Merge pull request #4838 from nabinhait/rounding_gle

[fix] GLE for Rounding loss allowed upto 1 for all transactions except JE
This commit is contained in:
Anand Doshi 2016-02-19 12:59:54 +05:30
commit 3bce3f412a

View File

@ -117,7 +117,13 @@ def round_off_debit_credit(gl_map):
debit_credit_diff += entry.debit - entry.credit debit_credit_diff += entry.debit - entry.credit
debit_credit_diff = flt(debit_credit_diff, precision) debit_credit_diff = flt(debit_credit_diff, precision)
if abs(debit_credit_diff) >= (5.0 / (10**precision)):
if gl_map[0]["voucher_type"] == "Journal Entry":
allowance = 5.0 / (10**precision)
else:
allowance = 1
if abs(debit_credit_diff) >= allowance:
frappe.throw(_("Debit and Credit not equal for {0} #{1}. Difference is {2}.") frappe.throw(_("Debit and Credit not equal for {0} #{1}. Difference is {2}.")
.format(gl_map[0].voucher_type, gl_map[0].voucher_no, debit_credit_diff)) .format(gl_map[0].voucher_type, gl_map[0].voucher_no, debit_credit_diff))