@rangka-os/create 0.5.0-alpha.2 → 0.5.0-alpha.21

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 (532) hide show
  1. package/index.js +42 -6
  2. package/package.json +1 -1
  3. package/template/base/apps/crm/app.rk +2 -0
  4. package/template/base/apps/crm/processes/lead_to_cash.rk +8 -0
  5. package/template/base/apps/dapur/app.rk +35 -0
  6. package/template/base/apps/dapur/dashboards/dapur_hari_ini.rk +26 -0
  7. package/template/base/apps/faktur_piutang/app.rk +31 -0
  8. package/template/base/apps/faktur_piutang/dashboards/piutang_ringkas.rk +88 -0
  9. package/template/base/apps/fnb_cabang/app.rk +11 -6
  10. package/template/base/apps/fnb_cabang/dashboards/fnb_overview.rk +38 -14
  11. package/template/base/apps/fnb_cabang/dashboards/outlet_harian.rk +36 -0
  12. package/template/base/apps/fnb_cabang/dashboards/stock_recap.rk +19 -16
  13. package/template/base/apps/grosir_distribusi/app.rk +57 -0
  14. package/template/base/apps/grosir_distribusi/dashboards/grosir_ar.rk +66 -0
  15. package/template/base/apps/grosir_distribusi/dashboards/grosir_overview.rk +91 -0
  16. package/template/base/apps/grosir_distribusi/dashboards/gudang_harian.rk +33 -0
  17. package/template/base/apps/grosir_distribusi/dashboards/salesman_harian.rk +51 -0
  18. package/template/base/apps/jasa_proyek/app.rk +24 -5
  19. package/template/base/apps/jasa_proyek/dashboards/absen_saya.rk +15 -0
  20. package/template/base/apps/jasa_proyek/dashboards/jasa_overview.rk +65 -38
  21. package/template/base/apps/jasa_proyek/dashboards/project_margin.rk +94 -0
  22. package/template/base/apps/jasa_proyek/dashboards/rekap_absen.rk +18 -0
  23. package/template/base/apps/jasa_proyek/processes/quote_to_cash.rk +10 -0
  24. package/template/base/apps/kasir/app.rk +38 -0
  25. package/template/base/apps/kasir/dashboards/kasir_ringkas.rk +20 -0
  26. package/template/base/apps/kasir/skills/rangka-app-kasir/SKILL.md +80 -0
  27. package/template/base/apps/kelas_kursus/app.rk +32 -0
  28. package/template/base/apps/kelas_kursus/dashboards/kelas_saya.rk +41 -0
  29. package/template/base/apps/kelas_kursus/dashboards/kursus_ringkas.rk +67 -0
  30. package/template/base/apps/langganan_jasa/app.rk +39 -0
  31. package/template/base/apps/langganan_jasa/dashboards/langganan_ringkas.rk +167 -0
  32. package/template/base/apps/langganan_jasa/dashboards/penagihan_saya.rk +54 -0
  33. package/template/base/apps/mutasi_bank/app.rk +22 -0
  34. package/template/base/apps/pajak/app.rk +25 -0
  35. package/template/base/apps/pembelian_pemasok/app.rk +23 -0
  36. package/template/base/apps/pembukuan/app.rk +19 -0
  37. package/template/base/apps/penjualan_harian/app.rk +34 -0
  38. package/template/base/apps/penjualan_harian/dashboards/penjualan_ringkas.rk +87 -0
  39. package/template/base/apps/produksi_pabrik/app.rk +54 -0
  40. package/template/base/apps/produksi_pabrik/dashboards/produksi_overview.rk +101 -0
  41. package/template/base/apps/produksi_pabrik/dashboards/produksi_upah.rk +39 -0
  42. package/template/base/apps/ritel_cabang/app.rk +61 -0
  43. package/template/base/apps/ritel_cabang/dashboards/ritel_overview.rk +137 -0
  44. package/template/base/apps/ritel_cabang/dashboards/ritel_stock.rk +147 -0
  45. package/template/base/apps/ritel_cabang/dashboards/ritel_tax.rk +76 -0
  46. package/template/base/apps/sewa_alat/app.rk +36 -0
  47. package/template/base/apps/sewa_alat/dashboards/alat_hari_ini.rk +90 -0
  48. package/template/base/apps/sewa_alat/dashboards/sewa_ringkas.rk +86 -0
  49. package/template/base/apps/sewa_alat/skills/rangka-app-sewa-alat/SKILL.md +24 -0
  50. package/template/base/apps/sewa_alat/skills/rangka-app-sewa-alat/first-day.json +162 -0
  51. package/template/base/apps/stok_outlet/app.rk +34 -0
  52. package/template/base/apps/stok_outlet/dashboards/outlet_hari_ini.rk +33 -0
  53. package/template/base/apps/stok_outlet/dashboards/stok_ringkas.rk +50 -0
  54. package/template/base/connectors/biteship/connector.rk +246 -0
  55. package/template/base/connectors/biteship/fixtures/cancel_order.json +1 -0
  56. package/template/base/connectors/biteship/fixtures/create_order.json +8 -0
  57. package/template/base/connectors/biteship/fixtures/expect.json +9 -0
  58. package/template/base/connectors/biteship/fixtures/get_order.json +2 -0
  59. package/template/base/connectors/biteship/fixtures/get_rates.json +7 -0
  60. package/template/base/connectors/biteship/fixtures/get_tracking.json +7 -0
  61. package/template/base/connectors/biteship/fixtures/order_price.json +11 -0
  62. package/template/base/connectors/biteship/fixtures/order_status.json +15 -0
  63. package/template/base/connectors/biteship/fixtures/order_status_cancelled.json +15 -0
  64. package/template/base/connectors/biteship/fixtures/order_waybill.json +7 -0
  65. package/template/base/connectors/biteship/fixtures/search_areas.json +1 -0
  66. package/template/base/connectors/doku/connector.rk +128 -0
  67. package/template/base/connectors/doku/fixtures/create_checkout.json +6 -0
  68. package/template/base/connectors/doku/fixtures/expect.json +38 -0
  69. package/template/base/connectors/doku/fixtures/payment_notified.json +5 -0
  70. package/template/base/connectors/doku/fixtures/payment_notified_failed.json +3 -0
  71. package/template/base/connectors/doku/fixtures/payment_notified_no_type.json +3 -0
  72. package/template/base/connectors/doku/fixtures/payment_notified_null_type.json +3 -0
  73. package/template/base/connectors/doku/fixtures/payment_notified_refund.json +3 -0
  74. package/template/base/connectors/doku/mock/doku_mock.py +217 -0
  75. package/template/base/connectors/loyverse/connector.rk +98 -0
  76. package/template/base/connectors/moka/connector.rk +121 -0
  77. package/template/base/connectors/moka/fixtures/expect.json +44 -0
  78. package/template/base/connectors/moka/fixtures/latest_transactions.json +79 -0
  79. package/template/base/connectors/moka/fixtures/list_items.json +4 -0
  80. package/template/base/connectors/moka/fixtures/list_outlets.json +4 -0
  81. package/template/base/connectors/moka/fixtures/transaction_created.json +44 -0
  82. package/template/base/connectors/moka/fixtures/transaction_created_refund.json +39 -0
  83. package/template/base/connectors/moka/fixtures/transaction_created_refund_later.json +51 -0
  84. package/template/base/connectors/moka/mock/moka_mock.py +210 -0
  85. package/template/base/connectors/whatsapp_business/connector.rk +22 -1
  86. package/template/base/connectors/whatsapp_business/templates.md +32 -0
  87. package/template/base/connectors/xendit/connector.rk +184 -0
  88. package/template/base/connectors/xendit/mock/xendit_mock.py +231 -0
  89. package/template/base/modules/accounting/flows/financial_report_compute.rk +47 -0
  90. package/template/base/modules/accounting/flows/financial_report_recompute.rk +47 -0
  91. package/template/base/modules/accounting/flows/gl_cash_advance_post.rk +33 -0
  92. package/template/base/modules/accounting/flows/gl_cash_advance_reverse.rk +194 -0
  93. package/template/base/modules/accounting/flows/gl_delivery_note_post.rk +37 -0
  94. package/template/base/modules/accounting/flows/gl_delivery_note_reverse.rk +194 -0
  95. package/template/base/modules/accounting/flows/gl_goods_receipt_post.rk +41 -0
  96. package/template/base/modules/accounting/flows/gl_goods_receipt_reverse.rk +194 -0
  97. package/template/base/modules/accounting/flows/gl_opening_balance_post.rk +132 -0
  98. package/template/base/modules/accounting/flows/gl_opening_balance_reverse.rk +194 -0
  99. package/template/base/modules/accounting/flows/gl_outlet_return_post.rk +38 -0
  100. package/template/base/modules/accounting/flows/gl_outlet_return_reverse.rk +194 -0
  101. package/template/base/modules/accounting/flows/gl_outlet_sales_post.rk +95 -0
  102. package/template/base/modules/accounting/flows/gl_outlet_sales_reverse.rk +194 -0
  103. package/template/base/modules/accounting/flows/gl_outlet_takings_post.rk +71 -0
  104. package/template/base/modules/accounting/flows/gl_outlet_takings_reverse.rk +194 -0
  105. package/template/base/modules/accounting/flows/gl_payment_post.rk +63 -0
  106. package/template/base/modules/accounting/flows/gl_payment_reverse.rk +194 -0
  107. package/template/base/modules/accounting/flows/gl_payroll_close_post.rk +89 -0
  108. package/template/base/modules/accounting/flows/gl_payroll_close_reverse.rk +194 -0
  109. package/template/base/modules/accounting/flows/gl_pos_sale_post.rk +95 -0
  110. package/template/base/modules/accounting/flows/gl_pos_sale_reverse.rk +194 -0
  111. package/template/base/modules/accounting/flows/gl_pos_shift_close_post.rk +59 -0
  112. package/template/base/modules/accounting/flows/gl_pos_shift_close_reverse.rk +194 -0
  113. package/template/base/modules/accounting/flows/gl_production_batch_post.rk +62 -0
  114. package/template/base/modules/accounting/flows/gl_production_batch_reverse.rk +194 -0
  115. package/template/base/modules/accounting/flows/gl_project_expense_post.rk +64 -0
  116. package/template/base/modules/accounting/flows/gl_project_expense_reverse.rk +194 -0
  117. package/template/base/modules/accounting/flows/gl_rental_booking_post.rk +35 -0
  118. package/template/base/modules/accounting/flows/gl_rental_booking_reverse.rk +194 -0
  119. package/template/base/modules/accounting/flows/gl_rental_return_post.rk +47 -0
  120. package/template/base/modules/accounting/flows/gl_rental_return_reverse.rk +194 -0
  121. package/template/base/modules/accounting/flows/gl_sales_invoice_post.rk +95 -0
  122. package/template/base/modules/accounting/flows/gl_sales_invoice_reverse.rk +194 -0
  123. package/template/base/modules/accounting/flows/gl_sales_return_post.rk +40 -0
  124. package/template/base/modules/accounting/flows/gl_sales_return_reverse.rk +194 -0
  125. package/template/base/modules/accounting/flows/gl_stock_adjustment_post.rk +38 -0
  126. package/template/base/modules/accounting/flows/gl_stock_adjustment_reverse.rk +194 -0
  127. package/template/base/modules/accounting/flows/gl_stock_count_post.rk +38 -0
  128. package/template/base/modules/accounting/flows/gl_stock_count_reverse.rk +194 -0
  129. package/template/base/modules/accounting/flows/gl_stock_transfer_post.rk +38 -0
  130. package/template/base/modules/accounting/flows/gl_stock_transfer_receipt_post.rk +38 -0
  131. package/template/base/modules/accounting/flows/gl_stock_transfer_receipt_reverse.rk +194 -0
  132. package/template/base/modules/accounting/flows/gl_stock_transfer_reverse.rk +194 -0
  133. package/template/base/modules/accounting/flows/gl_timesheet_post.rk +35 -0
  134. package/template/base/modules/accounting/flows/gl_timesheet_reverse.rk +194 -0
  135. package/template/base/modules/accounting/flows/gl_vendor_bill_post.rk +63 -0
  136. package/template/base/modules/accounting/flows/gl_vendor_bill_reverse.rk +194 -0
  137. package/template/base/modules/accounting/imports/opening_balance_sheet.rk +22 -0
  138. package/template/base/modules/accounting/models/financial_report.rk +85 -0
  139. package/template/base/modules/accounting/models/gl_entry.rk +164 -0
  140. package/template/base/modules/accounting/models/opening_balance.rk +48 -0
  141. package/template/base/modules/accounting/models/period_close.rk +33 -0
  142. package/template/base/modules/accounting/module.rk +16 -0
  143. package/template/base/modules/bank_statement/flows/bank_transaction_booked.rk +12 -0
  144. package/template/base/modules/bank_statement/flows/bank_transaction_booked_released.rk +11 -0
  145. package/template/base/modules/bank_statement/flows/bank_transaction_claim.rk +29 -0
  146. package/template/base/modules/bank_statement/flows/bank_transaction_confirm.rk +61 -0
  147. package/template/base/modules/bank_statement/flows/bank_transaction_link_locked.rk +11 -0
  148. package/template/base/modules/bank_statement/flows/bank_transaction_matched.rk +13 -0
  149. package/template/base/modules/bank_statement/flows/bank_transaction_release.rk +11 -0
  150. package/template/base/modules/bank_statement/flows/bank_transaction_suggest.rk +73 -0
  151. package/template/base/modules/bank_statement/flows/bank_transaction_unmatched.rk +11 -0
  152. package/template/base/modules/bank_statement/imports/bank_statement_csv.rk +25 -0
  153. package/template/base/modules/bank_statement/models/bank_transaction.rk +147 -0
  154. package/template/base/modules/bank_statement/models/bank_transaction_claim.rk +49 -0
  155. package/template/base/modules/bank_statement/module.rk +12 -0
  156. package/template/base/modules/catalogue/imports/item_list.rk +20 -0
  157. package/template/base/modules/catalogue/imports/item_master.rk +25 -0
  158. package/template/base/modules/catalogue/models/item.rk +81 -1
  159. package/template/base/modules/catalogue/models/item_category.rk +29 -0
  160. package/template/base/modules/catalogue/models/uom.rk +14 -0
  161. package/template/base/modules/catalogue/models/uom_conversion.rk +8 -0
  162. package/template/base/modules/catalogue/module.rk +8 -2
  163. package/template/base/modules/consignment/flows/consignment_bill.rk +39 -0
  164. package/template/base/modules/consignment/flows/consignment_bill_cancelled.rk +14 -0
  165. package/template/base/modules/consignment/models/consignment_settlement.rk +111 -0
  166. package/template/base/modules/consignment/models/consignment_settlement_item.rk +37 -0
  167. package/template/base/modules/consignment/module.rk +15 -0
  168. package/template/base/modules/contacts/imports/customer_list.rk +17 -0
  169. package/template/base/modules/contacts/imports/vendor_list.rk +16 -0
  170. package/template/base/modules/contacts/models/credit_guard.rk +40 -0
  171. package/template/base/modules/contacts/models/customer.rk +144 -2
  172. package/template/base/modules/contacts/models/vendor.rk +51 -2
  173. package/template/base/modules/contacts/module.rk +6 -1
  174. package/template/base/modules/coretax/models/tax_period.rk +89 -0
  175. package/template/base/modules/coretax/module.rk +13 -0
  176. package/template/base/modules/coretax/print/coretax_bupot.rk +31 -0
  177. package/template/base/modules/coretax/print/coretax_bupot.xml +28 -0
  178. package/template/base/modules/coretax/print/coretax_faktur.rk +44 -0
  179. package/template/base/modules/coretax/print/coretax_faktur.xml +74 -0
  180. package/template/base/modules/courses/flows/charge_cancel_guard.rk +23 -0
  181. package/template/base/modules/courses/flows/charge_invoice_on_submit.rk +58 -0
  182. package/template/base/modules/courses/flows/enrollment_seats_on_create.rk +15 -0
  183. package/template/base/modules/courses/flows/enrollment_seats_on_update.rk +35 -0
  184. package/template/base/modules/courses/flows/invoice_course_once.rk +22 -0
  185. package/template/base/modules/courses/flows/invoice_course_tag_lock.rk +16 -0
  186. package/template/base/modules/courses/flows/session_attendance_checked.rk +14 -0
  187. package/template/base/modules/courses/flows/session_fill_attendance.rk +16 -0
  188. package/template/base/modules/courses/flows/session_of_the_day.rk +34 -0
  189. package/template/base/modules/courses/flows/student_billing_on_create.rk +25 -0
  190. package/template/base/modules/courses/models/course_attendance.rk +24 -0
  191. package/template/base/modules/courses/models/course_batch.rk +119 -0
  192. package/template/base/modules/courses/models/course_batch_slot.rk +18 -0
  193. package/template/base/modules/courses/models/course_charge.rk +125 -0
  194. package/template/base/modules/courses/models/course_guard.rk +50 -0
  195. package/template/base/modules/courses/models/course_program.rk +101 -0
  196. package/template/base/modules/courses/models/course_session.rk +94 -0
  197. package/template/base/modules/courses/models/enrollment.rk +136 -0
  198. package/template/base/modules/courses/models/student.rk +68 -0
  199. package/template/base/modules/courses/module.rk +14 -0
  200. package/template/base/modules/courses/roles/instructor.rk +7 -0
  201. package/template/base/modules/courses/screens/absen_kelas.rk +17 -0
  202. package/template/base/modules/currency/module.rk +5 -0
  203. package/template/base/modules/delivery/flows/delivery_cancel_guard.rk +18 -0
  204. package/template/base/modules/delivery/flows/fulfilment_on_delivery_cancelled.rk +21 -0
  205. package/template/base/modules/delivery/flows/fulfilment_on_delivery_submitted.rk +28 -0
  206. package/template/base/modules/delivery/flows/fulfilment_on_invoice_cancelled.rk +22 -0
  207. package/template/base/modules/delivery/flows/fulfilment_on_invoice_submitted.rk +22 -0
  208. package/template/base/modules/delivery/flows/fulfilment_on_order_created.rk +18 -0
  209. package/template/base/modules/delivery/flows/fulfilment_on_order_submitted.rk +16 -0
  210. package/template/base/modules/delivery/flows/fulfilment_on_order_updated.rk +19 -0
  211. package/template/base/modules/delivery/flows/fulfilment_on_return_cancelled.rk +16 -0
  212. package/template/base/modules/delivery/flows/fulfilment_on_return_submitted.rk +16 -0
  213. package/template/base/modules/delivery/flows/invoice_qty_from_deliveries.rk +20 -0
  214. package/template/base/modules/delivery/flows/order_cancel_guard.rk +10 -0
  215. package/template/base/modules/delivery/flows/return_cancel_guard.rk +11 -0
  216. package/template/base/modules/delivery/flows/return_credit_on_payment_cancelled.rk +11 -0
  217. package/template/base/modules/delivery/flows/return_credit_on_payment_submitted.rk +21 -0
  218. package/template/base/modules/delivery/flows/return_credit_on_return_cancelled.rk +11 -0
  219. package/template/base/modules/delivery/flows/return_credit_on_return_submitted.rk +10 -0
  220. package/template/base/modules/delivery/models/delivery_guard.rk +48 -0
  221. package/template/base/modules/delivery/models/delivery_note.rk +101 -0
  222. package/template/base/modules/delivery/models/delivery_note_item.rk +11 -0
  223. package/template/base/modules/delivery/models/order_fulfilment.rk +27 -0
  224. package/template/base/modules/delivery/models/order_fulfilment_item.rk +10 -0
  225. package/template/base/modules/delivery/models/return_credit.rk +23 -0
  226. package/template/base/modules/delivery/models/sales_return.rk +87 -0
  227. package/template/base/modules/delivery/models/sales_return_item.rk +16 -0
  228. package/template/base/modules/delivery/module.rk +16 -0
  229. package/template/base/modules/delivery/print/delivery_note.html +96 -0
  230. package/template/base/modules/delivery/print/delivery_note.rk +9 -0
  231. package/template/base/modules/distribution/flows/credit_on_invoice_cancelled.rk +17 -0
  232. package/template/base/modules/distribution/flows/credit_on_invoice_submitted.rk +17 -0
  233. package/template/base/modules/distribution/flows/credit_on_order_cancelled.rk +17 -0
  234. package/template/base/modules/distribution/flows/credit_on_order_submitted.rk +25 -0
  235. package/template/base/modules/distribution/flows/credit_on_payment_cancelled.rk +17 -0
  236. package/template/base/modules/distribution/flows/credit_on_payment_submitted.rk +17 -0
  237. package/template/base/modules/distribution/flows/giro_bounced.rk +20 -0
  238. package/template/base/modules/distribution/flows/giro_from_payment.rk +21 -0
  239. package/template/base/modules/distribution/flows/order_tier_pricing_created.rk +17 -0
  240. package/template/base/modules/distribution/flows/order_tier_pricing_updated.rk +17 -0
  241. package/template/base/modules/distribution/models/giro.rk +79 -0
  242. package/template/base/modules/distribution/module.rk +14 -0
  243. package/template/base/modules/invoicing/flows/invoice_due_digest.rk +12 -0
  244. package/template/base/modules/invoicing/flows/milestone_invoiced.rk +23 -0
  245. package/template/base/modules/invoicing/flows/milestone_reopened.rk +19 -0
  246. package/template/base/modules/invoicing/flows/payment_instruction_on_submit.rk +25 -0
  247. package/template/base/modules/invoicing/flows/project_billed_on_cancel.rk +16 -0
  248. package/template/base/modules/invoicing/flows/project_billed_on_submit.rk +16 -0
  249. package/template/base/modules/invoicing/flows/project_revenue_on_cancel.rk +22 -0
  250. package/template/base/modules/invoicing/flows/project_revenue_on_submit.rk +17 -0
  251. package/template/base/modules/invoicing/flows/sales_invoice_credit_recheck.rk +18 -0
  252. package/template/base/modules/invoicing/models/bank_account.rk +134 -0
  253. package/template/base/modules/invoicing/models/invoice_reminder.rk +83 -0
  254. package/template/base/modules/invoicing/models/payment_instruction.rk +72 -0
  255. package/template/base/modules/invoicing/models/sales_invoice.rk +324 -13
  256. package/template/base/modules/invoicing/models/sales_invoice_item.rk +23 -0
  257. package/template/base/modules/invoicing/module.rk +7 -2
  258. package/template/base/modules/invoicing/print/sales_invoice.html +145 -32
  259. package/template/base/modules/invoicing/print/sales_invoice.rk +7 -0
  260. package/template/base/modules/invoicing/print/sales_invoice_nota.html +71 -0
  261. package/template/base/modules/invoicing/print/sales_invoice_nota.rk +13 -0
  262. package/template/base/modules/invoicing/print/sales_invoice_whatsapp.html +45 -0
  263. package/template/base/modules/invoicing/print/sales_invoice_whatsapp.rk +15 -0
  264. package/template/base/modules/kitchen/flows/kitchen_ticket_on_sale.rk +47 -0
  265. package/template/base/modules/kitchen/flows/kitchen_ticket_on_update.rk +30 -0
  266. package/template/base/modules/kitchen/flows/kitchen_ticket_on_void.rk +23 -0
  267. package/template/base/modules/kitchen/models/kitchen_guard.rk +40 -0
  268. package/template/base/modules/kitchen/models/kitchen_route.rk +26 -0
  269. package/template/base/modules/kitchen/models/kitchen_station.rk +40 -0
  270. package/template/base/modules/kitchen/models/kitchen_ticket.rk +83 -0
  271. package/template/base/modules/kitchen/models/kitchen_ticket_item.rk +10 -0
  272. package/template/base/modules/kitchen/module.rk +18 -0
  273. package/template/base/modules/kitchen/print/kitchen_ticket.html +29 -0
  274. package/template/base/modules/kitchen/print/kitchen_ticket.rk +9 -0
  275. package/template/base/modules/kitchen/roles/kitchen.rk +6 -0
  276. package/template/base/modules/kitchen/screens/dapur.rk +22 -0
  277. package/template/base/modules/orders/models/customer_order.rk +98 -2
  278. package/template/base/modules/orders/models/customer_order_item.rk +29 -0
  279. package/template/base/modules/orders/module.rk +7 -2
  280. package/template/base/modules/outlet_sales/flows/moka_api_opened.rk +30 -0
  281. package/template/base/modules/outlet_sales/flows/moka_daily_sales.rk +78 -0
  282. package/template/base/modules/outlet_sales/flows/moka_held_release.rk +35 -0
  283. package/template/base/modules/outlet_sales/flows/moka_legacy_key_overlap.rk +22 -0
  284. package/template/base/modules/outlet_sales/flows/moka_line_mapped.rk +38 -0
  285. package/template/base/modules/outlet_sales/flows/moka_transaction_refused.rk +15 -0
  286. package/template/base/modules/outlet_sales/flows/moka_transaction_staged.rk +171 -0
  287. package/template/base/modules/outlet_sales/flows/outlet_day_backfill_harian.rk +71 -0
  288. package/template/base/modules/outlet_sales/flows/outlet_day_free_sales.rk +19 -0
  289. package/template/base/modules/outlet_sales/flows/outlet_day_free_takings.rk +19 -0
  290. package/template/base/modules/outlet_sales/flows/outlet_day_on_sales.rk +19 -0
  291. package/template/base/modules/outlet_sales/flows/outlet_day_on_takings.rk +19 -0
  292. package/template/base/modules/outlet_sales/flows/refund_on_return_cancelled.rk +15 -0
  293. package/template/base/modules/outlet_sales/flows/refund_on_return_submitted.rk +26 -0
  294. package/template/base/modules/outlet_sales/flows/refund_on_sales_submitted.rk +14 -0
  295. package/template/base/modules/outlet_sales/flows/sales_cancel_guard.rk +18 -0
  296. package/template/base/modules/outlet_sales/imports/daily_form.rk +3 -1
  297. package/template/base/modules/outlet_sales/imports/loyverse_receipts.rk +28 -0
  298. package/template/base/modules/outlet_sales/imports/moka_item_details.rk +14 -4
  299. package/template/base/modules/outlet_sales/imports/pos_sales_file.rk +28 -0
  300. package/template/base/modules/outlet_sales/imports/takings_file.rk +23 -0
  301. package/template/base/modules/outlet_sales/models/moka_sale_line.rk +66 -0
  302. package/template/base/modules/outlet_sales/models/moka_transaction.rk +26 -0
  303. package/template/base/modules/outlet_sales/models/outlet_return.rk +66 -0
  304. package/template/base/modules/outlet_sales/models/outlet_return_item.rk +7 -0
  305. package/template/base/modules/outlet_sales/models/outlet_sales.rk +79 -7
  306. package/template/base/modules/outlet_sales/models/outlet_sales_guard.rk +40 -0
  307. package/template/base/modules/outlet_sales/models/outlet_sales_line.rk +2 -0
  308. package/template/base/modules/outlet_sales/models/outlet_takings.rk +85 -0
  309. package/template/base/modules/outlet_sales/models/outlet_takings_line.rk +37 -0
  310. package/template/base/modules/outlet_sales/models/pos_refund.rk +36 -0
  311. package/template/base/modules/outlet_sales/models/pos_refund_item.rk +9 -0
  312. package/template/base/modules/outlet_sales/module.rk +7 -2
  313. package/template/base/modules/outlets/models/outlet.rk +57 -0
  314. package/template/base/modules/outlets/models/outlet_day.rk +30 -0
  315. package/template/base/modules/outlets/models/outlet_day_backfill.rk +25 -0
  316. package/template/base/modules/outlets/module.rk +7 -2
  317. package/template/base/modules/payments/flows/payment_from_doku.rk +73 -0
  318. package/template/base/modules/payments/flows/payment_from_xendit_invoice.rk +59 -0
  319. package/template/base/modules/payments/flows/payment_from_xendit_qr.rk +59 -0
  320. package/template/base/modules/payments/flows/payment_from_xendit_va.rk +59 -0
  321. package/template/base/modules/payments/flows/payment_gateway_claim_created.rk +19 -0
  322. package/template/base/modules/payments/flows/payment_gateway_claim_submitted.rk +19 -0
  323. package/template/base/modules/payments/flows/payment_gateway_release.rk +12 -0
  324. package/template/base/modules/payments/flows/payment_refund_from_doku.rk +14 -0
  325. package/template/base/modules/payments/models/gateway_ref_claim.rk +42 -0
  326. package/template/base/modules/payments/models/payment.rk +62 -1
  327. package/template/base/modules/payments/models/withholding.rk +16 -2
  328. package/template/base/modules/payments/module.rk +7 -2
  329. package/template/base/modules/payments/print/statement.html +1 -1
  330. package/template/base/modules/payroll/flows/cash_advance_cancel_guard.rk +15 -0
  331. package/template/base/modules/payroll/flows/invoice_payroll_once.rk +20 -0
  332. package/template/base/modules/payroll/flows/invoice_payroll_tag_lock.rk +13 -0
  333. package/template/base/modules/payroll/flows/payroll_close_on_cancel.rk +35 -0
  334. package/template/base/modules/payroll/flows/payroll_close_on_submit.rk +66 -0
  335. package/template/base/modules/payroll/flows/payroll_run_overlap_guard_created.rk +14 -0
  336. package/template/base/modules/payroll/flows/payroll_run_overlap_guard_updated.rk +14 -0
  337. package/template/base/modules/payroll/flows/payroll_totals_on_payslip_cancel.rk +29 -0
  338. package/template/base/modules/payroll/flows/payroll_totals_on_payslip_submit.rk +29 -0
  339. package/template/base/modules/payroll/flows/payslip_advance_guard.rk +23 -0
  340. package/template/base/modules/payroll/flows/payslip_cancel_guard.rk +14 -0
  341. package/template/base/modules/payroll/flows/payslip_casual_guard.rk +19 -0
  342. package/template/base/modules/payroll/flows/payslip_from_recap.rk +76 -0
  343. package/template/base/modules/payroll/flows/payslip_month_guard_created.rk +16 -0
  344. package/template/base/modules/payroll/flows/payslip_month_guard_submitted.rk +16 -0
  345. package/template/base/modules/payroll/flows/payslip_order_guard_cancelled.rk +15 -0
  346. package/template/base/modules/payroll/flows/payslip_order_guard_submitted.rk +15 -0
  347. package/template/base/modules/payroll/flows/payslip_pay_overlap_guard.rk +15 -0
  348. package/template/base/modules/payroll/flows/payslip_ytd_guard.rk +35 -0
  349. package/template/base/modules/payroll/flows/payslip_ytd_on_create.rk +49 -0
  350. package/template/base/modules/payroll/flows/recap_cancel_guard.rk +15 -0
  351. package/template/base/modules/payroll/models/cash_advance.rk +53 -0
  352. package/template/base/modules/payroll/models/payroll_close.rk +80 -0
  353. package/template/base/modules/payroll/models/payroll_guard.rk +89 -0
  354. package/template/base/modules/payroll/models/payroll_profile.rk +146 -0
  355. package/template/base/modules/payroll/models/payroll_run.rk +220 -0
  356. package/template/base/modules/payroll/models/payslip.rk +370 -0
  357. package/template/base/modules/payroll/module.rk +13 -0
  358. package/template/base/modules/payroll/print/payslip.html +54 -0
  359. package/template/base/modules/payroll/print/payslip.rk +7 -0
  360. package/template/base/modules/pipeline/module.rk +5 -0
  361. package/template/base/modules/pos/flows/outlet_day_backfill_kasir.rk +61 -0
  362. package/template/base/modules/pos/flows/pos_daily_form_guard.rk +18 -0
  363. package/template/base/modules/pos/flows/pos_sale_on_cancel.rk +42 -0
  364. package/template/base/modules/pos/flows/pos_sale_on_submit.rk +60 -0
  365. package/template/base/modules/pos/flows/pos_shift_close_on_cancel.rk +26 -0
  366. package/template/base/modules/pos/flows/pos_shift_close_on_submit.rk +23 -0
  367. package/template/base/modules/pos/flows/pos_shift_on_create.rk +21 -0
  368. package/template/base/modules/pos/flows/pos_shift_on_update.rk +10 -0
  369. package/template/base/modules/pos/flows/pos_takings_guard.rk +28 -0
  370. package/template/base/modules/pos/models/pos_guard.rk +76 -0
  371. package/template/base/modules/pos/models/pos_payment.rk +17 -0
  372. package/template/base/modules/pos/models/pos_sale.rk +226 -0
  373. package/template/base/modules/pos/models/pos_sale_item.rk +46 -0
  374. package/template/base/modules/pos/models/pos_shift.rk +92 -0
  375. package/template/base/modules/pos/models/pos_shift_close.rk +77 -0
  376. package/template/base/modules/pos/module.rk +22 -0
  377. package/template/base/modules/pos/print/pos_receipt.html +50 -0
  378. package/template/base/modules/pos/print/pos_receipt.rk +9 -0
  379. package/template/base/modules/pos/screens/kasir.rk +41 -0
  380. package/template/base/modules/procurement/flows/project_vendor_cost_on_cancel.rk +22 -0
  381. package/template/base/modules/procurement/flows/project_vendor_cost_on_submit.rk +17 -0
  382. package/template/base/modules/procurement/imports/opening_stock.rk +25 -0
  383. package/template/base/modules/procurement/models/goods_receipt.rk +3 -1
  384. package/template/base/modules/procurement/models/purchase_order.rk +22 -8
  385. package/template/base/modules/procurement/models/purchase_request.rk +12 -1
  386. package/template/base/modules/procurement/models/purchase_request_item.rk +2 -0
  387. package/template/base/modules/procurement/models/vendor_bill.rk +117 -4
  388. package/template/base/modules/procurement/module.rk +7 -2
  389. package/template/base/modules/production/flows/batch_cancel_guard.rk +12 -0
  390. package/template/base/modules/production/flows/batch_from_bom.rk +19 -0
  391. package/template/base/modules/production/flows/wage_sheet_on_batch_cancelled.rk +14 -0
  392. package/template/base/modules/production/flows/wage_sheet_on_batch_submitted.rk +12 -0
  393. package/template/base/modules/production/flows/work_order_materials_created.rk +20 -0
  394. package/template/base/modules/production/flows/work_order_materials_updated.rk +20 -0
  395. package/template/base/modules/production/models/bom.rk +68 -0
  396. package/template/base/modules/production/models/bom_byproduct.rk +7 -0
  397. package/template/base/modules/production/models/bom_line.rk +11 -0
  398. package/template/base/modules/production/models/production_batch.rk +153 -0
  399. package/template/base/modules/production/models/production_guard.rk +23 -0
  400. package/template/base/modules/production/models/production_labour.rk +10 -0
  401. package/template/base/modules/production/models/production_material.rk +8 -0
  402. package/template/base/modules/production/models/production_output.rk +8 -0
  403. package/template/base/modules/production/models/production_stage.rk +19 -0
  404. package/template/base/modules/production/models/wage_line.rk +15 -0
  405. package/template/base/modules/production/models/wage_sheet.rk +28 -0
  406. package/template/base/modules/production/models/work_order.rk +63 -0
  407. package/template/base/modules/production/models/work_order_material.rk +8 -0
  408. package/template/base/modules/production/module.rk +17 -0
  409. package/template/base/modules/production/print/wage_sheet.html +75 -0
  410. package/template/base/modules/production/print/wage_sheet.rk +9 -0
  411. package/template/base/modules/projects/flows/attendance_close_cancel_guard.rk +15 -0
  412. package/template/base/modules/projects/flows/attendance_close_on_submit.rk +68 -0
  413. package/template/base/modules/projects/flows/attendance_log_cancel_guard.rk +14 -0
  414. package/template/base/modules/projects/flows/attendance_log_guard_created.rk +17 -0
  415. package/template/base/modules/projects/flows/attendance_log_guard_submitted.rk +38 -0
  416. package/template/base/modules/projects/flows/attendance_log_guard_updated.rk +15 -0
  417. package/template/base/modules/projects/flows/milestone_back_on_acceptance_cancel.rk +15 -0
  418. package/template/base/modules/projects/flows/milestone_lock_on_update.rk +16 -0
  419. package/template/base/modules/projects/flows/milestone_ready_on_acceptance.rk +40 -0
  420. package/template/base/modules/projects/flows/milestone_scheduled_on_create.rk +14 -0
  421. package/template/base/modules/projects/flows/milestone_scheduled_on_update.rk +27 -0
  422. package/template/base/modules/projects/flows/project_expense_on_cancel.rk +21 -0
  423. package/template/base/modules/projects/flows/project_expense_on_submit.rk +16 -0
  424. package/template/base/modules/projects/flows/project_labor_on_cancel.rk +22 -0
  425. package/template/base/modules/projects/flows/project_labor_on_submit.rk +17 -0
  426. package/template/base/modules/projects/flows/project_terms_lock.rk +26 -0
  427. package/template/base/modules/projects/flows/timesheet_assignment_on_create.rk +28 -0
  428. package/template/base/modules/projects/flows/timesheet_attendance_overlap_guard.rk +20 -0
  429. package/template/base/modules/projects/flows/vendor_bill_cancel_guard.rk +15 -0
  430. package/template/base/modules/projects/flows/work_site_supervisor_changed.rk +19 -0
  431. package/template/base/modules/projects/flows/worker_employee_changed.rk +19 -0
  432. package/template/base/modules/projects/imports/attendance_recap.rk +23 -0
  433. package/template/base/modules/projects/imports/billing_milestone.rk +20 -0
  434. package/template/base/modules/projects/models/assignment.rk +65 -3
  435. package/template/base/modules/projects/models/attendance_close.rk +67 -0
  436. package/template/base/modules/projects/models/attendance_guard.rk +57 -0
  437. package/template/base/modules/projects/models/attendance_log.rk +275 -0
  438. package/template/base/modules/projects/models/billing_milestone.rk +217 -0
  439. package/template/base/modules/projects/models/project.rk +76 -2
  440. package/template/base/modules/projects/models/project_expense.rk +121 -0
  441. package/template/base/modules/projects/models/project_guard.rk +27 -0
  442. package/template/base/modules/projects/models/project_ledger.rk +146 -0
  443. package/template/base/modules/projects/models/timesheet.rk +100 -10
  444. package/template/base/modules/projects/models/work_site.rk +83 -0
  445. package/template/base/modules/projects/module.rk +8 -3
  446. package/template/base/modules/projects/roles/field_worker.rk +10 -0
  447. package/template/base/modules/projects/roles/site_supervisor.rk +8 -0
  448. package/template/base/modules/projects/screens/absen.rk +23 -0
  449. package/template/base/modules/quotation/models/quotation.rk +20 -4
  450. package/template/base/modules/quotation/models/quotation_item.rk +13 -0
  451. package/template/base/modules/quotation/module.rk +6 -1
  452. package/template/base/modules/quotation/print/quotation.html +17 -3
  453. package/template/base/modules/rental/flows/rental_booking_on_cancel.rk +19 -0
  454. package/template/base/modules/rental/flows/rental_booking_on_submit.rk +45 -0
  455. package/template/base/modules/rental/flows/rental_checkout_on_cancel.rk +24 -0
  456. package/template/base/modules/rental/flows/rental_checkout_on_submit.rk +33 -0
  457. package/template/base/modules/rental/flows/rental_invoice_once.rk +20 -0
  458. package/template/base/modules/rental/flows/rental_invoice_tag_lock.rk +12 -0
  459. package/template/base/modules/rental/flows/rental_return_on_cancel.rk +28 -0
  460. package/template/base/modules/rental/flows/rental_return_on_submit.rk +45 -0
  461. package/template/base/modules/rental/models/rental_booking.rk +124 -0
  462. package/template/base/modules/rental/models/rental_checkout.rk +91 -0
  463. package/template/base/modules/rental/models/rental_checkout_unit.rk +22 -0
  464. package/template/base/modules/rental/models/rental_guard.rk +93 -0
  465. package/template/base/modules/rental/models/rental_item.rk +83 -0
  466. package/template/base/modules/rental/models/rental_return.rk +134 -0
  467. package/template/base/modules/rental/models/rental_return_unit.rk +29 -0
  468. package/template/base/modules/rental/models/rental_schedule.rk +59 -0
  469. package/template/base/modules/rental/models/rental_unit.rk +80 -0
  470. package/template/base/modules/rental/module.rk +25 -0
  471. package/template/base/modules/rental/print/rental_bast_in.html +107 -0
  472. package/template/base/modules/rental/print/rental_bast_in.rk +9 -0
  473. package/template/base/modules/rental/print/rental_bast_out.html +98 -0
  474. package/template/base/modules/rental/print/rental_bast_out.rk +11 -0
  475. package/template/base/modules/rental/roles/rental_staff.rk +7 -0
  476. package/template/base/modules/rental/screens/alat_keluar.rk +19 -0
  477. package/template/base/modules/rental/screens/alat_kembali.rk +19 -0
  478. package/template/base/modules/rental/screens/jadwal_alat.rk +21 -0
  479. package/template/base/modules/stock/flows/adjustment_value_backfill.rk +95 -0
  480. package/template/base/modules/stock/flows/adjustment_value_on_cancel.rk +19 -0
  481. package/template/base/modules/stock/flows/adjustment_value_on_submit.rk +17 -0
  482. package/template/base/modules/stock/models/recipe.rk +8 -0
  483. package/template/base/modules/stock/models/stock_adjustment.rk +1 -0
  484. package/template/base/modules/stock/models/stock_adjustment_value.rk +80 -0
  485. package/template/base/modules/stock/models/stock_balance.rk +6 -2
  486. package/template/base/modules/stock/models/stock_count.rk +2 -0
  487. package/template/base/modules/stock/models/stock_move.rk +17 -5
  488. package/template/base/modules/stock/models/stock_transfer_item.rk +1 -1
  489. package/template/base/modules/stock/module.rk +7 -2
  490. package/template/base/modules/subscriptions/flows/collector_deposit_on_submit.rk +57 -0
  491. package/template/base/modules/subscriptions/flows/deposit_payment_kept.rk +17 -0
  492. package/template/base/modules/subscriptions/flows/deposit_payment_not_cancelled.rk +14 -0
  493. package/template/base/modules/subscriptions/flows/deposit_payment_not_deleted.rk +14 -0
  494. package/template/base/modules/subscriptions/flows/field_collection_cap_created.rk +24 -0
  495. package/template/base/modules/subscriptions/flows/field_collection_cap_updated.rk +24 -0
  496. package/template/base/modules/subscriptions/flows/field_collection_locked.rk +12 -0
  497. package/template/base/modules/subscriptions/flows/field_collection_not_deleted.rk +10 -0
  498. package/template/base/modules/subscriptions/flows/invoice_subscription_kept.rk +19 -0
  499. package/template/base/modules/subscriptions/flows/invoice_subscription_once.rk +34 -0
  500. package/template/base/modules/subscriptions/flows/invoice_subscription_tag_lock.rk +13 -0
  501. package/template/base/modules/subscriptions/flows/service_area_collector.rk +14 -0
  502. package/template/base/modules/subscriptions/flows/subscription_billing.rk +79 -0
  503. package/template/base/modules/subscriptions/flows/subscription_dunning.rk +81 -0
  504. package/template/base/modules/subscriptions/flows/subscription_extra_locked.rk +14 -0
  505. package/template/base/modules/subscriptions/flows/subscription_status_on_payment.rk +48 -0
  506. package/template/base/modules/subscriptions/models/collection_visit.rk +47 -0
  507. package/template/base/modules/subscriptions/models/collector_deposit.rk +36 -0
  508. package/template/base/modules/subscriptions/models/field_collection.rk +42 -0
  509. package/template/base/modules/subscriptions/models/service_area.rk +19 -0
  510. package/template/base/modules/subscriptions/models/subscription.rk +235 -0
  511. package/template/base/modules/subscriptions/models/subscription_bill.rk +48 -0
  512. package/template/base/modules/subscriptions/models/subscription_extra.rk +50 -0
  513. package/template/base/modules/subscriptions/models/subscription_guard.rk +65 -0
  514. package/template/base/modules/subscriptions/models/subscription_month.rk +29 -0
  515. package/template/base/modules/subscriptions/models/subscription_plan.rk +75 -0
  516. package/template/base/modules/subscriptions/models/subscription_status_log.rk +27 -0
  517. package/template/base/modules/subscriptions/module.rk +18 -0
  518. package/template/base/modules/subscriptions/roles/collector.rk +7 -0
  519. package/template/base/modules/subscriptions/screens/catat_tagih.rk +18 -0
  520. package/template/base/modules/subscriptions/screens/rute_tagih.rk +25 -0
  521. package/template/base/modules/tax_id/module.rk +5 -0
  522. package/template/base/modules/users/models/user.rk +35 -4
  523. package/template/base/modules/users/models/user_outlet.rk +6 -0
  524. package/template/base/modules/users/module.rk +8 -2
  525. package/template/base/modules/users/roles/cashier.rk +8 -0
  526. package/template/base/modules/users/roles/course_admin.rk +4 -0
  527. package/template/base/modules/users/roles/field_sales.rk +7 -0
  528. package/template/base/modules/workforce/imports/worker_list.rk +21 -0
  529. package/template/base/modules/workforce/models/certification.rk +1 -2
  530. package/template/base/modules/workforce/models/worker.rk +54 -4
  531. package/template/base/modules/workforce/module.rk +6 -1
  532. package/template/demo/fixtures/demo.rk +2 -2
