| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500 |
- <?php
-
- namespace App\Http\Controllers\v3\Api;
-
- use Illuminate\Http\Request;
- use App\Http\Controllers\v3\Api\BaseController;
-
- use File;
- use Carbon\Carbon;
-
- use App\LatestModel\Staff;
- use App\LatestModel\StaffDetail;
- use App\LatestModel\Module\Form;
- use App\LatestModel\Module\FormStatus;
- use App\LatestModel\Module\Subscriber;
- use App\LatestModel\Module\WorkOrder;
- use App\LatestModel\Module\Docket;
- use App\LatestModel\Module\PackageDetail;
- use App\LatestModel\Module\Company;
- use App\LatestModel\Module\Coverage;
- use App\LatestModel\Module\Product;
-
- class WorkOrderController extends BaseController
- {
-
- /**
- * View PDF
- *
- * @return json
- */
- public function viewWorkOrderPDF(Request $request){
-
- $wo = WorkOrder::where('wo',$request->id)->first();
- if(!empty($wo)){
- $form = Form::with('PackageDetail','Subscriber')->where('_id',$wo->_id)->first();
- if(!empty($form->Subscriber) && !empty($form->PackageDetail)){
- return $this->sendResponse($form, '/v3/main/work-order-pdf/'.$request->id);
- }else{
- return $this->sendError('Package or subscriber not exist!', '');
- }
- }else{
- return $this->sendError('Work order not exist!', '');
- }
- }
-
- /**
- * Reset Work Order
- *
- * @return json
- */
- public function resetWorkOrder(Request $request){
-
- $wo = WorkOrder::where('wo',$request->id)->first();
- if(!empty($wo)){
- $docket = Docket::where('work_order_id', $request->id)->first();
- if(!empty($docket)){
- $docket->forceDelete();
- $wo->docket_id = '';
- $wo->status = 'Pending Contractor';
- $wo->save();
-
- $form = Form::where('_id', $wo->_id)->first();
- if(!empty($form)){
- $formH = new FormStatus;
- $formH->form_id = $form->_id;
- $formH->status_id = 17;
- $formH->date = new \MongoDB\BSON\UTCDateTime(time()*1000);
- $formH->status = 'Reset Work Order';
- $formH->desc = 'This work order has been reset by customer service';
- $form->formstatus()->save($formH);
- }
- return $this->sendResponse($wo, 'Success Reset Work Order. You can check work order under category Pending Contractor');
- }else{
- return $this->sendError('Docket not exist!', '');
- }
- }else{
- return $this->sendError('Work order not exist!', '');
- }
- }
-
- /**
- * Delete Work Order
- *
- * @return json
- */
- public function deleteWorkOrder(Request $request){
-
- $wo = WorkOrder::where('wo',$request->id)->first();
- if(!empty($wo)){
- $wo->forceDelete();
- return $this->sendResponse($wo, 'Success Delete Work Order. You can access the form in customer tab under application form and re-assign work order again');
- }else{
- return $this->sendError('Work order not exist!', '');
- }
- }
-
- /**
- * Get Work Order Controlelr
- *
- * @return json
- */
- public function getWorkOrderData($status,$company_id,$startdate,$enddate,$type_work,$package,$building,$dealer){
-
- if($status == 'pending-contractor'){
- $status = 'Pending Contractor';
- }else if($status == 'pending-installer'){
- $status = 'Pending Installer';
- }else if($status == 'pending-non-prelaid'){
- $status = 'Pending Non Prelaid';
- }else if($status == 'success-non-prelaid'){
- $status = 'Success Non Prelaid';
- }else if($status == 'reschedule'){
- $status = 'Reschedule';
- }else if($status == 'suspend'){
- $status = 'Suspend';
- }else if($status == 'completed'){
- $status = 'Completed';
- }else if($status == 'cancelled'){
- $status = 'Cancelled';
- }
-
- if($startdate == '-' && $enddate == '-'){
- if($company_id == 'null'){
- if($package == 'null' && $dealer == 'null'){
- $wo = WorkOrder::with(['Form' => function($q) {
- $q->with('Subscriber','PackageDetail')->with('Company');
- }])->with('Company','Docket')->with(['Staff' => function($w){
- $w->with('StaffDetail');
- }])->orderBy('dateTimeStart', 'DESC')->where('status',$status)->get();
- }else if($package == 'null' && $dealer != 'null'){
- $wo = WorkOrder::with(['Form' => function($q) use($dealer){
- $q->with('Subscriber','PackageDetail')->with('Company')->where('company_id', $dealer);
- }])->with('Company')->with(['Staff' => function($w){
- $w->with('StaffDetail');
- }])->orderBy('dateTimeStart', 'DESC')->where('status',$status)->get();
- }else if($package == 'R' && $building == 'null' && $dealer == 'null'){
- $wo = WorkOrder::with(['Form' => function($q) use($package){
- $q->with('Subscriber','PackageDetail')->with('Company')->where('type_application', $package);
- }])->with('Company')->with(['Staff' => function($w){
- $w->with('StaffDetail');
- }])->orderBy('dateTimeStart', 'DESC')->where('status',$status)->get();
- }else if($package == 'R' && $building == 'null' && $dealer != 'null'){
- $wo = WorkOrder::with(['Form' => function($q) use($package,$dealer){
- $q->with('Subscriber','PackageDetail')->with('Company')->where('type_application', $package)->where('company_id', $dealer);
- }])->with('Company')->with(['Staff' => function($w){
- $w->with('StaffDetail');
- }])->orderBy('dateTimeStart', 'DESC')->where('status',$status)->get();
- }else if($package == 'R' && $building != 'null' && $dealer == 'null'){
- $wo = WorkOrder::with(['Form' => function($q) use($package,$building){
- $q->with(['Subscriber' => function($q) use($building) {
- $q->where('building_name', $building);
- }],'PackageDetail')->with('Company')->where('type_application', $package);
- }])->with('Company')->with(['Staff' => function($w){
- $w->with('StaffDetail');
- }])->orderBy('dateTimeStart', 'DESC')->where('status',$status)->get();
- }else if($package == 'R' && $building != 'null' && $dealer != 'null'){
- $wo = WorkOrder::with(['Form' => function($q) use($package,$dealer,$building){
- $q->with(['Subscriber' => function($q) use($building) {
- $q->where('building_name', $building);
- }],'PackageDetail')->with('Company')->where('type_application', $package)->where('company_id', $dealer);
- }])->with('Company')->with(['Staff' => function($w){
- $w->with('StaffDetail');
- }])->orderBy('dateTimeStart', 'DESC')->where('status',$status)->get();
- }else if($package == 'B' && $dealer == 'null'){
- $wo = WorkOrder::with(['Form' => function($q) use($package){
- $q->with('Subscriber','PackageDetail')->with('Company')->where('type_application', $package);
- }])->with('Company')->with(['Staff' => function($w){
- $w->with('StaffDetail');
- }])->orderBy('dateTimeStart', 'DESC')->where('status',$status)->get();
- }else if($package == 'B' && $dealer != 'null'){
- $wo = WorkOrder::with(['Form' => function($q) use($package,$dealer){
- $q->with('Subscriber','PackageDetail')->with('Company')->where('type_application', $package)->where('company_id', $dealer);
- }])->with('Company')->with(['Staff' => function($w){
- $w->with('StaffDetail');
- }])->orderBy('dateTimeStart', 'DESC')->where('status',$status)->get();
- }
- }
- else if($company_id != 'null'){
- if($package == 'null' && $dealer == 'null'){
- $wo = WorkOrder::with(['Form' => function($q) {
- $q->with('Subscriber','PackageDetail')->with('Company');
- }])->with('Company')->with(['Staff' => function($w){
- $w->with('StaffDetail');
- }])->orderBy('dateTimeStart', 'DESC')->where('contractor_id',$company_id)->where('status',$status)->get();
- }else if($package == 'null' && $dealer != 'null'){
- $wo = WorkOrder::with(['Form' => function($q) use($dealer){
- $q->with('Subscriber','PackageDetail')->with('Company')->where('company_id', $dealer);
- }])->with('Company')->with(['Staff' => function($w){
- $w->with('StaffDetail');
- }])->orderBy('dateTimeStart', 'DESC')->where('contractor_id',$company_id)->where('status',$status)->get();
- }else if($package == 'R' && $building == 'null' && $dealer == 'null'){
- $wo = WorkOrder::with(['Form' => function($q) use($package){
- $q->with('Subscriber','PackageDetail')->with('Company')->where('type_application', $package);
- }])->with('Company')->with(['Staff' => function($w){
- $w->with('StaffDetail');
- }])->orderBy('dateTimeStart', 'DESC')->where('contractor_id',$company_id)->where('status',$status)->get();
- }else if($package == 'R' && $building == 'null' && $dealer != 'null'){
- $wo = WorkOrder::with(['Form' => function($q) use($package,$dealer){
- $q->with('Subscriber','PackageDetail')->with('Company')->where('type_application', $package)->where('company_id', $dealer);
- }])->with('Company')->with(['Staff' => function($w){
- $w->with('StaffDetail');
- }])->orderBy('dateTimeStart', 'DESC')->where('contractor_id',$company_id)->where('status',$status)->get();
- }else if($package == 'R' && $building != 'null' && $dealer == 'null'){
- $wo = WorkOrder::with(['Form' => function($q) use($package,$building){
- $q->with(['Subscriber' => function($q) use($building) {
- $q->where('building_name', $building);
- }],'PackageDetail')->with('Company')->where('type_application', $package);
- }])->with('Company')->with(['Staff' => function($w){
- $w->with('StaffDetail');
- }])->orderBy('dateTimeStart', 'DESC')->where('contractor_id',$company_id)->where('status',$status)->get();
- }else if($package == 'R' && $building != 'null' && $dealer != 'null'){
- $wo = WorkOrder::with(['Form' => function($q) use($package,$dealer,$building){
- $q->with(['Subscriber' => function($q) use($building) {
- $q->where('building_name', $building);
- }],'PackageDetail')->with('Company')->where('type_application', $package)->where('company_id', $dealer);
- }])->with('Company')->with(['Staff' => function($w){
- $w->with('StaffDetail');
- }])->orderBy('dateTimeStart', 'DESC')->where('contractor_id',$company_id)->where('status',$status)->get();
- }else if($package == 'B' && $dealer == 'null'){
- $wo = WorkOrder::with(['Form' => function($q) use($package){
- $q->with('Subscriber','PackageDetail')->with('Company')->where('type_application', $package);
- }])->with('Company')->with(['Staff' => function($w){
- $w->with('StaffDetail');
- }])->orderBy('dateTimeStart', 'DESC')->where('contractor_id',$company_id)->where('status',$status)->get();
- }else if($package == 'B' && $dealer != 'null'){
- $wo = WorkOrder::with(['Form' => function($q) use($package,$dealer){
- $q->with('Subscriber','PackageDetail')->with('Company')->where('type_application', $package)->where('company_id', $dealer);
- }])->with('Company')->with(['Staff' => function($w){
- $w->with('StaffDetail');
- }])->orderBy('dateTimeStart', 'DESC')->where('contractor_id',$company_id)->where('status',$status)->get();
- }
- }
- }else if($startdate != '-'){
-
- $start = $startdate.' 00:00:00';
-
- if($enddate != '-'){
- $end = $enddate.' 23:59:59';
- }else{
- $end = $startdate.' 23:59:59';
- }
-
- if($company_id == 'null'){
- if($package == 'null' && $dealer == 'null'){
- $wo = WorkOrder::with(['Form' => function($q) {
- $q->with('Subscriber','PackageDetail')->with('Company');
- }])->with('Company')->with(['Staff' => function($w){
- $w->with('StaffDetail');
- }])->orderBy('dateTimeStart', 'DESC')->whereBetween('dateTimeStart', array($start, $end))->where('status',$status)->get();
- }else if($package == 'null' && $dealer != 'null'){
- $wo = WorkOrder::with(['Form' => function($q) use($dealer){
- $q->with('Subscriber','PackageDetail')->with('Company')->where('company_id', $dealer);
- }])->with('Company')->with(['Staff' => function($w){
- $w->with('StaffDetail');
- }])->orderBy('dateTimeStart', 'DESC')->whereBetween('dateTimeStart', array($start, $end))->where('status',$status)->get();
- }else if($package == 'R' && $building == 'null' && $dealer == 'null'){
- $wo = WorkOrder::with(['Form' => function($q) use($package){
- $q->with('Subscriber','PackageDetail')->with('Company')->where('type_application', $package);
- }])->with('Company')->with(['Staff' => function($w){
- $w->with('StaffDetail');
- }])->orderBy('dateTimeStart', 'DESC')->whereBetween('dateTimeStart', array($start, $end))->where('status',$status)->get();
- }else if($package == 'R' && $building == 'null' && $dealer != 'null'){
- $wo = WorkOrder::with(['Form' => function($q) use($package,$dealer){
- $q->with('Subscriber','PackageDetail')->with('Company')->where('type_application', $package)->where('company_id', $dealer);
- }])->with('Company')->with(['Staff' => function($w){
- $w->with('StaffDetail');
- }])->orderBy('dateTimeStart', 'DESC')->whereBetween('dateTimeStart', array($start, $end))->where('status',$status)->get();
- }else if($package == 'R' && $building != 'null' && $dealer == 'null'){
- $wo = WorkOrder::with(['Form' => function($q) use($package,$building){
- $q->with(['Subscriber' => function($q) use($building) {
- $q->where('building_name', $building);
- }],'PackageDetail')->with('Company')->where('type_application', $package);
- }])->with('Company')->with(['Staff' => function($w){
- $w->with('StaffDetail');
- }])->orderBy('dateTimeStart', 'DESC')->whereBetween('dateTimeStart', array($start, $end))->where('status',$status)->get();
- }else if($package == 'R' && $building != 'null' && $dealer != 'null'){
- $wo = WorkOrder::with(['Form' => function($q) use($package,$dealer,$building){
- $q->with(['Subscriber' => function($q) use($building) {
- $q->where('building_name', $building);
- }],'PackageDetail')->with('Company')->where('type_application', $package)->where('company_id', $dealer);
- }])->with('Company')->with(['Staff' => function($w){
- $w->with('StaffDetail');
- }])->orderBy('dateTimeStart', 'DESC')->whereBetween('dateTimeStart', array($start, $end))->where('status',$status)->get();
- }else if($package == 'B' && $dealer == 'null'){
- $wo = WorkOrder::with(['Form' => function($q) use($package){
- $q->with('Subscriber','PackageDetail')->with('Company')->where('type_application', $package);
- }])->with('Company')->with(['Staff' => function($w){
- $w->with('StaffDetail');
- }])->orderBy('dateTimeStart', 'DESC')->whereBetween('dateTimeStart', array($start, $end))->where('status',$status)->get();
- }else if($package == 'B' && $dealer != 'null'){
- $wo = WorkOrder::with(['Form' => function($q) use($package,$dealer){
- $q->with('Subscriber','PackageDetail')->with('Company')->where('type_application', $package)->where('company_id', $dealer);
- }])->with('Company')->with(['Staff' => function($w){
- $w->with('StaffDetail');
- }])->orderBy('dateTimeStart', 'DESC')->whereBetween('dateTimeStart', array($start, $end))->where('status',$status)->get();
- }
- }
- else if($company_id != 'null'){
- if($package == 'null' && $dealer == 'null'){
- $wo = WorkOrder::with(['Form' => function($q) {
- $q->with('Subscriber','PackageDetail')->with('Company');
- }])->with('Company')->with(['Staff' => function($w){
- $w->with('StaffDetail');
- }])->orderBy('dateTimeStart', 'DESC')->whereBetween('dateTimeStart', array($start, $end))->where('contractor_id',$company_id)->where('status',$status)->get();
- }else if($package == 'null' && $dealer != 'null'){
- $wo = WorkOrder::with(['Form' => function($q) use($dealer){
- $q->with('Subscriber','PackageDetail')->with('Company')->where('company_id', $dealer);
- }])->with('Company')->with(['Staff' => function($w){
- $w->with('StaffDetail');
- }])->orderBy('dateTimeStart', 'DESC')->whereBetween('dateTimeStart', array($start, $end))->where('contractor_id',$company_id)->where('status',$status)->get();
- }else if($package == 'R' && $building == 'null' && $dealer == 'null'){
- $wo = WorkOrder::with(['Form' => function($q) use($package){
- $q->with('Subscriber','PackageDetail')->with('Company')->where('type_application', $package);
- }])->with('Company')->with(['Staff' => function($w){
- $w->with('StaffDetail');
- }])->orderBy('dateTimeStart', 'DESC')->whereBetween('dateTimeStart', array($start, $end))->where('contractor_id',$company_id)->where('status',$status)->get();
- }else if($package == 'R' && $building == 'null' && $dealer != 'null'){
- $wo = WorkOrder::with(['Form' => function($q) use($package,$dealer){
- $q->with('Subscriber','PackageDetail')->with('Company')->where('type_application', $package)->where('company_id', $dealer);
- }])->with('Company')->with(['Staff' => function($w){
- $w->with('StaffDetail');
- }])->orderBy('dateTimeStart', 'DESC')->whereBetween('dateTimeStart', array($start, $end))->where('contractor_id',$company_id)->where('status',$status)->get();
- }else if($package == 'R' && $building != 'null' && $dealer == 'null'){
- $wo = WorkOrder::with(['Form' => function($q) use($package,$building){
- $q->with(['Subscriber' => function($q) use($building) {
- $q->where('building_name', $building);
- }],'PackageDetail')->with('Company')->where('type_application', $package);
- }])->with('Company')->with(['Staff' => function($w){
- $w->with('StaffDetail');
- }])->orderBy('dateTimeStart', 'DESC')->whereBetween('dateTimeStart', array($start, $end))->where('contractor_id',$company_id)->where('status',$status)->get();
- }else if($package == 'R' && $building != 'null' && $dealer != 'null'){
- $wo = WorkOrder::with(['Form' => function($q) use($package,$dealer,$building){
- $q->with(['Subscriber' => function($q) use($building) {
- $q->where('building_name', $building);
- }],'PackageDetail')->with('Company')->where('type_application', $package)->where('company_id', $dealer);
- }])->with('Company')->with(['Staff' => function($w){
- $w->with('StaffDetail');
- }])->orderBy('dateTimeStart', 'DESC')->whereBetween('dateTimeStart', array($start, $end))->where('contractor_id',$company_id)->where('status',$status)->get();
- }else if($package == 'B' && $dealer == 'null'){
- $wo = WorkOrder::with(['Form' => function($q) use($package){
- $q->with('Subscriber','PackageDetail')->with('Company')->where('type_application', $package);
- }])->with('Company')->with(['Staff' => function($w){
- $w->with('StaffDetail');
- }])->orderBy('dateTimeStart', 'DESC')->whereBetween('dateTimeStart', array($start, $end))->where('contractor_id',$company_id)->where('status',$status)->get();
- }else if($package == 'B' && $dealer != 'null'){
- $wo = WorkOrder::with(['Form' => function($q) use($package,$dealer){
- $q->with('Subscriber','PackageDetail')->with('Company')->where('type_application', $package)->where('company_id', $dealer);
- }])->with('Company')->with(['Staff' => function($w){
- $w->with('StaffDetail');
- }])->orderBy('dateTimeStart', 'DESC')->whereBetween('dateTimeStart', array($start, $end))->where('contractor_id',$company_id)->where('status',$status)->get();
- }
- }
- }
-
- return $wo;
- }
-
- public function displayWorkOrder($status,$company_id,$startdate,$enddate,$type_work,$package,$building,$dealer){
-
- $i = 0;
- $curr = Carbon::now()->getTimestamp();
- $nested_data = array();
-
- $wo = $this->getWorkOrderData($status,$company_id,$startdate,$enddate,$type_work,$package,$building,$dealer);
- // return $wo;
-
- if(!empty($wo)){
- foreach ($wo as $key => $w) {
-
- $n1 = ''; $do = ''; $labelD = '';
- $reg_time = Carbon::createFromFormat('Y-m-d H:i:s', $w->created_at);
- $expiry_date = $reg_time->addDays(3);
- $expiry_date = $expiry_date->getTimestamp();
-
- if($curr < $expiry_date) { $n1 = 'New/'; }
- else{ $n1 = ''; }
-
- if(!empty($w->Form->Subscriber) && !empty($w->Form->PackageDetail)){
-
- if(!empty($w->Form->Company)){
- $com = explode(' ',trim($w->Form->Company->name));
- $labelD = 'D/'.$com[0].'.';
- }else{ $labelD = ''; }
-
- if(!empty($w->Company)){
- $company = $w->Company->name;
- }
-
- $installer = '';
- if(!empty($w->Staff)){
- $installer = $w->Staff->StaffDetail->name;
- }
-
- $docket = '';
- if($status == 'completed' || $status == 'cancelled'){
- if(!empty($w->Docket)){
- $docket = $w->Docket->docket_id;
- }
- }
-
- if($w->Form->PackageDetail->name == '1'){
- $product = $w->Form->PackageDetail->name .'Gbps';
- }else if($w->Form->PackageDetail->name == 'NA'){
- $product = $w->Form->PackageDetail->name;
- }else {
- $product = $w->Form->PackageDetail->name .'Mbps';
- }
-
- $unit = ''; $building = ''; $address = '';
-
- if($w->Form->type_application == 'R'){
- $building = $w->Form->Subscriber->building_name;
- $unit = $w->Form->Subscriber->unit_no;
-
- if($w->Form->Subscriber->street != ''){
- $address = $w->Form->Subscriber->street;
- }else {
- $address = '-';
- }
-
- }else if($w->Form->type_application == 'B'){
-
- if($w->Form->Subscriber->unit_no == ''){
- $unit = '-';
- }else {
- $unit = $w->Form->Subscriber->unit_no;
- }
-
- $building = $w->Form->Subscriber->company_name;
- $address = $w->Form->Subscriber->street;
- }
-
- if($w->nature_work == $type_work){
- $i++;
- array_push($nested_data, array(
- 'formT' => $n1.$i.$w->Form->type_application,
- 'service' => $w->nature_work,
- 'wo' => $w->wo,
- 'name' => $labelD.$w->Form->Subscriber->name,
- 'phone' => $w->Form->Subscriber->phone1,
- 'unit' => $unit,
- 'building' => $building,
- 'city' => $w->Form->Subscriber->city,
- 'package' => $product,
- 'contractor' => $company,
- 'installer' => $installer,
- 'date' => date("d/m/Y", strtotime($w->dateTimeStart)),
- 'time' => date("h:i A", strtotime($w->dateTimeStart)),
- 'status' => $w->status,
- 'docket' => $docket,
- 'action' => $w->wo,
- ));
- }else if($type_work == 'null'){
- $i++;
- array_push($nested_data, array(
- 'formT' => $n1.$i.$w->Form->type_application,
- 'service' => $w->nature_work,
- 'wo' => $w->wo,
- 'name' => $labelD.$w->Form->Subscriber->name,
- 'phone' => $w->Form->Subscriber->phone1,
- 'unit' => $unit,
- 'building' => $building,
- 'city' => $w->Form->Subscriber->city,
- 'package' => $product,
- 'contractor' => $company,
- 'installer' => $installer,
- 'date' => date("d/m/Y", strtotime($w->dateTimeStart)),
- 'time' => date("h:i A", strtotime($w->dateTimeStart)),
- 'status' => $w->status,
- 'docket' => $docket,
- 'action' => $w->wo,
- ));
- }
- }
- }
- }
- return \DataTables::of($nested_data)->make(true);
- }
-
- public function updateStatusWorkOrderNonPrelaid(Request $request){
- $wod = WorkOrder::where('wo', $request->id)->first();
- if(!empty($wod)){
- $wod->status = 'Success Non Prelaid';
- $wod->save();
-
- $form = Form::where('_id',$wod->_id)->first();
- $formH = new FormStatus;
- $formH->form_id = $form->_id;
- $formH->status_id = 7;
- $formH->date = new \MongoDB\BSON\UTCDateTime(time()*1000);
- $formH->status = 'Success Non Prelaid';
- $formH->desc = 'Prelaid successfully';
- $form->formstatus()->save($formH);
-
- return $this->sendResponse($wod, 'Successfully confirm assign/reassign installer');
- }else{
- return $this->sendError('Work order id cant be found!', '');
- }
- }
- }
|