@rangka-os/create 0.5.0-alpha.6 → 0.5.0-alpha.8
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 +48 -0
- package/template/base/apps/grosir_distribusi/dashboards/grosir_ar.rk +62 -0
- package/template/base/apps/grosir_distribusi/dashboards/grosir_overview.rk +85 -0
- package/template/base/apps/jasa_proyek/dashboards/jasa_overview.rk +4 -0
- package/template/base/apps/jasa_proyek/dashboards/project_margin.rk +28 -0
- package/template/base/apps/produksi_pabrik/app.rk +46 -0
- package/template/base/apps/produksi_pabrik/dashboards/produksi_overview.rk +96 -0
- package/template/base/apps/produksi_pabrik/dashboards/produksi_upah.rk +39 -0
- package/template/base/modules/catalogue/models/item.rk +22 -0
- package/template/base/modules/catalogue/models/item_category.rk +1 -0
- package/template/base/modules/catalogue/models/uom.rk +1 -0
- package/template/base/modules/catalogue/module.rk +2 -1
- package/template/base/modules/contacts/models/customer.rk +58 -1
- package/template/base/modules/contacts/module.rk +1 -1
- package/template/base/modules/delivery/flows/delivery_cancel_guard.rk +18 -0
- package/template/base/modules/delivery/flows/fulfilment_on_delivery_cancelled.rk +21 -0
- package/template/base/modules/delivery/flows/fulfilment_on_delivery_submitted.rk +21 -0
- package/template/base/modules/delivery/flows/fulfilment_on_invoice_cancelled.rk +22 -0
- package/template/base/modules/delivery/flows/fulfilment_on_invoice_submitted.rk +22 -0
- package/template/base/modules/delivery/flows/fulfilment_on_order_created.rk +18 -0
- package/template/base/modules/delivery/flows/fulfilment_on_order_submitted.rk +16 -0
- package/template/base/modules/delivery/flows/fulfilment_on_order_updated.rk +19 -0
- package/template/base/modules/delivery/flows/fulfilment_on_return_cancelled.rk +16 -0
- package/template/base/modules/delivery/flows/fulfilment_on_return_submitted.rk +16 -0
- package/template/base/modules/delivery/flows/invoice_qty_from_deliveries.rk +20 -0
- package/template/base/modules/delivery/flows/order_cancel_guard.rk +10 -0
- package/template/base/modules/delivery/flows/return_cancel_guard.rk +11 -0
- package/template/base/modules/delivery/flows/return_credit_on_payment_cancelled.rk +11 -0
- package/template/base/modules/delivery/flows/return_credit_on_payment_submitted.rk +21 -0
- package/template/base/modules/delivery/flows/return_credit_on_return_cancelled.rk +11 -0
- package/template/base/modules/delivery/flows/return_credit_on_return_submitted.rk +10 -0
- package/template/base/modules/delivery/models/delivery_guard.rk +48 -0
- package/template/base/modules/delivery/models/delivery_note.rk +94 -0
- package/template/base/modules/delivery/models/delivery_note_item.rk +9 -0
- package/template/base/modules/delivery/models/order_fulfilment.rk +27 -0
- package/template/base/modules/delivery/models/order_fulfilment_item.rk +10 -0
- package/template/base/modules/delivery/models/return_credit.rk +23 -0
- package/template/base/modules/delivery/models/sales_return.rk +87 -0
- package/template/base/modules/delivery/models/sales_return_item.rk +16 -0
- package/template/base/modules/delivery/module.rk +11 -0
- package/template/base/modules/distribution/flows/credit_on_invoice_cancelled.rk +17 -0
- package/template/base/modules/distribution/flows/credit_on_invoice_submitted.rk +17 -0
- package/template/base/modules/distribution/flows/credit_on_order_cancelled.rk +17 -0
- package/template/base/modules/distribution/flows/credit_on_order_submitted.rk +17 -0
- package/template/base/modules/distribution/flows/credit_on_payment_cancelled.rk +17 -0
- package/template/base/modules/distribution/flows/credit_on_payment_submitted.rk +17 -0
- package/template/base/modules/distribution/flows/giro_bounced.rk +20 -0
- package/template/base/modules/distribution/flows/giro_from_payment.rk +21 -0
- package/template/base/modules/distribution/flows/order_tier_pricing_created.rk +17 -0
- package/template/base/modules/distribution/flows/order_tier_pricing_updated.rk +17 -0
- package/template/base/modules/distribution/models/giro.rk +79 -0
- package/template/base/modules/distribution/module.rk +9 -0
- package/template/base/modules/invoicing/models/sales_invoice.rk +16 -1
- package/template/base/modules/invoicing/module.rk +2 -2
- package/template/base/modules/orders/models/customer_order.rk +80 -2
- package/template/base/modules/orders/models/customer_order_item.rk +19 -0
- package/template/base/modules/orders/module.rk +2 -2
- package/template/base/modules/outlets/models/outlet.rk +1 -0
- package/template/base/modules/outlets/module.rk +1 -1
- package/template/base/modules/payments/models/payment.rk +36 -1
- package/template/base/modules/payments/module.rk +2 -2
- package/template/base/modules/production/flows/batch_cancel_guard.rk +12 -0
- package/template/base/modules/production/flows/batch_from_bom.rk +19 -0
- package/template/base/modules/production/flows/wage_sheet_on_batch_cancelled.rk +14 -0
- package/template/base/modules/production/flows/wage_sheet_on_batch_submitted.rk +12 -0
- package/template/base/modules/production/flows/work_order_materials_created.rk +20 -0
- package/template/base/modules/production/flows/work_order_materials_updated.rk +20 -0
- package/template/base/modules/production/models/bom.rk +67 -0
- package/template/base/modules/production/models/bom_byproduct.rk +7 -0
- package/template/base/modules/production/models/bom_line.rk +11 -0
- package/template/base/modules/production/models/production_batch.rk +149 -0
- package/template/base/modules/production/models/production_guard.rk +23 -0
- package/template/base/modules/production/models/production_labour.rk +10 -0
- package/template/base/modules/production/models/production_material.rk +8 -0
- package/template/base/modules/production/models/production_output.rk +8 -0
- package/template/base/modules/production/models/production_stage.rk +19 -0
- package/template/base/modules/production/models/wage_line.rk +11 -0
- package/template/base/modules/production/models/wage_sheet.rk +28 -0
- package/template/base/modules/production/models/work_order.rk +63 -0
- package/template/base/modules/production/models/work_order_material.rk +8 -0
- package/template/base/modules/production/module.rk +12 -0
- package/template/base/modules/projects/flows/timesheet_assignment_on_create.rk +28 -0
- package/template/base/modules/projects/imports/attendance_recap.rk +23 -0
- package/template/base/modules/projects/models/assignment.rk +16 -3
- package/template/base/modules/projects/models/project_ledger.rk +5 -2
- package/template/base/modules/projects/models/timesheet.rk +58 -14
- package/template/base/modules/stock/models/stock_move.rk +4 -0
- package/template/base/modules/stock/module.rk +1 -1
- package/template/base/modules/users/models/user.rk +1 -0
- package/template/base/modules/users/module.rk +1 -1
- package/template/base/modules/users/roles/field_sales.rk +7 -0
- package/template/base/modules/workforce/imports/worker_list.rk +6 -1
- package/template/base/modules/workforce/models/worker.rk +28 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rangka-os/create",
|
|
3
|
-
"version": "0.5.0-alpha.
|
|
3
|
+
"version": "0.5.0-alpha.8",
|
|
4
4
|
"description": "Start a Rangka OS project: npm create @rangka-os@latest my-shop",
|
|
5
5
|
"license": "Elastic-2.0",
|
|
6
6
|
"homepage": "https://rangka-os.github.io/rangka-os/guide/quick-start",
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/app.json
|
|
2
|
+
# Back office of a sub-distributor (grosir FMCG): salesmen take orders for their own customers at the customer's price
|
|
3
|
+
# tier, an order is held for the sales manager when the customer is on hold, overdue or over its limit, the warehouse
|
|
4
|
+
# delivers with a delivery note (stock out), invoices go out with PPN, giro is followed to the bank, a bounced giro
|
|
5
|
+
# opens the invoices again, and AR is read per salesman.
|
|
6
|
+
name: grosir_distribusi
|
|
7
|
+
version: 1.0.0
|
|
8
|
+
title: {id: Grosir dan distribusi, en: Wholesale distribution}
|
|
9
|
+
label: {id: Rangka Grosir Distribusi, en: Rangka Wholesale Distribution}
|
|
10
|
+
summary:
|
|
11
|
+
id: Pesanan salesman dengan harga per tier, tahan kredit otomatis, surat jalan, retur, giro dan piutang per salesman.
|
|
12
|
+
rangka: '>=0.5'
|
|
13
|
+
modules:
|
|
14
|
+
contacts: ^1.0
|
|
15
|
+
catalogue: ^1.0
|
|
16
|
+
outlets: ^1.0
|
|
17
|
+
users: ^1.0
|
|
18
|
+
stock: ^1.0
|
|
19
|
+
orders: ^1.0
|
|
20
|
+
invoicing: ^1.0
|
|
21
|
+
payments: ^1.0
|
|
22
|
+
procurement: ^1.0
|
|
23
|
+
distribution: ^1.0
|
|
24
|
+
delivery: ^1.0
|
|
25
|
+
dashboards: [grosir_overview, grosir_ar]
|
|
26
|
+
roles: [sales_manager, finance_manager, head_office, field_sales]
|
|
27
|
+
home: {dashboard: grosir_overview}
|
|
28
|
+
# recipe is installed with stock but has no menu entry: a distributor sells goods as they are.
|
|
29
|
+
menu:
|
|
30
|
+
- group: {id: Penjualan}
|
|
31
|
+
items: [customer_order, sales_invoice, payment, giro]
|
|
32
|
+
- group: {id: Pengiriman}
|
|
33
|
+
items: [delivery_note, sales_return, order_fulfilment, return_credit]
|
|
34
|
+
- group: {id: Gudang}
|
|
35
|
+
items: [stock_balance, stock_move, stock_transfer, stock_transfer_receipt, stock_count, stock_adjustment]
|
|
36
|
+
- group: {id: Pembelian}
|
|
37
|
+
items: [purchase_order, goods_receipt, vendor_bill]
|
|
38
|
+
- group: {id: Data induk}
|
|
39
|
+
items: [customer, item, item_category, price_list, outlet, uom, vendor, user]
|
|
40
|
+
onboarding:
|
|
41
|
+
- ask: {id: 'Berapa salesman yang mengambil pesanan?'}
|
|
42
|
+
sets: seed.salesmen
|
|
43
|
+
- ask: {id: 'Apakah usaha kamu PKP (memungut PPN)?'}
|
|
44
|
+
options: ['true', 'false']
|
|
45
|
+
sets: tax.pkp
|
|
46
|
+
- ask: {id: 'Apakah ada mobil kanvas (jual langsung dari mobil)?'}
|
|
47
|
+
options: ['true', 'false']
|
|
48
|
+
sets: seed.canvas_van
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/dashboard.json
|
|
2
|
+
name: grosir_ar
|
|
3
|
+
label: {id: Piutang dan penagihan, en: Receivables and collections}
|
|
4
|
+
cache: 5m
|
|
5
|
+
widgets:
|
|
6
|
+
- name: ar_by_salesman
|
|
7
|
+
type: chart
|
|
8
|
+
chart: bar
|
|
9
|
+
label: {id: Piutang per salesman}
|
|
10
|
+
model: sales_invoice
|
|
11
|
+
group_by: salesman
|
|
12
|
+
aggregate: sum
|
|
13
|
+
field: outstanding
|
|
14
|
+
filter: docstatus == 1 && outstanding > 0
|
|
15
|
+
span: 6
|
|
16
|
+
- name: overdue_by_salesman
|
|
17
|
+
type: chart
|
|
18
|
+
chart: bar
|
|
19
|
+
label: {id: Lewat jatuh tempo per salesman}
|
|
20
|
+
model: sales_invoice
|
|
21
|
+
group_by: salesman
|
|
22
|
+
aggregate: sum
|
|
23
|
+
field: outstanding
|
|
24
|
+
filter: docstatus == 1 && outstanding > 0 && due_date < today()
|
|
25
|
+
span: 6
|
|
26
|
+
- name: collected_by_salesman
|
|
27
|
+
type: chart
|
|
28
|
+
chart: bar
|
|
29
|
+
label: {id: Tertagih per salesman (30 hari)}
|
|
30
|
+
model: payment
|
|
31
|
+
group_by: salesman
|
|
32
|
+
aggregate: sum
|
|
33
|
+
field: amount
|
|
34
|
+
filter: docstatus == 1 && direction == 'receive' && method != 'sales_return'
|
|
35
|
+
period: payment_date
|
|
36
|
+
span: 6
|
|
37
|
+
- name: on_hold
|
|
38
|
+
type: list
|
|
39
|
+
label: {id: Pelanggan ditahan kredit}
|
|
40
|
+
model: customer
|
|
41
|
+
filter: credit_hold == true
|
|
42
|
+
limit: 20
|
|
43
|
+
columns: [customer_name, salesman, credit_hold_reason, outstanding]
|
|
44
|
+
span: 6
|
|
45
|
+
- name: returns_not_credited
|
|
46
|
+
label: {id: Retur belum dipotongkan}
|
|
47
|
+
description: {id: 'Retur yang sudah diterima gudang tapi belum dipotong dari piutang (pembayaran metode Potong retur)'}
|
|
48
|
+
type: list
|
|
49
|
+
model: return_credit
|
|
50
|
+
filter: credited < return_total
|
|
51
|
+
limit: 20
|
|
52
|
+
columns: [sales_return, return_total, credited]
|
|
53
|
+
span: 12
|
|
54
|
+
- name: overdue_list
|
|
55
|
+
type: list
|
|
56
|
+
label: {id: Faktur lewat jatuh tempo}
|
|
57
|
+
model: sales_invoice
|
|
58
|
+
filter: docstatus == 1 && outstanding > 0 && due_date < today()
|
|
59
|
+
sort: due_date
|
|
60
|
+
limit: 20
|
|
61
|
+
columns: [name, customer, salesman, due_date, outstanding]
|
|
62
|
+
span: 12
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/dashboard.json
|
|
2
|
+
name: grosir_overview
|
|
3
|
+
label: {id: Ringkasan distribusi, en: Distribution overview}
|
|
4
|
+
default_period: 30
|
|
5
|
+
cache: 5m
|
|
6
|
+
# The owner's daily questions: what did the salesmen sell, which orders wait, who pays late, which giro is due.
|
|
7
|
+
widgets:
|
|
8
|
+
- name: sales_period
|
|
9
|
+
type: number
|
|
10
|
+
label: {id: Penjualan (faktur)}
|
|
11
|
+
description: {id: 'Nilai sebelum PPN, faktur yang sudah diterbitkan pada periode ini'}
|
|
12
|
+
model: sales_invoice
|
|
13
|
+
aggregate: sum
|
|
14
|
+
field: subtotal
|
|
15
|
+
filter: docstatus == 1
|
|
16
|
+
period: posting_date
|
|
17
|
+
compact: true
|
|
18
|
+
span: 3
|
|
19
|
+
- name: ar_open
|
|
20
|
+
type: number
|
|
21
|
+
label: {id: Piutang berjalan}
|
|
22
|
+
model: sales_invoice
|
|
23
|
+
aggregate: sum
|
|
24
|
+
field: outstanding
|
|
25
|
+
filter: docstatus == 1 && outstanding > 0
|
|
26
|
+
compact: true
|
|
27
|
+
span: 3
|
|
28
|
+
- name: overdue_ar
|
|
29
|
+
type: number
|
|
30
|
+
label: {id: Piutang lewat jatuh tempo}
|
|
31
|
+
model: sales_invoice
|
|
32
|
+
aggregate: sum
|
|
33
|
+
field: outstanding
|
|
34
|
+
filter: docstatus == 1 && outstanding > 0 && due_date < today()
|
|
35
|
+
compact: true
|
|
36
|
+
good_when: down
|
|
37
|
+
span: 3
|
|
38
|
+
- name: held_orders
|
|
39
|
+
type: number
|
|
40
|
+
label: {id: Pesanan belum jalan}
|
|
41
|
+
description: {id: Draft dan pesanan yang menunggu persetujuan kredit}
|
|
42
|
+
model: customer_order
|
|
43
|
+
aggregate: count
|
|
44
|
+
filter: docstatus == 0
|
|
45
|
+
span: 3
|
|
46
|
+
- name: sales_by_salesman
|
|
47
|
+
type: chart
|
|
48
|
+
chart: bar
|
|
49
|
+
label: {id: Penjualan per salesman}
|
|
50
|
+
model: sales_invoice
|
|
51
|
+
group_by: salesman
|
|
52
|
+
aggregate: sum
|
|
53
|
+
field: subtotal
|
|
54
|
+
filter: docstatus == 1
|
|
55
|
+
period: posting_date
|
|
56
|
+
span: 6
|
|
57
|
+
- name: ar_by_salesman
|
|
58
|
+
type: chart
|
|
59
|
+
chart: bar
|
|
60
|
+
label: {id: Piutang per salesman}
|
|
61
|
+
model: sales_invoice
|
|
62
|
+
group_by: salesman
|
|
63
|
+
aggregate: sum
|
|
64
|
+
field: outstanding
|
|
65
|
+
filter: docstatus == 1 && outstanding > 0
|
|
66
|
+
span: 6
|
|
67
|
+
- name: giro_due
|
|
68
|
+
type: list
|
|
69
|
+
label: {id: Giro belum cair}
|
|
70
|
+
description: {id: 'Giro diterima atau disetor, urut tanggal efektif'}
|
|
71
|
+
model: giro
|
|
72
|
+
filter: status == 'received' || status == 'deposited'
|
|
73
|
+
sort: effective_date
|
|
74
|
+
limit: 10
|
|
75
|
+
columns: [giro_no, customer, effective_date, amount, status]
|
|
76
|
+
span: 6
|
|
77
|
+
- name: late_customers
|
|
78
|
+
type: list
|
|
79
|
+
label: {id: Pelanggan telat bayar}
|
|
80
|
+
model: customer
|
|
81
|
+
filter: oldest_open_due != '' && oldest_open_due < today()
|
|
82
|
+
sort: oldest_open_due
|
|
83
|
+
limit: 10
|
|
84
|
+
columns: [customer_name, salesman, oldest_open_due, outstanding, credit_hold]
|
|
85
|
+
span: 6
|
|
@@ -63,6 +63,8 @@ widgets:
|
|
|
63
63
|
filter: state == 'planned' || state == 'running'
|
|
64
64
|
span: 3
|
|
65
65
|
- name: active_workers
|
|
66
|
+
# worker carries pay: only roles that may read it (audit L1)
|
|
67
|
+
if: "'owner' in user.roles || 'finance_manager' in user.roles || 'project_admin' in user.roles"
|
|
66
68
|
type: number
|
|
67
69
|
label: {id: Tenaga kerja aktif}
|
|
68
70
|
model: worker
|
|
@@ -110,6 +112,8 @@ widgets:
|
|
|
110
112
|
# Certification expiry cannot be a widget: `expired` lives on child rows (certification) and is a stored compute that goes
|
|
111
113
|
# stale once expires_on passes. The closest honest view is the list of active workers; open one to see its certifications.
|
|
112
114
|
- name: workers_certifications
|
|
115
|
+
# worker carries pay: only roles that may read it (audit L1)
|
|
116
|
+
if: "'owner' in user.roles || 'finance_manager' in user.roles || 'project_admin' in user.roles"
|
|
113
117
|
type: list
|
|
114
118
|
label: {id: Tenaga kerja aktif}
|
|
115
119
|
description: {id: Buka satu untuk melihat masa berlaku sertifikasinya}
|
|
@@ -3,9 +3,14 @@
|
|
|
3
3
|
name: project_margin
|
|
4
4
|
label: {id: Untung per proyek, en: Project margin}
|
|
5
5
|
default_period: 365
|
|
6
|
+
# Margin is cost: owner, finance and the project admin only. Sales and purchasing read only their own rows of the
|
|
7
|
+
# ledger, so a sum would show them revenue as "untung"; `roles` is not enforced by the kernel yet, so every widget on
|
|
8
|
+
# the ledger, timesheets or workers also carries the same `if` (they are hidden for other roles).
|
|
9
|
+
roles: [finance_manager, project_admin]
|
|
6
10
|
cache: 5m
|
|
7
11
|
widgets:
|
|
8
12
|
- name: margin_total
|
|
13
|
+
if: "'owner' in user.roles || 'finance_manager' in user.roles || 'project_admin' in user.roles"
|
|
9
14
|
type: number
|
|
10
15
|
label: {id: Untung proyek}
|
|
11
16
|
description: {id: 'Pendapatan dikurangi biaya tenaga kerja, proyek dan pemasok (DPP), dari dokumen yang diajukan sejak buku ini aktif'}
|
|
@@ -16,6 +21,7 @@ widgets:
|
|
|
16
21
|
compact: true
|
|
17
22
|
span: 4
|
|
18
23
|
- name: revenue_total
|
|
24
|
+
if: "'owner' in user.roles || 'finance_manager' in user.roles || 'project_admin' in user.roles"
|
|
19
25
|
type: number
|
|
20
26
|
label: {id: Pendapatan proyek}
|
|
21
27
|
model: project_ledger
|
|
@@ -35,7 +41,27 @@ widgets:
|
|
|
35
41
|
filter: state == 'planned' || state == 'running'
|
|
36
42
|
compact: true
|
|
37
43
|
span: 4
|
|
44
|
+
# A margin is only as good as its labour cost: absensi without pay add no cost, so they are counted here (G5).
|
|
45
|
+
- name: timesheets_without_pay
|
|
46
|
+
if: "'owner' in user.roles || 'finance_manager' in user.roles || 'project_admin' in user.roles"
|
|
47
|
+
type: number
|
|
48
|
+
label: {id: Absensi tanpa upah}
|
|
49
|
+
description: {id: 'Absensi diajukan yang upahnya belum diisi: untung proyek di atas belum termasuk biaya tenaga ini'}
|
|
50
|
+
model: timesheet
|
|
51
|
+
filter: docstatus == 1 && cost_missing
|
|
52
|
+
good_when: down
|
|
53
|
+
span: 6
|
|
54
|
+
- name: workers_without_pay
|
|
55
|
+
if: "'owner' in user.roles || 'finance_manager' in user.roles || 'project_admin' in user.roles"
|
|
56
|
+
type: number
|
|
57
|
+
label: {id: Tenaga tanpa upah}
|
|
58
|
+
description: {id: 'Tenaga aktif yang upah per hari dan per jamnya belum diisi'}
|
|
59
|
+
model: worker
|
|
60
|
+
filter: active && cost_day_rate == 0 && cost_hour_rate == 0
|
|
61
|
+
good_when: down
|
|
62
|
+
span: 6
|
|
38
63
|
- name: margin_by_project
|
|
64
|
+
if: "'owner' in user.roles || 'finance_manager' in user.roles || 'project_admin' in user.roles"
|
|
39
65
|
type: chart
|
|
40
66
|
chart: bar
|
|
41
67
|
label: {id: Untung per proyek}
|
|
@@ -47,6 +73,7 @@ widgets:
|
|
|
47
73
|
sort: -value
|
|
48
74
|
span: 6
|
|
49
75
|
- name: result_by_kind
|
|
76
|
+
if: "'owner' in user.roles || 'finance_manager' in user.roles || 'project_admin' in user.roles"
|
|
50
77
|
type: chart
|
|
51
78
|
chart: bar
|
|
52
79
|
label: {id: Pendapatan dan biaya}
|
|
@@ -57,6 +84,7 @@ widgets:
|
|
|
57
84
|
period: posting_date
|
|
58
85
|
span: 6
|
|
59
86
|
- name: latest_rows
|
|
87
|
+
if: "'owner' in user.roles || 'finance_manager' in user.roles || 'project_admin' in user.roles"
|
|
60
88
|
type: list
|
|
61
89
|
label: {id: Catatan terakhir}
|
|
62
90
|
model: project_ledger
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/app.json
|
|
2
|
+
# Back office of a small factory (frozen food, bakery, konveksi): multi-level recipes with a standard cost, work
|
|
3
|
+
# orders (SPK), batch results with production code and expiry, actual cost per batch (materials, piece-rate wages,
|
|
4
|
+
# overhead), weekly piece-rate wages per worker, material purchasing and stock of materials and finished goods.
|
|
5
|
+
name: produksi_pabrik
|
|
6
|
+
version: 1.0.0
|
|
7
|
+
title: {id: Produksi pabrik kecil, en: Small-factory production}
|
|
8
|
+
label: {id: Rangka Produksi Pabrik, en: Rangka Factory Production}
|
|
9
|
+
summary:
|
|
10
|
+
id: Resep bertingkat, SPK, hasil per batch dengan kedaluwarsa, HPP aktual dan upah borongan.
|
|
11
|
+
rangka: '>=0.5'
|
|
12
|
+
modules:
|
|
13
|
+
contacts: ^1.0
|
|
14
|
+
catalogue: ^1.0
|
|
15
|
+
outlets: ^1.0
|
|
16
|
+
users: ^1.0
|
|
17
|
+
stock: ^1.0
|
|
18
|
+
workforce: ^1.0
|
|
19
|
+
production: ^1.0
|
|
20
|
+
procurement: ^1.0
|
|
21
|
+
payments: ^1.0
|
|
22
|
+
invoicing: ^1.0
|
|
23
|
+
dashboards: [produksi_overview, produksi_upah]
|
|
24
|
+
roles: [head_office, outlet_staff]
|
|
25
|
+
home: {dashboard: produksi_overview}
|
|
26
|
+
# invoicing is only here because payments requires it; selling (orders, delivery notes) comes with grosir_distribusi.
|
|
27
|
+
menu:
|
|
28
|
+
- group: {id: Produksi}
|
|
29
|
+
items: [work_order, production_batch, wage_sheet]
|
|
30
|
+
- group: {id: Resep dan tarif}
|
|
31
|
+
items: [bom, production_stage, worker]
|
|
32
|
+
- group: {id: Stok}
|
|
33
|
+
items: [stock_balance, stock_move, stock_transfer, stock_transfer_receipt, stock_count, stock_adjustment]
|
|
34
|
+
- group: {id: Pembelian}
|
|
35
|
+
items: [purchase_order, goods_receipt, vendor_bill, payment]
|
|
36
|
+
- group: {id: Data induk}
|
|
37
|
+
items: [item, item_category, outlet, uom, vendor]
|
|
38
|
+
onboarding:
|
|
39
|
+
- ask: {id: 'Apa produk utama yang kamu buat?'}
|
|
40
|
+
sets: seed.products
|
|
41
|
+
- ask: {id: 'Apakah pekerja produksi dibayar borongan (per hasil)?'}
|
|
42
|
+
options: ['true', 'false']
|
|
43
|
+
sets: seed.piece_rate
|
|
44
|
+
- ask: {id: 'Apakah usaha kamu PKP (memungut PPN)?'}
|
|
45
|
+
options: ['true', 'false']
|
|
46
|
+
sets: tax.pkp
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/dashboard.json
|
|
2
|
+
name: produksi_overview
|
|
3
|
+
label: {id: Ringkasan produksi, en: Production overview}
|
|
4
|
+
default_period: 30
|
|
5
|
+
cache: 5m
|
|
6
|
+
# The owner's questions: how much did we make, what did it really cost, how much went to waste, what expires soon.
|
|
7
|
+
widgets:
|
|
8
|
+
- name: batches
|
|
9
|
+
type: number
|
|
10
|
+
label: {id: Batch selesai}
|
|
11
|
+
model: production_batch
|
|
12
|
+
aggregate: count
|
|
13
|
+
filter: docstatus == 1
|
|
14
|
+
period: production_date
|
|
15
|
+
span: 3
|
|
16
|
+
- name: good_qty
|
|
17
|
+
type: number
|
|
18
|
+
label: {id: Hasil baik}
|
|
19
|
+
model: production_batch
|
|
20
|
+
aggregate: sum
|
|
21
|
+
field: good_qty
|
|
22
|
+
filter: docstatus == 1
|
|
23
|
+
period: production_date
|
|
24
|
+
span: 3
|
|
25
|
+
- name: hpp_total
|
|
26
|
+
type: number
|
|
27
|
+
label: {id: HPP produksi}
|
|
28
|
+
description: {id: 'Bahan, upah borongan dan overhead'}
|
|
29
|
+
model: production_batch
|
|
30
|
+
aggregate: sum
|
|
31
|
+
field: hpp_total
|
|
32
|
+
filter: docstatus == 1
|
|
33
|
+
period: production_date
|
|
34
|
+
compact: true
|
|
35
|
+
span: 3
|
|
36
|
+
- name: reject_qty
|
|
37
|
+
type: number
|
|
38
|
+
label: {id: Reject}
|
|
39
|
+
model: production_batch
|
|
40
|
+
aggregate: sum
|
|
41
|
+
field: reject_qty
|
|
42
|
+
filter: docstatus == 1
|
|
43
|
+
period: production_date
|
|
44
|
+
good_when: down
|
|
45
|
+
span: 3
|
|
46
|
+
- name: hpp_by_product
|
|
47
|
+
type: chart
|
|
48
|
+
chart: bar
|
|
49
|
+
label: {id: HPP per produk}
|
|
50
|
+
model: production_batch
|
|
51
|
+
group_by: item
|
|
52
|
+
aggregate: sum
|
|
53
|
+
field: hpp_total
|
|
54
|
+
filter: docstatus == 1
|
|
55
|
+
period: production_date
|
|
56
|
+
span: 6
|
|
57
|
+
- name: output_by_product
|
|
58
|
+
type: chart
|
|
59
|
+
chart: bar
|
|
60
|
+
label: {id: Hasil baik per produk}
|
|
61
|
+
model: production_batch
|
|
62
|
+
group_by: item
|
|
63
|
+
aggregate: sum
|
|
64
|
+
field: good_qty
|
|
65
|
+
filter: docstatus == 1
|
|
66
|
+
period: production_date
|
|
67
|
+
span: 6
|
|
68
|
+
- name: recent_batches
|
|
69
|
+
type: list
|
|
70
|
+
label: {id: Batch terakhir}
|
|
71
|
+
description: {id: 'HPP aktual per satuan dibanding standar resep'}
|
|
72
|
+
model: production_batch
|
|
73
|
+
filter: docstatus == 1
|
|
74
|
+
sort: -production_date
|
|
75
|
+
limit: 10
|
|
76
|
+
columns: [name, item, good_qty, hpp_per_unit, standard_unit_cost, expiry_date]
|
|
77
|
+
span: 12
|
|
78
|
+
- name: expiring
|
|
79
|
+
type: list
|
|
80
|
+
label: {id: Batch mendekati kedaluwarsa}
|
|
81
|
+
description: {id: Kedaluwarsa dalam 30 hari}
|
|
82
|
+
model: production_batch
|
|
83
|
+
filter: "docstatus == 1 && expiry_date != '' && expiry_date <= today() + duration('30d')"
|
|
84
|
+
sort: expiry_date
|
|
85
|
+
limit: 10
|
|
86
|
+
columns: [name, item, good_qty, expiry_date]
|
|
87
|
+
span: 6
|
|
88
|
+
- name: open_work_orders
|
|
89
|
+
type: list
|
|
90
|
+
label: {id: SPK berjalan}
|
|
91
|
+
model: work_order
|
|
92
|
+
filter: docstatus == 1
|
|
93
|
+
sort: due_date
|
|
94
|
+
limit: 10
|
|
95
|
+
columns: [name, item, qty, due_date]
|
|
96
|
+
span: 6
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/dashboard.json
|
|
2
|
+
name: produksi_upah
|
|
3
|
+
label: {id: Upah borongan, en: Piece-rate wages}
|
|
4
|
+
default_period: 7
|
|
5
|
+
cache: 5m
|
|
6
|
+
# Weekly recap for paying the piece-rate workers (period 7 days); PPh 21 is not computed here yet.
|
|
7
|
+
widgets:
|
|
8
|
+
- name: wages_total
|
|
9
|
+
type: number
|
|
10
|
+
label: {id: Total upah borongan}
|
|
11
|
+
model: wage_line
|
|
12
|
+
aggregate: sum
|
|
13
|
+
field: amount
|
|
14
|
+
filter: "!cancelled"
|
|
15
|
+
period: work_date
|
|
16
|
+
compact: true
|
|
17
|
+
span: 4
|
|
18
|
+
- name: wages_by_worker
|
|
19
|
+
type: chart
|
|
20
|
+
chart: bar
|
|
21
|
+
label: {id: Upah per pekerja}
|
|
22
|
+
model: wage_line
|
|
23
|
+
group_by: worker
|
|
24
|
+
aggregate: sum
|
|
25
|
+
field: amount
|
|
26
|
+
filter: "!cancelled"
|
|
27
|
+
period: work_date
|
|
28
|
+
span: 8
|
|
29
|
+
- name: qty_by_stage
|
|
30
|
+
type: chart
|
|
31
|
+
chart: bar
|
|
32
|
+
label: {id: Qty per tahap}
|
|
33
|
+
model: wage_line
|
|
34
|
+
group_by: stage
|
|
35
|
+
aggregate: sum
|
|
36
|
+
field: qty
|
|
37
|
+
filter: "!cancelled"
|
|
38
|
+
period: work_date
|
|
39
|
+
span: 12
|
|
@@ -12,6 +12,7 @@ permissions:
|
|
|
12
12
|
- {role: head_office, read: true, create: true, write: true, import: true, print: true}
|
|
13
13
|
- {role: outlet_staff, read: true}
|
|
14
14
|
- {role: sales_rep, read: true}
|
|
15
|
+
- {role: field_sales, read: true}
|
|
15
16
|
fields:
|
|
16
17
|
- name: item_name
|
|
17
18
|
type: data
|
|
@@ -68,6 +69,27 @@ fields:
|
|
|
68
69
|
type: currency
|
|
69
70
|
label: {id: Harga jual}
|
|
70
71
|
in_list: true
|
|
72
|
+
# Tier prices of a distributor (module distribution): a customer's price_tier picks rate, rate_wholesale or
|
|
73
|
+
# rate_agent on its orders. Empty (0) falls back to rate.
|
|
74
|
+
- name: rate_wholesale
|
|
75
|
+
type: currency
|
|
76
|
+
label: {id: Harga grosir}
|
|
77
|
+
depends_on: app_installed('distribution')
|
|
78
|
+
- name: rate_agent
|
|
79
|
+
type: currency
|
|
80
|
+
label: {id: Harga agen}
|
|
81
|
+
depends_on: app_installed('distribution')
|
|
82
|
+
# Production (module production): the BOM this item is made with (also how a semi-finished line costs in a
|
|
83
|
+
# multi-level BOM) and its shelf life, which sets the expiry date of a batch.
|
|
84
|
+
- name: default_bom
|
|
85
|
+
type: link
|
|
86
|
+
to: bom
|
|
87
|
+
label: {id: Resep produksi}
|
|
88
|
+
depends_on: app_installed('production')
|
|
89
|
+
- name: shelf_life_days
|
|
90
|
+
type: int
|
|
91
|
+
label: {id: Umur simpan (hari)}
|
|
92
|
+
depends_on: app_installed('production')
|
|
71
93
|
- name: standard_cost
|
|
72
94
|
type: currency
|
|
73
95
|
label: {id: Harga pokok standar}
|
|
@@ -14,6 +14,7 @@ permissions:
|
|
|
14
14
|
- {role: head_office, read: true, create: true, write: true, delete: true, print: true}
|
|
15
15
|
- {role: outlet_staff, read: true}
|
|
16
16
|
- {role: sales_rep, read: true}
|
|
17
|
+
- {role: field_sales, read: true}
|
|
17
18
|
fields:
|
|
18
19
|
- name: category_name
|
|
19
20
|
type: data
|
|
@@ -5,6 +5,7 @@ icon: stock
|
|
|
5
5
|
naming: UOM-{###}
|
|
6
6
|
title_field: uom_name
|
|
7
7
|
permissions:
|
|
8
|
+
- {role: field_sales, read: true}
|
|
8
9
|
- {role: sales_manager, read: true, create: true, write: true, print: true}
|
|
9
10
|
- {role: finance_manager, read: true, create: true, write: true, print: true}
|
|
10
11
|
- {role: purchasing_manager, read: true, create: true, write: true, print: true}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/module.json
|
|
2
2
|
name: catalogue
|
|
3
|
-
version: 1.
|
|
3
|
+
version: 1.1.0
|
|
4
4
|
title: {id: Katalog, en: Catalogue}
|
|
5
5
|
requires: {rangka: '>=0.5', users: ^1.0, contacts: ^1.0}
|
|
6
|
+
optional: {production: ^1.0}
|
|
@@ -12,6 +12,8 @@ permissions:
|
|
|
12
12
|
- {role: head_office, read: true, create: true, write: true, print: true}
|
|
13
13
|
- {role: outlet_staff, read: true}
|
|
14
14
|
- {role: sales_rep, read: true, create: true, write: true}
|
|
15
|
+
# a salesman sees his own customers (role scope salesman) and cannot change their credit
|
|
16
|
+
- {role: field_sales, read: true}
|
|
15
17
|
fields:
|
|
16
18
|
- name: customer_name
|
|
17
19
|
type: data
|
|
@@ -45,6 +47,57 @@ fields:
|
|
|
45
47
|
label: {id: Piutang}
|
|
46
48
|
read_only: true
|
|
47
49
|
in_list: true
|
|
50
|
+
# Distributor sales (module distribution): the salesman who visits the customer, the route, the price tier, and
|
|
51
|
+
# the credit control that holds its orders (customer_order approvals). oldest_open_due is the earliest due date of
|
|
52
|
+
# its open invoices, kept by the distribution flows; an order is held while it is before today.
|
|
53
|
+
- name: salesman
|
|
54
|
+
type: link
|
|
55
|
+
to: user
|
|
56
|
+
label: {id: Salesman}
|
|
57
|
+
in_list: true
|
|
58
|
+
depends_on: app_installed('distribution')
|
|
59
|
+
- name: route_day
|
|
60
|
+
type: select
|
|
61
|
+
label: {id: Hari kunjungan}
|
|
62
|
+
depends_on: app_installed('distribution')
|
|
63
|
+
options:
|
|
64
|
+
- {value: mon_thu, label: {id: Senin dan Kamis}}
|
|
65
|
+
- {value: tue_fri, label: {id: Selasa dan Jumat}}
|
|
66
|
+
- {value: wed_sat, label: {id: Rabu dan Sabtu}}
|
|
67
|
+
- {value: daily, label: {id: Setiap hari}}
|
|
68
|
+
- name: price_tier
|
|
69
|
+
type: select
|
|
70
|
+
label: {id: Tier harga}
|
|
71
|
+
default: "'retail'"
|
|
72
|
+
depends_on: app_installed('distribution')
|
|
73
|
+
options:
|
|
74
|
+
- {value: retail, label: {id: Eceran}}
|
|
75
|
+
- {value: wholesale, label: {id: Grosir}}
|
|
76
|
+
- {value: agent, label: {id: Agen}}
|
|
77
|
+
- name: credit_hold
|
|
78
|
+
type: check
|
|
79
|
+
label: {id: Tahan kredit}
|
|
80
|
+
help: {id: Semua pesanan pelanggan ini butuh persetujuan sampai dicentang lagi}
|
|
81
|
+
depends_on: app_installed('distribution')
|
|
82
|
+
- name: credit_hold_reason
|
|
83
|
+
type: data
|
|
84
|
+
label: {id: Alasan tahan kredit}
|
|
85
|
+
depends_on: app_installed('distribution')
|
|
86
|
+
- name: oldest_open_due
|
|
87
|
+
type: date
|
|
88
|
+
label: {id: Jatuh tempo tertua yang belum lunas}
|
|
89
|
+
read_only: true
|
|
90
|
+
depends_on: app_installed('distribution')
|
|
91
|
+
- name: open_orders
|
|
92
|
+
type: currency
|
|
93
|
+
label: {id: Pesanan belum ditagih (dengan PPN)}
|
|
94
|
+
read_only: true
|
|
95
|
+
depends_on: app_installed('distribution')
|
|
96
|
+
- name: uninvoiced_deliveries
|
|
97
|
+
type: currency
|
|
98
|
+
label: {id: Terkirim belum ditagih (dengan PPN)}
|
|
99
|
+
read_only: true
|
|
100
|
+
depends_on: app_installed('delivery')
|
|
48
101
|
- name: npwp
|
|
49
102
|
type: npwp
|
|
50
103
|
label: {id: NPWP}
|
|
@@ -66,7 +119,11 @@ views:
|
|
|
66
119
|
- [npwp, phone, email]
|
|
67
120
|
- section: {id: Pembayaran}
|
|
68
121
|
columns:
|
|
69
|
-
- [payment_days]
|
|
122
|
+
- [payment_days, price_tier]
|
|
70
123
|
- [credit_limit, outstanding]
|
|
124
|
+
- section: {id: Kredit dan salesman}
|
|
125
|
+
columns:
|
|
126
|
+
- [salesman, route_day, credit_hold, credit_hold_reason]
|
|
127
|
+
- [open_orders, uninvoiced_deliveries, oldest_open_due]
|
|
71
128
|
- section: {id: Kontak person}
|
|
72
129
|
fields: [contacts]
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/flow.json
|
|
2
|
+
# Inside a delivery note's cancel: refused while a live sales return comes from it (its stock would be counted back
|
|
3
|
+
# twice), or while the order would have invoiced more than it delivered (an invoice billing goods never sent).
|
|
4
|
+
name: delivery_cancel_guard
|
|
5
|
+
label: {id: Surat jalan yang sudah diretur atau ditagih tidak bisa dibatalkan}
|
|
6
|
+
on: delivery_note.cancelled
|
|
7
|
+
steps:
|
|
8
|
+
- {find: sales_return, where: delivery_note == event.name && docstatus == 1, as: ret}
|
|
9
|
+
- {find: order_fulfilment, where: name == event.fulfilment, as: f}
|
|
10
|
+
- update: f
|
|
11
|
+
if: f != null
|
|
12
|
+
set: {customer: f.customer}
|
|
13
|
+
- if: ret != null
|
|
14
|
+
create: delivery_guard
|
|
15
|
+
set: {reason: "'note_returned'", document: ret.name}
|
|
16
|
+
- if: "ret == null && f != null && f.items.map(b, b.delivered_qty - event.items.map(l, l.item == b.item ? l.qty : 0).sum() + 0.0005 < b.invoiced_qty ? 1 : 0).sum() > 0"
|
|
17
|
+
create: delivery_guard
|
|
18
|
+
set: {reason: "'note_invoiced'", document: event.name}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/flow.json
|
|
2
|
+
# Keeps order_fulfilment current on delivery_note.cancelled: one line per item of the order, summed over the event lines of that item.
|
|
3
|
+
name: fulfilment_on_delivery_cancelled
|
|
4
|
+
label: {id: Perbarui pemenuhan pesanan}
|
|
5
|
+
on: delivery_note.cancelled
|
|
6
|
+
if: "event.fulfilment != ''"
|
|
7
|
+
steps:
|
|
8
|
+
- {find: order_fulfilment, where: name == event.fulfilment, as: f}
|
|
9
|
+
# a find returns the record without its table rows: an update that changes nothing returns it whole
|
|
10
|
+
- update: f
|
|
11
|
+
if: f != null
|
|
12
|
+
set: {customer: f.customer}
|
|
13
|
+
- update: f
|
|
14
|
+
if: f != null
|
|
15
|
+
set:
|
|
16
|
+
items: "f.items.map(b, {'name': b.name, 'item': b.item, 'ordered_qty': b.ordered_qty, 'rate': b.rate, 'delivered_qty': b.delivered_qty - event.items.map(l, l.item == b.item ? l.qty : 0).sum(), 'returned_qty': b.returned_qty, 'invoiced_qty': b.invoiced_qty})"
|
|
17
|
+
- {find_all: order_fulfilment, where: "f != null && customer == f.customer", as: all}
|
|
18
|
+
- {find: customer, where: "f != null && name == f.customer", as: cust}
|
|
19
|
+
- update: cust
|
|
20
|
+
if: cust != null
|
|
21
|
+
set: {uninvoiced_deliveries: "all.map(x, x.uninvoiced_value).sum()"}
|