|
|
|
@ -25,6 +25,7 @@ if(Tools::getValue('action') == 'getOrderForm' && ( ( $id_category = Tools::getV
|
|
|
|
|
1, //1 : bon de commande
|
|
|
|
|
2, //2 : état des ventes
|
|
|
|
|
3, //3 : stats des ventes
|
|
|
|
|
4, //4 : BDC logistique
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
$lang_id = Tools::getValue('lang', 'fr');
|
|
|
|
@ -41,8 +42,12 @@ if(Tools::getValue('action') == 'getOrderForm' && ( ( $id_category = Tools::getV
|
|
|
|
|
'Remaining quantity' => 'Remaining quantities',
|
|
|
|
|
'Unit Price' => 'Unit Price',
|
|
|
|
|
'Total Amount' => 'Total Amount',
|
|
|
|
|
'Purchase order' => 'Purchase order',
|
|
|
|
|
'Purchase order' => 'Purchase order',
|
|
|
|
|
'Purchase order logistic' => 'Purchase order logistic',
|
|
|
|
|
'State order' => 'Sales report',
|
|
|
|
|
|
|
|
|
|
'Missing' => 'Missing',
|
|
|
|
|
'Colisage' => 'Packing',
|
|
|
|
|
|
|
|
|
|
'The number below must be present on each document regarding this order, delivery note, invoice :' => 'The number below must be present on each document regarding this order, delivery note, invoice :',
|
|
|
|
|
'PURCHASE ORDER NUMBER' => 'PURCHASE ORDER NUMBER',
|
|
|
|
@ -62,10 +67,14 @@ if(Tools::getValue('action') == 'getOrderForm' && ( ( $id_category = Tools::getV
|
|
|
|
|
'Remaining quantity' => 'Stock restant',
|
|
|
|
|
'Unit Price' => 'PU HT',
|
|
|
|
|
'Total Amount' => 'Prix Total HT',
|
|
|
|
|
'Purchase order' => 'Bon de commande',
|
|
|
|
|
'Purchase order' => 'Bon de commande',
|
|
|
|
|
'Purchase order logistic' => 'Bon de commande logistique',
|
|
|
|
|
'State order' => 'Etat des ventes',
|
|
|
|
|
'YES' => 'OUI',
|
|
|
|
|
|
|
|
|
|
'Missing' => 'Manquant',
|
|
|
|
|
'Colisage' => 'Colisage/Ferme',
|
|
|
|
|
|
|
|
|
|
'PURCHASE ORDER NUMBER' => 'NUMERO DE BON DE COMMANDE',
|
|
|
|
|
'Delivery adress' => 'Adresse de livraison',
|
|
|
|
|
'PURCHASE ORDER DATE' => 'DATE DU BON DE COMMANDE',
|
|
|
|
@ -129,15 +138,13 @@ if(Tools::getValue('action') == 'getOrderForm' && ( ( $id_category = Tools::getV
|
|
|
|
|
$date_to_sql = $date_to;
|
|
|
|
|
|
|
|
|
|
$sale = Sale::getSaleFromCategory($id_category);
|
|
|
|
|
|
|
|
|
|
$category = new Category($id_category, $cookie->id_lang);
|
|
|
|
|
$products = MakeStats::getProductsByCat($id_category);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$lines = array();
|
|
|
|
|
$array_product = array();
|
|
|
|
|
|
|
|
|
|
if($type == 1 || $type == 2 || $type == 3) {
|
|
|
|
|
if($type == 1 || $type == 2 || $type == 3 || $type == 4) {
|
|
|
|
|
$arrayProduct = array();
|
|
|
|
|
foreach($products as $product)
|
|
|
|
|
$array_product[$product['id_product']] = $arrayProduct[$product['id_product']] = new Product($product['id_product']);
|
|
|
|
@ -147,14 +154,18 @@ if(Tools::getValue('action') == 'getOrderForm' && ( ( $id_category = Tools::getV
|
|
|
|
|
$lines = MakeStats::getOrdersByIdsProduct(array_keys($arrayProduct), $order_states, $date_from->getDate('SQL'), $date_to->getDate('SQL'));
|
|
|
|
|
|
|
|
|
|
// adding - fev 2016
|
|
|
|
|
if ($type == 2) {
|
|
|
|
|
if ($type == 2 || $type == 4) {
|
|
|
|
|
$lines = MakeStats::getDetailsByIdsProduct(array_keys($arrayProduct), $order_states, $date_from->getDate('SQL'), $date_to->getDate('SQL'));
|
|
|
|
|
}
|
|
|
|
|
// end adding
|
|
|
|
|
|
|
|
|
|
// for stats
|
|
|
|
|
$lines_tmp = $lines;
|
|
|
|
|
$lines = MakeStats::getArrayLines($lines);
|
|
|
|
|
if ($type == 4) {
|
|
|
|
|
$lines = MakeStats::getArrayLines($lines, false, $sale->id);
|
|
|
|
|
} else {
|
|
|
|
|
$lines = MakeStats::getArrayLines($lines);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
die("Type d'export invalide");
|
|
|
|
|
}
|
|
|
|
@ -236,13 +247,10 @@ if(Tools::getValue('action') == 'getOrderForm' && ( ( $id_category = Tools::getV
|
|
|
|
|
{
|
|
|
|
|
foreach($arrayProduct as $id_product_attribute => $values)
|
|
|
|
|
{
|
|
|
|
|
//echo "<pre>";var_dump($values);echo "</pre>";
|
|
|
|
|
$arrayTmp[$values['line']['product_id']][$values['line']['product_attribute_id']] = $values;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// associate position
|
|
|
|
|
$arrayTmp2 = array();
|
|
|
|
@ -255,7 +263,6 @@ if(Tools::getValue('action') == 'getOrderForm' && ( ( $id_category = Tools::getV
|
|
|
|
|
|
|
|
|
|
// ksort($lines2);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$have_declinaison = false;
|
|
|
|
|
foreach($lines2 as $lines_attributes)
|
|
|
|
|
{
|
|
|
|
@ -277,6 +284,9 @@ if(Tools::getValue('action') == 'getOrderForm' && ( ( $id_category = Tools::getV
|
|
|
|
|
$extrafields = Category::getSalesInfos(array((int)$category->id_category));
|
|
|
|
|
$title = $lang['State order'] .' '. $category->name . ' - ' . $extrafields[(int)$category->id_category]['sales'][1];
|
|
|
|
|
break;
|
|
|
|
|
case '4':
|
|
|
|
|
$title = $lang['Purchase order logistic'].' '. $category->name .' - Bébé Boutik '. $date_from->getNomMois() .' '.$date_from->getAnnee();
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -284,69 +294,107 @@ if(Tools::getValue('action') == 'getOrderForm' && ( ( $id_category = Tools::getV
|
|
|
|
|
$firstColumn = 'A';
|
|
|
|
|
if($have_declinaison === true)
|
|
|
|
|
{
|
|
|
|
|
if ($type == 1) {
|
|
|
|
|
$lastColumn = 'H';
|
|
|
|
|
if ($type == 4) {
|
|
|
|
|
$lastColumn = 'K';
|
|
|
|
|
|
|
|
|
|
$letter_product_ref_interne = 'B';
|
|
|
|
|
$letter_product_name = 'C';
|
|
|
|
|
$letter_product_attribute_name = 'D';
|
|
|
|
|
$letter_product_ht = 'E';
|
|
|
|
|
$letter_product_M1_M2 = 'F';
|
|
|
|
|
$letter_product_multi = 'G';
|
|
|
|
|
|
|
|
|
|
$letter_product_colisage = 'H';
|
|
|
|
|
$letter_product_stock3btk = 'I';
|
|
|
|
|
$letter_product_missing = 'J';
|
|
|
|
|
|
|
|
|
|
$letter_product_total_qty= 'K';
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
$lastColumn = 'J';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$letter_bdc_title = 'C';
|
|
|
|
|
$letter_end_address = 'B';
|
|
|
|
|
if ($type == 1) {
|
|
|
|
|
$lastColumn = 'H';
|
|
|
|
|
} else {
|
|
|
|
|
$lastColumn = 'J';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$letter_date = 'C';
|
|
|
|
|
$letter_franco = 'D';
|
|
|
|
|
$letter_condition = 'E';
|
|
|
|
|
$letter_bdc_title = 'C';
|
|
|
|
|
$letter_end_address = 'B';
|
|
|
|
|
|
|
|
|
|
$letter_product_ean = 'B';
|
|
|
|
|
$letter_product_ref_interne = 'C';
|
|
|
|
|
$letter_product_name = 'D';
|
|
|
|
|
$letter_product_attribute_name = 'E';
|
|
|
|
|
/*$letter_product_qty = 'F';*/
|
|
|
|
|
$letter_date = 'C';
|
|
|
|
|
$letter_franco = 'D';
|
|
|
|
|
$letter_condition = 'E';
|
|
|
|
|
|
|
|
|
|
if ($type == 1) {
|
|
|
|
|
$letter_product_qty = 'F';
|
|
|
|
|
$letter_product_ht = 'G';
|
|
|
|
|
$letter_product_total = 'H';
|
|
|
|
|
} else {
|
|
|
|
|
$letter_product_total_qty = 'F';
|
|
|
|
|
$letter_product_qty = 'G';
|
|
|
|
|
$letter_product_remaining_qty = 'H';
|
|
|
|
|
$letter_product_ht = 'I';
|
|
|
|
|
$letter_product_total = 'J';
|
|
|
|
|
$letter_product_ean = 'B';
|
|
|
|
|
$letter_product_ref_interne = 'C';
|
|
|
|
|
$letter_product_name = 'D';
|
|
|
|
|
$letter_product_attribute_name = 'E';
|
|
|
|
|
/*$letter_product_qty = 'F';*/
|
|
|
|
|
|
|
|
|
|
if ($type == 1) {
|
|
|
|
|
$letter_product_qty = 'F';
|
|
|
|
|
$letter_product_ht = 'G';
|
|
|
|
|
$letter_product_total = 'H';
|
|
|
|
|
} else {
|
|
|
|
|
$letter_product_total_qty = 'F';
|
|
|
|
|
$letter_product_qty = 'G';
|
|
|
|
|
$letter_product_remaining_qty = 'H';
|
|
|
|
|
$letter_product_ht = 'I';
|
|
|
|
|
$letter_product_total = 'J';
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if ($type == 1) {
|
|
|
|
|
$lastColumn = 'G';
|
|
|
|
|
if ($type == 4) {
|
|
|
|
|
$lastColumn = 'J';
|
|
|
|
|
|
|
|
|
|
$letter_product_ref_interne = 'B';
|
|
|
|
|
$letter_product_name = 'C';
|
|
|
|
|
//$letter_product_attribute_name = 'D';
|
|
|
|
|
$letter_product_ht = 'D';
|
|
|
|
|
$letter_product_M1_M2 = 'E';
|
|
|
|
|
$letter_product_multi = 'F';
|
|
|
|
|
|
|
|
|
|
$letter_product_colisage = 'G';
|
|
|
|
|
$letter_product_stock3btk = 'H';
|
|
|
|
|
$letter_product_missing = 'I';
|
|
|
|
|
|
|
|
|
|
$letter_product_total_qty= 'J';
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
$lastColumn = 'I';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$letter_bdc_title = 'C';
|
|
|
|
|
$letter_end_address = 'B';
|
|
|
|
|
|
|
|
|
|
$letter_date = 'C';
|
|
|
|
|
$letter_franco = 'D';
|
|
|
|
|
$letter_condition = 'E';
|
|
|
|
|
if ($type == 1) {
|
|
|
|
|
$lastColumn = 'G';
|
|
|
|
|
} else {
|
|
|
|
|
$lastColumn = 'I';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$letter_bdc_title = 'C';
|
|
|
|
|
$letter_end_address = 'B';
|
|
|
|
|
|
|
|
|
|
$letter_date = 'C';
|
|
|
|
|
$letter_franco = 'D';
|
|
|
|
|
$letter_condition = 'E';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$letter_product_ean = 'B';
|
|
|
|
|
$letter_product_ref_interne = 'C';
|
|
|
|
|
$letter_product_name = 'D';
|
|
|
|
|
// $letter_product_attribute_name = 'C';
|
|
|
|
|
/* $letter_product_qty = 'E';*/
|
|
|
|
|
$letter_product_ean = 'B';
|
|
|
|
|
$letter_product_ref_interne = 'C';
|
|
|
|
|
$letter_product_name = 'D';
|
|
|
|
|
// $letter_product_attribute_name = 'C';
|
|
|
|
|
/* $letter_product_qty = 'E';*/
|
|
|
|
|
|
|
|
|
|
if ($type == 1) {
|
|
|
|
|
$letter_product_qty = 'E';
|
|
|
|
|
$letter_product_ht = 'F';
|
|
|
|
|
$letter_product_total = 'G';
|
|
|
|
|
} else {
|
|
|
|
|
$letter_product_total_qty = 'E';
|
|
|
|
|
$letter_product_qty = 'F';
|
|
|
|
|
$letter_product_remaining_qty = 'G';
|
|
|
|
|
$letter_product_ht = 'H';
|
|
|
|
|
$letter_product_total = 'I';
|
|
|
|
|
if ($type == 1) {
|
|
|
|
|
$letter_product_qty = 'E';
|
|
|
|
|
$letter_product_ht = 'F';
|
|
|
|
|
$letter_product_total = 'G';
|
|
|
|
|
} else {
|
|
|
|
|
$letter_product_total_qty = 'E';
|
|
|
|
|
$letter_product_qty = 'F';
|
|
|
|
|
$letter_product_remaining_qty = 'G';
|
|
|
|
|
$letter_product_ht = 'H';
|
|
|
|
|
$letter_product_total = 'I';
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
@ -623,61 +671,105 @@ if(Tools::getValue('action') == 'getOrderForm' && ( ( $id_category = Tools::getV
|
|
|
|
|
|
|
|
|
|
$i ++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ($type == 2) {
|
|
|
|
|
$activeSheet->SetCellValue($firstColumn.$i, $date_of_extract->getJour().' '.$date_of_extract->getNomMois().' '.$date_of_extract->getAnnee());
|
|
|
|
|
if ($type == 4) {
|
|
|
|
|
$activeSheet->SetCellValue($firstColumn.$i, $title);
|
|
|
|
|
$i++;$i++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$activeSheet->SetCellValue($firstColumn.$i, $lang['Product ID']);
|
|
|
|
|
$activeSheet->getStyle($firstColumn.$i)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$activeSheet->SetCellValue($letter_product_ean.$i, $lang['EAN']);
|
|
|
|
|
$activeSheet->getStyle($letter_product_ean.$i)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
|
|
|
|
|
$activeSheet->SetCellValue($letter_product_ref_interne.$i, $lang['Reference BB']);
|
|
|
|
|
$activeSheet->getStyle($letter_product_ref_interne.$i)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
|
|
|
|
|
//$activeSheet->getStyle('E'.$i)->getBorders()->setBold(true);
|
|
|
|
|
$activeSheet->SetCellValue($letter_product_ref_interne.$i, $lang['Reference BB']);
|
|
|
|
|
$activeSheet->getStyle($letter_product_ref_interne.$i)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
|
|
|
|
|
|
|
|
|
|
$activeSheet->SetCellValue($letter_product_name.$i, $lang['Product Name']);
|
|
|
|
|
$activeSheet->getStyle($letter_product_name.$i)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
|
|
|
|
|
if($have_declinaison === true) {
|
|
|
|
|
$activeSheet->SetCellValue($letter_product_attribute_name.$i, $lang['Attribute']);
|
|
|
|
|
$activeSheet->getStyle($letter_product_attribute_name.$i)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
|
|
|
|
|
}
|
|
|
|
|
$activeSheet->SetCellValue($letter_product_name.$i, $lang['Product Name']);
|
|
|
|
|
$activeSheet->getStyle($letter_product_name.$i)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
|
|
|
|
|
if($have_declinaison === true) {
|
|
|
|
|
$activeSheet->SetCellValue($letter_product_attribute_name.$i, $lang['Attribute']);
|
|
|
|
|
$activeSheet->getStyle($letter_product_attribute_name.$i)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$activeSheet->SetCellValue($letter_product_qty.$i, $lang['Quantity']);
|
|
|
|
|
$activeSheet->getStyle($letter_product_qty.$i)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
|
|
|
|
|
$activeSheet->getStyle($letter_product_qty.$i)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
|
|
|
|
|
$activeSheet->getStyle($letter_product_qty.$i)->getAlignment()->setWrapText(true);
|
|
|
|
|
if ($type == 2) {
|
|
|
|
|
$activeSheet->getStyle($letter_product_qty.$i)->getFill()->applyFromArray(
|
|
|
|
|
array(
|
|
|
|
|
'type' => PHPExcel_Style_Fill::FILL_SOLID,
|
|
|
|
|
'rotation' => 0,
|
|
|
|
|
'startcolor' => array(
|
|
|
|
|
'rgb' => 'D9D9D9'
|
|
|
|
|
),
|
|
|
|
|
'endcolor' => array(
|
|
|
|
|
'argb' => 'D9D9D9D9'
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
);
|
|
|
|
|
$activeSheet->SetCellValue($letter_product_total_qty.$i, $lang['Total quantity']);
|
|
|
|
|
$activeSheet->setCellValue($letter_product_ht.$i, $lang['Unit Price']);
|
|
|
|
|
$activeSheet->getStyle($letter_product_ht.$i)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
|
|
|
|
|
$activeSheet->getStyle($letter_product_ht.$i)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
|
|
|
|
|
|
|
|
|
|
$activeSheet->setCellValue($letter_product_M1_M2.$i, 'M1+M2');
|
|
|
|
|
$activeSheet->getStyle($letter_product_M1_M2.$i)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
|
|
|
|
|
$activeSheet->getStyle($letter_product_M1_M2.$i)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
|
|
|
|
|
|
|
|
|
|
$activeSheet->setCellValue($letter_product_multi.$i, 'Multi');
|
|
|
|
|
$activeSheet->getStyle($letter_product_multi.$i)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
|
|
|
|
|
$activeSheet->getStyle($letter_product_multi.$i)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
|
|
|
|
|
|
|
|
|
|
$activeSheet->setCellValue($letter_product_colisage.$i, $lang['Colisage']);
|
|
|
|
|
$activeSheet->getStyle($letter_product_colisage.$i)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
|
|
|
|
|
$activeSheet->getStyle($letter_product_colisage.$i)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
|
|
|
|
|
|
|
|
|
|
$activeSheet->setCellValue($letter_product_stock3btk.$i, 'Stock 3BTK');
|
|
|
|
|
$activeSheet->getStyle($letter_product_stock3btk.$i)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
|
|
|
|
|
$activeSheet->getStyle($letter_product_stock3btk.$i)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
|
|
|
|
|
|
|
|
|
|
$activeSheet->setCellValue($letter_product_missing.$i, $lang['Missing']);
|
|
|
|
|
$activeSheet->getStyle($letter_product_missing.$i)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
|
|
|
|
|
$activeSheet->getStyle($letter_product_missing.$i)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
|
|
|
|
|
|
|
|
|
|
$activeSheet->setCellValue($letter_product_total_qty.$i, 'Total qty');
|
|
|
|
|
$activeSheet->getStyle($letter_product_total_qty.$i)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
|
|
|
|
|
$activeSheet->getStyle($letter_product_total_qty.$i)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
|
|
|
|
|
|
|
|
|
|
$activeSheet->SetCellValue($letter_product_remaining_qty.$i, $lang['Remaining quantity']);
|
|
|
|
|
$activeSheet->getStyle($letter_product_remaining_qty.$i)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
|
|
|
|
|
$activeSheet->getStyle($letter_product_remaining_qty.$i)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
if ($type == 2) {
|
|
|
|
|
$activeSheet->SetCellValue($firstColumn.$i, $date_of_extract->getJour().' '.$date_of_extract->getNomMois().' '.$date_of_extract->getAnnee());
|
|
|
|
|
$i++;$i++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$activeSheet->SetCellValue($firstColumn.$i, $lang['Product ID']);
|
|
|
|
|
$activeSheet->getStyle($firstColumn.$i)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$activeSheet->SetCellValue($letter_product_ean.$i, $lang['EAN']);
|
|
|
|
|
$activeSheet->getStyle($letter_product_ean.$i)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
|
|
|
|
|
$activeSheet->SetCellValue($letter_product_ref_interne.$i, $lang['Reference BB']);
|
|
|
|
|
$activeSheet->getStyle($letter_product_ref_interne.$i)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
|
|
|
|
|
//$activeSheet->getStyle('E'.$i)->getBorders()->setBold(true);
|
|
|
|
|
|
|
|
|
|
$activeSheet->SetCellValue($letter_product_name.$i, $lang['Product Name']);
|
|
|
|
|
$activeSheet->getStyle($letter_product_name.$i)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
|
|
|
|
|
if($have_declinaison === true) {
|
|
|
|
|
$activeSheet->SetCellValue($letter_product_attribute_name.$i, $lang['Attribute']);
|
|
|
|
|
$activeSheet->getStyle($letter_product_attribute_name.$i)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$activeSheet->SetCellValue($letter_product_qty.$i, $lang['Quantity']);
|
|
|
|
|
$activeSheet->getStyle($letter_product_qty.$i)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
|
|
|
|
|
$activeSheet->getStyle($letter_product_qty.$i)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
|
|
|
|
|
$activeSheet->getStyle($letter_product_qty.$i)->getAlignment()->setWrapText(true);
|
|
|
|
|
if ($type == 2) {
|
|
|
|
|
$activeSheet->getStyle($letter_product_qty.$i)->getFill()->applyFromArray(
|
|
|
|
|
array(
|
|
|
|
|
'type' => PHPExcel_Style_Fill::FILL_SOLID,
|
|
|
|
|
'rotation' => 0,
|
|
|
|
|
'startcolor' => array(
|
|
|
|
|
'rgb' => 'D9D9D9'
|
|
|
|
|
),
|
|
|
|
|
'endcolor' => array(
|
|
|
|
|
'argb' => 'D9D9D9D9'
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
);
|
|
|
|
|
$activeSheet->SetCellValue($letter_product_total_qty.$i, $lang['Total quantity']);
|
|
|
|
|
$activeSheet->getStyle($letter_product_total_qty.$i)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
|
|
|
|
|
$activeSheet->getStyle($letter_product_total_qty.$i)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
|
|
|
|
|
|
|
|
|
|
$activeSheet->SetCellValue($letter_product_remaining_qty.$i, $lang['Remaining quantity']);
|
|
|
|
|
$activeSheet->getStyle($letter_product_remaining_qty.$i)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
|
|
|
|
|
$activeSheet->getStyle($letter_product_remaining_qty.$i)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
|
|
|
|
|
}
|
|
|
|
|
$activeSheet->setCellValue($letter_product_ht.$i, $lang['Unit Price']);
|
|
|
|
|
$activeSheet->getStyle($letter_product_ht.$i)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
|
|
|
|
|
$activeSheet->getStyle($letter_product_ht.$i)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
|
|
|
|
|
|
|
|
|
|
$activeSheet->setCellValue($letter_product_total.$i, $lang['Total Amount']);
|
|
|
|
|
$activeSheet->getStyle($letter_product_total.$i)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
|
|
|
|
|
$activeSheet->getStyle($letter_product_total.$i)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
|
|
|
|
|
}
|
|
|
|
|
$activeSheet->setCellValue($letter_product_ht.$i, $lang['Unit Price']);
|
|
|
|
|
$activeSheet->getStyle($letter_product_ht.$i)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
|
|
|
|
|
$activeSheet->getStyle($letter_product_ht.$i)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
|
|
|
|
|
|
|
|
|
|
$activeSheet->setCellValue($letter_product_total.$i, $lang['Total Amount']);
|
|
|
|
|
$activeSheet->getStyle($letter_product_total.$i)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
|
|
|
|
|
$activeSheet->getStyle($letter_product_total.$i)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
|
|
|
|
|
|
|
|
|
|
$i++;
|
|
|
|
|
$iOri = $i;
|
|
|
|
@ -691,6 +783,56 @@ if(Tools::getValue('action') == 'getOrderForm' && ( ( $id_category = Tools::getV
|
|
|
|
|
|
|
|
|
|
switch($type)
|
|
|
|
|
{
|
|
|
|
|
case '4':
|
|
|
|
|
foreach($lines2 as $lines_attributes)
|
|
|
|
|
{
|
|
|
|
|
foreach($lines_attributes as $values)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
$id_product_attribute = $values['line']['product_attribute_id'];
|
|
|
|
|
$id_product = $values['line']['product_id'];
|
|
|
|
|
$current_product = $array_product[$id_product];
|
|
|
|
|
if($id_product_attribute != 0)
|
|
|
|
|
{
|
|
|
|
|
$combination = new Combination($id_product_attribute);
|
|
|
|
|
if($combination->wholesale_price == 0)
|
|
|
|
|
$wholesale_price = $current_product->wholesale_price;
|
|
|
|
|
else
|
|
|
|
|
$wholesale_price = $combination->wholesale_price;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
$wholesale_price = $current_product->wholesale_price;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$activeSheet->SetCellValue($letter_product_ref_interne.$i, $values['line']['product_reference']);
|
|
|
|
|
|
|
|
|
|
$activeSheet->SetCellValue($letter_product_name.$i, $values['line']['product_name_base']);
|
|
|
|
|
if($have_declinaison === true)
|
|
|
|
|
$activeSheet->SetCellValue($letter_product_attribute_name.$i, $values['line']['product_attribute_name_base']);
|
|
|
|
|
|
|
|
|
|
$activeSheet->setCellValue($letter_product_ht.$i, (float)$wholesale_price );
|
|
|
|
|
$activeSheet->getStyle($letter_product_ht.$i)->getNumberFormat()->setFormatCode( PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_EUR );
|
|
|
|
|
|
|
|
|
|
if (isset($values['multi'])) {
|
|
|
|
|
$activeSheet->setCellValue($letter_product_multi.$i, $values['multi']);
|
|
|
|
|
}
|
|
|
|
|
if (isset($values['m1_m2'])) {
|
|
|
|
|
$activeSheet->setCellValue($letter_product_M1_M2.$i, $values['m1_m2']);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// colonnes vide
|
|
|
|
|
// $activeSheet->setCellValue($letter_product_colisage.$i, '');
|
|
|
|
|
// $activeSheet->setCellValue($letter_product_stock3btk.$i, '');
|
|
|
|
|
// $activeSheet->setCellValue($letter_product_missing.$i, '');
|
|
|
|
|
|
|
|
|
|
$activeSheet->setCellValue($letter_product_total_qty.$i, '='.$letter_product_M1_M2.$i.'+'.$letter_product_multi.$i.'+'.$letter_product_colisage.$i.'-'.$letter_product_stock3btk.$i.'-'.$letter_product_missing.$i);
|
|
|
|
|
$activeSheet->getStyle($letter_product_total.$i)->getNumberFormat()->setFormatCode( PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_EUR );
|
|
|
|
|
|
|
|
|
|
$i++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case '2':
|
|
|
|
|
foreach($lines2 as $lines_attributes)
|
|
|
|
|
{
|
|
|
|
@ -807,126 +949,149 @@ if(Tools::getValue('action') == 'getOrderForm' && ( ( $id_category = Tools::getV
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$activeSheet->SetCellValue($firstColumn.$i, 'Total');
|
|
|
|
|
$activeSheet->getStyle($firstColumn.$i)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT);
|
|
|
|
|
$activeSheet->getStyle($firstColumn.$i)->getFont()->setBold(true);
|
|
|
|
|
if ($type = 4) {
|
|
|
|
|
|
|
|
|
|
$activeSheet->SetCellValue($letter_product_qty.$i, '=SUM('.$letter_product_qty.($iOri).':'.$letter_product_qty.($i-1).')');
|
|
|
|
|
$activeSheet->getStyle($letter_product_qty.$i)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
|
|
|
|
|
$activeSheet->getStyle($letter_product_qty.$i)->getFont()->setBold(true);
|
|
|
|
|
if ($type == 2) {
|
|
|
|
|
$activeSheet->getStyle($letter_product_qty.$i)->getFill()->applyFromArray(
|
|
|
|
|
array(
|
|
|
|
|
'type' => PHPExcel_Style_Fill::FILL_SOLID,
|
|
|
|
|
'rotation' => 0,
|
|
|
|
|
'startcolor' => array(
|
|
|
|
|
'rgb' => 'D9D9D9'
|
|
|
|
|
),
|
|
|
|
|
'endcolor' => array(
|
|
|
|
|
'argb' => 'D9D9D9D9'
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
);
|
|
|
|
|
$activeSheet->SetCellValue($letter_product_total_qty.$i, '=SUM('.$letter_product_total_qty.($iOri).':'.$letter_product_total_qty.($i-1).')');
|
|
|
|
|
$activeSheet->getStyle($letter_product_total_qty.$i)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
|
|
|
|
|
$activeSheet->getStyle($letter_product_total_qty.$i)->getFont()->setBold(true);
|
|
|
|
|
|
|
|
|
|
$activeSheet->SetCellValue($letter_product_remaining_qty.$i, '=SUM('.$letter_product_remaining_qty.($iOri).':'.$letter_product_remaining_qty.($i-1).')');
|
|
|
|
|
$activeSheet->getStyle($letter_product_remaining_qty.$i)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
|
|
|
|
|
$activeSheet->getStyle($letter_product_remaining_qty.$i)->getFont()->setBold(true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$activeSheet->getStyle($firstColumn.($iOri-1).':'.$lastColumn.$i)->applyFromArray($arrayBorder);
|
|
|
|
|
|
|
|
|
|
$i++;
|
|
|
|
|
|
|
|
|
|
$activeSheet->setCellValue($letter_product_ht.$i, $lang['Total Amount']);
|
|
|
|
|
$activeSheet->getStyle($letter_product_ht.$i)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT);
|
|
|
|
|
if($type == 1)
|
|
|
|
|
$activeSheet->getStyle($letter_product_ht.$i)->getFont()->setBold(true);
|
|
|
|
|
|
|
|
|
|
$activeSheet->setCellValue($letter_product_total.$i, '=SUM('.$letter_product_total.($iOri).':'.$letter_product_total.($i-2).')');
|
|
|
|
|
$activeSheet->getStyle($letter_product_total.$i)->getNumberFormat()->setFormatCode( PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_EUR );
|
|
|
|
|
|
|
|
|
|
if($lang_id != 'en')
|
|
|
|
|
{
|
|
|
|
|
$i++;
|
|
|
|
|
|
|
|
|
|
$activeSheet->setCellValue($letter_product_ht.$i, 'TVA '.$TVA);
|
|
|
|
|
$activeSheet->getStyle($letter_product_ht.$i)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT);
|
|
|
|
|
if($type == 1)
|
|
|
|
|
$activeSheet->getStyle($letter_product_ht.$i)->getFont()->setBold(true);
|
|
|
|
|
|
|
|
|
|
$activeSheet->setCellValue($letter_product_total.$i, '='.$letter_product_total.($i-1).'*'.($TVA/100) );
|
|
|
|
|
$activeSheet->getStyle($letter_product_total.$i)->getNumberFormat()->setFormatCode( PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_EUR );
|
|
|
|
|
|
|
|
|
|
$i++;
|
|
|
|
|
|
|
|
|
|
$activeSheet->setCellValue($letter_product_ht.$i, 'TOTAL TTC');
|
|
|
|
|
$activeSheet->getStyle($letter_product_ht.$i)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT);
|
|
|
|
|
$activeSheet->getStyle($letter_product_ht.$i)->getFont()->setBold(true);
|
|
|
|
|
|
|
|
|
|
$activeSheet->setCellValue($letter_product_total.$i, '='.$letter_product_total.($i-1).'+'.$letter_product_total.($i-2) );
|
|
|
|
|
$activeSheet->getStyle($letter_product_total.$i)->getNumberFormat()->setFormatCode( PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_EUR );
|
|
|
|
|
$activeSheet->getStyle($letter_product_total.$i)->getFont()->setBold(true);
|
|
|
|
|
|
|
|
|
|
$activeSheet->getStyle($letter_product_ht.($i-3).':'.$lastColumn.$i)->applyFromArray($arrayBorder);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
$activeSheet->getStyle($letter_product_ht.($i-1).':'.$lastColumn.$i)->applyFromArray($arrayBorder);
|
|
|
|
|
}
|
|
|
|
|
if($type == 1)
|
|
|
|
|
{
|
|
|
|
|
$value = Configuration::get('PS_IT_OF_BAS_PAGE_'.$lang_id);
|
|
|
|
|
if($value != '')
|
|
|
|
|
{
|
|
|
|
|
$i++;
|
|
|
|
|
$value = str_replace('<br />', ' ' , nl2br($value));
|
|
|
|
|
|
|
|
|
|
$activeSheet->setCellValue($firstColumn.$i, $value);
|
|
|
|
|
$activeSheet->mergeCells($firstColumn.$i.':'.$lastColumn.$i );
|
|
|
|
|
$activeSheet->getRowDimension($i)->setRowHeight(80);
|
|
|
|
|
$activeSheet->getStyle($firstColumn.$i)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_TOP);
|
|
|
|
|
$activeSheet->getStyle($firstColumn.$i)->getNumberFormat()->setFormatCode( PHPExcel_Style_NumberFormat::FORMAT_TEXT );
|
|
|
|
|
$activeSheet->getStyle($firstColumn.$i)->getAlignment()->setWrapText(true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$value = Configuration::get('PS_IT_OF_BAS_PAGE_BIS_'.$lang_id);
|
|
|
|
|
if($value != '')
|
|
|
|
|
{
|
|
|
|
|
$i++;
|
|
|
|
|
$value = str_replace('<br />', ' ' , nl2br($value));
|
|
|
|
|
|
|
|
|
|
$activeSheet->setCellValue($firstColumn.$i, $value);
|
|
|
|
|
$activeSheet->mergeCells($firstColumn.$i.':'.$lastColumn.$i );
|
|
|
|
|
$activeSheet->getRowDimension($i)->setRowHeight(80);
|
|
|
|
|
$activeSheet->getStyle($firstColumn.$i)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_TOP);
|
|
|
|
|
$activeSheet->getStyle($firstColumn.$i)->getAlignment()->setWrapText(true);
|
|
|
|
|
$activeSheet->getStyle($firstColumn.$i)->getFont()->getColor()->setRGB('FF0000');
|
|
|
|
|
$activeSheet->getStyle($firstColumn.$i)->getNumberFormat()->setFormatCode( PHPExcel_Style_NumberFormat::FORMAT_TEXT );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$activeSheet->getColumnDimension($firstColumn)->setWidth(25);
|
|
|
|
|
$activeSheet->getColumnDimension($letter_product_ean)->setWidth(25);
|
|
|
|
|
$activeSheet->getColumnDimension($letter_product_ref_interne)->setWidth(25);
|
|
|
|
|
$activeSheet->getColumnDimension($letter_product_qty)->setWidth(18);
|
|
|
|
|
$activeSheet->getColumnDimension($letter_product_name)->setWidth(40);
|
|
|
|
|
if($have_declinaison === true)
|
|
|
|
|
$activeSheet->getColumnDimension($letter_product_attribute_name)->setWidth(20);
|
|
|
|
|
|
|
|
|
|
$activeSheet->getColumnDimension($letter_product_qty)->setWidth(13);
|
|
|
|
|
if ($type == 2) {
|
|
|
|
|
$activeSheet->getColumnDimension($firstColumn)->setWidth(10);
|
|
|
|
|
$activeSheet->getColumnDimension($letter_product_ref_interne)->setWidth(25);
|
|
|
|
|
$activeSheet->getColumnDimension($letter_product_name)->setWidth(40);
|
|
|
|
|
if ($have_declinaison === true) {
|
|
|
|
|
$activeSheet->getColumnDimension($letter_product_attribute_name)->setWidth(20);
|
|
|
|
|
}
|
|
|
|
|
$activeSheet->getColumnDimension($letter_product_ht)->setWidth(13);
|
|
|
|
|
$activeSheet->getColumnDimension($letter_product_multi)->setWidth(13);
|
|
|
|
|
$activeSheet->getColumnDimension($letter_product_M1_M2)->setWidth(13);
|
|
|
|
|
$activeSheet->getColumnDimension($letter_product_colisage)->setWidth(13);
|
|
|
|
|
$activeSheet->getColumnDimension($letter_product_stock3btk)->setWidth(13);
|
|
|
|
|
$activeSheet->getColumnDimension($letter_product_missing)->setWidth(13);
|
|
|
|
|
$activeSheet->getColumnDimension($letter_product_total_qty)->setWidth(13);
|
|
|
|
|
$activeSheet->getColumnDimension($letter_product_remaining_qty)->setWidth(13);
|
|
|
|
|
|
|
|
|
|
$i++;
|
|
|
|
|
|
|
|
|
|
$activeSheet->setCellValue($firstColumn.$i, '');
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
$activeSheet->SetCellValue($firstColumn.$i, 'Total');
|
|
|
|
|
$activeSheet->getStyle($firstColumn.$i)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT);
|
|
|
|
|
$activeSheet->getStyle($firstColumn.$i)->getFont()->setBold(true);
|
|
|
|
|
|
|
|
|
|
$activeSheet->SetCellValue($letter_product_qty.$i, '=SUM('.$letter_product_qty.($iOri).':'.$letter_product_qty.($i-1).')');
|
|
|
|
|
$activeSheet->getStyle($letter_product_qty.$i)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
|
|
|
|
|
$activeSheet->getStyle($letter_product_qty.$i)->getFont()->setBold(true);
|
|
|
|
|
if ($type == 2) {
|
|
|
|
|
$activeSheet->getStyle($letter_product_qty.$i)->getFill()->applyFromArray(
|
|
|
|
|
array(
|
|
|
|
|
'type' => PHPExcel_Style_Fill::FILL_SOLID,
|
|
|
|
|
'rotation' => 0,
|
|
|
|
|
'startcolor' => array(
|
|
|
|
|
'rgb' => 'D9D9D9'
|
|
|
|
|
),
|
|
|
|
|
'endcolor' => array(
|
|
|
|
|
'argb' => 'D9D9D9D9'
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
);
|
|
|
|
|
$activeSheet->SetCellValue($letter_product_total_qty.$i, '=SUM('.$letter_product_total_qty.($iOri).':'.$letter_product_total_qty.($i-1).')');
|
|
|
|
|
$activeSheet->getStyle($letter_product_total_qty.$i)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
|
|
|
|
|
$activeSheet->getStyle($letter_product_total_qty.$i)->getFont()->setBold(true);
|
|
|
|
|
|
|
|
|
|
$activeSheet->SetCellValue($letter_product_remaining_qty.$i, '=SUM('.$letter_product_remaining_qty.($iOri).':'.$letter_product_remaining_qty.($i-1).')');
|
|
|
|
|
$activeSheet->getStyle($letter_product_remaining_qty.$i)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
|
|
|
|
|
$activeSheet->getStyle($letter_product_remaining_qty.$i)->getFont()->setBold(true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$activeSheet->getStyle($firstColumn.($iOri-1).':'.$lastColumn.$i)->applyFromArray($arrayBorder);
|
|
|
|
|
|
|
|
|
|
$i++;
|
|
|
|
|
|
|
|
|
|
$activeSheet->setCellValue($letter_product_ht.$i, $lang['Total Amount']);
|
|
|
|
|
$activeSheet->getStyle($letter_product_ht.$i)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT);
|
|
|
|
|
if($type == 1)
|
|
|
|
|
$activeSheet->getStyle($letter_product_ht.$i)->getFont()->setBold(true);
|
|
|
|
|
|
|
|
|
|
$activeSheet->setCellValue($letter_product_total.$i, '=SUM('.$letter_product_total.($iOri).':'.$letter_product_total.($i-2).')');
|
|
|
|
|
$activeSheet->getStyle($letter_product_total.$i)->getNumberFormat()->setFormatCode( PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_EUR );
|
|
|
|
|
|
|
|
|
|
if($lang_id != 'en')
|
|
|
|
|
{
|
|
|
|
|
$i++;
|
|
|
|
|
|
|
|
|
|
$activeSheet->setCellValue($letter_product_ht.$i, 'TVA '.$TVA);
|
|
|
|
|
$activeSheet->getStyle($letter_product_ht.$i)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT);
|
|
|
|
|
if($type == 1)
|
|
|
|
|
$activeSheet->getStyle($letter_product_ht.$i)->getFont()->setBold(true);
|
|
|
|
|
|
|
|
|
|
$activeSheet->setCellValue($letter_product_total.$i, '='.$letter_product_total.($i-1).'*'.($TVA/100) );
|
|
|
|
|
$activeSheet->getStyle($letter_product_total.$i)->getNumberFormat()->setFormatCode( PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_EUR );
|
|
|
|
|
|
|
|
|
|
$i++;
|
|
|
|
|
|
|
|
|
|
$activeSheet->setCellValue($letter_product_ht.$i, 'TOTAL TTC');
|
|
|
|
|
$activeSheet->getStyle($letter_product_ht.$i)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT);
|
|
|
|
|
$activeSheet->getStyle($letter_product_ht.$i)->getFont()->setBold(true);
|
|
|
|
|
|
|
|
|
|
$activeSheet->setCellValue($letter_product_total.$i, '='.$letter_product_total.($i-1).'+'.$letter_product_total.($i-2) );
|
|
|
|
|
$activeSheet->getStyle($letter_product_total.$i)->getNumberFormat()->setFormatCode( PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_EUR );
|
|
|
|
|
$activeSheet->getStyle($letter_product_total.$i)->getFont()->setBold(true);
|
|
|
|
|
|
|
|
|
|
$activeSheet->getStyle($letter_product_ht.($i-3).':'.$lastColumn.$i)->applyFromArray($arrayBorder);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
$activeSheet->getStyle($letter_product_ht.($i-1).':'.$lastColumn.$i)->applyFromArray($arrayBorder);
|
|
|
|
|
}
|
|
|
|
|
if($type == 1)
|
|
|
|
|
{
|
|
|
|
|
$value = Configuration::get('PS_IT_OF_BAS_PAGE_'.$lang_id);
|
|
|
|
|
if($value != '')
|
|
|
|
|
{
|
|
|
|
|
$i++;
|
|
|
|
|
$value = str_replace('<br />', ' ' , nl2br($value));
|
|
|
|
|
|
|
|
|
|
$activeSheet->setCellValue($firstColumn.$i, $value);
|
|
|
|
|
$activeSheet->mergeCells($firstColumn.$i.':'.$lastColumn.$i );
|
|
|
|
|
$activeSheet->getRowDimension($i)->setRowHeight(80);
|
|
|
|
|
$activeSheet->getStyle($firstColumn.$i)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_TOP);
|
|
|
|
|
$activeSheet->getStyle($firstColumn.$i)->getNumberFormat()->setFormatCode( PHPExcel_Style_NumberFormat::FORMAT_TEXT );
|
|
|
|
|
$activeSheet->getStyle($firstColumn.$i)->getAlignment()->setWrapText(true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$value = Configuration::get('PS_IT_OF_BAS_PAGE_BIS_'.$lang_id);
|
|
|
|
|
if($value != '')
|
|
|
|
|
{
|
|
|
|
|
$i++;
|
|
|
|
|
$value = str_replace('<br />', ' ' , nl2br($value));
|
|
|
|
|
|
|
|
|
|
$activeSheet->setCellValue($firstColumn.$i, $value);
|
|
|
|
|
$activeSheet->mergeCells($firstColumn.$i.':'.$lastColumn.$i );
|
|
|
|
|
$activeSheet->getRowDimension($i)->setRowHeight(80);
|
|
|
|
|
$activeSheet->getStyle($firstColumn.$i)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_TOP);
|
|
|
|
|
$activeSheet->getStyle($firstColumn.$i)->getAlignment()->setWrapText(true);
|
|
|
|
|
$activeSheet->getStyle($firstColumn.$i)->getFont()->getColor()->setRGB('FF0000');
|
|
|
|
|
$activeSheet->getStyle($firstColumn.$i)->getNumberFormat()->setFormatCode( PHPExcel_Style_NumberFormat::FORMAT_TEXT );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$activeSheet->getColumnDimension($firstColumn)->setWidth(25);
|
|
|
|
|
$activeSheet->getColumnDimension($letter_product_ean)->setWidth(25);
|
|
|
|
|
$activeSheet->getColumnDimension($letter_product_ref_interne)->setWidth(25);
|
|
|
|
|
$activeSheet->getColumnDimension($letter_product_qty)->setWidth(18);
|
|
|
|
|
$activeSheet->getColumnDimension($letter_product_name)->setWidth(40);
|
|
|
|
|
if($have_declinaison === true)
|
|
|
|
|
$activeSheet->getColumnDimension($letter_product_attribute_name)->setWidth(20);
|
|
|
|
|
|
|
|
|
|
$activeSheet->getColumnDimension($letter_product_qty)->setWidth(13);
|
|
|
|
|
if ($type == 2) {
|
|
|
|
|
$activeSheet->getColumnDimension($letter_product_total_qty)->setWidth(13);
|
|
|
|
|
$activeSheet->getColumnDimension($letter_product_remaining_qty)->setWidth(13);
|
|
|
|
|
}
|
|
|
|
|
$activeSheet->getColumnDimension($letter_product_ht)->setWidth(13);
|
|
|
|
|
$activeSheet->getColumnDimension($letter_product_total)->setWidth(13);
|
|
|
|
|
|
|
|
|
|
$i++;
|
|
|
|
|
|
|
|
|
|
$activeSheet->setCellValue($firstColumn.$i, '');
|
|
|
|
|
}
|
|
|
|
|
$activeSheet->getColumnDimension($letter_product_ht)->setWidth(13);
|
|
|
|
|
$activeSheet->getColumnDimension($letter_product_total)->setWidth(13);
|
|
|
|
|
|
|
|
|
|
$i++;
|
|
|
|
|
|
|
|
|
|
$activeSheet->setCellValue($firstColumn.$i, '');
|
|
|
|
|
|
|
|
|
|
header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
|
|
|
|
|
header('Content-Disposition: attachment;filename="'.$title.'.xlsx"');
|
|
|
|
|