@rangka-os/create 0.5.0-alpha.11 → 0.5.0-alpha.13

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.
Files changed (34) hide show
  1. package/package.json +1 -1
  2. package/template/base/apps/jasa_proyek/app.rk +1 -1
  3. package/template/base/apps/ritel_cabang/dashboards/ritel_stock.rk +4 -4
  4. package/template/base/modules/accounting/flows/gl_cash_advance_post.rk +33 -0
  5. package/template/base/modules/accounting/flows/gl_cash_advance_reverse.rk +194 -0
  6. package/template/base/modules/accounting/models/gl_entry.rk +1 -1
  7. package/template/base/modules/accounting/module.rk +1 -1
  8. package/template/base/modules/coretax/module.rk +1 -1
  9. package/template/base/modules/coretax/print/coretax_bupot.rk +10 -5
  10. package/template/base/modules/coretax/print/coretax_faktur.rk +12 -7
  11. package/template/base/modules/coretax/print/coretax_faktur.xml +4 -0
  12. package/template/base/modules/invoicing/models/sales_invoice.rk +3 -2
  13. package/template/base/modules/invoicing/module.rk +1 -1
  14. package/template/base/modules/outlet_sales/flows/sales_cancel_guard.rk +5 -1
  15. package/template/base/modules/outlet_sales/models/pos_refund.rk +4 -1
  16. package/template/base/modules/outlet_sales/module.rk +1 -1
  17. package/template/base/modules/payroll/flows/cash_advance_cancel_guard.rk +15 -0
  18. package/template/base/modules/payroll/flows/payslip_advance_guard.rk +20 -0
  19. package/template/base/modules/payroll/flows/payslip_casual_guard.rk +19 -0
  20. package/template/base/modules/payroll/flows/payslip_from_recap.rk +1 -1
  21. package/template/base/modules/payroll/flows/payslip_ytd_guard.rk +3 -1
  22. package/template/base/modules/payroll/flows/payslip_ytd_on_create.rk +3 -1
  23. package/template/base/modules/payroll/models/cash_advance.rk +53 -0
  24. package/template/base/modules/payroll/models/payroll_guard.rk +15 -0
  25. package/template/base/modules/payroll/models/payroll_profile.rk +11 -1
  26. package/template/base/modules/payroll/models/payslip.rk +66 -7
  27. package/template/base/modules/payroll/module.rk +1 -1
  28. package/template/base/modules/payroll/print/payslip.html +4 -3
  29. package/template/base/modules/procurement/models/vendor_bill.rk +3 -2
  30. package/template/base/modules/procurement/module.rk +1 -1
  31. package/template/base/modules/projects/models/assignment.rk +2 -2
  32. package/template/base/modules/projects/models/timesheet.rk +5 -0
  33. package/template/base/modules/projects/module.rk +1 -1
  34. package/template/base/modules/workforce/models/worker.rk +4 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rangka-os/create",
3
- "version": "0.5.0-alpha.11",
3
+ "version": "0.5.0-alpha.13",
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",
@@ -40,7 +40,7 @@ menu:
40
40
  - group: {id: Tenaga kerja}
41
41
  items: [worker]
42
42
  - group: {id: Penggajian}
43
- items: [payroll_run, payslip, payroll_close, payroll_profile]
43
+ items: [payroll_run, payslip, payroll_close, payroll_profile, cash_advance]
44
44
  - group: {id: Keuangan}
45
45
  items: [payment, bank_transaction, invoice_reminder, withholding, vendor_bill, bank_account]
46
46
  - group: {id: Pembelian}
@@ -50,12 +50,12 @@ widgets:
50
50
  type: chart
51
51
  chart: bar
52
52
  label: {id: Barang laku (qty)}
53
- description: {id: 'Qty terjual per barang pada periode, semua cabang'}
53
+ description: {id: 'Qty terjual per barang pada periode, semua cabang, dikurangi yang kembali ke stok'}
54
54
  model: stock_move
55
55
  group_by: item
56
56
  aggregate: sum
57
57
  field: sold_qty
58
- filter: voucher_type == 'outlet_sales'
58
+ filter: "voucher_type == 'outlet_sales' || voucher_type == 'outlet_return'"
59
59
  period: posting_date
60
60
  sort: -value
61
61
  limit: 10
@@ -64,12 +64,12 @@ widgets:
64
64
  type: chart
65
65
  chart: bar
66
66
  label: {id: Barang laku (harga pokok)}
67
- description: {id: 'Nilai harga pokok yang keluar karena penjualan'}
67
+ description: {id: 'Nilai harga pokok yang keluar karena penjualan, dikurangi yang kembali ke stok'}
68
68
  model: stock_move
69
69
  group_by: item
70
70
  aggregate: sum
71
71
  field: sold_cost
72
- filter: voucher_type == 'outlet_sales'
72
+ filter: "voucher_type == 'outlet_sales' || voucher_type == 'outlet_return'"
73
73
  period: posting_date
74
74
  sort: -value
75
75
  limit: 10
