Skip to main content

Price update on receipt takes a long time

Why does changing the price on a receipt with many linked issue notes take a long time, and what can be done about it

Written by Petr Pech

🚨 The following procedure is intended exclusively for on-premise (own server) operation and involves direct intervention in the database. It cannot be performed in the cloud on *.flexibee.eu. Do not attempt it without consulting our support team and without an up-to-date database backup.

Changing the price on a receipt note that is linked to a large number of issue notes can take an unreasonably long time. This is because the receipt note's price is used in many issue notes - the new price needs to be propagated to all related documents via FIFO links. In general, you need to wait for the price change to complete.

For on-premise users, a possible partial solution is described below, though it will take a similarly long time.

Procedure for on-premise data:

Before changing the price on the receipt note, you can disable the stock recalculation triggers, then after changing the price perform a manual stock recalculation (in the Tools module), and then re-enable the triggers.

General SQL:

alter table dpolsklad disable trigger user

⚠️ While the triggers are disabled (i.e., during the process described above), no other user may be connected, and no other work may be performed in Flexi.

Did this answer your question?