Fix sql error

This commit is contained in:
Laurent Destailleur 2023-04-10 13:59:19 +02:00
parent 9283b7af74
commit 569320424b
2 changed files with 5 additions and 5 deletions

View File

@ -2209,8 +2209,8 @@ class Expedition extends CommonObject
$sql = "SELECT cd.fk_product, cd.subprice,"; $sql = "SELECT cd.fk_product, cd.subprice,";
$sql .= " ed.rowid, ed.qty, ed.fk_entrepot,"; $sql .= " ed.rowid, ed.qty, ed.fk_entrepot,";
$sql .= " e.ref,"; $sql .= " e.ref,";
$sql .= " edb.rowid as edbrowid, edb.eatby, edb.sellby, edb.batch, edb.qty as edbqty, edb.fk_origin_stock"; $sql .= " edb.rowid as edbrowid, edb.eatby, edb.sellby, edb.batch, edb.qty as edbqty, edb.fk_origin_stock,";
$sql .= " ,cd.rowid as cdid, ed.rowid as edid"; $sql .= " cd.rowid as cdid, ed.rowid as edid";
$sql .= " FROM " . MAIN_DB_PREFIX . "commandedet as cd,"; $sql .= " FROM " . MAIN_DB_PREFIX . "commandedet as cd,";
$sql .= " " . MAIN_DB_PREFIX . "expeditiondet as ed"; $sql .= " " . MAIN_DB_PREFIX . "expeditiondet as ed";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "expeditiondet_batch as edb on edb.fk_expeditiondet = ed.rowid"; $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "expeditiondet_batch as edb on edb.fk_expeditiondet = ed.rowid";
@ -2264,8 +2264,8 @@ class Expedition extends CommonObject
// If some stock lines are now 0, we can remove entry into llx_product_stock, but only if there is no child lines into llx_product_batch (detail of batch, because we can imagine // If some stock lines are now 0, we can remove entry into llx_product_stock, but only if there is no child lines into llx_product_batch (detail of batch, because we can imagine
// having a lot1/qty=X and lot2/qty=-X, so 0 but we must not loose repartition of different lot. // having a lot1/qty=X and lot2/qty=-X, so 0 but we must not loose repartition of different lot.
$sql = "DELETE FROM ".MAIN_DB_PREFIX."product_stock WHERE reel = 0 AND rowid NOT IN (SELECT fk_product_stock FROM ".MAIN_DB_PREFIX."product_batch as pb)"; $sqldelete = "DELETE FROM ".MAIN_DB_PREFIX."product_stock WHERE reel = 0 AND rowid NOT IN (SELECT fk_product_stock FROM ".MAIN_DB_PREFIX."product_batch as pb)";
$resql = $this->db->query($sql); $resqldelete = $this->db->query($sqldelete);
// We do not test error, it can fails if there is child in batch details // We do not test error, it can fails if there is child in batch details
} }
} else { } else {

View File

@ -773,7 +773,7 @@ if ($id > 0 || !empty($ref)) {
$toBeShippedTotal += $toBeShipped[$objp->fk_product]; $toBeShippedTotal += $toBeShipped[$objp->fk_product];
print $toBeShipped[$objp->fk_product]; print $toBeShipped[$objp->fk_product];
} else { } else {
print '0 ('.$langs->trans("Service").')'; print '0 <span class="opacitymedium">('.$langs->trans("Service").')</span>';
} }
print ($objp->unit_order ? ' '.$objp->unit_order : '').'</td>'; print ($objp->unit_order ? ' '.$objp->unit_order : '').'</td>';