diff --git a/modules/privatesales_tools/classes/MakeFile.php b/modules/privatesales_tools/classes/MakeFile.php index 1d798b58..6dcffa07 100755 --- a/modules/privatesales_tools/classes/MakeFile.php +++ b/modules/privatesales_tools/classes/MakeFile.php @@ -45,7 +45,7 @@ class MakeFile { case self::TYPE_BDC : $show_product_ids = LOGISTIQUE_SHOW_DECIMAL_ID_PRODUCT; // $title = 'Bon de commande ' . $private_sale->name . ' du '.$date_from->getDate('STR').' au '.$date_to->getDate('STR'); - $title = 'BDC '.$private_sale->title.' - '.$private_sale->id_privatesales; + $title = 'BDC '.$private_sale->title.' - n°'. Db::getInstance()->getValue('SELECT MAX(`id_privatesales_export`) FROM `'._DB_PREFIX_.'privatesales_logistique_export`'); $letter_bdc_logo = 'B'; $letter_bdc_logo_end = 'C'; @@ -147,6 +147,7 @@ class MakeFile { $activeSheet->SetCellValue($letter_date.$i, 'Date : '.date('d/m/Y') ); $activeSheet->getStyle($letter_date.$i)->getFont()->setBold(true); + $activeSheet->getStyle($letter_date.$i)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT); $activeSheet->mergeCells($letter_date.$i.':'.$letter_date_end.$i); $i ++; @@ -419,6 +420,8 @@ class MakeFile { // } $value = Configuration::get('BDC_SHOP_BOTTOM_CONTENT', null, null, Context::getContext()->shop->id); + + if($value != '') { $i++; @@ -429,7 +432,7 @@ class MakeFile { $activeSheet->getStyle('B'.$i)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_TOP); $activeSheet->getStyle('B'.$i)->getAlignment()->setWrapText(true); } - + header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'); header('Content-Disposition: attachment;filename="'.$title.'.xlsx"');