当前位置: 首页>>代码示例>>PHP>>正文


PHP products_minierp::stockAdd方法代码示例

本文整理汇总了PHP中products_minierp::stockAdd方法的典型用法代码示例。如果您正苦于以下问题:PHP products_minierp::stockAdd方法的具体用法?PHP products_minierp::stockAdd怎么用?PHP products_minierp::stockAdd使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在products_minierp的用法示例。


在下文中一共展示了products_minierp::stockAdd方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: cancelOrderStockHandler

function cancelOrderStockHandler($type, $oiid, $stock_status, $status, $print_count, $print_confirmed, $products_id, $articles_id, $quantity, $is_promotion_order = false)
{
    global $STOCKLESS_ELEMENTS_CATEGORY;
    use_class('products_minierp');
    use_class('elements_stock');
    use_class('element');
    $class_pm = new products_minierp();
    $class_es = new elements_stock();
    $timestamp = date('Y-m-d H:i:s');
    if (in_array($status, array('1', '2', '3')) && $print_confirmed == 0 || $status == '8' && $print_count == 0) {
        switch ($stock_status) {
            case 'D':
                //DEPOT STOCK
                $class_pm->stockAdd(WAREHOUSE_ID_FOR_HANDLING_ORDERS, $products_id, $articles_id, $quantity, 'ADD CANCEL ' . $type . '-' . $oiid);
                break;
            case 'P':
                //FG STOCK
                $class_pm->stockAdd(WAREHOUSE_ID_PRODUCTS_BALI, $products_id, $articles_id, $quantity, 'ADD CANCEL ' . $type . '-' . $oiid);
                break;
            case 'R':
                //ELEMENTS STOCK
                $elements_used = array();
                $el_usage = $class_pm->retrieveElementsUsage($products_id, $articles_id);
                foreach ($el_usage as $e) {
                    $elements_used[$e['elements_id']] = $e['quantity'];
                }
                foreach ($elements_used as $eid => $el_qty) {
                    $el = new element($eid);
                    $el_cat_id = !is_null($el->attributes['category']['id']) ? $el->attributes['category']['id'] : '';
                    if (!in_array($el_cat_id, $STOCKLESS_ELEMENTS_CATEGORY)) {
                        $stock_qty = $quantity * $el_qty;
                        $current_stock = $class_es->addStockByPieces(WAREHOUSE_ID_ELEMENTS, $eid, $stock_qty, 'ADD CANCEL ' . $type . '-' . $oiid, $is_promotion_order);
                    }
                }
                break;
        }
    }
}
开发者ID:blasiuscosa,项目名称:manobo-2008,代码行数:38,代码来源:functions-2.php

