Compare commits

..

No commits in common. "6a8953530e0f88ae252b18a7beaa25e931d91f1e" and "419a1559d704065dc431df1c3c740d11be87d5bc" have entirely different histories.

8 changed files with 55 additions and 211 deletions

View File

@ -102,7 +102,6 @@ class Transaksi extends Controller
public function store(Request $request)
{
$request->validate([
'orderCode' => 'required',
'namaPemesan' => 'required',
@ -124,10 +123,6 @@ class Transaksi extends Controller
$orderMenusQty += $value['qty'];
$orderMenusRupiah += $value['total'];
}
// $ get last count pesanan by date now and add 1 for next count pesanan today
$lastCountPesanan = Pesanan::whereDate('created_at', date('Y-m-d'))->count() + 1;
// calculate nomor antrian
$nomorAntrian = $lastCountPesanan;
$pesananDatas = [
'kode_pesanan' => $request->orderCode,
'nama_pemesan' => $request->namaPemesan,
@ -136,7 +131,6 @@ class Transaksi extends Controller
'status_pesanan' => '1',
'tanggal_pesanan' => date('Y-m-d H:i:s'),
'keterangan_pesanan' => $request->keteranganPesanan ?? null,
'nomor_antrian' => $nomorAntrian,
'total_pesanan' => $orderMenusQty,
'total_bayar' => $orderMenusRupiah,
'grand_total' => $request->totalDiskon,

View File

@ -21,7 +21,6 @@ class Pesanan extends Model
'tanggal_pesanan',
'nomor_meja',
'keterangan_pesanan',
'nomor_antrian',
'total_pesanan',
'total_bayar',
'grand_total',

View File

@ -1,28 +0,0 @@
<?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->string('nomor_antrian')->nullable()->after('keterangan_pesanan');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('pesanans', function (Blueprint $table) {
$table->dropColumn('nomor_antrian');
});
}
};

View File

@ -480,6 +480,7 @@
2,291
9,439
9,440
2,440
2,441
2,442
2,443

1 kelompok_kategori_id produk_id
480 2 291
481 9 439
482 9 440
483 2 440
484 2 441
485 2 442
486 2 443

View File

@ -83,47 +83,31 @@
<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>
<hr class="style2">
<span style="display: flex; justify-content: space-between">
<table width="100%">
<tr>
<td width=50%>
<h3>Meja: {{ $pesanan->nomor_meja }}</h3>
</td>
<td width=50% align="right">
<h3>Antrian: {{ $pesanan->nomor_antrian }}</h3>
</td>
</tr>
<tr>
<td colspan="2">
<h3>Pemesan: {{ $pesanan->nama_pemesan }}</h3>
</td>
</tr>
</table>
</span>
<p></p>
<hr class="style2">
<table class="literely-table" style="width: 100%;">
<tbody>
@foreach ($pesanan->detailPesanan as $item)
<tr>
<td style="width: 100px;" colspan="5">{{ $item->nama_produk }}</td>
</tr>
<tr>
<td></td>
<td style="text-align: right">{{ $item->jumlah_produk }}</td>
<td style="text-align: right">{{ convert_to_rupiah($item->harga_produk) }}</td>
<td style="text-align: right;width: 30px">
{{ $item->diskon_persen != '' || $item->diskon_persen != 0 || $item->diskon_persen != null ? $item->diskon_persen . '%' : '' }}
</td>
<td style="text-align: right;width: 70px">{{ convert_to_rupiah($item->total_harga_produk) }}</td>
</tr>
<tr>
<td style="width: 100px;" colspan="5">{{ $item->nama_produk }}</td>
</tr>
<tr>
<td></td>
<td style="text-align: right">{{ $item->jumlah_produk }}</td>
<td style="text-align: right">{{ convert_to_rupiah($item->harga_produk) }}</td>
<td style="text-align: right;width: 30px">
{{ $item->diskon_persen != '' || $item->diskon_persen != 0 || $item->diskon_persen != null ? $item->diskon_persen . '%' : '' }}
</td>
<td style="text-align: right;width: 70px">{{ convert_to_rupiah($item->total_harga_produk) }}</td>
</tr>
@endforeach
</tbody>
</table>
@ -161,70 +145,6 @@
<p style="text-align: center">Terima Kasih, Selamat Datang Kembali</p>
<p style="text-align: center;font-size: 7pt;">@sepiringtelurkeriting</p>
<hr class="dashed-line" style="margin-top: 15px;">
<p style="text-align: center;font-size: 7pt">untuk dapur</p>
<hr class="dashed-line" style="margin-top: 10px;">
<span style="display: flex; justify-content: space-between">
<span>
<p>{{ tanggal_indonesia($pesanan->tanggal_pesanan) }}</p>
<p>{{ date('H:i', strtotime($pesanan->tanggal_pesanan)) }}</p>
</span>
<span style="text-align: right">
<p>{{ $pesanan->kode_pesanan }}</p>
<p>Kasir: {{ $pesanan->user->name }}</p>
</span>
</span>
<hr class="style2">
<span style="display: flex; justify-content: space-between">
<table width="100%">
<tr>
<td width=50%>
<h3>Meja: {{ $pesanan->nomor_meja }}</h3>
</td>
<td width=50% align="right">
<h3>Antrian: {{ $pesanan->nomor_antrian }}</h3>
</td>
</tr>
<tr>
<td colspan="2">
<h3>Pemesan: {{ $pesanan->nama_pemesan }}</h3>
</td>
</tr>
</table>
</span>
<p></p>
<hr class="style2">
<h5 style="text-align: left; margin-top:3px;">Menu Order</h5>
<table class="table" style="width: 100%;">
<tbody>
@foreach ($pesanan->detailPesanan as $item)
<tr>
<td style="width: 80px;" colspan="3">
<h4>
({{ $item->jumlah_produk }} X)
{{ $item->nama_produk }}
</h4>
@if ($item->keterangan_produk != '')
<br>
<p>
&nbsp;&nbsp;&nbsp;&nbsp; ket: {{ $item->keterangan_produk }}
</p>
@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">
<h4>{{ $pesanan->keterangan_pesanan != '' ? $pesanan->keterangan_pesanan : '-' }}</h4>
</td>
</tr>
</tbody>
</table>
<hr class="style2">
<!-- Button Print -->
<br>
@ -321,4 +241,4 @@
})
</script>
</html>
</html>

