Fix: En modif un prix est affich tel quel et jamais tronqu.
This commit is contained in:
parent
07dc449578
commit
9e34dca725
@ -1278,7 +1278,7 @@ if ($_GET['propalid'] > 0)
|
||||
else
|
||||
print $html->select_tva("tva_tx",$objp->tva_tx,$mysoc,$societe);
|
||||
print '</td>';
|
||||
print '<td align="right"><input size="6" type="text" class="flat" name="subprice" value="'.price($objp->subprice).'"></td>';
|
||||
print '<td align="right"><input size="6" type="text" class="flat" name="subprice" value="'.price($objp->subprice,0,'',0).'"></td>';
|
||||
print '<td align="right">';
|
||||
if (($objp->info_bits & 2) != 2)
|
||||
{
|
||||
|
||||
@ -1441,7 +1441,7 @@ else
|
||||
else
|
||||
print $html->select_tva('tva_tx',$objp->tva_tx,$mysoc,$soc);
|
||||
print '</td>';
|
||||
print '<td align="right"><input size="5" type="text" class="flat" name="pu" value="'.price($objp->subprice).'"></td>';
|
||||
print '<td align="right"><input size="5" type="text" class="flat" name="pu" value="'.price($objp->subprice,0,'',0).'"></td>';
|
||||
print '<td align="right">';
|
||||
if (($objp->info_bits & 2) != 2)
|
||||
{
|
||||
|
||||
@ -2389,7 +2389,7 @@ else
|
||||
else
|
||||
print $html->select_tva('tva_tx',$objp->tva_taux,$mysoc,$soc);
|
||||
print '</td>';
|
||||
print '<td align="right"><input size="6" type="text" class="flat" name="price" value="'.price($objp->subprice).'"></td>';
|
||||
print '<td align="right"><input size="6" type="text" class="flat" name="price" value="'.price($objp->subprice,0,'',0).'"></td>';
|
||||
print '<td align="right">';
|
||||
if (($objp->info_bits & 2) != 2)
|
||||
{
|
||||
|
||||
@ -1824,10 +1824,11 @@ function print_fleche_navigation($page,$file,$options='',$nextpage)
|
||||
* \param amount Montant a formater
|
||||
* \param html Formatage html ou pas (0 par defaut)
|
||||
* \param outlangs Objet langs pour formatage
|
||||
* \param trunc 1=Tronque affichage si trop de décimales
|
||||
* \return string Chaine avec montant formaté
|
||||
* \seealso price2num Fonction inverse de price
|
||||
*/
|
||||
function price($amount, $html=0, $outlangs='')
|
||||
function price($amount, $html=0, $outlangs='', $trunc=1)
|
||||
{
|
||||
global $langs,$conf;
|
||||
|
||||
@ -1849,25 +1850,25 @@ function price($amount, $html=0, $outlangs='')
|
||||
//print $datas[1]."<br>";
|
||||
|
||||
// On pose par defaut 2 decimales
|
||||
$decimal = 2;
|
||||
$nbdecimal = 2;
|
||||
$end='';
|
||||
// On augmente au besoin si il y a plus de 2 décimales
|
||||
if (strlen($decpart) > $decimal) $decimal=strlen($decpart);
|
||||
if (strlen($decpart) > $nbdecimal) $nbdecimal=strlen($decpart);
|
||||
// Si on depasse max
|
||||
if ($decimal > $conf->global->MAIN_MAX_DECIMALS_SHOWN)
|
||||
if ($trunc && $nbdecimal > $conf->global->MAIN_MAX_DECIMALS_SHOWN)
|
||||
{
|
||||
$decimal=$conf->global->MAIN_MAX_DECIMALS_SHOWN;
|
||||
$nbdecimal=$conf->global->MAIN_MAX_DECIMALS_SHOWN;
|
||||
$end='...';
|
||||
}
|
||||
|
||||
// Formate nombre
|
||||
if ($html)
|
||||
{
|
||||
$output=ereg_replace(' ',' ',number_format($amount, $decimal, $dec, $thousand));
|
||||
$output=ereg_replace(' ',' ',number_format($amount, $nbdecimal, $dec, $thousand));
|
||||
}
|
||||
else
|
||||
{
|
||||
$output=number_format($amount, $decimal, $dec, $thousand);
|
||||
$output=number_format($amount, $nbdecimal, $dec, $thousand);
|
||||
}
|
||||
$output.=$end;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user