delete data table

This commit is contained in:
2026-07-03 11:33:40 +05:30
parent 50a251853d
commit f2ad6093d2
3 changed files with 62 additions and 81 deletions

View File

@@ -76,4 +76,14 @@ class DailySalePaymentReportModuleController extends Controller
{ {
// //
} }
public function exportReport(Request $request)
{
$date = $request->query('date');
$type = $request->query('type');
return "Export function is working. Selected Date: " . $date . " | Export Type: " . $type;
}
} }

View File

@@ -49,10 +49,29 @@
</div> </div>
</div> </div>
<div class="container-fluid mt-3"> <div class="container-fluid mt-4">
<!-- අලුතෙන් දාපු Single Export Buttons ටික -->
<div class="row mb-3">
<div class="col-md-12 text-right">
<button class="btn btn-danger" onclick="exportFullReport('pdf')" style="border-radius: 10px;">
<i class="fa fa-file-pdf-o"></i> Export PDF
</button>
<button class="btn btn-success" onclick="exportFullReport('excel')" style="border-radius: 10px;">
<i class="dripicons-document-new"></i> Export Excel
</button>
<button class="btn btn-info" onclick="exportFullReport('csv')" style="border-radius: 10px;">
<i class="fa fa-file-text-o"></i> Export CSV
</button>
<button class="btn btn-secondary" onclick="window.print()" style="border-radius: 10px;">
<i class="fa fa-print"></i> Print Report
</button>
</div>
</div>
<!-- Sales Table -->
<h4 class="mb-3" style="color: #00489f; font-weight: bold;">Sales Table (Daily Sale)</h4> <h4 class="mb-3" style="color: #00489f; font-weight: bold;">Sales Table (Daily Sale)</h4>
<div class="table-responsive"> <div class="table-responsive">
<table style="border-radius: 15px; background-color: #e0e5ea;" id="sales-table" class="table table-hover"> <table style="border-radius: 15px; background-color: #e0e5ea;" class="table table-hover table-bordered">
<thead <thead
style="border-radius: 50px; background: linear-gradient(to right, #078bce, #1a1d1e); color: white;"> style="border-radius: 50px; background: linear-gradient(to right, #078bce, #1a1d1e); color: white;">
<tr> <tr>
@@ -78,14 +97,14 @@
<tfoot style="background-color: #cdd4da; font-weight: bold;"> <tfoot style="background-color: #cdd4da; font-weight: bold;">
<tr> <tr>
<td colspan="4" class="text-right">Total</td> <td colspan="4" class="text-right">Total</td>
<td>0.00</td> <!-- Grand Total Sum --> <td>0.00</td>
<td>0.00</td> <!-- Cash Sum --> <td>0.00</td>
<td>0.00</td> <!-- Card 1 Sum --> <td>0.00</td>
<td>0.00</td> <!-- Card 2 Sum --> <td>0.00</td>
<td>0.00</td> <!-- Card 3 Sum --> <td>0.00</td>
<td>0.00</td> <!-- Online Sum --> <td>0.00</td>
<td>0.00</td> <!-- Link Pay Sum --> <td>0.00</td>
<td>0.00</td> <!-- Due Sum --> <td>0.00</td>
</tr> </tr>
</tfoot> </tfoot>
</table> </table>
@@ -93,10 +112,10 @@
</div> </div>
<div class="container-fluid mt-5"> <div class="container-fluid mt-5">
<!-- Credit Sale Collections Table -->
<h4 class="mb-3" style="color: #00489f; font-weight: bold;">Credit Sale Collections</h4> <h4 class="mb-3" style="color: #00489f; font-weight: bold;">Credit Sale Collections</h4>
<div class="table-responsive"> <div class="table-responsive">
<table style="border-radius: 15px; background-color: #e0e5ea;" id="credit-collection-table" <table style="border-radius: 15px; background-color: #e0e5ea;" class="table table-hover table-bordered">
class="table table-hover">
<thead <thead
style="border-radius: 50px; background: linear-gradient(to right, #078bce, #1a1d1e); color: white;"> style="border-radius: 50px; background: linear-gradient(to right, #078bce, #1a1d1e); color: white;">
<tr> <tr>
@@ -121,13 +140,13 @@
<tfoot style="background-color: #cdd4da; font-weight: bold;"> <tfoot style="background-color: #cdd4da; font-weight: bold;">
<tr> <tr>
<td colspan="4" class="text-right">Total</td> <td colspan="4" class="text-right">Total</td>
<td>0.00</td> <!-- Grand Total Sum --> <td>0.00</td>
<td>0.00</td> <!-- Cash Sum --> <td>0.00</td>
<td>0.00</td> <!-- Card 1 Sum --> <td>0.00</td>
<td>0.00</td> <!-- Card 2 Sum --> <td>0.00</td>
<td>0.00</td> <!-- Card 3 Sum --> <td>0.00</td>
<td>0.00</td> <!-- Online Sum --> <td>0.00</td>
<td>0.00</td> <!-- Link Pay Sum --> <td>0.00</td>
</tr> </tr>
</tfoot> </tfoot>
</table> </table>
@@ -135,10 +154,11 @@
</div> </div>
<div class="container-fluid mt-5 mb-5"> <div class="container-fluid mt-5 mb-5">
<!-- Payment Method Summary Table -->
<h4 class="mb-3" style="color: #00489f; font-weight: bold;">Payment Method Summary</h4> <h4 class="mb-3" style="color: #00489f; font-weight: bold;">Payment Method Summary</h4>
<div class="table-responsive"> <div class="table-responsive">
<table style="border-radius: 15px; background-color: #e0e5ea; width: 60%;" id="summary-table" <table style="border-radius: 15px; background-color: #e0e5ea; width: 60%;"
class="table table-hover"> class="table table-hover table-bordered">
<thead <thead
style="border-radius: 50px; background: linear-gradient(to right, #078bce, #1a1d1e); color: white;"> style="border-radius: 50px; background: linear-gradient(to right, #078bce, #1a1d1e); color: white;">
<tr> <tr>
@@ -219,19 +239,9 @@
background-color: #0068e3; background-color: #0068e3;
} }
.dt-button-collection.dropdown-menu { table {
background: #0068e3;
padding: 10px 15px;
}
/* Table Border Radius Fix for Datatables */
table.dataTable {
border-collapse: collapse !important; border-collapse: collapse !important;
} }
.dataTables_wrapper .dt-buttons {
margin-bottom: 15px;
}
</style> </style>
@endsection @endsection
@@ -244,55 +254,15 @@
} }
}); });
// Common export buttons configuration // මුළු රිපෝට් එකම එක්ස්පෝර්ට් කරන්න හදපු Function එක
var exportButtons = [ function exportFullReport(exportType) {
{ var selectedDate = $('#report_date').val();
extend: 'pdf',
text: '<i title="export to pdf" class="fa fa-file-pdf-o"></i>', // ඔයාගේ Controller එකේ export route එකට මේක හරවන්න ඕනේ.
exportOptions: { columns: ':visible' } // උදාහරණයක් විදිහට: url('/dailysalepaymentreportmodule/export')
}, var exportUrl = "{{ url('/dailysalepaymentreportmodule/export') }}" + "?date=" + selectedDate + "&type=" + exportType;
{
extend: 'excel', window.location.href = exportUrl;
text: '<i title="export to excel" class="dripicons-document-new"></i>',
exportOptions: { columns: ':visible' }
},
{
extend: 'csv',
text: '<i title="export to csv" class="fa fa-file-text-o"></i>',
exportOptions: { columns: ':visible' }
},
{
extend: 'print',
text: '<i title="print" class="fa fa-print"></i>',
exportOptions: { columns: ':visible' }
} }
];
// Initialize Sales Table
$('#sales-table').DataTable({
"order": [],
dom: '<"row"lfB>rtip',
buttons: exportButtons,
'lengthMenu': [[10, 25, 50, -1], [10, 25, 50, "All"]]
});
// Initialize Credit Collection Table
$('#credit-collection-table').DataTable({
"order": [],
dom: '<"row"lfB>rtip',
buttons: exportButtons,
'lengthMenu': [[10, 25, 50, -1], [10, 25, 50, "All"]]
});
// Initialize Summary Table (Without pagination/search for cleaner look)
$('#summary-table').DataTable({
"order": [],
dom: '<"row"B>rt',
buttons: exportButtons,
"paging": false,
"searching": false,
"info": false
});
</script> </script>
@endpush @endpush

View File

@@ -13,8 +13,9 @@
use Modules\DailySalePaymentReportModule\Http\Controllers\DailySalePaymentReportModuleController; use Modules\DailySalePaymentReportModule\Http\Controllers\DailySalePaymentReportModuleController;
Route::middleware(['common', 'auth', 'active'])->group(function() { Route::middleware(['common', 'auth', 'active'])->group(function () {
Route::controller(DailySalePaymentReportModuleController::class)->prefix('dailysalepaymentreportmodule')->group(function () { Route::controller(DailySalePaymentReportModuleController::class)->prefix('dailysalepaymentreportmodule')->group(function () {
Route::get('/', 'index'); Route::get('/', 'index');
Route::get('/export', 'exportReport');
}); });
}); });