View File

@ -147,51 +147,33 @@
<hr class="dashed-line" style="margin-top: 15px;">
<p style="text-align: center;font-size: 7pt">untuk dapur</p>
<hr class="dashed-line" style="margin-top: 10px;">
<span style="display: flex; justify-content: space-between">
<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>
<hr class="style2">
<span style="display: flex; justify-content: space-between">
<table width="100%">
<tr>
<td width=50%>
<h3>Meja: {{ $pesanan->nomor_meja }}</h3>
</td>
<td width=50% align="right">
<h3>Antrian: {{ $pesanan->nomor_antrian }}</h3>
</td>
</tr>
<tr>
<td colspan="2">
<h3>Pemesan: {{ $pesanan->nama_pemesan }}</h3>
</td>
</tr>
</table>
</span>
<p></p>
<hr class="style2">
<h5 style="text-align: left; margin-top:3px;">Menu Order</h5>
<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">
<h4>
({{ $item->jumlah_produk }} X)
{{ $item->nama_produk }}
</h4>
({{ $item->jumlah_produk }} X)
{{ $item->nama_produk }}
@if ($item->keterangan_produk != '')
<br>
<p>
<small>
&nbsp;&nbsp;&nbsp;&nbsp; ket: {{ $item->keterangan_produk }}
</p>
</small>
@endif
</td>
</tr>
@ -203,8 +185,7 @@
<tbody>
<tr>
<td style="width: 80px;" colspan="3">
<h4>{{ $pesanan->keterangan_pesanan != '' ? $pesanan->keterangan_pesanan : '-' }}</h4>
</td>
{{ $pesanan->keterangan_pesanan != '' ? $pesanan->keterangan_pesanan : '-' }}</td>
</tr>
</tbody>
</table>

