Summary: | Bad price calculation when filling a basket with staged records | ||
---|---|---|---|
Product: | Koha | Reporter: | Mathieu Saby <mathsabypro> |
Component: | Acquisitions | Assignee: | Jonathan Druart <jonathan.druart> |
Status: | CLOSED FIXED | QA Contact: | |
Severity: | normal | ||
Priority: | P5 - low | CC: | chris, elliott, jonathan.druart, mglavica, paul.poulain |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
GIT URL: | Change sponsored?: | --- | |
Patch complexity: | Small patch | Documentation contact: | |
Documentation submission: | Text to go in the release notes: | ||
Version(s) released in: | Circulation function: | ||
Attachments: |
Bug 9280: FIX price calculation adding an order from a staged file
Bug 9280: Followup FIX price calculation adding an order from a staged file Bug 9280: FIX price calculation adding an order from a staged file Bug 9280: FIX price calculation adding an order from a staged file [Passed QA] Bug 9280: FIX price calculation adding an order from a staged file |
Description
Mathieu Saby
2012-12-13 12:32:59 UTC
Created attachment 14071 [details] [review] Bug 9280: FIX price calculation adding an order from a staged file Test plan: Add an order from a staged file containing a price value (010$d for UNIMARC user). Check this patch with 2 different vendors (listprice=1 and listprice=0). Check the calculated price (depending discount and gstrate). It failed : I have got negative ecost inc. prices (for vendor with listprice =1 ; didn't test for listprice=0) in record : 75 euros RRP tax inc. : 75.00 ecost inc. : -675.00 Total tax in. : -675.00 GST rate 5% GST : -32.14 M. Saby Yep, bad test just before pushing :-/ Created attachment 14074 [details] [review] Bug 9280: Followup FIX price calculation adding an order from a staged file I applied the 2 patches. Bug partially corrected : 1st vendor : List item price includes tax: Yes Invoice item price includes tax: Yes Discount: 10.0000 % Tax rate: 5.0% => OK : => Stage record with 27 euros in 010$d => line in a basket : - RRP tax exc. : 25,71 - ecost tax exc. : 23,14 - RRP tax inc. : 27 - ecost tax inc. : 24,30 - Total tax exc. (EURO) : 23,14 - Total tax inc. (EURO) : 24,30 - GST % : 5% - GST : 1,16 Prices are correct : - (25,71 * 5 / 100) + 25,71 = 27 - 27 * 0.9 = 24,30 - 23,14 * 5 / 100 = 24,30 2d vendor : 1st vendor : List item price includes tax: No Invoice item price includes tax: Yes Discount: 10.0000 % Tax rate: 5.0% => KO I have exactly the same values for 2d vendor, while I was waiting for RRP tax exc. = 27 euros M. Saby Created attachment 14079 [details] [review] Bug 9280: FIX price calculation adding an order from a staged file Test plan: Add an order from a staged file containing a price value (010$d for UNIMARC user). Check this patch with 2 different vendors (listprice=1 and listprice=0). Check the calculated price (depending discount and gstrate). I'm a little bit lost... I don't understand the behavior we want here. The Bug 7180 includes a complex calculation and rewrite a big part of this page but I don't know what we want for this current version. The patch does in *ALL* cases: rrp = 010$d (or similar) ecost = rrp * ( 1 - discount) This 2 values are stored in the DB and the values are calculated on the fly depending of the bookseller parameters. Yes, it is tiresome... I found a way to explain what I mean : If you create a new order line from scratch (not from staged record), Koha ask for "Vendor price", and calculates other prices. For me, 010$d is the equivalent of this "Vendor price", and should be treated in the same way. And it is not currently the case. M. Saby With the last patch, what is wrong ? you mean only with patch 14079 ? I did not test yet... It is OK with patch 14079, I have : -1d vendor : List item price includes tax: Yes Invoice item price includes tax: Yes Discount: 10.0000 % Tax rate: 5.0% stage record with 010$d = 27 euros RRP tax exc. = 25.71 euros RRP tax incl. = 27 euros (wich is 25.71+ (25,71 * 5/100)) discount calculated correctly -2d vendor : List item price includes tax: No Invoice item price includes tax: Yes Discount: 10.0000 % Tax rate: 5.0% stage record with 010$d = 27 euros RRP tax exc. = 27 euros RRP tax incl. = 28.35 (which is 27 + (27*5/100)) discount calculated correctly I sign off. Created attachment 14084 [details] [review] Bug 9280: FIX price calculation adding an order from a staged file Is this problem really minor ? It does not happen in a lot of places, but it's very annoying (and not "circumventable" ?). I would say "normal" or "major" Changed to "normal" Created attachment 14707 [details] [review] [Passed QA] Bug 9280: FIX price calculation adding an order from a staged file Test plan: Add an order from a staged file containing a price value (010$d for UNIMARC user). Check this patch with 2 different vendors (listprice=1 and listprice=0). Check the calculated price (depending discount and gstrate). Signed-off-by: mathieu saby <mathieu.saby@univ-rennes2.fr> Signed-off-by: Elliott Davis <elliott@bywatersolions.com> introduces no new bugs This patch has been pushed to master. Pushed to 3.10.x will be in 3.10.3 |