CHANGE_BDS
This commit is contained in:
parent
8329b66871
commit
e291e81f33
@ -1193,9 +1193,6 @@ class PolicyTransactionController extends BaseController
|
|||||||
// $data['is_cd_reduce_from_bds'] = 1;
|
// $data['is_cd_reduce_from_bds'] = 1;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
$data['is_cd_reduce_from_bds'] = ($data['policy_type_id'] > 7 && $data['client_type'] == 1) ? 1 : 0;
|
|
||||||
|
|
||||||
|
|
||||||
if (empty($data['data_received_date'])) {
|
if (empty($data['data_received_date'])) {
|
||||||
$data['data_received_date'] = null;
|
$data['data_received_date'] = null;
|
||||||
} else {
|
} else {
|
||||||
@ -1255,6 +1252,8 @@ class PolicyTransactionController extends BaseController
|
|||||||
$client_branch_id = $issue_type['client_branch_id'];
|
$client_branch_id = $issue_type['client_branch_id'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$data['is_cd_reduce_from_bds'] = (isset($issue_type['policy_type_id']) && $issue_type['policy_type_id'] > 7 && $data['client_type'] == 1) ? 1 : 0;
|
||||||
|
|
||||||
// if($data['bro_payable_by'] == ""){
|
// if($data['bro_payable_by'] == ""){
|
||||||
// $data['bro_payable_by'] = $issue_type['bro_payable_by'];
|
// $data['bro_payable_by'] = $issue_type['bro_payable_by'];
|
||||||
// }
|
// }
|
||||||
@ -1325,12 +1324,15 @@ class PolicyTransactionController extends BaseController
|
|||||||
|
|
||||||
private function updateEndorsementTransaction($id, $data)
|
private function updateEndorsementTransaction($id, $data)
|
||||||
{
|
{
|
||||||
|
$old_endorse_data = $this->policyTransactionModel->where('id', $id)->where('is_active', 1)->first();
|
||||||
$update = $this->policyTransactionModel->where('id', $id)->set($data)->update();
|
$update = $this->policyTransactionModel->where('id', $id)->set($data)->update();
|
||||||
|
|
||||||
if ($update) {
|
if ($update) {
|
||||||
|
|
||||||
$this->insertTransactionStatus($id, $data, 1);
|
$this->insertTransactionStatus($id, $data, 1);
|
||||||
$this->handleCompletedStatus($data, $id);
|
if($old_endorse_data['status'] != "completed"){
|
||||||
|
$this->handleCompletedStatus($data, $id);
|
||||||
|
}
|
||||||
$this->insertOrUpdateCoShareDetails($data, $id);
|
$this->insertOrUpdateCoShareDetails($data, $id);
|
||||||
|
|
||||||
|
|
||||||
@ -1344,11 +1346,10 @@ class PolicyTransactionController extends BaseController
|
|||||||
{
|
{
|
||||||
if ($data['client_type'] == 1 && $data['status'] == 'completed' && $data['is_cd_reduce_from_bds'] == 1) {
|
if ($data['client_type'] == 1 && $data['status'] == 'completed' && $data['is_cd_reduce_from_bds'] == 1) {
|
||||||
|
|
||||||
$tolamt = $data['total'][0] ?? 0;
|
$tolamt = (int) $data['total'][0] ?? 0;
|
||||||
|
|
||||||
$description = 'The following amount of Rs. ' . round($tolamt, 2) . '/- has been' .
|
$description = 'The following amount of Rs. ' . round($tolamt, 2) . '/- has been' .
|
||||||
($data['action_type'] == 'deletion' ? ' Credit ' : ' Debit ') . 'from the policy transaction (BDS)';
|
($data['action_type'] == 'deletion' ? ' Credit ' : ' Debit ') . 'from the policy transaction (BDS)';
|
||||||
|
|
||||||
$cd_tranction_data = [
|
$cd_tranction_data = [
|
||||||
'amount' => $tolamt,
|
'amount' => $tolamt,
|
||||||
'sub_type_id' => $data['action_type'] == 'deletion' ? 3 : 4,
|
'sub_type_id' => $data['action_type'] == 'deletion' ? 3 : 4,
|
||||||
|
|||||||
@ -363,11 +363,11 @@
|
|||||||
<td>Is Leader?</td>
|
<td>Is Leader?</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr id="table_tr_33">
|
<tr id="table_tr_34">
|
||||||
<td>CD Acc No</td>
|
<td>CD Acc No</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr id="table_tr_34">
|
<tr id="table_tr_37">
|
||||||
<td>CD Amount</td>
|
<td>CD Amount</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
@ -602,20 +602,32 @@ $(document).ready(function(){
|
|||||||
var end_date = $(this).find('option:selected').attr('data-ed');
|
var end_date = $(this).find('option:selected').attr('data-ed');
|
||||||
var policy_type_id = $(this).find('option:selected').attr('data-ptid');
|
var policy_type_id = $(this).find('option:selected').attr('data-ptid');
|
||||||
|
|
||||||
if(policy_type_id == 1 || policy_type_id == 2 || policy_type_id == 3 || policy_type_id == 4 || policy_type_id == 5 || policy_type_id == 6 || policy_type_id == 7){
|
// if(policy_type_id == 1 || policy_type_id == 2 || policy_type_id == 3 || policy_type_id == 4 || policy_type_id == 5 || policy_type_id == 6 || policy_type_id == 7){
|
||||||
$('#is_cd_reduce_from_bds').prop('disabled',true).prop('checked', false)
|
// $('#is_cd_reduce_from_bds').prop('disabled',true).prop('checked', false)
|
||||||
}else{
|
// }else{
|
||||||
$('#is_cd_reduce_from_bds').prop('disabled',false)
|
// $('#is_cd_reduce_from_bds').prop('disabled',false)
|
||||||
}
|
// }
|
||||||
|
|
||||||
if( policy_type_id > 7 ){
|
if( policy_type_id > 7 ){
|
||||||
$('#tpa_endorse_div').hide();
|
$('#tpa_endorse_div').hide();
|
||||||
$('#no_of_insured_endorse_div').hide();
|
$('#table_tr_34').show();
|
||||||
$('#no_of_dependents_endorse_div').hide();
|
$('#table_tr_37').show();
|
||||||
}else{
|
}else{
|
||||||
$('#tpa_endorse_div').show();
|
$('#tpa_endorse_div').show();
|
||||||
|
$('#table_tr_34').hide();
|
||||||
|
$('#table_tr_37').hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if(policy_type_id == 2 || policy_type_id == 3 || policy_type_id == 4 || policy_type_id == 5){
|
||||||
$('#no_of_insured_endorse_div').show();
|
$('#no_of_insured_endorse_div').show();
|
||||||
$('#no_of_dependents_endorse_div').show();
|
$('#no_of_dependents_endorse_div').show();
|
||||||
|
}else if(policy_type_id == 1 || policy_type_id == 6 || policy_type_id == 7) {
|
||||||
|
$('#no_of_insured_endorse_div').show();
|
||||||
|
$('#no_of_dependents_endorse_div').hide();
|
||||||
|
}else{
|
||||||
|
$('#no_of_insured_endorse_div').hide();
|
||||||
|
$('#no_of_dependents_endorse_div').hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -822,8 +834,13 @@ $('#client_type').on('change', function() {
|
|||||||
|
|
||||||
if (selectedClientType == 2) {
|
if (selectedClientType == 2) {
|
||||||
$('.branchdiv').hide();
|
$('.branchdiv').hide();
|
||||||
|
$('#table_tr_34').hide();
|
||||||
|
$('#table_tr_37').hide();
|
||||||
} else {
|
} else {
|
||||||
$('.branchdiv').show();
|
$('.branchdiv').show();
|
||||||
|
$('#table_tr_34').show();
|
||||||
|
$('#table_tr_37').show();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('selectedClientType', selectedClientType);
|
console.log('selectedClientType', selectedClientType);
|
||||||
@ -850,8 +867,14 @@ $('#client_type').on('change', function() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$('#client_policy_id').empty().append($('<option>', {
|
||||||
|
value: '',
|
||||||
|
text: 'Select Policy'
|
||||||
|
}))
|
||||||
|
|
||||||
// Initialize or refresh Select2 for both dropdowns
|
// Initialize or refresh Select2 for both dropdowns
|
||||||
$('#client_id').select2();
|
$('#client_id').select2();
|
||||||
|
$('#client_policy_id').select2();
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#endorsement_no').on('change', function(){
|
$('#endorsement_no').on('change', function(){
|
||||||
@ -968,11 +991,11 @@ function getPolicyTransactionDataForEndorsementEdit(input){
|
|||||||
$('#policy_with_corr').prop('checked', false);
|
$('#policy_with_corr').prop('checked', false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (res.data.is_cd_reduce_from_bds == 1) {
|
// if (res.data.is_cd_reduce_from_bds == 1) {
|
||||||
$('#is_cd_reduce_from_bds').prop('checked', true).prop('checked', false);
|
// $('#is_cd_reduce_from_bds').prop('checked', true).prop('checked', false);
|
||||||
} else {
|
// } else {
|
||||||
$('#is_cd_reduce_from_bds').prop('checked', false);
|
// $('#is_cd_reduce_from_bds').prop('checked', false);
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (res.data.action_type == 'policy_instalment') {
|
if (res.data.action_type == 'policy_instalment') {
|
||||||
$('.install_due_date_div').show()
|
$('.install_due_date_div').show()
|
||||||
@ -990,11 +1013,11 @@ function getPolicyTransactionDataForEndorsementEdit(input){
|
|||||||
addInsurerColumn();
|
addInsurerColumn();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(res.data.policy_type_id == 1 || res.data.policy_type_id == 2 || res.data.policy_type_id == 3 || res.data.policy_type_id == 4 || res.data.policy_type_id == 5 || res.data.policy_type_id == 6 || res.data.policy_type_id == 7){
|
// if(res.data.policy_type_id == 1 || res.data.policy_type_id == 2 || res.data.policy_type_id == 3 || res.data.policy_type_id == 4 || res.data.policy_type_id == 5 || res.data.policy_type_id == 6 || res.data.policy_type_id == 7){
|
||||||
$('#is_cd_reduce_from_bds').prop('disabled',true).prop('checked', false);
|
// $('#is_cd_reduce_from_bds').prop('disabled',true).prop('checked', false);
|
||||||
}else{
|
// }else{
|
||||||
$('#is_cd_reduce_from_bds').prop('disabled',false);
|
// $('#is_cd_reduce_from_bds').prop('disabled',false);
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user