Bug 9506 - Values are false in the generated pdf for basketgroups
Summary: Values are false in the generated pdf for basketgroups
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Acquisitions (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Jonathan Druart
QA Contact: Katrin Fischer
URL:
Keywords:
Depends on: 5335
Blocks:
  Show dependency treegraph
 
Reported: 2013-01-30 11:35 UTC by Jonathan Druart
Modified: 2014-05-26 21:04 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Medium patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 9506: FIX GST values for the basketgroup print action (17.20 KB, patch)
2013-01-30 11:37 UTC, Jonathan Druart
Details | Diff | Splinter Review
[SIGNED OFF] Bug 9506: FIX GST values for the basketgroup print action (17.31 KB, patch)
2013-02-04 17:54 UTC, mathieu saby
Details | Diff | Splinter Review
screenshot (17.32 KB, image/png)
2013-03-21 09:32 UTC, Katrin Fischer
Details
Bug 9506: FIX gst list values for each basket (1.84 KB, patch)
2013-03-21 13:14 UTC, Jonathan Druart
Details | Diff | Splinter Review
[PASSED QA] Bug 9506: FIX GST values for the basketgroup print action (17.32 KB, patch)
2013-03-22 06:31 UTC, Katrin Fischer
Details | Diff | Splinter Review
[PASSED QA] Bug 9506: FIX gst list values for each basket (2.13 KB, patch)
2013-03-22 06:32 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2013-01-30 11:35:44 UTC
Due to the multi VAT development (Bug 5335), values are not well calculated in the pdf generated by the basketgroup print action.
Comment 1 Jonathan Druart 2013-01-30 11:37:37 UTC Comment hidden (obsolete)
Comment 2 mathieu saby 2013-02-04 17:52:48 UTC
Good work Jonathan ;-)
I sign off.
I like the replacement of the array by a hash too. It will be easier to edit basketgroup pdf templates!

Maybe "Discount amount" would be better than "Discount price"? But I am not fluent in english... and it could be fixed latter.

Details of my tests ; 

BEFORE applying the patch :

I create a bookseller NOYES with :
- List item price includes tax: No
- Invoice item price includes tax: Yes
- tax rate : 5.5
- discount : 9%

I create a basket with :
- a book costing 100 euros (vendor price)
- a book costing 50 euros (vendor price), in 2 items

I check basket.pl : all is correct :
for the book costing 100 euros :
- RP tax exc. : 100
- ecost tax exc : 91
- RP tax inc : 105.5
- ecost tax incl : 96
and half these values for the book costing 50 euros

total correct (on discounted prices)
- Total tax exc. (EUR) 182.00
- Total tax inc. (EUR) 192.00
- GST (EUR) 10.00    

I close the basket, create a basketgroup, and print the basketgroup with layout3pages
=> WRONG prices

1st page :
RRT GST Inc.  : 200
Discount Price : 182
Total GST exc  : 172,51
GST  : 9,49
Total GST Inc. : 182

2d page, for the book costing 100 euros :
RRT GST Inc  : 100
Discount price GST Exc.  : 86,26
Total GST Inc. : 91

AFTER applying the patch :

I print again the same basketgroup with layout3pages
=> RIGHT prices
1st page :
Total RRP tax exc : 200
Total RRP tax incl: 211
GST : 10
Total discount : 18
Total Tax exc  : 182
Total Tax incl : 192

2d page, for the book costing 100 euros tax exc :
RRP tax exc : 100
RRP tax inc : 105.5
Discount price : 9
Total tax exc.  : 91
Total tax incl : 96

For the 2 items of the book costing 50 euros, everything is correct too.
(Total tax exc.  : 91 ; Total tax incl : 96)

Same test with a 2d bookseller YESYES with :
- List item price includes tax: Yes
- Invoice item price includes tax: Yes

=> everything is OK after patch is applied :
2 items of a book with vendor price = 105,50 EUR tax inc :
I print the basketgroup with layout3pages
1st page :
Total RRP tax exc : 200
Total RRP tax incl: 211
GST : 10
Total discount : 18
Total Tax exc  : 182
Total Tax incl : 192

2d page, for the book costing 105,5 euros tax inc :
Qty : 2
RRP tax exc : 100
RRP tax inc : 105.5
Discount price : 9
Total tax exc.  : 182
Total tax incl : 192




M. Saby
Rennes 2 university
Comment 3 mathieu saby 2013-02-04 17:54:17 UTC Comment hidden (obsolete)
Comment 4 Katrin Fischer 2013-03-21 09:32:43 UTC
Created attachment 16586 [details]
screenshot

The calculation looks alright to me, but there is a little problem when using pdfformat::layout3pages as PDF layout. On the second page that shows the baskets in the basket group there is a column "gst rate". It currently always shows a list with the gst rate for every order line of the first basket (see screenshot).

2 Problems here:
- First baskets gst rates are shown for all baskets
- The list of gst rates is not deduplicated - it's one entry for each order line. Maybe we should just say "Multiple" or something if there is more than one? Or maybe remove the columns altogether and just keep the sum in the next column?
Comment 5 Jonathan Druart 2013-03-21 13:14:06 UTC Comment hidden (obsolete)
Comment 6 Jonathan Druart 2013-03-21 13:15:24 UTC
(In reply to comment #4)
> 2 Problems here:
> - First baskets gst rates are shown for all baskets
Fixed, bad placed variable.

> - The list of gst rates is not deduplicated - it's one entry for each order
> line. Maybe we should just say "Multiple" or something if there is more than
> one? Or maybe remove the columns altogether and just keep the sum in the
> next column?
Really strange behavior, appears just for 0 value.
Now it is fixed.
Comment 7 Katrin Fischer 2013-03-22 06:31:54 UTC
Created attachment 16705 [details] [review]
[PASSED QA] Bug 9506: FIX GST values for the basketgroup print action

Due to the multi VAT development (Bug 5335), values are not well calculated in
the pdf generated by the basketgroup print action.

Test plan:
- Add one or more basket to a basketgroup.
- Close and print this basketgroup
- Check that different values correspond to values in the basket detail page.

Don't forget to test with different parameters (multiple vat, vendor
include/don't include tax).

Signed-off-by: Mathieu Saby <mathieu.saby@univ-rennes2.fr>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Comment 8 Katrin Fischer 2013-03-22 06:32:02 UTC
Created attachment 16706 [details] [review]
[PASSED QA] Bug 9506: FIX gst list values for each basket

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Problems raised by QA for the basket list page in the 3 pages
layout (pdfformat::layout3pages) fixed.

GST column on the summary page now gives a list of all used
GST rates for each individual basket.

All tests and QA script pass.
Comment 9 Jared Camins-Esakov 2013-03-23 04:29:25 UTC
This patch has been pushed to master.