refactor(test): AR output filtered on USD customers
diff --git a/erpnext/accounts/report/accounts_payable/test_accounts_payable.py b/erpnext/accounts/report/accounts_payable/test_accounts_payable.py
index cb84cf4..3cf93cc 100644
--- a/erpnext/accounts/report/accounts_payable/test_accounts_payable.py
+++ b/erpnext/accounts/report/accounts_payable/test_accounts_payable.py
@@ -24,7 +24,7 @@
def tearDown(self):
frappe.db.rollback()
- def test_accounts_receivable_with_supplier(self):
+ def test_accounts_payable_for_foreign_currency_supplier(self):
pi = self.create_purchase_invoice(do_not_submit=True)
pi.currency = "USD"
pi.conversion_rate = 80
diff --git a/erpnext/accounts/report/accounts_receivable/test_accounts_receivable.py b/erpnext/accounts/report/accounts_receivable/test_accounts_receivable.py
index 0c7d931..b98916e 100644
--- a/erpnext/accounts/report/accounts_receivable/test_accounts_receivable.py
+++ b/erpnext/accounts/report/accounts_receivable/test_accounts_receivable.py
@@ -568,3 +568,40 @@
row.account_currency,
],
)
+
+ def test_usd_customer_filter(self):
+ filters = {
+ "company": self.company,
+ "party_type": "Customer",
+ "party": self.customer,
+ "report_date": today(),
+ "range1": 30,
+ "range2": 60,
+ "range3": 90,
+ "range4": 120,
+ }
+
+ si = self.create_sales_invoice(no_payment_schedule=True, do_not_submit=True)
+ si.currency = "USD"
+ si.conversion_rate = 80
+ si.debit_to = self.debtors_usd
+ si.save().submit()
+ name = si.name
+
+ # check invoice grand total and invoiced column's value for 3 payment terms
+ report = execute(filters)
+
+ expected = {
+ "voucher_type": si.doctype,
+ "voucher_no": si.name,
+ "party_account": self.debtors_usd,
+ "customer_name": self.customer,
+ "invoiced": 100.0,
+ "outstanding": 100.0,
+ "account_currency": "USD",
+ }
+ self.assertEqual(len(report[1]), 1)
+ report_output = report[1][0]
+ for field in expected:
+ with self.subTest(field=field):
+ self.assertEqual(report_output.get(field), expected.get(field))