fixed $checkqtanegativa
This commit is contained in:
@@ -424,7 +424,7 @@ function setDataPubblicazione($sku, $debug)
|
|||||||
|
|
||||||
function isArticleInPrevendita($id, $checkqtanegativa)
|
function isArticleInPrevendita($id, $checkqtanegativa)
|
||||||
{
|
{
|
||||||
return loadArticleByIdArticle($id, true);
|
return loadArticleByIdArticle($id, true, $checkqtanegativa);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -437,15 +437,15 @@ function loadArticleByIdArticle($id, $checkprevendita = false, $checkqtanegativa
|
|||||||
$join->on('T_WEB_Articoli.IdArticolo', '=', 'b.IdArticolo')
|
$join->on('T_WEB_Articoli.IdArticolo', '=', 'b.IdArticolo')
|
||||||
->on('T_WEB_Articoli.DataOra', '=', 'b.data');
|
->on('T_WEB_Articoli.DataOra', '=', 'b.data');
|
||||||
})
|
})
|
||||||
->leftJoin(DB::raw('(SELECT e.IdStatoProdotto, e.Descrizione as DescrizioneStatoProdotto FROM T_WEB_StatiProdotto e
|
->leftJoin(DB::raw('(SELECT e.IdStatoProdotto, e.Descrizione as DescrizioneStatoProdotto FROM T_WEB_StatiProdotto e
|
||||||
JOIN (SELECT IdStatoProdotto, MAX(DataOra) as data1
|
JOIN (SELECT IdStatoProdotto, MAX(DataOra) as data1
|
||||||
FROM T_WEB_StatiProdotto GROUP BY IdStatoProdotto) c
|
FROM T_WEB_StatiProdotto GROUP BY IdStatoProdotto) c
|
||||||
ON e.IdStatoProdotto = c.IdStatoProdotto AND e.DataOra = c.data1) f'), function ($join) {
|
ON e.IdStatoProdotto = c.IdStatoProdotto AND e.DataOra = c.data1) f'), function ($join) {
|
||||||
$join->on('T_WEB_Articoli.IdStatoProdotto', '=', 'f.IdStatoProdotto');
|
$join->on('T_WEB_Articoli.IdStatoProdotto', '=', 'f.IdStatoProdotto');
|
||||||
})
|
})
|
||||||
->leftJoin(DB::raw('(SELECT o.Codice, o.QtaDisponibile FROM T_WEB_Disponibile o
|
->leftJoin(DB::raw('(SELECT o.Codice, o.QtaDisponibile FROM T_WEB_Disponibile o
|
||||||
JOIN (SELECT Codice, MAX(DataOra) as data1
|
JOIN (SELECT Codice, MAX(DataOra) as data1
|
||||||
FROM T_WEB_Disponibile GROUP BY Codice) p
|
FROM T_WEB_Disponibile GROUP BY Codice) p
|
||||||
ON o.Codice = p.Codice AND o.DataOra = p.data1) q'), function ($join) {
|
ON o.Codice = p.Codice AND o.DataOra = p.data1) q'), function ($join) {
|
||||||
$join->on('T_WEB_Articoli.IdArticolo', '=', 'q.Codice');
|
$join->on('T_WEB_Articoli.IdArticolo', '=', 'q.Codice');
|
||||||
})
|
})
|
||||||
@@ -769,8 +769,8 @@ function getStructTable($tableName)
|
|||||||
$str .= '<pre>';
|
$str .= '<pre>';
|
||||||
|
|
||||||
// Recupera i tipi di dati e lunghezza per ogni colonna
|
// Recupera i tipi di dati e lunghezza per ogni colonna
|
||||||
$types = DB::select("SELECT column_name, data_type, character_maximum_length
|
$types = DB::select("SELECT column_name, data_type, character_maximum_length
|
||||||
FROM information_schema.columns
|
FROM information_schema.columns
|
||||||
WHERE table_name = '$tableName'");
|
WHERE table_name = '$tableName'");
|
||||||
$columnInfo = [];
|
$columnInfo = [];
|
||||||
foreach ($types as $type) {
|
foreach ($types as $type) {
|
||||||
@@ -1278,8 +1278,8 @@ function libriInPrevendita()
|
|||||||
) y'), function ($join) {
|
) y'), function ($join) {
|
||||||
$join->on('T_WEB_Articoli.IdCollana', '=', 'y.IdCollana');
|
$join->on('T_WEB_Articoli.IdCollana', '=', 'y.IdCollana');
|
||||||
})
|
})
|
||||||
->leftJoin(DB::raw('(SELECT g2.IdArgomento, g2.Descrizione as DescrArgomento FROM T_WEB_Argomenti
|
->leftJoin(DB::raw('(SELECT g2.IdArgomento, g2.Descrizione as DescrArgomento FROM T_WEB_Argomenti
|
||||||
g2 JOIN (SELECT IdArgomento, MAX(DataOra) as data12 from T_WEB_Argomenti
|
g2 JOIN (SELECT IdArgomento, MAX(DataOra) as data12 from T_WEB_Argomenti
|
||||||
GROUP BY IdArgomento) h ON g2.IdArgomento = h.IdArgomento AND g2.DataOra = h.data12 ) i2'), function ($join) {
|
GROUP BY IdArgomento) h ON g2.IdArgomento = h.IdArgomento AND g2.DataOra = h.data12 ) i2'), function ($join) {
|
||||||
$join->on('T_WEB_Articoli.ListaArgomenti', '=', 'i2.IdArgomento');
|
$join->on('T_WEB_Articoli.ListaArgomenti', '=', 'i2.IdArgomento');
|
||||||
})
|
})
|
||||||
@@ -2287,7 +2287,7 @@ function setProductFromGM($article, $initlog, ProductLogger &$passproductLogger)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// ESISTE GIA' IL LIBRO
|
// ESISTE GIA' IL LIBRO
|
||||||
|
|
||||||
echo "Esiste già il libro...";
|
echo "Esiste già il libro...";
|
||||||
|
|
||||||
@@ -2365,7 +2365,7 @@ function getArticoloById($idarticolo)
|
|||||||
->orderBy('dataOra', 'desc')
|
->orderBy('dataOra', 'desc')
|
||||||
->get();
|
->get();
|
||||||
|
|
||||||
// se $articles è un array
|
// se $articles è un array
|
||||||
if (count($articles) > 0) {
|
if (count($articles) > 0) {
|
||||||
$article = $articles[0];
|
$article = $articles[0];
|
||||||
} else {
|
} else {
|
||||||
@@ -2461,7 +2461,7 @@ function updateArticoloFromGM($idarticolo)
|
|||||||
->orderBy('dataOra', 'desc')
|
->orderBy('dataOra', 'desc')
|
||||||
->get();
|
->get();
|
||||||
|
|
||||||
// se $articles è un array
|
// se $articles è un array
|
||||||
if (count($articles) > 0) {
|
if (count($articles) > 0) {
|
||||||
$article = $articles[0];
|
$article = $articles[0];
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user