Bug 21427: Format prices on ordered/spent lists consistently
authorKatrin Fischer <katrin.fischer.83@web.de>
Fri, 11 Jan 2019 21:55:35 +0000 (22:55 +0100)
committerLucas Gass <lucas@bywatersolutions.com>
Wed, 6 Mar 2019 05:56:31 +0000 (05:56 +0000)
Some price information on the spent and ordered list already
used the $Price filter. With this patch all amounts should be
formatted according to the CurrencyFormat system preference.

Signed-off-by: Jack Kelliher <jke0429@stacmail.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

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

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

koha-tmpl/intranet-tmpl/prog/en/modules/acqui/ordered.tt
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/spent.tt

index 7b9c8b6..05071f5 100644 (file)
 <div id="doc3" class="yui-t2">
 
 <div id="bd">
-    <div id="yui-main">
-        <div class="yui-b">
+<div id="yui-main">
+    <div class="yui-b">
 
 <h1>Fund: [% fund_code %]</h1>
 <h2>Ordered</h2>
 
 <table id="spent">
-    <thead>
-    <tr>
-    <th class="anti-the"> Title </th>
-       <th> Order </th>
-       <th> Vendor </th>
-    <th> Item type </th>
-    <th> Left on order </th>
-       <th> Estimated cost per unit </th>
-    <th class="title-string"> Date ordered </th>
-       <th> Subtotal </th>
-    </tr>
-    </thead>
-    <tbody>
+<thead>
+<tr>
+<th class="anti-the"> Title </th>
+<th> Order </th>
+<th> Vendor </th>
+<th> Item type </th>
+<th> Left on order </th>
+<th> Estimated cost per unit </th>
+<th class="title-string"> Date ordered </th>
+<th> Subtotal </th>
+</tr>
+</thead>
+<tbody>
 [% FOREACH order IN ordered %]
-    <tr>
-       <td class="cell">
-            <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% order.biblionumber %]">
-           [% order.title %]
-            </a>
-       </td>
-       <td class="cell">
-        [% IF ( CAN_user_acquisition_order_manage ) %]
-            <a href="/cgi-bin/koha/acqui/neworderempty.pl?ordernumber=[% order.ordernumber %]&amp;booksellerid=[% order.booksellerid %]&amp;basketno=[% order.basketno %]">[% order.ordernumber %]</a>
-        [% ELSE %]
-            [% order.ordernumber %]
-        [% END %]
-       </td>
-       <td class="cell">
-           <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% order.booksellerid | uri %]">[% order.vendorname | html %]</a>
-       </td>
-       <td class="cell">
-        [% ItemTypes.GetDescription( order.itype ) %]
-       </td>
-       <td class="cell">
-           [% order.left %]
-       </td>
-    <td class="data cell">
-        [% order.ecost_tax_included | $Price %]
-       </td>
-    <td class="cell">
-        <span title="[% order.entrydate %]">[% order.entrydate | $KohaDates %]</span>
-       </td>
-    <td class="data cell">
-           [% order.subtotal %]
+<tr>
+<td class="cell">
+        <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% order.biblionumber %]">
+    [% order.title %]
+        </a>
+</td>
+<td class="cell">
+    [% IF ( CAN_user_acquisition_order_manage ) %]
+        <a href="/cgi-bin/koha/acqui/neworderempty.pl?ordernumber=[% order.ordernumber %]&amp;booksellerid=[% order.booksellerid %]&amp;basketno=[% order.basketno %]">[% order.ordernumber %]</a>
+    [% ELSE %]
+        [% order.ordernumber %]
+    [% END %]
+</td>
+<td class="cell">
+    <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% order.booksellerid | uri %]">[% order.vendorname | html %]</a>
+</td>
+<td class="cell">
+    [% ItemTypes.GetDescription( order.itype ) %]
+</td>
+<td class="cell">
+    [% order.left %]
+</td>
+<td class="data cell">
+    [% order.ecost_tax_included | $Price %]
+</td>
+<td class="cell">
+    <span title="[% order.entrydate %]">[% order.entrydate | $KohaDates %]</span>
+</td>
+<td class="data cell">
+           [% order.subtotal | $Price %]
        </td>
     </tr>
 [% END %]
     </tbody>
     <tfoot>
+    [% IF ( adjustments && adjustments.count > 0 ) %]
+            [% FOREACH adjustment IN adjustments %]
+                <tr>
+                    <td></td>
+                    <td colspan="6">Adjustment cost for invoice [% adjustment.invoiceid | html %]</td>
+                    <td class="data total">[% adjustment.adjustment | $Price %]</td>
+                </tr>
+            [% END %]
+
+    [% END %]
     <tr>
         <td> Total </td>
         <td> </td>
@@ -83,7 +93,7 @@
         <td> </td>
        <td> </td>
         <td class="data">
-            [% total %]
+            [% total | $Price %]
         </td>
     </tr>
     </tfoot>
index 97893b8..67a0cca 100644 (file)
@@ -73,6 +73,7 @@
             </td>
             <td class="data cell">
                 [% order.rowtotal %]
+                [% order.rowtotal | $Price %]
             </td>
         </tr>
     [% END %]
         [% IF shipmentcosts.size %]
             <tr valign="top">
                 <td colspan="9"> Sub total </td>
-                <td class="data"> [% subtotal %] </td>
+                <td class="data"> [% subtotal | $Price %] </td>
             </tr>
             [% FOREACH shipmentcost IN shipmentcosts %]
                 <tr>
                     <td></td>
-                    <td colspan="8">Shipping cost for invoice [% shipmentcost.invoicenumber %]</td>
-                    <td class="data total">[% shipmentcost.shipmentcost %]</td>
+                    <td colspan="8">Shipping cost for invoice [% shipmentcost.invoicenumber | html %]</td>
+                    <td class="data total">[% shipmentcost.shipmentcost | $Price %]</td>
+                </tr>
+            [% END %]
+        [% END %]
+        [% IF ( adjustments && adjustments.count > 0 ) %]
+            [% FOREACH adjustment IN adjustments %]
+                <tr>
+                    <td></td>
+                    <td colspan="8">Adjustment cost for invoice [% adjustment.invoiceid | html %]</td>
+                    <td class="data total">[% adjustment.adjustment | $Price %]</td>
                 </tr>
             [% END %]
         [% END %]
         <tr>
             <td colspan="9">TOTAL</td>
-            <td class="data total">[% total %]</td>
+            <td class="data total">[% total | $Price %]</td>
         </tr>
     </tfoot>
 </table>