Lines 8-161
Link Here
|
8 |
<script type="text/javascript" src="[% themelang %]/js/datatables.js"></script> |
8 |
<script type="text/javascript" src="[% themelang %]/js/datatables.js"></script> |
9 |
[% INCLUDE 'greybox.inc' %] |
9 |
[% INCLUDE 'greybox.inc' %] |
10 |
<script type="text/javascript" src="[% yuipath %]/json/json-min.js"></script> |
10 |
<script type="text/javascript" src="[% yuipath %]/json/json-min.js"></script> |
|
|
11 |
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.dataTables.min.js"></script> |
12 |
[% INCLUDE 'datatables-strings.inc' %] |
13 |
<script type="text/javascript" src="[% themelang %]/js/datatables.js"></script> |
11 |
<script type="text/javascript"> |
14 |
<script type="text/javascript"> |
12 |
//<![CDATA[ |
15 |
//<![CDATA[ |
13 |
|
16 |
var pendingt; |
14 |
var rowsToCollapse = 5; |
|
|
15 |
|
17 |
|
16 |
$(document).ready(function(){ |
18 |
$(document).ready(function(){ |
17 |
var pendingt = $("#pendingt").dataTable($.extend(true, {}, dataTablesDefaults, { |
19 |
pendingt = $("#pendingt").dataTable($.extend(true, {}, dataTablesDefaults, { |
18 |
"aoColumnDefs": [ |
20 |
"aoColumnDefs": [ |
19 |
{ "aTargets": [ 3, 7, 8 ], "bSortable": false, "bSearchable": false }, |
21 |
{ "aTargets": [ 4, 8, 9 ], "bSortable": false, "bSearchable": false }, |
20 |
], |
22 |
{ "aTargets": [ 0, 1 ], "sType": "num-html" }, |
21 |
"aoColumns": [ |
23 |
{ "aTargets": [ 3 ], "bVisible": false } |
22 |
{ "sType": "num-html" }, |
|
|
23 |
{ "sType": "num-html" }, |
24 |
null, |
25 |
null, |
26 |
null, |
27 |
null, |
28 |
null, |
29 |
null, |
30 |
null, |
31 |
], |
24 |
], |
32 |
"sPaginationType": "four_button" |
25 |
"sPaginationType": "four_button" |
33 |
} ) ); |
26 |
} ) ); |
34 |
var receivedt = $("#receivedt").dataTable($.extend(true, {}, dataTablesDefaults, { |
27 |
var receivedt = $("#receivedt").dataTable($.extend(true, {}, dataTablesDefaults, { |
35 |
"aoColumnDefs": [ |
28 |
"aoColumnDefs": [ |
36 |
{ "aTargets": [ 3 ], "bSortable": false, "bSearchable": false }, |
29 |
{ "aTargets": [ 3 ], "bSortable": false, "bSearchable": false }, |
37 |
], |
30 |
{ "aTargets": [ 0, 1 ], "sType": "num-html" } |
38 |
"aoColumns": [ |
|
|
39 |
{ "sType": "num-html" }, |
40 |
{ "sType": "num-html" }, |
41 |
null, |
42 |
null, |
43 |
null, |
44 |
null, |
45 |
null, |
46 |
null, |
47 |
], |
31 |
], |
48 |
"sPaginationType": "four_button" |
32 |
"sPaginationType": "four_button" |
49 |
} ) ); |
33 |
} ) ); |
50 |
|
|
|
51 |
rowCountPending = $("#pendingt tbody.filterclass tr").length; |
52 |
rowCountReceived = $("#receivedt tbody.filterclass tr").length; |
53 |
if (rowCountPending > rowsToCollapse) { pendingCollapse(); } |
54 |
if (rowCountReceived > rowsToCollapse) { receivedCollapse(); } |
55 |
}); |
34 |
}); |
56 |
|
35 |
|
57 |
// Case-insensitive version of jquery's contains function |
|
|
58 |
jQuery.extend(jQuery.expr[':'], { |
59 |
icontains : "jQuery(a).text().toUpperCase().indexOf(m[3].toUpperCase())>=0" |
60 |
}); |
61 |
|
62 |
// Contains exactly function |
63 |
jQuery.extend(jQuery.expr[':'], { |
64 |
containsExactly: "$(a).text() == m[3]" |
65 |
}); |
66 |
|
67 |
|
68 |
// Collapse pending items table |
69 |
function pendingCollapse() { |
70 |
$("#pendingcollapserow").remove(); |
71 |
$("#pendingt tr").show(); |
72 |
$("#pendingt tbody.filterclass tr:gt(" + (rowsToCollapse-1) + ")").hide(); |
73 |
$("#pendingt").before("<p id=\"pendingcollapserow\">" + _("Only the first ") + rowsToCollapse + _(" items are displayed.") + "<a href=\"javascript:pendingExpand();\">" + _("Click here to show all ") + rowCountPending + _(" items") + "<\/a>.<\/p>"); |
74 |
|
75 |
} |
76 |
|
77 |
// Expend pending items table |
78 |
function pendingExpand() { |
79 |
$("#pendingcollapserow").remove(); |
80 |
$("#pendingt tr").show(); |
81 |
$("#pendingt tbody.filterclass tr.orderfound").remove(); |
82 |
$("#pendingt").before("<p id=\"pendingcollapserow\">" + rowCountPending + _(" items are displayed.") + "<a href=\"javascript:pendingCollapse();\">" + _("Click here to show only the first ") + rowsToCollapse + _(" items") + "<\/a>.<\/p>"); |
83 |
} |
84 |
|
85 |
// Collapse already received items table |
86 |
function receivedCollapse() { |
87 |
$("#receivedcollapserow").remove(); |
88 |
$("#receivedt tbody.filterclass tr:gt(" + (rowsToCollapse-1) + ")").hide(); |
89 |
$("#receivedt").before("<p id=\"receivedcollapserow\">" + _("Only the first ") + rowsToCollapse + _(" items are displayed.") + "<a href=\"javascript:receivedExpand();\">" + _("Click here to show all ") + rowCountReceived + _(" items") + "<\/a>.<\/p>"); |
90 |
} |
91 |
|
92 |
// Expand already received items table |
93 |
function receivedExpand() { |
94 |
$("#receivedcollapserow").remove(); |
95 |
$("#receivedt tr").show(); |
96 |
$("#receivedt").before("<p id=\"receivedcollapserow\">" + _("All ") + rowCountReceived + _(" items are displayed.") + "<a href=\"javascript:receivedCollapse();\">" + _("Click here to show only the first ") + rowsToCollapse + _(" items") + "<\/a>.<\/p>"); |
97 |
} |
98 |
|
99 |
// Launch filtering |
100 |
function filter() { |
36 |
function filter() { |
101 |
|
37 |
var summaryStatus = jQuery.trim($("#summaryfilter").val()); |
102 |
var summaryStatus = jQuery.trim($("#summaryfilter").val()); |
38 |
var basketStatus = $("#basketfilter").val(); |
103 |
var basketStatus = $("#basketfilter").val(); |
39 |
var orderStatus = $("#orderfilter").val(); |
104 |
var orderStatus = $("#orderfilter").val(); |
40 |
var eanfilter = $("#eanfilter").val(); |
105 |
var eanStatus = $("#eanfilter").val() || ''; |
41 |
|
106 |
|
42 |
if (summaryStatus == '' && basketStatus == '' && orderStatus == '' && eanfilter == '') { |
107 |
if (summaryStatus == '' && basketStatus == '' && orderStatus == '' && eanStatus == '') { clearFilters(); return false; } |
43 |
clearFilters(); |
108 |
|
44 |
return false; |
109 |
var filtered = "table#pendingt tbody.filterclass tr"; |
45 |
} |
110 |
|
46 |
pendingt.fnFilter(summaryStatus,2); |
111 |
// We hide everything |
47 |
pendingt.fnFilter(orderStatus,1); |
112 |
$("#nothingfoundrow").remove(); |
48 |
pendingt.fnFilter(basketStatus,0); |
113 |
$(filtered).hide(); |
49 |
pendingt.fnFilter(eanfilter, 3); |
114 |
|
50 |
|
115 |
// Do the search |
51 |
return false; |
116 |
var callback = { |
|
|
117 |
success: function(o) { |
118 |
var jsonString = o.responseText; |
119 |
var gst = "[% gst %]"; |
120 |
try { |
121 |
var orders = YAHOO.lang.JSON.parse(jsonString); |
122 |
var foundCount = orders.length; |
123 |
|
124 |
for( i = 0 ; i < orders.length ; i++){ |
125 |
order = orders[i]; |
126 |
$('<tr class="orderfound">' |
127 |
+ '<td class="basketfilterclass"><a href="/cgi-bin/koha/acqui/basket.pl?basketno=' + order.basketno + '">' + order.basketno + '</a></td>' |
128 |
+ '<td class="orderfilterclass"> <a href="neworderempty.pl?ordernumber=' + order.ordernumber + '&booksellerid=' + order.booksellerid + '">' + order.ordernumber + ' </a></td>' |
129 |
+ '<td class="summaryfilterclass">' |
130 |
+ '<a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=' + order.biblionumber + '">' + order.title + '</a>' + _(" by ") + order.author + ' – ' + order.isbn + '</td>' |
131 |
+ '<td><a href="/cgi-bin/koha/catalogue/showmarc.pl?id=' + order.biblionumber + '" title="MARC" rel="gb_page_center[600,500]">MARC</a> | <a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&id=' + order.biblionumber + '" title="MARC" rel="gb_page_center[600,500]">Card</a></td>' |
132 |
+ '<td>' + order.quantity + '</td>' |
133 |
+ '<td>' + order.ecost + '</td>' |
134 |
+ '<td>' + order.ordertotal + '</td>' |
135 |
+ '<td>' |
136 |
+ '<a href="orderreceive.pl?ordernumber=' + order.ordernumber + '&datereceived=[% invoicedatereceived %]&invoice=[% invoice %]&gst=' + gst + '&freight=' + order.freight + '&booksellerid=[% booksellerid %]">Receive</a> /' |
137 |
+ '<a href="parcel.pl?type=intra&ordernumber=' + order.ordernumber + '&biblionumber=' + order.biblionumber + '&action=cancelorder&booksellerid=[% booksellerid %]&datereceived=[% invoicedatereceived %]&invoice=[% invoice %]" onclick="return confirm(\'' + _('Are you sure you want to cancel this order?') + '\');">Cancel</a>' |
138 |
+ '</td></tr>').appendTo("table#pendingt"); |
139 |
} |
140 |
|
141 |
// If nothing has been found, we tell the user so |
142 |
if (orders.length == 0) { |
143 |
$("<tr><td id=\"nothingfoundrow\" colspan=\"8\">No items match your criteria.<\/tr>").appendTo("#pendingt"); |
144 |
} |
145 |
}catch(e){alert(e);} |
146 |
} |
147 |
} |
148 |
var transaction = YAHOO.util.Connect.asyncRequest('GET', '/cgi-bin/koha/acqui/parcel.pl?booksellerid=[% booksellerid %]&search='+summaryStatus+'&basketno='+basketStatus+'&orderno='+orderStatus+'&ean='+eanStatus+'&format=json', callback, null); |
149 |
|
150 |
return false; |
151 |
} |
52 |
} |
152 |
|
53 |
|
153 |
// Clear already applied filters |
54 |
// Clear already applied filters |
154 |
function clearFilters() { |
55 |
function clearFilters() { |
155 |
$("#nothingfoundrow").remove(); |
56 |
$("#summaryfilter").val(''); |
156 |
$("#pendingt tbody.filterclass tr").show(); |
57 |
$("#basketfilter").val(''); |
157 |
//$("#pendingt tbody.filterclass tr.orderfound").remove(); |
58 |
$("#orderfilter").val(''); |
158 |
pendingExpand(); |
59 |
$("#eanfilter").val(''); |
|
|
60 |
var oSettings = pendingt.fnSettings(); |
61 |
for(iCol = 0; iCol < oSettings.aoPreSearchCols.length; iCol++) { |
62 |
oSettings.aoPreSearchCols[ iCol ].sSearch = ''; |
63 |
} |
64 |
pendingt.fnDraw(); |
159 |
} |
65 |
} |
160 |
|
66 |
|
161 |
//]]> |
67 |
//]]> |
Lines 197-207
Link Here
|
197 |
<div class="yui-b"> |
103 |
<div class="yui-b"> |
198 |
[% IF ( receive_error ) %] |
104 |
[% IF ( receive_error ) %] |
199 |
<div class="dialog alert"> |
105 |
<div class="dialog alert"> |
200 |
<h3>Error adding items:</h3> |
106 |
<h3>Error receiving items:</h3> |
201 |
<ul> |
107 |
<ul> |
202 |
[% FOREACH error_loo IN error_loop %] |
108 |
[% FOREACH error IN error_loop %] |
203 |
<li>[% error_loo.error_param %][% IF ( error_loo.error_duplicate_barcode ) %]Duplicate Barcode[% END %] <!-- todo: other error conditions come here. --></li> |
109 |
<li> |
204 |
[% END %] |
110 |
[% error.error_param %] |
|
|
111 |
[% IF ( error.error_duplicate_barcode ) %] |
112 |
Duplicate Barcode |
113 |
[% ELSIF (error.error_cannot_receive_order) %] |
114 |
You were not authorised to receive this order |
115 |
[% END %] |
116 |
<!-- todo: other error conditions come here. --> |
117 |
</li> |
118 |
[% END %] |
205 |
</ul> |
119 |
</ul> |
206 |
</div> |
120 |
</div> |
207 |
[% END %] |
121 |
[% END %] |
Lines 237-242
Link Here
|
237 |
<th>Basket</th> |
151 |
<th>Basket</th> |
238 |
<th>Order line</th> |
152 |
<th>Order line</th> |
239 |
<th>Summary</th> |
153 |
<th>Summary</th> |
|
|
154 |
<th>EAN</th> |
240 |
<th>View record</th> |
155 |
<th>View record</th> |
241 |
<th>Quantity</th> |
156 |
<th>Quantity</th> |
242 |
<th>Unit cost</th> |
157 |
<th>Unit cost</th> |
Lines 246-252
Link Here
|
246 |
</tr> |
161 |
</tr> |
247 |
</thead> |
162 |
</thead> |
248 |
<tfoot> |
163 |
<tfoot> |
249 |
<tr><td colspan="4" class="total">TOTAL</td> |
164 |
<tr><td colspan="5" class="total">TOTAL</td> |
250 |
<td> [% totalPquantity %] </td> |
165 |
<td> [% totalPquantity %] </td> |
251 |
<td> </td> |
166 |
<td> </td> |
252 |
<td>[% ordergrandtotal %]</td> |
167 |
<td>[% ordergrandtotal %]</td> |
Lines 276-288
Link Here
|
276 |
[<a href="/cgi-bin/koha/acqui/modordernotes.pl?ordernumber=[% loop_order.ordernumber %]&referrer=/cgi-bin/koha/acqui/parcel.pl%3Fbooksellerid=[% loop_order.booksellerid %]&datereceived=[% loop_order.invoicedatereceived %]&invoice=[% loop_order.invoice %]">Add note</a>] |
191 |
[<a href="/cgi-bin/koha/acqui/modordernotes.pl?ordernumber=[% loop_order.ordernumber %]&referrer=/cgi-bin/koha/acqui/parcel.pl%3Fbooksellerid=[% loop_order.booksellerid %]&datereceived=[% loop_order.invoicedatereceived %]&invoice=[% loop_order.invoice %]">Add note</a>] |
277 |
[% END %] |
192 |
[% END %] |
278 |
</td> |
193 |
</td> |
|
|
194 |
<td>[% loop_order.ean %]</td> |
279 |
<td><a href="/cgi-bin/koha/catalogue/showmarc.pl?id=[% loop_order.biblionumber %]" title="MARC" rel="gb_page_center[600,500]">MARC</a> | <a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&id=[% loop_order.biblionumber %]" title="MARC" rel="gb_page_center[600,500]">Card</a></td> |
195 |
<td><a href="/cgi-bin/koha/catalogue/showmarc.pl?id=[% loop_order.biblionumber %]" title="MARC" rel="gb_page_center[600,500]">MARC</a> | <a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&id=[% loop_order.biblionumber %]" title="MARC" rel="gb_page_center[600,500]">Card</a></td> |
280 |
<td>[% loop_order.quantity %]</td> |
196 |
<td>[% loop_order.quantity %]</td> |
281 |
<td>[% loop_order.ecost %]</td> |
197 |
<td>[% loop_order.ecost %]</td> |
282 |
<td>[% loop_order.ordertotal %]</td> |
198 |
<td>[% loop_order.ordertotal %]</td> |
283 |
<td> |
199 |
<td> |
284 |
<a href="orderreceive.pl?ordernumber=[% loop_order.ordernumber %]&datereceived=[% invoicedatereceived %]&invoice=[% invoice %]&gst=[% loop_order.gst %]&freight=[% loop_order.freight %]&booksellerid=[% loop_order.booksellerid %]">Receive</a> |
200 |
[% IF (loop_order.can_receive) %] |
285 |
|
201 |
<a href="orderreceive.pl?ordernumber=[% loop_order.ordernumber %]&datereceived=[% invoicedatereceived %]&invoice=[% invoice %]&gst=[% loop_order.gst %]&freight=[% loop_order.freight %]&booksellerid=[% loop_order.booksellerid %]">Receive</a> |
|
|
202 |
[% ELSE %] |
203 |
Can't receive order |
204 |
[% END %] |
286 |
</td> |
205 |
</td> |
287 |
<td> |
206 |
<td> |
288 |
[% IF ( loop_order.left_holds_on_order ) %] |
207 |
[% IF ( loop_order.left_holds_on_order ) %] |
Lines 312-333
Link Here
|
312 |
[% END %] |
231 |
[% END %] |
313 |
</tbody> |
232 |
</tbody> |
314 |
</table>[% ELSE %]There are no pending orders.[% END %] |
233 |
</table>[% ELSE %]There are no pending orders.[% END %] |
315 |
<div id="resultnumber"> |
|
|
316 |
<!-- Row of numbers corresponding to search result pages --> |
317 |
[% IF ( displayprev ) %] |
318 |
<a href="parcel.pl?type=intra&booksellerid=[% booksellerid %]&startfrom=[% prevstartfrom %][% IF ( datereceived ) %]&datereceived=[% datereceived %][% END %][% IF ( invoice ) %]&invoice=[% invoice %][% END %][% IF ( resultsperpage ) %]&resultsperpage=[% resultsperpage %][% END %]#resultnumber"><< Previous</a> |
319 |
[% END %] |
320 |
[% FOREACH number IN numbers %] |
321 |
[% IF ( number.highlight ) %] |
322 |
<span class="current">[% number.number %]</span> |
323 |
[% ELSE %] |
324 |
<a href="parcel.pl?type=intra&booksellerid=[% booksellerid %]&startfrom=[% number.startfrom %][% IF ( datereceived ) %]&datereceived=[% datereceived %][% END %][% IF ( invoice ) %]&invoice=[% invoice %][% END %][% IF ( resultsperpage ) %]&resultsperpage=[% resultsperpage %][% END %]#resultnumber">[% number.number %]</a> |
325 |
[% END %] |
326 |
[% END %] |
327 |
[% IF ( displaynext ) %] |
328 |
<a href="parcel.pl?type=intra&booksellerid=[% booksellerid %]&startfrom=[% nextstartfrom %][% IF ( datereceived ) %]&datereceived=[% datereceived %][% END %][% IF ( invoice ) %]&invoice=[% invoice %][% END %][% IF ( resultsperpage ) %]&resultsperpage=[% resultsperpage %][% END %]#resultnumber">Next >></a> |
329 |
[% END %] |
330 |
</div> |
331 |
</div> |
234 |
</div> |
332 |
<div id="acqui_receive_receivelist"> |
235 |
<div id="acqui_receive_receivelist"> |
333 |
<h3>Already received</h3> |
236 |
<h3>Already received</h3> |