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