Merge branch 'dev' of bitbucket.org:jubilian/nhance into dev
This commit is contained in:
commit
35a2930439
@ -661,8 +661,9 @@ class ClientController extends AdminController
|
||||
$loggedInUserID = get_session_userid();
|
||||
// $data['clientData']= $this->clientPolicyModel->getinsurerswithinsurenceid($insurerId);
|
||||
$clientId = $this->request->getGet('client_id');
|
||||
$cd_ac_pk = $this->request->getGet('cd_ac_pk');
|
||||
$data['insurerName'] = $this->insurerModel->getInsurerName($insurerId, $clientId);
|
||||
$data['depositdata'] = $this->clientPolicyModel->getdepositData($clientId, $insurerId);
|
||||
$data['depositdata'] = $this->clientPolicyModel->getdepositData($clientId, $insurerId, $cd_ac_pk);
|
||||
$data['clientData'] = $this->clientPolicyModel->getClientById($clientId);
|
||||
$data['deposiamount'] = $this->clientPolicyModel->getDepositSummary($clientId, $insurerId);
|
||||
|
||||
|
||||
@ -185,7 +185,7 @@ class EmpDataServiceController extends BaseController
|
||||
$balance = $this->CDMasterModel
|
||||
->where('client_id', $export_data['client_id'])
|
||||
->where('insurer_id', $policy_details['insurer_id'])
|
||||
->where('cd_ac_no', $policy_details['cd_ac_no'])
|
||||
->where('id', $policy_details['cd_ac_pk'])
|
||||
->first();
|
||||
|
||||
$cash_balance['balance'] = $balance['opening_bal'];
|
||||
@ -683,7 +683,7 @@ class EmpDataServiceController extends BaseController
|
||||
$balance = $this->CDMasterModel
|
||||
->where('client_id', $export_data['client_id'])
|
||||
->where('insurer_id', $policy_details['insurer_id'])
|
||||
->where('cd_ac_no', $policy_details['cd_ac_no'])
|
||||
->where('id', $policy_details['cd_ac_pk'])
|
||||
->first();
|
||||
|
||||
$cash_balance['balance'] = $balance['opening_bal'];
|
||||
|
||||
@ -2501,7 +2501,7 @@ class EmployeeRestController extends AdminController
|
||||
|
||||
function getEmployeeActiveOrInactivePolicy()
|
||||
{
|
||||
if($this->request->getGet('type') == 'Active'){ $policy_status = 1; }else{ $policy_status = 0; }
|
||||
if($this->request->getGet('type') == 'Active'){ $policy_status = 1; $policy_status_key = "Active"; }else{ $policy_status = 0; $policy_status_key = "InActive";}
|
||||
$dayInterval = 10;
|
||||
$ClientPolicyData = $this->clientPolicyModel->select("client_policy.* , policy_type.policy_type as policy_type,insurers.name as insurer_name,tpa.name as tpa_name,tpa.network_hospitals as network_hospitals_url, policy_type.long_name as policy_long_name, DATE_ADD(client_policy.policy_end_date, INTERVAL {$dayInterval} DAY) as claims_grace_date")
|
||||
->join('insurers', 'client_policy.insurer_id = insurers.id', 'left')
|
||||
@ -2527,12 +2527,16 @@ class EmployeeRestController extends AdminController
|
||||
->get()->getRow()->name;
|
||||
$whereArrayForId = [];
|
||||
foreach ( $employeeData as $key => $value) { array_push($whereArrayForId, $value['id']); }
|
||||
|
||||
|
||||
if(count($ClientPolicyData) > 0 && count($employeeData) > 0)
|
||||
{
|
||||
$result = [];
|
||||
foreach ($ClientPolicyData as $key => $ClientPolicyValue) {
|
||||
|
||||
if (strtotime(date('Y-m-d') > strtotime($ClientPolicyValue['claims_grace_date']))) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if($ClientPolicyValue['policy_type_id'] == 1)
|
||||
{
|
||||
$policyGroup = 'gpa';
|
||||
@ -2566,7 +2570,8 @@ class EmployeeRestController extends AdminController
|
||||
$data['policy_start_date'] = $this->convertDateFormatDisplay($ClientPolicyValue['policy_start_date']);
|
||||
$data['policy_end_date'] = $this->convertDateFormatDisplay($ClientPolicyValue['policy_end_date']);
|
||||
$data['heading'] = $ClientPolicyValue['policy_long_name'];
|
||||
$data['claims_grace_date'] = $ClientPolicyValue['claims_grace_date'];
|
||||
$data['claims_grace_date'] = $this->convertDateFormatDisplay($ClientPolicyValue['claims_grace_date']);
|
||||
$data['policy_status'] = $policy_status_key;
|
||||
// $data['policy_terms'] = $terms;
|
||||
|
||||
// if($ClientPolicyValue['policy_type_id'] == 1){ $data['heading'] = 'Group Personal Accident Coverage'; }else
|
||||
|
||||
@ -1649,6 +1649,7 @@ class PolicyTransactionController extends BaseController
|
||||
->where('policy_transaction.client_id', $client_id)
|
||||
->where('policy_transaction.client_policy_id', $client_policy_id)
|
||||
->where('policy_transaction.action_type', 'inception')
|
||||
->where('policy_transaction.is_active', 1)
|
||||
->findAll();
|
||||
|
||||
$is_copay_yes = $this->policyTransactionModel
|
||||
|
||||
@ -181,8 +181,9 @@ class ClientPolicyModel extends Model
|
||||
->where('client_policy.client_id', $id)
|
||||
->where('cd_master.id = client_policy.cd_ac_pk')
|
||||
->where('cd_master.is_active', 1)
|
||||
->groupBy('client_policy.insurer_id')
|
||||
->groupBy('client_policy.client_id', $id) // Group by insurer_id
|
||||
->groupBy('client_policy.insurer_id')
|
||||
->groupBy('client_policy.cd_ac_pk')
|
||||
->get()
|
||||
->getResult();
|
||||
|
||||
@ -225,10 +226,10 @@ class ClientPolicyModel extends Model
|
||||
}
|
||||
|
||||
|
||||
public function getDepositData($clientId, $insurerId)
|
||||
public function getDepositData($clientId, $insurerId, $cd_ac_pk = null)
|
||||
{
|
||||
// Fetch the deposit data based on client and insurer IDs
|
||||
return $this->db->table('cash_deposit')
|
||||
// Fetch the deposit data based on client and insurer IDs
|
||||
$query = $this->db->table('cash_deposit')
|
||||
->select('cash_deposit.*')
|
||||
->select('insurers.name as insurer_name, insurers.short_name as insurer_short')
|
||||
->select('clients.client_name as clientname, clients.short_name as clientshort, client_policy.policy_no')
|
||||
@ -245,11 +246,14 @@ class ClientPolicyModel extends Model
|
||||
->join('policy_type', 'policy_type.id = client_policy.policy_type_id', 'left')
|
||||
->where('cash_deposit.client_id', $clientId)
|
||||
->where('cash_deposit.insurer_id', $insurerId)
|
||||
->where('cash_deposit.is_active', 1)
|
||||
->where('cash_deposit.is_active', 1);
|
||||
// ->where('cash_deposit.cd_ac_pk = cd_master.id')
|
||||
->orderBy('cash_deposit.id', 'DESC')
|
||||
->get()
|
||||
->getResult();
|
||||
if(!empty($cd_ac_pk)){
|
||||
$query->where('cash_deposit.cd_ac_pk', $cd_ac_pk);
|
||||
}
|
||||
$query->orderBy('cash_deposit.id', 'DESC');
|
||||
|
||||
return $query->get()->getResult();
|
||||
}
|
||||
|
||||
|
||||
@ -319,6 +323,7 @@ class ClientPolicyModel extends Model
|
||||
->select('SUM(CASE WHEN transaction_type = "Credit" THEN amount ELSE -amount END) AS balance')
|
||||
->where('client_id', $id)
|
||||
->groupBy('insurer_id')
|
||||
->groupBy('cd_ac_pk')
|
||||
->get()
|
||||
->getResult();
|
||||
}
|
||||
|
||||
@ -416,7 +416,7 @@ class EmployeePolicyModel extends Model
|
||||
employees.designation AS emp_designation,
|
||||
employees.basic_pay AS emp_basic_pay,
|
||||
|
||||
TIMESTAMPDIFF(YEAR, employees.dob, CURDATE()) AS emp_age,
|
||||
TIMESTAMPDIFF(YEAR, employees.dob, employee_polices.date_coverage) AS emp_age,
|
||||
employees.emp_type as emp_type,
|
||||
|
||||
|
||||
@ -641,21 +641,22 @@ class EmployeePolicyModel extends Model
|
||||
|
||||
sidata.new_basic_cover_si,
|
||||
sidata.new_si_premium,
|
||||
sidata.old_si_premium,
|
||||
sidata.date_of_coverage,
|
||||
|
||||
DATEDIFF(employee_polices.policy_end_date, sidata.date_of_coverage) + 1 AS no_of_days,
|
||||
|
||||
sidata.new_si_premium - employee_polices.rata_premimum AS difference_premium,
|
||||
ROUND(sidata.new_si_premium - sidata.old_si_premium, 2) AS difference_premium,
|
||||
|
||||
ROUND((sidata.new_si_premium - employee_polices.rata_premimum) * (DATEDIFF(employee_polices.policy_end_date, sidata.date_of_coverage) + 1) / 365, 2) AS pro_rata_premium,
|
||||
ROUND((sidata.new_si_premium - sidata.old_si_premium) * (DATEDIFF(employee_polices.policy_end_date, sidata.date_of_coverage) + 1) / 365, 2) AS pro_rata_premium,
|
||||
|
||||
ROUND(((sidata.new_si_premium - employee_polices.rata_premimum) * (DATEDIFF(employee_polices.policy_end_date, sidata.date_of_coverage) + 1) / 365) * 0.18, 2) AS gst,
|
||||
ROUND(((sidata.new_si_premium - sidata.old_si_premium) * (DATEDIFF(employee_polices.policy_end_date, sidata.date_of_coverage) + 1) / 365) * 0.18, 2) AS gst,
|
||||
|
||||
ROUND(
|
||||
((sidata.new_si_premium - employee_polices.rata_premimum) *
|
||||
((sidata.new_si_premium - sidata.old_si_premium) *
|
||||
(DATEDIFF(employee_polices.policy_end_date, sidata.date_of_coverage) + 1) / 365) +
|
||||
ROUND(
|
||||
((sidata.new_si_premium - employee_polices.rata_premimum) *
|
||||
((sidata.new_si_premium - sidata.old_si_premium) *
|
||||
(DATEDIFF(employee_polices.policy_end_date, sidata.date_of_coverage) + 1) / 365) * 0.18, 2
|
||||
), 2
|
||||
) AS total
|
||||
@ -671,12 +672,14 @@ class EmployeePolicyModel extends Model
|
||||
aa.emp_code,
|
||||
aa.new_value as 'new_basic_cover_si',
|
||||
bb.new_value as 'new_si_premium',
|
||||
bb.old_value as 'old_si_premium',
|
||||
cc.new_value as 'date_of_coverage'
|
||||
FROM (
|
||||
SELECT
|
||||
a1.emp_code,
|
||||
a1.field_name,
|
||||
a1.new_value
|
||||
a1.new_value,
|
||||
a1.old_value
|
||||
FROM
|
||||
emp_endorsement as a1
|
||||
WHERE
|
||||
@ -686,7 +689,8 @@ class EmployeePolicyModel extends Model
|
||||
SELECT
|
||||
b1.emp_code,
|
||||
b1.field_name,
|
||||
b1.new_value
|
||||
b1.new_value,
|
||||
b1.old_value
|
||||
FROM
|
||||
emp_endorsement as b1
|
||||
WHERE
|
||||
@ -696,7 +700,8 @@ class EmployeePolicyModel extends Model
|
||||
SELECT
|
||||
c1.emp_code,
|
||||
c1.field_name,
|
||||
c1.new_value
|
||||
c1.new_value,
|
||||
c1.old_value
|
||||
FROM
|
||||
emp_endorsement as c1
|
||||
WHERE
|
||||
|
||||
@ -49,7 +49,7 @@
|
||||
</td>
|
||||
<td>
|
||||
<a class="dropdown-item"
|
||||
href="<?= base_url("client/view_deposit/{$value->insurer_id}?client_id={$value->client_id}"); ?>">
|
||||
href="<?= base_url("client/view_deposit/{$value->insurer_id}?client_id={$value->client_id}&cd_ac_pk={$value->cd_ac_pk}"); ?>">
|
||||
<i class="mdi mdi-eye mr-2 text-muted font-18 vertical-middle"></i>View Deposit
|
||||
</a>
|
||||
</td>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user