item-wise price list rate, editable report

This commit is contained in:
Nabin Hait
2013-09-25 10:32:51 +05:30
parent 04a3feecf6
commit 625da79e9f
16 changed files with 63 additions and 80 deletions

View File

@@ -268,17 +268,15 @@ def get_stock_and_account_difference(account_list=None, posting_date=None):
if not posting_date: posting_date = nowdate()
account_warehouse_map = {}
difference = {}
warehouse_account = webnotes.conn.sql("""select name, account from tabWarehouse
where account in (%s)""" % ', '.join(['%s']*len(account_list)), account_list, as_dict=1)
for wh in warehouse_account:
account_warehouse_map.setdefault(wh.account, []).append(wh.name)
account_warehouse = dict(webnotes.conn.sql("""select name, master_name from tabAccount
where account_type = 'Warehouse' and ifnull(master_name, '') != ''
and name in (%s)""" % ', '.join(['%s']*len(account_list)), account_list))
for account, warehouse_list in account_warehouse_map.items():
for account, warehouse in account_warehouse.items():
account_balance = get_balance_on(account, posting_date)
stock_value = get_stock_balance_on(warehouse_list, posting_date)
stock_value = get_stock_balance_on(warehouse, posting_date)
if abs(flt(stock_value) - flt(account_balance)) > 0.005:
difference.setdefault(account, flt(stock_value) - flt(account_balance))