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