Very cosmetic bug : In a basket, if some prices are between 0 and 1, they are displayed in red, with class = "number error". For example, a VAT of 0.89 euros is displayed in red. In don't think it is normal. this behavior was introduced by http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7112 M. Saby Rennes 2 university
Created attachment 21107 [details] [review] [PATCH] Bug 9374: Only 0.00 prices must have class error in basket.tt A regexp '^0' in basket.tt is used to give the class "error" to null prices. It is wrong, because it matches prices like "0.15". It should only match "0.00". To test : - apply the patch - display a basket with an order with a price between 0 and 1 (like "0.50") and an order with a price stricty null ("0.00") - only the "0.00" price should be displayed in red
Signing patches on sandbox (test1) did not work. Thank you to "Sign-off" on.
Created attachment 21250 [details] [review] Bug 9374: Only 0.00 prices must have class error in basket.tt A regexp '^0' in basket.tt is used to give the class "error" to null prices. It is wrong, because it matches prices like "0.15". It should only match "0.00". To test : - apply the patch - display a basket with an order with a price between 0 and 1 (like "0.50") and an order with a price stricty null ("0.00") - only the "0.00" price should be displayed in red Signed-off-by: Cedric Vita <cedric.vita@dracenie.com>
Created attachment 21265 [details] [review] Bug 9374: Only 0.00 prices must have class error in basket.tt A regexp '^0' in basket.tt is used to give the class "error" to null prices. It is wrong, because it matches prices like "0.15". It should only match "0.00". To test : - apply the patch - display a basket with an order with a price between 0 and 1 (like "0.50") and an order with a price stricty null ("0.00") - only the "0.00" price should be displayed in red Signed-off-by: Cedric Vita <cedric.vita@dracenie.com> Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Created attachment 21266 [details] [review] Bug 9374: The color should manage all zero format. The format of prices in Koha is discuted in some bugs (e.g. 9410). The good way will be to introduce a syspref in order to deal with the number of decimal. The previous patch is too restrictive, we should deal with other zero format. Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
I did not know bug 9410... As you rewrite the patch, I suppose it need an other sign off ? Mathieu
Created attachment 21268 [details] pic of a basket with several prices
Bugs 10792 and 10929 are somewhat related, as they touch on the general problem of displaying monetary amounts. Jonathan's follow-up patch bandaids the situation, but would become awkward if (say) the currency symbol started being displayed in the table. The approach I'm proposing in my WIP branch for bug 10929 would instead just pass the numeric currency amount to the template and rely on TT filters to format it for display. This, in turn, would mean that rather than having to use delicate regexes to see if an amount is zero, the template could simply do a numeric test. I'll probably push the patches for this bug as is, but slap a FIXME on them, as the currency formatting revamp will simplify the template logic.
(In reply to Galen Charlton from comment #8) > Bugs 10792 and 10929 are somewhat related, as they touch on the general > problem of displaying monetary amounts. For information, I proposed a similar way in bug 9410.
Pushed to master, along with a follow-up adding the promised FIXME. Thanks, Mathieu!
This patch has been pushed to 3.12.x, will be in 3.12.8. Thanks Mathieu!