refactor(test): assert Exc journal when reconciling Journa to invoic
This commit is contained in:
parent
ee3ce82ea8
commit
389cadf157
@ -686,14 +686,24 @@ class TestPaymentReconciliation(FrappeTestCase):
|
|||||||
|
|
||||||
# Check if difference journal entry gets generated for difference amount after reconciliation
|
# Check if difference journal entry gets generated for difference amount after reconciliation
|
||||||
pr.reconcile()
|
pr.reconcile()
|
||||||
total_debit_amount = frappe.db.get_all(
|
total_credit_amount = frappe.db.get_all(
|
||||||
"Journal Entry Account",
|
"Journal Entry Account",
|
||||||
{"account": self.debtors_eur, "docstatus": 1, "reference_name": si.name},
|
{"account": self.debtors_eur, "docstatus": 1, "reference_name": si.name},
|
||||||
"sum(debit) as amount",
|
"sum(credit) as amount",
|
||||||
group_by="reference_name",
|
group_by="reference_name",
|
||||||
)[0].amount
|
)[0].amount
|
||||||
|
|
||||||
self.assertEqual(flt(total_debit_amount, 2), -500)
|
# total credit includes the exchange gain/loss amount
|
||||||
|
self.assertEqual(flt(total_credit_amount, 2), 8500)
|
||||||
|
|
||||||
|
jea_parent = frappe.db.get_all(
|
||||||
|
"Journal Entry Account",
|
||||||
|
filters={"account": self.debtors_eur, "docstatus": 1, "reference_name": si.name, "credit": 500},
|
||||||
|
fields=["parent"],
|
||||||
|
)[0]
|
||||||
|
self.assertEqual(
|
||||||
|
frappe.db.get_value("Journal Entry", jea_parent.parent, "voucher_type"), "Exchange Gain Or Loss"
|
||||||
|
)
|
||||||
|
|
||||||
def test_difference_amount_via_payment_entry(self):
|
def test_difference_amount_via_payment_entry(self):
|
||||||
# Make Sale Invoice
|
# Make Sale Invoice
|
||||||
|
|||||||
@ -1038,8 +1038,8 @@ class AccountsController(TransactionBase):
|
|||||||
# "reference_type": self.doctype,
|
# "reference_type": self.doctype,
|
||||||
# "reference_name": self.name,
|
# "reference_name": self.name,
|
||||||
# "reference_detail_no": arg.idx,
|
# "reference_detail_no": arg.idx,
|
||||||
reverse_dr_or_cr + "_in_account_currency": abs(arg.get("difference_amount")),
|
|
||||||
reverse_dr_or_cr: abs(arg.get("difference_amount")),
|
reverse_dr_or_cr: abs(arg.get("difference_amount")),
|
||||||
|
reverse_dr_or_cr + "_in_account_currency": 0,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user