You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ngcp-panel/share/templates/invoice/invoice_template_list.tt

63 lines
3.5 KiB

[% USE Dumper %]
[% USE format %]
[% money_format = format('%.2f') %]
[% IF !c.user.read_only && (c.user.roles == 'admin' || c.user.roles == 'reseller') -%]
[% write_access = 1 %]
[%END%]
<script>
var staticContainerId='invoice_template_list';
</script>
[%IF invoice_template_list.size %]
<table class="table table-bordered table-striped table-highlight table-hover">
<thead>
<tr>
<th>[% c.loc('Active') %]</th>
<th>[% c.loc('Id') %]</th>
<th>[% c.loc('Name') %]</th>
<th>[% c.loc('Type') %]</th>
<th class="ngcp-actions-column"></th>
</tr>
</thead>
<tbody>
[% FOR template IN invoice_template_list -%]
[%# Dumper.dump_html(invoice_template_list.as_query)%]
[%# Dumper.dump_html(template)%]
<tr class="sw_action_row" data-id="[%template.get_column('id')%]">
<td style="font-size: 20px;">[%IF template.get_column('is_active') > 0; '✓'; END%]</td><!--✓-->
<td>[% template.get_column('id') %]</td>
<td>[% template.get_column('name') %]</td>
<td>[% template.get_column('type') %]</td>
<td class="ngcp-actions-column">
<div class="sw_actions">
[% IF write_access -%]
<a class="btn btn-small btn-primary"
onclick="fetch_into('invoice_template_info_form', '[%- c.uri_for_action("/reseller/invoice_template_info", [contract.id]) -%]','item=invoice_template_info&tt_id=[%template.get_column('id')%]',function(){modalFormScript();});void(0);
">
<i class="icon-edit"></i> [% c.loc('Edit template info') %]
</a>
<a class="btn btn-small btn-primary"
onclick="fetchInvoiceTemplateData({
tt_sourcestate: 'saved',
contract_id: '[%contract.id%]',
tt_id: '[%template.get_column('id')%]',
});listSetCurrentEdit('[%template.get_column('id')%]', $(this).closest('tr') );">
<i class="icon-edit"></i> [% c.loc('Edit template') %]
</a>
<a class="btn btn-small btn-primary ngcp-noback-button" data-confirm="[%IF template.get_column('is_active'); c.loc('Deactivate'); ELSE; c.loc('Activate'); END%]"
href="javascript:fetch_into(staticContainerId, '[%- c.uri_for_action("/reseller/invoice_template_activate", [contract.id, template.get_column('id'),template.get_column('is_active')]) -%]','',function(){ refreshMessagesAjax();mainWrapperInit(); listRestoreCurrentEdit('',staticContainerId);});void(0);">
<i class="icon-edit"></i> [%IF template.get_column('is_active'); c.loc('Deactivate'); ELSE; c.loc('Activate'); END%]
</a>
<a class="btn btn-small btn-secondary ngcp-noback-button" data-confirm="Delete"
href="javascript:fetch_into(staticContainerId, '[%- c.uri_for_action("/reseller/invoice_template_delete", [contract.id, template.get_column('id')]) -%]','',function(){ refreshMessagesAjax();mainWrapperInit();listRestoreCurrentEdit('',staticContainerId);if('[%template.get_column('id')%]' === getCurrentEditId('', staticContainerId)){clearTemplateForm({contract_id: '[%contract.id%]'});} });void(0);">
<i class="icon-trash"></i> [% c.loc('Delete') %]
</a>
[%END%]
</div>
</td>
</tr>
[%END%]
</tbody>
</table>
[%END%]