mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-15 03:01:22 +00:00
fix: hardcoded precision causing decimal issues
This commit is contained in:
@@ -634,11 +634,11 @@ class SellingController(StockController):
|
||||
if allow_at_arms_length_price:
|
||||
continue
|
||||
|
||||
rate = flt(
|
||||
flt(d.incoming_rate, d.precision("incoming_rate")) * d.conversion_factor,
|
||||
d.precision("rate"),
|
||||
)
|
||||
if d.rate != rate:
|
||||
rate = flt(flt(d.incoming_rate) * flt(d.conversion_factor or 1.0))
|
||||
|
||||
if flt(d.rate, d.precision("incoming_rate")) != flt(
|
||||
rate, d.precision("incoming_rate")
|
||||
):
|
||||
d.rate = rate
|
||||
frappe.msgprint(
|
||||
_(
|
||||
|
||||
@@ -167,8 +167,11 @@ class calculate_taxes_and_totals:
|
||||
bill_for_rejected_quantity_in_purchase_invoice = frappe.get_single_value(
|
||||
"Buying Settings", "bill_for_rejected_quantity_in_purchase_invoice"
|
||||
)
|
||||
|
||||
do_not_round_fields = ["valuation_rate", "incoming_rate"]
|
||||
|
||||
for item in self.doc.items:
|
||||
self.doc.round_floats_in(item)
|
||||
self.doc.round_floats_in(item, do_not_round_fields=do_not_round_fields)
|
||||
|
||||
if item.discount_percentage == 100:
|
||||
item.rate = 0.0
|
||||
|
||||
Reference in New Issue
Block a user