| } | } | ||||
| } | } | ||||
| }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']; |