-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor: Setting Float Precision for representing Monetary (Currency…
… without symbol ) Columns in Report 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): .... float_precision = get_float_precison() columns = [ { "label": _("Debit"), "fieldname": "debit_in_account_currency", "fieldtype": "Float", "precision": float_precision, "width": 130, }, { "label": _("Credit"), "fieldname": "credit_in_account_currency", "fieldtype": "Float", "precision": float_precision, "width": 130, }, { "label": _("Balance"), "fieldname": "balance", "fieldtype": "Float", "precision": float_precision, "width": 130, },
- Loading branch information
Showing
1 changed file
with
41 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters