|
Line 0
Link Here
|
|
|
1 |
[% USE raw %] |
| 2 |
[% USE Asset %] |
| 3 |
[% USE Koha %] |
| 4 |
[% USE KohaDates %] |
| 5 |
[% USE Price %] |
| 6 |
[% SET footerjs = 1 %] |
| 7 |
[% INCLUDE 'doc-head-open.inc' %] |
| 8 |
<title>Koha › Cashup</title> |
| 9 |
[% INCLUDE 'doc-head-close.inc' %] |
| 10 |
</head> |
| 11 |
|
| 12 |
<body id="cashup" class="pos"> |
| 13 |
[% INCLUDE 'header.inc' %] |
| 14 |
[% INCLUDE 'circ-search.inc' %] |
| 15 |
|
| 16 |
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › Point of sale</div> |
| 17 |
|
| 18 |
<div class="main container-fluid"> |
| 19 |
<div class="row"> |
| 20 |
<div class="col-sm-10 col-sm-push-2"> |
| 21 |
<main> |
| 22 |
[% IF ( error_registers ) %] |
| 23 |
<div id="error_message" class="dialog alert"> |
| 24 |
You must have at least one cash register associated with this branch before you can record payments. |
| 25 |
</div> |
| 26 |
[% ELSE %] |
| 27 |
<div id="toolbar" class="btn-toolbar"> |
| 28 |
<a class="cashup_all btn btn-default" href="/cgi-bin/koha/pos/registers.pl?op=cashup"><i class="fa fa-money"></i> Cashup all</a> |
| 29 |
</div> |
| 30 |
|
| 31 |
<h1>Branch transaction details for [% library.branchname | html %]</h1> |
| 32 |
|
| 33 |
<h2>Summary</h2> |
| 34 |
<ul> |
| 35 |
<li>Total income (cash): ()</li> |
| 36 |
<li>Total outgoing (cash): ()</li> |
| 37 |
<li>Total bankable: </li> |
| 38 |
</ul> |
| 39 |
|
| 40 |
<table id="registers" class="table_registers"> |
| 41 |
<thead> |
| 42 |
<th> |
| 43 |
ID |
| 44 |
</th> |
| 45 |
<th> |
| 46 |
Name |
| 47 |
</th> |
| 48 |
<th> |
| 49 |
Description |
| 50 |
</th> |
| 51 |
<th> |
| 52 |
Last cashup |
| 53 |
</th> |
| 54 |
<th> |
| 55 |
Float |
| 56 |
</th> |
| 57 |
<th> |
| 58 |
Bankable |
| 59 |
</th> |
| 60 |
<th> |
| 61 |
Actions |
| 62 |
</th> |
| 63 |
</thead> |
| 64 |
<tbody> |
| 65 |
[% FOREACH register IN registers %] |
| 66 |
<tr> |
| 67 |
<td> |
| 68 |
[% register.id | html %] |
| 69 |
</td> |
| 70 |
<td> |
| 71 |
<a href="/cgi-bin/koha/pos/register.pl?registerid=[% register.id | uri %]">[% register.name | html %]</a> |
| 72 |
</td> |
| 73 |
<td> |
| 74 |
[% register.description | html %] |
| 75 |
</td> |
| 76 |
<td> |
| 77 |
[%- IF register.last_cashup -%] |
| 78 |
[% register.last_cashup.timestamp | $KohaDates with_hours => 1 %] ([% register.last_cashup.amount | $Price %]) |
| 79 |
[%- ELSE -%] |
| 80 |
No last cashup |
| 81 |
[%- END -%] |
| 82 |
</td> |
| 83 |
<td> |
| 84 |
[% register.starting_float | $Price %] |
| 85 |
</td> |
| 86 |
<td> |
| 87 |
[% register.outstanding_accountlines.total * -1 | $Price %] |
| 88 |
</td> |
| 89 |
<td> |
| 90 |
<a class="cashup_individual btn btn-default" href="/cgi-bin/koha/pos/register.pl?registerid=[% register.id | uri %]&op=cashup"><i class="fa fa-money"></i> Record cashup</a> |
| 91 |
</td> |
| 92 |
</tr> |
| 93 |
[% END %] |
| 94 |
</tbody> |
| 95 |
<tfoot> |
| 96 |
<tr> |
| 97 |
<td colspan="5">Total bankable:</td> |
| 98 |
<td></td> |
| 99 |
<td></td> |
| 100 |
</tr> |
| 101 |
</tfoot> |
| 102 |
</table> |
| 103 |
[% END %] |
| 104 |
</main> |
| 105 |
</div> |
| 106 |
|
| 107 |
<div class="col-sm-2 col-sm-pull-10"> |
| 108 |
<aside> |
| 109 |
[% INCLUDE 'pos-menu.inc' %] |
| 110 |
</aside> |
| 111 |
</div> |
| 112 |
|
| 113 |
</div> <!-- /.row --> |
| 114 |
|
| 115 |
[% MACRO jsinclude BLOCK %] |
| 116 |
[% INCLUDE 'datatables.inc' %] |
| 117 |
<script> |
| 118 |
$(document).ready(function() { |
| 119 |
var registers_table = $("#registers").dataTable($.extend(true, {}, dataTablesDefaults, { |
| 120 |
"bFilter": false, |
| 121 |
"paginationType": "full", |
| 122 |
"footerCallback": function ( row, data, start, end, display ) { |
| 123 |
var api = this.api(), data; |
| 124 |
|
| 125 |
// Remove the formatting to get integer data for summation |
| 126 |
var intVal = function ( i ) { |
| 127 |
return typeof i === 'string' ? |
| 128 |
i.replace(/[\$,]/g, '')*1 : |
| 129 |
typeof i === 'number' ? |
| 130 |
i : 0; |
| 131 |
}; |
| 132 |
|
| 133 |
// Total over all pages |
| 134 |
total = api |
| 135 |
.column( 5 ) |
| 136 |
.data() |
| 137 |
.reduce( function (a, b) { |
| 138 |
return intVal(a) + intVal(b); |
| 139 |
}, 0 ); |
| 140 |
|
| 141 |
// Update footer |
| 142 |
$( api.column( 5 ).footer() ).html( |
| 143 |
total |
| 144 |
); |
| 145 |
} |
| 146 |
})); |
| 147 |
}); |
| 148 |
</script> |
| 149 |
[% END %] |
| 150 |
|
| 151 |
[% INCLUDE 'intranet-bottom.inc' %] |