From 8ae9fb7dd278012885681a812b5c44f1b47c2df3 Mon Sep 17 00:00:00 2001 From: Marion Muszynski Date: Wed, 22 Nov 2017 16:31:51 +0100 Subject: [PATCH] fix --- modules/ant_wp/AdminAntWp.php | 61 +++++--- modules/ant_wp/GenerateWp.php | 145 ++++++++++++------ .../Classes/PHPExcel/Style/NumberFormat.php | 3 +- 3 files changed, 141 insertions(+), 68 deletions(-) diff --git a/modules/ant_wp/AdminAntWp.php b/modules/ant_wp/AdminAntWp.php index cd136a02..d52b0b8d 100644 --- a/modules/ant_wp/AdminAntWp.php +++ b/modules/ant_wp/AdminAntWp.php @@ -111,24 +111,24 @@ class AdminAntWp extends AdminTab $ean = trim($line[0]); $products[$ean] = array( 'ean' => $ean, - 'supplier_ref' => trim($line[1]), - 'name_ha' => trim($line[2]), + 'supplier_ref' => trim((String)utf8_encode($line[1])), + 'name_ha' => trim((String)utf8_encode($line[2])), 'quantity' => trim($line[3]), - 'ppc' => trim($line[4]), - 'prix_ha' => trim($line[5]), - 'name_attribute_ha' => trim($line[6]) + 'ppc' => trim((float)$line[4]), + 'prix_ha' => trim((float)$line[5]), + 'name_attribute_ha' => trim((String)$line[6]) ); $eans[] = $ean; } else { - $ref = trim($line[1]); + $ref = trim((String)utf8_encode($line[1])); $products[$ref] = array( 'ean' => trim($line[0]), 'supplier_ref' => $ref, - 'name_ha' => trim($line[2]), + 'name_ha' => trim((String)utf8_encode($line[2])), 'quantity' => trim($line[3]), - 'ppc' => trim($line[4]), - 'prix_ha' => trim($line[5]), - 'name_attribute_ha' => trim($line[6]) + 'ppc' => trim((float)$line[4]), + 'prix_ha' => trim((float)$line[5]), + 'name_attribute_ha' => trim((String)utf8_encode($line[6])) ); $refs[] = $ref; } @@ -181,7 +181,7 @@ class AdminAntWp extends AdminTab LEFT JOIN `'._DB_PREFIX_.'product_attribute_combination` ac ON (ac.`id_product_attribute` = at.`id_product_attribute`) LEFT JOIN `'._DB_PREFIX_.'attribute_lang` al - ON (al.`id_attribute` = ac.`id_attribute` AND al.`id_land` = 2) + ON (al.`id_attribute` = ac.`id_attribute` AND al.`id_lang` = 2) WHERE at.`ean13` IN ("'.implode('","',$eans).'") AND p.`id_product` IS NOT NULL ORDER BY c.`position` @@ -189,28 +189,51 @@ class AdminAntWp extends AdminTab if($row['ean13']!='' && isset($products[$row['ean13']])){ $products[$row['ean13']] = array_merge($products[$row['ean13']], $row); $product_found++; - $ids[] = (int)$row['id_product']; } elseif($row['supplier_reference']!='' && isset($products[$row['supplier_reference']])){ $products[$row['supplier_reference']] = array_merge($products[$row['supplier_reference']], $row); $product_found++; - $ids[] = (int)$row['id_product']; } if(!in_array((int)$row['id_product'],$ids)){ $ids[] = (int)$row['id_product']; } } $new_products = count($products) - $product_found; - if(!empty($ids)){ foreach (Db::getInstance()->executeS(' SELECT p.`ean13`, p.`supplier_reference`, pl.* - FROM ps_product_lang pl - LEFT JOIN ps_product p ON (pl.`id_product` = p.`id_product`) - WHERE pl.`id_product` IN ('.implode(',',$ids).') + FROM '._DB_PREFIX_.'product p + LEFT JOIN '._DB_PREFIX_.'product_lang pl ON (pl.`id_product` = p.`id_product`) + WHERE p.`id_product` IN ('.implode(',',$ids).') AND (pl.id_lang = 2 OR pl.id_lang = 3) - ORDER BY pl.`id_product` + ORDER BY p.`id_product` ') as $row) { - if($row['ean13']!='' && isset($products[$row['ean13']])){ + if($row['ean13']!='' && isset($products[(int)$row['ean13']])){ + if(!isset($products[$row['ean13']]['lang'])){ + $products[$row['ean13']]['lang'] = array(); + } + if(!isset($products[$row['ean13']]['lang'][(int)$row['id_lang']])){ + $products[$row['ean13']]['lang'][(int)$row['id_lang']] = $row; + } + } elseif($row['supplier_reference']!='' && isset($products[$row['supplier_reference']])){ + if(!isset($products[$row['supplier_reference']]['lang'])){ + $products[$row['supplier_reference']]['lang'] = array(); + } + if(!isset($products[$row['supplier_reference']]['lang'][(int)$row['id_lang']])){ + $products[$row['supplier_reference']]['lang'][(int)$row['id_lang']] = $row; + } + } + } + + foreach (Db::getInstance()->executeS(' + SELECT at.`ean13`, p.`supplier_reference`, pl.* + FROM '._DB_PREFIX_.'product p + LEFT JOIN '._DB_PREFIX_.'product_lang pl ON (pl.`id_product` = p.`id_product`) + LEFT JOIN `'._DB_PREFIX_.'product_attribute` at ON (at.`id_product` = p.`id_product`) + WHERE p.`id_product` IN ('.implode(',',$ids).') + AND (pl.id_lang = 2 OR pl.id_lang = 3) + ORDER BY p.`id_product` + ') as $row) { + if($row['ean13']!='' && isset($products[(int)$row['ean13']])){ if(!isset($products[$row['ean13']]['lang'])){ $products[$row['ean13']]['lang'] = array(); } diff --git a/modules/ant_wp/GenerateWp.php b/modules/ant_wp/GenerateWp.php index 58899ded..18b22663 100644 --- a/modules/ant_wp/GenerateWp.php +++ b/modules/ant_wp/GenerateWp.php @@ -32,7 +32,7 @@ class GenerateWp 'F' => 'Nom / Collection', 'G' => 'Coloris / Déclinaison', 'H' => 'Taille HA', - 'I' => 'Taille', + 'I' => 'Taille (old)', 'J' => 'Nom du produit HA', 'K' => 'Nom du produit (old)', 'L' => 'Nb de caract. Titre', @@ -91,11 +91,11 @@ class GenerateWp } $activeSheet->mergeCells('A1:B1'); if($key == 0){ - $activeSheet->setCellValue('AM1',(String)$params['marque']); - $activeSheet->getStyle('AM1')->getFont()->getColor()->setARGB(PHPExcel_Style_Color::COLOR_WHITE); - $activeSheet->getStyle('AM1')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER); - $activeSheet->getStyle('AM1')->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER); - $activeSheet->getStyle('AM1')->getFill()->applyFromArray( + $activeSheet->setCellValue('AO1',(String)$params['marque']); + $activeSheet->getStyle('AO1')->getFont()->getColor()->setARGB(PHPExcel_Style_Color::COLOR_WHITE); + $activeSheet->getStyle('AO1')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER); + $activeSheet->getStyle('AO1')->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER); + $activeSheet->getStyle('AO1')->getFill()->applyFromArray( array( 'type' => PHPExcel_Style_Fill::FILL_SOLID, 'rotation' => 0, @@ -109,8 +109,8 @@ class GenerateWp ); } - $activeSheet->getStyle('A1:AR'.$lastLine)->getFont()->setSize(10); - $activeSheet->getStyle('A1:AR'.$lastLine)->getFont()->setName('calibri'); + $activeSheet->getStyle('A1:AT'.$lastLine)->getFont()->setSize(10); + $activeSheet->getStyle('A1:AT'.$lastLine)->getFont()->setName('calibri'); } $borders_style = array( @@ -122,26 +122,48 @@ class GenerateWp ); $i=4; + $activeSheet->getColumnDimension('A')->setWidth(3); foreach ($this->columns as $key => $value) { $this->objPHPExcel->setActiveSheetIndex(0); $activeSheet = $this->objPHPExcel->getActiveSheet(); $activeSheet->getRowDimension($i)->setRowHeight(25); - if(in_array($key,array('C','D'))) { - $activeSheet->getColumnDimension($key)->setWidth(30); - } elseif(in_array($key,array('U','AO','AP'))) { - $activeSheet->getColumnDimension($key)->setWidth(40); - } elseif(in_array($key,array('L','N','Q','R','T'))){ - $activeSheet->getColumnDimension($key)->setWidth(10); - } elseif(in_array($key,array('Z','AA','AB','AC','AD','AE','AF','AG','AH','AI','AJ','AK','AL','AM','AN','AQ','AR','AS'))) { - $activeSheet->getColumnDimension($key)->setWidth(11); - } else { + if(in_array($key,array('B','C','N','O','P','S','V','W','X','Y'))){ $activeSheet->getColumnDimension($key)->setWidth(16); + } elseif(in_array($key,array('E','F','G','H','I','J','K'))){ + $activeSheet->getColumnDimension($key)->setWidth(20); + } elseif(in_array($key,array('L','M','Q','R','T'))){ + $activeSheet->getColumnDimension($key)->setWidth(10); + } elseif(in_array($key,array('Z','AA','AB','AC','AD','AE','AF','AG','AH','AI','AJ','AK','AL','AM','AN'))){ + $activeSheet->getColumnDimension($key)->setWidth(11); + } elseif(in_array($key,array('U','AO'))){ + $activeSheet->getColumnDimension($key)->setWidth(45); + } elseif(in_array($key,array('AQ','AR','AS','AT'))){ + $activeSheet->getColumnDimension($key)->setWidth(12); + } elseif(in_array($key,array('D'))){ + $activeSheet->getColumnDimension($key)->setWidth(25); + } elseif(in_array($key,array('AP'))){ + $activeSheet->getColumnDimension($key)->setWidth(40); } + // elseif(in_array($key,array('U','AO','AP'))) { + // $activeSheet->getColumnDimension($key)->setWidth(35); + // } elseif(in_array($key,array('D'))) { + // $activeSheet->getColumnDimension($key)->setWidth(25); + // } elseif(in_array($key,array('E','F','G','H','I','J','K'))) { + // $activeSheet->getColumnDimension($key)->setWidth(20); + // } elseif(in_array($key,array('Z','AA','AB','AC','AD','AE','AF','AG','AH','AI','AJ','AK','AL','AM','AN','AQ','AR','AS','AT'))) { + // $activeSheet->getColumnDimension($key)->setWidth(8); + // } elseif(in_array($key,array('L','M','Q','R','T'))){ + // $activeSheet->getColumnDimension($key)->setWidth(7); + // } else { + // $activeSheet->getColumnDimension($key)->setWidth(13); + // } + $activeSheet->setCellValue($key.$i,$value); $activeSheet->getStyle($key.$i)->getFont()->getColor()->setARGB(PHPExcel_Style_Color::COLOR_WHITE); $activeSheet->getStyle($key.$i)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER); $activeSheet->getStyle($key.$i)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER); + $activeSheet->getStyle($key.$i)->getAlignment()->setWrapText(true); $activeSheet->getStyle($key.$i)->applyFromArray($borders_style); $activeSheet->getStyle($key.$i)->getFill()->applyFromArray( array( @@ -160,18 +182,21 @@ class GenerateWp $this->objPHPExcel->setActiveSheetIndex(1); $activeSheet = $this->objPHPExcel->getActiveSheet(); $activeSheet->getRowDimension($i)->setRowHeight(25); - if(in_array($key,array('B','C','D','E','F','G','H','J'))) { - $activeSheet->getColumnDimension($key)->setWidth(16); + if(in_array($key,array('B','C','D','F','G','H','J'))) { + $activeSheet->getColumnDimension($key)->setWidth(13); + } elseif(in_array($key,array('E','J'))) { + $activeSheet->getColumnDimension($key)->setWidth(25); } elseif(in_array($key,array('I'))) { - $activeSheet->getColumnDimension($key)->setWidth(40); + $activeSheet->getColumnDimension($key)->setWidth(35); } else { - $activeSheet->getColumnDimension($key)->setWidth(11); + $activeSheet->getColumnDimension($key)->setWidth(8); } $activeSheet->setCellValue($key.$i,$value); $activeSheet->getStyle($key.$i)->getFont()->getColor()->setARGB(PHPExcel_Style_Color::COLOR_WHITE); $activeSheet->getStyle($key.$i)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER); $activeSheet->getStyle($key.$i)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER); + $activeSheet->getStyle($key.$i)->getAlignment()->setWrapText(true); $activeSheet->getStyle($key.$i)->applyFromArray($borders_style); $activeSheet->getStyle($key.$i)->getFill()->applyFromArray( array( @@ -237,7 +262,7 @@ class GenerateWp $price2 = Product::getPriceStatic($row['id_product'],TRUE, NULL, 2); $this->objPHPExcel->setActiveSheetIndex(0)->setCellValue('B'.$i, (String)$row['ean']) - ->setCellValue('C'.$i, $row['supplier_reference']) + ->setCellValue('C'.$i, (String)$row['supplier_reference']) ->setCellValue('D'.$i, '=IF(AND(E'.$i.'="",F'.$i.'="",G'.$i.'=""),"",E'.$i.'&" "&F'.$i.'&" - "&G'.$i.')') ->setCellValue('E'.$i, '') ->setCellValue('F'.$i, '') @@ -253,8 +278,8 @@ class GenerateWp ->setCellValue('P'.$i, $categories_title[2][2]) ->setCellValue('Q'.$i, count($images)) ->setCellValue('R'.$i, '') - ->setCellValue('S'.$i, '=AM1&"-"&P'.$i.'&"-"&LEFT(C'.$i.',9)') - ->setCellValue('T'.$i, '=IF(Q'.$i.'="","",LEN(Q'.$i.'))') + ->setCellValue('S'.$i, '=AO1&"-"&R'.$i.'&"-"&LEFT(C'.$i.',9)') + ->setCellValue('T'.$i, '=IF(S'.$i.'="","",LEN(S'.$i.'))') ->setCellValue('U'.$i, $row['lang'][2]['description_short']) ->setCellValue('V'.$i, $row['lang'][2]['description']) ->setCellValue('W'.$i, $row['lang'][2]['description_more']) @@ -270,21 +295,21 @@ class GenerateWp ->setCellValue('AG'.$i, '') ->setCellValue('AH'.$i, $row['prix_ha']) ->setCellValue('AI'.$i, Tools::ps_round($row['wholesale_price'], 2)) - ->setCellValue('AJ'.$i, '=IF(AG'.$i.'="","",IF((AF'.$i.'-AG'.$i.')>0,"ATTENTION",IF((AF'.$i.'-AG'.$i.')<0,"COOL",IF((AF'.$i.'-AG'.$i.')=0,"OK",""))))') - ->setCellValue('AK'.$i, '=IF(AF'.$i.'="","",(AF'.$i.'*1.85))') + ->setCellValue('AJ'.$i, '=IF(AI'.$i.'="","",IF((AH'.$i.'-AI'.$i.')>0,"ATTENTION",IF((AH'.$i.'-AI'.$i.')<0,"COOL",IF((AH'.$i.'-AI'.$i.')=0,"OK",""))))') + ->setCellValue('AK'.$i, '=IF(AH'.$i.'="","",(AH'.$i.'*1.85))') ->setCellValue('AL'.$i, $price2) - ->setCellValue('AM'.$i, '=IF(AND(AD'.$i.'="",AI'.$i.'=""),"",ROUND((1-AI'.$i.'/AD'.$i.')*100,4))') - ->setCellValue('AN'.$i, '=IF(AND(AF'.$i.'="",AI'.$i.'=""),"",1-AF'.$i.'/(AI'.$i.'/1.2))') - ->setCellValue('AO'.$i, '=IF(O'.$i.'="","",IF(O'.$i.'=1,"https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&".jpg",IF(O'.$i.'=2,"https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&".jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-1.jpg",IF(O'.$i.'=3,"https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&".jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-1.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-2.jpg",IF(O'.$i.'=4,"https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&".jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-1.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-2.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-3.jpg",IF(O'.$i.'='.$i.',"https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&".jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-1.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-2.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-3.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-4.jpg",IF(O'.$i.'=6,"https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&".jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-1.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-2.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-3.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-4.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-5.jpg",IF(O'.$i.'=7,"https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&".jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-1.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-2.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-3.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-4.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-5.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-6.jpg",IF(O'.$i.'=8,"https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&".jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-1.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-2.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-3.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-4.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-5.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-6.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-7.jpg",IF(O'.$i.'=9,"https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&".jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-1.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-2.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-3.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-4.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-5.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-6.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-7.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-8.jpg",IF(O'.$i.'=10,"https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&".jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-1.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-2.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-3.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-4.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-5.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-6.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-7.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-8.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-9.jpg",IF(O'.$i.'=11,"https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&".jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-1.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-2.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-3.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-4.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-5.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-6.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-7.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-8.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-9.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-10.jpg",IF(O'.$i.'=12,"https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&".jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-1.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-2.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-3.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-4.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-5.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-6.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-7.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-8.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-9.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-10.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-11.jpg",IF(O'.$i.'=13,"https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&".jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-1.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-2.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-3.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-4.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-5.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-6.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-7.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-8.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-9.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-10.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-11.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-12.jpg",IF(O'.$i.'=14,"https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&".jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-1.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-2.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-3.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-4.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-5.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-6.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-7.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-8.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-9.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-10.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-11.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-12.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-13.jpg",IF(O'.$i.'=1'.$i.',"https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&".jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-1.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-2.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-3.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-4.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-5.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-6.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-7.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-8.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-9.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-10.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-11.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-12.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-13.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-14.jpg"))))))))))))))))') + ->setCellValue('AM'.$i, '=IF(AND(AF'.$i.'="",AK'.$i.'=""),"",ROUND((1-AK'.$i.'/AF'.$i.')*100,4))') + ->setCellValue('AN'.$i, '=IF(AND(AH'.$i.'="",AK'.$i.'=""),"",1-AH'.$i.'/(AK'.$i.'/1.2))') + ->setCellValue('AO'.$i, '=IF(Q'.$i.'="","",IF(Q'.$i.'=1,"https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&".jpg",IF(Q'.$i.'=2,"https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&".jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-1.jpg",IF(Q'.$i.'=3,"https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&".jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-1.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-2.jpg",IF(Q'.$i.'=4,"https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&".jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-1.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-2.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-3.jpg",IF(Q'.$i.'='.$i.',"https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&".jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-1.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-2.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-3.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-4.jpg",IF(Q'.$i.'=6,"https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&".jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-1.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-2.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-3.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-4.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-5.jpg",IF(Q'.$i.'=7,"https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&".jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-1.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-2.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-3.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-4.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-5.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-6.jpg",IF(Q'.$i.'=8,"https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&".jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-1.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-2.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-3.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-4.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-5.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-6.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-7.jpg",IF(Q'.$i.'=9,"https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&".jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-1.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-2.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-3.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-4.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-5.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-6.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-7.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-8.jpg",IF(Q'.$i.'=10,"https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&".jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-1.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-2.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-3.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-4.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-5.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-6.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-7.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-8.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-9.jpg",IF(Q'.$i.'=11,"https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&".jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-1.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-2.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-3.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-4.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-5.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-6.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-7.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-8.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-9.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-10.jpg",IF(Q'.$i.'=12,"https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&".jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-1.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-2.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-3.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-4.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-5.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-6.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-7.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-8.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-9.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-10.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-11.jpg",IF(Q'.$i.'=13,"https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&".jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-1.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-2.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-3.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-4.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-5.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-6.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-7.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-8.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-9.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-10.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-11.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-12.jpg",IF(Q'.$i.'=14,"https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&".jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-1.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-2.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-3.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-4.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-5.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-6.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-7.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-8.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-9.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-10.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-11.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-12.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-13.jpg",IF(Q'.$i.'=1'.$i.',"https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&".jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-1.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-2.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-3.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-4.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-5.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-6.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-7.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-8.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-9.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-10.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-11.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-12.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-13.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-14.jpg"))))))))))))))))') ->setCellValue('AP'.$i, implode(', ', $images)) - ->setCellValue('AK'.$i, '=AA'.$i.'*AF'.$i) + ->setCellValue('AQ'.$i, '=AC'.$i.'*AH'.$i) ->setCellValue('AR'.$i, isset($row['nc8'])?$row['nc8']:"") ->setCellValue('AS'.$i, isset($row['id_country'])?$row['id_country']:"") ->setCellValue('AT'.$i, date('d/m/Y',strtotime($sales[$id_categories[0]]))); $this->objPHPExcel->setActiveSheetIndex(0)->getStyle('B'.$i.':AT'.$i.'')->applyFromArray($borders_style); $this->objPHPExcel->setActiveSheetIndex(1)->setCellValue('B'.$i, (String)$row['ean']) - ->setCellValue('C'.$i, $row['supplier_reference']) + ->setCellValue('C'.$i, (String)$row['supplier_reference']) ->setCellValue('D'.$i, $row['id_product']) ->setCellValue('E'.$i, $row['lang'][3]['name']) ->setCellValue('F'.$i, $categories_title[3][0]) @@ -298,7 +323,7 @@ class GenerateWp $this->objPHPExcel->setActiveSheetIndex(1)->getStyle('B'.$i.':M'.$i.'')->applyFromArray($borders_style); } else { $this->objPHPExcel->setActiveSheetIndex(0)->setCellValue('B'.$i, (String)$row['ean']) - ->setCellValue('C'.$i, $row['supplier_ref']) + ->setCellValue('C'.$i, (String)$row['supplier_ref']) ->setCellValue('D'.$i, '=IF(AND(E'.$i.'="",F'.$i.'="",G'.$i.'=""),"",E'.$i.'&" "&F'.$i.'&" - "&G'.$i.')') ->setCellValue('E'.$i, '') ->setCellValue('F'.$i, '') @@ -314,8 +339,8 @@ class GenerateWp ->setCellValue('P'.$i, '') ->setCellValue('Q'.$i, '') ->setCellValue('R'.$i, '') - ->setCellValue('S'.$i, '=AM1 & "-" & P'.$i.' & "-" & LEFT(C'.$i.',9)') - ->setCellValue('T'.$i, '=IF(Q'.$i.'="","",LEN(Q'.$i.'))') + ->setCellValue('S'.$i, '=AO1&"-"&R'.$i.'&"-"&LEFT(C'.$i.',9)') + ->setCellValue('T'.$i, '=IF(S'.$i.'="","",LEN(S'.$i.'))') ->setCellValue('U'.$i, '') ->setCellValue('V'.$i, '') ->setCellValue('W'.$i, '') @@ -331,14 +356,14 @@ class GenerateWp ->setCellValue('AG'.$i, '') ->setCellValue('AH'.$i, $row['prix_ha']) ->setCellValue('AI'.$i, '') - ->setCellValue('AJ'.$i, '=IF(AG'.$i.'="","",IF((AF'.$i.'-AG'.$i.')>0,"ATTENTION",IF((AF'.$i.'-AG'.$i.')<0,"COOL",IF((AF'.$i.'-AG'.$i.')=0,"OK",""))))') - ->setCellValue('AK'.$i, '=IF(AF'.$i.'="","",(AF'.$i.'*1.85))') + ->setCellValue('AJ'.$i, '=IF(AI'.$i.'="","",IF((AH'.$i.'-AI'.$i.')>0,"ATTENTION",IF((AH'.$i.'-AI'.$i.')<0,"COOL",IF((AH'.$i.'-AI'.$i.')=0,"OK",""))))') + ->setCellValue('AK'.$i, '=IF(AH'.$i.'="","",(AH'.$i.'*1.85))') ->setCellValue('AL'.$i, '') - ->setCellValue('AM'.$i, '=IF(AND(AD'.$i.'="",AI'.$i.'=""),"",ROUND((1-AI'.$i.'/AD'.$i.')*100,4))') - ->setCellValue('AN'.$i, '=IF(AND(AF'.$i.'="",AI'.$i.'=""),"",1-AF'.$i.'/(AI'.$i.'/1.2))') - ->setCellValue('AO'.$i, '=IF(O'.$i.'="","",IF(O'.$i.'=1,"https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&".jpg",IF(O'.$i.'=2,"https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&".jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-1.jpg",IF(O'.$i.'=3,"https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&".jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-1.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-2.jpg",IF(O'.$i.'=4,"https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&".jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-1.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-2.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-3.jpg",IF(O'.$i.'='.$i.',"https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&".jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-1.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-2.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-3.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-4.jpg",IF(O'.$i.'=6,"https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&".jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-1.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-2.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-3.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-4.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-5.jpg",IF(O'.$i.'=7,"https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&".jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-1.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-2.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-3.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-4.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-5.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-6.jpg",IF(O'.$i.'=8,"https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&".jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-1.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-2.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-3.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-4.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-5.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-6.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-7.jpg",IF(O'.$i.'=9,"https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&".jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-1.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-2.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-3.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-4.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-5.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-6.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-7.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-8.jpg",IF(O'.$i.'=10,"https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&".jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-1.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-2.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-3.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-4.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-5.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-6.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-7.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-8.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-9.jpg",IF(O'.$i.'=11,"https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&".jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-1.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-2.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-3.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-4.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-5.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-6.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-7.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-8.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-9.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-10.jpg",IF(O'.$i.'=12,"https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&".jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-1.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-2.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-3.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-4.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-5.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-6.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-7.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-8.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-9.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-10.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-11.jpg",IF(O'.$i.'=13,"https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&".jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-1.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-2.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-3.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-4.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-5.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-6.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-7.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-8.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-9.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-10.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-11.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-12.jpg",IF(O'.$i.'=14,"https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&".jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-1.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-2.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-3.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-4.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-5.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-6.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-7.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-8.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-9.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-10.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-11.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-12.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-13.jpg",IF(O'.$i.'=1'.$i.',"https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&".jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-1.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-2.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-3.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-4.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-5.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-6.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-7.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-8.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-9.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-10.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-11.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-12.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-13.jpg,https://static.bebeboutik.com/img_import/"&AM1&"/"&C'.$i.'&"-14.jpg"))))))))))))))))') + ->setCellValue('AM'.$i, '=IF(AND(AF'.$i.'="",AK'.$i.'=""),"",ROUND((1-AK'.$i.'/AF'.$i.')*100,4))') + ->setCellValue('AN'.$i, '=IF(AND(AH'.$i.'="",AK'.$i.'=""),"",1-AH'.$i.'/(AK'.$i.'/1.2))') + ->setCellValue('AO'.$i, '=IF(Q'.$i.'="","",IF(Q'.$i.'=1,"https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&".jpg",IF(Q'.$i.'=2,"https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&".jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-1.jpg",IF(Q'.$i.'=3,"https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&".jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-1.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-2.jpg",IF(Q'.$i.'=4,"https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&".jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-1.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-2.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-3.jpg",IF(Q'.$i.'='.$i.',"https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&".jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-1.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-2.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-3.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-4.jpg",IF(Q'.$i.'=6,"https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&".jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-1.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-2.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-3.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-4.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-5.jpg",IF(Q'.$i.'=7,"https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&".jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-1.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-2.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-3.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-4.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-5.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-6.jpg",IF(Q'.$i.'=8,"https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&".jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-1.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-2.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-3.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-4.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-5.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-6.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-7.jpg",IF(Q'.$i.'=9,"https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&".jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-1.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-2.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-3.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-4.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-5.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-6.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-7.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-8.jpg",IF(Q'.$i.'=10,"https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&".jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-1.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-2.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-3.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-4.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-5.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-6.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-7.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-8.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-9.jpg",IF(Q'.$i.'=11,"https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&".jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-1.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-2.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-3.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-4.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-5.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-6.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-7.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-8.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-9.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-10.jpg",IF(Q'.$i.'=12,"https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&".jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-1.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-2.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-3.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-4.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-5.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-6.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-7.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-8.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-9.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-10.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-11.jpg",IF(Q'.$i.'=13,"https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&".jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-1.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-2.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-3.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-4.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-5.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-6.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-7.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-8.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-9.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-10.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-11.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-12.jpg",IF(Q'.$i.'=14,"https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&".jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-1.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-2.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-3.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-4.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-5.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-6.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-7.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-8.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-9.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-10.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-11.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-12.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-13.jpg",IF(Q'.$i.'=1'.$i.',"https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&".jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-1.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-2.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-3.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-4.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-5.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-6.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-7.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-8.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-9.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-10.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-11.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-12.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-13.jpg,https://static.bebeboutik.com/img_import/"&AO1&"/"&C'.$i.'&"-14.jpg"))))))))))))))))') ->setCellValue('AP'.$i, '') - ->setCellValue('AQ'.$i, '=AA'.$i.'*AF'.$i) + ->setCellValue('AQ'.$i, '=AC'.$i.'*AH'.$i) ->setCellValue('AR'.$i, '') ->setCellValue('AS'.$i, '') ->setCellValue('AT'.$i, ''); @@ -365,38 +390,58 @@ class GenerateWp ->getStyle('B5:B'.$lastLine) ->getNumberFormat() ->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER); + $this->objPHPExcel->getActiveSheet() + ->getStyle('C5:C'.$lastLine) + ->getNumberFormat() + ->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_TEXT); + $this->objPHPExcel->getActiveSheet() + ->getStyle('L5:L'.$lastLine) + ->getNumberFormat() + ->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER); + $this->objPHPExcel->getActiveSheet() + ->getStyle('L5:L'.$lastLine) + ->getAlignment() + ->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER); $this->objPHPExcel->getActiveSheet() ->getStyle('R5:R'.$lastLine) ->getNumberFormat() ->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_TEXT); + $this->objPHPExcel->getActiveSheet() + ->getStyle('T5:T'.$lastLine) + ->getNumberFormat() + ->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER); + $this->objPHPExcel->getActiveSheet() + ->getStyle('T5:T'.$lastLine) + ->getAlignment() + ->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER); $this->objPHPExcel->getActiveSheet() ->getStyle('AB5:AB'.$lastLine) ->getNumberFormat() - ->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_EUR_SIMPLE); + ->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_EUR); $this->objPHPExcel->getActiveSheet() ->getStyle('AF5:AF'.$lastLine) ->getNumberFormat() - ->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_EUR_SIMPLE); + ->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_EUR); $this->objPHPExcel->getActiveSheet() ->getStyle('AG5:AG'.$lastLine) ->getNumberFormat() - ->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_EUR_SIMPLE); + ->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_EUR); $this->objPHPExcel->getActiveSheet() ->getStyle('AH5:AH'.$lastLine) ->getNumberFormat() - ->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_EUR_SIMPLE); + ->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_EUR); $this->objPHPExcel->getActiveSheet() ->getStyle('AI5:AI'.$lastLine) ->getNumberFormat() - ->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_EUR_SIMPLE); + ->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_EUR); $this->objPHPExcel->getActiveSheet() ->getStyle('AK5:AK'.$lastLine) ->getNumberFormat() - ->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_EUR_SIMPLE); + ->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_EUR); $this->objPHPExcel->getActiveSheet() ->getStyle('AL5:AL'.$lastLine) ->getNumberFormat() - ->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_EUR_SIMPLE); + ->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_EUR); $this->objPHPExcel->getActiveSheet() ->getStyle('AM5:AM'.$lastLine) ->getNumberFormat() @@ -408,7 +453,11 @@ class GenerateWp $this->objPHPExcel->getActiveSheet() ->getStyle('AQ5:AQ'.$lastLine) ->getNumberFormat() - ->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_EUR_SIMPLE); + ->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_EUR); + $this->objPHPExcel->getActiveSheet() + ->getStyle('AQ5:AQ'.$lastLine) + ->getAlignment() + ->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER); $this->objPHPExcel->getActiveSheet() ->getStyle('AT5:AT'.$lastLine) ->getNumberFormat() diff --git a/tools/PHPExcel/Classes/PHPExcel/Style/NumberFormat.php b/tools/PHPExcel/Classes/PHPExcel/Style/NumberFormat.php index 1b72cda9..619b0ad8 100755 --- a/tools/PHPExcel/Classes/PHPExcel/Style/NumberFormat.php +++ b/tools/PHPExcel/Classes/PHPExcel/Style/NumberFormat.php @@ -66,6 +66,7 @@ class PHPExcel_Style_NumberFormat extends PHPExcel_Style_Supervisor implements P const FORMAT_CURRENCY_USD_SIMPLE = '"$"#,##0.00_-'; const FORMAT_CURRENCY_USD = '$#,##0_-'; const FORMAT_CURRENCY_EUR_SIMPLE = '[$EUR ]#,##0.00_-'; + const FORMAT_CURRENCY_EUR = '#.00 [$€];-#.00 [$€]'; /** * Excel built-in number formats @@ -264,7 +265,7 @@ class PHPExcel_Style_NumberFormat extends PHPExcel_Style_Supervisor implements P // 40: "#,##0.00_);[Red](#,##0.00)" // 47: "mm:ss.0" // KOR fmt 55: "yyyy/mm/dd" - + // Built-in format codes if (is_null(self::$builtInFormats)) { self::$builtInFormats = array();