mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-29 18:04:46 +00:00
refactor: difference amt validation for same currency accounts
(cherry picked from commit ec075122b6)
This commit is contained in:
@@ -349,6 +349,11 @@ class TestPaymentReconciliation(FrappeTestCase):
|
|||||||
invoices = [x.as_dict() for x in pr.get("invoices")]
|
invoices = [x.as_dict() for x in pr.get("invoices")]
|
||||||
payments = [x.as_dict() for x in pr.get("payments")]
|
payments = [x.as_dict() for x in pr.get("payments")]
|
||||||
pr.allocate_entries(frappe._dict({"invoices": invoices, "payments": payments}))
|
pr.allocate_entries(frappe._dict({"invoices": invoices, "payments": payments}))
|
||||||
|
|
||||||
|
# Difference amount should not be calculated for base currency accounts
|
||||||
|
for row in pr.allocation:
|
||||||
|
self.assertEqual(flt(row.get("difference_amount")), 0.0)
|
||||||
|
|
||||||
pr.reconcile()
|
pr.reconcile()
|
||||||
|
|
||||||
si.reload()
|
si.reload()
|
||||||
@@ -390,6 +395,11 @@ class TestPaymentReconciliation(FrappeTestCase):
|
|||||||
invoices = [x.as_dict() for x in pr.get("invoices")]
|
invoices = [x.as_dict() for x in pr.get("invoices")]
|
||||||
payments = [x.as_dict() for x in pr.get("payments")]
|
payments = [x.as_dict() for x in pr.get("payments")]
|
||||||
pr.allocate_entries(frappe._dict({"invoices": invoices, "payments": payments}))
|
pr.allocate_entries(frappe._dict({"invoices": invoices, "payments": payments}))
|
||||||
|
|
||||||
|
# Difference amount should not be calculated for base currency accounts
|
||||||
|
for row in pr.allocation:
|
||||||
|
self.assertEqual(flt(row.get("difference_amount")), 0.0)
|
||||||
|
|
||||||
pr.reconcile()
|
pr.reconcile()
|
||||||
|
|
||||||
# check PR tool output
|
# check PR tool output
|
||||||
@@ -414,6 +424,11 @@ class TestPaymentReconciliation(FrappeTestCase):
|
|||||||
invoices = [x.as_dict() for x in pr.get("invoices")]
|
invoices = [x.as_dict() for x in pr.get("invoices")]
|
||||||
payments = [x.as_dict() for x in pr.get("payments")]
|
payments = [x.as_dict() for x in pr.get("payments")]
|
||||||
pr.allocate_entries(frappe._dict({"invoices": invoices, "payments": payments}))
|
pr.allocate_entries(frappe._dict({"invoices": invoices, "payments": payments}))
|
||||||
|
|
||||||
|
# Difference amount should not be calculated for base currency accounts
|
||||||
|
for row in pr.allocation:
|
||||||
|
self.assertEqual(flt(row.get("difference_amount")), 0.0)
|
||||||
|
|
||||||
pr.reconcile()
|
pr.reconcile()
|
||||||
|
|
||||||
# assert outstanding
|
# assert outstanding
|
||||||
@@ -450,6 +465,11 @@ class TestPaymentReconciliation(FrappeTestCase):
|
|||||||
invoices = [x.as_dict() for x in pr.get("invoices")]
|
invoices = [x.as_dict() for x in pr.get("invoices")]
|
||||||
payments = [x.as_dict() for x in pr.get("payments")]
|
payments = [x.as_dict() for x in pr.get("payments")]
|
||||||
pr.allocate_entries(frappe._dict({"invoices": invoices, "payments": payments}))
|
pr.allocate_entries(frappe._dict({"invoices": invoices, "payments": payments}))
|
||||||
|
|
||||||
|
# Difference amount should not be calculated for base currency accounts
|
||||||
|
for row in pr.allocation:
|
||||||
|
self.assertEqual(flt(row.get("difference_amount")), 0.0)
|
||||||
|
|
||||||
pr.reconcile()
|
pr.reconcile()
|
||||||
|
|
||||||
self.assertEqual(pr.get("invoices"), [])
|
self.assertEqual(pr.get("invoices"), [])
|
||||||
|
|||||||
Reference in New Issue
Block a user