fix: make use of 'flt' to prevent really low precision exc gain/loss
This commit is contained in:
parent
8e7d47b3a7
commit
0aa72f841d
@ -46,6 +46,7 @@ from erpnext.accounts.party import (
|
|||||||
from erpnext.accounts.utils import (
|
from erpnext.accounts.utils import (
|
||||||
create_gain_loss_journal,
|
create_gain_loss_journal,
|
||||||
get_account_currency,
|
get_account_currency,
|
||||||
|
get_currency_precision,
|
||||||
get_fiscal_years,
|
get_fiscal_years,
|
||||||
validate_fiscal_year,
|
validate_fiscal_year,
|
||||||
)
|
)
|
||||||
@ -1291,10 +1292,12 @@ class AccountsController(TransactionBase):
|
|||||||
# These are generated by Sales/Purchase Invoice during reconciliation and advance allocation.
|
# These are generated by Sales/Purchase Invoice during reconciliation and advance allocation.
|
||||||
# and below logic is only for such scenarios
|
# and below logic is only for such scenarios
|
||||||
if args:
|
if args:
|
||||||
|
precision = get_currency_precision()
|
||||||
for arg in args:
|
for arg in args:
|
||||||
# Advance section uses `exchange_gain_loss` and reconciliation uses `difference_amount`
|
# Advance section uses `exchange_gain_loss` and reconciliation uses `difference_amount`
|
||||||
if (
|
if (
|
||||||
arg.get("difference_amount", 0) != 0 or arg.get("exchange_gain_loss", 0) != 0
|
flt(arg.get("difference_amount", 0), precision) != 0
|
||||||
|
or flt(arg.get("exchange_gain_loss", 0), precision) != 0
|
||||||
) and arg.get("difference_account"):
|
) and arg.get("difference_account"):
|
||||||
|
|
||||||
party_account = arg.get("account")
|
party_account = arg.get("account")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user