@@ -24,8 +24,3 @@
-
-
diff --git a/resources/js/components/KasirForm.vue b/resources/js/components/KasirForm.vue
index 7d1468c..582e4d2 100644
--- a/resources/js/components/KasirForm.vue
+++ b/resources/js/components/KasirForm.vue
@@ -1,95 +1,181 @@
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
-
-
- Total:
-
- Rp{{ total.toLocaleString() }},-
-
-
+
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+ Total:
+
+ Rp{{ total.toLocaleString() }},-
+
+
-
-
-
-
-
- No |
- Item |
- Jml |
- Harga |
- Total |
-
-
-
-
- {{ index + 1 }} |
- {{ item.kode }} |
- {{ item.jumlah }} |
- Rp{{ item.harga.toLocaleString() }} |
- Rp{{ (item.harga * item.jumlah).toLocaleString() }} |
-
-
-
-
+
+
{{ error }}
+
{{ info }}
+
+
+
+
+ No |
+ Nam Produk |
+ Posisi |
+ Harga |
+
+
+
+
+ Belum ada item dipesan |
+
+
+ {{ index + 1 }} |
+ {{ item.produk.nama }} |
+ {{ item.posisi ? item.posisi : 'Brankas' }} |
+ Rp{{ item.harga_deal.toLocaleString() }} |
+
+
+
+
+
-
-
+ // harga deal
+ item.value.harga_deal = hargaJual.value
+ pesanan.value.push(item.value)
+
+ // Reset input fields
+ kodeItem.value = ''
+ hargaJual.value = null
+ item.value = null
+ info.value = ''
+ clearTimeout(infoTimeout)
+}
+
+const konfirmasiPenjualan = () => {
+ if (pesanan.value.length === 0) {
+ error.value = 'Belum ada item yang dipesan.'
+ clearTimeout(errorTimeout)
+ errorTimeout = setTimeout(() => {
+ error.value = ''
+ }, 3000)
+ return
+ }
+
+ // Todo: Implementasi konfirmasi penjualan
+ alert('Penjualan dikonfirmasi! (Implementasi lebih lanjut diperlukan)')
+}
+
+const total = computed(() => {
+ let sum = 0;
+ pesanan.value.forEach(item => {
+ sum += item.harga_deal;
+ });
+ return sum;
+})
+
diff --git a/resources/js/components/KasirTransaksiList.vue b/resources/js/components/KasirTransaksiList.vue
index 012b413..5944287 100644
--- a/resources/js/components/KasirTransaksiList.vue
+++ b/resources/js/components/KasirTransaksiList.vue
@@ -1,42 +1,35 @@
- Transaksi
-
-
-
- Tanggal |
- Kode Transaksi |
- Pendapatan |
- Detail Item |
-
-
-
-
- {{ trx.tanggal }} |
- {{ trx.kode }} |
- Rp{{ (trx.pendapatan || 0).toLocaleString() }} |
-
-
- |
-
-
-
-
+
Transaksi
+
+
+
+ Tanggal |
+ Kode Transaksi |
+ Pendapatan |
+ Detail Item |
+
+
+
+
+ {{ trx.tanggal }} |
+ {{ trx.kode }} |
+ Rp{{ (trx.pendapatan || 0).toLocaleString() }} |
+
+
+ |
+
+
+
+
-
+defineEmits(['detail'])
+
diff --git a/resources/js/components/Modal.vue b/resources/js/components/Modal.vue
index de1fa83..9162425 100644
--- a/resources/js/components/Modal.vue
+++ b/resources/js/components/Modal.vue
@@ -73,7 +73,7 @@ onBeforeUnmount(() => {
})
-