On affiche l'intitul "offert" au lieu de 100% pour une rduction

This commit is contained in:
Regis Houssin
2007-12-06 22:13:46 +00:00
parent a76638ebf9
commit ef35fb8407
9 changed files with 33 additions and 7 deletions

View File

@@ -1233,7 +1233,7 @@ if ($_GET['propalid'] > 0)
// Remise %
if ($objp->remise_percent > 0)
{
print '<td align="right">'.$objp->remise_percent."%</td>\n";
print '<td align="right">'.dolibarr_print_reduction($objp->remise_percent)."</td>\n";
}
else
{

View File

@@ -924,7 +924,7 @@ if ($_GET['action'] == 'create' && $user->rights->commande->creer)
print '<tr class="liste_titre"><td>'.$langs->trans('Ref').'</td><td>'.$langs->trans('Product').'</td>';
print '<td align="right">'.$langs->trans('Price').'</td>';
print '<td align="center">'.$langs->trans('Qty').'</td>';
print '<td align="center">'.$langs->trans('Reductionshort').'</td>';
print '<td align="center">'.$langs->trans('ReductionShort').'</td>';
print '</tr>';
$var=false;
@@ -1399,7 +1399,7 @@ else
print '</td>';
if ($objp->remise_percent > 0)
{
print '<td align="right">'.$objp->remise_percent.'%</td>';
print '<td align="right">'.dolibarr_print_reduction($objp->remise_percent).'</td>';
}
else
{

View File

@@ -2402,7 +2402,7 @@ else
print '</td>';
if ($objp->remise_percent > 0)
{
print '<td align="right">'.$objp->remise_percent."%</td>\n";
print '<td align="right">'.dolibarr_print_reduction($objp->remise_percent)."</td>\n";
}
else
{

View File

@@ -296,7 +296,7 @@ class pdf_einstein extends ModelePDFCommandes
$pdf->SetXY ($this->posxdiscount, $curY);
if ($com->lignes[$i]->remise_percent)
{
$pdf->MultiCell(14, 4, $com->lignes[$i]->remise_percent."%", 0, 'R');
$pdf->MultiCell(14, 4, dolibarr_print_reduction($com->lignes[$i]->remise_percent), 0, 'R');
}
// Total HT ligne

View File

@@ -307,7 +307,7 @@ class pdf_crabe extends ModelePDFFactures
$pdf->SetXY ($this->posxdiscount, $curY);
if ($fac->lignes[$i]->remise_percent)
{
$pdf->MultiCell(14, 4, $fac->lignes[$i]->remise_percent."%", 0, 'R');
$pdf->MultiCell(14, 4, dolibarr_print_reduction($fac->lignes[$i]->remise_percent), 0, 'R');
}
// Total HT ligne

View File

@@ -294,7 +294,7 @@ class pdf_propale_azur extends ModelePDFPropales
$pdf->SetXY ($this->posxdiscount, $curY);
if ($propale->lignes[$i]->remise_percent)
{
$pdf->MultiCell(14, 4, $propale->lignes[$i]->remise_percent."%", 0, 'R');
$pdf->MultiCell(14, 4, dolibarr_print_reduction($propale->lignes[$i]->remise_percent), 0, 'R');
}
// Total HT ligne

View File

@@ -393,6 +393,7 @@ AutomaticCode=Automatic code
NotManaged=Not managed
FeatureDisabled=Feature disabled
MoveBox=Move box %s
Offered=Offered
# Week day
Monday=Monday
Tuesday=Tuesday

View File

@@ -394,6 +394,7 @@ AutomaticCode=Cr
NotManaged=Non g<>r<EFBFBD>
FeatureDisabled=Fonction d<>sactiv<69>e
MoveBox=D<>placer la boite %s
Offered=Offert
# Week day
Monday=Lundi
Tuesday=Mardi

View File

@@ -3849,4 +3849,28 @@ function monthArrayOrSelected($selected=0)
}
}
/**
\brief Returns formated reduction
\param reduction Reduction percentage
\return string Formated reduction
*/
function dolibarr_print_reduction($reduction=0)
{
global $langs;
$langs->load("main");
$string = '';
if ($reduction == 100)
{
$string = $langs->trans("Offered");
}
else
{
$string = $reduction.'%';
}
return $string;
}
?>