diff --git a/app/Controllers/PolicyTransactionController.php b/app/Controllers/PolicyTransactionController.php index e5f9348a..9c941c39 100644 --- a/app/Controllers/PolicyTransactionController.php +++ b/app/Controllers/PolicyTransactionController.php @@ -214,25 +214,25 @@ class PolicyTransactionController extends BaseController // $data['renewal_date'] = change_date_format($this->request->getPost('renewal_date'), 'd/m/Y', 'Y-m-d') ?? null; // $data['rollover_date'] = change_date_format($this->request->getPost('rollover_date'), 'd/m/Y', 'Y-m-d') ?? null; - $data['policy_issue_date'] = (isset($data['policy_issue_date']) && $data['policy_issue_date'] !== null && $data['policy_issue_date'] !== '') - ? date('d/m/Y', strtotime($data['policy_issue_date'])) - : null; + // $data['policy_issue_date'] = (isset($data['policy_issue_date']) && $data['policy_issue_date'] !== null && $data['policy_issue_date'] !== '') + // ? date('d/m/Y', strtotime($data['policy_issue_date'])) + // : null; - $data['policy_start_date'] = (isset($data['policy_start_date']) && $data['policy_start_date'] !== null && $data['policy_start_date'] !== '') - ? date('d/m/Y', strtotime($data['policy_start_date'])) - : null; + // $data['policy_start_date'] = (isset($data['policy_start_date']) && $data['policy_start_date'] !== null && $data['policy_start_date'] !== '') + // ? date('d/m/Y', strtotime($data['policy_start_date'])) + // : null; - $data['policy_end_date'] = (isset($data['policy_end_date']) && $data['policy_end_date'] !== null && $data['policy_end_date'] !== '') - ? date('d/m/Y', strtotime($data['policy_end_date'])) - : null; + // $data['policy_end_date'] = (isset($data['policy_end_date']) && $data['policy_end_date'] !== null && $data['policy_end_date'] !== '') + // ? date('d/m/Y', strtotime($data['policy_end_date'])) + // : null; - $data['renewal_date'] = (isset($data['renewal_date']) && $data['renewal_date'] !== null && $data['renewal_date'] !== '') - ? date('d/m/Y', strtotime($data['renewal_date'])) - : null; + // $data['renewal_date'] = (isset($data['renewal_date']) && $data['renewal_date'] !== null && $data['renewal_date'] !== '') + // ? date('d/m/Y', strtotime($data['renewal_date'])) + // : null; - $data['rollover_date'] = (isset($data['rollover_date']) && $data['rollover_date'] !== null && $data['rollover_date'] !== '') - ? date('d/m/Y', strtotime($data['rollover_date'])) - : null; + // $data['rollover_date'] = (isset($data['rollover_date']) && $data['rollover_date'] !== null && $data['rollover_date'] !== '') + // ? date('d/m/Y', strtotime($data['rollover_date'])) + // : null; // Separate Insurer and TPA Branch IDs and IDs @@ -268,8 +268,8 @@ class PolicyTransactionController extends BaseController $data['ct_type'] = 1; } - $month = '01-'.(string)$this->request->getPost('month'); - $data['month'] = empty($data['month']) ? null : date('Y-m-d', strtotime($month)); + // $month = '01-'.(string)$this->request->getPost('month'); + // $data['month'] = empty($data['month']) ? null : date('Y-m-d', strtotime($month)); // Determine $is_addon value $data['is_addon'] = in_array($data['policy_type_id'], [1, 2, 6, 7]) ? 1 : @@ -825,12 +825,13 @@ class PolicyTransactionController extends BaseController $endorse_eff_date = (string)$this->request->getPost('endorse_eff_date'); $month = (string)$this->request->getPost('month'); - $data['data_received_date'] = empty($data['data_received_date']) ? null : date('Y-m-d', strtotime($data_received_date)); - $data['closure_date'] = empty($data['closure_date']) ? null : date('Y-m-d', strtotime($closure_date)); - $data['endorse_eff_date'] = empty($data['endorse_eff_date']) ? null : date('Y-m-d', strtotime($endorse_eff_date)); + $data['data_received_date'] = empty($data['data_received_date']) ? null : change_date_format($data_received_date,'d/m/Y','Y-m-d'); + //date('Y-m-d', strtotime($data_received_date)); + $data['closure_date'] = empty($data['closure_date']) ? null : change_date_format($closure_date,'d/m/Y','Y-m-d'); + $data['endorse_eff_date'] = empty($data['endorse_eff_date']) ? null : change_date_format($endorse_eff_date,'d/m/Y','Y-m-d'); - $month = '01-'.$data['month']; - $data['month'] = empty($data['month']) ? null : date('Y-m-d', strtotime($month)); + $month = $data['month'].'/01'; + $data['month'] = empty($data['month']) ? null : change_date_format($month,'M/Y/d','Y-m-d'); // Separate Insurer and TPA Branch IDs and IDs if(isset($data['insurer_id']) && !empty($data['insurer_id'])){ @@ -934,7 +935,7 @@ class PolicyTransactionController extends BaseController { if ($data['status'] == 'completed' && $data['ct_type'] == 2) { - $tolamt = $data['total'][0] ?? 0; + $tolamt = isset($data['total'][0]) && is_numeric($data['total'][0]) ? $data['total'][0] : 0; $description = 'The following amount of Rs. ' . round($tolamt, 2) . '/- has been' . ($data['action_type'] == 'deletion' ? ' Credit ' : ' Debit ') . 'from the policy transaction'; diff --git a/app/Models/PolicyTransactionModel.php b/app/Models/PolicyTransactionModel.php index bb94a40e..df32d967 100644 --- a/app/Models/PolicyTransactionModel.php +++ b/app/Models/PolicyTransactionModel.php @@ -479,12 +479,25 @@ class PolicyTransactionModel extends Model pt_co_share_details.exp_amt, pt_co_share_details.variance, insurer_statements.invoice_amount, + insurer_statements.invoice_status, - ROUND((pt_co_share_details.actual_bp_brokerage_amt + pt_co_share_details.actual_tp_brokerage_amt + pt_co_share_details.actual_tep_brokerage_amt), 2) AS realization_amount + ROUND((pt_co_share_details.actual_bp_brokerage_amt + pt_co_share_details.actual_tp_brokerage_amt + pt_co_share_details.actual_tep_brokerage_amt), 2) AS realization_amount2, + + ( + SELECT + (SUM(inv_payment_details.inv_amt) + SUM(inv_payment_details.tds)) AS realization_amount + FROM + inv_payment_details + WHERE + inv_payment_details.statement_id = insurer_statements.id + AND inv_payment_details.is_active = 1 + + ) AS realization_amount, ") ->join('pt_co_share_details', 'policy_transaction.id = pt_co_share_details.pt_id', 'left') ->join('insurer_statements', 'pt_co_share_details.statement_id = insurer_statements.id', 'left') + ->join('inv_payment_details', 'insurer_statements.id = inv_payment_details.statement_id', 'left') ->join('clients', 'clients.id = policy_transaction.client_id', 'left') ->join('insurers', 'pt_co_share_details.insurer_id = insurers.id', 'left') ->join('client_policy', 'policy_transaction.client_policy_id = client_policy.id', 'left') diff --git a/app/Views/policy_transaction_endorsement_form.php b/app/Views/policy_transaction_endorsement_form.php index 251de501..20d9e41a 100644 --- a/app/Views/policy_transaction_endorsement_form.php +++ b/app/Views/policy_transaction_endorsement_form.php @@ -109,7 +109,7 @@
Back + >Back
@@ -555,7 +555,7 @@ $(document).ready(function(){ }else{ addInsurerColumn() } - + hidePermiumDetailsBasedOnTheTeam(); }, error: function (xhr, status, error) { console.error(xhr.responseText); @@ -564,6 +564,8 @@ $(document).ready(function(){ }); } + + }); }) @@ -1184,8 +1186,8 @@ function hidePermiumDetailsBasedOnTheTeam(){ // $('#' + id + ' input, #' + id + ' select, #' + id + ' textarea').prop('disabled', true); // Disable inputs }); - $('.hideter').hide() - $('.hidetp').hide() + $('.hideter').hide(); + $('.hidetp').hide(); } } @@ -1236,7 +1238,7 @@ $('#setInsurerCount').on('input', function() { function addInsurerColumn() { insurerCount++; - hidePermiumDetailsBasedOnTheTeam() + hidePermiumDetailsBasedOnTheTeam(); // Update header $('#insurerTable thead tr').append(` diff --git a/app/Views/policy_transaction_endorsement_list.php b/app/Views/policy_transaction_endorsement_list.php index 7a0209af..46e85ef9 100644 --- a/app/Views/policy_transaction_endorsement_list.php +++ b/app/Views/policy_transaction_endorsement_list.php @@ -179,6 +179,7 @@ table.dataTable thead th { + diff --git a/app/Views/policy_transaction_inception_form.php b/app/Views/policy_transaction_inception_form.php index 9a42c780..4db42108 100644 --- a/app/Views/policy_transaction_inception_form.php +++ b/app/Views/policy_transaction_inception_form.php @@ -140,7 +140,7 @@
Back + >Back
{ formData.append(`co_share_type[${index}]`, value); }); - + //covert date to mysql format + // alert(formData.get('policy_issue_date')); + + formData.set('policy_issue_date',convertToMySQLDate(formData.get('policy_issue_date'))); + formData.set('policy_start_date',convertToMySQLDate(formData.get('policy_start_date'))); + formData.set('policy_end_date',convertToMySQLDate(formData.get('policy_end_date'))); + formData.set('renewal_date',convertToMySQLDate(formData.get('renewal_date'))); + formData.set('rollover_date',convertToMySQLDate(formData.get('rollover_date'))); + formData.set('month',convertMonthYearToMySQLDate(formData.get('month'))); + + // formData['policy_start_date'] = convertToMySQLDate(formData['policy_start_date']); + // formData['policy_end_date'] = convertToMySQLDate(formData['policy_end_date']); + // formData['renewal_date'] = convertToMySQLDate(formData['renewal_date']); + // formData['rollover_date'] = convertToMySQLDate(formData['rollover_date']); + // formData['month'] = convertMonthYearToMySQLDate(formData['month']); + // console.log(formData); + // return false; $.ajax({ data: formData, url: form_action, diff --git a/app/Views/variance_report_list.php b/app/Views/variance_report_list.php index f784b8d4..da28834c 100644 --- a/app/Views/variance_report_list.php +++ b/app/Views/variance_report_list.php @@ -16,6 +16,14 @@ table.dataTable tbody td { .dataTables_filter { position: absolute; } + +.right-align-input { + text-align: right; +} + +.center-align-input { + text-align: center; +}
@@ -153,9 +161,11 @@ table.dataTable tbody td {
- + + + @@ -168,11 +178,13 @@ table.dataTable tbody td { - - + + - + + +
Sno Issuer Client Branch Client Name Insurer PolicyPolicy No Endorsement No Expected AmountInvoice StatusInvoice Amount Realization Amount Variance