| @@ -109,13 +109,8 @@ class CustomerController extends Controller | |||
| } | |||
| if(!empty($form)){ | |||
| info('not empty form'); | |||
| foreach ($form as $key => $f) { | |||
| info('loop'); | |||
| info($key); | |||
| info($f); | |||
| if(empty($f->WorkOrder)){ | |||
| info('empty work order'); | |||
| $i++; | |||
| $n1 = ''; | |||
| @@ -135,19 +130,15 @@ class CustomerController extends Controller | |||
| }else{ | |||
| $labelD = ""; | |||
| } | |||
| info('entry not empty subscriber'); | |||
| if(!empty($f->Subscriber)){ | |||
| info('not empty subscriber'); | |||
| if($f->Subscriber->street != ''){ | |||
| $street = $f->Subscriber->street; | |||
| } | |||
| $wo = ''; | |||
| if($f->status_email == 'verified'){ | |||
| info('status email verified'); | |||
| $work_order = ''; | |||
| if($f->type_application == 'R'){ | |||
| info('type application R'); | |||
| do { | |||
| $work_order = 'WO-'.$this->createWorkID(4); | |||
| @@ -162,16 +153,12 @@ class CustomerController extends Controller | |||
| } | |||
| }else if($f->type_application == 'B'){ | |||
| info('type application B'); | |||
| do { | |||
| info('init loop'); | |||
| $work_order = 'WO-'.$this->createWorkID(4); | |||
| } while (WorkOrder::where("wo", "=", $work_order)->first() instanceof WorkOrder); | |||
| info('exit loop'); | |||
| $wo = $work_order.'/'.$f->Subscriber->subscriber_id; | |||
| $cov = Coverage::where('building_name',$f->Subscriber->building_name)->where('Type','B')->first(); | |||
| if(!empty($cov)){ | |||
| info('not empty coverage'); | |||
| if($cov->status_building == 'non prelaid'){ | |||
| $wo = 'Non/'.$work_order.'/'.$f->Subscriber->subscriber_id; | |||
| } | |||
| @@ -217,7 +204,6 @@ class CustomerController extends Controller | |||
| }else if($f->PackageDetail->voice_fee == ''){ | |||
| $nP = '-'; | |||
| } | |||
| info('before array push'); | |||
| array_push($nested_data, array( | |||
| 'formT' => $n1.$i.$f->type_application, | |||
| 'type' => $f->type_service, | |||