|
Lines 1-5
Link Here
|
| 1 |
[% USE raw %] |
1 |
[% USE raw %] |
| 2 |
[% USE Asset %] |
2 |
[% USE Asset %] |
|
|
3 |
[% USE Koha %] |
| 3 |
[% USE KohaDates %] |
4 |
[% USE KohaDates %] |
| 4 |
[% USE Branches %] |
5 |
[% USE Branches %] |
| 5 |
[% USE Price %] |
6 |
[% USE Price %] |
|
Lines 296-302
Link Here
|
| 296 |
<li><label for="ecost">Budgeted cost: </label>[% ecost | $Price %] <span class="hint">[% IF (listincgst == 1) %](tax inclusive)[% ELSE %](tax exclusive)[% END %]</span></li> |
297 |
<li><label for="ecost">Budgeted cost: </label>[% ecost | $Price %] <span class="hint">[% IF (listincgst == 1) %](tax inclusive)[% ELSE %](tax exclusive)[% END %]</span></li> |
| 297 |
<li> |
298 |
<li> |
| 298 |
<label for="unitprice">Actual cost:</label> |
299 |
<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> |
300 |
<input type="text" size="20" name="unitprice" id="unitprice" value="[% unitprice | $Price %]" /> <span class="hint">[% IF (invoiceincgst == 1) %](tax inclusive)[% ELSE %](tax exclusive)[% END %]</span> |
| 300 |
</li> |
301 |
</li> |
| 301 |
<li><label for="order_internalnote">Internal note: </label><textarea name="order_internalnote" width="40" rows="8" >[% order_internalnote | html %]</textarea></li> |
302 |
<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 %] |
303 |
[% IF order_vendornote %] |
|
Lines 369-374
Link Here
|
| 369 |
}; |
370 |
}; |
| 370 |
[% END %] |
371 |
[% END %] |
| 371 |
|
372 |
|
|
|
373 |
//Check if unit price is correctly formatted |
| 374 |
var unit_price_correct_format = false; |
| 375 |
|
| 376 |
switch("[%- Koha.Preference( 'CurrencyFormat' ) -%]") { |
| 377 |
case 'FR': |
| 378 |
var unit_price_regexp = /^(?![^.])*([0-9])+(,[0-9]{1,2})?$/; |
| 379 |
var unit_price_format_error_alert_message = _("Decimals must be separated by a comma."); |
| 380 |
break; |
| 381 |
case 'CH': |
| 382 |
var unit_price_regexp = /(?=.*?\d)^\$?(([1-9]\d{0,2}('\d{3})*)|\d+)?(\.\d{1,2})?$/; |
| 383 |
var unit_price_format_error_alert_message = _("Decimals must be separated by a period and thousands by an apostrophe."); |
| 384 |
break; |
| 385 |
default: |
| 386 |
var unit_price_regexp = /(?=.*?\d)^\$?(([1-9]\d{0,2}(,\d{3})*)|\d+)?(\.\d{1,2})?$/; |
| 387 |
var unit_price_format_error_alert_message = _("Decimals must be separated by a period and thousands by a comma."); |
| 388 |
break; |
| 389 |
} |
| 390 |
|
| 391 |
if (!(unit_price_regexp.test(document.getElementById("unitprice").value))){ |
| 392 |
alert(_("Actual cost: ") + unit_price_format_error_alert_message); |
| 393 |
return false; |
| 394 |
} |
| 395 |
|
| 372 |
return true; |
396 |
return true; |
| 373 |
} |
397 |
} |
| 374 |
|
398 |
|
| 375 |
- |
|
|