Compare commits

..

2 Commits

Author SHA1 Message Date
Deepesh Garg
a3b8735222 fix: Values with same account and different account number in consolidated balance sheet report (#27493)
(cherry picked from commit 625626b973)

# Conflicts:
#	erpnext/accounts/report/consolidated_financial_statement/consolidated_financial_statement.py
2025-02-24 00:11:56 +00:00
mergify[bot]
f5160dc83d fix: use Stock Qty while getting POS Reserved Qty (backport #38962) (#38983)
fix: use `Stock Qty` while getting `POS Reserved Qty`

(cherry picked from commit 7223106417)

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2023-12-28 12:00:04 +05:30
3 changed files with 29 additions and 3 deletions

View File

@@ -4,7 +4,7 @@ import frappe
from erpnext.hooks import regional_overrides
__version__ = "13.55.2"
__version__ = "13.54.4"
def get_default_company(user=None):

View File

@@ -704,7 +704,7 @@ def get_pos_reserved_qty(item_code, warehouse):
reserved_qty = (
frappe.qb.from_(p_inv)
.from_(p_item)
.select(Sum(p_item.qty).as_("qty"))
.select(Sum(p_item.stock_qty).as_("stock_qty"))
.where(
(p_inv.name == p_item.parent)
& (IfNull(p_inv.consolidated_invoice, "") == "")
@@ -715,7 +715,7 @@ def get_pos_reserved_qty(item_code, warehouse):
)
).run(as_dict=True)
return reserved_qty[0].qty or 0 if reserved_qty else 0
return flt(reserved_qty[0].stock_qty) if reserved_qty else 0
@frappe.whitelist()

View File

@@ -400,12 +400,20 @@ def calculate_values(accounts_by_name, gl_entries_by_account, companies, filters
for entries in gl_entries_by_account.values():
for entry in entries:
if entry.account_number:
<<<<<<< HEAD
account_name = entry.account_number + " - " + entry.account_name
else:
account_name = entry.account_name
d = accounts_by_name.get(account_name)
=======
account_name = entry.account_number + ' - ' + entry.account_name
else:
account_name = entry.account_name
d = accounts_by_name.get(account_name)
>>>>>>> 625626b973 (fix: Values with same account and different account number in consolidated balance sheet report (#27493))
if d:
debit, credit = 0, 0
for company in companies:
@@ -482,9 +490,15 @@ def update_parent_account_names(accounts):
for d in accounts:
if d.account_number:
<<<<<<< HEAD
account_name = d.account_number + " - " + d.account_name
else:
account_name = d.account_name
=======
account_name = d.account_number + ' - ' + d.account_name
else:
account_name = d.account_name
>>>>>>> 625626b973 (fix: Values with same account and different account number in consolidated balance sheet report (#27493))
name_to_account_map[d.name] = account_name
for account in accounts:
@@ -660,9 +674,15 @@ def set_gl_entries_by_account(
for entry in gl_entries:
if entry.account_number:
<<<<<<< HEAD
account_name = entry.account_number + " - " + entry.account_name
else:
account_name = entry.account_name
=======
account_name = entry.account_number + ' - ' + entry.account_name
else:
account_name = entry.account_name
>>>>>>> 625626b973 (fix: Values with same account and different account number in consolidated balance sheet report (#27493))
validate_entries(account_name, entry, accounts_by_name, accounts)
gl_entries_by_account.setdefault(account_name, []).append(entry)
@@ -770,10 +790,16 @@ def filter_accounts(accounts, depth=10):
accounts_by_name = {}
for d in accounts:
if d.account_number:
<<<<<<< HEAD
account_name = d.account_number + " - " + d.account_name
else:
account_name = d.account_name
d["company_wise_opening_bal"] = defaultdict(float)
=======
account_name = d.account_number + ' - ' + d.account_name
else:
account_name = d.account_name
>>>>>>> 625626b973 (fix: Values with same account and different account number in consolidated balance sheet report (#27493))
accounts_by_name[account_name] = d
parent_children_map.setdefault(d.parent_account or None, []).append(d)