From 34af63cf51a256b1091f21c89d92493681d870d7 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Thu, 22 Nov 2012 18:28:12 +0530 Subject: [PATCH] convert account amount to float in voucher import --- accounts/page/voucher_import_tool/voucher_import_tool.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/accounts/page/voucher_import_tool/voucher_import_tool.py b/accounts/page/voucher_import_tool/voucher_import_tool.py index 4a94ad6bae..0fb3e70967 100644 --- a/accounts/page/voucher_import_tool/voucher_import_tool.py +++ b/accounts/page/voucher_import_tool/voucher_import_tool.py @@ -208,15 +208,17 @@ def get_data(rows, company_abbr): for acc_idx in xrange(len(accounts)): col_idx = len(columns) + acc_idx if flt(r[col_idx]) != 0: - acc_dict[accounts[acc_idx]] = r[col_idx] + if not acc_dict.get(accounts[acc_idx]): + acc_dict[accounts[acc_idx]] = 0 + acc_dict[accounts[acc_idx]] += flt(r[col_idx]) if flt(r[col_idx]) > 0: total_debit += flt(r[col_idx]) else: total_credit += abs(flt(r[col_idx])) - + d['total_debit'] = total_debit d['total_credit'] = total_credit - + data.append([d, acc_dict])