aggiornamento qta
This commit is contained in:
@@ -197,13 +197,13 @@ function setPreOrder($sku, $aggiornapreordine, $debug)
|
||||
}
|
||||
}
|
||||
|
||||
function isArticleInPrevendita($id)
|
||||
function isArticleInPrevendita($id, $checkqtanegativa)
|
||||
{
|
||||
return loadArticleByIdArticle($id, true);
|
||||
}
|
||||
|
||||
|
||||
function loadArticleByIdArticle($id, $checkprevendita = false)
|
||||
function loadArticleByIdArticle($id, $checkprevendita = false, $checkqtanegativa = false)
|
||||
{
|
||||
|
||||
try {
|
||||
@@ -225,8 +225,10 @@ function loadArticleByIdArticle($id, $checkprevendita = false)
|
||||
$qtaneg = $article->QtaDisponibile < 0;
|
||||
$inprevendita = false;
|
||||
if ($article) {
|
||||
$inprevendita = $qtaneg
|
||||
&& ($article->DescrizioneStatoProdotto === 'In prevendita');
|
||||
$inprevendita = ($article->DescrizioneStatoProdotto === 'In prevendita');
|
||||
if ($checkqtanegativa) {
|
||||
$inprevendita = $inprevendita && $qtaneg;
|
||||
}
|
||||
}
|
||||
if ($inprevendita) {
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user