fix outstanding and floating point issue in gl entry

This commit is contained in:
Nabin Hait
2013-02-13 15:50:39 +05:30
parent a9545794aa
commit 362455e749
7 changed files with 48 additions and 6 deletions

View File

@@ -778,10 +778,10 @@ cur_frm.cscript.calc_doc_values = function(doc, tname, fname, other_fname) {
var calculate_outstanding = function(doc) {
// total amount to pay
doc.total_amount_to_pay = flt(flt(doc.net_total) + flt(doc.other_charges_added) - flt(doc.other_charges_deducted));
doc.total_amount_to_pay = flt(doc.grand_total) - flt(doc.write_off_amount);
// outstanding amount
if(doc.docstatus==0) doc.outstanding_amount = flt(doc.net_total) + flt(doc.other_charges_added) - flt(doc.other_charges_deducted) - flt(doc.total_advance);
if(doc.docstatus==0) doc.outstanding_amount = doc.total_amount_to_pay - flt(doc.total_advance);
refresh_many(['total_amount_to_pay', 'outstanding_amount']);
}