diff --git a/modules/ant_wp/AdminAntWp.php b/modules/ant_wp/AdminAntWp.php index 15c49235..d52b0b8d 100644 --- a/modules/ant_wp/AdminAntWp.php +++ b/modules/ant_wp/AdminAntWp.php @@ -110,23 +110,25 @@ class AdminAntWp extends AdminTab if($line[0] != '') { $ean = trim($line[0]); $products[$ean] = array( - 'ean' => $ean, - 'supplier_ref' => trim($line[1]), - 'name_ha' => trim($line[2]), - 'quantity' => trim($line[3]), - 'ppc' => trim($line[4]), - 'prix_ha' => trim($line[5]) + 'ean' => $ean, + 'supplier_ref' => trim((String)utf8_encode($line[1])), + 'name_ha' => trim((String)utf8_encode($line[2])), + 'quantity' => trim($line[3]), + '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]), - 'quantity' => trim($line[3]), - 'ppc' => trim($line[4]), - 'prix_ha' => trim($line[5]) + 'ean' => trim($line[0]), + 'supplier_ref' => $ref, + 'name_ha' => trim((String)utf8_encode($line[2])), + 'quantity' => trim($line[3]), + 'ppc' => trim((float)$line[4]), + 'prix_ha' => trim((float)$line[5]), + 'name_attribute_ha' => trim((String)utf8_encode($line[6])) ); $refs[] = $ref; } @@ -164,7 +166,8 @@ class AdminAntWp extends AdminTab foreach (Db::getInstance()->executeS(' SELECT p.`id_product`, p.`id_tax_rules_group`, p.`id_category_default`, at.`ean13`, p.`price`, p.`wholesale_price`, - p.`reference`, p.`supplier_reference`, p.`weight`, p.`height`, p.`width`, p.`depth`, c.`position`, cu.`nc8`, cu.`id_country` + p.`reference`, p.`supplier_reference`, p.`weight`, p.`height`, p.`width`, p.`depth`, c.`position`, cu.`nc8`, cu.`id_country`, + al.`name` as attribute_name FROM `'._DB_PREFIX_.'product` p INNER JOIN (SELECT date_add, max(id_product) as maxid FROM `'._DB_PREFIX_.'product` GROUP BY `supplier_reference`) as b @@ -175,6 +178,10 @@ class AdminAntWp extends AdminTab ON (cu.`id_product` = p.`id_product`) LEFT JOIN `'._DB_PREFIX_.'product_attribute` at ON (at.`id_product` = p.`id_product`) + 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_lang` = 2) WHERE at.`ean13` IN ("'.implode('","',$eans).'") AND p.`id_product` IS NOT NULL ORDER BY c.`position` @@ -182,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(); } @@ -280,7 +310,7 @@ class AdminAntWp extends AdminTab Avec les colonnes suivantes :

Les colonnes suivantes et la première ligne du fichier seront ignorées.

' diff --git a/modules/ant_wp/GenerateWp.php b/modules/ant_wp/GenerateWp.php index 6ff97556..18b22663 100644 --- a/modules/ant_wp/GenerateWp.php +++ b/modules/ant_wp/GenerateWp.php @@ -1,8 +1,4 @@ 'Type de produit', 'F' => 'Nom / Collection', 'G' => 'Coloris / Déclinaison', - 'H' => 'Nom du produit HA', - 'I' => 'Nom du produit (old)', - 'J' => 'Nb de caract. Titre', - 'K' => 'Order', - 'L' => 'Catégorie', - 'M' => 'Sous-catégorie', - 'N' => 'Sous-sous-catégorie', - 'O' => 'Nb de photos', - 'P' => 'Ordre Logistique', - 'Q' => 'Ref Bébé Boutik', - 'R' => 'Nb de caract. Ref', - 'S' => 'Description courte', - 'T' => 'Bon à savoir', - 'U' => 'Les plus', - 'V' => 'Vidéo', - 'W' => 'Livraison', - 'X' => 'Poids', - 'Y' => 'Vente old', - 'Z' => 'BDC old', - 'AA' => 'Quantité réservée', - 'AB' => 'Taille', - 'AC' => 'TVA appliquée', - 'AD' => 'PPC TTC', - 'AE' => 'PPC old', - 'AF' => 'Prix achat HT', - 'AG' => 'Prix HA old', - 'AH' => 'Différence', - 'AI' => 'PV 3BTK appliqué', - 'AJ' => 'Prix vente', - 'AK' => 'Remise membre', - 'AL' => 'Marge', - 'AM' => 'Photos', - 'AN' => 'Photos old', - 'AO' => 'BDC Potentiel', - 'AP' => 'Custom code', - 'AQ' => 'Pays de fabrication', - 'AR' => 'Date de la vente'); + 'H' => 'Taille HA', + 'I' => 'Taille (old)', + 'J' => 'Nom du produit HA', + 'K' => 'Nom du produit (old)', + 'L' => 'Nb de caract. Titre', + 'M' => 'Order', + 'N' => 'Catégorie', + 'O' => 'Sous-catégorie', + 'P' => 'Sous-sous-catégorie', + 'Q' => 'Nb de photos', + 'R' => 'Ordre Logistique', + 'S' => 'Ref Bébé Boutik', + 'T' => 'Nb de caract. Ref', + 'U' => 'Description courte', + 'V' => 'Bon à savoir', + 'W' => 'Les plus', + 'X' => 'Vidéo', + 'Y' => 'Livraison', + 'Z' => 'Poids', + 'AA' => 'Vente old', + 'AB' => 'BDC old', + 'AC' => 'Quantité réservée', + 'AD' => 'Taille', + 'AE' => 'TVA appliquée', + 'AF' => 'PPC TTC', + 'AG' => 'PPC old', + 'AH' => 'Prix achat HT', + 'AI' => 'Prix HA old', + 'AJ' => 'Différence', + 'AK' => 'PV 3BTK appliqué', + 'AL' => 'Prix vente', + 'AM' => 'Remise membre', + 'AN' => 'Marge', + 'AO' => 'Photos', + 'AP' => 'Photos old', + 'AQ' => 'BDC Potentiel', + 'AR' => 'Custom code', + 'AS' => 'Pays de fabrication', + 'AT' => 'Date de la vente'); } @@ -93,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, @@ -111,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( @@ -124,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('S','AM','AN'))) { - $activeSheet->getColumnDimension($key)->setWidth(40); - } elseif(in_array($key,array('J','K','O','P','R'))){ - $activeSheet->getColumnDimension($key)->setWidth(10); - } elseif(in_array($key,array('X','Y','Z','AA','AB','AC','AD','AE','AF','AG','AH','AI','AJ','AK','AL','AO','AP','AK','AR'))) { - $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( @@ -162,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( @@ -239,52 +262,54 @@ 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, '') ->setCellValue('G'.$i, '') - ->setCellValue('H'.$i, $row['name_ha']) - ->setCellValue('I'.$i, $row['lang'][2]['name']) - ->setCellValue('J'.$i, '=LEN(D'.$i.')') - ->setCellValue('K'.$i, (int)$row['position']) - ->setCellValue('L'.$i, $categories_title[2][0]) - ->setCellValue('M'.$i, $categories_title[2][1]) - ->setCellValue('N'.$i, $categories_title[2][2]) - ->setCellValue('O'.$i, count($images)) - ->setCellValue('P'.$i, '') - ->setCellValue('Q'.$i, '=AM1&"-"&P'.$i.'&"-"&LEFT(C'.$i.',9)') - ->setCellValue('R'.$i, '=IF(Q'.$i.'="","",LEN(Q'.$i.'))') - ->setCellValue('S'.$i, $row['lang'][2]['description_short']) - ->setCellValue('T'.$i, $row['lang'][2]['description']) - ->setCellValue('U'.$i, $row['lang'][2]['description_more']) - ->setCellValue('V'.$i, $row['lang'][2]['videos']) - ->setCellValue('W'.$i, $row['lang'][2]['description_delivery']) - ->setCellValue('X'.$i, $row['weight']) - ->setCellValue('Y'.$i, '') - ->setCellValue('Z'.$i, '') - ->setCellValue('AA'.$i, $row['quantity']) - ->setCellValue('AB'.$i, $row['height']) - ->setCellValue('AC'.$i, $row['id_tax_rules_group']) - ->setCellValue('AD'.$i, $row['ppc']) - ->setCellValue('AE'.$i, '') - ->setCellValue('AF'.$i, $row['prix_ha']) - ->setCellValue('AG'.$i, Tools::ps_round($row['wholesale_price'], 2)) - ->setCellValue('AH'.$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('AI'.$i, '=IF(AF'.$i.'="","",(AF'.$i.'*1.85))') - ->setCellValue('AJ'.$i, $price2) - ->setCellValue('AK'.$i, '=IF(AND(AD'.$i.'="",AI'.$i.'=""),"",ROUND((1-AI'.$i.'/AD'.$i.')*100,4))') - ->setCellValue('AL'.$i, '=IF(AND(AF'.$i.'="",AI'.$i.'=""),"",1-AF'.$i.'/(AI'.$i.'/1.2))') - ->setCellValue('AM'.$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('AN'.$i, implode(', ', $images)) - ->setCellValue('AO'.$i, '=AA'.$i.'*AF'.$i) - ->setCellValue('AP'.$i, isset($row['nc8'])?$row['nc8']:"") - ->setCellValue('AQ'.$i, isset($row['id_country'])?$row['id_country']:"") - ->setCellValue('AR'.$i, date('d/m/Y',strtotime($sales[$id_categories[0]]))); - $this->objPHPExcel->setActiveSheetIndex(0)->getStyle('B'.$i.':AR'.$i.'')->applyFromArray($borders_style); + ->setCellValue('H'.$i, $row['name_attribute_ha']) + ->setCellValue('I'.$i, (isset($row['attribute_name'])?$row['attribute_name']:'')) + ->setCellValue('J'.$i, $row['name_ha']) + ->setCellValue('K'.$i, $row['lang'][2]['name']) + ->setCellValue('L'.$i, '=LEN(D'.$i.')') + ->setCellValue('M'.$i, (int)$row['position']) + ->setCellValue('N'.$i, $categories_title[2][0]) + ->setCellValue('O'.$i, $categories_title[2][1]) + ->setCellValue('P'.$i, $categories_title[2][2]) + ->setCellValue('Q'.$i, count($images)) + ->setCellValue('R'.$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']) + ->setCellValue('X'.$i, $row['lang'][2]['videos']) + ->setCellValue('Y'.$i, $row['lang'][2]['description_delivery']) + ->setCellValue('Z'.$i, $row['weight']) + ->setCellValue('AA'.$i, '') + ->setCellValue('AB'.$i, '') + ->setCellValue('AC'.$i, $row['quantity']) + ->setCellValue('AD'.$i, $row['height']) + ->setCellValue('AE'.$i, $row['id_tax_rules_group']) + ->setCellValue('AF'.$i, $row['ppc']) + ->setCellValue('AG'.$i, '') + ->setCellValue('AH'.$i, $row['prix_ha']) + ->setCellValue('AI'.$i, Tools::ps_round($row['wholesale_price'], 2)) + ->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(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('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,49 +323,51 @@ 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, '') ->setCellValue('G'.$i, '') - ->setCellValue('H'.$i, $row['name_ha']) + ->setCellValue('H'.$i, $row['name_attribute_ha']) ->setCellValue('I'.$i, '') - ->setCellValue('J'.$i, '=LEN(D'.$i.')') + ->setCellValue('J'.$i, $row['name_ha']) ->setCellValue('K'.$i, '') - ->setCellValue('L'.$i, '') + ->setCellValue('L'.$i, '=LEN(D'.$i.')') ->setCellValue('M'.$i, '') ->setCellValue('N'.$i, '') ->setCellValue('O'.$i, '') ->setCellValue('P'.$i, '') - ->setCellValue('Q'.$i, '=AM1 & "-" & P'.$i.' & "-" & LEFT(C'.$i.',9)') - ->setCellValue('R'.$i, '=IF(Q'.$i.'="","",LEN(Q'.$i.'))') - ->setCellValue('S'.$i, '') - ->setCellValue('T'.$i, '') + ->setCellValue('Q'.$i, '') + ->setCellValue('R'.$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, '') ->setCellValue('X'.$i, '') ->setCellValue('Y'.$i, '') ->setCellValue('Z'.$i, '') - ->setCellValue('AA'.$i, $row['quantity']) + ->setCellValue('AA'.$i, '') ->setCellValue('AB'.$i, '') - ->setCellValue('AC'.$i, '') - ->setCellValue('AD'.$i, $row['ppc']) + ->setCellValue('AC'.$i, $row['quantity']) + ->setCellValue('AD'.$i, '') ->setCellValue('AE'.$i, '') - ->setCellValue('AF'.$i, $row['prix_ha']) + ->setCellValue('AF'.$i, $row['ppc']) ->setCellValue('AG'.$i, '') - ->setCellValue('AH'.$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('AI'.$i, '=IF(AF'.$i.'="","",(AF'.$i.'*1.85))') - ->setCellValue('AJ'.$i, '') - ->setCellValue('AK'.$i, '=IF(AND(AD'.$i.'="",AI'.$i.'=""),"",ROUND((1-AI'.$i.'/AD'.$i.')*100,4))') - ->setCellValue('AL'.$i, '=IF(AND(AF'.$i.'="",AI'.$i.'=""),"",1-AF'.$i.'/(AI'.$i.'/1.2))') - ->setCellValue('AM'.$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('AN'.$i, '') - ->setCellValue('AO'.$i, '=AA'.$i.'*AF'.$i) + ->setCellValue('AH'.$i, $row['prix_ha']) + ->setCellValue('AI'.$i, '') + ->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(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, '') - ->setCellValue('AR'.$i, ''); - $this->objPHPExcel->setActiveSheetIndex(0)->getStyle('B'.$i.':AR'.$i.'')->applyFromArray($borders_style); + ->setCellValue('AQ'.$i, '=AC'.$i.'*AH'.$i) + ->setCellValue('AR'.$i, '') + ->setCellValue('AS'.$i, '') + ->setCellValue('AT'.$i, ''); + $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_ref']) @@ -364,51 +391,75 @@ class GenerateWp ->getNumberFormat() ->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER); $this->objPHPExcel->getActiveSheet() - ->getStyle('P5:P'.$lastLine) + ->getStyle('C5:C'.$lastLine) ->getNumberFormat() ->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_TEXT); $this->objPHPExcel->getActiveSheet() - ->getStyle('Z5:Z'.$lastLine) - ->getNumberFormat() - ->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_EUR_SIMPLE); - $this->objPHPExcel->getActiveSheet() - ->getStyle('AD5:AD'.$lastLine) - ->getNumberFormat() - ->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_EUR_SIMPLE); - $this->objPHPExcel->getActiveSheet() - ->getStyle('AE5:AE'.$lastLine) - ->getNumberFormat() - ->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_EUR_SIMPLE); - $this->objPHPExcel->getActiveSheet() - ->getStyle('AF5:AF'.$lastLine) - ->getNumberFormat() - ->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_EUR_SIMPLE); - $this->objPHPExcel->getActiveSheet() - ->getStyle('AG5:AG'.$lastLine) - ->getNumberFormat() - ->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_EUR_SIMPLE); - $this->objPHPExcel->getActiveSheet() - ->getStyle('AI5:AI'.$lastLine) - ->getNumberFormat() - ->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_EUR_SIMPLE); - $this->objPHPExcel->getActiveSheet() - ->getStyle('AJ5:AJ'.$lastLine) - ->getNumberFormat() - ->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_EUR_SIMPLE); - $this->objPHPExcel->getActiveSheet() - ->getStyle('AK5:AK'.$lastLine) + ->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); + $this->objPHPExcel->getActiveSheet() + ->getStyle('AF5:AF'.$lastLine) + ->getNumberFormat() + ->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_EUR); + $this->objPHPExcel->getActiveSheet() + ->getStyle('AG5:AG'.$lastLine) + ->getNumberFormat() + ->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_EUR); + $this->objPHPExcel->getActiveSheet() + ->getStyle('AH5:AH'.$lastLine) + ->getNumberFormat() + ->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_EUR); + $this->objPHPExcel->getActiveSheet() + ->getStyle('AI5:AI'.$lastLine) + ->getNumberFormat() + ->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_EUR); + $this->objPHPExcel->getActiveSheet() + ->getStyle('AK5:AK'.$lastLine) + ->getNumberFormat() + ->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_EUR); $this->objPHPExcel->getActiveSheet() ->getStyle('AL5:AL'.$lastLine) ->getNumberFormat() + ->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_EUR); + $this->objPHPExcel->getActiveSheet() + ->getStyle('AM5:AM'.$lastLine) + ->getNumberFormat() + ->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER); + $this->objPHPExcel->getActiveSheet() + ->getStyle('AN5:AN'.$lastLine) + ->getNumberFormat() ->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_PERCENTAGE_00); $this->objPHPExcel->getActiveSheet() - ->getStyle('AO5:AO'.$lastLine) + ->getStyle('AQ5:AQ'.$lastLine) ->getNumberFormat() - ->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_EUR_SIMPLE); + ->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_EUR); $this->objPHPExcel->getActiveSheet() - ->getStyle('AR5:AR'.$lastLine) + ->getStyle('AQ5:AQ'.$lastLine) + ->getAlignment() + ->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER); + $this->objPHPExcel->getActiveSheet() + ->getStyle('AT5:AT'.$lastLine) ->getNumberFormat() ->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_DATE_DDMMYYYY); @@ -417,24 +468,6 @@ class GenerateWp ->getStyle('B5:B'.$lastLine) ->getNumberFormat() ->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER); - // $this->objPHPExcel->setActiveSheetIndex(0); - // foreach ($this->columns as $col => $value) { - // for($row = 5; $row <= count($params['lines']); ++$row) { - // if ((!is_null($formula = $this->objPHPExcel->getActiveSheet()->getCell($col.$row)->getValue())) && - // ($formula[0] == '=')) { - // $this->objPHPExcel->getActiveSheet()->getCell($col.$row)->getCalculatedValue(); - // } - // } - // } - // $this->objPHPExcel->setActiveSheetIndex(1); - // foreach ($this->columns_es as $col => $value) { - // for($row = 5; $row <= count($params['lines']); ++$row) { - // if ((!is_null($formula = $this->objPHPExcel->getActiveSheet()->getCell($col.$row)->getValue())) && - // ($formula[0] == '=')) { - // $this->objPHPExcel->getActiveSheet()->getCell($col.$row)->getCalculatedValue(); - // } - // } - // } $this->objPHPExcel->setActiveSheetIndex(0); $this->objWriter = PHPExcel_IOFactory::createWriter($this->objPHPExcel, 'Excel2007'); } 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();