delete data table
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,10 +49,29 @@
|
||||
</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>
|
||||
<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
|
||||
style="border-radius: 50px; background: linear-gradient(to right, #078bce, #1a1d1e); color: white;">
|
||||
<tr>
|
||||
@@ -78,14 +97,14 @@
|
||||
<tfoot style="background-color: #cdd4da; font-weight: bold;">
|
||||
<tr>
|
||||
<td colspan="4" class="text-right">Total</td>
|
||||
<td>0.00</td> <!-- Grand Total Sum -->
|
||||
<td>0.00</td> <!-- Cash Sum -->
|
||||
<td>0.00</td> <!-- Card 1 Sum -->
|
||||
<td>0.00</td> <!-- Card 2 Sum -->
|
||||
<td>0.00</td> <!-- Card 3 Sum -->
|
||||
<td>0.00</td> <!-- Online Sum -->
|
||||
<td>0.00</td> <!-- Link Pay Sum -->
|
||||
<td>0.00</td> <!-- Due Sum -->
|
||||
<td>0.00</td>
|
||||
<td>0.00</td>
|
||||
<td>0.00</td>
|
||||
<td>0.00</td>
|
||||
<td>0.00</td>
|
||||
<td>0.00</td>
|
||||
<td>0.00</td>
|
||||
<td>0.00</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
@@ -93,10 +112,10 @@
|
||||
</div>
|
||||
|
||||
<div class="container-fluid mt-5">
|
||||
<!-- Credit Sale Collections Table -->
|
||||
<h4 class="mb-3" style="color: #00489f; font-weight: bold;">Credit Sale Collections</h4>
|
||||
<div class="table-responsive">
|
||||
<table style="border-radius: 15px; background-color: #e0e5ea;" id="credit-collection-table"
|
||||
class="table table-hover">
|
||||
<table style="border-radius: 15px; background-color: #e0e5ea;" class="table table-hover table-bordered">
|
||||
<thead
|
||||
style="border-radius: 50px; background: linear-gradient(to right, #078bce, #1a1d1e); color: white;">
|
||||
<tr>
|
||||
@@ -121,13 +140,13 @@
|
||||
<tfoot style="background-color: #cdd4da; font-weight: bold;">
|
||||
<tr>
|
||||
<td colspan="4" class="text-right">Total</td>
|
||||
<td>0.00</td> <!-- Grand Total Sum -->
|
||||
<td>0.00</td> <!-- Cash Sum -->
|
||||
<td>0.00</td> <!-- Card 1 Sum -->
|
||||
<td>0.00</td> <!-- Card 2 Sum -->
|
||||
<td>0.00</td> <!-- Card 3 Sum -->
|
||||
<td>0.00</td> <!-- Online Sum -->
|
||||
<td>0.00</td> <!-- Link Pay Sum -->
|
||||
<td>0.00</td>
|
||||
<td>0.00</td>
|
||||
<td>0.00</td>
|
||||
<td>0.00</td>
|
||||
<td>0.00</td>
|
||||
<td>0.00</td>
|
||||
<td>0.00</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
@@ -135,10 +154,11 @@
|
||||
</div>
|
||||
|
||||
<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>
|
||||
<div class="table-responsive">
|
||||
<table style="border-radius: 15px; background-color: #e0e5ea; width: 60%;" id="summary-table"
|
||||
class="table table-hover">
|
||||
<table style="border-radius: 15px; background-color: #e0e5ea; width: 60%;"
|
||||
class="table table-hover table-bordered">
|
||||
<thead
|
||||
style="border-radius: 50px; background: linear-gradient(to right, #078bce, #1a1d1e); color: white;">
|
||||
<tr>
|
||||
@@ -219,19 +239,9 @@
|
||||
background-color: #0068e3;
|
||||
}
|
||||
|
||||
.dt-button-collection.dropdown-menu {
|
||||
background: #0068e3;
|
||||
padding: 10px 15px;
|
||||
}
|
||||
|
||||
/* Table Border Radius Fix for Datatables */
|
||||
table.dataTable {
|
||||
table {
|
||||
border-collapse: collapse !important;
|
||||
}
|
||||
|
||||
.dataTables_wrapper .dt-buttons {
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@endsection
|
||||
@@ -244,55 +254,15 @@
|
||||
}
|
||||
});
|
||||
|
||||
// Common export buttons configuration
|
||||
var exportButtons = [
|
||||
{
|
||||
extend: 'pdf',
|
||||
text: '<i title="export to pdf" class="fa fa-file-pdf-o"></i>',
|
||||
exportOptions: { columns: ':visible' }
|
||||
},
|
||||
{
|
||||
extend: 'excel',
|
||||
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' }
|
||||
// මුළු රිපෝට් එකම එක්ස්පෝර්ට් කරන්න හදපු Function එක
|
||||
function exportFullReport(exportType) {
|
||||
var selectedDate = $('#report_date').val();
|
||||
|
||||
// ඔයාගේ Controller එකේ export route එකට මේක හරවන්න ඕනේ.
|
||||
// උදාහරණයක් විදිහට: url('/dailysalepaymentreportmodule/export')
|
||||
var exportUrl = "{{ url('/dailysalepaymentreportmodule/export') }}" + "?date=" + selectedDate + "&type=" + exportType;
|
||||
|
||||
window.location.href = exportUrl;
|
||||
}
|
||||
];
|
||||
|
||||
// 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>
|
||||
@endpush
|
||||
@@ -16,5 +16,6 @@ use Modules\DailySalePaymentReportModule\Http\Controllers\DailySalePaymentReport
|
||||
Route::middleware(['common', 'auth', 'active'])->group(function () {
|
||||
Route::controller(DailySalePaymentReportModuleController::class)->prefix('dailysalepaymentreportmodule')->group(function () {
|
||||
Route::get('/', 'index');
|
||||
Route::get('/export', 'exportReport');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user