• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Warehouse类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: login

 /**
  * Tries to login.
  * @param session id if logged in successfull, false otherwise.
  */
 public function login()
 {
     // get warehouse
     $warehouse = new Warehouse($this->warehouseId);
     $vSession = false;
     if ($warehouse->checkPassword($this->pw)) {
         $vSession = new Session($warehouse->id, true, false);
     } elseif ($warehouse->checkPasswordRestricted($this->pw)) {
         $vSession = new Session($warehouse->id, true);
     }
     return $vSession;
 }
开发者ID:hanneseilers,项目名称:Social-Warehouse,代码行数:16,代码来源:Login.php


示例2: getWarehouseList

 public function getWarehouseList()
 {
     /* Load Model of warehouses and setup the list */
     App::import('Model', 'Warehouse');
     $warehouse = new Warehouse();
     /* Set conditions */
     $options = array('fields' => array('City.city_name', 'Warehouse.warehouse_name', 'Warehouse.id'), 'joins' => array(array('alias' => 'City', 'table' => 'cities', 'type' => 'LEFT', 'conditions' => array('City.id = WarehouseDesc.city_id'))), 'conditions' => array('WarehouseDesc.is_deleted' => 0));
     $getWarehouseAllWithStatus = $warehouse->find('all', $options);
     $newWarehouseList = array();
     if ($warehouse->find('count') > 0) {
         foreach ($getWarehouseAllWithStatus as $index => $value) {
             $newWarehouseList[$value["Warehouse"]["id"]] = $value["Warehouse"]["warehouse_name"] . " (" . $value["City"]["city_name"] . ")";
         }
     }
     return $getWarehouseList = $newWarehouseList;
 }
开发者ID:agashish,项目名称:test_new,代码行数:16,代码来源:CommonHelper.php


示例3: renderForm

 public function renderForm()
 {
     $warehouses = Warehouse::getWarehouses();
     $this->fields_form = array('legend' => array('title' => $this->l('States'), 'icon' => 'icon-globe'), 'input' => array(array('type' => 'text', 'label' => 'Название', 'name' => 'name', 'lang' => true, 'required' => true, 'class' => 'copy2friendlyUrl', 'hint' => $this->l('Invalid characters:') . ' <>;=#{}'), array('type' => 'text', 'label' => 'Порядок сортировки', 'name' => 'sort', 'class' => 'copy2friendlyUrl', 'hint' => $this->l('Invalid characters:') . ' <>;=#{}'), array('type' => 'text', 'label' => 'Стоимость доставки в разделе декор', 'name' => 'price_decor', 'class' => 'copy2friendlyUrl', 'hint' => $this->l('Invalid characters:') . ' <>;=#{}'), array('type' => 'text', 'label' => 'Стоимость доставки обычная', 'name' => 'price_main', 'class' => 'copy2friendlyUrl', 'hint' => $this->l('Invalid characters:') . ' <>;=#{}'), array('type' => 'text', 'label' => 'Адрес склада', 'name' => 'address_warehouse', 'class' => 'copy2friendlyUrl', 'hint' => $this->l('Invalid characters:') . ' <>;=#{}'), array('type' => 'text', 'label' => 'Режим работы', 'name' => 'mode', 'class' => 'copy2friendlyUrl', 'hint' => $this->l('Invalid characters:') . ' <>;=#{}'), array('type' => 'switch', 'label' => 'Главный', 'name' => 'is_main', 'required' => true, 'values' => array(array('id' => 'active_on', 'value' => 1, 'label' => '<img src="../img/admin/enabled.gif" alt="' . $this->l('Enabled') . '" title="' . $this->l('Enabled') . '" />'), array('id' => 'active_off', 'value' => 0, 'label' => '<img src="../img/admin/disabled.gif" alt="' . $this->l('Disabled') . '" title="' . $this->l('Disabled') . '" />'))), array('type' => 'switch', 'label' => 'Московская обл', 'name' => 'is_msk', 'required' => true, 'values' => array(array('id' => 'active_on', 'value' => 1, 'label' => '<img src="../img/admin/enabled.gif" alt="' . $this->l('Enabled') . '" title="' . $this->l('Enabled') . '" />'), array('id' => 'active_off', 'value' => 0, 'label' => '<img src="../img/admin/disabled.gif" alt="' . $this->l('Disabled') . '" title="' . $this->l('Disabled') . '" />')))), 'submit' => array('title' => $this->l('Save')));
     //                foreach ($warehouses as $warehous){
     //                    $this->fields_form['input'][] = array(
     //                        'type' => 'text',
     //                        'label' => 'Время доставки со скдада '.$warehous['name'],
     //                        'name' => 'distance_'.$warehous['id_warehouse'],
     //                        'hint' => 'Время доставки в днях',
     //                    );
     //                    $this->fields_form['input'][] = array(
     //                        'type' => 'text',
     //                        'label' => 'Стоимость доставки со склада '.$warehous['name'],
     //                        'name' => 'price_'.$warehous['id_warehouse'],
     //                        'hint' => 'Стоимость доставки в рублях',
     //                    );
     //                    if(!empty($this->object->id_city)){
     //                        $fields_value = Db::getInstance()->getRow("SELECT distance,price FROM "._DB_PREFIX_."city_warehous
     //                            WHERE id_warehouse={$warehous['id_warehouse']} AND id_city={$this->object->id_city}");
     //
     //                        $this->fields_value['distance_'.$warehous['id_warehouse']] = isset($fields_value['distance']) ? $fields_value['distance'] : '';
     //                        $this->fields_value['price_'.$warehous['id_warehouse']] = isset($fields_value['price']) ? $fields_value['price'] : '';
     //                    }
     //                }
     return parent::renderForm();
 }
