Lines 38-48
Link Here
|
38 |
<h1>Invoices</h1> |
38 |
<h1>Invoices</h1> |
39 |
[% IF ( do_search ) %] |
39 |
[% IF ( do_search ) %] |
40 |
[% IF invoices %] |
40 |
[% IF invoices %] |
|
|
41 |
[% BLOCK invoices_table %] |
42 |
[% IF closed %] |
43 |
[% SET tab = 'closed' %] |
44 |
[% ELSE %] |
45 |
[% SET tab = 'opened' %] |
46 |
[% END %] |
41 |
<label for="show_only_subscription"> |
47 |
<label for="show_only_subscription"> |
42 |
<input type="checkbox" style="vertical-align: middle;" id="show_only_subscription" /> |
48 |
<input type="checkbox" style="vertical-align: middle;" class="show_only_subscription" data-tableid="[% tab %]resultst"/> |
43 |
Show only subscriptions |
49 |
Show only subscriptions |
44 |
</label> |
50 |
</label> |
45 |
<table id="resultst"> |
51 |
<table id="[% tab %]resultst" class="result"> |
46 |
<thead> |
52 |
<thead> |
47 |
<tr> |
53 |
<tr> |
48 |
[% IF CAN_user_acquisition_merge_invoices %] |
54 |
[% IF CAN_user_acquisition_merge_invoices %] |
Lines 113-135
Link Here
|
113 |
</tbody> |
119 |
</tbody> |
114 |
</table> |
120 |
</table> |
115 |
[% IF CAN_user_acquisition_merge_invoices %] |
121 |
[% IF CAN_user_acquisition_merge_invoices %] |
116 |
<a class="submit" id="merge" href="#merge_invoices">Merge selected invoices</a> |
122 |
<a class="submit merge" id="merge" href="#merge_invoices">Merge selected invoices</a> |
117 |
<div id="merge_invoices"> |
123 |
[% IF tab == 'closed' %] |
118 |
<form id="merge_invoice_form" action="/cgi-bin/koha/acqui/invoice.pl" method="post"> |
124 |
<a class="submit" id="open_sel" href="#reopen_selected" data-op="reopen" data-referer="referer=/cgi-bin/koha/acqui/invoices.pl%3Fop=do_search%26invoicenumber=[% invoicenumber | uri %]%26supplier=[% booksellerid | uri %]%26shipmentdatefrom=[% shipmentdatefrom | $KohaDates %]%26shipmentdateto=[% shipmentdateto | $KohaDates %]%26billingdatefrom=[% billingdatefrom | $KohaDates %]%26billingdateto=[% billingdateto | $KohaDates %]%26isbneanissn=[% isbneanissn | uri %]%26title=[% title | uri %]%26author=[% author | uri %]%26publisher=[% publisher | uri %]%26publicationyear=[% publicationyear | uri %]%26branch=[% branch | uri %]"><i class="fa fa-refresh"></i> Reopen Selected Invoices</a> |
119 |
<fieldset class="rows"> |
125 |
[% ELSE %] |
120 |
<ol> |
126 |
<a class="submit" id="close_sel" href="#close_selected" data-op="close" data-referer="referer=/cgi-bin/koha/acqui/invoices.pl%3Fop=do_search%26invoicenumber=[% invoicenumber | uri %]%26supplier=[% booksellerid | uri %]%26shipmentdatefrom=[% shipmentdatefrom | $KohaDates %]%26shipmentdateto=[% shipmentdateto | $KohaDates %]%26billingdatefrom=[% billingdatefrom | $KohaDates %]%26billingdateto=[% billingdateto | $KohaDates %]%26isbneanissn=[% isbneanissn | uri %]%26title=[% title | uri %]%26author=[% author | uri %]%26publisher=[% publisher | uri %]%26publicationyear=[% publicationyear | uri %]%26branch=[% branch | uri %]"><i class="fa fa-times-circle"></i> Close Selected Invoices</a> |
121 |
<li><h2>Merge invoices</h2></li> |
127 |
[% END %] |
122 |
<li><table id="merge_table"> |
128 |
|
123 |
<thead><tr><th>Invoice no.</th><th>Shipment date</th><th>Billing date</th><th>Shipment cost</th></tr></thead> |
129 |
[% END %] <!-- invoices_table --> |
124 |
<tbody> |
130 |
<div id="invoicestabs" class="toptabs" style="clear:both;"> |
125 |
</tbody> |
131 |
<ul class="ui-tabs-nav"> |
126 |
</table></li> |
132 |
<li><a href="#opened">Open Invoices ([% openedinvoices.size || 0 | html %])</a></li> |
127 |
<li><label for="merge_invoicenumber" class="required">Invoice number:</label> |
133 |
<li><a href="#closed">Closed Invoices ([% closedinvoices.size || 0 | html %]) </a></li> |
128 |
<input type="text" size="10" id="merge_invoicenumber" name="invoicenumber" value="" class="required" required="required" /> |
134 |
</ul> |
129 |
<span class="required">Required</span> |
135 |
<div id="opened"> |
130 |
</li> |
136 |
[% IF openedinvoices %] |
131 |
<li><label for="merge_shipmentdate">Shipment date:</label> |
137 |
[% INCLUDE invoices_table invoices = openedinvoices %] |
132 |
<input type="text" size="10" id="merge_shipmentdate" name="shipmentdate" value="" class="datepicker" /></li> |
138 |
[% ELSE %] |
|
|
139 |
<div class="dialog message"> |
140 |
<p>Your search returned no open invoices.</p> |
141 |
</div> |
142 |
[% END %] |
143 |
</div> <!-- opened --> |
144 |
<div id="closed"> |
145 |
[% IF closedinvoices %] |
146 |
[% INCLUDE invoices_table invoices = closedinvoices closed = 1 %] |
147 |
[% ELSE %] |
148 |
<div class="dialog message"> |
149 |
<p>Your search returned no closed invoices.</p> |
150 |
</div> |
151 |
[% END %] |
152 |
</div> <!-- closed --> |
153 |
</div> <!-- invoicestabs --> |
154 |
|
155 |
|
156 |
<div id="merge_invoices"> |
157 |
<form id="merge_invoice_form" action="/cgi-bin/koha/acqui/invoice.pl" method="post"> |
158 |
<fieldset class="rows"> |
159 |
<ol> |
160 |
<li><h2>Merge invoices</h2></li> |
161 |
<li><table id="merge_table"> |
162 |
<thead><tr><th>Invoice no.</th><th>Shipment date</th><th>Billing date</th><th>Shipment cost</th></tr></thead> |
163 |
<tbody> |
164 |
</tbody> |
165 |
</table></li> |
166 |
<li><label for="merge_invoicenumber" class="required">Invoice number:</label> |
167 |
<input type="text" size="10" id="merge_invoicenumber" name="invoicenumber" value="" class="required" required="required" /> |
168 |
<span class="required">Required</span> |
169 |
</li> |
170 |
<li><label for="merge_shipmentdate">Shipment date:</label> |
171 |
<input type="text" size="10" id="merge_shipmentdate" name="shipmentdate" value="" class="datepicker" /></li> |
133 |
|
172 |
|
134 |
<li><label for="merge_billingdate">Billing date:</label> |
173 |
<li><label for="merge_billingdate">Billing date:</label> |
135 |
<input type="text" size="10" id="merge_billingdate" name="billingdate" value="" class="datepicker" /></li> |
174 |
<input type="text" size="10" id="merge_billingdate" name="billingdate" value="" class="datepicker" /></li> |
Lines 322-331
Link Here
|
322 |
[% INCLUDE 'calendar.inc' %] |
361 |
[% INCLUDE 'calendar.inc' %] |
323 |
<script> |
362 |
<script> |
324 |
$(document).ready(function() { |
363 |
$(document).ready(function() { |
|
|
364 |
$('#invoicestabs').tabs(); |
325 |
$(".delete_invoice").click(function(){ |
365 |
$(".delete_invoice").click(function(){ |
326 |
return confirmDelete(_("Are you sure you want to delete this invoice?")); |
366 |
return confirmDelete(_("Are you sure you want to delete this invoice?")); |
327 |
}); |
367 |
}); |
328 |
var resultst = $("#resultst").dataTable($.extend(true, {}, dataTablesDefaults, { |
368 |
var resultst = $("table.result").dataTable($.extend(true, {}, dataTablesDefaults, { |
329 |
bPaginate: false, |
369 |
bPaginate: false, |
330 |
aoColumnDefs: [ |
370 |
aoColumnDefs: [ |
331 |
{ "bSortable": false, "aTargets": [1, -1] }, |
371 |
{ "bSortable": false, "aTargets": [1, -1] }, |
Lines 333-349
Link Here
|
333 |
] |
373 |
] |
334 |
})); |
374 |
})); |
335 |
|
375 |
|
336 |
$("#show_only_subscription").prop("checked", false); |
376 |
$(".show_only_subscription").prop("checked", false); |
337 |
|
377 |
|
338 |
$("#show_only_subscription").click(function(){ |
378 |
$(".show_only_subscription").click(function(){ |
|
|
379 |
var table_id = $(this).attr("data-tableid"); |
339 |
if ( $(this).prop("checked") ) { |
380 |
if ( $(this).prop("checked") ) { |
340 |
resultst.fnFilter( "1", 0, true ); |
381 |
$('#'+table_id).dataTable().fnFilter( "1", 0, true ); |
341 |
} else { |
382 |
} else { |
342 |
resultst.fnFilter( '', 0 ); |
383 |
$('#'+table_id).dataTable().fnFilter( '', 0 ); |
343 |
} |
384 |
} |
344 |
}); |
385 |
}); |
345 |
|
386 |
|
346 |
$('#merge').click(function (ev) { |
387 |
$('#open_sel,#close_sel').click(function () { |
|
|
388 |
var referer = $(this).attr("data-referer"); |
389 |
var op = $(this).attr("data-op"); |
390 |
var invoice_link = "invoice.pl?op="+op; |
391 |
$('.select-invoice:checked').each(function () { |
392 |
var row = $(this).parents('tr'); |
393 |
invoice_link = invoice_link + "&invoiceid="+$(row).attr('data-invoiceid'); |
394 |
}); |
395 |
window.location.href =invoice_link +"&"+referer; |
396 |
}); |
397 |
|
398 |
$('.merge').click(function (ev) { |
347 |
var booksellerid; |
399 |
var booksellerid; |
348 |
var mismatch; |
400 |
var mismatch; |
349 |
var invoices = [ ]; |
401 |
var invoices = [ ]; |
350 |
- |
|
|