3 [% USE ColumnsSettings %]
5 [% INCLUDE 'doc-head-open.inc' %]
6 <title>Koha › Acquisitions › Late orders</title>
7 <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables_[% KOHA_VERSION %].css" />
8 [% INCLUDE 'doc-head-close.inc' %]
11 <body id="acq_lateorders" class="acq">
12 [% INCLUDE 'header.inc' %]
13 [% INCLUDE 'acquisitions-search.inc' %]
15 <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>
17 <div id="doc3" class="yui-t2">
23 <h1>[% IF ( Supplier ) %][% Supplier %] : [% END %]Late orders</h1>
24 <div id="acqui_lateorders">
27 [% IF ( error_claim == "no_email" ) %]
28 <div class="error">This vendor has no email</div>
29 [% ELSIF ( error_claim == "no_order_selected" ) %]
30 <div class="error">No order selected</div>
32 <div class="error">[% error_claim %]</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 %]" />
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 %]">[% letter.name %]</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 %]" data-booksellerid="[% lateorder.supplierid %]" name="ordernumber">
79 <span title="[% lateorder.orderdate %]">[% lateorder.orderdate | $KohaDates %] ([% lateorder.latesince %] days)</span>
82 [% IF ( lateorder.estimateddeliverydate ) %]
83 <span title="[% lateorder.estimateddeliverydate %]">[% lateorder.estimateddeliverydate | $KohaDates %]</span>
85 <span title="0000-00-00"></span>
89 [% lateorder.supplier %]
90 ([% lateorder.supplierid %])
93 <b>[% lateorder.title |html %]</b>
94 [% IF ( lateorder.author ) %]<br/><i>Author:</i> [% lateorder.author %][% END %]
95 [% IF ( lateorder.publisher ) %]
96 <br/><i>Published by:</i> [% lateorder.publisher %]
97 [% IF ( lateorder.publicationyear ) %]
98 <i> in </i>[% lateorder.publicationyear %]
103 [% lateorder.unitpricesupplier %]x[% lateorder.quantity %] =
104 [% lateorder.subtotal %]
107 [% IF ( CAN_user_acquisition_order_manage ) %]
108 <a href="basket.pl?basketno=[% lateorder.basketno %]" title="basket">[% lateorder.basketname %] ([% lateorder.basketno %])</a>
110 [% lateorder.basketname %] ([% lateorder.basketno %])
114 [% IF ( lateorder.basketgroupid ) %]
115 [% IF ( CAN_user_acquisition_group_manage ) %]
116 <a href="basketgroup.pl?op=add&booksellerid=[% lateorder.supplierid %]&basketgroupid=[% lateorder.basketgroupid %]" title="basketgroup">[% lateorder.basketgroupname %] ([% lateorder.basketgroupid %])</a>
118 [% lateorder.basketgroupname %] ([% lateorder.basketgroupid %])</a>
122 <td>[% Branches.GetName( lateorder.branch ) %]
124 <td>[% lateorder.budget %]
126 <td>[% lateorder.claims_count %]</td>
128 [% IF ( lateorder.claimed_date ) %]
129 <span title="[% lateorder.claimed_date %]">[% lateorder.claimed_date | $KohaDates %]</span>
131 <span title="0000-00-00"></span>
139 <th colspan="5">Total</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>
160 <form action="lateorders.pl" method="get">
161 <fieldset class="brief">
162 <h4>Filter results:</h4>
163 [% FOREACH ERROR_LOO IN ERROR_LOOP %]
164 [% 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 %]
167 <li><label for="delay">Order date:</label><input size="3" maxlength="3" id="delay" type="text" name="delay" value="[% delay | html%]" /> days ago</li>
168 <li><label for="from">Estimated delivery date from: </label>
169 <input type="text" size="10" id="from" name="estimateddeliverydatefrom" value="[% estimateddeliverydatefrom %]" class="datepickerfrom" />
170 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
172 <li><label for="to">To: </label>
173 <input type="text" size="10" id="to" name="estimateddeliverydateto" value="[% estimateddeliverydateto %]" class="datepickerto" />
174 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
177 <li><label for="booksellerid">Vendor:</label>
178 <select id="booksellerid" size="1" tabindex="" name="booksellerid">
179 <option value=""></option>
180 [% FOREACH SUPPLIER_LOO IN SUPPLIER_LOOP %]
181 [% IF ( SUPPLIER_LOO.selected ) %]<option value="[% SUPPLIER_LOO.id %]" selected="selected">[% SUPPLIER_LOO.name %]</option>
182 [% ELSE %]<option value="[% SUPPLIER_LOO.id %]">[% SUPPLIER_LOO.name %]</option>[% END %]
186 <fieldset class="action"><input type="submit" value="Filter" /></fieldset>
189 [% INCLUDE 'acquisitions-menu.inc' %]
193 [% MACRO jsinclude BLOCK %]
194 <script type="text/javascript" src="[% interface %]/[% theme %]/js/acquisitions-menu_[% KOHA_VERSION %].js"></script>
195 [% INCLUDE 'datatables.inc' %]
196 [% INCLUDE 'columns_settings.inc' %]
197 <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.checkboxes.min_[% KOHA_VERSION %].js"></script>
198 [% INCLUDE 'calendar.inc' %]
199 <script type="text/javascript">
201 function check_uncheck() {
202 var all_nodes = $(late_orderst.fnGetNodes());
203 if ( $(all_nodes).find("input:checkbox[name=ordernumber]:checked").length > 0) {
204 var booksellerid = $(all_nodes).find("input:checkbox[name=ordernumber]:checked:first").attr("data-booksellerid");
205 $(all_nodes).find("input:checkbox[name=ordernumber][data-booksellerid!="+booksellerid+"]").prop('disabled', true);
207 $("input:checkbox[name=ordernumber]").prop('disabled', false);
211 $(document).ready(function() {
213 var columns_settings = [% ColumnsSettings.GetColumns( 'acqui', 'lateorders', 'late_orders', 'json' ) %];
214 late_orderst = KohaTable("late_orders", {
216 { "aTargets": [ 0 ], "bSortable": false, "bSearchable": false },
217 { "sType": "anti-the", "aTargets" : [ "anti-the" ] },
218 { "sType": "title-string", "aTargets" : [ "title-string" ] }
220 "sPaginationType": "four_button",
222 "fnDrawCallback": function() {
223 if ( typeof late_orderst != 'undefined' ) {
225 $('input:checkbox[name=ordernumber]').bind('click', check_uncheck);
228 }, columns_settings );
229 $('input:checkbox[name=ordernumber]').bind('click', check_uncheck);
230 $('#CheckAll').click(function(){ $(late_orderst.fnGetNodes()).find("td").checkCheckboxes();});
231 $('#CheckNone').click(function(){ $(late_orderst.fnGetNodes()).find("td").unCheckCheckboxes();});
233 // Generates a dynamic link for exporting the selection's data as CSV
234 $("#ExportSelected").click(function() {
235 var all_nodes = $(late_orderst.fnGetNodes());
236 var selected = $(all_nodes).find("input[name='ordernumber']:checked");
238 if (selected.length == 0) {
239 alert(_("Please select at least one item to export."));
243 // Building the url from currently checked boxes
244 var url = '/cgi-bin/koha/acqui/lateorders-export.pl?op=export';
245 for (var i = 0; i < selected.length; i++) {
246 url += '&ordernumber=' + selected[i].value;
248 // And redirecting to the CSV page
256 [% INCLUDE 'intranet-bottom.inc' %]