5 [% USE ColumnsSettings %]
7 [% INCLUDE 'doc-head-open.inc' %]
8 <title>Koha › Acquisitions › Late orders</title>
9 [% Asset.css("css/datatables.css") | $raw %]
10 [% INCLUDE 'doc-head-close.inc' %]
13 <body id="acq_lateorders" class="acq">
14 [% INCLUDE 'header.inc' %]
15 [% INCLUDE 'acquisitions-search.inc' %]
17 <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>
19 <div class="main container-fluid">
21 <div class="col-sm-10 col-sm-push-2">
24 <h1>[% IF ( Supplier ) %][% Supplier | html %] : [% END %]Late orders</h1>
25 <div id="acqui_lateorders">
28 [% IF ( error_claim == "no_email" ) %]
29 <div class="dialog alert">This vendor has no email</div>
30 [% ELSIF ( error_claim == "no_order_selected" ) %]
31 <div class="dialog alert">No order selected</div>
33 <div class="dialog alert">[% error_claim | html %]</div>
37 <div class="dialog message">Email has been sent.</div>
39 [% IF ( lateorders ) %]
40 <form action="lateorders.pl" name="claim" method="post">
41 <input type="hidden" name="op" value="send_alert" />
42 <input type="hidden" name="delay" value="[% delay | html %]" />
43 <input type="hidden" name="booksellerid" value="[% booksellerid | html %]" />
45 <p><label for="letter_code">Claim using notice: </label><select name="letter_code" id="letter_code">
46 [% FOREACH letter IN letters %]
47 <option value="[% letter.code | html %]">[% letter.name | html %]</option>
52 <table id="late_orders">
56 <th><a id="CheckAll" href="#">Check all</a><br /><a id="CheckNone" href="#">Uncheck all</a></th>
60 <th class="title-string">Order date</th>
61 <th class="title-string">Estimated delivery date</th>
63 <th class="anti-the">Information</th>
70 <th class="title-string">Claimed date</th>
74 [% FOREACH lateorder IN lateorders %]
77 <input type="checkbox" value="[% lateorder.ordernumber | html %]" data-booksellerid="[% lateorder.supplierid | html %]" name="ordernumber">
80 <span title="[% lateorder.orderdate | html %]">[% lateorder.orderdate | $KohaDates %] ([% lateorder.latesince | html %] days)</span>
83 [% IF ( lateorder.estimateddeliverydate ) %]
84 <span title="[% lateorder.estimateddeliverydate | html %]">[% lateorder.estimateddeliverydate | $KohaDates %]</span>
86 <span title="0000-00-00"></span>
90 [% lateorder.supplier | html %]
91 ([% lateorder.supplierid | html %])
94 <b>[% lateorder.title | html %]</b>
95 [% IF ( lateorder.author ) %]<br/><i>Author:</i> [% lateorder.author | html %][% END %]
96 [% IF ( lateorder.publisher ) %]
97 <br/><i>Published by:</i> [% lateorder.publisher | html %]
98 [% IF ( lateorder.publicationyear ) %]
99 <i> in </i>[% lateorder.publicationyear | html %]
104 [% lateorder.unitpricesupplier | html %]x[% lateorder.quantity | html %] =
105 [% lateorder.subtotal | html %]
108 [% IF ( CAN_user_acquisition_order_manage ) %]
109 <a href="basket.pl?basketno=[% lateorder.basketno | uri %]" title="basket">[% lateorder.basketname | html %] ([% lateorder.basketno | html %])</a>
111 [% lateorder.basketname | html %] ([% lateorder.basketno | html %])
115 [% IF ( lateorder.basketgroupid ) %]
116 [% IF ( CAN_user_acquisition_group_manage ) %]
117 <a href="basketgroup.pl?op=add&booksellerid=[% lateorder.supplierid | uri %]&basketgroupid=[% lateorder.basketgroupid | uri %]" title="basketgroup">[% lateorder.basketgroupname | html %] ([% lateorder.basketgroupid | html %])</a>
119 [% lateorder.basketgroupname | html %] ([% lateorder.basketgroupid | html %])</a>
123 <td>[% Branches.GetName( lateorder.branch ) | html %]
125 <td>[% lateorder.budget | html %]
127 <td>[% lateorder.claims_count | html %]</td>
129 [% IF ( lateorder.claimed_date ) %]
130 <span title="[% lateorder.claimed_date | html %]">[% lateorder.claimed_date | $KohaDates %]</span>
132 <span title="0000-00-00"></span>
140 <th colspan="5">Total</th>
141 <th>[% total | html %]</th>
142 <th colspan="6"> </th>
146 <div class="spacer"></div>
148 <p style="display:block;">
149 <input type="button" value="Export as CSV" id="ExportSelected" />
150 [% UNLESS lateorder.budget_lock %]
151 <input type="submit" value="Claim order" />
155 [% ELSE %]<p>There are no late orders.</p>
157 </div> <!-- /#acqui_lateorders -->
159 </div> <!-- /.col-sm-10.col-sm-push-2 -->
161 <div class="col-sm-2 col-sm-pull-10">
163 <form action="lateorders.pl" method="get">
164 <fieldset class="brief">
165 <h4>Filter results:</h4>
166 [% FOREACH ERROR_LOO IN ERROR_LOOP %]
167 [% 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 %]
170 <li><label for="delay">Order date:</label><input size="3" maxlength="3" id="delay" type="text" name="delay" value="[% delay | html %]" /> days ago</li>
171 <li><label for="from">Estimated delivery date from: </label>
172 <input type="text" size="10" id="from" name="estimateddeliverydatefrom" value="[% estimateddeliverydatefrom | html %]" class="datepickerfrom" />
173 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
175 <li><label for="to">To: </label>
176 <input type="text" size="10" id="to" name="estimateddeliverydateto" value="[% estimateddeliverydateto | html %]" class="datepickerto" />
177 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
180 <li><label for="booksellerid">Vendor:</label>
181 <select id="booksellerid" size="1" tabindex="" name="booksellerid">
182 <option value=""></option>
183 [% FOREACH SUPPLIER_LOO IN SUPPLIER_LOOP %]
184 [% IF ( SUPPLIER_LOO.selected ) %]<option value="[% SUPPLIER_LOO.id | html %]" selected="selected">[% SUPPLIER_LOO.name | html %]</option>
185 [% ELSE %]<option value="[% SUPPLIER_LOO.id | html %]">[% SUPPLIER_LOO.name | html %]</option>[% END %]
189 <fieldset class="action"><input type="submit" value="Filter" /></fieldset>
192 [% INCLUDE 'acquisitions-menu.inc' %]
194 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
197 [% MACRO jsinclude BLOCK %]
198 [% Asset.js("js/acquisitions-menu.js") | $raw %]
199 [% INCLUDE 'datatables.inc' %]
200 [% INCLUDE 'columns_settings.inc' %]
201 [% Asset.js("lib/jquery/plugins/jquery.checkboxes.min.js") | $raw %]
202 [% INCLUDE 'calendar.inc' %]
205 function check_uncheck() {
206 var all_nodes = $(late_orderst.fnGetNodes());
207 if ( $(all_nodes).find("input:checkbox[name=ordernumber]:checked").length > 0) {
208 var booksellerid = $(all_nodes).find("input:checkbox[name=ordernumber]:checked:first").attr("data-booksellerid");
209 $(all_nodes).find("input:checkbox[name=ordernumber][data-booksellerid!="+booksellerid+"]").prop('disabled', true);
211 $("input:checkbox[name=ordernumber]").prop('disabled', false);
215 $(document).ready(function() {
217 var columns_settings = [% ColumnsSettings.GetColumns( 'acqui', 'lateorders', 'late_orders', 'json' ) | $raw %];
218 late_orderst = KohaTable("late_orders", {
220 { "aTargets": [ 0 ], "bSortable": false, "bSearchable": false },
221 { "sType": "anti-the", "aTargets" : [ "anti-the" ] },
222 { "sType": "title-string", "aTargets" : [ "title-string" ] }
224 "sPaginationType": "four_button",
226 "fnDrawCallback": function() {
227 if ( typeof late_orderst != 'undefined' ) {
229 $('input:checkbox[name=ordernumber]').bind('click', check_uncheck);
232 }, columns_settings );
233 $('input:checkbox[name=ordernumber]').bind('click', check_uncheck);
234 $('#CheckAll').click(function(){ $(late_orderst.fnGetNodes()).find("td").checkCheckboxes();});
235 $('#CheckNone').click(function(){ $(late_orderst.fnGetNodes()).find("td").unCheckCheckboxes();});
237 // Generates a dynamic link for exporting the selection's data as CSV
238 $("#ExportSelected").click(function() {
239 var all_nodes = $(late_orderst.fnGetNodes());
240 var selected = $(all_nodes).find("input[name='ordernumber']:checked");
242 if (selected.length == 0) {
243 alert(_("Please select at least one item to export."));
247 // Building the url from currently checked boxes
248 var url = '/cgi-bin/koha/acqui/lateorders-export.pl?op=export';
249 for (var i = 0; i < selected.length; i++) {
250 url += '&ordernumber=' + selected[i].value;
252 // And redirecting to the CSV page
260 [% INCLUDE 'intranet-bottom.inc' %]