fix: not able to submit LCV entry (#42303)

This commit is contained in:
rohitwaghchaure
2024-07-12 16:57:50 +05:30
committed by GitHub
parent b04da63aad
commit 9cf92eaeab
2 changed files with 49 additions and 0 deletions

View File

@@ -311,6 +311,18 @@ def check_if_in_list(gle, gl_map):
def toggle_debit_credit_if_negative(gl_map):
for entry in gl_map:
# toggle debit, credit if negative entry
if flt(entry.debit) < 0 and flt(entry.credit) < 0 and flt(entry.debit) == flt(entry.credit):
entry.credit *= -1
entry.debit *= -1
if (
flt(entry.debit_in_account_currency) < 0
and flt(entry.credit_in_account_currency) < 0
and flt(entry.debit_in_account_currency) == flt(entry.credit_in_account_currency)
):
entry.credit_in_account_currency *= -1
entry.debit_in_account_currency *= -1
if flt(entry.debit) < 0:
entry.credit = flt(entry.credit) - flt(entry.debit)
entry.debit = 0.0