MT#5879 Format invoice list. Just save state.

ipeshinskaya/InvoiceTemplate5
Irina Peshinskaya 12 years ago committed by Victor Seva
parent c39d6a92a8
commit ebd4a412e6

@ -239,9 +239,10 @@ sub getProviderInvoiceList{
'contact.reseller_id' => $provider_reseller_id, #$client_contract_id - contract of the client
],
},{
'+select' => ['contract_balances.invoice_id','contract_balances.start','contract_balances.end','contract_balances.cash_balance','contract_balances.free_time_balance'],
'+as' => ['invoice_id','contract_balance_start','contract_balance_end','cash_balance','free_time_balance'],
'prefetch' => [ {'contract_balances' => { 'contract' => 'contact' }} ],
'+select' => ['contract_balances.invoice_id','contract_balances.start','contract_balances.end','contract_balances.cash_balance','contract_balances.free_time_balance','reseller.id','reseller.name','contact.id',],
'+as' => ['invoice_id','contract_balance_start','contract_balance_end','cash_balance','free_time_balance', 'reseller_id', 'reseller_name',,'client_contact_id' ],
'prefetch' => [ {'contract_balances' => { 'contract' => { 'contact' => 'reseller' } } } ],
'order_by' => [ { '-desc' => 'contract_balances.start' },{ '-asc' => 'contract_balances.end' }, ]
});
}
sub getInvoice{

@ -1,34 +1,40 @@
[%USE Date%]
[%manip=date.manip%]
<table class="table table-bordered table-striped table-highlight table-hover">
<thead>
<tr>
<th>[% c.loc('Serial') %]</th>
<th>[% c.loc('Start') %]</th>
<th>[% c.loc('End') %]</th>
<th>[% c.loc('Cache Balance') %]</th>
<th>[% c.loc('Free time balance') %]</th>
<th class="ngcp-actions-column"></th>
</tr>
</thead>
<tbody>
[%# Dumper.dump_html(invoice_details_zones.as_query)%]
[%FOREACH invoice IN invoice_list -%]
<tr class="sw_action_row">
<td><div class="pull-right">[% invoice.get_column('serial')|format('%06d') %]</div></td>
<td><div class="pull-right">[% invoice.get_column('contract_balance_start') %]</div></td>
<td><div class="pull-right">[% invoice.get_column('contract_balance_end') %]</div></td>
<td><div class="pull-right">[% invoice.get_column('cash_balance') %]</div></td>
<td><div class="pull-right">[% invoice.get_column('free_time_balance') %]</div></td>
<td><a class="btn btn-small btn-primary" href="javascript:window.open('[%c.uri_for_action("/invoice/invoice_data",[invoice.get_column('invoice_id')])%]','_blank');void(0);">
<i class="icon-edit"></i> [% c.loc('View invoice') %]
</a>
</td>
</tr>
[%END%]
</tbody>
</table>
<table class="table table-bordered table-striped table-highlight table-hover">
<thead>
<tr>
[%#0 - now interface suppose preselected reseller%]
[%IF 0 && c.user.roles == 'admin' %]
<th>[% c.loc('Reseller') %]</th>
[%END%]
<th>[% c.loc('Client #') %]</th>
<th>[% c.loc('Serial') %]</th>
<th>[% c.loc('Start') %]</th>
<th>[% c.loc('End') %]</th>
<th>[% c.loc('Cache Balance') %]</th>
<th>[% c.loc('Free time balance') %]</th>
<th class="ngcp-actions-column"></th>
</tr>
</thead>
<tbody>
[%# Dumper.dump_html(invoice_details_zones.as_query)%]
[%FOREACH invoice IN invoice_list -%]
<tr class="sw_action_row">
[%IF 0 && c.user.roles == 'admin' %]
<td>#[% invoice.get_column('reseller_id') %] [% invoice.get_column('reseller_name') %]</td>
[%END%]
<td>#[% invoice.get_column('client_contact_id') %]</td>
<td><div class="pull-right">[% invoice.get_column('serial')|format('%06d') %]</div></td>
<td>[% invoice.get_column('contract_balance_start') %]</td>
<td>[% invoice.get_column('contract_balance_end') %]</td>
<td><div class="pull-right">[% invoice.get_column('cash_balance') %]</div></td>
<td><div class="pull-right">[% invoice.get_column('free_time_balance') %]</div></td>
<td class="ngcp-actions-column"><div class="sw_actions"><a class="btn btn-small btn-primary" href="javascript:window.open('[%c.uri_for_action('/invoice/invoice_data',[invoice.get_column('invoice_id')])%]','_blank');void(0);">
<i class="icon-edit"></i> [% c.loc('View invoice') %]
</a>
</div></td>
</tr>
[%END%]
</tbody>
</table>

Loading…
Cancel
Save