Lines 1-136
Link Here
|
1 |
[% INCLUDE 'doc-head-open.inc' %] |
1 |
[% INCLUDE 'doc-head-open.inc' %] |
2 |
<title>Koha › Acquisitions › [% IF ( date ) %] |
2 |
<title>Koha › Acquisitions › [% IF ( date ) %] |
3 |
Receipt summary for [% name %] [% IF ( invoice ) %]invoice [% invoice %][% END %] on [% formatteddatereceived %][% ELSE %]Receive orders from [% name %][% END %]</title> |
3 |
Receipt summary for [% name %] [% IF ( invoice ) %]invoice [% invoice %][% END %] on [% formatteddatereceived %][% ELSE %]Receive orders from [% name %][% END %]</title> |
|
|
4 |
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" /> |
4 |
[% INCLUDE 'doc-head-close.inc' %] |
5 |
[% INCLUDE 'doc-head-close.inc' %] |
5 |
[% INCLUDE 'greybox.inc' %] |
6 |
[% INCLUDE 'greybox.inc' %] |
6 |
<script type="text/javascript" src="[% yuipath %]/json/json-min.js"></script> |
7 |
<script type="text/javascript" src="[% yuipath %]/json/json-min.js"></script> |
7 |
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script> |
8 |
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.dataTables.min.js"></script> |
|
|
9 |
[% INCLUDE 'datatables-strings.inc' %] |
10 |
<script type="text/javascript" src="[% themelang %]/js/datatables.js"></script> |
8 |
<script type="text/javascript"> |
11 |
<script type="text/javascript"> |
9 |
//<![CDATA[ |
12 |
//<![CDATA[ |
|
|
13 |
var dt_pending; |
10 |
|
14 |
|
11 |
var rowsToCollapse = 5; |
|
|
12 |
|
13 |
$.tablesorter.addParser({ |
14 |
id: 'articles', |
15 |
is: function(s) {return false; }, |
16 |
format: function(s) { return s.toLowerCase().replace(/^(the|an|a) /,''); }, |
17 |
type: 'text' |
18 |
}); |
19 |
|
20 |
$(document).ready(function(){ |
21 |
$("#pendingt").tablesorter({ |
22 |
headers: { 2: { sorter: 'articles' },3: { sorter: false },7:{sorter:false}} |
23 |
}); |
24 |
|
25 |
rowCountPending = $("#pendingt tbody.filterclass tr").length; |
26 |
rowCountReceived = $("#receivedt tbody.filterclass tr").length; |
27 |
if (rowCountPending > rowsToCollapse) { pendingCollapse(); } |
28 |
if (rowCountReceived > rowsToCollapse) { receivedCollapse(); } |
29 |
}); |
30 |
|
31 |
// Case-insensitive version of jquery's contains function |
32 |
jQuery.extend(jQuery.expr[':'], { |
33 |
icontains : "jQuery(a).text().toUpperCase().indexOf(m[3].toUpperCase())>=0" |
34 |
}); |
35 |
|
36 |
// Contains exactly function |
37 |
jQuery.extend(jQuery.expr[':'], { |
38 |
containsExactly: "$(a).text() == m[3]" |
39 |
}); |
40 |
|
41 |
|
42 |
// Collapse pending items table |
43 |
function pendingCollapse() { |
44 |
$("#pendingcollapserow").remove(); |
45 |
$("#pendingt tr").show(); |
46 |
$("#pendingt tbody.filterclass tr:gt(" + (rowsToCollapse-1) + ")").hide(); |
47 |
$("#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>"); |
48 |
|
49 |
} |
50 |
|
51 |
// Expend pending items table |
52 |
function pendingExpand() { |
53 |
$("#pendingcollapserow").remove(); |
54 |
$("#pendingt tr").show(); |
55 |
$("#pendingt tbody.filterclass tr.orderfound").remove(); |
56 |
$("#pendingt").before("<p id=\"pendingcollapserow\">" + rowCountPending + _(" items are displayed.") + "<a href=\"javascript:pendingCollapse();\">" + _("Click here to show only the first ") + rowsToCollapse + _(" items") + "<\/a>.<\/p>"); |
57 |
} |
58 |
|
59 |
// Collapse already received items table |
60 |
function receivedCollapse() { |
61 |
$("#receivedcollapserow").remove(); |
62 |
$("#receivedt tbody.filterclass tr:gt(" + (rowsToCollapse-1) + ")").hide(); |
63 |
$("#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>"); |
64 |
} |
65 |
|
66 |
// Expand already received items table |
67 |
function receivedExpand() { |
68 |
$("#receivedcollapserow").remove(); |
69 |
$("#receivedt tr").show(); |
70 |
$("#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>"); |
71 |
} |
72 |
|
73 |
// Launch filtering |
74 |
function filter() { |
15 |
function filter() { |
75 |
|
16 |
var summaryStatus = jQuery.trim($("#summaryfilter").val()); |
76 |
var summaryStatus = jQuery.trim($("#summaryfilter").val()); |
17 |
var basketStatus = $("#basketfilter").val(); |
77 |
var basketStatus = $("#basketfilter").val(); |
18 |
var orderStatus = $("#orderfilter").val(); |
78 |
var orderStatus = $("#orderfilter").val(); |
19 |
|
79 |
|
20 |
if (summaryStatus == '' && basketStatus == '' && orderStatus == '') { |
80 |
if (summaryStatus == '' && basketStatus == '' && orderStatus == '') { clearFilters(); return false; } |
21 |
clearFilters(); |
81 |
|
22 |
return false; |
82 |
var filtered = "table#pendingt tbody.filterclass tr"; |
23 |
} |
83 |
|
24 |
dt_pending.fnFilter(summaryStatus,2); |
84 |
// We hide everything |
25 |
dt_pending.fnFilter(orderStatus,1); |
85 |
$("#nothingfoundrow").remove(); |
26 |
dt_pending.fnFilter(basketStatus,0); |
86 |
$(filtered).hide(); |
27 |
|
87 |
|
28 |
return false; |
88 |
// Do the search |
|
|
89 |
var callback = { |
90 |
success: function(o) { |
91 |
var jsonString = o.responseText; |
92 |
var gst = "[% gst %]"; |
93 |
try { |
94 |
var orders = YAHOO.lang.JSON.parse(jsonString); |
95 |
var foundCount = orders.length; |
96 |
|
97 |
for( i = 0 ; i < orders.length ; i++){ |
98 |
order = orders[i]; |
99 |
$('<tr class="orderfound">' |
100 |
+ '<td class="basketfilterclass"><a href="/cgi-bin/koha/acqui/basket.pl?basketno=' + order.basketno + '">' + order.basketno + '</a></td>' |
101 |
+ '<td class="orderfilterclass"> <a href="neworderempty.pl?ordernumber=' + order.ordernumber + '&booksellerid=' + order.booksellerid + '">' + order.ordernumber + ' </a></td>' |
102 |
+ '<td class="summaryfilterclass">' |
103 |
+ '<a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=' + order.biblionumber + '">' + order.title + '</a>' + _(" by ") + order.author + ' – ' + order.isbn + '</td>' |
104 |
+ '<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>' |
105 |
+ '<td>' + order.quantity + '</td>' |
106 |
+ '<td>' + order.ecost + '</td>' |
107 |
+ '<td>' + order.ordertotal + '</td>' |
108 |
+ '<td>' |
109 |
+ '<a href="orderreceive.pl?ordernumber=' + order.ordernumber + '&datereceived=[% invoicedatereceived %]&invoice=[% invoice %]&gst=' + gst + '&freight=' + order.freight + '&booksellerid=[% booksellerid %]">Receive</a> /' |
110 |
+ '<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>' |
111 |
+ '</td></tr>').appendTo("table#pendingt"); |
112 |
} |
113 |
|
114 |
// If nothing has been found, we tell the user so |
115 |
if (orders.length == 0) { |
116 |
$("<tr><td id=\"nothingfoundrow\" colspan=\"8\">No items match your criteria.<\/tr>").appendTo("#pendingt"); |
117 |
} |
118 |
}catch(e){alert(e);} |
119 |
} |
120 |
} |
121 |
var transaction = YAHOO.util.Connect.asyncRequest('GET', '/cgi-bin/koha/acqui/parcel.pl?booksellerid=[% booksellerid %]&search='+summaryStatus+'&basketno='+basketStatus+'&orderno='+orderStatus+'&format=json', callback, null); |
122 |
|
123 |
return false; |
124 |
} |
29 |
} |
125 |
|
30 |
|
126 |
// Clear already applied filters |
31 |
// Clear already applied filters |
127 |
function clearFilters() { |
32 |
function clearFilters() { |
128 |
$("#nothingfoundrow").remove(); |
33 |
$("#summaryfilter").val(''); |
129 |
$("#pendingt tbody.filterclass tr").show(); |
34 |
$("#basketfilter").val(''); |
130 |
//$("#pendingt tbody.filterclass tr.orderfound").remove(); |
35 |
$("#orderfilter").val(''); |
131 |
pendingExpand(); |
36 |
var oSettings = dt_pending.fnSettings(); |
|
|
37 |
for(iCol = 0; iCol < oSettings.aoPreSearchCols.length; iCol++) { |
38 |
oSettings.aoPreSearchCols[ iCol ].sSearch = ''; |
39 |
} |
40 |
dt_pending.fnDraw(); |
132 |
} |
41 |
} |
133 |
|
42 |
|
|
|
43 |
$(document).ready(function() { |
44 |
var dt_options = $.extend(true, {}, dataTablesDefaults, { |
45 |
'aLengthMenu': [[5, 10, 20, 50, -1], [5, 10, 20, 50, _("All")]], |
46 |
'iDisplayLength': 5, |
47 |
'sDom': '<"top pager"ilp>t' |
48 |
}); |
49 |
dt_pending = $("#pendingt").dataTable(dt_options); |
50 |
$("#receivedt").dataTable(dt_options); |
51 |
}); |
134 |
//]]> |
52 |
//]]> |
135 |
</script> |
53 |
</script> |
136 |
<script type="text/javascript"> |
54 |
<script type="text/javascript"> |
Lines 170-180
Link Here
|
170 |
<div class="yui-b"> |
88 |
<div class="yui-b"> |
171 |
[% IF ( receive_error ) %] |
89 |
[% IF ( receive_error ) %] |
172 |
<div class="dialog alert"> |
90 |
<div class="dialog alert"> |
173 |
<h3>Error adding items:</h3> |
91 |
<h3>Error receiving items:</h3> |
174 |
<ul> |
92 |
<ul> |
175 |
[% FOREACH error_loo IN error_loop %] |
93 |
[% FOREACH error IN error_loop %] |
176 |
<li>[% error_loo.error_param %][% IF ( error_loo.error_duplicate_barcode ) %]Duplicate Barcode[% END %] <!-- todo: other error conditions come here. --></li> |
94 |
<li> |
177 |
[% END %] |
95 |
[% error.error_param %] |
|
|
96 |
[% IF ( error.error_duplicate_barcode ) %] |
97 |
Duplicate Barcode |
98 |
[% ELSIF (error.error_cannot_receive_order) %] |
99 |
You were not authorised to receive this order |
100 |
[% END %] |
101 |
<!-- todo: other error conditions come here. --> |
102 |
</li> |
103 |
[% END %] |
178 |
</ul> |
104 |
</ul> |
179 |
</div> |
105 |
</div> |
180 |
[% END %] |
106 |
[% END %] |
Lines 258-265
Link Here
|
258 |
<td>[% loop_order.ecost %]</td> |
184 |
<td>[% loop_order.ecost %]</td> |
259 |
<td>[% loop_order.ordertotal %]</td> |
185 |
<td>[% loop_order.ordertotal %]</td> |
260 |
<td> |
186 |
<td> |
261 |
<a href="orderreceive.pl?ordernumber=[% loop_order.ordernumber %]&datereceived=[% loop_order.invoicedatereceived %]&invoice=[% loop_order.invoice %]&gst=[% loop_order.gst %]&freight=[% loop_order.freight %]&booksellerid=[% loop_order.booksellerid %]">Receive</a> |
187 |
[% IF (loop_order.can_receive) %] |
262 |
|
188 |
<a href="orderreceive.pl?ordernumber=[% loop_order.ordernumber %]&datereceived=[% loop_order.invoicedatereceived %]&invoice=[% loop_order.invoice %]&gst=[% loop_order.gst %]&freight=[% loop_order.freight %]&booksellerid=[% loop_order.booksellerid %]">Receive</a> |
|
|
189 |
[% ELSE %] |
190 |
Can't receive order |
191 |
[% END %] |
263 |
</td> |
192 |
</td> |
264 |
<td> |
193 |
<td> |
265 |
[% IF ( loop_order.left_holds_on_order ) %] |
194 |
[% IF ( loop_order.left_holds_on_order ) %] |
Lines 289-310
Link Here
|
289 |
[% END %] |
218 |
[% END %] |
290 |
</tbody> |
219 |
</tbody> |
291 |
</table>[% ELSE %]There are no pending orders.[% END %] |
220 |
</table>[% ELSE %]There are no pending orders.[% END %] |
292 |
<div id="resultnumber"> |
|
|
293 |
<!-- Row of numbers corresponding to search result pages --> |
294 |
[% IF ( displayprev ) %] |
295 |
<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> |
296 |
[% END %] |
297 |
[% FOREACH number IN numbers %] |
298 |
[% IF ( number.highlight ) %] |
299 |
<span class="current">[% number.number %]</span> |
300 |
[% ELSE %] |
301 |
<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> |
302 |
[% END %] |
303 |
[% END %] |
304 |
[% IF ( displaynext ) %] |
305 |
<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> |
306 |
[% END %] |
307 |
</div> |
308 |
</div> |
221 |
</div> |
309 |
<div id="acqui_receive_receivelist"> |
222 |
<div id="acqui_receive_receivelist"> |
310 |
<h3>Already received</h3> |
223 |
<h3>Already received</h3> |
311 |
- |
|
|