@@ -, +, @@ --- acqui/basketgroup.pl | 17 +++++++++++++---- acqui/parcel.pl | 1 - 2 files changed, 13 insertions(+), 5 deletions(-) --- a/acqui/basketgroup.pl +++ a/acqui/basketgroup.pl @@ -77,9 +77,13 @@ 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); + if ( $bookseller->{invoiceincgst} && !$bookseller->{listincgst} ) { + my $gst = $bookseller->{gstrate}; + unless ( defined $gst ) { + ($gst) = split /\|/, C4::Context->preference("gist"); + } + $gst //= 0; + $total = $total * ( $gst / 100 + 1 ); } } $total .= " " . ($bookseller->{invoiceprice} // 0); @@ -225,7 +229,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; } --- a/acqui/parcel.pl +++ a/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. --