Merge branch 'ticket-9791' into develop
This commit is contained in:
commit
9d12fd401d
@ -88,7 +88,7 @@ class MakeStats {
|
||||
$arrayTmp = array();
|
||||
$g = 0;
|
||||
|
||||
if ($id_sale>2) {
|
||||
if ($id_sale && (int)$id_sale>2) {
|
||||
|
||||
$sale = new Sale((int) $id_sale);
|
||||
$id_products = $sale->getProducts();
|
||||
@ -153,7 +153,7 @@ class MakeStats {
|
||||
$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)
|
||||
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;
|
||||
|
@ -151,11 +151,12 @@ if(Tools::getValue('action') == 'getOrderForm' && ( ( $id_category = Tools::getV
|
||||
|
||||
$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
|
||||
if ($type == 2 || $type == 4) {
|
||||
$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
|
||||
|
||||
@ -814,20 +815,15 @@ if(Tools::getValue('action') == 'getOrderForm' && ( ( $id_category = Tools::getV
|
||||
$activeSheet->setCellValue($letter_product_ht.$i, (float)$wholesale_price );
|
||||
$activeSheet->getStyle($letter_product_ht.$i)->getNumberFormat()->setFormatCode( PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_EUR );
|
||||
|
||||
if (isset($values['multi'])) {
|
||||
$activeSheet->setCellValue($letter_product_multi.$i, $values['multi']);
|
||||
}
|
||||
if (isset($values['m1_m2'])) {
|
||||
$activeSheet->setCellValue($letter_product_M1_M2.$i, $values['m1_m2']);
|
||||
}
|
||||
$activeSheet->setCellValue($letter_product_multi.$i, (isset($values['multi']))?$values['multi']:0);
|
||||
$activeSheet->setCellValue($letter_product_M1_M2.$i, (isset($values['m1_m2']))?$values['m1_m2']:0);
|
||||
|
||||
// colonnes vide
|
||||
// $activeSheet->setCellValue($letter_product_colisage.$i, '');
|
||||
// $activeSheet->setCellValue($letter_product_stock3btk.$i, '');
|
||||
// $activeSheet->setCellValue($letter_product_missing.$i, '');
|
||||
$activeSheet->setCellValue($letter_product_colisage.$i, 0);
|
||||
$activeSheet->setCellValue($letter_product_stock3btk.$i, 0);
|
||||
$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->getStyle($letter_product_total.$i)->getNumberFormat()->setFormatCode( PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_EUR );
|
||||
|
||||
$i++;
|
||||
}
|
||||
@ -949,7 +945,7 @@ if(Tools::getValue('action') == 'getOrderForm' && ( ( $id_category = Tools::getV
|
||||
break;
|
||||
}
|
||||
|
||||
if ($type = 4) {
|
||||
if ($type == 4) {
|
||||
|
||||
$activeSheet->getColumnDimension($firstColumn)->setWidth(10);
|
||||
$activeSheet->getColumnDimension($letter_product_ref_interne)->setWidth(25);
|
||||
|
Loading…
Reference in New Issue
Block a user