7 [% PROCESS 'accounts.inc' %]
8 [% INCLUDE 'doc-head-open.inc' %]
9 <title>Koha › Cashup</title>
10 [% INCLUDE 'doc-head-close.inc' %]
11 [% Asset.css("lib/jquery/plugins/rowGroup/stylesheets/rowGroup.dataTables.min.css") | $raw %]
14 <body id="register" class="pos">
15 [% INCLUDE 'header.inc' %]
16 [% INCLUDE 'circ-search.inc' %]
18 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/pos/pay.pl">Point of sale</a> › Register details</div>
20 <div class="main container-fluid">
22 <div class="col-sm-10 col-sm-push-2">
24 [% IF ( error_registers ) %]
25 <div id="error_message" class="dialog alert">
26 You must have at least one cash register associated with this branch before you can record payments.
30 <div id="toolbar" class="btn-toolbar">
31 <a id="cashup" href="/cgi-bin/koha/pos/register.pl?op=cashup" class="btn btn-default"><i class="fa fa-money"></i> Record cashup</a>
34 <h1>Register transaction details for [% register.name | html %]</h1>
38 [% IF register.last_cashup %]
39 <li>Last cashup: [% register.last_cashup.timestamp | $KohaDates with_hours => 1 %]</li>
41 <li>Float: [% register.starting_float | $Price %]</li>
42 <li>Total income (cash): [% accountlines.credits_total * -1 | $Price %] ([% accountlines.credits_total(payment_type => 'CASH') * -1 | $Price %])</li>
43 <li>Total outgoing (cash): [% accountlines.debits_total * -1 | $Price %] ([% accountlines.debits_total( payment_type => 'CASH') * -1 | $Price %])</li>
44 <li>Total bankable: [% accountlines.total( payment_type => 'CASH') * -1 | $Price %]</li>
47 [% IF register.last_cashup %]
48 <h2>Transactions since [% register.last_cashup.timestamp | $KohaDates with_hours => 1 %]</h2>
50 <h2>Transactions to date</h2>
52 <table id="sales" class="table_sales">
77 [% FOREACH accountline IN accountlines %]
78 [% IF accountline.is_credit %]
79 [% FOREACH credit IN accountline.credit_offsets %]
83 [% accountline.accountlines_id %]
86 { "type": "credit", "description": "[%- PROCESS account_type_description account=accountline -%] ([% accountline.payment_type | html %])", "amount": "[% accountline.amount * -1 | $Price %]" }
90 [%- PROCESS account_type_description account=credit.debit -%]
91 [%- IF credit.debit.description -%] ([% credit.debit.description | html %])[%- END -%]
92 [%- IF ( credit.debit.itemnumber ) -%] (<a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% credit.debit.item.biblionumber | uri %]&itemnumber=[% credit.debit.itemnumber | uri %]">[% credit.debit.item.biblio.title | html %]</a>)[%- END -%]
95 [% credit.debit.amount | $Price %]
103 [% FOREACH debit IN accountline.debit_offsets %]
104 [% IF debit.credit %]
107 [% accountline.accountlines_id %]
110 { "type": "debit", "description": "[%- PROCESS account_type_description account=accountline -%] ([% accountline.payment_type | html %])", "amount": "[% accountline.amount * -1 | $Price %]" }
114 [%- PROCESS account_type_description account=debit.credit -%]
117 [%- IF debit.credit.description %][% debit.credit.description | html %][%- END -%]
118 [%- IF ( debit.credit.itemnumber ) -%] (<a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% debit.credit.item.biblionumber | uri %]&itemnumber=[% debit.credit.itemnumber | uri %]">[% debit.credit.item.biblio.title | html %]</a>)[%- END -%]
121 [% debit.credit.amount | $Price %]
132 <td colspan="5">Total income: </td>
133 <td>[% accountlines.total * -1 | $Price %]</td>
141 <div class="col-sm-2 col-sm-pull-10">
143 [% INCLUDE 'pos-menu.inc' %]
148 [% MACRO jsinclude BLOCK %]
149 [% INCLUDE 'datatables.inc' %]
150 [% Asset.js("lib/jquery/plugins/rowGroup/dataTables.rowGroup.min.js") | $raw %]
152 var sales_table = $("#sales").dataTable($.extend(true, {}, dataTablesDefaults, {
153 orderFixed: [ 0, 'asc'],
160 startRender: function ( rows, group ) {
161 var details = JSON.parse(rows.data().pluck(1).pop());
162 return $('<tr class="'+details.type+'"/>')
163 .append( '<td>'+group+'</td>' )
164 .append( '<td colspan="2">'+details.description+'</td>' )
165 .append( '<td>'+details.amount+'</td>' )
166 .append( '<td><button class="printReceipt btn btn-default btn-xs" data-accountline="'+group+'"><i class="fa fa-print"></i> Print receipt</button></td>');
172 $(".printReceipt").click(function() {
173 var accountlines_id = $(this).data('accountline');
174 var win = window.open('/cgi-bin/koha/pos/printreceipt.pl?action=print&accountlines_id=' + accountlines_id, '_blank');
180 [% INCLUDE 'intranet-bottom.inc' %]