Qual: We must not concat currency symbol after a price, but use the

parameter currency of method price.
This commit is contained in:
Laurent Destailleur 2013-06-17 11:58:55 +02:00
parent 7ec8220826
commit 869e877cb7
18 changed files with 97 additions and 108 deletions

View File

@ -62,14 +62,14 @@ else
$remise = $tab[$i]['remise'];
echo ('<p>'.$tab[$i]['qte'].' x '.price2num($tab[$i]['price'], 'MT').$remise_percent.' = '.price2num($tab[$i]['total_ht'], 'MT').' '.$conf->currency.' '.$langs->trans("HT").' ('.price2num($tab[$i]['total_ttc'], 'MT').' '.$conf->currency.' '.$langs->trans("TTC").')</p>'."\n");
echo ('<p>'.$tab[$i]['qte'].' x '.price2num($tab[$i]['price'], 'MT').$remise_percent.' = '.price(price2num($tab[$i]['total_ht'], 'MT'),0,$langs,0,0,-1,$conf->currency).' '.$langs->trans("HT").' ('.price(price2num($tab[$i]['total_ttc'], 'MT'),0,$langs,0,0,-1,$conf->currency).' '.$langs->trans("TTC").')</p>'."\n");
echo ('</div>'."\n");
}
}
$obj_facturation->calculTotaux();
$total_ttc = $obj_facturation->prixTotalTtc();
echo ('<p class="cadre_prix_total">'.$langs->trans("Total").' : '.price2num($total_ttc, 'MT').' '.$conf->currency.'<br></p>'."\n");
echo ('<p class="cadre_prix_total">'.$langs->trans("Total").' : '.price(price2num($total_ttc, 'MT'),0,$langs,0,0,-1,$conf->currency).'<br></p>'."\n");
?></div>
</div>

View File

@ -132,7 +132,7 @@ print $object->ref;
for($i=0;$i < $tab_size;$i++)
{
$remise = $tab[$i]['remise'];
echo ('<tr><td>'.$tab[$i]['ref'].'</td><td>'.$tab[$i]['label'].'</td><td>'.$tab[$i]['qte'].'</td><td>'.$tab[$i]['remise_percent'].'</td><td class="total">'.price2num($tab[$i]['total_ht'],'MT').' '.$conf->currency.'</td></tr>'."\n");
echo ('<tr><td>'.$tab[$i]['ref'].'</td><td>'.$tab[$i]['label'].'</td><td>'.$tab[$i]['qte'].'</td><td>'.$tab[$i]['remise_percent'].'</td><td class="total">'.price(price2num($tab[$i]['total_ht'],'MT'),0,$langs,0,0,-1,$conf->currency).'</td></tr>'."\n");
}
?>

View File

@ -26,12 +26,12 @@ $langs->load("main");
<table class="table_resume">
<tr><td class="resume_label"><?php echo $langs->trans("Invoice"); ?></td><td><?php echo $obj_facturation->numInvoice(); ?></td></tr>
<tr><td class="resume_label"><?php echo $langs->trans("TotalHT"); ?></td><td><?php echo price2num($obj_facturation->prixTotalHt(),'MT').' '.$conf->currency; ?></td></tr>
<tr><td class="resume_label"><?php echo $langs->trans("TotalHT"); ?></td><td><?php echo price(price2num($obj_facturation->prixTotalHt(),'MT'),0,$langs,0,0,-1,$conf->currency); ?></td></tr>
<?php
// Affichage de la tva par taux
if ( $obj_facturation->montantTva() ) {
echo ('<tr><td class="resume_label">'.$langs->trans("VAT").'</td><td>'.price2num($obj_facturation->montantTva(),'MT').' '.$conf->currency.'</td></tr>');
echo ('<tr><td class="resume_label">'.$langs->trans("VAT").'</td><td>'.price(price2num($obj_facturation->montantTva(),'MT'),0,$langs,0,0,-1,$conf->currency).'</td></tr>');
}
else
@ -41,7 +41,7 @@ $langs->load("main");
}
?>
<tr><td class="resume_label"><?php echo $langs->trans("TotalTTC"); ?> </td><td><?php echo price2num($obj_facturation->prixTotalTtc(),'MT').' '.$conf->currency; ?></td></tr>
<tr><td class="resume_label"><?php echo $langs->trans("TotalTTC"); ?> </td><td><?php echo price(price2num($obj_facturation->prixTotalTtc(),'MT'),0,$langs,0,0,-1,$conf->currency); ?></td></tr>
<tr><td class="resume_label"><?php echo $langs->trans("PaymentMode"); ?> </td><td>
<?php
switch ($obj_facturation->getSetPaymentMode())
@ -85,14 +85,14 @@ $langs->load("main");
} else {
echo ('<tr><td class="resume_label">'.$langs->trans("Received").'</td><td>'.price2num($obj_facturation->montantEncaisse(),'MT').' '.$conf->currency.'</td></tr>');
echo ('<tr><td class="resume_label">'.$langs->trans("Received").'</td><td>'.price(price2num($obj_facturation->montantEncaisse(),'MT'),0,$langs,0,0,-1,$conf->currency).'</td></tr>');
}
// Affichage du montant rendu (reglement en especes)
if ( $obj_facturation->montantRendu() ) {
echo ('<tr><td class="resume_label">'.$langs->trans("Change").'</td><td>'.price2num($obj_facturation->montantRendu(),'MT').' '.$conf->currency.'</td></tr>');
echo ('<tr><td class="resume_label">'.$langs->trans("Change").'</td><td>'.price(price2num($obj_facturation->montantRendu(),'MT'),0,$langs,0,0,-1,$conf->currency).'</td></tr>');
}

