Bugzilla – Attachment 60834 Details for
Bug 18115
Fix use of Objects as hashref in acqui/addorderiso2709.pl - Bug 15503 followup
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18115 - Fix use of Objects as hashref in acqui/addorderiso2709.pl - Bug 15503 followup
Bug-18115---Fix-use-of-Objects-as-hashref-in-acqui.patch (text/plain), 4.49 KB, created by
Matthias Meusburger
on 2017-03-06 11:07:25 UTC
(
hide
)
Description:
Bug 18115 - Fix use of Objects as hashref in acqui/addorderiso2709.pl - Bug 15503 followup
Filename:
MIME Type:
Creator:
Matthias Meusburger
Created:
2017-03-06 11:07:25 UTC
Size:
4.49 KB
patch
obsolete
>From b94f71f0fe97226c8a749acb6be77eb846e43250 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Fri, 3 Mar 2017 16:10:09 +0000 >Subject: [PATCH] Bug 18115 - Fix use of Objects as hashref in > acqui/addorderiso2709.pl - Bug 15503 followup > >Fix use of 'gstrate' for 'tax_rate' > >Signed-off-by: Matthias Meusburger <matthias.meusburger@biblibre.com> >--- > acqui/addorderiso2709.pl | 20 ++++++++++---------- > t/db_dependent/Acquisition/OrderUsers.t | 1 - > 2 files changed, 10 insertions(+), 11 deletions(-) > >diff --git a/acqui/addorderiso2709.pl b/acqui/addorderiso2709.pl >index 18ba56e..24dc8e5 100755 >--- a/acqui/addorderiso2709.pl >+++ b/acqui/addorderiso2709.pl >@@ -259,9 +259,9 @@ if ($op eq ""){ > # in this case, the price will be x100 when unformatted ! Replace the . by a , to get a proper price calculation > $price =~ s/\./,/ if C4::Context->preference("CurrencyFormat") eq "FR"; > $price = Koha::Number::Price->new($price)->unformat; >- $orderinfo{gstrate} = $bookseller->{gstrate}; >- my $c = $c_discount ? $c_discount : $bookseller->{discount} / 100; >- if ( $bookseller->{listincgst} ) { >+ $orderinfo{tax_rate} = $bookseller->tax_rate; >+ my $c = $c_discount ? $c_discount : $bookseller->discount / 100; >+ if ( $bookseller->listincgst ) { > if ( $c_discount ) { > $orderinfo{ecost} = $price; > $orderinfo{rrp} = $orderinfo{ecost} / ( 1 - $c ); >@@ -271,10 +271,10 @@ if ($op eq ""){ > } > } else { > if ( $c_discount ) { >- $orderinfo{ecost} = $price / ( 1 + $orderinfo{gstrate} ); >+ $orderinfo{ecost} = $price / ( 1 + $orderinfo{tax_rate} ); > $orderinfo{rrp} = $orderinfo{ecost} / ( 1 - $c ); > } else { >- $orderinfo{rrp} = $price / ( 1 + $orderinfo{gstrate} ); >+ $orderinfo{rrp} = $price / ( 1 + $orderinfo{tax_rate} ); > $orderinfo{ecost} = $orderinfo{rrp} * ( 1 - $c ); > } > } >@@ -327,9 +327,9 @@ if ($op eq ""){ > # in this case, the price will be x100 when unformatted ! Replace the . by a , to get a proper price calculation > $price =~ s/\./,/ if C4::Context->preference("CurrencyFormat") eq "FR"; > $price = Koha::Number::Price->new($price)->unformat; >- $orderinfo{gstrate} = $bookseller->{gstrate}; >- my $c = $c_discount ? $c_discount : $bookseller->{discount} / 100; >- if ( $bookseller->{listincgst} ) { >+ $orderinfo{tax_rate} = $bookseller->tax_rate; >+ my $c = $c_discount ? $c_discount : $bookseller->discount / 100; >+ if ( $bookseller->listincgst ) { > if ( $c_discount ) { > $orderinfo{ecost} = $price; > $orderinfo{rrp} = $orderinfo{ecost} / ( 1 - $c ); >@@ -339,10 +339,10 @@ if ($op eq ""){ > } > } else { > if ( $c_discount ) { >- $orderinfo{ecost} = $price / ( 1 + $orderinfo{gstrate} ); >+ $orderinfo{ecost} = $price / ( 1 + $orderinfo{tax_rate} ); > $orderinfo{rrp} = $orderinfo{ecost} / ( 1 - $c ); > } else { >- $orderinfo{rrp} = $price / ( 1 + $orderinfo{gstrate} ); >+ $orderinfo{rrp} = $price / ( 1 + $orderinfo{tax_rate} ); > $orderinfo{ecost} = $orderinfo{rrp} * ( 1 - $c ); > } > } >diff --git a/t/db_dependent/Acquisition/OrderUsers.t b/t/db_dependent/Acquisition/OrderUsers.t >index 4a50440..b63f5a2 100644 >--- a/t/db_dependent/Acquisition/OrderUsers.t >+++ b/t/db_dependent/Acquisition/OrderUsers.t >@@ -50,7 +50,6 @@ my $order = Koha::Acquisition::Order->new( > entrydate => '01-01-2014', > currency => 'EUR', > notes => "This is a note1", >- gstrate => 0.0500, > orderstatus => 1, > quantityreceived => 0, > rrp => 10, >-- >2.7.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 18115
:
60217
|
60249
|
60811
|
60834
|
60888