Merge pull request #25086 from deepeshgarg007/advance_amount_precision
fix: Precision issues while allocating advance amount
This commit is contained in:
commit
df9388aa8e
@ -127,7 +127,6 @@
|
|||||||
"write_off_cost_center",
|
"write_off_cost_center",
|
||||||
"advances_section",
|
"advances_section",
|
||||||
"allocate_advances_automatically",
|
"allocate_advances_automatically",
|
||||||
"adjust_advance_taxes",
|
|
||||||
"get_advances",
|
"get_advances",
|
||||||
"advances",
|
"advances",
|
||||||
"payment_schedule_section",
|
"payment_schedule_section",
|
||||||
@ -1326,13 +1325,6 @@
|
|||||||
"label": "Project",
|
"label": "Project",
|
||||||
"options": "Project"
|
"options": "Project"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"default": "0",
|
|
||||||
"description": "Taxes paid while advance payment will be adjusted against this invoice",
|
|
||||||
"fieldname": "adjust_advance_taxes",
|
|
||||||
"fieldtype": "Check",
|
|
||||||
"label": "Adjust Advance Taxes"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"depends_on": "eval:doc.is_internal_supplier",
|
"depends_on": "eval:doc.is_internal_supplier",
|
||||||
"description": "Unrealized Profit / Loss account for intra-company transfers",
|
"description": "Unrealized Profit / Loss account for intra-company transfers",
|
||||||
@ -1378,7 +1370,7 @@
|
|||||||
"idx": 204,
|
"idx": 204,
|
||||||
"is_submittable": 1,
|
"is_submittable": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2021-03-09 21:12:30.422084",
|
"modified": "2021-03-30 21:45:58.334107",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Accounts",
|
"module": "Accounts",
|
||||||
"name": "Purchase Invoice",
|
"name": "Purchase Invoice",
|
||||||
|
@ -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."""))
|
throw(_("""Payment Entry has been modified after you pulled it. Please pull it again."""))
|
||||||
|
|
||||||
def validate_allocated_amount(args):
|
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:
|
if args.get("allocated_amount") < 0:
|
||||||
throw(_("Allocated amount cannot be negative"))
|
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"))
|
throw(_("Allocated amount cannot be greater than unadjusted amount"))
|
||||||
|
|
||||||
def update_reference_in_journal_entry(d, jv_obj):
|
def update_reference_in_journal_entry(d, jv_obj):
|
||||||
|
@ -659,6 +659,7 @@ class AccountsController(TransactionBase):
|
|||||||
'dr_or_cr': dr_or_cr,
|
'dr_or_cr': dr_or_cr,
|
||||||
'unadjusted_amount': flt(d.advance_amount),
|
'unadjusted_amount': flt(d.advance_amount),
|
||||||
'allocated_amount': flt(d.allocated_amount),
|
'allocated_amount': flt(d.allocated_amount),
|
||||||
|
'precision': d.precision('advance_amount'),
|
||||||
'exchange_rate': (self.conversion_rate
|
'exchange_rate': (self.conversion_rate
|
||||||
if self.party_account_currency != self.company_currency else 1),
|
if self.party_account_currency != self.company_currency else 1),
|
||||||
'grand_total': (self.base_grand_total
|
'grand_total': (self.base_grand_total
|
||||||
|
Loading…
x
Reference in New Issue
Block a user