Bugzilla – Attachment 29623 Details for
Bug 11733
"gist" system preference inconsistently treated as single-value or multi-value
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11733: gist can be multi-valued
Bug-11733-gist-can-be-multi-valued.patch (text/plain), 2.83 KB, created by
Jonathan Druart
on 2014-07-11 10:40:33 UTC
(
hide
)
Description:
Bug 11733: gist can be multi-valued
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2014-07-11 10:40:33 UTC
Size:
2.83 KB
patch
obsolete
>From 9588f6eb875b95258f7274dc9ea80256dfe46d29 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Thu, 6 Mar 2014 10:40:50 +0100 >Subject: [PATCH] Bug 11733: gist can be multi-valued > >The gist syspref should always be treated as multi-value. > >In basketgroup.pl, parcel.pl and invoice.pl it is treated as >single-value. >The invoice.pl script will be fixed by bug 10613. > >If the pref contains several values, the first one is the default one >(according to the syspref description). > >Test plan: >basketgroup.pl: > create a vendor with List prices don't include tax and invoice prices include tax. > add 1 basket with 1+ order(s) > receive them and check that the total amount on the basket page is the > same as on the basketgroup page >Verify this is right for other vendor configurations. > >On parcel.pl, this patch only removes dead code. The $gst variable is >not used. >--- > acqui/basketgroup.pl | 11 ++++++----- > acqui/parcel.pl | 1 - > 2 files changed, 6 insertions(+), 6 deletions(-) > >diff --git a/acqui/basketgroup.pl b/acqui/basketgroup.pl >index cdb392d..b81bdf8 100755 >--- a/acqui/basketgroup.pl >+++ b/acqui/basketgroup.pl >@@ -77,10 +77,6 @@ sub BasketTotal { > my @orders = GetOrders($basketno); > for my $order (@orders){ > $total = $total + ( $order->{ecost} * $order->{quantity} ); >- if ($bookseller->{invoiceincgst} && ! $bookseller->{listincgst} && ( $bookseller->{gstrate} // C4::Context->preference("gist") )) { >- my $gst = $bookseller->{gstrate} // C4::Context->preference("gist"); >- $total = $total * ( $gst / 100 +1); >- } > } > $total .= " " . ($bookseller->{invoiceprice} // 0); > return $total; >@@ -230,7 +226,12 @@ sub printbasketgrouppdf{ > -type => 'application/pdf', > -attachment => ( $basketgroup->{name} || $basketgroupid ) . '.pdf' > ); >- my $pdf = printpdf($basketgroup, $bookseller, $baskets, \%orders, $bookseller->{gstrate} // C4::Context->preference("gist")) || die "pdf generation failed"; >+ my $gstrate = $bookseller->{gstrate}; >+ unless ( defined $gstrate ) { >+ ( $gstrate ) = split /\|/, C4::Context->preference("gist"); >+ } >+ >+ my $pdf = printpdf($basketgroup, $bookseller, $baskets, \%orders, $gstrate) || die "pdf generation failed"; > print $pdf; > > } >diff --git a/acqui/parcel.pl b/acqui/parcel.pl >index 557030c..0ba0282 100755 >--- a/acqui/parcel.pl >+++ b/acqui/parcel.pl >@@ -146,7 +146,6 @@ unless( $invoiceid and $invoice->{invoiceid} ) { > > my $booksellerid = $invoice->{booksellerid}; > my $bookseller = GetBookSellerFromId($booksellerid); >-my $gst = $bookseller->{gstrate} // C4::Context->preference("gist") // 0; > my $datereceived = C4::Dates->new(); > > my $cfstr = "%.2f"; # currency format string -- could get this from currency table. >-- >2.0.0.rc2
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 11733
:
25888
| 29623 |
34198