/** This Function subtract the specified product quantity to the Product Quantity in Demand in the Warehouse * @param int $productId - ProductId * @param int $qty - Quantity to be subtract */ function deductFromProductDemand($productId, $qty) { global $log; $log->debug("Entering deductFromProductDemand(" . $productId . "," . $qty . ") method ..."); global $adb; $qtyInStck = getProductQtyInDemand($productId); $updQty = $qtyInStck - $qty; $sql = "UPDATE vtiger_products set qtyindemand=? where productid=?"; $adb->pquery($sql, array($updQty, $productId)); $log->debug("Exiting deductFromProductDemand method ..."); }
/** This Function subtract the specified product quantity to the Product Quantity in Demand in the Warehouse * @param int $productId - ProductId * @param int $qty - Quantity to be subtract */ function deductFromProductDemand($productId, $qty) { $log = vglobal('log'); $log->debug("Entering deductFromProductDemand(" . $productId . "," . $qty . ") method ..."); $adb = PearDatabase::getInstance(); $qtyInStck = getProductQtyInDemand($productId); $updQty = $qtyInStck - $qty; $sql = "UPDATE vtiger_products set qtyindemand=? where productid=?"; $adb->pquery($sql, array($updQty, $productId)); $log->debug("Exiting deductFromProductDemand method ..."); }