Tracker issue : GWM
This commit is contained in:
parent
562fcd943b
commit
8816f2f323
@ -27,6 +27,7 @@ use App\Models\MailTemplateModel;
|
||||
use App\Models\ReportsModel;
|
||||
use App\Models\GroupModel;
|
||||
use App\Models\PolicyModel;
|
||||
use App\Models\TravellerModel;
|
||||
use Mpdf\Mpdf;
|
||||
|
||||
class PlanController extends ResourceController
|
||||
@ -54,6 +55,7 @@ class PlanController extends ResourceController
|
||||
protected $reportsModel;
|
||||
protected $groupModel;
|
||||
protected $policyModel;
|
||||
protected $travellerModel;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
@ -80,6 +82,7 @@ class PlanController extends ResourceController
|
||||
$this->reportsModel = new ReportsModel();
|
||||
$this->groupModel = new GroupModel();
|
||||
$this->policyModel = new PolicyModel();
|
||||
$this->travellerModel = new TravellerModel();
|
||||
|
||||
}
|
||||
|
||||
@ -1318,7 +1321,8 @@ class PlanController extends ResourceController
|
||||
->where('c_user_visa_details.valid_upto >=', date('Y-m-d'))
|
||||
->findAll();
|
||||
|
||||
$userId = $plan['user_id'] ?? $plan['traveller_id'];
|
||||
$userId = !empty($plan['user_id']) ? $plan['user_id'] : $plan['traveller_id'];
|
||||
|
||||
|
||||
//current plan status
|
||||
$status = getCurrentPlanStatus($planId);
|
||||
@ -1326,7 +1330,14 @@ class PlanController extends ResourceController
|
||||
$plan['status_details'] = $status;
|
||||
|
||||
//get user data
|
||||
$plan['user_data'] = $this->userModel->where('user_id', $userId)->first();
|
||||
if($plan['user_id'] != 0){
|
||||
$plan['user_data'] = $this->userModel->where('user_id', $userId)->first();
|
||||
}else{
|
||||
$plan['user_data'] = $this->travellerModel->select('first_name,last_name,email,mobile as mobile_no')->where('traveller_id', $userId)->first();
|
||||
}
|
||||
|
||||
// dd($plan['user_data']);
|
||||
|
||||
$plan['view'] = $view;
|
||||
$data['data'] = $plan;
|
||||
// dd($data);
|
||||
@ -1478,6 +1489,7 @@ class PlanController extends ResourceController
|
||||
public function canclePlan()
|
||||
{
|
||||
$plan_id = $this->request->getGet('plan_id') ?? null;
|
||||
$updated_by = $this->request->getGet('updated_by') ?? null;
|
||||
log_message('error', "Recived plan_id: {$plan_id} in update()");
|
||||
|
||||
|
||||
@ -1486,7 +1498,7 @@ class PlanController extends ResourceController
|
||||
return $this->failNotFound('Plan ID is required');
|
||||
}
|
||||
|
||||
$return = $this->planModel->where('plan_id', $plan_id)->set(['status' => 7])->update();
|
||||
$return = $this->planModel->where('plan_id', $plan_id)->set(['status' => 7,'updated_by'=>$updated_by])->update();
|
||||
|
||||
if($return){
|
||||
|
||||
@ -1532,7 +1544,7 @@ class PlanController extends ResourceController
|
||||
// echo getUserPlanCreationRestrictionStatus($user); die;
|
||||
// print_r(getPlanApproverAction(126)); die;
|
||||
|
||||
return $this->generatePlanPdf(174, true);
|
||||
return $this->generatePlanPdf(223, true);
|
||||
die;
|
||||
|
||||
// updatePlanStatus(57); die;
|
||||
@ -1708,22 +1720,25 @@ class PlanController extends ResourceController
|
||||
return false;
|
||||
}
|
||||
|
||||
$userId = $planData['user_id'] ?? $planData['traveller_id'];
|
||||
// $userId = $planData['user_id'] ?? $planData['traveller_id'];
|
||||
$userId = !empty($planData['user_id']) ? $planData['user_id'] : $planData['created_by'];
|
||||
$userData = $this->userModel->where('user_id', $userId)->first();
|
||||
if (!$userData) {
|
||||
log_message('error', "User data not found for user_id: {$userId}");
|
||||
return false;
|
||||
}
|
||||
|
||||
$groupId = $userData['group_id'];
|
||||
|
||||
|
||||
$planStatusData = $this->planStatusModel->where('plan_id', $plan_id)->where('is_active', 1)->first();
|
||||
|
||||
$groupId = $planStatusData['group_id'];
|
||||
$groupData = $this->groupModel->where('group_id', $groupId)->first();
|
||||
if (!$groupData) {
|
||||
log_message('error', "Group data not found for group_id: {$groupId}");
|
||||
return false;
|
||||
}
|
||||
|
||||
$planStatusData = $this->planStatusModel->where('plan_id', $plan_id)->where('is_active', 1)->first();
|
||||
|
||||
|
||||
$result['traveller'] = $userData['first_name'].' '.$userData['last_name'];
|
||||
$result['group_name'] = $groupData['name'];
|
||||
|
||||
@ -42,7 +42,8 @@ if (!function_exists('palnStatusHandler')) {
|
||||
|
||||
log_message('debug', "Plan services found: " . json_encode($planServices));
|
||||
|
||||
$userId = $planData['user_id'] ?? $planData['traveller_id'];
|
||||
// $userId = $planData['user_id'] ?? $planData['traveller_id'];
|
||||
$userId = !empty($planData['user_id']) ? $planData['user_id'] : $planData['created_by'];
|
||||
$userData = $userModel->where('user_id', $userId)->first();
|
||||
if (!$userData) {
|
||||
log_message('error', "User data not found for user_id: {$userId}");
|
||||
@ -157,7 +158,9 @@ if (!function_exists('palnStatusHandler')) {
|
||||
'a4_action' => $policyA4Action,
|
||||
'is_a4_action_done' => ($policyA4Action == 'None') ? 1 : 0,
|
||||
'parallel_process_from' => $policyParallelAction,
|
||||
'policy_action' => $policyAction
|
||||
'policy_action' => $policyAction,
|
||||
'group_id'=> $groupId,
|
||||
'policy_id'=> $policyId,
|
||||
];
|
||||
|
||||
// dd($data);
|
||||
|
||||
@ -18,6 +18,8 @@ class PlanStatusModel extends Model
|
||||
'a4_id', 'a4_action', 'is_a4_action_done', 'a4_reject_reason', 'a4_action_done_on','a4_action_done_by','is_a4_mail_send',
|
||||
'parallel_process_from',
|
||||
'policy_action',
|
||||
'group_id',
|
||||
'policy_id',
|
||||
'is_active',
|
||||
'created_on', 'created_by'
|
||||
];
|
||||
|
||||
@ -192,7 +192,7 @@
|
||||
<tr class="invoice-section">
|
||||
<td class="quotation-company">
|
||||
<div>
|
||||
<span class="user-name"><?= esc($data['user_data']['first_name']) ?> <?= esc($data['user_data']['last_name']) ?> <?php if($data['user_data']['employee_code']){ echo '- '.$data['user_data']['employee_code']; } ?> </span>
|
||||
<span class="user-name"><?= esc($data['user_data']['first_name']) ?> <?= esc($data['user_data']['last_name']) ?> <?php if(isset($data['user_data']['employee_code'])){ echo '- '.$data['user_data']['employee_code']; } ?> </span>
|
||||
</div>
|
||||
<div>
|
||||
<span class="user-email" ><?= esc($data['user_data']['email']) ?></span>,
|
||||
@ -209,7 +209,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align:left; border-bottom:1px solid #ddd; border-right:1px solid #ddd;">Expiry Date</td>
|
||||
<td style="text-align:left; border-bottom:1px solid #ddd; color:#6b6b6b;"><?= $data['user_data']['date_of_expiry'] ? date('d, M y', strtotime($data['user_data']['date_of_expiry'])) : '' ?></td>
|
||||
<td style="text-align:left; border-bottom:1px solid #ddd; color:#6b6b6b;"><?= !empty($data['user_data']['date_of_expiry']) ? date('d, M y', strtotime($data['user_data']['date_of_expiry'])) : '' ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align:left; border-bottom:1px solid #ddd; border-right:1px solid #ddd;">Place Of Issue</td>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user