Lines 288-294
Link Here
|
288 |
<input type="hidden" name="tax_rate" value="0" /> |
288 |
<input type="hidden" name="tax_rate" value="0" /> |
289 |
[% END %] |
289 |
[% END %] |
290 |
|
290 |
|
291 |
<li><label for="rrp">Retail price: </label>[% rrp | $Price %] <span class="hint">(adjusted for [% cur_active | html %], [% IF (invoiceincgst == 1) %]tax inclusive[% ELSE %]tax exclusive[% END %])</span></li> |
291 |
<li><label for="rrp">Retail price: </label>[% rrp | $Price %] <span class="hint">(adjusted for [% active_currency.currency | html %], [% IF (invoiceincgst == 1) %]tax inclusive[% ELSE %]tax exclusive[% END %])</span></li> |
292 |
<li> |
292 |
<li> |
293 |
<label for="replacementprice">Replacement price:</label> |
293 |
<label for="replacementprice">Replacement price:</label> |
294 |
<input type="text" size="20" name="replacementprice" id="replacementprice" value="[% replacementprice | $Price on_editing => 1 %]" /> |
294 |
<input type="text" size="20" name="replacementprice" id="replacementprice" value="[% replacementprice | $Price on_editing => 1 %]" /> |
Lines 296-302
Link Here
|
296 |
<li><label for="ecost">Budgeted cost: </label>[% ecost | $Price %] <span class="hint">[% IF (invoiceincgst == 1) %](tax inclusive)[% ELSE %](tax exclusive)[% END %]</span></li> |
296 |
<li><label for="ecost">Budgeted cost: </label>[% ecost | $Price %] <span class="hint">[% IF (invoiceincgst == 1) %](tax inclusive)[% ELSE %](tax exclusive)[% END %]</span></li> |
297 |
<li> |
297 |
<li> |
298 |
<label for="unitprice">Actual cost:</label> |
298 |
<label for="unitprice">Actual cost:</label> |
299 |
<input type="text" size="20" name="unitprice" id="unitprice" value="[% unitprice | $Price on_editing => 1 %]" /> <span class="hint">[% IF (invoiceincgst == 1) %](tax inclusive)[% ELSE %](tax exclusive)[% END %]</span> |
299 |
<input type="text" size="20" name="unitprice" id="unitprice" value="[% unitprice | $Price on_editing => 1 %]" /> |
|
|
300 |
<span class="hint">[% IF (invoiceincgst == 1) %](tax inclusive)[% ELSE %](tax exclusive)[% END %]</span> |
301 |
<label style="font-weight: inherit; float:none;"><input type="checkbox" name="change_currency">Change currency</label> |
302 |
</li> |
303 |
<li id="select_currency"> |
304 |
<label for="unitprice_currency"></label> |
305 |
<input type="text" size="20" name="unitprice" id="unitprice_currency" value="" /> |
306 |
[% IF currencies.count %] |
307 |
<select name="currency"> |
308 |
<option value="[% active_currency.rate %]" selected="selected">[% active_currency.currency %] ([% active_currency.symbol %])</option> |
309 |
[% FOR currency IN currencies %] |
310 |
<option value="[% currency.rate %]">[% currency.currency %] ([% currency.symbol %])</option> |
311 |
[% END %] |
312 |
</select> |
313 |
[% END %] |
300 |
</li> |
314 |
</li> |
301 |
<li><label for="order_internalnote">Internal note: </label><textarea name="order_internalnote" width="40" rows="8" >[% order_internalnote | html %]</textarea></li> |
315 |
<li><label for="order_internalnote">Internal note: </label><textarea name="order_internalnote" width="40" rows="8" >[% order_internalnote | html %]</textarea></li> |
302 |
[% IF order_vendornote %] |
316 |
[% IF order_vendornote %] |
Lines 436-441
Link Here
|
436 |
CheckNItems($(this).val()); |
450 |
CheckNItems($(this).val()); |
437 |
}); |
451 |
}); |
438 |
[% END %] |
452 |
[% END %] |
|
|
453 |
|
454 |
$("input[name='change_currency']").on("change", function(){ |
455 |
if ( $(this).is(":checked") ) { |
456 |
$("#select_currency").show(); |
457 |
$("#unitprice").prop("readonly", "true"); |
458 |
} else { |
459 |
$("#select_currency").hide(); |
460 |
$("#unitprice").prop("readonly", ""); |
461 |
} |
462 |
}).change(); |
463 |
|
464 |
function update_unitprice() { |
465 |
var rate = Number($("select[name='currency'] option:selected").val()); |
466 |
var unitprice = $("#unitprice_currency").val(); |
467 |
var new_unitprice = Number( unitprice * rate ).toFixed(2); |
468 |
$("#unitprice").val(new_unitprice); |
469 |
} |
470 |
$("select[name='currency']").on("change", function(){update_unitprice()} ); |
471 |
$("#unitprice_currency").on("change", function(){update_unitprice()} ); |
439 |
}); |
472 |
}); |
440 |
</script> |
473 |
</script> |
441 |
[% END %] |
474 |
[% END %] |
442 |
- |
|
|