public static function statusSanityCheck($customer_id)
 {
     $message = "";
     $status_list = CustomerApplicationStatus::where('customer_id', '=', $customer_id)->where('done', '=', 1)->get();
     foreach ($status_list as $key => $current_status) {
         if ($current_status->statusName() == "fiber") {
             //check for splicing
             $splicing_check = CustomerApplicationStatus::where('customer_id', '=', $customer_id)->where('status_id', '=', Masterdata::getId("splicing", "customer_activation_process"))->first();
             if (!$splicing_check->done) {
                 $current_status->done = 0;
                 $current_status->save();
                 $message .= "Splicing Should be Done before proceed to Fiber!! ";
             }
         }
         //check the rest of the status and add the condition
         if ($current_status->statusName() == "configuration") {
             //check for all status the is done
             $all_status = CustomerApplicationStatus::where('customer_id', '=', $customer_id)->lists('done');
             if (in_array("0", $all_status)) {
                 $current_status->done = 0;
                 $current_status->save();
                 $message .= "All the steps has to be Done before proceed to configuration!! ";
             }
         }
     }
     if (empty($message)) {
         return array('status' => true);
     } else {
         return array('status' => false, 'message' => $message);
     }
 }
Example #2
0
 public function updateStatusUser()
 {
     $md_id = Masterdata::getId('Open', 'ticket_status');
     $status = new Stattus();
     $status->status_id = Masterdata::getId('Open', 'ticket_status');
     $status->object_type = "ticket";
     $status->object_id = $this->id;
     $status->updated_by = Auth::user()->get()->account_id;
     $status->save();
     $this->status_id = Masterdata::getId('Open', 'ticket_status');
     $this->save();
 }
Example #3
0
 public function photo_document()
 {
     $md_id = Masterdata::getId("OFPHO", "document_type");
     $document_mapping = DocumentMapping::where('owner_type', '=', 'new_customer')->where('owner_id', '=', $this->id)->get();
     if (count($document_mapping) != 0) {
         foreach ($document_mapping as $dm) {
             if ($dm->document->document_id == $md_id) {
                 return $dm->document;
             }
         }
     }
     return false;
 }