Skip to content

Commit

Permalink
fix: don't set default payment amount in case of invoice return (#35645)
Browse files Browse the repository at this point in the history
  • Loading branch information
anandbaburajan committed Jun 12, 2023
1 parent 81ef2ba commit 79483cc
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions erpnext/public/js/controllers/taxes_and_totals.js
Original file line number Diff line number Diff line change
Expand Up @@ -805,11 +805,13 @@ erpnext.taxes_and_totals = class TaxesAndTotals extends erpnext.payments {
);
}

this.frm.doc.payments.find(pay => {
if (pay.default) {
pay.amount = total_amount_to_pay;
}
});
if(!this.frm.doc.is_return){
this.frm.doc.payments.find(payment => {
if (payment.default) {
payment.amount = total_amount_to_pay;
}
});
}

this.frm.refresh_fields();
}
Expand Down

0 comments on commit 79483cc

Please sign in to comment.