Skip to content

Creating a Sales Shipment and Partial Invoicing for a Lot Enabled Item in Dynamics NAVHow to create a sales shipment and partial invoice for Lot enabled items in Dynamics NAV 2017

**UPDATED** August 30, 2018 to include code that Microsoft provided to correct this issue.
We have discovered a bug in Microsoft Dynamics NAV 2017 when creating a sales order for lot enabled items. To use this functionality, we have created a workaround so that you can create a sales order for a lot enabled item including the full shipment and partial invoice. This blog will walk through the steps required.

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:

  1. Create a Sales Order from the Home screen → Sales Orders → New
  2. Enter the all mandatory header information such as customer name and posting date details
  3. Select the Item no. in line level (ex: 80001)
  4. Enter the quantity 50
  5. Select the Item Tracking Entries from Lines → Related Information → Item Tracking Lines
  6. Select the Entries from the Item Tracking page action → select Entries. Press OK.

Figure 1 - Item Tracking Lines in Dynamics NAV 2017
Figure 1 - Item Tracking Lines in Dynamics NAV 2017

To create an Item Tracking Line with an invoiced quantity, simply:

  1. Post the Sales Order → select option Only Ship. Press OK. Sales order has shipped 50 quantities.
  2. Change the value in Quantity to invoice 5 and again post the Sales Order → select the option Only Invoice.
  3. Now the document is posted and the quantity invoiced equals 5.

Figure 2 - Item Tracking Lines with Invoiced Quantity
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
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
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.

Blog Tags: 
Read ArcherPoint's Blog Follow us on Twitter Follow us on Facebook Follow us on LinkedIn Link to our RSS feed Join us on Google+ Watch us on YouTube
Get Help Now