Merge branch 'sofyan' of https://git.indoserv.net/wewmantap/resto-dhepot into main-gitea
commit
3f16ec0754
app/Http/Controllers/Kasir
database/migrations
resources/views/pages/Kasir
routes
|
@ -35,7 +35,7 @@ class History extends Controller
|
||||||
})
|
})
|
||||||
->addColumn('ubah', function ($data) {
|
->addColumn('ubah', function ($data) {
|
||||||
return '<div class="btn-group">
|
return '<div class="btn-group">
|
||||||
<a href="javascript:void(0)" onclick="print(\'' . $data->id . '\')"><span class="btn btn-xs btn-success"><i class="fas fa-print"></i></span></a></div>';
|
<a href="javascript:void(0)" onclick="print(\'' . $data->id . '\')"><span class="btn btn-xs btn-success"><i class="fas fa-print"></i></span></a></div>';
|
||||||
})
|
})
|
||||||
->rawColumns(['nomor', 'nama_user', 'created_at', 'grand_total', 'ubah'])
|
->rawColumns(['nomor', 'nama_user', 'created_at', 'grand_total', 'ubah'])
|
||||||
->make(true);
|
->make(true);
|
||||||
|
|
|
@ -5,6 +5,7 @@ namespace App\Http\Controllers\Kasir;
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
use App\Models\DetailPesanan;
|
use App\Models\DetailPesanan;
|
||||||
use App\Models\KelompokKategori;
|
use App\Models\KelompokKategori;
|
||||||
|
use App\Models\Pesanan;
|
||||||
use App\Models\Produk;
|
use App\Models\Produk;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Support\Facades\DB;
|
use Illuminate\Support\Facades\DB;
|
||||||
|
@ -30,6 +31,44 @@ class Transaksi extends Controller
|
||||||
return view('pages.Kasir.transaksi', compact('orderCode', 'KelompokKategori', 'produk', 'totalPembelianByProduk'));
|
return view('pages.Kasir.transaksi', compact('orderCode', 'KelompokKategori', 'produk', 'totalPembelianByProduk'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getCetakTigaKali()
|
||||||
|
{
|
||||||
|
$data = Pesanan::with(['detailPesanan', 'user'])->where('status_printer', null)->get();
|
||||||
|
$nomor = 1;
|
||||||
|
|
||||||
|
return $datatables = datatables()
|
||||||
|
->of($data)
|
||||||
|
->addColumn('nomor', function ($data) use (&$nomor) {
|
||||||
|
return $nomor++;
|
||||||
|
})
|
||||||
|
->addColumn('nama_user', function ($data) {
|
||||||
|
return $data->user->name;
|
||||||
|
})
|
||||||
|
->addColumn('created_at', function ($data) {
|
||||||
|
return \Carbon\Carbon::parse($data->created_at)->format('d F Y H:i:s');
|
||||||
|
})
|
||||||
|
->addColumn('grand_total', function ($data) {
|
||||||
|
return 'Rp ' . number_format($data->grand_total, 0, ',', '.');
|
||||||
|
})
|
||||||
|
->addColumn('ubah', function ($data) {
|
||||||
|
return '<div class="btn-group">
|
||||||
|
<a href="javascript:void(0)" onclick="printTigaKali(\'' . $data->id . '\')"><span class="btn btn-xs btn-success"><i class="fas fa-print"></i></span></a></div>';
|
||||||
|
})
|
||||||
|
->rawColumns(['nomor', 'nama_user', 'created_at', 'grand_total', 'ubah'])
|
||||||
|
->make(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function printTigaKali($id)
|
||||||
|
{
|
||||||
|
$pesanan = \App\Models\Pesanan::with('detailPesanan', 'user')->find($id);
|
||||||
|
$data = Pesanan::where('id', $id);
|
||||||
|
$data->update([
|
||||||
|
'status_printer' => 1
|
||||||
|
]);
|
||||||
|
|
||||||
|
return view('pages.Kasir.print_dapur_3x', compact('pesanan'));
|
||||||
|
}
|
||||||
|
|
||||||
public function store(Request $request)
|
public function store(Request $request)
|
||||||
{
|
{
|
||||||
$request->validate([
|
$request->validate([
|
||||||
|
|
|
@ -0,0 +1,28 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*/
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
Schema::table('pesanans', function (Blueprint $table) {
|
||||||
|
$table->integer('status_printer')->nullable()->after('status_pesanan')->comment('Jika 1 = print; Jika null = belum print');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::table('pesanans', function (Blueprint $table) {
|
||||||
|
$table->dropColumn('status_printer');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
|
@ -0,0 +1,30 @@
|
||||||
|
<div class="modal fade" id="modal_print_dapur" aria-labelledby="exampleModalLabel" >
|
||||||
|
<div class="modal-dialog modal-lg">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<h5 class="modal-title" id="exampleModalLabel">Print Dapur</h5>
|
||||||
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||||
|
<span aria-hidden="true">×</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<div class="table-responsive mt-3">
|
||||||
|
<table id="tabelku" class="table table-hover display" style="width: 100%; font-size: 14px;">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th class="text-center">No</th>
|
||||||
|
<th class="text-center">Kode Pesanan</th>
|
||||||
|
<th>Kasir</th>
|
||||||
|
<th class="text-center">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>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
|
@ -0,0 +1,132 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252" />
|
||||||
|
<title>Document</title>
|
||||||
|
{{-- <link rel="preconnect" href="https://fonts.googleapis.com">
|
||||||
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> --}}
|
||||||
|
{{-- <link href="https://fonts.googleapis.com/css2?family=Oswald&family=Roboto:wght@300;400&display=swap"
|
||||||
|
rel="stylesheet"> --}}
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
@font-face {
|
||||||
|
font-family: Bitum;
|
||||||
|
src: url('/assets/font/Bitum.ttf');
|
||||||
|
}
|
||||||
|
|
||||||
|
@page {
|
||||||
|
margin: 0cm;
|
||||||
|
}
|
||||||
|
|
||||||
|
html {
|
||||||
|
color: black;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
font-family: Bitum;
|
||||||
|
font-size: 8pt;
|
||||||
|
/* transform: scaleY(1.5); */
|
||||||
|
}
|
||||||
|
|
||||||
|
.title {
|
||||||
|
font-size: 11pt;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* .literely-table td,
|
||||||
|
th,
|
||||||
|
tr {
|
||||||
|
border-collapse: collapse;
|
||||||
|
border: 0.1px solid rgb(85, 85, 85);
|
||||||
|
} */
|
||||||
|
|
||||||
|
.rotate90 {
|
||||||
|
-webkit-transform: rotate(90deg);
|
||||||
|
-moz-transform: rotate(90deg);
|
||||||
|
-o-transform: rotate(90deg);
|
||||||
|
-ms-transform: rotate(90deg);
|
||||||
|
transform: rotate(90deg);
|
||||||
|
}
|
||||||
|
|
||||||
|
h1,
|
||||||
|
h2,
|
||||||
|
h3,
|
||||||
|
h4,
|
||||||
|
h5,
|
||||||
|
h6,
|
||||||
|
p {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
hr.style1 {
|
||||||
|
border-top: 3px double #8c8b8b;
|
||||||
|
}
|
||||||
|
|
||||||
|
hr.style2 {
|
||||||
|
border-top: 1px solid #8c8b8b;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dashed-line {
|
||||||
|
border: 1.5px dashed black;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<body style="width: 58mm;">
|
||||||
|
@for ($i = 0; $i < 3; $i++)
|
||||||
|
<hr class="dashed-line" style="margin-top: 15px;">
|
||||||
|
<p style="text-align: center;font-size: 7pt">Print Dapur</p>
|
||||||
|
<hr class="dashed-line" style="margin-top: 10px;">
|
||||||
|
<span style="display: flex; justify-content: space-between;margin-top: 10px;">
|
||||||
|
<span>
|
||||||
|
<p>{{ tanggal_indonesia($pesanan->tanggal_pesanan) }}</p>
|
||||||
|
<p>{{ date('H:i', strtotime($pesanan->tanggal_pesanan)) }}</p>
|
||||||
|
<p>Meja: {{ $pesanan->nomor_meja }}</p>
|
||||||
|
</span>
|
||||||
|
<span style="text-align: right">
|
||||||
|
<p>{{ $pesanan->kode_pesanan }}</p>
|
||||||
|
<p>Kasir: {{ $pesanan->user->name }}</p>
|
||||||
|
<p>Order: {{ $pesanan->nama_pemesan }}</p>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
<p></p>
|
||||||
|
<hr class="style2">
|
||||||
|
<p style="text-align: left; margin-top:3px;">Menu Order</p>
|
||||||
|
<table class="table" style="width: 100%;">
|
||||||
|
<tbody>
|
||||||
|
@foreach ($pesanan->detailPesanan as $item)
|
||||||
|
<tr>
|
||||||
|
<td style="width: 80px;" colspan="3">
|
||||||
|
({{ $item->jumlah_produk }} X)
|
||||||
|
{{ $item->nama_produk }}
|
||||||
|
@if ($item->keterangan_produk != '')
|
||||||
|
<br>
|
||||||
|
<small>
|
||||||
|
ket: {{ $item->keterangan_produk }}
|
||||||
|
</small>
|
||||||
|
@endif
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
@endforeach
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<p style="text-align: left; margin-top:5px;">Keterangan Pesanan Keseluruhan</p>
|
||||||
|
<table class="table" style="width: 100%;">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td style="width: 80px;" colspan="3">
|
||||||
|
{{ $pesanan->keterangan_pesanan != '' ? $pesanan->keterangan_pesanan : '-' }}</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<hr class="style2">
|
||||||
|
@endfor
|
||||||
|
</body>
|
||||||
|
<script>
|
||||||
|
window.print();
|
||||||
|
</script>
|
||||||
|
|
||||||
|
</html>
|
|
@ -417,6 +417,14 @@
|
||||||
<tr style="background-color: white">
|
<tr style="background-color: white">
|
||||||
<th colspan="4">
|
<th colspan="4">
|
||||||
<button class="btn btn-warning btn-block" id="pesan-bayar">Bayar</button>
|
<button class="btn btn-warning btn-block" id="pesan-bayar">Bayar</button>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-6 mt-2">
|
||||||
|
<button class="btn btn-info btn-block" id="print-dapur">Print Dapur</button>
|
||||||
|
</div>
|
||||||
|
<div class="col-6 mt-2">
|
||||||
|
<button class="btn btn-danger btn-block" id="refresh">Refresh Halaman</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</th>
|
</th>
|
||||||
</tr>
|
</tr>
|
||||||
</tfoot>
|
</tfoot>
|
||||||
|
@ -447,6 +455,7 @@
|
||||||
</div>
|
</div>
|
||||||
<!-- /.modal-dialog -->
|
<!-- /.modal-dialog -->
|
||||||
</div>
|
</div>
|
||||||
|
@include('pages.Kasir.modal_print_dapur')
|
||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
@push('styles')
|
@push('styles')
|
||||||
|
@ -454,11 +463,60 @@
|
||||||
<style>
|
<style>
|
||||||
</style>
|
</style>
|
||||||
<link rel="stylesheet" href="{{ asset('assets/plugins/toastr/toastr.min.css') }}">
|
<link rel="stylesheet" href="{{ asset('assets/plugins/toastr/toastr.min.css') }}">
|
||||||
|
<link rel="stylesheet" href="{{asset('assets/datatables/datatables.min.css')}}">
|
||||||
@endpush
|
@endpush
|
||||||
|
|
||||||
@push('scripts')
|
@push('scripts')
|
||||||
<!-- Toastr -->
|
<!-- Toastr -->
|
||||||
<script src="{{ asset('assets/plugins/toastr/toastr.min.js') }}"></script>
|
<script src="{{ asset('assets/plugins/toastr/toastr.min.js') }}"></script>
|
||||||
|
<script>
|
||||||
|
$(document).ready( function () {
|
||||||
|
$('#print-dapur').on('click', function(){
|
||||||
|
$('#modal_print_dapur').modal('show')
|
||||||
|
})
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
<script>
|
||||||
|
$(document).ready( function () {
|
||||||
|
$('#refresh').on('click', function(){
|
||||||
|
location.reload()
|
||||||
|
})
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
<script src="{{ asset('assets/datatables/datatables.min.js') }}"></script>
|
||||||
|
<script>
|
||||||
|
$(document).ready( function () {
|
||||||
|
$('#tabelku').DataTable({
|
||||||
|
processing: true,
|
||||||
|
serverSide: true,
|
||||||
|
ajax: '{{ route('transaksi.getCetakTigaKali') }}',
|
||||||
|
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', className: 'text-center'},
|
||||||
|
{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'},
|
||||||
|
]
|
||||||
|
})
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
<script>
|
||||||
|
function printTigaKali(id) {
|
||||||
|
var url = "{{ route('transaksi.printTigaKali', '') }}/" + id + '?print=true'
|
||||||
|
window.open(url, '_blank');
|
||||||
|
location.reload(true);
|
||||||
|
}
|
||||||
|
</script>
|
||||||
<script>
|
<script>
|
||||||
// set interval waktu pesanan
|
// set interval waktu pesanan
|
||||||
function showTime() {
|
function showTime() {
|
||||||
|
|
|
@ -24,6 +24,8 @@ Route::group(['prefix' => 'transaksi'], function () {
|
||||||
Route::get('/print/{id}', [Transaksi::class, 'print'])->name('transaksi.print');
|
Route::get('/print/{id}', [Transaksi::class, 'print'])->name('transaksi.print');
|
||||||
Route::get('/detail/{id}', [Transaksi::class, 'detail'])->name('transaksi.detail');
|
Route::get('/detail/{id}', [Transaksi::class, 'detail'])->name('transaksi.detail');
|
||||||
Route::post('/cari-paket', [Transaksi::class, 'selectPaket'])->name('transaksi.cari-paket');
|
Route::post('/cari-paket', [Transaksi::class, 'selectPaket'])->name('transaksi.cari-paket');
|
||||||
|
Route::get('/getCetakTigaKali', [Transaksi::class, 'getCetakTigaKali'])->name('transaksi.getCetakTigaKali');
|
||||||
|
Route::get('/printTigaKali/{id}', [Transaksi::class, 'printTigaKali'])->name('transaksi.printTigaKali');
|
||||||
});
|
});
|
||||||
|
|
||||||
Route::group(['prefix' => 'history'], function () {
|
Route::group(['prefix' => 'history'], function () {
|
||||||
|
|
Loading…
Reference in New Issue