From 2edc117f534994b2b3c3b03c8c863e72ac0eacc8 Mon Sep 17 00:00:00 2001 From: Gowtham M Date: Fri, 7 Nov 2025 10:17:32 +0530 Subject: [PATCH] GWM : policy additional fields added --- app/Controllers/PolicyController.php | 40 ++++++++++++++++++++++++++++ app/Models/PolicyModel.php | 23 +++++++++++++++- 2 files changed, 62 insertions(+), 1 deletion(-) diff --git a/app/Controllers/PolicyController.php b/app/Controllers/PolicyController.php index 1e6227f..2abe2ae 100644 --- a/app/Controllers/PolicyController.php +++ b/app/Controllers/PolicyController.php @@ -107,6 +107,26 @@ class PolicyController extends ResourceController 'agent_id' => $quotData['agent_id'], 'policy_pdf_file_name' => $pdfFileName, 'policy_payment_receipt_file_name' => $receiptFileName, + + // newly added fields + 'tp' => $data['tp'] ?? null, + 'od' => $data['od'] ?? null, + 'pa' => $data['pa'] ?? null, + 'cgst' => $data['cgst'] ?? null, + 'sgst' => $data['sgst'] ?? null, + 'igst' => $data['igst'] ?? null, + 'rto_state_code' => $data['rto_state_code'] ?? null, + 'rto_city_code' => $data['rto_city_code'] ?? null, + 'weight' => $data['weight'] ?? null, + 'fuel_type' => $data['fuel_type'] ?? null, + 'date_of_registration' => format_date_for_database($data['date_of_registration'] ?? null), + 'year_of_manufacture' => $data['year_of_manufacture'] ?? null, + 'engine_no' => $data['engine_no'] ?? null, + 'chassis_no' => $data['chassis_no'] ?? null, + 'make' => $data['make'] ?? null, + 'model' => $data['model'] ?? null, + 'cubic_capacity' => $data['cubic_capacity'] ?? null, + 'vehicle_type' => $data['vehicle_type'] ?? null, 'created_by' => $data['created_by'] ]; @@ -166,6 +186,26 @@ class PolicyController extends ResourceController 'premium_amount' => $data['premium_amount'] ?? $policy['premium_amount'], 'policy_number' => $data['policy_number'] ?? $policy['policy_number'], 'payment_mode' => $data['payment_mode'] ?? $policy['payment_mode'], + + // newly added fields + 'tp' => $data['tp'] ?? null, + 'od' => $data['od'] ?? null, + 'pa' => $data['pa'] ?? null, + 'cgst' => $data['cgst'] ?? null, + 'sgst' => $data['sgst'] ?? null, + 'igst' => $data['igst'] ?? null, + 'rto_state_code' => $data['rto_state_code'] ?? null, + 'rto_city_code' => $data['rto_city_code'] ?? null, + 'weight' => $data['weight'] ?? null, + 'fuel_type' => $data['fuel_type'] ?? null, + 'date_of_registration' => format_date_for_database($data['date_of_registration'] ?? null), + 'year_of_manufacture' => $data['year_of_manufacture'] ?? null, + 'engine_no' => $data['engine_no'] ?? null, + 'chassis_no' => $data['chassis_no'] ?? null, + 'make' => $data['make'] ?? null, + 'model' => $data['model'] ?? null, + 'cubic_capacity' => $data['cubic_capacity'] ?? null, + 'vehicle_type' => $data['vehicle_type'] ?? null, 'updated_by' => $data['updated_by'] ?? null ]; diff --git a/app/Models/PolicyModel.php b/app/Models/PolicyModel.php index 1866547..bdbffd6 100644 --- a/app/Models/PolicyModel.php +++ b/app/Models/PolicyModel.php @@ -28,7 +28,28 @@ class PolicyModel extends Model 'policy_transaction_id', 'pt_oc_share_details_id', 'created_by', - 'updated_by' + 'updated_by', + + // newly added + 'tp', + 'od', + 'pa', + 'cgst', + 'sgst', + 'igst', + 'rto_state_code', + 'rto_city_code', + 'weight', + 'fuel_type', + 'date_of_registration', + 'year_of_manufacture', + 'engine_no', + 'chassis_no', + 'make', + 'model', + 'cubic_capacity', + 'vehicle_type' ]; + protected $useTimestamps = false; }