products hotfix

This commit is contained in:
2025-05-11 11:07:45 +00:00
parent 21ab2d0962
commit 9a455c1f2d

View File

@@ -624,6 +624,25 @@ class EcmProduct extends SugarBean
}
return false;
}
function getProductUsingComponent()
{
$db = $GLOBALS['db'];
$res = $db->query("
SELECT p.code, pc.quantity
FROM ecmproductcomponents AS pc
INNER JOIN ecmproducts AS p
ON p.id = pc.ecmproduct_id
WHERE ecmcomponent_id='$this->id';
");
$products = array();
while ($row = $db->fetchByAssoc($res)) {
$products[] = array(
'code' => $row['code'],
'quantity' => $row['quantity'],
);
}
return $products;
}
//***************************Start Managing Positions*************************//
function constructInsertQuery($data, $table = '')
{