diff --git a/adm/tabs/AdminInvoices.php b/adm/tabs/AdminInvoices.php index ba98729d..a4e7b4ec 100755 --- a/adm/tabs/AdminInvoices.php +++ b/adm/tabs/AdminInvoices.php @@ -108,6 +108,7 @@ class AdminInvoices extends AdminTab echo 'M1'; /*M2*/ echo 'M2+ + Même marque All '. $this->l('Delay') .' '; @@ -157,6 +158,7 @@ class AdminInvoices extends AdminTab */ echo ' + @@ -177,6 +179,9 @@ class AdminInvoices extends AdminTab echo ' + + + '; @@ -489,6 +494,22 @@ class AdminInvoices extends AdminTab $this->_errors[] = $this->l('No invoice found for these sales'); } } + // print multi with same brand + elseif (Tools::isSubmit('submitPrintMPlus')) { + include_once(dirname(__FILE__).'/../../modules/privatesales/Sale.php'); + $id_sales = Tools::getValue('multiPlus'); + + if (empty($id_sales) || (count($id_sales) < 2) ) { + $this->_errors[] = $this->l('You must select 2 sales minimum for print M2+'); + } else { + $statuts = array(17, Configuration::get('PS_OS_PAYMENT')); + $orders = Sale::getOrdersM2($statuts, $id_sales, Tools::getValue('date_from'), Tools::getValue('date_to')); + if(sizeof($orders)) { + Tools::redirectAdmin('pdf.php?privatesalesM2Plus&id_sale='.implode(',', $id_sales) .'&date_from='.urlencode(Tools::getValue('date_from')).'&date_to='.urlencode(Tools::getValue('date_to')).'&token='.$this->token); + } + $this->_errors[] = $this->l('No invoice found for these sales'); + } + } // print M3 elseif (Tools::isSubmit('submitPrintM3')) { include_once(dirname(__FILE__).'/../../modules/privatesales/Sale.php');