开发者ID:WhisperingTree,项目名称:etagerca,代码行数:27,代码来源:AdminCityController.php


示例4: testClosestWarehouse

 function testClosestWarehouse()
 {
     $warehouse = Warehouse::closest_to($this->objFromFixture("Address", "customeraddress1"));
     $this->assertEquals("Main warehouse", $warehouse->Title);
     $warehouse = Warehouse::closest_to($this->objFromFixture("Address", "customeraddress2"));
     $this->assertEquals("NSW depot", $warehouse->Title);
 }
开发者ID:helpfulrobot,项目名称:silvershop-shipping,代码行数:7,代码来源:WarehouseTest.php


示例5: getWarehouseList

 public function getWarehouseList()
 {
     /* Load Model of warehouses and setup the list */
     App::import('Model', 'Warehouse');
     $warehouse = new Warehouse();
     $getWarehouseAllWithStatus = $warehouse->find('all');
     $newWarehouseList = array();
     if ($warehouse->find('count') > 0) {
         foreach ($getWarehouseAllWithStatus as $index => $value) {
             if ($value["WarehouseDesc"]["is_deleted"] == "1") {
                 $newWarehouseList[$value["Warehouse"]["id"]] = $value["Warehouse"]["warehouse_name"] . " (Under Deleted)";
             } else {
                 $newWarehouseList[$value["Warehouse"]["id"]] = $value["Warehouse"]["warehouse_name"];
             }
         }
     }
     return $getWarehouseList = $newWarehouseList;
 }
开发者ID:agashish,项目名称:wms_master,代码行数:18,代码来源:CommonComponent.php


示例6: run

 public function run()
 {
     //$faker = Faker::create();
     //foreach(range(1, 10) as $index)
     //{
     Warehouse::create(['item' => '158-52A', 'quantity' => 800, 'position' => 205]);
     Warehouse::create(['item' => '158-52B', 'quantity' => 900, 'position' => 213]);
     Warehouse::create(['item' => '211-19A', 'quantity' => 900, 'position' => 125]);
     Warehouse::create(['item' => '211-19B', 'quantity' => 900, 'position' => 126]);
     //}
 }
开发者ID:yanguanglan,项目名称:sz,代码行数:11,代码来源:WarehousesTableSeeder.php


