
When posting a sales order, I am trying to store the Quantity, Quantity Shipped and Quantity Remaining (Quantity - Quantity Shipped) on the lines of the shipment and invoice that are created from the posting process.
I have no trouble getting this working on the shipment lines using a simple OnBeforeInsert in a table extension for the "Sales Shipment Line" table.
I am having an issue with this on the Sales Invoice Lines but only when they user does a "Ship & Invoice" in a single action.
I have trawled through the source code of Code Unit 80 "Sales-Post" and can see there is a lot of buffering so when I try to get the "Qty Shipped" from the Sales Order Line in relation to the current Sales Invoice Line, the sales order line record hasn't actually been updated yet.
Can anyone offer a suggestion as to where I might be able to hook into this process?
The reason I am doing this is my customer wants to see back order quantities (remaining quantities) for each line on the sales shipment and sales invoice reports.