[Bug 43962] New: Use the shared rounding engine in acquisitions with per-vendor rounding settings
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43962 Bug ID: 43962 Summary: Use the shared rounding engine in acquisitions with per-vendor rounding settings Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Acquisitions Assignee: koha-bugs@lists.koha-community.org Reporter: martin.renvoize@openfifth.co.uk QA Contact: testopia@bugs.koha-community.org Depends on: 43957 Blocks: 23728 Target Milestone: --- Use the shared rounding engine in acquisitions and allow rounding to be set per vendor. Part of the currency rounding work collected on bug 23728. Acquisitions currently has its own implementation: C4::Acquisition::get_rounded_price and get_rounding_sql (CAST(x*100 AS SIGNED)/100) driven by OrderPriceRounding. Several screens ignore it (bugs 37937, 37938, 41708, 35114). Proposed: - Replace both functions with the shared engine and the OutgoingRounding preferences. - Add nullable rounding mode and timing columns to aqbookseller; when null, fall back to the system preferences. - Fix the screens that ignore the setting. Needs an atomicupdate and DBIC schema update. 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=43957 [Bug 43957] Add per-currency decimal digits and configurable rounding policy 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=43962 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. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43962 --- Comment #1 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 210153 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210153&action=edit Bug 43962: Add vendor rounding overrides and remove OrderPriceRounding -- 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=43962 --- Comment #2 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 210154 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210154&action=edit Bug 43962: 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=43962 --- Comment #3 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 210155 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210155&action=edit Bug 43962: Vendor rounding settings in the API and vendor form -- 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=43962 --- Comment #4 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 210156 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210156&action=edit Bug 43962: Price knows the outgoing timing and vendor override -- 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=43962 --- Comment #5 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 210157 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210157&action=edit Bug 43962: SQL version of the acquisitions rounding rule -- 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=43962 --- Comment #6 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 210158 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210158&action=edit Bug 43962: Acquisitions totals and tax use the shared rounding -- 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=43962 --- Comment #7 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 210160 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210160&action=edit Bug 43962: Fund totals use the shared rounding rule -- 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=43962 --- Comment #8 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 210161 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210161&action=edit Bug 43962: Acquisitions screens use the shared rounding -- 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=43962 --- Comment #9 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 210162 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210162&action=edit Bug 43962: Remove get_rounded_price and get_rounding_sql -- 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=43962 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 the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43962 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |43958 Referenced Bugs: 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 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43962 --- Comment #10 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Patches attached. This bug depends on 43957 (currency digits and the OutgoingRounding preferences) and 43958 (the shared JavaScript currency helper). What it does: acquisitions now rounds with one rule in Perl, SQL and JavaScript, driven by OutgoingRoundingTiming and OutgoingRoundingMode, with an optional override per vendor (two new nullable columns on the vendor, editable on the vendor form and in the API). When a vendor setting is empty the system preference is used. Timing values: - line: round the unit price, then multiply by the quantity. This is what OrderPriceRounding = nearest_cent did. - total: multiply, then round the line total once; totals are the sum of the rounded line totals. For 3 copies at 3.333333 this gives 10.00, matching a vendor invoice, where "line" gives 9.99. - none: nothing is rounded. Also: fund and budget totals used SQL that truncated (0.829 became 0.82) where the screens rounded; they now use the same rule. The new order form, basket, invoice, receiving, spent and ordered pages, the fund reports and the basket group PDF follow it, and two places that rounded a quantity no longer do. OrderPriceRounding, get_rounded_price and get_rounding_sql are removed. Notes for the release notes: - The settings are read when amounts are calculated, so changing a preference or a vendor setting changes how existing orders and the fund "spent" and "ordered" figures are calculated. No stored prices change. - The tax values stored on orders placed or received from now on follow the timing. Existing rows are not rewritten. - OrderPriceRounding is removed (its value was migrated to OutgoingRoundingTiming in bug 43957). The descriptions of bugs 43957 and 43960 still mention IncomeRoundingTiming, which no longer exists: income amounts are always rounded when stored. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org