Merge branch 'bug_8942' into 3.12-master
[koha_ffzg] / koha-tmpl / intranet-tmpl / prog / en / modules / acqui / supplier.tt
index 6ace8da..51ec129 100644 (file)
@@ -1,7 +1,12 @@
 [% USE KohaDates %]
 [% INCLUDE 'doc-head-open.inc' %]
 <title>Koha &rsaquo; Vendor [% bookselname %]</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>
+
 <script type="text/javascript">
 //<![CDATA[
 function confirm_deletion() {
@@ -16,6 +21,23 @@ if (f.company.value == "") {
 }
     f.submit();
 }
+
+ $(document).ready(function() {
+    [% IF (dateformat == 'metric') %]
+        dt_add_type_uk_date();
+    [% END %]
+    var contractst = $("#contractst").dataTable($.extend(true, {}, dataTablesDefaults, {
+        "aoColumnDefs": [
+          { "aTargets": [ -1, -2 ], "bSortable": false, "bSearchable": false },
+          [% IF (dateformat == 'metric') %]
+            { "aTargets": [ 2, 3 ], "sType": "uk_date" },
+          [% END %]
+        ],
+        'bPaginate': false,
+        'bFilter': false,
+        'bInfo': false,
+    } ) );
+ });
 //]]>
 </script>
 </head>
@@ -25,10 +47,11 @@ if (f.company.value == "") {
 
 <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; [% IF ( enter ) %][% IF ( booksellerid ) %] <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid %]">[% name %]</a> &rsaquo; Update: [% name %][% ELSE %]Add vendor[% END %] [% ELSE %][% name %][% END %]</div>
 
-<div id="doc" class="yui-t7">
+<div id="doc3" class="yui-t2">
 
 <div id="bd">
     <div id="yui-main">
+    <div class="yui-b">
     [% IF ( enter ) %]
         [% IF ( booksellerid ) %]
         <h1>Update: [% name %]</h1>
