From c33b5b74c6eee154531736eca428c8e3f3dc3c71 Mon Sep 17 00:00:00 2001 From: Neil Trini Lasrado Date: Fri, 29 Apr 2016 18:21:51 +0530 Subject: [PATCH] Itemwise purchase and Itemwise sales --- .../item_wise_purchase_register.py | 6 +++--- .../item_wise_sales_register/item_wise_sales_register.py | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/erpnext/accounts/report/item_wise_purchase_register/item_wise_purchase_register.py b/erpnext/accounts/report/item_wise_purchase_register/item_wise_purchase_register.py index 0eda1db01e..9e7cdb65d0 100644 --- a/erpnext/accounts/report/item_wise_purchase_register/item_wise_purchase_register.py +++ b/erpnext/accounts/report/item_wise_purchase_register/item_wise_purchase_register.py @@ -126,9 +126,9 @@ def get_tax_accounts(item_list, columns): for d in item_row_map.get(parent, {}).get(item_code, [])]) for d in item_row_map.get(parent, {}).get(item_code, []): - item_row_tax.setdefault(d.name, {})[account_head] = \ - flt((tax_amount * d.base_net_amount) / item_net_amount) - + item_tax_amount = flt((tax_amount * d.base_net_amount) / item_net_amount) if item_net_amount else 0 + item_row_tax.setdefault(d.name, {})[account_head] = item_tax_amount + except ValueError: continue elif charge_type == "Actual" and tax_amount: diff --git a/erpnext/accounts/report/item_wise_sales_register/item_wise_sales_register.py b/erpnext/accounts/report/item_wise_sales_register/item_wise_sales_register.py index df71350cc7..beca96e7f6 100644 --- a/erpnext/accounts/report/item_wise_sales_register/item_wise_sales_register.py +++ b/erpnext/accounts/report/item_wise_sales_register/item_wise_sales_register.py @@ -116,14 +116,14 @@ def get_tax_accounts(item_list, columns): for item_code, tax_amount in item_wise_tax_detail.items(): tax_amount = flt(tax_amount[1]) if isinstance(tax_amount, list) else flt(tax_amount) - + item_net_amount = sum([flt(d.base_net_amount) for d in item_row_map.get(parent, {}).get(item_code, [])]) for d in item_row_map.get(parent, {}).get(item_code, []): - item_row_tax.setdefault(d.name, {})[account_head] = \ - flt((tax_amount * d.base_net_amount) / item_net_amount) - + item_tax_amount = flt((tax_amount * d.base_net_amount) / item_net_amount) if item_net_amount else 0 + item_row_tax.setdefault(d.name, {})[account_head] = item_tax_amount + except ValueError: continue elif charge_type == "Actual" and tax_amount: