mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-27 22:05:19 +00:00
Rounding based on smallest circulating currency fraction value
This commit is contained in:
@@ -5,7 +5,7 @@ from __future__ import unicode_literals
|
||||
import json
|
||||
import frappe
|
||||
from frappe import _, scrub
|
||||
from frappe.utils import cint, flt, rounded
|
||||
from frappe.utils import cint, flt, round_based_on_smallest_currency_fraction
|
||||
from erpnext.setup.utils import get_company_currency
|
||||
from erpnext.controllers.accounts_controller import validate_conversion_rate, \
|
||||
validate_taxes_and_charges, validate_inclusive_tax
|
||||
@@ -319,9 +319,14 @@ class calculate_taxes_and_totals(object):
|
||||
self.doc.round_floats_in(self.doc, ["grand_total", "base_grand_total"])
|
||||
|
||||
if self.doc.meta.get_field("rounded_total"):
|
||||
self.doc.rounded_total = rounded(self.doc.grand_total)
|
||||
self.doc.rounded_total = round_based_on_smallest_currency_fraction(self.doc.grand_total,
|
||||
self.doc.currency, self.doc.precision("rounded_total"))
|
||||
if self.doc.meta.get_field("base_rounded_total"):
|
||||
self.doc.base_rounded_total = rounded(self.doc.base_grand_total)
|
||||
company_currency = get_company_currency(self.doc.company)
|
||||
|
||||
self.doc.base_rounded_total = \
|
||||
round_based_on_smallest_currency_fraction(self.doc.base_grand_total,
|
||||
company_currency, self.doc.precision("base_rounded_total"))
|
||||
|
||||
def _cleanup(self):
|
||||
for tax in self.doc.get("taxes"):
|
||||
|
||||
Reference in New Issue
Block a user