CHNAGE_BDS_FEEDBACKS

This commit is contained in:
velz 2025-01-21 14:05:07 +05:30
parent ce31e6f4a9
commit 78b3b7f4e6
5 changed files with 109 additions and 22 deletions

View File

@ -1480,7 +1480,7 @@ class PolicyTransactionController extends BaseController
//Actual data for the list
$data['report_list'] = $this->policyTransactionModel->getBDSReportList($start_date, $end_date, $client_id, $insurer_id, $policy_type_id, $date_type, $issuer, $client_branch_id, $insurer_branch_id, $client_policy_id);
// dd($data['report_list']);
//!dd($data['report_list']);
$this->loadLayout('report_bds_filter', $data);
}
@ -1529,6 +1529,7 @@ class PolicyTransactionController extends BaseController
$data['varience_list'] = $this->policyTransactionModel->getVarienceReportLIst($start_date, $end_date, $client_id, $insurer_id, $policy_type_id, $date_type, $issuer, $client_branch_id, $insurer_branch_id, $client_policy_id);
// !dd($data['varience_list']);
$this->loadLayout('variance_report_list', $data);
}
@ -1768,6 +1769,12 @@ class PolicyTransactionController extends BaseController
return $this->respond(['dataStatus' => false, 'code' => 404, 'message' => 'file not uploaded', 'error_data' => $validation_result['error_data'],'error_code' => $validation_result['error_code']], 200);
}
if (isset($file_id) || $validation_result['status']) {
$this->insurerStatements->where('id', $file_id)->set(['invoice_status' => 'pending'])->update();
}
return $this->respond(['dataStatus' => true, 'code' => 200, 'data' => 'file upload success'], 200);
}

View File

