Bug 19166: (follow-up) Adjust table and files and QA issues
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / acqui / ordered.tt
index 018d807..f1418cd 100644 (file)
@@ -1,13 +1,18 @@
+[% USE Asset %]
 [% USE KohaDates %]
+[% USE ItemTypes %]
+[% SET footerjs = 1 %]
 [% INCLUDE 'doc-head-open.inc' %]
 <title>Koha &rsaquo; Acquisitions &rsaquo; Ordered</title>
+[% Asset.css("css/datatables.css") %]
 [% INCLUDE 'doc-head-close.inc' %]
 </head>
-<body>
+
+<body id="acq_ordered" class="acq">
 [% INCLUDE 'header.inc' %]
 [% INCLUDE 'acquisitions-search.inc' %]
 
-<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a> &rsaquo; Ordered - [% fund %]</div>
+<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a> &rsaquo; Ordered - [% fund_code %]</div>
 
 <div id="doc3" class="yui-t2">
 
     <div id="yui-main">
         <div class="yui-b">
 
-<h1>Bookfunds</h1>
-<h2>Ordered - [% fund %]</h2>
+<h1>Fund: [% fund_code %]</h1>
+<h2>Ordered</h2>
 
-<table cellspacing="0" cellpadding="0" border="0" id="spent" class="collapse">
+<table id="spent">
     <thead>
     <tr>
-        <th> Title </th>
+    <th class="anti-the"> Title </th>
        <th> Order </th>
        <th> Vendor </th>
-       <th> Itemtype </th>
-       <th> Left on Order </th>
+    <th> Item type </th>
+    <th> Left on order </th>
        <th> Estimated cost per unit </th>
-       <th> Date Ordered </th>
+    <th class="title-string"> Date ordered </th>
        <th> Subtotal </th>
     </tr>
     </thead>
-
+    <tbody>
 [% FOREACH order IN ordered %]
-    [% IF loop.odd %]
-        <tr class="highlight">
-    [% ELSE %]
-        <tr>
-    [% END %]
+    <tr>
        <td class="cell">
+            <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% order.biblionumber %]">
            [% order.title %]
+            </a>
        </td>
        <td class="cell">
-           <a href="/cgi-bin/koha/acqui/neworderempty.pl?ordernumber=[% order.ordernumber %]&booksellerid=[% order.booksellerid %]&basketno=[% order.basketno %]">[% order.ordernumber %]</a>
+        [% IF ( CAN_user_acquisition_order_manage ) %]
+            <a href="/cgi-bin/koha/acqui/neworderempty.pl?ordernumber=[% order.ordernumber %]&amp;booksellerid=[% order.booksellerid %]&amp;basketno=[% order.basketno %]">[% order.ordernumber %]</a>
+        [% ELSE %]
+            [% order.ordernumber %]
+        [% END %]
        </td>
        <td class="cell">
-           <a href="/cgi-bin/koha/acqui/supplier.pl?supplierid=[% order.booksellerid %]">[% order.booksellerid %]</a>
+           <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% order.booksellerid %]">[% order.booksellerid %]</a>
        </td>
        <td class="cell">
-           [% order.itype %]
+        [% ItemTypes.GetDescription( order.itype ) %]
        </td>
        <td class="cell">
            [% order.left %]
        </td>
-       <td class="cell" align="right">
+    <td class="data cell">
            [% order.ecost %]
        </td>
-       <td class="cell">
-           [% order.entrydate | $KohaDates %]
+    <td class="cell">
+        <span title="[% order.entrydate %]">[% order.entrydate | $KohaDates %]</span>
        </td>
-       <td class="cell" align="right">
+    <td class="data cell">
            [% order.subtotal %]
        </td>
     </tr>
 [% END %]
-
+    </tbody>
     <tfoot>
+    [% IF ( adjustments && adjustments.count > 0 ) %]
+            [% FOREACH adjustment IN adjustments %]
+                <tr>
+                    <td></td>
+                    <td colspan="6">Adjustment cost for invoice [% adjustment.invoiceid %]</td>
+                    <td class="data total">[% adjustment.adjustment %]</td>
+                </tr>
+            [% END %]
+
+    [% END %]
     <tr>
         <td> Total </td>
         <td> </td>
@@ -74,7 +91,7 @@
         <td> </td>
         <td> </td>
        <td> </td>
-        <td align="right">
+        <td class="data">
             [% total %]
         </td>
     </tr>
 [% INCLUDE 'acquisitions-menu.inc' %]
 </div>
 </div>
+
+[% MACRO jsinclude BLOCK %]
+    [% Asset.js("js/acquisitions-menu.js") %]
+    [% INCLUDE 'datatables.inc' %]
+    <script type="text/javascript">
+        $(document).ready(function() {
+            $("#spent").dataTable($.extend(true, {}, dataTablesDefaults, {
+                "aoColumnDefs": [
+                    { "sType": "anti-the", "aTargets" : [ "anti-the" ] },
+                    { "sType": "title-string", "aTargets" : [ "title-string" ] }
+                ],
+                "sPaginationType": "four_button"
+            }));
+        });
+    </script>
+[% END %]
+
 [% INCLUDE 'intranet-bottom.inc' %]