Sales Shipment and Partial Invoicing for Lot Enabled Items in Dynamics NAV 2017
Before getting started, be sure that your item is an enabled lot and that you have enough stock in two different lots.
The following example, which illustrates the effect of the shipment, is based on the following scenario for an item that uses the lot. To get started:
- Create a Sales Order from the Home screen → Sales Orders → New
- Enter the all mandatory header information such as customer name and posting date details
- Select the Item no. in line level (ex: 80001)
- Enter the quantity 50
- Select the Item Tracking Entries from Lines → Related Information → Item Tracking Lines
- Select the Entries from the Item Tracking page action → select Entries. Press OK.
Figure 1 – Item Tracking Lines in Dynamics NAV 2017
To create an Item Tracking Line with an invoiced quantity, simply:
- Post the Sales Order → select option Only Ship. Press OK. Sales order has shipped 50 quantities.
- Change the value in Quantity to invoice 5 and again post the Sales Order → select the option Only Invoice.
- Now the document is posted and the quantity invoiced equals 5.
Figure 2 – Item Tracking Lines with Invoiced Quantity
To ensure there are no tracking lines issues:
Check the item tracking lines from Lines → Related Information → Item Tracking Lines → Quantity invoiced (base) value is 10. That is wrong. It should be 5.
Figure 3 – Error While Posting Sales Invoice
Check the item tracking lines from Lines → Related Information → Item Tracking Lines. Then try to modify the Quantity to Invoice (base), and the system throws the error.
Figure 4 – Item Tracking Line, Modify Quantity
We have also tested this workaround with the latest cumulative update of Dynamics NAV 2018 and it was not working. We have reported this issue to Microsoft. We will post an updated blog once we receive update from them. Until we know the bug has been fixed, if you have a transaction like this please update Item Tracking Manually before partially invoicing.
**Microsoft provided a fix in the latest cumulative update of Microsoft Dynamics NAV 2017**
Modify code as follows to correct this issue and avoid the workaround. Make the changes noted in OBJECT to codeunit 6500 Item Tracking Management and function RetrieveInvoiceSpecification.
———- Before (BEFORE) ———- Codeunit 6500 ———- Function RetrieveInvoiceSpecification
            TempInvoicingSpecification.”Qty. to Invoice” :=
             ROUND(TempInvoicingSpecification.”Qty. to Invoice (Base)” /
               SourceSpecification.”Qty. per Unit of Measure”,0.00001);
–Â Â Â Â Â Â Â Â Â Â TotalQtyToInvoiceBase += TempInvoicingSpecification.”Qty. to Invoice (Base)”;
           TempInvoicingSpecification.INSERT;
         END;
       UNTIL TrackingSpecification.NEXT = 0;
———- After (AFTER) ——————————————————
           TempInvoicingSpecification.”Qty. to Invoice” :=
             ROUND(TempInvoicingSpecification.”Qty. to Invoice (Base)” /
               SourceSpecification.”Qty. per Unit of Measure”,0.00001);
+
+Â Â Â Â Â Â Â Â Â Â IF ABS(TotalQtyToInvoiceBase + TempInvoicingSpecification.”Qty. to Invoice (Base)”) >
+Â Â Â Â Â Â Â Â Â Â Â Â Â ABS(SourceSpecification.”Qty. to Invoice (Base)”)
+Â Â Â Â Â Â Â Â Â Â THEN BEGIN
+Â Â Â Â Â Â Â Â Â Â Â Â TempInvoicingSpecification.”Qty. to Invoice (Base)” :=
+Â Â Â Â Â Â Â Â Â Â Â Â Â Â SourceSpecification.”Qty. to Invoice (Base)” – TotalQtyToInvoiceBase;
+Â Â Â Â Â Â Â Â Â Â Â Â TotalQtyToInvoiceBase := SourceSpecification.”Qty. to Invoice (Base)”;
+Â Â Â Â Â Â Â Â Â Â END ELSE
+Â Â Â Â Â Â Â Â Â Â Â Â TotalQtyToInvoiceBase += TempInvoicingSpecification.”Qty. to Invoice (Base)”;
           TempInvoicingSpecification.INSERT;
         END;
       UNTIL TrackingSpecification.NEXT = 0;
——————————————————————————–
Â
If you have questions about this issue or any development related issue in Microsoft Dynamics NAV, please visit our website and be sure to subscribe to our developer blogs to stay abreast of Dynamics NAV developer related blogs.