@@ -, +, @@ --- acqui/basket.pl | 44 ++++++++++---------- acqui/basketgroup.pl | 36 ++++++++-------- acqui/neworderempty.pl | 10 ++--- .../intranet-tmpl/prog/en/modules/acqui/basket.tt | 35 ++++++++-------- .../prog/en/modules/acqui/neworderempty.tt | 33 ++++++++------- 5 files changed, 79 insertions(+), 79 deletions(-) --- a/acqui/basket.pl +++ a/acqui/basket.pl @@ -306,7 +306,7 @@ if ( $op eq 'delete_confirm' ) { my @cancelledorders = GetCancelledOrders($basketno); foreach (@cancelledorders) { - $_->{'line_total'} = sprintf("%.2f", $_->{'ecost'} * $_->{'quantity'}); + $_->{'line_total'} = $_->{'ecost'} * $_->{'quantity'}; } $template->param( @@ -330,9 +330,9 @@ if ( $op eq 'delete_confirm' ) { book_foot_loop => \@book_foot_loop, cancelledorders_loop => \@cancelledorders, total_quantity => $total_quantity, - total_gste => sprintf( "%.2f", $total_gste ), - total_gsti => sprintf( "%.2f", $total_gsti ), - total_gstvalue => sprintf( "%.2f", $total_gstvalue ), + total_gste => $total_gste, + total_gsti => $total_gsti, + total_gstvalue => $total_gstvalue, currency => $cur->{'currency'}, listincgst => $bookseller->{listincgst}, basketgroups => $basketgroups, @@ -358,25 +358,25 @@ sub get_order_infos { $line{budget_name} = $budget->{budget_name}; $line{rrp} = ConvertCurrency( $order->{'currency'}, $line{rrp} ); # FIXME from comm if ( $bookseller->{'listincgst'} ) { - $line{rrpgsti} = sprintf( "%.2f", $line{rrp} ); - $line{gstgsti} = sprintf( "%.2f", $line{gstrate} * 100 ); - $line{rrpgste} = sprintf( "%.2f", $line{rrp} / ( 1 + ( $line{gstgsti} / 100 ) ) ); - $line{gstgste} = sprintf( "%.2f", $line{gstgsti} / ( 1 + ( $line{gstgsti} / 100 ) ) ); - $line{ecostgsti} = sprintf( "%.2f", $line{ecost} ); - $line{ecostgste} = sprintf( "%.2f", $line{ecost} / ( 1 + ( $line{gstgsti} / 100 ) ) ); - $line{gstvalue} = sprintf( "%.2f", ( $line{ecostgsti} - $line{ecostgste} ) * $line{quantity}); - $line{totalgste} = sprintf( "%.2f", $order->{quantity} * $line{ecostgste} ); - $line{totalgsti} = sprintf( "%.2f", $order->{quantity} * $line{ecostgsti} ); + $line{rrpgsti} = $line{rrp}; + $line{gstgsti} = $line{gstrate} * 100; + $line{rrpgste} = $line{rrp} / ( 1 + ( $line{gstgsti} / 100 ) ); + $line{gstgste} = $line{gstgsti} / ( 1 + ( $line{gstgsti} / 100 ) ); + $line{ecostgsti} = $line{ecost}; + $line{ecostgste} = $line{ecost} / ( 1 + ( $line{gstgsti} / 100 ) ); + $line{gstvalue} = ( $line{ecostgsti} - $line{ecostgste} ) * $line{quantity}; + $line{totalgste} = $order->{quantity} * $line{ecostgste}; + $line{totalgsti} = $order->{quantity} * $line{ecostgsti}; } else { - $line{rrpgsti} = sprintf( "%.2f", $line{rrp} * ( 1 + ( $line{gstrate} ) ) ); - $line{rrpgste} = sprintf( "%.2f", $line{rrp} ); - $line{gstgsti} = sprintf( "%.2f", $line{gstrate} * 100 ); - $line{gstgste} = sprintf( "%.2f", $line{gstrate} * 100 ); - $line{ecostgsti} = sprintf( "%.2f", $line{ecost} * ( 1 + ( $line{gstrate} ) ) ); - $line{ecostgste} = sprintf( "%.2f", $line{ecost} ); - $line{gstvalue} = sprintf( "%.2f", ( $line{ecostgsti} - $line{ecostgste} ) * $line{quantity}); - $line{totalgste} = sprintf( "%.2f", $order->{quantity} * $line{ecostgste} ); - $line{totalgsti} = sprintf( "%.2f", $order->{quantity} * $line{ecostgsti} ); + $line{rrpgsti} = $line{rrp} * ( 1 + ( $line{gstrate} ) ); + $line{rrpgste} = $line{rrp}; + $line{gstgsti} = $line{gstrate} * 100; + $line{gstgste} = $line{gstrate} * 100; + $line{ecostgsti} = $line{ecost} * ( 1 + ( $line{gstrate} ) ); + $line{ecostgste} = $line{ecost}; + $line{gstvalue} = ( $line{ecostgsti} - $line{ecostgste} ) * $line{quantity}; + $line{totalgste} = $order->{quantity} * $line{ecostgste}; + $line{totalgsti} = $order->{quantity} * $line{ecostgsti}; } if ( $line{uncertainprice} ) { --- a/acqui/basketgroup.pl +++ a/acqui/basketgroup.pl @@ -233,25 +233,25 @@ sub printbasketgrouppdf{ $ord->{rrp} = ConvertCurrency( $ord->{'currency'}, $ord->{rrp} ); if ( $bookseller->{'listincgst'} ) { - $ord->{rrpgsti} = sprintf( "%.2f", $ord->{rrp} ); - $ord->{gstgsti} = sprintf( "%.2f", $ord->{gstrate} * 100 ); - $ord->{rrpgste} = sprintf( "%.2f", $ord->{rrp} / ( 1 + ( $ord->{gstgsti} / 100 ) ) ); - $ord->{gstgste} = sprintf( "%.2f", $ord->{gstgsti} / ( 1 + ( $ord->{gstgsti} / 100 ) ) ); - $ord->{ecostgsti} = sprintf( "%.2f", $ord->{ecost} ); - $ord->{ecostgste} = sprintf( "%.2f", $ord->{ecost} / ( 1 + ( $ord->{gstgsti} / 100 ) ) ); - $ord->{gstvalue} = sprintf( "%.2f", ( $ord->{ecostgsti} - $ord->{ecostgste} ) * $ord->{quantity}); - $ord->{totalgste} = sprintf( "%.2f", $ord->{quantity} * $ord->{ecostgste} ); - $ord->{totalgsti} = sprintf( "%.2f", $ord->{quantity} * $ord->{ecostgsti} ); + $ord->{rrpgsti} = Koha::Prices::format( $ord->{rrp} ); + $ord->{gstgsti} = Koha::Prices::format( $ord->{gstrate} * 100 ); + $ord->{rrpgste} = Koha::Prices::format( $ord->{rrp} / ( 1 + ( $ord->{gstgsti} / 100 ) ) ); + $ord->{gstgste} = Koha::Prices::format( $ord->{gstgsti} / ( 1 + ( $ord->{gstgsti} / 100 ) ) ); + $ord->{ecostgsti} = Koha::Prices::format( $ord->{ecost} ); + $ord->{ecostgste} = Koha::Prices::format( $ord->{ecost} / ( 1 + ( $ord->{gstgsti} / 100 ) ) ); + $ord->{gstvalue} = Koha::Prices::format( ( $ord->{ecostgsti} - $ord->{ecostgste} ) * $ord->{quantity}); + $ord->{totalgste} = Koha::Prices::format( $ord->{quantity} * $ord->{ecostgste} ); + $ord->{totalgsti} = Koha::Prices::format( $ord->{quantity} * $ord->{ecostgsti} ); } else { - $ord->{rrpgsti} = sprintf( "%.2f", $ord->{rrp} * ( 1 + ( $ord->{gstrate} ) ) ); - $ord->{rrpgste} = sprintf( "%.2f", $ord->{rrp} ); - $ord->{gstgsti} = sprintf( "%.2f", $ord->{gstrate} * 100 ); - $ord->{gstgste} = sprintf( "%.2f", $ord->{gstrate} * 100 ); - $ord->{ecostgsti} = sprintf( "%.2f", $ord->{ecost} * ( 1 + ( $ord->{gstrate} ) ) ); - $ord->{ecostgste} = sprintf( "%.2f", $ord->{ecost} ); - $ord->{gstvalue} = sprintf( "%.2f", ( $ord->{ecostgsti} - $ord->{ecostgste} ) * $ord->{quantity}); - $ord->{totalgste} = sprintf( "%.2f", $ord->{quantity} * $ord->{ecostgste} ); - $ord->{totalgsti} = sprintf( "%.2f", $ord->{quantity} * $ord->{ecostgsti} ); + $ord->{rrpgsti} = Koha::Prices::format( $ord->{rrp} * ( 1 + ( $ord->{gstrate} ) ) ); + $ord->{rrpgste} = Koha::Prices::format( $ord->{rrp} ); + $ord->{gstgsti} = Koha::Prices::format( $ord->{gstrate} * 100 ); + $ord->{gstgste} = Koha::Prices::format( $ord->{gstrate} * 100 ); + $ord->{ecostgsti} = Koha::Prices::format( $ord->{ecost} * ( 1 + ( $ord->{gstrate} ) ) ); + $ord->{ecostgste} = Koha::Prices::format( $ord->{ecost} ); + $ord->{gstvalue} = Koha::Prices::format( ( $ord->{ecostgsti} - $ord->{ecostgste} ) * $ord->{quantity}); + $ord->{totalgste} = Koha::Prices::format( $ord->{quantity} * $ord->{ecostgste} ); + $ord->{totalgsti} = Koha::Prices::format( $ord->{quantity} * $ord->{ecostgsti} ); } my $bib = GetBiblioData($ord->{biblionumber}); my $itemtypes = GetItemTypes(); --- a/acqui/neworderempty.pl +++ a/acqui/neworderempty.pl @@ -379,9 +379,7 @@ $template->param( biblionumber => $biblionumber, uncertainprice => $data->{'uncertainprice'}, authorisedbyname => $borrower->{'firstname'} . " " . $borrower->{'surname'}, - discount_2dp => sprintf( "%.2f", $bookseller->{'discount'} ) , # for display discount => $bookseller->{'discount'}, - orderdiscount_2dp => sprintf( "%.2f", $data->{'discount'} || 0 ), orderdiscount => $data->{'discount'}, listincgst => $bookseller->{'listincgst'}, invoiceincgst => $bookseller->{'invoiceincgst'}, @@ -405,10 +403,10 @@ $template->param( gst_values => \@gst_values, gstrate => $data->{gstrate} ? $data->{gstrate}+0.0 : $bookseller->{gstrate} ? $bookseller->{gstrate}+0.0 : 0, gstreg => $bookseller->{'gstreg'}, - listprice => sprintf( "%.2f", $data->{listprice} || $data->{price} || $listprice), - total => sprintf( "%.2f", ($data->{ecost} || 0) * ($data->{'quantity'} || 0) ), - ecost => sprintf( "%.2f", $data->{ecost} || 0), - unitprice => sprintf( "%.2f", $data->{unitprice} || 0), + listprice => $data->{listprice} || $data->{price} || $listprice, + total => ($data->{ecost} || 0) * ($data->{'quantity'} || 0), + ecost => $data->{ecost} || 0, + unitprice => $data->{unitprice} || 0, publishercode => $data->{'publishercode'}, barcode_subfield => $barcode_subfield, import_batch_id => $import_batch_id, --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt @@ -1,4 +1,5 @@ [% USE KohaDates %] +[% USE FormatNum %] [% INCLUDE 'doc-head-open.inc' %]
[Add note]
[% END %] -