Skip to content

Commit

Permalink
fix: don't set default payment amount in case of invoice return (back…
Browse files Browse the repository at this point in the history
…port #35645) (#35648)

* fix: don't set default payment amount in case of invoice return (#35645)

(cherry picked from commit 79483cc)

# Conflicts:
#	erpnext/public/js/controllers/taxes_and_totals.js

* chore: fixing conflict

---------

Co-authored-by: Anand Baburajan <anandbaburajan@gmail.com>
  • Loading branch information
mergify[bot] and anandbaburajan committed Jun 12, 2023
1 parent 1b69b37 commit 8e3636f
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 @@ -764,11 +764,13 @@ erpnext.taxes_and_totals = erpnext.payments.extend({
precision("base_grand_total")
);
}
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 8e3636f

Please sign in to comment.