From b5b1bbd1808c155a33002fa6fec20e3d5832a455 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 19 Feb 2011 13:38:02 +0000 Subject: [PATCH] New: Can add a discount directly when building invoice --- htdocs/compta/facture.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index e6f8370c6be..06779a2557f 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -2108,12 +2108,16 @@ else } else { - if ($object->statut == 0 && $object->type != 2 && $object->type != 3) print ' - '.$addabsolutediscount.'
'; - else print '. '; + if ($absolute_creditnote > 0) // If not linke will be added later + { + if ($object->statut == 0 && $object->type != 2 && $object->type != 3) print ' - '.$addabsolutediscount.'
'; + + } + print '. '; } if ($absolute_creditnote > 0) { - // If validated, we show link "add credit note to payment" + // If validated, we show link "add credit note to payment" if ($object->statut != 1 || $object->type == 2 || $object->type == 3) { if ($object->statut == 0 && $object->type != 3) @@ -2136,7 +2140,9 @@ else } if (! $absolute_discount && ! $absolute_creditnote) { - print $langs->trans("CompanyHasNoAbsoluteDiscount").'.'; + print $langs->trans("CompanyHasNoAbsoluteDiscount"); + if ($object->statut == 0 && $object->type != 2 && $object->type != 3) print ' - '.$addabsolutediscount.'
'; + else print '. '; } /*if ($object->statut == 0 && $object->type != 2 && $object->type != 3) {