View File

@ -796,7 +796,7 @@ else if ($action == "addline" && $user->rights->propal->creer)
if (! empty($price_min) && (price2num($pu_ht)*(1-price2num(GETPOST('remise_percent'))/100) < price2num($price_min)))
{
$mesg = $langs->trans("CantBeLessThanMinPrice",price2num($price_min,'MU').$langs->getCurrencySymbol($conf->currency));
$mesg = $langs->trans("CantBeLessThanMinPrice",price(price2num($price_min,'MU'),0,$langs,0,0,-1,$conf->currency));
setEventMessage($mesg, 'errors');
}
else
@ -927,7 +927,7 @@ else if ($action == 'updateligne' && $user->rights->propal->creer && GETPOST('sa
if ($price_min && (price2num($pu_ht)*(1-price2num(GETPOST('remise_percent'))/100) < price2num($price_min)))
{
setEventMessage($langs->trans("CantBeLessThanMinPrice", price2num($price_min,'MU')).$langs->getCurrencySymbol($conf->currency), 'errors');
setEventMessage($langs->trans("CantBeLessThanMinPrice", price(price2num($price_min,'MU'),0,$langs,0,0,-1,$conf->currency)), 'errors');
$error++;
}
}

View File

@ -732,7 +732,7 @@ else if ($action == 'addline' && $user->rights->commande->creer)
if (! empty($price_min) && (price2num($pu_ht)*(1-price2num(GETPOST('remise_percent'))/100) < price2num($price_min)))
{
$mesg = $langs->trans("CantBeLessThanMinPrice",price2num($price_min,'MU').$langs->getCurrencySymbol($conf->currency));
$mesg = $langs->trans("CantBeLessThanMinPrice",price(price2num($price_min,'MU'),0,$langs,0,0,-1,$conf->currency));
setEventMessage($mesg, 'errors');
}
else
@ -865,7 +865,7 @@ else if ($action == 'updateligne' && $user->rights->commande->creer && GETPOST('
if ($price_min && (price2num($pu_ht)*(1-price2num(GETPOST('remise_percent'))/100) < price2num($price_min)))
{
setEventMessage($langs->trans("CantBeLessThanMinPrice", price2num($price_min,'MU')).$langs->getCurrencySymbol($conf->currency), 'errors');
setEventMessage($langs->trans("CantBeLessThanMinPrice", price(price2num($price_min,'MU'),0,$langs,0,0,-1,$conf->currency)), 'errors');
$error++;
}
}

View File

@ -482,7 +482,7 @@ if (! empty($id) && $action != 'edit')
print '<td rowspan="'.$nbrows.'" valign="top" width="50%">'.$langs->trans("Comments").' :<br>';
print nl2br($don->note_private).'</td></tr>';
print "<tr>".'<td>'.$langs->trans("Amount").'</td><td>'.price($don->amount).' '.$langs->trans("Currency".$conf->currency).'</td></tr>';
print "<tr>".'<td>'.$langs->trans("Amount").'</td><td>'.price($don->amount,0,$langs,0,0,-1,$conf->currency).'</td></tr>';
print "<tr><td>".$langs->trans("PublicDonation")."</td><td>";
print yn($don->public);

View File

@ -1,28 +1,28 @@
<?php
/* Copyright (C) 2002-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2013 Jean-Francois FERRY <jfefe@aternatik.fr>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2013 Jean-Francois FERRY <jfefe@aternatik.fr>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* \file htdocs/compta/facture.php
@ -1304,7 +1304,7 @@ else if (($action == 'addline' || $action == 'addline_predef') && $user->rights-
if (! empty($price_min) && (price2num($pu_ht)*(1-price2num(GETPOST('remise_percent'))/100) < price2num($price_min)))
{
$mesg = $langs->trans("CantBeLessThanMinPrice",price2num($price_min,'MU').$langs->getCurrencySymbol($conf->currency));
$mesg = $langs->trans("CantBeLessThanMinPrice",price(price2num($price_min,'MU'),0,$langs,0,0,-1,$conf->currency));
setEventMessage($mesg, 'errors');
}
else
@ -1443,7 +1443,7 @@ else if ($action == 'updateligne' && $user->rights->facture->creer && $_POST['sa
if ($price_min && (price2num($pu_ht)*(1-price2num(GETPOST('remise_percent'))/100) < price2num($price_min)))
{
setEventMessage($langs->trans("CantBeLessThanMinPrice", price2num($price_min,'MU')).$langs->getCurrencySymbol($conf->currency), 'errors');
setEventMessage($langs->trans("CantBeLessThanMinPrice", price(price2num($price_min,'MU'),0,$langs,0,0,-1,$conf->currency)), 'errors');
$error++;
}
}

View File

@ -367,13 +367,13 @@ if ($resql)
print $thirdparty->getNomUrl(1,'customer');
print '</td>';
print '<td align="right">'.price($objp->total_ht).' '.$langs->getCurrencySymbol($conf->currency).'</td>';
print '<td align="right">'.price($objp->total_ht,0,$langs,0,0,-1,$conf->currency).'</td>';
print '<td align="right">'.price($objp->total_tva).' '.$langs->getCurrencySymbol($conf->currency).'</td>';
print '<td align="right">'.price($objp->total_tva,0,$langs,0,0,-1,$conf->currency).'</td>';
print '<td align="right">'.price($objp->total_ttc).' '.$langs->getCurrencySymbol($conf->currency).'</td>';
print '<td align="right">'.price($objp->total_ttc,0,$langs,0,0,-1,$conf->currency).'</td>';
print '<td align="right">'.(! empty($paiement)?price($paiement).' '.$langs->getCurrencySymbol($conf->currency):'&nbsp;').'</td>';
print '<td align="right">'.(! empty($paiement)?price($paiement,0,$langs,0,0,-1,$conf->currency):'&nbsp;').'</td>';
// Affiche statut de la facture
print '<td align="right" class="nowrap">';
@ -393,10 +393,10 @@ if ($resql)
// Print total
print '<tr class="liste_total">';
print '<td class="liste_total" colspan="4" align="left">'.$langs->trans('Total').'</td>';
print '<td class="liste_total" align="right">'.price($total_ht).' '.$langs->getCurrencySymbol($conf->currency).'</td>';
print '<td class="liste_total" align="right">'.price($total_tva).' '.$langs->getCurrencySymbol($conf->currency).'</td>';
print '<td class="liste_total" align="right">'.price($total_ttc).' '.$langs->getCurrencySymbol($conf->currency).'</td>';
print '<td class="liste_total" align="right">'.price($totalrecu).' '.$langs->getCurrencySymbol($conf->currency).'</td>';
print '<td class="liste_total" align="right">'.price($total_ht,0,$langs,0,0,-1,$conf->currency).'</td>';
print '<td class="liste_total" align="right">'.price($total_tva,0,$langs,0,0,-1,$conf->currency).'</td>';
print '<td class="liste_total" align="right">'.price($total_ttc,0,$langs,0,0,-1,$conf->currency).'</td>';
print '<td class="liste_total" align="right">'.price($totalrecu,0,$langs,0,0,-1,$conf->currency).'</td>';
print '<td class="liste_total" align="center">&nbsp;</td>';
print '</tr>';
}

View File

@ -201,7 +201,7 @@ if ($resql)
print $thirdpartystatic->getNomUrl(1,'customer');
print '</td>';
print '<td align="right">';
print price($obj->total_ttc).' '.$langs->trans("Currency".$conf->currency);
print price($obj->total_ttc,0,$langs,0,0,-1,$conf->currency);
print '</td>';
// Date
print '<td align="right">';
@ -261,7 +261,7 @@ if ($result)
print "</td>\n";
print '<td align="center">'.dol_print_date($db->jdate($obj->datec),'day')."</td>\n";
print '<td align="right">'.price($obj->amount).' '.$langs->trans("Currency".$conf->currency)."</td>\n";
print '<td align="right">'.price($obj->amount,0,$langs,0,0,-1,$conf->currency)."</td>\n";
print "</tr>\n";
$i++;

View File

@ -459,7 +459,7 @@ else if ($action == 'addline' && $user->rights->contrat->creer)
if($price_min && (price2num($pu_ht)*(1-price2num(GETPOST('remise_percent'))/100) < price2num($price_min)))
{
$object->error = $langs->trans("CantBeLessThanMinPrice",price2num($price_min,'MU').' '.$langs->trans("Currency".$conf->currency));
$object->error = $langs->trans("CantBeLessThanMinPrice",price(price2num($price_min,'MU'),0,$langs,0,0,-1,$conf->currency));
$result = -1 ;
}
else

View File

@ -118,7 +118,7 @@ class box_activity extends ModeleBoxes
);
$this->info_box_contents[$i][3] = array('td' => 'align="right"',
'text' => dol_trunc(number_format($objp->Mnttot, 0, ',', ' '),40)."&nbsp;".$langs->getCurrencySymbol($conf->currency)
'text' => price($objp->Mnttot,1,$langs,0,0,-1,$conf->currency)
);
// We add only for the current year
@ -165,7 +165,7 @@ class box_activity extends ModeleBoxes
);
$totalnb += $objp->nb;
$this->info_box_contents[$i][3] = array('td' => 'align="right"',
'text' => dol_trunc(number_format($objp->Mnttot, 0, ',', ' '),40)."&nbsp;".$langs->getCurrencySymbol($conf->currency)
'text' => price($objp->Mnttot,1,$langs,0,0,-1,$conf->currency)
);
$totalMnt += $objp->Mnttot;
$this->info_box_contents[$i][4] = array('td' => 'align="right" width="18"',
@ -219,7 +219,7 @@ class box_activity extends ModeleBoxes
$totalnb += $objp->nb;
$this->info_box_contents[$i][3] = array('td' => 'align="right"',
'text' => dol_trunc(number_format($objp->Mnttot, 0, ',', ' '),40)."&nbsp;".$langs->getCurrencySymbol($conf->currency)
'text' => price($objp->Mnttot,1,$langs,0,0,-1,$conf->currency)
);
$totalMnt += $objp->Mnttot;
$this->info_box_contents[$i][4] = array('td' => 'align="right" width="18"', 'text' => $commandestatic->LibStatut($objp->fk_statut,0,3));
@ -270,7 +270,7 @@ class box_activity extends ModeleBoxes
$totalnb += $objp->nb;
$this->info_box_contents[$i][3] = array('td' => 'align="right"',
'text' => dol_trunc(number_format($objp->Mnttot, 0, ',', ' '),40)."&nbsp;".$langs->getCurrencySymbol($conf->currency)
'text' => price($objp->Mnttot,1,$langs,0,0,-1,$conf->currency)
);
$totalMnt += $objp->Mnttot;
$this->info_box_contents[$i][4] = array('td' => 'align="right" width="18"', 'text' => $propalstatic->LibStatut($objp->fk_statut,3));
@ -283,8 +283,8 @@ class box_activity extends ModeleBoxes
// Add the sum in the bottom of the boxes
$this->info_box_contents[$i][1] = array('td' => 'align="left" ', 'text' => $langs->trans("Total")."&nbsp;".$textHead);
$this->info_box_contents[$i][2] = array('td' => 'align="right" ', 'text' => number_format($totalnb, 0, ',', ' '));
$this->info_box_contents[$i][3] = array('td' => 'align="right" ', 'text' => number_format($totalMnt, 0, ',', ' ')."&nbsp;".$langs->getCurrencySymbol($conf->currency));
$this->info_box_contents[$i][2] = array('td' => 'align="right" ', 'text' => price($totalnb,1,$langs,0,0,-1,$conf->currency));
$this->info_box_contents[$i][3] = array('td' => 'align="right" ', 'text' => price($totalMnt,1,$langs,0,0,-1,$conf->currency));
$this->info_box_contents[$i][4] = array('td' => 'align="right" ', 'text' => "");
$this->info_box_contents[$i][5] = array('td' => 'align="right"', 'text' => "");
}

View File

@ -141,7 +141,7 @@ class box_comptes extends ModeleBoxes
$this->info_box_contents[$i][2] = array('td' => 'align="right" class="liste_total"',
'text' => '&nbsp;'
);
$totalamount=price($solde_total).' '.$langs->trans("Currency".$conf->currency);
$totalamount=price($solde_total,0,$langs,0,0,-1,$conf->currency);
$this->info_box_contents[$i][3] = array('td' => 'align="right" class="liste_total"',
'text' => $totalamount
);

View File

@ -185,7 +185,7 @@ abstract class CommonDocGenerator
{
if($extrafields->attribute_type[$key] == 'price')
{
$object->array_options['options_'.$key] = price($object->array_options['options_'.$key]).' '.$outputlangs->getCurrencySymbol($conf->currency);
$object->array_options['options_'.$key] = price($object->array_options['options_'.$key],0,$outputlangs,0,0,-1,$conf->currency);
}
else if($extrafields->attribute_type[$key] == 'select')
{
@ -322,8 +322,8 @@ abstract class CommonDocGenerator
{
if($extrafields->attribute_type[$key] == 'price')
{
$object->array_options['options_'.$key] = price2num($object->array_options['options_'.$key],2);
$object->array_options['options_'.$key.'_currency'] = $object->array_options['options_'.$key].' '.$outputlangs->getCurrencySymbol($conf->currency);
$object->array_options['options_'.$key] = price2num($object->array_options['options_'.$key]);
$object->array_options['options_'.$key.'_currency'] = price($object->array_options['options_'.$key],0,$outputlangs,0,0,-1,$conf->currency);
//Add value to store price with currency
$array_to_fill=array_merge($array_to_fill,array($array_key.'_options_'.$key.'_currency' => $object->array_options['options_'.$key.'_currency']));
}

View File

@ -828,7 +828,7 @@ class ExtraFields
}
elseif ($type == 'price')
{
$value=price($value).' '.$langs->getCurrencySymbol($conf->currency);
$value=price($value,0,$langs,0,0,-1,$conf->currency);
}
elseif ($type == 'select')
{

View File

@ -1461,10 +1461,6 @@ class Form
$outval.=$objRef.' - '.dol_trunc($label,32).' - ';
$found=0;
$currencytext=$langs->trans("Currency".$conf->currency);
$currencytextnoent=$langs->transnoentities("Currency".$conf->currency);
if (dol_strlen($currencytext) > 10) $currencytext=$conf->currency; // If text is too long, we use the short code
if (dol_strlen($currencytextnoent) > 10) $currencytextnoent=$conf->currency; // If text is too long, we use the short code
// Multiprice
if ($price_level >= 1) // If we need a particular price level (from 1 to 6)
@ -1486,13 +1482,13 @@ class Form
$found=1;
if ($objp2->price_base_type == 'HT')
{
$opt.= price($objp2->price,1).' '.$currencytext.' '.$langs->trans("HT");
$outval.= price($objp2->price,1).' '.$currencytextnoent.' '.$langs->transnoentities("HT");
$opt.= price($objp2->price,1,$langs,0,0,-1,$conf->currency).' '.$langs->trans("HT");
$outval.= price($objp2->price,0,$langs,0,0,-1,$conf->currency).' '.$langs->transnoentities("HT");
}
else
{
$opt.= price($objp2->price_ttc,1).' '.$currencytext.' '.$langs->trans("TTC");
$outval.= price($objp2->price_ttc,1).' '.$currencytextnoent.' '.$langs->transnoentities("TTC");
$opt.= price($objp2->price_ttc,1,$langs,0,0,-1,$conf->currency).' '.$langs->trans("TTC");
$outval.= price($objp2->price_ttc,0,$langs,0,0,-1,$conf->currency).' '.$langs->transnoentities("TTC");
}
$outprice_ht=price($objp2->price);
$outprice_ttc=price($objp2->price_ttc);
@ -1514,15 +1510,15 @@ class Form
$outdiscount=$objp->remise_percent;
if ($objp->quantity == 1)
{
$opt.= price($objp->unitprice).' '.$currencytext."/";
$outval.= price($objp->unitprice).' '.$currencytextnoent."/";
$opt.= price($objp->unitprice,1,$langs,0,0,-1,$conf->currency)."/";
$outval.= price($objp->unitprice,0,$langs,0,0,-1,$conf->currency)."/";
$opt.= $langs->trans("Unit"); // Do not use strtolower because it breaks utf8 encoding
$outval.=$langs->transnoentities("Unit");
}
else
{
$opt.= price($objp->price).' '.$currencytext."/".$objp->quantity;
$outval.= price($objp->price).' '.$currencytextnoent."/".$objp->quantity;
$opt.= price($objp->price,1,$langs,0,0,-1,$conf->currency)."/".$objp->quantity;
$outval.= price($objp->price,0,$langs,0,0,-1,$conf->currency)."/".$objp->quantity;
$opt.= $langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding
$outval.=$langs->transnoentities("Units");
}
@ -1534,8 +1530,8 @@ class Form
}
if (!empty($objp->quantity) && $objp->quantity >= 1)
{
$opt.=" (".price($objp->unitprice).' '.$currencytext."/".$langs->trans("Unit").")"; // Do not use strtolower because it breaks utf8 encoding
$outval.=" (".price($objp->unitprice).' '.$currencytextnoent."/".$langs->transnoentities("Unit").")"; // Do not use strtolower because it breaks utf8 encoding
$opt.=" (".price($objp->unitprice,1,$langs,0,0,-1,$conf->currency)."/".$langs->trans("Unit").")"; // Do not use strtolower because it breaks utf8 encoding
$outval.=" (".price($objp->unitprice,0,$langs,0,0,-1,$conf->currency)."/".$langs->transnoentities("Unit").")"; // Do not use strtolower because it breaks utf8 encoding
}
if (!empty($objp->remise_percent) && $objp->remise_percent >= 1)
{
@ -1548,13 +1544,13 @@ class Form
{
if ($objp->price_base_type == 'HT')
{
$opt.= price($objp->price,1).' '.$currencytext.' '.$langs->trans("HT");
$outval.= price($objp->price,1).' '.$currencytextnoent.' '.$langs->transnoentities("HT");
$opt.= price($objp->price,1,$langs,0,0,-1,$conf->currency).' '.$langs->trans("HT");
$outval.= price($objp->price,0,$langs,0,0,-1,$conf->currency).' '.$langs->transnoentities("HT");
}
else
{
$opt.= price($objp->price_ttc,1).' '.$currencytext.' '.$langs->trans("TTC");
$outval.= price($objp->price_ttc,1).' '.$currencytextnoent.' '.$langs->transnoentities("TTC");
$opt.= price($objp->price_ttc,1,$langs,0,0,-1,$conf->currency).' '.$langs->trans("TTC");
$outval.= price($objp->price_ttc,0,$langs,0,0,-1,$conf->currency).' '.$langs->transnoentities("TTC");
}
$outprice_ht=price($objp->price);
$outprice_ttc=price($objp->price_ttc);
@ -1720,33 +1716,27 @@ class Form
if (! empty($objp->idprodfournprice))
{
$currencytext=$langs->trans("Currency".$conf->currency);
$currencytextnoent=$langs->transnoentities("Currency".$conf->currency);
if (dol_strlen($currencytext) > 10) $currencytext=$conf->currency; // If text is too long, we use the short code
if (dol_strlen($currencytextnoent) > 10) $currencytextnoent=$conf->currency; // If text is too long, we use the short code
$outqty=$objp->quantity;
$outdiscount=$objp->remise_percent;
if ($objp->quantity == 1)
{
$opt.= price($objp->fprice).' '.$currencytext."/";
$outval.= price($objp->fprice).' '.$currencytextnoent."/";
$opt.= price($objp->fprice,1,$langs,0,0,-1,$conf->currency)."/";
$outval.= price($objp->fprice,0,$langs,0,0,-1,$conf->currency)."/";
$opt.= $langs->trans("Unit"); // Do not use strtolower because it breaks utf8 encoding
$outval.=$langs->transnoentities("Unit");
}
else
{
$opt.= price($objp->fprice).' '.$currencytext."/".$objp->quantity;
$outval.= price($objp->fprice).' '.$currencytextnoent."/".$objp->quantity;
$opt.= price($objp->fprice,1,$langs,0,0,-1,$conf->currency)."/".$objp->quantity;
$outval.= price($objp->fprice,0,$langs,0,0,-1,$conf->currency)."/".$objp->quantity;
$opt.= $langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding
$outval.= $langs->transnoentities("Units");
}
if ($objp->quantity >= 1)
{
$opt.=" (".price($objp->unitprice).' '.$currencytext."/".$langs->trans("Unit").")"; // Do not use strtolower because it breaks utf8 encoding
$outval.=" (".price($objp->unitprice).' '.$currencytextnoent."/".$langs->transnoentities("Unit").")"; // Do not use strtolower because it breaks utf8 encoding
$opt.=" (".price($objp->unitprice,1,$langs,0,0,-1,$conf->currency)."/".$langs->trans("Unit").")"; // Do not use strtolower because it breaks utf8 encoding
$outval.=" (".price($objp->unitprice,0,$langs,0,0,-1,$conf->currency)."/".$langs->transnoentities("Unit").")"; // Do not use strtolower because it breaks utf8 encoding
}
if ($objp->remise_percent >= 1)
{
@ -1853,24 +1843,23 @@ class Form
if ($objp->quantity == 1)
{
$opt.= price($objp->fprice);
$opt.= $langs->trans("Currency".$conf->currency)."/";
$opt.= price($objp->fprice,1,$langs,0,0,-1,$conf->currency)."/";
}
$opt.= $objp->quantity.' ';
if ($objp->quantity == 1)
{
$opt.= strtolower($langs->trans("Unit"));
$opt.= $langs->trans("Unit");
}
else
{
$opt.= strtolower($langs->trans("Units"));
$opt.= $langs->trans("Units");
}
if ($objp->quantity > 1)
{
$opt.=" - ";
$opt.= price($objp->unitprice).$langs->trans("Currency".$conf->currency)."/".strtolower($langs->trans("Unit"));
$opt.= price($objp->unitprice,1,$langs,0,0,-1,$conf->currency)."/".$langs->trans("Unit");
}
if ($objp->duration) $opt .= " - ".$objp->duration;
$opt .= "</option>\n";
@ -2987,13 +2976,13 @@ class Form
print '<tr><td class="nowrap">';
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS))
{
if (! $filter || $filter=="fk_facture_source IS NULL") print $langs->trans("CompanyHasAbsoluteDiscount",price($amount),$langs->transnoentities("Currency".$conf->currency)).': '; // If we want deposit to be substracted to payments only and not to total of final invoice
else print $langs->trans("CompanyHasCreditNote",price($amount),$langs->transnoentities("Currency".$conf->currency)).': ';
if (! $filter || $filter=="fk_facture_source IS NULL") print $langs->trans("CompanyHasAbsoluteDiscount",price($amount,1,$langs,0,0,-1,$conf->currency)).': '; // If we want deposit to be substracted to payments only and not to total of final invoice
else print $langs->trans("CompanyHasCreditNote",price($amount,1,$langs,0,0,-1,$conf->currency)).': ';
}
else
{
if (! $filter || $filter=="fk_facture_source IS NULL OR (fk_facture_source IS NOT NULL AND description='(DEPOSIT)')") print $langs->trans("CompanyHasAbsoluteDiscount",price($amount),$langs->transnoentities("Currency".$conf->currency)).': ';
else print $langs->trans("CompanyHasCreditNote",price($amount),$langs->transnoentities("Currency".$conf->currency)).': ';
if (! $filter || $filter=="fk_facture_source IS NULL OR (fk_facture_source IS NOT NULL AND description='(DEPOSIT)')") print $langs->trans("CompanyHasAbsoluteDiscount",price($amount,1,$langs,0,0,-1,$conf->currency)).': ';
else print $langs->trans("CompanyHasCreditNote",price($amount,1,$langs,0,0,-1,$conf->currency)).': ';
}
$newfilter='fk_facture IS NULL AND fk_facture_line IS NULL'; // Remises disponibles
if ($filter) $newfilter.=' AND ('.$filter.')';

View File

@ -2616,8 +2616,8 @@ function vatrate($rate,$addpercent=false,$info_bits=0,$usestarfornpr=0)
* @param string $form Type of format, HTML or not (not by default)
* @param Translate $outlangs Object langs for output
* @param int $trunc 1=Truncate if there is too much decimals (default), 0=Does not truncate
* @param int $rounding Minimum number of decimal to show. If not defined we use min($conf->global->MAIN_MAX_DECIMALS_UNIT,$conf->global->MAIN_MAX_DECIMALS_TOTAL)
* @param int $forcerounding Force the number of decimal fo forcerounding decimal (-1=do not force)
* @param int $rounding Minimum number of decimal to show. If 0, no change, if -1, we use min($conf->global->MAIN_MAX_DECIMALS_UNIT,$conf->global->MAIN_MAX_DECIMALS_TOTAL)
* @param int $forcerounding Force the number of decimal to forcerounding decimal (-1=do not force)
* @param string $currency_code To add currency symbol (''=add nothing, 'XXX'=add currency symbols for XXX currency)
* @return string Chaine avec montant formate
*

View File

@ -76,8 +76,7 @@ if (! empty($idprod))
if ($objp->quantity == 1)
{
$title.= price($objp->fprice);
$title.= $langs->getCurrencySymbol($conf->currency)."/";
$title.= price($objp->fprice,0,$langs,0,0,-1,$conf->currency)."/";
$price = $objp->fprice;
}
@ -95,18 +94,18 @@ if (! empty($idprod))
if ($objp->quantity > 1)
{
$title.=" - ";
$title.= price($objp->unitprice).$langs->getCurrencySymbol($conf->currency)."/".strtolower($langs->trans("Unit"));
$title.= price($objp->unitprice,0,$langs,0,0,-1,$conf->currency)."/".$langs->trans("Unit");
$price = $objp->unitprice;
}
if ($objp->unitcharges > 0 && ($conf->global->MARGIN_TYPE == "2")) {
$title.=" + ";
$title.= price($objp->unitcharges).$langs->getCurrencySymbol($conf->currency);
$title.= price($objp->unitcharges,0,$langs,0,0,-1,$conf->currency);
$price += $objp->unitcharges;
}
if ($objp->duration) $label .= " - ".$objp->duration;
$label = price($price).$langs->getCurrencySymbol($conf->currency)."/".strtolower($langs->trans("Unit"));
$label = price($price,0,$langs,0,0,-1,$conf->currency)."/".$langs->trans("Unit");
$prices[] = array("id" => $objp->idprodfournprice, "price" => price($price,0,'',0), "label" => $label, "title" => $title);
$i++;

View File

@ -127,8 +127,8 @@ if ($result)
print '<tr class="liste_total">';
print '<td colspan="2" align="right">'.$langs->trans("Total").'</td>';
print '<td align="right">'.price(price2num($total,'MT')).' '.$langs->trans('Currency'.$conf->currency).'</td>';
print '<td align="right">'.price(price2num($totalsell,'MT')).' '.$langs->trans('Currency'.$conf->currency).'</td>';
print '<td align="right">'.price(price2num($total,'MT'),1,$langs,0,0,-1,$conf->currency).'</td>';
print '<td align="right">'.price(price2num($totalsell,'MT'),1,$langs,0,0,-1,$conf->currency).'</td>';
print '<td align="right">&nbsp;</td>';
print "</tr>\n";
@ -158,7 +158,8 @@ else
dol_print_error($db);
}
$db->close();
llxFooter();
$db->close();
?>