Fix: [ bug #1319 ] Erreur d'affichage des remises dans les propales
This commit is contained in:
parent
5aee7131af
commit
a2531872cb
@ -381,7 +381,7 @@ if ($id > 0)
|
||||
print '<td colspan="3">';
|
||||
$amount_discount=$object->getAvailableDiscounts();
|
||||
if ($amount_discount < 0) dol_print_error($db,$object->error);
|
||||
if ($amount_discount > 0) print '<a href="'.DOL_URL_ROOT.'/comm/remx.php?id='.$object->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?socid='.$object->id).'">'.price($amount_discount).'</a> '.$langs->trans("Currency".$conf->currency);
|
||||
if ($amount_discount > 0) print '<a href="'.DOL_URL_ROOT.'/comm/remx.php?id='.$object->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?socid='.$object->id).'">'.price($amount_discount,1,$langs,1,-1,-1,$conf->currency).'</a>';
|
||||
else print $langs->trans("DiscountNone");
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2010-2011 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2012-2013 Christophe Battarel <christophe.battarel@altairis.fr>
|
||||
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2013-2014 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
|
||||
@ -1465,7 +1465,7 @@ if ($action == 'create') {
|
||||
$absolute_creditnote = price2num($absolute_creditnote, 'MT');
|
||||
if ($absolute_discount) {
|
||||
if ($object->statut > 0) {
|
||||
print $langs->trans("CompanyHasAbsoluteDiscount", price($absolute_discount), $langs->transnoentities("Currency" . $conf->currency));
|
||||
print $langs->trans("CompanyHasAbsoluteDiscount", price($absolute_discount, 0, $langs, 0, 0, -1, $conf->currency));
|
||||
} else {
|
||||
// Remise dispo de type non avoir
|
||||
$filter = 'fk_facture_source IS NULL';
|
||||
@ -1474,7 +1474,7 @@ if ($action == 'create') {
|
||||
}
|
||||
}
|
||||
if ($absolute_creditnote) {
|
||||
print $langs->trans("CompanyHasCreditNote", price($absolute_creditnote), $langs->transnoentities("Currency" . $conf->currency)) . '. ';
|
||||
print $langs->trans("CompanyHasCreditNote", price($absolute_creditnote, 0, $langs, 0, 0, -1, $conf->currency)) . '. ';
|
||||
}
|
||||
if (! $absolute_discount && ! $absolute_creditnote)
|
||||
print $langs->trans("CompanyHasNoAbsoluteDiscount") . '.';
|
||||
|
||||
@ -3110,13 +3110,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,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)).': ';
|
||||
if (! $filter || $filter=="fk_facture_source IS NULL") print $langs->trans("CompanyHasAbsoluteDiscount",price($amount,0,$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,0,$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,1,$langs,0,0,-1,$conf->currency)).': ';
|
||||
else print $langs->trans("CompanyHasCreditNote",price($amount,1,$langs,0,0,-1,$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,0,$langs,0,0,-1,$conf->currency)).': ';
|
||||
else print $langs->trans("CompanyHasCreditNote",price($amount,0,$langs,0,0,-1,$conf->currency)).': ';
|
||||
}
|
||||
$newfilter='fk_facture IS NULL AND fk_facture_line IS NULL'; // Remises disponibles
|
||||
if ($filter) $newfilter.=' AND ('.$filter.')';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user