risolto errore
This commit is contained in:
@@ -75,7 +75,7 @@ class ProductUpdateQta extends Command
|
||||
->where('data1','>=',$fromtime)
|
||||
->orderBy('DataOra')
|
||||
->get();
|
||||
*/
|
||||
*/
|
||||
$stocks = Stock::select('Codice', 'QtaDisponibile', DB::raw('MAX(DataOra) as data_recente'))
|
||||
->where('DataOra', '>=', $fromtime)
|
||||
->groupBy('Codice', 'QtaDisponibile')
|
||||
@@ -96,9 +96,13 @@ class ProductUpdateQta extends Command
|
||||
$inprevendita = isArticleInPrevendita($stock->Codice, false);
|
||||
$inprevendita_qtaneg = isArticleInPrevendita($stock->Codice, true);
|
||||
$qtyinstock = intval($productsku['stock_quantity']);
|
||||
$titolo = $productsku['title'];
|
||||
// Se il libro è ancora in Prevendita e la quantità è > QTA_MINIMA_PER_PREVENDITA, allora non aggiornare la QTA
|
||||
// deve rimanere a > QTA_MINIMA_PER_PREVENDITA per poter vedere "In Preordine"
|
||||
if (isset($productsku['title'])) {
|
||||
$titolo = $productsku['title'];
|
||||
} else {
|
||||
$titolo = '';
|
||||
}
|
||||
// Se il libro è ancora in Prevendita e la quantità è > MyConfig::$qtaMinima, allora non aggiornare la QTA
|
||||
// deve rimanere a > MyConfig::$qtaMinima per poter vedere "In Preordine"
|
||||
if ($inprevendita && $qtyinstock > MyConfig::$qtaInPrevendita) {
|
||||
$aggiorna = false;
|
||||
}
|
||||
@@ -118,7 +122,7 @@ class ProductUpdateQta extends Command
|
||||
|
||||
$log .= ' *** ' . $stock->Codice . ' ' . $titolo . ' QTA=' . $stock->QtaDisponibile . "\n";
|
||||
|
||||
if ($inprevendita_qtaneg && ($qtyinstock < QTA_MINIMA_PER_PREVENDITA)) {
|
||||
if ($inprevendita_qtaneg && ($qtyinstock < MyConfig::$qtaMinima)) {
|
||||
setPreOrder($stock->Codice, "1", false);
|
||||
$log .= ' SETTATO IN PREVENDITA ! <br>';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user