3 [% BLOCK edit_contact %]
5 <input type="hidden" name="contact_id" value="[% contact.id %]" />
6 <li><label for="contact_name[% contact.id %]">Contact name: </label>
7 <input type="text" size="40" id="contact_name[% contact.id %]" name="contact_name" value="[% contact.name %]" /></li>
8 <li><label for="contact_position[% contact.id %]">Position: </label>
9 <input type="text" size="40" id="contact_position[% contact.id %]" name="contact_position" value="[% contact.position %]" /></li>
10 <li><label for="contact_phone[% contact.id %]">Phone: </label>
11 <input type="text" size="20" id="contact_phone[% contact.id %]" name="contact_phone" value="[% contact.phone %]" /> </li>
12 <li><label for="contact_altphone[% contact.id %]">Alternative phone: </label>
13 <input type="text" size="20" id="contact_altphone[% contact.id %]" name="contact_altphone" value="[% contact.altphone %]" /></li>
14 <li><label for="contact_fax[% contact.id %]">Fax: </label>
15 <input type="text" size="20" id="contact_fax[% contact.id %]" name="contact_fax" value="[% contact.fax %]" /></li>
16 <li><label for="contact_email[% contact.id %]">Email: </label>
17 <input type="text" size="40" id="contact_email[% contact.id %]" name="contact_email" value="[% contact.email %]" class="email" /></li>
18 <li><label for="contact_notes[% contact.id %]">Notes: </label>
19 <textarea id="contact_notes[% contact.id %]" name="contact_notes" cols="40" rows="4">[% contact.notes %]</textarea></li>
20 <li><label for="contact_acqprimary[% contact.id %]">Primary acquisitions contact:</label>
21 [% IF contact.acqprimary %]
22 <input type="checkbox" id="contact_acqprimary[% contact.id %]" class="contact_acqprimary" checked="checked"></input>
24 <input type="checkbox" id="contact_acqprimary[% contact.id %]" class="contact_acqprimary"></input>
26 <input type="hidden" class="contact_acqprimary_hidden" name="contact_acqprimary" value="[% contact.acqprimary %]"></input>
27 <li><label for="contact_serialsprimary[% contact.id %]">Primary serials contact:</label>
28 [% IF contact.serialsprimary %]
29 <input type="checkbox" id="contact_serialsprimary[% contact.id %]" class="contact_serialsprimary" checked="checked"></input>
31 <input type="checkbox" id="contact_serialsprimary[% contact.id %]" class="contact_serialsprimary"></input>
33 <input type="hidden" class="contact_serialsprimary_hidden" name="contact_serialsprimary" value="[% contact.serialsprimary %]"></input>
34 <li><label for="contact_orderacquisition[% contact.id %]">Contact when ordering?</label>
35 [% IF contact.orderacquisition %]
36 <input type="checkbox" id="contact_orderacquisition[% contact.id %]" class="contact_orderacquisition" checked="checked"></input>
38 <input type="checkbox" id="contact_orderacquisition[% contact.id %]" class="contact_orderacquisition"></input>
40 <input type="hidden" class="contact_orderacquisition_hidden" name="contact_orderacquisition" value="[% contact.orderacquisition %]"></input>
41 <li><label for="contact_claimacquisition[% contact.id %]">Contact about late orders?</label>
42 [% IF contact.claimacquisition %]
43 <input type="checkbox" id="contact_claimacquisition[% contact.id %]" class="contact_claimacquisition" checked="checked"></input>
45 <input type="checkbox" id="contact_claimacquisition[% contact.id %]" class="contact_claimacquisition"></input>
47 <input type="hidden" class="contact_claimacquisition_hidden" name="contact_claimacquisition" value="[% contact.claimacquisition %]"></input>
48 <li><label for="contact_claimissues[% contact.id %]">Contact about late issues?</label>
49 [% IF contact.claimissues %]
50 <input type="checkbox" id="contact_claimissues[% contact.id %]" class="contact_claimissues" checked="checked"></input>
52 <input type="checkbox" id="contact_claimissues[% contact.id %]" class="contact_claimissues"></input>
54 <input type="hidden" class="contact_claimissues_hidden" name="contact_claimissues" value="[% contact.claimissues %]"></input>
56 [% IF contact.id %]<li><button class="btn btn-default delete-contact"><i class="fa fa-trash"></i> Delete contact</li>[% END %]
60 [% BLOCK show_contact %]
61 <h3>[% contact.name |html %]</h3>
62 <p><span class="label">Position: </span>[% contact.position |html %]</p>
63 <p><span class="label">Phone: </span>[% contact.phone |html %]</p>
64 <p><span class="label">Alternative phone: </span>[% contact.altphone |html %]</p>
65 <p><span class="label">Fax: </span>[% contact.fax |html %]</p>
66 [% IF ( contact.email ) %]
67 <p><span class="label">Email: </span><a href="mailto:[% contact.email %]">[% contact.email %]</a></p>
69 [% IF ( contact.notes ) %]
70 <p><span class="label">Notes: </span>[% contact.notes |html %]</p>
72 [% IF ( contact.acqprimary ) %]
73 <p><span class="label">Primary acquisitions contact</span></p>
75 [% IF ( contact.serialsprimary ) %]
76 <p><span class="label">Primary serials contact</span></p>
78 [% IF ( contact.orderacquisition ) %]
79 <p><span class="label">Receives orders</span></p>
81 [% IF ( contact.claimacquisition ) %]
82 <p><span class="label">Receives claims for late orders</span></p>
84 [% IF ( contact.claimissues ) %]
85 <p><span class="label">Receives claims for late issues</span></p>
89 [% SET footerjs = 1 %]
90 [% INCLUDE 'doc-head-open.inc' %]
91 <title>Koha › Vendor [% name %]</title>
92 [% Asset.css("css/datatables.css") %]
93 [% INCLUDE 'doc-head-close.inc' %]
96 <body id="acq_supplier" class="acq">
97 [% INCLUDE 'header.inc' %]
98 [% INCLUDE 'acquisitions-search.inc' %]
100 <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 %]">[% name |html %]</a> › Update: [% name |html %][% ELSE %]Add vendor[% END %] [% ELSE %][% name |html %][% END %]</div>
102 <div id="doc3" class="yui-t2">
108 [% IF ( booksellerid ) %]
109 <h1>Update: [% name |html %]</h1>
114 [% UNLESS ( enter ) %][% INCLUDE 'acquisitions-toolbar.inc' %][% END %]
116 <form action="updatesupplier.pl" name="updatesupplier" class="validated" method="post">
118 <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
119 <fieldset class="rows">
120 <legend>Company details</legend>
121 <ol><li><label for="company" class="required">Name:</label>
122 <input type="text" size="40" id="company" name="company" value="[% name %]" required="required" class="required" /><span class="required">Required</span></li>
123 <li><label for="company_postal">Postal address: </label>
124 <textarea id="company_postal" name="company_postal" cols="40" rows="3">[% postal %]</textarea></li>
125 <li><label for="physical">Physical address: </label>
126 <textarea id="physical" name="physical" cols="40" rows="3">[% address1 %][% address2 %][% address3 %][% address4 %]</textarea></li>
127 <li><label for="company_phone">Phone: </label>
128 <input type="text" size="20" id="company_phone" name="company_phone" value="[% phone %]" /></li>
129 <li><label for="company_fax">Fax: </label>
130 <input type="text" size="20" id="company_fax" name="company_fax" value="[% fax %]" /></li>
131 <li><label for="website">Website: </label>
132 <input type="text" size="40" id="website" name="website" value="[% url %]" class="url" /></li>
133 <li><label for="accountnumber">Account number: </label>
134 <input type="text" size="40" id="accountnumber" name="accountnumber" value="[% accountnumber %]" /></li></ol>
136 <fieldset class="rows">
137 <legend>Contacts</legend>
138 <fieldset id="contact-template" class="supplier-contact">
139 <legend>Contact details</legend>
140 [% INCLUDE edit_contact %]
142 [% FOREACH contact IN contacts %]
143 <fieldset class="supplier-contact">
144 <legend>Contact details</legend>
145 [% INCLUDE edit_contact %]
148 <button id="add-contact" class="btn btn-default"><i class="fa fa-plus"></i> Add another contact</button>
152 <fieldset class="rows">
153 <legend>Ordering information</legend>
154 <ol class="radio"><li><label for="activestatus" class="radio">Vendor is:</label>
156 <label for="activestatus">Active</label> <input type="radio" id="activestatus" name="status" value="1" checked="checked" />
157 <label for="inactivestatus">Inactive</label> <input type="radio" id="inactivestatus" name="status" value="0" />
159 <label for="activestatus">Active</label> <input type="radio" id="activestatus" name="status" value="1" />
160 <label for="inactivestatus">Inactive</label> <input type="radio" id="inactivestatus" name="status" value="0" checked="checked" />
164 <li><label for="list_currency">List prices are: </label>
165 <select name="list_currency" id="list_currency">
166 [% FOREACH c IN currencies %]
167 [% IF booksellerid and c.currency == listprice or not booksellerid and c.active %]
168 <option value="[% c.currency %]" selected="selected">[% c.currency %]</option>
169 [% ELSIF not c.archived %]
170 <option value="[% c.currency %]">[% c.currency %]</option>
175 <li><label for="invoice_currency">Invoice prices are: </label>
176 <select name="invoice_currency" id="invoice_currency">
177 [% FOREACH c IN currencies %]
178 [% IF booksellerid and c.currency == invoiceprice or not booksellerid and c.active %]
179 <option value="[% c.currency %]" selected="selected">[% c.currency %]</option>
180 [% ELSIF not c.archived %]
181 <option value="[% c.currency %]">[% c.currency %]</option>
188 <li><label for="gstyes" class="radio">Tax number registered:</label>
190 <label for="gstyes">Yes</label> <input type="radio" name="gst" id="gstyes" value="1" checked="checked" />
191 <label for="gstno">No</label> <input type="radio" name="gst" id="gstno" value="0" />
193 <label for="gstyes">Yes</label> <input type="radio" name="gst" id="gstyes" value="1" />
194 <label for="gstno">No</label> <input type="radio" name="gst" id="gstno" value="0" checked="checked" />
197 <li><label for="list_gstyes" class="radio">List prices:</label>
198 [% IF ( listincgst ) %]
199 <label for="list_gstyes">Include tax</label> <input type="radio" id="list_gstyes" name="list_gst" value="1" checked="checked" />
200 <label for="list_gstno">Don't include tax</label> <input type="radio" id="list_gstno" name="list_gst" value="0" />
202 <label for="list_gstyes">Include tax</label> <input type="radio" id="list_gstyes" name="list_gst" value="1" />
203 <label for="list_gstno">Don't include tax</label> <input type="radio" id="list_gstno" name="list_gst" value="0" checked="checked" />
206 <li><label for="invoice_gstyes" class="radio">Invoice prices:</label>
207 [% IF ( invoiceincgst ) %]
208 <label for="invoice_gstyes">Include tax</label> <input type="radio" id="invoice_gstyes" name="invoice_gst" value="1" checked="checked" />
209 <label for="invoice_gstno">Don't include tax</label> <input type="radio" id="invoice_gstno" name="invoice_gst" value="0" />
211 <label for="invoice_gstyes">Include tax</label> <input type="radio" id="invoice_gstyes" name="invoice_gst" value="1" />
212 <label for="invoice_gstno">Don't include tax</label> <input type="radio" id="invoice_gstno" name="invoice_gst" value="0" checked="checked" />
218 <label for="tax_rate">Tax rate: </label>
219 <select name="tax_rate" id="tax_rate">
220 [% FOREACH gst IN gst_values %]
221 [% IF ( tax_rate == gst.option ) %]
222 <option value="[% gst.option %]" selected="selected">[% gst.option * 100 %] %</option>
224 <option value="[% gst.option %]">[% gst.option * 100 %] %</option>
231 <input type="hidden" name="tax_rate" value="0" />
234 <li><label for="discount">Discount: </label>
235 <input type="text" size="6" id="discount" name="discount" value="[% discount | format ("%.1f") %]" />%</li>
237 <label for="deliverytime">Delivery time: </label>
238 <input type="text" size="2" id="deliverytime" name="deliverytime" value="[% deliverytime %]" /> days
240 <li><label for="notes">Notes: </label>
241 <textarea cols="40" rows="4" id="notes" name="notes" >[% notes %]</textarea></li></ol>
243 <fieldset class="action"><input type="submit" value="Save" /> [% IF ( booksellerid ) %]
244 <a class="cancel" href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid %]">[% ELSE %]<a class="cancel" href="/cgi-bin/koha/acqui/acqui-home.pl">
245 [% END %]Cancel</a></fieldset>
249 <h1>[% name |html %]</h1>
251 <div id="supplier-company-details" class="yui-u first">
252 <h2>Vendor details</h2>
253 <p><span class="label">Company name: </span>[% name |html %]</p>
254 <p><span class="label">Postal address: </span>[% postal |html %]</p>
255 <p><span class="label">Physical address: </span>[% address1 |html %][% address2 |html %][% address3 |html %][% address4 |html %]</p>
256 <p><span class="label">Phone: </span>[% phone |html %]</p>
257 <p><span class="label">Fax: </span>[% fax |html %]</p>
259 <p><span class="label">Website: </span><a href="[% url %]">[% url %]</a></p>
261 [% IF ( accountnumber ) %]
262 <p><span class="label">Account number: </span>[% accountnumber |html %]</p>
265 <div id="supplier-ordering-information">
266 <h2>Ordering information</h2>
267 <p><strong>Vendor is: </strong>
273 <p><strong>List prices are: </strong>[% listprice %]</p>
274 <p><strong>Invoice prices are: </strong>[% invoiceprice %]</p>
275 [% IF ( tax_rate ) %]<p><strong>Tax number registered: </strong>
276 [% IF ( gstreg ) %]Yes[% ELSE %]No[% END %]</p>
277 <p><strong>List item price includes tax: </strong>
278 [% IF ( listincgst ) %]Yes[% ELSE %]No[% END %]</p>
279 <p><strong>Invoice item price includes tax: </strong>
280 [% IF ( invoiceincgst ) %]Yes[% ELSE %]No[% END %]</p>[% END %]
281 <p><strong>Discount: </strong>
282 [% discount | format("%.1f") %] %</p>
283 <p><strong>Tax rate: </strong>
284 [% ( tax_rate || 0 ) * 100 %] %</p>
285 [% IF deliverytime.defined %]
286 <p><strong>Delivery time: </strong>
287 [% deliverytime %] days</p>
289 [% IF ( notes ) %]<p><strong>Notes: </strong>
290 [% notes |html %]</p>[% END %]
294 <div class="supplier-contact-details yui-u">
296 [% FOREACH contact IN contacts %]
297 [% INCLUDE show_contact %]
303 <div class="subscription-details">
304 <h2>Subscription details</h2>
305 <p><strong>Number of subscriptions: </strong>[% subscriptioncount %]</p>
312 [% IF ( contracts ) %]
313 <div id="supplier-contracts" class="yui-g">
315 <table id="contractst">
318 <th scope="col">Name</th>
319 <th scope="col">Description</th>
320 <th scope="col" class="title-string">Start date</th>
321 <th scope="col" class="title-string">End date</th>
322 <th scope="col">Actions</th>
326 [% FOREACH contract IN contracts %]
329 <a href="/cgi-bin/koha/admin/aqcontract.pl?op=add_form&contractnumber=[% contract.contractnumber %]&booksellerid=[% contract.booksellerid %]">[% contract.contractname %]</a>
331 <td>[% contract.contractdescription %]</td>
332 <td><span title="[% contract.contractstartdate %]">[% contract.contractstartdate | $KohaDates %]</span></td>
333 <td><span title="[% contract.contractenddate %]">[% contract.contractenddate | $KohaDates %]</span></td>
335 <a class="btn btn-default btn-xs" href="/cgi-bin/koha/admin/aqcontract.pl?op=add_form&contractnumber=[% contract.contractnumber %]&booksellerid=[% contract.booksellerid %]"><i class="fa fa-pencil"></i> Edit</a>
336 <a class="btn btn-default btn-xs" href="/cgi-bin/koha/admin/aqcontract.pl?op=delete_confirm&contractnumber=[% contract.contractnumber %]&booksellerid=[% contract.booksellerid %]"><i class="fa fa-trash"></i> Delete</a>
350 [% INCLUDE 'vendor-menu.inc' %]
354 [% MACRO jsinclude BLOCK %]
355 [% Asset.js("js/acquisitions-menu.js") %]
356 [% INCLUDE 'datatables.inc' %]
357 <script type="text/javascript">
358 function confirm_deletion() {
359 if (confirm(_("Confirm deletion of this vendor ?"))) {
360 window.location="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid %]&op=delete";
364 function add_contact() {
365 var new_contact = $('#contact-template').clone();
366 var timestamp = new Date().getTime();
367 $(new_contact).removeAttr('id');
368 $('input, textarea', new_contact).each(function () {
369 $(this).attr('id', $(this).attr('id') + '_' + timestamp);
371 $('label', new_contact).each(function () {
372 $(this).attr('for', $(this).attr('for') + '_' + timestamp);
374 $(new_contact).insertBefore(this);
375 if ($('.supplier-contact').length === 2) { // First contact
376 $.each(['.contact_acqprimary', '.contact_serialsprimary', '.contact_orderacquisition', '.contact_claimacquisition', '.contact_claimissues'], function (idx, checkbox) {
377 $(checkbox, new_contact).click();
380 $('input[name="contact_name"]', new_contact).focus();
384 function delete_contact(ev) {
385 $(this).parents('.supplier-contact').remove();
389 $(document).ready(function() {
390 var contractst = $("#contractst").dataTable($.extend(true, {}, dataTablesDefaults, {
392 { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
393 { "sType": "title-string", "aTargets" : [ "title-string" ] }
397 $('body').on('click', '.delete-contact', null, delete_contact);
398 $('#add-contact').click(add_contact);
399 $('body').on('click', '.contact_acqprimary', null, function () {
400 if ($(this).is(':checked')) {
401 $('.contact_acqprimary').filter(':checked').not(this).prop('checked', false);
402 $('.contact_acqprimary_hidden').each(function () {
406 $(this).next('.contact_acqprimary_hidden').val('1');
408 $('body').on('click', '.contact_serialsprimary', null, function () {
409 if ($(this).is(':checked')) {
410 $('.contact_serialsprimary').filter(':checked').not(this).prop('checked', false);
411 $('.contact_serialsprimary_hidden').each(function () {
415 $(this).next('.contact_serialsprimary_hidden').val($(this).is(':checked') ? '1' : '0');
417 $('body').on('click', '.contact_orderacquisition', null, function () {
418 $(this).next('.contact_orderacquisition_hidden').val($(this).is(':checked') ? '1' : '0');
420 $('body').on('click', '.contact_claimacquisition', null, function () {
421 $(this).next('.contact_claimacquisition_hidden').val($(this).is(':checked') ? '1' : '0');
423 $('body').on('click', '.contact_claimissues', null, function () {
424 $(this).next('.contact_claimissues_hidden').val($(this).is(':checked') ? '1' : '0');
430 [% INCLUDE 'intranet-bottom.inc' %]