update order status report

This commit is contained in:
franknstayn
2022-02-03 20:48:23 +08:00
parent 4c6ea784b7
commit cab28b65ff
2 changed files with 571 additions and 508 deletions

View File

@@ -4,6 +4,7 @@ This is a starter template page. Use this page to start your new project from
scratch. This page gets rid of all links and provides the needed markup only.
-->
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
@@ -114,10 +115,12 @@ scratch. This page gets rid of all links and provides the needed markup only.
width: 45px;
margin: 2px;
}
#image_preview img {
height: 65px;
width: 100%;
}
/* div#image_preview {
column-count: 4;
}
@@ -157,6 +160,7 @@ desired effect
| | sidebar-mini |
|---------------------------------------------------------|
-->
<body class="hold-transition skin-black sidebar-mini">
<div class="wrapper">
@@ -304,8 +308,7 @@ desired effect
});
},
dom: 'Bfrtip',
buttons: [
{
buttons: [{
extend: 'csv',
className: "btn btn-default",
text: "<i class=\"fa fa-table\"></i> CSV",
@@ -327,16 +330,38 @@ desired effect
$.fn.dataTable.ext.search.push(
function(settings, data, dataIndex) {
if (settings.nTable.id !=='tbl_store_orders' || settings.nTable.id !=='tbl_order_status') {
if (settings.nTable.id !== 'tbl_store_orders' && settings.nTable.id !== 'tbl_order_status') {
return true;
}
if (settings.nTable.id == 'tbl_store_orders') {
var min = $('#min').datepicker("getDate");
var max = $('#max').datepicker("getDate");
var startDate = new Date(data[10]);
if (min == null && max == null) { return true; }
if (min == null && startDate <= max) { return true;}
if(max == null && startDate >= min) {return true;}
if (startDate <= max && startDate >= min) { return true; }
// console.log("store_od", startDate)
} else {
// tbl_order_status
var min = $('#min_tbl_order_status').datepicker("getDate");
var max = $('#max_tbl_order_status').datepicker("getDate");
var startDate = new Date(data[5]);
// console.log("order", startDate)
}
if (min == null && max == null) {
return true;
}
if (min == null && startDate <= max) {
return true;
}
if (max == null && startDate >= min) {
return true;
}
if (startDate <= max && startDate >= min) {
return true;
}
return false;
},
@@ -367,8 +392,7 @@ desired effect
autoWidth: false,
// scrollX: true,
dom: 'Bfrtip',
buttons: [
{
buttons: [{
extend: 'csv',
exportOptions: {
columns: [0, 1, 2, 3, 4]
@@ -391,9 +415,15 @@ desired effect
}
}
],
columnDefs: [
{ targets: 4, type: 'date', visible: false },
{ targets: 4, type: 'date' }
columnDefs: [{
targets: 5,
type: 'date',
visible: false
},
{
targets: 5,
type: 'date'
}
],
});
@@ -421,8 +451,7 @@ desired effect
},
scrollX: true,
dom: 'Bfrtip',
buttons: [
{
buttons: [{
extend: 'csv',
exportOptions: {
columns: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20]
@@ -445,19 +474,49 @@ desired effect
}
}
],
columnDefs: [
{ targets: 10, type: 'date', visible: false },
{ targets: 10, type: 'date' }
columnDefs: [{
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 });
$("#min").datepicker({
onSelect: function() {
table.draw();
},
changeMonth: true,
changeYear: true
});
$("#max").datepicker({
onSelect: function() {
table.draw();
},
changeMonth: true,
changeYear: true
});
$("#min").datepicker({ onSelect: function () { tbl_order_status.draw(); }, changeMonth: true, changeYear: true });
$("#max").datepicker({ onSelect: function () { tbl_order_status.draw(); }, changeMonth: true, changeYear: true });
$("#min_tbl_order_status").datepicker({
onSelect: function() {
tbl_order_status.draw();
},
changeMonth: true,
changeYear: true
});
$("#max_tbl_order_status").datepicker({
onSelect: function() {
tbl_order_status.draw();
},
changeMonth: true,
changeYear: true
});
$(document).on('a click', '.btn-order-item-details', function(e) {
@@ -1382,8 +1441,7 @@ desired effect
var total_file = document.getElementById("uploadPrintFiles").files.length;
for(var i=0;i<total_file;i++)
{
for (var i = 0; i < total_file; i++) {
$('#image_preview').append("<div class='col-sm-3'> " +
"<div class='print-file-holder'> " +
"<img class='svg-print-file-preview' src='" + URL.createObjectURL(event.target.files[i]) + "'> " +
@@ -1470,8 +1528,7 @@ desired effect
var split_id = state.id.split("##");
var thumb = "{{ config('site_config.images_directory') }}" + split_id[1];
var $state = $('<div><img sytle="display: inline-block;" height="45px" src="'+thumb+'" /><span>' + state.text + '</span></div>'
);
var $state = $('<div><img sytle="display: inline-block;" height="45px" src="' + thumb + '" /><span>' + state.text + '</span></div>');
return $state;
}
@@ -1714,7 +1771,9 @@ desired effect
'</div>').fadeIn().delay(5000).fadeOut();
}
$("html, body").animate({ scrollTop: 0 }, "slow");
$("html, body").animate({
scrollTop: 0
}, "slow");
$("#btn_save_new_store").attr('disabled', false);
$("#btn_save_new_store").html('Save');
@@ -1771,7 +1830,9 @@ desired effect
'</div>').fadeIn().delay(5000).fadeOut();
}
$("html, body").animate({ scrollTop: 0 }, "slow");
$("html, body").animate({
scrollTop: 0
}, "slow");
$("#btn_update_store").attr('disabled', false);
$("#btn_update_store").html('Save Changes');
@@ -1881,4 +1942,5 @@ desired effect
}
</script>
</body>
</html>

View File

@@ -36,7 +36,7 @@
<div class="form-group">
<label class="control-label">Select Date From: <span
class="required">*</span></label>
<input type="text" name="min" class="form-control datepicker-reports" id="min"
<input type="text" name="min" class="form-control datepicker-reports min" id="min_tbl_order_status"
placeholder="Select Date" required autocomplete="off" />
</div>
</div>
@@ -44,7 +44,7 @@
<div class="form-group">
<label class="control-label">Select Date To: <span
class="required">*</span></label>
<input type="text" name="max" class="form-control datepicker-reports" id="max"
<input type="text" name="max" class="form-control datepicker-reports max" id="max_tbl_order_status"
placeholder="Select Date" required autocomplete="off" />
</div>
</div>
@@ -75,6 +75,7 @@
<td>{{ $item->ProductName }}</td>
<td>{{ $item->OrderStatus }}</td>
<td>{{ date("F j, Y g:i A", strtotime($item->DateCreated)) }}</td>
<td>{{ date('Y/m/d', strtotime($item->DateCreated)) }}</td>
</tr>
@endforeach