@@ -0,0 +1,370 @@
1
+ # yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/model.json
2
+ name: payslip
3
+ label: {id: Slip gaji, en: Payslip}
4
+ icon: invoice
5
+ is_submittable: true
6
+ naming: SLIP-{YYYY}-{#####}
7
+ title_field: worker
8
+ # One worker in one payroll run. Made as a draft from the worker's submitted attendance recap (flow payslip_from_recap)
9
+ # or by hand for a monthly worker; submitted by finance while the run is open. Every amount is computed here from the
10
+ # inputs, the profile and the run, with the rules of docs/payroll.md (PP 58/2023 + PMK 168/2023 for PPh 21, PP 44/2015,
11
+ # 45/2015, 46/2015 and Perpres 82/2018 for BPJS, PP 35/2021 for overtime). The year-to-date fields are filled by
12
+ # payslip_ytd_on_create from this worker's earlier submitted slips of the tax year; the December (or last) slip
13
+ # recomputes the year with Pasal 17 and takes what January to November already withheld.
14
+ permissions:
15
+ - {role: finance_manager, read: true, create: true, write: true, delete: true, submit: true, cancel: true, amend: true, export: true, print: true}
16
+ # Recaps are submitted by the project admin; their flow makes the draft slip as that person (no submit).
17
+ - {role: project_admin, read: true, create: true}
18
+ fields:
19
+ - name: payroll_run
20
+ type: link
21
+ to: payroll_run
22
+ label: {id: Periode gaji}
23
+ required: true
24
+ in_list: true
25
+ - name: profile
26
+ type: link
27
+ to: payroll_profile
28
+ label: {id: Data gaji pekerja}
29
+ required: true
30
+ - {name: run_umk, type: currency, label: {id: UMK periode}, hidden: true, compute: payroll_run.umk}
31
+ - {name: run_jkk_rate, type: percent, label: {id: Tarif JKK periode}, hidden: true, compute: payroll_run.jkk_rate}
32
+ - {name: run_jp_cap, type: currency, label: {id: Batas JP periode}, hidden: true, compute: payroll_run.jp_wage_cap}
33
+ - {name: run_kes_cap, type: currency, label: {id: Batas Kesehatan periode}, hidden: true, compute: payroll_run.kes_wage_cap}
34
+ - {name: run_workdays, type: int, label: {id: Hari kerja per minggu periode}, hidden: true, compute: payroll_run.workdays_per_week}
35
+ - {name: run_period_from, type: date, label: {id: Periode dari}, hidden: true, compute: payroll_run.period_from}
36
+ - {name: run_period_to, type: date, label: {id: Periode sampai}, hidden: true, compute: payroll_run.period_to}
37
+ - name: worker
38
+ type: link
39
+ to: worker
40
+ label: {id: Tenaga kerja}
41
+ compute: profile.worker
42
+ in_list: true
43
+ - name: project
44
+ type: link
45
+ to: project
46
+ label: {id: Proyek}
47
+ compute: payroll_run.project
48
+ - name: timesheet
49
+ type: link
50
+ to: timesheet
51
+ label: {id: Rekap absensi}
52
+ - {name: tax_year, type: int, label: {id: Tahun pajak}, default: payroll_run.tax_year}
53
+ - {name: tax_month, type: int, label: {id: Bulan pajak}, default: payroll_run.tax_month}
54
+ # December, or the month the worker leaves: PPh 21 is recomputed for the year (Pasal 17).
55
+ - name: last_month
56
+ type: check
57
+ label: {id: Masa pajak terakhir (Desember atau keluar)}
58
+ default: payroll_run.tax_month == 12
59
+ # Inputs, copied when the slip is made so a later change of the profile or the worker does not change a slip.
60
+ - name: pay_basis
61
+ type: select
62
+ label: {id: Dasar gaji}
63
+ default: profile.pay_basis
64
+ options:
65
+ - {value: daily, label: {id: Harian}}
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'}}
74
+ - {name: days, type: float, label: {id: Hari hadir}, default: '0', in_list: true}
75
+ - {name: day_rate, type: currency, label: {id: Upah per hari}, default: profile.worker.cost_day_rate}
76
+ - {name: monthly_salary, type: currency, label: {id: Gaji pokok per bulan}, default: profile.monthly_salary}
77
+ - {name: fixed_allowance, type: currency, label: {id: Tunjangan tetap}, default: profile.fixed_allowance}
78
+ - {name: daily_allowance, type: currency, label: {id: Tunjangan per hari hadir}, default: profile.daily_allowance}
79
+ - {name: overtime_hours, type: float, label: {id: Jam lembur}, default: '0'}
80
+ # Days with overtime: the first hour of each is paid 1,5x, the rest 2x (PP 35/2021, working days), when no weighted
81
+ # overtime rate is set.
82
+ - {name: overtime_days, type: float, label: {id: Hari ada lembur}, default: '0'}
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'}
92
+ # THR: months of service (12 or more = one month's wage, fewer = pro rata; under 1 = none). 0 = no THR this month.
93
+ - {name: thr_tenure_months, type: float, label: {id: Masa kerja untuk THR (bulan)}, default: '0'}
94
+ - {name: other_income, type: currency, label: {id: Insentif lain}, default: '0'}
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}}
99
+ # A kasbon of this worker not yet repaid in full by the submitted slips linking it, found when the slip is made
100
+ # (payslip_ytd_on_create, payslip_from_recap). A deduction without a link while one is open is warned at submit
101
+ # (audit gelombang 3 r2 R1): linked, the kasbon cannot be cancelled after its repayment.
102
+ - {name: open_advance, type: link, to: cash_advance, label: {id: Kasbon belum lunas}, read_only: true}
103
+ - name: ptkp_status
104
+ type: select
105
+ label: {id: Status PTKP}
106
+ default: profile.ptkp_status
107
+ options:
108
+ - {value: tk0, label: {id: TK/0}}
109
+ - {value: tk1, label: {id: TK/1}}
110
+ - {value: tk2, label: {id: TK/2}}
111
+ - {value: tk3, label: {id: TK/3}}
112
+ - {value: k0, label: {id: K/0}}
113
+ - {value: k1, label: {id: K/1}}
114
+ - {value: k2, label: {id: K/2}}
115
+ - {value: k3, label: {id: K/3}}
116
+ - {name: has_tax_id, type: check, label: {id: Punya NIK/NPWP valid}, default: profile.has_tax_id}
117
+ - {name: bpjs_tk, type: check, label: {id: BPJS Ketenagakerjaan}, default: profile.bpjs_tk}
118
+ - {name: bpjs_jp, type: check, label: {id: Jaminan Pensiun}, default: profile.bpjs_jp}
119
+ - {name: bpjs_kes, type: check, label: {id: BPJS Kesehatan}, default: profile.bpjs_kes}
120
+ # The recap's own labour cost, already on the project ledger (project_labor_on_submit): the run books only the rest.
121
+ - {name: timesheet_cost, type: currency, label: {id: Biaya sudah dibukukan absensi}, compute: "timesheet != '' ? timesheet.cost_amount : 0"}
122
+ # Year to date (earlier submitted slips of this worker and tax year), filled by payslip_ytd_on_create.
123
+ - {name: ytd_gross, type: currency, label: {id: Bruto sebelumnya tahun ini}, default: '0', read_only: true}
124
+ - {name: ytd_pph21, type: currency, label: {id: PPh 21 sebelumnya tahun ini}, default: '0', read_only: true}
125
+ - {name: ytd_pension, type: currency, label: {id: JHT + JP pekerja sebelumnya}, default: '0', read_only: true}
126
+ - {name: ytd_months, type: int, label: {id: Bulan sebelumnya tahun ini}, default: '0', read_only: true}
127
+ # Pay.
128
+ - name: base_pay
129
+ type: currency
130
+ label: {id: Gaji pokok}
131
+ compute: "pay_basis == 'monthly' ? monthly_salary : round(days * day_rate)"
132
+ # Upah sebulan (pokok + tunjangan tetap) for the hourly overtime wage and THR; a daily worker's month is 25 days
133
+ # (6-day week) or 21 (5-day week).
134
+ - name: month_wage
135
+ type: currency
136
+ label: {id: Upah sebulan}
137
+ hidden: true
138
+ compute: "(pay_basis == 'monthly' ? monthly_salary : day_rate * (payroll_run.workdays_per_week == 5 ? 21 : 25)) + fixed_allowance"
139
+ - name: overtime_pay
140
+ type: currency
141
+ label: {id: Lembur}
142
+ 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))))"
143
+ - name: holiday_overtime_pay
144
+ type: currency
145
+ label: {id: Lembur hari libur}
146
+ compute: "round(month_wage * 1.0 / 173 * (2.0 * holiday_hours_2x + 3.0 * holiday_hours_3x + 4.0 * holiday_hours_4x))"
147
+ - name: allowance_pay
148
+ type: currency
149
+ label: {id: Tunjangan}
150
+ compute: "fixed_allowance + round(days * daily_allowance)"
151
+ - name: thr_pay
152
+ type: currency
153
+ label: {id: THR}
154
+ compute: "thr_tenure_months >= 1 ? round(month_wage * 1.0 * (thr_tenure_months < 12 ? thr_tenure_months : 12) / 12) : 0"
155
+ - name: cash_gross
156
+ type: currency
157
+ label: {id: 'Penghasilan (gaji, tunjangan, lembur, THR)'}
158
+ compute: base_pay + overtime_pay + holiday_overtime_pay + allowance_pay + thr_pay + other_income
159
+ in_list: true
160
+ # BPJS wage: pokok + tunjangan tetap, never below the UMK of the site.
161
+ - name: bpjs_base
162
+ type: currency
163
+ label: {id: Dasar upah BPJS}
164
+ compute: "base_pay + fixed_allowance > payroll_run.umk ? base_pay + fixed_allowance : payroll_run.umk"
165
+ - name: below_umk
166
+ type: check
167
+ label: {id: Upah di bawah UMK}
168
+ compute: "(pay_basis == 'monthly' ? monthly_salary : day_rate * (payroll_run.workdays_per_week == 5 ? 21 : 25)) < payroll_run.umk"
169
+ - {name: jkk, type: currency, label: {id: JKK (perusahaan)}, compute: "bpjs_tk ? round(bpjs_base * payroll_run.jkk_rate / 100) : 0"}
170
+ - {name: jkm, type: currency, label: {id: JKM (perusahaan)}, compute: "bpjs_tk ? round(bpjs_base * 0.3 / 100) : 0"}
171
+ - {name: jht_employer, type: currency, label: {id: 'JHT 3,7% (perusahaan)'}, compute: "bpjs_tk ? round(bpjs_base * 3.7 / 100) : 0"}
172
+ - {name: jht_employee, type: currency, label: {id: JHT 2% (pekerja)}, compute: "bpjs_tk ? round(bpjs_base * 2.0 / 100) : 0"}
173
+ - {name: jp_employer, type: currency, label: {id: JP 2% (perusahaan)}, compute: "bpjs_tk && bpjs_jp ? round((bpjs_base < payroll_run.jp_wage_cap ? bpjs_base : payroll_run.jp_wage_cap) * 2.0 / 100) : 0"}
174
+ - {name: jp_employee, type: currency, label: {id: JP 1% (pekerja)}, compute: "bpjs_tk && bpjs_jp ? round((bpjs_base < payroll_run.jp_wage_cap ? bpjs_base : payroll_run.jp_wage_cap) * 1.0 / 100) : 0"}
175
+ - {name: kes_employer, type: currency, label: {id: BPJS Kesehatan 4% (perusahaan)}, compute: "bpjs_kes ? round((bpjs_base < payroll_run.kes_wage_cap ? bpjs_base : payroll_run.kes_wage_cap) * 4.0 / 100) : 0"}
176
+ - {name: kes_employee, type: currency, label: {id: BPJS Kesehatan 1% (pekerja)}, compute: "bpjs_kes ? round((bpjs_base < payroll_run.kes_wage_cap ? bpjs_base : payroll_run.kes_wage_cap) * 1.0 / 100) : 0"}
177
+ # PPh 21. Gross includes the premiums the employer pays for the worker: JKK, JKM, BPJS Kesehatan 4% (not JHT, JP).
178
+ - name: gross_taxable
179
+ type: currency
180
+ label: {id: Bruto PPh 21}
181
+ compute: cash_gross + jkk + jkm + kes_employer
182
+ - name: ter_category
183
+ type: data
184
+ label: {id: Kategori TER}
185
+ compute: "ptkp_status == 'k3' ? 'C' : (ptkp_status in ['tk2', 'tk3', 'k1', 'k2'] ? 'B' : 'A')"
186
+ # TER in basis points of a percent (25 = 0,25%): the PP 58/2023 tables as [upper bound, step to the next rate], summed
187
+ # over the bounds the gross is above. Replace the three lists when the table changes.
188
+ - name: ter_bp
189
+ type: int
190
+ label: {id: TER (per sepuluh ribu)}
191
+ compute: >-
192
+ ter_category == 'A' ? [[5400000, 25], [5650000, 25], [5950000, 25], [6300000, 25], [6750000, 25], [7500000, 25], [8550000, 25], [9650000, 25], [10050000, 25], [10350000, 25], [10700000, 50], [11050000, 50], [11600000, 50], [12500000, 100], [13750000, 100], [15100000, 100], [16950000, 100], [19750000, 100], [24150000, 100], [26450000, 100], [28000000, 100], [30050000, 100], [32400000, 100], [35400000, 100], [39100000, 100], [43850000, 100], [47800000, 100], [51400000, 100], [56300000, 100], [62200000, 100], [68600000, 100], [77500000, 100], [89000000, 100], [103000000, 100], [125000000, 100], [157000000, 100], [206000000, 100], [337000000, 100], [454000000, 100], [550000000, 100], [695000000, 100], [910000000, 100], [1400000000, 100]].map(b, gross_taxable > b[0] ? b[1] : 0).sum()
193
+ : (ter_category == 'B' ? [[6200000, 25], [6500000, 25], [6850000, 25], [7300000, 25], [9200000, 50], [10750000, 50], [11250000, 50], [11600000, 50], [12600000, 100], [13600000, 100], [14950000, 100], [16400000, 100], [18450000, 100], [21850000, 100], [26000000, 100], [27700000, 100], [29350000, 100], [31450000, 100], [33950000, 100], [37100000, 100], [41100000, 100], [45800000, 100], [49500000, 100], [53800000, 100], [58500000, 100], [64000000, 100], [71000000, 100], [80000000, 100], [93000000, 100], [109000000, 100], [129000000, 100], [163000000, 100], [211000000, 100], [374000000, 100], [459000000, 100], [555000000, 100], [704000000, 100], [957000000, 100], [1405000000, 100]].map(b, gross_taxable > b[0] ? b[1] : 0).sum()
194
+ : [[6600000, 25], [6950000, 25], [7350000, 25], [7800000, 25], [8850000, 25], [9800000, 25], [10950000, 25], [11200000, 25], [12050000, 100], [12950000, 100], [14150000, 100], [15550000, 100], [17050000, 100], [19500000, 100], [22700000, 100], [26600000, 100], [28100000, 100], [30100000, 100], [32600000, 100], [35400000, 100], [38900000, 100], [43000000, 100], [47400000, 100], [51200000, 100], [55800000, 100], [60400000, 100], [66700000, 100], [74500000, 100], [83200000, 100], [95600000, 100], [110000000, 100], [134000000, 100], [169000000, 100], [221000000, 100], [390000000, 100], [463000000, 100], [561000000, 100], [709000000, 100], [965000000, 100], [1419000000, 100]].map(b, gross_taxable > b[0] ? b[1] : 0).sum())
195
+ # Truncated to the rupiah: round(x - 0.5) is the floor of a non-negative x made by one division of whole numbers
196
+ # (the validators know no floor or int).
197
+ - name: ter_pph21
198
+ type: currency
199
+ label: {id: PPh 21 TER bulan ini}
200
+ hidden: true
201
+ compute: "round(gross_taxable * ter_bp * (has_tax_id ? 100 : 120) / 1000000.0 - 0.5)"
202
+ # Daily TER (PP 58/2023, PMK 168/2023 Pasal 16 ayat 2) for a pegawai tidak tetap paid per day: bruto sehari = this
203
+ # 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%;
204
+ # above that the Pasal 17 layers on 50% of the gross paid (per payment, not cumulative, audit F7). x 120% without a
205
+ # tax number; truncated to the rupiah.
206
+ - name: ter_daily
207
+ type: check
208
+ label: {id: PPh 21 TER harian}
209
+ hidden: true
210
+ compute: "employment == 'casual' && pay_basis == 'daily'"
211
+ - name: daily_gross
212
+ type: currency
213
+ label: {id: Bruto sehari (TER harian)}
214
+ depends_on: ter_daily
215
+ compute: "days + holiday_overtime_days > 0 ? round(gross_taxable * 1.0 / (days + holiday_overtime_days)) : 0"
216
+ - name: daily_pph21
217
+ type: currency
218
+ label: {id: PPh 21 TER harian}
219
+ hidden: true
220
+ compute: >-
221
+ days + holiday_overtime_days <= 0 || gross_taxable * 1.0 / (days + holiday_overtime_days) <= 450000 ? 0
222
+ : (gross_taxable * 1.0 / (days + holiday_overtime_days) <= 2500000 ? round(gross_taxable * 0.5 * (has_tax_id ? 100 : 120) / 10000.0 - 0.5)
223
+ : round(((gross_taxable * 0.5 > 60000000 ? 60000000 : gross_taxable * 0.5) * 5
224
+ + (gross_taxable * 0.5 > 250000000 ? 190000000 : (gross_taxable * 0.5 > 60000000 ? gross_taxable * 0.5 - 60000000 : 0)) * 15
225
+ + (gross_taxable * 0.5 > 500000000 ? 250000000 : (gross_taxable * 0.5 > 250000000 ? gross_taxable * 0.5 - 250000000 : 0)) * 25
226
+ + (gross_taxable * 0.5 > 5000000000 ? 4500000000 : (gross_taxable * 0.5 > 500000000 ? gross_taxable * 0.5 - 500000000 : 0)) * 30
227
+ + (gross_taxable * 0.5 > 5000000000 ? gross_taxable * 0.5 - 5000000000 : 0) * 35) * (has_tax_id ? 100 : 120) / 10000.0 - 0.5))
228
+ # Annual recomputation (last_month).
229
+ - name: ptkp
230
+ type: currency
231
+ label: {id: PTKP setahun}
232
+ compute: "54000000 + (ptkp_status.startsWith('k') ? 4500000 : 0) + (ptkp_status.endsWith('1') ? 4500000 : (ptkp_status.endsWith('2') ? 9000000 : (ptkp_status.endsWith('3') ? 13500000 : 0)))"
233
+ - {name: year_gross, type: currency, label: {id: Bruto setahun}, compute: ytd_gross + gross_taxable}
234
+ # Biaya jabatan 5%, at most 500.000 per month worked (6.000.000 a year).
235
+ - name: job_cost
236
+ type: currency
237
+ label: {id: Biaya jabatan setahun}
238
+ compute: "round(year_gross * 5 / 100.0 - 0.5) < 500000 * (ytd_months + 1) ? round(year_gross * 5 / 100.0 - 0.5) : 500000 * (ytd_months + 1)"
239
+ - name: year_net
240
+ type: currency
241
+ label: {id: Neto setahun}
242
+ compute: year_gross - job_cost - ytd_pension - jht_employee - jp_employee
243
+ # Rounded down to thousands.
244
+ - name: year_pkp
245
+ type: currency
246
+ label: {id: PKP setahun}
247
+ compute: "year_net > ptkp ? round((year_net - ptkp) / 1000.0 - 0.5) * 1000 : 0"
248
+ # Pasal 17 layers 5/15/25/30/35% on PKP (a multiple of 1.000, so every layer is whole rupiah), x 120% without a tax
249
+ # number, truncated to the rupiah.
250
+ - name: year_pph21
251
+ type: currency
252
+ label: {id: PPh 21 setahun (Pasal 17)}
253
+ compute: >-
254
+ round(((year_pkp > 60000000 ? 60000000 : year_pkp) * 5
255
+ + (year_pkp > 250000000 ? 190000000 : (year_pkp > 60000000 ? year_pkp - 60000000 : 0)) * 15
256
+ + (year_pkp > 500000000 ? 250000000 : (year_pkp > 250000000 ? year_pkp - 250000000 : 0)) * 25
257
+ + (year_pkp > 5000000000 ? 4500000000 : (year_pkp > 500000000 ? year_pkp - 500000000 : 0)) * 30
258
+ + (year_pkp > 5000000000 ? year_pkp - 5000000000 : 0) * 35) * (has_tax_id ? 100 : 120) / 10000.0 - 0.5)
259
+ # Negative on a last slip = over-withheld this year, paid back to the worker on this slip.
260
+ - name: pph21
261
+ type: currency
262
+ label: {id: PPh 21 dipotong}
263
+ compute: "ter_daily ? daily_pph21 : (last_month ? year_pph21 - ytd_pph21 : ter_pph21)"
264
+ - name: employee_bpjs
265
+ type: currency
266
+ label: {id: BPJS dipotong dari pekerja}
267
+ compute: jht_employee + jp_employee + kes_employee
268
+ - name: employer_bpjs
269
+ type: currency
270
+ label: {id: BPJS dibayar perusahaan}
271
+ compute: jkk + jkm + jht_employer + jp_employer + kes_employer
272
+ - name: net_pay
273
+ type: currency
274
+ label: {id: Gaji bersih}
275
+ compute: cash_gross - employee_bpjs - pph21 - other_deduction
276
+ in_list: true
277
+ - name: employer_cost
278
+ type: currency
279
+ label: {id: Biaya perusahaan}
280
+ compute: cash_gross + employer_bpjs
281
+ - {name: deposit_bpjs_tk, type: currency, label: {id: Setoran BPJS TK}, compute: jkk + jkm + jht_employer + jht_employee + jp_employer + jp_employee}
282
+ - {name: deposit_bpjs_kes, type: currency, label: {id: Setoran BPJS Kesehatan}, compute: kes_employer + kes_employee}
283
+ rules:
284
+ - name: run_open
285
+ on: submit
286
+ check: "!payroll_run.closed"
287
+ message: {id: 'Periode gaji sudah ditutup; slip baru masuk periode yang masih terbuka'}
288
+ - name: inputs_not_negative
289
+ on: save
290
+ check: >-
291
+ days >= 0 && days <= 31 && day_rate >= 0 && monthly_salary >= 0 && fixed_allowance >= 0 && daily_allowance >= 0
292
+ && overtime_hours >= 0 && overtime_hours <= 744 && overtime_days >= 0 && overtime_days <= days + 0.0001 && overtime_rate >= 0
293
+ && thr_tenure_months >= 0 && other_income >= 0 && other_deduction >= 0
294
+ && holiday_overtime_days >= 0 && holiday_overtime_days <= 31 && holiday_hours_2x >= 0 && holiday_hours_3x >= 0 && holiday_hours_4x >= 0
295
+ && holiday_hours_2x <= holiday_overtime_days * (payroll_run.workdays_per_week == 5 ? 8 : 7)
296
+ && holiday_hours_3x <= holiday_overtime_days && holiday_hours_4x <= holiday_overtime_days * 3
297
+ 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'}
298
+ # Rest-day hours climb the tiers in order (PP 35/2021 Pasal 31; audit gelombang 3 r2 R4): an hour at 3x only after a
299
+ # full day at 2x (at least 5 hours, the shortest day of a six-day week; 8 hours in a five-day week), hours at 4x only
300
+ # after the hour at 3x (at most 3 per day that had one).
301
+ - name: holiday_tiers_in_order
302
+ on: save
303
+ check: >-
304
+ holiday_hours_2x >= holiday_hours_3x * (payroll_run.workdays_per_week == 5 ? 8 : 5)
305
+ && holiday_hours_4x <= holiday_hours_3x * 3
306
+ message: {id: 'Jam hari libur 3x baru setelah jam 2x penuh, dan 4x baru setelah jam 3x'}
307
+ - name: pay_entered
308
+ on: submit
309
+ check: "pay_basis == 'monthly' ? monthly_salary > 0 : (days > 0 && day_rate > 0)"
310
+ message: {id: 'Slip butuh hari hadir dan upah per hari (harian) atau gaji pokok (bulanan)'}
311
+ - name: same_project
312
+ on: save
313
+ check: timesheet == '' || (timesheet.project == payroll_run.project && timesheet.worker == profile.worker && timesheet.docstatus == 1)
314
+ message: {id: 'Rekap absensi harus milik pekerja dan proyek periode ini, dan sudah diajukan'}
315
+ - name: advance_of_worker
316
+ on: save
317
+ check: cash_advance == '' || (cash_advance.worker == profile.worker && cash_advance.docstatus == 1 && other_deduction > 0)
318
+ message: {id: 'Kasbon yang dipotong harus milik pekerja ini, sudah diajukan, dan potongannya diisi'}
319
+ - name: same_tax_month
320
+ on: save
321
+ check: tax_year == payroll_run.tax_year && tax_month == payroll_run.tax_month
322
+ message: {id: 'Tahun dan bulan pajak slip harus sama dengan periode gajinya'}
323
+ - name: net_not_negative
324
+ on: submit
325
+ check: net_pay >= 0
326
+ message: {id: 'Gaji bersih minus: kurangi potongan lain'}
327
+ - name: deduction_not_linked
328
+ on: submit
329
+ level: warn
330
+ check: other_deduction == 0 || cash_advance != '' || open_advance == ''
331
+ message: {id: 'Pekerja ini punya kasbon belum lunas, tapi potongannya tidak ditautkan ke kasbon itu'}
332
+ - name: umk_warning
333
+ on: submit
334
+ level: warn
335
+ check: "!below_umk"
336
+ message: {id: 'Upah di bawah UMK lokasi kerja'}
337
+ views:
338
+ list:
339
+ columns: [name, payroll_run, worker, days, cash_gross, pph21, net_pay, status]
340
+ filters: [payroll_run, worker]
341
+ form:
342
+ layout:
343
+ - section: {id: Slip}
344
+ columns:
345
+ - [payroll_run, profile, worker, timesheet]
346
+ - [tax_year, tax_month, last_month, ptkp_status, has_tax_id]
347
+ - section: {id: Kehadiran dan upah}
348
+ columns:
349
+ - [pay_basis, employment, days, day_rate, monthly_salary, fixed_allowance, daily_allowance]
350
+ - [overtime_hours, overtime_days, overtime_rate, thr_tenure_months, other_income, other_deduction, cash_advance, open_advance]
351
+ - section: {id: Hari libur masuk kerja}
352
+ columns:
353
+ - [holiday_overtime_days]
354
+ - [holiday_hours_2x, holiday_hours_3x, holiday_hours_4x]
355
+ - section: {id: Penghasilan}
356
+ columns:
357
+ - [base_pay, overtime_pay, holiday_overtime_pay, allowance_pay]
358
+ - [thr_pay, cash_gross]
359
+ - section: {id: BPJS}
360
+ columns:
361
+ - [bpjs_base, jkk, jkm, jht_employer, jp_employer, kes_employer, employer_bpjs]
362
+ - [bpjs_tk, bpjs_jp, bpjs_kes, jht_employee, jp_employee, kes_employee, employee_bpjs]
363
+ - section: {id: PPh 21}
364
+ columns:
365
+ - [gross_taxable, ter_category, ter_bp, daily_gross, pph21]
366
+ - [ytd_gross, ytd_pph21, year_gross, job_cost, year_net, year_pkp, year_pph21]
367
+ - section: {id: Bersih}
368
+ columns:
369
+ - [net_pay, employer_cost]
370
+ - [below_umk, timesheet_cost]
@@ -0,0 +1,13 @@
1
+ # yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/module.json
2
+ name: payroll
3
+ version: 1.2.1
4
+ title: {id: Penggajian, en: Payroll}
5
+ summary:
6
+ id: Data gaji pekerja, periode gaji, slip gaji dan tutup periode.
7
+ en: Worker pay data, pay periods, payslips and period close.
8
+ category: people
9
+ icon: money-dollar-box-line
10
+ # Monthly pay of outsourced workers from the attendance recap (projects.timesheet with period_to): payslips with BPJS and
11
+ # PPh 21 TER, the deposits of the month, the extra employer cost on the project margin and the client invoice (wages +
12
+ # BPJS + fee, or fee only). Rules and sources: docs/payroll.md.
13
+ requires: {rangka: '>=0.5', users: ^1.0, contacts: ^1.0, catalogue: ^1.0, workforce: ^1.0, projects: ^1.0, invoicing: ^1.7}
@@ -0,0 +1,54 @@
1
+ {{define "style"}}
2
+ .meta { width: 100%; margin: 8px 0 12px; border-collapse: collapse; font-size: 0.92em; }
3
+ .meta td { padding: 2px 6px 2px 0; vertical-align: top; }
4
+ .cols { display: flex; gap: 16px; }
5
+ .cols > div { flex: 1; }
6
+ .items { width: 100%; border-collapse: collapse; font-size: 0.92em; }
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
+ .net { margin-top: 14px; padding: 10px 12px; background: #f5f5f4; display: flex; justify-content: space-between; font-size: 1.1em; font-weight: 700; }
12
+ .note { margin-top: 10px; font-size: 0.82em; color: #57534e; }
13
+ {{end}}
14
+ {{template "letterhead" .}}
15
+ <h1>Slip gaji</h1>
16
+ <table class="meta">
17
+ <tr><td>Nama</td><td>: {{.Links.worker.worker_name}}</td><td>No. slip</td><td>: {{.Doc.name}}</td></tr>
18
+ <tr><td>No. pegawai</td><td>: {{.Links.worker.employee_no}}</td><td>Masa pajak</td><td>: {{.Doc.tax_month}}/{{.Doc.tax_year}}</td></tr>
19
+ <tr><td>Jabatan</td><td>: {{.Links.worker.role_title}}</td><td>Periode</td><td>: {{date .Links.payroll_run.period_from}} s.d. {{date .Links.payroll_run.period_to}}</td></tr>
20
+ <tr><td>Hari hadir</td><td>: {{.Doc.days}}</td><td>Lembur</td><td>: {{.Doc.overtime_hours}} jam</td></tr>
21
+ </table>
22
+ <div class="cols">
23
+ <div>
24
+ <table class="items">
25
+ <thead><tr><th>Penghasilan</th><th class="num">Rp</th></tr></thead>
26
+ <tbody>
27
+ <tr><td>Gaji pokok</td><td class="num">{{rupiah .Doc.base_pay}}</td></tr>
28
+ {{if .Doc.allowance_pay}}<tr><td>Tunjangan</td><td class="num">{{rupiah .Doc.allowance_pay}}</td></tr>{{end}}
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}}
31
+ {{if .Doc.thr_pay}}<tr><td>THR</td><td class="num">{{rupiah .Doc.thr_pay}}</td></tr>{{end}}
32
+ {{if .Doc.other_income}}<tr><td>Insentif</td><td class="num">{{rupiah .Doc.other_income}}</td></tr>{{end}}
33
+ <tr class="total"><td>Jumlah penghasilan</td><td class="num">{{rupiah .Doc.cash_gross}}</td></tr>
34
+ </tbody>
35
+ </table>
36
+ </div>
37
+ <div>
38
+ <table class="items">
39
+ <thead><tr><th>Potongan</th><th class="num">Rp</th></tr></thead>
40
+ <tbody>
41
+ <tr><td>JHT 2%</td><td class="num">{{rupiah .Doc.jht_employee}}</td></tr>
42
+ {{if .Doc.jp_employee}}<tr><td>Jaminan Pensiun 1%</td><td class="num">{{rupiah .Doc.jp_employee}}</td></tr>{{end}}
43
+ {{if .Doc.kes_employee}}<tr><td>BPJS Kesehatan 1%</td><td class="num">{{rupiah .Doc.kes_employee}}</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}}
46
+ <tr class="total"><td>Jumlah potongan</td><td class="num">{{rupiah (sub .Doc.cash_gross .Doc.net_pay)}}</td></tr>
47
+ </tbody>
48
+ </table>
49
+ </div>
50
+ </div>
51
+ <div class="net"><span>Gaji bersih diterima</span><span>{{rupiah .Doc.net_pay}}</span></div>
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}}.
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>
54
+ {{if .Links.profile.bank_account}}<p class="note">Ditransfer ke {{.Links.profile.bank_name}} {{.Links.profile.bank_account}}.</p>{{end}}
@@ -0,0 +1,7 @@
1
+ # yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/print.json
2
+ name: payslip
3
+ model: payslip
4
+ label: {id: Slip gaji, en: Payslip}
5
+ paper: A5
6
+ template: payslip.html
7
+ default: true
@@ -2,6 +2,11 @@
2
2
  name: pipeline
