Merge pull request #6039 from rohitwaghchaure/allow_to_edit_change_amount

Allow to edit change amount
This commit is contained in:
Nabin Hait
2016-08-17 17:08:54 +05:30
committed by GitHub
14 changed files with 386 additions and 145 deletions

View File

@@ -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)
}
})