示例7: __construct

 public function __construct()
 {
     $this->bootstrap = true;
     $this->className = 'Configuration';
     $this->table = 'configuration';
     parent::__construct();
     $warehouse_list = Warehouse::getWarehouses();
     $warehouse_no = array(array('id_warehouse' => 0, 'name' => $this->l('No default warehouse (default setting)')));
     $warehouse_list = array_merge($warehouse_no, $warehouse_list);
     $this->fields_options = array('products' => array('title' => $this->l('Products (general)'), 'fields' => array('PS_CATALOG_MODE' => array('title' => $this->l('Catalog mode'), 'hint' => $this->l('When active, all shopping features will be disabled.'), 'validation' => 'isBool', 'cast' => 'intval', 'required' => false, 'type' => 'bool'), 'PS_COMPARATOR_MAX_ITEM' => array('title' => $this->l('Product comparison'), 'hint' => $this->l('Set the maximum number of products that can be selected for comparison. Set to "0" to disable this feature.'), 'validation' => 'isUnsignedId', 'required' => true, 'cast' => 'intval', 'type' => 'text'), 'PS_NB_DAYS_NEW_PRODUCT' => array('title' => $this->l('Number of days for which the product is considered \'new\''), 'validation' => 'isUnsignedInt', 'cast' => 'intval', 'type' => 'text'), 'PS_CART_REDIRECT' => array('title' => $this->l('Redirect after adding product to cart'), 'hint' => $this->l('Only for non-AJAX versions of the cart.'), 'cast' => 'intval', 'show' => true, 'required' => false, 'type' => 'radio', 'validation' => 'isBool', 'choices' => array(0 => $this->l('Previous page'), 1 => $this->l('Cart summary'))), 'PS_PRODUCT_SHORT_DESC_LIMIT' => array('title' => $this->l('Max size of short description'), 'hint' => $this->l('Set the maximum size of product short description (in characters).'), 'validation' => 'isInt', 'cast' => 'intval', 'type' => 'text', 'suffix' => $this->l('characters')), 'PS_QTY_DISCOUNT_ON_COMBINATION' => array('title' => $this->l('Quantity discounts based on'), 'hint' => $this->l('How to calculate quantity discounts.'), 'cast' => 'intval', 'show' => true, 'required' => false, 'type' => 'radio', 'validation' => 'isBool', 'choices' => array(0 => $this->l('Products'), 1 => $this->l('Combinations'))), 'PS_FORCE_FRIENDLY_PRODUCT' => array('title' => $this->l('Force update of friendly URL'), 'hint' => $this->l('When active, friendly URL will be updated on every save.'), 'validation' => 'isBool', 'cast' => 'intval', 'required' => false, 'type' => 'bool')), 'submit' => array('title' => $this->l('Save'))), 'order_by_pagination' => array('title' => $this->l('Pagination'), 'fields' => array('PS_PRODUCTS_PER_PAGE' => array('title' => $this->l('Products per page'), 'hint' => $this->l('Number of products displayed per page. Default is 10.'), 'validation' => 'isUnsignedInt', 'cast' => 'intval', 'type' => 'text'), 'PS_PRODUCTS_ORDER_BY' => array('title' => $this->l('Default order by'), 'hint' => $this->l('The order in which products are displayed in the product list.'), 'type' => 'select', 'list' => array(array('id' => '0', 'name' => $this->l('Product name')), array('id' => '1', 'name' => $this->l('Product price')), array('id' => '2', 'name' => $this->l('Product add date')), array('id' => '3', 'name' => $this->l('Product modified date')), array('id' => '4', 'name' => $this->l('Position inside category')), array('id' => '5', 'name' => $this->l('Manufacturer')), array('id' => '6', 'name' => $this->l('Product quantity')), array('id' => '7', 'name' => $this->l('Product reference'))), 'identifier' => 'id'), 'PS_PRODUCTS_ORDER_WAY' => array('title' => $this->l('Default order method'), 'hint' => $this->l('Default order method for product list.'), 'type' => 'select', 'list' => array(array('id' => '0', 'name' => $this->l('Ascending')), array('id' => '1', 'name' => $this->l('Descending'))), 'identifier' => 'id')), 'submit' => array('title' => $this->l('Save'))), 'fo_product_page' => array('title' => $this->l('Product page'), 'fields' => array('PS_DISPLAY_QTIES' => array('title' => $this->l('Display available quantities on the product page'), 'validation' => 'isBool', 'cast' => 'intval', 'required' => false, 'type' => 'bool'), 'PS_LAST_QTIES' => array('title' => $this->l('Display remaining quantities when the quantity is lower than'), 'hint' => $this->l('Set to "0" to disable this feature.'), 'validation' => 'isUnsignedId', 'required' => true, 'cast' => 'intval', 'type' => 'text'), 'PS_DISPLAY_JQZOOM' => array('title' => $this->l('Enable JqZoom instead of Fancybox on the product page'), 'validation' => 'isBool', 'cast' => 'intval', 'required' => false, 'type' => 'bool'), 'PS_DISP_UNAVAILABLE_ATTR' => array('title' => $this->l('Display unavailable product attributes on the product page'), 'validation' => 'isBool', 'cast' => 'intval', 'required' => false, 'type' => 'bool'), 'PS_ATTRIBUTE_CATEGORY_DISPLAY' => array('title' => $this->l('Display the "add to cart" button when a product has attributes'), 'hint' => $this->l('Display or hide the "add to cart" button on category pages for products that have attributes forcing customers to see product details.'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), 'PS_ATTRIBUTE_ANCHOR_SEPARATOR' => array('title' => $this->l('Separator of attribute anchor on the product links'), 'type' => 'select', 'list' => array(array('id' => '-', 'name' => '-'), array('id' => ',', 'name' => ',')), 'identifier' => 'id'), 'PS_DISPLAY_DISCOUNT_PRICE' => array('title' => $this->l('Display discounted price'), 'desc' => $this->l('In the volume discounts board, display the new price with the applied discount instead of showing the discount (ie. "-5%").'), 'validation' => 'isBool', 'cast' => 'intval', 'required' => false, 'type' => 'bool')), 'submit' => array('title' => $this->l('Save'))), 'stock' => array('title' => $this->l('Products stock'), 'fields' => array('PS_ORDER_OUT_OF_STOCK' => array('title' => $this->l('Allow ordering of out-of-stock products'), 'hint' => $this->l('By default, the Add to Cart button is hidden when a product is unavailable. You can choose to have it displayed in all cases.'), 'validation' => 'isBool', 'cast' => 'intval', 'required' => false, 'type' => 'bool'), 'PS_STOCK_MANAGEMENT' => array('title' => $this->l('Enable stock management'), 'validation' => 'isBool', 'cast' => 'intval', 'required' => false, 'type' => 'bool', 'js' => array('on' => 'onchange="stockManagementActivationAuthorization()"', 'off' => 'onchange="stockManagementActivationAuthorization()"')), 'PS_ADVANCED_STOCK_MANAGEMENT' => array('title' => $this->l('Enable advanced stock management'), 'hint' => $this->l('Allows you to manage physical stock, warehouses and supply orders in a new Stock menu.'), 'validation' => 'isBool', 'cast' => 'intval', 'required' => false, 'type' => 'bool', 'visibility' => Shop::CONTEXT_ALL, 'js' => array('on' => 'onchange="advancedStockManagementActivationAuthorization()"', 'off' => 'onchange="advancedStockManagementActivationAuthorization()"')), 'PS_FORCE_ASM_NEW_PRODUCT' => array('title' => $this->l('New products use advanced stock management'), 'hint' => $this->l('New products will automatically use advanced stock management and depends on stock, but no warehouse will be selected'), 'validation' => 'isBool', 'cast' => 'intval', 'required' => false, 'type' => 'bool', 'visibility' => Shop::CONTEXT_ALL), 'PS_DEFAULT_WAREHOUSE_NEW_PRODUCT' => array('title' => $this->l('Default warehouse on new products'), 'hint' => $this->l('Automatically set a default warehouse when new product is created'), 'type' => 'select', 'list' => $warehouse_list, 'identifier' => 'id_warehouse'), 'PS_PACK_STOCK_TYPE' => array('title' => $this->l('Default pack stock management'), 'type' => 'select', 'list' => array(array('pack_stock' => 0, 'name' => $this->l('Decrement pack only.')), array('pack_stock' => 1, 'name' => $this->l('Decrement products in pack only.')), array('pack_stock' => 2, 'name' => $this->l('Decrement both.'))), 'identifier' => 'pack_stock')), 'bottom' => '<script type="text/javascript">stockManagementActivationAuthorization();advancedStockManagementActivationAuthorization();</script>', 'submit' => array('title' => $this->l('Save'))));
 }
开发者ID:zangles,项目名称:lennyba,代码行数:11,代码来源:AdminPPreferencesController.php


示例8: store

 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store()
 {
     //
     $rules = array("warehouseId" => "required", "warehouseName" => "required", "firstAddress" => "required", "area" => "required", "region" => "required", "warehousePhone" => "required|numeric", "warehouseFax" => "required|numeric", "warehouseEmail" => "required|email", "warehousePIC" => "required");
     $validator = Validator::make(Input::all(), $rules);
     if ($validator->fails()) {
         return Redirect::to('/warehouse/create')->withErrors($validator);
     }
     //
     $warehouse = new Warehouse();
     $warehouse->warehouseID = Input::get('warehouseId');
     $warehouse->warehouseName = Input::get('warehouseName');
     $warehouse->warehouseAddress1 = Input::get('firstAddress');
     $warehouse->warehouseAddress2 = Input::get('secondAddress');
     $warehouse->areaID = Input::get("area");
     $warehouse->regionID = Input::get("region");
     $warehouse->warehousePhone = Input::get("warehousePhone");
     $warehouse->warehouseFax = Input::get("warehouseFax");
     $warehouse->warehouseEmail = Input::get("warehouseEmail");
     $warehouse->warehousePIC = Input::get("warehousePIC");
     $warehouse->save();
     return Redirect::to('/warehouse');
 }
开发者ID:NathanaelFebrianto,项目名称:Citramas,代码行数:28,代码来源:WarehouseController.php


示例9: postModal

 /**
  * postModal (入库确认)
  */
 public function postModal()
 {
     //itemReceivedPackageDetail->id
     $id = Input::get('id');
     $position = Input::get('readyposition');
     $itemReceivedPackageDetail = ItemReceivedPackageDetail::find($id);
     $itemReceivedPackageDetail->status = 2;
     $itemReceivedPackageDetail->readyposition = $position;
     $itemReceivedPackageDetail->save();
     //历史入库记录
     $historyWareHouse = new HistoryWarehouse();
     $historyWareHouse->identity = $itemReceivedPackageDetail->identity;
     $historyWareHouse->item = $itemReceivedPackageDetail->item;
     $historyWareHouse->batch = $itemReceivedPackageDetail->batch;
     $historyWareHouse->quantity = $itemReceivedPackageDetail->quantity;
     $historyWareHouse->position = $position;
     $historyWareHouse->operator = 5;
     $historyWareHouse->save();
     //库存汇总
     $wareHouse = Warehouse::where('item', $itemReceivedPackageDetail->item)->where('position', $position)->first();
     if ($wareHouse) {
         $wareHouse->quantity = $wareHouse->quantity + $itemReceivedPackageDetail->quantity;
         $wareHouse->save();
     } else {
         $wareHouse = new Warehouse();
         $wareHouse->item = $itemReceivedPackageDetail->item;
         $wareHouse->position = $position;
         $wareHouse->quantity = $itemReceivedPackageDetail->quantity;
         $wareHouse->save();
     }
     //更新item总库存
     $items = Item::where('code', $itemReceivedPackageDetail->item)->first();
     $items->stock += $itemReceivedPackageDetail->quantity;
     $items->readystock -= $itemReceivedPackageDetail->quantity;
     $items->save();
     return Redirect::back();
 }
开发者ID:yanguanglan,项目名称:sz,代码行数:40,代码来源:WareHouseController.php


示例10: generateId

 public static function generateId()
 {
     $warehouse = Warehouse::orderBy('warehouseID', 'DESC')->get()->first();
     $warehouseId = $warehouse->warehouseID;
     $warehouseId = substr($warehouseId, 2);
     $newId = (int) $warehouseId;
     $newId++;
     $newIdString = (string) $newId;
     $newIdString = "000000" . $newIdString;
     if (strlen($newIdString) > 3) {
         $newIdString = substr($newIdString, strlen($newIdString) - 3);
     }
     $newIdString = "wa" . $newIdString;
     return $newIdString;
 }
开发者ID:NathanaelFebrianto,项目名称:Citramas,代码行数:15,代码来源:Warehouse.php


示例11: __construct

 public function __construct()
 {
     $this->context = Context::getContext();
     $this->table = 'product';
     $this->className = 'Product';
     $this->lang = true;
     $this->colorOnBackground = true;
     $this->multishop_context = Shop::CONTEXT_ALL;
     $this->fields_list = array('reference' => array('title' => $this->l('Reference'), 'align' => 'center', 'width' => 200, 'filter_key' => 'a!reference'), 'ean13' => array('title' => $this->l('EAN13'), 'align' => 'center', 'width' => 100, 'filter_key' => 'a!ean13'), 'upc' => array('title' => $this->l('UPC'), 'align' => 'center', 'width' => 100, 'filter_key' => 'a!upc'), 'name' => array('title' => $this->l('Name'), 'filter_key' => 'b!name'), 'qty_sold' => array('title' => $this->l('Quantity sold'), 'width' => 160, 'orderby' => false, 'search' => false, 'hint' => $this->l('Quantity sold during the defined period.')), 'coverage' => array('title' => $this->l('Coverage'), 'width' => 160, 'orderby' => false, 'search' => false, 'hint' => $this->l('Days left before your stock runs out.')), 'stock' => array('title' => $this->l('Quantity'), 'width' => 80, 'orderby' => false, 'search' => false, 'hint' => $this->l('Physical (usable) quantity.')));
     // pre-defines coverage periods
     $this->stock_cover_periods = array($this->l('One week') => 7, $this->l('Two weeks') => 14, $this->l('Three weeks') => 21, $this->l('One month') => 31, $this->l('Six months') => 186, $this->l('One year') => 365);
     // gets the list of warehouses available
     $this->stock_cover_warehouses = Warehouse::getWarehouses(true);
     // gets the final list of warehouses
     array_unshift($this->stock_cover_warehouses, array('id_warehouse' => -1, 'name' => $this->l('All Warehouses')));
     parent::__construct();
 }
开发者ID:toufikadfab,项目名称:PrestaShop-1.5,代码行数:17,代码来源:AdminStockCoverController.php


示例12: renderDetails

 public function renderDetails()
 {
     if (Tools::isSubmit('id_product')) {
         // override attributes
         $this->identifier = 'id_product_attribute';
         $this->list_id = 'product_attribute';
         $this->lang = false;
         $this->addRowAction('addstock');
         $this->addRowAction('removestock');
         if (count(Warehouse::getWarehouses()) > 1) {
             $this->addRowAction('transferstock');
         }
         // no link on list rows
         $this->list_no_link = true;
         // inits toolbar
         $this->toolbar_btn = array();
         // get current lang id
         $lang_id = (int) $this->context->language->id;
         // Get product id
         $product_id = (int) Tools::getValue('id_product');
         // Load product attributes with sql override
         $this->table = 'product_attribute';
         $this->list_id = 'product_attribute';
         $this->_select = 'a.id_product_attribute as id, a.id_product, a.reference, a.ean13, a.upc';
         $this->_where = 'AND a.id_product = ' . $product_id;
         $this->_group = 'GROUP BY a.id_product_attribute';
         $this->fields_list = array('reference' => array('title' => $this->l('Product reference'), 'filter_key' => 'a!reference'), 'ean13' => array('title' => $this->l('EAN-13 or JAN barcode'), 'filter_key' => 'a!ean13'), 'upc' => array('title' => $this->l('UPC barcode'), 'filter_key' => 'a!upc'), 'name' => array('title' => $this->l('Name'), 'orderby' => false, 'filter' => false, 'search' => false), 'stock' => array('title' => $this->l('Quantity'), 'orderby' => false, 'filter' => false, 'search' => false, 'class' => 'fixed-width-sm', 'align' => 'center', 'hint' => $this->l('Quantitity total for all warehouses.')));
         self::$currentIndex = self::$currentIndex . '&id_product=' . (int) $product_id . '&detailsproduct';
         $this->processFilter();
         return parent::renderList();
     }
 }
开发者ID:ortegon000,项目名称:tienda,代码行数:32,代码来源:AdminStockManagementController.php


示例13: array

                       }', 'select' => 'js:function(event, ui){
                        	document.getElementById(\'keterangan\').innerHTML = \'Code : \'+ui.item.code;
                        	document.getElementById(\'component_id\').value = ui.item.id;
                        }'), 'htmlOptions' => array('style' => 'height:25px;width:200px;padding:0px 5px;', 'class' => 'mf'), 'htmlOptions' => array('style' => 'width:50%;')));
?>
		<input type="hidden" name="component_id" id="component_id">
		</div>
	
	<div class="row">
	<b id="keterangan">
	</b></div>	
	
	<div class="row">	 
		<label>From Warehouse</label>
		<?php 
echo CHtml::dropDownList('warehouse_from', '', CHtml::listData(Warehouse::model()->findAll(), 'id', 'name_warehouse'), array('empty' => '-- select warehouse --'));
?>
	</div>
	
	<div class="row">	 
		<label>To Warehouse</label>
		<?php 
echo CHtml::dropDownList('warehouse_to', '', CHtml::listData(Warehouse::model()->findAll(), 'id', 'name_warehouse'), array('empty' => '-- select warehouse --'));
?>
	</div>
	
	<div class="row">
	<label>Qty</label>
	<input type="text" id="qty" name="qty" size="8">
	</div>
</div>		
开发者ID:7thZoneTechnology,项目名称:inventory-2,代码行数:31,代码来源:_form.php


示例14: getAllocation

 public function getAllocation($ProductId)
 {
     $product = Product::find($ProductId);
     $warehouse = Warehouse::where('id', '<>', $product->warehouse_id)->get();
     return View::make('goods.allocation')->with('warehouse', $warehouse)->with('product', $product)->with('good', Good::find($product->good_id));
 }
开发者ID:huanghua581,项目名称:erp,代码行数:6,代码来源:GoodsController.php


示例15: renderCSV

 /**
  * Exports CSV
  */
 public function renderCSV()
 {
     if (count($this->_list) <= 0) {
         return;
     }
     // sets warehouse id and warehouse name
     $id_warehouse = (int) Tools::getValue('id_warehouse');
     $warehouse_name = Warehouse::getWarehouseNameById($id_warehouse);
     // if quantities requested
     if (Tools::isSubmit('csv_quantities')) {
         // filename
         $filename = $this->l('stock_instant_state_quantities') . '_' . $warehouse_name . '.csv';
         // header
         header('Content-type: text/csv');
         header('Cache-Control: no-store, no-cache must-revalidate');
         header('Content-disposition: attachment; filename="' . $filename);
         // puts keys
         $keys = array('id_product', 'id_product_attribute', 'reference', 'ean13', 'upc', 'name', 'physical_quantity', 'usable_quantity', 'real_quantity');
         echo sprintf("%s\n", implode(';', $keys));
         // puts rows
         foreach ($this->_list as $row) {
             $row_csv = array($row['id_product'], $row['id_product_attribute'], $row['reference'], $row['ean13'], $row['upc'], $row['name'], $row['physical_quantity'], $row['usable_quantity'], $row['real_quantity']);
             // puts one row
             echo sprintf("%s\n", implode(';', array_map(array('CSVCore', 'wrap'), $row_csv)));
         }
     } elseif (Tools::isSubmit('csv_prices')) {
         // sets filename
         $filename = $this->l('stock_instant_state_prices') . '_' . $warehouse_name . '.csv';
         // header
         header('Content-type: text/csv');
         header('Cache-Control: no-store, no-cache must-revalidate');
         header('Content-disposition: attachment; filename="' . $filename);
         // puts keys
         $keys = array('id_product', 'id_product_attribute', 'reference', 'ean13', 'upc', 'name', 'price_te', 'physical_quantity', 'usable_quantity');
         echo sprintf("%s\n", implode(';', $keys));
         foreach ($this->_list as $row) {
             $id_product = (int) $row['id_product'];
             $id_product_attribute = (int) $row['id_product_attribute'];
             // gets prices
             $query = new DbQuery();
             $query->select('s.price_te, SUM(s.physical_quantity) as physical_quantity, SUM(s.usable_quantity) as usable_quantity');
             $query->from('stock', 's');
             $query->leftJoin('warehouse', 'w', 'w.id_warehouse = s.id_warehouse');
             $query->where('s.id_product = ' . $id_product . ' AND s.id_product_attribute = ' . $id_product_attribute);
             $query->where('s.id_warehouse = ' . $id_warehouse);
             $query->groupBy('s.price_te');
             $datas = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($query);
             // puts data
             foreach ($datas as $data) {
                 $row_csv = array($row['id_product'], $row['id_product_attribute'], $row['reference'], $row['ean13'], $row['upc'], $row['name'], $data['price_te'], $data['physical_quantity'], $data['usable_quantity']);
                 // puts one row
                 echo sprintf("%s\n", implode(';', array_map(array('CSVCore', 'wrap'), $row_csv)));
             }
         }
     }
 }
开发者ID:M03G,项目名称:PrestaShop,代码行数:59,代码来源:AdminStockInstantStateController.php


示例16: getAvailableCarrierList

 /**
  * For a given {product, warehouse}, gets the carrier available
  *
  * @since 1.5.0
  * @param Product $product The id of the product, or an array with at least the package size and weight
  * @return array
  */
 public static function getAvailableCarrierList(Product $product, $id_warehouse, $id_address_delivery = null, $id_shop = null, $cart = null)
 {
     if (is_null($id_shop)) {
         $id_shop = Context::getContext()->shop->id;
     }
     if (is_null($cart)) {
         $cart = Context::getContext()->cart;
     }
     $id_address = (int) (!is_null($id_address_delivery) && $id_address_delivery != 0 ? $id_address_delivery : $cart->id_address_delivery);
     if ($id_address) {
         $address = new Address($id_address);
         $id_zone = Address::getZoneById($address->id);
         // Check the country of the address is activated
         if (!Address::isCountryActiveById($address->id)) {
             return array();
         }
     } else {
         $country = new Country(Configuration::get('PS_COUNTRY_DEFAULT'));
         $id_zone = $country->id_zone;
     }
     // Does the product is linked with carriers?
     $query = new DbQuery();
     $query->select('id_carrier');
     $query->from('product_carrier', 'pc');
     $query->innerJoin('carrier', 'c', 'c.id_reference = pc.id_carrier_reference AND c.deleted = 0');
     $query->where('pc.id_product = ' . (int) $product->id);
     $query->where('pc.id_shop = ' . (int) $id_shop);
     $carriers = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($query);
     if (!empty($carriers)) {
         //the product is linked with carriers
         $carrier_list = array();
         foreach ($carriers as $carrier) {
             //check if the linked carriers are available in current zone
             if (Carrier::checkCarrierZone($carrier['id_carrier'], $id_zone)) {
                 $carrier_list[] = $carrier['id_carrier'];
             }
         }
         if (!empty($carrier_list)) {
             return $carrier_list;
         } else {
             return array();
         }
         //no linked carrier are available for this zone
     }
     $carrier_list = array();
     // The product is not dirrectly linked with a carrier
     // Get all the carriers linked to a warehouse
     if ($id_warehouse) {
         $warehouse = new Warehouse($id_warehouse);
         $warehouse_carrier_list = $warehouse->getCarriers();
     }
     $available_carrier_list = array();
     $customer = new Customer($cart->id_customer);
     $carriers = Carrier::getCarriersForOrder($id_zone, $customer->getGroups(), $cart);
     foreach ($carriers as $carrier) {
         $available_carrier_list[] = $carrier['id_carrier'];
     }
     if (empty($warehouse_carrier_list)) {
         $carrier_list = $available_carrier_list;
     } else {
         $carrier_list = array_intersect($warehouse_carrier_list, $available_carrier_list);
     }
     if ($product->width > 0 || $product->height > 0 || $product->depth > 0 || $product->weight > 0) {
         foreach ($carrier_list as $key => $id_carrier) {
             $carrier = new Carrier($id_carrier);
             if ($carrier->max_width > 0 && $carrier->max_width < $product->width || $carrier->max_height > 0 && $carrier->max_height < $product->height || $carrier->max_depth > 0 && $carrier->max_depth < $product->depth || $carrier->max_weight > 0 && $carrier->max_weight < $product->weight) {
                 unset($carrier_list[$key]);
             }
         }
     }
     return $carrier_list;
 }
开发者ID:rrameshsat,项目名称:Prestashop,代码行数:79,代码来源:Carrier.php


示例17: postProcess

 public function postProcess()
 {
     if (Tools::getValue('submitAdd' . $this->table)) {
         /* Checking fields validity */
         $this->validateRules();
         if (!count($this->errors)) {
             $id = (int) Tools::getValue('id_' . $this->table);
             /* Object update */
             if (isset($id) && !empty($id)) {
                 try {
                     if ($this->tabAccess['edit'] === '1') {
                         $current_carrier = new Carrier($id);
                         if (!Validate::isLoadedObject($current_carrier)) {
                             throw new PrestaShopException('Cannot load Carrier object');
                         }
                         // Duplicate current Carrier
                         $new_carrier = $current_carrier->duplicateObject();
                         if (Validate::isLoadedObject($new_carrier)) {
                             // Set flag deteled to true for historization
                             $current_carrier->deleted = true;
                             $current_carrier->update();
                             // Fill the new carrier object
                             $this->copyFromPost($new_carrier, $this->table);
                             $new_carrier->position = $current_carrier->position;
                             $new_carrier->update();
                             $this->updateAssoShop($new_carrier->id);
                             $new_carrier->copyCarrierData((int) $current_carrier->id);
                             $this->changeGroups($new_carrier->id);
                             // Call of hooks
                             Hook::exec('actionCarrierUpdate', array('id_carrier' => (int) $current_carrier->id, 'carrier' => $new_carrier));
                             $this->postImage($new_carrier->id);
                             $this->changeZones($new_carrier->id);
                             $new_carrier->setTaxRulesGroup((int) Tools::getValue('id_tax_rules_group'));
                             Tools::redirectAdmin(self::$currentIndex . '&id_' . $this->table . '=' . $current_carrier->id . '&conf=4&token=' . $this->token);
                         } else {
                             $this->errors[] = Tools::displayError('An error occurred while updating an object.') . ' <b>' . $this->table . '</b>';
                         }
                     } else {
                         $this->errors[] = Tools::displayError('You do not have permission to edit this.');
                     }
                 } catch (PrestaShopException $e) {
                     $this->errors[] = $e->getMessage();
                 }
             } else {
                 if ($this->tabAccess['add'] === '1') {
                     // Create new Carrier
                     $carrier = new Carrier();
                     $this->copyFromPost($carrier, $this->table);
                     $carrier->position = Carrier::getHigherPosition() + 1;
                     if ($carrier->add()) {
                         if (($_POST['id_' . $this->table] = $carrier->id) && $this->postImage($carrier->id) && $this->_redirect) {
                             $carrier->setTaxRulesGroup((int) Tools::getValue('id_tax_rules_group'), true);
                             $this->changeZones($carrier->id);
                             $this->changeGroups($carrier->id);
                             $this->updateAssoShop($carrier->id);
                             Tools::redirectAdmin(self::$currentIndex . '&id_' . $this->table . '=' . $carrier->id . '&conf=3&token=' . $this->token);
                         }
                     } else {
                         $this->errors[] = Tools::displayError('An error occurred while creating an object.') . ' <b>' . $this->table . '</b>';
                     }
                 } else {
                     $this->errors[] = Tools::displayError('You do not have permission to add this.');
                 }
             }
         }
         parent::postProcess();
     } else {
         if (isset($_GET['isFree' . $this->table])) {
             $this->processIsFree();
         } else {
             /*
             	if ((Tools::isSubmit('submitDel'.$this->table) && in_array(Configuration::get('PS_CARRIER_DEFAULT'), Tools::getValue('carrierBox')))
             				|| (isset($_GET['delete'.$this->table]) && Tools::getValue('id_carrier') == Configuration::get('PS_CARRIER_DEFAULT')))
             					$this->errors[] = $this->l('Please set another carrier as default before deleting this one.');
             			else
             			{
             */
             // if deletion : removes the carrier from the warehouse/carrier association
             if (Tools::isSubmit('delete' . $this->table)) {
                 $id = (int) Tools::getValue('id_' . $this->table);
                 // Delete from the reference_id and not from the carrier id
                 $carrier = new Carrier((int) $id);
                 Warehouse::removeCarrier($carrier->id_reference);
             } else {
                 if (Tools::isSubmit($this->table . 'Box') && count(Tools::isSubmit($this->table . 'Box')) > 0) {
                     $ids = Tools::getValue($this->table . 'Box');
                     array_walk($ids, 'intval');
                     foreach ($ids as $id) {
                         // Delete from the reference_id and not from the carrier id
                         $carrier = new Carrier((int) $id);
                         Warehouse::removeCarrier($carrier->id_reference);
                     }
                 }
             }
             parent::postProcess();
             Carrier::cleanPositions();
             //}
         }
     }
 }
开发者ID:dev-lav,项目名称:htdocs,代码行数:100,代码来源:AdminCarriersController.php


示例18: afterAdd

该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP WarehouseProductLocation类代码示例发布时间:2022-05-23
下一篇:
PHP WapAction类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap