Lines 26-34
Link Here
|
26 |
You must have at least one cash register associated with this branch before you can record payments. |
26 |
You must have at least one cash register associated with this branch before you can record payments. |
27 |
</div> |
27 |
</div> |
28 |
[% ELSE %] |
28 |
[% ELSE %] |
|
|
29 |
[% IF ( CAN_user_cash_management_cashup_cash_registers ) %] |
29 |
<div id="toolbar" class="btn-toolbar"> |
30 |
<div id="toolbar" class="btn-toolbar"> |
30 |
<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> |
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> |
31 |
</div> |
32 |
</div> |
|
|
33 |
[% END %] |
32 |
|
34 |
|
33 |
<h1>Register transaction details for [% register.name | html %]</h1> |
35 |
<h1>Register transaction details for [% register.name | html %]</h1> |
34 |
|
36 |
|
Lines 51-69
Link Here
|
51 |
<table id="sales" class="table_sales"> |
53 |
<table id="sales" class="table_sales"> |
52 |
<thead> |
54 |
<thead> |
53 |
<th> |
55 |
<th> |
54 |
Receipt ID |
56 |
ID |
|
|
57 |
</th> |
58 |
<th> |
59 |
DATA |
55 |
</th> |
60 |
</th> |
56 |
<th> |
61 |
<th> |
57 |
Transaction |
62 |
Transaction |
58 |
</th> |
63 |
</th> |
59 |
<th> |
64 |
<th> |
60 |
Description of charges |
65 |
Description |
61 |
</th> |
66 |
</th> |
62 |
<th> |
67 |
<th> |
63 |
Item |
68 |
Price |
64 |
</th> |
69 |
</th> |
65 |
<th> |
70 |
<th> |
66 |
Transaction |
71 |
Total |
67 |
</th> |
72 |
</th> |
68 |
<th> |
73 |
<th> |
69 |
Actions |
74 |
Actions |
Lines 73-98
Link Here
|
73 |
[% FOREACH accountline IN accountlines %] |
78 |
[% FOREACH accountline IN accountlines %] |
74 |
[% IF accountline.is_credit %] |
79 |
[% IF accountline.is_credit %] |
75 |
[% FOREACH credit IN accountline.credit_offsets %] |
80 |
[% FOREACH credit IN accountline.credit_offsets %] |
|
|
81 |
[% IF credit.debit %] |
82 |
<tr> |
83 |
<td> |
84 |
[% accountline.accountlines_id %] |
85 |
</td> |
86 |
<td> |
87 |
{ "type": "credit", "description": "[%- PROCESS account_type_description account=accountline -%] ([% accountline.payment_type | html %])", "amount": "[% accountline.amount * -1 | $Price %]" } |
88 |
</td> |
89 |
<td></td> |
90 |
<td> |
91 |
[%- PROCESS account_type_description account=credit.debit -%] |
92 |
[%- IF credit.debit.description -%] ([% credit.debit.description | html %])[%- END -%] |
93 |
[%- 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 -%] |
94 |
</td> |
95 |
<td> |
96 |
[% credit.debit.amount | $Price %] |
97 |
</td> |
98 |
<td></td> |
99 |
<td> |
100 |
[% IF CAN_user_cash_management_refund_cash_registers && !(credit.debit.status == 'REFUNDED' ) %] |
101 |
<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-quantity="[% credit.debit.note | html %]"><i class="fa fa-money"></i> Issue refund</button> |
102 |
[% END %] |
103 |
</td> |
104 |
</tr> |
105 |
[% END %] |
106 |
[% END %] |
107 |
[% ELSE %] |
108 |
[% FOREACH debit IN accountline.debit_offsets %] |
109 |
[% IF debit.credit %] |
110 |
<tr> |
111 |
<td> |
112 |
[% accountline.accountlines_id %] |
113 |
</td> |
114 |
<td> |
115 |
{ "type": "debit", "description": "[%- PROCESS account_type_description account=accountline -%] ([% accountline.payment_type | html %])", "amount": "[% accountline.amount * -1 | $Price %]" } |
116 |
</td> |
117 |
<td></td> |
118 |
<td> |
119 |
[%- PROCESS account_type_description account=debit.credit -%] |
120 |
</td> |
121 |
<td> |
122 |
[%- IF debit.credit.description %][% debit.credit.description | html %][%- END -%] |
123 |
[%- 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 -%] |
124 |
</td> |
125 |
<td> |
126 |
[% debit.credit.amount | $Price %] |
127 |
</td> |
128 |
<td></td> |
129 |
</tr> |
130 |
[% END %] |
131 |
[% END %] |
132 |
[% END %] |
133 |
[% END %] |
134 |
</tbody> |
135 |
<tfoot> |
136 |
<tr> |
137 |
<td colspan="5">Total income: </td> |
138 |
<td>[% accountlines.total * -1 | $Price %]</td> |
139 |
<td></td> |
140 |
</tr> |
141 |
</tfoot> |
142 |
</table> |
143 |
[% END %] |
144 |
|
145 |
[% IF trange_f %] |
146 |
<h2>Older transactions</h2> |
147 |
<table id="past_sales" class="past_sales_table"> |
148 |
<thead> |
149 |
<th> |
150 |
ID |
151 |
</th> |
152 |
<th> |
153 |
DATA |
154 |
</th> |
155 |
<th> |
156 |
Transaction |
157 |
</th> |
158 |
<th> |
159 |
Description |
160 |
</th> |
161 |
<th> |
162 |
Price |
163 |
</th> |
164 |
<th> |
165 |
Total |
166 |
</th> |
167 |
<th> |
168 |
Actions |
169 |
</th> |
170 |
</thead> |
171 |
<tbody> |
172 |
[% FOREACH accountline IN past_accountlines %] |
173 |
[% IF accountline.is_credit %] |
174 |
[% FOREACH credit IN accountline.credit_offsets %] |
175 |
[% IF credit.debit %] |
76 |
<tr> |
176 |
<tr> |
77 |
<td>[% accountline.accountlines_id %]</td> |
177 |
<td>[% accountline.accountlines_id %]</td> |
78 |
<td>{ "type": "credit", "description": "[%- PROCESS account_type_description account=accountline -%] ([% accountline.payment_type | html %])", "amount": "[% accountline.amount * -1 | $Price %]" }</td> |
178 |
<td>{ "type": "credit", "description": "[%- PROCESS account_type_description account=accountline -%] ([% accountline.payment_type | html %])", "amount": "[% accountline.amount * -1 | $Price %]" }</td> |
79 |
<td>[%- PROCESS account_type_description account=credit.debit -%]</td> |
179 |
<td></td> |
|
|
180 |
<td>[%- PROCESS account_type_description account=credit.debit -%] |
181 |
[%- IF credit.debit.description -%] ([% credit.debit.description | html %])[%- END -%] |
182 |
[%- 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 -%] |
183 |
</td> |
80 |
<td>[% credit.debit.amount | $Price %]</td> |
184 |
<td>[% credit.debit.amount | $Price %]</td> |
81 |
<td></td> |
185 |
<td></td> |
|
|
186 |
<td> |
187 |
[% IF CAN_user_cash_management_refund_cash_registers && !(credit.debit.status == 'REFUNDED' ) %] |
188 |
<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-quantity="[% credit.debit.note | html %]"><i class="fa fa-money"></i> Issue refund</button> |
189 |
[% END %] |
190 |
</td> |
191 |
</tr> |
192 |
[% END %] |
193 |
[% END %] |
194 |
[% ELSE %] |
195 |
[% FOREACH debit IN accountline.debit_offsets %] |
196 |
[% IF debit.credit %] |
197 |
<tr> |
198 |
<td>[% accountline.accountlines_id %]</td> |
199 |
<td>{ "type": "debit", "description": "[%- PROCESS account_type_description account=accountline -%] ([% accountline.payment_type | html %])", "amount": "[% accountline.amount * -1 | $Price %]" }</td> |
200 |
<td></td> |
201 |
<td>[%- PROCESS account_type_description account=debit.credit -%]</td> |
202 |
<td>[%- IF debit.credit.description %][% debit.credit.description | html %][% END %] |
203 |
[% 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 %]</td> |
204 |
<td>[% debit.credit.amount | $Price %]</td> |
82 |
<td></td> |
205 |
<td></td> |
83 |
</tr> |
206 |
</tr> |
84 |
[% END %] |
207 |
[% END %] |
|
|
208 |
[% END %] |
85 |
[% END %] |
209 |
[% END %] |
86 |
[% END %] |
210 |
[% END %] |
87 |
</tbody> |
211 |
</tbody> |
88 |
<tfoot> |
212 |
<tfoot> |
89 |
<tr> |
213 |
<tr> |
90 |
<td colspan="4">Total income: </td> |
214 |
<td colspan="5">Total income: </td> |
91 |
<td>[% accountlines.total * -1 | $Price %]</td> |
215 |
<td>[% past_accountlines.total * -1 | $Price %]</td> |
92 |
<td></td> |
216 |
<td></td> |
93 |
</tr> |
217 |
</tr> |
94 |
</tfoot> |
218 |
</tfoot> |
95 |
</table> |
219 |
</table> |
|
|
220 |
[% ELSE %] |
221 |
[% IF register.cashups %] |
222 |
<h2>Older transactions</h2> |
223 |
<form method="GET" action="/cgi-bin/koha/pos/register.pl"> |
224 |
<fieldset class="rows"> |
225 |
Please select a date range to display transactions for: |
226 |
<ol> |
227 |
<li> |
228 |
<label for="trange_f">From: </label> |
229 |
<input type="text" size="10" id="from" name="trange_f" /> |
230 |
<label class="inline" for="trange_t">To: </label> |
231 |
<input size="10" id="to" name="trange_t" value="[% trange_t | html %]" type="text" /> |
232 |
<span class="hint">[% INCLUDE 'date-format.inc' %]</span> |
233 |
</li> |
234 |
</ol> |
235 |
</fieldset> |
236 |
<input type="submit" value="Display" /> |
237 |
</form> |
238 |
[% END %] |
96 |
[% END %] |
239 |
[% END %] |
97 |
</div> |
240 |
</div> |
98 |
|
241 |
|
Lines 103-111
Link Here
|
103 |
</div> |
246 |
</div> |
104 |
</div><!-- /.row --> |
247 |
</div><!-- /.row --> |
105 |
|
248 |
|
|
|
249 |
<!-- Issue refund modal --> |
250 |
<div class="modal" id="issueRefundModal" tabindex="-1" role="dialog" aria-labelledby="issueRefundLabel"> |
251 |
<form id="refund_form" method="post" enctype="multipart/form-data" class="validated"> |
252 |
<input type="hidden" name="accountline" value="" id="refundline"> |
253 |
<div class="modal-dialog" role="document"> |
254 |
<div class="modal-content"> |
255 |
<div class="modal-header"> |
256 |
<button type="button" class="closebtn" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> |
257 |
<h4 class="modal-title" id="issueRefundLabel">Issue refund from <em>[% register.name | html %]</em></h4> |
258 |
</div> |
259 |
<div class="modal-body"> |
260 |
<fieldset class="rows"> |
261 |
<ol> |
262 |
<li> |
263 |
<span id="item" class="label">Item: </span><span></span> |
264 |
</li> |
265 |
<li> |
266 |
<span id="paid" class="label">Amount paid: </span><span>[% refund.amount | $Price %]</span> |
267 |
</li> |
268 |
<li> |
269 |
<label class="required" for="amount">Returned to patron: </label> |
270 |
<input type="number" step="0.01" max="[% refund.amount | $Price %]" id="amount" name="amount" value="[% refund.amount | $Price %]" required="required"> |
271 |
<span class="required">Required</span> |
272 |
</li> |
273 |
<li> |
274 |
<label class="required" for="quantity">Quantity: </label> |
275 |
<input type="text" id="quantity" name="quantity" value="[% refund.quantity | html %]" required="required"> |
276 |
<span class="required">Required</span> |
277 |
</li> |
278 |
[% SET payment_types = AuthorisedValues.GetAuthValueDropbox('PAYMENT_TYPE') %] |
279 |
[% IF payment_types %] |
280 |
<li> |
281 |
<label for="transaction_type">Transaction type: </label> |
282 |
<select name="transaction_type" id="transaction_type"> |
283 |
[% FOREACH pt IN payment_types %] |
284 |
<option value="[% pt.authorised_value | html %]">[% pt.lib | html %]</option> |
285 |
[% END %] |
286 |
</select> |
287 |
</li> |
288 |
[% END %] |
289 |
</ol> |
290 |
</fieldset> <!-- /.rows --> |
291 |
</div> <!-- /.modal-body --> |
292 |
<div class="modal-footer"> |
293 |
<input type="hidden" name="registerid" value="[% register.id | html %]"> |
294 |
<input type="hidden" name="op" value="refund"> |
295 |
<button type="submit" class="btn btn-default">Confirm</button> |
296 |
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button> |
297 |
</div> <!-- /.modal-footer --> |
298 |
</div> <!-- /.modal-content --> |
299 |
</div> <!-- /.modal-dialog --> |
300 |
</form> <!-- /#refund_form --> |
301 |
</div> <!-- /#issueRefundModal --> |
302 |
|
106 |
[% MACRO jsinclude BLOCK %] |
303 |
[% MACRO jsinclude BLOCK %] |
107 |
[% INCLUDE 'datatables.inc' %] |
304 |
[% INCLUDE 'datatables.inc' %] |
108 |
[% Asset.js("lib/jquery/plugins/rowGroup/dataTables.rowGroup.min.js") | $raw %] |
305 |
[% Asset.js("lib/jquery/plugins/rowGroup/dataTables.rowGroup.min.js") | $raw %] |
|
|
306 |
[% INCLUDE 'calendar.inc' %] |
109 |
<script> |
307 |
<script> |
110 |
var sales_table = $("#sales").dataTable($.extend(true, {}, dataTablesDefaults, { |
308 |
var sales_table = $("#sales").dataTable($.extend(true, {}, dataTablesDefaults, { |
111 |
orderFixed: [ 0, 'asc'], |
309 |
orderFixed: [ 0, 'asc'], |
Lines 118-136
Link Here
|
118 |
startRender: function ( rows, group ) { |
316 |
startRender: function ( rows, group ) { |
119 |
var details = JSON.parse(rows.data().pluck(1).pop()); |
317 |
var details = JSON.parse(rows.data().pluck(1).pop()); |
120 |
return $('<tr class="'+details.type+'"/>') |
318 |
return $('<tr class="'+details.type+'"/>') |
121 |
.append( '<td colspan="2">'+group+' '+details.description+'</td>' ) |
319 |
.append( '<td>'+group+'</td>' ) |
|
|
320 |
.append( '<td colspan="2">'+details.description+'</td>' ) |
122 |
.append( '<td>'+details.amount+'</td>' ) |
321 |
.append( '<td>'+details.amount+'</td>' ) |
123 |
.append( '<td><button class="printReceipt" data-accountline="'+group+'"><i class="fa fa-print"></i> Print receipt</button></td>'); |
322 |
.append( '<td><button class="printReceipt btn btn-default btn-xs" data-accountline="'+group+'"><i class="fa fa-print"></i> Print receipt</button></td>'); |
124 |
}, |
323 |
}, |
125 |
endRender: null, |
324 |
endRender: null, |
126 |
} |
325 |
} |
127 |
})); |
326 |
})); |
128 |
|
327 |
|
|
|
328 |
var past_sales_table = $("#past_sales").dataTable($.extend(true, {}, dataTablesDefaults, { |
329 |
orderFixed: [ 0, 'asc'], |
330 |
columnDefs: [ { |
331 |
targets: [ 0, 1 ], |
332 |
visible: false |
333 |
}], |
334 |
rowGroup: { |
335 |
dataSrc: 0, |
336 |
startRender: function ( rows, group ) { |
337 |
var details = JSON.parse(rows.data().pluck(1).pop()); |
338 |
return $('<tr class="'+details.type+'"/>') |
339 |
.append( '<td>'+group+'</td>' ) |
340 |
.append( '<td colspan="2">'+details.description+'</td>' ) |
341 |
.append( '<td>'+details.amount+'</td>' ) |
342 |
.append( '<td><button class="printReceipt btn btn-default btn-xs" data-accountline="'+group+'"><i class="fa fa-print"></i> Print receipt</button></td>'); |
343 |
}, |
344 |
endRender: null, |
345 |
} |
346 |
})); |
347 |
|
348 |
$("#issueRefundModal").on("shown.bs.modal", function(e){ |
349 |
var button = $(e.relatedTarget); |
350 |
var item = button.data('item'); |
351 |
$("#item + span").replaceWith(item); |
352 |
var accountline = button.data('accountline'); |
353 |
$('#refundline').val(accountline); |
354 |
var amount = button.data('amount'); |
355 |
$("#paid + span").replaceWith(amount); |
356 |
$("#amount").val(amount); |
357 |
$("#amount").attr("max", amount); |
358 |
var quantity = button.data('quantity'); |
359 |
$("#quantity").val(quantity); |
360 |
$("#amount, #quantity, #transaction_type").focus(); |
361 |
}); |
362 |
|
129 |
$(".printReceipt").click(function() { |
363 |
$(".printReceipt").click(function() { |
130 |
var accountlines_id = $(this).data('accountline'); |
364 |
var accountlines_id = $(this).data('accountline'); |
131 |
var win = window.open('/cgi-bin/koha/pos/printreceipt.pl?action=print&accountlines_id=' + accountlines_id, '_blank'); |
365 |
var win = window.open('/cgi-bin/koha/pos/printreceipt.pl?action=print&accountlines_id=' + accountlines_id, '_blank'); |
132 |
win.focus(); |
366 |
win.focus(); |
133 |
}); |
367 |
}); |
|
|
368 |
|
369 |
$(document).ready(function() { |
370 |
// http://jqueryui.com/demos/datepicker/#date-range |
371 |
var dates = $( "#from, #to" ).datepicker({ |
372 |
changeMonth: true, |
373 |
numberOfMonths: 1, |
374 |
onSelect: function( selectedDate ) { |
375 |
var option = this.id == "from" ? "minDate" : "maxDate", |
376 |
instance = $( this ).data( "datepicker" ); |
377 |
date = $.datepicker.parseDate( |
378 |
instance.settings.dateFormat || |
379 |
$.datepicker._defaults.dateFormat, |
380 |
selectedDate, instance.settings ); |
381 |
dates.not( this ).datepicker( "option", option, date ); |
382 |
} |
383 |
}); |
384 |
}); |
134 |
</script> |
385 |
</script> |
135 |
[% END %] |
386 |
[% END %] |
136 |
|
387 |
|