chore: don't make gain/loss journal for base currency transactions

(cherry picked from commit 567c0ce1e8)
This commit is contained in:
ruthra kumar
2023-07-28 08:12:44 +05:30
committed by Mergify
parent efb293398a
commit ed0881dacb

View File

@@ -678,27 +678,28 @@ def reconcile_dr_cr_note(dr_cr_notes, company):
>>>>>>> c87332d5da (refactor: cr/dr note will be on single exchange rate) >>>>>>> c87332d5da (refactor: cr/dr note will be on single exchange rate)
jv.submit() jv.submit()
# make gain/loss journal if inv.difference_amount != 0:
if inv.party_type == "Customer": # make gain/loss journal
dr_or_cr = "credit" if inv.difference_amount < 0 else "debit" if inv.party_type == "Customer":
else: dr_or_cr = "credit" if inv.difference_amount < 0 else "debit"
dr_or_cr = "debit" if inv.difference_amount < 0 else "credit" else:
dr_or_cr = "debit" if inv.difference_amount < 0 else "credit"
reverse_dr_or_cr = "debit" if dr_or_cr == "credit" else "credit" reverse_dr_or_cr = "debit" if dr_or_cr == "credit" else "credit"
create_gain_loss_journal( create_gain_loss_journal(
company, company,
inv.party_type, inv.party_type,
inv.party, inv.party,
inv.account, inv.account,
inv.difference_account, inv.difference_account,
inv.difference_amount, inv.difference_amount,
dr_or_cr, dr_or_cr,
reverse_dr_or_cr, reverse_dr_or_cr,
inv.voucher_type, inv.voucher_type,
inv.voucher_no, inv.voucher_no,
None, None,
inv.against_voucher_type, inv.against_voucher_type,
inv.against_voucher, inv.against_voucher,
None, None,
) )