Bug 26403: Use accounts include in account management pages

This patch updates the credit and debit types management pages to use
the proper includes for handling system type translations.  This is how
it should have been done in the first place on the original bugs that
introduced the management of these types but for some reason I think it
got dropped during the QA process leading to confusion around these
system types with their fixed descriptions.

To test:
1. Apply patch
2. Apply the translations
   ./misc/translator/translate install xx-XX
3. In the staff interface, go to Administration > Credit types
   --> They should be translated
4. Go to Administration > Debit types
   --> They should be translated

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Martin Renvoize 2023-05-10 07:37:55 +01:00 committed by Tomas Cohen Arazi
parent 0c07407a82
commit bd8d019d32
No known key found for this signature in database
GPG Key ID: 0A272EA1B2F3C15F
2 changed files with 10 additions and 4 deletions

View File

@ -2,6 +2,7 @@
[% USE Asset %]
[% USE Branches %]
[% SET footerjs = 1 %]
[% PROCESS 'accounts.inc' %]
[% INCLUDE 'doc-head-open.inc' %]
<title>
[% IF op =='add_form' %]
@ -94,7 +95,7 @@
<li>
<label for="description" class="required">Description: </label>
[% IF credit_type && credit_type.is_system %]
<span>[% credit_type.description | html %]</span>
<span>[%- PROCESS credit_type_description credit_type = credit_type -%]</span>
[% ELSE %]
<input type="text" name="description" id="description" required="required" class="required" size="80" maxlength="100" value="[% credit_type.description | html %]" /> <span class="required">Required</span>
[% END %]
@ -171,7 +172,7 @@
<td>[% credit_type.archived | html %]</td>
<td>[% credit_type.is_system | html %]</td>
<td>[% credit_type.code | html %]</td>
<td>[% credit_type.description | html %]</td>
<td>[%- PROCESS credit_type_description credit_type = credit_type -%]</td>
<td>[% IF credit_type.can_be_added_manually %]Manual credit[% END %]</td>
<td>[% IF credit_type.credit_number_enabled %]Yes[% ELSE %]No[% END %]</td>
<td>

View File

@ -3,6 +3,7 @@
[% USE Branches %]
[% USE Price %]
[% SET footerjs = 1 %]
[% PROCESS 'accounts.inc' %]
[% INCLUDE 'doc-head-open.inc' %]
<title>
[% IF op =='add_form' %]
@ -95,7 +96,11 @@
</li>
<li>
<label for="description" class="required">Description: </label>
<input type="text" name="description" id="description" required="required" class="required" size="80" maxlength="100" value="[% debit_type.description | html %]" /> <span class="required">Required</span>
[% IF debit_type && debit_type.is_system %]
<span>[%- PROCESS debit_type_description debit_type = debit_type -%]</span>
[% ELSE %]
<input type="text" name="description" id="description" required="required" class="required" size="80" maxlength="100" value="[% debit_type.description | html %]" /> <span class="required">Required</span>
[% END %]
</li>
<li>
<label for="can_be_invoiced">Can be manually invoiced? </label>
@ -162,7 +167,7 @@
<td>[% debit_type.archived | html %]</td>
<td>[% debit_type.is_system | html %]</td>
<td>[% debit_type.code | html %]</td>
<td>[% debit_type.description | html %]</td>
<td>[%- PROCESS debit_type_description debit_type = debit_type -%]</td>
<td>[% debit_type.default_amount | $Price %]</td>
<td>[% IF debit_type.can_be_invoiced && debit_type.can_be_sold %]
<i class="fa fa-id-card-o"></i> Invoicing, <i class="fa fa-shopping-cart"></i> Sale