Correct back order qty on AR Invoice
Client wants BO qty to print on invoice. Here's the problem/bug/my mistake.
Thereu2019s a field called u2018QtyToShipu2019, which is really the quantity left to ship, on every item row of an A/R doc in Business One.
Say we create a sales order for a quantity of 12 of some item. When the SO is created, the current document quantity and the QtyToShip are equal.
Hereu2019s the issue.
Say we copy our SO to a delivery note, revising the quantity to 5 because thatu2019s all we think we have on hand. The QtyToShip on the DN is set to 7. It is also automatically revised on the SO to 7. We donu2019t invoice the DN yet.
Thereafter somebody finds 7 more of the item and chooses to ship and invoice in one step. He copies the SO to an Invoice and adds the doc. The SO and the Invoice both show QtyToShip as 0. The DN above stays the same.
Now we still have to invoice the DN for 5. When it is copied to an Invoice, it drags its last known QtyToShip of 7 along with it. This second invoice shows 5 invoiced and 7 left to ship, but it should be 0 left to ship based on the original order qty.
I know I can painstakingly work my way back through all the docs to the original SO and do the math and compute the correct BO qty. But I hope I'm just picking the wrong field from inv1 for my invoice report.