Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX - Repair the replenishment list #29336

Merged
merged 10 commits into from
Apr 17, 2024
Prev Previous commit
Next Next commit
Update replenish.php
  • Loading branch information
eldy authored Apr 12, 2024
commit b6a0f5830fa456bab86af72615b2e6c6900c9c2b
2 changes: 1 addition & 1 deletion htdocs/product/stock/replenish.php
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,8 @@

// Check if an order for the supplier exists
$sql = "SELECT rowid FROM " . MAIN_DB_PREFIX . "commande_fournisseur";
$sql .= " WHERE fk_soc = " . ((int)$suppliersid[$i]);

Check failure on line 233 in htdocs/product/stock/replenish.php

View workflow job for this annotation

GitHub Actions / pre-commit

Expected 1 space after cast statement; 0 found
$sql .= " AND source = " . ((int)$order::SOURCE_ID_REPLENISHMENT) . " AND fk_statut = " . ((int)$order::STATUS_DRAFT);

Check failure on line 234 in htdocs/product/stock/replenish.php

View workflow job for this annotation

GitHub Actions / pre-commit

Expected 1 space after cast statement; 0 found

Check failure on line 234 in htdocs/product/stock/replenish.php

View workflow job for this annotation

GitHub Actions / pre-commit

Expected 1 space after cast statement; 0 found
$sql .= " AND entity IN (" . getEntity('commande_fournisseur') . ")";
$sql .= " ORDER BY date_creation DESC";
$resql = $db->query($sql);
Expand Down Expand Up @@ -366,7 +366,7 @@

//$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'entrepot AS ent ON s.fk_entrepot = ent.rowid AND ent.entity IN('.getEntity('stock').')';
if (!empty($conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE) && $fk_entrepot > 0) {
$sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'product_warehouse_properties AS pse ON (p.rowid = pse.fk_product AND pse.fk_entrepot = ' . ((int)$fk_entrepot) . ')';

Check failure on line 369 in htdocs/product/stock/replenish.php

View workflow job for this annotation

GitHub Actions / pre-commit

Expected 1 space after cast statement; 0 found
}
// Add fields from hooks
$parameters = array();
Expand All @@ -392,7 +392,7 @@
$sql .= natural_search('p.label', $search_label);
}
$sql .= ' AND p.tobuy = 1';
if (!isModEnabled('variants') && !getDolGlobalString('VARIANT_ALLOW_STOCK_MOVEMENT_ON_VARIANT_PARENT')) { // Add test to exclude products that has variants
if (isModEnabled('variants') && !getDolGlobalString('VARIANT_ALLOW_STOCK_MOVEMENT_ON_VARIANT_PARENT')) { // Add test to exclude products that has variants
$sql .= ' AND p.rowid NOT IN (SELECT pac.fk_product_parent FROM ' . MAIN_DB_PREFIX . 'product_attribute_combination as pac WHERE pac.entity IN (' . getEntity('product') . '))';
}
if ($fk_supplier > 0) {
Expand Down Expand Up @@ -674,7 +674,7 @@
}
}
if ($limit > 0 && $limit != $conf->liste_limit) {
$filters .= '&limit=' . ((int)$limit);

Check failure on line 677 in htdocs/product/stock/replenish.php

View workflow job for this annotation

GitHub Actions / pre-commit

Expected 1 space after cast statement; 0 found
}
if (!empty($includeproductswithoutdesiredqty)) $filters .= '&includeproductswithoutdesiredqty=' . urlencode($includeproductswithoutdesiredqty);
if (!empty($salert)) $filters .= '&salert=' . urlencode($salert);
Expand Down Expand Up @@ -815,7 +815,7 @@
if (getDolGlobalInt('MAIN_MULTILANGS')) {
$sql = 'SELECT label,description';
$sql .= ' FROM ' . MAIN_DB_PREFIX . 'product_lang';
$sql .= ' WHERE fk_product = ' . ((int)$objp->rowid);

Check failure on line 818 in htdocs/product/stock/replenish.php

View workflow job for this annotation

GitHub Actions / pre-commit

Expected 1 space after cast statement; 0 found
$sql .= " AND lang = '" . $db->escape($langs->getDefaultLang()) . "'";
$sql .= ' LIMIT 1';

Expand Down
Loading