|
Lines 1-738
Link Here
|
| 1 |
[% USE raw %] |
|
|
| 2 |
[% USE Koha %] |
| 3 |
[% USE To %] |
| 4 |
[% USE Asset %] |
| 5 |
[% USE KohaDates %] |
| 6 |
[% USE AuthorisedValues %] |
| 7 |
[% PROCESS 'i18n.inc' %] |
| 8 |
[% BLOCK edit_contact %] |
| 9 |
<ol id="contact-form"> |
| 10 |
<input type="hidden" name="contact_id" value="[% contact.id | html %]" /> |
| 11 |
<li><label for="contact_name[% contact.id | html %]">Contact name: </label> <input type="text" size="40" id="contact_name[% contact.id | html %]" name="contact_name" value="[% contact.name | html %]" /></li> |
| 12 |
<li><label for="contact_position[% contact.id | html %]">Position: </label> <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> <input type="tel" size="20" id="contact_phone[% contact.id | html %]" name="contact_phone" value="[% contact.phone | html %]" /> </li> |
| 14 |
<li><label for="contact_altphone[% contact.id | html %]">Alternative phone: </label> <input type="tel" 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> <input type="tel" size="20" id="contact_fax[% contact.id | html %]" name="contact_fax" value="[% contact.fax | html %]" /></li> |
| 16 |
<li><label for="contact_email[% contact.id | html %]">Email: </label> <input type="email" size="40" id="contact_email[% contact.id | html %]" name="contact_email" value="[% contact.email | html %]" class="email" /></li> |
| 17 |
<li><label for="contact_notes[% contact.id | html %]">Notes: </label> <textarea id="contact_notes[% contact.id | html %]" name="contact_notes" cols="40" rows="4">[% contact.notes | html %]</textarea></li> |
| 18 |
</ol> |
| 19 |
<div style="display:flex"> |
| 20 |
<div> |
| 21 |
<fieldset class="rows"> |
| 22 |
<legend>Acquisitions options</legend> |
| 23 |
<ol class="radio"> |
| 24 |
<li> |
| 25 |
<label> |
| 26 |
[% IF contact.acqprimary %] |
| 27 |
<input type="checkbox" id="contact_acqprimary[% contact.id | html %]" class="contact_acqprimary" checked="checked" /> |
| 28 |
[% ELSE %] |
| 29 |
<input type="checkbox" id="contact_acqprimary[% contact.id | html %]" class="contact_acqprimary" /> |
| 30 |
[% END %] |
| 31 |
<input type="hidden" class="contact_acqprimary_hidden" name="contact_acqprimary" value="[% contact.acqprimary | html %]" /> |
| 32 |
Primary acquisitions contact |
| 33 |
</label> |
| 34 |
</li> |
| 35 |
<li> |
| 36 |
<label> |
| 37 |
[% IF contact.orderacquisition %] |
| 38 |
<input type="checkbox" id="contact_orderacquisition[% contact.id | html %]" class="contact_orderacquisition" checked="checked" /> |
| 39 |
[% ELSE %] |
| 40 |
<input type="checkbox" id="contact_orderacquisition[% contact.id | html %]" class="contact_orderacquisition" /> |
| 41 |
[% END %] |
| 42 |
<input type="hidden" class="contact_orderacquisition_hidden" name="contact_orderacquisition" value="[% contact.orderacquisition | html %]" /> |
| 43 |
Contact when ordering |
| 44 |
</label> |
| 45 |
</li> |
| 46 |
<li> |
| 47 |
<label> |
| 48 |
[% IF contact.claimacquisition %] |
| 49 |
<input type="checkbox" id="contact_claimacquisition[% contact.id | html %]" class="contact_claimacquisition" checked="checked" /> |
| 50 |
[% ELSE %] |
| 51 |
<input type="checkbox" id="contact_claimacquisition[% contact.id | html %]" class="contact_claimacquisition" /> |
| 52 |
[% END %] |
| 53 |
<input type="hidden" class="contact_claimacquisition_hidden" name="contact_claimacquisition" value="[% contact.claimacquisition | html %]" /> |
| 54 |
Contact about late orders |
| 55 |
</label> |
| 56 |
</li> |
| 57 |
</ol> |
| 58 |
</fieldset> |
| 59 |
</div> |
| 60 |
<div> |
| 61 |
<fieldset class="rows"> |
| 62 |
<legend>Serials options</legend> |
| 63 |
<ol class="radio"> |
| 64 |
<li> |
| 65 |
<label> |
| 66 |
[% IF contact.serialsprimary %] |
| 67 |
<input type="checkbox" id="contact_serialsprimary[% contact.id | html %]" class="contact_serialsprimary" checked="checked" /> |
| 68 |
[% ELSE %] |
| 69 |
<input type="checkbox" id="contact_serialsprimary[% contact.id | html %]" class="contact_serialsprimary" /> |
| 70 |
[% END %] |
| 71 |
<input type="hidden" class="contact_serialsprimary_hidden" name="contact_serialsprimary" value="[% contact.serialsprimary | html %]" /> |
| 72 |
Primary serials contact |
| 73 |
</label> |
| 74 |
</li> |
| 75 |
<li> |
| 76 |
<label> |
| 77 |
[% IF contact.claimissues %] |
| 78 |
<input type="checkbox" id="contact_claimissues[% contact.id | html %]" class="contact_claimissues" checked="checked" /> |
| 79 |
[% ELSE %] |
| 80 |
<input type="checkbox" id="contact_claimissues[% contact.id | html %]" class="contact_claimissues" /> |
| 81 |
[% END %] |
| 82 |
<input type="hidden" class="contact_claimissues_hidden" name="contact_claimissues" value="[% contact.claimissues | html %]" /> |
| 83 |
Contact about late issues |
| 84 |
</label> |
| 85 |
</li> |
| 86 |
</ol> |
| 87 |
</fieldset> |
| 88 |
</div> |
| 89 |
</div> |
| 90 |
|
| 91 |
[% IF contact.id %] |
| 92 |
<ol |
| 93 |
><li |
| 94 |
><button class="btn btn-default delete-contact"><i class="fa fa-trash-can"></i> Delete contact</button></li |
| 95 |
></ol |
| 96 |
> |
| 97 |
[% END %] |
| 98 |
[% END %] |
| 99 |
|
| 100 |
[% BLOCK show_contact %] |
| 101 |
<h3>[% contact.name | html %]</h3> |
| 102 |
<ol> |
| 103 |
<li><span class="label">Position: </span>[% contact.position | html %]</li> |
| 104 |
<li><span class="label">Phone: </span>[% contact.phone | html %]</li> |
| 105 |
<li><span class="label">Alternative phone: </span>[% contact.altphone | html %]</li> |
| 106 |
<li><span class="label">Fax: </span>[% contact.fax | html %]</li> |
| 107 |
[% IF ( contact.email ) %] |
| 108 |
<li><span class="label">Email: </span><a href="mailto:[% contact.email | uri %]">[% contact.email | html %]</a></li> |
| 109 |
[% END %] |
| 110 |
[% IF ( contact.notes ) %] |
| 111 |
<li><span class="label">Notes: </span>[% contact.notes | html %]</li> |
| 112 |
[% END %] |
| 113 |
[% IF ( contact.acqprimary || contact.orderacquisition || contact.claimacquisition ) %] |
| 114 |
<li> |
| 115 |
<span class="label">Acquisitions options:</span> |
| 116 |
<ol> |
| 117 |
[% IF ( contact.acqprimary ) %] |
| 118 |
<li><span class="label"></span> <i class="fa fa-check"></i> Primary acquisitions contact</li> |
| 119 |
[% END %] |
| 120 |
[% IF ( contact.orderacquisition ) %] |
| 121 |
<li><span class="label"></span> <i class="fa fa-check"></i> Receives orders</li> |
| 122 |
[% END %] |
| 123 |
[% IF ( contact.claimacquisition ) %] |
| 124 |
<li><span class="label"></span> <i class="fa fa-check"></i> Receives claims for late orders</li> |
| 125 |
[% END %] |
| 126 |
</ol> |
| 127 |
</li> |
| 128 |
[% END %] |
| 129 |
[% IF ( contact.serialsprimary || contact.claimissues ) %] |
| 130 |
<li> |
| 131 |
<span class="label">Serials options:</span> |
| 132 |
<ol> |
| 133 |
[% IF ( contact.serialsprimary ) %] |
| 134 |
<li><span class="label"></span> <i class="fa fa-check"></i> Primary serials contact</li> |
| 135 |
[% END %] |
| 136 |
[% IF ( contact.claimissues ) %] |
| 137 |
<li><span class="label"></span> <i class="fa fa-check"></i> Receives claims for late issues</li> |
| 138 |
[% END %] |
| 139 |
</ol> |
| 140 |
</li> |
| 141 |
[% END %] |
| 142 |
</ol> |
| 143 |
[% END %] |
| 144 |
|
| 145 |
[% SET footerjs = 1 %] |
| 146 |
[% INCLUDE 'doc-head-open.inc' %] |
| 147 |
<title |
| 148 |
>[% FILTER collapse %] |
| 149 |
[% IF ( enter ) %] |
| 150 |
[% IF ( booksellerid ) %] |
| 151 |
[% tx("Modify vendor '{vendor}'", { vendor = name }) | html %] |
| 152 |
[% ELSE %] |
| 153 |
[% t("Add vendor") | html %] |
| 154 |
[% END %] |
| 155 |
[% ELSE %] |
| 156 |
[% tx("Vendor '{vendor}'", { vendor = name }) | html %] |
| 157 |
[% END %] |
| 158 |
› [% t("Acquisitions") | html %] › [% t("Koha") | html %] |
| 159 |
[% END %]</title |
| 160 |
> |
| 161 |
[% INCLUDE 'doc-head-close.inc' %] |
| 162 |
</head> |
| 163 |
|
| 164 |
<body id="acq_supplier" class="acq"> |
| 165 |
[% WRAPPER 'header.inc' %] |
| 166 |
[% INCLUDE 'acquisitions-search.inc' %] |
| 167 |
[% END %] |
| 168 |
|
| 169 |
[% WRAPPER 'sub-header.inc' %] |
| 170 |
[% WRAPPER breadcrumbs %] |
| 171 |
[% WRAPPER breadcrumb_item %] |
| 172 |
<a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a> |
| 173 |
[% END %] |
| 174 |
[% IF ( enter ) %] |
| 175 |
[% IF ( booksellerid ) %] |
| 176 |
[% WRAPPER breadcrumb_item %] |
| 177 |
<a href="/cgi-bin/koha/vendors/[% booksellerid | uri %]">[% name | html %]</a> |
| 178 |
[% END %] |
| 179 |
[% WRAPPER breadcrumb_item bc_active= 1 %] |
| 180 |
[% tx("Modify vendor '{vendor}'", { vendor = name }) | html %] |
| 181 |
[% END %] |
| 182 |
[% ELSE %] |
| 183 |
[% WRAPPER breadcrumb_item bc_active= 1 %] |
| 184 |
<span>Add vendor</span> |
| 185 |
[% END %] |
| 186 |
[% END %] |
| 187 |
[% ELSE %] |
| 188 |
[% WRAPPER breadcrumb_item bc_active= 1 %] |
| 189 |
[% name | html %] |
| 190 |
[% END %] |
| 191 |
[% END # /IF (enter) %] |
| 192 |
[% END #/ WRAPPER breadcrumbs %] |
| 193 |
[% END #/ WRAPPER sub-header.inc %] |
| 194 |
|
| 195 |
[% WRAPPER 'main-container.inc' aside='vendor-menu' %] |
| 196 |
|
| 197 |
[% IF ( enter ) %] |
| 198 |
[% INCLUDE 'messages.inc' %] |
| 199 |
[% IF ( booksellerid ) %] |
| 200 |
<h1>Modify vendor '[% name | html %]'</h1> |
| 201 |
[% ELSE %] |
| 202 |
<h1>Add vendor</h1> |
| 203 |
[% END %] |
| 204 |
[% END %] |
| 205 |
[% UNLESS ( enter ) %][% INCLUDE 'acquisitions-toolbar.inc' %][% END %] |
| 206 |
[% IF ( enter ) %] |
| 207 |
<form action="updatesupplier.pl" name="updatesupplier" class="validated" method="post"> |
| 208 |
<input type="hidden" name="op" value="cud-add" /> |
| 209 |
[% INCLUDE 'csrf-token.inc' %] |
| 210 |
<div id="toolbar" class="btn-toolbar sticky"> |
| 211 |
<button class="btn btn-primary" type="submit"><i class="fa fa-save"></i> Save</button> |
| 212 |
[% IF ( booksellerid ) %] |
| 213 |
<a class="btn btn-default cancel" href="/cgi-bin/koha/vendors/[% booksellerid | html %]"> </a> |
| 214 |
[% ELSE %] |
| 215 |
[% SET a_href = '/cgi-bin/koha/acqui/acqui-home.pl' %] |
| 216 |
[% END %] |
| 217 |
<a class="btn btn-default cancel" href="[% a_href | url %]"><i class="fa fa-times"></i> Cancel</a> |
| 218 |
</div> |
| 219 |
|
| 220 |
<input type="hidden" name="booksellerid" value="[% booksellerid | html %]" /> |
| 221 |
<fieldset class="rows"> |
| 222 |
<legend>Company details</legend> |
| 223 |
<ol |
| 224 |
><li |
| 225 |
><label for="company" class="required">Name:</label> <input type="text" size="40" id="company" name="company" value="[% name | html %]" required="required" class="required focus" /><span class="required" |
| 226 |
>Required</span |
| 227 |
></li |
| 228 |
> |
| 229 |
<li><label for="company_postal">Postal address: </label> <textarea id="company_postal" name="company_postal" cols="40" rows="3">[% postal | html %]</textarea></li> |
| 230 |
<li><label for="physical">Physical address: </label> <textarea id="physical" name="physical" cols="40" rows="3">[% address1 | html %][% address2 | html %][% address3 | html %][% address4 | html %]</textarea></li> |
| 231 |
<li><label for="company_phone">Phone: </label> <input type="tel" size="20" id="company_phone" name="company_phone" value="[% phone | html %]" /></li> |
| 232 |
<li><label for="company_fax">Fax: </label> <input type="tel" size="20" id="company_fax" name="company_fax" value="[% fax | html %]" /></li> |
| 233 |
<li><label for="website">Website: </label> <input type="url" size="40" id="website" name="website" value="[% url | html %]" class="url" /></li> |
| 234 |
<li><label for="accountnumber">Account number: </label> <input type="text" size="40" id="accountnumber" name="accountnumber" value="[% accountnumber | html %]" /></li> |
| 235 |
<li> |
| 236 |
<label for="vendor_type">Vendor type: </label> |
| 237 |
[% PROCESS 'av-build-dropbox.inc' name="vendor_type", category="VENDOR_TYPE", default=type, empty=1, size = 20 %] |
| 238 |
</li> |
| 239 |
<li> |
| 240 |
<label for="aliases">Aliases: </label> |
| 241 |
<div id="aliases" style="padding-left: 11rem;"></div> |
| 242 |
</li> |
| 243 |
</ol> |
| 244 |
</fieldset> |
| 245 |
<fieldset class="rows"> |
| 246 |
<legend>Contacts</legend> |
| 247 |
<fieldset id="contact-template" class="supplier-contact"> |
| 248 |
<legend>Contact details</legend> |
| 249 |
[% INCLUDE edit_contact %] |
| 250 |
</fieldset> |
| 251 |
[% FOREACH contact IN contacts %] |
| 252 |
<fieldset class="supplier-contact"> |
| 253 |
<legend>Contact details</legend> |
| 254 |
[% INCLUDE edit_contact %] |
| 255 |
</fieldset> |
| 256 |
[% END %] |
| 257 |
<button id="add-contact" class="btn btn-default"><i class="fa fa-plus"></i> Add another contact</button> |
| 258 |
</fieldset> |
| 259 |
|
| 260 |
<fieldset class="rows"> |
| 261 |
<legend>Interfaces</legend> |
| 262 |
<div id="interfaces"></div> |
| 263 |
</fieldset> |
| 264 |
|
| 265 |
<fieldset class="rows"> |
| 266 |
<legend>Ordering information</legend> |
| 267 |
<ol |
| 268 |
><li |
| 269 |
><label for="activestatus">Vendor is:</label> [% IF ( active ) %] |
| 270 |
<input type="radio" id="activestatus" name="status" value="1" checked="checked" /> |
| 271 |
<label class="radio" for="activestatus">Active</label> |
| 272 |
<input type="radio" id="inactivestatus" name="status" value="0" /> |
| 273 |
<label class="radio" for="inactivestatus">Inactive</label> |
| 274 |
[% ELSE %] |
| 275 |
<input type="radio" id="activestatus" name="status" value="1" /> |
| 276 |
<label class="radio" for="activestatus">Active</label> |
| 277 |
<input type="radio" id="inactivestatus" name="status" value="0" checked="checked" /> |
| 278 |
<label class="radio" for="inactivestatus">Inactive</label> |
| 279 |
[% END %]</li |
| 280 |
> |
| 281 |
<li |
| 282 |
><label for="list_currency">List prices are: </label> |
| 283 |
<select name="list_currency" id="list_currency"> |
| 284 |
[% FOREACH c IN currencies %] |
| 285 |
[% IF booksellerid and c.currency == listprice or not booksellerid and c.active %] |
| 286 |
<option value="[% c.currency | html %]" selected="selected">[% c.currency | html %]</option> |
| 287 |
[% ELSIF not c.archived %] |
| 288 |
<option value="[% c.currency | html %]">[% c.currency | html %]</option> |
| 289 |
[% END %] |
| 290 |
[% END %] |
| 291 |
</select> |
| 292 |
</li> |
| 293 |
<li |
| 294 |
><label for="invoice_currency">Invoice prices are: </label> |
| 295 |
<select name="invoice_currency" id="invoice_currency"> |
| 296 |
[% FOREACH c IN currencies %] |
| 297 |
[% IF booksellerid and c.currency == invoiceprice or not booksellerid and c.active %] |
| 298 |
<option value="[% c.currency | html %]" selected="selected">[% c.currency | html %]</option> |
| 299 |
[% ELSIF not c.archived %] |
| 300 |
<option value="[% c.currency | html %]">[% c.currency | html %]</option> |
| 301 |
[% END %] |
| 302 |
[% END %] |
| 303 |
</select> |
| 304 |
</li> |
| 305 |
<li |
| 306 |
><label for="gstyes">Tax number registered:</label> [% IF ( gstreg ) %] |
| 307 |
<label class="radio" for="gstyes">Yes</label> |
| 308 |
<input type="radio" name="gst" id="gstyes" value="1" checked="checked" /> |
| 309 |
<label class="radio" for="gstno">No</label> |
| 310 |
<input type="radio" name="gst" id="gstno" value="0" /> |
| 311 |
[% ELSE %] |
| 312 |
<label class="radio" for="gstyes">Yes</label> |
| 313 |
<input type="radio" name="gst" id="gstyes" value="1" /> |
| 314 |
<label class="radio" for="gstno">No</label> |
| 315 |
<input type="radio" name="gst" id="gstno" value="0" checked="checked" /> |
| 316 |
[% END %]</li |
| 317 |
> |
| 318 |
|
| 319 |
<li |
| 320 |
><label for="list_gstyes">List prices:</label> [% IF ( listincgst ) %] |
| 321 |
<label class="radio" for="list_gstyes">Include tax</label> |
| 322 |
<input type="radio" id="list_gstyes" name="list_gst" value="1" checked="checked" /> |
| 323 |
<label class="radio" for="list_gstno">Don't include tax</label> |
| 324 |
<input type="radio" id="list_gstno" name="list_gst" value="0" /> |
| 325 |
[% ELSE %] |
| 326 |
<label class="radio" for="list_gstyes">Include tax</label> |
| 327 |
<input type="radio" id="list_gstyes" name="list_gst" value="1" /> |
| 328 |
<label class="radio" for="list_gstno">Don't include tax</label> |
| 329 |
<input type="radio" id="list_gstno" name="list_gst" value="0" checked="checked" /> |
| 330 |
[% END %]</li |
| 331 |
> |
| 332 |
|
| 333 |
<li |
| 334 |
><label for="invoice_gstyes">Invoice prices:</label> [% IF ( invoiceincgst ) %] |
| 335 |
<label class="radio" for="invoice_gstyes">Include tax</label> |
| 336 |
<input type="radio" id="invoice_gstyes" name="invoice_gst" value="1" checked="checked" /> |
| 337 |
<label class="radio" for="invoice_gstno">Don't include tax</label> |
| 338 |
<input type="radio" id="invoice_gstno" name="invoice_gst" value="0" /> |
| 339 |
[% ELSE %] |
| 340 |
<label class="radio" for="invoice_gstyes">Include tax</label> |
| 341 |
<input type="radio" id="invoice_gstyes" name="invoice_gst" value="1" /> |
| 342 |
<label class="radio" for="invoice_gstno">Don't include tax</label> |
| 343 |
<input type="radio" id="invoice_gstno" name="invoice_gst" value="0" checked="checked" /> |
| 344 |
[% END %]</li |
| 345 |
> |
| 346 |
|
| 347 |
[% IF gst_values %] |
| 348 |
<li> |
| 349 |
<label for="tax_rate">Tax rate: </label> |
| 350 |
<select name="tax_rate" id="tax_rate"> |
| 351 |
[% FOREACH gst IN gst_values %] |
| 352 |
[% IF ( tax_rate == gst.option ) %] |
| 353 |
<option value="[% gst.option | html %]" selected="selected">[% gst.option * 100 | html %] %</option> |
| 354 |
[% ELSE %] |
| 355 |
<option value="[% gst.option | html %]">[% gst.option * 100 | html %] %</option> |
| 356 |
[% END %] |
| 357 |
[% END %] |
| 358 |
</select> |
| 359 |
</li> |
| 360 |
[% ELSE %] |
| 361 |
<input type="hidden" name="tax_rate" value="0" /> |
| 362 |
[% END %] |
| 363 |
<li><label for="discount">Discount: </label> <input class="rate" type="text" size="6" id="discount" name="discount" value="[% discount | html %]" />%</li> |
| 364 |
<li> |
| 365 |
<label for="deliverytime">Delivery time: </label> |
| 366 |
<input type="text" size="2" id="deliverytime" name="deliverytime" value="[% deliverytime | html %]" /> days |
| 367 |
</li> |
| 368 |
<li><label for="notes">Notes: </label> <textarea cols="40" rows="4" id="notes" name="notes">[% notes | html %]</textarea></li> |
| 369 |
</ol> |
| 370 |
</fieldset> |
| 371 |
</form> |
| 372 |
[% ELSE %] |
| 373 |
<h1>[% name | html %]</h1> |
| 374 |
<div class="row"> |
| 375 |
<div class="col"> |
| 376 |
<div id="supplier-company-details" class="page-section rows"> |
| 377 |
<h2>Vendor details</h2> |
| 378 |
<ol> |
| 379 |
<li> |
| 380 |
<span class="label">Type: </span> |
| 381 |
[% IF (type) %][% AuthorisedValues.GetByCode( 'VENDOR_TYPE', type ) | html %][% END %] |
| 382 |
</li> |
| 383 |
<li><span class="label">Company name: </span>[% name | html %]</li> |
| 384 |
<li><span class="label">Postal address: </span>[% postal | html %]</li> |
| 385 |
<li><span class="label">Physical address: </span>[% address1 | html %][% address2 | html %][% address3 | html %][% address4 | html %]</li> |
| 386 |
<li><span class="label">Phone: </span>[% phone | html %]</li> |
| 387 |
<li><span class="label">Fax: </span>[% fax | html %]</li> |
| 388 |
[% IF ( url ) %] |
| 389 |
<li><span class="label">Website: </span><a href="[% url | url %]" target="_blank">[% url | html %]</a></li> |
| 390 |
[% END %] |
| 391 |
[% IF ( accountnumber ) %] |
| 392 |
<li><span class="label">Account number: </span>[% accountnumber | html %]</li> |
| 393 |
[% END %] |
| 394 |
[% IF vendor.aliases.count %] |
| 395 |
<li> |
| 396 |
<span class="label">Aliases: </span> |
| 397 |
<ul> |
| 398 |
[% FOR alias IN vendor.aliases %] |
| 399 |
<li>[% alias.alias | html %]</li> |
| 400 |
[% END %] |
| 401 |
</ul> |
| 402 |
</li> |
| 403 |
[% END %] |
| 404 |
</ol> |
| 405 |
</div> |
| 406 |
<!-- /#supplier-company-details --> |
| 407 |
|
| 408 |
<div id="supplier-ordering-information" class="page-section rows"> |
| 409 |
<h2>Ordering information</h2> |
| 410 |
<li><span class="label">Vendor is: </span>[% IF ( active ) %]Active[% ELSE %]Inactive[% END %]</li> |
| 411 |
<li><span class="label">List prices are: </span>[% listprice | html %]</li> |
| 412 |
<li><span class="label">Invoice prices are: </span>[% invoiceprice | html %]</li> |
| 413 |
[% IF ( tax_rate ) %] |
| 414 |
<li><span class="label">Tax number registered: </span>[% IF ( gstreg ) %]Yes[% ELSE %]No[% END %]</li> |
| 415 |
<li><span class="label">List item price includes tax: </span>[% IF ( listincgst ) %]Yes[% ELSE %]No[% END %]</li> |
| 416 |
<li><span class="label">Invoice item price includes tax: </span>[% IF ( invoiceincgst ) %]Yes[% ELSE %]No[% END %]</li> |
| 417 |
[% END %] |
| 418 |
<li><span class="label">Discount: </span>[% ( discount || 0 ) | format("%.1f" ) %] %</li> |
| 419 |
<li><span class="label">Tax rate: </span>[% ( tax_rate || 0 ) * 100 | html %] %</li> |
| 420 |
[% IF deliverytime.defined %] |
| 421 |
<li><span class="label">Delivery time: </span>[% deliverytime | html %] days</li> |
| 422 |
[% END %] |
| 423 |
[% IF ( notes ) %] |
| 424 |
<li><span class="label">Notes: </span>[% notes | html %]</li> |
| 425 |
[% END %] |
| 426 |
</div> |
| 427 |
<!-- #supplier-ordering-information --> |
| 428 |
|
| 429 |
[% IF vendor.interfaces.count %] |
| 430 |
<div id="supplier-interfaces" class="page-section rows"> |
| 431 |
<h2>Interfaces</h2> |
| 432 |
|
| 433 |
[% FOR i IN vendor.interfaces %] |
| 434 |
<h3>[% i.name | html %]</h3> |
| 435 |
[% IF i.type %] |
| 436 |
<li><span class="label">Type: </span>[% AuthorisedValues.GetByCode( 'VENDOR_INTERFACE_TYPE', i.type) | html %]</li> |
| 437 |
[% END %] |
| 438 |
[% IF i.uri %] |
| 439 |
<li> <span class="label">URI: </span><a href="[% i.uri | url %]" target="_blank">[% i.uri | html %]</a> </li> |
| 440 |
[% END %] |
| 441 |
[% IF i.login %] |
| 442 |
<li><span class="label">Login: </span>[% i.login | html %]</li> |
| 443 |
[% END %] |
| 444 |
[% IF i.password %] |
| 445 |
<li |
| 446 |
><span class="label">Password: </span><span class="password"><a href="#" class="show_password" data-plain-text-password="[% i.plain_text_password | html %]">Show</a></span></li |
| 447 |
> |
| 448 |
[% END %] |
| 449 |
[% IF i.account_email %] |
| 450 |
<li><span class="label">Account email: </span>[% i.account_email | html %]</li> |
| 451 |
[% END %] |
| 452 |
[% IF i.notes %] |
| 453 |
<li><span class="label">Notes: </span>[% i.notes | html %]</li> |
| 454 |
[% END %] |
| 455 |
[% END %] |
| 456 |
</div> |
| 457 |
[% END %] |
| 458 |
</div> |
| 459 |
<!-- /.col --> |
| 460 |
|
| 461 |
<div class="col"> |
| 462 |
<div id="supplier-contact-details" class="page-section rows"> |
| 463 |
<h2>Contact</h2> |
| 464 |
[% FOREACH contact IN contacts %] |
| 465 |
[% INCLUDE show_contact %] |
| 466 |
[% END %] |
| 467 |
</div> |
| 468 |
<!-- /#supplier-contact-details --> |
| 469 |
|
| 470 |
<div id="subscription-details" class="page-section"> |
| 471 |
<h2>Subscription details</h2> |
| 472 |
<p |
| 473 |
><strong>Number of subscriptions: </strong> |
| 474 |
[% IF ( CAN_user_serials ) %] |
| 475 |
<a href="/cgi-bin/koha/serials/serials-search.pl?bookseller_filter=[% name | uri %]&searched=1">[% subscriptioncount | html %]</a> |
| 476 |
[% ELSE %] |
| 477 |
[% subscriptioncount | html %] |
| 478 |
[% END %] |
| 479 |
</p> |
| 480 |
</div> |
| 481 |
<!-- /#subscription-details --> |
| 482 |
</div> |
| 483 |
<!-- /.col --> |
| 484 |
</div> |
| 485 |
<!-- /.row --> |
| 486 |
|
| 487 |
[% IF ( contracts ) %] |
| 488 |
<div id="supplier-contracts" class="page-section rows"> |
| 489 |
<h2>Contract(s)</h2> |
| 490 |
<table id="contractst"> |
| 491 |
<thead> |
| 492 |
<tr> |
| 493 |
<th scope="col">Name</th> |
| 494 |
<th scope="col">Description</th> |
| 495 |
<th scope="col">Start date</th> |
| 496 |
<th scope="col">End date</th> |
| 497 |
[% IF CAN_user_acquisition_contracts_manage %] |
| 498 |
<th scope="col" class="NoSort noExport">Actions</th> |
| 499 |
[% END %] |
| 500 |
</tr> |
| 501 |
</thead> |
| 502 |
<tbody> |
| 503 |
[% FOREACH contract IN contracts %] |
| 504 |
<tr> |
| 505 |
<td> |
| 506 |
<a href="/cgi-bin/koha/admin/aqcontract.pl?op=add_form&contractnumber=[% contract.contractnumber | uri %]&booksellerid=[% contract.booksellerid | uri %]">[% contract.contractname | html %]</a> |
| 507 |
</td> |
| 508 |
<td>[% contract.contractdescription | html %]</td> |
| 509 |
<td data-order="[% contract.contractstartdate | html %]">[% contract.contractstartdate | $KohaDates %]</td> |
| 510 |
<td data-order="[% contract.contractenddate | html %]">[% contract.contractenddate | $KohaDates %]</td> |
| 511 |
[% IF CAN_user_acquisition_contracts_manage %] |
| 512 |
<td class="actions"> |
| 513 |
<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 %]" |
| 514 |
><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit</a |
| 515 |
> |
| 516 |
<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 %]" |
| 517 |
><i class="fa fa-trash-can"></i> Delete</a |
| 518 |
> |
| 519 |
</td> |
| 520 |
[% END %] |
| 521 |
</tr> |
| 522 |
[% END %] |
| 523 |
</tbody> |
| 524 |
</table> |
| 525 |
</div> |
| 526 |
<!-- /#supplier-contracts --> |
| 527 |
[% END %] |
| 528 |
[% END %] |
| 529 |
[% END %] |
| 530 |
|
| 531 |
[% MACRO jsinclude BLOCK %] |
| 532 |
[% Asset.js("js/acquisitions-menu.js") | $raw %] |
| 533 |
[% Asset.js("js/acq.js") | $raw %] |
| 534 |
[% INCLUDE 'datatables.inc' %] |
| 535 |
[% Asset.js("js/vue/dist/islands.js", "init" => "1") | $raw %] |
| 536 |
<script> |
| 537 |
function add_contact() { |
| 538 |
var new_contact = $('#contact-template').clone(); |
| 539 |
var timestamp = new Date().getTime(); |
| 540 |
$(new_contact).removeAttr('id'); |
| 541 |
$('input, textarea', new_contact).each(function () { |
| 542 |
$(this).attr('id', $(this).attr('id') + '_' + timestamp); |
| 543 |
}); |
| 544 |
$(new_contact).insertBefore(this); |
| 545 |
if ($('.supplier-contact').length === 2) { // First contact |
| 546 |
$.each(['.contact_acqprimary', '.contact_serialsprimary', '.contact_orderacquisition', '.contact_claimacquisition', '.contact_claimissues'], function (idx, checkbox) { |
| 547 |
$(checkbox, new_contact).click(); |
| 548 |
}); |
| 549 |
} |
| 550 |
$('input[name="contact_name"]', new_contact).focus(); |
| 551 |
return false; |
| 552 |
} |
| 553 |
|
| 554 |
function delete_contact(ev) { |
| 555 |
$(this).parents('.supplier-contact').remove(); |
| 556 |
ev.preventDefault(); |
| 557 |
} |
| 558 |
|
| 559 |
[% IF vendor %] |
| 560 |
let aliases = [% To.json(vendor.aliases.unblessed) | $raw %]; |
| 561 |
[% ELSE %] |
| 562 |
let aliases = []; |
| 563 |
[% END %] |
| 564 |
function remove_alias(i){ |
| 565 |
aliases.splice(i, 1); |
| 566 |
refresh_aliases(); |
| 567 |
} |
| 568 |
|
| 569 |
function encodeHTMLEntities(str){ |
| 570 |
return str.replace(/[&<>'"]/g, |
| 571 |
tag => ({ |
| 572 |
'&': '&', |
| 573 |
'<': '<', |
| 574 |
'>': '>', |
| 575 |
"'": ''', |
| 576 |
'"': '"' |
| 577 |
}[tag])); |
| 578 |
} |
| 579 |
|
| 580 |
function add_alias(){ |
| 581 |
let alias = $("#new_alias").val(); |
| 582 |
if ( !alias.length > 0 ) { return } |
| 583 |
aliases.push({alias}); |
| 584 |
refresh_aliases(); |
| 585 |
} |
| 586 |
function refresh_aliases(){ |
| 587 |
let nodes = $("<div></div>"); |
| 588 |
aliases.forEach((a, i) => { |
| 589 |
let alias_str = encodeHTMLEntities(a.alias); |
| 590 |
let n = $("<div></div>").append(alias_str); |
| 591 |
let input = $('<input type="hidden" name="alias" />'); |
| 592 |
input.val(a.alias); |
| 593 |
n.append(input); |
| 594 |
n.append(` <a style="cursor: pointer;" onclick="remove_alias(${i});"><i class="fa fa-trash" aria-hidden="true"></i> ` + _("Remove") + '</a>'); |
| 595 |
nodes.append(n); |
| 596 |
}); |
| 597 |
nodes.append("<input id='new_alias' type='text' class='noEnterSubmit' />"); |
| 598 |
nodes.append(' <a style="cursor: pointer;" onclick="add_alias();"><i class="fa fa-plus" aria-hidden="true"></i> ' + _("Add") + '</a>'); |
| 599 |
$("#aliases").html(nodes.html()); |
| 600 |
} |
| 601 |
|
| 602 |
[% IF vendor %] |
| 603 |
let interfaces = []; |
| 604 |
[% FOR i_object IN vendor.interfaces %] |
| 605 |
[% SET i = i_object.unblessed %] |
| 606 |
[% SET i.password = i_object.plain_text_password %] |
| 607 |
interfaces.push([% To.json(i) | $raw %]); |
| 608 |
[% END %] |
| 609 |
[% ELSE %] |
| 610 |
let interfaces = []; |
| 611 |
[% END %] |
| 612 |
function serialize_interface_form(){ |
| 613 |
interfaces = []; |
| 614 |
$("#interfaces > fieldset.supplier-interface > ol.interface-form").each( (index, interface_form )=> { |
| 615 |
let interface = {}; |
| 616 |
$(interface_form).find('input,textarea,select').serializeArray().map(attr => { |
| 617 |
let name = attr.name.replace(/interface_([\w_]+)_\d+/, "$1"); |
| 618 |
interface[name] = attr.value |
| 619 |
}) |
| 620 |
interfaces.push(interface); |
| 621 |
}); |
| 622 |
return interfaces; |
| 623 |
} |
| 624 |
function remove_interface(i){ |
| 625 |
interfaces = serialize_interface_form(); |
| 626 |
interfaces.splice(i, 1); |
| 627 |
refresh_interfaces(); |
| 628 |
} |
| 629 |
function add_interface(){ |
| 630 |
interfaces = serialize_interface_form(); |
| 631 |
interfaces.push({ |
| 632 |
type: "", |
| 633 |
name: "", |
| 634 |
uri: "", |
| 635 |
login: "", |
| 636 |
password: "", |
| 637 |
account_email: "", |
| 638 |
notes: "", |
| 639 |
}); |
| 640 |
refresh_interfaces(); |
| 641 |
} |
| 642 |
let av_select = { |
| 643 |
VENDOR_INTERFACE_TYPE: $("[% PROCESS 'av-build-dropbox.inc', category="VENDOR_INTERFACE_TYPE" empty=1 | replace('\n', '') | replace('"', '\"') %]"), |
| 644 |
}; |
| 645 |
function refresh_interfaces(){ |
| 646 |
let nodes = $("<div id='interfaces'></div>"); |
| 647 |
interfaces.forEach((interface, i) => { |
| 648 |
let n = $("<fieldset class='supplier-interface'></fieldset>"); |
| 649 |
n.append("<legend>" + _("Interface details") + "</legend>"); |
| 650 |
n.append(`<input type="hidden" name="interface_counter" value="${i}" />`); |
| 651 |
let ol = $('<ol class="interface-form"></ol>'); |
| 652 |
let attributes = [ |
| 653 |
{ label: _("Name:"), name: 'name', type: 'text', node: 'input' }, |
| 654 |
{ label: _("Type:"), name: 'type', type: 'select', node: 'av_select', av_cat: 'VENDOR_INTERFACE_TYPE' }, |
| 655 |
{ label: _("URI:"), name: 'uri', type: 'url', node: 'input' }, |
| 656 |
{ label: _("Login:"), name: 'login', type: 'text', node: 'input' }, |
| 657 |
{ label: _("Password:"), name: 'password', type: 'text', node: 'input' }, |
| 658 |
{ label: _("Account email:"), name: 'account_email', type: 'email', node: 'input' }, |
| 659 |
{ label: _("Notes:"), name: 'notes', type: 'textarea', node: 'textarea' } |
| 660 |
]; |
| 661 |
attributes.forEach((attribute, ii) => { |
| 662 |
let li = $('<li></li>'); |
| 663 |
li.append(`<label for="interface_${attribute.name}_${i}">${attribute.label}</label>`); |
| 664 |
if( attribute.node == 'input' ) { |
| 665 |
li.append(`<input type="${attribute.type}" size="40" id="interface_${attribute.name}_${i}" name="interface_${attribute.name}_${i}" value="${interface[attribute.name]}" />`); |
| 666 |
} else if ( attribute.node == 'textarea' ) { |
| 667 |
li.append(`<textarea cols="40" rows="3" id="interface_${attribute.name}_${i}" name="interface_${attribute.name}_${i}">${interface[attribute.name]}</textarea>`); |
| 668 |
} else if ( attribute.node == 'av_select' ) { |
| 669 |
let select = av_select[attribute.av_cat].clone(); |
| 670 |
select.attr('name', `interface_${attribute.name}_${i}`); |
| 671 |
select.find(`option[value='${interface[attribute.name]}']`).prop("selected", true); |
| 672 |
li.append(select); |
| 673 |
} |
| 674 |
ol.append(li); |
| 675 |
}); |
| 676 |
ol.append(`<li><button class="btn btn-default" onclick="remove_interface(${i});"><i class="fa fa-trash"></i> ` + _("Delete interface") + '</li>'); |
| 677 |
n.append(ol); |
| 678 |
nodes.append(n); |
| 679 |
}); |
| 680 |
nodes.append(`<button onclick="add_interface();" class="btn btn-default"><i class="fa fa-plus"></i> ` + _("Add another interface") + '</button>') |
| 681 |
$("#interfaces").replaceWith(nodes); |
| 682 |
|
| 683 |
interfaces.forEach((interface, i) => { |
| 684 |
$("#interface_account_email_" + i).rules("add", { |
| 685 |
email: true, |
| 686 |
}); |
| 687 |
}); |
| 688 |
} |
| 689 |
|
| 690 |
$(document).ready(function() { |
| 691 |
var contractst = $("#contractst").dataTable($.extend(true, {}, dataTablesDefaults, { |
| 692 |
"columnDefs": [ |
| 693 |
{ "orderable": false, "searchable": false, "targets": [ 'NoSort' ] } |
| 694 |
], |
| 695 |
"dom": 't' |
| 696 |
} ) ); |
| 697 |
$('body').on('click', '.delete-contact', null, delete_contact); |
| 698 |
$('#add-contact').click(add_contact); |
| 699 |
$('body').on('click', '.contact_acqprimary', null, function () { |
| 700 |
if ($(this).is(':checked')) { |
| 701 |
$('.contact_acqprimary').filter(':checked').not(this).prop('checked', false); |
| 702 |
$('.contact_acqprimary_hidden').each(function () { |
| 703 |
$(this).val('0'); |
| 704 |
}); |
| 705 |
} |
| 706 |
$(this).next('.contact_acqprimary_hidden').val('1'); |
| 707 |
}); |
| 708 |
$('body').on('click', '.contact_serialsprimary', null, function () { |
| 709 |
if ($(this).is(':checked')) { |
| 710 |
$('.contact_serialsprimary').filter(':checked').not(this).prop('checked', false); |
| 711 |
$('.contact_serialsprimary_hidden').each(function () { |
| 712 |
$(this).val('0'); |
| 713 |
}); |
| 714 |
} |
| 715 |
$(this).next('.contact_serialsprimary_hidden').val($(this).is(':checked') ? '1' : '0'); |
| 716 |
}); |
| 717 |
$('body').on('click', '.contact_orderacquisition', null, function () { |
| 718 |
$(this).next('.contact_orderacquisition_hidden').val($(this).is(':checked') ? '1' : '0'); |
| 719 |
}); |
| 720 |
$('body').on('click', '.contact_claimacquisition', null, function () { |
| 721 |
$(this).next('.contact_claimacquisition_hidden').val($(this).is(':checked') ? '1' : '0'); |
| 722 |
}); |
| 723 |
$('body').on('click', '.contact_claimissues', null, function () { |
| 724 |
$(this).next('.contact_claimissues_hidden').val($(this).is(':checked') ? '1' : '0'); |
| 725 |
}); |
| 726 |
|
| 727 |
$('body').on('click', '.show_password', null, function(e){ |
| 728 |
e.preventDefault(); |
| 729 |
$(this).parent().replaceWith($(this).data('plain-text-password')); |
| 730 |
}); |
| 731 |
refresh_aliases(); |
| 732 |
refresh_interfaces(); |
| 733 |
|
| 734 |
}); |
| 735 |
</script> |
| 736 |
[% END %] |
| 737 |
|
| 738 |
[% INCLUDE 'intranet-bottom.inc' %] |