Bug 23805: (QA follow-up) Corrections for cash_register_stats
authorMartin Renvoize <martin.renvoize@ptfs-europe.com>
Thu, 31 Oct 2019 17:49:29 +0000 (17:49 +0000)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Thu, 31 Oct 2019 17:49:54 +0000 (17:49 +0000)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

koha-tmpl/intranet-tmpl/prog/en/modules/reports/cash_register_stats.tt
reports/cash_register_stats.pl

index dc2b1c8..cbcc27a 100644 (file)
                         <option value="ACT">All payments to the library</option>
                         [% END %]
 
-                        [% IF transaction_type == "C" %]
-                        <option value="C" selected="selected">Credit</option>
-                        [% ELSE %]
-                        <option value="C">Credit</option>
-                        [% END %]
-
-                        [% IF transaction_type == "CR" %]
-                        <option value="CR" selected="selected">Credit (item returned)</option>
-                        [% ELSE %]
-                        <option value="CR">Credit (item returned)</option>
-                        [% END %]
-
                         [% IF transaction_type == "FORW" %]
                         <option value="FORW" selected="selected">Write off</option>
                         [% ELSE %]
                         <option value="FORW">Write off</option>
                         [% END %]
 
-                        [% IF transaction_type == "PAY" %]
-                        <option value="PAY" selected="selected">Payment</option>
-                        [% ELSE %]
-                        <option value="PAY">Payment</option>
-                        [% END %]
-
                         [% FOREACH debit_type IN debit_types %]
                             [% IF transaction_type == debit_type.code %]
                             <option value="[% debit_type.code | html %]" selected="selected">[% debit_type.description | html %]</option>
                             <option value="[% debit_type.code | html %]">[% debit_type.description | html %]</option>
                             [% END %]
                         [% END %]
+                        
+                        [% FOREACH credit_type IN credit_types %]
+                            [% IF transaction_type == credit_type.code %]
+                            <option value="[% credit_type.code | html %]" selected="selected">[% credit_type.description | html %]</option>
+                            [% ELSE %]
+                            <option value="[% credit_type.code | html %]">[% credit_type.description | html %]</option>
+                            [% END %]
+                        [% END %]
                     </select>
                 </li>
                 <li>
index 84ce194..37aaace 100755 (executable)
@@ -58,6 +58,8 @@ my $toDate   = dt_from_string;
 
 my @debit_types =
   Koha::Account::DebitTypes->search()->as_list;
+my @credit_types =
+  Koha::Account::CreditTypes->search()->as_list;
 
 if ($do_it) {
 
@@ -187,6 +189,7 @@ $template->param(
     transaction_type => $transaction_type,
     branchloop       => Koha::Libraries->search({}, { order_by => ['branchname'] })->unblessed,
     debit_types      => \@debit_types,
+    credit_types     => \@credit_types,
     CGIsepChoice => GetDelimiterChoices,
 );