]> git.koha-community.org Git - koha.git/blob - koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt
Bug 9236 : Redirect to the parcel page after deleting an item/order
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / acqui / parcel.tt
1 [% INCLUDE 'doc-head-open.inc' %]
2 <title>Koha &rsaquo; Acquisitions &rsaquo; [% IF ( date ) %]
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" />
5 [% INCLUDE 'doc-head-close.inc' %]
6 <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.dataTables.min.js"></script>
7 [% INCLUDE 'datatables-strings.inc' %]
8 <script type="text/javascript" src="[% themelang %]/js/datatables.js"></script>
9 [% INCLUDE 'greybox.inc' %]
10 <script type="text/javascript" src="[% yuipath %]/json/json-min.js"></script>
11 <script type="text/javascript">
12 //<![CDATA[
13
14     dt_overwrite_html_sorting_localeCompare();
15
16     $(document).ready(function(){
17         var pendingt = $("#pendingt").dataTable($.extend(true, {}, dataTablesDefaults, {
18             "bStateSave": true,
19             "iCookieDuration": 60*60*24*1000, // 1000 days
20             "aLengthMenu": [[10, 25, 50, 100, -1], [10, 25, 50, 100, "All"]],
21             "aoColumnDefs": [
22                 { "aTargets": [ 3, 8, 9 ], "bSortable": false, "bSearchable": false },
23             ],
24             "aoColumns": [
25                 { "sType": "num-html" },
26                 { "sType": "num-html" },
27                 { "sType": "html" },
28                 null,
29                 null,
30                 null,
31                 null,
32                 null,
33                 null,
34                 null,
35             ],
36             "sPaginationType": "four_button"
37         } ) );
38         var receivedt = $("#receivedt").dataTable($.extend(true, {}, dataTablesDefaults, {
39             "bStateSave": true,
40             "iCookieDuration": 60*60*24*1000, // 1000 days
41             "aLengthMenu": [[10, 25, 50, 100, -1], [10, 25, 50, 100, "All"]],
42             "aoColumnDefs": [
43                 { "aTargets": [ 3, -1 ], "bSortable": false, "bSearchable": false },
44             ],
45             "aoColumns": [
46                 { "sType": "num-html" },
47                 { "sType": "num-html" },
48                 { "sType": "html" },
49                 null,
50                 null,
51                 null,
52                 null,
53                 null,
54                 null
55             ],
56             "sPaginationType": "four_button"
57         } ) );
58 /*
59     $("#pendingt").tablesorter({
60                 headers: { 2: { sorter: 'articles' },3: { sorter: false },8:{sorter:false}}
61     });
62 */
63
64     });
65
66      // Case-insensitive version of jquery's contains function
67      jQuery.extend(jQuery.expr[':'], {
68             icontains : "jQuery(a).text().toUpperCase().indexOf(m[3].toUpperCase())>=0"
69      });
70
71      // Contains exactly function
72      jQuery.extend(jQuery.expr[':'], {
73           containsExactly: "$(a).text() == m[3]"
74      });
75
76 //]]>
77 </script>
78 <script type="text/javascript">
79 //<![CDATA[
80             function confirm_delete_item(ordernumber, basketno, biblionumber) {
81                 var is_confirmed = confirm(_('Are you sure you want to delete this order ?'));
82                 if (is_confirmed) {
83                     window.location = "addorder.pl?ordernumber="+ordernumber+"&basketno="+basketno+"&quantity=0&biblionumber="+biblionumber+"&invoiceid=[% invoiceid %]";
84                 }
85             }
86             
87             function confirm_delete_biblio(ordernumber, basketno, biblionumber) {
88                 var is_confirmed = confirm(_('Are you sure you want to delete this catalog record and order ?'));
89                 if (is_confirmed) {
90                     window.location = "addorder.pl?ordernumber="+ordernumber+"&basketno="+basketno+"&quantity=0&biblionumber="+biblionumber+"&delbiblio=1&invoiceid=[% invoiceid %]";
91                     }
92             }
93 //]]>
94 </script>
95 </head>
96 <body id="acq_parcel" class="acq">
97 [% INCLUDE 'header.inc' %]
98 [% INCLUDE 'acquisitions-search.inc' %]
99
100 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a> &rsaquo;
101     [% IF ( datereceived ) %]
102         Receipt summary for <i>[% name %]</i>
103         [% IF ( invoice ) %]
104             <i>[ [% invoice %] ]</i>
105         [% END %]
106         on <i>[% formatteddatereceived %]</i>
107     [% ELSE %]
108         Receive orders from [% name %]
109     [% END %]
110 </div>
111
112 <div id="doc3" class="yui-t2">
113
114    <div id="bd">
115         <div id="yui-main">
116         <div class="yui-b">
117         [% IF ( receive_error ) %]
118         <div class="dialog alert">
119         <h3>Error adding items:</h3>
120         <ul>
121         [% FOREACH error_loo IN error_loop %]
122                 <li>[% error_loo.error_param %][% IF ( error_loo.error_duplicate_barcode ) %]Duplicate Barcode[% END %] <!-- todo: other error conditions come here. --></li>
123         [% END %]
124         </ul>
125         </div>
126         [% END %]
127     <h1>
128         [% IF ( datereceived ) %]
129             Receipt summary for <i>[% name %]</i> [% IF ( invoice ) %] <i> [ [% invoice %] ] </i>[% END %] on <i>[% formatteddatereceived %]</i>
130         [% ELSE %]
131             Receive orders from [% name %]
132         [% END %]
133     </h1>
134
135     [% IF ( success_delorder ) %]
136     <div class="dialog message">The order has been successfully canceled.</div>
137     [% ELSE %]
138         [% IF ( error_delitem ) %]
139             <div class="dialog alert">The order has been canceled, although one or more items could not have been deleted.</div>
140         [% END %]
141         [% IF ( error_delbiblio ) %]
142             <div class="dialog alert">The order has been canceled, although the record has not been deleted.</div>
143         [% END %]
144     [% END %]
145
146     [% IF (error_cancelling_receipt) %]
147       <div class="error">
148       Cannot cancel receipt. Possible reasons :
149       <ul>
150         <li>
151           The order line you trying to cancel was created from a partial receipt
152           of another order line which is already received. Try to cancel this
153           one first and retry.
154         </li>
155         <li>
156           The order line you trying to cancel was created from a partial receipt
157           of another order line which has been deleted. Cancellation is not
158           possible.
159         </li>
160       </ul>
161       </div>
162     [% END %]
163
164 <div id="acqui_receive_summary">
165 <p><strong>Invoice number:</strong> [% invoice %] <strong>Received by:</strong> [% loggedinusername %] <strong>On:</strong> [% formatteddatereceived %]</p>
166 </div>
167 [% UNLESS (invoiceclosedate) %]
168 <div id="acqui_receive_search">
169     <h3>Pending orders</h3>
170
171  [% IF ( loop_orders ) %]<table id="pendingt">
172     <thead>
173         <tr>
174             <th>Basket</th>
175             <th>Order line</th>
176             <th>Summary</th>
177             <th>View record</th>
178             <th>Quantity</th>
179             <th>Unit cost</th>
180             <th>Order cost</th>
181             <th>Fund</th>
182             <th>&nbsp;</th>
183             <th>&nbsp;</th>
184         </tr>
185     </thead>
186     <tbody class="filterclass">
187         [% FOREACH loop_order IN loop_orders %]
188             <tr>
189                 <td class="basketfilterclass"><a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% loop_order.basketno %]">[% loop_order.basketno %]</a></td>
190                 <td class="orderfilterclass"><a href="neworderempty.pl?ordernumber=[% loop_order.ordernumber %]&amp;booksellerid=[% loop_order.booksellerid %]">[% loop_order.ordernumber %]</a></td>
191                 <td class="summaryfilterclass">
192                   <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% loop_order.biblionumber %]">[% loop_order.title |html %]</a>
193                 [% IF ( loop_order.author ) %] by [% loop_order.author %][% END %]
194                 [% IF ( loop_order.isbn ) %] &ndash; [% loop_order.isbn %][% END %]
195                 [% IF ( loop_order.publishercode ) %]<br />Publisher :[% loop_order.publishercode %][% END %]
196                 [% IF ( loop_order.suggestionid ) %]
197                     <br/>
198                     Suggested by: [% loop_order.surnamesuggestedby %][% IF ( loop_order.firstnamesuggestedby ) %], [% loop_order.firstnamesuggestedby %] [% END %]
199                     (<a href="/cgi-bin/koha/suggestion/suggestion.pl?suggestionid=[% loop_order.suggestionid %]&amp;op=show">suggestion #[% loop_order.suggestionid %]</a>)
200                 [% END %]
201                 <br />
202                 [% IF ( loop_order.notes ) %]
203                     <p class="ordernote"><strong>Note: </strong>[% loop_order.notes|html %] [<a href="/cgi-bin/koha/acqui/modordernotes.pl?ordernumber=[% loop_order.ordernumber %]&amp;referrer=/cgi-bin/koha/acqui/parcel.pl%3Fbooksellerid=[% loop_order.booksellerid %]&amp;datereceived=[% loop_order.invoicedatereceived %]&amp;invoice=[% loop_order.invoice %]">Change note</a>]</p>
204                 [% ELSE %]
205                     [<a href="/cgi-bin/koha/acqui/modordernotes.pl?ordernumber=[% loop_order.ordernumber %]&amp;referrer=/cgi-bin/koha/acqui/parcel.pl%3Fbooksellerid=[% loop_order.booksellerid %]&amp;datereceived=[% loop_order.invoicedatereceived %]&amp;invoice=[% loop_order.invoice %]">Add note</a>]
206                 [% END %]
207                 </td>
208                 <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&amp;id=[% loop_order.biblionumber %]" title="MARC" rel="gb_page_center[600,500]">Card</a></td>
209                 <td>[% loop_order.quantity %]</td>
210                 <td>[% loop_order.ecost %]</td>
211                 <td>[% loop_order.ordertotal %]</td>
212                 <td>[% loop_order.budget_name %]</td>
213                                 <td>
214                               <a href="orderreceive.pl?ordernumber=[% loop_order.ordernumber %]&amp;invoiceid=[% invoiceid %]">Receive</a>
215                                 </td>
216                                 <td>
217                         [% IF ( loop_order.left_holds_on_order ) %]
218                         <span class="button" title="Can't delete order, ([% loop_order.holds_on_order %]) holds are linked with this order cancel holds first">Can't delete order</span><br>
219                         [% ELSE %]
220                         <a href="javascript:confirm_delete_item([% loop_order.ordernumber %], [% loop_order.basketno %], [% loop_order.biblionumber %])" class="button">Delete order</a><br>
221                         [% END %]
222                         [% IF ( loop_order.can_del_bib ) %]
223                         <a href="javascript:confirm_delete_biblio([% loop_order.ordernumber %], [% loop_order.basketno %], [% loop_order.biblionumber %])" class="button">Delete order and catalog record</a><br>
224                         [% ELSE %]
225                         <span class="button" title="Can't delete catalog record, see constraints below">Can't delete order and catalog record</span><br>
226                         [% END %]
227                         [% IF ( loop_order.left_item ) %]
228                         <b title="Can't delete catalog record, because of [% loop_order.items %] existing item(s)" >[% loop_order.items %] item(s) left</b><br>
229                         [% END %]
230                         [% IF ( loop_order.left_biblio ) %]
231                         <b title="Can't delete catalog record, delete other orders linked to it first">[% loop_order.biblios %] order(s) left</b><br>
232                         [% END %]
233                         [% IF ( loop_order.left_subscription ) %]
234                         <b title="Can't delete catalog record, delete subscriptions first">[% loop_order.subscriptions %] subscription(s) left</b><br>
235                         [% END %]
236                         [% IF ( loop_order.left_holds ) %]
237                         <b title="Can't delete catalog record or order, cancel holds first">[% loop_order.holds %] hold(s) left</b>
238                         [% END %]
239                     </td>
240                 </tr>
241             [% END %]
242         </tbody>
243          </table>[% ELSE %]There are no pending orders.[% END %]
244        <div id="resultnumber">
245         <!-- Row of numbers corresponding to search result pages -->
246         [% IF ( displayprev ) %]
247             <a href="parcel.pl?invoiceid=[% invoiceid %]&amp;startfrom=[% prevstartfrom %][% IF ( resultsperpage ) %]&amp;resultsperpage=[% resultsperpage %][% END %]#resultnumber">&lt;&lt; Previous</a>
248         [% END %]
249         [% FOREACH number IN numbers %]
250             [% IF ( number.highlight ) %]
251             <span class="current">[% number.number %]</span>
252             [% ELSE %]
253             <a href="parcel.pl?invoiceid=[% invoiceid %]&amp;startfrom=[% number.startfrom %][% IF ( resultsperpage ) %]&amp;resultsperpage=[% resultsperpage %][% END %]#resultnumber">[% number.number %]</a>
254             [% END %]
255         [% END %]
256         [% IF ( displaynext ) %]
257             <a href="parcel.pl?invoiceid=[% invoiceid %]&amp;startfrom=[% nextstartfrom %][% IF ( resultsperpage ) %]&amp;resultsperpage=[% resultsperpage %][% END %]#resultnumber">Next &gt;&gt;</a>
258         [% END %]
259         </div>
260     </div>
261 [% ELSE %]
262     <p>
263         Invoice is closed, so you can't receive orders anymore.
264         <a href="/cgi-bin/koha/acqui/invoice.pl?op=reopen&invoiceid=[% invoiceid %]&referer=/cgi-bin/koha/acqui/parcel.pl%3Finvoiceid=[% invoiceid %]">Reopen it</a>.
265     </p>
266 [% END %]
267
268 <div id="acqui_receive_receivelist">
269     <h3>Already received</h3>
270
271
272    [% IF ( loop_received ) %]
273    <form action="/cgi-bin/koha/acqui/parcel.pl" method="get" name="orderform">
274     <table id="receivedt">
275         <thead>
276             <tr>
277                 <th>Basket</th>
278         <th>Order line</th>
279                 <th>Summary</th>
280         <th>View record</th>
281                 <th>Quantity</th>  
282                 <th>Est cost</th>
283                 <th>Actual cost</th>
284                 <th>TOTAL</th>
285         <th></th>
286             </tr>
287     </thead>
288     <tfoot>
289         <tr>
290             <th colspan="7" class="total">Total tax exc.</th>
291             <th>[% total_gste %]</th>
292             <th></th>
293         </tr>
294         [% FOREACH book_foot IN book_foot_loop %]
295             <tr>
296                 <th colspan="7">Total (GST [% book_foot.gstrate * 100 | format ("%.1f") %]%)</th>
297                 <th>[% book_foot.value %]</th>
298                 <th></th>
299             </tr>
300         [% END %]
301         <tr>
302             <th colspan="7" class="total">Total tax inc.</th>
303             <th>[% total_gsti %]</th>
304             <th></th>
305         </tr>
306     </tfoot>
307         <tbody class="filterclass">
308             [% FOREACH loop_receive IN loop_received %]
309             <tr>
310                 <td><a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% loop_receive.basketno %]">[% loop_receive.basketno %]</a></td>
311                 <td><a href="neworderempty.pl?ordernumber=[% loop_receive.ordernumber %]&amp;booksellerid=[% booksellerid %]">[% loop_receive.ordernumber %]</a></td>
312                 <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% loop_receive.biblionumber %]">[% loop_receive.title |html %]</a>
313                 [% IF ( loop_receive.author ) %] / [% loop_receive.author %][% END %]
314                 [% IF ( loop_receive.isbn ) %] - [% loop_receive.isbn %][% END %]
315                 [% IF ( loop_receive.publishercode ) %]<br />Publisher :[% loop_receive.publishercode %][% END %]
316                 [% IF ( loop_receive.suggestionid ) %]
317                     <br/>
318                     Suggested by: [% loop_receive.surnamesuggestedby %][% IF ( loop_receive.firstnamesuggestedby ) %], [% loop_receive.firstnamesuggestedby %] [% END %]
319                     (<a href="/cgi-bin/koha/suggestion/suggestion.pl?suggestionid=[% loop_receive.suggestionid %]&amp;op=show">suggestion #[% loop_receive.suggestionid %]</a>)
320                 [% END %]
321                 </td>
322                 <td><a href="/cgi-bin/koha/catalogue/showmarc.pl?id=[% loop_receive.biblionumber %]" title="MARC" rel="gb_page_center[600,500]">MARC</a> | <a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&amp;id=[% loop_receive.biblionumber %]" title="MARC" rel="gb_page_center[600,500]">Card</a></td>
323                 <td>[% loop_receive.quantityreceived %]</td>
324                 <td>[% loop_receive.ecost %]</td>
325                 <td>[% loop_receive.unitprice %]</td>
326                 <td>[% loop_receive.total %]</td>
327                 <td>
328                     [% IF (loop_receive.cannot_cancel) %]
329                         [% span_title = BLOCK %]
330                             Cannot cancel receipt of this order line because it
331                             was created from a partial receipt of order line no.
332                             [% loop_receive.parent_ordernumber %], which is
333                             already received. Try cancelling this one first and
334                             retry.
335                         [% END %]
336                         <span title="[% span_title | collapse %]">
337                             Can't cancel receipt
338                         </span>
339                     [% ELSE %]
340                         <a href="/cgi-bin/koha/acqui/parcel.pl?invoiceid=[% invoiceid %]&op=cancelreceipt&ordernumber=[% loop_receive.ordernumber %]">Cancel receipt</a>
341                     [% END %]
342                 </td>
343             </tr>
344             [% END %]
345         </tbody>
346     </table>
347     </form>
348         [% ELSE %]There are no received orders.[% END %]
349 </div>
350
351 <!--<form action="/cgi-bin/koha/acqui/parcels.pl?booksellerid=[% booksellerid %]" method="post">-->
352 [% IF (invoiceclosedate) %]
353     <a href="/cgi-bin/koha/acqui/invoice.pl?invoiceid=[% invoiceid %]">View invoice</a>
354 [% ELSE %]
355     <form action="/cgi-bin/koha/acqui/invoice.pl" method="get">
356         <input type="hidden" name="invoiceid" value="[% invoiceid %]" />
357         <fieldset class="action">
358             <input type="submit" value="Finish receiving" />
359         </fieldset>
360     </form>
361 [% END %]
362
363 </div>
364 </div>
365 <div class="yui-b">
366 <form action="/cgi-bin/koha/acqui/parcel.pl" id="filterform" method="post">
367         <fieldset class="brief">
368
369             <h4>Filter</h4>
370
371             <ol>
372
373                 <li>
374                     <label for="summaryfilter">ISBN, author or title :</label>
375             <input type="text" name="summaryfilter" id="summaryfilter" value="[% summaryfilter %]"/>
376                 </li>
377
378                 <li>
379                     <label for="basketfilter">Basket :</label>
380             <input type="text" name="basketfilter" id="basketfilter" value="[% basketfilter %]"/>
381                 </li>
382
383                 <li>
384             <label for="orderfilter">Order line :</label>
385             <input type="text" name="orderfilter" id="orderfilter" value="[% orderfilter %]"/>
386                 </li>
387                 [% IF (UNIMARC) %]
388         <li>
389             <label for="eanfilter">EAN :</label>
390             <input type="text" name="eanfilter" id="eanfilter" value="[% eanfilter %]"/>
391         </li>
392                 [% END %]
393             </ol>
394                 <fieldset class="action">
395         <input type="hidden" value="search" name="op" />
396         <input type="hidden" value="[% invoiceid %]" name="invoiceid" />
397         <input type="submit" value="Filter" />
398         <a href="/cgi-bin/koha/acqui/parcel.pl?invoiceid=[% invoiceid %]">Clear</a>
399                 </fieldset>
400
401
402         </fieldset>
403     </form>
404 [% INCLUDE 'acquisitions-menu.inc' %]
405 </div>
406 </div>
407 [% INCLUDE 'intranet-bottom.inc' %]
408