3
3
  version: 1.0.0
4
4
  title: {id: Pipeline penjualan, en: Sales pipeline}
5
+ summary:
6
+ id: Lead, peluang dan aktivitas penjualan sampai closing.
7
+ en: Leads, deals and sales activities through to closing.
8
+ category: sales
9
+ icon: funnel-line
5
10
  requires: {rangka: '>=0.5', contacts: ^1.0, users: ^1.0}
6
11
  optional: {invoicing: ^1.0}
7
12
  hooks: [crm.convert_lead, crm.mark_won]
@@ -0,0 +1,61 @@
1
+ # yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/flow.json
2
+ # Backfill of outlets/outlet_day for days submitted before it existed (audit rangka-apps#77 F3): the kernel has no
3
+ # migrate hook for .rk, so the run walks back through the days in windows of 30, newest first (card t_0dba5917, audit
4
+ # rangka-apps#79 R2-1: reading every receipt per run grew with the history). The first run records the start in
5
+ # outlet_day_backfill key kasir (before = tomorrow). Every later run checks, for each outlet and each day of the window
6
+ # below `before`, the first submitted receipt of that outlet and day (an SQL read on outlet, date and docstatus, kernel
7
+ # date pushdown, pos_sale.date indexed; first by number, STRK-<outlet>-<YYMM>-<n> is padded) and its marker (day_key,
8
+ # unique); a day without a marker gets one with source kasir and that receipt (audit #79 R2-3). A day already marked
9
+ # (any source, also one freed by a cancel) is left as it is, so the run is safe to repeat and a day never gets two
10
+ # markers. Then `before` moves back 30 days; the run that finds no submitted receipt before it records done, and from
11
+ # then on a run reads only that one row (audit #79 F1). A receipt without an outlet has no day to mark and does not hold
12
+ # the walk back (audit #79 F5), nor does a receipt without a date (audit t_0dba5917 B2).
13
+ name: outlet_day_backfill_kasir
14
+ label: {id: 'Lengkapi sumber penjualan harian dari struk kasir lama'}
15
+ schedule: '*/5 * * * *'
16
+ steps:
17
+ - find: outlet_day_backfill
18
+ where: "key == 'kasir'"
19
+ as: st
20
+ - create: outlet_day_backfill
21
+ if: "st == null"
22
+ set:
23
+ key: "'kasir'"
24
+ before: "today() + duration(1)"
25
+ done: "false"
26
+ - find_all: outlet
27
+ if: "st != null && !st.done"
28
+ as: outlets
29
+ - for_each: "[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30].map(i, st.before - duration(i))"
30
+ if: "st != null && !st.done"
31
+ as: d
32
+ do:
33
+ - for_each: "outlets"
34
+ as: o
35
+ do:
36
+ - find_all: pos_sale
37
+ where: "docstatus == 1 && outlet == o.name && date == d"
38
+ sort: name
39
+ limit: 1
40
+ as: r
41
+ - find: outlet_day
42
+ if: "size(r) > 0"
43
+ where: "day_key == o.name + '|' + d"
44
+ as: k
45
+ - create: outlet_day
46
+ if: "size(r) > 0 && k == null"
47
+ set:
48
+ outlet: "o.name"
49
+ date: "d"
50
+ source: "'kasir'"
51
+ document: "r[0].name"
52
+ day_key: "o.name + '|' + d"
53
+ - find: pos_sale
54
+ if: "st != null && !st.done"
55
+ where: "docstatus == 1 && date != '' && date < st.before - duration(30)"
56
+ as: more
57
+ - update: st
58
+ if: "st != null && !st.done"
59
+ set:
60
+ before: "st.before - duration(30)"
61
+ done: "more == null"
@@ -0,0 +1,18 @@
1
+ # yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/flow.json
2
+ # Jalur A and B never on the same outlet and day (audit kasir M2): a daily sales record (form, Moka, POS file) of an
3
+ # outlet and day that already has a paid cashier receipt is refused, so the day's revenue and stock are never taken
4
+ # twice even when head office switches the outlet's sales_source. Runs as whoever submits the record (head office,
5
+ # outlet staff), who read the receipts of their outlets for it.
6
+ name: pos_daily_form_guard
7
+ label: {id: 'Penjualan harian diajukan: tolak kalau outlet itu sudah memakai kasir hari itu'}
8
+ on: outlet_sales.submitted
9
+ steps:
10
+ - find_all: pos_sale
11
+ where: outlet == event.outlet && date == event.date && docstatus == 1
12
+ limit: 1
13
+ as: receipts
14
+ - if: receipts.size() > 0
15
+ create: pos_guard
16
+ set:
17
+ reason: "'cashier_same_day'"
18
+ document: receipts[0].name
@@ -0,0 +1,42 @@
1
+ # yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/flow.json
2
+ # Runs inside a sale's cancel (a void), as the cashier. A void is for the sale's own day only (void_other_day) and
3
+ # while its shift is open (void_shift_closed: the closing count already holds this receipt's cash); the kernel runs no
4
+ # `on: cancel` rule, so both checks are here, under the shift's lock. Otherwise the money goes back out of the drawer
5
+ # (or back to the buyer's QRIS) and the shift's totals shrink; the void is counted. Only the shift's own cashier (or
6
+ # head office) voids its receipts.
7
+ name: pos_sale_on_cancel
8
+ label: {id: 'Transaksi kasir dibatalkan: kurangi dari sesi kasir'}
9
+ on: pos_sale.cancelled
10
+ steps:
11
+ - {find: pos_shift, where: name == event.shift && state == 'open', as: s}
12
+ - if: event.date != today()
13
+ create: pos_guard
14
+ set: {reason: "'void_other_day'", document: event.name}
15
+ - if: s == null
16
+ create: pos_guard
17
+ set: {reason: "'void_shift_closed'", document: event.name}
18
+ # only the cashier of the shift (or head office, the owner) voids its receipts: the cash leaves that drawer's count
19
+ - if: "s != null && s.cashier != user.email && !('head_office' in user.roles) && !('owner' in user.roles)"
20
+ create: pos_guard
21
+ set: {reason: "'void_not_own'", document: event.name}
22
+ - update: s
23
+ if: s != null
24
+ set:
25
+ sales_count: s.sales_count - 1
26
+ gross_total: s.gross_total - event.gross_total
27
+ discount_total: s.discount_total - event.discount_total
28
+ net_total: s.net_total - event.grand_total
29
+ cash_total: s.cash_total - event.cash_amount
30
+ qris_total: s.qris_total - event.qris_amount
31
+ cogs_total: s.cogs_total - event.cogs_total
32
+ void_count: s.void_count + 1
33
+ void_total: s.void_total + event.grand_total
34
+ # the last receipt of the day voided: the day is free again for a daily sales record (outlet_day, audit #74 L1)
35
+ - find_all: pos_sale
36
+ where: outlet == event.outlet && date == event.date && docstatus == 1
37
+ limit: 1
38
+ as: left
39
+ - {find: outlet_day, where: outlet == event.outlet && date == event.date, as: day}
40
+ - if: day != null && day.source == 'kasir' && left.size() == 0
41
+ update: day
42
+ set: {source: "''", document: "''"}
@@ -0,0 +1,60 @@
1
+ # yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/flow.json
2
+ # Runs inside a sale's submit (the payment), as the cashier. Reading pos_shift takes the flow read lock of contract
3
+ # 0025, so the sales of a shift are added one after the other and each sees the totals the previous one left. A shift
4
+ # closed meanwhile is not found open: the sale is refused (pos_guard shift_closed) and rolls back with its stock
5
+ # moves and its number. Otherwise the shift's totals grow by this receipt.
6
+ name: pos_sale_on_submit
7
+ label: {id: 'Transaksi kasir dibayar: tambah ke sesi kasir'}
8
+ on: pos_sale.submitted
9
+ steps:
10
+ - {find: pos_shift, where: name == event.shift && state == 'open', as: s}
11
+ # Jalur A and B never on the same outlet and day: a daily sales record (form, Moka, POS file) of this outlet and day
12
+ # refuses the receipt (and flow pos_daily_form_guard refuses the record after a receipt), whatever sales_source says
13
+ - find_all: outlet_sales
14
+ if: app_installed('outlet_sales')
15
+ where: outlet == event.outlet && date == event.date && docstatus == 1
16
+ limit: 1
17
+ as: forms
18
+ # a site without outlet_sales skips the find above, so forms is never declared: app_installed is checked first
19
+ # (&& stops there); `forms != null` alone read an undeclared name and failed every receipt (host smoke, 13 Nov)
20
+ - if: app_installed('outlet_sales') && forms.size() > 0
21
+ create: pos_guard
22
+ set:
23
+ reason: "'daily_sales_same_day'"
24
+ document: forms[0].name
25
+ # a Setoran harian of this outlet and day was booked outside the cashier: the shift's close would book the cash again
26
+ - find_all: outlet_takings
27
+ if: app_installed('outlet_sales')
28
+ where: outlet == event.outlet && date == event.date && docstatus == 1
29
+ limit: 1
30
+ as: takings
31
+ - if: app_installed('outlet_sales') && takings.size() > 0
32
+ create: pos_guard
33
+ set:
34
+ reason: "'daily_sales_same_day'"
35
+ document: takings[0].name
36
+ # one sales source per outlet and day, kept in outlets (installed with either source): a daily sales record or
37
+ # setoran marked the day 'harian', which holds even after the outlet_sales app is removed (audit #74 L1)
38
+ - {find: outlet_day, where: outlet == event.outlet && date == event.date, as: day}
39
+ - if: day != null && day.source == 'harian'
40
+ create: pos_guard
41
+ set: {reason: "'daily_sales_same_day'", document: day.document}
42
+ - if: day == null
43
+ create: outlet_day
44
+ set: {outlet: event.outlet, date: event.date, source: "'kasir'", document: event.name, day_key: "event.outlet + '|' + string(event.date)"}
45
+ - if: day != null && day.source == ''
46
+ update: day
47
+ set: {source: "'kasir'", document: event.name}
48
+ - if: s == null
49
+ create: pos_guard
50
+ set: {reason: "'shift_closed'", document: event.name}
51
+ - update: s
52
+ if: s != null
53
+ set:
54
+ sales_count: s.sales_count + 1
55
+ gross_total: s.gross_total + event.gross_total
56
+ discount_total: s.discount_total + event.discount_total
57
+ net_total: s.net_total + event.grand_total
58
+ cash_total: s.cash_total + event.cash_amount
59
+ qris_total: s.qris_total + event.qris_amount
60
+ cogs_total: s.cogs_total + event.cogs_total