CHANGE_AGENT_CODE_TO_POS_CODE
This commit is contained in:
parent
07295b3ad6
commit
d90a8dd448
@ -6633,7 +6633,8 @@ class ClientController extends AdminController
|
||||
$policyTransactionController = new PolicyTransactionController();
|
||||
// $res = $policyTransactionController->validateInsurerStatement(['file_id' => '281']);
|
||||
// $res = $policyTransactionController->updateInsurerStatement(['file_id' => '62']);
|
||||
// dd('-----', $res);
|
||||
// $res = $policyTransactionController->bdsDumpExcelFileFormatValidation(['file_id' => '73']);
|
||||
// dd($res);
|
||||
|
||||
// ----------EMP DATA SERVICE CONTROLLER--------------------------------------------------------------------------------
|
||||
|
||||
|
||||
@ -309,7 +309,7 @@
|
||||
'format' => null,
|
||||
'allowed_values' => null,
|
||||
'custom' => 'check_agent_exist',
|
||||
'params' => ['row', 'agent_data']
|
||||
'params' => ['row', 'pos_data']
|
||||
],
|
||||
|
||||
'base_premium' => [
|
||||
@ -4944,6 +4944,7 @@
|
||||
$pt_data = $this->policyTransactionModel->where('is_active', 1)->findAll();
|
||||
$user_data = $this->userModel->where('is_active', 1)->findAll();
|
||||
$agent_data = db_connect()->table('partner_agent')->where('is_active', 1)->get()->getResultArray();
|
||||
$pos_data = db_connect()->table('partner_pos')->where('is_active', 1)->get()->getResultArray();
|
||||
$rto_master = db_connect()->table('rto_master')->where('is_active', 1)->get()->getResultArray();
|
||||
$vehicle_type = db_connect()->table('vehicle_type')->where('is_active', 1)->get()->getResultArray();
|
||||
$nhance_branch_data = db_connect()->table('nhance_branch')->where('is_active', 1)->get()->getResultArray();
|
||||
@ -5109,6 +5110,7 @@
|
||||
$vehicle_data = $this->vehicleModel->where('is_active', 1)->findAll();
|
||||
$user_data = $this->userModel->where('is_active', 1)->findAll();
|
||||
$agent_data = db_connect()->table('partner_agent')->where('is_active', 1)->get()->getResultArray();
|
||||
$pos_data = db_connect()->table('partner_pos')->where('is_active', 1)->get()->getResultArray();
|
||||
$rto_master = db_connect()->table('rto_master')->where('is_active', 1)->get()->getResultArray();
|
||||
$vehicle_type_data = db_connect()->table('vehicle_type')->where('is_active', 1)->get()->getResultArray();
|
||||
$nhance_branch_data = db_connect()->table('nhance_branch')->where('is_active', 1)->get()->getResultArray();
|
||||
@ -5191,7 +5193,8 @@
|
||||
$current_insurer_branch_data = check_insurer_branch_exist($row, $insurer_branch_data, $current_insurer_data)['branch'] ?? null;
|
||||
|
||||
$current_nhance_branch = check_nhance_branch($row, $nhance_branch_data)['branch'] ?? null;
|
||||
$current_agent_data = check_agent_exist($row, $agent_data)['agent'] ?? null;
|
||||
// $current_agent_data = check_agent_exist($row, $agent_data)['agent'] ?? null;
|
||||
$current_agent_data = check_agent_exist($row, $pos_data)['agent'] ?? null;
|
||||
|
||||
$salse = check_user_exist($row, 13, $user_data)['user'] ?? null;
|
||||
$service = check_user_exist($row, 14, $user_data)['user'] ?? null;
|
||||
@ -5229,8 +5232,9 @@
|
||||
'salse_person_manager_id' => $salse['rm_id'] ?? null,
|
||||
'service_person_manager_id' => $service['rm_id'] ?? null,
|
||||
'service_person_branch_id' => $service['nhance_branch_id'] ?? null,
|
||||
'agent_id' => $current_agent_data['id'] ?? null,
|
||||
'agent_code' => $current_agent_data['agent_code'] ?? null,
|
||||
// 'agent_id' => $current_agent_data['id'] ?? null,
|
||||
// 'agent_code' => $current_agent_data['agent_code'] ?? null,
|
||||
'pos_id' => $current_agent_data['id'] ?? null,
|
||||
'file_id' => $params['file_id'],
|
||||
'endorsement_no' => null,
|
||||
'client_branch_id' => null,
|
||||
|
||||
@ -3149,7 +3149,7 @@ if (!function_exists('check_agent_exist')) {
|
||||
// Loop agent data from DB
|
||||
foreach ($agent_data as $agent) {
|
||||
// Assuming DB keys: agent_code
|
||||
if (isset($agent['agent_code']) && $agent['agent_code'] == $agent_code) {
|
||||
if (isset($agent['pos_code']) && (strtolower($agent['pos_code']) == strtolower($agent_code))) {
|
||||
return [
|
||||
'status' => true,
|
||||
'error' => null,
|
||||
@ -3173,6 +3173,17 @@ if (!function_exists('check_rto_data')) {
|
||||
$vehicle_no = strtoupper(trim($row[2])); // Example: TN10AB1234
|
||||
$new_vehicle = strtolower(trim($row[2]));
|
||||
|
||||
// BH Series: 22BH1234AA
|
||||
$bhPattern = '/^[0-9]{2}BH[0-9]{4}[A-Z]{2}$/';
|
||||
|
||||
if (preg_match($bhPattern, $vehicle_no)) {
|
||||
return [
|
||||
'status' => true,
|
||||
'error' => null,
|
||||
'rto_data' => []
|
||||
];
|
||||
}
|
||||
|
||||
if($new_vehicle == "new"){
|
||||
return [
|
||||
'status' => true,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user