Browse Source

update calculation incentives august

ifah
Siti Hajar Ibrahim 5 years ago
parent
commit
a76998328b
1 changed files with 1 additions and 4 deletions
  1. 1
    4
      app/Http/Controllers/DS/DealerController.php

+ 1
- 4
app/Http/Controllers/DS/DealerController.php View File

} }
} }
}else if(count($combineData) < 50){ }else if(count($combineData) < 50){
info(count($combineData));
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(
'total' => $d['total'], 'total' => $d['total'],
'claim' => $d['claim'], 'claim' => $d['claim'],
)); ));
info("12" . $d['wo']);
}else { }else {
$total = number_format(floatval(str_replace("RM ", "" , $d['retail_price'])) * 2.5, 2); $total = number_format(floatval(str_replace("RM ", "" , $d['retail_price'])) * 2.5, 2);
array_push($combineData, array( array_push($combineData, array(
'total' => 'RM '.$total, 'total' => 'RM '.$total,
'claim' => $d['claim'], 'claim' => $d['claim'],
)); ));
info("24" . $d['wo']);
} }
} }
} }
$nested_data = array(); $nested_data = array();
if(!empty($combineData)){ if(!empty($combineData)){
foreach ($combineData as $c){ foreach ($combineData as $c){
info($c['wo']);
$update_dealer = DealerClaim::where('wo',$c['wo'])->first(); $update_dealer = DealerClaim::where('wo',$c['wo'])->first();
if(!empty($update_dealer)){ if(!empty($update_dealer)){
$update_dealer->incentives1 = $c['incentives1']; $update_dealer->incentives1 = $c['incentives1'];

Loading…
Cancel
Save