Summary: | In baskets, prices between 0 and 1 are displayed in red | ||
---|---|---|---|
Product: | Koha | Reporter: | Mathieu Saby <mathsabypro> |
Component: | Acquisitions | Assignee: | Mathieu Saby <mathsabypro> |
Status: | CLOSED FIXED | QA Contact: | Jonathan Druart <jonathan.druart> |
Severity: | minor | ||
Priority: | P5 - low | CC: | cedric.vita, gmcharlt, jonathan.druart, tomascohen, tredok.pierre |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
GIT URL: | Change sponsored?: | --- | |
Patch complexity: | Trivial patch | Documentation contact: | |
Documentation submission: | Text to go in the release notes: | ||
Version(s) released in: | Circulation function: | ||
Attachments: |
[PATCH] Bug 9374: Only 0.00 prices must have class error in basket.tt
Bug 9374: Only 0.00 prices must have class error in basket.tt Bug 9374: Only 0.00 prices must have class error in basket.tt Bug 9374: The color should manage all zero format. pic of a basket with several prices |
Description
Mathieu Saby
2013-01-09 15:55:34 UTC
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! |