From cde0a1aad457152f0303ab96c1bc3aee292ef193 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 1 Sep 2015 14:43:28 +0100 Subject: [PATCH] Bug 12768: Use the Price TT plugin to display prices --- admin/itemtypes.pl | 5 +---- koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt | 11 ++++++----- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/admin/itemtypes.pl b/admin/itemtypes.pl index 69aeb5f..a3b24f3 100755 --- a/admin/itemtypes.pl +++ b/admin/itemtypes.pl @@ -232,7 +232,7 @@ elsif ( $op eq 'delete_confirm' ) { $template->param( itemtype => $itemtype, description => $data->{description}, - rentalcharge => sprintf( "%.2f", $data->{rentalcharge} ), + rentalcharge => $data->{rentalcharge}, imageurl => $data->{imageurl}, total => $total ); @@ -257,9 +257,6 @@ else { # DEFAULT my @loop; foreach my $itemtype ( @{$results} ) { $itemtype->{imageurl} = getitemtypeimagelocation( 'intranet', $itemtype->{imageurl} ); - $itemtype->{rentalcharge} = sprintf( '%.2f', $itemtype->{rentalcharge} ); - $itemtype->{defaultreplacecost} = sprintf( '%.2f', $itemtype->{defaultreplacecost} ); - $itemtype->{processfee} = sprintf( '%.2f', $itemtype->{processfee} ); push( @loop, $itemtype ); } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt index f26a0c9..2ec2d2f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt @@ -1,4 +1,5 @@ [% USE AuthorisedValues %] +[% USE Price %] [% INCLUDE 'doc-head-open.inc' %] Koha › Administration › Item types [% IF ( add_form ) %]› [% IF ( itemtype ) %] @@ -174,7 +175,7 @@ Item types administration </li> <li> <label for="rentalcharge">Rental charge: </label> - <input type="text" id="rentalcharge" name="rentalcharge" size="10" value="[% rentalcharge %]" /> + <input type="text" id="rentalcharge" name="rentalcharge" size="10" value="[% rentalcharge %]" /> </li> <li> <label for="defaultreplacecost">Default replacement cost: </label> @@ -247,7 +248,7 @@ Item types administration <tr><th scope="row">Description</th><td>[% description %]</td></tr> <tr><th scope="row">Loan length</th><td>[% loanlength %]</td></tr> -<tr><th scope="row">Rental charge</th><td>[% rentalcharge %]</td></tr></table> +<tr><th scope="row">Rental charge</th><td>[% Pricerentalcharge | $Price %]</td></tr></table> <form action="[% script_name %]" method="post"> <input type="hidden" name="op" value="delete_confirmed" /><input type="hidden" name="itemtype" value="[% itemtype %]" />[% IF ( total ) %] </form> @@ -287,11 +288,11 @@ Item types administration <td>[% IF ( loo.notforloan ) %]Yes[% ELSE %] [% END %]</td> <td> [% UNLESS ( loo.notforloan ) %] - [% loo.rentalcharge %] + [% loo.rentalcharge | $Price %] [% END %] </td> - <td>[% loo.defaultreplacecost %]</td> - <td>[% loo.processfee %]</td> + <td>[% loo.defaultreplacecost | $Price %]</td> + <td>[% loo.processfee | $Price %]</td> <td>[% loo.checkinmsg | html_line_break %]</td> <td> <a href="[% loo.script_name %]?op=add_form&itemtype=[% loo.itemtype |html %]">Edit</a> -- 2.1.0