3 [% USE ColumnsSettings %]
4 [% INCLUDE 'doc-head-open.inc' %]
5 <title>Koha › Acquisitions › Late orders</title>
6 <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
7 [% INCLUDE 'doc-head-close.inc' %]
8 [% INCLUDE 'datatables.inc' %]
9 [% INCLUDE 'columns_settings.inc' %]
10 <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
11 [% INCLUDE 'calendar.inc' %]
12 <script type="text/javascript">
16 function check_uncheck() {
17 var all_nodes = $(late_orderst.fnGetNodes());
18 if ( $(all_nodes).find("input:checkbox[name=ordernumber]:checked").length > 0) {
19 var booksellerid = $(all_nodes).find("input:checkbox[name=ordernumber]:checked:first").attr("data-booksellerid");
20 $(all_nodes).find("input:checkbox[name=ordernumber][data-booksellerid!="+booksellerid+"]").prop('disabled', true);
22 $("input:checkbox[name=ordernumber]").prop('disabled', false);
26 $(document).ready(function() {
28 var columns_settings = [% ColumnsSettings.GetColumns( 'acqui', 'lateorders', 'late_orders', 'json' ) %];
29 late_orderst = KohaTable("#late_orders", {
31 { "aTargets": [ 0 ], "bSortable": false, "bSearchable": false },
32 { "sType": "anti-the", "aTargets" : [ "anti-the" ] },
33 { "sType": "title-string", "aTargets" : [ "title-string" ] }
35 "sPaginationType": "four_button",
37 "fnDrawCallback": function() {
38 if ( typeof late_orderst != 'undefined' ) {
40 $('input:checkbox[name=ordernumber]').bind('click', check_uncheck);
43 }, columns_settings );
44 $('input:checkbox[name=ordernumber]').bind('click', check_uncheck);
45 $('#CheckAll').click(function(){ $(late_orderst.fnGetNodes()).find("td").checkCheckboxes();});
46 $('#CheckNone').click(function(){ $(late_orderst.fnGetNodes()).find("td").unCheckCheckboxes();});
48 // Generates a dynamic link for exporting the selection's data as CSV
49 $("#ExportSelected").click(function() {
50 var all_nodes = $(late_orderst.fnGetNodes());
51 var selected = $(all_nodes).find("input[name='ordernumber']:checked");
53 if (selected.length == 0) {
54 alert(_("Please select at least one item to export."));
58 // Building the url from currently checked boxes
59 var url = '/cgi-bin/koha/acqui/lateorders-export.pl?op=export';
60 for (var i = 0; i < selected.length; i++) {
61 url += '&ordernumber=' + selected[i].value;
63 // And redirecting to the CSV page
71 <body id="acq_lateorders" class="acq">
72 [% INCLUDE 'header.inc' %]
73 [% INCLUDE 'acquisitions-search.inc' %]
75 <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>
77 <div id="doc3" class="yui-t2">
83 <h1>[% IF ( Supplier ) %][% Supplier %] : [% END %]Late orders</h1>
84 <div id="acqui_lateorders">
87 [% IF ( error_claim == "no_email" ) %]
88 <div class="error">This vendor has no email</div>
89 [% ELSIF ( error_claim == "no_order_selected" ) %]
90 <div class="error">No order selected</div>
92 <div class="error">[% error_claim %]</div>
96 <div class="dialog message">Email has been sent.</div>
98 [% IF ( lateorders ) %]
99 <form action="lateorders.pl" name="claim" method="post">
100 <input type="hidden" name="op" value="send_alert" />
101 <input type="hidden" name="delay" value="[% delay | html%]" />
102 <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
104 <p><label for="letter_code">Claim using notice: </label><select name="letter_code" id="letter_code">
105 [% FOREACH letter IN letters %]
106 <option value="[% letter.code %]">[% letter.name %]</option>
111 <table id="late_orders">
115 <th><a id="CheckAll" href="#">Check all</a><br /><a id="CheckNone" href="#">Uncheck all</a></th>
119 <th class="title-string">Order date</th>
120 <th class="title-string">Estimated delivery date</th>
122 <th class="anti-the">Information</th>
125 <th>Basket group</th>
128 <th>Claims count</th>
129 <th class="title-string">Claimed date</th>
133 [% FOREACH lateorder IN lateorders %]
136 <input type="checkbox" value="[% lateorder.ordernumber %]" data-booksellerid="[% lateorder.supplierid %]" name="ordernumber">
139 <span title="[% lateorder.orderdate %]">[% lateorder.orderdate | $KohaDates %] ([% lateorder.latesince %] days)</span>
142 [% IF ( lateorder.estimateddeliverydate ) %]
143 <span title="[% lateorder.estimateddeliverydate %]">[% lateorder.estimateddeliverydate | $KohaDates %]</span>
145 <span title="0000-00-00"></span>
149 [% lateorder.supplier %]
150 ([% lateorder.supplierid %])
153 <b>[% lateorder.title |html %]</b>
154 [% IF ( lateorder.author ) %]<br/><i>Author:</i> [% lateorder.author %][% END %]
155 [% IF ( lateorder.publisher ) %]
156 <br/><i>Published by:</i> [% lateorder.publisher %]
157 [% IF ( lateorder.publicationyear ) %]
158 <i> in </i>[% lateorder.publicationyear %]
163 [% lateorder.unitpricesupplier %]x[% lateorder.quantity %] =
164 [% lateorder.subtotal %]
167 [% IF ( CAN_user_acquisition_order_manage ) %]
168 <a href="basket.pl?basketno=[% lateorder.basketno %]" title="basket">[% lateorder.basketname %] ([% lateorder.basketno %])</a>
170 [% lateorder.basketname %] ([% lateorder.basketno %])
174 [% IF ( lateorder.basketgroupid ) %]
175 [% IF ( CAN_user_acquisition_group_manage ) %]
176 <a href="basketgroup.pl?op=add&booksellerid=[% lateorder.supplierid %]&basketgroupid=[% lateorder.basketgroupid %]" title="basketgroup">[% lateorder.basketgroupname %] ([% lateorder.basketgroupid %])</a>
178 [% lateorder.basketgroupname %] ([% lateorder.basketgroupid %])</a>
182 <td>[% Branches.GetName( lateorder.branch ) %]
184 <td>[% lateorder.budget %]
186 <td>[% lateorder.claims_count %]</td>
188 [% IF ( lateorder.claimed_date ) %]
189 <span title="[% lateorder.claimed_date %]">[% lateorder.claimed_date | $KohaDates %]</span>
191 <span title="0000-00-00"></span>
199 <th colspan="5">Total</th>
201 <th colspan="6"> </th>
205 <div class="spacer"></div>
207 <p style="display:block;">
208 <input type="button" value="Export as CSV" id="ExportSelected" />
209 [% UNLESS lateorder.budget_lock %]
210 <input type="submit" value="Claim order" />
214 [% ELSE %]<p>There are no late orders.</p>
220 <form action="lateorders.pl" method="get">
221 <fieldset class="brief">
222 <h4>Filter results:</h4>
223 [% FOREACH ERROR_LOO IN ERROR_LOOP %]
224 [% 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 %]
227 <li><label for="delay">Order date:</label><input size="3" maxlength="3" id="delay" type="text" name="delay" value="[% delay | html%]" /> days ago</li>
228 <li><label for="from">Estimated delivery date from: </label>
229 <input type="text" size="10" id="from" name="estimateddeliverydatefrom" value="[% estimateddeliverydatefrom %]" class="datepickerfrom" />
230 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
232 <li><label for="to">To: </label>
233 <input type="text" size="10" id="to" name="estimateddeliverydateto" value="[% estimateddeliverydateto %]" class="datepickerto" />
234 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
237 <li><label for="booksellerid">Vendor:</label>
238 <select id="booksellerid" size="1" tabindex="" name="booksellerid">
239 <option value=""></option>
240 [% FOREACH SUPPLIER_LOO IN SUPPLIER_LOOP %]
241 [% IF ( SUPPLIER_LOO.selected ) %]<option value="[% SUPPLIER_LOO.id %]" selected="selected">[% SUPPLIER_LOO.name %]</option>
242 [% ELSE %]<option value="[% SUPPLIER_LOO.id %]">[% SUPPLIER_LOO.name %]</option>[% END %]
246 <fieldset class="action"><input type="submit" value="Filter" /></fieldset>
249 [% INCLUDE 'acquisitions-menu.inc' %]
252 [% INCLUDE 'intranet-bottom.inc' %]