Bug 23049: Update existing code to use debit_type
[srvgit] / koha-tmpl / intranet-tmpl / prog / en / modules / members / paycollect.tt
index dfd4935..bc0cefa 100644 (file)
     <input type="hidden" name="pay_individual" id="pay_individual" value="[% pay_individual | html %]" />
     <input type="hidden" name="itemnumber" id="itemnumber" value="[% itemnumber | html %]" />
     <input type="hidden" name="description" id="description" value="[% description | html %]" />
-    <input type="hidden" name="accounttype" id="accounttype" value="[% accounttype | html %]" />
+    <input type="hidden" name="debit_type_code" id="debit_type_code" value="[% debit_type_code | html %]" />
     <input type="hidden" name="amount" id="amount" value="[% amount | html %]" />
     <input type="hidden" name="amountoutstanding" id="amountoutstanding" value="[% amountoutstanding | html %]" />
     <input type="hidden" name="accountlines_id" id="accountlines_id" value="[% accountlines_id | html %]" />
     <input type="hidden" name="title" id="title" value="[% title | html %]" />
+    <input type="hidden" name="change_given" id="change_given" />
 
 <fieldset class="rows">
     <legend>Pay an individual fine</legend>
@@ -96,7 +97,7 @@
             <td>
                 [% individual_description | html %]
             </td>
-            <td>[% accounttype | html %]</td>
+            <td>[% debit_type_code | html %]</td>
             <td class="debit">[% amount | format('%.2f') %]</td>
             <td class="debit">[% amountoutstanding | format('%.2f') %]</td>
         </tr></tbody>
     <input type="hidden" name="pay_individual" id="pay_individual" value="[% pay_individual | html %]" />
     <input type="hidden" name="itemnumber" id="itemnumber" value="[% itemnumber | html %]" />
     <input type="hidden" name="description" id="description" value="[% description | html %]" />
-    <input type="hidden" name="accounttype" id="accounttype" value="[% accounttype | html %]" />
+    <input type="hidden" name="debit_type_code" id="debit_type_code" value="[% debit_type_code | html %]" />
     <input type="hidden" name="amount" id="amount" value="[% amount | html %]" />
     <input type="hidden" name="accountlines_id" id="accountlines_id" value="[% accountlines_id | html %]" />
     <input type="hidden" name="title" id="title" value="[% title | html %]" />
     <input type="hidden" name="payment_note" id="payment_note" value="[% payment_note | html %]" />
     <input type="hidden" name="amountoutstanding" id="amountoutstanding" value="[% amountoutstanding | html %]" />
     <input type="hidden" name="confirm_writeoff" id="confirm_writeoff" value="1" />
+    <input type="hidden" name="change_given" id="change_given" />
     <table>
     <thead><tr>
             <th>Description</th>
     <tfoot><tr><td colspan="3">Total amount outstanding:</td><td>[% amountoutstanding | format('%.2f') %]</td></tr></tfoot>
     <tbody><tr>
             <td>[% description | html %] [% title | html %]</td>
-            <td>[% accounttype | html %]</td>
+            <td>[% debit_type_code | html %]</td>
             <td class="debit">[% amount | format('%.2f') %]</td>
             <td class="debit">[% amountoutstanding | format('%.2f') %]</td>
         </tr></tbody>
     <input type="hidden" name="selected_accts" id="selected_accts" value="[% selected_accts | html %]" />
     <input type="hidden" name="total" id="total" value="[% total | html %]" />
     <input type="hidden" name="type" value="[% type | html %]" />
+    <input type="hidden" name="change_given" id="change_given" />
 
     <fieldset class="rows">
     [% IF ( selected_accts ) %]
     <script>
         $(document).ready(function() {
             [% IF payment_id && Koha.Preference('FinePaymentAutoPopup') %]
-                window.open('/cgi-bin/koha/members/printfeercpt.pl?action=print&accountlines_id=[% payment_id | html %]&borrowernumber=[% patron.borrowernumber | html %]', '_blank');
+                window.open('/cgi-bin/koha/members/printfeercpt.pl?action=print&accountlines_id=[% payment_id | html %]&change_given=[% change_given | html %]&borrowernumber=[% patron.borrowernumber | html %]', '_blank');
             [% END %]
 
             var forms = $('#payindivfine, #payfine');
             change.innerHTML = Math.round(($('#collected')[0].value - $('#paid')[0].value) * 100) / 100;
             if (change.innerHTML <= 0) {
                 change.innerHTML = "0.00";
+                $('input[name="change_given"]').val('0.00');
             } else {
                 change.value = change.innerHTML;
                 moneyFormat(change);
                 change.innerHTML = change.value;
+                $('input[name="change_given"]').val(change.value);
             }
 
             $('#modal_change').html(change.innerHTML);