=item order
-
-
=back
=cut
$booksellerid = $basket->{booksellerid} unless $booksellerid;
my @booksellers = GetBookSeller($booksellerid);
my $count2 = scalar @booksellers;
+# FIXME: do something with count2?
+# FIXME: how do you know the first BookSeller in the array is the one you want?
+# FIXME: GetBookSeller should be changing to reliably return 1 record based on ID,
+# but we still should give some kind of Error back to the user if it fails.
# get librarian branch...
if ( C4::Context->preference("IndependantBranches") ) {
my $userenv = C4::Context->userenv;
unless ( $userenv->{flags} == 1 ) {
my $validtest = ( $basket->{creationdate} eq '' )
- || ( $basket->{branch} eq '' )
|| ( $userenv->{branch} eq $basket->{branch} )
|| ( $userenv->{branch} eq '' )
|| ( $basket->{branch} eq '' );
sprintf "loggedinuser: $loggedinuser; creationdate: %s; authorisedby: %s",
$basket->{creationdate}, $basket->{authorisedby} ;
-
-my ( $count, @results );
-@results = GetOrders( $basketno, $order );
-$count = scalar @results;
+my @results = GetOrders( $basketno, $order );
+my $count = scalar @results;
my $line_total; # total of each line
my $sub_total; # total of line totals
}
my $prefgist = C4::Context->preference("gist");
$gist = sprintf( "%.2f", $sub_total * $prefgist );
-$grand_total = $sub_total + $gist;
-$grand_total_est = $sub_total_est + sprintf( "%.2f", $sub_total_est * $prefgist );
+$grand_total = $sub_total;
+$grand_total_est = $sub_total_est;
+unless ($booksellers[0]->{'listincgst'}) {
+ $grand_total += $gist;
+ $grand_total_est += sprintf( "%.2f", $sub_total_est * $prefgist );
+}
my $grand_total_rrp = sprintf( "%.2f", $sub_total_rrp );
$gist_est = sprintf( "%.2f", $sub_total_est * $prefgist );
$template->param(
grand_total_rrp => $grand_total_rrp,
currency => $booksellers[0]->{'listprice'},
qty_total => $qty_total,
- GST => C4::Context->preference("gist"),
+ GST => $prefgist,
);
output_html_with_http_headers $query, $cookie, $template->output;