[Bug 43957] New: Add per-currency decimal digits and configurable rounding policy preferences
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43957 Bug ID: 43957 Summary: Add per-currency decimal digits and configurable rounding policy preferences Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: System Administration Assignee: koha-bugs@lists.koha-community.org Reporter: martin.renvoize@openfifth.co.uk QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com Depends on: 43956 Blocks: 23728 Target Milestone: --- Add a decimal_digits setting to currencies and configurable rounding policy preferences. Part of the currency rounding work collected on bug 23728. Currently 2 decimal places are hard-coded (Koha::Number::Price::_format_params decimal_fill, format_price.inc toFixed(2)). The currency table has no digits column, although some currencies use 0 or 3 digits. Proposed: - currency.decimal_digits tinyint, default 2, editable in the currency administration page. - Koha::Number::Price and the JS formatter read the digits from the active currency. - New system preferences, shared digits but separate timing and mode for income (POS, cash management, fines, manual debits) and outgoings (acquisitions): - IncomeRoundingTiming: line (default) | total | none - IncomeRoundingMode: half_away_from_zero (default) | half_up | half_down | half_even | half_odd - OutgoingRoundingTiming and OutgoingRoundingMode, same options - OrderPriceRounding migrates to the outgoing preferences (nearest_cent maps to line timing at the currency digits; empty maps to none). - Vendor-level overrides are handled in the acquisitions bug. Needs an atomicupdate and DBIC schema update. Tests with a 0-digit and a 3-digit currency. Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23728 [Bug 23728] Rounding code should be moved to a Koha module so code can be centralised https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43956 [Bug 43956] Koha::Number::Price::round returns wrong or inconsistent results -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43957 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |43958 Blocks| |43959 Blocks| |43960 Blocks| |43961 Blocks| |43962 Blocks|23728 | Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23728 [Bug 23728] [OMNIBUS] Currency precision and rounding: central engine, per-currency digits, configurable policy https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43958 [Bug 43958] Replace toFixed-based price formatting with a currency-aware minor-unit helper https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43959 [Bug 43959] Cash-up reports false surplus or deficit when amounts contain fractions of a penny https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43960 [Bug 43960] Round account line amounts at write time per income rounding preferences https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43961 [Bug 43961] POS accepts prices and quantities that produce fractions of a penny https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43962 [Bug 43962] Use the shared rounding engine in acquisitions with per-vendor rounding settings -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43957 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks|43959 | Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43959 [Bug 43959] Cash-up reports false surplus or deficit when amounts contain fractions of a penny -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43957 --- Comment #1 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 210087 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210087&action=edit Bug 43957: Add currency.decimal_digits and rounding preferences -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43957 --- Comment #2 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 210088 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210088&action=edit Bug 43957: Automated Schema Update -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43957 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |martin.renvoize@openfifth.c |ity.org |o.uk Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43957 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|enhancement |normal -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43957 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #210087|0 |1 is obsolete| | Attachment #210088|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43957 --- Comment #3 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 210107 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210107&action=edit Bug 43957: Add currency.decimal_digits and rounding preferences -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43957 --- Comment #4 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 210108 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210108&action=edit Bug 43957: Automated Schema Update -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43957 --- Comment #5 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- I have replaced the patches with revised versions. Nothing has been tested yet, so I have squashed the change into the existing patches. What changed: the IncomeRoundingTiming preference has been removed. Each account line is a complete transaction, so there is nothing to round "in total", and no reason to allow sub-unit amounts to be stored. Amounts received are now always rounded when stored (bug 43960) using IncomeRoundingMode, and income has a mode only. The description above still lists IncomeRoundingTiming; please ignore it. The outgoing preferences are unchanged: OutgoingRoundingTiming (line, total or none) is meaningful for acquisitions, where partial amounts arise from price x quantity, discounts and tax, and replaces OrderPriceRounding. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org