Bug 13001: Refactor VAT and price calculation - parcel page
authorJonathan Druart <jonathan.druart@biblibre.com>
Fri, 26 Sep 2014 12:46:21 +0000 (14:46 +0200)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Wed, 21 Jan 2015 14:25:59 +0000 (11:25 -0300)
commiteed14b080db8691f371b4c19f1a190b87fcc396a
tree31dd3b4d831c447323ec9d8325ff26e492b52d51
parent229cb65629c93d30191bc6c797d06021942239b2
Bug 13001: Refactor VAT and price calculation - parcel page

Bug 12969 introduces a subroutine to centralize VAT and prices
calculation.
It should be use in the acqui/parcel.pl script.

Test plan:
1/ Create 4 suppliers with the different configurations
2/ Create a basket and create several orders
3/ Go on the parcel page
4/ You should see, on the "pending orders" table, the same prices as
before this patch.
Note that the prices are now correctly formated.

You could see one change for the supplier configuration 3 (1 0):
If the cost of the item is 82, discount 10% and vat 5%:
The "Order cost" = 140.58 instead of 140.57.
Indeed, before this patch, the order cost was wrong, now you should have
70.29*2 = 140.58

( before: 140.58 + 7.03 = 147.61
  now:    140.58 + 7.02 = 147.60 )

5/ Receive the items and return on the parcel page
Now the "Already received" table with the same prices as before this
patch.
Note some differences too:
- There was a td tag missing, the table was badly formated, it's now
fixed (column below the "Cancel receipt" link).
- The prices are now correctly formated.
- For the configuration 2 (1 1), if the cost of the item is 82, discount
  10% and vat 5%:

( before: 140.57 + 7.03 = 147.60
  now:    140.58 + 7.02 = 147.60 )

Note that 7.03 is the "correct" value, but on all other pages, 7.02 is
displayed.
To be consistent, we should display the same prices everywhere.

Signed-off-by: Paola Rossi <paola.rossi@cineca.it>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
acqui/parcel.pl
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt