mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-27 17:04:47 +00:00
item-wise price list rate, editable report
This commit is contained in:
@@ -19,10 +19,9 @@ class DocType:
|
||||
webnotes.conn.get_value("Account", self.doc.account, "debit_or_credit").lower() or ""
|
||||
|
||||
def get_voucher_details(self):
|
||||
|
||||
total_amount = webnotes.conn.sql("""select sum(%s) from `tabGL Entry`
|
||||
where voucher_type = %s and voucher_no = %s
|
||||
and account = %s and ifnull(is_cancelled, 'No') = 'No'""" %
|
||||
and account = %s""" %
|
||||
(self.doc.account_type, '%s', '%s', '%s'),
|
||||
(self.doc.voucher_type, self.doc.voucher_no, self.doc.account))
|
||||
|
||||
|
||||
@@ -52,8 +52,7 @@ def get_stock_ledger_entries(filters):
|
||||
query = """select item_code, voucher_type, voucher_no,
|
||||
voucher_detail_no, posting_date, posting_time, stock_value,
|
||||
warehouse, actual_qty as qty
|
||||
from `tabStock Ledger Entry`
|
||||
where ifnull(`is_cancelled`, 'No') = No'"""
|
||||
from `tabStock Ledger Entry`"""
|
||||
|
||||
if filters.get("company"):
|
||||
query += """ and company=%(company)s"""
|
||||
|
||||
@@ -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))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user