@rangka-os/create 0.5.0-alpha.34 → 0.5.0-alpha.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/package.json +1 -1
  2. package/template/base/apps/faktur_piutang/app.rk +4 -0
  3. package/template/base/apps/faktur_piutang/skills/rangka-app-faktur-piutang/SKILL.md +35 -0
  4. package/template/base/apps/fnb_cabang/app.rk +7 -0
  5. package/template/base/apps/fnb_cabang/skills/rangka-app-fnb-cabang/SKILL.md +43 -0
  6. package/template/base/apps/jasa_proyek/app.rk +11 -1
  7. package/template/base/apps/jasa_proyek/skills/rangka-app-jasa-proyek/SKILL.md +51 -0
  8. package/template/base/apps/karyawan_gaji/app.rk +2 -0
  9. package/template/base/apps/kasir/app.rk +2 -0
  10. package/template/base/apps/pembelian_pemasok/app.rk +8 -0
  11. package/template/base/apps/pembelian_pemasok/skills/rangka-app-pembelian-pemasok/SKILL.md +43 -0
  12. package/template/base/apps/ritel_cabang/app.rk +7 -0
  13. package/template/base/apps/ritel_cabang/skills/rangka-app-ritel-cabang/SKILL.md +43 -0
  14. package/template/base/modules/accounting/flows/financial_report_compute.rk +1 -1
  15. package/template/base/modules/accounting/flows/financial_report_recompute.rk +1 -1
  16. package/template/base/modules/accounting/flows/gl_pos_sale_post.rk +38 -2
  17. package/template/base/modules/accounting/models/gl_entry.rk +3 -0
  18. package/template/base/modules/attendance/module.rk +4 -4
  19. package/template/base/modules/attendance/screens/absen_outlet.rk +3 -0
  20. package/template/base/modules/kitchen/flows/kitchen_ticket_on_draft.rk +44 -0
  21. package/template/base/modules/kitchen/flows/kitchen_ticket_on_sale.rk +6 -5
  22. package/template/base/modules/loyalty/flows/loyalty_on_sale.rk +6 -5
  23. package/template/base/modules/loyalty/flows/loyalty_on_sale_cancel.rk +2 -2
  24. package/template/base/modules/outlets/models/outlet.rk +39 -0
  25. package/template/base/modules/payroll/flows/pph21_annual_on_slip_cancel.rk +28 -0
  26. package/template/base/modules/payroll/flows/pph21_annual_on_slip_submit.rk +84 -0
  27. package/template/base/modules/payroll/models/payslip.rk +4 -0
  28. package/template/base/modules/payroll/models/pph21_annual.rk +84 -0
  29. package/template/base/modules/payroll/models/pph21_period.rk +77 -0
  30. package/template/base/modules/payroll/module.rk +3 -2
  31. package/template/base/modules/payroll/print/bukti_potong_a1.html +53 -0
  32. package/template/base/modules/payroll/print/bukti_potong_a1.rk +9 -0
  33. package/template/base/modules/payroll/print/coretax_bp21.rk +44 -0
  34. package/template/base/modules/payroll/print/coretax_bp21.xml +36 -0
  35. package/template/base/modules/payroll/print/coretax_bpa1.rk +21 -0
  36. package/template/base/modules/payroll/print/coretax_bpa1.xml +46 -0
  37. package/template/base/modules/payroll/print/coretax_bpmp.rk +23 -0
  38. package/template/base/modules/payroll/print/coretax_bpmp.xml +31 -0
  39. package/template/base/modules/pos/flows/pos_sale_merge.rk +34 -0
  40. package/template/base/modules/pos/flows/pos_sale_on_cancel.rk +3 -0
  41. package/template/base/modules/pos/flows/pos_sale_on_submit.rk +28 -1
  42. package/template/base/modules/pos/flows/pos_sale_split.rk +37 -0
  43. package/template/base/modules/pos/flows/pos_shift_on_create.rk +9 -1
  44. package/template/base/modules/pos/flows/pos_table_guard_on_create.rk +24 -0
  45. package/template/base/modules/pos/flows/pos_table_guard_on_update.rk +23 -0
  46. package/template/base/modules/pos/models/dining_area.rk +23 -0
  47. package/template/base/modules/pos/models/dining_table.rk +38 -0
  48. package/template/base/modules/pos/models/pos_guard.rk +39 -0
  49. package/template/base/modules/pos/models/pos_payment.rk +2 -0
  50. package/template/base/modules/pos/models/pos_sale.rk +153 -7
  51. package/template/base/modules/pos/models/pos_sale_item.rk +3 -0
  52. package/template/base/modules/pos/models/pos_shift.rk +11 -1
  53. package/template/base/modules/pos/module.rk +9 -4
  54. package/template/base/modules/pos/print/pos_receipt.html +5 -2
  55. package/template/base/modules/pos/print/pos_receipt_part.html +30 -0
  56. package/template/base/modules/pos/print/pos_receipt_part.rk +8 -0
  57. package/template/base/modules/pos/screens/kasir.rk +5 -3
  58. package/template/base/modules/pos/screens/kasir_meja.rk +62 -0
  59. package/template/base/modules/shifts/module.rk +1 -1
  60. package/template/base/modules/users/flows/summary_daily.rk +3 -1
  61. package/template/base/modules/users/flows/summary_monthly.rk +3 -1
  62. package/template/base/modules/users/flows/summary_weekly.rk +3 -1
@@ -126,6 +126,41 @@ fields:
126
126
  label: {id: Modal kas kasir}
127
127
  help: {id: 'Uang kembalian di laci tiap sesi kasir dibuka. Kosongkan kalau kasir yang mengisi'}
128
128
  depends_on: app_installed('pos') && (location_type == '' || location_type == 'store' || location_type == 'vehicle')
129
+ # module pos (rangka-apps#121): restaurant charges and the rounding of the bill total, set by head office. A sale copies
130
+ # them when it is created, so a receipt keeps its rates when the outlet changes later. The PBJT rate is set by the
131
+ # regional regulation (Perda), at most 10% by UU HKPD: the owner types it, Raka never picks it.
132
+ - name: service_pct
133
+ type: float
134
+ label: {id: Service charge (%)}
135
+ help: {id: 'Hanya untuk makan di sini. Isi 0 kalau tidak ada service charge'}
136
+ default: '0'
137
+ depends_on: app_installed('pos') && (location_type == '' || location_type == 'store' || location_type == 'vehicle')
138
+ - name: pbjt_pct
139
+ type: float
140
+ label: {id: 'Pajak restoran PBJT/PB1 (%)'}
141
+ help: {id: 'Tarif sesuai Perda daerahmu, paling tinggi 10. Dihitung di luar harga. Isi 0 kalau tidak ada'}
142
+ default: '0'
143
+ depends_on: app_installed('pos') && (location_type == '' || location_type == 'store' || location_type == 'vehicle')
144
+ - name: rounding_unit
145
+ type: select
146
+ label: {id: Pembulatan total}
147
+ help: {id: 'Total nota dibulatkan ke kelipatan ini'}
148
+ # opt-in (audit F5): a new outlet does not round until head office picks a unit
149
+ default: "'0'"
150
+ depends_on: app_installed('pos') && (location_type == '' || location_type == 'store' || location_type == 'vehicle')
151
+ options:
152
+ - {value: '0', label: {id: Tanpa pembulatan}}
153
+ - {value: '100', label: {id: Rp 100}}
154
+ - {value: '500', label: {id: Rp 500}}
155
+ - {value: '1000', label: {id: Rp 1.000}}
156
+ - name: rounding_mode
157
+ type: select
158
+ label: {id: Arah pembulatan}
159
+ default: "'nearest'"
160
+ depends_on: app_installed('pos') && (location_type == '' || location_type == 'store' || location_type == 'vehicle')
161
+ options:
162
+ - {value: down, label: {id: Ke bawah}}
163
+ - {value: nearest, label: {id: Terdekat}}
129
164
  # module whatsapp_order: the store that takes the orders customers write on WhatsApp (their drafts get this outlet,
130
165
  # so its cashiers see and confirm them). With none ticked, a business with one store uses it; with several and none
131
166
  # ticked, head office sets the outlet on each order.
@@ -186,6 +221,10 @@ fields:
186
221
  default: '10'
187
222
  depends_on: app_installed('attendance')
188
223
  rules:
224
+ - name: charge_rates_range
225
+ on: save
226
+ check: "service_pct >= 0 && service_pct <= 100 && pbjt_pct >= 0 && pbjt_pct <= 10"
227
+ message: {id: 'Service charge 0 sampai 100 persen, pajak restoran PBJT 0 sampai 10 persen'}
189
228
  # rangka-apps#104: the warehouse a store asks goods from is a warehouse; a location is not its own parent; a row
190
229
  # that is not a store has no sales source (Moka, daily form, POS file), so no daily sales are booked at a warehouse.
191
230
  - name: supply_is_warehouse
@@ -0,0 +1,28 @@
1
+ # yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/flow.json
2
+ name: pph21_annual_on_slip_cancel
3
+ label: {id: Rekap PPh 21 setahun dibatalkan bersama slipnya}
4
+ description: {id: 'Saat slip masa pajak terakhir dibatalkan, Rekap PPh 21 setahunnya ditandai batal: tidak lagi muncul di ekspor 1721-A1 dan tidak terlihat oleh pegawai.'}
5
+ # A cancelled last slip leaves its summary as a voided row (the kernel flows cannot delete). The amended slip, when
6
+ # submitted, brings the row back with fresh numbers through pph21_annual_on_slip_submit. When the cancelled slip had
7
+ # voided an earlier summary of the same worker and year (a later last_month slip covering it), the nearest earlier
8
+ # summary whose last slip is still submitted is live again (only when the cancelled slip was itself a last-month slip with a summary), so no submitted last-month slip is left without an A1.
9
+ on: payslip.cancelled
10
+ steps:
11
+ - find: pph21_annual
12
+ where: last_slip == event.name
13
+ as: row
14
+ - if: row != null
15
+ update: row
16
+ set:
17
+ voided: true
18
+ - find_all: pph21_annual
19
+ where: event.last_month && !event.ter_daily && worker == event.worker && tax_year == event.tax_year && voided && month_end < event.tax_month && last_slip.docstatus == 1
20
+ sort: -month_end
21
+ limit: 1
22
+ as: earlier
23
+ - for_each: earlier
24
+ as: e
25
+ do:
26
+ - update: e
27
+ set:
28
+ voided: false
@@ -0,0 +1,84 @@
1
+ # yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/flow.json
2
+ name: pph21_annual_on_slip_submit
3
+ label: {id: Rekap PPh 21 setahun dibuat dari slip masa pajak terakhir}
4
+ description: {id: 'Saat slip masa pajak terakhir (Desember atau bulan keluar) diajukan, dibuat Rekap PPh 21 setahun pekerja itu untuk 1721-A1: jumlah slip tahun pajak yang sama, dari awal masa kerja.'}
5
+ # On the submit of a last_month slip that is not a daily-TER slip, copy the slips' own numbers into one pph21_annual row
6
+ # (rangka-apps#128). The slips counted are the same as payslip_ytd_on_create counts: the worker's submitted slips of the
7
+ # tax year after the end of an earlier period of work, daily-TER months left out. Nothing is recomputed: year_net,
8
+ # ptkp, year_pkp and year_pph21 are the last slip's own computes.
9
+ on: payslip.submitted
10
+ if: "event.last_month && !event.ter_daily"
11
+ steps:
12
+ - find_all: payslip
13
+ where: worker == event.worker && tax_year == event.tax_year && tax_month < event.tax_month && docstatus == 1 && employment == 'casual' && pay_basis == 'daily'
14
+ sort: -tax_month
15
+ limit: 1
16
+ as: lastcas
17
+ - find_all: payslip
18
+ where: >-
19
+ worker == event.worker && tax_year == event.tax_year && tax_month < event.tax_month && docstatus == 1 && last_month && !(employment == 'casual' && pay_basis == 'daily')
20
+ && tax_month < (size(lastcas) > 0 ? lastcas[0].tax_month : 0)
21
+ sort: -tax_month
22
+ limit: 1
23
+ as: ended
24
+ - find_all: payslip
25
+ where: >-
26
+ worker == event.worker && tax_year == event.tax_year && tax_month < event.tax_month && docstatus == 1 && !(employment == 'casual' && pay_basis == 'daily')
27
+ && tax_month > (size(ended) > 0 ? ended[0].tax_month : 0)
28
+ sort: tax_month
29
+ as: prev
30
+ # a re-submit after a cancel (amend) finds its old row and brings it back instead of making a second one
31
+ - find: pph21_annual
32
+ where: last_slip == event.name
33
+ as: old
34
+ # a mistaken last_month tick earlier in the same stretch leaves a live summary that this one now covers: void it so the
35
+ # worker's income is never in two A1 files
36
+ - find_all: pph21_annual
37
+ where: >-
38
+ worker == event.worker && tax_year == event.tax_year && !voided && last_slip != event.name && month_end < event.tax_month
39
+ && month_end >= (size(prev) > 0 ? prev[0].tax_month : event.tax_month)
40
+ as: covered
41
+ - for_each: covered
42
+ as: c
43
+ do:
44
+ - update: c
45
+ set:
46
+ voided: true
47
+ - if: old == null
48
+ create: pph21_annual
49
+ set:
50
+ tax_year: event.tax_year
51
+ worker: event.worker
52
+ employee: event.employee
53
+ last_slip: event.name
54
+ worker_name: event.slip_worker_name
55
+ employee_no: event.slip_employee_no
56
+ position: "event.slip_role_title != '' ? event.slip_role_title : 'Staff'"
57
+ nik: event.slip_nik
58
+ npwp: event.slip_npwp
59
+ ptkp_status: event.ptkp_status
60
+ has_tax_id: event.has_tax_id
61
+ month_start: "size(prev) > 0 ? prev[0].tax_month : event.tax_month"
62
+ month_end: event.tax_month
63
+ months: "size(prev) + 1"
64
+ withholding_status: "(size(prev) > 0 ? prev[0].tax_month : event.tax_month) == 1 && event.tax_month == 12 ? 'full_year' : 'partial_year'"
65
+ gross_salary: "prev.map(p, p.base_pay - p.late_deduction).sum() + event.base_pay - event.late_deduction"
66
+ other_benefit: "prev.map(p, p.allowance_pay + p.overtime_pay + p.holiday_overtime_pay + p.other_income).sum() + event.allowance_pay + event.overtime_pay + event.holiday_overtime_pay + event.other_income"
67
+ insurance_employer: "prev.map(p, p.jkk + p.jkm + p.kes_employer).sum() + event.jkk + event.jkm + event.kes_employer"
68
+ bonus_thr: "prev.map(p, p.thr_pay).sum() + event.thr_pay"
69
+ year_gross: event.year_gross
70
+ job_cost: event.job_cost
71
+ pension_contribution: "prev.map(p, p.jht_employee + p.jp_employee).sum() + event.jht_employee + event.jp_employee"
72
+ year_net: event.year_net
73
+ ptkp: event.ptkp
74
+ year_pkp: event.year_pkp
75
+ year_pph21: event.year_pph21
76
+ withheld_before: "prev.map(p, p.pph21).sum()"
77
+ last_withheld: event.pph21
78
+ withholding_date: "event.pay_date != '' ? string(event.pay_date) : string(event.run_period_to)"
79
+ release_date: "event.pay_date != '' ? event.pay_date : event.run_period_to"
80
+ voided: false
81
+ - if: old != null
82
+ update: old
83
+ set:
84
+ voided: false
@@ -67,6 +67,10 @@ fields:
67
67
  - {name: slip_role_title, type: data, label: {id: Jabatan, en: Job title}, hidden: true, compute: profile.worker.role_title}
