예제 #1
0
/**
 * This function updates the stock information once the product is ordered.
 * Param $productid - product id
 * Param $qty - product quantity in no's
 * Param $mode - mode type
 * Param $ext_prod_arr - existing products ** NOT USED: empty **
 * Param $module - module name
 * return type void
 */
function updateStk($product_id, $qty, $mode, $ext_prod_arr, $module)
{
    global $log, $adb, $current_user;
    $log->debug("Entering updateStk({$product_id},{$qty},{$mode},{$module}) method ...");
    $prod_name = getProductName($product_id);
    $qtyinstk = getPrdQtyInStck($product_id);
    $log->debug("Prd Qty in Stock " . $qtyinstk);
    $upd_qty = $qtyinstk - $qty;
    sendPrdStckMail($product_id, $upd_qty, $prod_name, $qtyinstk, $qty, $module);
    $log->debug("Exiting updateStk method ...");
}
예제 #2
0
/**
 * This function updates the stock information once the product is ordered.
 * Param $productid - product id
 * Param $qty - product quantity in no's
 * Param $mode - mode type
 * Param $ext_prod_arr - existing vtiger_products
 * Param $module - module name
 * return type void
 */
function updateStk($product_id, $qty, $mode, $ext_prod_arr, $module)
{
    global $log;
    $log->debug("Entering updateStk(" . $product_id . "," . $qty . "," . $mode . "," . $ext_prod_arr . "," . $module . ") method ...");
    global $adb;
    global $current_user;
    $log->debug("Inside updateStk function, module=" . $module);
    $log->debug("Product Id = {$product_id} & Qty = {$qty}");
    $prod_name = getProductName($product_id);
    $qtyinstk = getPrdQtyInStck($product_id);
    $log->debug("Prd Qty in Stock " . $qtyinstk);
    $upd_qty = $qtyinstk - $qty;
    sendPrdStckMail($product_id, $upd_qty, $prod_name, $qtyinstk, $qty, $module);
    $log->debug("Exiting updateStk method ...");
}