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