[Bug 9280] New: Bad price calculation when filling a basket with staged records
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9280 Bug ID: 9280 Summary: Bad price calculation when filling a basket with staged records Classification: Unclassified Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: minor Priority: P5 - low Component: Acquisitions Assignee: koha-bugs@lists.koha-community.org Reporter: mathieu.saby@univ-rennes2.fr Koha does not manage the VAT properly when filling a basket with staged records. Let's take a book whose Recommended Retail Price excluding tax is 39 euros. On the vendor's website, I import the record for this book in iso2709 In the record (UNIMARC), the price is in 010$d after the ISBN. So, I found in my record 10$d39.00 EUR I stage this record in Koha with Stage Marc Records Tools. In Acquisition module, I create a vendor with: - List item price includes tax: Yes - Invoice item price includes tax: Yes - Discount: 9.0000 % - Tax rate: 5.5% I create a new basket for this vendor. I fill this basket with my stage record. I think I should have for the command line in this basket : - RRP tax included : 39 euros - Ecost tax included : 39 euros - 3,51 euros = 35,49 euros - RRP tax excluded : 39*100/105.5 = 36,96 euros - Ecost tax excluded : 35,49*100/105.5 = 33,63 euros BUT instead I see the following values : - RRP tax included : 42.86 euros - Ecost tax included : 39 euros - RRP tax excluded : 40,63 - Ecost tax excluded : 36,97 So, Koha considered the "39 euros" value in my record as a Ecost price. I dont think it is normal, as as chose "List item price includes tax: Yes" in vendor record. M. Saby Rennes 2 University -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9280 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@biblibre.co | |m Assignee|koha-bugs@lists.koha-commun |jonathan.druart@biblibre.co |ity.org |m -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9280 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9280 --- Comment #1 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 14071 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=14071&action=edit 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). -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9280 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9280 --- Comment #2 from mathieu saby <mathieu.saby@univ-rennes2.fr> --- 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 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9280 --- Comment #3 from Jonathan Druart <jonathan.druart@biblibre.com> --- Yep, bad test just before pushing :-/ -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9280 --- Comment #4 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 14074 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=14074&action=edit Bug 9280: Followup FIX price calculation adding an order from a staged file -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9280 --- Comment #5 from mathieu saby <mathieu.saby@univ-rennes2.fr> --- 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 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9280 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #14071|0 |1 is obsolete| | Attachment #14074|0 |1 is obsolete| | --- Comment #6 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 14079 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=14079&action=edit 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). -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9280 --- Comment #7 from Jonathan Druart <jonathan.druart@biblibre.com> --- 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. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9280 --- Comment #8 from mathieu saby <mathieu.saby@univ-rennes2.fr> --- 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 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9280 --- Comment #9 from Jonathan Druart <jonathan.druart@biblibre.com> --- With the last patch, what is wrong ? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9280 --- Comment #10 from mathieu saby <mathieu.saby@univ-rennes2.fr> --- you mean only with patch 14079 ? I did not test yet... -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9280 --- Comment #11 from mathieu saby <mathieu.saby@univ-rennes2.fr> --- 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. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9280 mathieu saby <mathieu.saby@univ-rennes2.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9280 mathieu saby <mathieu.saby@univ-rennes2.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #14079|0 |1 is obsolete| | --- Comment #12 from mathieu saby <mathieu.saby@univ-rennes2.fr> --- Created attachment 14084 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=14084&action=edit Bug 9280: FIX price calculation adding an order from a staged file -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9280 Paul Poulain <paul.poulain@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |paul.poulain@biblibre.com --- Comment #13 from Paul Poulain <paul.poulain@biblibre.com> --- 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" -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9280 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|minor |normal --- Comment #14 from Jonathan Druart <jonathan.druart@biblibre.com> --- Changed to "normal" -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9280 Marijana Glavica <mglavica@ffzg.hr> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mglavica@ffzg.hr -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9280 Elliott Davis <elliott@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #14084|0 |1 is obsolete| | --- Comment #15 from Elliott Davis <elliott@bywatersolutions.com> --- Created attachment 14707 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=14707&action=edit [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 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9280 Elliott Davis <elliott@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA CC| |elliott@bywatersolutions.co | |m Patch complexity|--- |Small patch -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9280 Jared Camins-Esakov <jcamins@cpbibliography.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master --- Comment #16 from Jared Camins-Esakov <jcamins@cpbibliography.com> --- This patch has been pushed to master. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9280 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |Pushed to Stable CC| |chris@bigballofwax.co.nz --- Comment #17 from Chris Cormack <chris@bigballofwax.co.nz> --- Pushed to 3.10.x will be in 3.10.3 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org