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