diff --git a/htdocs/cashdesk/tpl/liste_articles.tpl.php b/htdocs/cashdesk/tpl/liste_articles.tpl.php index 0ee03559391186b978627da9aff1cb1206e92083..2fac2e2a16a954e92e16ff30ba53edaaf4052a0b 100644 --- a/htdocs/cashdesk/tpl/liste_articles.tpl.php +++ b/htdocs/cashdesk/tpl/liste_articles.tpl.php @@ -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> diff --git a/htdocs/cashdesk/tpl/ticket.tpl.php b/htdocs/cashdesk/tpl/ticket.tpl.php index cae461fe7fcfdba9cf0612e96713815a8b344358..3e154585e54f217f9db10fd70d6fcbb94ea728e5 100644 --- a/htdocs/cashdesk/tpl/ticket.tpl.php +++ b/htdocs/cashdesk/tpl/ticket.tpl.php @@ -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"); } ?> diff --git a/htdocs/cashdesk/tpl/validation1.tpl.php b/htdocs/cashdesk/tpl/validation1.tpl.php index 6fdf7952207020c878f44cf519007f2981574475..2542993b31420134180be299989f14e79a08f4c7 100644 --- a/htdocs/cashdesk/tpl/validation1.tpl.php +++ b/htdocs/cashdesk/tpl/validation1.tpl.php @@ -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>'); } diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index eb81c4a46ae208137329b098cce46eb3a0871a3b..71302baf5423b3116b1b23f8c657a1d60b01a62a 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -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++; } } diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index 2c60093ab06356e2eab8ac60b1b00fdcd0039d87..203dbe4be96b45254ce7195a416265da4829384e 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -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++; } } diff --git a/htdocs/compta/dons/fiche.php b/htdocs/compta/dons/fiche.php index 1e13c9f987426f3f940c783ea8f96d36a2d67356..95f5985b56f9f4d43abbc9b7f05b23c40f88c3c2 100644 --- a/htdocs/compta/dons/fiche.php +++ b/htdocs/compta/dons/fiche.php @@ -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); diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index c22a0becde1f2ecd08c8500e98b028bd275b9bce..d8379a02a07b209930505d6c4b4fd483cd7883df 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -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++; } } diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 6f41995971ebc34de2f7c0acfe94eda37c9aca29..c117291394451d4226d1db41a45c18e7040e4d34 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -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):' ').'</td>'; + print '<td align="right">'.(! empty($paiement)?price($paiement,0,$langs,0,0,-1,$conf->currency):' ').'</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"> </td>'; print '</tr>'; } diff --git a/htdocs/compta/prelevement/create.php b/htdocs/compta/prelevement/create.php index ddf8a988b488b7092fb81a5e3cf258dc40ce160e..0e47fd7c1099aa54b4100ea5197b7491e9764479 100644 --- a/htdocs/compta/prelevement/create.php +++ b/htdocs/compta/prelevement/create.php @@ -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++; diff --git a/htdocs/contrat/fiche.php b/htdocs/contrat/fiche.php index 060d9c546b0a98856ab08901ace74615dc74c651..fa9c99a857123f8897f191739b73b390fd9403b4 100644 --- a/htdocs/contrat/fiche.php +++ b/htdocs/contrat/fiche.php @@ -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 diff --git a/htdocs/core/boxes/box_activity.php b/htdocs/core/boxes/box_activity.php index 50401f586940d07ef75deed5a586a077444060c1..8f191415deb06b1aa6a2c4c6b128d2c2a4b58cb1 100644 --- a/htdocs/core/boxes/box_activity.php +++ b/htdocs/core/boxes/box_activity.php @@ -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)." ".$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)." ".$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)." ".$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)." ".$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")." ".$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, ',', ' ')." ".$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' => ""); } diff --git a/htdocs/core/boxes/box_comptes.php b/htdocs/core/boxes/box_comptes.php index b48d7993d277d677e0ace70811ed62f70accbf4a..9b80ffefb7400899c7f1fec3e528a57f66953f54 100644 --- a/htdocs/core/boxes/box_comptes.php +++ b/htdocs/core/boxes/box_comptes.php @@ -141,7 +141,7 @@ class box_comptes extends ModeleBoxes $this->info_box_contents[$i][2] = array('td' => 'align="right" class="liste_total"', 'text' => ' ' ); - $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 ); diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index 1cf128cc150fcd2452c71936e68aa0f7cc1161a4..92a4dcd07a58bfbef0af8e2c49280d4495753e3e 100755 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -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'])); } diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 2e014321b0537ae53755637e83a09f01bb037275..dcff2aedf14888c9d6e376d601ed96eb678b1718 100755 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -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') { diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index ef9a416d1df59b414ade07206b1bd8ca1d177680..4e1ca4e3bbbe979e7541a8af18945019e76d92b2 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -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.')'; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 5cb65432ab62602400a8a6844ceeb7862d991c63..4eea7aa785aeccd09565b4501fcc35f902cd7a33 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -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 * diff --git a/htdocs/fourn/ajax/getSupplierPrices.php b/htdocs/fourn/ajax/getSupplierPrices.php index 938b3af22794b1c6a3369d74190d7067abd5229b..029f135a653ca60ba14c9bc88ca96592fbb1edce 100644 --- a/htdocs/fourn/ajax/getSupplierPrices.php +++ b/htdocs/fourn/ajax/getSupplierPrices.php @@ -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++; diff --git a/htdocs/product/stock/valo.php b/htdocs/product/stock/valo.php index 842c2163202c3a7d71fa2a078288506761b8b966..4b30b01ad69495efd1e01ed3213e9825de9bd531 100644 --- a/htdocs/product/stock/valo.php +++ b/htdocs/product/stock/valo.php @@ -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"> </td>'; print "</tr>\n"; @@ -158,7 +158,8 @@ else dol_print_error($db); } -$db->close(); llxFooter(); + +$db->close(); ?>