Merge pull request #43462 from vishakhdesai/journal-entry-issue

This commit is contained in:
Smit Vora
2024-10-22 19:34:31 +05:30
committed by GitHub
2 changed files with 7 additions and 3 deletions

View File

@@ -1575,12 +1575,16 @@ def compare_existing_and_expected_gle(existing_gle, expected_gle, precision):
return matched
def get_stock_accounts(company, voucher_type=None, voucher_no=None):
def get_stock_accounts(company, voucher_type=None, voucher_no=None, accounts=None):
stock_accounts = [
d.name
for d in frappe.db.get_all("Account", {"account_type": "Stock", "company": company, "is_group": 0})
]
if voucher_type and voucher_no:
if accounts:
stock_accounts = [row.account for row in accounts if row.account in stock_accounts]
elif voucher_type and voucher_no:
if voucher_type == "Journal Entry":
stock_accounts = [
d.account