Discount shows 4 decimal places, it should show 1 like other places that show discount rate
Created attachment 14645 [details] [review] bug 9410 Fix formatting of discount rate The formatting for discount doesn't limit the number of decimal points for the discount rate when creating a new order from an empty record. This patch fixes that by limiting it to 2dp Signed-off-by: Hugh Davenport <hugh@davenport.net.nz>
Created attachment 15354 [details] [review] bug 9410 Fix formatting of discount rate The formatting for discount doesn't limit the number of decimal points for the discount rate when creating a new order from an empty record. This patch fixes that by limiting it to 2dp Signed-off-by: Hugh Davenport <hugh@davenport.net.nz> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
The aqorders.discount field is a float(6,4) in DB. If we limit the value to 2 in the interface, we should limit the number of decimals in the DB structure too. However, maybe the 4 decimals are used by some library (hum... it should be surprising). Switch to in discussion.
I just seen you already submitted a patch for the supplier form (bug 9062). You limited the discount value to 1 decimal, we have to be consistent. 2 is certainly the best choice, but in this case a patch for the supplier form is required (and maybe for DB changes).
Hi Jonathan, I would agree, prehaps we should make another bug for changing the patch made in bug 9062 to use 2dp as well, and push this one through as is, as long as everyone is happy with that. Cheers, Hugh
Ok, switch back to Signed Off and let someone else qa this patch.
Hm, there is some inconsistency in how we format tax and discount in various places in Koha: Tax: Available tax values are controlled by system preference gist. It's possible to enter values <1% there but the display shows max 2dp%. Example: gist: 0.066, display when selecting: 0.7%, display in order summary page: 2dp. tax any gist (input field, no validation) 1dp discount 1dp Vendor - summary 1dp Vendor - edit (display of saved value) any Vendor - edit (input field, no validation) 2dp Order - order line edit/add (with patch) - Order - summary, doesn't show discount - Receive, doesn't show discount
Accidentally submitted the form earlier, let's try that again: There is some inconsistency in how we format tax and discount in various places in Koha: Tax: Available tax values are controlled by system preference gist. It's possible to enter values <1% there but the display shows max 2dp%. Example: gist: 0.066, display in pull down: 0.7%, display in order summary page 0.66. tax any gist (input field, no validation) 1dp pull down used for add/edit/modify in vendor and order lines 1dp Order - summary, rounded 2dp Receive - summary discount 1dp Vendor - summary 1dp Vendor - edit (display of saved value) any Vendor - edit (input field, no validation) 2dp Order - order line edit/add (with patch) - Order - summary, doesn't show discount - Receive - summary, doesn't show the discount So we have some mismatch here - I am not sure right now how to solve it. Can we get some opinions on this?
Created attachment 19792 [details] [review] [ALT] Bug 9410: Draft: TT Plugin for formatting prices, etc.
I think template plugin is much more appropriate in this case. What do you think about this patch?
Created attachment 21267 [details] [review] [ALT] Bug 9410: Draft: TT Plugin for formatting prices, etc.
What about my proposed patch?
Still valid?
(In reply to Marc Véron from comment #13) > Still valid? Yes, the way to go is to use the TT plugin added by bug 12844.
(In reply to Jonathan Druart from comment #11) > Created attachment 21267 [details] [review] [review] > [ALT] Bug 9410: Draft: TT Plugin for formatting prices, etc. This is now in, see bug 12844.
This has been fixed.