Bug 14680: Always subtract discount from price to calculate estimated cost
authorNick Clemens <nick@bywatersolutions.com>
Tue, 12 Jul 2022 18:10:54 +0000 (18:10 +0000)
committerLucas Gass <lucas@bywatersolutions.com>
Tue, 23 Aug 2022 17:24:04 +0000 (17:24 +0000)
commit96eed0f5e00657808e506ba6d5e0a98a3529bf95
tree8c0b8eecff67e132626a0feb85617a9d8adbf8ba
parent604da9beaaaaa90c875dfcc05261f45793b3fb7c
Bug 14680: Always subtract discount from price to calculate estimated cost

This patch simply removes a discrepancty where when a discount is provided on the order form
we add the discount to the price, and when it comes form the vendor we subtract the discount.

Discounts should always descrease the estimated cost

To test:
 0 - Have a vendor with a discount of 10% specified
 1 - Export a record from your Koha
 2 - Stage the record for import and match on biblionumber
 3 - Add to a basket in acq from the staged file
 4 - Select the title, and set order price to $10 and do not fill the discount field
 5 - Add the order - note $10 RRP and $9 actual/budgeted cost
 6 - Repeat 2&3
 7 - Select the tile, set price $10 and discount 50%
 8 - Add the order - note $20 RRP and $10 actual/budgeted cost! FAIL
 9 - Apply patch, restart all
10 - Repeat 2-7
11 - Add the order, note $10 RRP and $5 actual.budgeted cost

Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 7c734c6903a823eeb58be9ab1c4af251def776b7)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
acqui/addorderiso2709.pl