web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

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

Sales Order Prepayment Amount Not Updated After Sales Credit Memo — Divide by Zero Error

(0) ShareShare
ReportReport
Posted on by 131

Hello everyone,

I’m facing an issue with Sales Order prepayments and credit memos in Microsoft Dynamics 365 Business Central and would appreciate any guidance.

Here is the scenario:

  1. I created a Sales Order with 4 sales lines, with 100 quantity on each line.
  2. Initially, I set Prepayment % = 100% on Line 1 and Line 3 and posted the corresponding Prepayment Invoices.
  3. Later, I also set Prepayment % = 100% on Line 2 and Line 4 and posted the Prepayment Invoice for those lines.
  4. I then started invoicing Line 1 partially, in three separate Sales Invoices:
    • 25 Qty
    • 25 Qty
    • 50 Qty
  5. Later, I needed to cancel these posted Sales Invoices, so I created and posted Sales Credit Memos against all three invoices.
  6. After posting the credit memos, when I try to create/post the Sales Invoice again for Line 1, I receive a "Divide by Zero" error.

After investigating, I noticed that the Prepayment Amount Deducted on the sales line is not being updated/recalculated after posting the Sales Credit Memo.

Interestingly, this issue occurs only for Line 1 and Line 3, where the prepayment was posted initially.

When I performed the same process with Line 2 and Line 4—i.e., invoicing partially, posting the Sales Credit Memo, and then invoicing again—the Prepayment Amount Deducted is updated correctly, and I do not get the Divide by Zero error.

My Questions

  • Has anyone encountered this issue with Sales Order Prepayments and Sales Credit Memos in Business Central?
  • Is there a specific standard process or setup that needs to be followed when cancelling invoices that have prepayments applied?
  • Why would Prepayment Amount Deducted be updated correctly for Lines 2 and 4 but not for Lines 1 and 3?
  • Could this be a standard Business Central bug, or is there a specific field/table/event that needs to be handled when posting the Sales Credit Memo?
  • Has anyone faced the Divide by Zero error in a similar prepayment scenario, and if so, how did you resolve it?

Any suggestions regarding the relevant standard codeunits, tables, or posting routines that I should investigate would also be very helpful.

Thanks in advance!

Suketu Piprotar

I have the same question (0)

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 518 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 362 Super User 2026 Season 2

#3
Grigorios Mavrogeorgis Profile Picture

Grigorios Mavrogeorgis 327 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans