Bug 32099: Consistent classes for primary buttons: Assorted templates
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / pos / register.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE Koha %]
4 [% USE KohaDates %]
5 [% USE AuthorisedValues %]
6 [% USE Price %]
7 [% SET footerjs = 1 %]
8 [% PROCESS 'accounts.inc' %]
9 [% INCLUDE 'doc-head-open.inc' %]
10 <title>Cashup &rsaquo; Koha</title>
11 [% INCLUDE 'doc-head-close.inc' %]
12 [% Asset.css("lib/jquery/plugins/rowGroup/stylesheets/rowGroup.dataTables.min.css") | $raw %]
13 </head>
14
15 <body id="register" class="pos">
16 [% WRAPPER 'header.inc' %]
17     [% INCLUDE 'circ-search.inc' %]
18 [% END %]
19
20 [% WRAPPER 'sub-header.inc' %]
21 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
22     <ol>
23         <li>
24             <a href="/cgi-bin/koha/mainpage.pl">Home</a>
25         </li>
26         <li>
27             <a href="/cgi-bin/koha/pos/pay.pl">Cash management</a>
28         </li>
29         <li>
30             <a href="#" aria-current="page">
31                 Transaction history for [% register.name | html %]
32             </a>
33         </li>
34     </ol>
35 </nav>
36 [% END %]
37
38 <div class="main container-fluid">
39     <div class="row">
40         <div class="col-sm-10 col-sm-push-2">
41
42             [% IF ( error_registers ) %]
43                 <div id="error_message" class="dialog message">
44                     <p>
45                         You must have at least one cash register associated with the library before you can record payments.
46                     </p>
47                     [% IF ( CAN_user_parameters_manage_cash_registers ) %]
48                         <form action="/cgi-bin/koha/admin/cash_registers.pl" method="get">
49                             <input type="hidden" name="op" value="add_form" />
50                             <button class="new" type="submit"><i class="fa fa-plus"></i> Create a new cash register</button>
51                         </form>
52                     [% END %]
53                 </div>
54             [% ELSE %]
55
56             [% IF ( error_cashup_permission ) %]
57             <div id="error_message" class="dialog alert">
58                 You do not have permission to perform cashup actions.
59             </div>
60             [% END %]
61
62             [% IF ( error_refund_permission ) %]
63             <div id="error_message" class="dialog alert">
64                 You do not have permission to perform refund actions.
65             </div>
66             [% END %]
67
68             [% IF ( CAN_user_cash_management_cashup ) %]
69             <div id="toolbar" class="btn-toolbar">
70                 <button id="pos_cashup" type="button" class="btn btn-default" data-toggle="modal" data-target="#confirmCashupModal" ><i class="fa fa-money"></i> Record cashup</button>
71             </div>
72             [% END %]
73
74             <h1>Transaction history for [% register.name | html %]</h1>
75
76             <h2>Summary</h2>
77             <ul>
78                 [% IF register.last_cashup %]
79                 <li>Last cashup: [% register.last_cashup.timestamp | $KohaDates with_hours => 1 %] (<a data-toggle="modal" data-cashup="[% register.last_cashup.id | html %]" data-register="[% register.description | html %]" href="#cashupSummaryModal" class="button">Summary</a>)</li>
80                 [% END %]
81                 <li>Float: [% register.starting_float | $Price %]</li>
82                 <li>Total income (cash): [% accountlines.credits_total * -1 | $Price %] ([% accountlines.credits_total(payment_type => [ 'CASH', 'SIP00' ]) * -1 | $Price %])</li>
83                 <li>Total outgoing (cash): [% accountlines.debits_total * -1 | $Price %] ([% accountlines.debits_total( payment_type => [ 'CASH', 'SIP00' ]) * -1 | $Price %])</li>
84                 <li>Total bankable: [% accountlines.total( payment_type => [ 'CASH', 'SIP00' ]) * -1 | $Price %]</li>
85             </ul>
86
87             [% IF register.last_cashup %]
88             <h2>Transactions since [% register.last_cashup.timestamp | $KohaDates with_hours => 1 %]</h2>
89             [% ELSE %]
90             <h2>Transactions to date</h2>
91             [% END %]
92             <table id="sales" class="table_sales">
93                 <thead>
94                     <th>ID</th>
95                     <th>DATA</th>
96                     <th>Transaction</th>
97                     <th>Description</th>
98                     <th>Price</th>
99                     <th>Total</th>
100                     <th class="noExport">Actions</th>
101                 </thead>
102                 <tbody>
103                     [% FOREACH accountline IN accountlines %]
104                         [% IF accountline.is_credit %]
105                         [% IF accountline.credit_offsets.count == 1 %]
106                             <tr class="credit dtrg-group dtrg-start dtrg-level-0">
107                                 <td></td>
108                                 <td>{}</td>
109                                 <td>[% accountline.timestamp | $KohaDates with_hours => 1 %] ([% IF accountline.credit_number %][%- accountline.credit_number | html -%][% ELSE %][% accountline.accountlines_id | html %][% END %])</td>
110                                 <td>[%- PROCESS account_type_description account=accountline -%] ([% AuthorisedValues.GetByCode( 'PAYMENT_TYPE', accountline.payment_type ) | html %])</td>
111                                 <td></td>
112                                 <td>[% accountline.amount * -1 | $Price %]</td>
113                                 <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>
114                             </tr>
115                             [% ELSE %]
116                             [% FOREACH credit IN accountline.credit_offsets %]
117                             [% IF credit.debit %]
118                             <tr>
119                                 <td>[% accountline.accountlines_id | html %]</td>
120                                 <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>
121                                 <td></td>
122                                 <td>
123                                     [%- PROCESS account_type_description account=credit.debit -%]
124                                     [%- IF credit.debit.description -%] ([% credit.debit.description | html %])[%- END -%]
125                                     [%- IF ( credit.debit.itemnumber ) -%] (<a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% credit.debit.item.biblionumber | uri %]&amp;itemnumber=[% credit.debit.itemnumber | uri %]">[% credit.debit.item.biblio.title | html %]</a>)[%- END -%]
126                                 </td>
127                                 <td>[% credit.debit.amount | $Price %]</td>
128                                 <td></td>
129                                 <td>
130                                     [% IF CAN_user_cash_management_anonymous_refund && !(credit.debit.status == 'REFUNDED') && !(credit.debit.debit_type_code == 'PAYOUT') %]
131                                     <button type="button" class="btn btn-default btn-xs pos_refund" data-toggle="modal" data-target="#issueRefundModal" data-item="[%- PROCESS account_type_description account=credit.debit -%]" data-accountline="[% credit.debit.accountlines_id | html %]" data-amount="[% credit.debit.amount | $Price %]" data-amountoutstanding="[% credit.debit.amountoutstanding | $Price %]" data-member="[% credit.debit.borrowernumber | html %]"><i class="fa fa-money"></i> Issue refund</button>
132                                     [% ELSIF CAN_user_updatecharges_refund && !(credit.debit.status == 'REFUNDED') && credit.debit.borrowernumber && !(credit.debit.debit_type_code == 'PAYOUT') %]
133                                     <button type="button" class="btn btn-default btn-xs" data-toggle="modal" data-target="#issueRefundModal" data-item="[%- PROCESS account_type_description account=credit.debit -%]" data-accountline="[% credit.debit.accountlines_id | html %]" data-amount="[% credit.debit.amount | $Price %]" data-amountoutstanding="[% credit.debit.amountoutstanding | $Price %]" data-member="[% credit.debit.borrowernumber | html %]"><i class="fa fa-money"></i> Issue refund</button>
134                                     [% END %]
135                                 </td>
136                             </tr>
137                             [% END %]
138                             [% END %]
139                             [% END %]
140                         [% ELSE %]
141                             [% FOREACH debit IN accountline.debit_offsets %]
142                             [% IF debit.credit %]
143                             <tr>
144                                 <td>[% accountline.accountlines_id | html %]</td>
145                                 <td>{ "type": "debit", "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>
146                                 <td></td>
147                                 <td>
148                                     [%- PROCESS account_type_description account=debit.credit -%]
149                                     [%- IF debit.credit.description %][% debit.credit.description | html %][%- END -%]
150                                     [%- IF ( debit.credit.itemnumber ) -%] (<a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% debit.credit.item.biblionumber | uri %]&amp;itemnumber=[% debit.credit.itemnumber | uri %]">[% debit.credit.item.biblio.title | html %]</a>)[%- END -%]
151                                 </td>
152                                 <td>[% debit.credit.amount | $Price %]</td>
153                                 <td></td>
154                                 <td>
155                                     [%- IF debit.credit.credit_type_code == 'REFUND' -%]<a href="/cgi-bin/koha/members/accountline-details.pl?accountlines_id=[% debit.credit.accountlines_id | uri %]" class="btn btn-default btn-xs"><i class="fa fa-list"></i> Details</a>[%- END -%]
156                                 </td>
157                             </tr>
158                             [% END %]
159                             [% END %]
160                         [% END %]
161                     [% END %]
162                 </tbody>
163                 <tfoot>
164                     <tr>
165                         <td colspan="5">Total income: </td>
166                         <td>[% accountlines.total * -1 | $Price %]</td>
167                         <td></td>
168                     </tr>
169                 </tfoot>
170             </table>
171             [% END %]
172
173             [% IF register.cashups %]
174             <h2>Older transactions</h2>
175             <form method="GET" action="/cgi-bin/koha/pos/register.pl">
176                 <fieldset class="rows">
177                     Please select a date range to display transactions for:
178                     <ol>
179                         <li>
180                             <label for="trange_f">From: </label>
181                             <input type="text" size="10" id="from" class="flatpickr" data-date_to="to" name="trange_f" value="[% trange_f | html %]"/>
182                             <label class="inline" for="trange_t">To: </label>
183                             <input type="text" size="10" id="to" class="flatpickr" name="trange_t" value="[% trange_t | html %]" />
184                             <span class="hint">[% INCLUDE 'date-format.inc' %]</span>
185                         </li>
186                     </ol>
187                 </fieldset>
188
189                 <div class="action">
190                     <input type="hidden" name="registerid" value="[% register.id | html %]">
191                     <input type="submit" class="btn btn-primary" value="Display" />
192                 </div>
193             </form>
194
195             [% IF trange_f %]
196             <table id="past_sales" class="past_sales_table">
197                 <thead>
198                     <th>ID</th>
199                     <th>DATA</th>
200                     <th>Transaction</th>
201                     <th>Description</th>
202                     <th>Price</th>
203                     <th>Total</th>
204                     <th class="noExport">Actions</th>
205                 </thead>
206                 <tbody>
207                     [% FOREACH accountline IN past_accountlines %]
208                         [% IF accountline.is_credit %]
209                             [% FOREACH credit IN accountline.credit_offsets %]
210                             [% IF credit.debit %]
211                             <tr>
212                                 <td>[% accountline.accountlines_id | html %]</td>
213                                 <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>
214                                 <td></td>
215                                 <td>
216                                     [%- PROCESS account_type_description account=credit.debit -%]
217                                     [%- IF credit.debit.description -%] ([% credit.debit.description | html %])[%- END -%]
218                                     [%- IF ( credit.debit.itemnumber ) -%] (<a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% credit.debit.item.biblionumber | uri %]&amp;itemnumber=[% credit.debit.itemnumber | uri %]">[% credit.debit.item.biblio.title | html %]</a>)[%- END -%]
219                                 </td>
220                                 <td>[% credit.debit.amount | $Price %]</td>
221                                 <td></td>
222                                 <td>
223                                     [% IF CAN_user_cash_management_anonymous_refund && !(credit.debit.status == 'REFUNDED') && !(credit.debit.debit_type_code == 'PAYOUT') %]
224                                     <button type="button" class="btn btn-default btn-xs pos_refund" data-toggle="modal" data-target="#issueRefundModal" data-item="[%- PROCESS account_type_description account=credit.debit -%]" data-accountline="[% credit.debit.accountlines_id | html %]" data-amount="[% credit.debit.amount | $Price %]" data-amountoutstanding="[% credit.debit.amountoutstanding | $Price %]" data-member="[% credit.debit.borrowernumber | html %]"><i class="fa fa-money"></i> Issue refund</button>
225                                     [% ELSIF CAN_user_updatecharges_refund && !(credit.debit.status == 'REFUNDED') && credit.debit.borrowernumber && !(credit.debit.debit_type_code == 'PAYOUT') %]
226                                     <button type="button" class="btn btn-default btn-xs" data-toggle="modal" data-target="#issueRefundModal" data-item="[%- PROCESS account_type_description account=credit.debit -%]" data-accountline="[% credit.debit.accountlines_id | html %]" data-amount="[% credit.debit.amount | $Price %]" data-amountoutstanding="[% credit.debit.amountoutstanding | $Price %]" data-member="[% credit.debit.borrowernumber | html %]"><i class="fa fa-money"></i> Issue refund</button>
227                                     [% END %]
228                                 </td>
229                             </tr>
230                             [% END %]
231                             [% END %]
232                         [% ELSE %]
233                             [% FOREACH debit IN accountline.debit_offsets %]
234                             [% IF debit.credit %]
235                             <tr>
236                                 <td>[% accountline.accountlines_id | html %]</td>
237                                 <td>{ "type": "debit", "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>
238                                 <td></td>
239                                 <td>
240                                     [%- PROCESS account_type_description account=debit.credit -%]
241                                     [%- IF debit.credit.description %][% debit.credit.description | html %][%- END -%]
242                                     [%- IF ( debit.credit.itemnumber ) -%] (<a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% debit.credit.item.biblionumber | uri %]&amp;itemnumber=[% debit.credit.itemnumber | uri %]">[% debit.credit.item.biblio.title | html %]</a>)[%- END -%]
243                                 </td>
244                                 <td>[% debit.credit.amount | $Price %]</td>
245                                 <td></td>
246                                 <td>
247                                     [%- IF debit.credit.credit_type_code == 'REFUND' -%]<a href="/cgi-bin/koha/members/accountline-details.pl?accountlines_id=[% debit.credit.accountlines_id | uri %]" class="btn btn-default btn-xs"><i class="fa fa-list"></i> Details</a>[%- END -%]
248                                 </td>
249                             </tr>
250                             [% END %]
251                             [% END %]
252                         [% END %]
253                     [% END %]
254                 </tbody>
255                 <tfoot>
256                     <tr>
257                         <td colspan="5">Total income: </td>
258                         <td>[% past_accountlines.total * -1 | $Price %]</td>
259                         <td></td>
260                     </tr>
261                 </tfoot>
262             </table>
263             [% END %]
264
265             <hr/>
266             <h2>Cashup history</h2>
267             <table id="table_cashups">
268                 <thead>
269                     <tr>
270                         <th>Date</th>
271                         <th>Cashier</th>
272                         <th>Amount</th>
273                         <th data-class-name="actions">Actions</th>
274                     </tr>
275                 </thead>
276             </table>
277             [% END %]
278         </div>
279
280         <div class="col-sm-2 col-sm-pull-10">
281             <aside>
282                 [% INCLUDE 'pos-menu.inc' %]
283             </aside>
284         </div>
285     </div><!-- /.row -->
286
287     <!-- Confirm cashup modal -->
288     <div class="modal" id="confirmCashupModal" tabindex="-1" role="dialog" aria-labelledby="confirmCashupLabel">
289         <div class="modal-dialog" role="document">
290             <div class="modal-content">
291                 <div class="modal-header">
292                     <button type="button" class="closebtn" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
293                     <h4 class="modal-title" id="confirmCashupLabel">Confirm cashup of <em>[% register.description | html %]</em></h4>
294                 </div>
295                 <div class="modal-body">
296                     Please confirm that you have removed [% accountlines.total( payment_type => [ 'CASH', 'SIP00' ]) * -1 | $Price %] from the cash register and left a float of [% register.starting_float | $Price %].
297                 </div> <!-- /.modal-body -->
298                 <div class="modal-footer">
299                     <a href="/cgi-bin/koha/pos/register.pl?op=cashup" class="btn btn-default" id="pos_cashup_confirm">Confirm</a>
300                     <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
301                 </div> <!-- /.modal-footer -->
302             </div> <!-- /.modal-content -->
303         </div> <!-- /.modal-dialog -->
304     </div> <!-- /#confirmCashupModal -->
305
306     <!-- Issue refund modal -->
307     <div class="modal" id="issueRefundModal" tabindex="-1" role="dialog" aria-labelledby="issueRefundLabel">
308         <form id="refund_form" method="post" enctype="multipart/form-data" class="validated">
309             <input type="hidden" name="accountline" value="" id="refundline">
310             <div class="modal-dialog" role="document">
311                 <div class="modal-content">
312                     <div class="modal-header">
313                         <button type="button" class="closebtn" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
314                         <h4 class="modal-title" id="issueRefundLabel">Issue refund from <em>[% register.description | html %]</em></h4>
315                     </div>
316                     <div class="modal-body">
317                         <fieldset class="rows">
318                             <ol>
319                                 <li>
320                                     <span id="item" class="label">Item: </span><span></span>
321                                 </li>
322                                 <li>
323                                     <span id="paid" class="label">Amount paid: </span><span></span>
324                                 </li>
325                                 <li>
326                                     <label class="required" for="amount">Returned to patron: </label>
327                                     <input type="text" inputmode="decimal" pattern="^\d+(\.\d{2})?$" id="returned" name="amount" required="required">
328                                     <span class="required">Required</span>
329                                 </li>
330                                 [% INCLUDE 'transaction_types.inc' type="refund" %]
331                             </ol>
332                         </fieldset> <!-- /.rows -->
333                     </div> <!-- /.modal-body -->
334                     <div class="modal-footer">
335                         <input type="hidden" name="registerid" value="[% register.id | html %]">
336                         <input type="hidden" name="op" value="refund">
337                         <button type="submit" class="btn btn-default" id="pos_refund_confirm">Confirm</button>
338                         <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
339                     </div> <!-- /.modal-footer -->
340                 </div> <!-- /.modal-content -->
341             </div> <!-- /.modal-dialog -->
342         </form> <!-- /#refund_form -->
343     </div> <!-- /#issueRefundModal -->
344
345     [% INCLUDE 'modals/cashup_summary.inc' %]
346
347     [% MACRO jsinclude BLOCK %]
348     [% INCLUDE 'datatables.inc' %]
349     [% Asset.js("lib/jquery/plugins/rowGroup/dataTables.rowGroup.min.js") | $raw %]
350     [% INCLUDE 'format_price.inc' %]
351     [% INCLUDE 'js-date-format.inc' %]
352     [% Asset.js("js/cashup_modal.js") | $raw %]
353     [% INCLUDE 'calendar.inc' %]
354     <script>
355         var sales_table = $("#sales").dataTable($.extend(true, {}, dataTablesDefaults, {
356             orderFixed: [ 0, 'asc'],
357             columnDefs: [ {
358                 targets: [ 0, 1 ],
359                 visible: false
360             }],
361             rowGroup: {
362                 dataSrc: 0,
363                 startRender: function ( rows, group ) {
364                     if ( group ) {
365                     var details = JSON.parse(rows.data().pluck(1).pop());
366                     var identifier = details.identifier || group;
367                     return $('<tr class="'+details.type+'"/>')
368                         .append( '<td>'+details.timestamp+' ('+identifier+')</td>' )
369                         .append( '<td colspan="2">'+details.description+'</td>' )
370                         .append( '<td>'+details.amount+'</td>' )
371                         .append( '<td><button class="printReceipt btn btn-default btn-xs" data-accountline="'+group+'"><i class="fa fa-print"></i> ' + _("Print receipt") + '</button></td>');
372                     }
373                 },
374                 endRender: null,
375             },
376             initComplete: function() {
377                 $("#sales").show();
378             }
379         }));
380
381         var past_sales_table = $("#past_sales").dataTable($.extend(true, {}, dataTablesDefaults, {
382             orderFixed: [ 0, 'asc'],
383             columnDefs: [ {
384                 targets: [ 0, 1 ],
385                 visible: false
386             }],
387             rowGroup: {
388                 dataSrc: 0,
389                 startRender: function ( rows, group ) {
390                     var details = JSON.parse(rows.data().pluck(1).pop());
391                     var identifier = details.identifier || group;
392                     return $('<tr class="'+details.type+'"/>')
393                         .append( '<td>'+details.timestamp+' ('+identifier+')</td>' )
394                         .append( '<td colspan="2">'+details.description+'</td>' )
395                         .append( '<td>'+details.amount+'</td>' )
396                         .append( '<td><button class="printReceipt btn btn-default btn-xs" data-accountline="'+group+'"><i class="fa fa-print"></i> Print receipt</button></td>');
397                 },
398                 endRender: null,
399             }
400         }));
401
402         $("#issueRefundModal").on("shown.bs.modal", function(e){
403            var button = $(e.relatedTarget);
404            var item = button.data('item');
405            $("#item + span").replaceWith(item);
406            var accountline = button.data('accountline');
407            $('#refundline').val(accountline);
408            var amount = button.data('amount');
409            var amountoutstanding = button.data('amountoutstanding') || 0;
410            var paid = amount - amountoutstanding;
411            $("#paid + span").replaceWith(paid);
412            $("#returned").attr({ "value": paid, "max": paid });
413            var member = button.data('member');
414            if ( member === '' ) {
415                $("#refund_type option[value='AC']").remove();
416            } else if ( $("#refund_type option[value='AC']").length == 0 ) {
417                $("#refund_type").prepend('<option value="AC" selected="selected">Account credit</option>');
418            }
419            $("#returned, #refund_type").focus();
420         });
421
422         $("body").on('click', ".printReceipt", function() {
423             var accountlines_id = $(this).data('accountline');
424             var win = window.open('/cgi-bin/koha/pos/printreceipt.pl?action=print&accountlines_id=' + accountlines_id, '_blank');
425             win.focus();
426         });
427
428         var cashups_table_url = "/api/v1/cash_registers/[% register.id | html %]/cashups?";
429         var cashups_table = $("#table_cashups").kohaTable({
430             "ajax": {
431                 "url": cashups_table_url
432             },
433             "header_filter": true,
434             "embed": [
435                "manager"
436             ],
437             "order": [[ 0, "desc" ]],
438             "columns": [
439                 {
440                     "data": "timestamp",
441                     "searchable": true,
442                     "orderable": true,
443                     "render": function(data, type, row, meta) {
444                         return $datetime(row.timestamp);
445                     }
446                 },
447                 {
448                     "data": "manager.firstname:manager.surname",
449                     "searchable": true,
450                     "orderable": true,
451                     "render": function(data, type, row, meta) {
452                         var fullname;
453                         if ( row.manager.firstname == null ) {
454                             fullname = row.manager.surname;
455                         }
456                         else {
457                             fullname = row.manager.firstname + " " + row.manager.surname;
458                         }
459                         return escape_str(fullname);
460                     }
461                 },
462                 {
463                     "data": "amount",
464                     "searchable": true,
465                     "orderable": true,
466                     "render": function(data, type, row, meta) {
467                         var amt = row.amount * -1;
468                         return escape_price(amt);
469                     }
470                 },
471                 {
472                     "data": function( row, type, val, meta ) {
473                         var result = '<a class="btn btn-default btn-xs" role="button" data-toggle="modal" data-cashup="'+encodeURIComponent(row.cashup_id)+'" data-register="[% register.description | html %]" href="#cashupSummaryModal"><i class="fa fa-pencil" aria-hidden="true"></i> '+_("Summary")+'</a>\n';
474                         return result;
475                     },
476                     "searchable": false,
477                     "orderable": false
478                 }
479             ]
480         }, null, 1);
481     </script>
482 [% END %]
483
484 [% INCLUDE 'intranet-bottom.inc' %]