fix: don't get zero value entries for exchange rate calculation (#34475)

fix: don't get zero value entries for exchange rate calculation (#34475)

* fix: multiply None by float

* chore: remove debug

(cherry picked from commit 393bc25e2d)

Co-authored-by: Devin Slauenwhite <devin.slauenwhite@gmail.com>
This commit is contained in:
mergify[bot]
2023-03-28 16:58:22 +05:30
committed by GitHub
parent 477cb12240
commit ff24b3e40c

View File

@@ -490,6 +490,8 @@ def calculate_exchange_rate_using_last_gle(company, account, party_type, party):
conditions.append(gl.company == company)
conditions.append(gl.account == account)
conditions.append(gl.is_cancelled == 0)
conditions.append((gl.debit > 0) | (gl.credit > 0))
conditions.append((gl.debit_in_account_currency > 0) | (gl.credit_in_account_currency > 0))
if party_type:
conditions.append(gl.party_type == party_type)
if party: