@rangka-os/create 0.0.0-stage → 0.5.0-alpha.10

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 (486) hide show
  1. package/index.js +137 -0
  2. package/package.json +29 -4
  3. package/template/base/README.md +32 -0
  4. package/template/base/_gitignore +3 -0
  5. package/template/base/_vscode/settings.json +4 -0
  6. package/template/base/apps/crm/app.rk +44 -0
  7. package/template/base/apps/crm/dashboards/crm_overview.rk +88 -0
  8. package/template/base/apps/crm/dashboards/sales_overview.rk +66 -0
  9. package/template/base/apps/crm/processes/lead_to_cash.rk +8 -0
  10. package/template/base/apps/faktur_piutang/app.rk +31 -0
  11. package/template/base/apps/faktur_piutang/dashboards/piutang_ringkas.rk +88 -0
  12. package/template/base/apps/fnb_cabang/app.rk +46 -0
  13. package/template/base/apps/fnb_cabang/dashboards/fnb_overview.rk +104 -0
  14. package/template/base/apps/fnb_cabang/dashboards/stock_recap.rk +132 -0
  15. package/template/base/apps/grosir_distribusi/app.rk +56 -0
  16. package/template/base/apps/grosir_distribusi/dashboards/grosir_ar.rk +62 -0
  17. package/template/base/apps/grosir_distribusi/dashboards/grosir_overview.rk +87 -0
  18. package/template/base/apps/jasa_proyek/app.rk +61 -0
  19. package/template/base/apps/jasa_proyek/dashboards/ar_aging.rk +88 -0
  20. package/template/base/apps/jasa_proyek/dashboards/jasa_overview.rk +148 -0
  21. package/template/base/apps/jasa_proyek/dashboards/project_margin.rk +94 -0
  22. package/template/base/apps/jasa_proyek/processes/quote_to_cash.rk +10 -0
  23. package/template/base/apps/kasir/app.rk +38 -0
  24. package/template/base/apps/kasir/dashboards/kasir_ringkas.rk +20 -0
  25. package/template/base/apps/kasir/skills/rangka-app-kasir/SKILL.md +64 -0
  26. package/template/base/apps/kelas_kursus/app.rk +29 -0
  27. package/template/base/apps/kelas_kursus/dashboards/kursus_ringkas.rk +67 -0
  28. package/template/base/apps/langganan_jasa/app.rk +32 -0
  29. package/template/base/apps/langganan_jasa/dashboards/langganan_ringkas.rk +167 -0
  30. package/template/base/apps/langganan_jasa/dashboards/penagihan_saya.rk +54 -0
  31. package/template/base/apps/mutasi_bank/app.rk +22 -0
  32. package/template/base/apps/pajak/app.rk +25 -0
  33. package/template/base/apps/pembelian_pemasok/app.rk +23 -0
  34. package/template/base/apps/pembukuan/app.rk +19 -0
  35. package/template/base/apps/penjualan_harian/app.rk +34 -0
  36. package/template/base/apps/penjualan_harian/dashboards/penjualan_ringkas.rk +87 -0
  37. package/template/base/apps/produksi_pabrik/app.rk +54 -0
  38. package/template/base/apps/produksi_pabrik/dashboards/produksi_overview.rk +101 -0
  39. package/template/base/apps/produksi_pabrik/dashboards/produksi_upah.rk +39 -0
  40. package/template/base/apps/ritel_cabang/app.rk +58 -0
  41. package/template/base/apps/ritel_cabang/dashboards/ritel_overview.rk +137 -0
  42. package/template/base/apps/ritel_cabang/dashboards/ritel_stock.rk +147 -0
  43. package/template/base/apps/ritel_cabang/dashboards/ritel_tax.rk +76 -0
  44. package/template/base/apps/sewa_alat/app.rk +29 -0
  45. package/template/base/apps/sewa_alat/dashboards/sewa_ringkas.rk +86 -0
  46. package/template/base/apps/stok_outlet/app.rk +34 -0
  47. package/template/base/apps/stok_outlet/dashboards/stok_ringkas.rk +50 -0
  48. package/template/base/connectors/biteship/connector.rk +246 -0
  49. package/template/base/connectors/biteship/fixtures/cancel_order.json +1 -0
  50. package/template/base/connectors/biteship/fixtures/create_order.json +8 -0
  51. package/template/base/connectors/biteship/fixtures/expect.json +9 -0
  52. package/template/base/connectors/biteship/fixtures/get_order.json +2 -0
  53. package/template/base/connectors/biteship/fixtures/get_rates.json +7 -0
  54. package/template/base/connectors/biteship/fixtures/get_tracking.json +7 -0
  55. package/template/base/connectors/biteship/fixtures/order_price.json +11 -0
  56. package/template/base/connectors/biteship/fixtures/order_status.json +15 -0
  57. package/template/base/connectors/biteship/fixtures/order_status_cancelled.json +15 -0
  58. package/template/base/connectors/biteship/fixtures/order_waybill.json +7 -0
  59. package/template/base/connectors/biteship/fixtures/search_areas.json +1 -0
  60. package/template/base/connectors/loyverse/connector.rk +98 -0
  61. package/template/base/connectors/moka/connector.rk +86 -0
  62. package/template/base/connectors/whatsapp_business/connector.rk +89 -0
  63. package/template/base/connectors/whatsapp_business/templates.md +32 -0
  64. package/template/base/connectors/xendit/connector.rk +184 -0
  65. package/template/base/docker-compose.yml +16 -0
  66. package/template/base/env.example +12 -0
  67. package/template/base/modules/accounting/flows/financial_report_compute.rk +47 -0
  68. package/template/base/modules/accounting/flows/financial_report_recompute.rk +47 -0
  69. package/template/base/modules/accounting/flows/gl_delivery_note_post.rk +37 -0
  70. package/template/base/modules/accounting/flows/gl_delivery_note_reverse.rk +194 -0
  71. package/template/base/modules/accounting/flows/gl_goods_receipt_post.rk +41 -0
  72. package/template/base/modules/accounting/flows/gl_goods_receipt_reverse.rk +194 -0
  73. package/template/base/modules/accounting/flows/gl_opening_balance_post.rk +132 -0
  74. package/template/base/modules/accounting/flows/gl_opening_balance_reverse.rk +194 -0
  75. package/template/base/modules/accounting/flows/gl_outlet_return_post.rk +38 -0
  76. package/template/base/modules/accounting/flows/gl_outlet_return_reverse.rk +194 -0
  77. package/template/base/modules/accounting/flows/gl_outlet_sales_post.rk +95 -0
  78. package/template/base/modules/accounting/flows/gl_outlet_sales_reverse.rk +194 -0
  79. package/template/base/modules/accounting/flows/gl_outlet_takings_post.rk +71 -0
  80. package/template/base/modules/accounting/flows/gl_outlet_takings_reverse.rk +194 -0
  81. package/template/base/modules/accounting/flows/gl_payment_post.rk +63 -0
  82. package/template/base/modules/accounting/flows/gl_payment_reverse.rk +194 -0
  83. package/template/base/modules/accounting/flows/gl_payroll_close_post.rk +89 -0
  84. package/template/base/modules/accounting/flows/gl_payroll_close_reverse.rk +194 -0
  85. package/template/base/modules/accounting/flows/gl_pos_sale_post.rk +95 -0
  86. package/template/base/modules/accounting/flows/gl_pos_sale_reverse.rk +194 -0
  87. package/template/base/modules/accounting/flows/gl_pos_shift_close_post.rk +59 -0
  88. package/template/base/modules/accounting/flows/gl_pos_shift_close_reverse.rk +194 -0
  89. package/template/base/modules/accounting/flows/gl_production_batch_post.rk +62 -0
  90. package/template/base/modules/accounting/flows/gl_production_batch_reverse.rk +194 -0
  91. package/template/base/modules/accounting/flows/gl_project_expense_post.rk +64 -0
  92. package/template/base/modules/accounting/flows/gl_project_expense_reverse.rk +194 -0
  93. package/template/base/modules/accounting/flows/gl_rental_booking_post.rk +35 -0
  94. package/template/base/modules/accounting/flows/gl_rental_booking_reverse.rk +194 -0
  95. package/template/base/modules/accounting/flows/gl_rental_return_post.rk +47 -0
  96. package/template/base/modules/accounting/flows/gl_rental_return_reverse.rk +194 -0
  97. package/template/base/modules/accounting/flows/gl_sales_invoice_post.rk +95 -0
  98. package/template/base/modules/accounting/flows/gl_sales_invoice_reverse.rk +194 -0
  99. package/template/base/modules/accounting/flows/gl_sales_return_post.rk +40 -0
  100. package/template/base/modules/accounting/flows/gl_sales_return_reverse.rk +194 -0
  101. package/template/base/modules/accounting/flows/gl_stock_adjustment_post.rk +38 -0
  102. package/template/base/modules/accounting/flows/gl_stock_adjustment_reverse.rk +194 -0
  103. package/template/base/modules/accounting/flows/gl_stock_count_post.rk +38 -0
  104. package/template/base/modules/accounting/flows/gl_stock_count_reverse.rk +194 -0
  105. package/template/base/modules/accounting/flows/gl_stock_transfer_post.rk +38 -0
  106. package/template/base/modules/accounting/flows/gl_stock_transfer_receipt_post.rk +38 -0
  107. package/template/base/modules/accounting/flows/gl_stock_transfer_receipt_reverse.rk +194 -0
  108. package/template/base/modules/accounting/flows/gl_stock_transfer_reverse.rk +194 -0
  109. package/template/base/modules/accounting/flows/gl_timesheet_post.rk +35 -0
  110. package/template/base/modules/accounting/flows/gl_timesheet_reverse.rk +194 -0
  111. package/template/base/modules/accounting/flows/gl_vendor_bill_post.rk +63 -0
  112. package/template/base/modules/accounting/flows/gl_vendor_bill_reverse.rk +194 -0
  113. package/template/base/modules/accounting/imports/opening_balance_sheet.rk +22 -0
  114. package/template/base/modules/accounting/models/financial_report.rk +85 -0
  115. package/template/base/modules/accounting/models/gl_entry.rk +161 -0
  116. package/template/base/modules/accounting/models/opening_balance.rk +48 -0
  117. package/template/base/modules/accounting/models/period_close.rk +33 -0
  118. package/template/base/modules/accounting/module.rk +16 -0
  119. package/template/base/modules/bank_statement/flows/bank_transaction_claim.rk +19 -0
  120. package/template/base/modules/bank_statement/flows/bank_transaction_confirm.rk +43 -0
  121. package/template/base/modules/bank_statement/flows/bank_transaction_link_locked.rk +11 -0
  122. package/template/base/modules/bank_statement/flows/bank_transaction_matched.rk +13 -0
  123. package/template/base/modules/bank_statement/flows/bank_transaction_release.rk +11 -0
  124. package/template/base/modules/bank_statement/flows/bank_transaction_suggest.rk +31 -0
  125. package/template/base/modules/bank_statement/flows/bank_transaction_unmatched.rk +11 -0
  126. package/template/base/modules/bank_statement/imports/bank_statement_csv.rk +25 -0
  127. package/template/base/modules/bank_statement/models/bank_transaction.rk +124 -0
  128. package/template/base/modules/bank_statement/models/bank_transaction_claim.rk +49 -0
  129. package/template/base/modules/bank_statement/module.rk +12 -0
  130. package/template/base/modules/catalogue/imports/item_list.rk +20 -0
  131. package/template/base/modules/catalogue/imports/item_master.rk +25 -0
  132. package/template/base/modules/catalogue/models/item.rk +129 -0
  133. package/template/base/modules/catalogue/models/item_category.rk +27 -0
  134. package/template/base/modules/catalogue/models/price_list.rk +34 -0
  135. package/template/base/modules/catalogue/models/price_list_item.rk +21 -0
  136. package/template/base/modules/catalogue/models/uom.rk +34 -0
  137. package/template/base/modules/catalogue/models/uom_conversion.rk +44 -0
  138. package/template/base/modules/catalogue/module.rk +11 -0
  139. package/template/base/modules/consignment/flows/consignment_bill.rk +39 -0
  140. package/template/base/modules/consignment/flows/consignment_bill_cancelled.rk +14 -0
  141. package/template/base/modules/consignment/models/consignment_settlement.rk +111 -0
  142. package/template/base/modules/consignment/models/consignment_settlement_item.rk +37 -0
  143. package/template/base/modules/consignment/module.rk +15 -0
  144. package/template/base/modules/contacts/imports/customer_list.rk +17 -0
  145. package/template/base/modules/contacts/imports/vendor_list.rk +16 -0
  146. package/template/base/modules/contacts/models/contact_person.rk +21 -0
  147. package/template/base/modules/contacts/models/credit_guard.rk +40 -0
  148. package/template/base/modules/contacts/models/customer.rk +180 -0
  149. package/template/base/modules/contacts/models/vendor.rk +104 -0
  150. package/template/base/modules/contacts/module.rk +10 -0
  151. package/template/base/modules/coretax/models/tax_period.rk +89 -0
  152. package/template/base/modules/coretax/module.rk +13 -0
  153. package/template/base/modules/coretax/print/coretax_bupot.rk +26 -0
  154. package/template/base/modules/coretax/print/coretax_bupot.xml +28 -0
  155. package/template/base/modules/coretax/print/coretax_faktur.rk +34 -0
  156. package/template/base/modules/coretax/print/coretax_faktur.xml +58 -0
  157. package/template/base/modules/courses/flows/charge_cancel_guard.rk +23 -0
  158. package/template/base/modules/courses/flows/charge_invoice_on_submit.rk +56 -0
  159. package/template/base/modules/courses/flows/enrollment_seats_on_create.rk +15 -0
  160. package/template/base/modules/courses/flows/enrollment_seats_on_update.rk +35 -0
  161. package/template/base/modules/courses/flows/invoice_course_once.rk +22 -0
  162. package/template/base/modules/courses/flows/invoice_course_tag_lock.rk +16 -0
  163. package/template/base/modules/courses/flows/session_fill_attendance.rk +16 -0
  164. package/template/base/modules/courses/flows/student_billing_on_create.rk +25 -0
  165. package/template/base/modules/courses/models/course_attendance.rk +22 -0
  166. package/template/base/modules/courses/models/course_batch.rk +112 -0
  167. package/template/base/modules/courses/models/course_batch_slot.rk +18 -0
  168. package/template/base/modules/courses/models/course_charge.rk +125 -0
  169. package/template/base/modules/courses/models/course_guard.rk +50 -0
  170. package/template/base/modules/courses/models/course_program.rk +101 -0
  171. package/template/base/modules/courses/models/course_session.rk +90 -0
  172. package/template/base/modules/courses/models/enrollment.rk +136 -0
  173. package/template/base/modules/courses/models/student.rk +68 -0
  174. package/template/base/modules/courses/module.rk +14 -0
  175. package/template/base/modules/courses/roles/instructor.rk +7 -0
  176. package/template/base/modules/currency/models/currency.rk +34 -0
  177. package/template/base/modules/currency/models/exchange_rate.rk +39 -0
  178. package/template/base/modules/currency/module.rk +10 -0
  179. package/template/base/modules/delivery/flows/delivery_cancel_guard.rk +18 -0
  180. package/template/base/modules/delivery/flows/fulfilment_on_delivery_cancelled.rk +21 -0
  181. package/template/base/modules/delivery/flows/fulfilment_on_delivery_submitted.rk +28 -0
  182. package/template/base/modules/delivery/flows/fulfilment_on_invoice_cancelled.rk +22 -0
  183. package/template/base/modules/delivery/flows/fulfilment_on_invoice_submitted.rk +22 -0
  184. package/template/base/modules/delivery/flows/fulfilment_on_order_created.rk +18 -0
  185. package/template/base/modules/delivery/flows/fulfilment_on_order_submitted.rk +16 -0
  186. package/template/base/modules/delivery/flows/fulfilment_on_order_updated.rk +19 -0
  187. package/template/base/modules/delivery/flows/fulfilment_on_return_cancelled.rk +16 -0
  188. package/template/base/modules/delivery/flows/fulfilment_on_return_submitted.rk +16 -0
  189. package/template/base/modules/delivery/flows/invoice_qty_from_deliveries.rk +20 -0
  190. package/template/base/modules/delivery/flows/order_cancel_guard.rk +10 -0
  191. package/template/base/modules/delivery/flows/return_cancel_guard.rk +11 -0
  192. package/template/base/modules/delivery/flows/return_credit_on_payment_cancelled.rk +11 -0
  193. package/template/base/modules/delivery/flows/return_credit_on_payment_submitted.rk +21 -0
  194. package/template/base/modules/delivery/flows/return_credit_on_return_cancelled.rk +11 -0
  195. package/template/base/modules/delivery/flows/return_credit_on_return_submitted.rk +10 -0
  196. package/template/base/modules/delivery/models/delivery_guard.rk +48 -0
  197. package/template/base/modules/delivery/models/delivery_note.rk +101 -0
  198. package/template/base/modules/delivery/models/delivery_note_item.rk +11 -0
  199. package/template/base/modules/delivery/models/order_fulfilment.rk +27 -0
  200. package/template/base/modules/delivery/models/order_fulfilment_item.rk +10 -0
  201. package/template/base/modules/delivery/models/return_credit.rk +23 -0
  202. package/template/base/modules/delivery/models/sales_return.rk +87 -0
  203. package/template/base/modules/delivery/models/sales_return_item.rk +16 -0
  204. package/template/base/modules/delivery/module.rk +16 -0
  205. package/template/base/modules/delivery/print/delivery_note.html +96 -0
  206. package/template/base/modules/delivery/print/delivery_note.rk +9 -0
  207. package/template/base/modules/distribution/flows/credit_on_invoice_cancelled.rk +17 -0
  208. package/template/base/modules/distribution/flows/credit_on_invoice_submitted.rk +17 -0
  209. package/template/base/modules/distribution/flows/credit_on_order_cancelled.rk +17 -0
  210. package/template/base/modules/distribution/flows/credit_on_order_submitted.rk +25 -0
  211. package/template/base/modules/distribution/flows/credit_on_payment_cancelled.rk +17 -0
  212. package/template/base/modules/distribution/flows/credit_on_payment_submitted.rk +17 -0
  213. package/template/base/modules/distribution/flows/giro_bounced.rk +20 -0
  214. package/template/base/modules/distribution/flows/giro_from_payment.rk +21 -0
  215. package/template/base/modules/distribution/flows/order_tier_pricing_created.rk +17 -0
  216. package/template/base/modules/distribution/flows/order_tier_pricing_updated.rk +17 -0
  217. package/template/base/modules/distribution/models/giro.rk +79 -0
  218. package/template/base/modules/distribution/module.rk +14 -0
  219. package/template/base/modules/invoicing/flows/invoice_due_digest.rk +12 -0
  220. package/template/base/modules/invoicing/flows/milestone_invoiced.rk +23 -0
  221. package/template/base/modules/invoicing/flows/milestone_reopened.rk +19 -0
  222. package/template/base/modules/invoicing/flows/payment_instruction_on_submit.rk +25 -0
  223. package/template/base/modules/invoicing/flows/project_billed_on_cancel.rk +16 -0
  224. package/template/base/modules/invoicing/flows/project_billed_on_submit.rk +16 -0
  225. package/template/base/modules/invoicing/flows/project_revenue_on_cancel.rk +22 -0
  226. package/template/base/modules/invoicing/flows/project_revenue_on_submit.rk +17 -0
  227. package/template/base/modules/invoicing/flows/sales_invoice_credit_recheck.rk +18 -0
  228. package/template/base/modules/invoicing/models/bank_account.rk +134 -0
  229. package/template/base/modules/invoicing/models/invoice_reminder.rk +83 -0
  230. package/template/base/modules/invoicing/models/payment_instruction.rk +72 -0
  231. package/template/base/modules/invoicing/models/sales_invoice.rk +480 -0
  232. package/template/base/modules/invoicing/models/sales_invoice_item.rk +53 -0
  233. package/template/base/modules/invoicing/module.rk +14 -0
  234. package/template/base/modules/invoicing/print/sales_invoice.html +163 -0
  235. package/template/base/modules/invoicing/print/sales_invoice.rk +14 -0
  236. package/template/base/modules/invoicing/print/sales_invoice_nota.html +71 -0
  237. package/template/base/modules/invoicing/print/sales_invoice_nota.rk +13 -0
  238. package/template/base/modules/invoicing/print/sales_invoice_whatsapp.html +45 -0
  239. package/template/base/modules/invoicing/print/sales_invoice_whatsapp.rk +15 -0
  240. package/template/base/modules/orders/models/customer_order.rk +186 -0
  241. package/template/base/modules/orders/models/customer_order_item.rk +49 -0
  242. package/template/base/modules/orders/module.rk +14 -0
  243. package/template/base/modules/outlet_sales/flows/moka_legacy_key_overlap.rk +22 -0
  244. package/template/base/modules/outlet_sales/flows/refund_on_return_cancelled.rk +15 -0
  245. package/template/base/modules/outlet_sales/flows/refund_on_return_submitted.rk +26 -0
  246. package/template/base/modules/outlet_sales/flows/refund_on_sales_submitted.rk +14 -0
  247. package/template/base/modules/outlet_sales/flows/sales_cancel_guard.rk +14 -0
  248. package/template/base/modules/outlet_sales/imports/daily_form.rk +22 -0
  249. package/template/base/modules/outlet_sales/imports/loyverse_receipts.rk +28 -0
  250. package/template/base/modules/outlet_sales/imports/moka_item_details.rk +34 -0
  251. package/template/base/modules/outlet_sales/imports/pos_sales_file.rk +28 -0
  252. package/template/base/modules/outlet_sales/imports/takings_file.rk +23 -0
  253. package/template/base/modules/outlet_sales/models/outlet_return.rk +66 -0
  254. package/template/base/modules/outlet_sales/models/outlet_return_item.rk +7 -0
  255. package/template/base/modules/outlet_sales/models/outlet_sales.rk +175 -0
  256. package/template/base/modules/outlet_sales/models/outlet_sales_guard.rk +35 -0
  257. package/template/base/modules/outlet_sales/models/outlet_sales_line.rk +40 -0
  258. package/template/base/modules/outlet_sales/models/outlet_takings.rk +85 -0
  259. package/template/base/modules/outlet_sales/models/outlet_takings_line.rk +37 -0
  260. package/template/base/modules/outlet_sales/models/pos_refund.rk +33 -0
  261. package/template/base/modules/outlet_sales/models/pos_refund_item.rk +9 -0
  262. package/template/base/modules/outlet_sales/module.rk +12 -0
  263. package/template/base/modules/outlets/models/outlet.rk +75 -0
  264. package/template/base/modules/outlets/module.rk +10 -0
  265. package/template/base/modules/payments/flows/payment_from_xendit_invoice.rk +59 -0
  266. package/template/base/modules/payments/flows/payment_from_xendit_qr.rk +59 -0
  267. package/template/base/modules/payments/flows/payment_from_xendit_va.rk +59 -0
  268. package/template/base/modules/payments/flows/payment_gateway_claim_created.rk +19 -0
  269. package/template/base/modules/payments/flows/payment_gateway_claim_submitted.rk +19 -0
  270. package/template/base/modules/payments/flows/payment_gateway_release.rk +12 -0
  271. package/template/base/modules/payments/models/gateway_ref_claim.rk +42 -0
  272. package/template/base/modules/payments/models/payment.rk +214 -0
  273. package/template/base/modules/payments/models/payment_allocation.rk +35 -0
  274. package/template/base/modules/payments/models/withholding.rk +76 -0
  275. package/template/base/modules/payments/module.rk +13 -0
  276. package/template/base/modules/payments/print/statement.html +55 -0
  277. package/template/base/modules/payments/print/statement.rk +13 -0
  278. package/template/base/modules/payroll/flows/invoice_payroll_once.rk +20 -0
  279. package/template/base/modules/payroll/flows/invoice_payroll_tag_lock.rk +13 -0
  280. package/template/base/modules/payroll/flows/payroll_close_on_cancel.rk +35 -0
  281. package/template/base/modules/payroll/flows/payroll_close_on_submit.rk +66 -0
  282. package/template/base/modules/payroll/flows/payroll_run_overlap_guard_created.rk +14 -0
  283. package/template/base/modules/payroll/flows/payroll_run_overlap_guard_updated.rk +14 -0
  284. package/template/base/modules/payroll/flows/payroll_totals_on_payslip_cancel.rk +29 -0
  285. package/template/base/modules/payroll/flows/payroll_totals_on_payslip_submit.rk +29 -0
  286. package/template/base/modules/payroll/flows/payslip_cancel_guard.rk +14 -0
  287. package/template/base/modules/payroll/flows/payslip_from_recap.rk +47 -0
  288. package/template/base/modules/payroll/flows/payslip_month_guard_created.rk +16 -0
  289. package/template/base/modules/payroll/flows/payslip_month_guard_submitted.rk +16 -0
  290. package/template/base/modules/payroll/flows/payslip_order_guard_cancelled.rk +15 -0
  291. package/template/base/modules/payroll/flows/payslip_order_guard_submitted.rk +15 -0
  292. package/template/base/modules/payroll/flows/payslip_pay_overlap_guard.rk +15 -0
  293. package/template/base/modules/payroll/flows/payslip_ytd_guard.rk +16 -0
  294. package/template/base/modules/payroll/flows/payslip_ytd_on_create.rk +20 -0
  295. package/template/base/modules/payroll/flows/recap_cancel_guard.rk +15 -0
  296. package/template/base/modules/payroll/models/payroll_close.rk +80 -0
  297. package/template/base/modules/payroll/models/payroll_guard.rk +74 -0
  298. package/template/base/modules/payroll/models/payroll_profile.rk +136 -0
  299. package/template/base/modules/payroll/models/payroll_run.rk +220 -0
  300. package/template/base/modules/payroll/models/payslip.rk +293 -0
  301. package/template/base/modules/payroll/module.rk +13 -0
  302. package/template/base/modules/payroll/print/payslip.html +53 -0
  303. package/template/base/modules/payroll/print/payslip.rk +7 -0
  304. package/template/base/modules/pipeline/flows/morning_follow_up.rk +10 -0
  305. package/template/base/modules/pipeline/flows/whatsapp_to_lead.rk +24 -0
  306. package/template/base/modules/pipeline/models/activity.rk +83 -0
  307. package/template/base/modules/pipeline/models/deal.rk +139 -0
  308. package/template/base/modules/pipeline/models/lead.rk +119 -0
  309. package/template/base/modules/pipeline/module.rk +12 -0
  310. package/template/base/modules/pos/flows/pos_daily_form_guard.rk +18 -0
  311. package/template/base/modules/pos/flows/pos_sale_on_cancel.rk +33 -0
  312. package/template/base/modules/pos/flows/pos_sale_on_submit.rk +46 -0
  313. package/template/base/modules/pos/flows/pos_shift_close_on_cancel.rk +26 -0
  314. package/template/base/modules/pos/flows/pos_shift_close_on_submit.rk +23 -0
  315. package/template/base/modules/pos/flows/pos_shift_on_create.rk +21 -0
  316. package/template/base/modules/pos/flows/pos_shift_on_update.rk +10 -0
  317. package/template/base/modules/pos/flows/pos_takings_guard.rk +28 -0
  318. package/template/base/modules/pos/models/pos_guard.rk +76 -0
  319. package/template/base/modules/pos/models/pos_payment.rk +17 -0
  320. package/template/base/modules/pos/models/pos_sale.rk +222 -0
  321. package/template/base/modules/pos/models/pos_sale_item.rk +43 -0
  322. package/template/base/modules/pos/models/pos_shift.rk +92 -0
  323. package/template/base/modules/pos/models/pos_shift_close.rk +77 -0
  324. package/template/base/modules/pos/module.rk +22 -0
  325. package/template/base/modules/pos/print/pos_receipt.html +50 -0
  326. package/template/base/modules/pos/print/pos_receipt.rk +9 -0
  327. package/template/base/modules/pos/screens/kasir.rk +41 -0
  328. package/template/base/modules/procurement/flows/project_vendor_cost_on_cancel.rk +22 -0
  329. package/template/base/modules/procurement/flows/project_vendor_cost_on_submit.rk +17 -0
  330. package/template/base/modules/procurement/imports/opening_stock.rk +25 -0
  331. package/template/base/modules/procurement/models/goods_receipt.rk +85 -0
  332. package/template/base/modules/procurement/models/goods_receipt_item.rk +42 -0
  333. package/template/base/modules/procurement/models/purchase_order.rk +156 -0
  334. package/template/base/modules/procurement/models/purchase_order_item.rk +46 -0
  335. package/template/base/modules/procurement/models/purchase_request.rk +91 -0
  336. package/template/base/modules/procurement/models/purchase_request_item.rk +35 -0
  337. package/template/base/modules/procurement/models/vendor_bill.rk +272 -0
  338. package/template/base/modules/procurement/models/vendor_bill_item.rk +33 -0
  339. package/template/base/modules/procurement/module.rk +14 -0
  340. package/template/base/modules/procurement/print/purchase_order.html +120 -0
  341. package/template/base/modules/procurement/print/purchase_order.rk +7 -0
  342. package/template/base/modules/production/flows/batch_cancel_guard.rk +12 -0
  343. package/template/base/modules/production/flows/batch_from_bom.rk +19 -0
  344. package/template/base/modules/production/flows/wage_sheet_on_batch_cancelled.rk +14 -0
  345. package/template/base/modules/production/flows/wage_sheet_on_batch_submitted.rk +12 -0
  346. package/template/base/modules/production/flows/work_order_materials_created.rk +20 -0
  347. package/template/base/modules/production/flows/work_order_materials_updated.rk +20 -0
  348. package/template/base/modules/production/models/bom.rk +67 -0
  349. package/template/base/modules/production/models/bom_byproduct.rk +7 -0
  350. package/template/base/modules/production/models/bom_line.rk +11 -0
  351. package/template/base/modules/production/models/production_batch.rk +149 -0
  352. package/template/base/modules/production/models/production_guard.rk +23 -0
  353. package/template/base/modules/production/models/production_labour.rk +10 -0
  354. package/template/base/modules/production/models/production_material.rk +8 -0
  355. package/template/base/modules/production/models/production_output.rk +8 -0
  356. package/template/base/modules/production/models/production_stage.rk +19 -0
  357. package/template/base/modules/production/models/wage_line.rk +15 -0
  358. package/template/base/modules/production/models/wage_sheet.rk +28 -0
  359. package/template/base/modules/production/models/work_order.rk +63 -0
  360. package/template/base/modules/production/models/work_order_material.rk +8 -0
  361. package/template/base/modules/production/module.rk +17 -0
  362. package/template/base/modules/production/print/wage_sheet.html +75 -0
  363. package/template/base/modules/production/print/wage_sheet.rk +9 -0
  364. package/template/base/modules/projects/flows/milestone_back_on_acceptance_cancel.rk +15 -0
  365. package/template/base/modules/projects/flows/milestone_lock_on_update.rk +16 -0
  366. package/template/base/modules/projects/flows/milestone_ready_on_acceptance.rk +40 -0
  367. package/template/base/modules/projects/flows/milestone_scheduled_on_create.rk +14 -0
  368. package/template/base/modules/projects/flows/milestone_scheduled_on_update.rk +27 -0
  369. package/template/base/modules/projects/flows/project_expense_on_cancel.rk +21 -0
  370. package/template/base/modules/projects/flows/project_expense_on_submit.rk +16 -0
  371. package/template/base/modules/projects/flows/project_labor_on_cancel.rk +22 -0
  372. package/template/base/modules/projects/flows/project_labor_on_submit.rk +17 -0
  373. package/template/base/modules/projects/flows/project_terms_lock.rk +26 -0
  374. package/template/base/modules/projects/flows/timesheet_assignment_on_create.rk +28 -0
  375. package/template/base/modules/projects/flows/vendor_bill_cancel_guard.rk +15 -0
  376. package/template/base/modules/projects/imports/attendance_recap.rk +23 -0
  377. package/template/base/modules/projects/imports/billing_milestone.rk +20 -0
  378. package/template/base/modules/projects/models/acceptance.rk +68 -0
  379. package/template/base/modules/projects/models/assignment.rk +96 -0
  380. package/template/base/modules/projects/models/billing_milestone.rk +217 -0
  381. package/template/base/modules/projects/models/project.rk +155 -0
  382. package/template/base/modules/projects/models/project_expense.rk +121 -0
  383. package/template/base/modules/projects/models/project_guard.rk +27 -0
  384. package/template/base/modules/projects/models/project_ledger.rk +146 -0
  385. package/template/base/modules/projects/models/timesheet.rk +161 -0
  386. package/template/base/modules/projects/module.rk +11 -0
  387. package/template/base/modules/quotation/models/quotation.rk +201 -0
  388. package/template/base/modules/quotation/models/quotation_item.rk +37 -0
  389. package/template/base/modules/quotation/module.rk +14 -0
  390. package/template/base/modules/quotation/print/quotation.html +65 -0
  391. package/template/base/modules/quotation/print/quotation.rk +7 -0
  392. package/template/base/modules/rental/flows/rental_booking_on_cancel.rk +19 -0
  393. package/template/base/modules/rental/flows/rental_booking_on_submit.rk +45 -0
  394. package/template/base/modules/rental/flows/rental_checkout_on_cancel.rk +13 -0
  395. package/template/base/modules/rental/flows/rental_checkout_on_submit.rk +21 -0
  396. package/template/base/modules/rental/flows/rental_invoice_once.rk +20 -0
  397. package/template/base/modules/rental/flows/rental_invoice_tag_lock.rk +12 -0
  398. package/template/base/modules/rental/flows/rental_return_on_cancel.rk +15 -0
  399. package/template/base/modules/rental/flows/rental_return_on_submit.rk +28 -0
  400. package/template/base/modules/rental/models/rental_booking.rk +123 -0
  401. package/template/base/modules/rental/models/rental_checkout.rk +37 -0
  402. package/template/base/modules/rental/models/rental_guard.rk +72 -0
  403. package/template/base/modules/rental/models/rental_item.rk +75 -0
  404. package/template/base/modules/rental/models/rental_return.rk +83 -0
  405. package/template/base/modules/rental/models/rental_schedule.rk +49 -0
  406. package/template/base/modules/rental/module.rk +19 -0
  407. package/template/base/modules/stock/flows/adjustment_value_backfill.rk +95 -0
  408. package/template/base/modules/stock/flows/adjustment_value_on_cancel.rk +19 -0
  409. package/template/base/modules/stock/flows/adjustment_value_on_submit.rk +17 -0
  410. package/template/base/modules/stock/flows/stock_negative_alert.rk +15 -0
  411. package/template/base/modules/stock/models/recipe.rk +68 -0
  412. package/template/base/modules/stock/models/recipe_line.rk +24 -0
  413. package/template/base/modules/stock/models/stock_adjustment.rk +62 -0
  414. package/template/base/modules/stock/models/stock_adjustment_item.rk +32 -0
  415. package/template/base/modules/stock/models/stock_adjustment_value.rk +79 -0
  416. package/template/base/modules/stock/models/stock_balance.rk +27 -0
  417. package/template/base/modules/stock/models/stock_count.rk +54 -0
  418. package/template/base/modules/stock/models/stock_count_item.rk +33 -0
  419. package/template/base/modules/stock/models/stock_move.rk +53 -0
  420. package/template/base/modules/stock/models/stock_transfer.rk +70 -0
  421. package/template/base/modules/stock/models/stock_transfer_item.rk +34 -0
  422. package/template/base/modules/stock/models/stock_transfer_receipt.rk +57 -0
  423. package/template/base/modules/stock/models/stock_transfer_receipt_item.rk +18 -0
  424. package/template/base/modules/stock/module.rk +13 -0
  425. package/template/base/modules/subscriptions/flows/collector_deposit_on_submit.rk +57 -0
  426. package/template/base/modules/subscriptions/flows/deposit_payment_kept.rk +17 -0
  427. package/template/base/modules/subscriptions/flows/deposit_payment_not_cancelled.rk +14 -0
  428. package/template/base/modules/subscriptions/flows/deposit_payment_not_deleted.rk +14 -0
  429. package/template/base/modules/subscriptions/flows/field_collection_cap_created.rk +24 -0
  430. package/template/base/modules/subscriptions/flows/field_collection_cap_updated.rk +24 -0
  431. package/template/base/modules/subscriptions/flows/field_collection_locked.rk +12 -0
  432. package/template/base/modules/subscriptions/flows/field_collection_not_deleted.rk +10 -0
  433. package/template/base/modules/subscriptions/flows/invoice_subscription_kept.rk +19 -0
  434. package/template/base/modules/subscriptions/flows/invoice_subscription_once.rk +34 -0
  435. package/template/base/modules/subscriptions/flows/invoice_subscription_tag_lock.rk +13 -0
  436. package/template/base/modules/subscriptions/flows/service_area_collector.rk +14 -0
  437. package/template/base/modules/subscriptions/flows/subscription_billing.rk +79 -0
  438. package/template/base/modules/subscriptions/flows/subscription_dunning.rk +81 -0
  439. package/template/base/modules/subscriptions/flows/subscription_extra_locked.rk +14 -0
  440. package/template/base/modules/subscriptions/flows/subscription_status_on_payment.rk +48 -0
  441. package/template/base/modules/subscriptions/models/collector_deposit.rk +36 -0
  442. package/template/base/modules/subscriptions/models/field_collection.rk +42 -0
  443. package/template/base/modules/subscriptions/models/service_area.rk +19 -0
  444. package/template/base/modules/subscriptions/models/subscription.rk +233 -0
  445. package/template/base/modules/subscriptions/models/subscription_bill.rk +48 -0
  446. package/template/base/modules/subscriptions/models/subscription_extra.rk +50 -0
  447. package/template/base/modules/subscriptions/models/subscription_guard.rk +65 -0
  448. package/template/base/modules/subscriptions/models/subscription_month.rk +29 -0
  449. package/template/base/modules/subscriptions/models/subscription_plan.rk +75 -0
  450. package/template/base/modules/subscriptions/models/subscription_status_log.rk +27 -0
  451. package/template/base/modules/subscriptions/module.rk +18 -0
  452. package/template/base/modules/subscriptions/roles/collector.rk +7 -0
  453. package/template/base/modules/tax_id/models/tax_code.rk +49 -0
  454. package/template/base/modules/tax_id/module.rk +10 -0
  455. package/template/base/modules/users/models/user.rk +29 -0
  456. package/template/base/modules/users/module.rk +10 -0
  457. package/template/base/modules/users/roles/cashier.rk +8 -0
  458. package/template/base/modules/users/roles/course_admin.rk +4 -0
  459. package/template/base/modules/users/roles/field_sales.rk +7 -0
  460. package/template/base/modules/users/roles/finance_manager.rk +4 -0
  461. package/template/base/modules/users/roles/head_office.rk +4 -0
  462. package/template/base/modules/users/roles/outlet_staff.rk +6 -0
  463. package/template/base/modules/users/roles/project_admin.rk +4 -0
  464. package/template/base/modules/users/roles/purchasing_manager.rk +4 -0
  465. package/template/base/modules/users/roles/sales_manager.rk +4 -0
  466. package/template/base/modules/users/roles/sales_rep.rk +4 -0
  467. package/template/base/modules/workforce/imports/worker_list.rk +21 -0
  468. package/template/base/modules/workforce/models/certification.rk +25 -0
  469. package/template/base/modules/workforce/models/worker.rk +94 -0
  470. package/template/base/modules/workforce/module.rk +10 -0
  471. package/template/base/package.json +17 -0
  472. package/template/blank/fixtures/start.rk +5 -0
  473. package/template/blank/site/config.rk +13 -0
  474. package/template/blank/site/custom/README.md +2 -0
  475. package/template/blank/site/features.rk +13 -0
  476. package/template/blank/site/layouts/main.rk +14 -0
  477. package/template/blank/site/system.rk +20 -0
  478. package/template/blank/site/themes/main.rk +8 -0
  479. package/template/demo/fixtures/crm_demo.rk +168 -0
  480. package/template/demo/fixtures/demo.rk +417 -0
  481. package/template/demo/site/config.rk +13 -0
  482. package/template/demo/site/features.rk +13 -0
  483. package/template/demo/site/layouts/crm_first.rk +23 -0
  484. package/template/demo/site/system.rk +26 -0
  485. package/template/demo/site/themes/kopi_senja.rk +10 -0
  486. package/README.md +0 -3
