Pembayaran dan Meja csv
This commit is contained in:
parent
65e3b1a690
commit
067e6b2e17
16
main.py
16
main.py
@ -18,6 +18,8 @@ PROMO_CSV = "promo.csv"
|
|||||||
TRANSAKSI_CSV = "transaksi.csv"
|
TRANSAKSI_CSV = "transaksi.csv"
|
||||||
DETAIL_TRANSAKSI_CSV = "detail_transaksi.csv"
|
DETAIL_TRANSAKSI_CSV = "detail_transaksi.csv"
|
||||||
FAVORITE_CSV = "favorite.csv"
|
FAVORITE_CSV = "favorite.csv"
|
||||||
|
MEJA_CSV = "meja.csv"
|
||||||
|
PEMBAYARAN_CSV = "pembayaran.csv"
|
||||||
IMG_PREVIEW_SIZE = (120, 80)
|
IMG_PREVIEW_SIZE = (120, 80)
|
||||||
|
|
||||||
|
|
||||||
@ -63,6 +65,8 @@ def init_db_csv():
|
|||||||
ensure_file(TRANSAKSI_CSV, ["id", "user_id", "nomor_meja", "total", "status", "promo_code", "subtotal", "item_discount", "promo_discount", "tanggal"])
|
ensure_file(TRANSAKSI_CSV, ["id", "user_id", "nomor_meja", "total", "status", "promo_code", "subtotal", "item_discount", "promo_discount", "tanggal"])
|
||||||
ensure_file(DETAIL_TRANSAKSI_CSV, ["id", "transaksi_id", "menu_id", "qty", "harga_satuan", "subtotal_item"])
|
ensure_file(DETAIL_TRANSAKSI_CSV, ["id", "transaksi_id", "menu_id", "qty", "harga_satuan", "subtotal_item"])
|
||||||
ensure_file(FAVORITE_CSV, ["user_id", "menu_id", "order_count", "last_ordered"])
|
ensure_file(FAVORITE_CSV, ["user_id", "menu_id", "order_count", "last_ordered"])
|
||||||
|
ensure_file(MEJA_CSV, ["nomor_meja", "status", "transaksi_id"])
|
||||||
|
ensure_file(PEMBAYARAN_CSV, ["id", "transaksi_id", "metode_pembayaran", "jumlah_bayar", "status_pembayaran", "tanggal_bayar", "struk"])
|
||||||
|
|
||||||
seed_defaults()
|
seed_defaults()
|
||||||
|
|
||||||
@ -126,6 +130,18 @@ def seed_defaults():
|
|||||||
})
|
})
|
||||||
write_all(PROMO_CSV, ["code","type","value","min_total"], rows)
|
write_all(PROMO_CSV, ["code","type","value","min_total"], rows)
|
||||||
|
|
||||||
|
# Seed meja (10 meja default)
|
||||||
|
meja_rows = read_all(MEJA_CSV)
|
||||||
|
if not meja_rows:
|
||||||
|
rows = []
|
||||||
|
for i in range(1, 11): # Meja 1-10
|
||||||
|
rows.append({
|
||||||
|
"nomor_meja": str(i),
|
||||||
|
"status": "kosong",
|
||||||
|
"transaksi_id": ""
|
||||||
|
})
|
||||||
|
write_all(MEJA_CSV, ["nomor_meja", "status", "transaksi_id"], rows)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
11
meja.csv
Normal file
11
meja.csv
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
nomor_meja,status,transaksi_id
|
||||||
|
1,kosong,
|
||||||
|
2,kosong,
|
||||||
|
3,kosong,
|
||||||
|
4,kosong,
|
||||||
|
5,kosong,
|
||||||
|
6,kosong,
|
||||||
|
7,kosong,
|
||||||
|
8,kosong,
|
||||||
|
9,kosong,
|
||||||
|
10,kosong,
|
||||||
|
1
pembayaran.csv
Normal file
1
pembayaran.csv
Normal file
@ -0,0 +1 @@
|
|||||||
|
id,transaksi_id,metode_pembayaran,jumlah_bayar,status_pembayaran,tanggal_bayar,struk
|
||||||
|
Loading…
x
Reference in New Issue
Block a user