5 [% USE ColumnsSettings %]
7 [% INCLUDE 'doc-head-open.inc' %]
8 <title>Koha › Acquisitions › Late orders</title>
9 [% INCLUDE 'doc-head-close.inc' %]
12 <body id="acq_lateorders" class="acq">
13 [% INCLUDE 'header.inc' %]
14 [% INCLUDE 'acquisitions-search.inc' %]
16 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a> › <a href="lateorders.pl">Late orders</a></div>
18 <div class="main container-fluid">
20 <div class="col-sm-10 col-sm-push-2">
23 <h1>[% IF ( Supplier ) %][% Supplier | html %] : [% END %]Late orders</h1>
24 <div id="acqui_lateorders">
27 [% IF ( error_claim == "no_email" ) %]
28 <div class="dialog alert">This vendor has no email</div>
29 [% ELSIF ( error_claim == "no_order_selected" ) %]
30 <div class="dialog alert">No order selected</div>
32 <div class="dialog alert">[% error_claim | html %]</div>
36 <div class="dialog message">Email has been sent.</div>
38 [% IF ( lateorders ) %]
39 <form action="lateorders.pl" name="claim" method="post">
40 <input type="hidden" name="op" value="send_alert" />
41 <input type="hidden" name="delay" value="[% delay | html %]" />
42 <input type="hidden" name="booksellerid" value="[% booksellerid | html %]" />
44 <p><label for="letter_code">Claim using notice: </label><select name="letter_code" id="letter_code">
45 [% FOREACH letter IN letters %]
46 <option value="[% letter.code | html %]">[% letter.name | html %]</option>
51 <table id="late_orders">
55 <th><a id="CheckAll" href="#">Check all</a><br /><a id="CheckNone" href="#">Uncheck all</a></th>
59 <th class="title-string">Order date</th>
60 <th class="title-string">Estimated delivery date</th>
62 <th class="anti-the">Information</th>
69 <th class="title-string">Claimed date</th>
73 [% FOREACH lateorder IN lateorders %]
76 <input type="checkbox" value="[% lateorder.ordernumber | html %]" data-booksellerid="[% lateorder.supplierid | html %]" name="ordernumber">
79 <span title="[% lateorder.orderdate | html %]">[% lateorder.orderdate | $KohaDates %] ([% lateorder.latesince | html %] days)</span>
82 [% IF ( lateorder.estimateddeliverydate ) %]
83 <span title="[% lateorder.estimateddeliverydate | html %]">[% lateorder.estimateddeliverydate | $KohaDates %]</span>
85 <span title="0000-00-00"></span>
89 [% lateorder.supplier | html %]
90 ([% lateorder.supplierid | html %])
93 <b>[% lateorder.title | html %]</b>
94 [% IF ( lateorder.author ) %]<br/><i>Author:</i> [% lateorder.author | html %][% END %]
95 [% IF ( lateorder.publisher ) %]
96 <br/><i>Published by:</i> [% lateorder.publisher | html %]
97 [% IF ( lateorder.publicationyear ) %]
98 <i> in </i>[% lateorder.publicationyear | html %]
103 [% lateorder.unitpricesupplier | html %]x[% lateorder.quantity | html %] =
104 [% lateorder.subtotal | html %]
107 [% IF ( CAN_user_acquisition_order_manage ) %]
108 <a href="basket.pl?basketno=[% lateorder.basketno | uri %]" title="basket">[% lateorder.basketname | html %] ([% lateorder.basketno | html %])</a>
110 [% lateorder.basketname | html %] ([% lateorder.basketno | html %])
114 [% IF ( lateorder.basketgroupid ) %]
115 [% IF ( CAN_user_acquisition_group_manage ) %]
116 <a href="basketgroup.pl?op=add&booksellerid=[% lateorder.supplierid | uri %]&basketgroupid=[% lateorder.basketgroupid | uri %]" title="basketgroup">[% lateorder.basketgroupname | html %] ([% lateorder.basketgroupid | html %])</a>
118 [% lateorder.basketgroupname | html %] ([% lateorder.basketgroupid | html %])</a>
122 <td>[% Branches.GetName( lateorder.branch ) | html %]
124 <td>[% lateorder.budget | html %]
126 <td>[% lateorder.claims_count | html %]</td>
128 [% IF ( lateorder.claimed_date ) %]
129 <span title="[% lateorder.claimed_date | html %]">[% lateorder.claimed_date | $KohaDates %]</span>
131 <span title="0000-00-00"></span>
139 <th colspan="5">Total</th>
140 <th>[% total | html %]</th>
141 <th colspan="6"> </th>
145 <div class="spacer"></div>
147 <p style="display:block;">
148 <input type="button" value="Export as CSV" id="ExportSelected" />
149 [% UNLESS lateorder.budget_lock %]
150 <input type="submit" value="Claim order" />
154 [% ELSE %]<p>There are no late orders.</p>
156 </div> <!-- /#acqui_lateorders -->
158 </div> <!-- /.col-sm-10.col-sm-push-2 -->
160 <div class="col-sm-2 col-sm-pull-10">
162 <form action="lateorders.pl" method="get">
163 <fieldset class="brief">
164 <h4>Filter results:</h4>
165 [% FOREACH ERROR_LOO IN ERROR_LOOP %]
166 [% IF ( ERROR_LOO.delay_digits ) %]<p class="error">The number of days ([% ERROR_LOO.bad_delay | html %]) must be a number between 0 and 999.</p>[% END %]
169 <li><label for="delay">Order date:</label><input size="3" maxlength="3" id="delay" type="text" name="delay" value="[% delay | html %]" /> days ago</li>
170 <li><label for="from">Estimated delivery date from: </label>
171 <input type="text" size="10" id="from" name="estimateddeliverydatefrom" value="[% estimateddeliverydatefrom | html %]" class="datepickerfrom" />
172 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
174 <li><label for="to">To: </label>
175 <input type="text" size="10" id="to" name="estimateddeliverydateto" value="[% estimateddeliverydateto | html %]" class="datepickerto" />
176 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
179 <li><label for="booksellerid">Vendor:</label>
180 <select id="booksellerid" size="1" tabindex="" name="booksellerid">
181 <option value=""></option>
182 [% FOREACH SUPPLIER_LOO IN SUPPLIER_LOOP %]
183 [% IF ( SUPPLIER_LOO.selected ) %]<option value="[% SUPPLIER_LOO.id | html %]" selected="selected">[% SUPPLIER_LOO.name | html %]</option>
184 [% ELSE %]<option value="[% SUPPLIER_LOO.id | html %]">[% SUPPLIER_LOO.name | html %]</option>[% END %]
188 <fieldset class="action"><input type="submit" value="Filter" /></fieldset>
191 [% INCLUDE 'acquisitions-menu.inc' %]
193 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
196 [% MACRO jsinclude BLOCK %]
197 [% Asset.js("js/acquisitions-menu.js") | $raw %]
198 [% INCLUDE 'datatables.inc' %]
199 [% INCLUDE 'columns_settings.inc' %]
200 [% Asset.js("lib/jquery/plugins/jquery.checkboxes.min.js") | $raw %]
201 [% INCLUDE 'calendar.inc' %]
204 function check_uncheck() {
205 var all_nodes = $(late_orderst.fnGetNodes());
206 if ( $(all_nodes).find("input:checkbox[name=ordernumber]:checked").length > 0) {
207 var booksellerid = $(all_nodes).find("input:checkbox[name=ordernumber]:checked:first").attr("data-booksellerid");
208 $(all_nodes).find("input:checkbox[name=ordernumber][data-booksellerid!="+booksellerid+"]").prop('disabled', true);
210 $("input:checkbox[name=ordernumber]").prop('disabled', false);
214 $(document).ready(function() {
216 var columns_settings = [% ColumnsSettings.GetColumns( 'acqui', 'lateorders', 'late_orders', 'json' ) | $raw %];
217 late_orderst = KohaTable("late_orders", {
219 { "aTargets": [ 0 ], "bSortable": false, "bSearchable": false },
220 { "sType": "anti-the", "aTargets" : [ "anti-the" ] },
221 { "sType": "title-string", "aTargets" : [ "title-string" ] }
223 "sPaginationType": "four_button",
225 "fnDrawCallback": function() {
226 if ( typeof late_orderst != 'undefined' ) {
228 $('input:checkbox[name=ordernumber]').bind('click', check_uncheck);
231 }, columns_settings );
232 $('input:checkbox[name=ordernumber]').bind('click', check_uncheck);
233 $('#CheckAll').click(function(){ $(late_orderst.fnGetNodes()).find("td").checkCheckboxes();});
234 $('#CheckNone').click(function(){ $(late_orderst.fnGetNodes()).find("td").unCheckCheckboxes();});
236 // Generates a dynamic link for exporting the selection's data as CSV
237 $("#ExportSelected").click(function() {
238 var all_nodes = $(late_orderst.fnGetNodes());
239 var selected = $(all_nodes).find("input[name='ordernumber']:checked");
241 if (selected.length == 0) {
242 alert(_("Please select at least one item to export."));
246 // Building the url from currently checked boxes
247 var url = '/cgi-bin/koha/acqui/lateorders-export.pl?op=export';
248 for (var i = 0; i < selected.length; i++) {
249 url += '&ordernumber=' + selected[i].value;
251 // And redirecting to the CSV page
259 [% INCLUDE 'intranet-bottom.inc' %]