@@ -0,0 +1,33 @@
1
+ # yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/flow.json
2
+ # Generated by scripts/gen_accounting_flows.py; edit POSTINGS there, not this file.
3
+ name: gl_cash_advance_post
4
+ label: {id: Jurnal kasbon}
5
+ on: cash_advance.submitted
6
+ steps:
7
+ - find_all: period_close
8
+ where: docstatus == 1
9
+ sort: -closed_until
10
+ limit: 1
11
+ as: locks
12
+ - create: gl_entry
13
+ if: "(event.amount) != 0"
14
+ set:
15
+ posting_date: "event.advance_date"
16
+ account: "'11330'"
17
+ amount: "event.amount"
18
+ voucher_type: event.model
19
+ voucher: event.name
20
+ entry: "'post'"
21
+ line: "'1'"
22
+ lock_date: "locks.size() > 0 ? locks[0].closed_until : null"
23
+ - create: gl_entry
24
+ if: "(0 - event.amount) != 0"
25
+ set:
26
+ posting_date: "event.advance_date"
27
+ account: "event.method == 'cash' ? '11100' : '11200'"
28
+ amount: "0 - event.amount"
29
+ voucher_type: event.model
30
+ voucher: event.name
31
+ entry: "'post'"
32
+ line: "'2'"
33
+ lock_date: "locks.size() > 0 ? locks[0].closed_until : null"
@@ -0,0 +1,194 @@
1
+ # yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/flow.json
2
+ # Generated by scripts/gen_accounting_flows.py; edit POSTINGS there, not this file.
3
+ # The opposite of every line the document posted, on the post's own date, so a cancelled document nets to 0
4
+ # in its period. A document submitted before the accounting module was installed posted nothing and is not
5
+ # reversed. Amending posts the new document again.
6
+ name: gl_cash_advance_reverse
7
+ label: {id: Jurnal kasbon dibatalkan}
8
+ on: cash_advance.cancelled
9
+ steps:
10
+ - find_all: gl_entry
11
+ where: voucher_type == event.model && voucher == event.name && entry == 'post'
12
+ sort: line
13
+ as: posts
14
+ - find_all: period_close
15
+ where: docstatus == 1
16
+ sort: -closed_until
17
+ limit: 1
18
+ as: locks
19
+ - create: gl_entry
20
+ if: posts.size() > 0
21
+ set:
22
+ posting_date: posts[0].posting_date
23
+ account: posts[0].account
24
+ amount: 0 - posts[0].amount
25
+ voucher_type: posts[0].voucher_type
26
+ voucher: posts[0].voucher
27
+ entry: "'reverse'"
28
+ line: posts[0].line
29
+ reverses: posts[0].name
30
+ outlet: posts[0].outlet
31
+ project: posts[0].project
32
+ party: posts[0].party
33
+ against: posts[0].against
34
+ lock_date: "locks.size() > 0 ? locks[0].closed_until : null"
35
+ - create: gl_entry
36
+ if: posts.size() > 1
37
+ set:
38
+ posting_date: posts[1].posting_date
39
+ account: posts[1].account
40
+ amount: 0 - posts[1].amount
41
+ voucher_type: posts[1].voucher_type
42
+ voucher: posts[1].voucher
43
+ entry: "'reverse'"
44
+ line: posts[1].line
45
+ reverses: posts[1].name
46
+ outlet: posts[1].outlet
47
+ project: posts[1].project
48
+ party: posts[1].party
49
+ against: posts[1].against
50
+ lock_date: "locks.size() > 0 ? locks[0].closed_until : null"
51
+ - create: gl_entry
52
+ if: posts.size() > 2
53
+ set:
54
+ posting_date: posts[2].posting_date
55
+ account: posts[2].account
56
+ amount: 0 - posts[2].amount
57
+ voucher_type: posts[2].voucher_type
58
+ voucher: posts[2].voucher
59
+ entry: "'reverse'"
60
+ line: posts[2].line
61
+ reverses: posts[2].name
62
+ outlet: posts[2].outlet
63
+ project: posts[2].project
64
+ party: posts[2].party
65
+ against: posts[2].against
66
+ lock_date: "locks.size() > 0 ? locks[0].closed_until : null"
67
+ - create: gl_entry
68
+ if: posts.size() > 3
69
+ set:
70
+ posting_date: posts[3].posting_date
71
+ account: posts[3].account
72
+ amount: 0 - posts[3].amount
73
+ voucher_type: posts[3].voucher_type
74
+ voucher: posts[3].voucher
75
+ entry: "'reverse'"
76
+ line: posts[3].line
77
+ reverses: posts[3].name
78
+ outlet: posts[3].outlet
79
+ project: posts[3].project
80
+ party: posts[3].party
81
+ against: posts[3].against
82
+ lock_date: "locks.size() > 0 ? locks[0].closed_until : null"
83
+ - create: gl_entry
84
+ if: posts.size() > 4
85
+ set:
86
+ posting_date: posts[4].posting_date
87
+ account: posts[4].account
88
+ amount: 0 - posts[4].amount
89
+ voucher_type: posts[4].voucher_type
90
+ voucher: posts[4].voucher
91
+ entry: "'reverse'"
92
+ line: posts[4].line
93
+ reverses: posts[4].name
94
+ outlet: posts[4].outlet
95
+ project: posts[4].project
96
+ party: posts[4].party
97
+ against: posts[4].against
98
+ lock_date: "locks.size() > 0 ? locks[0].closed_until : null"
99
+ - create: gl_entry
100
+ if: posts.size() > 5
101
+ set:
102
+ posting_date: posts[5].posting_date
103
+ account: posts[5].account
104
+ amount: 0 - posts[5].amount
105
+ voucher_type: posts[5].voucher_type
106
+ voucher: posts[5].voucher
107
+ entry: "'reverse'"
108
+ line: posts[5].line
109
+ reverses: posts[5].name
110
+ outlet: posts[5].outlet
111
+ project: posts[5].project
112
+ party: posts[5].party
113
+ against: posts[5].against
114
+ lock_date: "locks.size() > 0 ? locks[0].closed_until : null"
115
+ - create: gl_entry
116
+ if: posts.size() > 6
117
+ set:
118
+ posting_date: posts[6].posting_date
119
+ account: posts[6].account
120
+ amount: 0 - posts[6].amount
121
+ voucher_type: posts[6].voucher_type
122
+ voucher: posts[6].voucher
123
+ entry: "'reverse'"
124
+ line: posts[6].line
125
+ reverses: posts[6].name
126
+ outlet: posts[6].outlet
127
+ project: posts[6].project
128
+ party: posts[6].party
129
+ against: posts[6].against
130
+ lock_date: "locks.size() > 0 ? locks[0].closed_until : null"
131
+ - create: gl_entry
132
+ if: posts.size() > 7
133
+ set:
134
+ posting_date: posts[7].posting_date
135
+ account: posts[7].account
136
+ amount: 0 - posts[7].amount
137
+ voucher_type: posts[7].voucher_type
138
+ voucher: posts[7].voucher
139
+ entry: "'reverse'"
140
+ line: posts[7].line
141
+ reverses: posts[7].name
142
+ outlet: posts[7].outlet
143
+ project: posts[7].project
144
+ party: posts[7].party
145
+ against: posts[7].against
146
+ lock_date: "locks.size() > 0 ? locks[0].closed_until : null"
147
+ - create: gl_entry
148
+ if: posts.size() > 8
149
+ set:
150
+ posting_date: posts[8].posting_date
151
+ account: posts[8].account
152
+ amount: 0 - posts[8].amount
153
+ voucher_type: posts[8].voucher_type
154
+ voucher: posts[8].voucher
155
+ entry: "'reverse'"
156
+ line: posts[8].line
157
+ reverses: posts[8].name
158
+ outlet: posts[8].outlet
159
+ project: posts[8].project
160
+ party: posts[8].party
161
+ against: posts[8].against
162
+ lock_date: "locks.size() > 0 ? locks[0].closed_until : null"
163
+ - create: gl_entry
164
+ if: posts.size() > 9
165
+ set:
166
+ posting_date: posts[9].posting_date
167
+ account: posts[9].account
168
+ amount: 0 - posts[9].amount
169
+ voucher_type: posts[9].voucher_type
170
+ voucher: posts[9].voucher
171
+ entry: "'reverse'"
172
+ line: posts[9].line
173
+ reverses: posts[9].name
174
+ outlet: posts[9].outlet
175
+ project: posts[9].project
176
+ party: posts[9].party
177
+ against: posts[9].against
178
+ lock_date: "locks.size() > 0 ? locks[0].closed_until : null"
179
+ - create: gl_entry
180
+ if: posts.size() > 10
181
+ set:
182
+ posting_date: posts[10].posting_date
183
+ account: posts[10].account
184
+ amount: 0 - posts[10].amount
185
+ voucher_type: posts[10].voucher_type
186
+ voucher: posts[10].voucher
187
+ entry: "'reverse'"
188
+ line: posts[10].line
189
+ reverses: posts[10].name
190
+ outlet: posts[10].outlet
191
+ project: posts[10].project
192
+ party: posts[10].party
193
+ against: posts[10].against
194
+ lock_date: "locks.size() > 0 ? locks[0].closed_until : null"
@@ -146,7 +146,7 @@ rules:
146
146
  - name: bill_cost_left
147
147
  on: save
148
148
  check: against == '' || entry == 'reverse' || bill_left >= 0
149
- message: {id: 'Biaya proyek atas tagihan ini melebihi sisa nilai tagihannya. Kurangi nilainya, atau catat tanpa tagihan.'}
149
+ message: {id: 'Biaya proyek atas tagihan ini melebihi sisa nilai tagihannya. Kurangi nilainya sampai sisa tagihan.'}
150
150
  - name: reverse_matches_post
151
151
  on: save
152
152
  check: >-
@@ -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: accounting
3
- version: 1.2.0
3
+ version: 1.3.0
4
4
  title: {id: Akuntansi, en: Accounting}
5
5
  summary:
6
6
  id: Jurnal, saldo awal, tutup buku dan laporan keuangan dari transaksi yang sudah dicatat.
@@ -3,7 +3,7 @@
3
3
  # (TaxInvoiceBulk) and the unified withholding slips the firm issues (BPPU, BpuBulk), checked before download.
4
4
  # Decisions and sources: reports/keputusan-riset/09-pajak-coretax.md in the project folder.
5
5
  name: coretax
6
- version: 1.0.0
6
+ version: 1.0.1
7
7
  title: {id: Lapor pajak Coretax, en: Coretax tax filing}
8
8
  summary:
9
9
  id: Siapkan masa pajak dan berkas unduhan untuk lapor di Coretax.
@@ -14,13 +14,18 @@ related:
14
14
  sort: name
15
15
  limit: 1000
16
16
  require:
17
- - check: origin_bill_date != '' && origin_bill_date >= doc.period_start
17
+ # A bill submitted before this module was installed (or amended from one whose own origin is unknown) froze
18
+ # without its Coretax fields (origin_bill_date, recipient_*): only this message is shown for it, since filling
19
+ # in the vendor's tax data cannot change a submitted bill (audit pajak 7 Nov #8, D2).
20
+ - check: origin_bill_date != ''
21
+ message: {id: 'Tagihan ini (atau tagihan yang digantinya) diajukan sebelum ekspor Coretax dipasang: buat bukti potongnya langsung di Coretax'}
22
+ - check: origin_bill_date == '' || origin_bill_date >= doc.period_start
18
23
  message: {id: 'Tagihan ini mengganti tagihan masa sebelumnya yang bukti potongnya sudah dilaporkan: buat pembetulan bukti potong di Coretax'}
19
- - check: "size(recipient_tin) == 16 && recipient_tin.matches('^[0-9]+$')"
24
+ - check: "origin_bill_date == '' || (size(recipient_tin) == 16 && recipient_tin.matches('^[0-9]+$'))"
20
25
  message: {id: 'Pemasok belum punya NPWP atau NIK 16 angka: lengkapi Data pajak pemasok'}
21
- - check: "size(recipient_idtku) == 22 && recipient_idtku.startsWith(recipient_tin)"
26
+ - check: "origin_bill_date == '' || (size(recipient_idtku) == 22 && recipient_idtku.startsWith(recipient_tin))"
22
27
  message: {id: 'NITKU pemasok harus 22 angka dan diawali NPWP/NIK-nya'}
23
- - check: "pph23_object_code.matches('^24-10[0-6]-[0-9]{2}$')"
28
+ - check: "origin_bill_date == '' || pph23_object_code.matches('^24-10[0-6]-[0-9]{2}$')"
24
29
  message: {id: 'Kode objek PPh 23 belum diisi di tagihan (misalnya 24-104-17 jasa tenaga kerja)'}
25
- - check: "pph23_rate > 0 && pph23_amount == round(pph23_base * pph23_rate / 100)"
30
+ - check: "origin_bill_date == '' || (pph23_rate > 0 && pph23_amount == round(pph23_base * pph23_rate / 100))"
26
31
  message: {id: 'PPh 23 di tagihan tidak sama dengan DPP PPh 23 x tarif'}
@@ -15,20 +15,25 @@ related:
15
15
  sort: name
16
16
  children: true
17
17
  limit: 1000
18
+ # An invoice submitted before this module froze without its Coretax fields (efaktur_code, buyer_*): the
19
+ # efaktur_code check below names it once, the other checks skip it (audit pajak 7 Nov #8).
18
20
  require:
19
- - check: buyer_id_type != ''
21
+ - check: efaktur_code == '' || buyer_id_type != ''
20
22
  message: {id: 'Pelanggan belum punya NPWP, NIK, atau nomor paspor: lengkapi Data pajak pelanggan. Penjualan eceran tanpa identitas dilaporkan sebagai digunggung, bukan lewat file ini'}
21
- - check: "buyer_id_type != 'TIN' || (size(buyer_tin) == 16 && size(buyer_idtku) == 22 && buyer_idtku.startsWith(buyer_tin))"
23
+ - check: "efaktur_code == '' || buyer_id_type != 'TIN' || (size(buyer_tin) == 16 && size(buyer_idtku) == 22 && buyer_idtku.startsWith(buyer_tin))"
22
24
  message: {id: 'NPWP (16 angka) atau NITKU (22 angka) pelanggan belum benar'}
23
- - check: "buyer_id_type != 'National ID' || (size(buyer_doc_no) == 16 && buyer_doc_no.matches('^[0-9]+$'))"
25
+ - check: "efaktur_code == '' || buyer_id_type != 'National ID' || (size(buyer_doc_no) == 16 && buyer_doc_no.matches('^[0-9]+$'))"
24
26
  message: {id: 'NIK pelanggan harus 16 angka'}
25
- - check: buyer_name != '' && buyer_address != ''
27
+ - check: efaktur_code == '' || (buyer_name != '' && buyer_address != '')
26
28
  message: {id: 'Nama dan alamat pelanggan wajib diisi untuk faktur pajak'}
27
29
  - check: "efaktur_code != '' && items.map(i, i.coretax_unit == '' ? 1 : 0).sum() == 0"
28
30
  message: {id: 'Faktur ini diajukan sebelum ekspor Coretax dipasang: buat faktur pajaknya langsung di Coretax'}
29
- - check: origin_posting_date != '' && origin_posting_date >= doc.period_start
31
+ # an amend chain whose middle invoice froze before this module (its origin unknown): audit pajak 7 Nov D2
32
+ - check: efaktur_code == '' || origin_posting_date != ''
33
+ message: {id: 'Faktur ini mengganti faktur yang diajukan sebelum ekspor Coretax dipasang: buat faktur pajaknya langsung di Coretax'}
34
+ - check: origin_posting_date == '' || origin_posting_date >= doc.period_start
30
35
  message: {id: 'Faktur ini mengganti faktur masa sebelumnya: buat Faktur Pengganti di Coretax, jangan diimpor'}
31
- - check: "items.map(i, i.qty * 100 - round(i.qty * 100) > 0.000001 || round(i.qty * 100) - i.qty * 100 > 0.000001 ? 1 : 0).sum() == 0"
36
+ - check: "efaktur_code == '' || items.map(i, i.qty * 100 - round(i.qty * 100) > 0.000001 || round(i.qty * 100) - i.qty * 100 > 0.000001 ? 1 : 0).sum() == 0"
32
37
  message: {id: 'Jumlah barang di faktur pajak maksimal 2 desimal: pakai satuan yang lebih kecil (misalnya gram)'}
33
- - check: buyer_id_type != 'Passport' || buyer_country != 'IDN'
38
+ - check: efaktur_code == '' || buyer_id_type != 'Passport' || buyer_country != 'IDN'
34
39
  message: {id: 'Pembeli dengan paspor harus punya kode negara selain IDN di Data pajak pelanggan'}
@@ -35,6 +35,10 @@
35
35
  {{- $q := round $l.qty 2}}
36
36
  {{- $tb := round (sub $b (div (mul $r $b) $s)) 2}}{{if eq (add $i 1) (add $n)}}{{$tb = sub $inv.dpp $acc}}{{end}}{{$acc = add $acc $tb}}
37
37
  {{- $otb := round (div (mul $tb $inv.dpp_num) $inv.dpp_den) 2}}
38
+ {{- /* Line amounts are whole rupiah while Price x Qty has 2 decimals, so Price x Qty can fall a few sen under TaxBase:
39
+ then Price is raised to TaxBase / Qty (rounded up to the sen) and TotalDiscount stays 0 or a few sen, never negative
40
+ (audit pajak 7 Nov D1). */}}
41
+ {{- if eq (slice (dec (sub (round (mul $p $q) 2) $tb) 2) 0 1) "-"}}{{$p = round (div $tb $q) 2}}{{if eq (slice (dec (sub (round (mul $p $q) 2) $tb) 2) 0 1) "-"}}{{$p = add $p "0.01"}}{{end}}{{end}}
38
42
  <GoodService>
39
43
  <Opt>{{$l.coretax_opt}}</Opt>
40
44
  <Code>{{$l.coretax_code}}</Code>
