Merge branch 'ticket-9791' into develop

This commit is contained in:
Marion Muszynski 2016-04-07 11:47:30 +02:00
commit 967ad5d3c9

View File

@ -958,8 +958,35 @@ if(Tools::getValue('action') == 'getOrderForm' && ( ( $id_category = Tools::getV
case '1':
foreach($lines2 as $lines_attributes)
{
foreach($lines_attributes as $values)
foreach($lines_attributes as $key => $values)
{
if (is_array($lines_attributes[$key+1])) {
$borders_style = array(
'borders' => array(
'right' => array(
'style' => PHPExcel_Style_Border::BORDER_THIN
),
'left' => array(
'style' => PHPExcel_Style_Border::BORDER_THIN
)
)
);
} else {
$borders_style = array(
'borders' => array(
'right' => array(
'style' => PHPExcel_Style_Border::BORDER_THIN
),
'left' => array(
'style' => PHPExcel_Style_Border::BORDER_THIN
),
'bottom' => array(
'style' => PHPExcel_Style_Border::BORDER_THIN
)
)
);
}
$id_product_attribute = $values['line']['product_attribute_id'];
$id_product = $values['line']['product_id'];
$current_product = $array_product[$id_product];
@ -978,26 +1005,35 @@ if(Tools::getValue('action') == 'getOrderForm' && ( ( $id_category = Tools::getV
$activeSheet->SetCellValue($firstColumn.$i, $values['line']['product_supplier_reference']);
$activeSheet->getStyle($firstColumn.$i)->getNumberFormat()->setFormatCode( PHPExcel_Style_NumberFormat::FORMAT_TEXT );
$activeSheet->getStyle($firstColumn.$i)->applyFromArray($borders_style);
$activeSheet->SetCellValue($letter_product_ean.$i, $values['line']['product_ean13']);
$activeSheet->getStyle($letter_product_ean)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);
$activeSheet->getStyle($letter_product_ean.$i)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER);
$activeSheet->getStyle($letter_product_ean.$i)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT);
$activeSheet->getStyle($letter_product_ean.$i)->applyFromArray($borders_style);
$activeSheet->SetCellValue($letter_product_ref_interne.$i, $values['line']['product_reference']);
$activeSheet->getStyle($letter_product_ref_interne.$i)->applyFromArray($borders_style);
$activeSheet->SetCellValue($letter_product_name.$i, $values['line']['product_name_base']);
if($have_declinaison === true)
$activeSheet->getStyle($letter_product_name.$i)->applyFromArray($borders_style);
if($have_declinaison === true) {
$activeSheet->SetCellValue($letter_product_attribute_name.$i, $values['line']['product_attribute_name_base']);
$activeSheet->getStyle($letter_product_attribute_name.$i)->applyFromArray($borders_style);
}
$activeSheet->SetCellValue($letter_product_qty.$i, $values['total']);
$activeSheet->getStyle($letter_product_qty.$i)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
$activeSheet->getStyle($letter_product_qty.$i)->applyFromArray($borders_style);
$activeSheet->setCellValue($letter_product_ht.$i, (float)$wholesale_price );
$activeSheet->setCellValue($letter_product_total.$i, '='.$letter_product_qty.$i.'*'.$letter_product_ht.$i);
$activeSheet->getStyle($letter_product_ht.$i)->getNumberFormat()->setFormatCode( PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_EUR );
$activeSheet->getStyle($letter_product_ht.$i)->applyFromArray($borders_style);
$activeSheet->getStyle($letter_product_total.$i)->getNumberFormat()->setFormatCode( PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_EUR );
$activeSheet->getStyle($letter_product_total.$i)->applyFromArray($borders_style);
$i++;
}
@ -1101,7 +1137,8 @@ if(Tools::getValue('action') == 'getOrderForm' && ( ( $id_category = Tools::getV
$activeSheet->getStyle($letter_product_remaining_qty.$i)->getFont()->setBold(true);
}
$activeSheet->getStyle($firstColumn.($iOri-1).':'.$lastColumn.$i)->applyFromArray($arrayBorder);
$activeSheet->getStyle($firstColumn.($iOri-1).':'.$lastColumn.($iOri-1))->applyFromArray($arrayBorder);
$activeSheet->getStyle($firstColumn.$i.':'.$lastColumn.$i)->applyFromArray($arrayBorder);
$i++;