refactor: cancel gain/loss JE on Journal as payment cancellation

This commit is contained in:
ruthra kumar
2023-07-11 12:21:10 +05:30
parent f119a1e115
commit 6e18bb6456
4 changed files with 39 additions and 13 deletions

View File

@@ -655,7 +655,7 @@ def cancel_exchange_gain_loss_journal(parent_doc: dict | object) -> None:
"""
Cancel Exchange Gain/Loss for Sales/Purchase Invoice, if they have any.
"""
if parent_doc.doctype in ["Sales Invoice", "Purchase Invoice", "Payment Entry"]:
if parent_doc.doctype in ["Sales Invoice", "Purchase Invoice", "Payment Entry", "Journal Entry"]:
journals = frappe.db.get_all(
"Journal Entry Account",
filters={