Skip to content

fix(accounts): set payment term outstanding when invoice portion is zero - #59712

Open
Sudharsanan11 wants to merge 4 commits into
frappe:developfrom
aerele:fix/payment-schedule-outstanding-zero-portion
Open

Sudharsanan11 wants to merge 4 commits into
frappe:developfrom
aerele:fix/payment-schedule-outstanding-zero-portion

Conversation

@Sudharsanan11

@Sudharsanan11 Sudharsanan11 commented Oct 1, 2026 •

Copy link
Copy Markdown
Collaborator

Issue

When a Payment Schedule row is added manually with Invoice Portion left at 0 and a Payment Amount entered, outstanding is saved as 0 while payment_amount and base_outstanding hold the full amount. Payment Entry skips terms whose outstanding is below 0.1 when allocating against payment terms, so such rows can never be allocated.

Steps to replicate

  1. Create a Purchase Invoice (or Sales Invoice) with no Payment Terms Template.
  2. In Payment Schedule, add one row. Set Due Date and Payment Amount to the grand total. Leave Invoice Portion at 0.
  3. Save and submit.
  4. Compare the row's outstanding with payment_amount and with the invoice outstanding_amount.

Current behaviour: outstanding is 0. payment_amount and base_outstanding equal the grand total, and the invoice outstanding_amount is also the grand total with paid_amount 0.

Expected behaviour: outstanding equals payment_amount, the same way it does when Invoice Portion is set.

Ref: #79701

@greptile-apps

greptile-apps Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 4/5

[Medium risk] Fixes payment term calculations when invoice portion is zero.

The PR should not merge until the party-specific item query’s change to MariaDB results is addressed under the repository requirement.

Reviews (2) · Last reviewed commit: "test(accounts): cover base amounts for z..."

Comment thread erpnext/accounts/services/payment_schedule.py
Comment thread erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py
@Sudharsanan11
Sudharsanan11 marked this pull request as draft October 1, 2026 09:31
@Sudharsanan11
Sudharsanan11 force-pushed the fix/payment-schedule-outstanding-zero-portion branch from e104664 to 43c080d Compare October 1, 2026 10:01
@Sudharsanan11
Sudharsanan11 marked this pull request as ready for review October 1, 2026 10:01

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants