mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-09 19:18:22 +01:00
On affiche l'intitul "offert" au lieu de 100% pour une rduction
This commit is contained in:
@@ -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
|
||||
{
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user