Bugzilla – Attachment 14071 Details for
Bug 9280
Bad price calculation when filling a basket with staged records
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 9280: FIX price calculation adding an order from a staged file
Bug-9280-FIX-price-calculation-adding-an-order-fro.patch (text/plain), 2.17 KB, created by
Jonathan Druart
on 2012-12-13 13:30:29 UTC
(
hide
)
Description:
Bug 9280: FIX price calculation adding an order from a staged file
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2012-12-13 13:30:29 UTC
Size:
2.17 KB
patch
obsolete
>From a2831b69f53065938d2c19cad7e5b888c67fb7a9 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Thu, 13 Dec 2012 14:26:54 +0100 >Subject: [PATCH] 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). >--- > acqui/addorderiso2709.pl | 9 +++++---- > 1 file changed, 5 insertions(+), 4 deletions(-) > >diff --git a/acqui/addorderiso2709.pl b/acqui/addorderiso2709.pl >index 4942571..1427c2f 100755 >--- a/acqui/addorderiso2709.pl >+++ b/acqui/addorderiso2709.pl >@@ -189,7 +189,7 @@ if ($op eq ""){ > SetImportRecordStatus( $biblio->{'import_record_id'}, 'imported' ); > } > # 3rd add order >- my $patron = C4::Members->GetMember( borrowernumber => $loggedinuser ); >+ my $patron = C4::Members::GetMember( borrowernumber => $loggedinuser ); > my $branch = C4::Branch->GetBranchDetail( $patron->{branchcode} ); > # get quantity in the MARC record (1 if none) > my $quantity = GetMarcQuantity($marcrecord, C4::Context->preference('marcflavour')) || 1; >@@ -223,11 +223,12 @@ if ($op eq ""){ > my $bookseller = GetBookSellerFromId( $basket->{booksellerid} ); > $orderinfo{gstrate} = $bookseller->{gstrate}; > if ( $bookseller->{listincgst} ) { >- $orderinfo{ecost} = $price; >+ $orderinfo{rrp} = $price; >+ $orderinfo{ecost} = $orderinfo{rrp} * ( 1 - $bookseller->{discount} ); > } else { >- $orderinfo{ecost} = $price * ( 1 + $orderinfo{gstrate} ); >+ $orderinfo{rrp} = $price / ( 1 + $orderinfo{gstrate} ); >+ $orderinfo{ecost} = $orderinfo{rrp} * ( 1 - $bookseller->{discount} ); > } >- $orderinfo{rrp} = ( $orderinfo{ecost} * 100 ) / ( 100 - $bookseller->{discount} ); > $orderinfo{listprice} = $orderinfo{rrp}; > $orderinfo{unitprice} = $orderinfo{ecost}; > $orderinfo{total} = $orderinfo{ecost}; >-- >1.7.10.4
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 9280
:
14071
|
14074
|
14079
|
14084
|
14707