Bug 22120: Add price formattig to patron summary print
authorKatrin Fischer <katrin.fischer.83@web.de>
Sun, 13 Jan 2019 10:15:27 +0000 (11:15 +0100)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Tue, 12 Feb 2019 13:14:00 +0000 (13:14 +0000)
The patron summary print lists the replacement prices
and rental charges of items and totals them. With this
patch they will be formatted according to the
CurrencyFormat system preference.

To test:
- Find or create a patron with some checkouts
- Make sure some items have replacement price set
  and some have a rental charge
- "Print summary" from the account in staff
- Verify that charges and prices in the checkouts
  table are formatted correctly
- Toggle CurrencyFormat to different settings

Signed-off-by: helene hickey <hickeyhe@wgc.school.nz>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 3c2cc8da26f7a907c0b51f928ffb100eefbfa692)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-print.tt
members/summary-print.pl

index dcf0cb4..10ee557 100644 (file)
                         <td>[% issue.itemtype_description | html %]</td>
                         <td>[% issue.date_due | $KohaDates  as_due_date => 1 %]</td>
                         <td>[% issue.barcode | html %]</td>
-                        <td>[% issue.charge | html %]</td>
-                        <td>[% issue.replacementprice | html %]</td>
+                        <td>[% issue.charge | $Price %]</td>
+                        <td>[% issue.replacementprice | $Price %]</td>
                         <td>[% IF ( issue.overdue ) %]Overdue![% ELSE %]&nbsp;[% END %]</td>
                     </tr>
                 [% END %]
 
             <tr>
                 <td colspan="6" style="text-align: right; font-weight:bold;">Totals:</td>
-                <td>[% totaldue | html %]</td>
-                <td>[% totalprice | html %]</td>
+                <td>[% totaldue | $Price %]</td>
+                <td>[% totalprice | $Price %]</td>
                 <td colspan="3">&nbsp;</td>
             </tr>
         </table>
index 352b497..76bb1d4 100755 (executable)
@@ -96,7 +96,7 @@ sub build_issue_data {
         $itemtype = Koha::ItemTypes->find( $itemtype );
         $checkout->{itemtype_description} = $itemtype->description; #FIXME Should not it be translated_description
 
-        $checkout->{charge} = sprintf( "%.2f", $charge ); # TODO Should be done in the template using Price
+        $checkout->{charge} = $charge;
 
         $checkout->{overdue} = $c->is_overdue;