Bug 25119: Fix account type and description for individual writeoffs/payments
authorKatrin Fischer <katrin.fischer.83@web.de>
Sat, 11 Apr 2020 12:02:03 +0000 (12:02 +0000)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Fri, 1 May 2020 14:43:56 +0000 (15:43 +0100)
When paying or writing off a single line from the list of pending charges,
the account type displayed the code instead of the description.

And when bug 23483 fixed the display of the description, 2 variables where
missed. This change is only visible when looking at the page source:

<input type="hidden" name="description" id="description" value="" />

With the patch applied, the value will be filled with the description.

To test:
- Create one or more manual invoices of different types
- Try to pay/write off using the buttons within the table
- Verify the account type shows as code, not description
- Apply patch
- Repeat
- Bonus points: Check the source code for the hidden input with description.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt

index 842f5e6..4f54f8a 100644 (file)
@@ -5,6 +5,7 @@
 [% USE Price %]
 [% SET footerjs = 1 %]
 [% PROCESS 'payments.inc' %]
+[% PROCESS 'accounts.inc' %]
 [% INCLUDE 'doc-head-open.inc' %]
 <title>Koha &rsaquo; Patrons &rsaquo;
     [% IF type == 'WRITEOFF' %]
@@ -83,7 +84,7 @@
     <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% patron.borrowernumber | html %]" />
     <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="description" id="description" value="[% individual_description | 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 %]" />
             <td>
                 [% individual_description | html %]
             </td>
-            <td>[% debit_type_code | html %]</td>
+            [% line.debit_type_code = debit_type_code %]
+            <td>[% PROCESS account_type_description account=line %]</td>
             <td class="debit">[% amount | format('%.2f') %]</td>
             <td class="debit">[% amountoutstanding | format('%.2f') %]</td>
         </tr></tbody>
     <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% patron.borrowernumber | html %]" />
     <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="description" id="description" value="[% individual_description | 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 %]" />
     <tfoot><tr><td colspan="3">Total amount outstanding:</td><td>[% amountoutstanding | format('%.2f') %]</td></tr></tfoot>
     <tbody><tr>
             <td>[% individual_description | html %]</td>
-            <td>[% debit_type_code | html %]</td>
+            [% line.debit_type_code = debit_type_code %]
+            <td>[% PROCESS account_type_description account=line %]</td>
             <td class="debit">[% amount | format('%.2f') %]</td>
             <td class="debit">[% amountoutstanding | format('%.2f') %]</td>
         </tr></tbody>