@@ -107,7 +130,7 @@ if (f.company.value == "") {
             </li>
             </ol>
             <ol class="radio">
-            <li><label for="gstyes" class="radio">Tax Number Registered:</label>
+            <li><label for="gstyes" class="radio">Tax number registered:</label>
                 [% IF ( gstreg ) %]
                     <label for="gstyes">Yes</label> <input type="radio" name="gst" id="gstyes" value="1" checked="checked" />
                     <label for="gstno">No</label> <input type="radio" name="gst" id="gstno" value="0" />
@@ -134,10 +157,31 @@ if (f.company.value == "") {
                     <label for="invoice_gstno">Don't include tax</label> <input type="radio" id="invoice_gstno" name="invoice_gst" value="0" checked="checked" />
                 [% END %]</li>
             </ol>
+            [% IF gst_values %]
+                <ol>
+                  <li>
+                    <label for="gst">Tax rate</label>
+                    <select name="gstrate" id="gstrate">
+                    [% FOREACH gst IN gst_values %]
+                      [% IF ( gstrate == gst.option ) %]
+                        <option value="[% gst.option %]" selected="selected">[% gst.option * 100 | format ("%.1f") %] %</option>
+                      [% ELSE %]
+                        <option value="[% gst.option %]">[% gst.option * 100 | format ("%.1f") %] %</option>
+                      [% END %]
+                    [% END %]
+                    </select>
+                  </li>
+                </ol>
+            [% ELSE %]
+                <input type="hidden" name="gstrate" value="0" />
+            [% END %]
             <ol>
             <li><label for="discount">Discount</label>
-                <input type="text" size="6" id="discount" name="discount" value="[% discount %]" />%</li>
-            <li><label for="gstrate">Tax rate</label><input type="text" name="gstrate" id="gstrate" size="6" value="[% gstrate %]"/>% (leave blank for default tax of [% default_gst_rate %]%)</li>
+                <input type="text" size="6" id="discount" name="discount" value="[% discount | format ("%.1f") %]" />%</li>
+            <li>
+                <label for="deliverytime">Delivery time</label>
+                <input type="text" size="2" id="deliverytime" name="deliverytime" value="[% deliverytime %]" /> days
+            </li>
             <li><label for="notes">Notes</label>
                 <textarea cols="40" rows="4" id="notes" name="notes" >[% notes %]</textarea></li></ol>
         </fieldset>
@@ -151,9 +195,9 @@ if (f.company.value == "") {
         <div class="yui-g">
             <div id="supplier-company-details" class="yui-u first">
                 <h2>Vendor details</h2>
-                <p><span class="label">Company Name: </span>[% name %]</p>
-                <p><span class="label">Postal Address: </span>[% postal %]</p>
-                <p><span class="label">Physical Address: </span>[% address1 %][% address2 %][% address3 %][% address4 %]</p>
+                <p><span class="label">Company name: </span>[% name %]</p>
+                <p><span class="label">Postal address: </span>[% postal %]</p>
+                <p><span class="label">Physical address: </span>[% address1 %][% address2 %][% address3 %][% address4 %]</p>
                 <p><span class="label">Phone: </span>[% phone %]</p>
                 <p><span class="label">Fax: </span>[% fax %]</p>
                 [% IF ( url ) %]
@@ -188,30 +232,38 @@ if (f.company.value == "") {
                     [% END %]</p>
             <p><strong>List prices are: </strong>[% listprice %]</p>
             <p><strong>Invoice prices are: </strong>[% invoiceprice %]</p>
-            [% IF ( GST ) %]<p><strong>Tax Number Registered: </strong>
+            [% IF ( gstrate ) %]<p><strong>Tax number registered: </strong>
                     [% IF ( gstreg ) %]Yes[% ELSE %]No[% END %]</p>
-            <p><strong>List Item Price Includes Tax: </strong>
+            <p><strong>List item price includes tax: </strong>
                     [% IF ( listincgst ) %]Yes[% ELSE %]No[% END %]</p>
-            <p><strong>Invoice Item Price Includes Tax: </strong>
+            <p><strong>Invoice item price includes tax: </strong>
                     [% IF ( invoiceincgst ) %]Yes[% ELSE %]No[% END %]</p>[% END %]
             <p><strong>Discount: </strong>
-                [% discount %] %</p>
+                [% discount | format("%.1f") %] %</p>
             <p><strong>Tax rate: </strong>
-                [% GST %]%[% UNLESS ( default_tax ) %] (default)[% END %]</p>
+                [% 0 + gstrate * 100 | format("%.1f") %] %</p>
+            [% IF deliverytime.defined %]
+                <p><strong>Delivery time: </strong>
+                    [% deliverytime %] days</p>
+            [% END %]
             [% IF ( notes ) %]<p><strong>Notes: </strong>
                 [% notes %]</p>[% END %]
         </div>
         [% IF ( contracts ) %]
             <div id="supplier-contracts" class="yui-g">
                 <h2>Contract(s)</h2>
-                <table>
+                <table id="contractst">
+                  <thead>
                     <tr>
                         <th scope="col">Name</th>
                         <th scope="col">Description</th>
                         <th scope="col">Start date</th>
                         <th scope="col">End date</th>
-                        <th scope="col" colspan="2">&nbsp; </th>
+                        <th scope="col">&nbsp; </th>
+                        <th scope="col">&nbsp; </th>
                     </tr>
+                  </thead>
+                  <tbody>
                     [% FOREACH contract IN contracts %]
                         [% IF ( loop.even ) %]<tr class="highlight">[% ELSE %]<tr>[% END %]
                         <td>
@@ -224,6 +276,7 @@ if (f.company.value == "") {
                         <td><a href="/cgi-bin/koha/admin/aqcontract.pl?op=delete_confirm&amp;contractnumber=[% contract.contractnumber %]&amp;booksellerid=[% contract.booksellerid %]">Delete</a></td>
                         </tr>
                     [% END %]
+                  </tbody>
                 </table>
             </div>
         [% END %]
@@ -232,4 +285,8 @@ if (f.company.value == "") {
 
 </div>
 </div>
+<div class="yui-b">
+[% INCLUDE 'vendor-menu.inc' %]
+</div>
+</div>
 [% INCLUDE 'intranet-bottom.inc' %]