Do you need to delete an incorrectly created goods receipt, purchase invoice, or credit note — or an incorrectly created line item on one of these documents — and Flexi is returning an error?
First, let's explain why this error occurs:
The error only occurs when you attempt to delete a goods receipt — whether directly from the goods receipt itself, or from the associated purchase invoice or credit note.
It occurs when a line item on the relevant goods receipt has already been issued — meaning that the item received via the goods receipt you are trying to delete has since been issued via a goods issue document.
A link is created between the goods receipt line item and the goods issue line item (in the sfifovazby table — a so-called FIFO link), which prevents the goods receipt from being deleted. This link also serves to assign the appropriate cost price to the goods issue document (when using the FIFO inventory valuation method).
The error and the inability to delete the goods receipt (or its line item) is a safeguard against an unwanted negative quantity on the inventory card.
How do I get rid of an incorrectly created goods receipt/invoice?
There are only two ways to remove a goods receipt — delete it or reverse it. However, this is only possible if all associated linked goods issue documents are deleted first.
If only one unit of an item was received and therefore only one goods issue document is linked, this approach is feasible.
With larger data volumes — for example, if a goods receipt contains 100 units of a given item and 50 goods issue documents are linked to those 100 units — this approach is clearly not practical.
A downloadable add-on is available on our website that can locate all such linked goods issue documents.
How can I correct the inventory balance if deleting the goods receipt/invoice is not feasible?
There are several correction options, but they all essentially come down to correcting the incorrect inventory balance. This can always be achieved using a goods issue document.
How to correct the inventory balance when only a goods receipt with no linked invoice is involved?
Create a goods issue document. We recommend creating a goods issue with the movement type set to "Bare" issue and adding the relevant line item to it.
Create a stocktake — either in the desktop application or in the web interface. A stocktake simply generates the appropriate inventory adjustment document — either a goods receipt or a goods issue. In your case, it will generate only a goods issue. We recommend this option especially when the issue affects multiple line items.
How to correct the inventory balance when a goods receipt with a linked invoice is involved?
Both approaches described above can be used.
Create a credit note for the relevant purchase invoice. You can find this option in the actions menu above the purchase invoices agenda. The credit note will trigger an issue from inventory (by automatically generating a goods issue document), which will bring the inventory balance back to the correct value.
Warning
Never manually create a goods receipt with a negative quantity. If you do not enter exactly the correct price that should be assigned to the goods issue document at that time according to the applicable inventory valuation method, the inventory card will show incorrect inventory values in CZK (or EUR).
You will typically notice this situation when the inventory quantity for a given item reaches 0, yet the balance in CZK (or EUR) shows a positive or negative value.
To correct the inventory balance or delete a goods receipt/invoice, always use one of the approaches described above.

