Look: Format price of discount

This commit is contained in:
Laurent Destailleur 2009-05-07 12:13:34 +00:00
parent 5df89b2c0a
commit 1ea905d8b3
6 changed files with 18 additions and 8 deletions

View File

@ -997,9 +997,11 @@ if ($id > 0 || ! empty($ref))
print '<tr><td>'.$langs->trans('Discounts').'</td><td colspan="5">'; print '<tr><td>'.$langs->trans('Discounts').'</td><td colspan="5">';
if ($societe->remise_client) print $langs->trans("CompanyHasRelativeDiscount",$societe->remise_client); if ($societe->remise_client) print $langs->trans("CompanyHasRelativeDiscount",$societe->remise_client);
else print $langs->trans("CompanyHasNoRelativeDiscount"); else print $langs->trans("CompanyHasNoRelativeDiscount");
print '. ';
$absolute_discount=$societe->getAvailableDiscounts('','fk_facture_source IS NULL'); $absolute_discount=$societe->getAvailableDiscounts('','fk_facture_source IS NULL');
$absolute_creditnote=$societe->getAvailableDiscounts('','fk_facture_source IS NOT NULL'); $absolute_creditnote=$societe->getAvailableDiscounts('','fk_facture_source IS NOT NULL');
print '. '; $absolute_discount=price2num($absolute_discount,'MT');
$absolute_creditnote=price2num($absolute_creditnote,'MT');
if ($absolute_discount) if ($absolute_discount)
{ {
if ($propal->statut > 0) if ($propal->statut > 0)

View File

@ -199,7 +199,7 @@ if ($_socid > 0)
print '<table width="100%" class="noborder">'; print '<table width="100%" class="noborder">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td width="110" align="left">'.$langs->trans("Date").'</td>'; print '<td width="110" align="left">'.$langs->trans("Date").'</td>';
print '<td align="left">'.$langs->trans("ReasonDiscount").'</td>'; print '<td width="150" align="left">'.$langs->trans("ReasonDiscount").'</td>';
print '<td align="left" nowrap="nowrap">'.$langs->trans("ConsumedBy").'</td>'; print '<td align="left" nowrap="nowrap">'.$langs->trans("ConsumedBy").'</td>';
print '<td width="120" align="right">'.$langs->trans("AmountHT").'</td>'; print '<td width="120" align="right">'.$langs->trans("AmountHT").'</td>';
print '<td width="80" align="right">'.$langs->trans("VATRate").'</td>'; print '<td width="80" align="right">'.$langs->trans("VATRate").'</td>';
@ -311,7 +311,7 @@ if ($_socid > 0)
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td width="110" align="left">'.$langs->trans("Date").'</td>'; print '<td width="110" align="left">'.$langs->trans("Date").'</td>';
print '<td align="left">'.$langs->trans("ReasonDiscount").'</td>'; print '<td width="150" align="left">'.$langs->trans("ReasonDiscount").'</td>';
print '<td align="left" nowrap="nowrap">'.$langs->trans("ConsumedBy").'</td>'; print '<td align="left" nowrap="nowrap">'.$langs->trans("ConsumedBy").'</td>';
print '<td width="120" align="right">'.$langs->trans("AmountHT").'</td>'; print '<td width="120" align="right">'.$langs->trans("AmountHT").'</td>';
print '<td width="80" align="right">'.$langs->trans("VATRate").'</td>'; print '<td width="80" align="right">'.$langs->trans("VATRate").'</td>';

View File

@ -1316,9 +1316,11 @@ else
print '<tr><td>'.$langs->trans('Discounts').'</td><td colspan="3">'; print '<tr><td>'.$langs->trans('Discounts').'</td><td colspan="3">';
if ($soc->remise_client) print $langs->trans("CompanyHasRelativeDiscount",$soc->remise_client); if ($soc->remise_client) print $langs->trans("CompanyHasRelativeDiscount",$soc->remise_client);
else print $langs->trans("CompanyHasNoRelativeDiscount"); else print $langs->trans("CompanyHasNoRelativeDiscount");
print '. ';
$absolute_discount=$soc->getAvailableDiscounts('','fk_facture_source IS NULL'); $absolute_discount=$soc->getAvailableDiscounts('','fk_facture_source IS NULL');
$absolute_creditnote=$soc->getAvailableDiscounts('','fk_facture_source IS NOT NULL'); $absolute_creditnote=$soc->getAvailableDiscounts('','fk_facture_source IS NOT NULL');
print '. '; $absolute_discount=price2num($absolute_discount,'MT');
$absolute_creditnote=price2num($absolute_creditnote,'MT');
if ($absolute_discount) if ($absolute_discount)
{ {
if ($commande->statut > 0) if ($commande->statut > 0)
@ -1335,7 +1337,7 @@ else
} }
if ($absolute_creditnote) if ($absolute_creditnote)
{ {
print $langs->trans("CompanyHasCreditNote",price($absolute_creditnote),$langs->transnoentities("Currency".$conf->monnaie)).'. '; print $langs->trans("CompanyHasCreditNote",price($absolute_creditnote,1),$langs->transnoentities("Currency".$conf->monnaie)).'. ';
} }
if (! $absolute_discount && ! $absolute_creditnote) print $langs->trans("CompanyHasNoAbsoluteDiscount").'.'; if (! $absolute_discount && ! $absolute_creditnote) print $langs->trans("CompanyHasNoAbsoluteDiscount").'.';
print '</td></tr>'; print '</td></tr>';
@ -1354,7 +1356,7 @@ else
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
// Date de livraison // Delivery date
print '<tr><td height="10">'; print '<tr><td height="10">';
print '<table class="nobordernopadding" width="100%"><tr><td>'; print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans('DeliveryDate'); print $langs->trans('DeliveryDate');

View File

@ -183,9 +183,11 @@ if ($id > 0 || ! empty($ref))
print '<tr><td>'.$langs->trans('Discounts').'</td><td colspan="3">'; print '<tr><td>'.$langs->trans('Discounts').'</td><td colspan="3">';
if ($soc->remise_client) print $langs->trans("CompanyHasRelativeDiscount",$soc->remise_client); if ($soc->remise_client) print $langs->trans("CompanyHasRelativeDiscount",$soc->remise_client);
else print $langs->trans("CompanyHasNoRelativeDiscount"); else print $langs->trans("CompanyHasNoRelativeDiscount");
print '. ';
$absolute_discount=$soc->getAvailableDiscounts('','fk_facture_source IS NULL'); $absolute_discount=$soc->getAvailableDiscounts('','fk_facture_source IS NULL');
$absolute_creditnote=$soc->getAvailableDiscounts('','fk_facture_source IS NOT NULL'); $absolute_creditnote=$soc->getAvailableDiscounts('','fk_facture_source IS NOT NULL');
print '. '; $absolute_discount=price2num($absolute_discount,'MT');
$absolute_creditnote=price2num($absolute_creditnote,'MT');
if ($absolute_discount) if ($absolute_discount)
{ {
if ($commande->statut > 0) if ($commande->statut > 0)

View File

@ -1985,6 +1985,8 @@ else
$absolute_discount=$soc->getAvailableDiscounts('','fk_facture_source IS NULL'); $absolute_discount=$soc->getAvailableDiscounts('','fk_facture_source IS NULL');
$absolute_creditnote=$soc->getAvailableDiscounts('','fk_facture_source IS NOT NULL'); $absolute_creditnote=$soc->getAvailableDiscounts('','fk_facture_source IS NOT NULL');
$absolute_discount=price2num($absolute_discount,'MT');
$absolute_creditnote=price2num($absolute_creditnote,'MT');
$author = new User($db); $author = new User($db);
if ($fac->user_author) if ($fac->user_author)

View File

@ -199,9 +199,11 @@ if ($id > 0 || ! empty($ref))
print '<tr><td>'.$langs->trans('Discounts').'</td><td colspan="3">'; print '<tr><td>'.$langs->trans('Discounts').'</td><td colspan="3">';
if ($soc->remise_client) print $langs->trans("CompanyHasRelativeDiscount",$soc->remise_client); if ($soc->remise_client) print $langs->trans("CompanyHasRelativeDiscount",$soc->remise_client);
else print $langs->trans("CompanyHasNoRelativeDiscount"); else print $langs->trans("CompanyHasNoRelativeDiscount");
print '. ';
$absolute_discount=$soc->getAvailableDiscounts('','fk_facture_source IS NULL'); $absolute_discount=$soc->getAvailableDiscounts('','fk_facture_source IS NULL');
$absolute_creditnote=$soc->getAvailableDiscounts('','fk_facture_source IS NOT NULL'); $absolute_creditnote=$soc->getAvailableDiscounts('','fk_facture_source IS NOT NULL');
print '. '; $absolute_discount=price2num($absolute_discount,'MT');
$absolute_creditnote=price2num($absolute_creditnote,'MT');
if ($absolute_discount) if ($absolute_discount)
{ {
if ($commande->statut > 0) if ($commande->statut > 0)