fix: respect db multi_tenancy while fetching precision (#30301)
[skip ci]
This commit is contained in:
parent
8819ba07a9
commit
5a9bf9ffd6
@ -12,7 +12,7 @@ from frappe.utils import cint, date_diff, flt
|
||||
from erpnext.stock.doctype.serial_no.serial_no import get_serial_nos
|
||||
|
||||
Filters = frappe._dict
|
||||
precision = cint(frappe.db.get_single_value("System Settings", "float_precision"))
|
||||
|
||||
|
||||
def execute(filters: Filters = None) -> Tuple:
|
||||
to_date = filters["to_date"]
|
||||
@ -30,6 +30,8 @@ def format_report_data(filters: Filters, item_details: Dict, to_date: str) -> Li
|
||||
_func = itemgetter(1)
|
||||
data = []
|
||||
|
||||
precision = cint(frappe.db.get_single_value("System Settings", "float_precision", cache=True))
|
||||
|
||||
for item, item_dict in item_details.items():
|
||||
earliest_age, latest_age = 0, 0
|
||||
details = item_dict["details"]
|
||||
@ -76,6 +78,9 @@ def get_average_age(fifo_queue: List, to_date: str) -> float:
|
||||
return flt(age_qty / total_qty, 2) if total_qty else 0.0
|
||||
|
||||
def get_range_age(filters: Filters, fifo_queue: List, to_date: str, item_dict: Dict) -> Tuple:
|
||||
|
||||
precision = cint(frappe.db.get_single_value("System Settings", "float_precision", cache=True))
|
||||
|
||||
range1 = range2 = range3 = above_range3 = 0.0
|
||||
|
||||
for item in fifo_queue:
|
||||
|
Loading…
x
Reference in New Issue
Block a user