FIX_ENDORSEMENT : RV

This commit is contained in:
VENKATESHWARAN 2025-03-11 10:06:41 +05:30
parent 8a5b5fcfd0
commit 33761b31ac
2 changed files with 467 additions and 409 deletions

View File

@ -1063,6 +1063,7 @@ class PolicyTransactionController extends BaseController
{
$id = $this->request->getPost('id');
$data = $this->preparePolicyTransactionData();
// print_r($data); die;
if (!$id) {
return $this->insertEndorsementTransaction($data);
@ -1079,25 +1080,12 @@ class PolicyTransactionController extends BaseController
// print_r($data);
// die;
// $data_received_date = (string)$this->request->getPost('data_received_date');
// $closure_date = (string)$this->request->getPost('closure_date');
// $endorse_eff_date = (string)$this->request->getPost('endorse_eff_date');
// $month = (string)$this->request->getPost('month');
// $data['data_received_date'] = empty($data['data_received_date']) ? null : date('Y-m-d', strtotime($data_received_date));
// $data['closure_date'] = empty($data['closure_date']) ? null : date('Y-m-d', strtotime($closure_date));
// $data['endorse_eff_date'] = empty($data['endorse_eff_date']) ? null : date('Y-m-d', strtotime($endorse_eff_date));
// $month = '01-'.$data['month'];
// $data['month'] = empty($data['month']) ? null : date('Y-m-d', strtotime($month));
if (!isset($data['policy_with_corr'])) {
$data['policy_with_corr'] = 0;
} elseif ($data['policy_with_corr']) {
$data['policy_with_corr'] = 1;
}
if(empty($data['data_received_date'])){
$data['data_received_date'] = null;
}else{
@ -1287,48 +1275,39 @@ class PolicyTransactionController extends BaseController
->join('client_policy', 'policy_transaction.client_policy_id = client_policy.id', 'left')
->where('policy_transaction.id', $id)
->where('policy_transaction.is_active', 1)
->orderBy('id', 'asc')
->first();
// $data['policy_start_date'] = empty($data['policy_start_date']) ? '' : date('d/m/Y', strtotime($data['s_date']));
// $data['policy_end_date'] = empty($data['policy_end_date']) ? '' : date('d/m/Y', strtotime($data['e_date']));
// $data['data_received_date'] = empty($data['data_received_date']) ? '' : date('d/m/Y', strtotime($data['data_received_date']));
// $data['closure_date'] = empty($data['closure_date']) ? '' : date('d/m/Y', strtotime($data['closure_date']));
// $data['endorse_eff_date'] = empty($data['endorse_eff_date']) ? '' : date('d/m/Y', strtotime($data['endorse_eff_date']));
// $data['month'] = (isset($data['month']) && $data['month'] !== null && $data['month'] !== '')
// ? date('M/Y', strtotime($data['month']))
// : null;
if(!empty($data['policy_start_date'])){
if (!empty($data['policy_start_date'])) {
$data['policy_start_date'] = change_date_format($data['policy_start_date'], 'Y-m-d', 'd/m/Y');
}
if(!empty($data['policy_end_date'])){
if (!empty($data['policy_end_date'])) {
$data['policy_end_date'] = change_date_format($data['policy_end_date'], 'Y-m-d', 'd/m/Y');
}
if(!empty($data['data_received_date'])){
if (!empty($data['data_received_date'])) {
$data['data_received_date'] = change_date_format($data['data_received_date'], 'Y-m-d', 'd/m/Y');
}
if(!empty($data['policy_issue_date'])){
if (!empty($data['policy_issue_date'])) {
$data['policy_issue_date'] = change_date_format($data['policy_issue_date'], 'Y-m-d', 'd/m/Y');
}
if(!empty($data['endorse_eff_date'])){
if (!empty($data['endorse_eff_date'])) {
$data['endorse_eff_date'] = change_date_format($data['endorse_eff_date'], 'Y-m-d', 'd/m/Y');
}
if(!empty($data['install_due_date'])){
if (!empty($data['install_due_date'])) {
$data['install_due_date'] = change_date_format($data['install_due_date'], 'Y-m-d', 'd/m/Y');
}
if(!empty($data['last_action_date'])){
if (!empty($data['last_action_date'])) {
$data['last_action_date'] = change_date_format($data['last_action_date'], 'Y-m-d', 'd/m/Y');
}
if(!empty($data['month'])){
if (!empty($data['month'])) {
$data['month'] = change_date_format($data['month'], 'Y-m-d', 'M/Y');
}
@ -1460,12 +1439,11 @@ class PolicyTransactionController extends BaseController
// print_r($data['endorse_eff_date']); die;
if($data){
if ($data) {
return $this->respond(['status' => true, 'data' => $data], 200);
}else{
} else {
return $this->respond(['status' => false], 200);
}
}
//------------------------------------------------------------------------------------------------

File diff suppressed because it is too large Load Diff