View File

@ -76,58 +76,39 @@
</style>
<body style="width: 58mm;">
@for ($i = 0; $i < 3; $i++)
<hr class="dashed-line" style="margin-top: 15px;">
@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">
<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>
<hr class="style2">
<span style="display: flex; justify-content: space-between">
<table width="100%">
<tr>
<td width=50%>
<h3>Meja: {{ $pesanan->nomor_meja }}</h3>
</td>
<td width=50% align="right">
<h3>Antrian: {{ $pesanan->nomor_antrian }}</h3>
</td>
</tr>
<tr>
<td colspan="2">
<h3>Pemesan: {{ $pesanan->nama_pemesan }}</h3>
</td>
</tr>
</table>
</span>
<p></p>
<hr class="style2">
<h5 style="text-align: left; margin-top:3px;">Menu Order</h5>
<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">
<h4>
({{ $item->jumlah_produk }} X)
{{ $item->nama_produk }}
</h4>
@if ($item->keterangan_produk != '')
<br>
<p>
&nbsp;&nbsp;&nbsp;&nbsp; ket: {{ $item->keterangan_produk }}
</p>
@endif
</td>
</tr>
<tr>
<td style="width: 80px;" colspan="3">
({{ $item->jumlah_produk }} X)
{{ $item->nama_produk }}
@if ($item->keterangan_produk != '')
<br>
<small>
&nbsp;&nbsp;&nbsp;&nbsp; ket: {{ $item->keterangan_produk }}
</small>
@endif
</td>
</tr>
@endforeach
</tbody>
</table>
@ -136,26 +117,25 @@
<tbody>
<tr>
<td style="width: 80px;" colspan="3">
<h4>{{ $pesanan->keterangan_pesanan != '' ? $pesanan->keterangan_pesanan : '-' }}
</h4>
{{ $pesanan->keterangan_pesanan != '' ? $pesanan->keterangan_pesanan : '-' }}
</td>
</tr>
</tbody>
</table>
<hr class="style2">
@endfor
@endfor
<!-- Button Print -->
<br>
<div class="">
<div class="col-6 mb">
<button class="btn btn-info btn-block hidden-print" id="print-dapur">Print</button>
<!-- Button Print -->
<br>
<div class="">
<div class="col-6 mb">
<button class="btn btn-info btn-block hidden-print" id="print-dapur">Print</button>
</div>
<div class="col-6 mt-2">
<button class="btn btn-danger btn-block hidden-print" id="refresh">Refresh
Halaman</button>
</div>
</div>
<div class="col-6 mt-2">
<button class="btn btn-danger btn-block hidden-print" id="refresh">Refresh
Halaman</button>
</div>
</div>
</body>
<style>
/* Untuk menyembunyikan tombol print */
@ -240,4 +220,4 @@
})
</script>
</html>
</html>

View File

@ -1023,7 +1023,6 @@
// pesan bayar
document.getElementById('pesan-bayar').addEventListener('click', function() {
document.getElementById('pesan-bayar').disabled = true;
var table = document.getElementById("order-menus");
var orderMenus = [];
@ -1111,7 +1110,6 @@
method: "POST",
data: data,
success: function(result) {
document.getElementById('pesan-bayar').disabled = false;
// console.log(result);
// show toastr success
toastr.success(result.message, 'Success', {
@ -1126,7 +1124,6 @@
}, 2000);
},
error: function(xhr, status, error) {
document.getElementById('pesan-bayar').disabled = false;
toastr.error(xhr.responseJSON.message, 'Error', {
timeOut: 3000
});