@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,26 @@
1
+ # yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/flow.json
2
+ # Head office cancels a close (a miscount): the shift opens again, without its counted figures, and is closed with a
3
+ # new Tutup sesi. Its selisih kas journal is reversed by gl_pos_shift_close_reverse.
4
+ name: pos_shift_close_on_cancel
5
+ label: {id: 'Tutup sesi dibatalkan: sesi kasir dibuka lagi'}
6
+ on: pos_shift_close.cancelled
7
+ steps:
8
+ - {find: pos_shift, where: name == event.shift, as: s}
9
+ # one open shift per cashier per outlet: a shift opened since cannot be joined by the reopened one (audit kasir L6)
10
+ - find_all: pos_shift
11
+ if: s != null
12
+ where: outlet == s.outlet && cashier == s.cashier && state == 'open' && name != s.name
13
+ limit: 1
14
+ as: open
15
+ - if: s != null && open.size() > 0
16
+ create: pos_guard
17
+ set:
18
+ reason: "'shift_already_open'"
19
+ document: open[0].name
20
+ - update: s
21
+ if: s != null && s.closed_by == event.name
22
+ set:
23
+ state: "'open'"
24
+ closed_by: "''"
25
+ counted_cash: '0'
26
+ cash_difference: '0'
@@ -0,0 +1,23 @@
1
+ # yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/flow.json
2
+ # Runs inside the close's submit, as the cashier. Reading pos_shift takes the flow read lock of contract 0025, the
3
+ # same one the sales' flows take, so a sale is either counted before the close or refused after it. A shift already
4
+ # closed (two closes at once) is refused, and so is a close whose figures went stale: a sale was paid or voided between
5
+ # the figures being read and this lock, so the cash and QRIS it would settle in the journal are not the shift's.
6
+ name: pos_shift_close_on_submit
7
+ label: {id: 'Tutup sesi diajukan: sesi kasir ditutup'}
8
+ on: pos_shift_close.submitted
9
+ steps:
10
+ - {find: pos_shift, where: name == event.shift, as: s}
11
+ - if: s == null || s.state != 'open'
12
+ create: pos_guard
13
+ set: {reason: "'shift_closed'", document: event.name}
14
+ - if: s != null && (s.cash_total != event.cash_total || s.qris_total != event.qris_total || s.opening_cash != event.opening_cash)
15
+ create: pos_guard
16
+ set: {reason: "'close_stale'", document: event.name}
17
+ - update: s
18
+ if: s != null
19
+ set:
20
+ state: "'closed'"
21
+ closed_by: event.name
22
+ counted_cash: event.counted_cash
23
+ cash_difference: event.cash_difference
@@ -0,0 +1,21 @@
1
+ # yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/flow.json
2
+ # When head office set one, the shift opens with the outlet's float (an outlet without a code cannot open a shift:
3
+ # the kernel refuses its number, 409 numbering). One open shift per cashier per outlet: a second one would split the drawer's cash over two counts. The read lock of
4
+ # contract 0025 serializes two opens at the same moment, so the later one sees the first.
5
+ name: pos_shift_on_create
6
+ label: {id: 'Sesi kasir dibuka: hanya satu sesi terbuka per kasir per outlet'}
7
+ on: pos_shift.created
8
+ steps:
9
+ - {find: outlet, where: name == event.outlet, as: o}
10
+ - if: o != null && o.cash_float > 0 && event.opening_cash != o.cash_float
11
+ create: pos_guard
12
+ set: {reason: "'float_of_outlet'", document: event.name}
13
+ - find_all: pos_shift
14
+ where: outlet == event.outlet && cashier == event.cashier && state == 'open' && name != event.name
15
+ limit: 1
16
+ as: open
17
+ - if: open.size() > 0
18
+ create: pos_guard
19
+ set:
20
+ reason: "'shift_already_open'"
21
+ document: open[0].name
@@ -0,0 +1,10 @@
1
+ # yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/flow.json
2
+ # The float and the outlet of a shift are fixed once it is open: the expected cash is counted from the float, so
3
+ # raising it later would hide a shortage. Writes by the flows (totals, the close) start no flow, so they pass.
4
+ name: pos_shift_on_update
5
+ label: {id: 'Sesi kasir diubah: modal dan outlet tetap'}
6
+ on: pos_shift.updated
7
+ steps:
8
+ - if: event.before != null && (event.before.opening_cash != event.opening_cash || event.before.outlet != event.outlet)
9
+ create: pos_guard
10
+ set: {reason: "'shift_changed'", document: event.name}
@@ -0,0 +1,28 @@
1
+ # yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/flow.json
2
+ # A day an outlet rang up in Juragan's cashier is settled when each shift closes (Tutup sesi: cash to Kas, QRIS to
3
+ # Bank, the difference to Selisih kas); a Setoran harian for that outlet and day would book them a second time (audit
4
+ # kasir H1, R2-1, R3-1). Refused when the outlet and day have a paid receipt, whatever the outlet's sales_source says
5
+ # now; and refused for an outlet on the cashier unless that day has a daily sales record (a day of the daily form
6
+ # before the outlet moved to the cashier can still take its setoran). pos_sale_on_submit refuses a receipt on a day
7
+ # that already has a setoran, so neither order books the cash twice.
8
+ name: pos_takings_guard
9
+ label: {id: 'Setoran harian diajukan: tolak kalau hari itu outlet memakai kasir'}
10
+ on: outlet_takings.submitted
11
+ steps:
12
+ - {find: outlet, where: name == event.outlet, as: o}
13
+ - find_all: outlet_sales
14
+ where: outlet == event.outlet && date == event.date && docstatus == 1
15
+ limit: 1
16
+ as: forms
17
+ - if: o != null && o.sales_source == 'kasir' && forms.size() == 0
18
+ create: pos_guard
19
+ set: {reason: "'cashier_takings'", document: event.name}
20
+ - find_all: pos_sale
21
+ where: outlet == event.outlet && date == event.date && docstatus == 1
22
+ limit: 1
23
+ as: receipts
24
+ - if: receipts.size() > 0
25
+ create: pos_guard
26
+ set:
27
+ reason: "'cashier_takings'"
28
+ document: receipts[0].name
@@ -0,0 +1,76 @@
1
+ # yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/model.json
2
+ # Never stored: a flow of this module creates one when the write it runs in must be refused (the pattern of
3
+ # rental_guard and outlet_sales_guard); the matching rule fails with the reason's message, which rolls the whole write
4
+ # back (the flow runs inside it). Create is granted to the roles whose writes run those flows.
5
+ name: pos_guard
6
+ label: {id: Penjaga kasir, en: Cashier guard}
7
+ icon: check
8
+ naming: PGD-{######}
9
+ title_field: reason
10
+ permissions:
11
+ - {role: head_office, create: true}
12
+ - {role: cashier, create: true}
13
+ - {role: outlet_staff, create: true} # flow pos_daily_form_guard, inside a daily form's submit
14
+ fields:
15
+ - name: reason
16
+ type: select
17
+ label: {id: Alasan}
18
+ required: true
19
+ options:
20
+ - {value: shift_already_open, label: {id: Sesi kasir masih terbuka}}
21
+ - {value: shift_closed, label: {id: Sesi kasir sudah ditutup}}
22
+ - {value: shift_changed, label: {id: Data pembukaan sesi diubah}}
23
+ - {value: close_stale, label: {id: Angka tutup sesi sudah berubah}}
24
+ - {value: void_other_day, label: {id: Batal di hari lain}}
25
+ - {value: void_shift_closed, label: {id: Batal setelah sesi ditutup}}
26
+ - {value: void_not_own, label: {id: Batal struk sesi kasir lain}}
27
+ - {value: daily_sales_same_day, label: {id: Outlet sudah punya penjualan harian di tanggal itu}}
28
+ - {value: cashier_same_day, label: {id: Outlet sudah memakai kasir di tanggal itu}}
29
+ - {value: cashier_takings, label: {id: Setoran hari kasir}}
30
+ - {value: float_of_outlet, label: {id: Modal kas beda dengan outlet}}
31
+ - {name: document, type: data, label: {id: Dokumen}}
32
+ rules:
33
+ - name: shift_already_open
34
+ on: save
35
+ check: reason != 'shift_already_open'
36
+ message: {id: 'Kamu masih punya sesi kasir terbuka di outlet ini; tutup sesi itu dulu atau lanjutkan di sana'}
37
+ - name: shift_closed
38
+ on: save
39
+ check: reason != 'shift_closed'
40
+ message: {id: 'Sesi kasir ini baru saja ditutup; buka sesi baru lalu ulangi transaksinya'}
41
+ - name: shift_changed
42
+ on: save
43
+ check: reason != 'shift_changed'
44
+ message: {id: 'Outlet dan modal kas tidak bisa diubah setelah sesi dibuka; tutup sesi ini dan buka sesi baru'}
45
+ - name: close_stale
46
+ on: save
47
+ check: reason != 'close_stale'
48
+ message: {id: 'Ada transaksi baru di sesi ini sejak tutup sesi disimpan; simpan lagi untuk membaca angka terbaru, lalu ajukan'}
49
+ - name: void_other_day
50
+ on: save
51
+ check: reason != 'void_other_day'
52
+ message: {id: 'Transaksi hanya bisa dibatalkan di hari yang sama. Untuk hari lain, catat retur lewat kantor pusat'}
53
+ - name: void_shift_closed
54
+ on: save
55
+ check: reason != 'void_shift_closed'
56
+ message: {id: 'Sesi kasir transaksi ini sudah ditutup; transaksinya tidak bisa dibatalkan lagi'}
57
+ - name: void_not_own
58
+ on: save
59
+ check: reason != 'void_not_own'
60
+ message: {id: 'Struk ini dari sesi kasir orang lain; minta kasirnya atau kantor pusat yang membatalkan'}
61
+ - name: daily_sales_same_day
62
+ on: save
63
+ check: reason != 'daily_sales_same_day'
64
+ message: {id: 'Outlet ini sudah punya penjualan atau setoran harian di tanggal ini; satu outlet satu sumber penjualan per hari'}
65
+ - name: cashier_same_day
66
+ on: save
67
+ check: reason != 'cashier_same_day'
68
+ message: {id: 'Outlet ini sudah mencatat penjualan lewat kasir Juragan di tanggal ini; penjualan harian tanggal itu tidak bisa diajukan'}
69
+ - name: cashier_takings
70
+ on: save
71
+ check: reason != 'cashier_takings'
72
+ message: {id: 'Outlet ini memakai kasir Juragan: setorannya dibukukan saat Tutup sesi kasir, bukan di Setoran harian'}
73
+ - name: float_of_outlet
74
+ on: save
75
+ check: reason != 'float_of_outlet'
76
+ message: {id: 'Modal kas outlet ini sudah ditetapkan kantor pusat; isi sesuai Modal kas kasir di data outlet'}
@@ -0,0 +1,17 @@
1
+ # yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/model.json
2
+ # One payment of a cashier sale: cash handed over (the change comes back from it) or a QRIS payment to the outlet's
3
+ # QRIS (exact, with the reference of the notification). Two rows make a split payment. The shape is the one the
4
+ # counter work screen fills (rangka-os proposal 0030: payments {table, method, amount}).
5
+ name: pos_payment
6
+ is_child: true
7
+ fields:
8
+ - name: method
9
+ type: select
10
+ label: {id: Cara bayar}
11
+ required: true
12
+ default: "'cash'"
13
+ options:
14
+ - {value: cash, label: {id: Tunai}}
15
+ - {value: qris, label: {id: QRIS}}
16
+ - {name: amount, type: currency, label: {id: Jumlah}, required: true}
17
+ - {name: ref, type: data, label: {id: Ref QRIS}, help: {id: 'Nomor referensi di notifikasi QRIS, kalau ada'}}
@@ -0,0 +1,226 @@
1
+ # yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/model.json
2
+ # Transaksi kasir: one receipt. A draft is the open basket; submitting it is the payment: the receipt gets its number
3
+ # per outlet and month (STRK-<outlet code>-<YYMM>-<n>, contract 0009 §2a), the goods leave the outlet's stock (a menu
4
+ # item through its active recipe), and the shift's totals grow (flow pos_sale_on_submit). Prices come from the item
5
+ # (or from the unit picked on the line, uom_conversion.rate); the cashier gives discounts, never a price. Prices
6
+ # include PPN for a PKP business, as on outlet_sales, so the journal splits the PPN out the same way.
7
+ # Payment is a table (cash with change, QRIS, or both), the shape of the counter work screen (proposal 0030).
8
+ # Void: cancel, only on the sale's day while its shift is open (flow pos_sale_on_cancel: the kernel runs no
9
+ # `on: cancel` rule, so the checks live in the flow, under the shift's lock); the stock comes back at the cost it
10
+ # left with and the shift's totals shrink. A partial return on the same day is a void and an amended receipt without the returned items
11
+ # (the amendment keeps the number with -1). Goods that went to waste after the void go out with a stock_adjustment.
12
+ name: pos_sale
13
+ label: {id: Transaksi kasir, en: Cashier sale}
14
+ icon: receipt
15
+ is_submittable: true
16
+ # No title_field: a receipt's title is its number (STRK-...), so a link to it (a kitchen ticket, a daily sales check)
17
+ # shows the number and never the total to a role that may not read the receipt.
18
+ naming: STRK-{outlet.code}-{YY}{MM}-{#####}
19
+ on_submit: [stock.post_moves]
20
+ on_cancel: [stock.reverse_moves]
21
+ permissions:
22
+ - {role: head_office, read: true, create: true, write: true, delete: true, submit: true, cancel: true, amend: true, export: true, print: true}
23
+ - {role: cashier, read: true, create: true, write: true, delete: true, submit: true, cancel: true, amend: true, print: true}
24
+ # flow pos_daily_form_guard reads the receipts of the outlet a daily sales record is submitted for
25
+ - {role: outlet_staff, read: true}
26
+ fields:
27
+ - name: shift
28
+ type: link
29
+ to: pos_shift
30
+ label: {id: Sesi kasir}
31
+ required: true
32
+ peek: [outlet, opening_date, cashier]
33
+ # outlet and date are not read_only: an amendment (a partial return) copies only writable values. The rules hold
34
+ # them to the shift's outlet and to the day of payment.
35
+ - name: outlet
36
+ type: link
37
+ to: outlet
38
+ label: {id: Outlet}
39
+ default: shift.outlet
40
+ in_list: true
41
+ - name: date
42
+ type: date
43
+ label: {id: Tanggal}
44
+ index: true # the outlet_day backfill reads one outlet and day at a time (card t_0dba5917)
45
+ default: today()
46
+ in_list: true
47
+ - name: buyer
48
+ type: data
49
+ label: {id: Pembeli atau meja}
50
+ help: {id: 'Boleh kosong. Nama pembeli, nomor meja atau nomor antrean'}
51
+ in_list: true
52
+ - name: items
53
+ type: table
54
+ of: pos_sale_item
55
+ label: {id: Barang}
56
+ min_rows: 1
57
+ - name: gross_total
58
+ type: currency
59
+ label: {id: Harga sebelum diskon}
60
+ compute: "items.map(l, l.gross).sum()"
61
+ - name: subtotal
62
+ type: currency
63
+ label: {id: Subtotal}
64
+ compute: "items.map(l, l.amount).sum()"
65
+ - name: discount_amount
66
+ type: currency
67
+ label: {id: Diskon nota}
68
+ help: {id: 'Potongan rupiah untuk seluruh nota, setelah diskon per barang'}
69
+ default: '0'
70
+ - name: discount_total
71
+ type: currency
72
+ label: {id: Total diskon}
73
+ compute: gross_total - subtotal + discount_amount
74
+ - name: grand_total
75
+ type: currency
76
+ label: {id: Total}
77
+ compute: subtotal - discount_amount
78
+ in_list: true
79
+ # Payment (table payments, rows of pos_payment): no row means exact cash; a cash row is what the buyer handed over,
80
+ # a QRIS row is paid exactly. Change comes only out of cash, so QRIS may not exceed the total.
81
+ - {name: payments, type: table, of: pos_payment, label: {id: Pembayaran}}
82
+ - name: qris_amount
83
+ type: currency
84
+ label: {id: Dibayar QRIS}
85
+ compute: "payments.map(p, p.method == 'qris' ? p.amount : 0).sum()"
86
+ - name: cash_received
87
+ type: currency
88
+ label: {id: Uang tunai diterima}
89
+ compute: "payments.size() == 0 ? grand_total : payments.map(p, p.method == 'cash' ? p.amount : 0).sum()"
90
+ - name: cash_amount
91
+ type: currency
92
+ label: {id: Dibayar tunai}
93
+ help: {id: 'Total dikurangi QRIS: uang tunai yang tinggal di laci'}
94
+ compute: grand_total - qris_amount
95
+ - name: change_amount
96
+ type: currency
97
+ label: {id: Kembalian}
98
+ compute: cash_received + qris_amount - grand_total
99
+ - name: method
100
+ type: select
101
+ label: {id: Cara bayar}
102
+ compute: "qris_amount == 0 ? 'cash' : (qris_amount >= grand_total ? 'qris' : 'split')"
103
+ in_list: true
104
+ chip: true
105
+ options:
106
+ - {value: cash, label: {id: Tunai}}
107
+ - {value: qris, label: {id: QRIS}}
108
+ - {value: split, label: {id: Tunai + QRIS}}
109
+ - name: cogs_total
110
+ type: currency
111
+ label: {id: Harga pokok}
112
+ help: {id: 'Diisi sistem saat dibayar: barang atau bahan resep x rata-rata biaya'}
113
+ read_only: true
114
+ hidden_for: [cashier, outlet_staff]
115
+ - name: margin
116
+ type: currency
117
+ label: {id: Margin}
118
+ compute: grand_total - cogs_total
119
+ hidden_for: [cashier, outlet_staff]
120
+ # Same monthly tax recap as outlet_sales: PPN inside a PKP shop's prices, and the 0,5% final PPh of PP 55/2022.
121
+ - name: ppn_in_sales
122
+ type: currency
123
+ label: {id: PPN dalam penjualan}
124
+ compute: "tax.pkp ? round(grand_total * tax.ppn_rate * tax.dpp_num / (100 * tax.dpp_den + tax.ppn_rate * tax.dpp_num)) : 0"
125
+ - name: pph_final
126
+ type: currency
127
+ label: {id: 'PPh final 0,5%'}
128
+ compute: round((grand_total - ppn_in_sales) * 5 / 1000)
129
+ # Cashier controls (audit kasir M5): a receipt whose discounts exceed 20% of its price waits for head office
130
+ # (contract 0007; the owner may always approve). A void is not held: an approved verb runs again as a requester
131
+ # without their outlets, so the flow's own-shift check cannot run (kernel card t_7782ebb1 follow-up); voids stay
132
+ # same day, open shift, own shift, and are counted on the shift and the dashboard.
133
+ approvals:
134
+ - name: big_discount
135
+ on: submit
136
+ when: "discount_total * 100 > gross_total * 20 && !('head_office' in user.roles) && !('owner' in user.roles)"
137
+ approvers: [head_office]
138
+ label: {id: Persetujuan kantor pusat untuk diskon di atas 20%, en: Head office approves a discount above 20%}
139
+ stock:
140
+ date: date
141
+ moves:
142
+ - {lines: items, out: outlet, explode: recipe, reason: sale, cogs: cogs}
143
+ cogs_total: cogs_total
144
+ rules:
145
+ # the receipt number carries the outlet code (STRK-<code>-...); head office could have emptied it since the shift
146
+ # opened: say so when saving, not only at payment (kernel 409 numbering)
147
+ - name: outlet_has_code
148
+ on: save
149
+ check: outlet.code != ''
150
+ message: {id: 'Outlet ini belum punya Kode; minta kantor pusat mengisi Kode outlet (dipakai di nomor struk)'}
151
+ - name: outlet_of_shift
152
+ on: save
153
+ check: outlet == shift.outlet
154
+ message: {id: 'Outlet transaksi harus sama dengan outlet sesi kasirnya'}
155
+ - name: shift_open
156
+ on: save
157
+ check: shift.state == 'open'
158
+ message: {id: 'Sesi kasir ini sudah ditutup; buka sesi baru'}
159
+ - name: own_shift
160
+ on: save
161
+ check: "shift.cashier == user.email || 'head_office' in user.roles || 'owner' in user.roles"
162
+ message: {id: 'Ini sesi kasir orang lain; pakai sesi kasirmu sendiri'}
163
+ # Jalur A or Jalur B per outlet: with outlet_sales installed, only an outlet whose sales source is the cashier.
164
+ - name: outlet_uses_cashier
165
+ on: save
166
+ check: "!app_installed('outlet_sales') || (outlet.moka_name == '' && outlet.sales_source == 'kasir')"
167
+ message: {id: 'Outlet ini mencatat penjualan lewat Moka, file POS atau formulir harian. Ubah Sumber penjualan outlet ke Kasir Juragan dulu'}
168
+ - name: qty_positive
169
+ on: save
170
+ check: "items.map(l, l.qty <= 0 ? 1 : 0).sum() == 0"
171
+ message: {id: Jumlah barang harus lebih dari 0}
172
+ - name: line_discount_range
173
+ on: save
174
+ check: "items.map(l, l.discount_pct < 0 || l.discount_pct > 100 ? 1 : 0).sum() == 0"
175
+ message: {id: Diskon barang harus 0 sampai 100 persen}
176
+ - name: unit_of_item
177
+ on: save
178
+ check: "items.map(l, l.packing_item != l.item ? 1 : 0).sum() == 0"
179
+ message: {id: 'Satuan yang dipilih bukan satuan barang itu'}
180
+ - name: priced
181
+ on: save
182
+ check: "items.map(l, l.rate <= 0 ? 1 : 0).sum() == 0"
183
+ message: {id: 'Ada barang tanpa harga jual; isi Harga jual di data barang'}
184
+ - name: receipt_discount_range
185
+ on: save
186
+ check: discount_amount >= 0 && discount_amount <= subtotal
187
+ message: {id: Diskon nota tidak boleh negatif atau melebihi subtotal}
188
+ - name: payment_positive
189
+ on: save
190
+ check: "payments.map(p, p.amount <= 0 ? 1 : 0).sum() == 0"
191
+ message: {id: Jumlah pembayaran harus lebih dari 0}
192
+ - name: qris_not_over
193
+ on: save
194
+ check: qris_amount <= grand_total
195
+ message: {id: 'QRIS tidak boleh melebihi total; kembalian hanya dari uang tunai'}
196
+ - name: paid_enough
197
+ on: save
198
+ check: change_amount >= 0
199
+ message: {id: 'Pembayaran kurang dari total'}
200
+ - name: paid_today
201
+ on: submit
202
+ check: date == today()
203
+ message: {id: 'Draf ini dari hari lain; buat transaksi baru untuk hari ini'}
204
+ views:
205
+ list:
206
+ columns: [name, date, outlet, grand_total, method, status, buyer]
207
+ filters: [outlet, method, shift]
208
+ sort: -name
209
+ form:
210
+ layout:
211
+ - section: {id: Transaksi}
212
+ columns:
213
+ - [shift, outlet, date]
214
+ - [buyer]
215
+ - section: {id: Barang}
216
+ fields: [items]
217
+ - section: {id: Bayar}
218
+ columns:
219
+ - [subtotal, discount_amount, grand_total]
220
+ - [cash_received, qris_amount, change_amount]
221
+ - section: {id: Pembayaran}
222
+ fields: [payments]
223
+ - section: {id: Ringkasan}
224
+ columns:
225
+ - [gross_total, discount_total, cogs_total, margin]
226
+ - [ppn_in_sales, pph_final]
@@ -0,0 +1,46 @@
1
+ # yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/model.json
2
+ # A line of a cashier sale. The unit is the item's stock unit, or another unit of the item (packing, a
3
+ # uom_conversion: a dus of 24, a pack of 10); stock moves stock_qty (contract 0022 §1). The price per unit is the
4
+ # item's price, or the unit's own price when it has one (a dus can be cheaper than 24 bottles), else the item's price
5
+ # times the unit's factor. It is computed, so a cashier cannot type another price; the discount is in percent.
6
+ name: pos_sale_item
7
+ is_child: true
8
+ fields:
9
+ - {name: item, type: link, to: item, label: {id: Barang atau menu}, required: true, peek: [rate, stock_uom]}
10
+ # the item's category when the line was saved: the kitchen routes a paid line by it (module kitchen) without reading
11
+ # the whole catalogue during the payment
12
+ - {name: category, type: link, to: item_category, label: {id: Kategori}, hidden: true, compute: item.category}
13
+ - {name: description, type: text, label: {id: Uraian}, default: item.item_name}
14
+ - name: packing
15
+ type: link
16
+ to: uom_conversion
17
+ label: {id: Satuan lain}
18
+ help: {id: 'Kosongkan untuk satuan stok barang. Pilih misalnya Dus isi 24'}
19
+ # the item of the unit picked (rule unit_of_item: a unit of this line's item)
20
+ - {name: packing_item, type: link, to: item, label: {id: Barang satuan}, hidden: true, compute: "packing != '' ? packing.item : item"}
21
+ - name: uom
22
+ type: link
23
+ to: uom
24
+ label: {id: Satuan}
25
+ compute: "packing != '' ? packing.uom : item.stock_uom"
26
+ - {name: qty, type: float, label: {id: Qty}, default: '1', required: true}
27
+ - name: stock_qty
28
+ type: float
29
+ label: {id: Qty satuan stok}
30
+ compute: "packing == '' ? qty : qty * packing.factor"
31
+ stock: true
32
+ - name: rate
33
+ type: currency
34
+ label: {id: Harga satuan}
35
+ compute: "packing == '' ? item.rate : (packing.rate > 0 ? packing.rate : round(item.rate * packing.factor))"
36
+ - name: gross
37
+ type: currency
38
+ label: {id: Harga}
39
+ compute: round(qty * rate)
40
+ - {name: discount_pct, type: float, label: {id: 'Diskon %'}, default: '0'}
41
+ - name: amount
42
+ type: currency
43
+ label: {id: Jumlah}
44
+ compute: round(qty * rate * (100 - discount_pct) / 100)
45
+ - {name: note, type: data, label: {id: Catatan}, help: {id: 'Misalnya kurang manis, tanpa es'}}
46
+ - {name: cogs, type: currency, label: {id: Harga pokok}, read_only: true, hidden_for: [cashier, outlet_staff]}
@@ -0,0 +1,92 @@
1
+ # yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/model.json
2
+ # Sesi kasir: one cashier's drawer at one outlet, from opening to closing. Creating it opens the shift with the float
3
+ # (opening_cash) and gives it its number at once (SESI-<outlet code>-<YYMM>-<n>): the sales link it by that name, so
4
+ # it is not a submittable document (a draft's DRAFT- name would be renamed at submit and the links would point at
5
+ # nothing). Closing is a document of its own, Tutup sesi (pos_shift_close). While the shift is open, every sale paid or
6
+ # voided on it updates its totals (flows pos_sale_on_submit / pos_sale_on_cancel); state and the totals are read_only,
7
+ # so only the flows write them. Those flows and the close read pos_shift under the flow read lock of contract 0025,
8
+ # so the sales of a shift are counted one after the other, and a sale after the close is refused.
9
+ name: pos_shift
10
+ label: {id: Sesi kasir, en: Cashier shift}
11
+ icon: wallet
12
+ naming: SESI-{outlet.code}-{YY}{MM}-{####}
13
+ title_field: outlet
14
+ permissions:
15
+ - {role: head_office, read: true, create: true, write: true, export: true, print: true}
16
+ - {role: cashier, read: true, create: true, write: true, print: true}
17
+ fields:
18
+ - {name: outlet, type: link, to: outlet, label: {id: Outlet}, required: true, in_list: true}
19
+ - name: opening_date
20
+ type: date
21
+ label: {id: Tanggal buka}
22
+ default: today()
23
+ read_only: true
24
+ in_list: true
25
+ # the person who opened the shift (their sign-in email); set once, from the session
26
+ - name: cashier
27
+ type: data
28
+ label: {id: Kasir}
29
+ default: user.email
30
+ read_only: true
31
+ in_list: true
32
+ - name: opening_cash
33
+ type: currency
34
+ label: {id: Modal kas}
35
+ help: {id: 'Uang tunai di laci saat sesi dibuka (uang kembalian)'}
36
+ required: true
37
+ - name: state
38
+ type: select
39
+ label: {id: Status sesi}
40
+ default: "'open'"
41
+ read_only: true
42
+ in_list: true
43
+ chip: true
44
+ options:
45
+ - {value: open, label: {id: Buka}}
46
+ - {value: closed, label: {id: Tutup}}
47
+ - {name: sales_count, type: int, label: {id: Jumlah transaksi}, read_only: true, in_list: true}
48
+ - {name: gross_total, type: currency, label: {id: Penjualan kotor}, read_only: true, hidden_for: [cashier]}
49
+ - {name: discount_total, type: currency, label: {id: Diskon}, read_only: true, hidden_for: [cashier]}
50
+ - {name: net_total, type: currency, label: {id: Penjualan bersih}, read_only: true, in_list: true, hidden_for: [cashier]}
51
+ # blind count (contract 0027 hidden_for): the cashier counts the drawer without seeing what should be in it
52
+ - {name: cash_total, type: currency, label: {id: Tunai masuk}, help: {id: 'Dibayar tunai setelah kembalian, dikurangi tunai transaksi yang dibatalkan'}, read_only: true, hidden_for: [cashier]}
53
+ - {name: qris_total, type: currency, label: {id: QRIS masuk}, read_only: true, hidden_for: [cashier]}
54
+ - {name: void_count, type: int, label: {id: Transaksi dibatalkan}, read_only: true}
55
+ - {name: void_total, type: currency, label: {id: Nilai dibatalkan}, read_only: true, hidden_for: [cashier]}
56
+ - {name: cogs_total, type: currency, label: {id: Harga pokok}, read_only: true, hidden_for: [cashier]}
57
+ - name: expected_cash
58
+ type: currency
59
+ label: {id: Tunai seharusnya}
60
+ help: {id: 'Modal kas ditambah tunai masuk'}
61
+ compute: opening_cash + cash_total
62
+ hidden_for: [cashier]
63
+ # copied from the Tutup sesi that closed the shift
64
+ - {name: closed_by, type: link, to: pos_shift_close, label: {id: Ditutup dengan}, read_only: true}
65
+ - {name: counted_cash, type: currency, label: {id: Hitung fisik}, read_only: true}
66
+ - {name: cash_difference, type: currency, label: {id: Selisih kas}, read_only: true, in_list: true, hidden_for: [cashier]}
67
+ # The outlet's float is checked when the shift opens (flow pos_shift_on_create), not as a save rule: a save rule runs
68
+ # on every update the sales' flows make, so head office changing the outlet would stop an open shift. An outlet
69
+ # without a code cannot open one (its number, SESI-<code>-..., is refused: 409 numbering).
70
+ rules:
71
+ - name: float_not_negative
72
+ on: save
73
+ check: opening_cash >= 0
74
+ message: {id: Modal kas tidak boleh negatif}
75
+ views:
76
+ list:
77
+ columns: [name, outlet, opening_date, state, net_total, cash_difference, cashier, sales_count]
78
+ filters: [outlet, state]
79
+ sort: -name
80
+ form:
81
+ layout:
82
+ - section: {id: Sesi}
83
+ columns:
84
+ - [outlet, opening_date, cashier]
85
+ - [opening_cash, state, closed_by]
86
+ - section: {id: Penjualan sesi ini}
87
+ columns:
88
+ - [sales_count, gross_total, discount_total, net_total]
89
+ - [cash_total, qris_total, void_count, void_total]
90
+ - section: {id: Laci}
91
+ columns:
92
+ - [expected_cash, counted_cash, cash_difference]
@@ -0,0 +1,77 @@
1
+ # yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/model.json
2
+ # Tutup sesi: the cashier counts the drawer and closes the shift, blind: the cash that should be there and the
3
+ # difference are hidden from the cashier (contract 0027) and shown to head office (dashboard kasir_ringkas). The figures of the shift are read from it (computed
4
+ # from the link while this is a draft, frozen at submit); the counted cash against the cash that should be there is
5
+ # the difference, journalled as selisih kas (gl_pos_shift_close_post). Submitting it closes the shift (flow
6
+ # pos_shift_close_on_submit, under the read lock of contract 0025): a shift already closed, or one that took a sale
7
+ # after these figures were read, refuses the close, and the cashier saves it again to read the new figures.
8
+ # Head office can cancel a close to reopen the shift (a miscount), and close it again with a new Tutup sesi.
9
+ name: pos_shift_close
10
+ label: {id: Tutup sesi kasir, en: Shift close}
11
+ icon: wallet
12
+ is_submittable: true
13
+ naming: TUTUP-{outlet.code}-{YY}{MM}-{####}
14
+ title_field: shift
15
+ permissions:
16
+ - {role: head_office, read: true, create: true, write: true, delete: true, submit: true, cancel: true, export: true, print: true}
17
+ - {role: cashier, read: true, create: true, write: true, delete: true, submit: true, print: true}
18
+ fields:
19
+ - {name: shift, type: link, to: pos_shift, label: {id: Sesi kasir}, required: true, in_list: true, peek: [opening_date, cashier, state]}
20
+ - {name: outlet, type: link, to: outlet, label: {id: Outlet}, default: shift.outlet, read_only: true, in_list: true}
21
+ - {name: close_date, type: date, label: {id: Tanggal tutup}, default: today(), read_only: true, in_list: true}
22
+ - {name: opening_cash, type: currency, label: {id: Modal kas}, compute: shift.opening_cash}
23
+ - {name: sales_count, type: int, label: {id: Jumlah transaksi}, compute: shift.sales_count}
24
+ - {name: net_total, type: currency, label: {id: Penjualan bersih}, compute: shift.net_total, in_list: true, hidden_for: [cashier]}
25
+ # blind count (contract 0027): what should be in the drawer and the difference are hidden from the cashier
26
+ - {name: cash_total, type: currency, label: {id: Tunai masuk}, compute: shift.cash_total, hidden_for: [cashier]}
27
+ - {name: qris_total, type: currency, label: {id: QRIS masuk}, compute: shift.qris_total, hidden_for: [cashier]}
28
+ - {name: void_count, type: int, label: {id: Transaksi dibatalkan}, compute: shift.void_count}
29
+ - name: expected_cash
30
+ type: currency
31
+ label: {id: Tunai seharusnya}
32
+ help: {id: 'Modal kas ditambah tunai masuk'}
33
+ compute: opening_cash + cash_total
34
+ hidden_for: [cashier]
35
+ - name: counted_cash
36
+ type: currency
37
+ label: {id: Hitung fisik}
38
+ help: {id: 'Semua uang tunai di laci, termasuk modal'}
39
+ required: true
40
+ - name: cash_difference
41
+ type: currency
42
+ label: {id: Selisih kas}
43
+ help: {id: 'Hitung fisik dikurangi tunai seharusnya. Minus berarti kas kurang'}
44
+ compute: counted_cash - expected_cash
45
+ in_list: true
46
+ hidden_for: [cashier]
47
+ - {name: closing_note, type: text, label: {id: Catatan}}
48
+ rules:
49
+ - name: shift_open
50
+ on: save
51
+ check: shift.state == 'open'
52
+ message: {id: 'Sesi kasir ini sudah ditutup'}
53
+ - name: own_shift
54
+ on: save
55
+ check: "shift.cashier == user.email || 'head_office' in user.roles || 'owner' in user.roles"
56
+ message: {id: 'Ini sesi kasir orang lain; tutup sesi kasirmu sendiri'}
57
+ - name: counted_not_negative
58
+ on: save
59
+ check: counted_cash >= 0
60
+ message: {id: Hitung fisik tidak boleh negatif}
61
+ views:
62
+ list:
63
+ columns: [name, outlet, close_date, net_total, cash_difference, status, shift]
64
+ filters: [outlet]
65
+ sort: -name
66
+ form:
67
+ layout:
68
+ - section: {id: Sesi}
69
+ columns:
70
+ - [shift, outlet, close_date]
71
+ - [opening_cash, sales_count, void_count]
72
+ - section: {id: Hitung laci}
73
+ columns:
74
+ - [net_total, cash_total, qris_total]
75
+ - [expected_cash, counted_cash, cash_difference]
76
+ - section: {id: Catatan}
77
+ fields: [closing_note]