Merge branch 'ticket-9791' into develop

This commit is contained in:
Marion Muszynski 2016-04-06 17:32:58 +02:00
commit 9d12fd401d
2 changed files with 10 additions and 14 deletions

View File

@ -88,7 +88,7 @@ class MakeStats {
$arrayTmp = array(); $arrayTmp = array();
$g = 0; $g = 0;
if ($id_sale>2) { if ($id_sale && (int)$id_sale>2) {
$sale = new Sale((int) $id_sale); $sale = new Sale((int) $id_sale);
$id_products = $sale->getProducts(); $id_products = $sale->getProducts();
@ -153,7 +153,7 @@ class MakeStats {
$arrayTmp[$line['product_id']][$line['product_attribute_id']]['stock'] = $stock; $arrayTmp[$line['product_id']][$line['product_attribute_id']]['stock'] = $stock;
} }
if ($id_sale>2) { if ($id_sale && (int)$id_sale>2) {
// multi (order contenant au moins 3 ventes differentes) // multi (order contenant au moins 3 ventes differentes)
if(!isset($arrayTmp[$line['product_id']][$line['product_attribute_id']]['multi']) && in_array($line['id_order'], $all_multi)) { if(!isset($arrayTmp[$line['product_id']][$line['product_attribute_id']]['multi']) && in_array($line['id_order'], $all_multi)) {
$arrayTmp[$line['product_id']][$line['product_attribute_id']]['multi'] = $quantity; $arrayTmp[$line['product_id']][$line['product_attribute_id']]['multi'] = $quantity;

View File

@ -151,11 +151,12 @@ if(Tools::getValue('action') == 'getOrderForm' && ( ( $id_category = Tools::getV
$order_states = explode(',', Configuration::get('PS_IT_OF_ORDER_STATES')); $order_states = explode(',', Configuration::get('PS_IT_OF_ORDER_STATES'));
$lines = MakeStats::getOrdersByIdsProduct(array_keys($arrayProduct), $order_states, $date_from->getDate('SQL'), $date_to->getDate('SQL'));
// adding - fev 2016 // adding - fev 2016
if ($type == 2 || $type == 4) { if ($type == 2 || $type == 4) {
$lines = MakeStats::getDetailsByIdsProduct(array_keys($arrayProduct), $order_states, $date_from->getDate('SQL'), $date_to->getDate('SQL')); $lines = MakeStats::getDetailsByIdsProduct(array_keys($arrayProduct), $order_states, $date_from->getDate('SQL'), $date_to->getDate('SQL'));
} else {
$lines = MakeStats::getOrdersByIdsProduct(array_keys($arrayProduct), $order_states, $date_from->getDate('SQL'), $date_to->getDate('SQL'));
} }
// end adding // end adding
@ -814,20 +815,15 @@ if(Tools::getValue('action') == 'getOrderForm' && ( ( $id_category = Tools::getV
$activeSheet->setCellValue($letter_product_ht.$i, (float)$wholesale_price ); $activeSheet->setCellValue($letter_product_ht.$i, (float)$wholesale_price );
$activeSheet->getStyle($letter_product_ht.$i)->getNumberFormat()->setFormatCode( PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_EUR ); $activeSheet->getStyle($letter_product_ht.$i)->getNumberFormat()->setFormatCode( PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_EUR );
if (isset($values['multi'])) { $activeSheet->setCellValue($letter_product_multi.$i, (isset($values['multi']))?$values['multi']:0);
$activeSheet->setCellValue($letter_product_multi.$i, $values['multi']); $activeSheet->setCellValue($letter_product_M1_M2.$i, (isset($values['m1_m2']))?$values['m1_m2']:0);
}
if (isset($values['m1_m2'])) {
$activeSheet->setCellValue($letter_product_M1_M2.$i, $values['m1_m2']);
}
// colonnes vide // colonnes vide
// $activeSheet->setCellValue($letter_product_colisage.$i, ''); $activeSheet->setCellValue($letter_product_colisage.$i, 0);
// $activeSheet->setCellValue($letter_product_stock3btk.$i, ''); $activeSheet->setCellValue($letter_product_stock3btk.$i, 0);
// $activeSheet->setCellValue($letter_product_missing.$i, ''); $activeSheet->setCellValue($letter_product_missing.$i, 0);
$activeSheet->setCellValue($letter_product_total_qty.$i, '='.$letter_product_M1_M2.$i.'+'.$letter_product_multi.$i.'+'.$letter_product_colisage.$i.'-'.$letter_product_stock3btk.$i.'-'.$letter_product_missing.$i); $activeSheet->setCellValue($letter_product_total_qty.$i, '='.$letter_product_M1_M2.$i.'+'.$letter_product_multi.$i.'+'.$letter_product_colisage.$i.'-'.$letter_product_stock3btk.$i.'-'.$letter_product_missing.$i);
$activeSheet->getStyle($letter_product_total.$i)->getNumberFormat()->setFormatCode( PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_EUR );
$i++; $i++;
} }
@ -949,7 +945,7 @@ if(Tools::getValue('action') == 'getOrderForm' && ( ( $id_category = Tools::getV
break; break;
} }
if ($type = 4) { if ($type == 4) {
$activeSheet->getColumnDimension($firstColumn)->setWidth(10); $activeSheet->getColumnDimension($firstColumn)->setWidth(10);
$activeSheet->getColumnDimension($letter_product_ref_interne)->setWidth(25); $activeSheet->getColumnDimension($letter_product_ref_interne)->setWidth(25);