Bug 9374: Only 0.00 prices must have class error in basket.tt
authorMathieu Saby <mathieu.saby@univ-rennes2.fr>
Sun, 15 Sep 2013 11:09:20 +0000 (13:09 +0200)
committerGalen Charlton <gmc@esilibrary.com>
Fri, 1 Nov 2013 00:03:18 +0000 (00:03 +0000)
A regexp '^0' in basket.tt is used to give the class "error" to null prices.
It is wrong, because it matches prices like "0.15". It should only match "0.00".

To test :
- apply the patch
- display a basket with an order with a price between 0 and 1 (like "0.50") and an order with a price stricty null ("0.00")
- only the "0.00" price should be displayed in red

Signed-off-by: Cedric Vita <cedric.vita@dracenie.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt

index 2bf26fb..3d4cf43 100644 (file)
                               </p>
                             [% END %]
                         </td>
-                        <td class="number gste [% IF books_loo.rrpgste.search('^0') %]error[% END %]">[% books_loo.rrpgste %]</td>
-                        <td class="number gste [% IF books_loo.ecostgste.search('^0') %]error[% END %]">[% books_loo.ecostgste %]</td>
-                        <td class="number gsti [% IF books_loo.rrpgsti.search('^0') %]error[% END %]">[% books_loo.rrpgsti %]</td>
-                        <td class="number gsti [% IF books_loo.ecostgsti.search('^0') %]error[% END %]">[% books_loo.ecostgsti %]</td>
-                        <td class="number [% IF books_loo.quantity.search('^0') %]error[% END %]">[% books_loo.quantity %]</td>
-                        <td class="number gste [% IF books_loo.totalgste.search('^0') %]error[% END %]">[% books_loo.totalgste %]</td>
-                        <td class="number gsti [% IF books_loo.totalgsti.search('^0') %]error[% END %]">[% books_loo.totalgsti %]</td>
-                        <td class="number [% IF books_loo.gstgsti.search('^0') %]error[% END %]">[% books_loo.gstgsti %]</td>
-                        <td class="number [% IF books_loo.gstvalue.search('^0') %]error[% END %]">[% books_loo.gstvalue %]</td>
+                        <td class="number gste [% IF books_loo.rrpgste.search('^0.00') %]error[% END %]">[% books_loo.rrpgste %]</td>
+                        <td class="number gste [% IF books_loo.ecostgste.search('^0.00') %]error[% END %]">[% books_loo.ecostgste %]</td>
+                        <td class="number gsti [% IF books_loo.rrpgsti.search('^0.00') %]error[% END %]">[% books_loo.rrpgsti %]</td>
+                        <td class="number gsti [% IF books_loo.ecostgsti.search('^0.00') %]error[% END %]">[% books_loo.ecostgsti %]</td>
+                        <td class="number [% IF books_loo.quantity.search('^0.00') %]error[% END %]">[% books_loo.quantity %]</td>
+                        <td class="number gste [% IF books_loo.totalgste.search('^0.00') %]error[% END %]">[% books_loo.totalgste %]</td>
+                        <td class="number gsti [% IF books_loo.totalgsti.search('^0.00') %]error[% END %]">[% books_loo.totalgsti %]</td>
+                        <td class="number [% IF books_loo.gstgsti.search('^0.00') %]error[% END %]">[% books_loo.gstgsti %]</td>
+                        <td class="number [% IF books_loo.gstvalue.search('^0.00') %]error[% END %]">[% books_loo.gstvalue %]</td>
                         <td>[% books_loo.budget_name %]</td>
                         [% IF ( active ) %]
                             [% UNLESS ( closedate ) %]