4 [% BLOCK edit_contact %]
6 <input type="hidden" name="contact_id" value="[% contact.id | html %]" />
7 <li><label for="contact_name[% contact.id | html %]">Contact name: </label>
8 <input type="text" size="40" id="contact_name[% contact.id | html %]" name="contact_name" value="[% contact.name | html %]" /></li>
9 <li><label for="contact_position[% contact.id | html %]">Position: </label>
10 <input type="text" size="40" id="contact_position[% contact.id | html %]" name="contact_position" value="[% contact.position | html %]" /></li>
11 <li><label for="contact_phone[% contact.id | html %]">Phone: </label>
12 <input type="text" size="20" id="contact_phone[% contact.id | html %]" name="contact_phone" value="[% contact.phone | html %]" /> </li>
13 <li><label for="contact_altphone[% contact.id | html %]">Alternative phone: </label>
14 <input type="text" size="20" id="contact_altphone[% contact.id | html %]" name="contact_altphone" value="[% contact.altphone | html %]" /></li>
15 <li><label for="contact_fax[% contact.id | html %]">Fax: </label>
16 <input type="text" size="20" id="contact_fax[% contact.id | html %]" name="contact_fax" value="[% contact.fax | html %]" /></li>
17 <li><label for="contact_email[% contact.id | html %]">Email: </label>
18 <input type="text" size="40" id="contact_email[% contact.id | html %]" name="contact_email" value="[% contact.email | html %]" class="email" /></li>
19 <li><label for="contact_notes[% contact.id | html %]">Notes: </label>
20 <textarea id="contact_notes[% contact.id | html %]" name="contact_notes" cols="40" rows="4">[% contact.notes | html %]</textarea></li>
21 <li><label for="contact_acqprimary[% contact.id | html %]">Primary acquisitions contact:</label>
22 [% IF contact.acqprimary %]
23 <input type="checkbox" id="contact_acqprimary[% contact.id | html %]" class="contact_acqprimary" checked="checked"></input>
25 <input type="checkbox" id="contact_acqprimary[% contact.id | html %]" class="contact_acqprimary"></input>
27 <input type="hidden" class="contact_acqprimary_hidden" name="contact_acqprimary" value="[% contact.acqprimary | html %]"></input>
28 <li><label for="contact_serialsprimary[% contact.id | html %]">Primary serials contact:</label>
29 [% IF contact.serialsprimary %]
30 <input type="checkbox" id="contact_serialsprimary[% contact.id | html %]" class="contact_serialsprimary" checked="checked"></input>
32 <input type="checkbox" id="contact_serialsprimary[% contact.id | html %]" class="contact_serialsprimary"></input>
34 <input type="hidden" class="contact_serialsprimary_hidden" name="contact_serialsprimary" value="[% contact.serialsprimary | html %]"></input>
35 <li><label for="contact_orderacquisition[% contact.id | html %]">Contact when ordering?</label>
36 [% IF contact.orderacquisition %]
37 <input type="checkbox" id="contact_orderacquisition[% contact.id | html %]" class="contact_orderacquisition" checked="checked"></input>
39 <input type="checkbox" id="contact_orderacquisition[% contact.id | html %]" class="contact_orderacquisition"></input>
41 <input type="hidden" class="contact_orderacquisition_hidden" name="contact_orderacquisition" value="[% contact.orderacquisition | html %]"></input>
42 <li><label for="contact_claimacquisition[% contact.id | html %]">Contact about late orders?</label>
43 [% IF contact.claimacquisition %]
44 <input type="checkbox" id="contact_claimacquisition[% contact.id | html %]" class="contact_claimacquisition" checked="checked"></input>
46 <input type="checkbox" id="contact_claimacquisition[% contact.id | html %]" class="contact_claimacquisition"></input>
48 <input type="hidden" class="contact_claimacquisition_hidden" name="contact_claimacquisition" value="[% contact.claimacquisition | html %]"></input>
49 <li><label for="contact_claimissues[% contact.id | html %]">Contact about late issues?</label>
50 [% IF contact.claimissues %]
51 <input type="checkbox" id="contact_claimissues[% contact.id | html %]" class="contact_claimissues" checked="checked"></input>
53 <input type="checkbox" id="contact_claimissues[% contact.id | html %]" class="contact_claimissues"></input>
55 <input type="hidden" class="contact_claimissues_hidden" name="contact_claimissues" value="[% contact.claimissues | html %]"></input>
57 [% IF contact.id %]<li><button class="btn btn-default delete-contact"><i class="fa fa-trash"></i> Delete contact</li>[% END %]
61 [% BLOCK show_contact %]
62 <h3>[% contact.name | html %]</h3>
63 <p><span class="label">Position: </span>[% contact.position | html %]</p>
64 <p><span class="label">Phone: </span>[% contact.phone | html %]</p>
65 <p><span class="label">Alternative phone: </span>[% contact.altphone | html %]</p>
66 <p><span class="label">Fax: </span>[% contact.fax | html %]</p>
67 [% IF ( contact.email ) %]
68 <p><span class="label">Email: </span><a href="mailto:[% contact.email | uri %]">[% contact.email | html %]</a></p>
70 [% IF ( contact.notes ) %]
71 <p><span class="label">Notes: </span>[% contact.notes | html %]</p>
73 [% IF ( contact.acqprimary ) %]
74 <p><span class="label">Primary acquisitions contact</span></p>
76 [% IF ( contact.serialsprimary ) %]
77 <p><span class="label">Primary serials contact</span></p>
79 [% IF ( contact.orderacquisition ) %]
80 <p><span class="label">Receives orders</span></p>
82 [% IF ( contact.claimacquisition ) %]
83 <p><span class="label">Receives claims for late orders</span></p>
85 [% IF ( contact.claimissues ) %]
86 <p><span class="label">Receives claims for late issues</span></p>
90 [% SET footerjs = 1 %]
91 [% INCLUDE 'doc-head-open.inc' %]
92 <title>Koha › Vendor [% name | html %]</title>
93 [% Asset.css("css/datatables.css") | $raw %]
94 [% INCLUDE 'doc-head-close.inc' %]
97 <body id="acq_supplier" class="acq">
98 [% INCLUDE 'header.inc' %]
99 [% INCLUDE 'acquisitions-search.inc' %]
101 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a> › [% IF ( enter ) %][% IF ( booksellerid ) %] <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | html %]">[% name | html %]</a> › Update: [% name | html %][% ELSE %]Add vendor[% END %] [% ELSE %][% name | html %][% END %]</div>
103 <div class="main container-fluid">
105 <div class="col-sm-10 col-sm-push-2">
109 [% IF ( booksellerid ) %]
110 <h1>Update: [% name | html %]</h1>
115 [% UNLESS ( enter ) %][% INCLUDE 'acquisitions-toolbar.inc' %][% END %]
117 <form action="updatesupplier.pl" name="updatesupplier" class="validated" method="post">
118 <div id="toolbar" class="btn-toolbar">
119 <button class="btn btn-default btn-sm" type="submit"><i class="fa fa-save"></i> Save</button>
120 [% IF ( booksellerid ) %]
121 <a class="btn btn-default btn-sm cancel" href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | html %]">
123 <a class="btn btn-default btn-sm cancel" href="/cgi-bin/koha/acqui/acqui-home.pl">
124 [% END %] <i class="fa fa-remove"></i> Cancel</a>
127 <input type="hidden" name="booksellerid" value="[% booksellerid | html %]" />
128 <fieldset class="rows">
129 <legend>Company details</legend>
130 <ol><li><label for="company" class="required">Name:</label>
131 <input type="text" size="40" id="company" name="company" value="[% name | html %]" required="required" class="required" /><span class="required">Required</span></li>
132 <li><label for="company_postal">Postal address: </label>
133 <textarea id="company_postal" name="company_postal" cols="40" rows="3">[% postal | html %]</textarea></li>
134 <li><label for="physical">Physical address: </label>
135 <textarea id="physical" name="physical" cols="40" rows="3">[% address1 | html %][% address2 | html %][% address3 | html %][% address4 | html %]</textarea></li>
136 <li><label for="company_phone">Phone: </label>
137 <input type="text" size="20" id="company_phone" name="company_phone" value="[% phone | html %]" /></li>
138 <li><label for="company_fax">Fax: </label>
139 <input type="text" size="20" id="company_fax" name="company_fax" value="[% fax | html %]" /></li>
140 <li><label for="website">Website: </label>
141 <input type="text" size="40" id="website" name="website" value="[% url | html %]" class="url" /></li>
142 <li><label for="accountnumber">Account number: </label>
143 <input type="text" size="40" id="accountnumber" name="accountnumber" value="[% accountnumber | html %]" /></li></ol>
145 <fieldset class="rows">
146 <legend>Contacts</legend>
147 <fieldset id="contact-template" class="supplier-contact">
148 <legend>Contact details</legend>
149 [% INCLUDE edit_contact %]
151 [% FOREACH contact IN contacts %]
152 <fieldset class="supplier-contact">
153 <legend>Contact details</legend>
154 [% INCLUDE edit_contact %]
157 <button id="add-contact" class="btn btn-default"><i class="fa fa-plus"></i> Add another contact</button>
160 <fieldset class="rows">
161 <legend>Ordering information</legend>
162 <ol class="radio"><li><label for="activestatus" class="radio">Vendor is:</label>
164 <label for="activestatus">Active</label> <input type="radio" id="activestatus" name="status" value="1" checked="checked" />
165 <label for="inactivestatus">Inactive</label> <input type="radio" id="inactivestatus" name="status" value="0" />
167 <label for="activestatus">Active</label> <input type="radio" id="activestatus" name="status" value="1" />
168 <label for="inactivestatus">Inactive</label> <input type="radio" id="inactivestatus" name="status" value="0" checked="checked" />
172 <li><label for="list_currency">List prices are: </label>
173 <select name="list_currency" id="list_currency">
174 [% FOREACH c IN currencies %]
175 [% IF booksellerid and c.currency == listprice or not booksellerid and c.active %]
176 <option value="[% c.currency | html %]" selected="selected">[% c.currency | html %]</option>
177 [% ELSIF not c.archived %]
178 <option value="[% c.currency | html %]">[% c.currency | html %]</option>
183 <li><label for="invoice_currency">Invoice prices are: </label>
184 <select name="invoice_currency" id="invoice_currency">
185 [% FOREACH c IN currencies %]
186 [% IF booksellerid and c.currency == invoiceprice or not booksellerid and c.active %]
187 <option value="[% c.currency | html %]" selected="selected">[% c.currency | html %]</option>
188 [% ELSIF not c.archived %]
189 <option value="[% c.currency | html %]">[% c.currency | html %]</option>
196 <li><label for="gstyes" class="radio">Tax number registered:</label>
198 <label for="gstyes">Yes</label> <input type="radio" name="gst" id="gstyes" value="1" checked="checked" />
199 <label for="gstno">No</label> <input type="radio" name="gst" id="gstno" value="0" />
201 <label for="gstyes">Yes</label> <input type="radio" name="gst" id="gstyes" value="1" />
202 <label for="gstno">No</label> <input type="radio" name="gst" id="gstno" value="0" checked="checked" />
205 <li><label for="list_gstyes" class="radio">List prices:</label>
206 [% IF ( listincgst ) %]
207 <label for="list_gstyes">Include tax</label> <input type="radio" id="list_gstyes" name="list_gst" value="1" checked="checked" />
208 <label for="list_gstno">Don't include tax</label> <input type="radio" id="list_gstno" name="list_gst" value="0" />
210 <label for="list_gstyes">Include tax</label> <input type="radio" id="list_gstyes" name="list_gst" value="1" />
211 <label for="list_gstno">Don't include tax</label> <input type="radio" id="list_gstno" name="list_gst" value="0" checked="checked" />
214 <li><label for="invoice_gstyes" class="radio">Invoice prices:</label>
215 [% IF ( invoiceincgst ) %]
216 <label for="invoice_gstyes">Include tax</label> <input type="radio" id="invoice_gstyes" name="invoice_gst" value="1" checked="checked" />
217 <label for="invoice_gstno">Don't include tax</label> <input type="radio" id="invoice_gstno" name="invoice_gst" value="0" />
219 <label for="invoice_gstyes">Include tax</label> <input type="radio" id="invoice_gstyes" name="invoice_gst" value="1" />
220 <label for="invoice_gstno">Don't include tax</label> <input type="radio" id="invoice_gstno" name="invoice_gst" value="0" checked="checked" />
226 <label for="tax_rate">Tax rate: </label>
227 <select name="tax_rate" id="tax_rate">
228 [% FOREACH gst IN gst_values %]
229 [% IF ( tax_rate == gst.option ) %]
230 <option value="[% gst.option | html %]" selected="selected">[% gst.option * 100 | html %] %</option>
232 <option value="[% gst.option | html %]">[% gst.option * 100 | html %] %</option>
239 <input type="hidden" name="tax_rate" value="0" />
242 <li><label for="discount">Discount: </label>
243 <input type="text" size="6" id="discount" name="discount" value="[% discount | format ("%.1f") %]" />%</li>
245 <label for="deliverytime">Delivery time: </label>
246 <input type="text" size="2" id="deliverytime" name="deliverytime" value="[% deliverytime | html %]" /> days
248 <li><label for="notes">Notes: </label>
249 <textarea cols="40" rows="4" id="notes" name="notes" >[% notes | html %]</textarea></li></ol>
251 <fieldset class="action"><input type="submit" value="Save" /> [% IF ( booksellerid ) %]
252 <a class="cancel" href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | html %]">[% ELSE %]<a class="cancel" href="/cgi-bin/koha/acqui/acqui-home.pl">
253 [% END %]Cancel</a></fieldset>
257 <h1>[% name | html %]</h1>
259 <div id="supplier-company-details" class="col-sm-6">
260 <h2>Vendor details</h2>
261 <p><span class="label">Company name: </span>[% name | html %]</p>
262 <p><span class="label">Postal address: </span>[% postal | html %]</p>
263 <p><span class="label">Physical address: </span>[% address1 | html %][% address2 | html %][% address3 | html %][% address4 | html %]</p>
264 <p><span class="label">Phone: </span>[% phone | html %]</p>
265 <p><span class="label">Fax: </span>[% fax | html %]</p>
267 <p><span class="label">Website: </span><a href="[% url | url %]">[% url | html %]</a></p>
269 [% IF ( accountnumber ) %]
270 <p><span class="label">Account number: </span>[% accountnumber | html %]</p>
273 <div id="supplier-ordering-information">
274 <h2>Ordering information</h2>
275 <p><strong>Vendor is: </strong>
281 <p><strong>List prices are: </strong>[% listprice | html %]</p>
282 <p><strong>Invoice prices are: </strong>[% invoiceprice | html %]</p>
283 [% IF ( tax_rate ) %]<p><strong>Tax number registered: </strong>
284 [% IF ( gstreg ) %]Yes[% ELSE %]No[% END %]</p>
285 <p><strong>List item price includes tax: </strong>
286 [% IF ( listincgst ) %]Yes[% ELSE %]No[% END %]</p>
287 <p><strong>Invoice item price includes tax: </strong>
288 [% IF ( invoiceincgst ) %]Yes[% ELSE %]No[% END %]</p>[% END %]
289 <p><strong>Discount: </strong>
290 [% discount | format("%.1f") %] %</p>
291 <p><strong>Tax rate: </strong>
292 [% ( tax_rate || 0 ) * 100 | html %] %</p>
293 [% IF deliverytime.defined %]
294 <p><strong>Delivery time: </strong>
295 [% deliverytime | html %] days</p>
297 [% IF ( notes ) %]<p><strong>Notes: </strong>
298 [% notes | html %]</p>[% END %]
302 <div class="supplier-contact-details col-sm-6">
304 [% FOREACH contact IN contacts %]
305 [% INCLUDE show_contact %]
311 <div class="subscription-details">
312 <h2>Subscription details</h2>
313 <p><strong>Number of subscriptions: </strong>[% subscriptioncount | html %]</p>
320 [% IF ( contracts ) %]
321 <div id="supplier-contracts">
323 <table id="contractst">
326 <th scope="col">Name</th>
327 <th scope="col">Description</th>
328 <th scope="col" class="title-string">Start date</th>
329 <th scope="col" class="title-string">End date</th>
330 <th scope="col">Actions</th>
334 [% FOREACH contract IN contracts %]
337 <a href="/cgi-bin/koha/admin/aqcontract.pl?op=add_form&contractnumber=[% contract.contractnumber | uri %]&booksellerid=[% contract.booksellerid | uri %]">[% contract.contractname | html %]</a>
339 <td>[% contract.contractdescription | html %]</td>
340 <td><span title="[% contract.contractstartdate | html %]">[% contract.contractstartdate | $KohaDates %]</span></td>
341 <td><span title="[% contract.contractenddate | html %]">[% contract.contractenddate | $KohaDates %]</span></td>
343 <a class="btn btn-default btn-xs" href="/cgi-bin/koha/admin/aqcontract.pl?op=add_form&contractnumber=[% contract.contractnumber | html %]&booksellerid=[% contract.booksellerid | html %]"><i class="fa fa-pencil"></i> Edit</a>
344 <a class="btn btn-default btn-xs" href="/cgi-bin/koha/admin/aqcontract.pl?op=delete_confirm&contractnumber=[% contract.contractnumber | html %]&booksellerid=[% contract.booksellerid | html %]"><i class="fa fa-trash"></i> Delete</a>
356 </div> <!-- /.col-sm-10.col-sm-push-2 -->
358 <div class="col-sm-2 col-sm-pull-10">
360 [% INCLUDE 'vendor-menu.inc' %]
362 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
363 </div> <!-- /.row -->
364 [% MACRO jsinclude BLOCK %]
365 [% Asset.js("js/acquisitions-menu.js") | $raw %]
366 [% Asset.js("lib/jquery/plugins/jquery.fixFloat.js") | $raw %]
367 [% INCLUDE 'datatables.inc' %]
369 function confirm_deletion() {
370 if (confirm(_("Confirm deletion of this vendor ?"))) {
371 window.location="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | html %]&op=delete";
375 function add_contact() {
376 var new_contact = $('#contact-template').clone();
377 var timestamp = new Date().getTime();
378 $(new_contact).removeAttr('id');
379 $('input, textarea', new_contact).each(function () {
380 $(this).attr('id', $(this).attr('id') + '_' + timestamp);
382 $('label', new_contact).each(function () {
383 $(this).attr('for', $(this).attr('for') + '_' + timestamp);
385 $(new_contact).insertBefore(this);
386 if ($('.supplier-contact').length === 2) { // First contact
387 $.each(['.contact_acqprimary', '.contact_serialsprimary', '.contact_orderacquisition', '.contact_claimacquisition', '.contact_claimissues'], function (idx, checkbox) {
388 $(checkbox, new_contact).click();
391 $('input[name="contact_name"]', new_contact).focus();
395 function delete_contact(ev) {
396 $(this).parents('.supplier-contact').remove();
400 $(document).ready(function() {
401 var contractst = $("#contractst").dataTable($.extend(true, {}, dataTablesDefaults, {
403 { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
404 { "sType": "title-string", "aTargets" : [ "title-string" ] }
408 $('body').on('click', '.delete-contact', null, delete_contact);
409 $('#add-contact').click(add_contact);
410 $('body').on('click', '.contact_acqprimary', null, function () {
411 if ($(this).is(':checked')) {
412 $('.contact_acqprimary').filter(':checked').not(this).prop('checked', false);
413 $('.contact_acqprimary_hidden').each(function () {
417 $(this).next('.contact_acqprimary_hidden').val('1');
419 $('body').on('click', '.contact_serialsprimary', null, function () {
420 if ($(this).is(':checked')) {
421 $('.contact_serialsprimary').filter(':checked').not(this).prop('checked', false);
422 $('.contact_serialsprimary_hidden').each(function () {
426 $(this).next('.contact_serialsprimary_hidden').val($(this).is(':checked') ? '1' : '0');
428 $('body').on('click', '.contact_orderacquisition', null, function () {
429 $(this).next('.contact_orderacquisition_hidden').val($(this).is(':checked') ? '1' : '0');
431 $('body').on('click', '.contact_claimacquisition', null, function () {
432 $(this).next('.contact_claimacquisition_hidden').val($(this).is(':checked') ? '1' : '0');
434 $('body').on('click', '.contact_claimissues', null, function () {
435 $(this).next('.contact_claimissues_hidden').val($(this).is(':checked') ? '1' : '0');
437 $('#toolbar').fixFloat();
442 [% INCLUDE 'intranet-bottom.inc' %]