Compare commits
23 Commits
0b1cba1465
...
42581b13ce
| Author | SHA1 | Date | |
|---|---|---|---|
| 42581b13ce | |||
| 5e26f48489 | |||
| e6e481ddf7 | |||
| 7937c1aa4c | |||
| 12c0f3ec92 | |||
| aa442f33f6 | |||
| f15dcffb7d | |||
| 1ac2c881fd | |||
| d157808dba | |||
| 0f2963dc16 | |||
| 4977874daa | |||
| 0cbd81b958 | |||
| d501f5167e | |||
| 82b7bd42ed | |||
| 36ac961e03 | |||
| b9d1d207f3 | |||
| d9a35e15f7 | |||
| edd76a2513 | |||
| 3c2ce3610f | |||
| d8b33496dc | |||
| e06e1490a8 | |||
| 49817cdd2b | |||
| d9ebc738c0 |
@ -285,7 +285,7 @@ class CustomerController extends Controller
|
||||
'entry_at' => Carbon::now()->format('Y-m-d H:i:s.u'),
|
||||
];
|
||||
if($jenisCustomer === "Karyawan RSAB Harapan Kita"){
|
||||
$nip_pns = Karyawan::where('namalengkap',$biodataResult['nama_pemesan'])->first()->nip_pns;
|
||||
$nip_pns = Karyawan::where('namalengkap',$biodataResult['nama_pemesan'])->first()?->nip_pns;
|
||||
$payloadOrder['nip'] = $nip_pns ?? null;
|
||||
$payloadOrder['bagian_instalasi'] = $biodataResult['bagian_instalasi'] ?? null;
|
||||
$payloadOrder['no_ekstensien'] = $biodataResult['no_ekstensien'] ?? null;
|
||||
@ -317,7 +317,12 @@ class CustomerController extends Controller
|
||||
}
|
||||
//code...
|
||||
if($order->email){
|
||||
Mail::to($order->email)->send(new NotifikasiCustomer($order->nama_pemesan, $order->no_order, $order->total_harga));
|
||||
try {
|
||||
Mail::to($order->email)->send(new NotifikasiCustomer($order->nama_pemesan, $order->no_order, $order->total_harga));
|
||||
} catch (\Throwable $th) {
|
||||
//throw $th;
|
||||
}
|
||||
|
||||
}
|
||||
DB::connection('dbOrderGizi')->commit();
|
||||
return response()->json([
|
||||
@ -375,7 +380,15 @@ class CustomerController extends Controller
|
||||
$order->update($payload);
|
||||
|
||||
if($order->email){
|
||||
Mail::to($order->email)->send(new NotifikasiPembayaran($order->nama_pemesan, $order->no_order));
|
||||
try {
|
||||
Mail::to($order->email)->send(
|
||||
new NotifikasiPembayaran($order->nama_pemesan, $order->no_order)
|
||||
);
|
||||
} catch (\Exception $e) {
|
||||
// log error biar bisa ditelusuri nanti
|
||||
// \Log::error('Gagal mengirim email ke ' . $order->email . ': ' . $e->getMessage());
|
||||
// continue tanpa break flow
|
||||
}
|
||||
}
|
||||
DB::connection('dbOrderGizi')->commit();
|
||||
session()->flash('payment_success', true);
|
||||
|
||||
@ -122,7 +122,12 @@ class PesananController extends Controller
|
||||
$order->update($payload);
|
||||
|
||||
if($order->email){
|
||||
Mail::to($order->email)->send(new NotifikasiKonfirmasiPembayaran($order->nama_pemesan, $order->no_order, $order->total_harga));
|
||||
try {
|
||||
//code...
|
||||
Mail::to($order->email)->send(new NotifikasiKonfirmasiPembayaran($order->nama_pemesan, $order->no_order, $order->total_harga));
|
||||
} catch (\Throwable $th) {
|
||||
//throw $th;
|
||||
}
|
||||
}
|
||||
|
||||
DB::connection('dbOrderGizi')->commit();
|
||||
|
||||
@ -241,18 +241,21 @@ function toggleCustomerFields() {
|
||||
$nama.val('')
|
||||
$nama.removeClass('form-control')
|
||||
$("#help_nama_pemesan").removeClass('d-none')
|
||||
$("#help_email_karyawan").removeClass('d-none')
|
||||
selectKaryawan(); // inisialisasi ulang selectize
|
||||
break;
|
||||
case 'Keluarga Pasien / Penunggu Pasien':
|
||||
$('.pasien').show();
|
||||
$nama.addClass('form-control')
|
||||
$("#help_nama_pemesan").addClass('d-none')
|
||||
$("#help_email_karyawan").addClass('d-none')
|
||||
break;
|
||||
|
||||
default: // Masyarakat Umum
|
||||
$('.umum').show();
|
||||
$nama.addClass('form-control')
|
||||
$("#help_nama_pemesan").addClass('d-none')
|
||||
$("#help_email_karyawan").addClass('d-none')
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -743,8 +746,6 @@ function validateCartBeforeSubmit() {
|
||||
cart.forEach((item, index) => {
|
||||
const pesananList = item.pesanan || [];
|
||||
pesananList.forEach((pesanan, i) => {
|
||||
console.log(!pesanan.karbohidrat_id, !item?.apakah_someday);
|
||||
|
||||
if (!pesanan.tgl) {
|
||||
isValid = false;
|
||||
errorMessage = `Tanggal belum diisi pada item "${item.nama_menu}" (baris ${i + 1})`;
|
||||
@ -784,20 +785,42 @@ function hitungTotalHarga(){
|
||||
function copyNoRek() {
|
||||
const text = document.getElementById('noRekText').innerText;
|
||||
navigator.clipboard.writeText(text).then(() => {
|
||||
alert("Nomor rekening berhasil disalin: " + text);
|
||||
Swal.fire({
|
||||
icon: 'success',
|
||||
title: 'Disalin!',
|
||||
text: 'Nomor rekening berhasil disalin: ' + text,
|
||||
showConfirmButton: false,
|
||||
timer: 1500
|
||||
});
|
||||
}).catch(err => {
|
||||
console.error('Gagal menyalin: ', err);
|
||||
alert("Gagal menyalin teks.");
|
||||
Swal.fire({
|
||||
icon: 'warning',
|
||||
text: 'Gagal menyalin teks: ' + text,
|
||||
showConfirmButton: false,
|
||||
timer: 2000
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function copyNoOrder() {
|
||||
const text = document.getElementById('no_order_display').innerText;
|
||||
navigator.clipboard.writeText(text).then(() => {
|
||||
alert("Nomor order berhasil disalin: " + text);
|
||||
Swal.fire({
|
||||
icon: 'success',
|
||||
title: 'Disalin!',
|
||||
text: 'Nomor order berhasil disalin: ' + text,
|
||||
showConfirmButton: false,
|
||||
timer: 1500
|
||||
});
|
||||
}).catch(err => {
|
||||
console.error('Gagal menyalin: ', err);
|
||||
alert("Gagal menyalin teks.");
|
||||
Swal.fire({
|
||||
icon: 'warning',
|
||||
text: 'Gagal menyalin teks: ' + text,
|
||||
showConfirmButton: false,
|
||||
timer: 2000
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@ -834,12 +857,13 @@ function initFlatpickrTersedia(item, i) {
|
||||
dayNumbers.forEach(day => {
|
||||
const dayStr = String(day).padStart(2, '0');
|
||||
const fullDateStr = `${year}-${month}-${dayStr}`;
|
||||
const fullDate = new Date(`${fullDateStr}T00:00:00`);
|
||||
|
||||
const fullDate = new Date(`${fullDateStr}T13:00:00`);
|
||||
|
||||
// Jika bukan menu someday, cek aturan H-1 dan jam batas
|
||||
if (item.apakah_someday) {
|
||||
availableDates.push(fullDateStr);
|
||||
} else {
|
||||
|
||||
const selisihHari = Math.floor((fullDate - now) / (1000 * 60 * 60 * 24));
|
||||
if (selisihHari >= 1 || (selisihHari === 1 && !lewatBatasNormal)) {
|
||||
availableDates.push(fullDateStr);
|
||||
@ -881,7 +905,6 @@ function increment(itemId, index) {
|
||||
function decrement(itemId, index) {
|
||||
const input = document.getElementById(`jumlah-${itemId}-${index}`);
|
||||
let current = parseInt(input.value || "0");
|
||||
console.log(current);
|
||||
|
||||
if (current > 1) {
|
||||
input.value = current - 1;
|
||||
@ -957,7 +980,6 @@ document.getElementById('submitNote').addEventListener('click', function(e){
|
||||
const noted = $("#note_order").val()
|
||||
const cart = JSON.parse(sessionStorage.getItem('cart') || '[]');
|
||||
const item =cart.find(item => item.id === id)
|
||||
console.log(id, index, item);
|
||||
|
||||
if(item && item.pesanan && item.pesanan[index]){
|
||||
item.pesanan[index].catatan = noted
|
||||
@ -985,7 +1007,13 @@ function selectKaryawan(){
|
||||
valueField: 'label', // sama dengan labelField
|
||||
labelField: 'label',
|
||||
searchField: ['label'],
|
||||
create: false,
|
||||
create: function(input) {
|
||||
return {
|
||||
label: input,
|
||||
value: input
|
||||
};
|
||||
},
|
||||
createOnBlur: true,
|
||||
placeholder: "Cari nama karyawan...",
|
||||
maxItems: 1,
|
||||
load: function (query, callback) {
|
||||
|
||||
@ -148,9 +148,12 @@
|
||||
@if($label->total_kalori)
|
||||
<tr><td>Total Kalori</td><td>: {{ $label->total_kalori }}</td></tr>
|
||||
@endif
|
||||
@if($label->order?->jenis_customer !== 'MCU')
|
||||
<tr><td>Harga Satuan</td><td>: Rp {{ number_format($label?->harga_satuan, 0, ',', '.') }}</td></tr>
|
||||
@endif
|
||||
<tr><td>Catatan</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?->catatan ?? '-' }}
|
||||
</span></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)
|
||||
|
||||
@ -75,7 +75,6 @@
|
||||
}
|
||||
|
||||
th:nth-child(6), td:nth-child(6) {
|
||||
width: 110px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
@ -126,6 +125,7 @@
|
||||
<th>Waktu Makan <br/> /Jam Layanan</th>
|
||||
<th>Menu</th>
|
||||
<th>Karbohidrat</th>
|
||||
<th>Catatan</th>
|
||||
<th>Total Kalori</th>
|
||||
<th>Keterangan</th>
|
||||
<th>Jumlah</th>
|
||||
@ -157,6 +157,7 @@
|
||||
-
|
||||
@endif
|
||||
</td>
|
||||
<td>{{ $row['catatan'] ? $row['catatan'] . ' kal' : '' }}</td>
|
||||
<td>{{ $row['total_kalori'] ? $row['total_kalori'] . ' kal' : '' }}</td>
|
||||
<td class="keterangan">
|
||||
@php
|
||||
|
||||
@ -50,6 +50,7 @@
|
||||
<div class="col-md-12">
|
||||
<label class="form-label">Email <span class="text-danger">*</span></label>
|
||||
<input type="email" class="form-control" name="email" id="email" required>
|
||||
<div id="help_email_karyawan" class="form-text d-none">Notifikasi dari sistem belum dapat dikirim ke email dengan domain @rsabhk.co.id, oleh karena itu karyawan disarankan memakai alamat email lain</div>
|
||||
</div>
|
||||
{{-- <div class="col-md-6">
|
||||
<label class="form-label">Tanggal Lahir</label>
|
||||
@ -81,8 +82,9 @@
|
||||
<option value="Ruang Cempaka">Ruang Cempaka</option>
|
||||
<option value="Ruang Widuri">Ruang Widuri</option>
|
||||
<option value="Ruang Teratai">Ruang Teratai</option>
|
||||
<option value="Klinik Anggrek">Klinik Melati</option>
|
||||
<option value="Ruang Anggrek">Ruang Anggrek</option>
|
||||
<option value="Ruang VK">Ruang VK</option>
|
||||
<option value="Klinik Melati">Klinik Melati</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
@ -98,7 +100,7 @@
|
||||
<option value="VIP A">VIP A</option>
|
||||
<option value="VIP B">VIP B</option>
|
||||
<option value="Kelas I">Kelas I</option>
|
||||
<option value="Mesa Tesa">Mesa Tesa</option>
|
||||
<option value="Klinik Melati">Klinik Melati</option>
|
||||
</select>
|
||||
</div>
|
||||
{{-- End Pasien --}}
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
<div class="card shadow-sm p-4">
|
||||
<div class="row justify-content-center text-center">
|
||||
<div class="col-12 col-sm-10 col-md-8 col-lg-6 mb-3">
|
||||
<img src="gambar/qris.jpg" alt="Pembayaran"
|
||||
<img src="/gambar/qris.jpg" alt="Pembayaran"
|
||||
class="img-fluid rounded shadow w-100"
|
||||
style="max-width: 500px; height: auto;">
|
||||
</div>
|
||||
@ -35,13 +35,13 @@
|
||||
<!-- Bank -->
|
||||
<div class="row mb-3">
|
||||
<div class="col-md-6 col-sm-12 fw-semibold">Bank</div>
|
||||
<div class="col-md-6 col-sm-12 text-sm-end">Bank BCA</div>
|
||||
<div class="col-md-6 col-sm-12 text-sm-end">Bank BRI</div>
|
||||
</div>
|
||||
|
||||
<!-- Nama Rekening -->
|
||||
<div class="row mb-3">
|
||||
<div class="col-md-6 col-sm-12 fw-semibold">Nama Rek.</div>
|
||||
<div class="col-md-6 col-sm-12 text-sm-end">RSAB Harapan Kita</div>
|
||||
<div class="col-md-6 col-sm-12 text-sm-end">RPL 182 RSAB HARKIT OPR BLU PENERIMAAN</div>
|
||||
</div>
|
||||
|
||||
<!-- No Rek -->
|
||||
@ -53,7 +53,7 @@
|
||||
<i class="fa fa-copy me-1"></i> Salin
|
||||
</button>
|
||||
</div>
|
||||
<strong id="noRekText" class="d-block text-sm-end">1234-5678-9101</strong>
|
||||
<strong id="noRekText" class="d-block text-sm-end">096201000073308</strong>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user