mirror of
https://github.com/frappe/erpnext.git
synced 2026-09-19 11:27:55 +00:00
Merge pull request #6039 from rohitwaghchaure/allow_to_edit_change_amount
Allow to edit change amount
This commit is contained in:
@@ -615,4 +615,18 @@ erpnext.taxes_and_totals = erpnext.payments.extend({
|
||||
this.frm.doc.base_change_amount = flt(this.frm.doc.change_amount * this.frm.doc.conversion_rate,
|
||||
precision("base_change_amount"));
|
||||
},
|
||||
|
||||
calculate_write_off_amount: function(){
|
||||
if(this.frm.doc.paid_amount > this.frm.doc.grand_total){
|
||||
this.frm.doc.write_off_amount = flt(this.frm.doc.grand_total - this.frm.doc.paid_amount + this.frm.doc.change_amount,
|
||||
precision("write_off_amount"))
|
||||
|
||||
this.frm.doc.base_write_off_amount = flt(this.frm.doc.write_off_amount * this.frm.doc.conversion_rate,
|
||||
precision("base_write_off_amount"));
|
||||
}else{
|
||||
this.frm.doc.paid_amount = 0.0
|
||||
}
|
||||
|
||||
this.calculate_outstanding_amount(false)
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user