fix: Precision issues while allocating advance amoount
This commit is contained in:
parent
f114da2f67
commit
f54d596ae1
@ -406,9 +406,10 @@ def check_if_advance_entry_modified(args):
|
||||
throw(_("""Payment Entry has been modified after you pulled it. Please pull it again."""))
|
||||
|
||||
def validate_allocated_amount(args):
|
||||
precision = args.get('precision') or frappe.db.get_single_value("System Settings", "currency_precision")
|
||||
if args.get("allocated_amount") < 0:
|
||||
throw(_("Allocated amount cannot be negative"))
|
||||
elif args.get("allocated_amount") > args.get("unadjusted_amount"):
|
||||
elif flt(args.get("allocated_amount"), precision) > flt(args.get("unadjusted_amount"), precision):
|
||||
throw(_("Allocated amount cannot be greater than unadjusted amount"))
|
||||
|
||||
def update_reference_in_journal_entry(d, jv_obj):
|
||||
|
@ -656,6 +656,7 @@ class AccountsController(TransactionBase):
|
||||
'dr_or_cr': dr_or_cr,
|
||||
'unadjusted_amount': flt(d.advance_amount),
|
||||
'allocated_amount': flt(d.allocated_amount),
|
||||
'precision': d.precision('advance_amount'),
|
||||
'exchange_rate': (self.conversion_rate
|
||||
if self.party_account_currency != self.company_currency else 1),
|
||||
'grand_total': (self.base_grand_total
|
||||
|
Loading…
Reference in New Issue
Block a user