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>Vendor [% name | html %] › Koha</title>
93 [% INCLUDE 'doc-head-close.inc' %]
96 <body id="acq_supplier" class="acq">
97 [% WRAPPER 'header.inc' %]
98 [% INCLUDE 'acquisitions-search.inc' %]
101 [% WRAPPER 'sub-header.inc' %]
102 [% WRAPPER breadcrumbs %]
103 [% WRAPPER breadcrumb_item %]
104 <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a>
107 [% IF ( booksellerid ) %]
108 [% WRAPPER breadcrumb_item %]
109 <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | uri %]">[% name | html %]</a>
111 [% WRAPPER breadcrumb_item bc_active= 1 %]
112 <span>Update: [% name | html %]</span>
115 [% WRAPPER breadcrumb_item bc_active= 1 %]
116 <span>Add vendor</span>
120 [% WRAPPER breadcrumb_item bc_active= 1 %]
123 [% END # /IF (enter) %]
124 [% END #/ WRAPPER breadcrumbs %]
125 [% END #/ WRAPPER sub-header.inc %]
127 <div class="main container-fluid">
129 <div class="col-sm-10 col-sm-push-2">
133 [% IF ( booksellerid ) %]
134 <h1>Update: [% name | html %]</h1>
139 [% UNLESS ( enter ) %][% INCLUDE 'acquisitions-toolbar.inc' %][% END %]
141 <form action="updatesupplier.pl" name="updatesupplier" style="display:block" class="validated" method="post">
142 <div id="toolbar" class="btn-toolbar">
143 <button class="btn btn-primary" type="submit"><i class="fa fa-save"></i> Save</button>
144 [% IF ( booksellerid ) %]
145 <a class="btn btn-default cancel" href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | html %]">
147 <a class="btn btn-default cancel" href="/cgi-bin/koha/acqui/acqui-home.pl">
148 [% END %] <i class="fa fa-remove"></i> Cancel</a>
151 <input type="hidden" name="booksellerid" value="[% booksellerid | html %]" />
152 <fieldset class="rows">
153 <legend>Company details</legend>
154 <ol><li><label for="company" class="required">Name:</label>
155 <input type="text" size="40" id="company" name="company" value="[% name | html %]" required="required" class="required focus" /><span class="required">Required</span></li>
156 <li><label for="company_postal">Postal address: </label>
157 <textarea id="company_postal" name="company_postal" cols="40" rows="3">[% postal | html %]</textarea></li>
158 <li><label for="physical">Physical address: </label>
159 <textarea id="physical" name="physical" cols="40" rows="3">[% address1 | html %][% address2 | html %][% address3 | html %][% address4 | html %]</textarea></li>
160 <li><label for="company_phone">Phone: </label>
161 <input type="text" size="20" id="company_phone" name="company_phone" value="[% phone | html %]" /></li>
162 <li><label for="company_fax">Fax: </label>
163 <input type="text" size="20" id="company_fax" name="company_fax" value="[% fax | html %]" /></li>
164 <li><label for="website">Website: </label>
165 <input type="text" size="40" id="website" name="website" value="[% url | html %]" class="url" /></li>
166 <li><label for="accountnumber">Account number: </label>
167 <input type="text" size="40" id="accountnumber" name="accountnumber" value="[% accountnumber | html %]" /></li>
169 <label for="vendor_type">Vendor type: </label>
170 [% PROCESS 'av-build-dropbox.inc' name="vendor_type", category="VENDOR_TYPE", default=type, empty=1, size = 20 %]
174 <fieldset class="rows">
175 <legend>Contacts</legend>
176 <fieldset id="contact-template" class="supplier-contact">
177 <legend>Contact details</legend>
178 [% INCLUDE edit_contact %]
180 [% FOREACH contact IN contacts %]
181 <fieldset class="supplier-contact">
182 <legend>Contact details</legend>
183 [% INCLUDE edit_contact %]
186 <button id="add-contact" class="btn btn-default"><i class="fa fa-plus"></i> Add another contact</button>
189 <fieldset class="rows">
190 <legend>Ordering information</legend>
191 <ol><li><label for="activestatus">Vendor is:</label>
193 <input type="radio" id="activestatus" name="status" value="1" checked="checked" />
194 <label class="radio" for="activestatus">Active</label>
195 <input type="radio" id="inactivestatus" name="status" value="0" />
196 <label class="radio" for="inactivestatus">Inactive</label>
198 <input type="radio" id="activestatus" name="status" value="1" />
199 <label class="radio" for="activestatus">Active</label>
200 <input type="radio" id="inactivestatus" name="status" value="0" checked="checked" />
201 <label class="radio" for="inactivestatus">Inactive</label>
203 <li><label for="list_currency">List prices are: </label>
204 <select name="list_currency" id="list_currency">
205 [% FOREACH c IN currencies %]
206 [% IF booksellerid and c.currency == listprice or not booksellerid and c.active %]
207 <option value="[% c.currency | html %]" selected="selected">[% c.currency | html %]</option>
208 [% ELSIF not c.archived %]
209 <option value="[% c.currency | html %]">[% c.currency | html %]</option>
214 <li><label for="invoice_currency">Invoice prices are: </label>
215 <select name="invoice_currency" id="invoice_currency">
216 [% FOREACH c IN currencies %]
217 [% IF booksellerid and c.currency == invoiceprice or not booksellerid and c.active %]
218 <option value="[% c.currency | html %]" selected="selected">[% c.currency | html %]</option>
219 [% ELSIF not c.archived %]
220 <option value="[% c.currency | html %]">[% c.currency | html %]</option>
225 <li><label for="gstyes">Tax number registered:</label>
227 <label class="radio" for="gstyes">Yes</label>
228 <input type="radio" name="gst" id="gstyes" value="1" checked="checked" />
229 <label class="radio" for="gstno">No</label>
230 <input type="radio" name="gst" id="gstno" value="0" />
232 <label class="radio" for="gstyes">Yes</label>
233 <input type="radio" name="gst" id="gstyes" value="1" />
234 <label class="radio" for="gstno">No</label>
235 <input type="radio" name="gst" id="gstno" value="0" checked="checked" />
238 <li><label for="list_gstyes">List prices:</label>
239 [% IF ( listincgst ) %]
240 <label class="radio" for="list_gstyes">Include tax</label>
241 <input type="radio" id="list_gstyes" name="list_gst" value="1" checked="checked" />
242 <label class="radio" for="list_gstno">Don't include tax</label>
243 <input type="radio" id="list_gstno" name="list_gst" value="0" />
245 <label class="radio" for="list_gstyes">Include tax</label>
246 <input type="radio" id="list_gstyes" name="list_gst" value="1" />
247 <label class="radio" for="list_gstno">Don't include tax</label>
248 <input type="radio" id="list_gstno" name="list_gst" value="0" checked="checked" />
251 <li><label for="invoice_gstyes">Invoice prices:</label>
252 [% IF ( invoiceincgst ) %]
253 <label class="radio" for="invoice_gstyes">Include tax</label>
254 <input type="radio" id="invoice_gstyes" name="invoice_gst" value="1" checked="checked" />
255 <label class="radio" for="invoice_gstno">Don't include tax</label>
256 <input type="radio" id="invoice_gstno" name="invoice_gst" value="0" />
258 <label class="radio" for="invoice_gstyes">Include tax</label>
259 <input type="radio" id="invoice_gstyes" name="invoice_gst" value="1" />
260 <label class="radio" for="invoice_gstno">Don't include tax</label>
261 <input type="radio" id="invoice_gstno" name="invoice_gst" value="0" checked="checked" />
266 <label for="tax_rate">Tax rate: </label>
267 <select name="tax_rate" id="tax_rate">
268 [% FOREACH gst IN gst_values %]
269 [% IF ( tax_rate == gst.option ) %]
270 <option value="[% gst.option | html %]" selected="selected">[% gst.option * 100 | html %] %</option>
272 <option value="[% gst.option | html %]">[% gst.option * 100 | html %] %</option>
278 <input type="hidden" name="tax_rate" value="0" />
280 <li><label for="discount">Discount: </label>
281 <input type="text" size="6" id="discount" name="discount" value="[% discount | format ('%.1f') %]" />%</li>
283 <label for="deliverytime">Delivery time: </label>
284 <input type="text" size="2" id="deliverytime" name="deliverytime" value="[% deliverytime | html %]" /> days
286 <li><label for="notes">Notes: </label>
287 <textarea cols="40" rows="4" id="notes" name="notes" >[% notes | html %]</textarea></li>
293 <h1>[% name | html %]</h1>
295 <div class="col-sm-6">
296 <div id="supplier-company-details" class="page-section">
297 <h2>Vendor details</h2>
298 <p><span class="label">Type: </span>[% type | html %]</p>
299 <p><span class="label">Company name: </span>[% name | html %]</p>
300 <p><span class="label">Postal address: </span>[% postal | html %]</p>
301 <p><span class="label">Physical address: </span>[% address1 | html %][% address2 | html %][% address3 | html %][% address4 | html %]</p>
302 <p><span class="label">Phone: </span>[% phone | html %]</p>
303 <p><span class="label">Fax: </span>[% fax | html %]</p>
305 <p><span class="label">Website: </span><a href="[% url | url %]">[% url | html %]</a></p>
307 [% IF ( accountnumber ) %]
308 <p><span class="label">Account number: </span>[% accountnumber | html %]</p>
310 </div> <!-- /#supplier-company-details -->
312 <div id="supplier-ordering-information" class="page-section">
313 <h2>Ordering information</h2>
314 <p><strong>Vendor is: </strong>[% IF ( active ) %]Active[% ELSE %]Inactive[% END %]</p>
315 <p><strong>List prices are: </strong>[% listprice | html %]</p>
316 <p><strong>Invoice prices are: </strong>[% invoiceprice | html %]</p>
317 [% IF ( tax_rate ) %]
318 <p><strong>Tax number registered: </strong>[% IF ( gstreg ) %]Yes[% ELSE %]No[% END %]</p>
319 <p><strong>List item price includes tax: </strong>[% IF ( listincgst ) %]Yes[% ELSE %]No[% END %]</p>
320 <p><strong>Invoice item price includes tax: </strong>[% IF ( invoiceincgst ) %]Yes[% ELSE %]No[% END %]</p>
322 <p><strong>Discount: </strong>[% discount | format("%.1f") %] %</p>
323 <p><strong>Tax rate: </strong>[% ( tax_rate || 0 ) * 100 | html %] %</p>
324 [% IF deliverytime.defined %]
325 <p><strong>Delivery time: </strong>[% deliverytime | html %] days</p>
328 <p><strong>Notes: </strong>[% notes | html %]</p>
330 </div> <!-- #supplier-ordering-information -->
331 </div> <!-- /.col-sm-6 -->
333 <div class="col-sm-6">
334 <div id="supplier-contact-details" class="page-section">
336 [% FOREACH contact IN contacts %]
337 [% INCLUDE show_contact %]
339 </div> <!-- /#supplier-contact-details -->
341 <div id="subscription-details" class="page-section">
342 <h2>Subscription details</h2>
343 <p><strong>Number of subscriptions: </strong>
344 [% IF ( CAN_user_serials ) %]
345 <a href="/cgi-bin/koha/serials/serials-search.pl?bookseller_filter=[% name | uri %]&searched=1">[% subscriptioncount | html %]</a>
347 [% subscriptioncount | html %]
350 </div> <!-- /#subscription-details -->
351 </div> <!-- /.col-sm-6 -->
355 [% IF ( contracts ) %]
356 <div id="supplier-contracts" class="page-section">
358 <table id="contractst">
361 <th scope="col">Name</th>
362 <th scope="col">Description</th>
363 <th scope="col">Start date</th>
364 <th scope="col">End date</th>
365 [% IF CAN_user_acquisition_contracts_manage %]
366 <th scope="col" class="NoSort noExport">Actions</th>
371 [% FOREACH contract IN contracts %]
374 <a href="/cgi-bin/koha/admin/aqcontract.pl?op=add_form&contractnumber=[% contract.contractnumber | uri %]&booksellerid=[% contract.booksellerid | uri %]">[% contract.contractname | html %]</a>
376 <td>[% contract.contractdescription | html %]</td>
377 <td data-order="[% contract.contractstartdate | html %]">[% contract.contractstartdate | $KohaDates %]</td>
378 <td data-order="[% contract.contractenddate | html %]">[% contract.contractenddate | $KohaDates %]</td>
379 [% IF CAN_user_acquisition_contracts_manage %]
381 <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>
382 <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>
389 </div> <!-- /#supplier-contracts -->
395 </div> <!-- /.col-sm-10.col-sm-push-2 -->
397 <div class="col-sm-2 col-sm-pull-10">
399 [% INCLUDE 'vendor-menu.inc' %]
401 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
402 </div> <!-- /.row -->
403 [% MACRO jsinclude BLOCK %]
404 [% Asset.js("js/acquisitions-menu.js") | $raw %]
405 [% Asset.js("lib/hc-sticky.js") | $raw %]
406 [% Asset.js("js/acq.js") | $raw %]
407 [% INCLUDE 'datatables.inc' %]
409 function confirm_deletion() {
410 if (confirm(_("Confirm deletion of this vendor ?"))) {
411 window.location="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | html %]&op=delete";
415 function add_contact() {
416 var new_contact = $('#contact-template').clone();
417 var timestamp = new Date().getTime();
418 $(new_contact).removeAttr('id');
419 $('input, textarea', new_contact).each(function () {
420 $(this).attr('id', $(this).attr('id') + '_' + timestamp);
422 $('label', new_contact).each(function () {
423 $(this).attr('for', $(this).attr('for') + '_' + timestamp);
425 $(new_contact).insertBefore(this);
426 if ($('.supplier-contact').length === 2) { // First contact
427 $.each(['.contact_acqprimary', '.contact_serialsprimary', '.contact_orderacquisition', '.contact_claimacquisition', '.contact_claimissues'], function (idx, checkbox) {
428 $(checkbox, new_contact).click();
431 $('input[name="contact_name"]', new_contact).focus();
435 function delete_contact(ev) {
436 $(this).parents('.supplier-contact').remove();
442 $(document).ready(function() {
443 var contractst = $("#contractst").dataTable($.extend(true, {}, dataTablesDefaults, {
445 { "bSortable": false, "bSearchable": false, 'aTargets': [ 'NoSort' ] }
449 $('body').on('click', '.delete-contact', null, delete_contact);
450 $('#add-contact').click(add_contact);
451 $('body').on('click', '.contact_acqprimary', null, function () {
452 if ($(this).is(':checked')) {
453 $('.contact_acqprimary').filter(':checked').not(this).prop('checked', false);
454 $('.contact_acqprimary_hidden').each(function () {
458 $(this).next('.contact_acqprimary_hidden').val('1');
460 $('body').on('click', '.contact_serialsprimary', null, function () {
461 if ($(this).is(':checked')) {
462 $('.contact_serialsprimary').filter(':checked').not(this).prop('checked', false);
463 $('.contact_serialsprimary_hidden').each(function () {
467 $(this).next('.contact_serialsprimary_hidden').val($(this).is(':checked') ? '1' : '0');
469 $('body').on('click', '.contact_orderacquisition', null, function () {
470 $(this).next('.contact_orderacquisition_hidden').val($(this).is(':checked') ? '1' : '0');
472 $('body').on('click', '.contact_claimacquisition', null, function () {
473 $(this).next('.contact_claimacquisition_hidden').val($(this).is(':checked') ? '1' : '0');
475 $('body').on('click', '.contact_claimissues', null, function () {
476 $(this).next('.contact_claimissues_hidden').val($(this).is(':checked') ? '1' : '0');
479 Sticky = $("#toolbar");
482 stickyClass: "floating"
488 [% INCLUDE 'intranet-bottom.inc' %]