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