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)
committerLucas Gass <lucas@bywatersolutions.com>
Tue, 12 Feb 2019 23:45:14 +0000 (23:45 +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>
(cherry picked from commit 3638172077c95f0cba2f0e190f245e598e4b004d)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>

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

index 0fe2e7e..9a395bb 100644 (file)
                             [% issue.title |html %]
                             <a href="/cgi-bin/koha/catalogue/detail.pl?item=[% issue.itemnumber %]&amp;biblionumber=[% issue.biblionumber %]&amp;bi=[% issue.biblioitemnumber %]"></a>
                         </td>
-                        <td>[% issue.author %]</td>
-                        <td>[% issue.itemcallnumber %]</td>
-                        <td>[% issue.itemtype_description %]</td>
-                        <td>[% issue.date_due | $KohaDates as_due_date => 1 %]</td>
-                        <td>[% issue.barcode %]</td>
-                        <td>[% issue.charge %]</td>
-                        <td>[% issue.replacementprice %]</td>
+                        <td>[% issue.author | html %]</td>
+                        <td>[% issue.itemcallnumber | html %]</td>
+                        <td>[% issue.itemtype_description | html %]</td>
+                        <td>[% issue.date_due | $KohaDates  as_due_date => 1 %]</td>
+                        <td>[% issue.barcode | 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 %]</td>
-                <td>[% totalprice %]</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;