fix: account payable currency and value (#36859)
* fix: account payable currency and value
* fix: added party_type and party in accounts payable report
* chore: code cleanup
* fix: customer group test case failure
* fix: added test case of the issue
* fix: filter toggle for party_type
* fix: filter toggle for party_type
* chore: fix typo
---------
Co-authored-by: ruthra kumar <ruthra@erpnext.com>
diff --git a/erpnext/accounts/test/accounts_mixin.py b/erpnext/accounts/test/accounts_mixin.py
index bf01362..0868860 100644
--- a/erpnext/accounts/test/accounts_mixin.py
+++ b/erpnext/accounts/test/accounts_mixin.py
@@ -126,6 +126,28 @@
acc = frappe.get_doc("Account", name)
self.debtors_usd = acc.name
+ def create_usd_payable_account(self):
+ account_name = "Creditors USD"
+ if not frappe.db.get_value(
+ "Account", filters={"account_name": account_name, "company": self.company}
+ ):
+ acc = frappe.new_doc("Account")
+ acc.account_name = account_name
+ acc.parent_account = "Accounts Payable - " + self.company_abbr
+ acc.company = self.company
+ acc.account_currency = "USD"
+ acc.account_type = "Payable"
+ acc.insert()
+ else:
+ name = frappe.db.get_value(
+ "Account",
+ filters={"account_name": account_name, "company": self.company},
+ fieldname="name",
+ pluck=True,
+ )
+ acc = frappe.get_doc("Account", name)
+ self.creditors_usd = acc.name
+
def clear_old_entries(self):
doctype_list = [
"GL Entry",