total
parent
dce70d85dd
commit
ab1a2c886a
|
@ -24,13 +24,20 @@ class History extends Controller
|
|||
->addColumn('nomor', function ($data) use (&$nomor) {
|
||||
return $nomor++;
|
||||
})
|
||||
->addColumn('nama_user', function ($data) {
|
||||
return $data->user->name;
|
||||
->addColumn('nama_pemesan', function ($data) {
|
||||
$nomor = $data->nomor_pemesan != null ? '(' . $data->nomor_pemesan . ')' : '';
|
||||
return $data->nama_pemesan . ' ' . $nomor;
|
||||
})
|
||||
->addColumn('nomor_meja', function ($data) {
|
||||
return $data->nomor_meja != null ? $data->nomor_meja : '-';
|
||||
})
|
||||
->addColumn('created_at', function ($data) {
|
||||
return \Carbon\Carbon::parse($data->created_at)->format('d F Y H:i:s');
|
||||
})
|
||||
->addColumn('grand_total', function ($data) {
|
||||
->addColumn('total_bayar_rp', function ($data) {
|
||||
return 'Rp ' . number_format($data->total_bayar, 0, ',', '.');
|
||||
})
|
||||
->addColumn('grand_total_rp', function ($data) {
|
||||
return 'Rp ' . number_format($data->grand_total, 0, ',', '.');
|
||||
})
|
||||
->addColumn('ubah', function ($data) {
|
||||
|
|
|
@ -21,7 +21,7 @@ class Transaksi extends Controller
|
|||
|
||||
public function index()
|
||||
{
|
||||
$orderCode = "ORD -" . strtoupper(random_str(6, random_str()));
|
||||
$orderCode = "ORD-" . strtoupper(random_str(6, random_str()));
|
||||
$KelompokKategori = KelompokKategori::with('kelompokKategoriPivot.produk')->get();
|
||||
|
||||
// dd($KelompokKategori);
|
||||
|
|
|
@ -1,51 +1,62 @@
|
|||
@extends('layouts.base')
|
||||
|
||||
@section('content-header')
|
||||
<div class="col-12">
|
||||
<div class="container" style="display: contents">
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-6">
|
||||
<h1 class="m-0"> Kasir <small>kasir 3.0</small></h1>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<ol class="breadcrumb float-sm-right">
|
||||
<li class="breadcrumb-item"><a href="#">Home</a></li>
|
||||
<li class="breadcrumb-item"><a href="#">Kasir</a></li>
|
||||
<li class="breadcrumb-item active">History</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="col-12 mt-2">
|
||||
<div class="container" style="display: contents">
|
||||
<div class="card">
|
||||
<div class="card bg-warning" style="min-height:5px; border-radius:1px;"></div>
|
||||
<div class="card-body">
|
||||
{{-- <h5 class="card-title">Form List Data</h5> --}}
|
||||
<div class="table-responsive mt-3">
|
||||
<table id="tabelku" class="table table-hover display" style="width: 100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center">No</th>
|
||||
<th>Kode Pesanan</th>
|
||||
<th>Kasir</th>
|
||||
<th>Tanggal & Jam</th>
|
||||
<th>Total Pesanan</th>
|
||||
<th>Diskon(%)</th>
|
||||
<th>Total</th>
|
||||
<th class="text-center"><i class="fas fa-cog"></i></th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
<div class="col-12">
|
||||
<div class="container" style="display: contents">
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-6">
|
||||
<h1 class="m-0"> Kasir <small>kasir 3.0</small></h1>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<ol class="breadcrumb float-sm-right">
|
||||
<li class="breadcrumb-item"><a href="#">Home</a></li>
|
||||
<li class="breadcrumb-item"><a href="#">Kasir</a></li>
|
||||
<li class="breadcrumb-item active">History</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="col-12 mt-2">
|
||||
<div class="container" style="display: contents">
|
||||
<div class="card">
|
||||
<div class="card bg-warning" style="min-height:5px; border-radius:1px;"></div>
|
||||
<div class="card-body">
|
||||
{{-- <h5 class="card-title">Form List Data</h5> --}}
|
||||
<div class="table-responsive mt-3">
|
||||
<table id="tabelku" class="table table-hover display" style="width: 100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center">No</th>
|
||||
<th>Kode Pesanan</th>
|
||||
<th>Pemesan</th>
|
||||
<th>Nomor Meja</th>
|
||||
<th>Tanggal & Jam</th>
|
||||
<th>Total Pesanan</th>
|
||||
<th>Sub Total</th>
|
||||
<th>Diskon(%)</th>
|
||||
<th>Total</th>
|
||||
<th class="text-center"><i class="fas fa-cog"></i></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th class="text-right" colspan="6">Total</th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th class="text-center"></th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('styles')
|
||||
|
@ -64,34 +75,106 @@
|
|||
}
|
||||
</style>
|
||||
<link rel="stylesheet" href="{{ asset('assets/plugins/toastr/toastr.min.css') }}">
|
||||
<link rel="stylesheet" href="{{asset('assets/datatables/datatables.min.css')}}">
|
||||
<link rel="stylesheet" href="{{ asset('assets/datatables/datatables.min.css') }}">
|
||||
@endpush
|
||||
|
||||
@push('scripts')
|
||||
<script src="{{ asset('assets/datatables/datatables.min.js') }}"></script>
|
||||
<script>
|
||||
$(document).ready( function () {
|
||||
$(document).ready(function() {
|
||||
$('#tabelku').DataTable({
|
||||
processing: true,
|
||||
serverSide: true,
|
||||
ajax: '{{ route('history.getDataHistory') }}',
|
||||
columns: [
|
||||
{data: 'nomor', name: 'nomor', orderable: false, className: 'text-center'},
|
||||
{data: 'kode_pesanan', name: 'kode_pesanan'},
|
||||
{data: 'nama_user', name: 'nama_user'},
|
||||
{data: 'created_at', name: 'created_at'},
|
||||
{data: 'total_pesanan', name: 'total_pesanan', className: 'text-center'},
|
||||
{
|
||||
data: 'diskon_persen',
|
||||
name: 'diskon_persen',
|
||||
className: 'text-center',
|
||||
render: function(data){
|
||||
return data ?? 0;
|
||||
}
|
||||
},
|
||||
{data: 'grand_total', name: 'grand_total'},
|
||||
{data: 'ubah', name: 'ubah', className: 'text-center'},
|
||||
]
|
||||
columns: [{
|
||||
data: 'nomor',
|
||||
name: 'nomor',
|
||||
orderable: false,
|
||||
className: 'text-center'
|
||||
},
|
||||
{
|
||||
data: 'kode_pesanan',
|
||||
name: 'kode_pesanan'
|
||||
},
|
||||
{
|
||||
data: 'nama_pemesan',
|
||||
name: 'nama_pemesan'
|
||||
},
|
||||
{
|
||||
data: 'nomor_meja',
|
||||
name: 'nomor_meja'
|
||||
},
|
||||
{
|
||||
data: 'created_at',
|
||||
name: 'created_at'
|
||||
},
|
||||
{
|
||||
data: 'total_pesanan',
|
||||
name: 'total_pesanan',
|
||||
className: 'text-center'
|
||||
},
|
||||
{
|
||||
data: 'total_bayar',
|
||||
name: 'total_bayar',
|
||||
render: function(data) {
|
||||
// change to IDR
|
||||
return 'Rp. ' + data.toString().replace(/\B(?=(\d{3})+(?!\d))/g, '.');
|
||||
}
|
||||
},
|
||||
{
|
||||
data: 'diskon_persen',
|
||||
name: 'diskon_persen',
|
||||
className: 'text-center',
|
||||
render: function(data) {
|
||||
return data ?? 0;
|
||||
}
|
||||
},
|
||||
{
|
||||
data: 'grand_total',
|
||||
name: 'grand_total',
|
||||
render: function(data) {
|
||||
// change to IDR
|
||||
return 'Rp. ' + data.toString().replace(/\B(?=(\d{3})+(?!\d))/g, '.');
|
||||
}
|
||||
},
|
||||
{
|
||||
data: 'ubah',
|
||||
name: 'ubah',
|
||||
className: 'text-center'
|
||||
},
|
||||
],
|
||||
footerCallback: function(row, data, start, end, display) {
|
||||
let api = this.api();
|
||||
console.log(api.column(6).data());
|
||||
// Remove the formatting to get integer data for summation
|
||||
let intVal = function(i) {
|
||||
return typeof i === 'string' ?
|
||||
i.replace(/[\$,]/g, '') * 1 :
|
||||
typeof i === 'number' ?
|
||||
i :
|
||||
0;
|
||||
};
|
||||
|
||||
// Total over all pages
|
||||
totalAll = api
|
||||
.column(8)
|
||||
.data()
|
||||
.reduce((a, b) => intVal(a) + intVal(b), 0);
|
||||
|
||||
// Total over this page
|
||||
pageTotal = api
|
||||
.column(6, {
|
||||
page: 'current'
|
||||
})
|
||||
.data()
|
||||
.reduce((a, b) => intVal(a) + intVal(b), 0);
|
||||
|
||||
// Update footer
|
||||
api.column(6).footer().innerHTML =
|
||||
'Rp. ' + pageTotal.toString().replace(/\B(?=(\d{3})+(?!\d))/g, '.');
|
||||
api.column(8).footer().innerHTML =
|
||||
'Rp. ' + totalAll.toString().replace(/\B(?=(\d{3})+(?!\d))/g, '.');
|
||||
}
|
||||
})
|
||||
})
|
||||
</script>
|
||||
|
|
|
@ -77,11 +77,11 @@
|
|||
|
||||
<body style="width: 58mm;">
|
||||
<!-- Button Print -->
|
||||
<div class="">
|
||||
{{-- <div class="">
|
||||
<div class="col-6 mb">
|
||||
<button class="btn btn-info btn-block hidden-print" id="print-dapur">Print</button>
|
||||
</div>
|
||||
</div>
|
||||
</div> --}}
|
||||
<br>
|
||||
<h2 style="text-align: center">Sepiring Telur Keriting</h2>
|
||||
<p style="text-align: center">Jln. Jawa No. 28A, Jember</p>
|
||||
|
@ -303,7 +303,12 @@
|
|||
}
|
||||
</style>
|
||||
<script>
|
||||
// window.print();
|
||||
addEventListener("afterprint", (event) => {
|
||||
window.close();
|
||||
});
|
||||
|
||||
window.print();
|
||||
|
||||
const $btnPrint = document.querySelector("#print-dapur");
|
||||
$btnPrint.addEventListener("click", () => {
|
||||
window.print();
|
||||
|
|
|
@ -75,13 +75,19 @@
|
|||
}
|
||||
</style>
|
||||
|
||||
<body style="width: 58mm;">
|
||||
<body style="width: 56mm;">
|
||||
<!-- Button Print -->
|
||||
<div class="">
|
||||
{{-- <div class="">
|
||||
<div class="col-6 mb">
|
||||
<button class="btn btn-info btn-block hidden-print" id="print-dapur">Print</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-6 mb">
|
||||
<button class="btn btn-warning btn-block hidden-print" id="refresh">Refresh</button>
|
||||
</div>
|
||||
<div class="col-6 mb">
|
||||
<button class="btn btn-danger btn-block hidden-print" id="close">Tutup</button>
|
||||
</div>
|
||||
</div> --}}
|
||||
<br>
|
||||
<h2 style="text-align: center">Sepiring Telur Keriting</h2>
|
||||
<p style="text-align: center">Jln. Jawa No. 28A, Jember</p>
|
||||
|
@ -290,6 +296,13 @@
|
|||
box-shadow: none;
|
||||
}
|
||||
|
||||
.btn-warning {
|
||||
color: #fff;
|
||||
background-color: orange;
|
||||
border-color: orange;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.btn-danger {
|
||||
color: #fff;
|
||||
background-color: #dc3545;
|
||||
|
@ -303,7 +316,12 @@
|
|||
}
|
||||
</style>
|
||||
<script>
|
||||
// window.print();
|
||||
addEventListener("afterprint", (event) => {
|
||||
window.close();
|
||||
});
|
||||
|
||||
window.print();
|
||||
|
||||
const $btnPrint = document.querySelector("#print-dapur");
|
||||
$btnPrint.addEventListener("click", () => {
|
||||
window.print();
|
||||
|
@ -314,6 +332,11 @@
|
|||
location.reload()
|
||||
})
|
||||
})
|
||||
$(document).ready(function() {
|
||||
$('#close').on('click', function() {
|
||||
window.close()
|
||||
})
|
||||
})
|
||||
</script>
|
||||
|
||||
</html>
|
||||
|
|
|
@ -77,11 +77,11 @@
|
|||
|
||||
<body style="width: 58mm;">
|
||||
<!-- Button Print -->
|
||||
<div class="">
|
||||
{{-- <div class="">
|
||||
<div class="col-6 mb">
|
||||
<button class="btn btn-info btn-block hidden-print" id="print-dapur">Print</button>
|
||||
</div>
|
||||
</div>
|
||||
</div> --}}
|
||||
<br>
|
||||
@for ($i = 0; $i < 2; $i++)
|
||||
<hr class="dashed-line" style="margin-top: 15px;">
|
||||
|
@ -220,7 +220,12 @@
|
|||
}
|
||||
</style>
|
||||
<script>
|
||||
// window.print();
|
||||
addEventListener("afterprint", (event) => {
|
||||
window.close();
|
||||
});
|
||||
|
||||
window.print();
|
||||
|
||||
const $btnPrint = document.querySelector("#print-dapur");
|
||||
$btnPrint.addEventListener("click", () => {
|
||||
window.print();
|
||||
|
|
|
@ -77,11 +77,11 @@
|
|||
|
||||
<body style="width: 58mm;">
|
||||
<!-- Button Print -->
|
||||
<div class="">
|
||||
{{-- <div class="">
|
||||
<div class="col-6 mb">
|
||||
<button class="btn btn-info btn-block hidden-print" id="print-dapur">Print</button>
|
||||
</div>
|
||||
</div>
|
||||
</div> --}}
|
||||
<br>
|
||||
@for ($i = 0; $i < 3; $i++)
|
||||
<hr class="dashed-line" style="margin-top: 15px;">
|
||||
|
@ -223,7 +223,12 @@
|
|||
}
|
||||
</style>
|
||||
<script>
|
||||
// window.print();
|
||||
addEventListener("afterprint", (event) => {
|
||||
window.close();
|
||||
});
|
||||
|
||||
window.print();
|
||||
|
||||
const $btnPrint = document.querySelector("#print-dapur");
|
||||
$btnPrint.addEventListener("click", () => {
|
||||
window.print();
|
||||
|
|
Loading…
Reference in New Issue