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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

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

How to calculate remaining amount after prepayment

(0) ShareShare
ReportReport
Posted on by 40

Hi,

On sales order page I want to show

1. Prepayment amount to be paid

2. remaining amount to be paid after prepayment.

How to calculate above amounts after prepayment of x% is done. and show these amounts on posted sales invoice print layout?

Thanks in advance.

  • Bilal Haider Profile Picture
    487 on at

    Hi NancyPaul,

    Please elaborate what you mean by prepayment amount to be paid. Do you mean the amount for which prepayment invoice has been generated already and it is partially/ fully paid?

  • Suggested answer
    JAngle Profile Picture
    161 on at

    Amount to be paid will be based on the prepayment % assigned to the order. You could create a page extension to display this or if it’s needed in a report later create a table extension. I believe the “Statistics” page does some of the calculations you need. Lift the code from there.

    Layout wise you need to think about the invoice process. So you create invoices 1 to 1 from orders? You will need the “Order No.” field on the sales invoice header to create a link. The usual invoice and prepayment will have this in common. You can then draw that into your layout for the regular invoice which will be for whatever is left over anyway. So for example, total net value to invoice is 100. Prepay at 25% so that invoice is 25. Regular invoice will be 75 regardless as to whether the prepayment has been paid or not. AR process to ensure it is paid - no flag exists when you create the regular invoice.

  • NancyPaul Profile Picture
    40 on at

    Thank you so much for the reply Josh Anglesea.

    which statistic page you are talking about?from where should I check the code.?

  • NancyPaul Profile Picture
    40 on at

    Thank you so much Bilal Haider.

    if sales order total Amount is 200, prepayment % 10 then

    1. Prepayment amount to be paid must be 20

    2. remaining amount to be paid after prepayment must be 180

    How to calculate these amounts and use in sales invoice report and sales order page?

  • Suggested answer
    JAngle Profile Picture
    161 on at

    The sales order statistics page uses codeunit Sales-Post Prepayments which has two functions for getting the details on current prepayments for that order. Makes sense to use existing code where possible. The results of the function calls are stored in global page variables which are then displayed as fields.

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

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 569 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 375 Super User 2026 Season 2

#3
Grigorios Mavrogeorgis Profile Picture

Grigorios Mavrogeorgis 228 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans