CHANGE missing si amount function : GWM
This commit is contained in:
parent
8a31001c63
commit
547c1b36ee
@ -439,6 +439,29 @@ class EmployeeRestController extends AdminController
|
|||||||
try {
|
try {
|
||||||
|
|
||||||
$requestData = $this->request->getJSON();
|
$requestData = $this->request->getJSON();
|
||||||
|
foreach ($requestData as $key => $value)
|
||||||
|
{
|
||||||
|
|
||||||
|
$checkIfExist = $this->employeePolicyModel->where('employee_id', $value->employee_id)
|
||||||
|
->where('client_policy_id', $value->client_policy_id)
|
||||||
|
->where('is_active', 1 )
|
||||||
|
->findAll();
|
||||||
|
|
||||||
|
|
||||||
|
if ($checkIfExist) {
|
||||||
|
|
||||||
|
$empPolicy = $this->employeePolicyModel->updateSiAndPremium($value->client_policy_id, $value->employee_id, $value->basic_cover_si);
|
||||||
|
|
||||||
|
}else{
|
||||||
|
|
||||||
|
$data['employee_id']= $value->employee_id;
|
||||||
|
$data['client_policy_id']= $value->client_policy_id;
|
||||||
|
$data['basic_cover_si']= $value->basic_cover_si;
|
||||||
|
$data['status'] = 'draft';
|
||||||
|
|
||||||
|
$this->employeePolicyModel->insert($data);
|
||||||
|
}
|
||||||
|
}
|
||||||
if(count($requestData))
|
if(count($requestData))
|
||||||
{
|
{
|
||||||
$this->updatePremiumAmount($requestData[0]->client_policy_id , $requestData[0]->emp_code , $requestData[0]->client_branch_id);
|
$this->updatePremiumAmount($requestData[0]->client_policy_id , $requestData[0]->emp_code , $requestData[0]->client_branch_id);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user