FIX_ADDITION_DUP_ISSUE

This commit is contained in:
velz 2024-05-25 12:39:08 +05:30
parent f35739af42
commit fba9a6e777
4 changed files with 13 additions and 3 deletions

View File

@ -828,7 +828,7 @@ class EmployeeServiceController extends AdminController
break;
}
// echo '<br>START- ' . $row[2];
$employee = $this->employeeModel->where('emp_code', $row[1])->where('name',$row[2])->where('client_id',$file['client_id'])->where('client_branch_id',$file['client_branch_id']->first();
$employee = $this->employeeModel->where('emp_code', $row[1])->where('name',$row[2])->where('client_id',$file['client_id'])->where('client_branch_id',$file['client_branch_id'])->first();
$employee_policy = $this->employeePolicyModel->where('employee_id',$employee['id'])->where('client_policy_id',$file['policy_id'])->first();
$existing_endorsements = $this->empEndorsementModel->where('actions','si')

View File

@ -175,7 +175,16 @@ class JobWorker extends AdminController
}
$payload = is_array($payload) ? $payload : [];
$response = $jobHandler($payload,$job->id);
try
{
$response = $jobHandler($payload,$job->id);
}
catch(\Exception $e)
{
$job_status = self::STATUS_FAILED;
$runtime = $runtime === null ? microtime(true) - $start : $runtime;
$response = ['file_name' => $e->getFile(),'error' => $e->getMessage(),'line_no' => $e->getLine(),'info' => $e->getTraceAsString()];
}
$runtime = microtime(true) - $start;
$job_status = self::STATUS_DONE;

View File

@ -405,7 +405,7 @@ if (!function_exists('name_and_empid_check_in_db'))
foreach ($family_data as $rkey => $row)
{
if(isset($row['temp']) && $row['temp']['source'] != 'db')
if(($current_action == 'inception' || $current_action == 'addition') || ($current_action == 'dependent_addition' && (isset($row['temp']) && $row['temp']['source'] != 'db')))
{
$res = $employeeModel
->join('client_policy cp',"employees.client_id = cp.client_id")

View File

@ -188,6 +188,7 @@ if (!function_exists('get_base64_image')) {
if (!function_exists('format_indian_number')) {
function format_indian_number($number) {
// Round the number to two decimal places
$number = isset($number) ? $number : 0;
$number = round($number, 2);
// Split the number into integer and decimal parts