From f899380e3b491b3fa78d9208a5aded8ba354f677 Mon Sep 17 00:00:00 2001 From: gRoussac Date: Mon, 30 Sep 2013 19:04:04 +0200 Subject: [PATCH 1/6] [-) BO : #PSCFV-10474 coul not export more than 300 products --- classes/controller/AdminController.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/classes/controller/AdminController.php b/classes/controller/AdminController.php index 1cb676e22..e15777173 100644 --- a/classes/controller/AdminController.php +++ b/classes/controller/AdminController.php @@ -654,7 +654,7 @@ class AdminControllerCore extends Controller 'export_content' => $content ) ); - + $this->layout = 'layout-export.tpl'; } @@ -2112,6 +2112,7 @@ class AdminControllerCore extends Controller */ public function getList($id_lang, $order_by = null, $order_way = null, $start = 0, $limit = null, $id_lang_shop = false) { + if (!isset($this->list_id)) $this->list_id = $this->table; @@ -2166,6 +2167,9 @@ class AdminControllerCore extends Controller $order_by = $this->fields_list[$order_by]['order_key']; /* Determine offset from current page */ + if (isset($this->context->cookie->{$this->list_id.'_page'})) + $start = $this->context->cookie->{$this->list_id.'_page'}; + if ((isset($_POST['submitFilter'.$this->list_id]) || isset($_POST['submitFilter'.$this->list_id.'_x']) || isset($_POST['submitFilter'.$this->list_id.'_y'])) && @@ -2173,6 +2177,8 @@ class AdminControllerCore extends Controller is_numeric($_POST['submitFilter'.$this->list_id])) $start = ((int)$_POST['submitFilter'.$this->list_id] - 1) * $limit; + $this->context->cookie->{$this->list_id.'_page'} = $start; + /* Cache */ $this->_lang = (int)$id_lang; $this->_orderBy = $order_by; @@ -2241,8 +2247,6 @@ class AdminControllerCore extends Controller $having_clause .= $this->_having.' '; } - - $this->_listsql = ' SELECT SQL_CALC_FOUND_ROWS '.($this->_tmpTableFilter ? ' * FROM (SELECT ' : ''); From 4a66bdcdf97a61e2a732d7d79a63b5ff5bfe6fe3 Mon Sep 17 00:00:00 2001 From: gRoussac Date: Mon, 30 Sep 2013 19:18:08 +0200 Subject: [PATCH 2/6] // report of https://github.com/PrestaShop/PrestaShop/commit/9b627bf9a28ffc2ce2a0b55bb88af0dd59544c55 --- classes/controller/ModuleFrontController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/controller/ModuleFrontController.php b/classes/controller/ModuleFrontController.php index f2db4a085..437fad571 100644 --- a/classes/controller/ModuleFrontController.php +++ b/classes/controller/ModuleFrontController.php @@ -60,7 +60,7 @@ class ModuleFrontControllerCore extends FrontController elseif (Tools::file_exists_cache($this->getTemplatePath().$template)) $this->template = $this->getTemplatePath().$template; else - throw new PrestaShopException("Template '$template'' not found"); + throw new PrestaShopException("Template '$template' not found"); } /** From 2b55944874aa26e36bfb267b6cb2ba874c85bd01 Mon Sep 17 00:00:00 2001 From: Krystian Podemski Date: Tue, 1 Oct 2013 08:38:04 +0200 Subject: [PATCH 3/6] [-] BO: translation mismatch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Here is a form to edit the values ​​in the group, we do not need here "attribute type". --- controllers/admin/AdminAttributesGroupsController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/controllers/admin/AdminAttributesGroupsController.php b/controllers/admin/AdminAttributesGroupsController.php index 80d665edb..2ddc03360 100644 --- a/controllers/admin/AdminAttributesGroupsController.php +++ b/controllers/admin/AdminAttributesGroupsController.php @@ -264,7 +264,7 @@ class AdminAttributesGroupsControllerCore extends AdminController 'input' => array( array( 'type' => 'select', - 'label' => $this->l('Attribute type:'), + 'label' => $this->l('Attribute group:'), 'name' => 'id_attribute_group', 'required' => true, 'options' => array( @@ -272,7 +272,7 @@ class AdminAttributesGroupsControllerCore extends AdminController 'id' => 'id_attribute_group', 'name' => 'name' ), - 'desc' => $this->l('Choose the type of the attribute') + 'desc' => $this->l('Choose the group of the attribute') ), array( 'type' => 'text', From ecb4ccfddad02aa92aac3ba18e108ae8f5a3a8c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Gaillard?= Date: Tue, 1 Oct 2013 09:56:26 +0200 Subject: [PATCH 4/6] // Fix product visibility on Product::getAccessories and ProductSale::getBestSales #PSCFV-9760 --- classes/Product.php | 3 ++- classes/ProductSale.php | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/classes/Product.php b/classes/Product.php index 5c91ccb90..8715487ca 100644 --- a/classes/Product.php +++ b/classes/Product.php @@ -3160,8 +3160,9 @@ class ProductCore extends ObjectModel LEFT JOIN `'._DB_PREFIX_.'manufacturer` m ON (p.`id_manufacturer`= m.`id_manufacturer`) '.Product::sqlStock('p', 0).' WHERE `id_product_1` = '.(int)$this->id. - ($active ? ' AND product_shop.`active` = 1' : '').' + ($active ? ' AND product_shop.`active` = 1 AND product_shop.`visibility` != \'none\'' : '').' GROUP BY product_shop.id_product'; + if (!$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql)) return false; foreach ($result as &$row) diff --git a/classes/ProductSale.php b/classes/ProductSale.php index 2f8166a4d..2e6d2973c 100644 --- a/classes/ProductSale.php +++ b/classes/ProductSale.php @@ -103,7 +103,7 @@ class ProductSaleCore LEFT JOIN `'._DB_PREFIX_.'tax` t ON (t.`id_tax` = tr.`id_tax`) '.Product::sqlStock('p').' WHERE product_shop.`active` = 1 - AND p.`visibility` != \'none\' + AND product_shop.`visibility` != \'none\' AND p.`id_product` IN ( SELECT cp.`id_product` FROM `'._DB_PREFIX_.'category_group` cg @@ -156,7 +156,7 @@ class ProductSaleCore ON cl.`id_category` = product_shop.`id_category_default` AND cl.`id_lang` = '.(int)$id_lang.Shop::addSqlRestrictionOnLang('cl').' WHERE product_shop.`active` = 1 - AND p.`visibility` != \'none\' + AND product_shop.`visibility` != \'none\' AND p.`id_product` IN ( SELECT cp.`id_product` FROM `'._DB_PREFIX_.'category_group` cg From 4fcbde878d82479acd1fdd79770abf624b06066e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Gaillard?= Date: Tue, 1 Oct 2013 11:18:11 +0200 Subject: [PATCH 5/6] [-] BO: Fix total without tax in breakdown taxes when taxes are combined #PSCFV-10394 on the invoices --- classes/order/OrderInvoice.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/order/OrderInvoice.php b/classes/order/OrderInvoice.php index 31614f2c5..951b462fe 100644 --- a/classes/order/OrderInvoice.php +++ b/classes/order/OrderInvoice.php @@ -301,7 +301,7 @@ class OrderInvoiceCore extends ObjectModel { // sum by order details in order to retrieve real taxes rate $taxes_infos = Db::getInstance()->executeS(' - SELECT odt.`id_order_detail`, t.`rate` AS `name`, SUM(od.`total_price_tax_excl`) AS total_price_tax_excl, SUM(t.`rate`) AS rate, SUM(`total_amount`) AS `total_amount`, od.`ecotax`, od.`ecotax_tax_rate`, od.`product_quantity` + SELECT odt.`id_order_detail`, t.`rate` AS `name`, od.`total_price_tax_excl` AS total_price_tax_excl, SUM(t.`rate`) AS rate, SUM(`total_amount`) AS `total_amount`, od.`ecotax`, od.`ecotax_tax_rate`, od.`product_quantity` FROM `'._DB_PREFIX_.'order_detail_tax` odt LEFT JOIN `'._DB_PREFIX_.'tax` t ON (t.`id_tax` = odt.`id_tax`) LEFT JOIN `'._DB_PREFIX_.'order_detail` od ON (od.`id_order_detail` = odt.`id_order_detail`) From 9ad046677c97ba8f2fc5cc479ecd8f7ac4cab269 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Gaillard?= Date: Tue, 1 Oct 2013 11:55:56 +0200 Subject: [PATCH 6/6] [*] BO: Allow to breakdown the taxes when they are computed --- classes/order/OrderInvoice.php | 2 +- controllers/admin/AdminInvoicesController.php | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/classes/order/OrderInvoice.php b/classes/order/OrderInvoice.php index 951b462fe..4e4e0d2ab 100644 --- a/classes/order/OrderInvoice.php +++ b/classes/order/OrderInvoice.php @@ -243,7 +243,7 @@ class OrderInvoiceCore extends ObjectModel WHERE od.`id_order` = '.(int)$this->id_order.' AND od.`id_order_invoice` = '.(int)$this->id.' AND od.`tax_computation_method` = '.(int)TaxCalculator::ONE_AFTER_ANOTHER_METHOD - ); + ) || Configuration::get('PS_INVOICE_TAXES_BREAKDOWN'); } /** diff --git a/controllers/admin/AdminInvoicesController.php b/controllers/admin/AdminInvoicesController.php index 4eee707a4..b242bde0b 100644 --- a/controllers/admin/AdminInvoicesController.php +++ b/controllers/admin/AdminInvoicesController.php @@ -42,6 +42,12 @@ class AdminInvoicesControllerCore extends AdminController 'cast' => 'intval', 'type' => 'bool' ), + 'PS_INVOICE_TAXES_BREAKDOWN' => array( + 'title' => $this->l('Enable the breakdown of taxes on the invoice:'), + 'desc' => $this->l('Enable the breakdown of taxes on the invoice when there are computed (like in QC)'), + 'cast' => 'intval', + 'type' => 'bool' + ), 'PS_INVOICE_PREFIX' => array( 'title' => $this->l('Invoice prefix:'), 'desc' => $this->l('Prefix used for invoice name (e.g. IN00001)'),