@ -363,7 +363,6 @@ class PolicyTransactionModel extends Model
vehicle.vehicle_no,
tpa.name as tpa_name,
pt_co_share_details.remark as remarks,
pt_co_share_details.reward,
pt_co_share_details.bp_amt,
pt_co_share_details.exp_amt,
pt_co_share_details.id as pt_id,
@ -383,7 +382,6 @@ class PolicyTransactionModel extends Model
(pt_co_share_details.agreed_tp_per + pt_co_share_details.agreed_tep_per) AS agreed_tp_or_ter_per,
pt_co_share_details.agreed_bp_per,
ROUND(
(
SELECT
@ -405,6 +403,24 @@ class PolicyTransactionModel extends Model
),
2
) AS total_irda_amt,
ROUND(
(
SELECT
(
SUM(co_share_stmt_details.reward)
) AS reward
FROM
co_share_stmt_details
JOIN insurer_statements ON co_share_stmt_details.statement_id = insurer_statements.id
WHERE
co_share_stmt_details.co_share_id = pt_co_share_details.id
AND co_share_stmt_details.is_active = 1
AND insurer_statements.is_active = 1
$date_condition
),
2
) AS reward,
ROUND(
(
@ -424,7 +440,7 @@ class PolicyTransactionModel extends Model
AND co_share_stmt_details.is_active = 1
AND pt_table.is_active = 1
AND insurer_statements.is_active = 1
AND insurer_statements.invoice_no IS NOT NULL
AND insurer_statements.invoice_status IS NOT NULL
$date_condition
),
@ -467,7 +483,7 @@ class PolicyTransactionModel extends Model
AND co_share_stmt_details.is_active = 1
AND pt_table.is_active = 1
AND insurer_statements.is_active = 1
AND insurer_statements.invoice_no IS NULL
AND insurer_statements.invoice_status IS NULL
$date_condition
)
),
@ -735,16 +751,55 @@ class PolicyTransactionModel extends Model
pt_co_share_details.exp_amt,
pt_co_share_details.variance,
ROUND ( (pt_co_share_details.bp_amt + pt_co_share_details.tp_amt + pt_co_share_details.tep_amt),2) as original_premium,
ROUND(
(
SELECT
(
SUM(co_share_stmt_details.actual_bp_amt) + SUM(co_share_stmt_details.actual_tp_amt) + SUM(co_share_stmt_details.actual_bp_per)
) AS total_stmt_amt
FROM
co_share_stmt_details
JOIN insurer_statements ON co_share_stmt_details.statement_id = insurer_statements.id and insurer_statements.is_active = 1
WHERE
co_share_stmt_details.co_share_id = pt_co_share_details.id
AND co_share_stmt_details.is_active = 1
),
2
) AS statement_premium,
COALESCE(
(pt_co_share_details.bp_amt + pt_co_share_details.tp_amt + pt_co_share_details.tep_amt), 0
) -
COALESCE(
(
SELECT
SUM(co_share_stmt_details.actual_bp_amt) +
SUM(co_share_stmt_details.actual_tp_amt) +
SUM(co_share_stmt_details.actual_bp_per)
FROM
co_share_stmt_details
JOIN
insurer_statements
ON
co_share_stmt_details.statement_id = insurer_statements.id
AND insurer_statements.is_active = 1
WHERE
co_share_stmt_details.co_share_id = pt_co_share_details.id
AND co_share_stmt_details.is_active = 1
), 0
) AS premium_variance_amt,
ROUND(
(
SELECT
(
SUM(co_share_stmt_details.actual_bp_brokerage_amt) + SUM(co_share_stmt_details.actual_tp_brokerage_amt) + SUM(co_share_stmt_details.actual_tep_brokerage_amt)
SUM(co_share_stmt_details.actual_bp_brokerage_amt) + SUM(co_share_stmt_details.actual_tp_brokerage_amt) + SUM(co_share_stmt_details.actual_tep_brokerage_amt) + SUM(co_share_stmt_details.reward)
) AS total_irda_amt
FROM
co_share_stmt_details
JOIN insurer_statements ON co_share_stmt_details.statement_id = insurer_statements.id
JOIN insurer_statements ON co_share_stmt_details.statement_id = insurer_statements.id and insurer_statements.is_active = 1
WHERE
co_share_stmt_details.co_share_id = pt_co_share_details.id
AND co_share_stmt_details.is_active = 1
@ -759,11 +814,11 @@ class PolicyTransactionModel extends Model
(
SUM(co_share_stmt_details.actual_bp_brokerage_amt) +
SUM(co_share_stmt_details.actual_tp_brokerage_amt) +
SUM(co_share_stmt_details.actual_tep_brokerage_amt)
SUM(co_share_stmt_details.actual_tep_brokerage_amt) + SUM(co_share_stmt_details.reward)
)
FROM co_share_stmt_details
JOIN insurer_statements
ON co_share_stmt_details.statement_id = insurer_statements.id
ON co_share_stmt_details.statement_id = insurer_statements.id and insurer_statements.is_active = 1
WHERE
co_share_stmt_details.co_share_id = pt_co_share_details.id
AND co_share_stmt_details.is_active = 1
@ -783,7 +838,18 @@ class PolicyTransactionModel extends Model
->join('policy_type', 'policy_transaction.policy_type_id = policy_type.id', 'left')
->where('policy_transaction.is_active', 1)
->where('pt_co_share_details.is_active', 1)
->having('variance_amt IS NOT NULL');
// ->where('insurer_statements.is_active',1);
// ->having('variance_amt IS NOT NULL')
// ->having('variance_amt !=',0)
// ->having('premium_variance_amt IS NOT NULL')
// ->having('premium_variance_amt !=',0);
// ->group_start()
->having('variance_amt IS NOT NULL')
->orHaving('variance_amt !=', 0)
->having('premium_variance_amt IS NOT NULL')
->orHaving('premium_variance_amt !=', 0);
// ->group_end();
// ->where('pt_co_share_details.actual_bp_brokerage_amt IS NOT NULL AND pt_co_share_details.actual_bp_brokerage_amt != 0');
// ->where('pt_co_share_details.variance IS NOT NULL')
// ->where('pt_co_share_details.variance !=', 0);

View File

@ -399,7 +399,7 @@ custom-dropdown-menu {
<div class="form-group col-md-4">
<label for="invoice_value_modal">Invoice value<span id="base_danger" class="text-danger"></span></label>
<input type="number" class="form-control" id="invoice_value_modal" name="invoice_value" placeholder="Enter Invoice Value" readonly>
<input type="number" class="form-control" id="invoice_value_modal" name="invoice_value" placeholder="Enter Invoice Value" readonly step="0.01">
</div>
@ -431,7 +431,7 @@ custom-dropdown-menu {
<div class="row" id="modal_received_amt_div">
<div class="form-group col-md-4" >
<label for="addon_policy">Total Received Amount</label>
<input type="number" class="form-control" id="modal_received_amt" placeholder="" disabled>
<input type="number" class="form-control" id="modal_received_amt" placeholder="" disabled step="0.01">
</div>
</div>
<!-- </div> -->
@ -458,7 +458,7 @@ custom-dropdown-menu {
<tbody>
<tr>
<td style="display: none;"><input type="hidden" class="form-control" name="pk[]" placeholder="Enter Amount"></td>
<td><input type="number" class="form-control" name="received_amount[]" placeholder="Enter Amount" required onchange="checkInvAmont(event)"></td>
<td><input type="number" class="form-control" name="received_amount[]" placeholder="Enter Amount" required step="0.01" onchange="checkInvAmont(event)"></td>
<td><input type="number" class="form-control" name="gst_amount[]" placeholder="Enter GST" required step="0.01" onchange="checkInvAmont(event)"></td>
<td><input type="number" class="form-control" name="tds[]" placeholder="Enter TDS" onchange="checkInvAmont(event)" required></td>
<td><input type="text" class="form-control" name="utr_no[]" placeholder="Enter UTR No" required></td>
@ -676,7 +676,8 @@ document.addEventListener("DOMContentLoaded", function () {
// alert($('#invoice_date_modal').val());
if((!form.checkValidity()))
{
// console.log('error2');
console.log('error2');
console.log(form.checkValidity());
return false;
}
@ -748,7 +749,7 @@ document.addEventListener("DOMContentLoaded", function () {
newRow.innerHTML = `
<td style="display: none;"><input type="hidden" class="form-control" name="pk[]" placeholder="Enter Amount"></td>
<td><input type="number" class="form-control" name="received_amount[]" placeholder="Enter Amount" onchange="checkInvAmont(event)" required></td>
<td><input type="number" class="form-control" name="received_amount[]" placeholder="Enter Amount" onchange="checkInvAmont(event)" required step="0.01"></td>
<td><input type="number" class="form-control" name="gst_amount[]" placeholder="Enter GST" onchange="checkInvAmont(event)" required step="0.01"></td>
<td><input type="number" class="form-control" name="tds[]" placeholder="Enter TDS" onchange="checkInvAmont(event)" required></td>
<td><input type="text" class="form-control" name="utr_no[]" placeholder="Enter UTR No" required></td>
@ -891,7 +892,7 @@ function showInvoiceStatusModal(event)
var row = paymentTableBody.insertRow();
row.innerHTML = `
<td style="display: none;"><input type="hidden" class="form-control" name="pk[]" value="${payment.id}"></td>
<td><input type="number" class="form-control" name="received_amount[]" placeholder="Enter Amount" value="${payment.inv_amt}" onchange="checkInvAmont(event)" required></td>
<td><input type="number" class="form-control" name="received_amount[]" placeholder="Enter Amount" value="${payment.inv_amt}" onchange="checkInvAmont(event)" required step="0.01"></td>
<td><input type="number" class="form-control" name="gst_amount[]" placeholder="Enter Amount" value="${payment.gst}" onchange="checkInvAmont(event)" required step="0.01"></td>
<td><input type="number" class="form-control" name="tds[]" placeholder="Enter Amount" value="${payment.tds}" onchange="checkInvAmont(event)" required></td>
<td><input type="text" class="form-control" name="utr_no[]" placeholder="Enter UTR No" value="${payment.utr_no}" required></td>

View File

@ -61,10 +61,11 @@ table.dataTable tbody td {
<th>Total Premium</th>
<th>Base <br> Revenue %</th>
<th>TP / Terrorism <br> Revenue %</th>
<th>Rewards</th>
<th>Total IRDA <br> Revenue INR</th>
<th>Billed Amount</th>
<th>UnBilled Amount</th>
<th>Rewards</th>
</tr>
</thead>
<tbody>
@ -97,11 +98,17 @@ table.dataTable tbody td {
<td class="right-align-input"><?php echo $row['total_premium']; ?></td>
<td class="right-align-input"><?php echo $row['agreed_bp_per']; ?>&nbsp;%</td>
<td class="right-align-input"><?php echo $row['agreed_tp_or_ter_per'];?>&nbsp;%</td>
<td class="right-align-input" onclick="showCoShareStatementDetails(this)" data-id="<?= $row['pt_id'] ?>"><?php echo empty($row['total_irda_amt']) ? $row['exp_amt'] : $row['total_irda_amt']; ?></td>
<td class="right-align-input"><?php echo isset($row['reward']) ? $row['reward'] : '0.00'; ?></td>
<?php $total_irda_amt = empty($row['total_irda_amt']) ? $row['exp_amt'] : $row['total_irda_amt']; ?>
<td class="right-align-input" onclick="showCoShareStatementDetails(this)" data-id="<?= $row['pt_id'] ?>"><?php echo $total_irda_amt; ?></td>
<td class="right-align-input"><?php echo empty($row['billed_amt']) ? '0.00' : $row['billed_amt'] ?></td>
<!-- <td class="right-align-input"><?php echo empty($row['unbilled_amt']) ? '0.00' : $row['unbilled_amt']?></td> -->
<td class="right-align-input"><?php echo number_format((float)$row['total_irda_amt'] - $row['billed_amt'],2, '.', '')?></td>
<td class="right-align-input"><?php echo $row['reward']; ?></td>
<?php
$unbilled_amt = $row['total_irda_amt'] - $row['billed_amt'];
$unbilled_amt = $unbilled_amt == 0 && $row['billed_amt'] == 0 ? $total_irda_amt : $unbilled_amt ;
?>
<td class="right-align-input"><?php echo number_format((float)$unbilled_amt,2, '.', '')?></td>
</tr>
<?php } ?>
<?php } ?>

View File

@ -170,6 +170,9 @@ table.dataTable tbody td {
<th>Insurer Branch</th>
<th>Policy</th>
<th>Endorsement No</th>
<th>Premium</th>
<th>Statement Premium</th>
<th>Premium Variance</th>
<th>Expected Amount</th>
<th>Statement Amount</th>
<th>Variance</th>
@ -186,9 +189,12 @@ table.dataTable tbody td {
<td><?php echo $row['insurer_branch_name']; ?></td>
<td><?php echo $row['policy_type'] .' - '. $row['policy_no']; ?></td>
<td><?php echo $row['endorsement_no']; ?></td>
<td class="right-align-input"><?php echo $row['original_premium']; ?></td>
<td class="right-align-input"><?php echo isset($row['statement_premium']) ? $row['statement_premium'] : '0.00'; ?></td>
<td class="right-align-input"><?php echo $row['premium_variance_amt']; ?></td>
<td class="right-align-input"><?php echo $row['exp_amt']; ?></td>
<td class="right-align-input"><?php echo $row['statement_amount']; ?></td>
<td class="right-align-input"><?php echo $row['variance_amt']; ?></td>
<td class="right-align-input"><?php echo isset($row['statement_amount']) ? $row['statement_amount'] : '0.00'; ?></td>
<td class="right-align-input"><?php echo isset($row['variance_amt']) ? $row['variance_amt'] : '0.00'; ?></td>
</tr>
<?php } ?>
<?php } ?>