@@ -0,0 +1,36 @@
1
+ # yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/model.json
2
+ name: collector_deposit
3
+ label: {id: Setoran penagih, en: Collector deposit}
4
+ icon: cash
5
+ is_submittable: true
6
+ naming: STP-{YYYY}-{#####}
7
+ title_field: collector
8
+ # The cash a collector hands over, counted by finance. Submitting it (flow collector_deposit_on_submit) takes every
9
+ # collection of that collector on or before the deposit date not yet deposited; refused when there is none or when the
10
+ # cash counted is not exactly their total (a shortage is found before submitting, not booked). Each collection becomes
11
+ # a draft cash payment of its client, allocated to the subscription's oldest unpaid invoices after the draft payments
12
+ # already waiting for that subscription (the rest stays unallocated as the client's credit). Finance submits those
13
+ # payments, which settles the invoices and puts the cash in Kas. A deposit is not cancelled: its draft payments cannot
14
+ # be deleted, and their amount, client and method cannot change (flows deposit_payment_*).
15
+ permissions:
16
+ - {role: finance_manager, read: true, create: true, write: true, submit: true, export: true, print: true}
17
+ - {role: collector, read: true}
18
+ fields:
19
+ - {name: collector, type: link, to: user, label: {id: Penagih}, required: true, in_list: true}
20
+ - {name: deposit_date, type: date, label: {id: Tanggal setor}, default: today(), required: true, in_list: true}
21
+ - {name: cash_counted, type: currency, label: {id: Uang yang dihitung}, required: true, in_list: true}
22
+ - {name: notes, type: text, label: {id: Catatan}}
23
+ rules:
24
+ - name: cash_positive
25
+ on: save
26
+ check: cash_counted > 0
27
+ message: {id: 'Uang yang dihitung harus lebih dari 0'}
28
+ - name: not_future
29
+ on: save
30
+ check: deposit_date <= today()
31
+ message: {id: 'Tanggal setor tidak boleh sesudah hari ini'}
32
+ views:
33
+ list:
34
+ columns: [name, deposit_date, collector, cash_counted, status]
35
+ filters: [collector]
36
+ sort: -deposit_date
@@ -0,0 +1,42 @@
1
+ # yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/model.json
2
+ name: field_collection
3
+ label: {id: Uang tertagih penagih, en: Field collection}
4
+ icon: wallet
5
+ naming: UTP-{YYYY}-{#####}
6
+ title_field: customer_name
7
+ # Cash a collector took from a client in the field (Rangka has no cash until the collector deposits it). Recorded on a
8
+ # subscription, not an invoice: a collector reads no invoices, and what the subscription still owes is on it
9
+ # (unpaid_amount less deposit_waiting, refreshed by the flows). The cap and the collector's area are checked when the
10
+ # collection is saved (flows field_collection_cap_*), not again when it is deposited: cash in hand is deposited even
11
+ # when the client paid the rest elsewhere meanwhile (the surplus is the client's credit) or the area changed hands. A collector deposit takes every collection of its collector not yet
12
+ # deposited and turns each into a draft cash payment allocated to the subscription's oldest unpaid invoices (flow
13
+ # collector_deposit_on_submit; the payment carries this collection's number in []). Once deposited a collection cannot change or be deleted (flows field_collection_*).
14
+ permissions:
15
+ - {role: collector, read: true, create: true, write: true, delete: true}
16
+ - {role: finance_manager, read: true, create: true, write: true, delete: true, export: true, print: true}
17
+ # the payment flows look for the collection of a payment as whoever edits it
18
+ - {role: sales_manager, read: true}
19
+ fields:
20
+ - {name: collector, type: link, to: user, label: {id: Penagih}, default: user.name, required: true, in_list: true}
21
+ - {name: subscription, type: link, to: subscription, label: {id: Langganan}, required: true}
22
+ - {name: customer, type: link, to: customer, label: {id: Pelanggan}, compute: subscription.customer}
23
+ - {name: customer_name, type: data, label: {id: Nama pelanggan}, compute: subscription.customer_name, in_list: true}
24
+ - {name: unpaid_amount, type: currency, label: {id: Belum dibayar saat dicatat}, compute: subscription.unpaid_amount}
25
+ - {name: amount, type: currency, label: {id: Uang diterima}, required: true, in_list: true}
26
+ - {name: collected_on, type: date, label: {id: Tanggal tagih}, default: today(), required: true, in_list: true}
27
+ - {name: deposit, type: link, to: collector_deposit, label: {id: Disetor di}, read_only: true, in_list: true}
28
+ - {name: notes, type: text, label: {id: Catatan}}
29
+ rules:
30
+ - name: amount_positive
31
+ on: save
32
+ check: amount > 0
33
+ message: {id: 'Uang diterima harus lebih dari 0'}
34
+ - name: not_future
35
+ on: save
36
+ check: collected_on <= today()
37
+ message: {id: 'Tanggal tagih tidak boleh sesudah hari ini'}
38
+ views:
39
+ list:
40
+ columns: [name, collected_on, customer_name, amount, collector, deposit]
41
+ filters: [collector, deposit, subscription]
42
+ sort: -collected_on
@@ -0,0 +1,19 @@
1
+ # yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/model.json
2
+ name: service_area
3
+ label: {id: Area layanan, en: Service area}
4
+ icon: map
5
+ naming: ARE-{###}
6
+ title_field: area_name
7
+ # An area (a village, a cluster, a block of a housing estate) and the collector who visits it. The subscriptions of an
8
+ # area follow its collector (flow service_area_collector).
9
+ permissions:
10
+ - {role: finance_manager, read: true, create: true, write: true, export: true, print: true}
11
+ - {role: collector, read: true}
12
+ fields:
13
+ - {name: area_name, type: data, label: {id: Nama area}, required: true, in_list: true}
14
+ - {name: collector, type: link, to: user, label: {id: Penagih}, in_list: true}
15
+ - {name: notes, type: text, label: {id: Catatan}}
16
+ views:
17
+ list:
18
+ columns: [area_name, collector]
19
+ sort: area_name
@@ -0,0 +1,233 @@
1
+ # yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/model.json
2
+ name: subscription
3
+ label: {id: Langganan, en: Subscription}
4
+ icon: repeat
5
+ naming: LGN-{#####}
6
+ title_field: customer_name
7
+ # One client's subscription to a plan, on its own cycle.
8
+ # - Cycle: monthly, every 3 months, yearly, or N months paid in advance; cycle_months is 1, 3, 12 or N. The cycle and
9
+ # the price may change at any time; they apply from the next bill.
10
+ # - Anchor: "start" bills every period from the start date (a retainer started on the 15th bills on the 15th);
11
+ # "month_start" bills on the 1st, and a start on another day gets a first bill pro-rated by days, from the start date
12
+ # to the day before the next 1st (open-isp practice). Periods are counted from the anchor with add_months (contract
13
+ # 0031), never from the previous period, so a 31st anchor does not drift: period k starts at
14
+ # add_months(anchor_date, billed_months). The start date, the anchor and the customer cannot change after the first bill.
15
+ # - Bills: flow subscription_billing (every day, 00:05) bills each subscription whose next bill date has come: one
16
+ # subscription_bill and one draft sales invoice per period. billed_months and prorata_billed are written only by it.
17
+ # - end_date: no period that starts on or after it is billed; the period it falls in is billed up to the day before,
18
+ # pro-rated by days; the subscription is stopped from that day. It cannot fall before billed_through.
19
+ # - Status (computed, never set by hand) from the facts the dunning flows write (oldest_due, checked_on): stopped once
20
+ # end_date has come; else suspended when the oldest unpaid invoice is suspend_after_days past due, late when past
21
+ # due, else active. stop_after_days > 0 makes the dunning flow set end_date when the oldest unpaid invoice is that
22
+ # late (stop_due). Its invoices carry {langganan:<name>} in their notes.
23
+ # The collector of a subscription is its area's (row scope of role collector). Not deleted by anyone but the owner: a
24
+ # client who leaves gets an end date, which keeps the history.
25
+ permissions:
26
+ - {role: finance_manager, read: true, create: true, write: true, export: true, print: true}
27
+ - {role: collector, read: true}
28
+ # the invoice and payment flows refresh a subscription's unpaid amount as whoever submits
29
+ - {role: sales_manager, read: true, write: true}
30
+ fields:
31
+ - {name: customer, type: link, to: customer, label: {id: Pelanggan}, required: true}
32
+ - {name: customer_name, type: data, label: {id: Nama pelanggan}, compute: customer.customer_name, in_list: true}
33
+ - {name: phone, type: data, label: {id: Telepon}, compute: customer.phone}
34
+ - {name: address, type: data, label: {id: Alamat}, compute: customer.address}
35
+ - {name: plan, type: link, to: subscription_plan, label: {id: Paket}, required: true, in_list: true}
36
+ - {name: plan_name, type: data, label: {id: Nama paket}, compute: plan.plan_name}
37
+ - {name: item, type: link, to: item, label: {id: Nama jasa di faktur}, compute: plan.item}
38
+ - name: service_id
39
+ type: data
40
+ label: {id: ID layanan}
41
+ help: {id: 'Nomor pelanggan, user PPPoE, domain, atau nomor lisensi'}
42
+ - {name: area, type: link, to: service_area, label: {id: Area}, in_list: true}
43
+ - {name: collector, type: link, to: user, label: {id: Penagih}, compute: area.collector}
44
+ - name: cycle
45
+ type: select
46
+ label: {id: Siklus tagihan}
47
+ required: true
48
+ default: plan.default_cycle
49
+ options:
50
+ - {value: monthly, label: {id: Bulanan}}
51
+ - {value: quarterly, label: {id: Tiap 3 bulan}}
52
+ - {value: yearly, label: {id: Tahunan}}
53
+ - {value: prepaid, label: {id: Bayar di muka N bulan}}
54
+ - name: prepaid_months
55
+ type: int
56
+ label: {id: Bayar di muka (bulan)}
57
+ default: plan.default_prepaid_months
58
+ depends_on: cycle == 'prepaid'
59
+ - name: cycle_months
60
+ type: int
61
+ label: {id: Bulan per tagihan}
62
+ compute: "cycle == 'monthly' ? 1 : (cycle == 'quarterly' ? 3 : (cycle == 'yearly' ? 12 : prepaid_months))"
63
+ - {name: monthly_price, type: currency, label: {id: Harga per bulan}, default: plan.monthly_price, required: true}
64
+ - name: discount_percent
65
+ type: float
66
+ label: {id: Potongan (%)}
67
+ help: {id: 'Misalnya potongan tahunan; berlaku mulai tagihan berikutnya'}
68
+ default: '0'
69
+ - name: monthly_net
70
+ type: currency
71
+ label: {id: Nilai per bulan (MRR)}
72
+ compute: round(monthly_price * (100 - discount_percent) / 100)
73
+ in_list: true
74
+ - name: start_date
75
+ type: date
76
+ label: {id: Mulai berlangganan}
77
+ default: today()
78
+ required: true
79
+ - name: anchor
80
+ type: select
81
+ label: {id: Tanggal tagihan}
82
+ required: true
83
+ default: "'start'"
84
+ options:
85
+ - {value: start, label: {id: Tiap tanggal mulai}}
86
+ - {value: month_start, label: {id: Tiap tanggal 1 (bulan pertama diprorata)}}
87
+ - name: anchor_date
88
+ type: date
89
+ label: {id: Awal periode penuh pertama}
90
+ compute: "anchor == 'month_start' && truncate(start_date, 7) + '-01' != start_date ? add_months(truncate(start_date, 7) + '-01', 1) : start_date"
91
+ - {name: end_date, type: date, label: {id: Berhenti mulai}}
92
+ - {name: due_days, type: int, label: {id: Jatuh tempo (hari dari awal periode)}, default: plan.due_days}
93
+ - {name: suspend_after_days, type: int, label: {id: Ditangguhkan setelah telat (hari)}, default: plan.suspend_after_days}
94
+ - {name: stop_after_days, type: int, label: {id: Berhenti otomatis setelah telat (hari)}, default: plan.stop_after_days}
95
+ # written by flow subscription_billing only
96
+ - {name: billed_months, type: int, label: {id: Bulan sudah ditagih}, default: '0', read_only: true}
97
+ - {name: prorata_billed, type: check, label: {id: Prorata sudah ditagih}, read_only: true}
98
+ - {name: last_bill, type: link, to: subscription_bill, label: {id: Tagihan terakhir}, read_only: true}
99
+ - name: next_is_prorata
100
+ type: check
101
+ label: {id: Tagihan berikutnya prorata}
102
+ compute: anchor_date != start_date && !prorata_billed
103
+ # the first day after the full periods billed; a period an end date cut short and then the end date taken away
104
+ # (the client stays) leaves billed_through before it: the rest of that period is billed first (audit 2026-11-08 #12)
105
+ - {name: boundary, type: date, label: {id: Batas periode penuh}, hidden: true, compute: "add_months(anchor_date, billed_months)"}
106
+ - name: resume
107
+ type: check
108
+ label: {id: Tagihan berikutnya sisa periode}
109
+ hidden: true
110
+ compute: "!next_is_prorata && billed_through != '' && last_period_start != '' && last_cycle_value > 0 && billed_through < boundary"
111
+ - name: next_bill_date
112
+ type: date
113
+ label: {id: Tagihan berikutnya}
114
+ compute: "next_is_prorata ? start_date : (resume ? billed_through : boundary)"
115
+ in_list: true
116
+ # the period as the cycle runs, then cut at the end date: a client who stops mid-period is billed up to the day before
117
+ # end_date, pro-rated by days of that period (audit 2026-11-08 #1)
118
+ - name: cycle_period_end
119
+ type: date
120
+ label: {id: Akhir periode penuh}
121
+ hidden: true
122
+ compute: "(next_is_prorata ? anchor_date : (resume ? boundary : add_months(anchor_date, billed_months + cycle_months))) - duration(1)"
123
+ - name: next_period_end
124
+ type: date
125
+ label: {id: Akhir periode berikutnya}
126
+ compute: "end_date != '' && end_date - duration(1) < cycle_period_end ? end_date - duration(1) : cycle_period_end"
127
+ - name: cycle_amount
128
+ type: currency
129
+ label: {id: Nilai periode penuh}
130
+ hidden: true
131
+ compute: >-
132
+ next_is_prorata ? round(monthly_net * days_between(start_date, anchor_date) / days_between(add_months(anchor_date, -1), anchor_date))
133
+ : (resume ? round(last_full_amount * days_between(billed_through, boundary) / days_between(last_period_start, boundary)) : monthly_net * cycle_months)
134
+ - name: next_amount
135
+ type: currency
136
+ label: {id: Nilai tagihan berikutnya}
137
+ help: {id: 'Tanpa baris tambahan dan PPN'}
138
+ compute: "next_period_end == cycle_period_end ? cycle_amount : round(cycle_amount * days_between(next_bill_date, next_period_end + duration(1)) / days_between(next_bill_date, cycle_period_end + duration(1)))"
139
+ - {name: billed_through, type: date, label: {id: Sudah ditagih sampai sebelum}, read_only: true}
140
+ # the last period billed as the cycle runs (before an end date cut it): what the rest of it is pro-rated against
141
+ - {name: last_period_start, type: date, label: {id: Awal periode terakhir}, read_only: true, hidden: true}
142
+ - {name: last_full_amount, type: currency, label: {id: Nilai penuh periode terakhir}, read_only: true, hidden: true}
143
+ - {name: last_cycle_value, type: currency, label: {id: Nilai satu siklus saat periode terakhir}, read_only: true, hidden: true}
144
+ # facts written by the dunning flows only; the status is computed from them when they are saved
145
+ - {name: unpaid_amount, type: currency, label: {id: Belum dibayar}, read_only: true, in_list: true}
146
+ - name: deposit_waiting
147
+ type: currency
148
+ label: {id: Setoran penagih menunggu diajukan}
149
+ help: {id: 'Uang tunai yang sudah disetor tapi pembayarannya belum diajukan finance'}
150
+ read_only: true
151
+ - {name: overdue_amount, type: currency, label: {id: Lewat jatuh tempo}, read_only: true}
152
+ - {name: oldest_due, type: date, label: {id: Jatuh tempo tagihan tertua yang belum lunas}, read_only: true}
153
+ - {name: checked_on, type: date, label: {id: Status dicek}, read_only: true}
154
+ - {name: prev_status, type: data, label: {id: Status sebelum dicek}, read_only: true, hidden: true}
155
+ - name: overdue_since
156
+ type: date
157
+ label: {id: Telat sejak}
158
+ compute: "oldest_due != '' && checked_on != '' && oldest_due < checked_on ? oldest_due : ''"
159
+ - name: late_days
160
+ type: int
161
+ label: {id: Telat (hari)}
162
+ compute: "overdue_since == '' ? 0 : days_between(overdue_since, checked_on)"
163
+ - name: stop_due
164
+ type: check
165
+ label: {id: Waktunya berhenti otomatis}
166
+ hidden: true
167
+ compute: end_date == '' && stop_after_days > 0 && late_days >= stop_after_days
168
+ - name: status
169
+ type: select
170
+ label: {id: Status layanan}
171
+ compute: "end_date != '' && end_date <= (checked_on == '' ? start_date : checked_on) ? 'stopped' : (late_days >= suspend_after_days ? 'suspended' : (late_days > 0 ? 'late' : 'active'))"
172
+ in_list: true
173
+ chip: true
174
+ options:
175
+ - {value: active, label: {id: Aktif}}
176
+ - {value: late, label: {id: Telat}}
177
+ - {value: suspended, label: {id: Ditangguhkan}}
178
+ - {value: stopped, label: {id: Berhenti}}
179
+ # copies the billing flow takes at the first bill (rule terms_locked)
180
+ - {name: locked_start, type: date, label: {id: Mulai (terkunci)}, read_only: true, hidden: true}
181
+ - {name: locked_anchor, type: data, label: {id: Tanggal tagihan (terkunci)}, read_only: true, hidden: true}
182
+ - {name: locked_customer, type: data, label: {id: Pelanggan (terkunci)}, read_only: true, hidden: true}
183
+ - {name: notes, type: text, label: {id: Catatan}}
184
+ rules:
185
+ - name: prepaid_range
186
+ on: save
187
+ check: cycle != 'prepaid' || (prepaid_months >= 1 && prepaid_months <= 36)
188
+ message: {id: 'Bayar di muka antara 1 dan 36 bulan'}
189
+ - name: price_positive
190
+ on: save
191
+ check: monthly_price > 0 && discount_percent >= 0 && discount_percent < 100 && monthly_net > 0
192
+ message: {id: 'Harga per bulan harus lebih dari 0 dan potongan 0 sampai di bawah 100%'}
193
+ - name: end_after_start
194
+ on: save
195
+ check: end_date == '' || end_date > start_date
196
+ message: {id: 'Tanggal berhenti harus sesudah tanggal mulai'}
197
+ - name: ladder_valid
198
+ on: save
199
+ check: due_days >= 0 && due_days <= 60 && suspend_after_days >= 1 && suspend_after_days <= 365 && (stop_after_days == 0 || (stop_after_days > suspend_after_days && stop_after_days <= 730))
200
+ message: {id: 'Jatuh tempo 0 sampai 60 hari, ditangguhkan 1 sampai 365 hari, berhenti otomatis 0 atau lebih lama dari ditangguhkan'}
201
+ - name: terms_locked
202
+ on: save
203
+ check: locked_start == '' || (start_date == locked_start && anchor == locked_anchor && (locked_customer == '' || customer == locked_customer))
204
+ message: {id: 'Sudah ada tagihan: pelanggan, tanggal mulai dan tanggal tagihan tidak bisa diubah lagi'}
205
+ - name: end_not_billed
206
+ on: save
207
+ check: end_date == '' || billed_through == '' || end_date >= billed_through
208
+ message: {id: 'Periode sampai tanggal itu sudah ditagih; isi tanggal berhenti sesudah periode terakhir yang ditagih'}
209
+ views:
210
+ list:
211
+ columns: [name, customer_name, plan, area, monthly_net, next_bill_date, status]
212
+ filters: [status, area, plan, collector]
213
+ sort: customer_name
214
+ form:
215
+ layout:
216
+ - section: {id: Pelanggan}
217
+ columns:
218
+ - [customer, customer_name, phone, address]
219
+ - [service_id, area, collector, status]
220
+ - section: {id: Paket dan siklus}
221
+ columns:
222
+ - [plan, cycle, prepaid_months, cycle_months]
223
+ - [monthly_price, discount_percent, monthly_net]
224
+ - section: {id: Periode}
225
+ columns:
226
+ - [start_date, anchor, anchor_date, end_date]
227
+ - [next_bill_date, next_period_end, next_amount, billed_months]
228
+ - section: {id: Penagihan}
229
+ columns:
230
+ - [due_days, suspend_after_days, stop_after_days]
231
+ - [unpaid_amount, deposit_waiting, overdue_amount, overdue_since, late_days, checked_on]
232
+ - section: {id: Catatan}
233
+ fields: [notes]
@@ -0,0 +1,48 @@
1
+ # yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/model.json
2
+ name: subscription_bill
3
+ label: {id: Tagihan langganan, en: Subscription bill}
4
+ icon: invoice
5
+ naming: TLG-{YYYY}-{#####}
6
+ title_field: customer_name
7
+ # One billed period of a subscription, made only by flow subscription_billing (no role creates or edits one; every
8
+ # field is read-only). It holds the period and the amounts; the draft invoice the flow made carries this bill's number
9
+ # in [] and {langganan:<subscription>} in its notes (found by that tag: a draft is renamed when submitted), and can be
10
+ # submitted only for exactly this bill's total, to its customer, once (flow invoice_subscription_once); the last live
11
+ # invoice of a bill is not deleted (flow invoice_subscription_kept). period_key is unique: a period is billed once whatever
12
+ # runs the flow. A wrong invoice is cancelled and amended (the amended copy keeps the tags); the bill stays as the
13
+ # record that the period was billed.
14
+ permissions:
15
+ - {role: finance_manager, read: true, export: true, print: true}
16
+ # flow invoice_subscription_once reads bills as whoever submits an invoice
17
+ - {role: sales_manager, read: true}
18
+ fields:
19
+ - {name: subscription, type: link, to: subscription, label: {id: Langganan}, required: true, read_only: true, in_list: true}
20
+ - {name: customer, type: link, to: customer, label: {id: Pelanggan}, required: true, read_only: true}
21
+ - {name: customer_name, type: data, label: {id: Nama pelanggan}, compute: customer.customer_name, in_list: true}
22
+ - name: kind
23
+ type: select
24
+ label: {id: Jenis}
25
+ read_only: true
26
+ in_list: true
27
+ options:
28
+ - {value: regular, label: {id: Periode penuh}}
29
+ - {value: prorata, label: {id: Prorata}}
30
+ - {value: remainder, label: {id: Sisa periode}}
31
+ - {name: period_start, type: date, label: {id: Periode mulai}, required: true, read_only: true, in_list: true}
32
+ - {name: period_end, type: date, label: {id: Periode sampai}, required: true, read_only: true, in_list: true}
33
+ - {name: months, type: int, label: {id: Bulan}, read_only: true}
34
+ - {name: base_amount, type: currency, label: {id: Nilai paket}, read_only: true}
35
+ - {name: extras_total, type: currency, label: {id: Tambahan}, read_only: true}
36
+ - {name: total, type: currency, label: {id: Total sebelum PPN}, compute: base_amount + extras_total, in_list: true}
37
+ - {name: due_date, type: date, label: {id: Jatuh tempo}, read_only: true}
38
+ - {name: period_key, type: data, label: {id: Kunci periode}, hidden: true, unique: true, compute: "subscription + '|' + period_start"}
39
+ rules:
40
+ - name: period_valid
41
+ on: save
42
+ check: period_end >= period_start && base_amount >= 0 && extras_total >= 0 && base_amount + extras_total > 0
43
+ message: {id: 'Periode atau nilai tagihan tidak sah'}
44
+ views:
45
+ list:
46
+ columns: [name, customer_name, kind, period_start, period_end, total]
47
+ filters: [subscription, kind]
48
+ sort: -period_start
@@ -0,0 +1,50 @@
1
+ # yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/model.json
2
+ name: subscription_extra
3
+ label: {id: Tambahan tagihan langganan, en: Subscription extra}
4
+ icon: plus
5
+ naming: TMB-{#####}
6
+ title_field: description
7
+ # A line added to a subscription's bills: once (an installation fee, an extra design job this month) or every period
8
+ # (an add-on, a second access point) from a date until an optional date; the amount is per full cycle, pro-rated on a
9
+ # shorter bill like the plan line. The billing flow adds every active extra whose
10
+ # dates overlap the period it bills (from_date on or before the period's last day, until_date empty or on or after its
11
+ # first day) as a line of the draft invoice; a one-off extra is marked with the bill that took it and is not billed
12
+ # again. An extra cannot change after a bill took it (flow subscription_extra_locked); a recurring one that should end gets an
13
+ # until date, a new amount is a new extra.
14
+ permissions:
15
+ # no delete: an extra a bill took stays as the record of that line; one that is not wanted is set inactive
16
+ - {role: finance_manager, read: true, create: true, write: true, export: true, print: true}
17
+ fields:
18
+ - {name: subscription, type: link, to: subscription, label: {id: Langganan}, required: true, in_list: true}
19
+ - {name: customer_name, type: data, label: {id: Pelanggan}, compute: subscription.customer_name, in_list: true}
20
+ - {name: description, type: data, label: {id: Keterangan di faktur}, required: true, in_list: true}
21
+ - {name: item, type: link, to: item, label: {id: Nama jasa di faktur}, default: subscription.item, required: true}
22
+ - {name: amount, type: currency, label: {id: Jumlah per tagihan}, required: true, in_list: true}
23
+ - name: repeat
24
+ type: select
25
+ label: {id: Berlaku}
26
+ required: true
27
+ default: "'once'"
28
+ in_list: true
29
+ options:
30
+ - {value: once, label: {id: Sekali}}
31
+ - {value: every_period, label: {id: Tiap tagihan}}
32
+ - {name: from_date, type: date, label: {id: Mulai}, default: today(), required: true}
33
+ - {name: until_date, type: date, label: {id: Sampai}, depends_on: repeat == 'every_period'}
34
+ - {name: active, type: check, label: {id: Aktif}, default: 'true', in_list: true}
35
+ - {name: billed_bill, type: link, to: subscription_bill, label: {id: Ditagih di}, read_only: true}
36
+ - {name: last_bill, type: link, to: subscription_bill, label: {id: Tagihan terakhir}, read_only: true}
37
+ rules:
38
+ - name: amount_positive
39
+ on: save
40
+ check: amount > 0
41
+ message: {id: 'Jumlah tambahan harus lebih dari 0; potongan ditulis di potongan langganan'}
42
+ - name: until_after_from
43
+ on: save
44
+ check: until_date == '' || until_date >= from_date
45
+ message: {id: 'Tanggal sampai harus sesudah tanggal mulai'}
46
+ views:
47
+ list:
48
+ columns: [name, customer_name, description, amount, repeat, from_date, active]
49
+ filters: [subscription, repeat, active]
50
+ sort: -from_date
@@ -0,0 +1,65 @@
1
+ # yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/model.json
2
+ name: subscription_guard
3
+ label: {id: Penjaga langganan, en: Subscription guard}
4
+ icon: check
5
+ naming: LGD-{######}
6
+ title_field: reason
7
+ # Never stored (the pattern of courses.course_guard): a flow that must refuse the action it runs in creates one, and the
8
+ # rule of its reason fails with that message, which rolls the whole action back.
9
+ permissions:
10
+ - {role: finance_manager, create: true}
11
+ - {role: sales_manager, create: true}
12
+ - {role: collector, create: true}
13
+ fields:
14
+ - name: reason
15
+ type: select
16
+ label: {id: Alasan}
17
+ required: true
18
+ options:
19
+ - {value: invoice_twice, label: {id: Faktur langganan tidak cocok}}
20
+ - {value: invoice_tag, label: {id: Catatan faktur langganan}}
21
+ - {value: extra_billed, label: {id: Tambahan sudah ditagih}}
22
+ - {value: deposit_mismatch, label: {id: Setoran tidak cocok}}
23
+ - {value: collection_deposited, label: {id: Uang tertagih sudah disetor}}
24
+ - {value: collection_over, label: {id: Uang tertagih melebihi tagihan}}
25
+ - {value: deposit_payment, label: {id: Pembayaran dari setoran}}
26
+ - {value: collection_area, label: {id: Bukan area penagih}}
27
+ - {value: invoice_kept, label: {id: Faktur langganan terakhir}}
28
+ - {name: document, type: data, label: {id: Dokumen}}
29
+ rules:
30
+ - name: invoice_twice
31
+ on: save
32
+ check: reason != 'invoice_twice'
33
+ message: {id: 'Faktur ini tidak cocok dengan tagihan langganannya (pelanggan atau jumlah sebelum PPN beda), atau tagihan itu sudah punya faktur diajukan'}
34
+ - name: invoice_tag
35
+ on: save
36
+ check: reason != 'invoice_tag'
37
+ message: {id: 'Catatan faktur langganan tidak bisa diubah (penanda tagihan langganan)'}
38
+ - name: extra_billed
39
+ on: save
40
+ check: reason != 'extra_billed'
41
+ message: {id: 'Tambahan ini sudah ditagih: hanya tanggal sampai dan status aktif yang bisa diubah; jumlah baru dibuat sebagai tambahan baru'}
42
+ - name: deposit_mismatch
43
+ on: save
44
+ check: reason != 'deposit_mismatch'
45
+ message: {id: 'Uang yang dihitung tidak sama dengan total uang tertagih penagih ini yang belum disetor (atau tidak ada yang belum disetor)'}
46
+ - name: collection_deposited
47
+ on: save
48
+ check: reason != 'collection_deposited'
49
+ message: {id: 'Uang tertagih ini sudah disetor; tidak bisa diubah atau dihapus'}
50
+ - name: collection_over
51
+ on: save
52
+ check: reason != 'collection_over'
53
+ message: {id: 'Uang tertagih yang belum disetor untuk langganan ini melebihi yang belum dibayar'}
54
+ - name: collection_area
55
+ on: save
56
+ check: reason != 'collection_area'
57
+ message: {id: 'Langganan ini bukan di area penagih ini'}
58
+ - name: invoice_kept
59
+ on: save
60
+ check: reason != 'invoice_kept'
61
+ message: {id: 'Ini satu-satunya faktur tagihan langganan itu; perbaiki drafnya, jangan dihapus (periodenya sudah ditagih)'}
62
+ - name: deposit_payment
63
+ on: save
64
+ check: reason != 'deposit_payment'
65
+ message: {id: 'Pembayaran ini dari setoran penagih: tidak bisa dihapus atau dibatalkan; jumlah, pelanggan, metode dan catatannya tetap'}
@@ -0,0 +1,29 @@
1
+ # yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/model.json
2
+ name: subscription_month
3
+ label: {id: Rekap bulan langganan, en: Subscription month}
4
+ icon: chart
5
+ naming: RBL-{YYYY}-{###}
6
+ title_field: month
7
+ # One row per calendar month, refreshed by flow subscription_dunning every day for this month and the month before:
8
+ # what was invoiced (submitted invoices of subscriptions dated in that month, net of PPh 23 and retention), what of it
9
+ # is paid, the collection rate, and the subscriptions and MRR at the last refresh.
10
+ permissions:
11
+ - {role: finance_manager, read: true, export: true, print: true}
12
+ fields:
13
+ - {name: month, type: data, label: {id: Bulan}, required: true, unique: true, read_only: true, in_list: true}
14
+ - {name: month_start, type: date, label: {id: Awal bulan}, compute: month + '-01'}
15
+ - {name: billed, type: currency, label: {id: Ditagih}, read_only: true, in_list: true}
16
+ - {name: collected, type: currency, label: {id: Sudah dibayar}, read_only: true, in_list: true}
17
+ - name: collection_rate
18
+ type: float
19
+ label: {id: Tingkat tertagih (%)}
20
+ compute: "billed > 0 ? round(collected * 100 / billed, 1) : 0"
21
+ in_list: true
22
+ - {name: invoices, type: int, label: {id: Jumlah faktur}, read_only: true}
23
+ - {name: active_count, type: int, label: {id: Langganan berjalan}, read_only: true}
24
+ - {name: mrr, type: currency, label: {id: MRR}, read_only: true}
25
+ - {name: refreshed_on, type: date, label: {id: Diperbarui}, read_only: true}
26
+ views:
27
+ list:
28
+ columns: [month, billed, collected, collection_rate, active_count, mrr]
29
+ sort: -month
@@ -0,0 +1,75 @@
1
+ # yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/model.json
2
+ name: subscription_plan
3
+ label: {id: Paket langganan, en: Subscription plan}
4
+ icon: tag
5
+ naming: PKT-{###}
6
+ title_field: plan_name
7
+ # A plan: the monthly price and the defaults a new subscription copies (cycle, due days, dunning ladder). A
8
+ # subscription keeps its own copy, so changing a plan changes only the subscriptions made after.
9
+ permissions:
10
+ - {role: finance_manager, read: true, create: true, write: true, export: true, print: true}
11
+ - {role: collector, read: true}
12
+ fields:
13
+ - {name: plan_name, type: data, label: {id: Nama paket}, required: true, in_list: true}
14
+ - {name: item, type: link, to: item, label: {id: Nama jasa di faktur}, required: true, in_list: true}
15
+ - {name: monthly_price, type: currency, label: {id: Harga per bulan}, required: true, in_list: true}
16
+ - name: default_cycle
17
+ type: select
18
+ label: {id: Siklus tagihan}
19
+ required: true
20
+ default: "'monthly'"
21
+ in_list: true
22
+ options:
23
+ - {value: monthly, label: {id: Bulanan}}
24
+ - {value: quarterly, label: {id: Tiap 3 bulan}}
25
+ - {value: yearly, label: {id: Tahunan}}
26
+ - {value: prepaid, label: {id: Bayar di muka N bulan}}
27
+ - name: default_prepaid_months
28
+ type: int
29
+ label: {id: Bayar di muka (bulan)}
30
+ default: '6'
31
+ depends_on: default_cycle == 'prepaid'
32
+ - name: due_days
33
+ type: int
34
+ label: {id: Jatuh tempo (hari dari awal periode)}
35
+ default: '7'
36
+ - name: suspend_after_days
37
+ type: int
38
+ label: {id: Ditangguhkan setelah telat (hari)}
39
+ help: {id: 'Layanan ditandai ditangguhkan (isolir) bila tagihan tertua lewat jatuh tempo sekian hari'}
40
+ default: '10'
41
+ - name: stop_after_days
42
+ type: int
43
+ label: {id: Berhenti otomatis setelah telat (hari)}
44
+ help: {id: '0 = tidak pernah berhenti otomatis'}
45
+ default: '0'
46
+ - {name: active, type: check, label: {id: Masih dijual}, default: 'true', in_list: true}
47
+ - {name: description, type: text, label: {id: Keterangan}}
48
+ rules:
49
+ - name: price_positive
50
+ on: save
51
+ check: monthly_price > 0
52
+ message: {id: 'Harga per bulan harus lebih dari 0'}
53
+ - name: prepaid_range
54
+ on: save
55
+ check: default_cycle != 'prepaid' || (default_prepaid_months >= 1 && default_prepaid_months <= 36)
56
+ message: {id: 'Bayar di muka antara 1 dan 36 bulan'}
57
+ - name: ladder_valid
58
+ on: save
59
+ check: due_days >= 0 && due_days <= 60 && suspend_after_days >= 1 && suspend_after_days <= 365 && (stop_after_days == 0 || (stop_after_days > suspend_after_days && stop_after_days <= 730))
60
+ message: {id: 'Jatuh tempo 0 sampai 60 hari, ditangguhkan 1 sampai 365 hari, berhenti otomatis 0 atau lebih lama dari ditangguhkan'}
61
+ views:
62
+ list:
63
+ columns: [plan_name, item, monthly_price, default_cycle, active]
64
+ sort: plan_name
65
+ form:
66
+ layout:
67
+ - section: {id: Paket}
68
+ columns:
69
+ - [plan_name, item, monthly_price, active]
70
+ - [default_cycle, default_prepaid_months]
71
+ - section: {id: Jatuh tempo dan penagihan}
72
+ columns:
73
+ - [due_days, suspend_after_days, stop_after_days]
74
+ - section: {id: Keterangan}
75
+ fields: [description]
@@ -0,0 +1,27 @@
1
+ # yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/model.json
2
+ name: subscription_status_log
3
+ label: {id: Riwayat status layanan, en: Service status log}
4
+ icon: history
5
+ naming: RSL-{YYYY}-{######}
6
+ title_field: subscription
7
+ # One row per change of a subscription's service status, written by the dunning flows. The suspended rows of today are
8
+ # the list of connections to isolate (by hand until the router connector exists; rangka-edge D6).
9
+ permissions:
10
+ # created only by the dunning flows (every field read-only), as whoever submits a payment
11
+ - {role: finance_manager, read: true, create: true, export: true, print: true}
12
+ - {role: sales_manager, read: true, create: true}
13
+ - {role: collector, read: true}
14
+ fields:
15
+ - {name: subscription, type: link, to: subscription, label: {id: Langganan}, required: true, read_only: true, in_list: true}
16
+ - {name: customer_name, type: data, label: {id: Pelanggan}, compute: subscription.customer_name, in_list: true}
17
+ - {name: collector, type: link, to: user, label: {id: Penagih}, compute: subscription.collector}
18
+ - {name: changed_on, type: date, label: {id: Tanggal}, required: true, read_only: true, in_list: true}
19
+ - {name: from_status, type: data, label: {id: Dari}, read_only: true, in_list: true}
20
+ - {name: to_status, type: data, label: {id: Menjadi}, read_only: true, in_list: true}
21
+ - {name: overdue_since, type: date, label: {id: Telat sejak}, read_only: true}
22
+ - {name: overdue_amount, type: currency, label: {id: Lewat jatuh tempo}, read_only: true}
23
+ views:
24
+ list:
25
+ columns: [changed_on, customer_name, from_status, to_status, overdue_amount]
26
+ filters: [subscription, to_status]
27
+ sort: -changed_on
@@ -0,0 +1,18 @@
1
+ # yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/module.json
2
+ name: subscriptions
3
+ version: 1.0.0
4
+ title: {id: Langganan, en: Subscriptions}
5
+ summary:
6
+ id: Paket langganan, tagihan tiap periode, area layanan dan setoran penagih.
7
+ en: Subscription plans, bills each period, service areas and collector deposits.
8
+ category: sales
9
+ icon: repeat-line
10
+ # Businesses that bill the same client every period: a digital agency's retainers, an RT/RW net, a reseller of a POS
11
+ # app. Plans with a monthly price; one subscription per client with its own cycle (monthly, 3 months, yearly or N
12
+ # months paid in advance), start date and anchor (every start date, or the 1st with the first period pro-rated);
13
+ # extra lines per period; bills made every day by a scheduled flow, each a draft sales invoice, so payment, reminders,
14
+ # aging, tax and bank matching are the money rail's; the service status (active, late, suspended, stopped) moved by a
15
+ # dunning ladder; areas and collectors, the cash they collect in the field and their deposits into the till; a monthly
16
+ # recap for the collection rate. Kernel: contract 0031 (add_months, days_between, for_each). Research and plan:
17
+ # rangka reports/Peta kebutuhan lima bisnis UMKM.md (langganan), lima-bisnis-plan.md §2.5, plans/layar-kerja.md A3.
18
+ requires: {rangka: '>=0.5', users: ^1.0, contacts: ^1.0, catalogue: ^1.0, invoicing: ^1.0, payments: ^1.0, procurement: ^1.0}