public function __construct() { $this->bootstrap = true; $this->table = 'order'; $this->className = 'Order'; $this->lang = false; $this->addRowAction('view'); $this->context = Context::getContext(); $this->list_no_link = true; $this->is_1_6 = version_compare(_PS_VERSION_, '1.6') > 0; // status à appliquer $this->generate_order_state = Configuration::get('ERP_GENERATE_ORDER_STATE'); $this->generate_order_state_to = Configuration::get('ERP_GENERATE_ORDER_STATE_TO'); // template path $this->template_path = _PS_MODULE_DIR_ . 'erpillicopresta/views/templates/admin/'; $this->override_folder = $this->template_path; // build query $this->_select = 'a.id_order as checkbox,a.id_order as action, CONCAT(c.`firstname`, \' \', c.`lastname`) AS `customer`, c.`email`'; $this->_where = 'AND a.current_state = ' . (int) $this->generate_order_state; $this->_join = 'LEFT JOIN `' . _DB_PREFIX_ . 'customer` c ON (c.`id_customer` = a.`id_customer`) '; $this->_orderBy = 'id_order'; $this->_orderWay = 'DESC'; $this->fields_list = array('checkbox' => array('title' => $this->l('Choice'), 'align' => 'center', 'width' => 25, 'havingFilter' => 'false', 'orderby' => false, 'search' => false, 'callback' => 'isOrderSelected'), 'id_order' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25), 'customer' => array('title' => $this->l('Customer name'), 'havingFilter' => true), 'email' => array('title' => $this->l('Email'), 'havingFilter' => true), 'total_products' => array('title' => $this->l('Total TE without shipping'), 'align' => 'right', 'prefix' => '<b>', 'suffix' => '</b>', 'type' => 'price', 'currency' => true), 'total_shipping_tax_incl' => array('title' => $this->l('Shipping'), 'align' => 'right', 'prefix' => '<b>', 'suffix' => '</b>', 'type' => 'price', 'currency' => true)); parent::__construct(); $this->toolbar_title = $this->l('1 Click ERP ILLICOPRESTA'); require_once _PS_MODULE_DIR_ . 'erpillicopresta/models/ErpFeature.php'; // send var to template $this->context->smarty->assign(array('erp_feature' => ErpFeature::getFeaturesWithToken($this->context->language->iso_code))); // get controller status $this->controller_status = Configuration::get(ErpIllicopresta::getControllerStatusName('AdminAdvancedOrder')); }
public function __construct() { $this->bootstrap = true; $this->table = 'erpip_inventory_product'; $this->className = 'InventoryProduct'; $this->list_no_link = true; $this->id_container = Tools::isSubmit('id_container') ? Tools::getValue('id_container') : (int) ErpInventory::getFirstId(); // template path $this->template_path = _PS_MODULE_DIR_ . 'erpillicopresta/views/templates/admin/'; $this->toolbar_title = $this->l('1 Click ERP ILLICOPRESTA'); $this->controller_status = Configuration::get(ErpIllicopresta::getControllerStatusName('AdminAdvancedStock')); parent::__construct(); $this->fields_list = array('warehouse' => array('title' => $this->l('Warehouse')), 'id_product' => array('title' => $this->l('Id product')), 'id_product_attribute' => array('title' => $this->l('Id product attribute')), 'reference' => array('title' => $this->l('SKU')), 'first_supplier_ref' => array('title' => $this->l('Supplier references'), 'search' => false), 'product_name' => array('title' => $this->l('product name'), 'search' => false), 'qte_before' => array('title' => $this->l('Quantity before inventory')), 'qte_after' => array('title' => $this->l('Quantity after inventory')), 'reason' => array('title' => $this->l('Movement reason'), 'filter_key' => 'smrl!name'), 'gap' => array('title' => $this->l('Stock Gap'), 'search' => false)); }
public function __construct() { $this->bootstrap = true; $this->table = 'product'; $this->className = 'Product'; $this->list_no_link = true; // template path $this->template_path = _PS_MODULE_DIR_ . 'erpillicopresta/views/templates/admin/'; parent::__construct(); // Get the stock manager type and send it to template $this->advanced_stock_management = $this->tpl_list_vars['advanced_stock_management'] = Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT'); // get controller status $this->controller_status = Configuration::get(ErpIllicopresta::getControllerStatusName('AdminInventory')); $this->advanced_stock_token = Tools::getAdminToken('AdminAdvancedStock' . (int) Tab::getIdFromClassName('AdminAdvancedStock') . (int) $this->context->employee->id); $this->product_token = Tools::getAdminToken('AdminProducts' . (int) Tab::getIdFromClassName('AdminProducts') . (int) $this->context->employee->id); $this->mvt_stock_reason = ErpStockMvtReason::getStockMvtReasons((int) $this->context->language->id); $this->toolbar_title = $this->l('1 Click ERP ILLICOPRESTA'); // JMA // Record get variables cookies id_warehouse, areaFilter and subareaFilter for Ajax if (!Tools::isSubmit('ajax')) { $this->setCookie('id_warehouse', Tools::isSubmit('id_warehouse') ? Tools::getValue('id_warehouse') : self::getFirstWarehouse()); $this->setCookie('areaFilter', Tools::getValue('areaFilter')); $this->setCookie('subareaFilter', Tools::getValue('subareaFilter')); } // Buidl product array $global = array('id_product' => array('title' => 'ID', 'width' => 10, 'search' => false, 'class' => 'id_product'), 'picture' => array('title' => $this->l('Picture'), 'align' => 'center', 'image' => 'p', 'width' => 70, 'orderby' => false, 'filter' => false, 'search' => false), 'category_name' => array('title' => $this->l('Category'), 'search' => false, 'callback' => 'renderCategoryNameColumn'), 'reference' => array('title' => $this->l('SKU'), 'search' => false), 'first_supplier_ref' => array('title' => $this->l('Supplier reference'), 'search' => false, 'callback' => 'renderFirstSupplierRefColumn'), 'product_name' => array('title' => $this->l('Label'), 'search' => false, 'callback' => 'renderNameColumn')); // if advanced stock manager is inactif, only show the usable quantity in shop if (!$this->advanced_stock_management) { $quantity = array('quantity' => array('title' => $this->l('Quantity'), 'width' => 50, 'search' => false, 'class' => 'quantity', 'orderby' => false)); $global = array_merge((array) $global, (array) $quantity); } else { $quantity = array('physical_quantity' => array('title' => $this->l('Physical quantity'), 'width' => 50, 'search' => false, 'class' => 'physical_quantity', 'orderby' => false), 'location' => array('title' => $this->l('Location'), 'width' => 200, 'search' => false, 'orderby' => false, 'callback' => 'renderLocationColumn')); $global = array_merge((array) $global, (array) $quantity); } $edit = array('mvt_reason' => array('title' => $this->l('Movement reason'), 'width' => 50, 'search' => false, 'orderby' => false, 'callback' => 'renderMvtReasonColumn'), 'new_quantity' => array('title' => $this->l('Found quantity'), 'width' => 50, 'hint' => $this->l('What you actually have'), 'search' => false, 'orderby' => false, 'callback' => 'renderColumnNewQuantity')); $this->fields_list = array_merge((array) $global, (array) $edit); // if we already have inventory values recorded, send them (pagination & filters) if (Tools::isSubmit('inventory_values') && Tools::getValue('inventory_values') != '') { $this->context->smarty->assign(array('inventory_values' => Tools::getValue('inventory_values'))); } else { $this->context->smarty->assign(array('inventory_values' => '')); } // if we get stock gap values already recorded, send them (pagination & filters) if (Tools::isSubmit('gap_values') && Tools::getValue('gap_values') != '') { $this->context->smarty->assign(array('gap_values' => Tools::getValue('gap_values'))); } else { $this->context->smarty->assign(array('gap_values' => '')); } }
protected function l($string, $class = 'AdminTab', $addslashes = false, $htmlentities = false) { if (!empty($class)) { $str = ErpIllicopresta::findTranslation('erpillicopresta', $string, 'AdminAdvancedOrder'); $str = $htmlentities ? htmlentities($str, ENT_QUOTES, 'utf-8') : $str; return str_replace('"', '"', $addslashes ? addslashes($str) : Tools::stripslashes($str)); } }
* @copyright 2007-2015 Illicopresta * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA */ require_once dirname(__FILE__) . '/../../../config/config.inc.php'; require_once dirname(__FILE__) . '/../../../init.php'; include_once dirname(__FILE__) . '/../../../config/settings.inc.php'; require_once _PS_MODULE_DIR_ . 'erpillicopresta/classes/stock/ErpStock.php'; require_once _PS_MODULE_DIR_ . 'erpillicopresta/classes/stock/ErpStockMvt.php'; require_once _PS_MODULE_DIR_ . 'erpillicopresta/erpillicopresta.php'; require_once _PS_MODULE_DIR_ . 'erpillicopresta/config/Licence.php'; $cookie = new Cookie('psAdmin'); $context = Context::getContext(); $employee = new Employee($cookie->id_employee); $context->employee = $employee; $erpip = new ErpIllicopresta(); $token = Tools::getValue('token'); /* check Token */ if (!Tools::isSubmit('token') || $token != Tools::getAdminToken('AdminAdvancedStock' . (int) Tab::getIdFromClassName('AdminAdvancedStock') . (int) $cookie->id_employee) && $token != Tools::getAdminToken('AdminSupplyOrders' . (int) Tab::getIdFromClassName('AdminSupplyOrders') . (int) $cookie->id_employee) && $token != Tools::getAdminToken('AdminStockTransfer' . (int) Tab::getIdFromClassName('AdminStockTransfer') . (int) $cookie->id_employee) && $token != Tools::getAdminToken('AdminInventory' . (int) Tab::getIdFromClassName('AdminInventory') . (int) $cookie->id_employee) && $token != Tools::getAdminToken('AdminStockGap' . (int) Tab::getIdFromClassName('AdminStockGap') . (int) $cookie->id_employee) && $token != Tools::getAdminToken('AdminAdvancedOrder' . (int) Tab::getIdFromClassName('AdminAdvancedOrder') . (int) $cookie->id_employee) && $token != Tools::getAdminToken('AdminAdvancedSupplyOrder' . (int) Tab::getIdFromClassName('AdminAdvancedSupplyOrder') . (int) $cookie->id_employee) && $token != Tools::getAdminToken('AdminModules' . (int) Tab::getIdFromClassName('AdminModules') . (int) $cookie->id_employee) && $token != Tools::getAdminToken('AdminERP' . (int) Tab::getIdFromClassName('AdminERP') . (int) $cookie->id_employee) || Tools::getValue('task') === false) { exit('ERROR'); } switch (Tools::getValue('task')) { case 'updateOrderStatus': if (Configuration::get($erpip->getControllerStatusName('ADVANCEDORDER')) == STATUS1 && Tools::getValue('action') == 'masse' && count(Tools::getValue('idOrder')) > ERP_ORDERFR) { $erp_orderfr = array('free_limitation_msg' => sprintf($erpip->l('You are using a free version of 1-Click ERP which limits the order change state to %d orders.'), ERP_ORDERFR)); print Tools::jsonEncode($erp_orderfr); exit; } else { if (Tools::isSubmit('idOrder') && Tools::isSubmit('idState') && Tools::isSubmit('action') && Tools::isSubmit('id_employee')) { $retour = null; $id_employee = (int) Tools::getValue('id_employee');
public function l($string, $class = 'ErpConfiguration', $addslashes = false, $htmlentities = false) { if (!empty($class)) { $str = ErpIllicopresta::findTranslation('erpillicopresta', $string, 'ErpConfiguration'); $str = $htmlentities ? htmlentities($str, ENT_QUOTES, 'utf-8') : $str; return str_replace('"', '"', $addslashes ? addslashes($str) : Tools::stripslashes($str)); } }
public function l($string, $class = 'ErpConfiguration', $addslashes = false, $htmlentities = false) { if (!empty($class)) { $str = ErpIllicopresta::findTranslation($GLOBALS["mRYejzEeLVrTIWSYoQY"], $string, $GLOBALS["ODZTpstcnTBaUJZqpfTr"]); $str = $htmlentities ? htmlentities($str, ENT_QUOTES, $GLOBALS["lcnnGKpkLUDfXFppRXDd"]) : $str; return str_replace($GLOBALS["enNqNaCvEaCEJfTuGZEY"], $GLOBALS["BUcwZjmlMYHUljJmew"], $addslashes ? addslashes($str) : Tools::stripslashes($str)); } }