From d385caa16bfc0bed476bf0fb8326fbd8eb5d6231 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 Retested also with item-level_itypes set to biblio and made sure to delete relevant rows from accountlines table when using same item and patron: Scenario 1 works Scenario 2 works I have also manually tested the sql in C4::Circulation::LostItem and it seems to work from what I can see. Adding a test for that in t/db_dependent/Circulation/Chargelostitem.t was not trivial. I am not a test developer but if it really is needed someone with more experience developing mockups with the db should probably be able to do it. Signed-off-by: Eivin Giske Skaaren --- 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 aff6b09..f5defb9 100755 --- a/admin/itemtypes.pl +++ b/admin/itemtypes.pl @@ -235,7 +235,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 ); @@ -261,9 +261,6 @@ if ( $op eq 'list' ) { 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 d5a7e3c..36065d0 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 ) %] @@ -190,7 +191,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> @@ -263,7 +264,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> @@ -303,11 +304,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> -- 1.7.10.4