Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Unanswered

Production Consumption Correction Bug

(0) ShareShare
ReportReport
Posted on by 5
Hello,
I don know where to publish this, it is a bug in original code, discovered by accident.
On one of our client database (Dynamics NAV 2016 CU 13) we have noticed that procedure Adjust cost – Item Entries posts new cost even if on new cost had been added to entry, it has posted milions already.
We recreated the condition on newest on-prem Bustiness Central W1 edition (CU 04 Dynamics 365 Business Central Spring 19 Update W1), and noticed that the bug is in this version also.
Bug is created when you correct more than a half production journal consumption, of one item, that has consumption that has been outputted in the same production order, and you have to have item tracking on consumed item.
Production output and consumption ticks Applied Entry to Adjust field in Item Ledger Entry that causes wrong entry to process when Adjusting Cost, and adding non-existing cost. Cost adjustment post new cost, when item Cost is Adjusted field is false, in Value Entry every time even if no new cost has been added to entry.
My opinion is that the bug appears in CU 99000830 Create Reserv. Entry  Function TransferReservEntry.
 Code:
//……
IF UseQtyToHandle THEN BEGIN // Used when handling Item Tracking
  QtyToHandleThisLine := OldReservEntry."Qty. to Handle (Base)";
  QtyToInvoiceThisLine := OldReservEntry."Qty. to Invoice (Base)";
  IF ABS(TransferQty) > ABS(QtyToHandleThisLine) THEN
    TransferQty := QtyToHandleThisLine;
  IF UseQtyToInvoice THEN BEGIN // Used when posting sales and purchase
    IF ABS(TransferQty) > ABS(QtyToInvoiceThisLine) THEN
      TransferQty := QtyToInvoiceThisLine;
  END;
END ELSE
  QtyToHandleThisLine := OldReservEntry."Quantity (Base)";
……//
 
In part in red we presume that both TransferQty and QtyToHandleThisLine have the same sign.
But when we post correction of the consumption TransferQty is positive and QtyToHandleThisLine is negative,
and with absolute comparison TransferQty becomes negative, and it creates wrong Item application Entry, that creates wrong postings.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
Sohail Ahmed Profile Picture

Sohail Ahmed 858

#2
YUN ZHU Profile Picture

YUN ZHU 773 Super User 2025 Season 1

#3
Mansi Soni Profile Picture

Mansi Soni 569

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans