From 71ee941cf84f3954b69bd0a6927cc6eb575dc02e Mon Sep 17 00:00:00 2001 From: gauthier Date: Wed, 25 May 2016 12:25:39 +0200 Subject: [PATCH] FIX : SQL error function on getAvailableDiscounts function, on bill create mode if socid is empty --- htdocs/compta/facture.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index c13d8197801..ccfd057ccde 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -1935,7 +1935,7 @@ if ($action == 'create') $dateinvoice = (empty($dateinvoice)?(empty($conf->global->MAIN_AUTOFILL_DATE)?-1:''):$dateinvoice); // Do not set 0 here (0 for a date is 1970) } - $absolute_discount = $soc->getAvailableDiscounts(); + if(!empty($soc->id)) $absolute_discount = $soc->getAvailableDiscounts(); if (! empty($conf->use_javascript_ajax)) {