Example #1
0
File: utils.php Project: yunter/crm
/**	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 ...");
}
Example #2
0
/** 	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 ...");
}