Lines 117-122
Link Here
|
117 |
$("#dataPreview .modal-body").html("<div id=\"loading\"><img src=\"[% interface %]/[% theme %]/img/loading-small.gif\" alt=\"\" /> "+_("Loading")+"</div>"); |
117 |
$("#dataPreview .modal-body").html("<div id=\"loading\"><img src=\"[% interface %]/[% theme %]/img/loading-small.gif\" alt=\"\" /> "+_("Loading")+"</div>"); |
118 |
}); |
118 |
}); |
119 |
|
119 |
|
|
|
120 |
$("li.disabled a,li.message a").on("click",function(e){ |
121 |
e.preventDefault(); |
122 |
var ordernumber = $(this).data("ordernumber"); |
123 |
if( ordernumber ){ |
124 |
showErrors( ordernumber ); |
125 |
} |
126 |
}).tooltip(); |
120 |
}); |
127 |
}); |
121 |
|
128 |
|
122 |
// Case-insensitive version of jquery's contains function |
129 |
// Case-insensitive version of jquery's contains function |
Lines 129-146
Link Here
|
129 |
containsExactly: "$(a).text() == m[3]" |
136 |
containsExactly: "$(a).text() == m[3]" |
130 |
}); |
137 |
}); |
131 |
|
138 |
|
132 |
//]]> |
139 |
function transfer_order_popup(ordernumber) { |
133 |
</script> |
140 |
var url = "/cgi-bin/koha/acqui/transferorder.pl?" |
134 |
<script type="text/javascript"> |
141 |
+ "ordernumber=" + ordernumber |
135 |
//<![CDATA[ |
142 |
window.open(url, 'TransferOrder','width=800,height=500,location=yes,toolbar=no,scrollbars=yes,resize=yes'); |
136 |
function transfer_order_popup(ordernumber) { |
143 |
} |
137 |
var url = "/cgi-bin/koha/acqui/transferorder.pl?" |
144 |
|
138 |
+ "ordernumber=" + ordernumber |
145 |
function showErrors( ordernumber ){ |
139 |
window.open(url, 'TransferOrder'); |
146 |
var errorstring = _("Cannot cancel or delete order: ") + "\n"; |
140 |
} |
147 |
$(".del_error" + ordernumber ).each(function(){ |
|
|
148 |
errorstring += "\n" + $(this).text(); |
149 |
}); |
150 |
alert( errorstring ); |
151 |
} |
141 |
|
152 |
|
142 |
//]]> |
153 |
//]]> |
143 |
</script> |
154 |
</script> |
|
|
155 |
<style> |
156 |
.dropdown-menu .message > a { |
157 |
clear: both; |
158 |
color: #C30; |
159 |
display: block; |
160 |
font-weight: bold; |
161 |
line-height: 20px; |
162 |
padding: 3px 20px; |
163 |
white-space: nowrap; |
164 |
} |
165 |
.dropdown-menu .message > a:hover { |
166 |
background-color: #EEE; |
167 |
background-image: none; |
168 |
color: #C00; |
169 |
cursor: default; |
170 |
text-decoration: none; |
171 |
} |
172 |
</style> |
144 |
</head> |
173 |
</head> |
145 |
<body id="acq_parcel" class="acq"> |
174 |
<body id="acq_parcel" class="acq"> |
146 |
[% INCLUDE 'header.inc' %] |
175 |
[% INCLUDE 'header.inc' %] |
Lines 257-271
Link Here
|
257 |
<tbody class="filterclass"> |
286 |
<tbody class="filterclass"> |
258 |
[% FOREACH loop_order IN loop_orders %] |
287 |
[% FOREACH loop_order IN loop_orders %] |
259 |
<tr> |
288 |
<tr> |
260 |
<td class="basketfilterclass">[% loop_order.basketname %] (<a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% loop_order.basketno %]">[% loop_order.basketno %]</a>)</td> |
289 |
<td class="basketfilterclass"><a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% loop_order.basketno %]">[% loop_order.basketname %] ([% loop_order.basketno %])</a></td> |
261 |
<td> |
290 |
<td> |
262 |
[% IF loop_order.basketgroupid %] |
291 |
[% IF loop_order.basketgroupid %] |
263 |
[% loop_order.basketgroupname %] (<a href="/cgi-bin/koha/acqui/basketgroup.pl?booksellerid=[% loop_order.booksellerid %]">[% loop_order.basketgroupid %]</a>) |
292 |
<a href="/cgi-bin/koha/acqui/basketgroup.pl?booksellerid=[% loop_order.booksellerid %]">[% loop_order.basketgroupname %] ([% loop_order.basketgroupid %])</a> |
264 |
[% ELSE %] |
293 |
[% ELSE %] |
265 |
No basket group |
294 |
No basket group |
266 |
[% END %] |
295 |
[% END %] |
267 |
</td> |
296 |
</td> |
268 |
<td class="orderfilterclass"><a href="neworderempty.pl?ordernumber=[% loop_order.ordernumber %]&booksellerid=[% loop_order.booksellerid %]">[% loop_order.ordernumber %]</a></td> |
297 |
<td class="orderfilterclass"><a href="neworderempty.pl?ordernumber=[% loop_order.ordernumber %]&booksellerid=[% loop_order.booksellerid %]">Order line [% loop_order.ordernumber %]</a></td> |
269 |
<td class="summaryfilterclass"> |
298 |
<td class="summaryfilterclass"> |
270 |
<a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% loop_order.biblionumber %]">[% loop_order.title |html %]</a> |
299 |
<a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% loop_order.biblionumber %]">[% loop_order.title |html %]</a> |
271 |
[% IF ( loop_order.author ) %] by [% loop_order.author %][% END %] |
300 |
[% IF ( loop_order.author ) %] by [% loop_order.author %][% END %] |
Lines 288-328
Link Here
|
288 |
[<a href="/cgi-bin/koha/acqui/modordernotes.pl?ordernumber=[% loop_order.ordernumber %]&referrer=/cgi-bin/koha/acqui/parcel.pl%3Finvoiceid=[% invoiceid %]&type=vendor">Add vendor note</a>] |
317 |
[<a href="/cgi-bin/koha/acqui/modordernotes.pl?ordernumber=[% loop_order.ordernumber %]&referrer=/cgi-bin/koha/acqui/parcel.pl%3Finvoiceid=[% invoiceid %]&type=vendor">Add vendor note</a>] |
289 |
[% END %] |
318 |
[% END %] |
290 |
</td> |
319 |
</td> |
291 |
<td><a href="/cgi-bin/koha/catalogue/showmarc.pl?id=[% loop_order.biblionumber %]" class="previewData">MARC</a> | <a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&id=[% loop_order.biblionumber %]" class="previewData">Card</a></td> |
320 |
<td> |
|
|
321 |
<div class="dropup"> |
322 |
<a class="btn btn-mini dropdown-toggle" id="viewpending[% loop_order.biblionumber %]" role="button" data-toggle="dropdown" href="#"> |
323 |
View <b class="caret"></b> |
324 |
</a> |
325 |
<ul class="dropdown-menu pull-right" role="menu" aria-labelledby="viewpending[% loop_order.biblionumber %]"> |
326 |
<li><a href="/cgi-bin/koha/catalogue/showmarc.pl?id=[% loop_order.biblionumber %]" class="previewData">MARC</a></li> |
327 |
<li><a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&id=[% loop_order.biblionumber %]" class="previewData">Card</a></li> |
328 |
</ul> |
329 |
</div> |
330 |
</td> |
292 |
<td>[% loop_order.quantity %]</td> |
331 |
<td>[% loop_order.quantity %]</td> |
293 |
<td>[% loop_order.ecost | $Price %]</td> |
332 |
<td>[% loop_order.ecost | $Price %]</td> |
294 |
<td>[% loop_order.total | $Price %]</td> |
333 |
<td>[% loop_order.total | $Price %]</td> |
295 |
<td>[% loop_order.budget_name %]</td> |
334 |
<td>[% loop_order.budget_name %]</td> |
296 |
<td> |
335 |
<td class="actions"> |
297 |
<a href="orderreceive.pl?ordernumber=[% loop_order.ordernumber %]&invoiceid=[% invoiceid %]">Receive</a> |
336 |
<div class="dropup"> |
298 |
<br /> |
337 |
<a class="btn btn-mini dropdown-toggle" id="actions[% loop_order.ordernumber %]" role="button" data-toggle="dropdown" href="#"> |
299 |
<a href="#" onclick="transfer_order_popup([% loop_order.ordernumber %]); return false;">Transfer</a> |
338 |
Actions <b class="caret"></b> |
300 |
</td> |
339 |
</a> |
301 |
<td> |
340 |
<ul class="dropdown-menu pull-right" role="menu" aria-labelledby="actions[% loop_order.ordernumber %]"> |
302 |
[% IF ( loop_order.left_holds_on_order ) %] |
341 |
<li><a href="orderreceive.pl?ordernumber=[% loop_order.ordernumber %]&invoiceid=[% invoiceid %]"><i class="fa fa-inbox"></i> Receive</a></li> |
303 |
<span class="button" title="Can't cancel order, ([% loop_order.holds_on_order %]) holds are linked with this order cancel holds first">Can't cancel order</span><br> |
342 |
<li><a href="#" onclick="transfer_order_popup([% loop_order.ordernumber %]); return false;"><i class="fa fa-exchange"></i> Transfer</a></li> |
304 |
[% ELSE %] |
343 |
|
305 |
<a href="/cgi-bin/koha/acqui/cancelorder.pl?ordernumber=[% loop_order.ordernumber %]&biblionumber=[% loop_order.biblionumber %]&referrer=[% "/cgi-bin/koha/acqui/parcel.pl?invoiceid=$invoiceid" | uri %]">Cancel order</a><br /> |
344 |
[% IF ( loop_order.left_holds_on_order ) %] |
306 |
[% END %] |
345 |
<li class="disabled"> |
307 |
[% IF ( loop_order.can_del_bib ) %] |
346 |
<a href="#" data-ordernumber="[% loop_order.ordernumber %]" data-toggle="tooltip" data-placement="left" title="Can't cancel order, ([% loop_order.holds_on_order %]) holds are linked with this order cancel holds first"><i class="fa fa-remove"></i> Cancel order</a></li> |
308 |
<a href="/cgi-bin/koha/acqui/cancelorder.pl?ordernumber=[% loop_order.ordernumber %]&biblionumber=[% loop_order.biblionumber %]&del_biblio=1&referrer=[% "/cgi-bin/koha/acqui/parcel.pl?invoiceid=$invoiceid" | uri %]">Cancel order and catalog record</a><br /> |
347 |
[% ELSE %] |
309 |
[% ELSE %] |
348 |
<li><a href="/cgi-bin/koha/acqui/cancelorder.pl?ordernumber=[% loop_order.ordernumber %]&biblionumber=[% loop_order.biblionumber %]&referrer=[% "/cgi-bin/koha/acqui/parcel.pl?invoiceid=$invoiceid" | uri %]"><i class="fa fa-remove"></i> Cancel order</a></li> |
310 |
<span class="button" title="Can't delete catalog record, see constraints below">Can't cancel order and delete catalog record</span><br> |
349 |
[% END %] |
311 |
[% END %] |
350 |
[% IF ( loop_order.can_del_bib ) %] |
312 |
[% IF ( loop_order.left_item ) %] |
351 |
<li><a href="/cgi-bin/koha/acqui/cancelorder.pl?ordernumber=[% loop_order.ordernumber %]&biblionumber=[% loop_order.biblionumber %]&del_biblio=1&referrer=[% "/cgi-bin/koha/acqui/parcel.pl?invoiceid=$invoiceid" | uri %]"><i class="fa fa-trash"></i> Cancel order and delete catalog record</a></li> |
313 |
<b title="Can't delete catalog record, because of [% loop_order.items %] existing item(s)" >[% loop_order.items %] item(s) left</b><br> |
352 |
[% ELSE %] |
314 |
[% END %] |
353 |
<li class="disabled"> |
315 |
[% IF ( loop_order.left_biblio ) %] |
354 |
<a data-ordernumber="[% loop_order.ordernumber %]" data-toggle="tooltip" data-placement="left" title="Can't delete catalog record, see constraints below" href="#"><i class="fa fa-trash"></i> Cancel order and delete catalog record</a> |
316 |
<b title="Can't delete catalog record, delete other orders linked to it first">[% loop_order.biblios %] order(s) left</b><br> |
355 |
</li> |
317 |
[% END %] |
356 |
[% END %] |
318 |
[% IF ( loop_order.left_subscription ) %] |
357 |
[% IF ( loop_order.left_item || loop_order.left_biblio || loop_order.left_subscription || loop_order.left_holds ) %] |
319 |
<b title="Can't delete catalog record, delete subscriptions first">[% loop_order.subscriptions %] subscription(s) left</b><br> |
358 |
<li class="divider"></li> |
320 |
[% END %] |
359 |
[% IF ( loop_order.left_item ) %] |
321 |
[% IF ( loop_order.left_holds ) %] |
360 |
<li class="message"><a class="del_error[% loop_order.ordernumber %]" href="#" title="Can't delete catalog record, because of [% loop_order.items %] existing item(s)" >[% loop_order.items %] item(s) left</a></li> |
322 |
<b title="Can't delete catalog record or order, cancel holds first">[% loop_order.holds %] hold(s) left</b> |
361 |
[% END %] |
323 |
[% END %] |
362 |
[% IF ( loop_order.left_biblio ) %] |
324 |
</td> |
363 |
<li class="message"><a class="del_error[% loop_order.ordernumber %]" href="#" title="Can't delete catalog record, delete other orders linked to it first">[% loop_order.biblios %] order(s) left</a></li> |
325 |
</tr> |
364 |
[% END %] |
|
|
365 |
[% IF ( loop_order.left_subscription ) %] |
366 |
<li class="message"><a class="del_error[% loop_order.ordernumber %]" href="#" title="Can't delete catalog record, delete subscriptions first">[% loop_order.subscriptions %] subscription(s) left</a></li> |
367 |
[% END %] |
368 |
[% IF ( loop_order.left_holds ) %] |
369 |
<li class="message"><a class="del_error[% loop_order.ordernumber %]" href="#" title="Can't delete catalog record or order, cancel holds first">[% loop_order.holds %] hold(s) left</a></li> |
370 |
[% END %] |
371 |
[% END %] |
372 |
</ul> |
373 |
</div> |
374 |
|
375 |
</td> |
376 |
<td> </td> |
377 |
</tr> |
326 |
[% END %] |
378 |
[% END %] |
327 |
</tbody> |
379 |
</tbody> |
328 |
</table> |
380 |
</table> |
Lines 393-408
Link Here
|
393 |
<tbody class="filterclass"> |
445 |
<tbody class="filterclass"> |
394 |
[% FOREACH order IN loop_received %] |
446 |
[% FOREACH order IN loop_received %] |
395 |
<tr> |
447 |
<tr> |
396 |
<td>[% order.basketname %] (<a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% order.basketno %]">[% order.basketno %]</a>)</td> |
448 |
<td><a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% order.basketno %]">[% order.basketname %] ([% order.basketno %])</a></td> |
397 |
<td> |
449 |
<td> |
398 |
[% IF order.basketgroupid %] |
450 |
[% IF order.basketgroupid %] |
399 |
[% order.basketgroupname %] (<a href="/cgi-bin/koha/acqui/basketgroup.pl?booksellerid=[% order.booksellerid %]">[% order.basketgroupid %]</a>) |
451 |
<a href="/cgi-bin/koha/acqui/basketgroup.pl?booksellerid=[% order.booksellerid %]">[% order.basketgroupname %] ([% order.basketgroupid %])</a> |
400 |
[% ELSE %] |
452 |
[% ELSE %] |
401 |
No basket group |
453 |
No basket group |
402 |
[% END %] |
454 |
[% END %] |
403 |
</td> |
455 |
</td> |
404 |
<td> |
456 |
<td> |
405 |
<a href="neworderempty.pl?ordernumber=[% order.ordernumber %]&booksellerid=[% booksellerid %]">[% order.ordernumber %]</a> |
457 |
<a href="neworderempty.pl?ordernumber=[% order.ordernumber %]&booksellerid=[% booksellerid %]">Order line [% order.ordernumber %]</a> |
406 |
[% IF (order.parent_ordernumber && (order.parent_ordernumber != order.ordernumber)) %] |
458 |
[% IF (order.parent_ordernumber && (order.parent_ordernumber != order.ordernumber)) %] |
407 |
(<a href="neworderempty.pl?ordernumber=[% order.parent_ordernumber %]&booksellerid=[% booksellerid %]" title="Original order line">[% order.parent_ordernumber %]</a>) |
459 |
(<a href="neworderempty.pl?ordernumber=[% order.parent_ordernumber %]&booksellerid=[% booksellerid %]" title="Original order line">[% order.parent_ordernumber %]</a>) |
408 |
[% END %] |
460 |
[% END %] |
Lines 424-437
Link Here
|
424 |
(<a href="/cgi-bin/koha/suggestion/suggestion.pl?suggestionid=[% order.suggestionid %]&op=show">suggestion #[% order.suggestionid %]</a>) |
476 |
(<a href="/cgi-bin/koha/suggestion/suggestion.pl?suggestionid=[% order.suggestionid %]&op=show">suggestion #[% order.suggestionid %]</a>) |
425 |
[% END %] |
477 |
[% END %] |
426 |
</td> |
478 |
</td> |
427 |
<td><a href="/cgi-bin/koha/catalogue/showmarc.pl?id=[% order.biblionumber %]" class="previewData">MARC</a> | <a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&id=[% order.biblionumber %]" class="previewData">Card</a></td> |
479 |
<td> |
|
|
480 |
<div class="dropup"> |
481 |
<a class="btn btn-mini dropdown-toggle" id="viewreceived[% loop_order.biblionumber %]" role="button" data-toggle="dropdown" href="#"> |
482 |
View <b class="caret"></b> |
483 |
</a> |
484 |
<ul class="dropdown-menu pull-right" role="menu" aria-labelledby="viewreceived[% loop_order.biblionumber %]"> |
485 |
<li><a href="/cgi-bin/koha/catalogue/showmarc.pl?id=[% order.biblionumber %]" class="previewData">MARC</a></li> |
486 |
<li><a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&id=[% order.biblionumber %]" class="previewData">Card</a></li> |
487 |
</ul> |
488 |
</div> |
489 |
</td> |
428 |
<td>[% order.quantityreceived %]</td> |
490 |
<td>[% order.quantityreceived %]</td> |
429 |
<td>[% order.budget.budget_name %]</td> |
491 |
<td>[% order.budget.budget_name %]</td> |
430 |
<td>[% order.ecost | $Price %]</td> |
492 |
<td>[% order.ecost | $Price %]</td> |
431 |
<td>[% order.unitprice | $Price %]</td> |
493 |
<td>[% order.unitprice | $Price %]</td> |
432 |
<td>[% order.total | $Price %]</td> |
494 |
<td>[% order.total | $Price %]</td> |
433 |
<td> |
495 |
[% IF loop_receive.cannot_cancel or ( Koha.Preference("AcqCreateItem") == "receiving" and loop_receive.holds > 0 ) %] |
434 |
[% IF loop_receive.cannot_cancel or ( Koha.Preference("AcqCreateItem") == "receiving" and loop_receive.holds > 0 ) %] |
496 |
<td> |
435 |
[% IF loop_receive.cannot_cancel %] |
497 |
[% IF loop_receive.cannot_cancel %] |
436 |
[% span_title = BLOCK %] |
498 |
[% span_title = BLOCK %] |
437 |
Cannot cancel receipt of this order line because it |
499 |
Cannot cancel receipt of this order line because it |
Lines 444-459
Link Here
|
444 |
[%# FIXME Here we block the cancellation if holds exist. Actually it could be possible if items will be exist after the deletion %] |
506 |
[%# FIXME Here we block the cancellation if holds exist. Actually it could be possible if items will be exist after the deletion %] |
445 |
[%# Some additional checks should be added in the pl file %] |
507 |
[%# Some additional checks should be added in the pl file %] |
446 |
[% span_title = BLOCK %] |
508 |
[% span_title = BLOCK %] |
447 |
Cannot cancel receipt of this order line because at least one reservation exists on the records. |
509 |
Cannot cancel receipt of this order line because at least one hold exists on the records. |
448 |
[% END %] |
510 |
[% END %] |
449 |
[% END %] |
511 |
[% END %] |
450 |
<span title="[% span_title | collapse %]"> |
512 |
<span title="[% span_title | collapse %]"> |
451 |
Can't cancel receipt |
513 |
Can't cancel receipt |
452 |
</span> |
514 |
</span> |
453 |
[% ELSE %] |
515 |
</td> |
454 |
<a href="/cgi-bin/koha/acqui/parcel.pl?invoiceid=[% invoiceid %]&op=cancelreceipt&ordernumber=[% order.ordernumber %]">Cancel receipt</a> |
516 |
[% ELSE %] |
455 |
[% END %] |
517 |
<td class="actions"> |
456 |
</td> |
518 |
<a class="btn btn-mini" href="/cgi-bin/koha/acqui/parcel.pl?invoiceid=[% invoiceid %]&op=cancelreceipt&ordernumber=[% order.ordernumber %]"><i class="fa fa-remove"></i> Cancel receipt</a> |
|
|
519 |
</td> |
520 |
[% END %] |
457 |
</tr> |
521 |
</tr> |
458 |
[% END %] |
522 |
[% END %] |
459 |
</tbody> |
523 |
</tbody> |
Lines 463-469
Link Here
|
463 |
[% ELSE %]There are no received orders.[% END %] |
527 |
[% ELSE %]There are no received orders.[% END %] |
464 |
</div> |
528 |
</div> |
465 |
|
529 |
|
466 |
<div id="dataPreview" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="dataPreviewLabel" aria-hidden="true"> |
530 |
<div id="dataPreview" class="modal hide" tabindex="-1" role="dialog" aria-labelledby="dataPreviewLabel" aria-hidden="true"> |
467 |
<div class="modal-header"> |
531 |
<div class="modal-header"> |
468 |
<button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button> |
532 |
<button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button> |
469 |
<h3 id="dataPreviewLabel">MARC preview</h3> |
533 |
<h3 id="dataPreviewLabel">MARC preview</h3> |
470 |
- |
|
|