Bug 20726: Add show/hide already received orders links
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / serials / subscription-detail.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE Koha %]
4 [% USE KohaDates %]
5 [% USE Branches %]
6 [% USE AuthorisedValues %]
7 [% USE Price %]
8 [% SET footerjs = 1 %]
9 [% INCLUDE 'doc-head-open.inc' %]
10 <title>Koha &rsaquo; Serials &rsaquo; Details for subscription #[% subscriptionid | html %]</title>
11 [% INCLUDE 'doc-head-close.inc' %]
12 [% Asset.css("css/datatables.css") %]
13 </head>
14
15 <body id="ser_subscription-detail" class="ser">
16 [% INCLUDE 'header.inc' %]
17 [% INCLUDE 'serials-search.inc' %]
18
19 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/serials/serials-home.pl">Serials</a> &rsaquo; Details for subscription #[% subscriptionid | html %]</div>
20
21 <div id="doc3" class="yui-t2">
22    
23    <div id="bd">
24         <div id="yui-main">
25         <div class="yui-b">
26         [% INCLUDE 'serials-toolbar.inc' %]
27
28     <h1>Subscription for [% bibliotitle | html %] [% IF closed %](closed)[% END %]</h1>
29     [% IF ( abouttoexpire ) %]
30       [% UNLESS closed %]
31         <div class="dialog message">Subscription will expire [% enddate | html %]. <a href="#" id="renewsub">Renew this subscription</a>.</div>
32       [% END %]
33     [% END %]
34     [% IF ( NEEDSCONFIRMATION ) %]
35     <div id="circ_needsconfirmation" class="dialog alert">
36         <h3>Please confirm subscription deletion</h3>
37
38                         <ul>
39                         [% IF ( NOTEXPIRED ) %] <li>The subscription has not expired yet</li> [% END %] 
40                         [% IF ( LINKEDISSUES ) %] <li>The subscription has linked issues</li> [% END %]
41                         [% IF ( LINKEDITEMS ) %] <li>The subscription has linked items<br /> Those items won't be deleted</li> [% END %]
42                         </ul>
43                         <form method="post" action="/cgi-bin/koha/serials/subscription-detail.pl">
44                         <input type="hidden" name="subscriptionid" value="[% subscriptionid | html %]" />
45                         <input type="hidden" name="issueconfirmed" value="1" />
46                         <input type="hidden" name="op" value="del" />
47             <button type="submit" class="approve" accesskey="y"><i class="fa fa-fw fa-check"></i> Yes, delete (Y)</button>
48                         </form>
49                         <form method="get" action="/cgi-bin/koha/serials/subscription-detail.pl">
50                         <input type="hidden" name="subscriptionid" value="[% subscriptionid | html %]" />
51             <button type="submit" class="deny" accesskey="n"><i class="fa fa-fw fa-remove"></i> No, don't delete (N)</button>
52                         </form>
53
54         </div>
55         [% END %] <!-- NEEDSCONFIRMATION -->
56
57 <div id="subscription_description" class="toptabs">
58 <ul class="ui-tabs-nav">
59     <li><a href="#subscription_info">Information</a></li>
60     <li><a href="#subscription_planning">Planning</a></li>
61     <li><a href="#subscription_issues">Issues</a></li>
62     <li><a href="#subscription_summary">Summary</a></li>
63 </ul>
64
65 <div id="subscription_info">
66     <div class="yui-g">
67     <div class="yui-u first">
68     <div class="rows">
69                 <ol>
70                 <li><span class="label">Subscription ID: </span>[% subscriptionid | html %]</li>
71         <li><span class="label">Librarian identity:</span> [% librarian | html %]</li>
72         <li><span class="label">Vendor:</span> <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% aqbooksellerid | html %]">[% aqbooksellername | html %]</a></li>
73         <li><span class="label">Biblio:</span>  <a href="/cgi-bin/koha/catalogue/[% default_bib_view | html %].pl?biblionumber=[% bibnum | html %]">[% bibliotitle | html %]</a> <i>([% bibnum | html %])</i></li>
74         [% IF ( OPACBaseURL ) %]
75             <li>
76                 <span class="label">OPAC view:</span>
77                 <a id="view-subscription-in-opac" target="_blank" href="[% Koha.Preference('OPACBaseURL') | html %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblionumber | html %]">Open in new window.</a>
78             </li>
79         [% END %]
80 [% IF ( branchcode ) %]<li><span class="label">Library:</span> [% Branches.GetName( branchcode ) | html %]</li>[% END %]
81         [% IF ( serialsadditems ) %]
82             <li><span class="label">Items:</span> Serial receipt creates an item record.</li>
83         [% ELSE %]
84             <li><span class="label">Items:</span> Serial receipt does not create an item record.</li>
85         [% END %]
86         <li>
87             <span class="label">Serial number:</span>
88             [% IF skip_serialseq %]
89                 Serial number is skipped when an irregularity is found.
90             [% ELSE %]
91                 Serial number is kept when an irregularity is found.
92             [% END %]
93         </li>
94         <li><span class="label">Grace period:</span> [% graceperiod | html %]</li>
95         </ol>
96     </div>
97     </div>
98     <div class="yui-u">
99     <div class="rows">
100         <ol>
101         [% IF ( location ) %]<li><span class="label">Location:</span> [% location | html %]</li>[% END %]
102         [% IF ( callnumber ) %]<li><span class="label">Call number:</span> [% callnumber | html %]</li>[% END %]
103                 [% IF ( staffdisplaycount ) %]<li><span class="label">Number of issues to display to staff:</span>[% staffdisplaycount | html %]</li>[% END %]
104         [% IF ( opacdisplaycount ) %]<li><span class="label">Number of issues to display in OPAC:</span>[% opacdisplaycount | html %]</li>[% END %]
105         [% IF ( letter ) %]
106             <li>
107                 <span class="label">Patron notification:</span> [% letter | html %]
108                 (<a href="/cgi-bin/koha/serials/viewalerts.pl?subscriptionid=[% subscriptionid | html %]">subscribers</a>)
109             </li>
110         [% END %]
111         [% IF ( hasRouting ) %]<li><span class="label">Routing:</span> yes</li>[% END %]
112      </ol>
113      </div>
114      </div>
115      </div>
116
117      [% IF additional_fields_for_subscription %]
118     <div class="yui-g">
119       <div class="yui-u first">
120         <div class="rows">
121           <legend>Additional fields:</legend>
122           <ol>
123             [% FOR field IN additional_fields_for_subscription %]
124               <li>
125                 <span class="label">[% field.name | html %]:</span>
126                 [% IF field.authorised_value_category %]
127                   [% AuthorisedValues.GetByCode( field.authorised_value_category, additional_fields.${field.name} ) | html %]
128                 [% ELSE %]
129                   [% additional_fields.${field.name} | html %]
130                 [% END %]
131               </li>
132             [% END %]
133           </ol>
134         </div>
135       </div>
136       </div>
137      [% END %]
138 </div>
139
140     <div id="subscription_planning">
141     <div class="yui-g">
142     <div class="rows">
143         <ol>
144             <li><span class="label">Beginning date:</span> [% startdate | html %]
145             </li>
146             <li><span class="label">Frequency:</span>
147                 [% frequency.description | html %]
148             </li>
149             <li>
150               <span class="label">Manual history: </span>
151                 [% IF ( manualhistory ) %]
152                     Enabled <a href="/cgi-bin/koha/serials/subscription-history.pl?subscriptionid=[% subscriptionid | html %]">Edit history</a>
153                 [% ELSE %]
154                     Disabled
155                 [% END %]
156             </li>
157             <li><span class="label">Number pattern:</span>
158                 [% numberpattern.label | html %]
159             </li>
160             <li><table>
161             <tr>
162                 <td>Starting with:</td>
163                 [% IF (has_X) %]
164                     <td align="center">[% lastvalue1 | html %]</td>
165                 [% END %]
166                 [% IF (has_Y) %]
167                     <td align="center">[% lastvalue2 | html %]</td>
168                 [% END %]
169                 [% IF (has_Z) %]
170                     <td align="center">[% lastvalue3 | html %]</td>
171                 [% END %]
172             </tr>
173             <tr>
174                 <td>Rollover:</td>
175                 [% IF (has_X) %]
176                     <td align="center">[% numberpattern.whenmorethan1 | html %]</td>
177                 [% END %]
178                 [% IF (has_Y) %]
179                     <td align="center">[% numberpattern.whenmorethan2 | html %]</td>
180                 [% END %]
181                 [% IF (has_Z) %]
182                     <td align="center">[% numberpattern.whenmorethan3 | html %]</td>
183                 [% END %]
184             </tr>
185             </table></li>
186             [% IF ( irregular_issues ) %]
187             <li><span class="label">Irregularity:</span> [% irregular_issues | html %] issues
188             </li>
189             [% END %]
190             <li><span class="label">First arrival:</span> [% firstacquidate | html %]
191             </li>
192         [% IF ( numberlength ) %]<li><span class="label">Number of issues:</span> [% numberlength | html %]</li>[% END %]
193         [% IF ( weeklength ) %]<li><span class="label">Number of weeks:</span> [% weeklength | html %]</li>[% END %]
194         [% IF ( monthlength ) %]<li><span class="label">Number of months:</span> [% monthlength | html %]</li>[% END %]
195         </ol>
196     </div>
197     </div>
198     </div>
199     <div id="subscription_numbering" style="display:none;">
200         <h3>Numbering calculation</h3>
201         <p><label>Numbering formula:</label> [% numberingmethod | html %]</p>
202         <table>
203             <tr>
204                 <th>&nbsp;</th>
205                 <th>X</th>
206                 <th>Y</th>
207                 <th>Z</th>
208                 </tr>
209                 <tr>
210                     <td>Add</td>
211                     <td>
212                         [% add1 | html %]
213                     </td>
214                     <td>
215                         [% add2 | html %]
216                     </td>
217                     <td>
218                         [% add3 | html %]
219                     </td>
220                 </tr>
221                 <tr>
222                     <td>once every</td>
223                     <td>[% every1 | html %]</td>
224                     <td>[% every2 | html %]</td>
225                     <td>[% every3 | html %]</td>
226                 </tr>
227                 <tr>
228                     <td>When more than</td>
229                     <td>[% whenmorethan1 | html %] [% IF ( innerloop1 ) %]<br />
230                         <i>(is [% innerloop1 | html %])</i>[% END %]</td>
231                     <td>[% whenmorethan2 | html %] [% IF ( innerloop2 ) %]<br />
232                         <i>(is [% innerloop2 | html %])</i>[% END %]</td>
233                     <td>[% whenmorethan3 | html %] [% IF ( innerloop3 ) %]<br />
234                         <i>(is [% innerloop3 | html %])</i>[% END %]</td>
235                 </tr>
236                 <tr>
237                     <td>Set back to</td>
238                     <td>[% setto1 | html %]</td>
239                     <td>[% setto2 | html %]</td>
240                     <td>[% setto3 | html %]</td>
241                 </tr>
242                 <tr>
243                     <td>
244                             Inner counter
245                     </td>
246                     <td>[% innerloop1 | html %]</td>
247                     <td>[% innerloop2 | html %]</td>
248                     <td>[% innerloop3 | html %]</td>
249                 </tr>
250                 <tr>
251                     <td>
252                             Last value
253                     </td>
254                     <td>[% lastvalue1 | html %]</td>
255                     <td>[% lastvalue2 | html %]</td>
256                     <td>[% lastvalue3 | html %]</td>
257                 </tr>
258             </table>
259     </div>
260     <div id="subscription_issues">
261         <table>
262         <tr>
263             <th>Issue number</th>
264             <th>Planned date</th>
265             <th>Published date</th>
266             <th>Published date (text)</th>
267             <th>Status</th>
268         </tr>
269         [% FOREACH serialslis IN serialslist %]
270             <tr>
271                 <td>
272                     [% serialslis.serialseq | html %]
273                 </td>
274                 <td>
275                     [% IF serialslis.planneddate %]
276                       [% serialslis.planneddate | html %]
277                     [% ELSE %]
278                       Unknown
279                     [% END %]
280                 </td>
281                 <td>
282                     [% IF serialslis.publisheddate %]
283                       [% serialslis.publisheddate | html %]
284                     [% ELSE %]
285                       Unknown
286                     [% END %]
287                 </td>
288                 <td>
289                     [% serialslis.publisheddatetext | html %]
290                 </td>
291                 <td>
292                     [% IF ( serialslis.status1 ) %]Expected[% END %]
293                     [% IF ( serialslis.status2 ) %]Arrived[% END %]
294                     [% IF ( serialslis.status3 ) %]Late[% END %]
295                     [% IF ( serialslis.status4 ) %]Missing[% END %]
296                     [% IF ( serialslis.status41 ) %]Missing (never received)[% END %]
297                     [% IF ( serialslis.status42 ) %]Missing (sold out)[% END %]
298                     [% IF ( serialslis.status43 ) %]Missing (damaged)[% END %]
299                     [% IF ( serialslis.status44 ) %]Missing (lost)[% END %]
300                     [% IF ( serialslis.status5 ) %]Not issued[% END %]
301                     [% IF ( serialslis.status6 ) %]Delete[% END %]
302                     [% IF ( serialslis.status7 ) %]
303                       Claimed
304                       [% IF ( serialslis.claimdate ) %]
305                         [% serialslis.claimdate | html %]
306                       [% END %]
307                     [% END %]
308                     [% IF ( serialslis.status8 ) %]Stopped[% END %]
309                 </td>
310             </tr>
311         [% END %]
312         </table>
313     </div>
314     <div id="subscription_summary">
315     <div class="yui-g">
316     <div class="rows">
317         <ol>
318             <li><span class="label">Start date:</span> [% startdate | html %] </li>
319             <li><span class="label">End date:</span> [% enddate | html %]</li>
320             <li><span class="label">History start date:</span> [% histstartdate | html %] </li>
321             <li><span class="label">History end date:</span> [% histenddate | html %]</li>
322             <li><span class="label">Received issues:</span>[% recievedlist | html %]</li>
323             <li><span class="label">Missing issues:</span>[% missinglist | html %]</li>
324             <li><span class="label">Nonpublic note:</span>[% internalnotes FILTER html_line_break | html %]</li>
325             <li><span class="label">Public note:</span>[% notes FILTER html_line_break | html %]</li>
326             <li><span class="label">History staff note:</span>[% librariannote FILTER html_line_break | html %]</li>
327             <li><span class="label">History OPAC note:</span>[% opacnote FILTER html_line_break | html %]</li>
328         </ol>
329     </div>
330     </div>
331     </div>
332     </div>
333
334     [% IF orders %]
335         <div id="acquisition_details">
336             <h2>Acquisition details</h2>
337             <table id="orders">
338                 <caption>
339                   <span class="actions">
340                   <a href="#" id="hide_received_orders">Hide already received orders</a>
341                   | <a href="#" id="show_all_orders">Show all orders</a></span>
342                 </caption>
343
344                 <thead>
345                     <tr>
346                         <th>Invoice</th>
347                         <th>Basket</th>
348                         <th>Order number</th>
349                         <th class="title-string">Creation date</th>
350                         <th class="title-string">Receive date</th>
351                         <th>Status</th>
352                         <th>Fund</th>
353                         <th>Ordered</th>
354                         <th>Spent</th>
355                     </tr>
356                 </thead>
357                 <tbody>
358                 [% FOR order IN orders %]
359                     <tr>
360                         <td>
361                         [% IF order.invoice %]
362                             [% IF CAN_user_acquisition %]
363                                 <a href="/cgi-bin/koha/acqui/invoice.pl?invoiceid=[% order.invoiceid %]" title="Invoice detail page">
364                                    [% order.invoice.invoicenumber | html %]</a>
365                             [% ELSE %]
366                                 [% order.invoice.invoicenumber | html %]
367                             [% END %]
368                         [% END %]
369                         </td>
370                         <td>[% IF CAN_user_acquisition_order_manage %]
371                             <a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% order.basketno | uri %]">[% order.basket.basketname | html %] ([% order.basketno | html %])</a>
372                         [% ELSE %]
373                             [% order.basket.basketname | html %] ([% order.basketno | html %])
374                         [% END %]</td>
375                         <td>[% order.ordernumber | html %]</td>
376                         <td><span title="[% order.basket.creationdate | uri %]">[% order.basket.creationdate | $KohaDates%]</span></td>
377                         <td>[% IF order.datereceived %]<span title="[% order.datereceived | uri %]">[% order.datereceived | $KohaDates %]</span>[% END %]</td>
378                         <td>
379                           [% SWITCH order.orderstatus %]
380                             [% CASE 'new' %]New
381                             [% CASE 'ordered' %]Ordered
382                             [% CASE 'partial' %]Partial
383                             [% CASE 'complete' %]Complete
384                             [% CASE 'cancelled' %]Cancelled
385                           [% END %]
386                         </td>
387                         <td>[% order.fund.budget_name | html %]</td>
388                         <td>
389                             [% UNLESS order.datereceived %]
390                                 [% order.ecost_tax_excluded | $Price %] / [% order.ecost_tax_included | $Price %]
391                             [% END %]
392                         </td>
393                         <td>
394                             [% IF order.datereceived %]
395                                 [%# FIXME What if unitprice has not been filled? %]
396                                 [% order.unitprice_tax_excluded | $Price %] / [% order.unitprice_tax_included | $Price %]
397                             [% END %]
398                         </td>
399                     </tr>
400                 [% END %]
401                 </tbody>
402             </table>
403           </div>
404       [% END %]
405
406 </div>
407 </div>
408
409 <div class="yui-b">
410 [% INCLUDE 'serials-menu.inc' %]
411 </div>
412 </div>
413
414 [% MACRO jsinclude BLOCK %]
415     <script type="text/javascript">
416         var subscriptionid = "[% subscriptionid | html %]";
417         var MSG_CLOSE_SUBSCRIPTION = _("Are you sure you want to close this subscription?");
418         var MSG_REOPEN_SUBSCRIPTION = _("Are you sure you want to reopen this subscription?");
419         var CONFIRM_DELETE_SUBSCRIPTION = _("Are you sure you want to delete this subscription?");
420     </script>
421     [% Asset.js("js/serials-toolbar.js") | $raw %]
422     [% INCLUDE 'datatables.inc' %]
423     <script type="text/javascript">
424         // the english words used in display purposes
425         var text = new Array(_("Number"),_("Volume"),_("Issue"),_("Month"),_("Week"),_("Starting with:"),_("Rollover at:"),_("Choose Hemisphere:"),_("Northern"),_("Southern",
426         "Autumn"),_("Winter"),_("Spring"),_("Summer"),_("Fall"),_("Season"),_("Year"));
427         $(document).ready(function() {
428             $("#subscription_description").tabs();
429             $("#renewsub").click(function(){
430                 popup([% subscriptionid | html %]);
431                 return false;
432             })
433
434             var table = $("#orders").dataTable($.extend(true, {}, dataTablesDefaults, {
435                 'bPaginate': false,
436                 'bAutoWidth': false,
437                 "aaSorting": [[ 4, "desc" ]],
438                 "aoColumnDefs": [
439                     { "aTargets": "title-string", "sType": "title-string" }
440                 ]
441             }));
442
443             $("#hide_received_orders").click(function(e){
444                 e.preventDefault();
445                 table.fnFilter( '.', 4, true ); // Not empty "Receive date" columns
446             });
447             $("#show_all_orders").click(function(e){
448                 e.preventDefault();
449                 table.fnFilter( '', 4 ); // Not filter, display all columns
450             });
451             $("#show_all_orders").click();
452
453
454         });
455     </script>
456 [% END %]
457
458 [% INCLUDE 'intranet-bottom.inc' %]