CHANGE_CDMASTER2CDTRAN_ENTRY&FIX_UAT_DATE_ISSUE
This commit is contained in:
parent
9ef8e68270
commit
f71ea394c6
@ -318,6 +318,7 @@ class ClientController extends AdminController
|
||||
4 => 'Debit',
|
||||
5 => 'Non EB',
|
||||
6 => 'Refund By Insurer',
|
||||
7 => 'Opening Amount',
|
||||
];
|
||||
|
||||
$data['subTypeOptions'] = $subTypeOptions;
|
||||
@ -330,6 +331,7 @@ class ClientController extends AdminController
|
||||
$data['clientData'] = $this->clientPolicyModel->getClientById($clientId);
|
||||
$data['deposiamount'] = $this->clientPolicyModel->getDepositSummary($clientId, $insurerId);
|
||||
|
||||
// dd($data['depositdata']);
|
||||
|
||||
// print_r($data['depositdata'] );die;
|
||||
// Load the view for the new list page
|
||||
|
||||
@ -9,6 +9,8 @@ use Psr\Log\LoggerInterface;
|
||||
use CodeIgniter\API\ResponseTrait;
|
||||
use CodeIgniter\Files\File;
|
||||
|
||||
use App\Helpers\DepositHelper;
|
||||
|
||||
use App\Models\UserModel;
|
||||
use App\Models\ClientModel;
|
||||
use App\Models\ClientBranchModel;
|
||||
@ -26,6 +28,7 @@ use App\Models\TPAModel;
|
||||
use App\Models\StateModel;
|
||||
use App\Models\PolicyTypeModel;
|
||||
use App\Models\CDMasterModel;
|
||||
use App\Models\ClientDepositModel;
|
||||
|
||||
class MasterController extends AdminController
|
||||
{
|
||||
@ -48,6 +51,7 @@ class MasterController extends AdminController
|
||||
protected $policyTypeModel;
|
||||
protected $CDMasterModel;
|
||||
protected $clientModel;
|
||||
protected $clientDepositModel;
|
||||
|
||||
|
||||
|
||||
@ -74,9 +78,12 @@ class MasterController extends AdminController
|
||||
$this->policyTypeModel = new PolicyTypeModel();
|
||||
$this->CDMasterModel = new CDMasterModel();
|
||||
$this->clientModel = new ClientModel();
|
||||
$this->clientDepositModel = new ClientDepositModel();
|
||||
|
||||
}
|
||||
|
||||
|
||||
//start insurer
|
||||
public function insurerList()
|
||||
{
|
||||
$this->myLogger->logme('error','Insurer list function called');
|
||||
@ -108,7 +115,6 @@ class MasterController extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function removeInsurerBranch($id = null)
|
||||
{
|
||||
$this->myLogger->logme('error','Insurer Branch Remove function called');
|
||||
@ -124,7 +130,6 @@ class MasterController extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function editInsurerOnboarding($id = null)
|
||||
{
|
||||
|
||||
@ -156,7 +161,6 @@ class MasterController extends AdminController
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function insurerOnboarding()
|
||||
{
|
||||
|
||||
@ -187,7 +191,6 @@ class MasterController extends AdminController
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function createInsurerGeneralInfo()
|
||||
{
|
||||
|
||||
@ -244,7 +247,6 @@ class MasterController extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function insurerBranchList($id = null)
|
||||
{
|
||||
$this->myLogger->logme('error','Edit Insurer Onboarding function called');
|
||||
@ -257,9 +259,6 @@ class MasterController extends AdminController
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public function editInsurerGeneralInfo()
|
||||
{
|
||||
$this->myLogger->logme('error','edit Insurer general info function called');
|
||||
@ -289,7 +288,6 @@ class MasterController extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function editInsurerGet($id = null)
|
||||
{
|
||||
$this->myLogger->logme('error','Edit TPA Onboarding function called');
|
||||
@ -339,15 +337,12 @@ class MasterController extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Insurer Ends
|
||||
// Insurer Ends
|
||||
|
||||
|
||||
|
||||
|
||||
// TPA Start
|
||||
|
||||
// TPA Start
|
||||
|
||||
public function tpaList()
|
||||
{
|
||||
@ -707,7 +702,6 @@ class MasterController extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function removeKYCDocs($id = null)
|
||||
{
|
||||
$this->myLogger->logme('error','KYC Docs Remove function called');
|
||||
@ -748,9 +742,6 @@ class MasterController extends AdminController
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public function createKYCInfo()
|
||||
{
|
||||
|
||||
@ -767,9 +758,6 @@ class MasterController extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public function createKycDocs()
|
||||
{
|
||||
|
||||
@ -794,7 +782,6 @@ class MasterController extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function editKYCOnboarding($id = null)
|
||||
{
|
||||
|
||||
@ -814,9 +801,6 @@ class MasterController extends AdminController
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public function kycDocsList($id = null)
|
||||
{
|
||||
|
||||
@ -831,8 +815,6 @@ class MasterController extends AdminController
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function editKYCInfo()
|
||||
{
|
||||
$this->myLogger->logme('error','edit KYC general info function called');
|
||||
@ -847,7 +829,6 @@ class MasterController extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function editKYCGet($id = null)
|
||||
{
|
||||
$this->myLogger->logme('error','Edit KYC Onboarding function called');
|
||||
@ -860,8 +841,6 @@ class MasterController extends AdminController
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function editKYCDocs()
|
||||
{
|
||||
$this->myLogger->logme('error','edit KYC Docs function called');
|
||||
@ -875,16 +854,12 @@ class MasterController extends AdminController
|
||||
echo json_encode(array("status" => false));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//Ends KYC
|
||||
|
||||
//Start Policy
|
||||
|
||||
|
||||
//Start Policy
|
||||
|
||||
public function policyTypeList()
|
||||
{
|
||||
$this->myLogger->logme('error','Policy Type list function called');
|
||||
@ -901,7 +876,6 @@ class MasterController extends AdminController
|
||||
// $this->loadLayout('insurer_onboarding', $data);
|
||||
}
|
||||
|
||||
|
||||
public function policyTypeRemove($id = null)
|
||||
{
|
||||
$this->myLogger->logme('error','Policy Type Remove function called');
|
||||
@ -956,9 +930,6 @@ class MasterController extends AdminController
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public function createPolicies()
|
||||
{
|
||||
$this->myLogger->logme('error','Policies CREATE function called');
|
||||
@ -980,9 +951,6 @@ class MasterController extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public function createPolicyType()
|
||||
{
|
||||
$this->myLogger->logme('error','Policy Type CREATE function called');
|
||||
@ -999,7 +967,6 @@ class MasterController extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function editPolicyTypeOnboarding($id = null)
|
||||
{
|
||||
|
||||
@ -1020,7 +987,6 @@ class MasterController extends AdminController
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function editPolicyType()
|
||||
{
|
||||
$this->myLogger->logme('error','edit Policy general info function called');
|
||||
@ -1035,7 +1001,6 @@ class MasterController extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function policesList($id = null)
|
||||
{
|
||||
$this->myLogger->logme('error','Edit Policies Onboarding function called');
|
||||
@ -1066,8 +1031,6 @@ class MasterController extends AdminController
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function editPoliciesGet($id = null)
|
||||
{
|
||||
$this->myLogger->logme('error','Edit Policies Onboarding function called');
|
||||
@ -1078,7 +1041,6 @@ class MasterController extends AdminController
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
public function editPolicies()
|
||||
{
|
||||
$this->myLogger->logme('error','edit Policy general info function called');
|
||||
@ -1093,9 +1055,11 @@ class MasterController extends AdminController
|
||||
echo json_encode(array("status" => false));
|
||||
}
|
||||
}
|
||||
|
||||
//end policies
|
||||
|
||||
|
||||
|
||||
//start CD Master list
|
||||
public function CDMasterList()
|
||||
{
|
||||
|
||||
@ -1105,7 +1069,6 @@ class MasterController extends AdminController
|
||||
$this->loadLayout('cd_master_list', $data);
|
||||
}
|
||||
|
||||
|
||||
public function createCDMasterData()
|
||||
{
|
||||
|
||||
@ -1113,13 +1076,30 @@ class MasterController extends AdminController
|
||||
$date = (string) $this->request->getPost('opening_date');
|
||||
$data['opening_date'] = date('Y-m-d', strtotime($date));
|
||||
|
||||
// Prepare the array with data
|
||||
$cd_tranction_data = [
|
||||
'amount' => $data['opening_bal'],
|
||||
'sub_type_id' => 7,
|
||||
'client_id' => $data['client_id'],
|
||||
'client_policy_id' => null,
|
||||
'cd_ac_no' => $data['cd_ac_no'],
|
||||
'endorsement_no' => null,
|
||||
'insurer_id' => $data['insurer_id'],
|
||||
'description' => 'opening Amount',
|
||||
'transaction_type' => 'Credit',
|
||||
'updated_by' => 1,
|
||||
];
|
||||
|
||||
$loggedInUserID = get_session_userid();
|
||||
|
||||
if ($data) {
|
||||
|
||||
$insert = $this->CDMasterModel->insert($data);
|
||||
|
||||
if ($insert) {
|
||||
|
||||
$response = DepositHelper::saveDeposit($cd_tranction_data, $loggedInUserID);
|
||||
|
||||
session()->setFlashdata('success', "Cash Deposite Master Added Successfully");
|
||||
return redirect()->to(base_url('/master/cash_deposite/list'));
|
||||
} else {
|
||||
@ -1134,7 +1114,6 @@ class MasterController extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function editCDMasterData($id = null)
|
||||
{
|
||||
|
||||
@ -1147,6 +1126,18 @@ class MasterController extends AdminController
|
||||
|
||||
$insert = $this->CDMasterModel->where('id', $id)->set($data)->update();
|
||||
|
||||
$cd_transaction_updated_data = [
|
||||
'balance' => $data['opening_bal'],
|
||||
'amount' => $data['opening_bal']
|
||||
];
|
||||
|
||||
$cd_tranction = $this->clientDepositModel
|
||||
->where('client_id', $data['client_id'])
|
||||
->where('insurer_id', $data['insurer_id'])
|
||||
->where('cd_ac_no', $data['cd_ac_no'])
|
||||
->where('sub_type', 7)
|
||||
->set($cd_transaction_updated_data)->update();
|
||||
|
||||
if ($insert) {
|
||||
|
||||
session()->setFlashdata('success', "Cash Deposite Master Updated Successfully");
|
||||
@ -1187,8 +1178,8 @@ class MasterController extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function removeCDMaster($id){
|
||||
public function removeCDMaster($id)
|
||||
{
|
||||
|
||||
$this->myLogger->logme('error','CDMaster Remove function called');
|
||||
$data['updated_by'] = get_session_userid();
|
||||
|
||||
@ -10,9 +10,10 @@ if(!function_exists('calculate_days_bw_dates'))
|
||||
function calculate_days_bw_dates(string $from_date = "", string $to_date ="",bool $include_start_date = true)
|
||||
{
|
||||
if($to_date == ""){ $currentDateTime = new DateTime(); }
|
||||
else{ $currentDateTime = new DateTime($to_date); }
|
||||
else{ $to_date = convert_string_to_date($to_date); $currentDateTime = new DateTime($to_date); }
|
||||
|
||||
if($from_date == ""){ $passedDateTime = new DateTime(); }
|
||||
else{ $passedDateTime = new DateTime($from_date); }
|
||||
else{ $from_date = convert_string_to_date($from_date); $passedDateTime = new DateTime($from_date); }
|
||||
|
||||
$interval = $currentDateTime->diff($passedDateTime);
|
||||
// $totalDays = $interval->days;
|
||||
@ -246,7 +247,7 @@ if(!function_exists('check_si'))
|
||||
}
|
||||
|
||||
// check age slab
|
||||
if(in_array(strtoupper($row['current_action']), ['I','A','DA']) && strtolower($row['5']) == 'self')
|
||||
if(in_array(strtoupper($row['current_action']), ['I','A','DA']) && (($slab_value['premium_type'] == 1 && strtolower($row['5']) == 'self' ) || ($slab_value['premium_type'] == 2) ) )
|
||||
{
|
||||
if($row[3] != '' && $row[3] != null)// dob
|
||||
{
|
||||
|
||||
@ -187,13 +187,15 @@ class ClientPolicyModel extends Model
|
||||
->select('cash_deposit.*')
|
||||
->select('insurers.name as insurer_name, insurers.short_name as insurer_short')
|
||||
->select('clients.client_name as clientname, clients.short_name as clientshort')
|
||||
->select('policies.name as policy_name')
|
||||
// ->select('policies.name as policy_name')
|
||||
->select('policy_type.policy_type')
|
||||
->select('user_profiles.first_name as username')
|
||||
->join('user_profiles', 'user_profiles.id = cash_deposit.created_by', 'left')
|
||||
->join('insurers', 'insurers.id = cash_deposit.insurer_id', 'left')
|
||||
->join('clients', 'clients.id = cash_deposit.client_id', 'left')
|
||||
->join('client_policy', 'client_policy.id = cash_deposit.client_policy_id', 'left')
|
||||
->join('policies', 'policies.id = client_policy.policy_id', 'left')
|
||||
// ->join('policies', 'policies.id = client_policy.policy_id', 'left')
|
||||
->join('policy_type', 'policy_type.id = client_policy.policy_type_id', 'left')
|
||||
->where('cash_deposit.client_id', $clientId)
|
||||
->where('cash_deposit.insurer_id', $insurerId)
|
||||
->where('cash_deposit.is_active', 1)
|
||||
@ -263,25 +265,13 @@ public function getBalances($clientId)
|
||||
|
||||
public function getDepositlistsummary($id)
|
||||
{
|
||||
// return $this->db->table('cash_deposit')
|
||||
// ->select('insurer_id')
|
||||
// ->select('SUM(CASE WHEN transaction_type = "Credit" THEN amount ELSE -amount END) AS balance')
|
||||
// ->where('client_id', $id)
|
||||
// ->groupBy('insurer_id')
|
||||
// ->get()
|
||||
// ->getResult();
|
||||
|
||||
return $this->db->table('cash_deposit')
|
||||
->select('cash_deposit.insurer_id, cash_deposit.cd_ac_no')
|
||||
->select('(SUM(CASE WHEN cash_deposit.transaction_type = \'Credit\' THEN cash_deposit.amount ELSE -cash_deposit.amount END) + cd_master.opening_bal) AS balance')
|
||||
->join('cd_master', 'cd_master.cd_ac_no = cash_deposit.cd_ac_no')
|
||||
->where('cash_deposit.client_id', $id)
|
||||
->groupBy(['cash_deposit.insurer_id', 'cash_deposit.cd_ac_no', 'cd_master.opening_bal'])
|
||||
->orderBy('cash_deposit.insurer_id', 'DESC')
|
||||
->orderBy('cash_deposit.cd_ac_no', 'DESC')
|
||||
->get()
|
||||
->getResult();
|
||||
|
||||
->select('insurer_id')
|
||||
->select('SUM(CASE WHEN transaction_type = "Credit" THEN amount ELSE -amount END) AS balance')
|
||||
->where('client_id', $id)
|
||||
->groupBy('insurer_id')
|
||||
->get()
|
||||
->getResult();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -60,7 +60,9 @@ table.dataTable thead th {
|
||||
<div class="btn-group dropdown">
|
||||
<a href="javascript: void(0);"class="dropdown-toggle arrow-none btn btn-light btn-sm" data-toggle="dropdown"aria-expanded="false"><i class="mdi mdi-dots-horizontal"></i></a>
|
||||
<div class="dropdown-menu dropdown-menu-right">
|
||||
<a class="dropdown-item btnEdit" data-id="<?= $row['id'];?>" data-toggle="modal" data-target="#con-close-modal"> <i class="mdi mdi-pencil mr-2 text-muted font-18 vertical-middle"></i>Edit</a>
|
||||
<?php if($row['cd_ac_no_count_cd_tranction'] <= 1) { ?>
|
||||
<a class="dropdown-item btnEdit" data-id="<?= $row['id'];?>" data-toggle="modal" data-target="#con-close-modal"> <i class="mdi mdi-pencil mr-2 text-muted font-18 vertical-middle"></i>Edit</a>
|
||||
<?php } ?>
|
||||
<?php if($row['cd_ac_no_count'] == 0) { ?>
|
||||
<a class="dropdown-item" data-id="<?= $row['id'];?>" onclick="removeCDMaster(this)"><i class="mdi mdi-delete mr-2 text-muted font-18 vertical-middle"></i>Delete</a>
|
||||
<?php } ?>
|
||||
|
||||
@ -108,7 +108,7 @@
|
||||
<tr>
|
||||
<th class="font-weight-medium">Date</th>
|
||||
<!-- <th class="font-weight-medium">CD Account No</th> -->
|
||||
<th class="font-weight-medium">Policy Name</th>
|
||||
<th class="font-weight-medium">Policy</th>
|
||||
<th class="font-weight-medium">Endorsement No</th>
|
||||
<th class="font-weight-medium">Sub Type</th>
|
||||
<th class="font-weight-medium">Credit</th>
|
||||
@ -122,7 +122,8 @@
|
||||
<?php foreach($depositdata as $row) { ?>
|
||||
<tr id="<?php echo $row->id;?>">
|
||||
<td><?php echo date('d-M-Y h:i A', strtotime($row->created_at)); ?></td>
|
||||
<td><?php echo $row->policy_name ?? '<center> - </center>'; ?></td>
|
||||
<!-- <td><?php echo $row->policy_name ?? '<center> - </center>'; ?></td> -->
|
||||
<td><?php echo $row->policy_type ?? '<center> - </center>'; ?></td>
|
||||
<td><?php echo $row->endorsement_no ?? '<center> - </center>'; ?></td>
|
||||
<td><?php echo isset($subTypeOptions[$row->sub_type]) ? $subTypeOptions[$row->sub_type] : ''; ?>
|
||||
</td>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user