Bug 10649 - Upgrade DataTables and move scripts out of theme directory
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / acqui / invoices.tt
index 21147e5..584d787 100644 (file)
@@ -4,9 +4,7 @@
 <title>Koha &rsaquo; Acquisitions &rsaquo; Invoices</title>
 <link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
 [% INCLUDE 'doc-head-close.inc' %]
-<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.dataTables.min.js"></script>
-[% INCLUDE 'datatables-strings.inc' %]
-<script type="text/javascript" src="[% themelang %]/js/datatables.js"></script>
+[% INCLUDE 'datatables.inc' %]
 [% INCLUDE 'calendar.inc' %]
 <script type="text/javascript">
 //<![CDATA[
@@ -41,7 +39,7 @@ $(document).ready(function() {
     <div class="yui-b">
       <h1>Invoices</h1>
       [% IF ( do_search ) %]
-        [% IF ( results_loop ) %]
+        [% IF invoices %]
           <table id="resultst">
             <thead>
               <tr>
@@ -55,30 +53,33 @@ $(document).ready(function() {
               </tr>
             </thead>
             <tbody>
-              [% FOREACH result IN results_loop %]
+              [% FOREACH invoice IN invoices %]
                 <tr>
-                  <td>[% result.invoicenumber %]</td>
-                  <td>[% result.suppliername %]</td>
+                  <td><a href="/cgi-bin/koha/acqui/invoice.pl?invoiceid=[% invoice.invoiceid %]">[% invoice.invoicenumber %]</a></td>
+                  <td><a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% invoice.booksellerid %]">[% invoice.suppliername %]</a></td>
                   <td>
-                    [% IF (result.billingdate) %]
-                      [% result.billingdate | $KohaDates %]
+                    [% IF invoice.billingdate %]
+                      [% invoice.billingdate | $KohaDates %]
                     [% END %]
                   </td>
-                  <td>[% result.receivedbiblios %]</td>
-                  <td>[% result.receiveditems %]</td>
+                  <td>[% invoice.receivedbiblios %]</td>
+                  <td>[% invoice.receiveditems %]</td>
                   <td>
-                    [% IF ( result.closedate ) %]
-                      Closed on [% result.closedate | $KohaDates %]
+                    [% IF invoice.closedate %]
+                      Closed on [% invoice.closedate | $KohaDates %]
                     [% ELSE %]
                       Open
                     [% END %]
                   </td>
                   <td>
-                    <a href="/cgi-bin/koha/acqui/invoice.pl?invoiceid=[% result.invoiceid %]">Details</a> /
-                    [% IF ( result.closedate ) %]
-                      <a href="invoice.pl?op=reopen&invoiceid=[% result.invoiceid %]&referer=/cgi-bin/koha/acqui/invoices.pl%3Fop=do_search%26invoicenumber=[% invoicenumber %]%26supplier=[% supplier %]%26billingdatefrom=[% billingdatefrom %]%26billingdateto=[% billingdateto %]%26isbneanissn=[% isbneanissn %]%26title=[% title %]%26author=[% author %]%26publisher=[% publisher %]%26publicationyear=[% publicationyear %]%26branch=[% branch %]">Reopen</a>
+                    <a href="/cgi-bin/koha/acqui/invoice.pl?invoiceid=[% invoice.invoiceid %]">Details</a> /
+                    [% IF invoice.closedate %]
+                      <a href="invoice.pl?op=reopen&amp;invoiceid=[% invoice.invoiceid %]&amp;referer=/cgi-bin/koha/acqui/invoices.pl%3Fop=do_search%26invoicenumber=[% invoicenumber %]%26supplier=[% booksellerid %]%26billingdatefrom=[% billingdatefrom %]%26billingdateto=[% billingdateto %]%26isbneanissn=[% isbneanissn %]%26title=[% title %]%26author=[% author %]%26publisher=[% publisher %]%26publicationyear=[% publicationyear %]%26branch=[% branch %]">Reopen</a>
                     [% ELSE %]
-                      <a href="invoice.pl?op=close&invoiceid=[% result.invoiceid %]&referer=/cgi-bin/koha/acqui/invoices.pl%3Fop=do_search%26invoicenumber=[% invoicenumber %]%26supplier=[% supplier %]%26billingdatefrom=[% billingdatefrom %]%26billingdateto=[% billingdateto %]%26isbneanissn=[% isbneanissn %]%26title=[% title %]%26author=[% author %]%26publisher=[% publisher %]%26publicationyear=[% publicationyear %]%26branch=[% branch %]">Close</a>
+                      <a href="invoice.pl?op=close&amp;invoiceid=[% invoice.invoiceid %]&amp;referer=/cgi-bin/koha/acqui/invoices.pl%3Fop=do_search%26invoicenumber=[% invoicenumber %]%26supplier=[% booksellerid %]%26billingdatefrom=[% billingdatefrom %]%26billingdateto=[% billingdateto %]%26isbneanissn=[% isbneanissn %]%26title=[% title %]%26author=[% author %]%26publisher=[% publisher %]%26publicationyear=[% publicationyear %]%26branch=[% branch %]">Close</a>
+                    [% END %]
+                    [% UNLESS invoice.receivedbiblios || invoice.receiveditems %]
+                      / <a href="invoice.pl?op=delete&amp;invoiceid=[% invoice.invoiceid %]&amp;referer=/cgi-bin/koha/acqui/invoices.pl%3Fop=do_search%26invoicenumber=[% invoicenumber %]%26supplier=[% booksellerid %]%26billingdatefrom=[% billingdatefrom %]%26billingdateto=[% billingdateto %]%26isbneanissn=[% isbneanissn %]%26title=[% title %]%26author=[% author %]%26publisher=[% publisher %]%26publicationyear=[% publicationyear %]%26branch=[% branch %]">Delete</a>
                     [% END %]
                   </td>
                 </tr>
@@ -92,7 +93,7 @@ $(document).ready(function() {
               [% IF ( invoicenumber ) %]
                 <li>Invoice no.: [% invoicenumber %]</li>
               [% END %]
-              [% IF ( supplier ) %]
+              [% IF booksellerid %]
                 <li>Vendor: [% suppliername %]</li>
               [% END %]
               [% IF ( billingdatefrom ) %]
@@ -127,11 +128,11 @@ $(document).ready(function() {
                 <li>Publication year: [% publicationyear %]</li>
               [% END %]
               [% IF ( branch ) %]
-                <li>Branch: [% branchname %]</li>
+                <li>Library: [% branchname %]</li>
               [% END %]
             </ul>
           </p>
-        [% END %]<!-- results_loop -->
+        [% END %]<!-- invoices -->
       [% ELSE %]
         <p>Use the search form on the left to find invoices.</p>
       [% END %]<!-- do_search -->
@@ -147,14 +148,14 @@ $(document).ready(function() {
             <input type="text" id="invoicenumber" name="invoicenumber" value="[% invoicenumber %]" />
           </li>
           <li>
-            <label for="supplier">Supplier:</label>
-            <select id="supplier" name="supplier">
+            <label for="supplier">Vendor:</label>
+            <select id="supplier" name="supplierid">
               <option value="">All</option>
               [% FOREACH supplier IN suppliers_loop %]
                 [% IF ( supplier.selected ) %]
-                  <option selected="selected" value="[% supplier.supplierid %]">[% supplier.suppliername %]</option>
+                  <option selected="selected" value="[% supplier.booksellerid %]">[% supplier.suppliername %]</option>
                 [% ELSE %]
-                  <option value="[% supplier.supplierid %]">[% supplier.suppliername %]</option>
+                  <option value="[% supplier.booksellerid %]">[% supplier.suppliername %]</option>
                 [% END %]
               [% END %]
             </select>