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