Bugzilla – Attachment 137650 Details for
Bug 14680
When creating orders from a staged file discounts supplied in the form are added
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14680: Always subtract discoutn form price to calculate estimated cost
Bug-14680-Always-subtract-discoutn-form-price-to-c.patch (text/plain), 2.61 KB, created by
ByWater Sandboxes
on 2022-07-12 18:39:28 UTC
(
hide
)
Description:
Bug 14680: Always subtract discoutn form price to calculate estimated cost
Filename:
MIME Type:
Creator:
ByWater Sandboxes
Created:
2022-07-12 18:39:28 UTC
Size:
2.61 KB
patch
obsolete
>From cf0704e1e889f05c9258c1dcefbeb2d9db8a08ca Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Tue, 12 Jul 2022 18:10:54 +0000 >Subject: [PATCH] Bug 14680: Always subtract discoutn form 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> >--- > acqui/addorderiso2709.pl | 10 ++-------- > 1 file changed, 2 insertions(+), 8 deletions(-) > >diff --git a/acqui/addorderiso2709.pl b/acqui/addorderiso2709.pl >index dd90a398fb..9d5911564c 100755 >--- a/acqui/addorderiso2709.pl >+++ b/acqui/addorderiso2709.pl >@@ -276,10 +276,7 @@ if ($op eq ""){ > $orderinfo{tax_rate} = $bookseller->tax_rate; > my $c = $c_discount ? $c_discount : $bookseller->discount; > $orderinfo{discount} = $c; >- if ( $c_discount ) { >- $orderinfo{ecost} = $price; >- $orderinfo{rrp} = $orderinfo{ecost} / ( 1 - $c / 100 ); >- } else { >+ if ( $c ) { > $orderinfo{ecost} = $price * ( 1 - $c / 100 ); > $orderinfo{rrp} = $price; > } >@@ -337,10 +334,7 @@ if ($op eq ""){ > $orderinfo{tax_rate} = $bookseller->tax_rate; > my $c = $c_discount ? $c_discount : $bookseller->discount; > $orderinfo{discount} = $c; >- if ( $c_discount ) { >- $orderinfo{ecost} = $c_price; >- $orderinfo{rrp} = $orderinfo{ecost} / ( 1 - $c / 100 ); >- } else { >+ if ( $c ) { > $orderinfo{ecost} = $c_price * ( 1 - $c / 100 ); > $orderinfo{rrp} = $c_price; > } >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 14680
:
41489
|
41551
|
137649
|
137650
|
137753