@rangka-os/create 0.5.0-alpha.34 → 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/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/ritel_cabang/app.rk +7 -0
- package/template/base/apps/ritel_cabang/skills/rangka-app-ritel-cabang/SKILL.md +43 -0
- 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/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/outlets/models/outlet.rk +39 -0
- 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 +3 -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 +5 -3
- package/template/base/modules/pos/screens/kasir_meja.rk +62 -0
- package/template/base/modules/shifts/module.rk +1 -1
- 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
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/flow.json
|
|
2
|
+
# Merge two open bills (rangka-apps#122, contract 0048 Open 4). The cashier sets merge_into on the bill to fold; this flow
|
|
3
|
+
# runs inside that write, so the lines land on the target and the source is marked merged in one atomic step: the lines
|
|
4
|
+
# are never on both bills as payable ones. The source keeps its lines as a record, frees its table and can never be
|
|
5
|
+
# paid (rule merged_not_payable); it can be deleted afterwards. Nothing touches stock: stock moves only when the
|
|
6
|
+
# target is paid. Line keys are prefixed with the source's name so they stay unique on the target, and the lines the
|
|
7
|
+
# kitchen already got are carried over under the same prefixed keys, so none is sent twice. The source's bill discount
|
|
8
|
+
# (discount_amount, rupiah) is added to the target's, so the merged total is the sum of both totals; a discount is
|
|
9
|
+
# rupiah off the net, so the sum leaves every later percentage (service, tax) on the same base. The target's
|
|
10
|
+
# "Minta tagihan" is cleared: the bill it asked for has changed. An amended copy (a return) is never merged, as source or
|
|
11
|
+
# target, and a line without a key keeps an empty key.
|
|
12
|
+
name: pos_sale_merge
|
|
13
|
+
label: {id: 'Gabung dua tagihan meja'}
|
|
14
|
+
description: {id: 'Semua barang tagihan yang digabung pindah ke tagihan tujuan, lalu tagihan asal tidak bisa dibayar lagi'}
|
|
15
|
+
on: pos_sale.updated
|
|
16
|
+
if: "event.docstatus == 0 && event.merge_into != '' && !event.merged"
|
|
17
|
+
steps:
|
|
18
|
+
- {find: pos_sale, where: "name == event.merge_into", as: tgt}
|
|
19
|
+
- {find: pos_sale, where: "name == event.name", as: src}
|
|
20
|
+
- if: tgt == null || (has(tgt.amended_from) && tgt.amended_from != '') || (has(event.amended_from) && event.amended_from != '') || tgt.docstatus != 0 || tgt.outlet != event.outlet || tgt.merged || tgt.merge_into != '' || tgt.name == event.name || event.promotion != '' || event.member != '' || event.points_redeemed > 0 || event.deposit_used > 0
|
|
21
|
+
create: pos_guard
|
|
22
|
+
set: {reason: "'merge_invalid'", document: event.name}
|
|
23
|
+
- if: tgt != null && (!has(tgt.amended_from) || tgt.amended_from == '') && (!has(event.amended_from) || event.amended_from == '') && tgt.docstatus == 0 && tgt.outlet == event.outlet && !tgt.merged && tgt.merge_into == '' && tgt.name != event.name && event.promotion == '' && event.member == '' && event.points_redeemed == 0 && event.deposit_used == 0
|
|
24
|
+
then:
|
|
25
|
+
- update: tgt
|
|
26
|
+
set:
|
|
27
|
+
items: "tgt.items.map(l, {'item': l.item, 'packing': l.packing, 'qty': l.qty, 'discount_pct': l.discount_pct, 'description': l.description, 'note': l.note, 'is_gift': l.is_gift, 'line_key': l.line_key}) + event.items.map(l, {'item': l.item, 'packing': l.packing, 'qty': l.qty, 'discount_pct': l.discount_pct, 'description': l.description, 'note': l.note, 'is_gift': l.is_gift, 'line_key': l.line_key == '' ? '' : event.name + ':' + l.line_key})"
|
|
28
|
+
sent_to_kitchen: "(tgt.sent_to_kitchen == null ? [] : tgt.sent_to_kitchen) + (event.sent_to_kitchen == null ? [] : event.sent_to_kitchen).map(s, {'key': event.name + ':' + s.key, 'item': s.item, 'packing': has(s.packing) ? s.packing : '', 'description': s.description, 'qty': s.qty, 'uom': s.uom, 'note': s.note, 'category': s.category})"
|
|
29
|
+
guests: tgt.guests + event.guests
|
|
30
|
+
discount_amount: tgt.discount_amount + event.discount_amount
|
|
31
|
+
bill_asked: "false"
|
|
32
|
+
rev: tgt.rev + 1
|
|
33
|
+
- update: src
|
|
34
|
+
set: {merged: "true", table: "''", bill_asked: "false", send_kitchen: "false"}
|
|
@@ -29,6 +29,9 @@ steps:
|
|
|
29
29
|
cash_total: s.cash_total - event.cash_amount
|
|
30
30
|
qris_total: s.qris_total - event.qris_amount
|
|
31
31
|
deposit_total: s.deposit_total - event.deposit_used
|
|
32
|
+
service_total: s.service_total - event.service_charge
|
|
33
|
+
pbjt_total: s.pbjt_total - event.pbjt
|
|
34
|
+
rounding_total: s.rounding_total - event.rounding
|
|
32
35
|
cogs_total: s.cogs_total - event.cogs_total
|
|
33
36
|
void_count: s.void_count + 1
|
|
34
37
|
void_total: s.void_total + event.grand_total
|
|
@@ -8,6 +8,27 @@ label: {id: 'Transaksi kasir dibayar: tambah ke sesi kasir'}
|
|
|
8
8
|
on: pos_sale.submitted
|
|
9
9
|
steps:
|
|
10
10
|
- {find: pos_shift, where: name == event.shift && state == 'open', as: s}
|
|
11
|
+
# only a store sells (rangka-apps#104): a device event turns the sale's own rules (sale_at_store) into exceptions,
|
|
12
|
+
# so the store check is repeated here, where a guard still refuses
|
|
13
|
+
- {find: outlet, if: device.event, where: name == event.outlet, as: so}
|
|
14
|
+
- if: device.event && so != null && so.location_type != '' && so.location_type != 'store'
|
|
15
|
+
create: pos_guard
|
|
16
|
+
set: {reason: "'not_a_store'", document: event.name}
|
|
17
|
+
# A device event also turns rules outlet_of_shift (outlet == shift.outlet) and own_shift into exceptions, so a sale
|
|
18
|
+
# could add to another outlet's or another cashier's head-office drawer and book a false shortage at its close. The
|
|
19
|
+
# shift is read whatever its state (a closed one is still not this device's to link). The kernel already refuses a
|
|
20
|
+
# shift made on another device (deviceLinks, shift_other_device); what is left is a shift made without a device.
|
|
21
|
+
- {find: pos_shift, if: device.event, where: name == event.shift, as: ds}
|
|
22
|
+
- if: device.event && ds != null && (ds.outlet != event.outlet || (device.outlet != '' && ds.outlet != device.outlet))
|
|
23
|
+
create: pos_guard
|
|
24
|
+
set: {reason: "'shift_other_outlet'", document: ds.name}
|
|
25
|
+
# Own shift on a device: one this device opened (its name carries the device code, contract 0058 §3; a cashier switch
|
|
26
|
+
# keeps selling on it) or one the same cashier opened.
|
|
27
|
+
- if: >-
|
|
28
|
+
device.event && ds != null && ds.cashier != user.email
|
|
29
|
+
&& !(so != null && ds.name.startsWith('SESI-' + so.code + '-' + device.code + '-'))
|
|
30
|
+
create: pos_guard
|
|
31
|
+
set: {reason: "'shift_not_own'", document: ds.name}
|
|
11
32
|
# Jalur A and B never on the same outlet and day: a daily sales record (form, Moka, POS file) of this outlet and day
|
|
12
33
|
# refuses the receipt (and flow pos_daily_form_guard refuses the record after a receipt), whatever sales_source says
|
|
13
34
|
- find_all: outlet_sales
|
|
@@ -45,7 +66,10 @@ steps:
|
|
|
45
66
|
- if: day != null && day.source == ''
|
|
46
67
|
update: day
|
|
47
68
|
set: {source: "'kasir'", document: event.name}
|
|
48
|
-
|
|
69
|
+
# A receipt a paired device sends from its queue (device.event) was already paid at the outlet (rangka-os contract
|
|
70
|
+
# 0058 §10): a shift head office closed meanwhile does not refuse it (rule shift_open becomes a rule_overridden exception for head office) and the
|
|
71
|
+
# closed shift's totals stay as counted.
|
|
72
|
+
- if: s == null && !device.event
|
|
49
73
|
create: pos_guard
|
|
50
74
|
set: {reason: "'shift_closed'", document: event.name}
|
|
51
75
|
- update: s
|
|
@@ -58,4 +82,7 @@ steps:
|
|
|
58
82
|
cash_total: s.cash_total + event.cash_amount
|
|
59
83
|
qris_total: s.qris_total + event.qris_amount
|
|
60
84
|
deposit_total: s.deposit_total + event.deposit_used
|
|
85
|
+
service_total: s.service_total + event.service_charge
|
|
86
|
+
pbjt_total: s.pbjt_total + event.pbjt
|
|
87
|
+
rounding_total: s.rounding_total + event.rounding
|
|
61
88
|
cogs_total: s.cogs_total + event.cogs_total
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/flow.json
|
|
2
|
+
# Split an open bill by line (rangka-apps#122). The cashier lists the line keys to move in split_lines; this flow runs
|
|
3
|
+
# inside that write: the new bill (split_of set) takes those lines on the same table, the old bill keeps the rest and
|
|
4
|
+
# split_lines is cleared so the flow cannot run twice. The two bills add up to the original: lines move whole, with their
|
|
5
|
+
# own discounts, and the lines the kitchen already got stay recorded under their keys on the bill they moved to. At
|
|
6
|
+
# least one line must stay, and a bill with a promo, a member or a deposit picked is not split (those amounts belong to
|
|
7
|
+
# the whole bill). An amended copy (a return) is not split. Stock moves only at payment, once per paid bill. The new bill
|
|
8
|
+
# takes the old bill's order_type, so each bill computes its own service charge, PBJT and rounding (rangka-apps#121).
|
|
9
|
+
name: pos_sale_split
|
|
10
|
+
label: {id: 'Pisah tagihan meja per barang'}
|
|
11
|
+
description: {id: 'Barang yang dipilih pindah ke tagihan baru di meja yang sama; sisanya tetap di tagihan lama'}
|
|
12
|
+
on: pos_sale.updated
|
|
13
|
+
if: "event.docstatus == 0 && event.split_lines.size() > 0"
|
|
14
|
+
steps:
|
|
15
|
+
- {find: pos_sale, where: "name == event.name", as: src}
|
|
16
|
+
- if: "event.table == '' || (has(event.amended_from) && event.amended_from != '') || event.merged || event.items.filter(l, !(l.line_key in event.split_lines)).size() == 0 || event.items.filter(l, l.line_key in event.split_lines).size() == 0 || event.promotion != '' || event.member != '' || event.points_redeemed > 0 || event.deposit_used > 0"
|
|
17
|
+
create: pos_guard
|
|
18
|
+
set: {reason: "'split_invalid'", document: event.name}
|
|
19
|
+
- if: "event.table != '' && (!has(event.amended_from) || event.amended_from == '') && !event.merged && event.items.filter(l, !(l.line_key in event.split_lines)).size() > 0 && event.items.filter(l, l.line_key in event.split_lines).size() > 0 && event.promotion == '' && event.member == '' && event.points_redeemed == 0 && event.deposit_used == 0"
|
|
20
|
+
then:
|
|
21
|
+
- create: pos_sale
|
|
22
|
+
set:
|
|
23
|
+
shift: event.shift
|
|
24
|
+
outlet: event.outlet
|
|
25
|
+
date: event.date
|
|
26
|
+
table: event.table
|
|
27
|
+
order_type: event.order_type
|
|
28
|
+
guests: "1"
|
|
29
|
+
split_of: event.name
|
|
30
|
+
items: "event.items.filter(l, l.line_key in event.split_lines).map(l, {'item': l.item, 'packing': l.packing, 'qty': l.qty, 'discount_pct': l.discount_pct, 'description': l.description, 'note': l.note, 'is_gift': l.is_gift, 'line_key': l.line_key})"
|
|
31
|
+
sent_to_kitchen: "event.sent_to_kitchen.filter(s, s.key in event.split_lines)"
|
|
32
|
+
- update: src
|
|
33
|
+
set:
|
|
34
|
+
items: "event.items.filter(l, !(l.line_key in event.split_lines)).map(l, {'item': l.item, 'packing': l.packing, 'qty': l.qty, 'discount_pct': l.discount_pct, 'description': l.description, 'note': l.note, 'is_gift': l.is_gift, 'line_key': l.line_key})"
|
|
35
|
+
sent_to_kitchen: "event.sent_to_kitchen.filter(s, !(s.key in event.split_lines))"
|
|
36
|
+
split_lines: "[]"
|
|
37
|
+
rev: event.rev + 1
|
|
@@ -7,6 +7,11 @@ label: {id: 'Sesi kasir dibuka: hanya satu sesi terbuka per kasir per outlet'}
|
|
|
7
7
|
on: pos_shift.created
|
|
8
8
|
steps:
|
|
9
9
|
- {find: outlet, where: name == event.outlet, as: o}
|
|
10
|
+
# only a store sells (rangka-apps#104, rule shift_at_store): repeated here because a paired device's write turns the
|
|
11
|
+
# shift's own rules into exceptions (rangka-os contract 0058 §10), while a guard a flow writes still refuses
|
|
12
|
+
- if: o != null && o.location_type != '' && o.location_type != 'store'
|
|
13
|
+
create: pos_guard
|
|
14
|
+
set: {reason: "'not_a_store'", document: event.name}
|
|
10
15
|
- if: o != null && o.cash_float > 0 && event.opening_cash != o.cash_float
|
|
11
16
|
create: pos_guard
|
|
12
17
|
set: {reason: "'float_of_outlet'", document: event.name}
|
|
@@ -14,7 +19,10 @@ steps:
|
|
|
14
19
|
where: outlet == event.outlet && cashier == event.cashier && state == 'open' && name != event.name
|
|
15
20
|
limit: 1
|
|
16
21
|
as: open
|
|
17
|
-
|
|
22
|
+
# a shift a paired device opened offline (device.event) already took sales at the outlet: a second open shift of the
|
|
23
|
+
# same cashier is accepted then (rangka-os contract 0058 §6, one shift per cashier per device); refusing it would
|
|
24
|
+
# refuse every receipt queued on it
|
|
25
|
+
- if: open.size() > 0 && !device.event
|
|
18
26
|
create: pos_guard
|
|
19
27
|
set:
|
|
20
28
|
reason: "'shift_already_open'"
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/flow.json
|
|
2
|
+
# The create half of pos_table_guard: a new bill on a table that already has an open bill is refused. Every open bill
|
|
3
|
+
# counts, a split child included. A bill made by the split flow (split_of set, a read-only field only that flow writes)
|
|
4
|
+
# shares its table on purpose and is not guarded. A copy with amended_from (a voided receipt paid again, a partial return)
|
|
5
|
+
# is not a table bill any more: its table is cleared. Amend itself runs no created flows, so pos_table_guard_on_update
|
|
6
|
+
# clears it on the copy's first write and the table map and the guards never count an amended copy as an open bill;
|
|
7
|
+
# this branch covers a copy created with amended_from (a device write that keeps its name).
|
|
8
|
+
name: pos_table_guard_on_create
|
|
9
|
+
label: {id: 'Satu tagihan terbuka per meja (tagihan baru)'}
|
|
10
|
+
description: {id: 'Tagihan baru di meja yang sudah punya tagihan terbuka ditolak'}
|
|
11
|
+
on: pos_sale.created
|
|
12
|
+
if: "event.docstatus == 0 && event.table != '' && event.split_of == ''"
|
|
13
|
+
steps:
|
|
14
|
+
- if: "has(event.amended_from) && event.amended_from != ''"
|
|
15
|
+
then:
|
|
16
|
+
- {find: pos_sale, where: "name == event.name", as: self}
|
|
17
|
+
- update: self
|
|
18
|
+
set: {table: "''", bill_asked: "false", send_kitchen: "false"}
|
|
19
|
+
- if: "!has(event.amended_from) || event.amended_from == ''"
|
|
20
|
+
then:
|
|
21
|
+
- {find_all: pos_sale, where: "table == event.table && docstatus == 0 && !merged && amended_from == '' && name != event.name", limit: 1, as: others}
|
|
22
|
+
- if: others.size() > 0
|
|
23
|
+
create: pos_guard
|
|
24
|
+
set: {reason: "'table_busy'", document: event.name}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/flow.json
|
|
2
|
+
# The update half of pos_table_guard: moving an open bill onto a table that already has an open bill is refused. It runs
|
|
3
|
+
# only when the table changes (event.before), so a bill and its split child sharing a table on purpose can still be
|
|
4
|
+
# edited, while any bill moved onto a busy table is refused, a split child included. A merged bill never sits on a
|
|
5
|
+
# table (rule merged_no_table). An amended copy of a paid bill (amended_from set; amend copies the table) is a return,
|
|
6
|
+
# not an open bill: its first write clears the table, and it is never counted as the table's open bill.
|
|
7
|
+
name: pos_table_guard_on_update
|
|
8
|
+
label: {id: 'Satu tagihan terbuka per meja (pindah meja)'}
|
|
9
|
+
description: {id: 'Pindah ke meja yang sudah punya tagihan terbuka ditolak'}
|
|
10
|
+
on: pos_sale.updated
|
|
11
|
+
if: "event.docstatus == 0 && event.table != ''"
|
|
12
|
+
steps:
|
|
13
|
+
- if: "has(event.amended_from) && event.amended_from != ''"
|
|
14
|
+
then:
|
|
15
|
+
- {find: pos_sale, where: "name == event.name", as: self}
|
|
16
|
+
- update: self
|
|
17
|
+
set: {table: "''", bill_asked: "false", send_kitchen: "false"}
|
|
18
|
+
- if: "(!has(event.amended_from) || event.amended_from == '') && (event.before == null || event.before.table != event.table)"
|
|
19
|
+
then:
|
|
20
|
+
- {find_all: pos_sale, where: "table == event.table && docstatus == 0 && !merged && amended_from == '' && name != event.name", limit: 1, as: others}
|
|
21
|
+
- if: others.size() > 0
|
|
22
|
+
create: pos_guard
|
|
23
|
+
set: {reason: "'table_busy'", document: event.name}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/model.json
|
|
2
|
+
# A section of an outlet's floor (Dalam, Teras, Lantai 2): the table map groups its tables by area.
|
|
3
|
+
name: dining_area
|
|
4
|
+
label: {id: Area meja, en: Dining area}
|
|
5
|
+
icon: stock
|
|
6
|
+
naming: ARM-{###}
|
|
7
|
+
title_field: area_name
|
|
8
|
+
permissions:
|
|
9
|
+
- {role: head_office, read: true, create: true, write: true, delete: true}
|
|
10
|
+
# the cashier reads the areas to see the map
|
|
11
|
+
- {role: cashier, read: true}
|
|
12
|
+
- {role: outlet_staff, read: true}
|
|
13
|
+
fields:
|
|
14
|
+
- {name: area_name, type: data, label: {id: Nama area}, help: {id: 'Misalnya Dalam, Teras, Lantai 2'}, required: true, in_list: true}
|
|
15
|
+
- {name: outlet, type: link, to: outlet, label: {id: Outlet}, required: true, in_list: true}
|
|
16
|
+
- {name: sort, type: int, label: {id: Urutan}, default: '0'}
|
|
17
|
+
# one area of a name per outlet
|
|
18
|
+
- {name: area_key, type: data, label: {id: Kunci area}, hidden: true, unique: true, compute: "outlet + '/' + area_name"}
|
|
19
|
+
views:
|
|
20
|
+
list:
|
|
21
|
+
columns: [area_name, outlet, sort]
|
|
22
|
+
filters: [outlet]
|
|
23
|
+
sort: sort
|
|
@@ -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,6 +6,9 @@
|
|
|
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
|
|
@@ -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]
|