| }else{ | }else{ | ||||
| $labelD = ""; | $labelD = ""; | ||||
| } | } | ||||
| $amount_claim = $f->Subscriber->DealerClaim['total_claim']; | |||||
| if(!empty($f->Subscriber) && !empty($f->PackageDetail)){ | if(!empty($f->Subscriber) && !empty($f->PackageDetail)){ | ||||
| if($f->type_application == 'R'){ | if($f->type_application == 'R'){ | ||||
| $address = $f->Subscriber->postcode. ' , '.$f->Subscriber->city. ' , '.$f->Subscriber->state; | $address = $f->Subscriber->postcode. ' , '.$f->Subscriber->city. ' , '.$f->Subscriber->state; | ||||
| } | } | ||||
| $woD = '-'; $woId = 'none'; $natureWork = ''; $doId = ''; $woRate=""; | |||||
| $woD = '-'; $woId = 'none'; $natureWork = ''; $doId = ''; $woRate=""; $amount_claim=""; | |||||
| if(!empty($f->WorkOrder)){ | if(!empty($f->WorkOrder)){ | ||||
| $woId = $f->WorkOrder->wo; | $woId = $f->WorkOrder->wo; | ||||
| $natureWork = $f->WorkOrder->nature_work; | $natureWork = $f->WorkOrder->nature_work; | ||||
| if(!empty($f->WorkOrder->Docket)){ | if(!empty($f->WorkOrder->Docket)){ | ||||
| $woD = $f->WorkOrder->Docket->end_job; | $woD = $f->WorkOrder->Docket->end_job; | ||||
| $woRate = $f->WorkOrder->Docket->Rating1; | $woRate = $f->WorkOrder->Docket->Rating1; | ||||
| $amount_claim = DealerClaim::with(['Subscriber' => function($q) { | |||||
| $q->with('Form'); | |||||
| }],'Staff')->where('wo', $woId)->get(); | |||||
| // array_push($result,array( | // array_push($result,array( | ||||
| // 'type_application' => $f->type_application, | // 'type_application' => $f->type_application, | ||||
| // "type_service" => $f->type_service, | // "type_service" => $f->type_service, | ||||
| "Service Type" => $natureWork, | "Service Type" => $natureWork, | ||||
| "Building"=>$building, | "Building"=>$building, | ||||
| "Rating" => $woRate, | "Rating" => $woRate, | ||||
| "Claim Amount" => $amount_claim, | |||||
| "Claim Amount" => $amount_claim->total_claim, | |||||
| )); | )); | ||||
| } | } | ||||