@@ -286,12 +286,13 @@ fields:
286
286
  hidden: true
287
287
  compute: amended_from
288
288
  # The posting date of the first invoice of the amend chain (A -> B -> C keeps A's date), frozen at submit: an
289
- # invoice whose chain started in an earlier period is a Faktur Pengganti in Coretax, however many amends later.
289
+ # invoice whose chain started in an earlier period is a Faktur Pengganti in Coretax, however many amends later. Empty
290
+ # when the invoice it amends froze before the coretax module and was itself an amend (its origin is unknown).
290
291
  - name: origin_posting_date
291
292
  type: data
292
293
  label: {id: Tanggal faktur asal}
293
294
  hidden: true
294
- compute: "replaces == '' ? posting_date : (replaces.origin_posting_date != '' ? replaces.origin_posting_date : replaces.posting_date)"
295
+ compute: "replaces == '' ? posting_date : (replaces.origin_posting_date != '' ? replaces.origin_posting_date : (replaces.replaces == '' ? replaces.posting_date : ''))"
295
296
  # Whether rule credit_limit warned on this submit (the same expression, computed in the same step from the same
296
297
  # customer row). The rule runs before any flow lock (contract 0025 §5); flow sales_invoice_credit_recheck reads the customer
297
298
  # again after the ledger hook has locked and updated it, and refuses an invoice that is over the limit only because
@@ -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: invoicing
3
- version: 1.6.0
3
+ version: 1.6.1
4
4
  title: {id: Faktur, en: Invoicing}
5
5
  summary:
6
6
  id: Buat faktur penjualan, pilih cara bayar termasuk QRIS, dan kirim pengingat tagihan.
@@ -1,6 +1,7 @@
1
1
  # yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/flow.json
2
2
  # Inside an outlet_sales cancel: refused while a live Retur ke stok comes from it. The return's goods came in at this
3
- # sale's cost; cancelling the sale would put its goods back as well, so they would be counted back twice.
3
+ # sale's cost; cancelling the sale would put its goods back as well, so they would be counted back twice. A cancel
4
+ # that goes through marks the Retur di kasir, whose open qty is then 0 (QA stock-returns N3).
4
5
  name: sales_cancel_guard
5
6
  label: {id: Penjualan yang sudah dikembalikan ke stok tidak bisa dibatalkan}
6
7
  on: outlet_sales.cancelled
@@ -12,3 +13,6 @@ steps:
12
13
  - if: ret != null
13
14
  create: outlet_sales_guard
14
15
  set: {reason: "'sales_returned'", document: ret.name}
16
+ - update: rf
17
+ if: rf != null && ret == null
18
+ set: {sales_cancelled: true}
@@ -19,7 +19,10 @@ fields:
19
19
  - {name: date, type: date, label: {id: Tanggal penjualan}, read_only: true, in_list: true}
20
20
  - {name: items, type: table, of: pos_refund_item, label: {id: Barang diretur}, read_only: true}
21
21
  - {name: refunded_qty, type: float, label: {id: Qty diretur}, compute: "items.map(i, i.refunded_qty).sum()", in_list: true}
22
- - {name: open_qty, type: float, label: {id: Belum kembali ke stok}, compute: "items.map(i, i.refunded_qty - i.returned_qty).sum()", in_list: true}
22
+ # Set by sales_cancel_guard when the sale is cancelled: its goods went back with the cancel, nothing is left to return
23
+ # (QA stock-returns N3).
24
+ - {name: sales_cancelled, type: check, label: {id: Penjualan dibatalkan}, read_only: true, default: 'false'}
25
+ - {name: open_qty, type: float, label: {id: Belum kembali ke stok}, compute: "sales_cancelled ? 0.0 : items.map(i, i.refunded_qty - i.returned_qty).sum()", in_list: true}
23
26
  rules:
24
27
  # every field is read_only, so a record typed by a person has no sale: only the flow makes one (QA N1)
25
28
  - name: has_sales
@@ -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: outlet_sales
3
- version: 1.3.0
3
+ version: 1.4.0
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.
@@ -0,0 +1,15 @@
1
+ # yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/flow.json
2
+ name: cash_advance_cancel_guard
3
+ label: {id: Kasbon yang sudah dipotong dari gaji tidak bisa dibatalkan}
4
+ # Inside a cash_advance cancel: refused while a submitted slip repays it, since its cancel would put the cash back
5
+ # that the slip already took off the wages (Piutang karyawan below 0; audit gelombang 3 F5).
6
+ on: cash_advance.cancelled
7
+ steps:
8
+ - find: payslip
9
+ where: cash_advance == event.name && docstatus == 1
10
+ as: slip
11
+ - if: slip != null
12
+ create: payroll_guard
13
+ set:
14
+ reason: "'advance_repaid'"
15
+ document: slip.name
@@ -0,0 +1,20 @@
1
+ # yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/flow.json
2
+ name: payslip_advance_guard
3
+ label: {id: Potongan kasbon tidak melebihi kasbonnya}
4
+ # Inside a payslip submit: the live slips that repay one kasbon (this one included) never deduct more than the kasbon
5
+ # (audit gelombang 3 F5). The kasbon's own cancel is refused while one of them is submitted (cash_advance_cancel_guard).
6
+ on: payslip.submitted
7
+ steps:
8
+ - if: event.cash_advance != ''
9
+ find: cash_advance
10
+ where: name == event.cash_advance && docstatus == 1
11
+ as: ka
12
+ - if: event.cash_advance != ''
13
+ find_all: payslip
14
+ where: cash_advance == event.cash_advance && docstatus == 1 && name != event.name
15
+ as: others
16
+ - if: event.cash_advance != '' && (ka == null || others.map(p, p.other_deduction).sum() + event.other_deduction > ka.amount)
17
+ create: payroll_guard
18
+ set:
19
+ reason: "'advance_exceeded'"
20
+ 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
+ name: payslip_casual_guard
3
+ label: {id: Pindah dari pegawai tetap ke tidak tetap menutup tahun pajaknya dulu}
4
+ # Inside a payslip submit under the daily TER (casual, paid per day): a worker who was a permanent employee earlier in
5
+ # the tax year has left that employment, so their last permanent slip must be the recomputed one (last_month,
6
+ # PMK 168/2023 masa pajak terakhir); otherwise the TER withheld on those months is never settled (audit gelombang 3 F1).
7
+ on: payslip.submitted
8
+ steps:
9
+ - if: event.employment == 'casual' && event.pay_basis == 'daily'
10
+ find_all: payslip
11
+ where: worker == event.worker && tax_year == event.tax_year && tax_month < event.tax_month && docstatus == 1 && !(employment == 'casual' && pay_basis == 'daily')
12
+ sort: -tax_month
13
+ limit: 1
14
+ as: perm
15
+ - if: event.employment == 'casual' && event.pay_basis == 'daily' && size(perm) > 0 && !perm[0].last_month
16
+ create: payroll_guard
17
+ set:
18
+ reason: "'casual_after_permanent'"
19
+ document: perm[0].name
@@ -29,7 +29,7 @@ steps:
29
29
  document: other.name
30
30
  - if: prof != null && run != null
31
31
  find_all: payslip
32
- where: worker == event.worker && tax_year == run.tax_year && tax_month < run.tax_month && docstatus == 1
32
+ where: worker == event.worker && tax_year == run.tax_year && tax_month < run.tax_month && docstatus == 1 && !(employment == 'casual' && pay_basis == 'daily')
33
33
  as: prev
34
34
  - if: prof != null && run != null
35
35
  create: payslip
