Merge branch 'main' of bitbucket.org:jubilian/nhance_partner_be

This commit is contained in:
sanjeev.p 2025-12-16 15:01:30 +05:30
commit 8ea62f6b0f
5 changed files with 17 additions and 11 deletions

View File

@ -105,7 +105,7 @@ class InvoiceController extends ResourceController
'agent_id' => $input['agent_id'] ?? '', 'agent_id' => $input['agent_id'] ?? '',
'till_date' => $input['till_date'] ? date('Y-m-d', strtotime($input['till_date'])) : null, 'till_date' => $input['till_date'] ? date('Y-m-d', strtotime($input['till_date'])) : null,
'invoice_date' => $input['invoice_date'] ? date('Y-m-d', strtotime($input['invoice_date'])) : null, 'invoice_date' => $input['invoice_date'] ? date('Y-m-d', strtotime($input['invoice_date'])) : null,
'payout_status' => $input['payout_status'] ?? 0, 'payout_status' => 1,
'is_active' => 1, 'is_active' => 1,
'updated_at' => date('Y-m-d H:i:s'), 'updated_at' => date('Y-m-d H:i:s'),
'updated_by' => $input['updated_by'] ?? 0 'updated_by' => $input['updated_by'] ?? 0

View File

@ -54,7 +54,7 @@ class MasterController extends ResourceController
public function getRoleMaster() public function getRoleMaster()
{ {
$data = $this->RoleMasterModel->whereIn('id',[2,3])->findAll(); $data = $this->RoleMasterModel->whereIn('id',[2,3,4])->findAll();
if (!$data) { if (!$data) {
return $this->failNotFound('No data found'); return $this->failNotFound('No data found');
@ -162,6 +162,7 @@ class MasterController extends ResourceController
$data = [ $data = [
'name' => $input['name'], 'name' => $input['name'],
'short_name' => $input['short_name'],
'is_active' => 1, 'is_active' => 1,
'created_by' => $input['created_by'] ?? null, 'created_by' => $input['created_by'] ?? null,
]; ];
@ -197,7 +198,8 @@ class MasterController extends ResourceController
} }
$data = [ $data = [
'name' => $input['name'] ?? null, 'name' => $input['name'] ,
'short_name'=> $input['short_name'],
'updated_by' => $input['updated_by'] ?? null, 'updated_by' => $input['updated_by'] ?? null,
]; ];

View File

@ -31,7 +31,7 @@ class StaffController extends ResourceController
$data = $this->StaffModel->select('partner_staff.* , R.role') $data = $this->StaffModel->select('partner_staff.* , R.role')
->join('partner_role_master R', 'R.id = partner_staff.role_id', 'left') ->join('partner_role_master R', 'R.id = partner_staff.role_id', 'left')
->where('partner_staff.manager_id' , $manager_id ) ->where('partner_staff.manager_id' , $manager_id )
->whereIn('partner_staff.role_id' , [2,3] ) ->whereIn('partner_staff.role_id' , [2,3,4] )
->findAll(); ->findAll();
}else if(!empty($handler_id)){ }else if(!empty($handler_id)){

View File

@ -108,6 +108,7 @@ if (!function_exists('createBDS')) {
'month' => $policyData['issued_date'], 'month' => $policyData['issued_date'],
'policy_start_date' => $policyData['start_date'], 'policy_start_date' => $policyData['start_date'],
'policy_end_date' => $policyData['end_date'], 'policy_end_date' => $policyData['end_date'],
'renewal_date' => (new DateTime($policyData['end_date']))->modify('+1 day')->format('Y-m-d'),
'endorsement_no' => null, 'endorsement_no' => null,
'action_type' => 'inception', 'action_type' => 'inception',
'revenue_type' => "NA", 'revenue_type' => "NA",
@ -131,13 +132,15 @@ if (!function_exists('createBDS')) {
// 5. Always create pt co-share details // 5. Always create pt co-share details
$ptCoShareDetails = [ $ptCoShareDetails = [
'pt_id' => $policyTransactionId, 'pt_id' => $policyTransactionId,
'insurer_id' => $policyData['insurer_id'], 'insurer_id' => $policyData['insurer_id'],
'insurer_branch_id' => $policyData['insurer_branch_id'], 'insurer_branch_id' => $policyData['insurer_branch_id'],
'co_share_type' => 1, 'co_share_type' => 1,
'co_share_per' => 100, 'co_share_per' => 100,
'bp_amt' => $policyData['premium_amount'], 'bp_amt' => $policyData['premium_amount'],
'cop_amt' => $policyData['premium_amount'], 'cop_amt' => $policyData['premium_amount'],
'exp_amt' => $policyData['commission_amount'],
'pt_policy_issue_date' => $policyData['issued_date']
]; ];
$ptCoShareId = $ptCoShareDetailsModel->insert($ptCoShareDetails, true); $ptCoShareId = $ptCoShareDetailsModel->insert($ptCoShareDetails, true);
$log[] = "PT Co-Share details created (ID: {$ptCoShareId})"; $log[] = "PT Co-Share details created (ID: {$ptCoShareId})";

View File

@ -14,6 +14,7 @@ class PartnerBrokerModel extends Model
protected $allowedFields = [ protected $allowedFields = [
'name', 'name',
'short_name',
'is_active', 'is_active',
'created_by', 'created_by',
'updated_by' 'updated_by'