@rangka-os/create 0.5.0-alpha.33 → 0.5.0-alpha.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/template/base/apps/faktur_piutang/app.rk +4 -0
- package/template/base/apps/faktur_piutang/skills/rangka-app-faktur-piutang/SKILL.md +35 -0
- package/template/base/apps/fnb_cabang/app.rk +7 -0
- package/template/base/apps/fnb_cabang/skills/rangka-app-fnb-cabang/SKILL.md +43 -0
- package/template/base/apps/jasa_proyek/app.rk +11 -1
- package/template/base/apps/jasa_proyek/skills/rangka-app-jasa-proyek/SKILL.md +51 -0
- package/template/base/apps/karyawan_gaji/app.rk +2 -0
- package/template/base/apps/kasir/app.rk +2 -0
- package/template/base/apps/kasir/skills/rangka-app-kasir/SKILL.md +1 -1
- package/template/base/apps/pembelian_pemasok/app.rk +8 -0
- package/template/base/apps/pembelian_pemasok/skills/rangka-app-pembelian-pemasok/SKILL.md +43 -0
- package/template/base/apps/pesanan_whatsapp/app.rk +28 -0
- package/template/base/apps/ritel_cabang/app.rk +7 -0
- package/template/base/apps/ritel_cabang/dashboards/ritel_overview.rk +16 -0
- package/template/base/apps/ritel_cabang/dashboards/ritel_stock.rk +13 -0
- package/template/base/apps/ritel_cabang/skills/rangka-app-ritel-cabang/SKILL.md +43 -0
- package/template/base/apps/sewa_alat/skills/rangka-app-sewa-alat/SKILL.md +3 -3
- package/template/base/connectors/rangka_whatsapp/README.md +3 -2
- package/template/base/connectors/rangka_whatsapp/connector.rk +12 -4
- package/template/base/connectors/rangka_whatsapp/fixtures/expect.json +3 -2
- package/template/base/connectors/rangka_whatsapp/fixtures/message_received.json +1 -1
- package/template/base/connectors/rangka_whatsapp/fixtures/message_received_order.json +1 -0
- package/template/base/connectors/rangka_whatsapp/mock/rangka_whatsapp_mock.py +9 -4
- package/template/base/modules/accounting/flows/financial_report_compute.rk +1 -1
- package/template/base/modules/accounting/flows/financial_report_recompute.rk +1 -1
- package/template/base/modules/accounting/flows/gl_pos_sale_post.rk +38 -2
- package/template/base/modules/accounting/models/gl_entry.rk +3 -0
- package/template/base/modules/attendance/module.rk +4 -4
- package/template/base/modules/attendance/screens/absen_outlet.rk +3 -0
- package/template/base/modules/catalogue/defaults/uom.rk +19 -0
- package/template/base/modules/catalogue/models/item.rk +12 -0
- package/template/base/modules/kitchen/flows/kitchen_ticket_on_draft.rk +44 -0
- package/template/base/modules/kitchen/flows/kitchen_ticket_on_sale.rk +6 -5
- package/template/base/modules/loyalty/flows/loyalty_on_sale.rk +6 -5
- package/template/base/modules/loyalty/flows/loyalty_on_sale_cancel.rk +2 -2
- package/template/base/modules/outlet_sales/models/outlet_sales_line.rk +1 -0
- package/template/base/modules/outlets/models/outlet.rk +48 -0
- package/template/base/modules/outlets/module.rk +1 -1
- package/template/base/modules/payroll/flows/pph21_annual_on_slip_cancel.rk +28 -0
- package/template/base/modules/payroll/flows/pph21_annual_on_slip_submit.rk +84 -0
- package/template/base/modules/payroll/models/payslip.rk +4 -0
- package/template/base/modules/payroll/models/pph21_annual.rk +84 -0
- package/template/base/modules/payroll/models/pph21_period.rk +77 -0
- package/template/base/modules/payroll/module.rk +3 -2
- package/template/base/modules/payroll/print/bukti_potong_a1.html +53 -0
- package/template/base/modules/payroll/print/bukti_potong_a1.rk +9 -0
- package/template/base/modules/payroll/print/coretax_bp21.rk +44 -0
- package/template/base/modules/payroll/print/coretax_bp21.xml +36 -0
- package/template/base/modules/payroll/print/coretax_bpa1.rk +21 -0
- package/template/base/modules/payroll/print/coretax_bpa1.xml +46 -0
- package/template/base/modules/payroll/print/coretax_bpmp.rk +23 -0
- package/template/base/modules/payroll/print/coretax_bpmp.xml +31 -0
- package/template/base/modules/pos/flows/pos_sale_merge.rk +34 -0
- package/template/base/modules/pos/flows/pos_sale_on_cancel.rk +3 -0
- package/template/base/modules/pos/flows/pos_sale_on_submit.rk +28 -1
- package/template/base/modules/pos/flows/pos_sale_split.rk +37 -0
- package/template/base/modules/pos/flows/pos_shift_on_create.rk +9 -1
- package/template/base/modules/pos/flows/pos_table_guard_on_create.rk +24 -0
- package/template/base/modules/pos/flows/pos_table_guard_on_update.rk +23 -0
- package/template/base/modules/pos/models/dining_area.rk +23 -0
- package/template/base/modules/pos/models/dining_table.rk +38 -0
- package/template/base/modules/pos/models/pos_guard.rk +39 -0
- package/template/base/modules/pos/models/pos_payment.rk +2 -0
- package/template/base/modules/pos/models/pos_sale.rk +153 -7
- package/template/base/modules/pos/models/pos_sale_item.rk +4 -0
- package/template/base/modules/pos/models/pos_shift.rk +11 -1
- package/template/base/modules/pos/module.rk +9 -4
- package/template/base/modules/pos/print/pos_receipt.html +5 -2
- package/template/base/modules/pos/print/pos_receipt_part.html +30 -0
- package/template/base/modules/pos/print/pos_receipt_part.rk +8 -0
- package/template/base/modules/pos/screens/kasir.rk +6 -3
- package/template/base/modules/pos/screens/kasir_meja.rk +62 -0
- package/template/base/modules/reimbursement/models/expense_claim.rk +1 -1
- package/template/base/modules/shifts/module.rk +1 -1
- package/template/base/modules/stock/flows/stock_balance_variant_group.rk +26 -0
- package/template/base/modules/stock/models/stock_balance.rk +1 -0
- package/template/base/modules/stock/models/stock_move.rk +1 -0
- package/template/base/modules/users/flows/summary_daily.rk +3 -1
- package/template/base/modules/users/flows/summary_monthly.rk +3 -1
- package/template/base/modules/users/flows/summary_weekly.rk +3 -1
- package/template/base/modules/whatsapp/models/whatsapp_message.rk +2 -0
- package/template/base/modules/whatsapp/module.rk +2 -2
- package/template/base/modules/whatsapp_order/README.md +44 -0
- package/template/base/modules/whatsapp_order/flows/whatsapp_order_intake.rk +118 -0
- package/template/base/modules/whatsapp_order/flows/whatsapp_order_locked.rk +12 -0
- package/template/base/modules/whatsapp_order/flows/whatsapp_order_on_update.rk +124 -0
- package/template/base/modules/whatsapp_order/models/whatsapp_inbound.rk +62 -0
- package/template/base/modules/whatsapp_order/models/whatsapp_order.rk +164 -0
- package/template/base/modules/whatsapp_order/models/whatsapp_order_guard.rk +46 -0
- package/template/base/modules/whatsapp_order/models/whatsapp_order_line.rk +45 -0
- package/template/base/modules/whatsapp_order/module.rk +42 -0
- package/template/base/modules/whatsapp_order/screens/pesanan_wa.rk +22 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/model.json
|
|
2
|
+
# A table of an outlet (A3, B1). Its state is never stored: the table map derives it from the open bills (draft
|
|
3
|
+
# pos_sale rows that link the table), contract 0048 section 2.
|
|
4
|
+
name: dining_table
|
|
5
|
+
label: {id: Meja, en: Dining table}
|
|
6
|
+
icon: stock
|
|
7
|
+
naming: MJA-{outlet.code}-{###}
|
|
8
|
+
title_field: table_name
|
|
9
|
+
permissions:
|
|
10
|
+
- {role: head_office, read: true, create: true, write: true, delete: true}
|
|
11
|
+
# the cashier reads the tables to open a bill on one; a waiter uses the cashier role in v1
|
|
12
|
+
- {role: cashier, read: true}
|
|
13
|
+
- {role: outlet_staff, read: true}
|
|
14
|
+
fields:
|
|
15
|
+
- {name: table_name, type: data, label: {id: Nama meja}, help: {id: 'Misalnya A3, B1'}, required: true, in_list: true}
|
|
16
|
+
- {name: area, type: link, to: dining_area, label: {id: Area}, required: true, in_list: true}
|
|
17
|
+
- {name: seats, type: int, label: {id: Kursi}, default: '2', in_list: true}
|
|
18
|
+
- {name: outlet, type: link, to: outlet, label: {id: Outlet}, required: true, in_list: true}
|
|
19
|
+
- {name: active, type: check, label: {id: Aktif}, default: 'true', in_list: true}
|
|
20
|
+
- {name: time_limit_min, type: int, label: {id: Batas waktu duduk (menit)}, help: {id: '0 berarti tanpa batas. Denah memberi tanda kuning 10 menit sebelum batas dan merah setelahnya'}, default: '0'}
|
|
21
|
+
# the area's name, for the table map's sections (a link shows its record name, not its title)
|
|
22
|
+
- {name: area_title, type: data, label: {id: Nama area}, hidden: true, compute: "area.area_name"}
|
|
23
|
+
# one table of a name per outlet
|
|
24
|
+
- {name: table_key, type: data, label: {id: Kunci meja}, hidden: true, unique: true, compute: "outlet + '/' + table_name"}
|
|
25
|
+
rules:
|
|
26
|
+
- name: area_of_outlet
|
|
27
|
+
on: save
|
|
28
|
+
check: area.outlet == outlet
|
|
29
|
+
message: {id: 'Area meja harus milik outlet yang sama dengan mejanya'}
|
|
30
|
+
- name: seats_positive
|
|
31
|
+
on: save
|
|
32
|
+
check: seats >= 1
|
|
33
|
+
message: {id: 'Jumlah kursi minimal 1'}
|
|
34
|
+
views:
|
|
35
|
+
list:
|
|
36
|
+
columns: [table_name, area, seats, outlet, active]
|
|
37
|
+
filters: [outlet, area, active]
|
|
38
|
+
sort: table_name
|
|
@@ -28,6 +28,13 @@ fields:
|
|
|
28
28
|
- {value: cashier_same_day, label: {id: Outlet sudah memakai kasir di tanggal itu}}
|
|
29
29
|
- {value: cashier_takings, label: {id: Setoran hari kasir}}
|
|
30
30
|
- {value: float_of_outlet, label: {id: Modal kas beda dengan outlet}}
|
|
31
|
+
- {value: table_busy, label: {id: Meja sudah punya tagihan terbuka}}
|
|
32
|
+
- {value: table_of_outlet, label: {id: Meja milik outlet lain}}
|
|
33
|
+
- {value: merge_invalid, label: {id: Gabung tagihan tidak bisa}}
|
|
34
|
+
- {value: split_invalid, label: {id: Pisah tagihan tidak bisa}}
|
|
35
|
+
- {value: not_a_store, label: {id: Lokasi bukan toko}}
|
|
36
|
+
- {value: shift_other_outlet, label: {id: Sesi kasir outlet lain}}
|
|
37
|
+
- {value: shift_not_own, label: {id: Sesi kasir orang lain}}
|
|
31
38
|
- {name: document, type: data, label: {id: Dokumen}}
|
|
32
39
|
rules:
|
|
33
40
|
- name: shift_already_open
|
|
@@ -74,3 +81,35 @@ rules:
|
|
|
74
81
|
on: save
|
|
75
82
|
check: reason != 'float_of_outlet'
|
|
76
83
|
message: {id: 'Modal kas outlet ini sudah ditetapkan kantor pusat; isi sesuai Modal kas kasir di data outlet'}
|
|
84
|
+
- name: table_busy
|
|
85
|
+
on: save
|
|
86
|
+
check: reason != 'table_busy'
|
|
87
|
+
message: {id: 'Meja ini sudah punya tagihan terbuka'}
|
|
88
|
+
- name: table_of_outlet
|
|
89
|
+
on: save
|
|
90
|
+
check: reason != 'table_of_outlet'
|
|
91
|
+
message: {id: 'Meja ini milik outlet lain'}
|
|
92
|
+
- name: merge_invalid
|
|
93
|
+
on: save
|
|
94
|
+
check: reason != 'merge_invalid'
|
|
95
|
+
message: {id: 'Tagihan hanya bisa digabung ke tagihan terbuka lain di outlet yang sama'}
|
|
96
|
+
- name: split_invalid
|
|
97
|
+
on: save
|
|
98
|
+
check: reason != 'split_invalid'
|
|
99
|
+
message: {id: 'Pisah tagihan butuh minimal satu barang tersisa di tagihan lama, dan tidak bisa dipakai bersama promo, member atau deposit'}
|
|
100
|
+
# a paired device's shift open passes the shift's own save rules as exceptions (contract 0058 §10); this guard keeps
|
|
101
|
+
# rule shift_at_store (rangka-apps#104) a refusal there too: a guard is a record a flow writes, so it still refuses
|
|
102
|
+
- name: not_a_store
|
|
103
|
+
on: save
|
|
104
|
+
check: reason != 'not_a_store'
|
|
105
|
+
message: {id: 'Sesi kasir hanya bisa dibuka di lokasi berjenis Toko'}
|
|
106
|
+
# a paired device's sale passes rules outlet_of_shift and own_shift of pos_sale as exceptions (contract 0058 §10);
|
|
107
|
+
# flow pos_sale_on_submit keeps them refusals with these two guards
|
|
108
|
+
- name: shift_other_outlet
|
|
109
|
+
on: save
|
|
110
|
+
check: reason != 'shift_other_outlet'
|
|
111
|
+
message: {id: 'Sesi kasir ini milik outlet lain; buka sesi di outlet perangkat ini'}
|
|
112
|
+
- name: shift_not_own
|
|
113
|
+
on: save
|
|
114
|
+
check: reason != 'shift_not_own'
|
|
115
|
+
message: {id: 'Sesi kasir ini milik kasir lain; buka sesi kasirmu sendiri'}
|
|
@@ -15,3 +15,5 @@ fields:
|
|
|
15
15
|
- {value: qris, label: {id: QRIS}}
|
|
16
16
|
- {name: amount, type: currency, label: {id: Jumlah}, required: true}
|
|
17
17
|
- {name: ref, type: data, label: {id: Ref QRIS}, help: {id: 'Nomor referensi di notifikasi QRIS, kalau ada'}}
|
|
18
|
+
# split bill by people (rangka-apps#121): which part of the bill this row pays; 1 when the bill is not split
|
|
19
|
+
- {name: party, type: int, label: {id: Bagian}, default: '1'}
|
|
@@ -16,7 +16,11 @@ icon: receipt
|
|
|
16
16
|
is_submittable: true
|
|
17
17
|
# No title_field: a receipt's title is its number (STRK-...), so a link to it (a kitchen ticket, a daily sales check)
|
|
18
18
|
# shows the number and never the total to a role that may not read the receipt.
|
|
19
|
-
|
|
19
|
+
# A receipt paid on a paired device (rangka-os contract 0058 §3) carries the number the device made, with the device's
|
|
20
|
+
# code (STRK-BTR-K1-2611-00042, a counter per device and month), so the printed receipt is final online or offline;
|
|
21
|
+
# head office in the browser keeps the outlet's own series without the device code (STRK-BTR-2611-00007).
|
|
22
|
+
naming: STRK-{outlet.code}-{device.code}-{YY}{MM}-{#####}
|
|
23
|
+
naming_on: device
|
|
20
24
|
on_submit: [stock.post_moves]
|
|
21
25
|
on_cancel: [stock.reverse_moves]
|
|
22
26
|
permissions:
|
|
@@ -45,11 +49,35 @@ fields:
|
|
|
45
49
|
index: true # the outlet_day backfill reads one outlet and day at a time (card t_0dba5917)
|
|
46
50
|
default: today()
|
|
47
51
|
in_list: true
|
|
52
|
+
# When the receipt was paid: the moment of the press at the counter (a paired device's occurred_at, contract 0058
|
|
53
|
+
# §10, so a sale synced after an outage keeps its own hour), else when it was created. Read by hourly sales
|
|
54
|
+
# (rangka-apps#115). An amended receipt (a partial return) is a new receipt and takes its own time.
|
|
55
|
+
- {name: sold_at, type: datetime, label: {id: Waktu transaksi}, default: now(), read_only: true}
|
|
48
56
|
- name: buyer
|
|
49
57
|
type: data
|
|
50
58
|
label: {id: Pembeli atau meja}
|
|
51
59
|
help: {id: 'Boleh kosong. Nama pembeli, nomor meja atau nomor antrean'}
|
|
52
60
|
in_list: true
|
|
61
|
+
# Tables (rangka-apps#122, contract 0048 section 2). An open bill is a draft that links its table; the table map derives
|
|
62
|
+
# Kosong, Terisi and Minta tagihan from the drafts. order_type is the stored field #121 defines below; a new bill made
|
|
63
|
+
# on a table defaults to dine_in.
|
|
64
|
+
- {name: table, type: link, to: dining_table, label: {id: Meja}, in_list: true}
|
|
65
|
+
- {name: guests, type: int, label: {id: Jumlah tamu}, default: '0'}
|
|
66
|
+
# a version counter the counter bumps on every write of an open bill: the conditional PATCH (_if: {rev}) turns two
|
|
67
|
+
# devices on one bill into a conflict, not a lost update
|
|
68
|
+
- {name: rev, type: int, label: {id: Versi tagihan}, default: '0', hidden: true}
|
|
69
|
+
- {name: bill_asked, type: check, label: {id: Minta tagihan}}
|
|
70
|
+
# the counter's "Kirim ke dapur" sets send_kitchen; flow kitchen_ticket_on_draft makes the tickets, records the lines
|
|
71
|
+
# in sent_to_kitchen (key, item, packing, description, qty, uom, note, category) and clears the check
|
|
72
|
+
- {name: send_kitchen, type: check, label: {id: Kirim ke dapur}}
|
|
73
|
+
- {name: sent_to_kitchen, type: json, label: {id: Baris terkirim ke dapur}, hidden: true, read_only: true, default: '[]'}
|
|
74
|
+
# merge: set on the bill to fold, naming the bill that takes its lines (flow pos_sale_merge); merged marks the bill that
|
|
75
|
+
# was folded: it frees its table, keeps its lines as a record and can never be paid
|
|
76
|
+
- {name: merge_into, type: link, to: pos_sale, label: {id: Gabung ke tagihan}, hidden: true}
|
|
77
|
+
- {name: merged, type: check, label: {id: Sudah digabung}, read_only: true, hidden: true}
|
|
78
|
+
# split: the line keys to move to a new bill on the same table (flow pos_sale_split); split_of is set on that new bill
|
|
79
|
+
- {name: split_lines, type: json, label: {id: Baris yang dipisah}, hidden: true, default: '[]'}
|
|
80
|
+
- {name: split_of, type: link, to: pos_sale, label: {id: Pisahan dari}, read_only: true, hidden: true}
|
|
53
81
|
# the customer of record (contacts), picked or signed up at the counter's checkout; buyer stays for a name, table or
|
|
54
82
|
# queue number. Shared with module loyalty (rangka-apps#102).
|
|
55
83
|
- {name: customer, type: link, to: customer, label: {id: Pelanggan}, help: {id: 'Boleh kosong. Pilih pelanggan terdaftar'}}
|
|
@@ -106,6 +134,35 @@ fields:
|
|
|
106
134
|
hidden: true
|
|
107
135
|
depends_on: app_installed('whatsapp_receipt')
|
|
108
136
|
compute: "(wa_phone.trim().startsWith('+') ? ('x' + wa_phone.replace(' ', '').replace('-', '').replace('.', '').replace('(', '').replace(')', '').replace('+', '')).replace('x620', 'x62').replace('x', '') : ('x' + wa_phone.replace(' ', '').replace('-', '').replace('.', '').replace('(', '').replace(')', '').replace('+', '')).replace('x8', 'x628').replace('x00', 'x').replace('x0', 'x62').replace('x620', 'x62').replace('x', '')).matches('^[1-9][0-9]{7,14}$') ? (wa_phone.trim().startsWith('+') ? ('x' + wa_phone.replace(' ', '').replace('-', '').replace('.', '').replace('(', '').replace(')', '').replace('+', '')).replace('x620', 'x62').replace('x', '') : ('x' + wa_phone.replace(' ', '').replace('-', '').replace('.', '').replace('(', '').replace(')', '').replace('+', '')).replace('x8', 'x628').replace('x00', 'x').replace('x0', 'x62').replace('x620', 'x62').replace('x', '')) : ''"
|
|
137
|
+
# Restaurant charges (rangka-apps#121). Service charge is for dine-in only. Rates and rounding are computed from the
|
|
138
|
+
# sale's outlet while the sale is a draft (a draft moved to another outlet's shift, or an amended receipt, takes that
|
|
139
|
+
# outlet's current values: re-audit N1, N2); a paid receipt keeps them when head office changes the outlet later.
|
|
140
|
+
- name: order_type
|
|
141
|
+
type: select
|
|
142
|
+
label: {id: Jenis pesanan}
|
|
143
|
+
# a default applies only at create when the client sent none: a bill opened on a table is dine_in (rangka-apps#122);
|
|
144
|
+
# a stored value is never overwritten, so an amended dine-in receipt whose table is cleared stays dine_in
|
|
145
|
+
default: "table != '' ? 'dine_in' : 'takeaway'"
|
|
146
|
+
in_list: true
|
|
147
|
+
options:
|
|
148
|
+
- {value: dine_in, label: {id: Makan di sini}}
|
|
149
|
+
- {value: takeaway, label: {id: Bawa pulang}}
|
|
150
|
+
- {value: online, label: {id: Online}}
|
|
151
|
+
- {name: service_pct, type: float, label: {id: Service charge (%)}, compute: outlet.service_pct, hidden: true}
|
|
152
|
+
- {name: pbjt_pct, type: float, label: {id: PBJT (%)}, compute: outlet.pbjt_pct, hidden: true}
|
|
153
|
+
- {name: rounding_unit, type: int, label: {id: Satuan pembulatan}, compute: int(outlet.rounding_unit), hidden: true}
|
|
154
|
+
- {name: rounding_mode, type: data, label: {id: Arah pembulatan}, compute: outlet.rounding_mode, hidden: true}
|
|
155
|
+
# Split bill between people (rangka-apps#121): the bill is paid in `parties` parts, one receipt, one submit. `equal`
|
|
156
|
+
# gives every part grand_total (less deposit) / parties with the remainder on part 1; `amount` leaves the amounts free.
|
|
157
|
+
- {name: parties, type: int, label: {id: Dibagi untuk}, help: {id: 'Jumlah orang yang membayar terpisah; 1 kalau tidak dibagi'}, default: '1'}
|
|
158
|
+
- name: split_mode
|
|
159
|
+
type: select
|
|
160
|
+
label: {id: Cara bagi}
|
|
161
|
+
default: "'equal'"
|
|
162
|
+
depends_on: parties > 1
|
|
163
|
+
options:
|
|
164
|
+
- {value: equal, label: {id: Sama rata}}
|
|
165
|
+
- {value: amount, label: {id: Jumlah bebas}}
|
|
109
166
|
- name: items
|
|
110
167
|
type: table
|
|
111
168
|
of: pos_sale_item
|
|
@@ -169,11 +226,12 @@ fields:
|
|
|
169
226
|
hidden: true
|
|
170
227
|
depends_on: app_installed('loyalty')
|
|
171
228
|
compute: "!app_installed('loyalty') || member == '' ? 0 : round((subtotal - bill_promo - member_discount) * member.max_redeem_pct / 100)"
|
|
229
|
+
# points on the sale before service charge, PBJT and rounding (audit F6), the same base as the member's spend
|
|
172
230
|
- name: points_earned
|
|
173
231
|
type: int
|
|
174
232
|
label: {id: Poin didapat}
|
|
175
233
|
depends_on: app_installed('loyalty') && points_earned > 0
|
|
176
|
-
compute: "!app_installed('loyalty') || member == '' || member.earn_spend <= 0 || grand_total <= 0 ? 0 : int(grand_total * member.earn_multiplier_pct / (member.earn_spend * 100))"
|
|
234
|
+
compute: "!app_installed('loyalty') || member == '' || member.earn_spend <= 0 || grand_total - service_charge - pbjt - rounding <= 0 ? 0 : int((grand_total - service_charge - pbjt - rounding) * member.earn_multiplier_pct / (member.earn_spend * 100))"
|
|
177
235
|
- name: points_left
|
|
178
236
|
type: int
|
|
179
237
|
label: {id: Sisa poin}
|
|
@@ -202,10 +260,32 @@ fields:
|
|
|
202
260
|
label: {id: Diskon kasir}
|
|
203
261
|
help: {id: 'Diskon yang diberi kasir, di luar promo'}
|
|
204
262
|
compute: discount_total - promo_total - member_discount - points_discount
|
|
263
|
+
# Charges after every discount: service on the net, PBJT on net plus service (Perda practice), then the rounding of the
|
|
264
|
+
# total to the outlet's unit. PBJT is a regional tax outside the price, so a PBJT sale carries no PPN (ppn_in_sales).
|
|
265
|
+
- name: net_before_charges
|
|
266
|
+
type: currency
|
|
267
|
+
label: {id: Subtotal setelah diskon}
|
|
268
|
+
compute: subtotal - bill_promo - member_discount - points_discount - discount_amount
|
|
269
|
+
- name: service_charge
|
|
270
|
+
type: currency
|
|
271
|
+
label: {id: Service charge}
|
|
272
|
+
compute: "order_type == 'dine_in' ? round(net_before_charges * service_pct / 100) : 0"
|
|
273
|
+
- name: pbjt
|
|
274
|
+
type: currency
|
|
275
|
+
label: {id: Pajak restoran (PBJT)}
|
|
276
|
+
compute: round((net_before_charges + service_charge) * pbjt_pct / 100)
|
|
277
|
+
- name: raw_total
|
|
278
|
+
type: currency
|
|
279
|
+
label: {id: Total sebelum pembulatan}
|
|
280
|
+
compute: net_before_charges + service_charge + pbjt
|
|
281
|
+
- name: rounding
|
|
282
|
+
type: currency
|
|
283
|
+
label: {id: Pembulatan}
|
|
284
|
+
compute: "rounding_unit <= 0 ? 0 : (rounding_mode == 'down' ? int(raw_total / rounding_unit) * rounding_unit : round(raw_total * 1.0 / rounding_unit) * rounding_unit) - raw_total"
|
|
205
285
|
- name: grand_total
|
|
206
286
|
type: currency
|
|
207
287
|
label: {id: Total}
|
|
208
|
-
compute:
|
|
288
|
+
compute: raw_total + rounding
|
|
209
289
|
in_list: true
|
|
210
290
|
# the part of the total the deposit does not pay: what the counter takes in cash or QRIS (its total slot)
|
|
211
291
|
- name: amount_due
|
|
@@ -234,6 +314,17 @@ fields:
|
|
|
234
314
|
type: currency
|
|
235
315
|
label: {id: Kembalian}
|
|
236
316
|
compute: cash_received + qris_amount - amount_due
|
|
317
|
+
- name: party_share
|
|
318
|
+
type: currency
|
|
319
|
+
label: {id: Bagian per orang}
|
|
320
|
+
help: {id: 'Total bayar dibagi sama rata, dibulatkan ke bawah; sisanya masuk bagian 1'}
|
|
321
|
+
depends_on: parties > 1
|
|
322
|
+
compute: "parties <= 1 ? amount_due : int(amount_due / parties)"
|
|
323
|
+
- name: party_first_share
|
|
324
|
+
type: currency
|
|
325
|
+
label: {id: Bagian 1}
|
|
326
|
+
depends_on: parties > 1
|
|
327
|
+
compute: "parties <= 1 ? amount_due : amount_due - (parties - 1) * party_share"
|
|
237
328
|
- name: method
|
|
238
329
|
type: select
|
|
239
330
|
label: {id: Cara bayar}
|
|
@@ -260,11 +351,11 @@ fields:
|
|
|
260
351
|
- name: ppn_in_sales
|
|
261
352
|
type: currency
|
|
262
353
|
label: {id: PPN dalam penjualan}
|
|
263
|
-
compute: "tax.pkp ? round(grand_total * tax.ppn_rate * tax.dpp_num / (100 * tax.dpp_den + tax.ppn_rate * tax.dpp_num)) : 0"
|
|
354
|
+
compute: "tax.pkp && pbjt_pct <= 0 ? round(grand_total * tax.ppn_rate * tax.dpp_num / (100 * tax.dpp_den + tax.ppn_rate * tax.dpp_num)) : 0"
|
|
264
355
|
- name: pph_final
|
|
265
356
|
type: currency
|
|
266
357
|
label: {id: 'PPh final 0,5%'}
|
|
267
|
-
compute: round((grand_total - ppn_in_sales) * 5 / 1000)
|
|
358
|
+
compute: round((grand_total - pbjt - ppn_in_sales) * 5 / 1000)
|
|
268
359
|
# Cashier controls (audit kasir M5): a receipt whose manual discounts exceed 20% of its price after promos waits for head office
|
|
269
360
|
# (contract 0007; the owner may always approve). A void is not held: an approved verb runs again as a requester
|
|
270
361
|
# without their outlets, so the flow's own-shift check cannot run (kernel card t_7782ebb1 follow-up); voids stay
|
|
@@ -281,6 +372,37 @@ stock:
|
|
|
281
372
|
- {lines: items, out: outlet, explode: recipe, reason: sale, cogs: cogs}
|
|
282
373
|
cogs_total: cogs_total
|
|
283
374
|
rules:
|
|
375
|
+
- name: table_of_outlet
|
|
376
|
+
on: save
|
|
377
|
+
check: "table == '' || table.outlet == outlet"
|
|
378
|
+
message: {id: 'Meja ini milik outlet lain'}
|
|
379
|
+
- name: table_active
|
|
380
|
+
on: save
|
|
381
|
+
check: "table == '' || table.active"
|
|
382
|
+
message: {id: 'Meja ini sedang tidak dipakai'}
|
|
383
|
+
- name: table_guests
|
|
384
|
+
on: save
|
|
385
|
+
check: "table == '' || merged || guests >= 1"
|
|
386
|
+
message: {id: 'Isi jumlah tamu minimal 1 untuk meja'}
|
|
387
|
+
- name: merged_no_table
|
|
388
|
+
on: save
|
|
389
|
+
check: "!merged || table == ''"
|
|
390
|
+
message: {id: 'Tagihan yang sudah digabung tidak bisa dipindah ke meja'}
|
|
391
|
+
# line keys (rangka-apps#122): the kitchen remembers the lines it got by key, so a key is used once per bill, and a line
|
|
392
|
+
# the kitchen already got keeps its item and unit and never grows (a tap on a sent line adds a new line); lowering it is a v1
|
|
393
|
+
# limit that sends no cancel
|
|
394
|
+
- name: line_key_unique
|
|
395
|
+
on: save
|
|
396
|
+
check: "items.all(l, l.line_key == '' || items.filter(m, m.line_key == l.line_key).size() == 1)"
|
|
397
|
+
message: {id: 'Ada baris pesanan ganda; muat ulang tagihan lalu coba lagi'}
|
|
398
|
+
- name: sent_line_kept
|
|
399
|
+
on: save
|
|
400
|
+
check: "sent_to_kitchen == null || items.all(l, l.line_key == '' || sent_to_kitchen.filter(s, s.key == l.line_key).all(s, s.item == l.item && (!('packing' in s) || s.packing == l.packing) && l.uom == s.uom && l.qty <= s.qty))"
|
|
401
|
+
message: {id: 'Barang yang sudah dikirim ke dapur tidak bisa diganti atau ditambah; tambahkan sebagai baris baru'}
|
|
402
|
+
- name: merged_not_payable
|
|
403
|
+
on: submit
|
|
404
|
+
check: "!merged"
|
|
405
|
+
message: {id: 'Tagihan ini sudah digabung ke tagihan lain dan tidak bisa dibayar'}
|
|
284
406
|
# Only a store sells (rangka-apps#104): a warehouse, vehicle, quarantine or production row takes no plan outlet seat
|
|
285
407
|
# (outlets limit_scope is_store), so a shift or sale there would be a free seat. Van sales belong to field_sales (#112).
|
|
286
408
|
- name: sale_at_store
|
|
@@ -315,6 +437,13 @@ rules:
|
|
|
315
437
|
on: save
|
|
316
438
|
check: "!app_installed('outlet_sales') || (outlet.moka_name == '' && outlet.sales_source == 'kasir')"
|
|
317
439
|
message: {id: 'Outlet ini mencatat penjualan lewat Moka, file POS atau formulir harian. Ubah Sumber penjualan outlet ke Kasir Juragan dulu'}
|
|
440
|
+
# The rounding of the bill stays within one step of the outlet's unit (audit F1, F2): the unit is one the outlet form
|
|
441
|
+
# offers, "nearest" moves at most half a unit and "down" takes off less than one unit, so a rounding can never close a
|
|
442
|
+
# bill for less than it costs.
|
|
443
|
+
- name: rounding_within_unit
|
|
444
|
+
on: save
|
|
445
|
+
check: "(rounding_unit == 0 || rounding_unit == 100 || rounding_unit == 500 || rounding_unit == 1000) && (rounding_unit == 0 ? rounding == 0 : (rounding_mode == 'down' ? (rounding <= 0 && -rounding < rounding_unit) : (rounding * 2 <= rounding_unit && -rounding * 2 <= rounding_unit)))"
|
|
446
|
+
message: {id: 'Pembulatan total tidak sesuai pengaturan outlet; muat ulang transaksi ini'}
|
|
318
447
|
- name: qty_positive
|
|
319
448
|
on: save
|
|
320
449
|
check: "items.map(l, l.qty <= 0 ? 1 : 0).sum() == 0"
|
|
@@ -396,6 +525,19 @@ rules:
|
|
|
396
525
|
on: save
|
|
397
526
|
check: "payments.map(p, p.amount <= 0 ? 1 : 0).sum() == 0"
|
|
398
527
|
message: {id: Jumlah pembayaran harus lebih dari 0}
|
|
528
|
+
- name: parties_range
|
|
529
|
+
on: save
|
|
530
|
+
check: parties >= 1 && parties <= 20
|
|
531
|
+
message: {id: 'Tagihan bisa dibagi untuk 1 sampai 20 orang'}
|
|
532
|
+
- name: payment_party_range
|
|
533
|
+
on: save
|
|
534
|
+
check: "payments.map(p, p.party < 1 || p.party > parties ? 1 : 0).sum() == 0"
|
|
535
|
+
message: {id: 'Bagian pembayaran harus antara 1 dan jumlah orang yang membagi tagihan'}
|
|
536
|
+
# an equal split: every part pays at least its share (cash may be more, the change comes back to that part)
|
|
537
|
+
- name: party_pays_share
|
|
538
|
+
on: save
|
|
539
|
+
check: "parties <= 1 || split_mode != 'equal' || payments.size() == 0 || [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20].map(k, k > parties ? 0 : (payments.map(p, p.party == k ? p.amount : 0).sum() < (k == 1 ? party_first_share : party_share) ? 1 : 0)).sum() == 0"
|
|
540
|
+
message: {id: 'Ada bagian yang bayarnya kurang dari bagiannya'}
|
|
399
541
|
- name: qris_not_over
|
|
400
542
|
on: save
|
|
401
543
|
check: qris_amount <= amount_due
|
|
@@ -447,14 +589,14 @@ rules:
|
|
|
447
589
|
message: {id: 'Draf ini dari hari lain; buat transaksi baru untuk hari ini'}
|
|
448
590
|
views:
|
|
449
591
|
list:
|
|
450
|
-
columns: [name, date, outlet, grand_total, method, status, buyer]
|
|
592
|
+
columns: [name, date, sold_at, outlet, grand_total, method, status, buyer]
|
|
451
593
|
filters: [outlet, method, shift]
|
|
452
594
|
sort: -name
|
|
453
595
|
form:
|
|
454
596
|
layout:
|
|
455
597
|
- section: {id: Transaksi}
|
|
456
598
|
columns:
|
|
457
|
-
- [shift, outlet, date, customer, member]
|
|
599
|
+
- [shift, outlet, date, sold_at, customer, member]
|
|
458
600
|
- [buyer, wa_phone, wa_receipt]
|
|
459
601
|
- section: {id: Promo}
|
|
460
602
|
columns:
|
|
@@ -466,6 +608,10 @@ views:
|
|
|
466
608
|
- [deposit_used, points_earned, points_left, deposit_left]
|
|
467
609
|
- section: {id: Barang}
|
|
468
610
|
fields: [items]
|
|
611
|
+
- section: {id: Jenis pesanan dan biaya}
|
|
612
|
+
columns:
|
|
613
|
+
- [order_type, parties, split_mode]
|
|
614
|
+
- [service_charge, pbjt, rounding, party_share, party_first_share]
|
|
469
615
|
- section: {id: Bayar}
|
|
470
616
|
columns:
|
|
471
617
|
- [subtotal, discount_amount, grand_total, amount_due]
|
|
@@ -6,10 +6,14 @@
|
|
|
6
6
|
name: pos_sale_item
|
|
7
7
|
is_child: true
|
|
8
8
|
fields:
|
|
9
|
+
# a stable key of the line (tables, rangka-apps#122): the kitchen remembers which lines it was sent, and a merge or a
|
|
10
|
+
# split moves lines between bills by it. The counter fills it; an empty key is a line the kitchen was never sent.
|
|
11
|
+
- {name: line_key, type: data, label: {id: Kunci baris}, hidden: true}
|
|
9
12
|
- {name: item, type: link, to: item, label: {id: Barang atau menu}, required: true, peek: [rate, stock_uom]}
|
|
10
13
|
# the item's category when the line was saved: the kitchen routes a paid line by it (module kitchen) without reading
|
|
11
14
|
# the whole catalogue during the payment
|
|
12
15
|
- {name: category, type: link, to: item_category, label: {id: Kategori}, hidden: true, compute: item.category}
|
|
16
|
+
- {name: variant_group, type: data, label: {id: Grup varian}, hidden: true, compute: item.variant_group}
|
|
13
17
|
- {name: description, type: text, label: {id: Uraian}, default: item.item_name}
|
|
14
18
|
- name: packing
|
|
15
19
|
type: link
|
|
@@ -9,7 +9,10 @@
|
|
|
9
9
|
name: pos_shift
|
|
10
10
|
label: {id: Sesi kasir, en: Cashier shift}
|
|
11
11
|
icon: wallet
|
|
12
|
-
|
|
12
|
+
# A shift opened on a paired device carries the device's number (SESI-BTR-K1-2611-0003, contract 0058 §3), so the
|
|
13
|
+
# sales queued offline link it by that name; head office keeps SESI-<outlet code>-<YYMM>-<n>.
|
|
14
|
+
naming: SESI-{outlet.code}-{device.code}-{YY}{MM}-{####}
|
|
15
|
+
naming_on: device
|
|
13
16
|
title_field: outlet
|
|
14
17
|
permissions:
|
|
15
18
|
- {role: head_office, read: true, create: true, write: true, export: true, print: true}
|
|
@@ -64,6 +67,10 @@ fields:
|
|
|
64
67
|
# blind count (contract 0027 hidden_for): the cashier counts the drawer without seeing what should be in it
|
|
65
68
|
- {name: cash_total, type: currency, label: {id: Tunai masuk}, help: {id: 'Dibayar tunai setelah kembalian, dikurangi tunai transaksi yang dibatalkan'}, read_only: true, hidden_for: [cashier]}
|
|
66
69
|
- {name: qris_total, type: currency, label: {id: QRIS masuk}, read_only: true, hidden_for: [cashier]}
|
|
70
|
+
# restaurant charges of the shift's receipts (rangka-apps#121), for the daily recap
|
|
71
|
+
- {name: service_total, type: currency, label: {id: Service charge}, read_only: true, hidden_for: [cashier]}
|
|
72
|
+
- {name: pbjt_total, type: currency, label: {id: Pajak restoran (PBJT)}, read_only: true, hidden_for: [cashier]}
|
|
73
|
+
- {name: rounding_total, type: currency, label: {id: Pembulatan}, read_only: true, hidden_for: [cashier]}
|
|
67
74
|
- {name: void_count, type: int, label: {id: Transaksi dibatalkan}, read_only: true}
|
|
68
75
|
# module loyalty: sales paid from a member's deposit (no money moves, 2-1400), and deposit top-ups taken on this
|
|
69
76
|
# shift (cash into the drawer, QRIS into the outlet's QRIS; flow deposit_topup_on_submit)
|
|
@@ -115,6 +122,9 @@ views:
|
|
|
115
122
|
columns:
|
|
116
123
|
- [sales_count, gross_total, discount_total, net_total]
|
|
117
124
|
- [cash_total, qris_total, void_count, void_total]
|
|
125
|
+
- section: {id: Biaya restoran}
|
|
126
|
+
columns:
|
|
127
|
+
- [service_total, pbjt_total, rounding_total]
|
|
118
128
|
- section: {id: Deposit member}
|
|
119
129
|
columns:
|
|
120
130
|
- [deposit_total]
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/module.json
|
|
2
2
|
name: pos
|
|
3
|
-
version: 1.
|
|
3
|
+
version: 1.10.0
|
|
4
4
|
title: {id: Kasir, en: Point of sale}
|
|
5
5
|
summary:
|
|
6
6
|
id: Kasir di browser dengan sesi kas, transaksi dan tutup sesi per outlet.
|
|
7
7
|
en: A browser till with cash sessions, sales and session close per outlet.
|
|
8
8
|
category: sales
|
|
9
9
|
icon: shopping-basket-line
|
|
10
|
-
# The cashier of a shop or an F&B outlet
|
|
11
|
-
#
|
|
10
|
+
# The cashier of a shop or an F&B outlet (Jalur B), online in any browser and offline on a paired device (rangka-os
|
|
11
|
+
# contract 0058: the device numbers its receipts and shifts with its own code, computes the totals with the model's
|
|
12
|
+
# computes and sends them when the connection is back; its totals are binding). A cashier opens a shift (pos_shift)
|
|
13
|
+
# at an outlet with the float in the drawer, rings up sales
|
|
12
14
|
# (pos_sale: items or menu, qty in any unit of the item, line and receipt discounts, paid in cash with change, QRIS,
|
|
13
15
|
# or both), and closes the shift by counting the drawer: the difference is booked as selisih kas. Each sale is
|
|
14
|
-
# numbered per outlet (STRK-<outlet code>-<YYMM>-<n>, kernel contract 0009 §2a), takes its goods out of the outlet's
|
|
16
|
+
# numbered per outlet (STRK-<outlet code>-<YYMM>-<n>, kernel contract 0009 §2a; on a paired device with its code), takes its goods out of the outlet's
|
|
15
17
|
# stock through the declared stock rule (contract 0021; a menu item through its active recipe, contract 0022) and is
|
|
16
18
|
# journalled by the accounting module like a day of outlet_sales. A sale can be voided (cancel) or corrected
|
|
17
19
|
# (cancel, then amend without the returned items) only on its own day while its shift is open.
|
|
@@ -20,6 +22,9 @@ icon: shopping-basket-line
|
|
|
20
22
|
# A sale may name its customer (contacts), and with module promotions it takes item promos by itself and a bill promo,
|
|
21
23
|
# voucher code or free gift picked at the counter's checkout (rangka-os contract 0069, rangka-apps#103). With module
|
|
22
24
|
# loyalty the checkout also takes a member, points to redeem and a part paid from the member's deposit (rangka-apps#102).
|
|
25
|
+
# A sale copies the outlet's service charge (dine-in only), PBJT rate and bill rounding while it is a draft, and a paid
|
|
26
|
+
# receipt can be printed split into parts (rangka-apps#121, pos 1.9.0). Tables: an open bill per table, moved, merged
|
|
27
|
+
# or split by line, sent to the kitchen while a draft; a bill opened on a table is dine-in (rangka-apps#122, pos 1.10.0).
|
|
23
28
|
requires: {rangka: '>=0.5', users: ^1.2, contacts: ^1.4, catalogue: ^1.5, outlets: ^1.7, stock: ^1.2}
|
|
24
29
|
hooks: [stock.reverse_moves]
|
|
25
30
|
optional: {accounting: ^1.4, outlet_sales: ^1.1, promotions: ^1.0, loyalty: ^1.0, shifts: ^1.0}
|
|
@@ -35,16 +35,19 @@ body { font-size: 8.5pt; }
|
|
|
35
35
|
</div>
|
|
36
36
|
{{end}}
|
|
37
37
|
<div class="rule"></div>
|
|
38
|
-
{{if or .Doc.discount_amount .Doc.bill_promo .Doc.member_discount .Doc.points_discount}}<div class="row"><span>Subtotal</span><span class="num">{{rupiah .Doc.subtotal}}</span></div>{{end}}
|
|
38
|
+
{{if or .Doc.discount_amount .Doc.bill_promo .Doc.member_discount .Doc.points_discount .Doc.service_charge .Doc.pbjt .Doc.rounding}}<div class="row"><span>Subtotal</span><span class="num">{{rupiah .Doc.subtotal}}</span></div>{{end}}
|
|
39
39
|
{{if .Doc.bill_promo}}<div class="row"><span>Promo nota {{.Doc.promo_name}}</span><span class="num">-{{rupiah .Doc.bill_promo}}</span></div>{{end}}
|
|
40
40
|
{{if .Doc.member_discount}}<div class="row"><span>Diskon member {{.Links.member.tier_name}}</span><span class="num">-{{rupiah .Doc.member_discount}}</span></div>{{end}}
|
|
41
41
|
{{if .Doc.points_discount}}<div class="row"><span>Tukar {{number .Doc.points_redeemed}} poin</span><span class="num">-{{rupiah .Doc.points_discount}}</span></div>{{end}}
|
|
42
42
|
{{if .Doc.discount_amount}}<div class="row"><span>Diskon nota</span><span class="num">-{{rupiah .Doc.discount_amount}}</span></div>{{end}}
|
|
43
43
|
{{if .Doc.promo_total}}<div class="row muted"><span>Hemat dari promo</span><span class="num">{{rupiah .Doc.promo_total}}</span></div>{{end}}
|
|
44
|
+
{{if .Doc.service_charge}}<div class="row"><span>Service charge {{number .Doc.service_pct}}%</span><span class="num">{{rupiah .Doc.service_charge}}</span></div>{{end}}
|
|
45
|
+
{{if .Doc.pbjt}}<div class="row"><span>PBJT {{number .Doc.pbjt_pct}}%</span><span class="num">{{rupiah .Doc.pbjt}}</span></div>{{end}}
|
|
46
|
+
{{if .Doc.rounding}}<div class="row"><span>Pembulatan</span><span class="num">{{rupiah .Doc.rounding}}</span></div>{{end}}
|
|
44
47
|
<div class="row big"><span>Total</span><span class="num">{{rupiah .Doc.grand_total}}</span></div>
|
|
45
48
|
{{if .Doc.ppn_in_sales}}<div class="row muted"><span>Termasuk PPN</span><span class="num">{{rupiah .Doc.ppn_in_sales}}</span></div>{{end}}
|
|
46
49
|
{{if .Doc.deposit_used}}<div class="row"><span>Deposit</span><span class="num">{{rupiah .Doc.deposit_used}}</span></div>{{end}}
|
|
47
|
-
{{range $p := .Doc.payments}}<div class="row"><span>{{if eq (printf "%v" $p.method) "qris"}}QRIS{{with $p.ref}} {{.}}{{end}}{{else}}Tunai{{end}}</span><span class="num">{{rupiah $p.amount}}</span></div>
|
|
50
|
+
{{range $p := .Doc.payments}}<div class="row"><span>{{if gt $.Doc.parties 1}}Bagian {{$p.party}}: {{end}}{{if eq (printf "%v" $p.method) "qris"}}QRIS{{with $p.ref}} {{.}}{{end}}{{else}}Tunai{{end}}</span><span class="num">{{rupiah $p.amount}}</span></div>
|
|
48
51
|
{{else}}{{if $.Doc.amount_due}}<div class="row"><span>Tunai</span><span class="num">{{rupiah $.Doc.amount_due}}</span></div>{{end}}
|
|
49
52
|
{{end}}
|
|
50
53
|
{{if .Doc.change_amount}}<div class="row"><span>Kembalian</span><span class="num">{{rupiah .Doc.change_amount}}</span></div>{{end}}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{{define "style"}}
|
|
2
|
+
/* Arah E untuk thermal, sama dengan nota faktur: hitam putih, nama usaha tebal, angka rata kanan. */
|
|
3
|
+
body { font-size: 8.5pt; }
|
|
4
|
+
.c { text-align: center; }
|
|
5
|
+
.brand { font-size: 1.25em; font-weight: 700; }
|
|
6
|
+
.rule { border-top: 1px dashed #1C1917; margin: 2mm 0; }
|
|
7
|
+
.row { display: flex; justify-content: space-between; gap: 2mm; }
|
|
8
|
+
.row .num { white-space: nowrap; }
|
|
9
|
+
.line { margin: 1mm 0; }
|
|
10
|
+
.line .sub { color: #57534E; }
|
|
11
|
+
.big { font-size: 1.35em; font-weight: 700; }
|
|
12
|
+
.status { font-weight: 700; }
|
|
13
|
+
.muted { color: #57534E; }
|
|
14
|
+
{{end}}
|
|
15
|
+
{{define "letterhead"}}{{with .Letterhead}}<div class="c">
|
|
16
|
+
<div class="brand">{{.legal_name}}</div>
|
|
17
|
+
</div>{{end}}{{end}}
|
|
18
|
+
{{template "letterhead" .}}
|
|
19
|
+
<div class="c">{{.Links.outlet.outlet_name}}</div>
|
|
20
|
+
<div class="rule"></div>
|
|
21
|
+
<div class="row"><span>Struk</span><span>{{.Doc.name}}</span></div>
|
|
22
|
+
<div class="row"><span>Tanggal</span><span>{{date .Doc.date}}</span></div>
|
|
23
|
+
<div class="row"><span>Total tagihan</span><span class="num">{{rupiah .Doc.grand_total}}</span></div>
|
|
24
|
+
{{range $p := .Doc.payments}}
|
|
25
|
+
<div class="rule"></div>
|
|
26
|
+
<div class="c big">Bagian {{$p.party}} dari {{$.Doc.parties}}</div>
|
|
27
|
+
<div class="row"><span>{{if eq (printf "%v" $p.method) "qris"}}QRIS{{with $p.ref}} {{.}}{{end}}{{else}}Tunai{{end}}</span><span class="num">{{rupiah $p.amount}}</span></div>
|
|
28
|
+
{{end}}
|
|
29
|
+
<div class="rule"></div>
|
|
30
|
+
<div class="c muted">Terima kasih</div>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/print.json
|
|
2
|
+
# One slip per payment row of a split bill ("Bagian 2 dari 3"): what that part paid and its change (rangka-apps#121).
|
|
3
|
+
# A part paid with two rows (cash and QRIS) gets two slips.
|
|
4
|
+
name: pos_receipt_part
|
|
5
|
+
model: pos_sale
|
|
6
|
+
label: {id: Struk per bagian (bayar terpisah), en: Receipt per part (split bill)}
|
|
7
|
+
paper: 80mm
|
|
8
|
+
template: pos_receipt_part.html
|
|
@@ -19,6 +19,7 @@ counter:
|
|
|
19
19
|
group_by: category
|
|
20
20
|
price: rate
|
|
21
21
|
barcode: barcode
|
|
22
|
+
variants: {group: variant_group, label: variant_label, title: variant_title}
|
|
22
23
|
available: {model: stock_balance, item: item, qty: qty, match: {outlet: outlet}}
|
|
23
24
|
document:
|
|
24
25
|
model: pos_sale
|
|
@@ -28,12 +29,14 @@ counter:
|
|
|
28
29
|
# amount_due: the total less what the member's deposit pays (module loyalty); without it, the total
|
|
29
30
|
total: amount_due
|
|
30
31
|
change: change_amount
|
|
31
|
-
|
|
32
|
+
# at most 12 lines (0034 §2, raised for rangka-apps#121; checkout takes at most 8 fields): the discounts show as one
|
|
33
|
+
# total here, the receipt and the sale keep the breakdown
|
|
34
|
+
summary: [gross_total, promo_total, member_discount, points_discount, manual_discount_total, promo_shortfall, service_charge, pbjt, rounding, deposit_used, amount_due]
|
|
32
35
|
# rangka-os contract 0069: filled before paying; the promo picker lists live bill promos only, the member picker
|
|
33
36
|
# active members. Fields of modules promotions and loyalty are left out when not installed (their depends_on).
|
|
34
|
-
checkout: [customer, {field: member, filter: "active"}, {field: promotion, filter: "is_bill && live"}, promo_code, points_redeemed, deposit_used]
|
|
37
|
+
checkout: [order_type, customer, {field: member, filter: "active"}, {field: promotion, filter: "is_bill && live"}, promo_code, points_redeemed, deposit_used]
|
|
35
38
|
set: {date: "today()"}
|
|
36
|
-
payments: {table: payments, method: method, amount: amount, ref: ref, methods: [cash, qris]}
|
|
39
|
+
payments: {table: payments, method: method, amount: amount, ref: ref, party: party, parties: parties, methods: [cash, qris]}
|
|
37
40
|
session:
|
|
38
41
|
model: pos_shift
|
|
39
42
|
link: shift
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/screen.json
|
|
2
|
+
# The cashier's work screen for a restaurant or cafe with tables (contract 0030 §2 counter, 0048 §2; rangka-apps#122). Same
|
|
3
|
+
# sale as kasir, but the cashier opens on the table map. kasir stays for a counter without tables.
|
|
4
|
+
# (contract 0030 §2 counter): the kernel web app renders it from these slots. Money, stock
|
|
5
|
+
# and numbering stay in pos_sale (computes, rules, stock: block, journal flows); the screen only fills the sale.
|
|
6
|
+
name: kasir_meja
|
|
7
|
+
type: counter
|
|
8
|
+
label: {id: Kasir meja, en: Table cashier}
|
|
9
|
+
description: {id: 'Buka tagihan per meja, kirim ke dapur, pindah, gabung atau pisah tagihan, lalu bayar dan cetak struk.'}
|
|
10
|
+
icon: wallet
|
|
11
|
+
roles: [cashier, head_office]
|
|
12
|
+
device: tablet
|
|
13
|
+
needs: [print, scan]
|
|
14
|
+
offline: queue
|
|
15
|
+
counter:
|
|
16
|
+
catalogue:
|
|
17
|
+
model: item
|
|
18
|
+
filter: "kind != 'material' && active != false"
|
|
19
|
+
title: item_name
|
|
20
|
+
search: [item_name, sku, barcode]
|
|
21
|
+
group_by: category
|
|
22
|
+
price: rate
|
|
23
|
+
barcode: barcode
|
|
24
|
+
variants: {group: variant_group, label: variant_label, title: variant_title}
|
|
25
|
+
available: {model: stock_balance, item: item, qty: qty, match: {outlet: outlet}}
|
|
26
|
+
document:
|
|
27
|
+
model: pos_sale
|
|
28
|
+
lines: items
|
|
29
|
+
# amount: the model's line amount shows a promo (struck price) or a free gift; flag: the cashier marks the gift line
|
|
30
|
+
line: {item: item, qty: qty, price: rate, note: note, amount: amount, flag: is_gift}
|
|
31
|
+
# amount_due: the total less what the member's deposit pays (module loyalty); without it, the total
|
|
32
|
+
total: amount_due
|
|
33
|
+
change: change_amount
|
|
34
|
+
# the same rows as kasir, with #121's service charge, PBJT and rounding: a bill on a table is dine-in
|
|
35
|
+
summary: [gross_total, promo_total, member_discount, points_discount, manual_discount_total, promo_shortfall, service_charge, pbjt, rounding, deposit_used, amount_due]
|
|
36
|
+
# rangka-os contract 0069: filled before paying; the promo picker lists live bill promos only, the member picker
|
|
37
|
+
# active members. Fields of modules promotions and loyalty are left out when not installed (their depends_on).
|
|
38
|
+
checkout: [order_type, customer, {field: member, filter: "active"}, {field: promotion, filter: "is_bill && live"}, promo_code, points_redeemed, deposit_used]
|
|
39
|
+
set: {date: "today()"}
|
|
40
|
+
payments: {table: payments, method: method, amount: amount, ref: ref, party: party, parties: parties, methods: [cash, qris]}
|
|
41
|
+
session:
|
|
42
|
+
model: pos_shift
|
|
43
|
+
link: shift
|
|
44
|
+
filter: "cashier == user.email"
|
|
45
|
+
state: {field: state, open: open, closed: closed}
|
|
46
|
+
open: [outlet, opening_cash]
|
|
47
|
+
set: {outlet: "user.outlets.size() > 0 ? user.outlets[0] : ''"}
|
|
48
|
+
close: {model: pos_shift_close, link: shift, fields: [counted_cash, closing_note]}
|
|
49
|
+
# contract 0048 section 2: the counter opens on the table map; an open bill is a draft that links its table
|
|
50
|
+
customer:
|
|
51
|
+
field: buyer
|
|
52
|
+
table:
|
|
53
|
+
model: dining_table
|
|
54
|
+
link: table
|
|
55
|
+
title: table_name
|
|
56
|
+
area: area_title
|
|
57
|
+
seats: seats
|
|
58
|
+
filter: "active != false"
|
|
59
|
+
match: {outlet: outlet}
|
|
60
|
+
guests: guests
|
|
61
|
+
bill: bill_asked
|
|
62
|
+
print: pos_receipt
|
|
@@ -15,7 +15,7 @@ title_field: description
|
|
|
15
15
|
# Paying it back (pay_with): cash or bank by finance (claim_payment), or with the next salary (payslip.reimbursement,
|
|
16
16
|
# untaxed). A submitted claim cannot change, so whether it was paid lives on its claim_settlement (made by
|
|
17
17
|
# claim_settlement_on_submit). A claim already paid cannot be cancelled (claim_cancel_guard): cancel the payment or the
|
|
18
|
-
# slip first.
|
|
18
|
+
# slip first. Zafdoz may suggest category and amount from the receipt into a draft; a person submits, an approver
|
|
19
19
|
# approves: money is never decided by an LLM.
|
|
20
20
|
permissions:
|
|
21
21
|
# Staff: their own claims only (permission if:, which also filters lists and dashboards). No cancel, no amend.
|
|
@@ -11,6 +11,6 @@ icon: calendar-line
|
|
|
11
11
|
# (pos_shift, module pos) is something else: it links to the work shift when the cashier has one, never needs it.
|
|
12
12
|
# With module attendance, a clock-in links to the employee's published shift of that day and lateness is measured
|
|
13
13
|
# against the shift instead of the outlet's default hours; flow shift_attendance_sync marks each shift present, late or
|
|
14
|
-
# absent. The
|
|
14
|
+
# absent. The clock screen shows the shift of the day (clock.shift, rangka-os 0030) and links it at clock-in.
|
|
15
15
|
requires: {rangka: '>=0.5', users: ^1.5, outlets: ^1.6}
|
|
16
16
|
optional: {attendance: ^1.1, pos: ^1.6}
|