@@ -4,10 +4,12 @@ label: {id: Slip gaji dengan penghasilan sebelumnya yang basi tidak bisa diajuka
4
4
  # Inside the submit: when the earlier submitted months of this worker and year no longer match the slip's year-to-date
5
5
  # fields (an earlier slip was submitted or cancelled after this one was made), the submit is refused: delete the draft and make it
6
6
  # again. The December recomputation never runs on stale sums.
7
+ # Slips under the daily TER (casual, paid per day) are not part of the year: the December recomputation covers the
8
+ # months as a permanent employee only (PMK 168/2023; audit gelombang 3 F1).
7
9
  on: payslip.submitted
8
10
  steps:
9
11
  - find_all: payslip
10
- where: worker == event.worker && tax_year == event.tax_year && tax_month < event.tax_month && docstatus == 1
12
+ where: worker == event.worker && tax_year == event.tax_year && tax_month < event.tax_month && docstatus == 1 && !(employment == 'casual' && pay_basis == 'daily')
11
13
  as: prev
12
14
  - if: size(prev) != event.ytd_months || prev.map(p, p.gross_taxable).sum() != event.ytd_gross || prev.map(p, p.pph21).sum() != event.ytd_pph21 || prev.map(p, p.jht_employee + p.jp_employee).sum() != event.ytd_pension
13
15
  create: payroll_guard
@@ -4,10 +4,12 @@ label: {id: Slip gaji membaca penghasilan sebelumnya tahun ini}
4
4
  # Year to date for the December (last) recomputation: the sums of this worker's submitted slips of the same tax year in
5
5
  # earlier tax months (submitted = paid, whether or not the run is closed yet). Filled on every slip made by hand; the
6
6
  # slips a recap makes get them from payslip_from_recap (a flow's writes start no flows).
7
+ # Slips under the daily TER (casual, paid per day) are not part of the year: the December recomputation covers the
8
+ # months as a permanent employee only (PMK 168/2023; audit gelombang 3 F1).
7
9
  on: payslip.created
8
10
  steps:
9
11
  - find_all: payslip
10
- where: worker == event.worker && tax_year == event.tax_year && tax_month < event.tax_month && docstatus == 1
12
+ where: worker == event.worker && tax_year == event.tax_year && tax_month < event.tax_month && docstatus == 1 && !(employment == 'casual' && pay_basis == 'daily')
11
13
  as: prev
12
14
  - find: payslip
13
15
  where: name == event.name
@@ -0,0 +1,53 @@
1
+ # yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/model.json
2
+ name: cash_advance
3
+ label: {id: Kasbon, en: Cash advance}
4
+ icon: wallet
5
+ is_submittable: true
6
+ naming: KSB-{YYYY}-{#####}
7
+ title_field: worker
8
+ # Money lent to a worker ahead of their pay (kasbon). Submitting it books Dr Piutang karyawan (1-1330) / Cr Kas or Bank
9
+ # (accounting module), so the repayment taken from wages (payslip other_deduction, Cr 1-1330 in the payroll close)
10
+ # brings the receivable back to 0 instead of below it (audit akuntansi r4 L-i). Finance gives and records it. A slip
11
+ # links the kasbon it repays (payslip.cash_advance): the kasbon cannot be cancelled while a submitted slip repays it,
12
+ # and the live slips never deduct more than its amount (payslip_advance_guard, cash_advance_cancel_guard).
13
+ permissions:
14
+ - {role: finance_manager, read: true, create: true, write: true, delete: true, submit: true, cancel: true, amend: true, export: true, print: true}
15
+ - {role: project_admin, read: true}
16
+ fields:
17
+ - name: worker
18
+ type: link
19
+ to: worker
20
+ label: {id: Tenaga kerja}
21
+ required: true
22
+ in_list: true
23
+ - name: advance_date
24
+ type: date
25
+ label: {id: Tanggal kasbon}
26
+ required: true
27
+ default: today()
28
+ in_list: true
29
+ - name: amount
30
+ type: currency
31
+ label: {id: Jumlah}
32
+ required: true
33
+ in_list: true
34
+ - name: method
35
+ type: select
36
+ label: {id: Dibayar dari}
37
+ default: "'cash'"
38
+ options:
39
+ - {value: cash, label: {id: Kas}}
40
+ - {value: bank, label: {id: Bank}}
41
+ - name: notes
42
+ type: text
43
+ label: {id: Keperluan}
44
+ rules:
45
+ - name: amount_positive
46
+ on: save
47
+ check: amount > 0 && amount == round(amount)
48
+ message: {id: Jumlah kasbon harus rupiah bulat lebih dari 0}
49
+ views:
50
+ list:
51
+ columns: [name, advance_date, worker, amount, method]
52
+ filters: [worker]
53
+ sort: -advance_date
@@ -28,6 +28,9 @@ fields:
28
28
  - {value: invoice_tag, label: {id: Catatan faktur tenaga kerja}}
29
29
  - {value: invoice_twice, label: {id: Faktur kedua periode gaji}}
30
30
  - {value: pay_overlap, label: {id: Hari kerja dibayar dua kali}}
31
+ - {value: advance_exceeded, label: {id: Potongan melebihi kasbon}}
32
+ - {value: advance_repaid, label: {id: Kasbon sudah dipotong}}
33
+ - {value: casual_after_permanent, label: {id: Slip tetap terakhir belum dihitung ulang}}
31
34
  - name: document
32
35
  type: data
33
36
  label: {id: Dokumen}
@@ -72,3 +75,15 @@ rules:
72
75
  on: save
73
76
  check: reason != 'pay_overlap'
74
77
  message: {id: 'Pekerja ini sudah dibayar untuk sebagian hari periode ini di periode gaji lain'}
78
+ - name: advance_exceeded
79
+ on: save
80
+ check: reason != 'advance_exceeded'
81
+ message: {id: 'Potongan kasbon di slip-slip yang diajukan melebihi kasbonnya, atau kasbonnya belum diajukan: kurangi potongannya'}
82
+ - name: advance_repaid
83
+ on: save
84
+ check: reason != 'advance_repaid'
85
+ message: {id: 'Kasbon ini sudah dipotong dari slip gaji yang diajukan; batalkan slip gajinya dulu'}
86
+ - name: casual_after_permanent
87
+ on: save
88
+ check: reason != 'casual_after_permanent'
89
+ message: {id: 'Pekerja ini pegawai tetap di bulan sebelumnya tahun ini: tandai slip tetap terakhirnya sebagai masa pajak terakhir (hitung tahunan) dulu'}
@@ -60,6 +60,16 @@ fields:
60
60
  options:
61
61
  - {value: daily, label: {id: Harian (upah x hari hadir)}}
62
62
  - {value: monthly, label: {id: Bulanan (gaji pokok tetap)}}
63
+ # PMK 168/2023: a pegawai tidak tetap (tenaga kerja lepas, paid only for the days worked) who is paid per day or per
64
+ # week has PPh 21 by the daily TER (bruto sehari x TER harian; above 2.500.000 a day, 50% x Pasal 17), not the monthly
65
+ # TER, and no December recomputation. Paid monthly, the same worker takes the monthly TER: keep Tetap.
66
+ - name: employment
67
+ type: select
68
+ label: {id: Status pegawai (PPh 21)}
69
+ default: "'permanent'"
70
+ options:
71
+ - {value: permanent, label: {id: Tetap atau dibayar bulanan (TER bulanan)}}
72
+ - {value: casual, label: {id: 'Tidak tetap, dibayar harian atau mingguan (TER harian)'}}
63
73
  - name: monthly_salary
64
74
  type: currency
65
75
  label: {id: Gaji pokok per bulan}
@@ -128,7 +138,7 @@ views:
128
138
  - [ptkp_status, ter_category, active]
129
139
  - section: {id: Gaji}
130
140
  columns:
131
- - [pay_basis, monthly_salary]
141
+ - [pay_basis, employment, monthly_salary]
132
142
  - [fixed_allowance, daily_allowance]
133
143
  - section: {id: BPJS dan rekening}
134
144
  columns:
@@ -64,6 +64,13 @@ fields:
64
64
  options:
65
65
  - {value: daily, label: {id: Harian}}
66
66
  - {value: monthly, label: {id: Bulanan}}
67
+ - name: employment
68
+ type: select
69
+ label: {id: Status pegawai (PPh 21)}
70
+ default: profile.employment
71
+ options:
72
+ - {value: permanent, label: {id: Tetap atau dibayar bulanan}}
73
+ - {value: casual, label: {id: 'Tidak tetap, dibayar harian'}}
67
74
  - {name: days, type: float, label: {id: Hari hadir}, default: '0', in_list: true}
68
75
  - {name: day_rate, type: currency, label: {id: Upah per hari}, default: profile.worker.cost_day_rate}
69
76
  - {name: monthly_salary, type: currency, label: {id: Gaji pokok per bulan}, default: profile.monthly_salary}
@@ -74,10 +81,21 @@ fields:
74
81
  # overtime rate is set.
75
82
  - {name: overtime_days, type: float, label: {id: Hari ada lembur}, default: '0'}
76
83
  - {name: overtime_rate, type: currency, label: {id: Upah lembur per jam (sudah ditimbang)}, default: profile.worker.overtime_cost_rate}
84
+ # Work on a rest day or a public holiday (PP 35/2021 Pasal 31), always at the PP 35 multipliers of 1/173 of the monthly
85
+ # wage. The hours are entered per multiplier, summed over the days (the tiers count per day, so they cannot come from
86
+ # a total): 6-day week, hours 1-7 of each day 2x, the 8th 3x, the 9th-11th 4x; 5-day week, 1-8 2x, the 9th 3x, the
87
+ # 10th-12th 4x; a holiday on the shortest day of a 6-day week, 1-5 2x, the 6th 3x, the 7th-9th 4x. Audit gelombang 3 F3.
88
+ - {name: holiday_overtime_days, type: float, label: {id: Hari libur masuk kerja}, default: '0'}
89
+ - {name: holiday_hours_2x, type: float, label: {id: 'Jam hari libur dibayar 2x'}, default: '0'}
90
+ - {name: holiday_hours_3x, type: float, label: {id: 'Jam hari libur dibayar 3x'}, default: '0'}
91
+ - {name: holiday_hours_4x, type: float, label: {id: 'Jam hari libur dibayar 4x'}, default: '0'}
77
92
  # THR: months of service (12 or more = one month's wage, fewer = pro rata; under 1 = none). 0 = no THR this month.
78
93
  - {name: thr_tenure_months, type: float, label: {id: Masa kerja untuk THR (bulan)}, default: '0'}
79
94
  - {name: other_income, type: currency, label: {id: Insentif lain}, default: '0'}
80
95
  - {name: other_deduction, type: currency, label: {id: Potongan lain (kasbon)}, default: '0'}
96
+ # The kasbon this deduction repays (cash_advance of the same worker, submitted): its cancel is then refused, and the
97
+ # live slips linking it never deduct more than it (payslip_advance_guard, audit gelombang 3 F5).
98
+ - {name: cash_advance, type: link, to: cash_advance, label: {id: Kasbon yang dipotong}}
81
99
  - name: ptkp_status
82
100
  type: select
83
101
  label: {id: Status PTKP}
@@ -118,6 +136,10 @@ fields:
118
136
  type: currency
119
137
  label: {id: Lembur}
120
138
  compute: "overtime_rate > 0 ? round(overtime_hours * overtime_rate) : round(month_wage * 1.0 / 173 * (1.5 * (overtime_days < overtime_hours ? overtime_days : overtime_hours) + 2.0 * (overtime_hours - (overtime_days < overtime_hours ? overtime_days : overtime_hours))))"
139
+ - name: holiday_overtime_pay
140
+ type: currency
141
+ label: {id: Lembur hari libur}
142
+ compute: "round(month_wage * 1.0 / 173 * (2.0 * holiday_hours_2x + 3.0 * holiday_hours_3x + 4.0 * holiday_hours_4x))"
121
143
  - name: allowance_pay
122
144
  type: currency
123
145
  label: {id: Tunjangan}
@@ -129,7 +151,7 @@ fields:
129
151
  - name: cash_gross
130
152
  type: currency
131
153
  label: {id: 'Penghasilan (gaji, tunjangan, lembur, THR)'}
132
- compute: base_pay + overtime_pay + allowance_pay + thr_pay + other_income
154
+ compute: base_pay + overtime_pay + holiday_overtime_pay + allowance_pay + thr_pay + other_income
133
155
  in_list: true
134
156
  # BPJS wage: pokok + tunjangan tetap, never below the UMK of the site.
135
157
  - name: bpjs_base
@@ -173,6 +195,32 @@ fields:
173
195
  label: {id: PPh 21 TER bulan ini}
174
196
  hidden: true
175
197
  compute: "round(gross_taxable * ter_bp * (has_tax_id ? 100 : 120) / 1000000.0 - 0.5)"
198
+ # Daily TER (PP 58/2023, PMK 168/2023 Pasal 16 ayat 2) for a pegawai tidak tetap paid per day: bruto sehari = this
199
+ # slip's gross over the days worked (present + rest days worked, audit F2); up to 450.000 0%, up to 2.500.000 0,5%;
200
+ # above that the Pasal 17 layers on 50% of the gross paid (per payment, not cumulative, audit F7). x 120% without a
201
+ # tax number; truncated to the rupiah.
202
+ - name: ter_daily
203
+ type: check
204
+ label: {id: PPh 21 TER harian}
205
+ hidden: true
206
+ compute: "employment == 'casual' && pay_basis == 'daily'"
207
+ - name: daily_gross
208
+ type: currency
209
+ label: {id: Bruto sehari (TER harian)}
210
+ depends_on: ter_daily
211
+ compute: "days + holiday_overtime_days > 0 ? round(gross_taxable * 1.0 / (days + holiday_overtime_days)) : 0"
212
+ - name: daily_pph21
213
+ type: currency
214
+ label: {id: PPh 21 TER harian}
215
+ hidden: true
216
+ compute: >-
217
+ days + holiday_overtime_days <= 0 || gross_taxable * 1.0 / (days + holiday_overtime_days) <= 450000 ? 0
218
+ : (gross_taxable * 1.0 / (days + holiday_overtime_days) <= 2500000 ? round(gross_taxable * 0.5 * (has_tax_id ? 100 : 120) / 10000.0 - 0.5)
219
+ : round(((gross_taxable * 0.5 > 60000000 ? 60000000 : gross_taxable * 0.5) * 5
220
+ + (gross_taxable * 0.5 > 250000000 ? 190000000 : (gross_taxable * 0.5 > 60000000 ? gross_taxable * 0.5 - 60000000 : 0)) * 15
221
+ + (gross_taxable * 0.5 > 500000000 ? 250000000 : (gross_taxable * 0.5 > 250000000 ? gross_taxable * 0.5 - 250000000 : 0)) * 25
222
+ + (gross_taxable * 0.5 > 5000000000 ? 4500000000 : (gross_taxable * 0.5 > 500000000 ? gross_taxable * 0.5 - 500000000 : 0)) * 30
223
+ + (gross_taxable * 0.5 > 5000000000 ? gross_taxable * 0.5 - 5000000000 : 0) * 35) * (has_tax_id ? 100 : 120) / 10000.0 - 0.5))
176
224
  # Annual recomputation (last_month).
177
225
  - name: ptkp
178
226
  type: currency
@@ -208,7 +256,7 @@ fields:
208
256
  - name: pph21
209
257
  type: currency
210
258
  label: {id: PPh 21 dipotong}
211
- compute: "last_month ? year_pph21 - ytd_pph21 : ter_pph21"
259
+ compute: "ter_daily ? daily_pph21 : (last_month ? year_pph21 - ytd_pph21 : ter_pph21)"
212
260
  - name: employee_bpjs
213
261
  type: currency
214
262
  label: {id: BPJS dipotong dari pekerja}
@@ -239,7 +287,10 @@ rules:
239
287
  days >= 0 && days <= 31 && day_rate >= 0 && monthly_salary >= 0 && fixed_allowance >= 0 && daily_allowance >= 0
240
288
  && overtime_hours >= 0 && overtime_hours <= 744 && overtime_days >= 0 && overtime_days <= days + 0.0001 && overtime_rate >= 0
241
289
  && thr_tenure_months >= 0 && other_income >= 0 && other_deduction >= 0
242
- message: {id: 'Hari 0 sampai 31, hari lembur tidak melebihi hari hadir, angka tidak boleh negatif'}
290
+ && holiday_overtime_days >= 0 && holiday_overtime_days <= 31 && holiday_hours_2x >= 0 && holiday_hours_3x >= 0 && holiday_hours_4x >= 0
291
+ && holiday_hours_2x <= holiday_overtime_days * (payroll_run.workdays_per_week == 5 ? 8 : 7)
292
+ && holiday_hours_3x <= holiday_overtime_days && holiday_hours_4x <= holiday_overtime_days * 3
293
+ message: {id: 'Hari 0 sampai 31, jam hari libur per tarif tidak melebihi batas per hari (2x: 7 atau 8, 3x: 1, 4x: 3), tidak negatif'}
243
294
  - name: pay_entered
244
295
  on: submit
245
296
  check: "pay_basis == 'monthly' ? monthly_salary > 0 : (days > 0 && day_rate > 0)"
@@ -248,6 +299,10 @@ rules:
248
299
  on: save
249
300
  check: timesheet == '' || (timesheet.project == payroll_run.project && timesheet.worker == profile.worker && timesheet.docstatus == 1)
250
301
  message: {id: 'Rekap absensi harus milik pekerja dan proyek periode ini, dan sudah diajukan'}
302
+ - name: advance_of_worker
303
+ on: save
304
+ check: cash_advance == '' || (cash_advance.worker == profile.worker && cash_advance.docstatus == 1 && other_deduction > 0)
305
+ message: {id: 'Kasbon yang dipotong harus milik pekerja ini, sudah diajukan, dan potongannya diisi'}
251
306
  - name: same_tax_month
252
307
  on: save
253
308
  check: tax_year == payroll_run.tax_year && tax_month == payroll_run.tax_month
@@ -273,11 +328,15 @@ views:
273
328
  - [tax_year, tax_month, last_month, ptkp_status, has_tax_id]
274
329
  - section: {id: Kehadiran dan upah}
275
330
  columns:
276
- - [pay_basis, days, day_rate, monthly_salary, fixed_allowance, daily_allowance]
277
- - [overtime_hours, overtime_days, overtime_rate, thr_tenure_months, other_income, other_deduction]
331
+ - [pay_basis, employment, days, day_rate, monthly_salary, fixed_allowance, daily_allowance]
332
+ - [overtime_hours, overtime_days, overtime_rate, thr_tenure_months, other_income, other_deduction, cash_advance]
333
+ - section: {id: Hari libur masuk kerja}
334
+ columns:
335
+ - [holiday_overtime_days]
336
+ - [holiday_hours_2x, holiday_hours_3x, holiday_hours_4x]
278
337
  - section: {id: Penghasilan}
279
338
  columns:
280
- - [base_pay, overtime_pay, allowance_pay]
339
+ - [base_pay, overtime_pay, holiday_overtime_pay, allowance_pay]
281
340
  - [thr_pay, cash_gross]
282
341
  - section: {id: BPJS}
283
342
  columns:
@@ -285,7 +344,7 @@ views:
285
344
  - [bpjs_tk, bpjs_jp, bpjs_kes, jht_employee, jp_employee, kes_employee, employee_bpjs]
286
345
  - section: {id: PPh 21}
287
346
  columns:
288
- - [gross_taxable, ter_category, ter_bp, pph21]
347
+ - [gross_taxable, ter_category, ter_bp, daily_gross, pph21]
289
348
  - [ytd_gross, ytd_pph21, year_gross, job_cost, year_net, year_pkp, year_pph21]
290
349
  - section: {id: Bersih}
291
350
  columns:
@@ -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: payroll
3
- version: 1.0.0
3
+ version: 1.1.0
4
4
  title: {id: Penggajian, en: Payroll}
5
5
  summary:
6
6
  id: Data gaji pekerja, periode gaji, slip gaji dan tutup periode.
@@ -27,6 +27,7 @@
27
27
  <tr><td>Gaji pokok</td><td class="num">{{rupiah .Doc.base_pay}}</td></tr>
28
28
  {{if .Doc.allowance_pay}}<tr><td>Tunjangan</td><td class="num">{{rupiah .Doc.allowance_pay}}</td></tr>{{end}}
29
29
  {{if .Doc.overtime_pay}}<tr><td>Lembur</td><td class="num">{{rupiah .Doc.overtime_pay}}</td></tr>{{end}}
30
+ {{if .Doc.holiday_overtime_pay}}<tr><td>Lembur hari libur ({{.Doc.holiday_overtime_days}} hari)</td><td class="num">{{rupiah .Doc.holiday_overtime_pay}}</td></tr>{{end}}
30
31
  {{if .Doc.thr_pay}}<tr><td>THR</td><td class="num">{{rupiah .Doc.thr_pay}}</td></tr>{{end}}
31
32
  {{if .Doc.other_income}}<tr><td>Insentif</td><td class="num">{{rupiah .Doc.other_income}}</td></tr>{{end}}
32
33
  <tr class="total"><td>Jumlah penghasilan</td><td class="num">{{rupiah .Doc.cash_gross}}</td></tr>
@@ -40,8 +41,8 @@
40
41
  <tr><td>JHT 2%</td><td class="num">{{rupiah .Doc.jht_employee}}</td></tr>
41
42
  {{if .Doc.jp_employee}}<tr><td>Jaminan Pensiun 1%</td><td class="num">{{rupiah .Doc.jp_employee}}</td></tr>{{end}}
42
43
  {{if .Doc.kes_employee}}<tr><td>BPJS Kesehatan 1%</td><td class="num">{{rupiah .Doc.kes_employee}}</td></tr>{{end}}
43
- <tr><td>PPh 21{{if .Doc.last_month}} (hitung tahunan){{end}}</td><td class="num">{{rupiah .Doc.pph21}}</td></tr>
44
- {{if .Doc.other_deduction}}<tr><td>Potongan lain</td><td class="num">{{rupiah .Doc.other_deduction}}</td></tr>{{end}}
44
+ <tr><td>PPh 21{{if .Doc.ter_daily}} (TER harian){{else if .Doc.last_month}} (hitung tahunan){{end}}</td><td class="num">{{rupiah .Doc.pph21}}</td></tr>
45
+ {{if .Doc.other_deduction}}<tr><td>Potongan lain{{if .Doc.cash_advance}} (kasbon {{.Doc.cash_advance}}){{end}}</td><td class="num">{{rupiah .Doc.other_deduction}}</td></tr>{{end}}
45
46
  <tr class="total"><td>Jumlah potongan</td><td class="num">{{rupiah (sub .Doc.cash_gross .Doc.net_pay)}}</td></tr>
46
47
  </tbody>
47
48
  </table>
@@ -49,5 +50,5 @@
49
50
  </div>
50
51
  <div class="net"><span>Gaji bersih diterima</span><span>{{rupiah .Doc.net_pay}}</span></div>
51
52
  <p class="note">Ditanggung perusahaan, tidak dipotong dari gaji: JKK {{rupiah .Doc.jkk}}, JKM {{rupiah .Doc.jkm}}, JHT 3,7% {{rupiah .Doc.jht_employer}}, JP 2% {{rupiah .Doc.jp_employer}}, BPJS Kesehatan 4% {{rupiah .Doc.kes_employer}}.
52
- Dasar upah BPJS {{rupiah .Doc.bpjs_base}}. PPh 21 kategori TER {{.Doc.ter_category}}, bruto {{rupiah .Doc.gross_taxable}}.</p>
53
+ Dasar upah BPJS {{rupiah .Doc.bpjs_base}}. {{if .Doc.ter_daily}}PPh 21 TER harian, bruto sehari {{rupiah .Doc.daily_gross}}{{else}}PPh 21 kategori TER {{.Doc.ter_category}}{{end}}, bruto {{rupiah .Doc.gross_taxable}}.</p>
53
54
  {{if .Links.profile.bank_account}}<p class="note">Ditransfer ke {{.Links.profile.bank_name}} {{.Links.profile.bank_account}}.</p>{{end}}
@@ -126,7 +126,8 @@ fields:
126
126
  depends_on: app_installed('coretax')
127
127
  compute: "vendor.nitku != '' ? vendor.nitku : (vendor.npwp != '' ? vendor.npwp + '000000' : (vendor.nik != '' ? vendor.nik + '000000' : ''))"
128
128
  # The first bill of the amend chain and its date (frozen at submit): a bill whose chain started in an earlier period
129
- # had its withholding slip reported there; the correction is a pembetulan in Coretax, not a new slip.
129
+ # had its withholding slip reported there; the correction is a pembetulan in Coretax, not a new slip. Empty when the
130
+ # bill it amends froze before the coretax module and was itself an amend (its origin is unknown).
130
131
  - name: replaces
131
132
  type: link
132
133
  to: vendor_bill
@@ -137,7 +138,7 @@ fields:
137
138
  type: data
138
139
  label: {id: Tanggal tagihan asal}
139
140
  hidden: true
140
- compute: "replaces == '' ? bill_date : (replaces.origin_bill_date != '' ? replaces.origin_bill_date : replaces.bill_date)"
141
+ compute: "replaces == '' ? bill_date : (replaces.origin_bill_date != '' ? replaces.origin_bill_date : (replaces.replaces == '' ? replaces.bill_date : ''))"
141
142
  - name: amount_due
142
143
  type: currency
143
144
  label: {id: Tagihan bersih}
@@ -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.0
3
+ version: 1.1.1
4
4
  title: {id: Pembelian, en: Procurement}
5
5
  summary:
6
6
  id: Permintaan dan pesanan pembelian, barang datang dan tagihan pemasok.
@@ -73,7 +73,7 @@ fields:
73
73
  - name: cost_rate
74
74
  type: currency
75
75
  label: {id: Biaya per satuan}
76
- hidden_for: [field_worker, site_supervisor]
76
+ hidden_for: [sales_manager, purchasing_manager, head_office, outlet_staff, sales_rep, field_worker, site_supervisor]
77
77
  default: "rate_basis == 'hour' ? worker.cost_hour_rate : worker.cost_day_rate"
78
78
  # Overtime per hour on this project, from the worker unless the client agreed another rate.
79
79
  - name: overtime_rate
@@ -84,7 +84,7 @@ fields:
84
84
  - name: overtime_cost_rate
85
85
  type: currency
86
86
  label: {id: Upah lembur per jam}
87
- hidden_for: [field_worker, site_supervisor]
87
+ hidden_for: [sales_manager, purchasing_manager, head_office, outlet_staff, sales_rep, field_worker, site_supervisor]
88
88
  default: worker.overtime_cost_rate
89
89
  - name: notes
90
90
  type: text
@@ -82,9 +82,12 @@ fields:
82
82
  type: currency
83
83
  label: {id: Tarif per jam}
84
84
  default: "assignment != '' ? assignment.hour_rate : worker.hour_rate"
85
+ # The pay copied from the worker (cost_*) keeps the worker's hidden_for (contract 0027 enforces it; a copy without
86
+ # hidden_for would show the pay here).
85
87
  - name: cost_rate
86
88
  type: currency
87
89
  label: {id: Biaya per satuan}
90
+ hidden_for: [sales_manager, purchasing_manager, head_office, outlet_staff, sales_rep, field_worker, site_supervisor]
88
91
  default: "assignment != '' ? assignment.cost_rate : (rate_basis == 'hour' ? worker.cost_hour_rate : worker.cost_day_rate)"
89
92
  - name: overtime_rate
90
93
  type: currency
@@ -93,6 +96,7 @@ fields:
93
96
  - name: overtime_cost_rate
94
97
  type: currency
95
98
  label: {id: Upah lembur per jam}
99
+ hidden_for: [sales_manager, purchasing_manager, head_office, outlet_staff, sales_rep, field_worker, site_supervisor]
96
100
  default: "assignment != '' ? assignment.overtime_cost_rate : worker.overtime_cost_rate"
97
101
  - name: amount
98
102
  type: currency
@@ -102,6 +106,7 @@ fields:
102
106
  - name: cost_amount
103
107
  type: currency
104
108
  label: {id: Biaya}
109
+ hidden_for: [sales_manager, purchasing_manager, head_office, outlet_staff, sales_rep, field_worker, site_supervisor]
105
110
  compute: "round((rate_basis == 'hour' ? hours : days) * cost_rate) + round(overtime_hours * overtime_cost_rate)"
106
111
  # No pay entered for this work (G5): the cost is not 0, it is unknown. The project margin dashboard counts these so
107
112
  # a margin without labour cost is read as incomplete; fix the pay on the worker, then cancel and amend.
@@ -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: projects
3
- version: 1.1.0
3
+ version: 1.1.1
4
4
  title: {id: Proyek, en: Projects}
5
5
  summary:
6
6
  id: Proyek dengan penugasan, absensi, biaya, termin tagihan dan untung per proyek.
@@ -5,8 +5,8 @@ icon: user
5
5
  naming: WRK-{####}
6
6
  title_field: worker_name
7
7
  permissions:
8
- # Pay (cost_*_rate, overtime_cost_rate) lives on the worker and hidden_for is not enforced by the kernel, so sales and
9
- # purchasing have no access at all (audit L1): workers are managed by finance and the project admin.
8
+ # Pay (cost_*_rate, overtime_cost_rate) lives on the worker. The kernel enforces hidden_for (contract 0027), and sales
9
+ # and purchasing still have no access at all (audit L1): workers are managed by finance and the project admin.
10
10
  - {role: finance_manager, read: true, create: true, write: true, print: true}
11
11
  - {role: project_admin, read: true, create: true, write: true, print: true}
12
12
  - {role: head_office, read: true, create: true, write: true, print: true}
@@ -39,8 +39,8 @@ fields:
39
39
  type: currency
40
40
  label: {id: Tarif per jam}
41
41
  default: '0'
42
- # Pay per person: hidden in forms and lists for roles that do not need it (hidden_for is not enforced by the kernel
43
- # yet; the REST API still returns it to anyone who may read worker).
42
+ # Pay per person: hidden_for removes it from every read of these roles (API, lists, prints, exports; contract 0027).
43
+ # assignment and timesheet copy it into cost_rate, overtime_cost_rate and cost_amount, which carry the same hidden_for.
44
44
  # Pay per day (upah harian). 0 means not entered yet: timesheets of this person are then flagged cost_missing and
45
45
  # the project margin dashboard counts them, so a margin without labour cost is never read as complete.
46
46
  - name: cost_day_rate