From 995b5c617b9236d13d96e8359c20c94b77824d2f Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 30 Nov 2012 19:40:37 +0530 Subject: [PATCH] Patch for fixing floating point issue in gl entry --- accounts/doctype/gl_control/gl_control.py | 3 +++ patches/patch_list.py | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/accounts/doctype/gl_control/gl_control.py b/accounts/doctype/gl_control/gl_control.py index 9dec4d5b0de..deb88f7d2f3 100644 --- a/accounts/doctype/gl_control/gl_control.py +++ b/accounts/doctype/gl_control/gl_control.py @@ -141,6 +141,9 @@ class DocType: # ---------------- def save_entries(self, cancel, adv_adj, update_outstanding): for le in self.entries: + # round off upto 2 decimal + le.debit, le.credit = round(le.debit, 2), round(le.credit, 2) + #toggle debit, credit if negative entry if flt(le.debit) < 0 or flt(le.credit) < 0: tmp=le.debit diff --git a/patches/patch_list.py b/patches/patch_list.py index 93fc08d1450..1e54d5b9b5c 100644 --- a/patches/patch_list.py +++ b/patches/patch_list.py @@ -701,4 +701,8 @@ patch_list = [ 'patch_module': 'patches.november_2012', 'patch_file': 'production_order_patch', }, + { + 'patch_module': 'patches.november_2012', + 'patch_file': 'gle_floating_point_issue', + }, ] \ No newline at end of file