@rangka-os/create 0.5.0-alpha.17 → 0.5.0-alpha.19
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/grosir_distribusi/app.rk +1 -1
- package/template/base/apps/grosir_distribusi/dashboards/grosir_ar.rk +4 -0
- package/template/base/apps/grosir_distribusi/dashboards/grosir_overview.rk +4 -0
- package/template/base/apps/grosir_distribusi/dashboards/gudang_harian.rk +33 -0
- package/template/base/apps/grosir_distribusi/dashboards/salesman_harian.rk +51 -0
- package/template/base/modules/accounting/flows/gl_payment_post.rk +4 -4
- package/template/base/modules/accounting/models/gl_entry.rk +6 -3
- package/template/base/modules/accounting/module.rk +1 -1
- package/template/base/modules/catalogue/models/item.rk +2 -0
- package/template/base/modules/catalogue/module.rk +1 -1
- package/template/base/modules/contacts/models/customer.rk +25 -0
- package/template/base/modules/contacts/models/vendor.rk +8 -1
- package/template/base/modules/contacts/module.rk +1 -1
- package/template/base/modules/courses/flows/charge_invoice_on_submit.rk +1 -0
- package/template/base/modules/courses/module.rk +2 -2
- package/template/base/modules/delivery/models/delivery_note.rk +1 -1
- package/template/base/modules/delivery/models/delivery_note_item.rk +1 -1
- package/template/base/modules/delivery/module.rk +1 -1
- package/template/base/modules/invoicing/models/sales_invoice.rk +44 -5
- package/template/base/modules/invoicing/module.rk +1 -1
- package/template/base/modules/outlet_sales/flows/outlet_day_backfill_harian.rk +71 -0
- package/template/base/modules/outlet_sales/flows/outlet_day_free_sales.rk +19 -0
- package/template/base/modules/outlet_sales/flows/outlet_day_free_takings.rk +19 -0
- package/template/base/modules/outlet_sales/flows/outlet_day_on_sales.rk +19 -0
- package/template/base/modules/outlet_sales/flows/outlet_day_on_takings.rk +19 -0
- package/template/base/modules/outlet_sales/models/outlet_sales.rk +2 -0
- package/template/base/modules/outlet_sales/models/outlet_sales_guard.rk +5 -0
- package/template/base/modules/outlet_sales/models/outlet_sales_line.rk +1 -0
- package/template/base/modules/outlet_sales/module.rk +2 -2
- package/template/base/modules/outlets/models/outlet_day.rk +30 -0
- package/template/base/modules/outlets/models/outlet_day_backfill.rk +25 -0
- package/template/base/modules/outlets/module.rk +1 -1
- package/template/base/modules/payroll/flows/payroll_close_on_submit.rk +2 -2
- package/template/base/modules/payroll/module.rk +1 -1
- package/template/base/modules/pos/flows/outlet_day_backfill_kasir.rk +61 -0
- package/template/base/modules/pos/flows/pos_sale_on_cancel.rk +9 -0
- package/template/base/modules/pos/flows/pos_sale_on_submit.rk +16 -2
- package/template/base/modules/pos/models/pos_sale.rk +3 -0
- package/template/base/modules/pos/models/pos_sale_item.rk +1 -1
- package/template/base/modules/pos/module.rk +2 -2
- package/template/base/modules/procurement/models/purchase_order.rk +7 -1
- package/template/base/modules/procurement/models/purchase_request.rk +1 -0
- package/template/base/modules/procurement/models/purchase_request_item.rk +2 -0
- package/template/base/modules/procurement/models/vendor_bill.rk +7 -1
- package/template/base/modules/procurement/module.rk +1 -1
- package/template/base/modules/production/models/bom.rk +3 -2
- package/template/base/modules/production/models/bom_line.rk +2 -2
- package/template/base/modules/production/models/production_batch.rk +6 -5
- package/template/base/modules/production/models/production_material.rk +1 -1
- package/template/base/modules/production/module.rk +1 -1
- package/template/base/modules/quotation/models/quotation.rk +6 -0
- package/template/base/modules/quotation/module.rk +1 -1
- package/template/base/modules/stock/models/stock_adjustment_value.rk +1 -0
- package/template/base/modules/stock/models/stock_balance.rk +2 -2
- package/template/base/modules/stock/models/stock_move.rk +5 -5
- package/template/base/modules/stock/models/stock_transfer_item.rk +1 -1
- package/template/base/modules/stock/module.rk +1 -1
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/flow.json
|
|
2
|
+
# One sales source per outlet and day, kept in outlets/outlet_day so it holds when the cashier app is removed (audit
|
|
3
|
+
# rangka-apps#74 L1); the cashier's own guards (module pos) stay as they are.
|
|
4
|
+
name: outlet_day_on_sales
|
|
5
|
+
label: {id: 'Penjualan harian diajukan: hari itu milik penjualan harian'}
|
|
6
|
+
on: outlet_sales.submitted
|
|
7
|
+
steps:
|
|
8
|
+
- {find: outlet_day, where: outlet == event.outlet && date == event.date, as: day}
|
|
9
|
+
# with the cashier installed its own guards (pos_daily_form_guard, pos_takings_guard) refuse first, with their reasons;
|
|
10
|
+
# this one holds the day once the cashier app is removed
|
|
11
|
+
- if: day != null && day.source == 'kasir' && !app_installed('pos')
|
|
12
|
+
create: outlet_sales_guard
|
|
13
|
+
set: {reason: "'cashier_same_day'", document: day.document}
|
|
14
|
+
- if: day == null
|
|
15
|
+
create: outlet_day
|
|
16
|
+
set: {outlet: event.outlet, date: event.date, source: "'harian'", document: event.name, day_key: "event.outlet + '|' + string(event.date)"}
|
|
17
|
+
- if: day != null && day.source == ''
|
|
18
|
+
update: day
|
|
19
|
+
set: {source: "'harian'", document: event.name}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/flow.json
|
|
2
|
+
# One sales source per outlet and day, kept in outlets/outlet_day so it holds when the cashier app is removed (audit
|
|
3
|
+
# rangka-apps#74 L1); the cashier's own guards (module pos) stay as they are.
|
|
4
|
+
name: outlet_day_on_takings
|
|
5
|
+
label: {id: 'Setoran harian diajukan: hari itu milik penjualan harian'}
|
|
6
|
+
on: outlet_takings.submitted
|
|
7
|
+
steps:
|
|
8
|
+
- {find: outlet_day, where: outlet == event.outlet && date == event.date, as: day}
|
|
9
|
+
# with the cashier installed its own guards (pos_daily_form_guard, pos_takings_guard) refuse first, with their reasons;
|
|
10
|
+
# this one holds the day once the cashier app is removed
|
|
11
|
+
- if: day != null && day.source == 'kasir' && !app_installed('pos')
|
|
12
|
+
create: outlet_sales_guard
|
|
13
|
+
set: {reason: "'cashier_same_day'", document: day.document}
|
|
14
|
+
- if: day == null
|
|
15
|
+
create: outlet_day
|
|
16
|
+
set: {outlet: event.outlet, date: event.date, source: "'harian'", document: event.name, day_key: "event.outlet + '|' + string(event.date)"}
|
|
17
|
+
- if: day != null && day.source == ''
|
|
18
|
+
update: day
|
|
19
|
+
set: {source: "'harian'", document: event.name}
|
|
@@ -105,11 +105,13 @@ fields:
|
|
|
105
105
|
help: {id: 'Diisi sistem saat diajukan: bahan resep x rata-rata biaya'}
|
|
106
106
|
read_only: true
|
|
107
107
|
in_list: true
|
|
108
|
+
hidden_for: [cashier, outlet_staff]
|
|
108
109
|
- name: margin
|
|
109
110
|
type: currency
|
|
110
111
|
label: {id: Margin}
|
|
111
112
|
compute: net_total - cogs_total
|
|
112
113
|
in_list: true
|
|
114
|
+
hidden_for: [cashier, outlet_staff]
|
|
113
115
|
# Monthly tax recap (no file): a PKP shop's sales prices include PPN, so the PPN inside net sales is
|
|
114
116
|
# net x rate x dpp / (100 + rate x dpp) (Digunggung amounts). The 0,5% final PPh of PP 55/2022 depends on turnover
|
|
115
117
|
# (up to Rp 4,8 miliar a year), not on PKP status, so it is shown for every shop on turnover without PPN; a shop
|
|
@@ -19,6 +19,7 @@ fields:
|
|
|
19
19
|
- {value: sales_returned, label: {id: Penjualan sudah dikembalikan ke stok}}
|
|
20
20
|
- {value: over_returned, label: {id: Retur melebihi yang diretur di kasir}}
|
|
21
21
|
- {value: sales_cancelled, label: {id: Penjualan sudah dibatalkan}}
|
|
22
|
+
- {value: cashier_same_day, label: {id: Outlet sudah memakai kasir di tanggal itu}}
|
|
22
23
|
- {name: document, type: data, label: {id: Dokumen}}
|
|
23
24
|
rules:
|
|
24
25
|
- name: sales_returned
|
|
@@ -33,3 +34,7 @@ rules:
|
|
|
33
34
|
on: save
|
|
34
35
|
check: reason != 'sales_cancelled'
|
|
35
36
|
message: {id: 'Penjualan ini baru saja dibatalkan; retur ke stok dari penjualan yang batal tidak bisa diajukan'}
|
|
37
|
+
- name: cashier_same_day
|
|
38
|
+
on: save
|
|
39
|
+
check: reason != 'cashier_same_day'
|
|
40
|
+
message: {id: 'Outlet ini sudah memakai kasir di tanggal itu: satu sumber penjualan per hari; batalkan struk kasirnya dulu'}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/module.json
|
|
2
2
|
name: outlet_sales
|
|
3
|
-
version: 1.
|
|
3
|
+
version: 1.5.2
|
|
4
4
|
title: {id: Penjualan outlet, en: Outlet sales}
|
|
5
5
|
summary:
|
|
6
6
|
id: Rekap penjualan harian per outlet, setoran kas dan retur di kasir.
|
|
7
7
|
en: Daily sales per outlet, cash deposits and returns at the till.
|
|
8
8
|
category: sales
|
|
9
9
|
icon: store-2-line
|
|
10
|
-
requires: {rangka: '>=0.5', users: ^1.0, outlets: ^1.
|
|
10
|
+
requires: {rangka: '>=0.5', users: ^1.0, outlets: ^1.4, catalogue: ^1.0, stock: ^1.1}
|
|
11
11
|
# Semantics fixed in docs/kernel-hooks.md (section stock): submitting posts the stock moves through the recipes.
|
|
12
12
|
hooks: [stock.reverse_moves]
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/model.json
|
|
2
|
+
# One sales source per outlet and day (Jalur A: a daily sales record or setoran; Jalur B: the cashier). The guards of
|
|
3
|
+
# pos and outlet_sales read and write this record, which lives in outlets: it stays installed with either source, so
|
|
4
|
+
# the day keeps its source when one of the two apps is removed mid-day (audit rangka-apps#74 L1: removing
|
|
5
|
+
# outlet_sales let the cashier record a day that already had a daily sales record). Written by flows only; source ''
|
|
6
|
+
# means every document of that day was cancelled, the day is free again. Every field is read_only: a person cannot
|
|
7
|
+
# create, clear or duplicate a marker through the API (the kernel drops read_only input), flows still write them
|
|
8
|
+
# (audit #77 F1/F2); create/write stay granted because a flow's step runs with its caller's permissions.
|
|
9
|
+
name: outlet_day
|
|
10
|
+
label: {id: Sumber penjualan harian outlet, en: Outlet day sales source}
|
|
11
|
+
icon: calendar-check
|
|
12
|
+
naming: ODY-{######}
|
|
13
|
+
title_field: day_key
|
|
14
|
+
permissions:
|
|
15
|
+
- {role: head_office, read: true, create: true, write: true}
|
|
16
|
+
- {role: outlet_staff, read: true, create: true, write: true}
|
|
17
|
+
- {role: cashier, read: true, create: true, write: true}
|
|
18
|
+
fields:
|
|
19
|
+
- {name: outlet, type: link, to: outlet, label: {id: Outlet}, required: true, read_only: true}
|
|
20
|
+
- {name: date, type: date, label: {id: Tanggal}, required: true, read_only: true}
|
|
21
|
+
- name: source
|
|
22
|
+
type: select
|
|
23
|
+
label: {id: Sumber}
|
|
24
|
+
read_only: true
|
|
25
|
+
options:
|
|
26
|
+
- {value: harian, label: {id: 'Penjualan harian (form, Moka, file) atau setoran'}}
|
|
27
|
+
- {value: kasir, label: {id: Kasir}}
|
|
28
|
+
- {name: document, type: data, label: {id: Dokumen pertama}, read_only: true}
|
|
29
|
+
# outlet|date, once per outlet and day (two sources at the same moment: the second write fails and rolls back)
|
|
30
|
+
- {name: day_key, type: data, label: {id: Kunci hari}, required: true, unique: true, read_only: true}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/model.json
|
|
2
|
+
# Done marker of the outlet_day backfill flows (audit rangka-apps#79 F1): one row per source (kasir from pos, harian
|
|
3
|
+
# from outlet_sales), written by the backfill flow in the run that finds no unmarked day left. Every later run reads
|
|
4
|
+
# this row by its key (one indexed row) and skips the scan of the receipts or daily records, so a finished backfill
|
|
5
|
+
# no longer holds the payment locks every 5 minutes. Days after the backfill are marked by the live flows
|
|
6
|
+
# (pos_sale_on_submit, outlet_day_on_sales, outlet_day_on_takings). Every field is read_only, like outlet_day.
|
|
7
|
+
name: outlet_day_backfill
|
|
8
|
+
label: {id: Status pelengkapan sumber penjualan harian, en: Outlet day backfill status}
|
|
9
|
+
icon: history-line
|
|
10
|
+
title_field: key
|
|
11
|
+
permissions:
|
|
12
|
+
- {role: head_office, read: true, create: true, write: true}
|
|
13
|
+
fields:
|
|
14
|
+
- name: key
|
|
15
|
+
type: select
|
|
16
|
+
label: {id: Sumber}
|
|
17
|
+
required: true
|
|
18
|
+
unique: true
|
|
19
|
+
read_only: true
|
|
20
|
+
options:
|
|
21
|
+
- {value: kasir, label: {id: Kasir}}
|
|
22
|
+
- {value: harian, label: {id: 'Penjualan harian (form, Moka, file) atau setoran'}}
|
|
23
|
+
- {name: done, type: check, label: {id: Selesai}, read_only: true}
|
|
24
|
+
# the kasir backfill walks back in windows of days (card t_0dba5917): days before this date are still to check
|
|
25
|
+
- {name: before, type: date, label: {id: Belum diperiksa sebelum}, read_only: true}
|
|
@@ -41,7 +41,7 @@ steps:
|
|
|
41
41
|
event.billing_mode == 'fee_only' ? [{'item': event.fee_item, 'description': 'Management fee', 'qty': 1, 'rate': event.fee_amount, 'pph23_exclude': false}] : [{'item': event.wage_item, 'description': 'Gaji, tunjangan, lembur dan THR tenaga kerja', 'qty': 1, 'rate': event.total_cash_gross, 'pph23_exclude': true, 'ppn_exclude': true},
|
|
42
42
|
{'item': event.bpjs_item, 'description': 'Iuran BPJS Ketenagakerjaan dan Kesehatan bagian perusahaan', 'qty': 1, 'rate': event.total_employer_bpjs, 'pph23_exclude': false},
|
|
43
43
|
{'item': event.fee_item, 'description': 'Management fee', 'qty': 1, 'rate': event.fee_amount, 'pph23_exclude': false}]
|
|
44
|
-
- if: event.billing_mode == 'wages_plus_fee' && old == null
|
|
44
|
+
- if: event.billing_mode != 'none' && event.billing_mode == 'wages_plus_fee' && old == null
|
|
45
45
|
create: sales_invoice
|
|
46
46
|
set:
|
|
47
47
|
customer: event.customer
|
|
@@ -54,7 +54,7 @@ steps:
|
|
|
54
54
|
[{'item': event.wage_item, 'description': 'Gaji, tunjangan, lembur dan THR tenaga kerja', 'qty': 1, 'rate': event.total_cash_gross, 'pph23_exclude': true, 'ppn_exclude': true},
|
|
55
55
|
{'item': event.bpjs_item, 'description': 'Iuran BPJS Ketenagakerjaan dan Kesehatan bagian perusahaan', 'qty': 1, 'rate': event.total_employer_bpjs, 'pph23_exclude': false},
|
|
56
56
|
{'item': event.fee_item, 'description': 'Management fee', 'qty': 1, 'rate': event.fee_amount, 'pph23_exclude': false}]
|
|
57
|
-
- if: event.billing_mode == 'fee_only' && old == null
|
|
57
|
+
- if: event.billing_mode != 'none' && event.billing_mode == 'fee_only' && old == null
|
|
58
58
|
create: sales_invoice
|
|
59
59
|
set:
|
|
60
60
|
customer: event.customer
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/flow.json
|
|
2
|
+
# Backfill of outlets/outlet_day for days submitted before it existed (audit rangka-apps#77 F3): the kernel has no
|
|
3
|
+
# migrate hook for .rk, so the run walks back through the days in windows of 30, newest first (card t_0dba5917, audit
|
|
4
|
+
# rangka-apps#79 R2-1: reading every receipt per run grew with the history). The first run records the start in
|
|
5
|
+
# outlet_day_backfill key kasir (before = tomorrow). Every later run checks, for each outlet and each day of the window
|
|
6
|
+
# below `before`, the first submitted receipt of that outlet and day (an SQL read on outlet, date and docstatus, kernel
|
|
7
|
+
# date pushdown, pos_sale.date indexed; first by number, STRK-<outlet>-<YYMM>-<n> is padded) and its marker (day_key,
|
|
8
|
+
# unique); a day without a marker gets one with source kasir and that receipt (audit #79 R2-3). A day already marked
|
|
9
|
+
# (any source, also one freed by a cancel) is left as it is, so the run is safe to repeat and a day never gets two
|
|
10
|
+
# markers. Then `before` moves back 30 days; the run that finds no submitted receipt before it records done, and from
|
|
11
|
+
# then on a run reads only that one row (audit #79 F1). A receipt without an outlet has no day to mark and does not hold
|
|
12
|
+
# the walk back (audit #79 F5), nor does a receipt without a date (audit t_0dba5917 B2).
|
|
13
|
+
name: outlet_day_backfill_kasir
|
|
14
|
+
label: {id: 'Lengkapi sumber penjualan harian dari struk kasir lama'}
|
|
15
|
+
schedule: '*/5 * * * *'
|
|
16
|
+
steps:
|
|
17
|
+
- find: outlet_day_backfill
|
|
18
|
+
where: "key == 'kasir'"
|
|
19
|
+
as: st
|
|
20
|
+
- create: outlet_day_backfill
|
|
21
|
+
if: "st == null"
|
|
22
|
+
set:
|
|
23
|
+
key: "'kasir'"
|
|
24
|
+
before: "today() + duration(1)"
|
|
25
|
+
done: "false"
|
|
26
|
+
- find_all: outlet
|
|
27
|
+
if: "st != null && !st.done"
|
|
28
|
+
as: outlets
|
|
29
|
+
- for_each: "[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30].map(i, st.before - duration(i))"
|
|
30
|
+
if: "st != null && !st.done"
|
|
31
|
+
as: d
|
|
32
|
+
do:
|
|
33
|
+
- for_each: "outlets"
|
|
34
|
+
as: o
|
|
35
|
+
do:
|
|
36
|
+
- find_all: pos_sale
|
|
37
|
+
where: "docstatus == 1 && outlet == o.name && date == d"
|
|
38
|
+
sort: name
|
|
39
|
+
limit: 1
|
|
40
|
+
as: r
|
|
41
|
+
- find: outlet_day
|
|
42
|
+
if: "size(r) > 0"
|
|
43
|
+
where: "day_key == o.name + '|' + d"
|
|
44
|
+
as: k
|
|
45
|
+
- create: outlet_day
|
|
46
|
+
if: "size(r) > 0 && k == null"
|
|
47
|
+
set:
|
|
48
|
+
outlet: "o.name"
|
|
49
|
+
date: "d"
|
|
50
|
+
source: "'kasir'"
|
|
51
|
+
document: "r[0].name"
|
|
52
|
+
day_key: "o.name + '|' + d"
|
|
53
|
+
- find: pos_sale
|
|
54
|
+
if: "st != null && !st.done"
|
|
55
|
+
where: "docstatus == 1 && date != '' && date < st.before - duration(30)"
|
|
56
|
+
as: more
|
|
57
|
+
- update: st
|
|
58
|
+
if: "st != null && !st.done"
|
|
59
|
+
set:
|
|
60
|
+
before: "st.before - duration(30)"
|
|
61
|
+
done: "more == null"
|
|
@@ -31,3 +31,12 @@ steps:
|
|
|
31
31
|
cogs_total: s.cogs_total - event.cogs_total
|
|
32
32
|
void_count: s.void_count + 1
|
|
33
33
|
void_total: s.void_total + event.grand_total
|
|
34
|
+
# the last receipt of the day voided: the day is free again for a daily sales record (outlet_day, audit #74 L1)
|
|
35
|
+
- find_all: pos_sale
|
|
36
|
+
where: outlet == event.outlet && date == event.date && docstatus == 1
|
|
37
|
+
limit: 1
|
|
38
|
+
as: left
|
|
39
|
+
- {find: outlet_day, where: outlet == event.outlet && date == event.date, as: day}
|
|
40
|
+
- if: day != null && day.source == 'kasir' && left.size() == 0
|
|
41
|
+
update: day
|
|
42
|
+
set: {source: "''", document: "''"}
|
|
@@ -15,7 +15,9 @@ steps:
|
|
|
15
15
|
where: outlet == event.outlet && date == event.date && docstatus == 1
|
|
16
16
|
limit: 1
|
|
17
17
|
as: forms
|
|
18
|
-
|
|
18
|
+
# a site without outlet_sales skips the find above, so forms is never declared: app_installed is checked first
|
|
19
|
+
# (&& stops there); `forms != null` alone read an undeclared name and failed every receipt (host smoke, 13 Nov)
|
|
20
|
+
- if: app_installed('outlet_sales') && forms.size() > 0
|
|
19
21
|
create: pos_guard
|
|
20
22
|
set:
|
|
21
23
|
reason: "'daily_sales_same_day'"
|
|
@@ -26,11 +28,23 @@ steps:
|
|
|
26
28
|
where: outlet == event.outlet && date == event.date && docstatus == 1
|
|
27
29
|
limit: 1
|
|
28
30
|
as: takings
|
|
29
|
-
- if:
|
|
31
|
+
- if: app_installed('outlet_sales') && takings.size() > 0
|
|
30
32
|
create: pos_guard
|
|
31
33
|
set:
|
|
32
34
|
reason: "'daily_sales_same_day'"
|
|
33
35
|
document: takings[0].name
|
|
36
|
+
# one sales source per outlet and day, kept in outlets (installed with either source): a daily sales record or
|
|
37
|
+
# setoran marked the day 'harian', which holds even after the outlet_sales app is removed (audit #74 L1)
|
|
38
|
+
- {find: outlet_day, where: outlet == event.outlet && date == event.date, as: day}
|
|
39
|
+
- if: day != null && day.source == 'harian'
|
|
40
|
+
create: pos_guard
|
|
41
|
+
set: {reason: "'daily_sales_same_day'", document: day.document}
|
|
42
|
+
- if: day == null
|
|
43
|
+
create: outlet_day
|
|
44
|
+
set: {outlet: event.outlet, date: event.date, source: "'kasir'", document: event.name, day_key: "event.outlet + '|' + string(event.date)"}
|
|
45
|
+
- if: day != null && day.source == ''
|
|
46
|
+
update: day
|
|
47
|
+
set: {source: "'kasir'", document: event.name}
|
|
34
48
|
- if: s == null
|
|
35
49
|
create: pos_guard
|
|
36
50
|
set: {reason: "'shift_closed'", document: event.name}
|
|
@@ -41,6 +41,7 @@ fields:
|
|
|
41
41
|
- name: date
|
|
42
42
|
type: date
|
|
43
43
|
label: {id: Tanggal}
|
|
44
|
+
index: true # the outlet_day backfill reads one outlet and day at a time (card t_0dba5917)
|
|
44
45
|
default: today()
|
|
45
46
|
in_list: true
|
|
46
47
|
- name: buyer
|
|
@@ -110,10 +111,12 @@ fields:
|
|
|
110
111
|
label: {id: Harga pokok}
|
|
111
112
|
help: {id: 'Diisi sistem saat dibayar: barang atau bahan resep x rata-rata biaya'}
|
|
112
113
|
read_only: true
|
|
114
|
+
hidden_for: [cashier, outlet_staff]
|
|
113
115
|
- name: margin
|
|
114
116
|
type: currency
|
|
115
117
|
label: {id: Margin}
|
|
116
118
|
compute: grand_total - cogs_total
|
|
119
|
+
hidden_for: [cashier, outlet_staff]
|
|
117
120
|
# Same monthly tax recap as outlet_sales: PPN inside a PKP shop's prices, and the 0,5% final PPh of PP 55/2022.
|
|
118
121
|
- name: ppn_in_sales
|
|
119
122
|
type: currency
|
|
@@ -43,4 +43,4 @@ fields:
|
|
|
43
43
|
label: {id: Jumlah}
|
|
44
44
|
compute: round(qty * rate * (100 - discount_pct) / 100)
|
|
45
45
|
- {name: note, type: data, label: {id: Catatan}, help: {id: 'Misalnya kurang manis, tanpa es'}}
|
|
46
|
-
- {name: cogs, type: currency, label: {id: Harga pokok}, read_only: true}
|
|
46
|
+
- {name: cogs, type: currency, label: {id: Harga pokok}, read_only: true, hidden_for: [cashier, outlet_staff]}
|
|
@@ -1,6 +1,6 @@
|
|
|
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.2.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.
|
|
@@ -17,6 +17,6 @@ icon: shopping-basket-line
|
|
|
17
17
|
# (cancel, then amend without the returned items) only on its own day while its shift is open.
|
|
18
18
|
# Sales of an outlet run either here or through outlet_sales (Jalur A), never both: an outlet whose sales_source is
|
|
19
19
|
# 'kasir' takes no daily form or POS file, and a sale needs that source when outlet_sales is installed.
|
|
20
|
-
requires: {rangka: '>=0.5', users: ^1.2, catalogue: ^1.3, outlets: ^1.
|
|
20
|
+
requires: {rangka: '>=0.5', users: ^1.2, catalogue: ^1.3, outlets: ^1.5, stock: ^1.2}
|
|
21
21
|
hooks: [stock.reverse_moves]
|
|
22
22
|
optional: {accounting: ^1.2, outlet_sales: ^1.1}
|
|
@@ -105,10 +105,16 @@ rules:
|
|
|
105
105
|
on: save
|
|
106
106
|
check: dpp_den > 0 && dpp_num > 0 && dpp_num <= dpp_den && tax_rate >= 0 && tax_rate <= 100
|
|
107
107
|
message: {id: Tarif PPN atau faktor DPP tidak valid}
|
|
108
|
+
# the rate is at most the company's (tax.ppn_rate): lower rates are lawful (PPN besaran tertentu, an earlier
|
|
109
|
+
# statutory 10% or 11%), a higher one only inflates the PPN, e.g. a typed 100% (audit tax-fields N2; card t_81bc5551)
|
|
110
|
+
- name: tax_rate_at_most_config
|
|
111
|
+
on: save
|
|
112
|
+
check: "tax_rate <= tax.ppn_rate"
|
|
113
|
+
message: {id: 'Tarif PPN tidak boleh melebihi tarif di pengaturan pajak usaha. Draft lama: ubah dulu tarifnya ke tarif pengaturan'}
|
|
108
114
|
- name: ppn_needs_pkp
|
|
109
115
|
on: save
|
|
110
116
|
check: vendor.pkp || tax_rate == 0
|
|
111
|
-
message: {id: Pemasok bukan PKP
|
|
117
|
+
message: {id: 'Pemasok bukan PKP: tarif PPN harus 0. Status PKP pemasok diatur pemilik atau bagian keuangan'}
|
|
112
118
|
- name: delivery_after_order
|
|
113
119
|
on: save
|
|
114
120
|
check: delivery_date == '' || delivery_date >= order_date
|
|
@@ -229,10 +229,16 @@ rules:
|
|
|
229
229
|
on: save
|
|
230
230
|
check: dpp_den > 0 && dpp_num > 0 && dpp_num <= dpp_den && tax_rate >= 0 && tax_rate <= 100
|
|
231
231
|
message: {id: Tarif PPN atau faktor DPP tidak valid}
|
|
232
|
+
# the rate is at most the company's (tax.ppn_rate): lower rates are lawful (PPN besaran tertentu, an earlier
|
|
233
|
+
# statutory 10% or 11%), a higher one only inflates the PPN, e.g. a typed 100% (audit tax-fields N2; card t_81bc5551)
|
|
234
|
+
- name: tax_rate_at_most_config
|
|
235
|
+
on: save
|
|
236
|
+
check: "tax_rate <= tax.ppn_rate || (purchase_order != '' && tax_rate == purchase_order.tax_rate)"
|
|
237
|
+
message: {id: 'Tarif PPN tidak boleh melebihi tarif di pengaturan pajak usaha. Draft lama: ubah dulu tarifnya ke tarif pengaturan'}
|
|
232
238
|
- name: ppn_needs_pkp
|
|
233
239
|
on: save
|
|
234
240
|
check: "tax_rate == 0 || (purchase_order != '' ? purchase_order.tax_rate > 0 : vendor.pkp)"
|
|
235
|
-
message: {id: Pemasok bukan PKP (atau PO tanpa PPN)
|
|
241
|
+
message: {id: 'Pemasok bukan PKP (atau PO tanpa PPN): tarif PPN harus 0. Status PKP pemasok diatur pemilik atau bagian keuangan'}
|
|
236
242
|
- name: due_after_bill
|
|
237
243
|
on: save
|
|
238
244
|
check: due_date == '' || due_date >= bill_date
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/module.json
|
|
2
2
|
name: procurement
|
|
3
|
-
version: 1.1.
|
|
3
|
+
version: 1.1.5
|
|
4
4
|
title: {id: Pembelian, en: Procurement}
|
|
5
5
|
summary:
|
|
6
6
|
id: Permintaan dan pesanan pembelian, barang datang dan tagihan pemasok.
|
|
@@ -20,14 +20,15 @@ fields:
|
|
|
20
20
|
- {name: lines, type: table, of: bom_line, label: {id: Bahan}, min_rows: 1}
|
|
21
21
|
- {name: byproducts, type: table, of: bom_byproduct, label: {id: Produk sampingan}}
|
|
22
22
|
- {name: labour_per_unit, type: currency, label: {id: Upah borongan per satuan}, help: {id: Jumlah tarif semua tahap per satuan hasil}}
|
|
23
|
-
- {name: overhead_per_unit, type: currency, label: {id: Overhead per satuan}, help: {id: 'Tarif sederhana: listrik, gas, sewa dibagi hasil sebulan'}}
|
|
24
|
-
- {name: material_cost, type: currency, label: {id: Biaya bahan per batch}, compute: "lines.map(l, l.cost).sum()"}
|
|
23
|
+
- {name: overhead_per_unit, type: currency, label: {id: Overhead per satuan}, help: {id: 'Tarif sederhana: listrik, gas, sewa dibagi hasil sebulan'}, hidden_for: [outlet_staff]}
|
|
24
|
+
- {name: material_cost, type: currency, label: {id: Biaya bahan per batch}, compute: "lines.map(l, l.cost).sum()", hidden_for: [outlet_staff]}
|
|
25
25
|
- {name: byproduct_share, type: float, label: {id: Porsi produk sampingan (%)}, compute: "byproducts.map(b, b.cost_share).sum()"}
|
|
26
26
|
- name: unit_cost
|
|
27
27
|
type: currency
|
|
28
28
|
label: {id: HPP standar per satuan}
|
|
29
29
|
compute: "output_qty > 0 ? round(material_cost * (100 - byproduct_share) / 100 / output_qty) + labour_per_unit + overhead_per_unit : 0"
|
|
30
30
|
in_list: true
|
|
31
|
+
hidden_for: [outlet_staff]
|
|
31
32
|
- {name: notes, type: text, label: {id: Catatan}}
|
|
32
33
|
rules:
|
|
33
34
|
- name: output_positive
|
|
@@ -7,5 +7,5 @@ fields:
|
|
|
7
7
|
- {name: uom, type: link, to: uom, label: {id: Satuan}, default: item.stock_uom}
|
|
8
8
|
- {name: semi_finished, type: check, label: {id: Setengah jadi}, compute: "item.default_bom != ''"}
|
|
9
9
|
# a semi-finished item costs what its own BOM says (rolled up); a raw material its standard cost
|
|
10
|
-
- {name: unit_cost, type: currency, label: {id: Biaya per satuan}, compute: "item.default_bom != '' ? item.default_bom.unit_cost : item.standard_cost"}
|
|
11
|
-
- {name: cost, type: currency, label: {id: Biaya}, compute: round(qty * unit_cost)}
|
|
10
|
+
- {name: unit_cost, type: currency, label: {id: Biaya per satuan}, compute: "item.default_bom != '' ? item.default_bom.unit_cost : item.standard_cost", hidden_for: [outlet_staff]}
|
|
11
|
+
- {name: cost, type: currency, label: {id: Biaya}, compute: round(qty * unit_cost), hidden_for: [outlet_staff]}
|
|
@@ -42,18 +42,19 @@ fields:
|
|
|
42
42
|
- {name: yield_percent, type: float, label: {id: Rendemen aktual (%)}, compute: "planned_qty > 0 ? round(good_qty * 10000 / planned_qty) / 100 : 0"}
|
|
43
43
|
- {name: share_total, type: float, label: {id: Total porsi biaya (%)}, compute: "outputs.map(o, o.cost_share).sum()"}
|
|
44
44
|
- {name: main_share, type: float, label: {id: Porsi biaya produk utama (%)}, compute: "outputs.map(o, o.item == item ? o.cost_share : 0).sum()"}
|
|
45
|
-
- {name: material_cost, type: currency, label: {id: Biaya bahan (aktual)}, read_only: true}
|
|
45
|
+
- {name: material_cost, type: currency, label: {id: Biaya bahan (aktual)}, read_only: true, hidden_for: [outlet_staff]}
|
|
46
46
|
- {name: labour_cost, type: currency, label: {id: Upah borongan}, compute: "labour.map(l, l.amount).sum()"}
|
|
47
|
-
- {name: overhead_rate, type: currency, label: {id: Overhead per satuan}, default: bom.overhead_per_unit}
|
|
48
|
-
- {name: overhead_cost, type: currency, label: {id: Overhead}, compute: round(good_qty * overhead_rate)}
|
|
47
|
+
- {name: overhead_rate, type: currency, label: {id: Overhead per satuan}, default: bom.overhead_per_unit, hidden_for: [outlet_staff]}
|
|
48
|
+
- {name: overhead_cost, type: currency, label: {id: Overhead}, compute: round(good_qty * overhead_rate), hidden_for: [outlet_staff]}
|
|
49
49
|
# The product's share of the materials, plus all wages and overhead (by-products carry only their material share).
|
|
50
50
|
- name: hpp_total
|
|
51
51
|
type: currency
|
|
52
52
|
label: {id: HPP batch (produk utama)}
|
|
53
53
|
compute: "round(material_cost * main_share / 100) + labour_cost + overhead_cost"
|
|
54
54
|
in_list: true
|
|
55
|
-
|
|
56
|
-
- {name:
|
|
55
|
+
hidden_for: [outlet_staff]
|
|
56
|
+
- {name: hpp_per_unit, type: currency, label: {id: HPP per satuan}, compute: "good_qty > 0 ? round(hpp_total / good_qty) : 0", in_list: true, hidden_for: [outlet_staff]}
|
|
57
|
+
- {name: standard_unit_cost, type: currency, label: {id: HPP standar per satuan}, default: bom.unit_cost, read_only: true, hidden_for: [outlet_staff]}
|
|
57
58
|
- {name: notes, type: text, label: {id: Catatan}}
|
|
58
59
|
stock:
|
|
59
60
|
date: production_date
|
|
@@ -5,4 +5,4 @@ fields:
|
|
|
5
5
|
- {name: item, type: link, to: item, label: {id: Bahan}, required: true}
|
|
6
6
|
- {name: qty, type: float, label: {id: Qty terpakai}}
|
|
7
7
|
- {name: uom, type: link, to: uom, label: {id: Satuan}, default: item.stock_uom}
|
|
8
|
-
- {name: cogs, type: currency, label: {id: Biaya bahan}, read_only: true}
|
|
8
|
+
- {name: cogs, type: currency, label: {id: Biaya bahan}, read_only: true, hidden_for: [outlet_staff]}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
# at the value of those materials through the declarative stock block of contract 0021 (K-o). Wages and overhead are
|
|
6
6
|
# in the batch's actual cost (HPP) but not in the stock value until K-r.
|
|
7
7
|
name: production
|
|
8
|
-
version: 1.2.
|
|
8
|
+
version: 1.2.2
|
|
9
9
|
title: {id: Produksi, en: Production}
|
|
10
10
|
summary:
|
|
11
11
|
id: Resep produksi, SPK, hasil per batch dan upah borongan.
|
|
@@ -132,6 +132,12 @@ rules:
|
|
|
132
132
|
on: save
|
|
133
133
|
check: dpp_den > 0 && dpp_num > 0 && dpp_num <= dpp_den && tax_rate >= 0 && tax_rate <= 100
|
|
134
134
|
message: {id: Tarif PPN atau faktor DPP tidak valid}
|
|
135
|
+
# the rate is at most the company's (tax.ppn_rate): lower rates are lawful (PPN besaran tertentu, an earlier
|
|
136
|
+
# statutory 10% or 11%), a higher one only inflates the PPN, e.g. a typed 100% (audit tax-fields N2; card t_81bc5551)
|
|
137
|
+
- name: tax_rate_at_most_config
|
|
138
|
+
on: save
|
|
139
|
+
check: "tax_rate <= tax.ppn_rate"
|
|
140
|
+
message: {id: 'Tarif PPN tidak boleh melebihi tarif di pengaturan pajak usaha. Draft lama: ubah dulu tarifnya ke tarif pengaturan'}
|
|
135
141
|
- name: ppn_needs_pkp
|
|
136
142
|
on: save
|
|
137
143
|
check: tax.pkp || tax_rate == 0
|
|
@@ -13,8 +13,8 @@ fields:
|
|
|
13
13
|
- {name: outlet, type: link, to: outlet, label: {id: Outlet}, required: true, read_only: true, in_list: true}
|
|
14
14
|
- {name: item, type: link, to: item, label: {id: Barang}, required: true, read_only: true, in_list: true}
|
|
15
15
|
- {name: qty, type: float, label: {id: Qty}, read_only: true, in_list: true}
|
|
16
|
-
- {name: value, type: currency, label: {id: Nilai}, read_only: true, in_list: true}
|
|
17
|
-
- {name: avg_cost, type: currency, label: {id: Rata-rata biaya}, read_only: true, in_list: true}
|
|
16
|
+
- {name: value, type: currency, label: {id: Nilai}, read_only: true, in_list: true, hidden_for: [outlet_staff, cashier]}
|
|
17
|
+
- {name: avg_cost, type: currency, label: {id: Rata-rata biaya}, read_only: true, in_list: true, hidden_for: [outlet_staff, cashier]}
|
|
18
18
|
- {name: negative, type: check, label: {id: Stok minus}, compute: qty < 0, in_list: true}
|
|
19
19
|
- {name: last_move, type: data, label: {id: Mutasi terakhir}, read_only: true}
|
|
20
20
|
# Written by stock.post_moves on each sale out of this balance (rangka-os#59); older
|
|
@@ -14,11 +14,11 @@ fields:
|
|
|
14
14
|
- {name: outlet, type: link, to: outlet, label: {id: Outlet}, required: true, read_only: true, in_list: true}
|
|
15
15
|
- {name: item, type: link, to: item, label: {id: Barang}, required: true, read_only: true, in_list: true}
|
|
16
16
|
- {name: qty, type: float, label: {id: 'Qty (+ masuk, - keluar)'}, read_only: true, in_list: true}
|
|
17
|
-
- {name: unit_cost, type: currency, label: {id: Biaya per satuan}, read_only: true}
|
|
18
|
-
- {name: value, type: currency, label: {id: Nilai}, read_only: true, in_list: true}
|
|
17
|
+
- {name: unit_cost, type: currency, label: {id: Biaya per satuan}, read_only: true, hidden_for: [outlet_staff, cashier]}
|
|
18
|
+
- {name: value, type: currency, label: {id: Nilai}, read_only: true, in_list: true, hidden_for: [outlet_staff, cashier]}
|
|
19
19
|
- {name: balance_qty, type: float, label: {id: Saldo qty}, read_only: true, in_list: true}
|
|
20
|
-
- {name: balance_value, type: currency, label: {id: Saldo nilai}, read_only: true}
|
|
21
|
-
- {name: avg_cost, type: currency, label: {id: Rata-rata biaya}, read_only: true}
|
|
20
|
+
- {name: balance_value, type: currency, label: {id: Saldo nilai}, read_only: true, hidden_for: [outlet_staff, cashier]}
|
|
21
|
+
- {name: avg_cost, type: currency, label: {id: Rata-rata biaya}, read_only: true, hidden_for: [outlet_staff, cashier]}
|
|
22
22
|
- {name: negative, type: check, label: {id: Stok minus}, read_only: true, in_list: true}
|
|
23
23
|
- {name: voucher_type, type: data, label: {id: Jenis dokumen}, read_only: true, in_list: true}
|
|
24
24
|
- {name: voucher, type: data, label: {id: Dokumen}, read_only: true, in_list: true}
|
|
@@ -27,7 +27,7 @@ fields:
|
|
|
27
27
|
# cancelled sale nets to zero. A Retur ke stok (outlet_return, contract 0022) counts against them: goods back on the
|
|
28
28
|
# shelf are not sold and their cost leaves HPP, so a unit sold again is not counted (or paid to a consignor) twice.
|
|
29
29
|
- {name: sold_qty, type: float, label: {id: Qty terjual}, compute: "voucher_type == 'outlet_sales' || voucher_type == 'outlet_return' ? -qty : 0"}
|
|
30
|
-
- {name: sold_cost, type: currency, label: {id: Harga pokok terjual}, compute: "voucher_type == 'outlet_sales' || voucher_type == 'outlet_return' ? -value : 0"}
|
|
30
|
+
- {name: sold_cost, type: currency, label: {id: Harga pokok terjual}, compute: "voucher_type == 'outlet_sales' || voucher_type == 'outlet_return' ? -value : 0", hidden_for: [outlet_staff, cashier]}
|
|
31
31
|
- name: reason
|
|
32
32
|
type: select
|
|
33
33
|
label: {id: Sebab}
|
|
@@ -30,5 +30,5 @@ fields:
|
|
|
30
30
|
type: float
|
|
31
31
|
label: {id: Qty stok}
|
|
32
32
|
compute: "packing == '' ? qty : qty * packing.factor"
|
|
33
|
-
- {name: unit_cost, type: currency, read_only: true, label: {id: Biaya per satuan}, help: {id: 'Diisi saat transfer dikirim: rata-rata outlet asal'}}
|
|
33
|
+
- {name: unit_cost, type: currency, read_only: true, label: {id: Biaya per satuan}, help: {id: 'Diisi saat transfer dikirim: rata-rata outlet asal'}, hidden_for: [outlet_staff, cashier]}
|
|
34
34
|
- {name: received_qty, type: float, read_only: true, label: {id: Qty diterima}}
|