diff --git a/app/Controllers/ClientController.php b/app/Controllers/ClientController.php index 1529e549..bcadb66d 100755 --- a/app/Controllers/ClientController.php +++ b/app/Controllers/ClientController.php @@ -4669,7 +4669,7 @@ class ClientController extends AdminController // Additional logic for non-individual clients (client_type != 2) $branch_insert = null; if ($client_type != 2) { - $unit[] = $postData['short_name'] . '-' . $postData['branch_code'] ?? 001; + $unit[] = $postData['short_name'] . '-' . ($postData['branch_code'] ?? 001); $branch_data = [ 'client_id' => $client_insert, 'branch_name' => $postData['branch_name'], diff --git a/app/Controllers/PolicyTransactionController.php b/app/Controllers/PolicyTransactionController.php index db8be45b..d2b45648 100644 --- a/app/Controllers/PolicyTransactionController.php +++ b/app/Controllers/PolicyTransactionController.php @@ -594,6 +594,7 @@ class PolicyTransactionController extends BaseController 'client_branch_id' => $data['client_branch_id'] ?? 0, 'cd_ac_pk' => $data['cd_ac_no'] ?? null, 'gst' => 18, + 'policy_entry_from' => 2, ]; } @@ -1397,6 +1398,12 @@ class PolicyTransactionController extends BaseController ->orderBy('id', 'asc') ->first(); + $pt_id = null; + if(!empty($data)){ + $inception_data = $this->policyTransactionModel->where('policy_no', $data['policy_no'])->where('client_id', $data['client_id'])->first(); + $pt_id = $inception_data['id']; + } + if (!empty($data['policy_start_date'])) { $data['policy_start_date'] = change_date_format($data['policy_start_date'], 'Y-m-d', 'd/m/Y'); @@ -1559,7 +1566,7 @@ class PolicyTransactionController extends BaseController // print_r($data['endorse_eff_date']); die; if ($data) { - return $this->respond(['status' => true, 'data' => $data], 200); + return $this->respond(['status' => true, 'data' => $data, 'pt_id' => $pt_id], 200); } else { return $this->respond(['status' => false], 200); } @@ -1709,14 +1716,16 @@ class PolicyTransactionController extends BaseController ") ->join('policy_transaction', 'policy_transaction.id = pt_co_share_details.pt_id') ->where('policy_transaction.client_id', $client_id) - ->where('policy_transaction.client_policy_id', $client_policy_id) + // ->where('policy_transaction.client_policy_id', $client_policy_id) + ->where('policy_transaction.id', $client_policy_id) ->where('policy_transaction.action_type', 'inception') ->where('policy_transaction.is_active', 1) ->findAll(); $is_copay_yes = $this->policyTransactionModel ->where('client_id', $client_id) - ->where('client_policy_id', $client_policy_id) + // ->where('client_policy_id', $client_policy_id) + ->where('id', $client_policy_id) ->where('action_type', 'inception') ->where('is_active', 1) ->first(); diff --git a/app/Models/ClientPolicyModel.php b/app/Models/ClientPolicyModel.php index 132080de..152cad7f 100755 --- a/app/Models/ClientPolicyModel.php +++ b/app/Models/ClientPolicyModel.php @@ -55,6 +55,7 @@ class ClientPolicyModel extends Model "cd_ac_pk", "is_lgbtq", "placement_json", + "policy_entry_from", ]; // Callbacks diff --git a/app/Models/EmployeePolicyModel.php b/app/Models/EmployeePolicyModel.php index 348d309d..041ac791 100755 --- a/app/Models/EmployeePolicyModel.php +++ b/app/Models/EmployeePolicyModel.php @@ -1492,6 +1492,7 @@ class EmployeePolicyModel extends Model tpa.tpa_logo AS tpa_logo, tpa.front_card, tpa.back_card, + tpa.network_hospitals, tpa.short_name AS tpa_short_name' ) @@ -1557,6 +1558,7 @@ class EmployeePolicyModel extends Model tpa.tpa_logo AS tpa_logo, tpa.front_card, tpa.back_card, + tpa.network_hospitals, tpa.short_name AS tpa_short_name' )