5 [% USE AuthorisedValues %]
6 [% BLOCK edit_contact %]
8 <input type="hidden" name="contact_id" value="[% contact.id | html %]" />
9 <li><label for="contact_name[% contact.id | html %]">Contact name: </label>
10 <input type="text" size="40" id="contact_name[% contact.id | html %]" name="contact_name" value="[% contact.name | html %]" /></li>
11 <li><label for="contact_position[% contact.id | html %]">Position: </label>
12 <input type="text" size="40" id="contact_position[% contact.id | html %]" name="contact_position" value="[% contact.position | html %]" /></li>
13 <li><label for="contact_phone[% contact.id | html %]">Phone: </label>
14 <input type="text" size="20" id="contact_phone[% contact.id | html %]" name="contact_phone" value="[% contact.phone | html %]" /> </li>
15 <li><label for="contact_altphone[% contact.id | html %]">Alternative phone: </label>
16 <input type="text" size="20" id="contact_altphone[% contact.id | html %]" name="contact_altphone" value="[% contact.altphone | html %]" /></li>
17 <li><label for="contact_fax[% contact.id | html %]">Fax: </label>
18 <input type="text" size="20" id="contact_fax[% contact.id | html %]" name="contact_fax" value="[% contact.fax | html %]" /></li>
19 <li><label for="contact_email[% contact.id | html %]">Email: </label>
20 <input type="text" size="40" id="contact_email[% contact.id | html %]" name="contact_email" value="[% contact.email | html %]" class="email" /></li>
21 <li><label for="contact_notes[% contact.id | html %]">Notes: </label>
22 <textarea id="contact_notes[% contact.id | html %]" name="contact_notes" cols="40" rows="4">[% contact.notes | html %]</textarea></li>
23 <li><label for="contact_acqprimary[% contact.id | html %]">Primary acquisitions contact:</label>
24 [% IF contact.acqprimary %]
25 <input type="checkbox" id="contact_acqprimary[% contact.id | html %]" class="contact_acqprimary" checked="checked"></input>
27 <input type="checkbox" id="contact_acqprimary[% contact.id | html %]" class="contact_acqprimary"></input>
29 <input type="hidden" class="contact_acqprimary_hidden" name="contact_acqprimary" value="[% contact.acqprimary | html %]"></input>
30 <li><label for="contact_serialsprimary[% contact.id | html %]">Primary serials contact:</label>
31 [% IF contact.serialsprimary %]
32 <input type="checkbox" id="contact_serialsprimary[% contact.id | html %]" class="contact_serialsprimary" checked="checked"></input>
34 <input type="checkbox" id="contact_serialsprimary[% contact.id | html %]" class="contact_serialsprimary"></input>
36 <input type="hidden" class="contact_serialsprimary_hidden" name="contact_serialsprimary" value="[% contact.serialsprimary | html %]"></input>
37 <li><label for="contact_orderacquisition[% contact.id | html %]">Contact when ordering?</label>
38 [% IF contact.orderacquisition %]
39 <input type="checkbox" id="contact_orderacquisition[% contact.id | html %]" class="contact_orderacquisition" checked="checked"></input>
41 <input type="checkbox" id="contact_orderacquisition[% contact.id | html %]" class="contact_orderacquisition"></input>
43 <input type="hidden" class="contact_orderacquisition_hidden" name="contact_orderacquisition" value="[% contact.orderacquisition | html %]"></input>
44 <li><label for="contact_claimacquisition[% contact.id | html %]">Contact about late orders?</label>
45 [% IF contact.claimacquisition %]
46 <input type="checkbox" id="contact_claimacquisition[% contact.id | html %]" class="contact_claimacquisition" checked="checked"></input>
48 <input type="checkbox" id="contact_claimacquisition[% contact.id | html %]" class="contact_claimacquisition"></input>
50 <input type="hidden" class="contact_claimacquisition_hidden" name="contact_claimacquisition" value="[% contact.claimacquisition | html %]"></input>
51 <li><label for="contact_claimissues[% contact.id | html %]">Contact about late issues?</label>
52 [% IF contact.claimissues %]
53 <input type="checkbox" id="contact_claimissues[% contact.id | html %]" class="contact_claimissues" checked="checked"></input>
55 <input type="checkbox" id="contact_claimissues[% contact.id | html %]" class="contact_claimissues"></input>
57 <input type="hidden" class="contact_claimissues_hidden" name="contact_claimissues" value="[% contact.claimissues | html %]"></input>
59 [% IF contact.id %]<li><button class="btn btn-default delete-contact"><i class="fa fa-trash"></i> Delete contact</li>[% END %]
63 [% BLOCK show_contact %]
64 <h3>[% contact.name | html %]</h3>
65 <p><span class="label">Position: </span>[% contact.position | html %]</p>
66 <p><span class="label">Phone: </span>[% contact.phone | html %]</p>
67 <p><span class="label">Alternative phone: </span>[% contact.altphone | html %]</p>
68 <p><span class="label">Fax: </span>[% contact.fax | html %]</p>
69 [% IF ( contact.email ) %]
70 <p><span class="label">Email: </span><a href="mailto:[% contact.email | uri %]">[% contact.email | html %]</a></p>
72 [% IF ( contact.notes ) %]
73 <p><span class="label">Notes: </span>[% contact.notes | html %]</p>
75 [% IF ( contact.acqprimary ) %]
76 <p><span class="label">Primary acquisitions contact</span></p>
78 [% IF ( contact.serialsprimary ) %]
79 <p><span class="label">Primary serials contact</span></p>
81 [% IF ( contact.orderacquisition ) %]
82 <p><span class="label">Receives orders</span></p>
84 [% IF ( contact.claimacquisition ) %]
85 <p><span class="label">Receives claims for late orders</span></p>
87 [% IF ( contact.claimissues ) %]
88 <p><span class="label">Receives claims for late issues</span></p>
92 [% SET footerjs = 1 %]
93 [% INCLUDE 'doc-head-open.inc' %]
94 <title>Vendor [% name | html %] › Koha</title>
95 [% INCLUDE 'doc-head-close.inc' %]
98 <body id="acq_supplier" class="acq">
99 [% WRAPPER 'header.inc' %]
100 [% INCLUDE 'acquisitions-search.inc' %]
103 [% WRAPPER 'sub-header.inc' %]
104 [% WRAPPER breadcrumbs %]
105 [% WRAPPER breadcrumb_item %]
106 <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a>
109 [% IF ( booksellerid ) %]
110 [% WRAPPER breadcrumb_item %]
111 <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | uri %]">[% name | html %]</a>
113 [% WRAPPER breadcrumb_item bc_active= 1 %]
114 <span>Modify [% name | html %]</span>
117 [% WRAPPER breadcrumb_item bc_active= 1 %]
118 <span>Add vendor</span>
122 [% WRAPPER breadcrumb_item bc_active= 1 %]
125 [% END # /IF (enter) %]
126 [% END #/ WRAPPER breadcrumbs %]
127 [% END #/ WRAPPER sub-header.inc %]
129 <div class="main container-fluid">
131 <div class="col-sm-10 col-sm-push-2">
135 [% IF ( booksellerid ) %]
136 <h1>Update: [% name | html %]</h1>
141 [% UNLESS ( enter ) %][% INCLUDE 'acquisitions-toolbar.inc' %][% END %]
143 <form action="updatesupplier.pl" name="updatesupplier" style="display:block" class="validated" method="post">
144 <div id="toolbar" class="btn-toolbar">
145 <button class="btn btn-primary" type="submit"><i class="fa fa-save"></i> Save</button>
146 [% IF ( booksellerid ) %]
147 <a class="btn btn-default cancel" href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | html %]">
149 <a class="btn btn-default cancel" href="/cgi-bin/koha/acqui/acqui-home.pl">
150 [% END %] <i class="fa fa-remove"></i> Cancel</a>
153 <input type="hidden" name="booksellerid" value="[% booksellerid | html %]" />
154 <fieldset class="rows">
155 <legend>Company details</legend>
156 <ol><li><label for="company" class="required">Name:</label>
157 <input type="text" size="40" id="company" name="company" value="[% name | html %]" required="required" class="required focus" /><span class="required">Required</span></li>
158 <li><label for="company_postal">Postal address: </label>
159 <textarea id="company_postal" name="company_postal" cols="40" rows="3">[% postal | html %]</textarea></li>
160 <li><label for="physical">Physical address: </label>
161 <textarea id="physical" name="physical" cols="40" rows="3">[% address1 | html %][% address2 | html %][% address3 | html %][% address4 | html %]</textarea></li>
162 <li><label for="company_phone">Phone: </label>
163 <input type="text" size="20" id="company_phone" name="company_phone" value="[% phone | html %]" /></li>
164 <li><label for="company_fax">Fax: </label>
165 <input type="text" size="20" id="company_fax" name="company_fax" value="[% fax | html %]" /></li>
166 <li><label for="website">Website: </label>
167 <input type="text" size="40" id="website" name="website" value="[% url | html %]" class="url" /></li>
168 <li><label for="accountnumber">Account number: </label>
169 <input type="text" size="40" id="accountnumber" name="accountnumber" value="[% accountnumber | html %]" /></li>
171 <label for="vendor_type">Vendor type: </label>
172 [% PROCESS 'av-build-dropbox.inc' name="vendor_type", category="VENDOR_TYPE", default=type, empty=1, size = 20 %]
175 <label for="aliases">Aliases: </label>
176 <div id="aliases" style="padding-left: 11rem;"></div>
181 <fieldset class="rows">
182 <legend>Contacts</legend>
183 <fieldset id="contact-template" class="supplier-contact">
184 <legend>Contact details</legend>
185 [% INCLUDE edit_contact %]
187 [% FOREACH contact IN contacts %]
188 <fieldset class="supplier-contact">
189 <legend>Contact details</legend>
190 [% INCLUDE edit_contact %]
193 <button id="add-contact" class="btn btn-default"><i class="fa fa-plus"></i> Add another contact</button>
196 <fieldset class="rows">
197 <legend>Ordering information</legend>
198 <ol><li><label for="activestatus">Vendor is:</label>
200 <input type="radio" id="activestatus" name="status" value="1" checked="checked" />
201 <label class="radio" for="activestatus">Active</label>
202 <input type="radio" id="inactivestatus" name="status" value="0" />
203 <label class="radio" for="inactivestatus">Inactive</label>
205 <input type="radio" id="activestatus" name="status" value="1" />
206 <label class="radio" for="activestatus">Active</label>
207 <input type="radio" id="inactivestatus" name="status" value="0" checked="checked" />
208 <label class="radio" for="inactivestatus">Inactive</label>
210 <li><label for="list_currency">List prices are: </label>
211 <select name="list_currency" id="list_currency">
212 [% FOREACH c IN currencies %]
213 [% IF booksellerid and c.currency == listprice or not booksellerid and c.active %]
214 <option value="[% c.currency | html %]" selected="selected">[% c.currency | html %]</option>
215 [% ELSIF not c.archived %]
216 <option value="[% c.currency | html %]">[% c.currency | html %]</option>
221 <li><label for="invoice_currency">Invoice prices are: </label>
222 <select name="invoice_currency" id="invoice_currency">
223 [% FOREACH c IN currencies %]
224 [% IF booksellerid and c.currency == invoiceprice or not booksellerid and c.active %]
225 <option value="[% c.currency | html %]" selected="selected">[% c.currency | html %]</option>
226 [% ELSIF not c.archived %]
227 <option value="[% c.currency | html %]">[% c.currency | html %]</option>
232 <li><label for="gstyes">Tax number registered:</label>
234 <label class="radio" for="gstyes">Yes</label>
235 <input type="radio" name="gst" id="gstyes" value="1" checked="checked" />
236 <label class="radio" for="gstno">No</label>
237 <input type="radio" name="gst" id="gstno" value="0" />
239 <label class="radio" for="gstyes">Yes</label>
240 <input type="radio" name="gst" id="gstyes" value="1" />
241 <label class="radio" for="gstno">No</label>
242 <input type="radio" name="gst" id="gstno" value="0" checked="checked" />
245 <li><label for="list_gstyes">List prices:</label>
246 [% IF ( listincgst ) %]
247 <label class="radio" for="list_gstyes">Include tax</label>
248 <input type="radio" id="list_gstyes" name="list_gst" value="1" checked="checked" />
249 <label class="radio" for="list_gstno">Don't include tax</label>
250 <input type="radio" id="list_gstno" name="list_gst" value="0" />
252 <label class="radio" for="list_gstyes">Include tax</label>
253 <input type="radio" id="list_gstyes" name="list_gst" value="1" />
254 <label class="radio" for="list_gstno">Don't include tax</label>
255 <input type="radio" id="list_gstno" name="list_gst" value="0" checked="checked" />
258 <li><label for="invoice_gstyes">Invoice prices:</label>
259 [% IF ( invoiceincgst ) %]
260 <label class="radio" for="invoice_gstyes">Include tax</label>
261 <input type="radio" id="invoice_gstyes" name="invoice_gst" value="1" checked="checked" />
262 <label class="radio" for="invoice_gstno">Don't include tax</label>
263 <input type="radio" id="invoice_gstno" name="invoice_gst" value="0" />
265 <label class="radio" for="invoice_gstyes">Include tax</label>
266 <input type="radio" id="invoice_gstyes" name="invoice_gst" value="1" />
267 <label class="radio" for="invoice_gstno">Don't include tax</label>
268 <input type="radio" id="invoice_gstno" name="invoice_gst" value="0" checked="checked" />
273 <label for="tax_rate">Tax rate: </label>
274 <select name="tax_rate" id="tax_rate">
275 [% FOREACH gst IN gst_values %]
276 [% IF ( tax_rate == gst.option ) %]
277 <option value="[% gst.option | html %]" selected="selected">[% gst.option * 100 | html %] %</option>
279 <option value="[% gst.option | html %]">[% gst.option * 100 | html %] %</option>
285 <input type="hidden" name="tax_rate" value="0" />
287 <li><label for="discount">Discount: </label>
288 <input type="text" size="6" id="discount" name="discount" value="[% discount | format ('%.1f') %]" />%</li>
290 <label for="deliverytime">Delivery time: </label>
291 <input type="text" size="2" id="deliverytime" name="deliverytime" value="[% deliverytime | html %]" /> days
293 <li><label for="notes">Notes: </label>
294 <textarea cols="40" rows="4" id="notes" name="notes" >[% notes | html %]</textarea></li>
300 <h1>[% name | html %]</h1>
302 <div class="col-sm-6">
303 <div id="supplier-company-details" class="page-section">
304 <h2>Vendor details</h2>
306 <span class="label">Type: </span>
307 [% IF (type) %][% AuthorisedValues.GetByCode( 'VENDOR_TYPE', type ) | html %][% END %]
309 <p><span class="label">Company name: </span>[% name | html %]</p>
310 <p><span class="label">Postal address: </span>[% postal | html %]</p>
311 <p><span class="label">Physical address: </span>[% address1 | html %][% address2 | html %][% address3 | html %][% address4 | html %]</p>
312 <p><span class="label">Phone: </span>[% phone | html %]</p>
313 <p><span class="label">Fax: </span>[% fax | html %]</p>
315 <p><span class="label">Website: </span><a href="[% url | url %]">[% url | html %]</a></p>
317 [% IF ( accountnumber ) %]
318 <p><span class="label">Account number: </span>[% accountnumber | html %]</p>
320 [% IF vendor.aliases.count %]
322 <span class="label">Aliases: </span>
324 [% FOR alias IN vendor.aliases %]
325 <li>[% alias.alias | html %]</li>
330 </div> <!-- /#supplier-company-details -->
332 <div id="supplier-ordering-information" class="page-section">
333 <h2>Ordering information</h2>
334 <p><strong>Vendor is: </strong>[% IF ( active ) %]Active[% ELSE %]Inactive[% END %]</p>
335 <p><strong>List prices are: </strong>[% listprice | html %]</p>
336 <p><strong>Invoice prices are: </strong>[% invoiceprice | html %]</p>
337 [% IF ( tax_rate ) %]
338 <p><strong>Tax number registered: </strong>[% IF ( gstreg ) %]Yes[% ELSE %]No[% END %]</p>
339 <p><strong>List item price includes tax: </strong>[% IF ( listincgst ) %]Yes[% ELSE %]No[% END %]</p>
340 <p><strong>Invoice item price includes tax: </strong>[% IF ( invoiceincgst ) %]Yes[% ELSE %]No[% END %]</p>
342 <p><strong>Discount: </strong>[% discount | format("%.1f") %] %</p>
343 <p><strong>Tax rate: </strong>[% ( tax_rate || 0 ) * 100 | html %] %</p>
344 [% IF deliverytime.defined %]
345 <p><strong>Delivery time: </strong>[% deliverytime | html %] days</p>
348 <p><strong>Notes: </strong>[% notes | html %]</p>
350 </div> <!-- #supplier-ordering-information -->
351 </div> <!-- /.col-sm-6 -->
353 <div class="col-sm-6">
354 <div id="supplier-contact-details" class="page-section">
356 [% FOREACH contact IN contacts %]
357 [% INCLUDE show_contact %]
359 </div> <!-- /#supplier-contact-details -->
361 <div id="subscription-details" class="page-section">
362 <h2>Subscription details</h2>
363 <p><strong>Number of subscriptions: </strong>
364 [% IF ( CAN_user_serials ) %]
365 <a href="/cgi-bin/koha/serials/serials-search.pl?bookseller_filter=[% name | uri %]&searched=1">[% subscriptioncount | html %]</a>
367 [% subscriptioncount | html %]
370 </div> <!-- /#subscription-details -->
371 </div> <!-- /.col-sm-6 -->
375 [% IF ( contracts ) %]
376 <div id="supplier-contracts" class="page-section">
378 <table id="contractst">
381 <th scope="col">Name</th>
382 <th scope="col">Description</th>
383 <th scope="col">Start date</th>
384 <th scope="col">End date</th>
385 [% IF CAN_user_acquisition_contracts_manage %]
386 <th scope="col" class="NoSort noExport">Actions</th>
391 [% FOREACH contract IN contracts %]
394 <a href="/cgi-bin/koha/admin/aqcontract.pl?op=add_form&contractnumber=[% contract.contractnumber | uri %]&booksellerid=[% contract.booksellerid | uri %]">[% contract.contractname | html %]</a>
396 <td>[% contract.contractdescription | html %]</td>
397 <td data-order="[% contract.contractstartdate | html %]">[% contract.contractstartdate | $KohaDates %]</td>
398 <td data-order="[% contract.contractenddate | html %]">[% contract.contractenddate | $KohaDates %]</td>
399 [% IF CAN_user_acquisition_contracts_manage %]
401 <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>
402 <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>
409 </div> <!-- /#supplier-contracts -->
415 </div> <!-- /.col-sm-10.col-sm-push-2 -->
417 <div class="col-sm-2 col-sm-pull-10">
419 [% INCLUDE 'vendor-menu.inc' %]
421 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
422 </div> <!-- /.row -->
423 [% MACRO jsinclude BLOCK %]
424 [% Asset.js("js/acquisitions-menu.js") | $raw %]
425 [% Asset.js("lib/hc-sticky.js") | $raw %]
426 [% Asset.js("js/acq.js") | $raw %]
427 [% INCLUDE 'datatables.inc' %]
429 function confirm_deletion() {
430 if (confirm(_("Confirm deletion of this vendor ?"))) {
431 window.location="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | html %]&op=delete";
435 function add_contact() {
436 var new_contact = $('#contact-template').clone();
437 var timestamp = new Date().getTime();
438 $(new_contact).removeAttr('id');
439 $('input, textarea', new_contact).each(function () {
440 $(this).attr('id', $(this).attr('id') + '_' + timestamp);
442 $('label', new_contact).each(function () {
443 $(this).attr('for', $(this).attr('for') + '_' + timestamp);
445 $(new_contact).insertBefore(this);
446 if ($('.supplier-contact').length === 2) { // First contact
447 $.each(['.contact_acqprimary', '.contact_serialsprimary', '.contact_orderacquisition', '.contact_claimacquisition', '.contact_claimissues'], function (idx, checkbox) {
448 $(checkbox, new_contact).click();
451 $('input[name="contact_name"]', new_contact).focus();
455 function delete_contact(ev) {
456 $(this).parents('.supplier-contact').remove();
461 let aliases = [% To.json(vendor.aliases.unblessed) | $raw %];
465 function remove_alias(i){
466 aliases.splice(i, 1);
470 function encodeHTMLEntities(str){
471 return str.replace(/[&<>'"]/g,
481 function add_alias(){
482 let alias = $("#new_alias").val();
483 if ( !alias.length > 0 ) { return }
484 aliases.push({alias});
487 function refresh_aliases(){
488 let nodes = $("<div></div>");
489 aliases.forEach((a, i) => {
490 let alias_str = encodeHTMLEntities(a.alias);
491 let n = $("<div></div>").append(alias_str);
492 let input = $('<input type="hidden" name="alias" />');
495 n.append(` <a style="cursor: pointer;" onclick="remove_alias(${i});"><i class="fa fa-trash" aria-hidden="true"></i> ` + _("Remove") + '</a>');
498 nodes.append("<input id='new_alias' type='text' class='noEnterSubmit' />");
499 nodes.append(' <a style="cursor: pointer;" onclick="add_alias();"><i class="fa fa-plus" aria-hidden="true"></i> ' + _("Add") + '</a>');
500 $("#aliases").html(nodes.html());
505 $(document).ready(function() {
506 var contractst = $("#contractst").dataTable($.extend(true, {}, dataTablesDefaults, {
508 { "bSortable": false, "bSearchable": false, 'aTargets': [ 'NoSort' ] }
512 $('body').on('click', '.delete-contact', null, delete_contact);
513 $('#add-contact').click(add_contact);
514 $('body').on('click', '.contact_acqprimary', null, function () {
515 if ($(this).is(':checked')) {
516 $('.contact_acqprimary').filter(':checked').not(this).prop('checked', false);
517 $('.contact_acqprimary_hidden').each(function () {
521 $(this).next('.contact_acqprimary_hidden').val('1');
523 $('body').on('click', '.contact_serialsprimary', null, function () {
524 if ($(this).is(':checked')) {
525 $('.contact_serialsprimary').filter(':checked').not(this).prop('checked', false);
526 $('.contact_serialsprimary_hidden').each(function () {
530 $(this).next('.contact_serialsprimary_hidden').val($(this).is(':checked') ? '1' : '0');
532 $('body').on('click', '.contact_orderacquisition', null, function () {
533 $(this).next('.contact_orderacquisition_hidden').val($(this).is(':checked') ? '1' : '0');
535 $('body').on('click', '.contact_claimacquisition', null, function () {
536 $(this).next('.contact_claimacquisition_hidden').val($(this).is(':checked') ? '1' : '0');
538 $('body').on('click', '.contact_claimissues', null, function () {
539 $(this).next('.contact_claimissues_hidden').val($(this).is(':checked') ? '1' : '0');
544 Sticky = $("#toolbar");
547 stickyClass: "floating"
553 [% INCLUDE 'intranet-bottom.inc' %]