From 89ae6cc3bfea81dea8d6995965a44b92c34764aa Mon Sep 17 00:00:00 2001 From: Katrin Fischer Date: Sat, 5 Jan 2019 06:45:05 +0000 Subject: [PATCH] Bug 22116: Add price formatting to rental charge and replacement price on items tab in staff Adds formatting to replacement price and rental charge on items tab. To test: - Add a rental charge to one or more of your item types - Edit a record with some items, add replacement cost to some - Find or create a record with your rental charged itemtype (MARC21:942$c) - Go to the staff detail page of those records - Check "Items" tab for - Rental charge on top - Replacement price for items - Verify information is displayed correctly when toggling CurrencyFormat system preference Signed-off-by: Jack Kelliher Signed-off-by: Martin Renvoize Signed-off-by: Nick Clemens --- catalogue/moredetail.pl | 4 ++-- .../intranet-tmpl/prog/en/modules/catalogue/moredetail.tt | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/catalogue/moredetail.pl b/catalogue/moredetail.pl index ba599370e3..6adcca9008 100755 --- a/catalogue/moredetail.pl +++ b/catalogue/moredetail.pl @@ -128,7 +128,7 @@ my $itemtypes = { map { $_->{itemtype} => $_ } @{ Koha::ItemTypes->search_with_l $data->{'itemtypename'} = $itemtypes->{ $data->{'itemtype'} }->{'translated_description'} if $data->{itemtype} && exists $itemtypes->{ $data->{itemtype} }; -$data->{'rentalcharge'} = sprintf( "%.2f", $data->{'rentalcharge'} || 0); # Price formatting should be done template-side +$data->{'rentalcharge'} = $data->{'rentalcharge'}; foreach ( keys %{$data} ) { $template->param( "$_" => defined $data->{$_} ? $data->{$_} : '' ); } @@ -138,7 +138,7 @@ foreach my $item (@items){ $item->{object} = Koha::Items->find( $item->{itemnumber} ); $item->{'collection'} = $ccodes->{ $item->{ccode} } if $ccodes && $item->{ccode} && exists $ccodes->{ $item->{ccode} }; $item->{'itype'} = $itemtypes->{ $item->{'itype'} }->{'translated_description'} if exists $itemtypes->{ $item->{'itype'} }; - $item->{'replacementprice'} = sprintf( "%.2f", $item->{'replacementprice'} || 0 ); # Price formatting should be done template-side + $item->{'replacementprice'} = $item->{'replacementprice'}; if ( defined $item->{'copynumber'} ) { $item->{'displaycopy'} = 1; if ( defined $copynumbers->{ $item->{'copynumber'} } ) { diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt index 4474432d93..dcf37b7357 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt @@ -2,6 +2,7 @@ [% USE Asset %] [% USE Koha %] [% USE Branches %] +[% USE Price %] [% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] Koha › Catalog › Item details for [% title | html %] [% FOREACH subtitl IN subtitle %] [% subtitl.subfield | html %][% END %] @@ -32,7 +33,7 @@ [% UNLESS ( item_level_itypes ) %]
  • Item type: [% itemtypename | html %] 
  • [% END %] - [% IF ( rentalcharge ) %]
  • Rental charge:[% rentalcharge | html %] 
  • [% END %] + [% IF ( rentalcharge ) %]
  • Rental charge:[% rentalcharge | $Price %] 
  • [% END %]
  • ISBN: [% isbn | html %] 
  • Publisher:[% place | html %] [% publishercode | html %] [% publicationyear | html %] 
  • [% IF ( volumeddesc ) %]
  • Volume: [% volumeddesc | html %]
  • [% END %] @@ -62,7 +63,7 @@ [% IF ( ITEM_DAT.collection ) %]
  • Collection: [% ITEM_DAT.collection | html %]
  • [% END %]
  • Item callnumber: [% ITEM_DAT.itemcallnumber | html %] 
  • [% IF ( ITEM_DAT.displaycopy ) %]
  • Copy number: [% ITEM_DAT.copyvol | html %] 
  • [% END %] - [% IF ( ITEM_DAT.replacementprice ) %]
  • Replacement price: [% ITEM_DAT.replacementprice | html %] 
  • [% END %] + [% IF ( ITEM_DAT.replacementprice ) %]
  • Replacement price: [% ITEM_DAT.replacementprice | $Price %] 
  • [% END %] [% IF ITEM_DAT.materials %]
  • Materials specified: [% ITEM_DAT.materials | html %]
  • [% END %]

    Statuses [% IF ( ITEM_DAT.status_advisory ) %]( -- 2.39.5