mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-31 10:49:09 +00:00
fix outstanding and floating point issue in gl entry
This commit is contained in:
@@ -423,7 +423,7 @@ class DocType(BuyingController):
|
||||
self.get_gl_dict({
|
||||
"account": self.doc.credit_to,
|
||||
"against": self.doc.against_expense_account,
|
||||
"credit": self.doc.grand_total,
|
||||
"credit": self.doc.total_amount_to_pay,
|
||||
"remarks": self.doc.remarks,
|
||||
"against_voucher": self.doc.name,
|
||||
"against_voucher_type": self.doc.doctype,
|
||||
|
||||
@@ -76,8 +76,9 @@ cur_frm.cscript.add_deduct_tax = function(doc, cdt, cdn) {
|
||||
alert("Please select Category first");
|
||||
d.add_deduct_tax = '';
|
||||
}
|
||||
else if(d.category != 'Total' && d.add_deduct_tax == 'Deduct'){
|
||||
alert("You cannot Deduct when category is for valuation or for both(i.e total and valuation)");
|
||||
else if(d.category != 'Total' && d.add_deduct_tax == 'Deduct') {
|
||||
console.log([d.category, d.add_deduct_tax]);
|
||||
msgprint("You cannot deduct when category is for 'Valuation' or 'Valuation and Total'");
|
||||
d.add_deduct_tax = '';
|
||||
}
|
||||
|
||||
|
||||
@@ -70,6 +70,10 @@ def save_entries(gl_map, cancel, adv_adj, update_outstanding):
|
||||
for entry in gl_map:
|
||||
gle = Document('GL Entry', fielddata=entry)
|
||||
|
||||
# round off upto 2 decimal
|
||||
gle.debit = flt(gle.debit, 2)
|
||||
gle.credit = flt(gle.credit, 2)
|
||||
|
||||
# toggle debit, credit if negative entry
|
||||
if flt(gle.debit) < 0 or flt(gle.credit) < 0:
|
||||
_swap(gle)
|
||||
|
||||
Reference in New Issue
Block a user