GWM : getSelfBand~

This commit is contained in:
Gowtham M 2025-10-04 14:05:48 +05:30
parent ecd0fcf756
commit 6e64988e46

View File

@ -275,6 +275,7 @@ class EmployeeRestController extends AdminController
$item->gender = $this->GenderMap($item->relationship , $item->emp_code);
$item->dob = $this->convertDateFormatYMD($item->dob);
$item->emp_status = 'draft';
$item->band = $this->getSelfBand($item->emp_code,$item->client_id,$item->client_branch_id);
// dd($item);
$employee = $this->employeeModel->insert($item);
@ -312,6 +313,22 @@ class EmployeeRestController extends AdminController
}
public function getSelfBand(string $emp_code, int $client_id, int $client_branch_id): ?string
{
$employee = $this->employeeModel
->where('emp_code', $emp_code)
->where('client_id', $client_id)
->where('client_branch_id', $client_branch_id)
->whereIn('emp_status', ['draft', 'enrolled'])
->where('is_active', 1)
->where('relationship','Self')
->first();
return $employee['band'] ?? null;
}
public function getEmployeePayableValue($client_policy_id,$relationship)
{
$terms = $this->clientPolicyModel->where('id',$client_policy_id)->get()->getRow()->policy_terms;