Bug 21511: (RM follow-up) Use orders.count instead of new variable
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / serials / subscription-detail.tt
index 1afd0c1..a1a218a 100644 (file)
@@ -1,65 +1,44 @@
+[% USE raw %]
+[% USE Asset %]
+[% USE Koha %]
+[% USE KohaDates %]
+[% USE Branches %]
+[% USE AuthorisedValues %]
+[% USE Price %]
+[% USE ColumnsSettings %]
+[% SET footerjs = 1 %]
 [% INCLUDE 'doc-head-open.inc' %]
-<title>Koha &rsaquo; Serials &rsaquo; Details for subscription #[% subscriptionid %]</title>
+<title>Koha &rsaquo; Serials &rsaquo; Details for subscription #[% subscriptionid | html %]</title>
 [% INCLUDE 'doc-head-close.inc' %]
-<script type="text/javascript">
-//<![CDATA[
-// the english words used in display purposes
-var text = new Array(_("Number"),_("Volume"),_("Issue"),_("Month"),_("Week"),_("Starting with:"),_("Rollover at:"),_("Choose Hemisphere:"),_("Northern"),_("Southern",
-"Autumn"),_("Winter"),_("Spring"),_("Summer"),_("Fall"),_("Season"),_("Year"));
-
-
-// to display the options section
-function options(x,y,z){
-var textbox = '';
-    // alert("X: "+x+"Y: "+y+"Z: "+z);
-    if(x){
-        document.f.xfield.value = x;
-        if(y){
-            document.f.yfield.value = y;
-            if(z){
-                document.f.zfield.value = z;
-            }
-        }
-    }
-}
-
-function confirm_deletion() {
-    var is_confirmed = confirm(_("Are you sure you want to delete this subscription?"));
-    if (is_confirmed) {
-        window.location="subscription-detail.pl?subscriptionid=[% subscriptionid %]&op=del";
-    }
-}
-function popup(subscriptionid) {
-    newin=window.open("subscription-renew.pl?mode=popup&subscriptionid="+subscriptionid,'popup','width=590,height=440,toolbar=false,scrollbars=yes');
-}
-$(document).ready(function() {
-    $("#subscription_description").tabs();
-    $("#renewsub").click(function(){
-        popup([% subscriptionid %]);
-        return false;
-    })
-});
-//]]>
-</script>
+[% Asset.css("css/datatables.css") | $raw %]
 </head>
+
 <body id="ser_subscription-detail" class="ser">
 [% INCLUDE 'header.inc' %]
 [% INCLUDE 'serials-search.inc' %]
 
-<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 %]</div>
+<div id="breadcrumbs">
+    <a href="/cgi-bin/koha/mainpage.pl">Home</a>
+    &rsaquo; <a href="/cgi-bin/koha/serials/serials-home.pl">Serials</a>
+    [% UNLESS blocking_error %]&rsaquo; Details for subscription #[% subscriptionid | html %][% END %]
+</div>
+
+<div class="main container-fluid">
+    <div class="row">
+        <div class="col-sm-10 col-sm-push-2">
+            <main>
 
-<div id="doc3" class="yui-t2">
-   
-   <div id="bd">
-       <div id="yui-main">
-       <div class="yui-b">
        [% INCLUDE 'serials-toolbar.inc' %]
 
-    <h1>Subscription for [% bibliotitle %] </h1>
-    [% IF ( abouttoexpire ) %]<div class="dialog message">Subscription will expire [% enddate %]. <a href="#" id="renewsub">Renew this subscription</a>.</div>[% END %]
+    <h1>Subscription for [% bibliotitle | html %] [% IF closed %](closed)[% END %]</h1>
+    [% IF ( abouttoexpire ) %]
+      [% UNLESS closed %]
+        <div class="dialog message">Subscription will expire [% enddate | html %]. <a href="#" id="renewsub">Renew this subscription</a>.</div>
+      [% END %]
+    [% END %]
     [% IF ( NEEDSCONFIRMATION ) %]
     <div id="circ_needsconfirmation" class="dialog alert">