示例2: array

            $products_id = $row['products_id'];
            $articles_id = $row['products_articles_id'];
            if (!isset($total_products[$jng_warehouses_id][$products_id])) {
                $total_products[$jng_warehouses_id][$products_id] = array();
            }
            if (!isset($total_products[$jng_warehouses_id][$products_id][$articles_id])) {
                $total_products[$jng_warehouses_id][$products_id][$articles_id] = 0;
            }
            $total_products[$jng_warehouses_id][$products_id][$articles_id] += $row['order_quantity'];
        }
    }
}
foreach ($total_products as $jng_warehouses_id => $products) {
    foreach ($products as $products_id => $articles) {
        foreach ($articles as $aid => $add_amount) {
            $class_pm->stockAdd($jng_warehouses_id, $products_id, $add_amount, $aid);
            $class_ms->products_state($jng_warehouses_id, $products_id, $period, true);
        }
    }
}
//ELEMENTS
$jng_warehouses_id = 1;
$stocks = $class_es->retrieveAll($jng_warehouses_id);
foreach ($stocks as $eid => $stock) {
    $class_ms->elements_state($jng_warehouses_id, $eid, $period, true);
}
//FG Bali
$jng_warehouses_id = 7;
$stocks = $class_pm->stockRetrieveList($jng_warehouses_id);
foreach ($stocks as $s) {
    if ($s['stock'] > 0) {
开发者ID:blasiuscosa,项目名称:manobo-2008,代码行数:31,代码来源:temp-stock-system-initializer.php

示例3: header

     $ean = tep_db_prepare_input($_POST['ean']);
     $qty = tep_db_prepare_input($_POST['qty']);
     use_class('products_ean');
     $class_ean = new products_ean();
     $article = $class_ean->getProductArticle($ean);
     if ($article['products_id'] == '0') {
         $messagebox->add("<strong>Manual Bin In Failed: UNKNOWN EAN</strong><br />Please check if correct EAN Label is used");
     } else {
         $segment = $class_bin->retrieveSegmentDetail($bin['bin_segments_id']);
         $jng_warehouses_id = $segment['warehouses_id'];
         $products_id = $article['products_id'];
         $articles_id = $article['products_articles_id'];
         $stock = $class_pm->stockRetrieveDetail($jng_warehouses_id, $products_id, $articles_id);
         $bin_current = $class_bin->getBinProductStock($stock['products_stock_id']);
         if (is_null($bin_current)) {
             $class_pm->stockAdd($jng_warehouses_id, $products_id, $articles_id, $qty, "MANUAL BIN-IN by {$session_userinfo['username']}");
             $class_bin->bookBinForProduct($bins_id, $stock['products_stock_id']);
             header("Location: ?open=products-stock-detail&id={$stock['products_stock_id']}" . ($hidemenuscript != '' ? '&hidemenu=true' : ''));
             exit;
         } else {
             $messagebox->add("<strong>Manual Bin In Failed: EXISTING ARTICLE</strong><br />This article has booked another bin: " . $bin_current['code_clean']);
         }
     }
 } elseif ($_POST['me_action'] == 'GETPRODUCTSTOCKHISTORY') {
     $psid = tep_db_prepare_input($_POST['psid']);
     $period = tep_db_prepare_input($_POST['period']);
     $daily_summary = tep_db_prepare_input($_POST['daily_summary']);
     $ps = $class_pm->stockRetrieveDetailByPSID($psid);
     $whid = $ps['jng_warehouses_id'];
     $pid = $ps['products_id'];
     $aid = $ps['articles_id'];
开发者ID:blasiuscosa,项目名称:manobo-2008,代码行数:31,代码来源:products-stock-detail.php

示例4: countElementsUsage

     if ($oi['stock_status'] == 'R') {
         //ADD BACK ELEMENTS STOCK AUTOMATICALLY
         $eu = countElementsUsage($oi);
         foreach ($eu as $e_id => $e_qty) {
             if (!in_array($elements_categories[$e_id], $STOCKLESS_ELEMENTS_CATEGORY)) {
                 $stock_id = $e_id;
                 $order_qty = $oi['order_quantity'] * $e_qty;
                 $class_es->addStockByPieces($whid_elements, $e_id, $order_qty, 'ADD-EL ' . $order_type . '-' . $oiid);
                 $elements_stock[$stock_id] += $order_qty;
             }
         }
     } elseif ($oi['stock_status'] == 'P') {
         //ADD BACK FG STOCK AUTOMATICALLY
         $stock_id = $oi['products_id'] . $oi['products_articles_id'];
         $order_qty = $oi['order_quantity'];
         $class_pm->stockAdd($whid_prod, $oi['products_id'], $oi['products_articles_id'], $order_qty, 'ADD-FG ' . $order_type . '-' . $oiid);
         $products_stock_bali[$stock_id] += $order_qty;
     }
 }
 $oi_trans = null;
 //PRODUCT IS ALREADY MOVED TO IN HH TAB (MMO) - Retrieve MMO details as $oi_trans
 if ($oi['status'] == $new_status) {
     $oi_trans = $class_do->retrieveDetailTransmigran($order_type, $oiid);
 }
 //CANCEL MMO IF NOT YET IN PRODUCTION
 if (!is_null($oi_trans) && $oi_trans['status'] < 4) {
     $class_do->doCancelOrders($oi_trans['depot_orders_id'], $oi_trans['status'], 'auto-set');
 }
 //REQUEST DEPOT REFILL IF ORDER WAS NOT YET IN PRODUCTION
 if (is_null($oi_trans) && $oi['status'] < 4 || !is_null($oi_trans) && $oi_trans['status'] < 4) {
     $refill_type = depot_orders::AUTO_REFILL_ID_DSO;
开发者ID:blasiuscosa,项目名称:manobo-2008,代码行数:31,代码来源:process-open-orders.php


注:本文中的products_minierp::stockAdd方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。