diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 1652a39a11c..26b8b0a0013 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -1713,6 +1713,7 @@ else $soc = new Societe($db, $fac->socid); $soc->fetch($fac->socid); + $absolute_discount=$soc->getAvailableDiscounts('','fk_facture_source IS NULL'); $absolute_creditnote=$soc->getAvailableDiscounts('','fk_facture_source IS NOT NULL'); diff --git a/htdocs/lib/functions.inc.php b/htdocs/lib/functions.inc.php index c1a13d28d0e..0075a4ef789 100644 --- a/htdocs/lib/functions.inc.php +++ b/htdocs/lib/functions.inc.php @@ -3873,4 +3873,38 @@ function dolibarr_print_reduction($reduction=0) return $string; } + +/** + \brief Returns formated reduction + \param reduction Reduction percentage + \return int Return number of error messages shown +*/ +function dol_htmloutput_errors($mesgstring='',$mesgarray='') +{ + global $langs; + + $ret = 0; + $langs->load("errors"); + + if (is_array($mesgarray) && sizeof($mesgarray)) + { + print '