Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
a21bba0144
@ -779,6 +779,8 @@ $routes->group('payout', function($routes) {
|
|||||||
$routes->get('invoices', 'PayoutController::invoices');
|
$routes->get('invoices', 'PayoutController::invoices');
|
||||||
$routes->post('invoices/save', 'PayoutController::saveInvoice');
|
$routes->post('invoices/save', 'PayoutController::saveInvoice');
|
||||||
$routes->get('invoices/history', 'PayoutController::auditHistory');
|
$routes->get('invoices/history', 'PayoutController::auditHistory');
|
||||||
|
$routes->get('invoices/preview', 'PayoutController::preview');
|
||||||
|
$routes->get('invoices/downloadPdf/(:any)', 'PayoutController::downloadPdf/$1');
|
||||||
$routes->get('invoice/generate-number/(:num)', 'PayoutController::generateInvoiceNumberAjax/$1');
|
$routes->get('invoice/generate-number/(:num)', 'PayoutController::generateInvoiceNumberAjax/$1');
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
@ -5652,11 +5652,9 @@ class ClientController extends AdminController
|
|||||||
|
|
||||||
public function sendextraparam()
|
public function sendextraparam()
|
||||||
{
|
{
|
||||||
// $data = db_connect()->table('jobs')->where('id', 1677)->get()->getRowArray();
|
// $return = db_connect()->table('jobs')->where('id', 1677)->get()->getRowArray();
|
||||||
// // dd($data);
|
|
||||||
// $return = $this->updatePolicyTransactionDataWhileClinetPolicyUpdate(json_decode($data['payload'], true));
|
// $return = $this->updatePolicyTransactionDataWhileClinetPolicyUpdate(json_decode($data['payload'], true));
|
||||||
// dd($return);
|
// dd($return);
|
||||||
// die;
|
|
||||||
|
|
||||||
// $ticket_id = 515;
|
// $ticket_id = 515;
|
||||||
// $apiServiceController = new ApiServiceController();
|
// $apiServiceController = new ApiServiceController();
|
||||||
@ -5680,7 +5678,9 @@ class ClientController extends AdminController
|
|||||||
// $response = $ticketServiceController->extractExcelData("claims_dump_form_client.xlsx");
|
// $response = $ticketServiceController->extractExcelData("claims_dump_form_client.xlsx");
|
||||||
// dd($response);
|
// dd($response);
|
||||||
|
|
||||||
// $TicketController = new TicketController();
|
// ---------- TICKET SERVICE CONTROLLER --------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
$TicketController = new TicketController();
|
||||||
// $response = $TicketController->getMoreInfo($requestFrom = 'rest', $ticket_id = 70);
|
// $response = $TicketController->getMoreInfo($requestFrom = 'rest', $ticket_id = 70);
|
||||||
// dd($response);
|
// dd($response);
|
||||||
|
|
||||||
@ -5689,7 +5689,7 @@ class ClientController extends AdminController
|
|||||||
$empServiceController = new EmployeeServiceController();
|
$empServiceController = new EmployeeServiceController();
|
||||||
// $res = $empServiceController->excelFileFormatValidation(['file_id' => '1126']);
|
// $res = $empServiceController->excelFileFormatValidation(['file_id' => '1126']);
|
||||||
// $res = $empServiceController->excelFileDataValidation(['file_id' => '865']);
|
// $res = $empServiceController->excelFileDataValidation(['file_id' => '865']);
|
||||||
// $res = $empServiceController->employeesOnboardPreprocess(['file_id' => 726]);
|
// $res = $empServiceController->employeesOnboardPreprocess(['file_id' => 1169]);
|
||||||
// $res = $empServiceController->employeesOnboardProcess(['file_id' => 835]);
|
// $res = $empServiceController->employeesOnboardProcess(['file_id' => 835]);
|
||||||
// $res = $empServiceController->employeesEnrollmentInsert(['file_id' => 836]);
|
// $res = $empServiceController->employeesEnrollmentInsert(['file_id' => 836]);
|
||||||
// $res = $empServiceController->employeesSIEnhanceProcess(['file_id' => '1131']);
|
// $res = $empServiceController->employeesSIEnhanceProcess(['file_id' => '1131']);
|
||||||
@ -5698,13 +5698,13 @@ class ClientController extends AdminController
|
|||||||
// $res = $empServiceController->compareMemberDataAndInceptionData(['file_id' => '1126']);
|
// $res = $empServiceController->compareMemberDataAndInceptionData(['file_id' => '1126']);
|
||||||
// dd($res);
|
// dd($res);
|
||||||
|
|
||||||
|
// ---------- EMP MULTI EVENT SERVICE CONTROLLER --------------------------------------------------------------------------------
|
||||||
|
|
||||||
$EmployeeMultiEventServiceController = new EmployeeMultiEventServiceController();
|
$EmployeeMultiEventServiceController = new EmployeeMultiEventServiceController();
|
||||||
// $res = $EmployeeMultiEventServiceController->constructMultiEventData(['file_id' => '1069']);
|
// $res = $EmployeeMultiEventServiceController->constructMultiEventData(['file_id' => '1069']);
|
||||||
// $res = $EmployeeMultiEventServiceController->excelMultieventFileFormateValidation(['file_id' => '2373']);
|
// $res = $EmployeeMultiEventServiceController->excelMultieventFileFormateValidation(['file_id' => '2373']);
|
||||||
// $res = $EmployeeMultiEventServiceController->excelMultieventFileDataValidation(['file_id' => '2373']);
|
// $res = $EmployeeMultiEventServiceController->excelMultieventFileDataValidation(['file_id' => '2373']);
|
||||||
// $res = $EmployeeMultiEventServiceController->excelMultieventFileOnBoard(['file_id' => '1069']);
|
// $res = $EmployeeMultiEventServiceController->excelMultieventFileOnBoard(['file_id' => '1069']);
|
||||||
// dd($res);
|
|
||||||
|
|
||||||
// $res = $EmployeeMultiEventServiceController->getExcelErrorData(1069, $res);
|
// $res = $EmployeeMultiEventServiceController->getExcelErrorData(1069, $res);
|
||||||
// $res['file_id'] = 1069;
|
// $res['file_id'] = 1069;
|
||||||
// echo view('excel_errors', $res);
|
// echo view('excel_errors', $res);
|
||||||
|
|||||||
@ -1387,6 +1387,9 @@ class EmployeeServiceController extends AdminController
|
|||||||
$family = array_merge($family,$existing_famility_details);
|
$family = array_merge($family,$existing_famility_details);
|
||||||
$family = data_group_by_family($family)[ $emp_id ];// reason to call this again is bring self to first index of the array
|
$family = data_group_by_family($family)[ $emp_id ];// reason to call this again is bring self to first index of the array
|
||||||
// dd($family);
|
// dd($family);
|
||||||
|
// $self = current(array_filter($family, fn($r) => strtolower($r[5] ?? '') === 'self'));
|
||||||
|
// $premium = (int)($self['temp']['rata_premimum'] ?? 0);
|
||||||
|
// foreach ($family as &$r) if (strtolower($r[5] ?? '') !== 'self') $r['self_rata_premium'] = $premium;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Kint::dump($family);
|
// Kint::dump($family);
|
||||||
|
|||||||
@ -11,6 +11,9 @@ use App\Models\InvoiceUtrModel;
|
|||||||
use App\Models\PolicyTransactionModel;
|
use App\Models\PolicyTransactionModel;
|
||||||
use App\Models\AuditHistoryModel;
|
use App\Models\AuditHistoryModel;
|
||||||
|
|
||||||
|
use Dompdf\Dompdf;
|
||||||
|
use Dompdf\Options;
|
||||||
|
|
||||||
class PayoutController extends BaseController
|
class PayoutController extends BaseController
|
||||||
{
|
{
|
||||||
use ResponseTrait;
|
use ResponseTrait;
|
||||||
@ -500,4 +503,108 @@ class PayoutController extends BaseController
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ****************************************************************************************************************************************************************
|
||||||
|
|
||||||
|
public function preview($invoiceId = null)
|
||||||
|
{
|
||||||
|
$invoiceId = $this->request->getGet('invoice_id');
|
||||||
|
|
||||||
|
// Get invoice data from database
|
||||||
|
$invoiceData = $this->getInvoiceData($invoiceId);
|
||||||
|
|
||||||
|
if (empty($invoiceData)) {
|
||||||
|
return $this->respond([
|
||||||
|
'status' => false,
|
||||||
|
'code' => 404,
|
||||||
|
'data' => '',
|
||||||
|
'message' => 'Invoice not found'
|
||||||
|
], 200);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Load view with data
|
||||||
|
$html = view('invoice_template_2', $invoiceData);
|
||||||
|
// echo $html; die;
|
||||||
|
|
||||||
|
return $this->respond([
|
||||||
|
'status' => true,
|
||||||
|
'code' => 200,
|
||||||
|
'data' => $html
|
||||||
|
], 200);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function downloadPdf($invoiceId = null, $type = 0)
|
||||||
|
{
|
||||||
|
// Get invoice data from database
|
||||||
|
$invoiceData = $this->getInvoiceData($invoiceId);
|
||||||
|
|
||||||
|
if (empty($invoiceData)) {
|
||||||
|
return redirect()->back()->with('error', 'Invoice not found');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Generate HTML
|
||||||
|
$html = view('invoice_template_2', $invoiceData);
|
||||||
|
|
||||||
|
// Configure Dompdf
|
||||||
|
$options = new Options();
|
||||||
|
$options->set('isHtml5ParserEnabled', true);
|
||||||
|
$options->set('isPhpEnabled', true);
|
||||||
|
$options->set('isRemoteEnabled', true);
|
||||||
|
$options->set('defaultFont', 'Arial');
|
||||||
|
$options->set('chroot', FCPATH);
|
||||||
|
|
||||||
|
// Initialize Dompdf
|
||||||
|
$dompdf = new Dompdf($options);
|
||||||
|
|
||||||
|
// Load HTML
|
||||||
|
$dompdf->loadHtml($html);
|
||||||
|
|
||||||
|
// Set paper size and orientation
|
||||||
|
$dompdf->setPaper('A4', 'portrait');
|
||||||
|
|
||||||
|
// Render PDF
|
||||||
|
$dompdf->render();
|
||||||
|
|
||||||
|
// Generate filename
|
||||||
|
$filename = 'Invoice_' . $invoiceData['invoice_no'] . '_' . date('Ymd') . '.pdf';
|
||||||
|
|
||||||
|
if($type == 0){
|
||||||
|
// Download PDF
|
||||||
|
return $this->response
|
||||||
|
->setHeader('Content-Type', 'application/pdf')
|
||||||
|
->setHeader('Content-Disposition', 'attachment; filename="' . $filename . '"')
|
||||||
|
->setBody($dompdf->output());
|
||||||
|
}else{
|
||||||
|
// View PDF
|
||||||
|
return $this->response
|
||||||
|
->setHeader('Content-Type', 'application/pdf')
|
||||||
|
->setHeader('Content-Disposition', 'inline; filename="' . $filename . '"')
|
||||||
|
->setBody($dompdf->output());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private function getInvoiceData($invoiceId)
|
||||||
|
{
|
||||||
|
$invoice_data = $this->invoiceModel
|
||||||
|
->select('
|
||||||
|
|
||||||
|
partner_invoice.*,
|
||||||
|
|
||||||
|
pa.name as agent_name,
|
||||||
|
pa.email as agent_email,
|
||||||
|
pa.mobile as agent_mobile,
|
||||||
|
pa.address as agent_address,
|
||||||
|
pa.agent_code,
|
||||||
|
pa.certificate_file_name,
|
||||||
|
pa.commission_retain
|
||||||
|
')
|
||||||
|
->join('partner_agent pa', 'partner_invoice.agent_id = pa.id')
|
||||||
|
->where('partner_invoice.is_active', 1)
|
||||||
|
->where('partner_invoice.id', $invoiceId)
|
||||||
|
->first();
|
||||||
|
|
||||||
|
return $invoice_data;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1022,6 +1022,10 @@ if (!function_exists('transform_excel_data_to_db')) {
|
|||||||
$result['temp']['rata_premimum'] = isset($memArr['temp']['rata_premimum']) ? $memArr['temp']['rata_premimum'] : 0;
|
$result['temp']['rata_premimum'] = isset($memArr['temp']['rata_premimum']) ? $memArr['temp']['rata_premimum'] : 0;
|
||||||
$result['policy_details'] = $policy;
|
$result['policy_details'] = $policy;
|
||||||
|
|
||||||
|
// if(isset($memArr['self_rata_premium'])){
|
||||||
|
// $result['self_rata_premium'] = $memArr['self_rata_premium'] ?? 0;
|
||||||
|
// }
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1839,6 +1843,16 @@ if (!function_exists('premium_calculation_manager')) {
|
|||||||
//set dependent si to 0
|
//set dependent si to 0
|
||||||
$emp_data['policy_details']['basic_cover_si'] = 0;
|
$emp_data['policy_details']['basic_cover_si'] = 0;
|
||||||
$emp_data['policy_details']['premium'] = 0;
|
$emp_data['policy_details']['premium'] = 0;
|
||||||
|
|
||||||
|
// if(isset($emp_data['self_rata_premium']) && !empty($emp_data['self_rata_premium'])){
|
||||||
|
// $self_rata_premium = (int)($emp_data['self_rata_premium'] ?? 0);
|
||||||
|
// $dependent_rata_premium = (int)($emp_data['policy_details']['rata_premimum'] ?? 0);
|
||||||
|
// $actual_rata_premium = abs($dependent_rata_premium - $self_rata_premium);
|
||||||
|
// $emp_data['policy_details']['rata_premimum'] = $actual_rata_premium;
|
||||||
|
// $emp_data['policy_details']['gst'] = (float) number_format(($emp_data['policy_details']['rata_premimum'] * ($gst / 100)), 2, '.', '');
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
}else if(strtolower($emp_data['relationship']) != 'self' && $temp_slab_rates[0]['premium_type'] == 1 && ($emp_data['temp']['action'] == 'I' || $emp_data['temp']['action'] == 'A' || $emp_data['temp']['action'] == 'MI')){
|
}else if(strtolower($emp_data['relationship']) != 'self' && $temp_slab_rates[0]['premium_type'] == 1 && ($emp_data['temp']['action'] == 'I' || $emp_data['temp']['action'] == 'A' || $emp_data['temp']['action'] == 'MI')){
|
||||||
|
|
||||||
$emp_data['policy_details']['basic_cover_si'] = 0;
|
$emp_data['policy_details']['basic_cover_si'] = 0;
|
||||||
|
|||||||
@ -57,6 +57,20 @@ table.dataTable tbody td { padding: 4px 4px !important; }
|
|||||||
.policy-adjustment { -moz-appearance:textfield; }
|
.policy-adjustment { -moz-appearance:textfield; }
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.invoice-actions {
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
|
gap: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#invoiceModal .modal-body {
|
||||||
|
max-height: 520px; /* adjust as needed */
|
||||||
|
overflow-y: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
|
|
||||||
<div class="row" id="invoices_details">
|
<div class="row" id="invoices_details">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<div id="invoices_accordion" class="ml-3">
|
<div id="invoices_accordion" class="ml-3">
|
||||||
@ -153,9 +167,9 @@ table.dataTable tbody td { padding: 4px 4px !important; }
|
|||||||
</button> -->
|
</button> -->
|
||||||
|
|
||||||
<?php if(isset($type) && $type === 'edit'): ?>
|
<?php if(isset($type) && $type === 'edit'): ?>
|
||||||
<button class="btn app-btn-primary mr-2 M" onclick="showMorePolicies()" title="More Policies">
|
<!-- <button class="btn btn-primary mr-2 M" onclick="showMorePolicies()" title="More Policies">
|
||||||
More Policies
|
More Policies
|
||||||
</button>
|
</button> -->
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
|
|
||||||
@ -216,6 +230,9 @@ table.dataTable tbody td { padding: 4px 4px !important; }
|
|||||||
<div class="summary-item">
|
<div class="summary-item">
|
||||||
<button type="button" class="btn-icon mr-1 text-warning" data-toggle="modal" data-target="#auditingModal" onclick="auditingHistory()" title="History"><i class="mdi mdi-history"></i></button>
|
<button type="button" class="btn-icon mr-1 text-warning" data-toggle="modal" data-target="#auditingModal" onclick="auditingHistory()" title="History"><i class="mdi mdi-history"></i></button>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="summary-item">
|
||||||
|
<button type="button" class="btn-icon mr-1 text-warning" onclick="fetchPreviewInvoiceDetails(<?= isset($invoice['id']) ? $invoice['id'] : '' ?>, '<?= isset($invoice['invoice_no']) ? $invoice['invoice_no'] : '' ?>')" data-toggle="tooltip" title="Preview Invoice"><i class="mdi mdi-eye"></i></button>
|
||||||
|
</div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@ -250,6 +267,36 @@ table.dataTable tbody td { padding: 4px 4px !important; }
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- Invoice Preview Modal -->
|
||||||
|
<div class="modal fade" id="invoiceModal" tabindex="-1" role="dialog" aria-hidden="true" aria-modal="true" data-bs-backdrop="static">
|
||||||
|
<div class="modal-dialog modal-full-width">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header" style="background-color: gainsboro;">
|
||||||
|
<h5 class="modal-title" id="invoiceModalLabel">
|
||||||
|
Invoice Preview <span id="invoice_heading"></span>
|
||||||
|
</h5>
|
||||||
|
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body" id="invoice_modal_body">
|
||||||
|
|
||||||
|
<input type="hidden" id="row_invoice_id">
|
||||||
|
|
||||||
|
<!-- Action Buttons -->
|
||||||
|
<div class="invoice-actions">
|
||||||
|
<button class="btn btn-success btn-sm" onclick="downloadInvoicePdf()"><i class="mdi mdi-download"></i> Download PDF</button>
|
||||||
|
<!-- <button class="btn btn-info btn-sm" onclick="printInvoice()"><i class="mdi mdi-printer"></i> Print </button> -->
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
<!-- Invoice Preview Container -->
|
||||||
|
<div id="invoicePreview"></div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
// ---- Internal state ----
|
// ---- Internal state ----
|
||||||
@ -970,4 +1017,74 @@ function getExportFileName() {
|
|||||||
// let INV = $("#invoiceNo").val() || '';
|
// let INV = $("#invoiceNo").val() || '';
|
||||||
return `Payouts (${day}-${month}-${year})`;
|
return `Payouts (${day}-${month}-${year})`;
|
||||||
}
|
}
|
||||||
</script>
|
|
||||||
|
function downloadInvoicePdf(){
|
||||||
|
|
||||||
|
let invoice_id = $('#invoiceID').val();
|
||||||
|
if(!invoice_id){
|
||||||
|
return toastr.warning('No data found', 'Warning');
|
||||||
|
}
|
||||||
|
window.location.href = '<?= base_url('payout/invoices/downloadPdf/') ?>' + invoice_id
|
||||||
|
}
|
||||||
|
|
||||||
|
function fetchPreviewInvoiceDetails(invoice_id, invoice_no){
|
||||||
|
|
||||||
|
if (!invoice_id) {
|
||||||
|
toastr.warning("Invoice Id not found!", "WARNING");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
let heading_text = ' - ( ' + invoice_no + ' )';
|
||||||
|
|
||||||
|
$('#invoicePreview').empty();
|
||||||
|
$('#invoice_heading').text(heading_text);
|
||||||
|
$('#invoicePreview').append('<div class="text-center p-5"><div class="spinner-border text-primary" role="status"><span class="sr-only">Loading...</span></div></div>');
|
||||||
|
|
||||||
|
var myModal = new bootstrap.Modal(document.getElementById('invoiceModal'));
|
||||||
|
myModal.show();
|
||||||
|
|
||||||
|
let url = '<?= base_url('payout/invoices/preview') ?>';
|
||||||
|
|
||||||
|
// Data to send in the AJAX request
|
||||||
|
let requestData = {
|
||||||
|
invoice_id: invoice_id,
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// Send AJAX request
|
||||||
|
sendAjaxRequestForGlobal(url, 'GET', requestData, function(response) {
|
||||||
|
|
||||||
|
console.log('Data fetched successfully:', response);
|
||||||
|
|
||||||
|
$('#invoicePreview').empty();
|
||||||
|
$('#invoice_heading').text(heading_text);
|
||||||
|
|
||||||
|
if (response.status == true) {
|
||||||
|
$('#invoicePreview').append(response.data);
|
||||||
|
$('#row_invoice_id').val(invoice_id);
|
||||||
|
}else{
|
||||||
|
$('#invoicePreview').append('<div class="text-center p-5 text-muted">No data found</div>');
|
||||||
|
}
|
||||||
|
|
||||||
|
}, function(xhr, status, error) {
|
||||||
|
console.error('Error fetching data:', error);
|
||||||
|
console.error(xhr.responseText);
|
||||||
|
// toastr.error('An error occurred while fetching the data.', 'ERROR');
|
||||||
|
$('#invoicePreview').empty();
|
||||||
|
$('#invoicePreview').append('<div class="text-center p-5 text-muted">No data found</div>');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<?php if(isset($type) && $type === 'edit'): ?>
|
||||||
|
<script>
|
||||||
|
$(document).ready(function(){
|
||||||
|
$(".dt-buttons").prepend(`
|
||||||
|
<button class="btn btn-primary mr-2 M" onclick="showMorePolicies()" title="More Policies">
|
||||||
|
More Policies
|
||||||
|
</button>
|
||||||
|
`);
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
<?php endif; ?>
|
||||||
@ -293,6 +293,13 @@ table.dataTable tbody td { padding: 4px 4px !important; }
|
|||||||
|
|
||||||
filteredPolicies = allPolicies.filter(p => String(p.agentId) === String(agentId));
|
filteredPolicies = allPolicies.filter(p => String(p.agentId) === String(agentId));
|
||||||
|
|
||||||
|
// policy Till Date filter
|
||||||
|
filteredPolicies = allPolicies.filter(p => {
|
||||||
|
if (String(p.agentId) !== String(agentId)) return false;
|
||||||
|
if (policyTillDate && p.date_db > policyTillDate) return false;
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
|
||||||
let rows = '';
|
let rows = '';
|
||||||
filteredPolicies.forEach(p => {
|
filteredPolicies.forEach(p => {
|
||||||
const idStr = String(p.id);
|
const idStr = String(p.id);
|
||||||
|
|||||||
430
app/Views/invoice_template.php
Normal file
430
app/Views/invoice_template.php
Normal file
@ -0,0 +1,430 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>Agent Commission Invoice</title>
|
||||||
|
<style>
|
||||||
|
|
||||||
|
* {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
font-family: Arial, sans-serif;
|
||||||
|
font-size: 12px;
|
||||||
|
color: #333;
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Page Setup for DOMPDF */
|
||||||
|
@page {
|
||||||
|
size: A4;
|
||||||
|
margin: 10mm;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* .invoice-container {
|
||||||
|
width: 100%;
|
||||||
|
max-width: 210mm;
|
||||||
|
margin: 0 auto;
|
||||||
|
padding: 10mm;
|
||||||
|
background: #fff;
|
||||||
|
} */
|
||||||
|
|
||||||
|
.invoice-container {
|
||||||
|
width: 180mm; /* reduced from 210mm */
|
||||||
|
max-width: 180mm;
|
||||||
|
margin: 0 auto;
|
||||||
|
padding: 8mm; /* reduced padding */
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Header */
|
||||||
|
.invoice-header {
|
||||||
|
border-bottom: 3px solid #2c3e50;
|
||||||
|
padding-bottom: 15px;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header-top {
|
||||||
|
width: 100%;
|
||||||
|
display: table;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header-top > div {
|
||||||
|
display: table-cell;
|
||||||
|
vertical-align: top;
|
||||||
|
width: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.company-info h1 {
|
||||||
|
color: #2c3e50;
|
||||||
|
font-size: 24px;
|
||||||
|
margin-bottom: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.company-info p {
|
||||||
|
color: #666;
|
||||||
|
font-size: 11px;
|
||||||
|
line-height: 1.4;
|
||||||
|
}
|
||||||
|
|
||||||
|
.invoice-title {
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
.invoice-title h2 {
|
||||||
|
font-size: 32px;
|
||||||
|
color: #e74c3c;
|
||||||
|
margin-bottom: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.invoice-title p {
|
||||||
|
font-size: 11px;
|
||||||
|
color: #666;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Invoice Info (converted grid to table layout) */
|
||||||
|
.invoice-info {
|
||||||
|
width: 100%;
|
||||||
|
display: table;
|
||||||
|
margin-bottom: 25px;
|
||||||
|
background: #f8f9fa;
|
||||||
|
border-radius: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.invoice-info > div {
|
||||||
|
display: table-cell;
|
||||||
|
width: 50%;
|
||||||
|
vertical-align: top;
|
||||||
|
padding: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.info-section h3 {
|
||||||
|
font-size: 13px;
|
||||||
|
color: #2c3e50;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
padding-bottom: 5px;
|
||||||
|
border-bottom: 2px solid #3498db;
|
||||||
|
}
|
||||||
|
|
||||||
|
.info-row {
|
||||||
|
width: 100%;
|
||||||
|
display: table;
|
||||||
|
padding: 5px 0;
|
||||||
|
font-size: 11px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.info-row span {
|
||||||
|
display: table-cell;
|
||||||
|
}
|
||||||
|
|
||||||
|
.info-label {
|
||||||
|
font-weight: 600;
|
||||||
|
color: #555;
|
||||||
|
}
|
||||||
|
|
||||||
|
.info-value {
|
||||||
|
color: #333;
|
||||||
|
font-weight: 500;
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Table */
|
||||||
|
.invoice-table {
|
||||||
|
width: 100%;
|
||||||
|
border-collapse: collapse;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
margin-top: -16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.invoice-table thead {
|
||||||
|
display: table-header-group;
|
||||||
|
background: #2c3e50;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.invoice-table thead th {
|
||||||
|
padding: 12px 8px;
|
||||||
|
font-size: 11px;
|
||||||
|
font-weight: 600;
|
||||||
|
text-transform: uppercase;
|
||||||
|
letter-spacing: 0.5px;
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.invoice-table td {
|
||||||
|
padding: 10px 8px;
|
||||||
|
font-size: 11px;
|
||||||
|
border-bottom: 1px solid #e0e0e0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.invoice-table tbody tr:nth-child(even) {
|
||||||
|
background: #f8f9fa;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Text alignment */
|
||||||
|
.text-right {
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
.text-center {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Summary Section */
|
||||||
|
.invoice-summary {
|
||||||
|
width: 100%;
|
||||||
|
text-align: right;
|
||||||
|
margin-top: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.summary-box {
|
||||||
|
width: 300px;
|
||||||
|
border: 2px solid #2c3e50;
|
||||||
|
border-radius: 5px;
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.summary-row {
|
||||||
|
width: 100%;
|
||||||
|
display: table;
|
||||||
|
padding: 10px 15px;
|
||||||
|
border-bottom: 1px solid #e0e0e0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.summary-row span {
|
||||||
|
display: table-cell;
|
||||||
|
}
|
||||||
|
|
||||||
|
.summary-row:last-child {
|
||||||
|
background: #2c3e50;
|
||||||
|
color: #fff;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.summary-label {
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Footer */
|
||||||
|
.invoice-footer {
|
||||||
|
border-top: 2px solid #2c3e50;
|
||||||
|
padding-top: 15px;
|
||||||
|
margin-top: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.footer-content {
|
||||||
|
width: 100%;
|
||||||
|
display: table;
|
||||||
|
}
|
||||||
|
|
||||||
|
.footer-section {
|
||||||
|
display: table-cell;
|
||||||
|
width: 50%;
|
||||||
|
vertical-align: top;
|
||||||
|
font-size: 10px;
|
||||||
|
color: #666;
|
||||||
|
}
|
||||||
|
|
||||||
|
.footer-section h4 {
|
||||||
|
font-size: 12px;
|
||||||
|
color: #2c3e50;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.footer-section p {
|
||||||
|
line-height: 1.6;
|
||||||
|
margin-bottom: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Signature */
|
||||||
|
.signature-section {
|
||||||
|
margin-top: 40px;
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
.signature-line {
|
||||||
|
border-top: 2px solid #333;
|
||||||
|
width: 200px;
|
||||||
|
margin-left: auto;
|
||||||
|
padding-top: 10px;
|
||||||
|
font-size: 11px;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Page break support */
|
||||||
|
.page-break {
|
||||||
|
page-break-after: always;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Row breaking prevention */
|
||||||
|
.invoice-table tr {
|
||||||
|
page-break-inside: avoid;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Optional hide */
|
||||||
|
.hide-header .invoice-header {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hide-footer .invoice-footer {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="invoice-container" id="invoiceContent">
|
||||||
|
<!-- Invoice Header (Can be toggled) -->
|
||||||
|
<div class="invoice-header">
|
||||||
|
<div class="header-top">
|
||||||
|
<div class="company-info">
|
||||||
|
<h1><?= $broker_company_name ?? 'Broker Company Name' ?></h1>
|
||||||
|
<p><?= $broker_address ?? 'Company Address Line 1' ?><br>
|
||||||
|
<?= $broker_city ?? 'City' ?>, <?= $broker_state ?? 'State' ?> - <?= $broker_pincode ?? 'PIN' ?><br>
|
||||||
|
Email: <?= $broker_email ?? 'email@company.com' ?> | Phone: <?= $broker_phone ?? '+91-XXXXXXXXXX' ?></p>
|
||||||
|
</div>
|
||||||
|
<div class="invoice-title">
|
||||||
|
<p>Commission Statement</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Invoice Information -->
|
||||||
|
<div class="invoice-info">
|
||||||
|
<div class="info-section">
|
||||||
|
<h3>Invoice Details</h3>
|
||||||
|
<div class="info-row">
|
||||||
|
<span class="info-label">Invoice Number:</span>
|
||||||
|
<span class="info-value"><?= $invoice_number ?? 'INV-2024-0001' ?></span>
|
||||||
|
</div>
|
||||||
|
<div class="info-row">
|
||||||
|
<span class="info-label">Invoice Date:</span>
|
||||||
|
<span class="info-value"><?= $invoice_date ?? date('d-M-Y') ?></span>
|
||||||
|
</div>
|
||||||
|
<div class="info-row">
|
||||||
|
<span class="info-label">Period:</span>
|
||||||
|
<span class="info-value"><?= $period ?? 'January 2024' ?></span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="info-section">
|
||||||
|
<h3>Agent Information</h3>
|
||||||
|
<div class="info-row">
|
||||||
|
<span class="info-label">Agent Name:</span>
|
||||||
|
<span class="info-value"><?= $agent_name ?? 'Agent Name' ?></span>
|
||||||
|
</div>
|
||||||
|
<div class="info-row">
|
||||||
|
<span class="info-label">Agent Code:</span>
|
||||||
|
<span class="info-value"><?= $agent_code ?? 'AGT-0001' ?></span>
|
||||||
|
</div>
|
||||||
|
<div class="info-row">
|
||||||
|
<span class="info-label">No. of Policies:</span>
|
||||||
|
<span class="info-value"><?= $total_policies ?? '0' ?></span>
|
||||||
|
</div>
|
||||||
|
<div class="info-row">
|
||||||
|
<span class="info-label">Policies Till Date:</span>
|
||||||
|
<span class="info-value"><?= $policies_till_date ?? '0' ?></span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Policy Details Table -->
|
||||||
|
<table class="invoice-table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th style="width: 5%;">Sr.</th>
|
||||||
|
<th style="width: 15%;">Policy No.</th>
|
||||||
|
<th style="width: 25%;">Customer Name</th>
|
||||||
|
<th style="width: 15%;" class="text-right">Premium (₹)</th>
|
||||||
|
<th style="width: 15%;" class="text-center">Issue Date</th>
|
||||||
|
<th style="width: 15%;" class="text-right">Commission (₹)</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<?php
|
||||||
|
$serial = 1;
|
||||||
|
$total_premium = 0;
|
||||||
|
$total_commission = 0;
|
||||||
|
$records_per_page = 25; // Adjust based on page size
|
||||||
|
|
||||||
|
foreach($policies as $index => $policy):
|
||||||
|
$total_premium += $policy['premium'];
|
||||||
|
$total_commission += $policy['commission'];
|
||||||
|
|
||||||
|
// Add page break after certain records
|
||||||
|
$page_break_class = (($serial % $records_per_page) == 0 && $serial != count($policies)) ? 'page-break' : '';
|
||||||
|
?>
|
||||||
|
<tr class="<?= $page_break_class ?>">
|
||||||
|
<td class="text-center"><?= $serial ?></td>
|
||||||
|
<td><?= $policy['policy_no'] ?></td>
|
||||||
|
<td><?= $policy['customer_name'] ?></td>
|
||||||
|
<td class="text-right"><?= number_format($policy['premium'], 2) ?></td>
|
||||||
|
<td class="text-center"><?= date('d-M-Y', strtotime($policy['issue_date'])) ?></td>
|
||||||
|
<td class="text-right"><?= number_format($policy['commission'], 2) ?></td>
|
||||||
|
</tr>
|
||||||
|
<?php
|
||||||
|
// Insert page header for continuation pages
|
||||||
|
if($page_break_class && $serial != count($policies)):
|
||||||
|
?>
|
||||||
|
<tr class="page-header">
|
||||||
|
<td colspan="6">
|
||||||
|
<h3>Invoice #<?= $invoice_number ?? 'INV-2024-0001' ?> - Continued</h3>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php
|
||||||
|
endif;
|
||||||
|
$serial++;
|
||||||
|
endforeach;
|
||||||
|
?>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<!-- Summary Section -->
|
||||||
|
<div class="invoice-summary">
|
||||||
|
<div class="summary-box">
|
||||||
|
<div class="summary-row">
|
||||||
|
<span class="summary-label">Total Premium:</span>
|
||||||
|
<span>₹ <?= number_format($total_premium, 2) ?></span>
|
||||||
|
</div>
|
||||||
|
<div class="summary-row">
|
||||||
|
<span class="summary-label">Total Policies:</span>
|
||||||
|
<span><?= count($policies) ?></span>
|
||||||
|
</div>
|
||||||
|
<div class="summary-row">
|
||||||
|
<span class="summary-label">Total Commission:</span>
|
||||||
|
<span>₹ <?= number_format($total_commission, 2) ?></span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Invoice Footer (Can be toggled) -->
|
||||||
|
<div class="invoice-footer">
|
||||||
|
<div class="footer-content">
|
||||||
|
<div class="footer-section">
|
||||||
|
<h4>Payment Terms</h4>
|
||||||
|
<p>Payment due within 15 days of invoice date.</p>
|
||||||
|
<p>Bank Transfer Details:</p>
|
||||||
|
<p><strong>Bank:</strong> <?= $bank_name ?? 'Bank Name' ?></p>
|
||||||
|
<p><strong>Account No:</strong> <?= $account_number ?? 'XXXXXXXXXXXX' ?></p>
|
||||||
|
<p><strong>IFSC:</strong> <?= $ifsc_code ?? 'XXXXXX' ?></p>
|
||||||
|
</div>
|
||||||
|
<div class="footer-section">
|
||||||
|
<h4>Notes</h4>
|
||||||
|
<p>Commission calculated as per agreed terms.</p>
|
||||||
|
<p>This is a computer-generated invoice.</p>
|
||||||
|
<p>For queries, contact: <?= $contact_email ?? 'accounts@company.com' ?></p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="signature-section">
|
||||||
|
<div class="signature-line">
|
||||||
|
Authorized Signatory
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
158
app/Views/invoice_template_2.php
Normal file
158
app/Views/invoice_template_2.php
Normal file
@ -0,0 +1,158 @@
|
|||||||
|
|
||||||
|
<head>
|
||||||
|
<style>
|
||||||
|
/* Page Setup for DOMPDF */
|
||||||
|
@page {
|
||||||
|
size: A4;
|
||||||
|
margin: 10mm;
|
||||||
|
}
|
||||||
|
|
||||||
|
* {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
font-family: Arial, sans-serif;
|
||||||
|
font-size: 12px;
|
||||||
|
color: #333;
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.invoice-container {
|
||||||
|
width: 180mm; /* reduced from 210mm */
|
||||||
|
max-width: 180mm;
|
||||||
|
margin: 0 auto;
|
||||||
|
padding: 8mm; /* reduced padding */
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.invoice-container table {
|
||||||
|
width: 100%;
|
||||||
|
/* border-collapse: collapse; */
|
||||||
|
margin-bottom: 15pt;
|
||||||
|
}
|
||||||
|
|
||||||
|
.invoice-container table th,
|
||||||
|
.invoice-container table td {
|
||||||
|
border: 1pt solid #000;
|
||||||
|
padding: 8pt;
|
||||||
|
text-align: left;
|
||||||
|
vertical-align: top;
|
||||||
|
}
|
||||||
|
|
||||||
|
.invoice-container th {
|
||||||
|
background-color: #f0f0f0;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header {
|
||||||
|
text-align: center;
|
||||||
|
font-weight: bold;
|
||||||
|
background-color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nhance-address {
|
||||||
|
text-align: center;
|
||||||
|
font-weight: bold;
|
||||||
|
background-color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.section-header {
|
||||||
|
font-weight: bold;
|
||||||
|
background-color: #f8f8f8;
|
||||||
|
}
|
||||||
|
|
||||||
|
.amount {
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bank-details {
|
||||||
|
margin-top: 15pt;
|
||||||
|
margin-bottom: 15pt;
|
||||||
|
line-height: 1.6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.signature {
|
||||||
|
text-align: right;
|
||||||
|
margin-top: 40pt;
|
||||||
|
padding-top: 20pt;
|
||||||
|
}
|
||||||
|
|
||||||
|
.amount-words {
|
||||||
|
margin-top: 10pt;
|
||||||
|
margin-bottom: 10pt;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
strong {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="invoice-container">
|
||||||
|
<table>
|
||||||
|
|
||||||
|
<?php if(isset($agent_name)) : ?>
|
||||||
|
<tr>
|
||||||
|
<td colspan="3" class="header"><?= $agent_name ?></td>
|
||||||
|
</tr>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<?php if(isset($agent_address) && !empty($agent_address)) : ?>
|
||||||
|
<tr>
|
||||||
|
<td colspan="3" class="header"><?= $agent_address ?></td>
|
||||||
|
</tr>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td class="section-header">Bill To:</td>
|
||||||
|
<td class="section-header">Invoice No</td>
|
||||||
|
<td class="section-header">Date</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<strong>NHANCE INDIA INSURANCE BROKING PVT LTD</strong><br>
|
||||||
|
'Old No.76, New No.82, 'Sreshtha', First floor , <br>
|
||||||
|
4th Avenue, Ashok Nagar, Chennai - 600083
|
||||||
|
</td>
|
||||||
|
<td><?= isset($invoice_no) && !empty($invoice_no) ? $invoice_no : "-" ?></td>
|
||||||
|
<td><?= isset($invoice_date) && !empty($invoice_date) ? change_date_format($invoice_date, 'Y-m-d', 'd/m/Y') : "-" ?></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<th>Sl No</th>
|
||||||
|
<th>Description</th>
|
||||||
|
<th>Amount-INR</th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>1</td>
|
||||||
|
<td>INSURANCE BROKING SERVICE (POINT OF SALE)</td>
|
||||||
|
<td class="amount"><?= isset($invoice_no) && !empty($invoice_amount) ? format_indian_number($invoice_amount) : "-" ?></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="2"><strong>Total</strong></td>
|
||||||
|
<td class="amount"><strong><?= isset($invoice_no) && !empty($invoice_amount) ? format_indian_number($invoice_amount) : "-" ?></strong></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<div class="amount-words">
|
||||||
|
<strong>Amount Payable in words : <?= isset($invoice_no) && !empty($invoice_amount) ? numberToWords((int)$invoice_amount) . ' Only' : "-" ?> </strong>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="bank-details">
|
||||||
|
<strong>BANK ACCOUNT DETAILS</strong><br>
|
||||||
|
ACCOUNT NUMBER : <?= isset($agent_account_no) && !empty($agent_account_no) ? $agent_account_no : "-" ?><br>
|
||||||
|
IFSC CODE : <?= isset($agent_ifsc_code) && !empty($agent_ifsc_code) ? $agent_ifsc_code : "-" ?><br>
|
||||||
|
Bank NAME : <?= isset($agent_bank_name) && !empty($agent_bank_name) ? $agent_bank_name : "-" ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="signature">
|
||||||
|
Authorised Signatory
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
@ -2019,13 +2019,13 @@
|
|||||||
<?php } ?>
|
<?php } ?>
|
||||||
<li>
|
<li>
|
||||||
<a href="<?= base_url('/payout/list') ?>">
|
<a href="<?= base_url('/payout/list') ?>">
|
||||||
<i class="ri-book-open-line"></i>
|
<i class="ri-money-rupee-circle-line"></i>
|
||||||
<span> Payouts</span>
|
<span> Payouts</span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a href="<?= base_url('/commission/list') ?>">
|
<a href="<?= base_url('/commission/list') ?>">
|
||||||
<i class="ri-book-open-line"></i>
|
<i class="ri-percent-line"></i>
|
||||||
<span> Commission</span>
|
<span> Commission</span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
|||||||
@ -23,11 +23,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.badge-container {
|
.badge-container {
|
||||||
background: #F0F0F0;
|
background: #F0F0F0;
|
||||||
padding: 6px 12px;
|
padding: 6px 12px;
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
}
|
}
|
||||||
|
|
||||||
.summary-box {
|
.summary-box {
|
||||||
@ -179,6 +179,21 @@
|
|||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
|
||||||
|
.invoice-actions {
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
|
gap: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#invoiceModal .modal-body {
|
||||||
|
max-height: 520px; /* adjust as needed */
|
||||||
|
overflow-y: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
|
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
@ -216,6 +231,7 @@
|
|||||||
<a class="dropdown-item" onclick="fetchUtrDetails(<?= $row['id'] ?>, '<?= $row['invoice_no'] ?>')"><i class="mdi mdi-bank-transfer mr-2 text-muted font-18 vertical-middle"></i>UTR</a>
|
<a class="dropdown-item" onclick="fetchUtrDetails(<?= $row['id'] ?>, '<?= $row['invoice_no'] ?>')"><i class="mdi mdi-bank-transfer mr-2 text-muted font-18 vertical-middle"></i>UTR</a>
|
||||||
<a href="<?= base_url('payout/invoices?type=edit&id=' . $row['id']) ?>" class="dropdown-item"><i class="mdi mdi-pencil mr-2 text-muted font-18 vertical-middle"></i>Edit</a>
|
<a href="<?= base_url('payout/invoices?type=edit&id=' . $row['id']) ?>" class="dropdown-item"><i class="mdi mdi-pencil mr-2 text-muted font-18 vertical-middle"></i>Edit</a>
|
||||||
<a href="<?= base_url('payout/invoices?type=adjustment&id=' . $row['id']) ?>" class="dropdown-item"><i class="mdi mdi-tune mr-2 text-muted font-18 vertical-middle"></i>Adjustment</a>
|
<a href="<?= base_url('payout/invoices?type=adjustment&id=' . $row['id']) ?>" class="dropdown-item"><i class="mdi mdi-tune mr-2 text-muted font-18 vertical-middle"></i>Adjustment</a>
|
||||||
|
<a onclick="fetchPreviewInvoiceDetails(<?= $row['id'] ?>, '<?= $row['invoice_no'] ?>')" class="dropdown-item"><i class="mdi mdi-eye mr-2 text-muted font-18 vertical-middle"></i>Preview Invoice</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
@ -242,6 +258,37 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- Invoice Preview Modal -->
|
||||||
|
<div class="modal fade" id="invoiceModal" tabindex="-1" role="dialog" aria-hidden="true" aria-modal="true" data-bs-backdrop="static">
|
||||||
|
<div class="modal-dialog modal-full-width">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header" style="background-color: gainsboro;">
|
||||||
|
<h5 class="modal-title" id="invoiceModalLabel">
|
||||||
|
Invoice Preview <span id="invoice_heading"></span>
|
||||||
|
</h5>
|
||||||
|
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body" id="invoice_modal_body">
|
||||||
|
|
||||||
|
<input type="hidden" id="row_invoice_id">
|
||||||
|
|
||||||
|
<!-- Action Buttons -->
|
||||||
|
<div class="invoice-actions">
|
||||||
|
<button class="btn btn-success btn-sm" onclick="downloadInvoicePdf()"><i class="mdi mdi-download"></i> Download PDF</button>
|
||||||
|
<!-- <button class="btn btn-info btn-sm" onclick="printInvoice()"><i class="mdi mdi-printer"></i> Print </button> -->
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
<!-- Invoice Preview Container -->
|
||||||
|
<div id="invoicePreview"></div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<!-------------------------------------------------------------------------------------------------->
|
<!-------------------------------------------------------------------------------------------------->
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@ -328,8 +375,7 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
function fetchUtrDetails(invoice_id, invoice_no)
|
function fetchUtrDetails(invoice_id, invoice_no){
|
||||||
{
|
|
||||||
if (!invoice_id) {
|
if (!invoice_id) {
|
||||||
toastr.warning("Invoice Id not found!", "WARNING");
|
toastr.warning("Invoice Id not found!", "WARNING");
|
||||||
return false;
|
return false;
|
||||||
@ -378,6 +424,58 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function fetchPreviewInvoiceDetails(invoice_id, invoice_no){
|
||||||
|
|
||||||
|
if (!invoice_id) {
|
||||||
|
toastr.warning("Invoice Id not found!", "WARNING");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
let heading_text = ' - ( ' + invoice_no + ' )';
|
||||||
|
|
||||||
|
$('#invoicePreview').empty();
|
||||||
|
$('#invoice_heading').text(heading_text);
|
||||||
|
$('#invoicePreview').append('<div class="text-center p-5"><div class="spinner-border text-primary" role="status"><span class="sr-only">Loading...</span></div></div>');
|
||||||
|
|
||||||
|
var myModal = new bootstrap.Modal(document.getElementById('invoiceModal'));
|
||||||
|
myModal.show();
|
||||||
|
|
||||||
|
let url = '<?= base_url('payout/invoices/preview') ?>';
|
||||||
|
|
||||||
|
// Data to send in the AJAX request
|
||||||
|
let requestData = {
|
||||||
|
invoice_id: invoice_id,
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// Send AJAX request
|
||||||
|
sendAjaxRequestForGlobal(url, 'GET', requestData, function(response) {
|
||||||
|
|
||||||
|
console.log('Data fetched successfully:', response);
|
||||||
|
|
||||||
|
$('#invoicePreview').empty();
|
||||||
|
$('#invoice_heading').text(heading_text);
|
||||||
|
|
||||||
|
if (response.status == true) {
|
||||||
|
$('#invoicePreview').append(response.data);
|
||||||
|
$('#row_invoice_id').val(invoice_id);
|
||||||
|
}else{
|
||||||
|
$('#invoicePreview').append('<div class="text-center p-5 text-muted">No data found</div>');
|
||||||
|
}
|
||||||
|
|
||||||
|
}, function(xhr, status, error) {
|
||||||
|
console.error('Error fetching data:', error);
|
||||||
|
console.error(xhr.responseText);
|
||||||
|
// toastr.error('An error occurred while fetching the data.', 'ERROR');
|
||||||
|
$('#invoicePreview').empty();
|
||||||
|
$('#invoicePreview').append('<div class="text-center p-5 text-muted">No data found</div>');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function addInvoiceButton(){
|
||||||
|
window.location.href='<?= base_url('payout/invoices?type=add') ?>'
|
||||||
|
}
|
||||||
|
|
||||||
function getExportFileName() {
|
function getExportFileName() {
|
||||||
let d = new Date();
|
let d = new Date();
|
||||||
let day = String(d.getDate()).padStart(2, '0');
|
let day = String(d.getDate()).padStart(2, '0');
|
||||||
@ -386,4 +484,15 @@
|
|||||||
return `Invoices (${day}-${month}-${year})`;
|
return `Invoices (${day}-${month}-${year})`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function downloadInvoicePdf(){
|
||||||
|
|
||||||
|
let invoice_id = $('#row_invoice_id').val();
|
||||||
|
window.location.href = '<?= base_url('payout/invoices/downloadPdf/') ?>' + invoice_id
|
||||||
|
}
|
||||||
|
|
||||||
|
$('#invoiceModal').on('hidden.bs.modal', function () {
|
||||||
|
$('#row_invoice_id').val("");
|
||||||
|
console.log('value reseted...')
|
||||||
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
@ -128,6 +128,7 @@
|
|||||||
$('#reportrange').val('');
|
$('#reportrange').val('');
|
||||||
$('#startDate').val('');
|
$('#startDate').val('');
|
||||||
$('#endDate').val('');
|
$('#endDate').val('');
|
||||||
|
window.location.reload(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user