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