refactor : Setting Float Precision for Columns that Representing Monetary DataFields instead of Float with System Settings or Currency #39035
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Representing Monetary data field as currency in many script report columns would take a lot of space and be annoyaing sometimes, meanwhile using Float as fieldtype would be annoyaing when you set float Precision to 5 in System Settings.
Thus after apply such field many report would get some update for example General Ledger Report: def get_float_precison():
fp = frappe.db.get_single_value(
"Accounts Settings", "monetary_columns_float_precison"
)
if fp !="":
return fp
else :
return frappe.db.get_single_value(
"System Settings", "float_precision"
)
def get_columns(filters):
....
{
"label": _("Debit"),
"fieldname": "debit_in_account_currency",
"fieldtype": "Float",
"precision": float_precision,
"width": 130,
},