diff --git a/app/Views/invoice_policy_mapping.php b/app/Views/invoice_policy_mapping.php index 870bcd66..29cc337d 100644 --- a/app/Views/invoice_policy_mapping.php +++ b/app/Views/invoice_policy_mapping.php @@ -57,6 +57,20 @@ table.dataTable tbody td { padding: 4px 4px !important; } .policy-adjustment { -moz-appearance:textfield; } + +
@@ -153,9 +167,9 @@ table.dataTable tbody td { padding: 4px 4px !important; } --> -
+
+ +
@@ -250,6 +267,36 @@ table.dataTable tbody td { padding: 4px 4px !important; }
+ + + \ No newline at end of file + +function downloadInvoicePdf(){ + + let invoice_id = $('#invoiceID').val(); + if(!invoice_id){ + return toastr.warning('No data found', 'Warning'); + } + window.location.href = '' + 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('
Loading...
'); + + var myModal = new bootstrap.Modal(document.getElementById('invoiceModal')); + myModal.show(); + + let url = ''; + + // 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('
No data found
'); + } + + }, 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('
No data found
'); + }); +} + + + + + + \ No newline at end of file diff --git a/app/Views/invoice_policy_mapping_add.php b/app/Views/invoice_policy_mapping_add.php index ee5a23f2..03168af3 100755 --- a/app/Views/invoice_policy_mapping_add.php +++ b/app/Views/invoice_policy_mapping_add.php @@ -293,6 +293,13 @@ table.dataTable tbody td { padding: 4px 4px !important; } 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 = ''; filteredPolicies.forEach(p => { const idStr = String(p.id); diff --git a/app/Views/payout_list_handler.php b/app/Views/payout_list_handler.php index 80315199..329645bd 100644 --- a/app/Views/payout_list_handler.php +++ b/app/Views/payout_list_handler.php @@ -128,6 +128,7 @@ $('#reportrange').val(''); $('#startDate').val(''); $('#endDate').val(''); + window.location.reload(true); }); });