Fix warning

This commit is contained in:
Laurent Destailleur 2020-11-15 15:10:15 +01:00
parent 2e0e42e918
commit 5c15162c40
15 changed files with 27 additions and 22 deletions

View File

@ -343,7 +343,7 @@ class pdf_einstein extends ModelePDFCommandes
// Incoterm
$height_incoterms = 0;
if ($conf->incoterm->enabled)
if (!empty($conf->incoterm->enabled))
{
$desc_incoterms = $object->getIncotermsForPDF();
if ($desc_incoterms)

View File

@ -381,7 +381,7 @@ class pdf_eratosthene extends ModelePDFCommandes
// Incoterm
$height_incoterms = 0;
if ($conf->incoterm->enabled)
if (!empty($conf->incoterm->enabled))
{
$desc_incoterms = $object->getIncotermsForPDF();
if ($desc_incoterms)

View File

@ -346,7 +346,7 @@ class pdf_storm extends ModelePDFDeliveryOrder
// Incoterm
$height_incoterms = 0;
if ($conf->incoterm->enabled)
if (!empty($conf->incoterm->enabled))
{
$desc_incoterms = $object->getIncotermsForPDF();
if ($desc_incoterms)

View File

@ -318,7 +318,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder
// Incoterm
$height_incoterms = 0;
if ($conf->incoterm->enabled)
if (!empty($conf->incoterm->enabled))
{
$desc_incoterms = $object->getIncotermsForPDF();
if ($desc_incoterms)

View File

@ -319,7 +319,7 @@ class pdf_espadon extends ModelePdfExpedition
// Incoterm
$height_incoterms = 0;
if ($conf->incoterm->enabled)
if (!empty($conf->incoterm->enabled))
{
$desc_incoterms = $object->getIncotermsForPDF();
if ($desc_incoterms)

View File

@ -338,7 +338,7 @@ class pdf_rouget extends ModelePdfExpedition
// Incoterm
$height_incoterms = 0;
if ($conf->incoterm->enabled)
if (!empty($conf->incoterm->enabled))
{
$desc_incoterms = $object->getIncotermsForPDF();
if ($desc_incoterms)

View File

@ -420,7 +420,7 @@ class pdf_crabe extends ModelePDFFactures
$tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD) ? 42 + $top_shift : 10);
// Incoterm
if ($conf->incoterm->enabled)
if (! empty($conf->incoterm->enabled))
{
$desc_incoterms = $object->getIncotermsForPDF();
if ($desc_incoterms)

View File

@ -422,7 +422,7 @@ class pdf_sponge extends ModelePDFFactures
// Incoterm
$height_incoterms = 0;
if ($conf->incoterm->enabled)
if (!empty($conf->incoterm->enabled))
{
$desc_incoterms = $object->getIncotermsForPDF();
if ($desc_incoterms)

View File

@ -396,7 +396,7 @@ class pdf_azur extends ModelePDFPropales
$tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD) ? 42 + $top_shift : 10);
// Incoterm
if ($conf->incoterm->enabled)
if (!empty($conf->incoterm->enabled))
{
$desc_incoterms = $object->getIncotermsForPDF();
if ($desc_incoterms)

View File

@ -384,7 +384,7 @@ class pdf_cyan extends ModelePDFPropales
// Incoterm
$height_incoterms = 0;
if ($conf->incoterm->enabled)
if (!empty($conf->incoterm->enabled))
{
$desc_incoterms = $object->getIncotermsForPDF();
if ($desc_incoterms)

View File

@ -254,7 +254,7 @@ class pdf_squille extends ModelePdfReception
// Incoterm
$height_incoterms = 0;
if ($conf->incoterm->enabled)
if (!empty($conf->incoterm->enabled))
{
$desc_incoterms = $object->getIncotermsForPDF();
if ($desc_incoterms)

View File

@ -336,7 +336,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
$tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD) ? 42 + $top_shift : 10);
// Incoterm
if ($conf->incoterm->enabled)
if (!empty($conf->incoterm->enabled))
{
$desc_incoterms = $object->getIncotermsForPDF();
if ($desc_incoterms)

View File

@ -342,7 +342,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders
$tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD) ? 42 + $top_shift : 10);
// Incoterm
if ($conf->incoterm->enabled)
if (!empty($conf->incoterm->enabled))
{
$desc_incoterms = $object->getIncotermsForPDF();
if ($desc_incoterms)

View File

@ -370,7 +370,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
$tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD) ? 42 + $top_shift : 10);
// Incoterm
if ($conf->incoterm->enabled)
if (!empty($conf->incoterm->enabled))
{
$desc_incoterms = $object->getIncotermsForPDF();
if ($desc_incoterms)

View File

@ -437,7 +437,7 @@ if ($usevirtualstock)
$sql .= ' HAVING (';
$sql .= ' ('.$sqldesiredtock.' >= 0 AND ('.$sqldesiredtock.' > SUM('.$db->ifsql("s.reel IS NULL", "0", "s.reel").')';
$sql .= ' - ('.$sqlCommandesCli.' - '.$sqlExpeditionsCli.') + ('.$sqlCommandesFourn.' - '.$sqlReceptionFourn.') + ('.$sqlProductionToProduce.' - '.$sqlProductionToConsume.')))';
$sql .= ' OR ';
$sql .= ' OR';
if ($includeproductswithoutdesiredqty == 'on') {
$sql .= ' (('.$sqlalertstock.' >= 0 OR '.$sqlalertstock.' IS NULL) AND ('.$db->ifsql("$sqlalertstock IS NULL", "0", $sqlalertstock).' > SUM('.$db->ifsql("s.reel IS NULL", "0", "s.reel").')';
} else {
@ -448,9 +448,9 @@ if ($usevirtualstock)
if ($salert == 'on') // Option to see when stock is lower than alert
{
$sql .= ' AND ((';
$sql .= ' AND (';
if ($includeproductswithoutdesiredqty == 'on') {
$sql .= $sqlalertstock.' >= 0 OR '.$sqlalertstock.' IS NULL) AND ('.$db->ifsql("$sqlalertstock IS NULL", "0", $sqlalertstock).' > SUM('.$db->ifsql("s.reel IS NULL", "0", "s.reel").')';
$sql .= '('.$sqlalertstock.' >= 0 OR '.$sqlalertstock.' IS NULL) AND ('.$db->ifsql("$sqlalertstock IS NULL", "0", $sqlalertstock).' > SUM('.$db->ifsql("s.reel IS NULL", "0", "s.reel").')';
} else {
$sql .= $sqlalertstock.' >= 0 AND ('.$sqlalertstock.' > SUM('.$db->ifsql("s.reel IS NULL", "0", "s.reel").')';
}
@ -459,20 +459,25 @@ if ($usevirtualstock)
$alertchecked = 'checked';
}
} else {
$sql .= ' HAVING (('.$sqldesiredtock.' >= 0 AND ('.$sqldesiredtock.' > SUM('.$db->ifsql("s.reel IS NULL", "0", "s.reel").')))';
$sql .= ' HAVING (';
$sql .= '('.$sqldesiredtock.' >= 0 AND ('.$sqldesiredtock.' > SUM('.$db->ifsql("s.reel IS NULL", "0", "s.reel").')))';
$sql .= ' OR';
if ($includeproductswithoutdesiredqty == 'on') {
$sql .= ' OR (('.$sqlalertstock.' >= 0 OR '.$sqlalertstock.' IS NULL) AND ('.$db->ifsql("$sqlalertstock IS NULL", "0", $sqlalertstock).' > SUM('.$db->ifsql("s.reel IS NULL", "0", "s.reel").'))))';
$sql .= ' (('.$sqlalertstock.' >= 0 OR '.$sqlalertstock.' IS NULL) AND ('.$db->ifsql("$sqlalertstock IS NULL", "0", $sqlalertstock).' > SUM('.$db->ifsql("s.reel IS NULL", "0", "s.reel").')))';
} else {
$sql .= ' OR ('.$sqlalertstock.' >= 0 AND ('.$sqlalertstock.' > SUM('.$db->ifsql("s.reel IS NULL", "0", "s.reel").'))))';
$sql .= ' ('.$sqlalertstock.' >= 0 AND ('.$sqlalertstock.' > SUM('.$db->ifsql("s.reel IS NULL", "0", "s.reel").')))';
}
$sql .= ')';
if ($salert == 'on') // Option to see when stock is lower than alert
{
$sql .= ' AND (';
if ($includeproductswithoutdesiredqty == 'on') {
$sql .= ' AND (('.$sqlalertstock.' >= 0 OR '.$sqlalertstock.' IS NULL) AND ('.$db->ifsql("$sqlalertstock IS NULL", "0", $sqlalertstock).' > SUM('.$db->ifsql("s.reel IS NULL", "0", "s.reel").')))';
$sql .= ' ('.$sqlalertstock.' >= 0 OR '.$sqlalertstock.' IS NULL) AND ('.$db->ifsql("$sqlalertstock IS NULL", "0", $sqlalertstock).' > SUM('.$db->ifsql("s.reel IS NULL", "0", "s.reel").'))';
} else {
$sql .= ' AND ('.$sqlalertstock.' >= 0 AND ('.$sqlalertstock.' > SUM('.$db->ifsql("s.reel IS NULL", "0", "s.reel").')))';
$sql .= ' '.$sqlalertstock.' >= 0 AND ('.$sqlalertstock.' > SUM('.$db->ifsql("s.reel IS NULL", "0", "s.reel").'))';
}
$sql .= ')';
$alertchecked = 'checked';
}
}