-                       <h3>Please Confirm Subscription deletion</h3>
+        <h3>Please confirm subscription deletion</h3>
 
                        <ul>
                        [% IF ( NOTEXPIRED ) %] <li>The subscription has not expired yet</li> [% END %] 
@@ -67,14 +46,14 @@ $(document).ready(function() {
                        [% IF ( LINKEDITEMS ) %] <li>The subscription has linked items<br /> Those items won't be deleted</li> [% END %]
                        </ul>
                        <form method="post" action="/cgi-bin/koha/serials/subscription-detail.pl">
-                       <input type="hidden" name="subscriptionid" value="[% subscriptionid %]" />
+                       <input type="hidden" name="subscriptionid" value="[% subscriptionid | html %]" />
                        <input type="hidden" name="issueconfirmed" value="1" />
                        <input type="hidden" name="op" value="del" />
-            <input type="submit" class="approve" value="Yes, delete (Y)" accesskey="y" />
+            <button type="submit" class="approve" accesskey="y"><i class="fa fa-fw fa-check"></i> Yes, delete (Y)</button>
                        </form>
                        <form method="get" action="/cgi-bin/koha/serials/subscription-detail.pl">
-                       <input type="hidden" name="subscriptionid" value="[% subscriptionid %]" />
-            <input type="submit" class="deny" value="No, don't delete (N)" accesskey="n" />
+                       <input type="hidden" name="subscriptionid" value="[% subscriptionid | html %]" />
+            <button type="submit" class="deny" accesskey="n"><i class="fa fa-fw fa-remove"></i> No, don't delete (N)</button>
                        </form>
 
        </div>
@@ -86,182 +65,153 @@ $(document).ready(function() {
     <li><a href="#subscription_planning">Planning</a></li>
     <li><a href="#subscription_issues">Issues</a></li>
     <li><a href="#subscription_summary">Summary</a></li>
+    [% IF orders.count %]
+        <li>
+            <a href="#acquisition_details">Acquisition details</a>
+        </li>
+    [% END %]
 </ul>
 
 <div id="subscription_info">
-    <div class="yui-g">
-    <div class="yui-u first">
+    <div class="row">
+    <div class="col-sm-6">
     <div class="rows">
                <ol>
-               <li><span class="label">Subscription ID: </span>[% subscriptionid %]</li>
-        <li><span class="label">Librarian identity:</span> [% librarian %]</li>
-        <li><span class="label">Vendor:</span> <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% aqbooksellerid %]">[% aqbooksellername %]</a></li>
-        <li><span class="label">Biblio:</span>  <a href="/cgi-bin/koha/catalogue/[% default_bib_view %].pl?biblionumber=[% bibnum %]">[% bibliotitle %]</a> <i>([% bibnum %])</i></li>
-[% IF ( branchcode ) %]<li><span class="label">Library:</span> [% branchcode %]</li>[% END %]
+               <li><span class="label">Subscription ID: </span>[% subscriptionid | html %]</li>
+        <li><span class="label">Librarian identity:</span> [% librarian | html %]</li>
+        <li><span class="label">Vendor:</span> <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% aqbooksellerid | html %]">[% aqbooksellername | html %]</a></li>
+        <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>
+        [% IF ( OPACBaseURL ) %]
+            <li>
+                <span class="label">OPAC view:</span>
+                <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>
+            </li>
+        [% END %]
+[% IF ( branchcode ) %]<li><span class="label">Library:</span> [% Branches.GetName( branchcode ) | html %]</li>[% END %]
         [% IF ( serialsadditems ) %]
             <li><span class="label">Items:</span> Serial receipt creates an item record.</li>
         [% ELSE %]
             <li><span class="label">Items:</span> Serial receipt does not create an item record.</li>
         [% END %]
-        <li><span class="label">Grace period:</span> [% graceperiod %]</li>
+        <li>
+            <span class="label">Serial number:</span>
+            [% IF skip_serialseq %]
+                Serial number is skipped when an irregularity is found.
+            [% ELSE %]
+                Serial number is kept when an irregularity is found.
+            [% END %]
+        </li>
+        <li><span class="label">Grace period:</span> [% graceperiod | html %]</li>
         </ol>
     </div>
     </div>
-    <div class="yui-u">
+    <div class="col-sm-6">
     <div class="rows">
         <ol>
-        [% IF ( location ) %]<li><span class="label">Location:</span> [% location %]</li>[% END %]
-        [% IF ( callnumber ) %]<li><span class="label">Call number:</span> [% callnumber %]</li>[% END %]
-               [% IF ( staffdisplaycount ) %]<li><span class="label">Number of issues to display to staff:</span>[% staffdisplaycount %]</li>[% END %]
-        [% IF ( opacdisplaycount ) %]<li><span class="label">Number of issues to display in OPAC:</span>[% opacdisplaycount %]</li>[% END %]
+        [% IF ( location ) %]<li><span class="label">Location:</span> [% location | html %]</li>[% END %]
+        [% IF ( callnumber ) %]<li><span class="label">Call number:</span> [% callnumber | html %]</li>[% END %]
+               [% IF ( staffdisplaycount ) %]<li><span class="label">Number of issues to display to staff:</span>[% staffdisplaycount | html %]</li>[% END %]
+        [% IF ( opacdisplaycount ) %]<li><span class="label">Number of issues to display in OPAC:</span>[% opacdisplaycount | html %]</li>[% END %]
         [% IF ( letter ) %]
             <li>
-                <span class="label">Patron notification:</span> [% letter %]
-                (<a href="/cgi-bin/koha/serials/viewalerts.pl?subscriptionid=[% subscriptionid %]">subscribers</a>)
+                <span class="label">Patron notification:</span> [% letter | html %]
+                (<a href="/cgi-bin/koha/serials/viewalerts.pl?subscriptionid=[% subscriptionid | html %]">subscribers</a>)
             </li>
         [% END %]
         [% IF ( hasRouting ) %]<li><span class="label">Routing:</span> yes</li>[% END %]
      </ol>
      </div>
      </div>
+     </div>
+
+    [% IF additional_fields_for_subscription %]
+    <hr>
+    <div class="row">
+      <div class="col-sm-6">
+        <h3>Additional fields:</h3>
+        <div class="rows">
+          <ol>
+            [% FOR field IN additional_fields_for_subscription %]
+              <li>
+                <span class="label">[% field.name | html %]:</span>
+                [% IF field.authorised_value_category %]
+                  [% AuthorisedValues.GetByCode( field.authorised_value_category, additional_fields.${field.name} ) | html %]
+                [% ELSE %]
+                  [% additional_fields.${field.name} | html %]
+                [% END %]
+              </li>
+            [% END %]
+          </ol>
+        </div>
+      </div>
+      </div>
+     [% END %]
 </div>
-</div>
+
     <div id="subscription_planning">
-    <div class="yui-g">
+    <div class="row">
+    <div class="col-sm-12">
     <div class="rows">
         <ol>
-            <li><span class="label">Beginning date:</span> [% startdate %]
+            <li><span class="label">Beginning date:</span> [% startdate | html %]
             </li>
-            <li><span class="label">Frequency (*):</span>
-                [% IF ( periodicity16 ) %]
-                        Without regularity
-                [% END %]
-                [% IF ( periodicity32 ) %]
-                        Irregular
-                [% END %]
-                [% IF ( periodicity0 ) %]
-                        Unknown
-                [% END %]
-                [% IF ( periodicity12 ) %]
-                        2/day
-                [% END %]
-                [% IF ( periodicity1 ) %]
-                        1/day
-                [% END %]
-                [% IF ( periodicity13 ) %]
-                        1/4 months (3/year)
-                [% END %]
-                [% IF ( periodicity2 ) %]
-                        1/week
-                [% END %]
-                [% IF ( periodicity3 ) %]
-                        1/2 weeks
-                [% END %]
-                [% IF ( periodicity4 ) %]
-                        1/3 weeks
-                [% END %]
-                [% IF ( periodicity5 ) %]
-                        1/month
-                [% END %]
-                [% IF ( periodicity6 ) %]
-                        1/2 months (6/year)
-                [% END %]
-                [% IF ( periodicity7 ) %]
-                        1/quarter
-                [% END %]
-                [% IF ( periodicity8 ) %]
-                        1/quarter
-                [% END %]
-                [% IF ( periodicity9 ) %]
-                        2/year
-                [% END %]
-                [% IF ( periodicity10 ) %]
-                        1/year
-                [% END %]
-                [% IF ( periodicity11 ) %]
-                        1/2 years
-                [% END %]
+            <li><span class="label">Frequency:</span>
+                [% frequency.description | html %]
             </li>
             <li>
               <span class="label">Manual history: </span>
                 [% IF ( manualhistory ) %]
-                    Disabled
+                    Enabled <a href="/cgi-bin/koha/serials/subscription-history.pl?subscriptionid=[% subscriptionid | html %]">Edit history</a>
                 [% ELSE %]
-                    Enabled
+                    Disabled
                 [% END %]
             </li>
             <li><span class="label">Number pattern:</span>
-                [% IF ( numberpattern1 ) %]
-                    Number only
-                [% END %]
-                [% IF ( numberpattern2 ) %]
-                    Volume, number, issue
-                [% END %]
-                [% IF ( numberpattern3 ) %]
-                    Volume, number
+                [% numberpattern.label | html %]
+            </li>
+            <li><table>
+            <tr>
+                <td>Starting with:</td>
+                [% IF (has_X) %]
+                    <td align="center">[% lastvalue1 | html %]</td>
                 [% END %]
-                [% IF ( numberpattern4 ) %]
-                    Volume, issue
+                [% IF (has_Y) %]
+                    <td align="center">[% lastvalue2 | html %]</td>
                 [% END %]
-                [% IF ( numberpattern5 ) %]
-                    Number, issue
+                [% IF (has_Z) %]
+                    <td align="center">[% lastvalue3 | html %]</td>
                 [% END %]
-                [% IF ( numberpattern8 ) %]
-                    Year/Number
+            </tr>
+            <tr>
+                <td>Rollover:</td>
+                [% IF (has_X) %]
+                    <td align="center">[% numberpattern.whenmorethan1 | html %]</td>
                 [% END %]
-                [% IF ( numberpattern6 ) %]
-                    Seasonal only
+                [% IF (has_Y) %]
+                    <td align="center">[% numberpattern.whenmorethan2 | html %]</td>
                 [% END %]
-                [% IF ( numberpattern7 ) %]
-                    None of the above
+                [% IF (has_Z) %]
+                    <td align="center">[% numberpattern.whenmorethan3 | html %]</td>
                 [% END %]
-            </li>
-            <li><table>
-            <tr><td>Starting with:</td>
-                <td align="center">[% lastvalue1 %]</td>
-            [% IF ( lastvalue2 ) %]
-                <td align="center">&nbsp; 
-                    [% lastvalue2 %]
-                </td>
-            [% END %]
-            [% IF ( lastvalue3 ) %]
-                <td align="center">&nbsp; 
-                    [% lastvalue3 %]
-                </td>
-            [% END %]
-            </tr>
-            <tr><td>Rollover:</td>
-                <td align="center">
-                    [% IF ( whenmorethan1 < 9999999 ) %][% whenmorethan1 %][% ELSE %]Never[% END %]
-                </td>
-            [% IF ( whenmorethan2 ) %]
-                <td align="center">&nbsp;
-                    [% IF ( whenmorethan2 < 9999999 ) %][% whenmorethan2 %][% ELSE %]Never[% END %]
-                </td>
-            [% END %]
-            [% IF ( whenmorethan3 ) %]
-                <td align="center">&nbsp;
-                    [% IF ( whenmorethan3 < 9999999 ) %][% whenmorethan3 %][% ELSE %]Never[% END %]
-                </td>
-            [% END %]
             </tr>
             </table></li>
             [% IF ( irregular_issues ) %]
-            <li><span class="label">Irregularity:</span> [% irregular_issues %] issues
+            <li><span class="label">Irregularity:</span> [% irregular_issues | html %] issues
             </li>
             [% END %]
-            <li><span class="label">First arrival:</span> [% firstacquidate %]
+            <li><span class="label">First arrival:</span> [% firstacquidate | html %]
             </li>
-        [% IF ( numberlength ) %]<li><span class="label">Number of issues:</span> [% numberlength %]</li>[% END %]
-        [% IF ( weeklength ) %]<li><span class="label">Number of weeks:</span> [% weeklength %]</li>[% END %]
-        [% IF ( monthlength ) %]<li><span class="label">Number of months:</span> [% monthlength %]</li>[% END %]
+        [% IF ( numberlength ) %]<li><span class="label">Number of issues:</span> [% numberlength | html %]</li>[% END %]
+        [% IF ( weeklength ) %]<li><span class="label">Number of weeks:</span> [% weeklength | html %]</li>[% END %]
+        [% IF ( monthlength ) %]<li><span class="label">Number of months:</span> [% monthlength | html %]</li>[% END %]
         </ol>
     </div>
     </div>
     </div>
+    </div>
     <div id="subscription_numbering" style="display:none;">
         <h3>Numbering calculation</h3>
-        <p><label>Numbering formula:</label> [% numberingmethod %]</p>
+        <p><label>Numbering formula:</label> [% numberingmethod | html %]</p>
         <table>
             <tr>
                 <th>&nbsp;</th>
@@ -272,51 +222,51 @@ $(document).ready(function() {
                 <tr>
                     <td>Add</td>
                     <td>
-                        [% add1 %]
+                        [% add1 | html %]
                     </td>
                     <td>
-                        [% add2 %]
+                        [% add2 | html %]
                     </td>
                     <td>
-                        [% add3 %]
+                        [% add3 | html %]
                     </td>
                 </tr>
                 <tr>
                     <td>once every</td>
-                    <td>[% every1 %]</td>
-                    <td>[% every2 %]</td>
-                    <td>[% every3 %]</td>
+                    <td>[% every1 | html %]</td>
+                    <td>[% every2 | html %]</td>
+                    <td>[% every3 | html %]</td>
                 </tr>
                 <tr>
                     <td>When more than</td>
-                    <td>[% whenmorethan1 %] [% IF ( innerloop1 ) %]<br />
-                        <i>(is [% innerloop1 %])</i>[% END %]</td>
-                    <td>[% whenmorethan2 %] [% IF ( innerloop2 ) %]<br />
-                        <i>(is [% innerloop2 %])</i>[% END %]</td>
-                    <td>[% whenmorethan3 %] [% IF ( innerloop3 ) %]<br />
-                        <i>(is [% innerloop3 %])</i>[% END %]</td>
+                    <td>[% whenmorethan1 | html %] [% IF ( innerloop1 ) %]<br />
+                        <i>(is [% innerloop1 | html %])</i>[% END %]</td>
+                    <td>[% whenmorethan2 | html %] [% IF ( innerloop2 ) %]<br />
+                        <i>(is [% innerloop2 | html %])</i>[% END %]</td>
+                    <td>[% whenmorethan3 | html %] [% IF ( innerloop3 ) %]<br />
+                        <i>(is [% innerloop3 | html %])</i>[% END %]</td>
                 </tr>
                 <tr>
                     <td>Set back to</td>
-                    <td>[% setto1 %]</td>
-                    <td>[% setto2 %]</td>
-                    <td>[% setto3 %]</td>
+                    <td>[% setto1 | html %]</td>
+                    <td>[% setto2 | html %]</td>
+                    <td>[% setto3 | html %]</td>
                 </tr>
                 <tr>
                     <td>
                             Inner counter
                     </td>
-                    <td>[% innerloop1 %]</td>
-                    <td>[% innerloop2 %]</td>
-                    <td>[% innerloop3 %]</td>
+                    <td>[% innerloop1 | html %]</td>
+                    <td>[% innerloop2 | html %]</td>
+                    <td>[% innerloop3 | html %]</td>
                 </tr>
                 <tr>
                     <td>
                             Last value
                     </td>
-                    <td>[% lastvalue1 %]</td>
-                    <td>[% lastvalue2 %]</td>
-                    <td>[% lastvalue3 %]</td>
+                    <td>[% lastvalue1 | html %]</td>
+                    <td>[% lastvalue2 | html %]</td>
+                    <td>[% lastvalue3 | html %]</td>
                 </tr>
             </table>
     </div>
@@ -326,70 +276,205 @@ $(document).ready(function() {
             <th>Issue number</th>
             <th>Planned date</th>
             <th>Published date</th>
+            <th>Published date (text)</th>
             <th>Status</th>
         </tr>
         [% FOREACH serialslis IN serialslist %]
             <tr>
                 <td>
-                    [% serialslis.serialseq %]
+                    [% serialslis.serialseq | html %]
                 </td>
                 <td>
-                    [% serialslis.planneddate %]
+                    [% IF serialslis.planneddate %]
+                      [% serialslis.planneddate | html %]
+                    [% ELSE %]
+                      Unknown
+                    [% END %]
                 </td>
                 <td>
-                    [% serialslis.publisheddate %]
+                    [% IF serialslis.publisheddate %]
+                      [% serialslis.publisheddate | html %]
+                    [% ELSE %]
+                      Unknown
+                    [% END %]
                 </td>
                 <td>
-                        [% IF ( serialslis.status1 ) %]
-                            Expected
-                        [% END %]
-                        [% IF ( serialslis.status2 ) %]
-                            Arrived
-                        [% END %]
-                        [% IF ( serialslis.status3 ) %]
-                            Late
-                        [% END %]
-                        [% IF ( serialslis.status4 ) %]
-                            Missing
-                        [% END %]
-                        [% IF ( serialslis.status5 ) %]
-                            Not available
-                        [% END %]
-                        [% IF ( serialslis.status7 ) %]
-                            Claimed
-                             [% IF ( serialslis.claimdate ) %]
-                             [% serialslis.claimdate %]
-                             [% END %]
-                        [% END %]
+                    [% serialslis.publisheddatetext | html %]
+                </td>
+                <td>
+                    [% IF ( serialslis.status1 ) %]Expected[% END %]
+                    [% IF ( serialslis.status2 ) %]Arrived[% END %]
+                    [% IF ( serialslis.status3 ) %]Late[% END %]
+                    [% IF ( serialslis.status4 ) %]Missing[% END %]
+                    [% IF ( serialslis.status41 ) %]Missing (never received)[% END %]
+                    [% IF ( serialslis.status42 ) %]Missing (sold out)[% END %]
+                    [% IF ( serialslis.status43 ) %]Missing (damaged)[% END %]
+                    [% IF ( serialslis.status44 ) %]Missing (lost)[% END %]
+                    [% IF ( serialslis.status5 ) %]Not issued[% END %]
+                    [% IF ( serialslis.status6 ) %]Delete[% END %]
+                    [% IF ( serialslis.status7 ) %]
+                      Claimed
+                      [% IF ( serialslis.claimdate ) %]
+                        [% serialslis.claimdate | html %]
+                      [% END %]
+                    [% END %]
+                    [% IF ( serialslis.status8 ) %]Stopped[% END %]
                 </td>
             </tr>
         [% END %]
         </table>
     </div>
     <div id="subscription_summary">
-    <div class="yui-g">
+    <div class="row">
+    <div class="col-sm-12">
     <div class="rows">
         <ol>
-            <li><span class="label">Start date:</span> [% startdate %] </li>
-            <li><span class="label">End date:</span> [% enddate %]</li>
-            <li><span class="label">History start date:</span> [% histstartdate %] </li>
-            <li><span class="label">History end date:</span> [% histenddate %]</li>
-            <li><span class="label">Received issues:</span>[% recievedlist %]</li>
-            <li><span class="label">Missing issues:</span>[% missinglist %]</li>
-            <li><span class="label">Nonpublic note:</span>[% internalnotes FILTER html_line_break %]</li>
-            <li><span class="label">Public note:</span>[% notes FILTER html_line_break %]</li>
-            <li><span class="label">History staff note</span>[% librariannote FILTER html_line_break %]</li>
-            <li><span class="label">History OPAC note</span>[% opacnote FILTER html_line_break %]</li>
+            <li><span class="label">Start date:</span> [% startdate | html %] </li>
+            <li><span class="label">End date:</span> [% enddate | html %]</li>
+            <li><span class="label">History start date:</span> [% histstartdate | html %] </li>
+            <li><span class="label">History end date:</span> [% histenddate | html %]</li>
+            <li><span class="label">Received issues:</span>[% recievedlist | html %]</li>
+            <li><span class="label">Missing issues:</span>[% missinglist | html %]</li>
+            <li><span class="label">Nonpublic note:</span>[% internalnotes FILTER html_line_break | html %]</li>
+            <li><span class="label">Public note:</span>[% notes FILTER html_line_break | html %]</li>
+            <li><span class="label">History staff note:</span>[% librariannote FILTER html_line_break | html %]</li>
+            <li><span class="label">History OPAC note:</span>[% opacnote FILTER html_line_break | html %]</li>
         </ol>
     </div>
     </div>
     </div>
     </div>
-</div>
-</div>
 
-<div class="yui-b">
-[% INCLUDE 'serials-menu.inc' %]
-</div>
-</div>
+    [% IF orders.count %]
+        <div id="acquisition_details">
+            <h2>Acquisition details</h2>
+            <table id="orders">
+                <caption>
+                  <span class="actions">
+                  <a href="#" id="hide_received_orders">Hide already received orders</a>
+                  | <a href="#" id="show_all_orders">Show all orders</a></span>
+                </caption>
+
+                <thead>
+                    <tr>
+                        <th>Invoice</th>
+                        <th>Basket</th>
+                        <th>Order number</th>
+                        <th class="title-string">Creation date</th>
+                        <th class="title-string">Receive date</th>
+                        <th class="title-string">Status</th>
+                        <th>Internal note</th>
+                        <th>Vendor note</th>
+                        <th>Fund</th>
+                        <th title="ecost tax exc. / ecost tax inc.">Ordered</th>
+                        <th title="Actual cost tax exc. / Actual cost tax inc.">Spent</th>
+                    </tr>
+                </thead>
+                <tbody>
+                [% FOR order IN orders %]
+                    <tr>
+                        <td>
+                        [% IF order.invoice %]
+                            [% IF CAN_user_acquisition %]
+                                <a href="/cgi-bin/koha/acqui/invoice.pl?invoiceid=[% order.invoiceid | html %]" title="Invoice detail page">
+                                   [% order.invoice.invoicenumber | html %]</a>
+                            [% ELSE %]
+                                [% order.invoice.invoicenumber | html %]
+                            [% END %]
+                        [% END %]
+                        </td>
+                        <td>[% IF CAN_user_acquisition_order_manage %]
+                            <a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% order.basketno | uri %]">[% order.basket.basketname | html %] ([% order.basketno | html %])</a>
+                        [% ELSE %]
+                            [% order.basket.basketname | html %] ([% order.basketno | html %])
+                        [% END %]</td>
+                        <td>[% order.ordernumber | html %]</td>
+                        <td><span title="[% order.basket.creationdate | uri %]">[% order.basket.creationdate | $KohaDates%]</span></td>
+                        <td>[% IF order.datereceived %]<span title="[% order.datereceived | uri %]">[% order.datereceived | $KohaDates %]</span>[% END %]</td>
+                        <td>
+                          [% SWITCH order.orderstatus %]
+                            [% CASE 'new' %]<span title="status_1">New</span>
+                            [% CASE 'ordered' %]<span title="status_2">Ordered</span>
+                            [% CASE 'partial' %]<span title="status_3">Partial</span>
+                            [% CASE 'complete' %]<span title="status_4">Complete</span>
+                            [% CASE 'cancelled' %]<span title="status_5">Cancelled</span>
+                          [% END %]
+                        </td>
+                        <td>[% order.order_internalnote | html %]</td>
+                        <td>[% order.order_vendornote | html %]</td>
+                        <td>[% order.fund.budget_name | html %]</td>
+                        <td>
+                            [% UNLESS order.datereceived %]
+                                [% order.ecost_tax_excluded | $Price %] / [% order.ecost_tax_included | $Price %]
+                            [% END %]
+                        </td>
+                        <td>
+                            [% IF order.datereceived %]
+                                [%# FIXME What if unitprice has not been filled? %]
+                                [% order.unitprice_tax_excluded | $Price %] / [% order.unitprice_tax_included | $Price %]
+                            [% END %]
+                        </td>
+                    </tr>
+                [% END %]
+                </tbody>
+            </table>
+          </div>
+      [% END %]
+
+            </main>
+        </div> <!-- /.col-sm-10.col-sm-push-2 -->
+
+        <div class="col-sm-2 col-sm-pull-10">
+            <aside>
+                [% INCLUDE 'serials-menu.inc' %]
+            </aside>
+        </div> <!-- /.col-sm-2.col-sm-pull-10 -->
+     </div> <!-- /.row -->
+
+[% MACRO jsinclude BLOCK %]
+    <script>
+        var subscriptionid = "[% subscriptionid | html %]";
+        var MSG_CLOSE_SUBSCRIPTION = _("Are you sure you want to close this subscription?");
+        var MSG_REOPEN_SUBSCRIPTION = _("Are you sure you want to reopen this subscription?");
+        var CONFIRM_DELETE_SUBSCRIPTION = _("Are you sure you want to delete this subscription?");
+    </script>
+    [% Asset.js("js/serials-toolbar.js") | $raw %]
+    [% INCLUDE 'datatables.inc' %]
+    [% INCLUDE 'columns_settings.inc' %]
+    <script>
+        // the english words used in display purposes
+        var text = new Array(_("Number"),_("Volume"),_("Issue"),_("Month"),_("Week"),_("Starting with:"),_("Rollover at:"),_("Choose Hemisphere:"),_("Northern"),_("Southern",
+        "Autumn"),_("Winter"),_("Spring"),_("Summer"),_("Fall"),_("Season"),_("Year"));
+        $(document).ready(function() {
+            $("#subscription_description").tabs();
+            $("#renewsub").click(function(){
+                popup([% subscriptionid | html %]);
+                return false;
+            })
+
+            var columns_settings = [% ColumnsSettings.GetColumns( 'serials', 'subscription-detail', 'orders', 'json' ) | $raw %];
+            var table = KohaTable("orders", {
+                'bPaginate': false,
+                'bAutoWidth': false,
+                "aaSorting": [[ 5, "asc" ], [ 2, "desc" ]], // Order by status then ordernumber
+                "aoColumnDefs": [
+                    { "aTargets": "title-string", "sType": "title-string" }
+                ]
+            }, columns_settings);
+
+            $("#hide_received_orders").click(function(e){
+                e.preventDefault();
+                table.fnFilter( '^$', 4, true ); // Not empty "Receive date" columns
+            });
+            $("#show_all_orders").click(function(e){
+                e.preventDefault();
+                table.fnFilter( '', 4 ); // Not filter, display all columns
+            });
+            $("#show_all_orders").click();
+
+
+        });
+    </script>
+[% END %]
+
 [% INCLUDE 'intranet-bottom.inc' %]