[-] BO : fix #PSTEST-388

This commit is contained in:
lLefevre
2012-01-12 14:01:07 +00:00
parent 1e6c73a7cc
commit ce46f83c97
4 changed files with 11 additions and 7 deletions
@@ -126,7 +126,7 @@ jQuery(document).ready(Customer.init);
<tr>
<td class="col-left"><label>{l s='Pre-tax wholesale price:'}</label></td>
<td style="padding-bottom:5px;">
{$currency->prefix}<input size="11" maxlength="14" name="wholesale_price" type="text" value="{$product->wholesale_price}" onchange="this.value = this.value.replace(/,/g, '.');" />{$currency->suffix}
{$currency->prefix}<input size="11" maxlength="14" name="wholesale_price" type="text" value="{$product->wholesale_price|string_format:'%.2f'}" onchange="this.value = this.value.replace(/,/g, '.');" />{$currency->suffix}
<p class="preference_description">{l s='The wholesale price at which you bought this product'}</p>
</td>
</tr>
@@ -134,7 +134,7 @@ jQuery(document).ready(Customer.init);
<tr>
<td class="col-left"><label>{l s='Pre-tax retail price:'}</label></td>
<td style="padding-bottom:5px;">
{$currency->prefix}<input size="11" maxlength="14" id="priceTE" name="price" type="text" value="{$product->price}" onchange="this.value = this.value.replace(/,/g, '.');" onkeyup="$('#priceType').val('TE');if (isArrowKey(event)) return; calcPriceTI();" />{$currency->suffix}
{$currency->prefix}<input size="11" maxlength="14" id="priceTE" name="price" type="text" value="{$product->price|string_format:'%.2f'}" onchange="this.value = this.value.replace(/,/g, '.');" onkeyup="$('#priceType').val('TE');if (isArrowKey(event)) return; calcPriceTI();" />{$currency->suffix}
<p class="preference_description">{l s='The pre-tax retail price to sell this product'}</p>
</td>
</tr>
@@ -178,7 +178,7 @@ jQuery(document).ready(Customer.init);
<tr>
<td class="col-left"><label>{l s='Eco-tax (tax incl.):'}</label></td>
<td>
{$currency->prefix}<input size="11" maxlength="14" id="ecotax" name="ecotax" type="text" value="{$product->ecotax}" onkeyup="$('#priceType').val('TI');if (isArrowKey(event))return; calcPriceTE(); this.value = this.value.replace(/,/g, '.'); if (parseInt(this.value) > getE('priceTE').value) this.value = getE('priceTE').value; if (isNaN(this.value)) this.value = 0;" />{$currency->suffix}
{$currency->prefix}<input size="11" maxlength="14" id="ecotax" name="ecotax" type="text" value="{$product->ecotax|string_format:'%.2f'}" onkeyup="$('#priceType').val('TI');if (isArrowKey(event))return; calcPriceTE(); this.value = this.value.replace(/,/g, '.'); if (parseInt(this.value) > getE('priceTE').value) this.value = getE('priceTE').value; if (isNaN(this.value)) this.value = 0;" />{$currency->suffix}
<span style="margin-left:10px">({l s='already included in price'})</span>
</td>
</tr>
@@ -193,7 +193,7 @@ jQuery(document).ready(Customer.init);
<tr id="tr_unit_price">
<td class="col-left"><label>{l s='Unit price:'}</label></td>
<td>
{$currency->prefix} <input size="11" maxlength="14" id="unit_price" name="unit_price" type="text" value="{$unit_price|number_format:6}"
{$currency->prefix} <input size="11" maxlength="14" id="unit_price" name="unit_price" type="text" value="{$unit_price|string_format:'%.2f'}"
onkeyup="if (isArrowKey(event)) return ;this.value = this.value.replace(/,/g, '.'); unitPriceWithTax('unit');"/>{$currency->suffix}
{l s='/'} <!--<input size="6" maxlength="10" id="unity" name="unity" type="text" value="{$product->unity|htmlentitiesUTF8}" onkeyup="if (isArrowKey(event)) return ;unitySecond();" onchange="unitySecond();"/> -->
<select onchange="unitySecond();" name="unity" id="unity">
@@ -90,10 +90,11 @@
</script>
{/literal}
{/if}
{assign var='value_text' value=$fields_value[$input.name][$language.id_lang]}
<input type="text"
name="{$input.name}_{$language.id_lang}"
id="{if isset($input.id)}{$input.id}_{$language.id_lang}{else}{$input.name}_{$language.id_lang}{/if}"
value="{$fields_value[$input.name][$language.id_lang]}"
value="{if isset($input.string_format) && $input.string_format}{$value_text|string_format:$input.string_format}{else}{$value_text}{/if}"
class="{if $input.type == 'tags'}tagify {/if}{if isset($input.class)}{$input.class}{/if}"
{if isset($input.size)}size="{$input.size}"{/if}
{if isset($input.maxlength)}maxlength="{$input.maxlength}"{/if}
@@ -119,10 +120,11 @@
</script>
{/literal}
{/if}
{assign var='value_text' value=$fields_value[$input.name]}
<input type="text"
name="{$input.name}"
id="{if isset($input.id)}{$input.id}{else}{$input.name}{/if}"
value="{$fields_value[$input.name]}"
value="{if isset($input.string_format) && $input.string_format}{$value_text|string_format:$input.string_format}{else}{$value_text}{/if}"
class="{if $input.type == 'tags'}tagify {/if}"
{if isset($input.size)}size="{$input.size}"{/if}
{if isset($input.maxlength)}maxlength="{$input.maxlength}"{/if}
@@ -86,6 +86,7 @@ class AdminRangePriceControllerCore extends AdminController
'required' => true,
'suffix' => $currency->getSign('right'),
'desc' => $this->l('Range start (included)'),
'string_format' => '%.2f'
),
array(
'type' => 'text',
@@ -95,6 +96,7 @@ class AdminRangePriceControllerCore extends AdminController
'required' => true,
'suffix' => $currency->getSign('right'),
'desc' => $this->l('Range end (excluded)'),
'string_format' => '%.2f'
),
),
'submit' => array(
+1 -1
View File
@@ -80,7 +80,7 @@ function calcPriceTE()
var priceTI = parseFloat(document.getElementById('priceTI').value.replace(/,/g, '.'));
var newPrice = ps_round(priceTI - getEcotaxTaxIncluded(), 2) / ((tax / 100) + 1);
document.getElementById('priceTE').value = (isNaN(newPrice) == true || newPrice < 0) ? '' :
ps_round(newPrice.toFixed(6), 6);
ps_round(newPrice.toFixed(2), 2);
document.getElementById('finalPrice').innerHTML = (isNaN(newPrice) == true || newPrice < 0) ? '' :
ps_round(priceTI.toFixed(2), 2);
document.getElementById('finalPriceWithoutTax').innerHTML = (isNaN(newPrice) == true || newPrice < 0) ? '' :