development #1

Merged
Joko merged 2 commits from development into production 2025-08-19 04:40:02 +00:00
42 changed files with 65 additions and 55 deletions
Showing only changes of commit 00792c68a0 - Show all commits

View File

@ -418,6 +418,7 @@ class CustomerController extends Controller
'od.harga_satuan',
'od.status_order as status_order_detail',
'od.catatan',
'od.total_kalori',
DB::raw('COALESCE(mm.nama_menu, mcu.nama_mcu) as nama_item'),
'mm.foto as foto'
)
@ -462,7 +463,8 @@ class CustomerController extends Controller
'jumlah' => $item->jumlah,
'harga_satuan' => $item->harga_satuan,
'status_order' => $item->status_order_detail,
'catatan' => $item->catatan ?? '-'
'catatan' => $item->catatan ?? '-',
'total_kalori' => $item->total_kalori
// tambahkan field tambahan jika diperlukan
];
})->values(),
@ -507,7 +509,7 @@ class CustomerController extends Controller
'cara_pembayaran' =>'MCU',
];
$order = Order::create($payload);
$payloadDetail = [
'order_id' => $order->order_id,
'jumlah' => 1,

Binary file not shown.

After

Width:  |  Height:  |  Size: 140 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 122 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 171 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 156 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 138 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 192 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 135 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 140 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 99 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 115 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 171 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 195 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 138 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 156 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 154 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 175 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 171 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 141 KiB

View File

@ -102,7 +102,7 @@ document.addEventListener('DOMContentLoaded', () => {
btnLoad.disabled = false;
btnLoad.innerHTML = 'Selanjutnya';
}
});
});
@ -324,7 +324,7 @@ function renderCartSummary() {
const disableSore = isToday && jam >= 13;
const countDate = pesananList.length;
pesananHTML += `
<div class="rounded border p-3 mb-3 shadow-sm" data-item-id="${item.id}" data-index="${i}">
<div class="row g-3 align-items-center">
@ -348,7 +348,7 @@ function renderCartSummary() {
<option disabled selected>Pilih Karbohidrat</option>
${(karhohidrats || []).map(k => `
<option value="${k.karbohidrat_id}" ${p.karbohidrat_id === k.karbohidrat_id ? 'selected' : ''} data-kalori=${k.nilai_kalori}>
${k.nama_karbohidrat} ${k.nilai_kalori ? `(${k.nilai_kalori} kkal)` : ''}
${k.nama_karbohidrat} ${k.nilai_kalori ? `(${k.nilai_kalori} kal)` : ''}
</option>
`).join('')}
</select>
@ -404,7 +404,7 @@ function renderCartSummary() {
</button>
</div>
</div>
<!-- Tombol Hapus -->
<div class="col-6 col-md-1 text-end">
${countDate > 1
@ -425,14 +425,14 @@ function renderCartSummary() {
const itemHTML = `
<div class="card mb-3 shadow-sm position-relative">
<button type="button" class="btn btn-sm btn-outline-danger position-absolute top-0 end-0 m-2" onClick="removeCartItem(${item.id})" style="z-index:1;">
<button type="button" class="btn btn-sm btn-danger position-absolute top-0 end-0 m-2" onClick="removeCartItem(${item.id})" style="z-index:1;">
Hapus
</button>
<div class="d-flex flex-column flex-md-row">
<div class="p-2 d-flex justify-content-center align-items-center" style="flex: 0 0 300px;">
<img src="gambar/${item.foto || 'default.jpg'}" alt="${item.nama_menu}"
class="img-fluid rounded" style="max-height: 180px; width: 100%; object-fit: cover;">
class="img-fluid rounded" style="max-height: 280px; width: 100%; object-fit: cover;">
</div>
<div class="flex-grow-1 position-relative">
@ -449,10 +449,10 @@ function renderCartSummary() {
<div class="mb-2 small text-muted"><i class="fa fa-utensils me-1"></i>
Menu: <strong>${item.apakah_someday ? 'Sameday' : 'Menu Normal'}</strong>
</div>
<div class="mb-2 small text-muted"><strong>Silahkan isi tanggal pemesanan, pilih karbohidrat dan catatan pemesanan (opsional) yang diinginkan</strong></div>
${pesananHTML}
ilahkan isi tanggal pemesanan, pilih karbohidrat dan catatan pemesanan (opsional) yang diinginkan
<div class="mt-3 d-flex justify-content-between align-items-center flex-wrap gap-2">
<button class="btn btn-sm btn-outline-success"
onclick="addOrderDate(${item.id}, ${item.apakah_menu_sore})">
@ -505,18 +505,19 @@ function onTanggalChange(itemId, index) {
function onKarbohidratChange(itemId, index, el, kalori){
const selectedOption = el.options[el.selectedIndex];
const kaloriOption = parseInt(selectedOption.getAttribute('data-kalori')) || 0;
const kaloriMenuInt = parseInt(kalori) || 0;
const kaloriMenuInt = kalori || 0;
const totalKalori = kaloriOption + kaloriMenuInt;
const kaloriEl = document.getElementById(`kalori_${itemId}_${index}`);
if (kaloriEl) {
kaloriEl.textContent = totalKalori ;
}
let cart = JSON.parse(sessionStorage.getItem('cart') || '[]');
const input = document.querySelector(`div[data-item-id='${itemId}'][data-index='${index}'] .karbohidrat-input`);
cart.find(item => item.id === itemId).pesanan[index].karbohidrat_id = parseInt(input.value);
cart.find(item => item.id === itemId).pesanan[index].resultKalori = parseInt(totalKalori);
cart.find(item => item.id === itemId).pesanan[index].resultKalori = totalKalori;
sessionStorage.setItem('cart', JSON.stringify(cart));
}

View File

@ -222,8 +222,9 @@ document.getElementById('formMasterMenu').addEventListener('submit', function(e)
const allFormSetsBeforSubmit = document.querySelectorAll('.form-set');
for (let i = 0; i < allFormSetsBeforSubmit.length; i++) {
const checkSiang = allFormSetsBeforSubmit[i].querySelector(`input[name="data[${i}][apakah_menu_siang]"]`);
const checkSore = allFormSetsBeforSubmit[i].querySelector(`input[name="data[${i}][apakah_menu_sore]"]`);
const checkSiang = allFormSetsBeforSubmit[i].querySelector(`input[name*="[apakah_menu_siang]"]`);
const checkSore = allFormSetsBeforSubmit[i].querySelector(`input[name*="[apakah_menu_sore]"]`);
if (!checkSiang?.checked && !checkSore?.checked) {
e.preventDefault();

View File

@ -91,7 +91,9 @@
},
{
title:"Nama Menu",
field:"nama_menu",
formatter:function(value, row){
return row?.kalori[0]?.nilai_kalori ? row?.nama_menu + ' ' + '(' + row?.kalori[0]?.nilai_kalori + ' kal)' : row?.nama_menu
},
width: 300
},
{

View File

@ -94,18 +94,6 @@ let orderIndex = 0;
$('#cartTotal').text('Rp ' + total.toLocaleString('id-ID'));
}
function renderCartTotalOnly() {
const cart = JSON.parse(sessionStorage.getItem('cart') || '[]');
let total = 0;

View File

@ -8,7 +8,7 @@ function detailOrder(id){
document.getElementById('confirm_nama_pesanan').textContent = data?.order?.nama_pemesan;
let html = '';
console.log(data);
html += `
<div class="col-md-12 mb-3">
<div class="card shadow-sm border-0">
@ -19,6 +19,9 @@ function detailOrder(id){
<div class="${data?.order?.jenis_customer === "MCU" ? 'col-md-12' : 'col-md-7 p-1'}">
<p class="mb-1">Nama Menu: <strong>${data?.menu?.nama_menu || data?.master_mcu?.nama_mcu}</strong></p>
<p class="mb-1">Tanggal Antar: <span>${data?.tgl_antar || 0}</span></p>
${data?.total_kalori ? `
<p class="mb-1">Total Kalori: <span>${data?.total_kalori} kal</span></p>
` : ''}
<p class="mb-1">Jumlah: <span>${data?.jumlah || 0}</span></p>
<p class="mb-1">Harga Satuan: <strong>Rp ${parseInt(data?.harga_satuan || 0).toLocaleString('id-ID')}</strong></p>
<p class="mb-1">Status Pesanan:
@ -66,7 +69,7 @@ function detailOrder(id){
function approve(e){
const data = $(e).data();
new bootstrap.Modal(modalActionOrder).show();
$("#confirmActionApproveOrder").text(
data?.menu + (!data?.type ? '' : ` (${data.type})`)

View File

@ -169,7 +169,7 @@
{
title: "Tgl Pemesanan",
formatter: function(value, row) {
if (!row?.entry_at) return '-';
const date = new Date(row.entry_at);
return date.toLocaleString('id-ID', {

View File

@ -179,8 +179,8 @@ function getTableColumns() {
{
title:"Total Kalori",
formatter: function(value, row){
return row?.total_kalori ? row?.total_kalori + ' kal' : '-'
}
},
@ -193,8 +193,8 @@ function getTableColumns() {
</ul>`
},
{ title: "Tgl Antar", field: 'tgl_antar' },
{ title: "Waktu Pengantaran",
formatter: function(value, row){
{ title: "Waktu Pengantaran",
formatter: function(value, row){
if(row?.order?.jenis_customer === 'MCU')return row.jam_layanan.slice(0, 5);
return row?.type
},
@ -226,7 +226,7 @@ function detailOrder(id){
<p class="mb-1">Nama Menu: <strong>${data?.menu?.nama_menu || data?.master_mcu?.nama_mcu}</strong></p>
<p class="mb-1">Tanggal Antar: <span>${data?.tgl_antar || 0}</span></p>
<p class="mb-1">Jumlah: <span>${data?.jumlah || 0}</span></p>
${data?.total_kalori ? `<p class="mb-1">Jumlah: <span>${data?.total_kalori || 0} kal</span></p>` : ''}
${data?.total_kalori ? `<p class="mb-1">Total Kalori: <span>${data?.total_kalori || 0} kal</span></p>` : ''}
<p class="mb-1">Harga Satuan: <strong>Rp ${parseInt(data?.harga_satuan || 0).toLocaleString('id-ID')}</strong></p>
<p class="mb-1">Status Pesanan:
<span class="badge text-dark ${data?.status_order === 'Selesai' ? 'bg-success' : 'bg-warning'}">

View File

@ -33,7 +33,7 @@
margin-top: -32px;
margin-left:21px;
}
.order {
position: absolute;
font-size: 9.5px;
@ -51,7 +51,7 @@
}
.info td {
padding: 0 1px;
padding: 2px 5px;
vertical-align: top;
font-size: 10px;
}
@ -92,19 +92,29 @@
@elseif($label?->order?->jenis_customer === "Karyawan RSAB Harapan Kita")
<tr><td>Bagian/No Ekstensien </td><td>: {{ $label?->order?->bagian_instalasi ?? '-'}} / {{ $label?->order?->no_ekstensien ?? '-'}} </td></tr>
@endif
<tr><td>Pesanan</td>
<tr><td>Pesanan</td>
<td>
<div style="max-width: 54mm; word-wrap: break-word; white-space: normal; display: block;">
: {{ $label?->masterMcu?->nama_mcu ?? $label?->menu?->nama_menu }}
</div>
<span style="vertical-align: top;">:</span>
<span style="max-width: 54mm; word-wrap: break-word; white-space: normal; display: inline-block; vertical-align: top;">
{{ $label?->masterMcu?->nama_mcu ?? $label?->menu?->nama_menu }}
</span>
</td></tr>
<tr><td>Total Kalori</td><td>: {{ isset($label->total_kalori) ? $label->total_kalori . ' (kal)' : '-' }}</td></tr>
<tr><td>Total Kalori</td><td>: {{ isset($label->total_kalori) ? $label->total_kalori . ' kal' : '-' }}</td></tr>
<tr><td>Harga Satuan</td><td>: Rp {{ number_format($label?->harga_satuan, 0, ',', '.') }}</td></tr>
<tr><td>Tanggal Produksi</td><td>: {{ $label?->tgl_antar ?? '-' }}</td></tr>
<tr><td>Tanggal Produksi</td><td>: {{ $label?->tgl_antar ? \Carbon\Carbon::parse($label->tgl_antar)->translatedFormat('d F Y') : '-' }} </td></tr>
<tr><td>No. Telp</td><td>: {{ $label?->order?->no_wa ?? '-' }}</td></tr>
@if($label?->order?->alamat)
<tr><td>Alamat</td><td>: {{ $label?->order?->alamat }}</td></tr>
@if ($label?->order?->alamat)
<tr>
<td style="vertical-align: top;">Alamat</td>
<td><span style="vertical-align: top;">:</span>
<span style="max-width: 54mm; word-wrap: break-word; white-space: normal; display: inline-block; vertical-align: top;">
{{ $label?->order?->alamat }}
</span>
</td>
</tr>
@endif
</table>
<div class="footer">
@ -116,9 +126,9 @@
</div>
<style>
</style>
</body>
</html>
</html>

View File

@ -41,7 +41,7 @@
<!-- fontawosome CSS -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.2/css/all.min.css" integrity="sha512-Evv84Mr4kqVGRNSgIGL/F/aIDqQb7xQ2vcrdIwxfjThSH8CSR7PBEakCr51Ck+w+/U6swU2Im1vVX0SVk9ABhg==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<link rel="stylesheet" href="{{ ver('/assets/vendor/libs/perfect-scrollbar/perfect-scrollbar.css') }}../" />
{{-- flatcpicker css --}}
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/flatpickr/dist/flatpickr.min.css">
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>

View File

@ -83,6 +83,9 @@
<div class="card-body py-2 px-3 mt-2">
<h6 class="card-title mb-1">${item.nama_item}</h6>
<p class="mb-1 small text-muted">Tgl Antar: <strong>${item.tgl_antar}</strong></p>
${item?.total_kalori ? `
<p class="mb-1 small text-muted">Total Kalori: <strong>${item?.total_kalori || '-'} kal</strong></p>
` : ''}
<p class="mb-1 small">Harga: <strong>${harga.toLocaleString('id-ID')}</strong></p>
<p class="mb-1 small">Jumlah: <strong>${jumlah}</strong></p>
<p class="mb-0 small">Total: <strong class="text-success">Rp ${total.toLocaleString('id-ID')}</strong></p>

View File

@ -23,15 +23,15 @@
<div class="col-12 mb-2">
<h6 class="fw-bold text-muted mb-1">
Pilih Tanggal Makanan
<a tabindex="0" class="ms-1 text-decoration-none" role="button" data-bs-toggle="popover" data-bs-trigger="focus"
<a tabindex="0" class="text-decoration-none" role="button" data-bs-toggle="popover" data-bs-trigger="focus"
title="Panduan"
data-bs-content="Pilih rentang tanggal untuk melihat daftar menu yang tersedia pada tanggal tersebut.">
<i class="fa fa-info-circle text-secondary"></i>
</a>
</h6>
<div class="input-group input-group-sm mb-2" style="max-width: 350px;">
<span class="input-group-text bg-white px-2">
<div class="input-group input-group-sm mb-2" style="max-width: 450px;">
<span class="input-group-text bg-white px-1">
<i class="fa fa-calendar-alt text-primary"></i>
</span>
@ -124,7 +124,7 @@
<div class="fw-bold mb-2">
<i class="fa fa-info-circle me-1"></i>Informasi
</div>
<ul class="mb-0 ps-3">
<ul class="mb-0 ps-3 pe-3">
<li>
Butuh bantuan? Hubungi WhatsApp <strong>Instalasi Gizi</strong>:
<a href="https://wa.me/08815611382 " target="_blank">08815611382 </a> <br>

View File

@ -6,7 +6,7 @@
<div class="container position-relative d-flex align-items-center justify-content-between">
<a href="/" class="logo d-flex align-items-center me-auto">
<!-- Uncomment the line below if you also wish to use an image logo -->
<img src="/logo/logo_rsabhk.png" width="170" alt="Logo RSAB HARAPAN KITA" class="logo-img">
<img src="/logo/logo_rsabhk.png" alt="Logo RSAB HARAPAN KITA" class="logo-img">
<h1 class="sitename"></h1>
</a>