Bug 8913 [Revised] Improve acquisitions navigation
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / acqui / supplier.tt
1 [% USE KohaDates %]
2 [% INCLUDE 'doc-head-open.inc' %]
3 <title>Koha &rsaquo; Vendor [% bookselname %]</title>
4 <link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
5 [% INCLUDE 'doc-head-close.inc' %]
6 <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.dataTables.min.js"></script>
7 [% INCLUDE 'datatables-strings.inc' %]
8 <script type="text/javascript" src="[% themelang %]/js/datatables.js"></script>
9
10 <script type="text/javascript">
11 //<![CDATA[
12 function confirm_deletion() {
13     if (confirm(_("Confirm deletion of this vendor ?"))) {
14         window.location="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid %]&op=delete";
15     }
16 }
17 function check(f) {
18 if (f.company.value == "") {
19     alert(_("You must specify a name for this vendor."));
20     return false;
21 }
22     f.submit();
23 }
24
25  $(document).ready(function() {
26     [% IF (dateformat == 'metric') %]
27         dt_add_type_uk_date();
28     [% END %]
29     var contractst = $("#contractst").dataTable($.extend(true, {}, dataTablesDefaults, {
30         "aoColumnDefs": [
31           { "aTargets": [ -1, -2 ], "bSortable": false, "bSearchable": false },
32           [% IF (dateformat == 'metric') %]
33             { "aTargets": [ 2, 3 ], "sType": "uk_date" },
34           [% END %]
35         ],
36         'bPaginate': false,
37         'bFilter': false,
38         'bInfo': false,
39     } ) );
40  });
41 //]]>
42 </script>
43 </head>
44 <body id="acq_supplier" class="acq">
45 [% INCLUDE 'header.inc' %]
46 [% INCLUDE 'acquisitions-search.inc' %]
47
48 <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>
49
50 <div id="doc3" class="yui-t2">
51
52 <div id="bd">
53     <div id="yui-main">
54     <div class="yui-b">
55     [% IF ( enter ) %]
56         [% IF ( booksellerid ) %]
57         <h1>Update: [% name %]</h1>
58     [% ELSE %]
59         <h1>Add vendor</h1>
60     [% END %]
61     [% END %]
62 [% UNLESS ( enter ) %][% INCLUDE 'acquisitions-toolbar.inc' %][% END %]
63 [% IF ( enter ) %]
64     <form action="updatesupplier.pl" name="updatesupplier" method="post">
65     <div class="yui-g">
66         <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
67         <fieldset class="rows">
68             <legend>Company details</legend>
69             <ol><li><label for="company" class="required">Name * </label>
70                 <input type="text" size="40" id="company" name="company" value="[% name %]" /></li>
71             <li><label for="company_postal">Postal address</label>
72                     <textarea id="company_postal" name="company_postal" cols="40" rows="3">[% postal %]</textarea></li>
73             <li><label for="physical">Physical address</label>
74                 <textarea id="physical" name="physical" cols="40" rows="3">[% address1 %][% address2 %][% address3 %][% address4 %]</textarea></li>
75             <li><label for="company_phone">Phone</label>
76                 <input type="text" size="20" id="company_phone" name="company_phone" value="[% phone %]" /></li>
77             <li><label for="company_fax">Fax</label>
78                 <input type="text" size="20" id="company_fax" name="company_fax" value="[% fax %]" /></li>
79             <li><label for="website">Website</label>
80                 <input type="text" size="40" id="website" name="website" value="[% url %]" /></li>
81             <li><label for="accountnumber">Account number</label>
82                 <input type="text" size="40" id="accountnumber" name="accountnumber" value="[% accountnumber %]" /></li></ol>
83         </fieldset>
84         <fieldset class="rows">
85             <legend>Contact details</legend>
86         <ol> <li><label for="company_contact_name">Contact name</label>
87                 <input type="text" size="40" id="company_contact_name" name="company_contact_name" value="[% contact %]" /></li>
88             <li><label for="company_contact_position">Position</label>
89                 <input type="text" size="40" id="company_contact_position" name="company_contact_position" value="[% contpos %]" /></li>
90             <li><label for="contact_phone">Phone</label>
91                 <input type="text" size="20" id="contact_phone" name="contact_phone" value="[% contphone %]" /> </li>
92             <li><label for="contact_phone_2">Alternative phone</label>
93                 <input type="text" size="20" id="contact_phone_2" name="contact_phone_2" value="[% contaltphone %]" /></li>
94             <li><label for="contact_fax">Fax</label>
95                 <input type="text" size="20" id="contact_fax" name="contact_fax" value="[% contfax %]" /></li>
96             <li><label for="company_email">Email</label>
97                 <input type="text" size="40" id="company_email" name="company_email" value="[% contemail %]" /></li>
98             <li><label for="contact_notes">Notes</label>
99                 <textarea id="contact_notes" name="contact_notes" cols="40" rows="4">[% contnotes %]</textarea></li></ol>
100         </fieldset>
101     </div>
102         <div class="yui-g">
103         <fieldset class="rows">
104             <legend>Ordering information</legend>
105             <ol class="radio"><li><label for="activestatus" class="radio">Vendor is:</label>
106                     [% IF ( active ) %]
107                         <label for="activestatus">Active</label> <input type="radio" id="activestatus" name="status" value="1" checked="checked" />
108                         <label for="inactivestatus">Inactive</label> <input type="radio" id="inactivestatus" name="status" value="0" />
109                     [% ELSE %]
110                         <label for="activestatus">Active</label> <input type="radio" id="activestatus" name="status" value="1" />
111                         <label for="inactivestatus">Inactive</label> <input type="radio" id="inactivestatus" name="status" value="0" checked="checked" />
112                     [% END %]</li>
113             </ol>
114             <ol>
115             <li><label for="list_currency">List prices are</label>
116                     <select name="list_currency" id="list_currency">
117                     [% FOREACH loop_currenc IN loop_currency %]
118                         [% IF ( loop_currenc.listprice ) %]<option value="[% loop_currenc.currency %]" selected="1">[% loop_currenc.currency %]</option>
119                         [% ELSE %]<option value="[% loop_currenc.currency %]">[% loop_currenc.currency %]</option>[% END %]
120                     [% END %]
121                     </select>
122             </li>
123             <li><label for="invoice_currency">Invoice prices are</label>
124                     <select name="invoice_currency" id="invoice_currency">
125                     [% FOREACH loop_currenc IN loop_currency %]
126                         [% IF ( loop_currenc.invoiceprice ) %]<option value="[% loop_currenc.currency %]" selected="1">[% loop_currenc.currency %]</option>
127                         [% ELSE %]<option value="[% loop_currenc.currency %]">[% loop_currenc.currency %]</option>[% END %]
128                     [% END %]
129                     </select>
130             </li>
131             </ol>
132             <ol class="radio">
133             <li><label for="gstyes" class="radio">Tax number registered:</label>
134                 [% IF ( gstreg ) %]
135                     <label for="gstyes">Yes</label> <input type="radio" name="gst" id="gstyes" value="1" checked="checked" />
136                     <label for="gstno">No</label> <input type="radio" name="gst" id="gstno" value="0" />
137                 [% ELSE %]
138                     <label for="gstyes">Yes</label> <input type="radio" name="gst" id="gstyes" value="1" />
139                     <label for="gstno">No</label> <input type="radio" name="gst" id="gstno" value="0" checked="checked" />
140                 [% END %]</li>
141             
142             <li><label for="list_gstyes" class="radio">List prices:</label>
143                 [% IF ( listincgst ) %]
144                     <label for="list_gstyes">Include tax</label> <input type="radio" id="list_gstyes" name="list_gst" value="1" checked="checked" />
145                     <label for="list_gstno">Don't include tax</label> <input type="radio" id="list_gstno" name="list_gst" value="0" />
146                 [% ELSE %]
147                     <label for="list_gstyes">Include tax</label> <input type="radio" id="list_gstyes" name="list_gst" value="1" />
148                     <label for="list_gstno">Don't include tax</label> <input type="radio" id="list_gstno" name="list_gst" value="0" checked="checked" />
149                 [% END %]</li>
150             
151             <li><label for="invoice_gstyes" class="radio">Invoice prices:</label>
152                 [% IF ( invoiceincgst ) %]
153                     <label for="invoice_gstyes">Include tax</label> <input type="radio" id="invoice_gstyes" name="invoice_gst" value="1" checked="checked" />
154                     <label for="invoice_gstno">Don't include tax</label> <input type="radio" id="invoice_gstno" name="invoice_gst" value="0" />
155                     [% ELSE %]
156                     <label for="invoice_gstyes">Include tax</label> <input type="radio" id="invoice_gstyes" name="invoice_gst" value="1" />
157                     <label for="invoice_gstno">Don't include tax</label> <input type="radio" id="invoice_gstno" name="invoice_gst" value="0" checked="checked" />
158                 [% END %]</li>
159             </ol>
160             [% IF gst_values %]
161                 <ol>
162                   <li>
163                     <label for="gst">Tax rate</label>
164                     <select name="gstrate" id="gstrate">
165                     [% FOREACH gst IN gst_values %]
166                       [% IF ( gstrate == gst.option ) %]
167                         <option value="[% gst.option %]" selected="selected">[% gst.option * 100 | format ("%.1f") %] %</option>
168                       [% ELSE %]
169                         <option value="[% gst.option %]">[% gst.option * 100 | format ("%.1f") %] %</option>
170                       [% END %]
171                     [% END %]
172                     </select>
173                   </li>
174                 </ol>
175             [% ELSE %]
176                 <input type="hidden" name="gstrate" value="0" />
177             [% END %]
178             <ol>
179             <li><label for="discount">Discount</label>
180                 <input type="text" size="6" id="discount" name="discount" value="[% discount | format ("%.1f") %]" />%</li>
181             <li>
182                 <label for="deliverytime">Delivery time</label>
183                 <input type="text" size="2" id="deliverytime" name="deliverytime" value="[% deliverytime %]" /> days
184             </li>
185             <li><label for="notes">Notes</label>
186                 <textarea cols="40" rows="4" id="notes" name="notes" >[% notes %]</textarea></li></ol>
187         </fieldset>
188         <fieldset class="action"><input type="button" value="Save" onclick="check(this.form);" /> [% IF ( booksellerid ) %]
189         <a class="cancel" href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid %]">[% ELSE %]<a class="cancel" href="/cgi-bin/koha/acqui/acqui-home.pl">
190         [% END %]Cancel</a></fieldset>
191         </div>
192     </form>
193 [% ELSE %]
194     <h1>[% name %]</h1>
195         <div class="yui-g">
196             <div id="supplier-company-details" class="yui-u first">
197                 <h2>Vendor details</h2>
198                 <p><span class="label">Company name: </span>[% name %]</p>
199                 <p><span class="label">Postal address: </span>[% postal %]</p>
200                 <p><span class="label">Physical address: </span>[% address1 %][% address2 %][% address3 %][% address4 %]</p>
201                 <p><span class="label">Phone: </span>[% phone %]</p>
202                 <p><span class="label">Fax: </span>[% fax %]</p>
203                 [% IF ( url ) %]
204                     <p><span class="label">Website: </span><a href="[% url %]">[% url %]</a></p>
205                 [% END %]
206                 [% IF ( accountnumber ) %]
207                     <p><span class="label">Account number: </span>[% accountnumber %]</p>
208                 [% END %]
209             </div>
210             <div id="supplier-contact-details" class="yui-u">
211                 <h2>Contact details</h2>
212                 <p><span class="label">Contact name: </span>[% contact %]</p>
213                 <p><span class="label">Position: </span>[% contpos %]</p>
214                 <p><span class="label">Phone: </span>[% contphone %]</p>
215                 <p><span class="label">Alternative phone: </span>[% contaltphone %]</p>
216                 <p><span class="label">Fax: </span>[% contfax %]</p>
217                 [% IF ( contemail ) %]
218                     <p><span class="label">Email: </span><a href="mailto:[% contemail %]">[% contemail %]</a></p>
219                 [% END %]
220                 [% IF ( contnotes ) %]
221                     <p><span class="label">Notes: </span>[% contnotes %]</p>
222                 [% END %]
223             </div>
224         </div>
225         <div id="supplier-ordering-information" class="yui-g">
226         <h3>Ordering information</h3>
227             <p><strong>Vendor is: </strong>
228                     [% IF ( active ) %]
229                         Active
230                     [% ELSE %]
231                         Inactive
232                     [% END %]</p>
233             <p><strong>List prices are: </strong>[% listprice %]</p>
234             <p><strong>Invoice prices are: </strong>[% invoiceprice %]</p>
235             [% IF ( gstrate ) %]<p><strong>Tax number registered: </strong>
236                     [% IF ( gstreg ) %]Yes[% ELSE %]No[% END %]</p>
237             <p><strong>List item price includes tax: </strong>
238                     [% IF ( listincgst ) %]Yes[% ELSE %]No[% END %]</p>
239             <p><strong>Invoice item price includes tax: </strong>
240                     [% IF ( invoiceincgst ) %]Yes[% ELSE %]No[% END %]</p>[% END %]
241             <p><strong>Discount: </strong>
242                 [% discount | format("%.1f") %] %</p>
243             <p><strong>Tax rate: </strong>
244                 [% 0 + gstrate * 100 | format("%.1f") %] %</p>
245             [% IF deliverytime.defined %]
246                 <p><strong>Delivery time: </strong>
247                     [% deliverytime %] days</p>
248             [% END %]
249             [% IF ( notes ) %]<p><strong>Notes: </strong>
250                 [% notes %]</p>[% END %]
251         </div>
252         [% IF ( contracts ) %]
253             <div id="supplier-contracts" class="yui-g">
254                 <h2>Contract(s)</h2>
255                 <table id="contractst">
256                   <thead>
257                     <tr>
258                         <th scope="col">Name</th>
259                         <th scope="col">Description</th>
260                         <th scope="col">Start date</th>
261                         <th scope="col">End date</th>
262                         <th scope="col">&nbsp; </th>
263                         <th scope="col">&nbsp; </th>
264                     </tr>
265                   </thead>
266                   <tbody>
267                     [% FOREACH contract IN contracts %]
268                         [% IF ( loop.even ) %]<tr class="highlight">[% ELSE %]<tr>[% END %]
269                         <td>
270                             <a href="/cgi-bin/koha/admin/aqcontract.pl?op=add_form&amp;contractnumber=[% contract.contractnumber %]&amp;booksellerid=[% contract.booksellerid %]">[% contract.contractname %]</a>
271                         </td>
272                         <td>[% contract.contractdescription %]</td>
273                         <td>[% contract.contractstartdate | $KohaDates %]</td>
274                         <td>[% contract.contractenddate | $KohaDates %]</td>
275                         <td><a href="/cgi-bin/koha/admin/aqcontract.pl?op=add_form&amp;contractnumber=[% contract.contractnumber %]&amp;booksellerid=[% contract.booksellerid %]">Edit</a></td>
276                         <td><a href="/cgi-bin/koha/admin/aqcontract.pl?op=delete_confirm&amp;contractnumber=[% contract.contractnumber %]&amp;booksellerid=[% contract.booksellerid %]">Delete</a></td>
277                         </tr>
278                     [% END %]
279                   </tbody>
280                 </table>
281             </div>
282         [% END %]
283
284 [% END %]
285
286 </div>
287 </div>
288 <div class="yui-b">
289 [% INCLUDE 'vendor-menu.inc' %]
290 </div>
291 </div>
292 [% INCLUDE 'intranet-bottom.inc' %]