<tbody>
[% FOREACH accountline IN accountlines %]
[% IF accountline.is_credit %]
+ [% IF accountline.credit_offsets.count == 1 %]
+ <tr class="credit dtrg-group dtrg-start dtrg-level-0">
+ <td></td>
+ <td>{}</td>
+ <td>[% accountline.timestamp | $KohaDates with_hours => 1 %] ([% IF accountline.credit_number %][%- accountline.credit_number | html -%][% ELSE %][% accountline.accountlines_id | html %][% END %])</td>
+ <td>[%- PROCESS account_type_description account=accountline -%] ([% AuthorisedValues.GetByCode( 'PAYMENT_TYPE', accountline.payment_type ) | html %])</td>
+ <td></td>
+ <td>[% accountline.amount * -1 | $Price %]</td>
+ <td><button class="printReceipt btn btn-default btn-xs" data-accountline="[% accountline.accountlines_id | uri %]"><i class="fa fa-print"></i> Print receipt</button></td>
+ </tr>
+ [% ELSE %]
[% FOREACH credit IN accountline.credit_offsets %]
[% IF credit.debit %]
- <tr>
+ <tr cnt="[% accountline.credit_offsets.count %]">
<td>[% accountline.accountlines_id | html %]</td>
<td>{ "type": "credit", "identifier": "[%- accountline.credit_number | html -%]", "description": "[%- PROCESS account_type_description account=accountline -%] ([% AuthorisedValues.GetByCode( 'PAYMENT_TYPE', accountline.payment_type ) | html %])", "amount": "[% accountline.amount * -1 | $Price %]", "timestamp": "[% accountline.timestamp | $KohaDates with_hours => 1 %]" }</td>
<td></td>
</tr>
[% END %]
[% END %]
+ [% END %]
[% ELSE %]
[% FOREACH debit IN accountline.debit_offsets %]
[% IF debit.credit %]
rowGroup: {
dataSrc: 0,
startRender: function ( rows, group ) {
+ if ( group ) {
var details = JSON.parse(rows.data().pluck(1).pop());
var identifier = details.identifier || group;
return $('<tr class="'+details.type+'"/>')
.append( '<td colspan="2">'+details.description+'</td>' )
.append( '<td>'+details.amount+'</td>' )
.append( '<td><button class="printReceipt btn btn-default btn-xs" data-accountline="'+group+'"><i class="fa fa-print"></i> ' + _("Print receipt") + '</button></td>');
+ }
},
endRender: null,
},