added commision page on reports

This commit is contained in:
franknstayn
2020-02-10 01:16:26 +08:00
parent 5e663d5891
commit 92e7aae7bb
7 changed files with 195 additions and 51 deletions

View File

@@ -261,10 +261,54 @@ desired effect
});
$('#store_owners_table').DataTable();
$('#tbl_commission').DataTable({
initComplete: function () {
this.api().columns(0).every( function () {
var column = this;
var select = $('<select class="form-control"><option value=""></option></select>')
.appendTo( $('#store_filter').empty() )
.on( 'change', function () {
var val = $.fn.dataTable.util.escapeRegex(
$(this).val()
);
column
.search( val ? '^'+val+'$' : '', true, false )
.draw();
} );
column.data().unique().sort().each( function ( d, j ) {
select.append( '<option value="'+d+'">'+d+'</option>' )
} );
} );
},
dom: 'Bfrtip',
buttons: [
{
extend: 'csv',
className : "btn btn-default",
text: "<i class=\"fa fa-table\"></i> CSV",
title : function() {
return "Commission Reports";
}
},
{
extend: 'excel',
className : "btn btn-default",
text: "<i class=\"fa fa-file-excel-o\"></i> Excel",
title : function() {
return "Commission Reports";
}
}
],
});
$.fn.dataTable.ext.search.push(
function (settings, data, dataIndex) {
if (settings.nTable.id !=='tbl_store_orders') {
return true;
}
var min = $('#min').datepicker("getDate");
var max = $('#max').datepicker("getDate");
var startDate = new Date(data[10]);
@@ -273,11 +317,11 @@ desired effect
if(max == null && startDate >= min) {return true;}
if (startDate <= max && startDate >= min) { return true; }
return false;
}
},
);
$("#min").datepicker({ onSelect: function () { table.draw(); }, changeMonth: true, changeYear: true });
$("#max").datepicker({ onSelect: function () { table.draw(); }, changeMonth: true, changeYear: true });
var table = $('#tbl_store_orders').DataTable({
initComplete: function () {
@@ -325,42 +369,16 @@ desired effect
return "ORDER REPORTS";
}
}
//,
// {
// extend: 'pdf',
// exportOptions: {
// columns: [ 0, 1, 2, 3, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 ]
// },
// className : "btn btn-default",
// text: "<i class=\"fa fa-file-pdf-o\"></i> PDF",
// orientation: 'landscape',
// pageSize: 'LEGAL',
// title : function() {
// return "ORDER REPORTS";
// }
// },
// {
// extend: 'print',
// exportOptions: {
// columns: [ 0, 1, 2, 3, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 ]
// },
// className : "btn btn-default",
// text : "<i class=\"fa fa-print\"></i> Print",
// orientation: 'landscape',
// pageSize: 'LEGAL',
// title : function() {
// return "ORDER REPORTS";
// }
// }
],
columnDefs: [
{ targets: 9, type: 'date', visible: false },
{ targets: 9, type: 'date' }
{ targets: 10, type: 'date', visible: false },
{ targets: 10, type: 'date' }
],
});
$("#min").datepicker({ onSelect: function () { table.draw(); }, changeMonth: true, changeYear: true });
$("#max").datepicker({ onSelect: function () { table.draw(); }, changeMonth: true, changeYear: true });
$(document).on('a click', '.btn-order-item-details', function(e){

View File

@@ -72,14 +72,26 @@
<li class="{{ Request::is('admin/orders') ? 'active' : '' }}">
<a href="{{ url('/admin/orders') }}">
<i class="fa fa-list-alt"></i> <span>Orders</span>
<i class="fa fa-list-alt"></i> <span>Print Orders</span>
</a>
</li>
<!-- <li class="active"><a href="#"><i class="fa fa-dashboard"></i> <span>Dashboard</span></a></li> -->
<li class="{{ Request::is('admin/reports') ? 'active' : '' }}">
<!-- <li class="{{ Request::is('admin/reports') ? 'active' : '' }}">
<a href="{{ url('/admin/reports') }}">
<i class="fa fa-line-chart"></i> <span>Reports</span>
</a>
</li> -->
@php $under_reports = array("/admin/reports", "/admin/commission") @endphp
<li class="treeview {{ (in_array($getrequest_url, $under_reports)) ? 'active' : '' }}">
<a href="#"><i class="fa fa-line-chart"></i> <span>Reports</span>
<span class="pull-right-container">
<i class="fa fa-angle-left pull-right"></i>
</span>
</a>
<ul class="treeview-menu">
<li {{ ($getrequest_url == '/admin/reports') ? 'class=active' : '' }}><a href="{{ url('/admin/reports') }}"><i class="fa fa-circle-o"></i> Store Orders</a></li>
<li {{ ($getrequest_url == '/admin/commission') ? 'class=active' : '' }}><a href="{{ url('/admin/commission') }}"><i class="fa fa-circle-o"></i> Commission</a></li>
</ul>
</li>
</ul>