Lines 144-149
Link Here
|
144 |
</tfoot> |
144 |
</tfoot> |
145 |
</table> |
145 |
</table> |
146 |
[% END %] |
146 |
[% END %] |
|
|
147 |
|
148 |
[% IF trange_f %] |
149 |
<h2>Older transactions</h2> |
150 |
<table id="past_sales" class="past_sales_table"> |
151 |
<thead> |
152 |
<th> |
153 |
ID |
154 |
</th> |
155 |
<th> |
156 |
DATA |
157 |
</th> |
158 |
<th> |
159 |
Transaction |
160 |
</th> |
161 |
<th> |
162 |
Description |
163 |
</th> |
164 |
<th> |
165 |
Price |
166 |
</th> |
167 |
<th> |
168 |
Total |
169 |
</th> |
170 |
<th> |
171 |
Actions |
172 |
</th> |
173 |
</thead> |
174 |
<tbody> |
175 |
[% FOREACH accountline IN past_accountlines %] |
176 |
[% IF accountline.is_credit %] |
177 |
[% FOREACH credit IN accountline.credit_offsets %] |
178 |
[% IF credit.debit %] |
179 |
<tr> |
180 |
<td>[% accountline.accountlines_id %]</td> |
181 |
<td>{ "type": "credit", "description": "[%- PROCESS account_type_description account=accountline -%] ([% accountline.payment_type | html %])", "amount": "[% accountline.amount * -1 | $Price %]" }</td> |
182 |
<td></td> |
183 |
<td>[%- PROCESS account_type_description account=credit.debit -%] |
184 |
[%- IF credit.debit.description -%] ([% credit.debit.description | html %])[%- END -%] |
185 |
[%- 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 -%] |
186 |
</td> |
187 |
<td>[% credit.debit.amount | $Price %]</td> |
188 |
<td></td> |
189 |
<td> |
190 |
[% IF CAN_user_cash_management_refund_cash_registers && !(credit.debit.status == 'REFUNDED' ) %] |
191 |
<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> |
192 |
[% END %] |
193 |
</td> |
194 |
</tr> |
195 |
[% END %] |
196 |
[% END %] |
197 |
[% ELSE %] |
198 |
[% FOREACH debit IN accountline.debit_offsets %] |
199 |
[% IF debit.credit %] |
200 |
<tr> |
201 |
<td>[% accountline.accountlines_id %]</td> |
202 |
<td>{ "type": "debit", "description": "[%- PROCESS account_type_description account=accountline -%] ([% accountline.payment_type | html %])", "amount": "[% accountline.amount * -1 | $Price %]" }</td> |
203 |
<td></td> |
204 |
<td>[%- PROCESS account_type_description account=debit.credit -%]</td> |
205 |
<td>[%- IF debit.credit.description %][% debit.credit.description | html %][% END %] |
206 |
[% 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> |
207 |
<td>[% debit.credit.amount | $Price %]</td> |
208 |
<td></td> |
209 |
</tr> |
210 |
[% END %] |
211 |
[% END %] |
212 |
[% END %] |
213 |
[% END %] |
214 |
</tbody> |
215 |
<tfoot> |
216 |
<tr> |
217 |
<td colspan="5">Total income: </td> |
218 |
<td>[% past_accountlines.total * -1 | $Price %]</td> |
219 |
<td></td> |
220 |
</tr> |
221 |
</tfoot> |
222 |
</table> |
223 |
[% ELSE %] |
224 |
[% IF register.cashups %] |
225 |
<h2>Older transactions</h2> |
226 |
<form method="GET" action="/cgi-bin/koha/pos/register.pl"> |
227 |
<fieldset class="rows"> |
228 |
Please select a date range to display transactions for: |
229 |
<ol> |
230 |
<li> |
231 |
<label for="trange_f">From: </label> |
232 |
<input type="text" size="10" id="from" name="trange_f" /> |
233 |
<label class="inline" for="trange_t">To: </label> |
234 |
<input size="10" id="to" name="trange_t" value="[% trange_t | html %]" type="text" /> |
235 |
<span class="hint">[% INCLUDE 'date-format.inc' %]</span> |
236 |
</li> |
237 |
</ol> |
238 |
</fieldset> |
239 |
<input type="submit" value="Display" /> |
240 |
</form> |
241 |
[% END %] |
242 |
[% END %] |
147 |
</div> |
243 |
</div> |
148 |
|
244 |
|
149 |
<div class="col-sm-2 col-sm-pull-10"> |
245 |
<div class="col-sm-2 col-sm-pull-10"> |
Lines 210-215
Link Here
|
210 |
[% MACRO jsinclude BLOCK %] |
306 |
[% MACRO jsinclude BLOCK %] |
211 |
[% INCLUDE 'datatables.inc' %] |
307 |
[% INCLUDE 'datatables.inc' %] |
212 |
[% Asset.js("lib/jquery/plugins/rowGroup/dataTables.rowGroup.min.js") | $raw %] |
308 |
[% Asset.js("lib/jquery/plugins/rowGroup/dataTables.rowGroup.min.js") | $raw %] |
|
|
309 |
[% INCLUDE 'calendar.inc' %] |
213 |
<script> |
310 |
<script> |
214 |
var sales_table = $("#sales").dataTable($.extend(true, {}, dataTablesDefaults, { |
311 |
var sales_table = $("#sales").dataTable($.extend(true, {}, dataTablesDefaults, { |
215 |
orderFixed: [ 0, 'asc'], |
312 |
orderFixed: [ 0, 'asc'], |
Lines 231-236
Link Here
|
231 |
} |
328 |
} |
232 |
})); |
329 |
})); |
233 |
|
330 |
|
|
|
331 |
var past_sales_table = $("#past_sales").dataTable($.extend(true, {}, dataTablesDefaults, { |
332 |
orderFixed: [ 0, 'asc'], |
333 |
columnDefs: [ { |
334 |
targets: [ 0, 1 ], |
335 |
visible: false |
336 |
}], |
337 |
rowGroup: { |
338 |
dataSrc: 0, |
339 |
startRender: function ( rows, group ) { |
340 |
var details = JSON.parse(rows.data().pluck(1).pop()); |
341 |
return $('<tr class="'+details.type+'"/>') |
342 |
.append( '<td>'+group+'</td>' ) |
343 |
.append( '<td colspan="2">'+details.description+'</td>' ) |
344 |
.append( '<td>'+details.amount+'</td>' ) |
345 |
.append( '<td><button class="printReceipt btn btn-default btn-xs" data-accountline="'+group+'"><i class="fa fa-print"></i> Print receipt</button></td>'); |
346 |
}, |
347 |
endRender: null, |
348 |
} |
349 |
})); |
350 |
|
234 |
$("#issueRefundModal").on("shown.bs.modal", function(e){ |
351 |
$("#issueRefundModal").on("shown.bs.modal", function(e){ |
235 |
var button = $(e.relatedTarget); |
352 |
var button = $(e.relatedTarget); |
236 |
var item = button.data('item'); |
353 |
var item = button.data('item'); |
Lines 251-256
Link Here
|
251 |
var win = window.open('/cgi-bin/koha/pos/printreceipt.pl?action=print&accountlines_id=' + accountlines_id, '_blank'); |
368 |
var win = window.open('/cgi-bin/koha/pos/printreceipt.pl?action=print&accountlines_id=' + accountlines_id, '_blank'); |
252 |
win.focus(); |
369 |
win.focus(); |
253 |
}); |
370 |
}); |
|
|
371 |
|
372 |
$(document).ready(function() { |
373 |
// http://jqueryui.com/demos/datepicker/#date-range |
374 |
var dates = $( "#from, #to" ).datepicker({ |
375 |
changeMonth: true, |
376 |
numberOfMonths: 1, |
377 |
onSelect: function( selectedDate ) { |
378 |
var option = this.id == "from" ? "minDate" : "maxDate", |
379 |
instance = $( this ).data( "datepicker" ); |
380 |
date = $.datepicker.parseDate( |
381 |
instance.settings.dateFormat || |
382 |
$.datepicker._defaults.dateFormat, |
383 |
selectedDate, instance.settings ); |
384 |
dates.not( this ).datepicker( "option", option, date ); |
385 |
} |
386 |
}); |
387 |
}); |
254 |
</script> |
388 |
</script> |
255 |
[% END %] |
389 |
[% END %] |
256 |
|
390 |
|