Bug 26602: Don't export "actions" column
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / acqui / orderreceive.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE KohaDates %]
4 [% USE Branches %]
5 [% USE AuthorisedValues %]
6 [% USE ItemTypes %]
7 [% USE Price %]
8 [% SET footerjs = 1 %]
9 [% INCLUDE 'doc-head-open.inc' %]
10 <title>Koha &rsaquo; Acquisitions &rsaquo; Receipt summary for : [% name | html %] [% IF ( invoice ) %]invoice, [% invoice | html %][% END %]</title>
11 [% INCLUDE 'doc-head-close.inc' %]
12 </head>
13
14 <body id="acq_orderreceive" class="acq">
15 [% INCLUDE 'header.inc' %]
16 [% INCLUDE 'acquisitions-search.inc' %]
17
18 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a> &rsaquo; <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% order.basket.booksellerid | html %]">[% name | html %]</a> &rsaquo; Receive items from : [% name | html %] [% IF ( invoice ) %][[% invoice | html %]][% END %] (order #[% order.ordernumber | html %])</div>
19
20 <div class="main container-fluid">
21     <div class="row">
22     [% AcqCreateItem = order.basket.effective_create_items %]
23         <div class="col-sm-10 col-sm-push-2">
24             <main>
25
26 <h1>Receive items from : [% name | html %] [% IF ( invoice ) %][[% invoice | html %]] [% END %] (order #[% order.ordernumber | html %])</h1>
27
28 [% IF ( order ) %]
29     <form action="/cgi-bin/koha/acqui/finishreceive.pl" class="noEnterSubmit" method="post" onsubmit="return Check(this);">
30 <div class="row">
31 <div class="col-sm-6">
32     <div class="dialog alert order_error" style="display:none"></div>
33
34     <fieldset class="rows">
35     <legend>Catalog details</legend>
36     <ol><li><span class="label">Title: </span><span class="title">[% order.biblio.title | html %]</span></li>
37     <li> <span class="label">Author: </span>
38         [% order.biblio.author | html %]</li>
39     <li><span class="label">Copyright: </span>
40         [% order.biblio.copyrightdate | html %]</li>
41     <li> <span class="label">ISBN: </span>
42         [% order.biblio.biblioitem.isbn | html %]</li>
43     <li> <span class="label">Series: </span>
44         [% order.biblio.seriestitle | html %]</li>
45     </ol>
46         </fieldset>
47
48     [% IF suggestion %]
49         <fieldset class="rows">
50         <legend>Suggestion</legend>
51         <ol>
52           <li>
53             <span class="label">Suggested by: </span>
54             [% suggestion.surnamesuggestedby | html %][% IF suggestion.firstnamesuggestedby %], [% suggestion.firstnamesuggestedby | html %][% END %] (<a href="/cgi-bin/koha/suggestion/suggestion.pl?suggestionid=[% suggestion.suggestionid | uri %]&amp;op=show">suggestion #[% suggestion.suggestionid | html %]</a>)
55             [% IF suggestion.reason %]
56                 <li>
57                     <span class="label">Reason:</span>
58                     [% SET suggestion_reasons = AuthorisedValues.GetAuthValueDropbox( 'SUGGEST' ) %]
59                     [% SET other_reason = 1 %]
60                     <select class="select-reason" id="reason" name="reason">
61                         <option value=""> -- Choose a reason -- </option>
62                         [% FOREACH reason IN suggestion_reasons %]
63                             [% IF reason.lib == suggestion.reason %]
64                                 <option value="[% reason.lib | html %]" selected="selected">[% reason.lib | html %]</option>
65                                 [% SET other_reason = 0 %]
66                             [% ELSE %]
67                                 <option value="[% reason.lib | html %]">[% reason.lib | html %]</option>
68                             [% END %]
69                         [% END %]
70                         <option value="other">Others...</option>
71                     </select>
72
73                     <span id="other_reason" name="other_reason">
74                         [% IF other_reason %]
75                             <input type="text" size="31" id="select-other_reason" name="other_reason" placeholder="please note your reason here..." value="[% suggestion.reason | html %]"/>
76                         [% ELSE %]
77                             <input type="text" size="31" id="select-other_reason" name="other_reason" placeholder="please note your reason here..." />
78                         [% END %]
79                         <a href="#back">Cancel</a>
80                     </span>
81
82                     <input type="hidden" name="suggestionid" value="[% suggestion.suggestionid | html %]" />
83                 </li>
84             [% END %]
85           </li>
86         </ol>
87         </fieldset>
88     [% END %]
89
90     [% IF order.subscriptionid and orders.count %]
91         <fieldset class="rows">
92             <legend>Receipt history for this subscription</legend>
93             <table id="orders">
94                 <thead>
95                     <tr>
96                         <th>Invoice</th>
97                         <th>Order number</th>
98                         <th class="title-string">Creation date</th>
99                         <th class="title-string">Receive date</th>
100                         <th>Quantity received</th>
101                         <th class="title-string">Status</th>
102                         <th title="Actual cost tax exc. / Actual cost tax inc.">Spent</th>
103                         <th>Internal note</th>
104                     </tr>
105                 </thead>
106                 <tbody>
107                 [% FOR suborder IN orders %]
108                     <tr>
109                         <td>
110                         [% IF suborder.invoice %]
111                             [% IF CAN_user_acquisition %]
112                                 <a href="/cgi-bin/koha/acqui/invoice.pl?invoiceid=[% suborder.invoiceid | uri %]" title="Invoice detail page">
113                                    [% suborder.invoice.invoicenumber | html %]</a>
114                             [% ELSE %]
115                                 [% suborder.invoice.invoicenumber | html %]
116                             [% END %]
117                         [% END %]
118                         </td>
119                         <td>[% suborder.ordernumber | html %]</td>
120                         <td><span title="[% suborder.basket.creationdate | uri %]">[% suborder.basket.creationdate | $KohaDates%]</span></td>
121                         <td>[% IF suborder.datereceived %]<span title="[% suborder.datereceived | uri %]">[% suborder.datereceived | $KohaDates %]</span>[% END %]</td>
122                         <td>[% suborder.quantityreceived | html %]</td>
123                         <td>
124                           [% SWITCH suborder.orderstatus %]
125                           [%# FIXME We should only see/display Complete here, right? %]
126                             [% CASE 'new' %]<span title="status_1">New</span>
127                             [% CASE 'ordered' %]<span title="status_2">Ordered</span>
128                             [% CASE 'partial' %]<span title="status_3">Partial</span>
129                             [% CASE 'complete' %]<span title="status_4">Complete</span>
130                             [% CASE 'cancelled' %]<span title="status_5">Cancelled</span>
131                           [% END %]
132                         </td>
133                         <td>
134                             [% IF suborder.datereceived %][%# FIXME Should only be true, right? %]
135                                 [%# FIXME What if unitprice has not been filled? %]
136                                 [% suborder.unitprice_tax_excluded * suborder.quantity | $Price %] / [% suborder.unitprice_tax_included * suborder.quantity | $Price %]
137                             [% END %]
138                         </td>
139                         <td>[% suborder.order_internalnote | html %]</td>
140                     </tr>
141                 [% END %]
142                 </tbody>
143             </table>
144         </fieldset>
145     [% ELSIF (AcqCreateItem == 'receiving') %]
146         <div id="items_list" style="display:none">
147             <p><strong>Items list</strong></p>
148             <div style="width:100%;overflow:auto;">
149                 <table>
150                     <thead>
151                         <tr>
152                             <th class="noExport">Actions</th>
153                             <th>Barcode</th>
154                             <th>Home library</th>
155                             <th>Holding library</th>
156                             <th>Not for loan</th>
157                             <th>Restricted</th>
158                             <th>Location</th>
159                             <th>Call number</th>
160                             <th>Copy number</th>
161                             <th>Inventory number</th>
162                             <th>Collection</th>
163                             <th>Item type</th>
164                             <th>Materials</th>
165                             <th>Notes</th>
166                         </tr>
167                     </thead>
168                     <tbody>
169                     </tbody>
170                 </table>
171             </div>
172         </div>
173
174         [% UNLESS order.subscriptionid %]
175           <fieldset class="rows" id="itemfieldset">
176               <legend>Item</legend>
177               [% IF ( NoACQframework ) %]
178                   <p class="required">
179                       No ACQ framework, using default. You should create a
180                       framework with code ACQ, the items framework would be
181                       used
182                   </p>
183               [% END %]
184               <div id="outeritemblock"></div>
185           </fieldset>
186         [% END %]
187     [% ELSIF (AcqCreateItem == 'ordering') %]
188         [% IF (order.items) %]
189             <h5>Items</h5>
190             <div style="width:100%;overflow:auto">
191                 <table>
192                     <thead>
193                         <tr>
194                             <th>Receive?</th>
195                             <th>&nbsp;</th>
196                             <th>Barcode</th>
197                             <th>Home library</th>
198                             <th>Current library</th>
199                             <th>Not for loan</th>
200                             <th>Restricted</th>
201                             <th>Location</th>
202                             <th>Call number</th>
203                             <th>Copy number</th>
204                             <th>Inventory number</th>
205                             <th>Collection</th>
206                             <th>Item type</th>
207                             <th>Materials</th>
208                             <th>Notes</th>
209                         </tr>
210                     </thead>
211                     <tbody>
212                         [% FOREACH item IN order.items %]
213                             <tr id="item_[% item.itemnumber | html %]">
214                                 <td style="text-align:center"><input type="checkbox" name="items_to_receive" value="[% item.itemnumber | html %]" /></td>
215                                 <td><a style="cursor:pointer" onclick="PopupEditPage([% item.biblionumber | html %],[% item.itemnumber | html %]);">Edit</a></td>
216                                 <td>[% item.barcode | html %]</td>
217                                 <td>[% Branches.GetName( item.homebranch ) | html %]</td>
218                                 <td>[% Branches.GetName( item.holdingbranch ) | html %]</td>
219                                 <td>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.notforloan', authorised_value => item.notforloan ) | html %]</td>
220                                 <td>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.restricted', authorised_value => item.restricted ) | html %]</td>
221                                 <td><span class="shelvingloc">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => item.location ) | html %]</span></td>
222                                 <td>[% item.itemcallnumber | html %]</td>
223                                 <td>[% item.copynumber | html %]</td>
224                                 <td>[% item.stocknumber | html %]</td>
225                                 <td>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => item.ccode ) | html %]</td>
226                                 <td>[% ItemTypes.GetDescription( item.itype ) | html %]</td>
227                                 <td>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.materials', authorised_value => item.materials ) | html %]</td>
228                                 <td>[% item.itemnotes | html %]</td>
229                             </tr>
230                         [% END %]
231                     </tbody>
232                 </table>
233             </div>
234         [% END %]
235     [% END %]
236     <input type="hidden" name="biblionumber" value="[% order.biblionumber | html %]" />
237     <input type="hidden" name="invoiceid" value="[% invoiceid | html %]" />
238     <input type="hidden" name="ordernumber" value="[% order.ordernumber | html %]" />
239     <input type="hidden" name="booksellerid" value="[% order.basket.booksellerid | html %]" />
240         </div>
241     <div class="col-sm-6">
242     <fieldset class="rows">
243     <legend>Accounting details</legend>
244         <ol>
245             <li>
246                 <label for="datereceived">Date received: </label>
247                 <input type="text" size="10" id="datereceived" name="datereceived" value="[% datereceived | $KohaDates %]" class="datepicker" />
248             </li>
249        <li><label for="bookfund">Fund: </label><select id="bookfund" name="bookfund">
250             <option value="">Keep current ([% budget_period_description | html %] - [% order.fund.budget_name | html %])</option>
251             [% FOREACH period IN budget_loop %]
252                 <optgroup label="[% period.description | html %]">
253                 [% FOREACH fund IN period.funds %]
254                     [% IF ( fund.b_sel ) %]
255                         <option value="[% fund.b_id | html %]" selected="selected">[% fund.b_txt | html %]</option>
256                     [% ELSE %]
257                         <option value="[% fund.b_id | html %]">[% fund.b_txt | html %]</option>
258                     [% END %]
259                 [% END %]
260                 </optgroup>
261             [% END %]
262        </select></li>
263        <li><label>&nbsp;</label><span>(Current: [% budget_period_description | html %] - [% bookfund | html %])</span></li>
264        <li>
265         <label for="creator">Ordered by: </label>
266         <span>
267             [% INCLUDE 'patron-title.inc' patron = creator %]
268         </span>
269        </li>
270        <li><label for="quantity_to_receive">Quantity ordered: </label><span class="label">
271            [% IF edit or order.subscriptionid %]
272                <input type="text" id="quantity_to_receive" name="quantity" value="[% order.quantity | html %]" />
273            [% ELSE%]
274                <input type="text" readonly="readonly" id="quantity_to_receive" name="quantity" value="[% order.quantity | html %]" />
275            [% END %]
276            </span></li>
277         <li><label for="quantity">Quantity received: </label>
278           [% IF order.subscriptionid %]
279               <input type="text" size="20" name="quantityrec" id="quantity" value="[% order.quantity | html %]" />
280               <input id="origquantityrec" readonly="readonly" type="hidden" name="origquantityrec" value="[% order.quantityreceived | html %]" />
281           [% ELSIF AcqCreateItem == 'receiving' %]
282               <input readonly="readonly" type="text" size="20" name="quantityrec" id="quantity" value="0" />
283           [% ELSE %]
284             [% IF ( order.quantityreceived ) %]
285                 [% IF ( edit ) %]
286                     <input type="text" size="20" name="quantityrec" id="quantity" value="[% order.quantityreceived | html %]" />
287                     <input id="origquantityrec" readonly="readonly" type="hidden" name="origquantityrec" value="[% order.quantityreceived | html %]" />
288                 [% ELSE %]
289                     [% IF ( order.items.count ) %]
290                         <input readonly="readonly" type="text" size="20" name="quantityrec" id="quantity" value="[% order.quantityreceived + 1 | html %]" />
291                     [% ELSE %]
292                         <input type="text" size="20" name="quantityrec" id="quantity" value="[% quantityreceived + 1 | html %]" />
293                     [% END %]
294                     <input id="origquantityrec" readonly="readonly" type="hidden" name="origquantityrec" value="[% order.quantityreceived | html %]" />
295                 [% END %]
296             [% ELSE %]
297                 <input type="text" id="quantity" size="20" name="quantityrec" value="1" />
298                 <input id="origquantityrec" readonly="readonly" type="hidden" name="origquantityrec" value="0" />
299             [% END %]
300             <div id="qtyrecerror" style="display:none">
301                 <p class="error">Warning, you have entered more items than expected.
302                 Items will not be created.</p>
303             </div>
304           [% END %][%# IF (order.subscriptionid) ELSIF (AcqCreateItem == 'receiving' ) %]
305                 </li>
306
307         [% IF ( gst_values ) %]
308             <li>
309                 <label for="tax_rate">Tax rate: </label>
310                 <select name="tax_rate" id="tax_rate">
311                 [% tax_rate = order.tax_rate_on_receiving || order.tax_rate_on_ordering %]
312                 [% FOREACH gst IN gst_values %]
313                     [% IF gst.option == tax_rate %]
314                         <option value="[% gst.option | html %]" selected="selected">[% gst.option * 100 | html %]%</option>
315                     [% ELSE %]
316                         <option value="[% gst.option | html %]">[% gst.option * 100 | html %]%</option>
317                     [% END %]
318                 [% END %]
319                 </select>
320             </li>
321         [% ELSE %]
322             <input type="hidden" name="tax_rate" value="0" />
323         [% END %]
324
325         <li><label for="rrp">Retail price: </label>
326             [% IF (invoiceincgst == 1) %]
327                 [% order.rrp_tax_included | $Price %]<span class="hint">(adjusted for [% active_currency.currency | html %],tax inclusive)</span></li>
328             [% ELSE %]
329                 [% order.rrp_tax_excluded | $Price %]<span class="hint">(adjusted for [% active_currency.currency | html %],tax exclusive)</span></li>
330             [% END %]
331         <li>
332             <label for="replacementprice">Replacement price:</label>
333             <input type="text" size="20" name="replacementprice" id="replacementprice" value="[% order.replacementprice | $Price on_editing => 1 %]" />
334         </li>
335         <li>
336             [% IF (invoiceincgst) %]
337                 <label for="ecost">Budgeted cost: </label>[% order.ecost_tax_included | $Price %] <span class="hint">(tax inclusive)</span>
338             [% ELSE %]
339                 <label for="ecost">Budgeted cost: </label>[% order.ecost_tax_excluded | $Price %] <span class="hint">(tax exclusive)</span>
340             [% END %]
341             </li>
342         <li>
343             <label for="unitprice">Actual cost:</label>
344             [% IF (invoiceincgst) %]
345                 <input type="text" size="20" name="unitprice" id="unitprice" value="[% order.unitprice_tax_included | $Price on_editing => 1 %]" /> <span class="hint">(tax inclusive)</span>
346             [% ELSE %]
347                 <input type="text" size="20" name="unitprice" id="unitprice" value="[% order.unitprice_tax_excluded | $Price on_editing => 1 %]" /> <span class="hint">(tax exclusive)</span>
348             [% END %]
349             <label style="font-weight: inherit; float:none;"><input type="checkbox" name="change_currency">Change currency</label>
350         </li>
351         <li id="select_currency">
352             <label for="unitprice_currency"></label>
353             <input type="text" size="20" name="unitprice" id="unitprice_currency" value="" />
354             [% IF currencies.count %]
355                 <select name="currency">
356                     <option value="[% active_currency.rate | html %]" selected="selected">[% active_currency.currency | html %] ([% active_currency.symbol | html %])</option>
357                     [% FOR currency IN currencies %]
358                         <option value="[% currency.rate | html %]">[% currency.currency | html %] ([% currency.symbol | html %])</option>
359                     [% END %]
360                 </select>
361             [% END %]
362         </li>
363         <li><label for="order_internalnote">Internal note: </label><textarea name="order_internalnote" width="40" rows="8" >[% order_internalnote | html %]</textarea></li>
364         [% IF order_vendornote %]
365             <li><label for="order_vendornote">Vendor note: </label><span>[% order_vendornote | html %]</span></li>
366         [% END %]
367         </ol>
368     </fieldset>
369
370 </div>
371 </div><div class="row"><fieldset class="action">
372         <input type="submit"  value="Save" class="button" accesskey="w" />
373         <a class="cancel" href="/cgi-bin/koha/acqui/parcel.pl?invoiceid=[% invoiceid | html %]">Cancel</a>
374 </fieldset></div>    </form>
375 [% ELSE %]
376     This ordernumber does not exist.
377 [% END %]
378
379 </main>
380 </div> <!-- /.col-sm-10.col-sm-push-2 -->
381
382 <div class="col-sm-2 col-sm-pull-10">
383     <aside>
384         [% INCLUDE 'acquisitions-menu.inc' %]
385     </aside>
386 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
387 </div> <!-- /.row -->
388 [% MACRO jsinclude BLOCK %]
389     [% Asset.js("js/acquisitions-menu.js") | $raw %]
390 [% INCLUDE 'calendar.inc' %]
391     [% Asset.js("js/additem.js") | $raw %]
392     [% Asset.js("js/cataloging.js") | $raw %]
393     <script>
394         function Check(form) {
395             [% IF (AcqCreateItem == 'receiving') %]
396                 var total_errors = CheckMandatorySubfields(form);
397                 if (total_errors != 0) {
398                     var alertString = _("Form not submitted because of the following problem(s)");
399                     alertString += "\n------------------------------------------------------------------------------------\n";
400                     alertString += "\n- " + _("%s mandatory fields empty (highlighted)").format(total_errors);
401                     alert(alertString);
402                     return false;
403                 }
404
405                 if(check_additem('[% Koha.Preference("UniqueItemFields") | html %]') == false){
406                     alert(_("Duplicate values detected. Please correct the errors and resubmit.") );
407                     return false;
408                 };
409
410                 // Remove last itemblock if it is not in items_list
411                 var lastitemblock = $("#outeritemblock > div:last");
412                 var tobedeleted = true;
413                 var listitems = $("#items_list tr");
414                 $(listitems).each(function(){
415                     if($(this).attr('idblock') == $(lastitemblock).attr('id')){
416                         tobedeleted = false;
417                     }
418                 });
419                 if(tobedeleted){
420                     $(lastitemblock).remove();
421                 }
422
423                 if(check_additem('[% Koha.Preference("UniqueItemFields") | html %]') == false){
424                     alert(_("Duplicate values detected. Please correct the errors and resubmit.") );
425                     if(tobedeleted) {
426                         $(lastitemblock).appendTo("#outeritemblock");
427                     }
428                     return false;
429                 };
430             [% END %]
431
432             if( $("#quantity").val() < 1 ) {
433                 alert(_("You must receive at least one item"));
434                 return false;
435             }
436
437             return true;
438         }
439
440         [% IF (AcqCreateItem == 'ordering') %]
441             var items_columns = [null, null, 'barcode', 'homebranchname',
442                 'holdingbranchname', 'notforloan', 'restricted', 'location',
443                 'itemcallnumber', 'copynumber', 'stocknumber', 'collection',
444                 'itemtype', 'materials', 'itemnotes'];
445
446             function PopupEditPage(biblionumber, itemnumber) {
447                 var url = "/cgi-bin/koha/cataloguing/additem.pl?op=edititem&biblionumber="
448                     + biblionumber + "&itemnumber=" + itemnumber + "&popup=1#edititem";
449                 var w = window.open(url);
450                 var watchClose = setInterval(function() {
451                     if (w.closed) {
452                         clearTimeout(watchClose);
453                         $.getJSON('/cgi-bin/koha/catalogue/getitem-ajax.pl',
454                             {
455                                 'itemnumber': itemnumber
456                             },
457                             function(item) {
458                                 var tds = $("#item_"+itemnumber+" td");
459                                 for(var i=2; i<tds.length; i++) {
460                                     var column = items_columns[i];
461                                     var text = item[column];
462                                     if ( text == null ) text = '';
463                                     $(tds[i]).text(text);
464                                 }
465                             }
466                         );
467                     }
468                 }, 500);
469             }
470
471             function CalcQtyToReceive() {
472                 var qty = $("input[name='items_to_receive']:checked").length;
473                 $("#quantity").val(qty);
474             }
475
476             function CheckNItems(n) {
477                 $("input[name='items_to_receive']").each(function() {
478                     $(this).prop('checked', false);
479                 });
480                 $("input[name='items_to_receive']:lt("+n+")").each(function () {
481                     $(this).prop('checked', true);
482                 });
483             }
484         [% END %]
485
486         $(document).ready(function() {
487             [% IF (AcqCreateItem == 'receiving') %]
488                 cloneItemBlock(0, '[% UniqueItemFields | html %]');
489             [% ELSIF (AcqCreateItem == 'ordering') && not order.subscriptionid %]
490                 $("input[name='items_to_receive']").change(function() {
491                     CalcQtyToReceive();
492                 });
493                 CalcQtyToReceive();
494                 $("#quantity").keyup(function() {
495                     var qty = parseInt($("#quantity").val());
496                     var qtyto = parseInt($("#quantity_to_receive").val());
497                     if(qty > qtyto) {
498                         $("#qtyrecerror").show();
499                     } else {
500                         $("#qtyrecerror").hide();
501                     }
502                     CheckNItems($(this).val());
503                 });
504             [% END %]
505
506             $("input[name='change_currency']").on("change", function(){
507                 if ( $(this).is(":checked") ) {
508                     $("#select_currency").show();
509                     $("#unitprice").prop("readonly", "true");
510                 } else {
511                     $("#select_currency").hide();
512                     $("#unitprice").prop("readonly", "");
513                 }
514             }).change();
515
516             function update_unitprice() {
517                 var rate = Number($("select[name='currency'] option:selected").val());
518                 var unitprice = $("#unitprice_currency").val();
519                 var new_unitprice = Number( unitprice * rate ).toFixed(2);
520                 $("#unitprice").val(new_unitprice);
521             }
522             $("select[name='currency']").on("change", function(){update_unitprice()} );
523             $("#unitprice_currency").on("change", function(){update_unitprice()} );
524
525             [% IF other_reason %]
526                 $(".select-reason").hide();
527                 $(".select-reason").find("option[value='other']").attr("selected","selected");
528                 $("#other_reason").show();
529             [% ELSE %]
530                 $("#other_reason").hide();
531             [% END %]
532             $(".select-reason").change(function(){
533                 if($(this).val() == "other"){
534                     $(this).hide();
535                     $("#other_reason").show();
536                 }
537             });
538             $("a[href*=back]").click(function(){
539                 $(".select-reason").show().find("option[value='']").attr("selected","selected");
540                 $("#other_reason").hide();
541             });
542
543         });
544     </script>
545 [% END %]
546
547 [% INCLUDE 'intranet-bottom.inc' %]