Merge branch 'ticket-simplemulti_bdc' into develop
This commit is contained in:
commit
1bfd79afb9
@ -86,6 +86,8 @@ class MakeStats {
|
|||||||
public static function getArrayLines($lines, $by_product_price = false, $id_sale = 0)
|
public static function getArrayLines($lines, $by_product_price = false, $id_sale = 0)
|
||||||
{
|
{
|
||||||
$arrayTmp = array();
|
$arrayTmp = array();
|
||||||
|
$all_multi = array();
|
||||||
|
$all_m1 = array();
|
||||||
$g = 0;
|
$g = 0;
|
||||||
|
|
||||||
if ($id_sale && (int)$id_sale>2) {
|
if ($id_sale && (int)$id_sale>2) {
|
||||||
@ -109,9 +111,10 @@ class MakeStats {
|
|||||||
foreach ($ids as $key => $id) {
|
foreach ($ids as $key => $id) {
|
||||||
$ids_od[] = (int)$id['id_order'];
|
$ids_od[] = (int)$id['id_order'];
|
||||||
}
|
}
|
||||||
$all_multi = $sale->getMultiForStats($ids_od, 3);
|
//$all_multi = $sale->getMultiForStats($ids_od, 3);
|
||||||
|
//$all_m2 = $sale->getMultiForStats($ids_od, 2, true);
|
||||||
|
$all_multi = $sale->getMultiForStats($ids_od, 2);
|
||||||
$all_m1 = $sale->getMultiForStats($ids_od, 1, true);
|
$all_m1 = $sale->getMultiForStats($ids_od, 1, true);
|
||||||
$all_m2 = $sale->getMultiForStats($ids_od, 2, true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach($lines as $line)
|
foreach($lines as $line)
|
||||||
@ -154,7 +157,7 @@ class MakeStats {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($id_sale && (int)$id_sale>2) {
|
if ($id_sale && (int)$id_sale>2) {
|
||||||
// multi (order contenant au moins 3 ventes differentes)
|
// multi (order contenant au moins 2 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;
|
||||||
} elseif (isset($arrayTmp[$line['product_id']][$line['product_attribute_id']]) && in_array($line['id_order'], $all_multi)) {
|
} elseif (isset($arrayTmp[$line['product_id']][$line['product_attribute_id']]) && in_array($line['id_order'], $all_multi)) {
|
||||||
@ -169,15 +172,15 @@ class MakeStats {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// multi 2 (order contenant uniquement 2 ventes)
|
// multi 2 (order contenant uniquement 2 ventes)
|
||||||
if(!isset($arrayTmp[$line['product_id']][$line['product_attribute_id']]['m2']) && in_array($line['id_order'], $all_m2)) {
|
/*if(!isset($arrayTmp[$line['product_id']][$line['product_attribute_id']]['m2']) && in_array($line['id_order'], $all_m2)) {
|
||||||
$arrayTmp[$line['product_id']][$line['product_attribute_id']]['m2'] = $quantity;
|
$arrayTmp[$line['product_id']][$line['product_attribute_id']]['m2'] = $quantity;
|
||||||
} elseif (isset($arrayTmp[$line['product_id']][$line['product_attribute_id']]['m2']) && in_array($line['id_order'], $all_m2)) {
|
} elseif (isset($arrayTmp[$line['product_id']][$line['product_attribute_id']]['m2']) && in_array($line['id_order'], $all_m2)) {
|
||||||
$arrayTmp[$line['product_id']][$line['product_attribute_id']]['m2'] += $quantity;
|
$arrayTmp[$line['product_id']][$line['product_attribute_id']]['m2'] += $quantity;
|
||||||
}
|
}*/
|
||||||
|
|
||||||
// multi 1 + multi 2 (produit dans order contenant uniquement 1 vente et order contenant 2 ventes)
|
// multi 1 + multi 2 (produit dans order contenant uniquement 1 vente et order contenant 2 ventes)
|
||||||
$arrayTmp[$line['product_id']][$line['product_attribute_id']]['m1_m2'] = $arrayTmp[$line['product_id']][$line['product_attribute_id']]['m1'] + $arrayTmp[$line['product_id']][$line['product_attribute_id']]['m2'];
|
// $arrayTmp[$line['product_id']][$line['product_attribute_id']]['m1_m2'] = $arrayTmp[$line['product_id']][$line['product_attribute_id']]['m1'] + $arrayTmp[$line['product_id']][$line['product_attribute_id']]['m2'];
|
||||||
$arrayTmp[$line['product_id']][$line['product_attribute_id']]['total_m'] = $arrayTmp[$line['product_id']][$line['product_attribute_id']]['m1_m2'] + $arrayTmp[$line['product_id']][$line['product_attribute_id']]['multi'];
|
$arrayTmp[$line['product_id']][$line['product_attribute_id']]['total_m'] = $arrayTmp[$line['product_id']][$line['product_attribute_id']]['m1'] + $arrayTmp[$line['product_id']][$line['product_attribute_id']]['multi'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $lines = $arrayTmp;
|
return $lines = $arrayTmp;
|
||||||
|
@ -307,7 +307,8 @@ if(Tools::getValue('action') == 'getOrderForm' && ( ( $id_category = Tools::getV
|
|||||||
$letter_product_name = 'C';
|
$letter_product_name = 'C';
|
||||||
$letter_product_attribute_name = 'D';
|
$letter_product_attribute_name = 'D';
|
||||||
$letter_product_ht = 'E';
|
$letter_product_ht = 'E';
|
||||||
$letter_product_M1_M2 = 'F';
|
//$letter_product_M1_M2 = 'F';
|
||||||
|
$letter_product_M1 = 'F';
|
||||||
$letter_product_multi = 'G';
|
$letter_product_multi = 'G';
|
||||||
|
|
||||||
$letter_product_colisage = 'H';
|
$letter_product_colisage = 'H';
|
||||||
@ -359,7 +360,8 @@ if(Tools::getValue('action') == 'getOrderForm' && ( ( $id_category = Tools::getV
|
|||||||
$letter_product_name = 'C';
|
$letter_product_name = 'C';
|
||||||
//$letter_product_attribute_name = 'D';
|
//$letter_product_attribute_name = 'D';
|
||||||
$letter_product_ht = 'D';
|
$letter_product_ht = 'D';
|
||||||
$letter_product_M1_M2 = 'E';
|
/*$letter_product_M1_M2 = 'E';*/
|
||||||
|
$letter_product_M1 = 'E';
|
||||||
$letter_product_multi = 'F';
|
$letter_product_multi = 'F';
|
||||||
|
|
||||||
$letter_product_colisage = 'G';
|
$letter_product_colisage = 'G';
|
||||||
@ -711,10 +713,10 @@ if(Tools::getValue('action') == 'getOrderForm' && ( ( $id_category = Tools::getV
|
|||||||
$activeSheet->getStyle($letter_product_ht.$i)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
|
$activeSheet->getStyle($letter_product_ht.$i)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
|
||||||
$activeSheet->getStyle($letter_product_ht.$i)->applyFromArray($borders_style);
|
$activeSheet->getStyle($letter_product_ht.$i)->applyFromArray($borders_style);
|
||||||
|
|
||||||
$activeSheet->setCellValue($letter_product_M1_M2.$i, 'M1+M2');
|
$activeSheet->setCellValue($letter_product_M1.$i, 'M1');
|
||||||
$activeSheet->getStyle($letter_product_M1_M2.$i)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
|
$activeSheet->getStyle($letter_product_M1.$i)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
|
||||||
$activeSheet->getStyle($letter_product_M1_M2.$i)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
|
$activeSheet->getStyle($letter_product_M1.$i)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
|
||||||
$activeSheet->getStyle($letter_product_M1_M2.$i)->applyFromArray($borders_style);
|
$activeSheet->getStyle($letter_product_M1.$i)->applyFromArray($borders_style);
|
||||||
|
|
||||||
$activeSheet->setCellValue($letter_product_multi.$i, 'Multi');
|
$activeSheet->setCellValue($letter_product_multi.$i, 'Multi');
|
||||||
$activeSheet->getStyle($letter_product_multi.$i)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
|
$activeSheet->getStyle($letter_product_multi.$i)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
|
||||||
@ -885,8 +887,8 @@ if(Tools::getValue('action') == 'getOrderForm' && ( ( $id_category = Tools::getV
|
|||||||
|
|
||||||
$activeSheet->setCellValue($letter_product_multi.$i, (isset($values['multi']))?$values['multi']:0);
|
$activeSheet->setCellValue($letter_product_multi.$i, (isset($values['multi']))?$values['multi']:0);
|
||||||
$activeSheet->getStyle($letter_product_multi.$i)->applyFromArray($borders_style);
|
$activeSheet->getStyle($letter_product_multi.$i)->applyFromArray($borders_style);
|
||||||
$activeSheet->setCellValue($letter_product_M1_M2.$i, (isset($values['m1_m2']))?$values['m1_m2']:0);
|
$activeSheet->setCellValue($letter_product_M1.$i, (isset($values['m1']))?$values['m1']:0);
|
||||||
$activeSheet->getStyle($letter_product_M1_M2.$i)->applyFromArray($borders_style);
|
$activeSheet->getStyle($letter_product_M1.$i)->applyFromArray($borders_style);
|
||||||
|
|
||||||
// colonnes vide - a remplir par 3BTK
|
// colonnes vide - a remplir par 3BTK
|
||||||
//$activeSheet->setCellValue($letter_product_colisage.$i, 0);
|
//$activeSheet->setCellValue($letter_product_colisage.$i, 0);
|
||||||
@ -896,7 +898,7 @@ if(Tools::getValue('action') == 'getOrderForm' && ( ( $id_category = Tools::getV
|
|||||||
//$activeSheet->setCellValue($letter_product_missing.$i, 0);
|
//$activeSheet->setCellValue($letter_product_missing.$i, 0);
|
||||||
$activeSheet->getStyle($letter_product_missing.$i)->applyFromArray($borders_style);
|
$activeSheet->getStyle($letter_product_missing.$i)->applyFromArray($borders_style);
|
||||||
|
|
||||||
$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.$i.'+'.$letter_product_multi.$i.'+'.$letter_product_colisage.$i.'-'.$letter_product_stock3btk.$i.'-'.$letter_product_missing.$i);
|
||||||
$activeSheet->getStyle($letter_product_total_qty.$i)->applyFromArray($borders_style);
|
$activeSheet->getStyle($letter_product_total_qty.$i)->applyFromArray($borders_style);
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
@ -1125,9 +1127,9 @@ if(Tools::getValue('action') == 'getOrderForm' && ( ( $id_category = Tools::getV
|
|||||||
$activeSheet->getStyle($letter_product_multi.$i)->getFont()->setBold(true);
|
$activeSheet->getStyle($letter_product_multi.$i)->getFont()->setBold(true);
|
||||||
$activeSheet->getStyle($letter_product_multi.$i)->applyFromArray($borders_style);
|
$activeSheet->getStyle($letter_product_multi.$i)->applyFromArray($borders_style);
|
||||||
|
|
||||||
$activeSheet->SetCellValue($letter_product_M1_M2.$i, '=SUM('.$letter_product_M1_M2.($iOri).':'.$letter_product_M1_M2.($i-1).')');
|
$activeSheet->SetCellValue($letter_product_M1.$i, '=SUM('.$letter_product_M1.($iOri).':'.$letter_product_M1.($i-1).')');
|
||||||
$activeSheet->getStyle($letter_product_M1_M2.$i)->getFont()->setBold(true);
|
$activeSheet->getStyle($letter_product_M1.$i)->getFont()->setBold(true);
|
||||||
$activeSheet->getStyle($letter_product_M1_M2.$i)->applyFromArray($borders_style);
|
$activeSheet->getStyle($letter_product_M1.$i)->applyFromArray($borders_style);
|
||||||
|
|
||||||
$activeSheet->SetCellValue($letter_product_colisage.$i, '=SUM('.$letter_product_colisage.($iOri).':'.$letter_product_colisage.($i-1).')');
|
$activeSheet->SetCellValue($letter_product_colisage.$i, '=SUM('.$letter_product_colisage.($iOri).':'.$letter_product_colisage.($i-1).')');
|
||||||
$activeSheet->getStyle($letter_product_colisage.$i)->getFont()->setBold(true);
|
$activeSheet->getStyle($letter_product_colisage.$i)->getFont()->setBold(true);
|
||||||
@ -1151,7 +1153,7 @@ if(Tools::getValue('action') == 'getOrderForm' && ( ( $id_category = Tools::getV
|
|||||||
}
|
}
|
||||||
$activeSheet->getColumnDimension($letter_product_ht)->setWidth(13);
|
$activeSheet->getColumnDimension($letter_product_ht)->setWidth(13);
|
||||||
$activeSheet->getColumnDimension($letter_product_multi)->setWidth(13);
|
$activeSheet->getColumnDimension($letter_product_multi)->setWidth(13);
|
||||||
$activeSheet->getColumnDimension($letter_product_M1_M2)->setWidth(13);
|
$activeSheet->getColumnDimension($letter_product_M1)->setWidth(13);
|
||||||
$activeSheet->getColumnDimension($letter_product_colisage)->setWidth(13);
|
$activeSheet->getColumnDimension($letter_product_colisage)->setWidth(13);
|
||||||
$activeSheet->getColumnDimension($letter_product_stock3btk)->setWidth(13);
|
$activeSheet->getColumnDimension($letter_product_stock3btk)->setWidth(13);
|
||||||
$activeSheet->getColumnDimension($letter_product_missing)->setWidth(13);
|
$activeSheet->getColumnDimension($letter_product_missing)->setWidth(13);
|
||||||
|
@ -183,8 +183,12 @@ class ParentOrderController extends ParentOrderControllerCore {
|
|||||||
$carriers_ah[] = $carrier;
|
$carriers_ah[] = $carrier;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// fix a check !
|
||||||
|
if (count($carriers_ah) > 0) {
|
||||||
unset($carriers);
|
unset($carriers);
|
||||||
$carriers = $carriers_ah;
|
$carriers = $carriers_ah;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user