@rangka-os/create 0.5.0-alpha.20 → 0.5.0-alpha.22
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/jasa_proyek/dashboards/rekap_absen.rk +1 -1
- package/template/base/apps/sewa_alat/skills/rangka-app-sewa-alat/SKILL.md +24 -0
- package/template/base/apps/sewa_alat/skills/rangka-app-sewa-alat/first-day.json +162 -0
- package/template/base/modules/orders/models/customer_order.rk +8 -0
- package/template/base/modules/procurement/models/goods_receipt.rk +2 -0
- package/template/base/modules/projects/flows/work_site_supervisor_changed.rk +19 -0
- package/template/base/modules/projects/flows/worker_employee_changed.rk +19 -0
- package/template/base/modules/projects/models/assignment.rk +6 -0
- package/template/base/modules/projects/models/attendance_log.rk +13 -1
- package/template/base/modules/projects/models/work_site.rk +11 -2
- package/template/base/modules/projects/module.rk +2 -2
- package/template/base/modules/projects/roles/field_worker.rk +4 -3
- package/template/base/modules/projects/roles/site_supervisor.rk +4 -3
- package/template/base/modules/projects/screens/absen.rk +3 -1
- package/template/base/modules/stock/models/stock_count.rk +2 -0
- package/template/base/modules/users/models/user.rk +33 -4
- package/template/base/modules/users/models/user_outlet.rk +6 -0
- package/template/base/modules/users/module.rk +3 -2
- package/template/base/modules/workforce/models/worker.rk +9 -0
- package/template/base/modules/workforce/module.rk +1 -1
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.22",
|
|
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",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: rekap_absen
|
|
3
3
|
label: {id: Rekap absen lapangan, en: Field attendance}
|
|
4
4
|
description: {id: 'Siapa yang sudah absen hari ini, absen di luar radius yang menunggu persetujuan, dan hari hadir per pekerja'}
|
|
5
|
-
# For the site supervisor (only the logs of their sites, row scope
|
|
5
|
+
# For the site supervisor (only the logs of their sites, row scope supervisor) and the project admin (every site). The
|
|
6
6
|
# held submits themselves are decided in Persetujuan (contract 0007); this board shows which logs wait.
|
|
7
7
|
default_period: 31
|
|
8
8
|
roles: [site_supervisor, project_admin]
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: rangka-app-sewa-alat
|
|
3
|
+
description: "Rangka Sewa Alat (app sewa_alat): rental of equipment or vehicles with a schedule without double booking, handover out and back per unit, deposit, late fee, rent invoices. Use when an owner rents things out (alat pesta, kamera, mobil, motor) and for the first day after it is built (first-day.json)."
|
|
4
|
+
metadata: {rangka: {version: 0.1.0, app: sewa_alat, requires: [rangka-compose, rangka-changesets]}}
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Rangka Sewa Alat
|
|
8
|
+
|
|
9
|
+
Read `rangka-compose` first. This draft only adds the first day.
|
|
10
|
+
|
|
11
|
+
## First day (first-day.json)
|
|
12
|
+
|
|
13
|
+
`first-day.json` next to this file is read by Rangka Cloud after the build (proposal "First day with Raka", draft for rangka-os):
|
|
14
|
+
|
|
15
|
+
- `steps`: 3-5 steps in the order a rental business starts. A step is done when the kernel has at least `done.min`
|
|
16
|
+
records of `done.model`; a step without `done` is ticked by the owner.
|
|
17
|
+
- `seed`: what Raka may prepare from the interview. Only values the owner said, each with the owner's quote (engine
|
|
18
|
+
`/v1/seed` drops the rest). Money fields are marked `money` and shown separately; nothing is written before the
|
|
19
|
+
owner agrees.
|
|
20
|
+
- `rename`: model labels that follow the owner's own word for what they rent (`{Word}` capitalised, `{word}` lower),
|
|
21
|
+
proposed as one low-risk change set of label overlays.
|
|
22
|
+
- `menu`: one sentence per menu item, said by Raka when the owner first opens it.
|
|
23
|
+
|
|
24
|
+
Say these in the owner's words. Never invent units, plates, rates or fees the owner did not say.
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 1,
|
|
3
|
+
"greeting": "Ini langkah hari pertama kita. Mulai dari yang paling dasar: isi {rental_item|lower} yang kamu sewakan, lalu coba satu pesanan.",
|
|
4
|
+
"steps": [
|
|
5
|
+
{
|
|
6
|
+
"id": "isi_alat",
|
|
7
|
+
"title": "Isi {rental_item|lower} yang kamu sewakan",
|
|
8
|
+
"why": "Pesanan sewa memilih dari daftar ini, lengkap dengan tarif dan dendanya.",
|
|
9
|
+
"model": "rental_item",
|
|
10
|
+
"done": {
|
|
11
|
+
"model": "rental_item",
|
|
12
|
+
"min": 1
|
|
13
|
+
},
|
|
14
|
+
"seed": "alat",
|
|
15
|
+
"action": "Buka {rental_item}"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"id": "pesanan",
|
|
19
|
+
"title": "Catat satu {rental_booking|lower} sebagai percobaan",
|
|
20
|
+
"why": "Jadwal terisi dan kamu langsung melihat kalau ada yang bentrok.",
|
|
21
|
+
"model": "rental_booking",
|
|
22
|
+
"done": {
|
|
23
|
+
"model": "rental_booking",
|
|
24
|
+
"min": 1
|
|
25
|
+
},
|
|
26
|
+
"action": "Catat {rental_booking|lower}",
|
|
27
|
+
"new": true
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"id": "keluar",
|
|
31
|
+
"title": "Catat {rental_checkout|lower} saat barang dibawa penyewa",
|
|
32
|
+
"why": "Kondisi dan kelengkapan tercatat, jadi denda dan kerusakan jelas saat kembali.",
|
|
33
|
+
"model": "rental_checkout",
|
|
34
|
+
"done": {
|
|
35
|
+
"model": "rental_checkout",
|
|
36
|
+
"min": 1
|
|
37
|
+
},
|
|
38
|
+
"action": "Buka {rental_checkout}"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"id": "staf",
|
|
42
|
+
"title": "Ajak staf yang melayani serah terima",
|
|
43
|
+
"why": "Staf mencatat keluar dan kembali dari ponselnya sendiri; kamu tinggal melihat ringkasannya.",
|
|
44
|
+
"link": "members",
|
|
45
|
+
"action": "Ajak staf"
|
|
46
|
+
}
|
|
47
|
+
],
|
|
48
|
+
"seed": [
|
|
49
|
+
{
|
|
50
|
+
"key": "alat",
|
|
51
|
+
"model": "rental_item",
|
|
52
|
+
"label": "{rental_item}",
|
|
53
|
+
"creates": [
|
|
54
|
+
{
|
|
55
|
+
"as": "uom",
|
|
56
|
+
"model": "uom",
|
|
57
|
+
"set": {
|
|
58
|
+
"uom_name": "Unit"
|
|
59
|
+
},
|
|
60
|
+
"reuse": true
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"as": "item",
|
|
64
|
+
"model": "item",
|
|
65
|
+
"fields": {
|
|
66
|
+
"item_name": "name"
|
|
67
|
+
},
|
|
68
|
+
"refs": {
|
|
69
|
+
"stock_uom": "uom"
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
],
|
|
73
|
+
"fields": [
|
|
74
|
+
{
|
|
75
|
+
"name": "name",
|
|
76
|
+
"label": "Nama atau jenis yang disewakan (misal kelas atau tipe)",
|
|
77
|
+
"type": "data"
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"name": "units",
|
|
81
|
+
"label": "Jumlah unit jenis ini",
|
|
82
|
+
"type": "int"
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"name": "daily_rate",
|
|
86
|
+
"label": "Tarif sewa per hari (rupiah)",
|
|
87
|
+
"type": "currency",
|
|
88
|
+
"money": true
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"name": "rate_per_event",
|
|
92
|
+
"label": "Tarif per acara atau per pemakaian (rupiah)",
|
|
93
|
+
"type": "currency",
|
|
94
|
+
"money": true,
|
|
95
|
+
"pseudo": true
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"name": "deposit_per_unit",
|
|
99
|
+
"label": "Deposit atau jaminan uang per unit (rupiah)",
|
|
100
|
+
"type": "currency",
|
|
101
|
+
"money": true
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"name": "late_fee_per_day",
|
|
105
|
+
"label": "Denda telat per hari per unit (rupiah)",
|
|
106
|
+
"type": "currency",
|
|
107
|
+
"money": true
|
|
108
|
+
}
|
|
109
|
+
],
|
|
110
|
+
"required": [
|
|
111
|
+
"name"
|
|
112
|
+
],
|
|
113
|
+
"max_rows": 10,
|
|
114
|
+
"rename": true,
|
|
115
|
+
"hint": "Satu baris per jenis atau kelas yang pemilik sebut; isi nama dan jumlah unit walau tarifnya belum jelas. Jaminan berupa KTP, motor, paspor, atau dokumen bukan deposit uang. Denda yang pemilik sebut per jam tidak diisi ke denda per hari; sebutkan di unclear. Untuk sewa harian, tarif per malam sama dengan tarif per hari; isi dan sebutkan di unclear supaya pemilik mengecek. Tarif yang pemilik sebut per acara atau per pemakaian (tenda, sound, dekor hajatan) diisi ke rate_per_event, bukan daily_rate, dan tidak perlu disebut di unclear.",
|
|
116
|
+
"refs": {
|
|
117
|
+
"item": "item"
|
|
118
|
+
},
|
|
119
|
+
"count_field": "units",
|
|
120
|
+
"count_word": "unit",
|
|
121
|
+
"save_requires": [
|
|
122
|
+
"daily_rate"
|
|
123
|
+
],
|
|
124
|
+
"fallbacks": [
|
|
125
|
+
{
|
|
126
|
+
"field": "daily_rate",
|
|
127
|
+
"from": "rate_per_event",
|
|
128
|
+
"note": "Tarif per acara aku catat sebagai tarif sekali sewa: satu acara dihitung satu hari sewa. Kalau acaranya lebih dari sehari, ubah tarifnya nanti."
|
|
129
|
+
}
|
|
130
|
+
]
|
|
131
|
+
}
|
|
132
|
+
],
|
|
133
|
+
"rename": {
|
|
134
|
+
"rental_item": "{Word}",
|
|
135
|
+
"rental_unit": "Unit {word}",
|
|
136
|
+
"rental_checkout": "Serah {word} keluar",
|
|
137
|
+
"rental_return": "Terima {word} kembali",
|
|
138
|
+
"rental_schedule": "Jadwal {word}"
|
|
139
|
+
},
|
|
140
|
+
"menu": {
|
|
141
|
+
"rental_booking": "Pesanan sewa dari pelanggan: tanggal ambil, tanggal kembali, dan berapa unit. Jadwal bentrok langsung ketahuan.",
|
|
142
|
+
"rental_checkout": "Catatan saat barang dibawa penyewa: unit mana dan kondisinya.",
|
|
143
|
+
"rental_return": "Catatan saat barang kembali: kondisi, telat atau tidak, dan dendanya.",
|
|
144
|
+
"rental_schedule": "Kalender unit: mana yang keluar, mana yang tersedia.",
|
|
145
|
+
"rental_item": "Daftar yang kamu sewakan, dengan jumlah unit, tarif, deposit, dan denda.",
|
|
146
|
+
"rental_unit": "Unit satu per satu (misal per plat nomor), kalau tiap unit perlu dicatat terpisah.",
|
|
147
|
+
"customer": "Daftar penyewamu dan riwayat sewanya."
|
|
148
|
+
},
|
|
149
|
+
"rename_groups": {
|
|
150
|
+
"Sewa alat": "Sewa {word}",
|
|
151
|
+
"Alat dan pelanggan": "{Word} dan pelanggan"
|
|
152
|
+
},
|
|
153
|
+
"rename_word": "alat",
|
|
154
|
+
"rename_fields": [
|
|
155
|
+
"rental_item",
|
|
156
|
+
"rental_unit",
|
|
157
|
+
"rental_booking",
|
|
158
|
+
"rental_checkout",
|
|
159
|
+
"rental_return",
|
|
160
|
+
"rental_schedule"
|
|
161
|
+
]
|
|
162
|
+
}
|
|
@@ -67,15 +67,23 @@ fields:
|
|
|
67
67
|
- name: work_order
|
|
68
68
|
type: data
|
|
69
69
|
label: {id: No. work order}
|
|
70
|
+
# manpower orders (jasa_proyek); a distributor's order form does not show them (C1-2, kartu t_5b5a3ae5)
|
|
71
|
+
depends_on: "!app_installed('distribution') || app_installed('jasa_proyek')"
|
|
70
72
|
- name: site
|
|
71
73
|
type: data
|
|
72
74
|
label: {id: Lokasi kerja}
|
|
75
|
+
# manpower orders (jasa_proyek); a distributor's order form does not show them (C1-2, kartu t_5b5a3ae5)
|
|
76
|
+
depends_on: "!app_installed('distribution') || app_installed('jasa_proyek')"
|
|
73
77
|
- name: start_date
|
|
74
78
|
type: date
|
|
75
79
|
label: {id: Mulai}
|
|
80
|
+
# manpower orders (jasa_proyek); a distributor's order form does not show them (C1-2, kartu t_5b5a3ae5)
|
|
81
|
+
depends_on: "!app_installed('distribution') || app_installed('jasa_proyek')"
|
|
76
82
|
- name: end_date
|
|
77
83
|
type: date
|
|
78
84
|
label: {id: Selesai}
|
|
85
|
+
# manpower orders (jasa_proyek); a distributor's order form does not show them (C1-2, kartu t_5b5a3ae5)
|
|
86
|
+
depends_on: "!app_installed('distribution') || app_installed('jasa_proyek')"
|
|
79
87
|
- name: items
|
|
80
88
|
type: table
|
|
81
89
|
of: customer_order_item
|
|
@@ -29,6 +29,8 @@ fields:
|
|
|
29
29
|
to: outlet
|
|
30
30
|
label: {id: Diterima di}
|
|
31
31
|
required: true
|
|
32
|
+
# staff with one outlet do not pick it (C1-2, kartu t_5b5a3ae5); head office with several picks as before
|
|
33
|
+
default: "user.outlets.size() == 1 ? user.outlets[0] : ''"
|
|
32
34
|
in_list: true
|
|
33
35
|
- name: received_on
|
|
34
36
|
type: date
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/flow.json
|
|
2
|
+
name: work_site_supervisor_changed
|
|
3
|
+
label: {id: Pengawas lokasi berganti}
|
|
4
|
+
# assignment.supervisor is computed on save. When a site gets (or changes) its supervisor, the assignments still running
|
|
5
|
+
# there are saved again, so the clock-ins from now on name the new supervisor. Logs keep the supervisor stamped at their
|
|
6
|
+
# clock-in: re-saving a held log would void its approval (kernel), and a day belongs to whoever kept the site that day.
|
|
7
|
+
on: work_site.updated
|
|
8
|
+
if: event.supervisor != event.before.supervisor
|
|
9
|
+
steps:
|
|
10
|
+
- find_all: assignment
|
|
11
|
+
where: work_site == event.name && end_date >= today()
|
|
12
|
+
limit: 500
|
|
13
|
+
as: open
|
|
14
|
+
- for_each: open
|
|
15
|
+
as: a
|
|
16
|
+
do:
|
|
17
|
+
- update: a
|
|
18
|
+
set:
|
|
19
|
+
work_site: a.work_site
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/flow.json
|
|
2
|
+
name: worker_employee_changed
|
|
3
|
+
label: {id: Akun absen tenaga kerja berubah}
|
|
4
|
+
# A worker linked to an employee record after their assignments were made (the owner invites them in Tim later) must see
|
|
5
|
+
# those assignments on the phone: the assignments still running get the worker's employee again (assignment.employee is
|
|
6
|
+
# computed on save). Ended assignments keep the old value; their logs are history.
|
|
7
|
+
on: worker.updated
|
|
8
|
+
if: event.employee != event.before.employee
|
|
9
|
+
steps:
|
|
10
|
+
- find_all: assignment
|
|
11
|
+
where: worker == event.name && end_date >= today()
|
|
12
|
+
limit: 200
|
|
13
|
+
as: open
|
|
14
|
+
- for_each: open
|
|
15
|
+
as: a
|
|
16
|
+
do:
|
|
17
|
+
- update: a
|
|
18
|
+
set:
|
|
19
|
+
worker: a.worker
|
|
@@ -41,6 +41,12 @@ fields:
|
|
|
41
41
|
- {name: site_lat, type: float, label: {id: Lintang lokasi absen}, read_only: true, compute: "work_site != '' ? work_site.lat : 0"}
|
|
42
42
|
- {name: site_lng, type: float, label: {id: Bujur lokasi absen}, read_only: true, compute: "work_site != '' ? work_site.lng : 0"}
|
|
43
43
|
- {name: site_radius_m, type: int, label: {id: Radius absen (m)}, read_only: true, compute: "work_site != '' ? work_site.radius_m : 0"}
|
|
44
|
+
# The worker's employee record (rangka-os contract 0056): the field worker's row scope (roles/field_worker.rk) shows the
|
|
45
|
+
# assignments that name them. Copied from the worker on every save; flow worker_employee_changed refreshes the open
|
|
46
|
+
# assignments when the worker gets (or changes) an employee record.
|
|
47
|
+
- {name: employee, type: link, to: user, label: {id: Karyawan}, read_only: true, hidden: true, compute: "worker != '' ? worker.employee : ''"}
|
|
48
|
+
# The site's supervisor (work_site.supervisor): the site supervisor's row scope (roles/site_supervisor.rk).
|
|
49
|
+
- {name: supervisor, type: link, to: user, label: {id: Pengawas lokasi}, read_only: true, hidden: true, compute: "work_site != '' ? work_site.supervisor : ''"}
|
|
44
50
|
# For the clock screen (screens/absen.rk): the worker picks today's assignment as the place to clock in.
|
|
45
51
|
- {name: site_name, type: data, label: {id: Nama lokasi absen}, read_only: true, compute: "work_site != '' ? work_site.site_name : ''"}
|
|
46
52
|
- {name: site_point, type: geo, label: {id: Titik lokasi absen}, read_only: true, hidden: true, compute: "work_site != '' ? {'lat': site_lat, 'lng': site_lng} : ''"}
|
|
@@ -38,12 +38,22 @@ permissions:
|
|
|
38
38
|
- {role: project_admin, read: true, create: true, write: true, delete: true, submit: true, cancel: true, amend: true, export: true, print: true}
|
|
39
39
|
- {role: finance_manager, read: true, export: true}
|
|
40
40
|
fields:
|
|
41
|
+
# The clock screen sends only the assignment: the worker is the assignment's (rule assignment_of_worker).
|
|
41
42
|
- name: worker
|
|
42
43
|
type: link
|
|
43
44
|
to: worker
|
|
44
45
|
label: {id: Tenaga kerja}
|
|
45
46
|
required: true
|
|
46
47
|
in_list: true
|
|
48
|
+
default: assignment.worker
|
|
49
|
+
# The worker's employee record (rangka-os contract 0056): the field worker's row scope reads and writes the logs that name
|
|
50
|
+
# them (roles/field_worker.rk), so a worker cannot clock in for someone else.
|
|
51
|
+
- {name: employee, type: link, to: user, label: {id: Karyawan}, read_only: true, hidden: true, compute: "worker != '' ? worker.employee : ''"}
|
|
52
|
+
# The site's supervisor when the worker clocked in (the assignment's, which follows work_site.supervisor): they read the
|
|
53
|
+
# log and decide it when held (row scope supervisor, roles/site_supervisor.rk). Stamped once, like the site point: a later
|
|
54
|
+
# change of supervisor leaves the day with the one who kept the site that day, and a held approval is not voided by a
|
|
55
|
+
# re-save (audit 2026-11-15 F1, F2). The owner may always decide a held log.
|
|
56
|
+
- {name: supervisor, type: link, to: user, label: {id: Pengawas lokasi}, read_only: true, hidden: true, default: "assignment != '' ? assignment.supervisor : ''"}
|
|
47
57
|
# The name, for the worker and the supervisor, who may not read worker records (they carry pay).
|
|
48
58
|
- name: worker_name
|
|
49
59
|
type: data
|
|
@@ -183,10 +193,12 @@ rules:
|
|
|
183
193
|
|| (clock_in.startsWith(work_date - duration(1)) && clock_in >= (work_date - duration(1)) + 'T15:00:00'))
|
|
184
194
|
: clock_in.startsWith(work_date))
|
|
185
195
|
message: {id: 'Jam masuk harus di tanggal absen'}
|
|
196
|
+
# Kept strict: payroll counts attendance days, so a clock-out not after the clock-in (a mis-tap) must not make a paid
|
|
197
|
+
# day. The message says what to do instead of only what is wrong (C1-2, kartu t_5b5a3ae5).
|
|
186
198
|
- name: out_after_in
|
|
187
199
|
on: save
|
|
188
200
|
check: clock_out == '' || (clock_in != '' && clock_out > clock_in)
|
|
189
|
-
message: {id: 'Jam keluar harus sesudah jam masuk'}
|
|
201
|
+
message: {id: 'Jam keluar harus sesudah jam masuk. Kalau tadi salah tekan masuk, minta admin proyek membatalkan absennya.'}
|
|
190
202
|
- name: overtime_range
|
|
191
203
|
on: save
|
|
192
204
|
check: overtime_hours >= 0 && overtime_hours <= 12
|
|
@@ -6,8 +6,9 @@ naming: LOK-{###}
|
|
|
6
6
|
title_field: site_name
|
|
7
7
|
# Where workers clock in: a client's factory, a building a guard keeps, an office a cleaner works in (A2, plans/layar-kerja.md
|
|
8
8
|
# §4.1, the `site` slot of the clock screen in contract 0030). A clock-in further than radius_m from the point (lat, lng) is
|
|
9
|
-
# kept, not refused, and waits for the site supervisor (attendance_log). The site supervisor
|
|
10
|
-
# `
|
|
9
|
+
# kept, not refused, and waits for the site supervisor (attendance_log). The site supervisor is the employee record named in
|
|
10
|
+
# `supervisor` (rangka-os contract 0056: a member's outlets are outlet records only, so sites are no longer kept there); their
|
|
11
|
+
# row scope is the sites, assignments and logs that name them, see roles/site_supervisor.rk.
|
|
11
12
|
permissions:
|
|
12
13
|
- {role: project_admin, read: true, create: true, write: true, delete: true, export: true, print: true}
|
|
13
14
|
- {role: finance_manager, read: true}
|
|
@@ -25,6 +26,14 @@ fields:
|
|
|
25
26
|
to: customer
|
|
26
27
|
label: {id: Klien}
|
|
27
28
|
in_list: true
|
|
29
|
+
# The mandor or danru of this site (an employee in Tim with the role Pengawas lokasi): sees its logs and decides the held
|
|
30
|
+
# ones. One supervisor per site; a supervisor may keep several sites. Name them before the workers clock in: each log keeps
|
|
31
|
+
# the supervisor of its clock-in, and flow work_site_supervisor_changed hands the running assignments to a new one.
|
|
32
|
+
- name: supervisor
|
|
33
|
+
type: link
|
|
34
|
+
to: user
|
|
35
|
+
label: {id: Pengawas lokasi}
|
|
36
|
+
in_list: true
|
|
28
37
|
- name: address
|
|
29
38
|
type: text
|
|
30
39
|
label: {id: Alamat}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/module.json
|
|
2
2
|
name: projects
|
|
3
|
-
version: 1.
|
|
3
|
+
version: 1.3.0
|
|
4
4
|
title: {id: Proyek, en: Projects}
|
|
5
5
|
summary:
|
|
6
6
|
id: Proyek dengan penugasan, absensi, biaya, termin tagihan dan untung per proyek.
|
|
7
7
|
en: Projects with assignments, attendance, costs, milestone billing and profit per project.
|
|
8
8
|
category: operations
|
|
9
9
|
icon: briefcase-line
|
|
10
|
-
requires: {rangka: '>=0.5', contacts: ^1.0, users: ^1.0, workforce: ^1.
|
|
10
|
+
requires: {rangka: '>=0.5', contacts: ^1.0, users: ^1.0, workforce: ^1.1}
|
|
11
11
|
optional: {orders: ^1.0, invoicing: ^1.0, procurement: ^1.0, payroll: ^1.0}
|
|
@@ -4,6 +4,7 @@ label: {id: Pekerja lapangan}
|
|
|
4
4
|
description: {id: 'Absen masuk dan pulang di lokasi kerja, dan melihat absennya sendiri'}
|
|
5
5
|
# Works from the phone: the clock screen full screen (work shell, contract 0030 §3), no sidebar.
|
|
6
6
|
desk: false
|
|
7
|
-
# Contract 0010 §5: records whose
|
|
8
|
-
# worker sees only their own logs and assignments.
|
|
9
|
-
|
|
7
|
+
# Contract 0010 §5: records whose `employee` is the member's own employee record (user.name, a users.user record since
|
|
8
|
+
# contract 0056), so a worker sees only their own logs and assignments. The worker record links to it (worker.employee);
|
|
9
|
+
# assignments and logs copy it. Pay and selling rates of an assignment are hidden (contract 0027).
|
|
10
|
+
scope: {field: employee, from: '[user.name]'}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
name: site_supervisor
|
|
3
3
|
label: {id: Pengawas lokasi}
|
|
4
4
|
description: {id: 'Mandor atau danru: melihat absen lokasi kerjanya dan menyetujui absen di luar radius, terlambat diisi atau lembur'}
|
|
5
|
-
# Contract 0010 §5: records whose
|
|
6
|
-
#
|
|
7
|
-
|
|
5
|
+
# Contract 0010 §5: records whose `supervisor` is the member's own employee record (user.name, a users.user record since
|
|
6
|
+
# rangka-os contract 0056): the work sites that name them, and the assignments and logs of those sites (copied from
|
|
7
|
+
# work_site.supervisor). Contract 0056 keeps a member's outlets to outlet records, so sites are no longer listed there.
|
|
8
|
+
scope: {field: supervisor, from: '[user.name]'}
|
|
@@ -13,7 +13,9 @@ device: phone
|
|
|
13
13
|
needs: [location, photo]
|
|
14
14
|
clock:
|
|
15
15
|
# The worker's own logs (row scope worker); the open one is the newest with a clock-in and no clock-out.
|
|
16
|
-
|
|
16
|
+
# The log names the assignment; its worker follows (attendance_log.worker default), and the row scope (employee) keeps
|
|
17
|
+
# it to the worker's own.
|
|
18
|
+
record: {model: attendance_log, filter: "docstatus == 0"}
|
|
17
19
|
in: {field: clock_in, location: in_pos, photo: in_photo}
|
|
18
20
|
out: {field: clock_out, location: out_pos, photo: out_photo}
|
|
19
21
|
site: {model: assignment, link: assignment, filter: "start_date <= today() && end_date >= today() && work_site != ''", title: site_name, location: site_point, radius_m: site_radius_m}
|
|
@@ -15,6 +15,8 @@ fields:
|
|
|
15
15
|
to: outlet
|
|
16
16
|
label: {id: Outlet}
|
|
17
17
|
required: true
|
|
18
|
+
# staff with one outlet do not pick it (C1-2, kartu t_5b5a3ae5); head office with several picks as before
|
|
19
|
+
default: "user.outlets.size() == 1 ? user.outlets[0] : ''"
|
|
18
20
|
in_list: true
|
|
19
21
|
- name: count_date
|
|
20
22
|
type: date
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/model.json
|
|
2
2
|
name: user
|
|
3
|
-
label: {id:
|
|
3
|
+
label: {id: Karyawan, en: Employee}
|
|
4
4
|
icon: user
|
|
5
5
|
title_field: full_name
|
|
6
6
|
naming: USR-{###}
|
|
@@ -20,10 +20,39 @@ fields:
|
|
|
20
20
|
label: {id: Nama}
|
|
21
21
|
required: true
|
|
22
22
|
in_list: true
|
|
23
|
-
- name:
|
|
23
|
+
- name: employee_no
|
|
24
24
|
type: data
|
|
25
|
-
label: {id:
|
|
26
|
-
|
|
25
|
+
label: {id: Nomor karyawan}
|
|
26
|
+
- name: phone
|
|
27
|
+
type: phone
|
|
28
|
+
label: {id: Nomor telepon}
|
|
29
|
+
hidden_for: [cashier, collector, course_admin, field_sales, field_worker, finance_manager, instructor, kitchen, outlet_staff, project_admin, purchasing_manager, rental_staff, sales_manager, sales_rep, site_supervisor]
|
|
27
30
|
- name: email
|
|
28
31
|
type: data
|
|
29
32
|
label: {id: Email}
|
|
33
|
+
read_only: true
|
|
34
|
+
hidden_for: [cashier, collector, course_admin, field_sales, field_worker, finance_manager, instructor, kitchen, outlet_staff, project_admin, purchasing_manager, rental_staff, sales_manager, sales_rep, site_supervisor]
|
|
35
|
+
- name: role
|
|
36
|
+
type: data
|
|
37
|
+
label: {id: Peran}
|
|
38
|
+
read_only: true
|
|
39
|
+
in_list: true
|
|
40
|
+
- {name: outlets, type: table, of: user_outlet, label: {id: Outlet}, read_only: true, depends_on: app_installed('outlets')}
|
|
41
|
+
- name: access
|
|
42
|
+
type: select
|
|
43
|
+
label: {id: Akses}
|
|
44
|
+
help: {id: Akses diatur di Tim.}
|
|
45
|
+
default: "'none'"
|
|
46
|
+
read_only: true
|
|
47
|
+
in_list: true
|
|
48
|
+
chip: true
|
|
49
|
+
options:
|
|
50
|
+
- {value: active, label: {id: Aktif}}
|
|
51
|
+
- {value: pending, label: {id: Menunggu}}
|
|
52
|
+
- {value: removed, label: {id: Dicabut}}
|
|
53
|
+
- {value: none, label: {id: Tanpa akses}}
|
|
54
|
+
- name: account_id
|
|
55
|
+
type: int
|
|
56
|
+
label: {id: ID akun}
|
|
57
|
+
read_only: true
|
|
58
|
+
hidden_for: [cashier, collector, course_admin, field_sales, field_worker, finance_manager, head_office, instructor, kitchen, outlet_staff, project_admin, purchasing_manager, rental_staff, sales_manager, sales_rep, site_supervisor]
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/model.json
|
|
2
|
+
# One outlet a member works at. Rows are written from Tim (contract 0056), not edited on the record.
|
|
3
|
+
name: user_outlet
|
|
4
|
+
is_child: true
|
|
5
|
+
fields:
|
|
6
|
+
- {name: outlet, type: link, to: outlet, label: {id: Outlet}, read_only: true, in_list: true}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/module.json
|
|
2
2
|
name: users
|
|
3
|
-
version: 1.
|
|
4
|
-
title: {id:
|
|
3
|
+
version: 1.3.0
|
|
4
|
+
title: {id: Karyawan, en: Employees}
|
|
5
5
|
summary:
|
|
6
6
|
id: Orang yang memakai Rangka di usaha kamu.
|
|
7
7
|
en: The people who use Rangka in your business.
|
|
8
8
|
category: people
|
|
9
9
|
icon: user-line
|
|
10
10
|
requires: {rangka: '>=0.5'}
|
|
11
|
+
optional: {outlets: ^1.5}
|
|
@@ -68,6 +68,15 @@ fields:
|
|
|
68
68
|
type: check
|
|
69
69
|
label: {id: Aktif}
|
|
70
70
|
default: 'true'
|
|
71
|
+
# The employee record (Karyawan, users.user) of a worker who signs in and clocks in on their phone (rangka-os contract
|
|
72
|
+
# 0056: a member's record is always a user record, made or picked in Tim). The field worker's row scope reads it through
|
|
73
|
+
# `employee` on assignments and logs (projects/roles/field_worker.rk). One worker per employee.
|
|
74
|
+
- name: employee
|
|
75
|
+
type: link
|
|
76
|
+
to: user
|
|
77
|
+
label: {id: Karyawan (akun absen)}
|
|
78
|
+
help: {id: 'Karyawan di Tim yang absen di HP sebagai tenaga kerja ini.'}
|
|
79
|
+
unique: true
|
|
71
80
|
- name: certifications
|
|
72
81
|
type: table
|
|
73
82
|
of: certification
|