68
68
  - {name: slip_bank_name, type: data, label: {id: Bank, en: Bank}, hidden: true, compute: profile.bank_name}
69
69
  - {name: slip_bank_account, type: data, label: {id: Nomor rekening, en: Account number}, hidden: true, compute: profile.bank_account}
70
+ # Tax identity copied the same way for the PPh 21 exports (ebupot21, rangka-apps#128): raw NIK and NPWP of the profile.
71
+ # A slip submitted before payroll 2.4.0 has them empty, and the Coretax export refuses it with a message.
72
+ - {name: slip_nik, type: data, label: {id: NIK, en: National ID}, hidden: true, compute: profile.nik}
73
+ - {name: slip_npwp, type: data, label: {id: NPWP, en: Tax number}, hidden: true, compute: profile.npwp}
70
74
  - name: project
71
75
  type: link
72
76
  to: project
@@ -0,0 +1,84 @@
1
+ # yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/model.json
2
+ # Rekap PPh 21 setahun: one row per worker per period of work (rangka-apps#128). Made by flow pph21_annual_on_slip_submit
3
+ # when the last tax-month slip (December, or the month the worker leaves) is submitted, and marked void by
4
+ # pph21_annual_on_slip_cancel. Every number is a copy of the slips' own computes: nothing is recomputed here. It feeds
5
+ # the Coretax BPA1 XML (print coretax_bpa1 on pph21_period) and the 1721-A1 PDF (print bukti_potong_a1).
6
+ # Every field is read_only: only the flows write a summary, so finance cannot change an amount, the employee or the void mark by hand.
7
+ name: pph21_annual
8
+ label: {id: Rekap PPh 21 setahun, en: Annual PPh 21 summary}
9
+ icon: file-list-3
10
+ naming: A1-{YYYY}-{####}
11
+ title_field: worker_name
12
+ permissions:
13
+ - {role: finance_manager, read: true, create: true, write: true, print: true, export: true}
14
+ # The employee reads and prints their own 1721-A1 from the phone (member grant, rangka-os contract 0074, like the
15
+ # payslip) once the last slip is released: on or after its pay date. A voided row (slip cancelled) is never shown.
16
+ - {role: member, read: true, print: true, if: "employee == user.name && !voided && release_date != '' && release_date <= today()"}
17
+ fields:
18
+ - {name: tax_year, type: int, grouping: false, label: {id: Tahun pajak}, required: true, in_list: true, read_only: true}
19
+ - {name: worker, type: link, to: worker, label: {id: Tenaga kerja}, required: true, read_only: true}
20
+ - {name: employee, type: link, to: user, label: {id: Karyawan, en: Employee}, read_only: true}
21
+ - {name: last_slip, type: link, to: payslip, label: {id: Slip masa pajak terakhir}, required: true, unique: true, read_only: true}
22
+ - {name: worker_name, type: data, label: {id: Nama}, in_list: true, read_only: true}
23
+ - {name: employee_no, type: data, label: {id: No. pegawai}, read_only: true}
24
+ - {name: position, type: data, label: {id: Jabatan}, read_only: true}
25
+ - {name: nik, type: data, label: {id: NIK}, read_only: true}
26
+ - {name: npwp, type: data, label: {id: NPWP}, read_only: true}
27
+ - {name: ptkp_status, type: data, label: {id: Status PTKP}, read_only: true}
28
+ - {name: has_tax_id, type: check, label: {id: Punya NIK/NPWP valid}, default: 'true', read_only: true}
29
+ - {name: month_start, type: int, label: {id: Masa pajak awal}, in_list: true, read_only: true}
30
+ - {name: month_end, type: int, label: {id: Masa pajak akhir}, in_list: true, read_only: true}
31
+ - {name: months, type: int, label: {id: Jumlah bulan}, read_only: true}
32
+ # full_year: January to December. partial_year: a leaver (or a joiner) with fewer months; the slip's year recompute
33
+ # takes the actual income and the full PTKP, so Annualized (joiner, income scaled to 12 months) is never used.
34
+ - name: withholding_status
35
+ type: select
36
+ read_only: true
37
+ label: {id: Status bukti potong}
38
+ options:
39
+ - {value: full_year, label: {id: Setahun penuh}}
40
+ - {value: partial_year, label: {id: Kurang dari setahun}}
41
+ - {name: gross_salary, type: currency, label: {id: Gaji}, read_only: true}
42
+ - {name: other_benefit, type: currency, label: {id: Tunjangan lain dan lembur}, read_only: true}
43
+ - {name: insurance_employer, type: currency, label: {id: 'Premi asuransi dibayar pemberi kerja (JKK, JKM, BPJS Kesehatan)'}, read_only: true}
44
+ - {name: bonus_thr, type: currency, label: {id: 'Bonus, THR, tantiem'}, read_only: true}
45
+ - {name: year_gross, type: currency, label: {id: Penghasilan bruto}, read_only: true}
46
+ - {name: job_cost, type: currency, label: {id: Biaya jabatan}, read_only: true}
47
+ - {name: pension_contribution, type: currency, label: {id: Iuran pensiun dan JHT pekerja}, read_only: true}
48
+ - {name: year_net, type: currency, label: {id: Penghasilan neto}, read_only: true}
49
+ - {name: ptkp, type: currency, label: {id: PTKP}, read_only: true}
50
+ - {name: year_pkp, type: currency, label: {id: PKP}, read_only: true}
51
+ - {name: year_pph21, type: currency, label: {id: PPh 21 terutang setahun}, read_only: true}
52
+ - {name: withheld_before, type: currency, label: {id: PPh 21 dipotong masa sebelumnya}, read_only: true}
53
+ # Positive: withheld on the last slip. Negative: over-withheld, paid back to the worker on that slip.
54
+ - {name: last_withheld, type: currency, label: {id: PPh 21 dipotong atau dikembalikan di masa terakhir}, read_only: true}
55
+ - {name: withholding_date, type: data, label: {id: Tanggal pemotongan}, read_only: true}
56
+ - {name: release_date, type: date, label: {id: Tanggal tersedia untuk pegawai}, read_only: true}
57
+ - {name: employer_name, type: data, label: {id: Nama pemotong}, default: "org.name", read_only: true}
58
+ - {name: employer_tin, type: data, label: {id: NPWP pemotong}, default: "org.npwp.replace('.', '').replace('-', '')", read_only: true}
59
+ - {name: voided, type: check, label: {id: Dibatalkan}, default: 'false', in_list: true, read_only: true}
60
+ rules:
61
+ - name: gross_parts_tie
62
+ on: save
63
+ check: gross_salary + other_benefit + insurance_employer + bonus_thr == year_gross
64
+ message: {id: Rincian penghasilan tidak sama dengan penghasilan bruto}
65
+ views:
66
+ list:
67
+ columns: [name, tax_year, worker_name, month_start, month_end, year_gross, year_pph21, voided]
68
+ sort: -tax_year
69
+ form:
70
+ layout:
71
+ - section: {id: Pegawai}
72
+ columns:
73
+ - [tax_year, worker, worker_name, employee_no, position]
74
+ - [nik, npwp, ptkp_status, has_tax_id]
75
+ - section: {id: Masa kerja}
76
+ columns:
77
+ - [month_start, month_end, months, withholding_status, last_slip, voided]
78
+ - section: {id: Penghasilan}
79
+ columns:
80
+ - [gross_salary, other_benefit, insurance_employer, bonus_thr, year_gross]
81
+ - [job_cost, pension_contribution, year_net, ptkp, year_pkp]
82
+ - section: {id: PPh 21}
83
+ columns:
84
+ - [year_pph21, withheld_before, last_withheld, withholding_date, release_date]
@@ -0,0 +1,77 @@
1
+ # yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/model.json
2
+ # One PPh 21 withholding month (masa pajak) of the employer, with its Coretax downloads (print formats coretax_bpmp,
3
+ # coretax_bp21 and coretax_bpa1). Kept in payroll, not coretax, so the employee bundle needs no invoicing (rangka-apps#128,
4
+ # docs/ebupot21.md). The employer TIN and NITKU default from the org's NPWP the way coretax tax_period does.
5
+ name: pph21_period
6
+ label: {id: Masa PPh 21, en: PPh 21 period}
7
+ icon: file-download
8
+ naming: PPH21-{####}
9
+ title_field: period_key
10
+ permissions:
11
+ - {role: finance_manager, read: true, create: true, write: true, delete: true, print: true, export: true}
12
+ fields:
13
+ - {name: year, type: int, grouping: false, label: {id: Tahun}, required: true, in_list: true}
14
+ - name: month
15
+ type: int
16
+ label: {id: Bulan (1 sampai 12)}
17
+ required: true
18
+ in_list: true
19
+ help: {id: 'Unggah bukti potong ke Coretax paling lambat tanggal 20 bulan berikutnya'}
20
+ - name: period_key
21
+ type: data
22
+ label: {id: Masa}
23
+ unique: true
24
+ in_list: true
25
+ compute: "truncate(year, 4) + '-' + (month < 10 ? '0' : '') + truncate(month, 2)"
26
+ - name: seller_tin
27
+ type: data
28
+ label: {id: NPWP pemotong (16 angka)}
29
+ required: true
30
+ default: "org.npwp.replace('.', '').replace('-', '')"
31
+ - name: seller_nitku
32
+ type: data
33
+ label: {id: NITKU pemotong (22 angka)}
34
+ help: {id: 'ID TKU dari Coretax; kantor pusat = NPWP + 000000'}
35
+ required: true
36
+ default: "org.npwp == '' ? '' : org.npwp.replace('.', '').replace('-', '') + '000000'"
37
+ # Text YYYY-MM-DD, so the rule below can compare it with the month in text order.
38
+ - name: withholding_date
39
+ type: data
40
+ label: {id: Tanggal pemotongan (TTTT-BB-HH)}
41
+ required: true
42
+ help: {id: 'Contoh 2026-11-30. Tidak boleh sebelum bulan masa pajak; biasanya akhir bulan masa pajak atau tanggal bayar gaji'}
43
+ - name: notes
44
+ type: text
45
+ label: {id: Catatan}
46
+ rules:
47
+ - name: month_range
48
+ on: save
49
+ check: month >= 1 && month <= 12 && year >= 2024 && year <= 2100
50
+ message: {id: 'Bulan 1 sampai 12 dan tahun 4 angka, misalnya 2026'}
51
+ - name: seller_tin_16
52
+ on: save
53
+ check: "size(seller_tin) == 16 && seller_tin.matches('^[0-9]+$')"
54
+ message: {id: 'NPWP pemotong harus 16 angka, isi NPWP usaha di Pengaturan'}
55
+ - name: seller_nitku_22
56
+ on: save
57
+ check: "size(seller_nitku) == 22 && seller_nitku.matches('^[0-9]+$') && seller_nitku.startsWith(seller_tin)"
58
+ message: {id: NITKU pemotong harus 22 angka dan diawali NPWP pemotong}
59
+ - name: withholding_not_before_period
60
+ on: save
61
+ check: "withholding_date.matches('^20[0-9]{2}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$') && withholding_date >= truncate(year, 4) + '-' + (month < 10 ? '0' : '') + truncate(month, 2) + '-01'"
62
+ message: {id: 'Tanggal pemotongan harus berbentuk 2026-11-30 dan tidak boleh sebelum bulan masa pajak'}
63
+ views:
64
+ list:
65
+ columns: [name, period_key, year, month, withholding_date]
66
+ sort: -period_key
67
+ form:
68
+ layout:
69
+ - section: {id: Masa pajak}
70
+ columns:
71
+ - [year, month, withholding_date]
72
+ - section: {id: Identitas pemotong}
73
+ columns:
74
+ - [seller_tin, seller_nitku]
75
+ - section: {id: Catatan}
76
+ columns:
77
+ - [notes]
@@ -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: 2.3.0
3
+ version: 2.4.0
4
4
  title: {id: Penggajian, en: Payroll}
5
5
  summary:
6
6
  id: Data gaji pekerja, periode gaji, slip gaji dan tutup periode.
@@ -15,7 +15,8 @@ icon: money-dollar-box-line
15
15
  # 2.0 moved projects, invoicing, contacts and catalogue from requires to optional (breaking only for what they pulled
16
16
  # in). 2.2 (rangka-apps#117): staff request a kasbon, repaid by a monthly installment the slips fill in (one open kasbon
17
17
  # per worker, cash_advance_balance), and slips pay approved expense claims (module reimbursement) untaxed. Rules and
18
- # sources: docs/payroll.md.
18
+ # sources: docs/payroll.md. 2.4 (rangka-apps#128): PPh 21 Coretax exports (masa PPh 21 pph21_period with the BPMP, BP21
19
+ # and BPA1 XML) and the annual summary pph21_annual with the employee's own 1721-A1; sources: docs/ebupot21.md.
19
20
  requires: {rangka: '>=0.5', users: ^1.0, workforce: ^1.0}
20
21
  optional: {projects: ^1.0, invoicing: ^1.7, contacts: ^1.0, catalogue: ^1.0, outlets: ^1.0, attendance: ^1.0, reimbursement: ^1.0}
21
22
  # What this module tells people (contract 0066 §1.1), both from flow payroll_reminder. Nothing here runs payroll.
@@ -0,0 +1,53 @@
1
+ {{define "style"}}
2
+ .meta { width: 100%; margin: 6px 0 12px; border-collapse: collapse; font-size: 0.95em; }
3
+ .meta td { padding: 3px 8px 3px 0; vertical-align: top; }
4
+ .meta td.k { width: 30%; color: #57534e; }
5
+ h2.sec { font-size: 1em; margin: 16px 0 4px; padding: 4px 8px; background: #f5f5f4; }
6
+ .items { width: 100%; border-collapse: collapse; font-size: 0.95em; }
7
+ .items th, .items td { padding: 4px 6px; text-align: left; border-bottom: 1px solid #e7e5e4; }
8
+ .items th { font-weight: 600; }
9
+ .items tr.total td { border-top: 2px solid #1c1917; border-bottom: 0; font-weight: 700; }
10
+ .num { text-align: right !important; font-variant-numeric: tabular-nums; }
11
+ .note { margin-top: 12px; font-size: 0.82em; color: #57534e; }
12
+ {{end}}
13
+ {{template "letterhead" .}}
14
+ <h1>Bukti Pemotongan PPh Pasal 21 Tahunan (1721-A1)</h1>
15
+ <p class="note">Masa pajak {{.Doc.month_start}} sampai {{.Doc.month_end}}, tahun pajak {{.Doc.tax_year}} ({{if eq .Doc.withholding_status "full_year"}}setahun penuh{{else}}kurang dari setahun{{end}})</p>
16
+
17
+ <h2 class="sec">A. Identitas</h2>
18
+ <table class="meta">
19
+ <tr><td class="k">Pemotong</td><td>{{.Doc.employer_name}}</td></tr>
20
+ <tr><td class="k">NPWP pemotong</td><td>{{.Doc.employer_tin}}</td></tr>
21
+ <tr><td class="k">Nama pegawai</td><td>{{.Doc.worker_name}}</td></tr>
22
+ <tr><td class="k">NIK / NPWP</td><td>{{or .Doc.npwp .Doc.nik}}</td></tr>
23
+ <tr><td class="k">Jabatan</td><td>{{.Doc.position}}</td></tr>
24
+ <tr><td class="k">Status PTKP</td><td>{{upper .Doc.ptkp_status}}</td></tr>
25
+ <tr><td class="k">Tanggal pemotongan</td><td>{{date .Doc.withholding_date}}</td></tr>
26
+ </table>
27
+
28
+ <h2 class="sec">B. Penghasilan dan pengurang</h2>
29
+ <table class="items">
30
+ <thead><tr><th>Uraian</th><th class="num">Rp</th></tr></thead>
31
+ <tbody>
32
+ <tr><td>Gaji</td><td class="num">{{rupiah .Doc.gross_salary}}</td></tr>
33
+ <tr><td>Tunjangan lain dan lembur</td><td class="num">{{rupiah .Doc.other_benefit}}</td></tr>
34
+ <tr><td>Premi asuransi dibayar pemberi kerja</td><td class="num">{{rupiah .Doc.insurance_employer}}</td></tr>
35
+ <tr><td>Bonus, THR, tantiem</td><td class="num">{{rupiah .Doc.bonus_thr}}</td></tr>
36
+ <tr class="total"><td>Penghasilan bruto</td><td class="num">{{rupiah .Doc.year_gross}}</td></tr>
37
+ <tr><td>Biaya jabatan</td><td class="num">-{{rupiah .Doc.job_cost}}</td></tr>
38
+ <tr><td>Iuran pensiun dan JHT pegawai</td><td class="num">-{{rupiah .Doc.pension_contribution}}</td></tr>
39
+ <tr class="total"><td>Penghasilan neto</td><td class="num">{{rupiah .Doc.year_net}}</td></tr>
40
+ <tr><td>PTKP</td><td class="num">-{{rupiah .Doc.ptkp}}</td></tr>
41
+ <tr class="total"><td>Penghasilan kena pajak (PKP)</td><td class="num">{{rupiah .Doc.year_pkp}}</td></tr>
42
+ </tbody>
43
+ </table>
44
+
45
+ <h2 class="sec">C. PPh Pasal 21</h2>
46
+ <table class="items">
47
+ <tbody>
48
+ <tr><td>PPh 21 terutang setahun (tarif Pasal 17)</td><td class="num">{{rupiah .Doc.year_pph21}}</td></tr>
49
+ <tr><td>Sudah dipotong di masa sebelumnya</td><td class="num">{{rupiah .Doc.withheld_before}}</td></tr>
50
+ <tr class="total"><td>{{if eq (slice (print .Doc.last_withheld) 0 1) "-"}}Kelebihan potong dikembalikan di masa terakhir{{else}}Dipotong di masa terakhir{{end}}</td><td class="num">{{rupiah .Doc.last_withheld}}</td></tr>
51
+ </tbody>
52
+ </table>
53
+ <p class="note">Rekap ini disalin dari slip gaji masa pajak terakhir dan slip bulan-bulan sebelumnya. Bukti potong resmi dibuat di Coretax DJP.</p>
@@ -0,0 +1,9 @@
1
+ # yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/print.json
2
+ # Bukti pemotongan PPh 21 tahunan 1721-A1 for one employee: sections A (identitas), B (penghasilan dan pengurang) and
3
+ # C (PPh 21) of the DJP form, from the worker's pph21_annual row (rangka-apps#128). The employee prints their own.
4
+ name: bukti_potong_a1
5
+ model: pph21_annual
6
+ label: {id: Bukti potong 1721-A1, en: Form 1721-A1}
7
+ paper: A4
8
+ template: bukti_potong_a1.html
9
+ default: true
@@ -0,0 +1,44 @@
1
+ # yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/print.json
2
+ # Monthly PPh 21 withholding slips of casual daily workers (BP21, pegawai tidak tetap paid per day) as Coretax imports
3
+ # them (Bp21Bulk, DJP template bp21.xml and converter "BP21 Excel to XML v.4"). They never get a 1721-A1. Three lists
4
+ # by the daily gross, the same bands as the slip's daily TER (PMK 168/2023 Pasal 16): up to 450.000 a day 0%, up to
5
+ # 2.500.000 a day 0,5% (code 21-100-24), above that Pasal 17 on 50% (code 21-100-30). Field map: docs/ebupot21.md.
6
+ name: coretax_bp21
7
+ model: pph21_period
8
+ label: {id: XML Bukti Potong PPh 21 Pegawai Tidak Tetap Harian (Coretax)}
9
+ output: xml
10
+ template: coretax_bp21.xml
11
+ related:
12
+ zero:
13
+ model: payslip
14
+ range: {tax_year: [year, year], tax_month: [month, month]}
15
+ filter: docstatus == 1 && ter_daily && (days + holiday_overtime_days <= 0 || gross_taxable * 1.0 <= 450000.0 * (days + holiday_overtime_days))
16
+ sort: name
17
+ limit: 1000
18
+ require:
19
+ - check: "((size(slip_npwp.replace('.', '').replace('-', '').replace(' ', '')) in [15, 16] && slip_npwp.replace('.', '').replace('-', '').replace(' ', '').matches('^[0-9]+$')) || (size(slip_nik) == 16 && slip_nik.matches('^[0-9]+$')))"
20
+ message: {id: 'Pekerja di slip ini belum punya NIK 16 angka atau NPWP: lengkapi Data gaji pekerja (slip lama: buat bukti potongnya langsung di Coretax)'}
21
+ - check: "ptkp_status != '' && gross_taxable >= 0"
22
+ message: {id: 'Status PTKP atau penghasilan bruto di slip ini tidak valid'}
23
+ low:
24
+ model: payslip
25
+ range: {tax_year: [year, year], tax_month: [month, month]}
26
+ filter: docstatus == 1 && ter_daily && gross_taxable * 1.0 > 450000.0 * (days + holiday_overtime_days) && gross_taxable * 1.0 <= 2500000.0 * (days + holiday_overtime_days)
27
+ sort: name
28
+ limit: 1000
29
+ require:
30
+ - check: "((size(slip_npwp.replace('.', '').replace('-', '').replace(' ', '')) in [15, 16] && slip_npwp.replace('.', '').replace('-', '').replace(' ', '').matches('^[0-9]+$')) || (size(slip_nik) == 16 && slip_nik.matches('^[0-9]+$')))"
31
+ message: {id: 'Pekerja di slip ini belum punya NIK 16 angka atau NPWP: lengkapi Data gaji pekerja (slip lama: buat bukti potongnya langsung di Coretax)'}
32
+ - check: "ptkp_status != '' && gross_taxable >= 0"
33
+ message: {id: 'Status PTKP atau penghasilan bruto di slip ini tidak valid'}
34
+ high:
35
+ model: payslip
36
+ range: {tax_year: [year, year], tax_month: [month, month]}
37
+ filter: docstatus == 1 && ter_daily && days + holiday_overtime_days > 0 && gross_taxable * 1.0 > 2500000.0 * (days + holiday_overtime_days)
38
+ sort: name
39
+ limit: 1000
40
+ require:
41
+ - check: "((size(slip_npwp.replace('.', '').replace('-', '').replace(' ', '')) in [15, 16] && slip_npwp.replace('.', '').replace('-', '').replace(' ', '').matches('^[0-9]+$')) || (size(slip_nik) == 16 && slip_nik.matches('^[0-9]+$')))"
42
+ message: {id: 'Pekerja di slip ini belum punya NIK 16 angka atau NPWP: lengkapi Data gaji pekerja (slip lama: buat bukti potongnya langsung di Coretax)'}
43
+ - check: "ptkp_status != '' && gross_taxable >= 0"
44
+ message: {id: 'Status PTKP atau penghasilan bruto di slip ini tidak valid'}
@@ -0,0 +1,36 @@
1
+ <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2
+ {{- /* Element names and order follow the DJP template bp21.xml (pajak.go.id Coretax templates); column meanings from
3
+ "BP21 Excel to XML v.4.xlsx" sheet BP21. Gross is the slip's whole bruto; Rate x Deemed% x Gross is the slip's PPh 21:
4
+ 21-100-24 is Deemed 100 and Rate 0 or 0,5 (x120% without a tax number); 21-100-30 is Deemed 50 and the Rate is the
5
+ slip's PPh 21 over half of its gross (the Pasal 17 layers as one percent, 2 decimals). The reference document is the
6
+ slip itself (Document Other). */}}
7
+ <Bp21Bulk xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
8
+ <TIN>{{.Doc.seller_tin}}</TIN>
9
+ <ListOfBp21>
10
+ {{- $d := .Doc}}
11
+ {{- range $k, $rows := .Related}}
12
+ {{- range $rows}}
13
+ {{- $tin := digits .slip_nik}}
14
+ {{- if eq (len (digits .slip_npwp)) 16}}{{$tin = digits .slip_npwp}}{{else if eq (len (digits .slip_npwp)) 15}}{{$tin = print "0" (digits .slip_npwp)}}{{end}}
15
+ {{- $m := 100}}{{if not .has_tax_id}}{{$m = 120}}{{end}}
16
+ <Bp21>
17
+ <TaxPeriodMonth>{{dec $d.month 0}}</TaxPeriodMonth>
18
+ <TaxPeriodYear>{{$d.year}}</TaxPeriodYear>
19
+ <CounterpartTin>{{$tin}}</CounterpartTin>
20
+ <IDPlaceOfBusinessActivityOfIncomeRecipient>{{$tin}}000000</IDPlaceOfBusinessActivityOfIncomeRecipient>
21
+ <StatusTaxExemption>{{if eq (slice .ptkp_status 0 1) "t"}}TK/{{slice .ptkp_status 2}}{{else}}K/{{slice .ptkp_status 1}}{{end}}</StatusTaxExemption>
22
+ <TaxCertificate>N/A</TaxCertificate>
23
+ <TaxObjectCode>{{if eq $k "high"}}21-100-30{{else}}21-100-24{{end}}</TaxObjectCode>
24
+ <Gross>{{dec .gross_taxable 0}}</Gross>
25
+ <Deemed>{{if eq $k "high"}}50{{else}}100{{end}}</Deemed>
26
+ <Rate>{{if eq $k "zero"}}0{{else if eq $k "low"}}{{dec (div (mul 5 $m) 1000) 2}}{{else}}{{dec (div (mul .daily_pph21 200) .gross_taxable) 4}}{{end}}</Rate>
27
+ <Document>Other</Document>
28
+ <DocumentNumber>{{.name}}</DocumentNumber>
29
+ <DocumentDate>{{isodate .run_period_to}}</DocumentDate>
30
+ <IDPlaceOfBusinessActivity>{{$d.seller_nitku}}</IDPlaceOfBusinessActivity>
31
+ <WithholdingDate>{{isodate $d.withholding_date}}</WithholdingDate>
32
+ </Bp21>
33
+ {{- end}}
34
+ {{- end}}
35
+ </ListOfBp21>
36
+ </Bp21Bulk>
@@ -0,0 +1,21 @@
1
+ # yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/print.json
2
+ # Annual or last-month 1721-A1 of permanent employees as Coretax imports them (A1Bulk, DJP template bpa1.xml and converter
3
+ # "BPA1 Excel to XML"): the pph21_annual rows whose last tax month is the period's month and year. Coretax computes the
4
+ # annual tax itself from the income parts below, so Article21IncomeTax is 0 as the DJP sheet says. Field map: docs/ebupot21.md.
5
+ name: coretax_bpa1
6
+ model: pph21_period
7
+ label: {id: XML Bukti Potong 1721-A1 (Coretax)}
8
+ output: xml
9
+ template: coretax_bpa1.xml
10
+ related:
11
+ a1:
12
+ model: pph21_annual
13
+ range: {tax_year: [year, year], month_end: [month, month]}
14
+ filter: "!voided"
15
+ sort: name
16
+ limit: 1000
17
+ require:
18
+ - check: "((size(npwp.replace('.', '').replace('-', '').replace(' ', '')) in [15, 16] && npwp.replace('.', '').replace('-', '').replace(' ', '').matches('^[0-9]+$')) || (size(nik) == 16 && nik.matches('^[0-9]+$')))"
19
+ message: {id: 'Pekerja di slip ini belum punya NIK 16 angka atau NPWP: lengkapi Data gaji pekerja (slip lama: buat bukti potongnya langsung di Coretax)'}
20
+ - check: "ptkp_status != '' && year_gross >= 0"
21
+ message: {id: 'Status PTKP atau penghasilan di rekap ini tidak valid'}
@@ -0,0 +1,46 @@
1
+ <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2
+ {{- /* Element names and order follow the DJP template bpa1.xml (pajak.go.id Coretax templates); column meanings from
3
+ "BPA1 Excel to XML.xlsx" sheet BPA1. SalaryPensionJhtTht is the salary after unpaid days and lateness; OtherBenefit
4
+ allowances, overtime and other income; InsurancePaidByEmployer the employer JKK, JKM and BPJS Kesehatan counted in
5
+ the bruto; TantiemBonusThr the THR; PensionContributionJhtThtFee the employee JHT and JP. The rows are those whose last
6
+ tax month is the period's month. Status FullYear (full_year) is January to December, else PartialYear (partial_year); NumberOfMonths is 0 for both
7
+ (the DJP sheet: 0 unless Annualized). */}}
8
+ <A1Bulk xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
9
+ <TIN>{{.Doc.seller_tin}}</TIN>
10
+ <ListOfA1>
11
+ {{- $d := .Doc}}
12
+ {{- range .Related.a1}}
13
+ {{- $tin := digits .nik}}
14
+ {{- if eq (len (digits .npwp)) 16}}{{$tin = digits .npwp}}{{else if eq (len (digits .npwp)) 15}}{{$tin = print "0" (digits .npwp)}}{{end}}
15
+ <A1>
16
+ <WorkForSecondEmployer>No</WorkForSecondEmployer>
17
+ <TaxPeriodMonthStart>{{dec .month_start 0}}</TaxPeriodMonthStart>
18
+ <TaxPeriodMonthEnd>{{dec .month_end 0}}</TaxPeriodMonthEnd>
19
+ <TaxPeriodYear>{{.tax_year}}</TaxPeriodYear>
20
+ <CounterpartOpt>Resident</CounterpartOpt>
21
+ <CounterpartPassport xsi:nil="true"/>
22
+ <CounterpartTin>{{$tin}}</CounterpartTin>
23
+ <TaxExemptOpt>{{if eq (slice .ptkp_status 0 1) "t"}}TK/{{slice .ptkp_status 2}}{{else}}K/{{slice .ptkp_status 1}}{{end}}</TaxExemptOpt>
24
+ <StatusOfWithholding>{{if eq .withholding_status "full_year"}}FullYear{{else}}PartialYear{{end}}</StatusOfWithholding>
25
+ <CounterpartPosition>{{or .position "Staff"}}</CounterpartPosition>
26
+ <TaxObjectCode>21-100-01</TaxObjectCode>
27
+ <NumberOfMonths>0</NumberOfMonths>
28
+ <SalaryPensionJhtTht>{{dec .gross_salary 0}}</SalaryPensionJhtTht>
29
+ <GrossUpOpt>No</GrossUpOpt>
30
+ <IncomeTaxBenefit>0</IncomeTaxBenefit>
31
+ <OtherBenefit>{{dec .other_benefit 0}}</OtherBenefit>
32
+ <Honorarium>0</Honorarium>
33
+ <InsurancePaidByEmployer>{{dec .insurance_employer 0}}</InsurancePaidByEmployer>
34
+ <Natura>0</Natura>
35
+ <TantiemBonusThr>{{dec .bonus_thr 0}}</TantiemBonusThr>
36
+ <PensionContributionJhtThtFee>{{dec .pension_contribution 0}}</PensionContributionJhtThtFee>
37
+ <Zakat>0</Zakat>
38
+ <PrevWhTaxSlip xsi:nil="true"/>
39
+ <TaxCertificate>N/A</TaxCertificate>
40
+ <Article21IncomeTax>0</Article21IncomeTax>
41
+ <IDPlaceOfBusinessActivity>{{$d.seller_nitku}}</IDPlaceOfBusinessActivity>
42
+ <WithholdingDate>{{isodate $d.withholding_date}}</WithholdingDate>
43
+ </A1>
44
+ {{- end}}
45
+ </ListOfA1>
46
+ </A1Bulk>
@@ -0,0 +1,23 @@
1
+ # yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/print.json
2
+ # Every slip taxed with monthly TER is here, also a casual worker paid monthly (the slip taxes it like a permanent one). Monthly PPh 21 withholding slips of permanent employees (BPMP, form 1721-VIII) as Coretax imports them (MmPayrollBulk,
3
+ # DJP template bpmp.xml and converter "BPMP Excel to XML v.3"). The last tax month (December or the month a worker
4
+ # leaves) is a 1721-A1 instead: see coretax_bpa1. Field map and sources: docs/ebupot21.md.
5
+ name: coretax_bpmp
6
+ model: pph21_period
7
+ label: {id: XML Bukti Potong PPh 21 Bulanan Pegawai Tetap (Coretax)}
8
+ output: xml
9
+ template: coretax_bpmp.xml
10
+ related:
11
+ slips:
12
+ model: payslip
13
+ range: {tax_year: [year, year], tax_month: [month, month]}
14
+ filter: docstatus == 1 && !last_month && !ter_daily
15
+ sort: name
16
+ limit: 1000
17
+ require:
18
+ - check: "((size(slip_npwp.replace('.', '').replace('-', '').replace(' ', '')) in [15, 16] && slip_npwp.replace('.', '').replace('-', '').replace(' ', '').matches('^[0-9]+$')) || (size(slip_nik) == 16 && slip_nik.matches('^[0-9]+$')))"
19
+ message: {id: 'Pekerja di slip ini belum punya NIK 16 angka atau NPWP: lengkapi Data gaji pekerja (slip lama: buat bukti potongnya langsung di Coretax)'}
20
+ - check: "ptkp_status != ''"
21
+ message: {id: 'Status PTKP pekerja di slip ini kosong'}
22
+ - check: "ter_bp >= 0 && gross_taxable >= 0"
23
+ message: {id: 'Penghasilan bruto atau tarif TER di slip ini tidak valid'}
@@ -0,0 +1,31 @@
1
+ <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2
+ {{- /* Element names and order follow the DJP template bpmp.xml (pajak.go.id Coretax templates); column meanings from
3
+ "BPMP Excel to XML v.3.xlsx" sheet BPMP. Gross is the slip's bruto PPh 21 (pay + employer JKK, JKM, health), Rate the
4
+ TER percent the slip withheld with (x120% when the profile says no tax number), so Coretax's Gross x Rate is the
5
+ slip's PPh 21. Code 21-100-01: permanent employee. */}}
6
+ <MmPayrollBulk xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
7
+ <TIN>{{.Doc.seller_tin}}</TIN>
8
+ <ListOfMmPayroll>
9
+ {{- $d := .Doc}}
10
+ {{- range .Related.slips}}
11
+ {{- $tin := digits .slip_nik}}
12
+ {{- if eq (len (digits .slip_npwp)) 16}}{{$tin = digits .slip_npwp}}{{else if eq (len (digits .slip_npwp)) 15}}{{$tin = print "0" (digits .slip_npwp)}}{{end}}
13
+ {{- $m := 100}}{{if not .has_tax_id}}{{$m = 120}}{{end}}
14
+ <MmPayroll>
15
+ <TaxPeriodMonth>{{dec $d.month 0}}</TaxPeriodMonth>
16
+ <TaxPeriodYear>{{$d.year}}</TaxPeriodYear>
17
+ <CounterpartOpt>Resident</CounterpartOpt>
18
+ <CounterpartPassport xsi:nil="true"/>
19
+ <CounterpartTin>{{$tin}}</CounterpartTin>
20
+ <StatusTaxExemption>{{if eq (slice .ptkp_status 0 1) "t"}}TK/{{slice .ptkp_status 2}}{{else}}K/{{slice .ptkp_status 1}}{{end}}</StatusTaxExemption>
21
+ <Position>{{or .slip_role_title "Staff"}}</Position>
22
+ <TaxCertificate>N/A</TaxCertificate>
23
+ <TaxObjectCode>21-100-01</TaxObjectCode>
24
+ <Gross>{{dec .gross_taxable 0}}</Gross>
25
+ <Rate>{{dec (div (mul .ter_bp $m) 10000) 4}}</Rate>
26
+ <IDPlaceOfBusinessActivity>{{$d.seller_nitku}}</IDPlaceOfBusinessActivity>
27
+ <WithholdingDate>{{isodate $d.withholding_date}}</WithholdingDate>
28
+ </MmPayroll>
29
+ {{- end}}
30
+ </ListOfMmPayroll>
31
+ </MmPayrollBulk>