Skip to content

[main] - Incorrect Prepayment Invoice Amount for Sales Orders with Invoice Discount, Prices Including VAT and negative non-inventory line.#9656

Draft
v-ankitgoyal wants to merge 5 commits into
mainfrom
bugs/Bug-643210-Master-Incorrect-Prepmt-Inv.-Amt.-for-SO-with-Discount
Draft

[main] - Incorrect Prepayment Invoice Amount for Sales Orders with Invoice Discount, Prices Including VAT and negative non-inventory line.#9656
v-ankitgoyal wants to merge 5 commits into
mainfrom
bugs/Bug-643210-Master-Incorrect-Prepmt-Inv.-Amt.-for-SO-with-Discount

Conversation

@v-ankitgoyal

@v-ankitgoyal v-ankitgoyal commented Jul 22, 2026

Copy link
Copy Markdown

Fixes : AB#643210
Issue :- Incorrect Prepayment Invoice Amount for Sales Orders with Invoice Discount, Prices Including VAT and a negative non-inventory line (regression). The posted prepayment invoice is lower than the sum of the lines' "Prepmt. Line Amount".

Root cause :-
The UpdateDifferenceAmount correction (added for work item 612821) derived the expected prepayment from the header: SalesHeader.Amount * SalesHeader."Prepayment %". SalesHeader.Amount includes negative and non-prepayment lines, and the single header Prepayment % does not reflect per-line prepayment, so the base is too low. The valid prepayment is then misread as a rounding difference and subtracted from the last buffer line, understating the invoice.

Solutions :-
Compute the expected prepayment amount line by line from the actual prepayment lines, using each line's own Amount and Prepayment %, so negative/non-prepayment lines are excluded and mixed percentages are respected. The correction still only fires on a genuine rounding surplus.

@github-actions github-actions Bot added the SCM GitHub request for SCM area label Jul 22, 2026
@github-actions github-actions Bot modified the milestone: Version 29.0 Jul 22, 2026
@v-ankitgoyal v-ankitgoyal added Finance GitHub request for Finance area and removed SCM GitHub request for SCM area labels Jul 22, 2026
@github-actions github-actions Bot added SCM GitHub request for SCM area and removed Finance GitHub request for Finance area labels Jul 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

SCM GitHub request for SCM area

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant