瀏覽代碼

edit claim

ifah
Siti Hajar Ibrahim 5 年之前
父節點
當前提交
906642b77c
共有 1 個檔案被更改,包括 120 行新增7 行删除
  1. 120
    7
      app/Http/Controllers/DS/DealerController.php

+ 120
- 7
app/Http/Controllers/DS/DealerController.php 查看文件

if($year!='null' && $month!='null' && $app=='null'){ if($year!='null' && $month!='null' && $app=='null'){


$count_cyberjaya = array(); $count_jasin = array(); $count_ayerKeroh = array(); $count_alorGajah = array(); $count_menglembu = array(); $count_ipoh = array(); $count_cyberjaya = array(); $count_jasin = array(); $count_ayerKeroh = array(); $count_alorGajah = array(); $count_menglembu = array(); $count_ipoh = array();
$extra = 0; $basic_total = 0; $countAugust = array(); $finalprice = 0;
$extra = 0; $basic_total = 0; $countAugustR = array(); $countAugustB = array(); $finalprice = 0;


// if(($year == '2019' || $year == '2020') && ($month == '12' || $month == '01')){ // if(($year == '2019' || $year == '2020') && ($month == '12' || $month == '01')){
// $dataDis = $this->returnDataR($company,'2019','12'); // $dataDis = $this->returnDataR($company,'2019','12');
} }
}else if($year == '2020' && ($month == '08' || $month == '09' || $month == '10')){ }else if($year == '2020' && ($month == '08' || $month == '09' || $month == '10')){
$dataAugust = $this->returnDataR($company,'2020','8');
$dataAugustR = $this->returnDataR($company,'2020','8');
$dataAugustB = $this->returnDataB($company,'2020','8');
$dataSeptember = $this->returnDataR($company,'2020','9'); $dataSeptember = $this->returnDataR($company,'2020','9');
$dataOctober = $this->returnDataR($company,'2020','10'); $dataOctober = $this->returnDataR($company,'2020','10');
foreach ($dataAugust as $key => $d) {
foreach ($dataAugustR as $key => $d) {
if(date('d/m/Y', strtotime($d['activation'])) >= '11/8/2020'){ if(date('d/m/Y', strtotime($d['activation'])) >= '11/8/2020'){
$countAugust[] = $d;
$countAugustR[] = $d;
} }
} }
// Store to combineData New Incentive August // Store to combineData New Incentive August
foreach ($countAugust as $key => $d) {
if(count($countAugust) >= 50){
foreach ($countAugustR as $key => $d) {
if(count($countAugustR) >= 50){
if(date('m/Y', strtotime($d['activation'])) == $month.'/'.$year){ if(date('m/Y', strtotime($d['activation'])) == $month.'/'.$year){
if($d['contract'] == '12'){ if($d['contract'] == '12'){
array_push($combineData, array( array_push($combineData, array(
)); ));
} }
} }
}else if(count($countAugust) < 50){
}else if(count($countAugustR) < 50){
if(date('m/Y', strtotime($d['activation'])) == $month.'/'.$year){ if(date('m/Y', strtotime($d['activation'])) == $month.'/'.$year){
if($d['contract'] == '12'){ if($d['contract'] == '12'){
array_push($combineData, array( array_push($combineData, array(
} }
} }
} }

foreach ($dataAugustB as $key => $d) {
if(date('d/m/Y', strtotime($d['activation'])) >= '11/8/2020'){
$countAugustB[] = $d;
}
}
// Store to combineData New Incentive August
foreach ($countAugustB as $key => $d) {
if(count($countAugustB) >= 50){
if(date('m/Y', strtotime($d['activation'])) == $month.'/'.$year){
if($d['contract'] == '12'){
array_push($combineData, array(
'index' => $d['index'],
'contract' => $d['contract'],
'wo' => $d['wo'],
'activation' => $d['activation'],
'name' => $d['name'],
'address' => $d['address'],
'package' => $d['package'],
'retail_price' => $d['retail_price'],
'incentives1' => $d['incentives1'],
'incentives2' => $d['incentives2'],
'total' => $d['total'],
'claim' => $d['claim'],
));

}else {
if ($d['package']== 50){
$finalprice = 89;
$total = number_format(89 * 2.5 + 50, 2);
} elseif ($d['package']== 100){
$finalprice = 119;
$total = number_format(119 * 2.5 + 50, 2);
} elseif ($d['package']== 300){
$finalprice = 179;
$total = number_format(179 * 2.5 + 50, 2);
} elseif ($d['package']== 500){
$finalprice = 249;
$total = number_format(249 * 2.5 + 50, 2);
} else{
$total = number_format(floatval(str_replace("RM ", "" , $d['retail_price'])) * 2.5 + 50, 2);
$finalprice = number_format(floatval(str_replace("RM ", "" , $d['retail_price'])), 2);
}
array_push($combineData, array(
'index' => $d['index'],
'contract' => $d['contract'],
'wo' => $d['wo'],
'activation' => $d['activation'],
'name' => $d['name'],
'address' => $d['address'],
'package' => $d['package'],
'retail_price' => 'RM '.$finalprice,
'incentives1' => '250% + RM50',
'incentives2' => $d['incentives2'],
'total' => 'RM '.$total,
'claim' => $d['claim'],
));
}
}
}else if(count($countAugustB) < 50){
if(date('m/Y', strtotime($d['activation'])) == $month.'/'.$year){
if($d['contract'] == '12'){
array_push($combineData, array(
'index' => $d['index'],
'contract' => $d['contract'],
'wo' => $d['wo'],
'activation' => $d['activation'],
'name' => $d['name'],
'address' => $d['address'],
'package' => $d['package'],
'retail_price' => $d['retail_price'],
'incentives1' => $d['incentives1'],
'incentives2' => $d['incentives2'],
'total' => $d['total'],
'claim' => $d['claim'],
));
}else {
if ($d['package']== 50){
$finalprice = 89;
$total = number_format(89 * 2.5, 2);
} elseif ($d['package']== 100){
$finalprice = 119;
$total = number_format(119 * 2.5, 2);
} elseif ($d['package']== 300){
$finalprice = 179;
$total = number_format(179 * 2.5, 2);
} elseif ($d['package']== 500){
$finalprice = 249;
$total = number_format(249 * 2.5, 2);
} else{
$total = number_format(floatval(str_replace("RM ", "" , $d['retail_price'])) * 2.5, 2);
$finalprice = number_format(floatval(str_replace("RM ", "" , $d['retail_price'])), 2);
}
array_push($combineData, array(
'index' => $d['index'],
'contract' => $d['contract'],
'wo' => $d['wo'],
'activation' => $d['activation'],
'name' => $d['name'],
'address' => $d['address'],
'package' => $d['package'],
'retail_price' => 'RM '.$finalprice,
'incentives1' => '250%',
'incentives2' => $d['incentives2'],
'total' => 'RM '.$total,
'claim' => $d['claim'],
));
}
}
}
}
}else{ }else{
$dataR = $this->returnDataR($company,$year,$month); $dataR = $this->returnDataR($company,$year,$month);

Loading…
取消
儲存