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

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 (526) 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/stok_outlet/app.rk +34 -0
  50. package/template/base/apps/stok_outlet/dashboards/outlet_hari_ini.rk +33 -0
  51. package/template/base/apps/stok_outlet/dashboards/stok_ringkas.rk +50 -0
  52. package/template/base/connectors/biteship/connector.rk +246 -0
  53. package/template/base/connectors/biteship/fixtures/cancel_order.json +1 -0
  54. package/template/base/connectors/biteship/fixtures/create_order.json +8 -0
  55. package/template/base/connectors/biteship/fixtures/expect.json +9 -0
  56. package/template/base/connectors/biteship/fixtures/get_order.json +2 -0
  57. package/template/base/connectors/biteship/fixtures/get_rates.json +7 -0
  58. package/template/base/connectors/biteship/fixtures/get_tracking.json +7 -0
  59. package/template/base/connectors/biteship/fixtures/order_price.json +11 -0
  60. package/template/base/connectors/biteship/fixtures/order_status.json +15 -0
  61. package/template/base/connectors/biteship/fixtures/order_status_cancelled.json +15 -0
  62. package/template/base/connectors/biteship/fixtures/order_waybill.json +7 -0
  63. package/template/base/connectors/biteship/fixtures/search_areas.json +1 -0
  64. package/template/base/connectors/doku/connector.rk +128 -0
  65. package/template/base/connectors/doku/fixtures/create_checkout.json +6 -0
  66. package/template/base/connectors/doku/fixtures/expect.json +38 -0
  67. package/template/base/connectors/doku/fixtures/payment_notified.json +5 -0
  68. package/template/base/connectors/doku/fixtures/payment_notified_failed.json +3 -0
  69. package/template/base/connectors/doku/fixtures/payment_notified_no_type.json +3 -0
  70. package/template/base/connectors/doku/fixtures/payment_notified_null_type.json +3 -0
  71. package/template/base/connectors/doku/fixtures/payment_notified_refund.json +3 -0
  72. package/template/base/connectors/doku/mock/doku_mock.py +217 -0
  73. package/template/base/connectors/loyverse/connector.rk +98 -0
  74. package/template/base/connectors/moka/connector.rk +121 -0
  75. package/template/base/connectors/moka/fixtures/expect.json +44 -0
  76. package/template/base/connectors/moka/fixtures/latest_transactions.json +79 -0
  77. package/template/base/connectors/moka/fixtures/list_items.json +4 -0
  78. package/template/base/connectors/moka/fixtures/list_outlets.json +4 -0
  79. package/template/base/connectors/moka/fixtures/transaction_created.json +44 -0
  80. package/template/base/connectors/moka/fixtures/transaction_created_refund.json +39 -0
  81. package/template/base/connectors/moka/fixtures/transaction_created_refund_later.json +51 -0
  82. package/template/base/connectors/moka/mock/moka_mock.py +210 -0
  83. package/template/base/connectors/whatsapp_business/connector.rk +22 -1
  84. package/template/base/connectors/whatsapp_business/templates.md +32 -0
  85. package/template/base/connectors/xendit/connector.rk +184 -0
  86. package/template/base/connectors/xendit/mock/xendit_mock.py +231 -0
  87. package/template/base/modules/accounting/flows/financial_report_compute.rk +47 -0
  88. package/template/base/modules/accounting/flows/financial_report_recompute.rk +47 -0
  89. package/template/base/modules/accounting/flows/gl_cash_advance_post.rk +33 -0
  90. package/template/base/modules/accounting/flows/gl_cash_advance_reverse.rk +194 -0
  91. package/template/base/modules/accounting/flows/gl_delivery_note_post.rk +37 -0
  92. package/template/base/modules/accounting/flows/gl_delivery_note_reverse.rk +194 -0
  93. package/template/base/modules/accounting/flows/gl_goods_receipt_post.rk +41 -0
  94. package/template/base/modules/accounting/flows/gl_goods_receipt_reverse.rk +194 -0
  95. package/template/base/modules/accounting/flows/gl_opening_balance_post.rk +132 -0
  96. package/template/base/modules/accounting/flows/gl_opening_balance_reverse.rk +194 -0
  97. package/template/base/modules/accounting/flows/gl_outlet_return_post.rk +38 -0
  98. package/template/base/modules/accounting/flows/gl_outlet_return_reverse.rk +194 -0
  99. package/template/base/modules/accounting/flows/gl_outlet_sales_post.rk +95 -0
  100. package/template/base/modules/accounting/flows/gl_outlet_sales_reverse.rk +194 -0
  101. package/template/base/modules/accounting/flows/gl_outlet_takings_post.rk +71 -0
  102. package/template/base/modules/accounting/flows/gl_outlet_takings_reverse.rk +194 -0
  103. package/template/base/modules/accounting/flows/gl_payment_post.rk +63 -0
  104. package/template/base/modules/accounting/flows/gl_payment_reverse.rk +194 -0
  105. package/template/base/modules/accounting/flows/gl_payroll_close_post.rk +89 -0
  106. package/template/base/modules/accounting/flows/gl_payroll_close_reverse.rk +194 -0
  107. package/template/base/modules/accounting/flows/gl_pos_sale_post.rk +95 -0
  108. package/template/base/modules/accounting/flows/gl_pos_sale_reverse.rk +194 -0
  109. package/template/base/modules/accounting/flows/gl_pos_shift_close_post.rk +59 -0
  110. package/template/base/modules/accounting/flows/gl_pos_shift_close_reverse.rk +194 -0
  111. package/template/base/modules/accounting/flows/gl_production_batch_post.rk +62 -0
  112. package/template/base/modules/accounting/flows/gl_production_batch_reverse.rk +194 -0
  113. package/template/base/modules/accounting/flows/gl_project_expense_post.rk +64 -0
  114. package/template/base/modules/accounting/flows/gl_project_expense_reverse.rk +194 -0
  115. package/template/base/modules/accounting/flows/gl_rental_booking_post.rk +35 -0
  116. package/template/base/modules/accounting/flows/gl_rental_booking_reverse.rk +194 -0
  117. package/template/base/modules/accounting/flows/gl_rental_return_post.rk +47 -0
  118. package/template/base/modules/accounting/flows/gl_rental_return_reverse.rk +194 -0
  119. package/template/base/modules/accounting/flows/gl_sales_invoice_post.rk +95 -0
  120. package/template/base/modules/accounting/flows/gl_sales_invoice_reverse.rk +194 -0
  121. package/template/base/modules/accounting/flows/gl_sales_return_post.rk +40 -0
  122. package/template/base/modules/accounting/flows/gl_sales_return_reverse.rk +194 -0
  123. package/template/base/modules/accounting/flows/gl_stock_adjustment_post.rk +38 -0
  124. package/template/base/modules/accounting/flows/gl_stock_adjustment_reverse.rk +194 -0
  125. package/template/base/modules/accounting/flows/gl_stock_count_post.rk +38 -0
  126. package/template/base/modules/accounting/flows/gl_stock_count_reverse.rk +194 -0
  127. package/template/base/modules/accounting/flows/gl_stock_transfer_post.rk +38 -0
  128. package/template/base/modules/accounting/flows/gl_stock_transfer_receipt_post.rk +38 -0
  129. package/template/base/modules/accounting/flows/gl_stock_transfer_receipt_reverse.rk +194 -0
  130. package/template/base/modules/accounting/flows/gl_stock_transfer_reverse.rk +194 -0
  131. package/template/base/modules/accounting/flows/gl_timesheet_post.rk +35 -0
  132. package/template/base/modules/accounting/flows/gl_timesheet_reverse.rk +194 -0
  133. package/template/base/modules/accounting/flows/gl_vendor_bill_post.rk +63 -0
  134. package/template/base/modules/accounting/flows/gl_vendor_bill_reverse.rk +194 -0
  135. package/template/base/modules/accounting/imports/opening_balance_sheet.rk +22 -0
  136. package/template/base/modules/accounting/models/financial_report.rk +85 -0
  137. package/template/base/modules/accounting/models/gl_entry.rk +164 -0
  138. package/template/base/modules/accounting/models/opening_balance.rk +48 -0
  139. package/template/base/modules/accounting/models/period_close.rk +33 -0
  140. package/template/base/modules/accounting/module.rk +16 -0
  141. package/template/base/modules/bank_statement/flows/bank_transaction_booked.rk +12 -0
  142. package/template/base/modules/bank_statement/flows/bank_transaction_booked_released.rk +11 -0
  143. package/template/base/modules/bank_statement/flows/bank_transaction_claim.rk +29 -0
  144. package/template/base/modules/bank_statement/flows/bank_transaction_confirm.rk +61 -0
  145. package/template/base/modules/bank_statement/flows/bank_transaction_link_locked.rk +11 -0
  146. package/template/base/modules/bank_statement/flows/bank_transaction_matched.rk +13 -0
  147. package/template/base/modules/bank_statement/flows/bank_transaction_release.rk +11 -0
  148. package/template/base/modules/bank_statement/flows/bank_transaction_suggest.rk +73 -0
  149. package/template/base/modules/bank_statement/flows/bank_transaction_unmatched.rk +11 -0
  150. package/template/base/modules/bank_statement/imports/bank_statement_csv.rk +25 -0
  151. package/template/base/modules/bank_statement/models/bank_transaction.rk +147 -0
  152. package/template/base/modules/bank_statement/models/bank_transaction_claim.rk +49 -0
  153. package/template/base/modules/bank_statement/module.rk +12 -0
  154. package/template/base/modules/catalogue/imports/item_list.rk +20 -0
  155. package/template/base/modules/catalogue/imports/item_master.rk +25 -0
  156. package/template/base/modules/catalogue/models/item.rk +81 -1
  157. package/template/base/modules/catalogue/models/item_category.rk +29 -0
  158. package/template/base/modules/catalogue/models/uom.rk +14 -0
  159. package/template/base/modules/catalogue/models/uom_conversion.rk +8 -0
  160. package/template/base/modules/catalogue/module.rk +8 -2
  161. package/template/base/modules/consignment/flows/consignment_bill.rk +39 -0
  162. package/template/base/modules/consignment/flows/consignment_bill_cancelled.rk +14 -0
  163. package/template/base/modules/consignment/models/consignment_settlement.rk +111 -0
  164. package/template/base/modules/consignment/models/consignment_settlement_item.rk +37 -0
  165. package/template/base/modules/consignment/module.rk +15 -0
  166. package/template/base/modules/contacts/imports/customer_list.rk +17 -0
  167. package/template/base/modules/contacts/imports/vendor_list.rk +16 -0
  168. package/template/base/modules/contacts/models/credit_guard.rk +40 -0
  169. package/template/base/modules/contacts/models/customer.rk +144 -2
  170. package/template/base/modules/contacts/models/vendor.rk +51 -2
  171. package/template/base/modules/contacts/module.rk +6 -1
  172. package/template/base/modules/coretax/models/tax_period.rk +89 -0
  173. package/template/base/modules/coretax/module.rk +13 -0
  174. package/template/base/modules/coretax/print/coretax_bupot.rk +31 -0
  175. package/template/base/modules/coretax/print/coretax_bupot.xml +28 -0
  176. package/template/base/modules/coretax/print/coretax_faktur.rk +44 -0
  177. package/template/base/modules/coretax/print/coretax_faktur.xml +74 -0
  178. package/template/base/modules/courses/flows/charge_cancel_guard.rk +23 -0
  179. package/template/base/modules/courses/flows/charge_invoice_on_submit.rk +58 -0
  180. package/template/base/modules/courses/flows/enrollment_seats_on_create.rk +15 -0
  181. package/template/base/modules/courses/flows/enrollment_seats_on_update.rk +35 -0
  182. package/template/base/modules/courses/flows/invoice_course_once.rk +22 -0
  183. package/template/base/modules/courses/flows/invoice_course_tag_lock.rk +16 -0
  184. package/template/base/modules/courses/flows/session_attendance_checked.rk +14 -0
  185. package/template/base/modules/courses/flows/session_fill_attendance.rk +16 -0
  186. package/template/base/modules/courses/flows/session_of_the_day.rk +34 -0
  187. package/template/base/modules/courses/flows/student_billing_on_create.rk +25 -0
  188. package/template/base/modules/courses/models/course_attendance.rk +24 -0
  189. package/template/base/modules/courses/models/course_batch.rk +119 -0
  190. package/template/base/modules/courses/models/course_batch_slot.rk +18 -0
  191. package/template/base/modules/courses/models/course_charge.rk +125 -0
  192. package/template/base/modules/courses/models/course_guard.rk +50 -0
  193. package/template/base/modules/courses/models/course_program.rk +101 -0
  194. package/template/base/modules/courses/models/course_session.rk +94 -0
  195. package/template/base/modules/courses/models/enrollment.rk +136 -0
  196. package/template/base/modules/courses/models/student.rk +68 -0
  197. package/template/base/modules/courses/module.rk +14 -0
  198. package/template/base/modules/courses/roles/instructor.rk +7 -0
  199. package/template/base/modules/courses/screens/absen_kelas.rk +17 -0
  200. package/template/base/modules/currency/module.rk +5 -0
  201. package/template/base/modules/delivery/flows/delivery_cancel_guard.rk +18 -0
  202. package/template/base/modules/delivery/flows/fulfilment_on_delivery_cancelled.rk +21 -0
  203. package/template/base/modules/delivery/flows/fulfilment_on_delivery_submitted.rk +28 -0
  204. package/template/base/modules/delivery/flows/fulfilment_on_invoice_cancelled.rk +22 -0
  205. package/template/base/modules/delivery/flows/fulfilment_on_invoice_submitted.rk +22 -0
  206. package/template/base/modules/delivery/flows/fulfilment_on_order_created.rk +18 -0
  207. package/template/base/modules/delivery/flows/fulfilment_on_order_submitted.rk +16 -0
  208. package/template/base/modules/delivery/flows/fulfilment_on_order_updated.rk +19 -0
  209. package/template/base/modules/delivery/flows/fulfilment_on_return_cancelled.rk +16 -0
  210. package/template/base/modules/delivery/flows/fulfilment_on_return_submitted.rk +16 -0
  211. package/template/base/modules/delivery/flows/invoice_qty_from_deliveries.rk +20 -0
  212. package/template/base/modules/delivery/flows/order_cancel_guard.rk +10 -0
  213. package/template/base/modules/delivery/flows/return_cancel_guard.rk +11 -0
  214. package/template/base/modules/delivery/flows/return_credit_on_payment_cancelled.rk +11 -0
  215. package/template/base/modules/delivery/flows/return_credit_on_payment_submitted.rk +21 -0
  216. package/template/base/modules/delivery/flows/return_credit_on_return_cancelled.rk +11 -0
  217. package/template/base/modules/delivery/flows/return_credit_on_return_submitted.rk +10 -0
  218. package/template/base/modules/delivery/models/delivery_guard.rk +48 -0
  219. package/template/base/modules/delivery/models/delivery_note.rk +101 -0
  220. package/template/base/modules/delivery/models/delivery_note_item.rk +11 -0
  221. package/template/base/modules/delivery/models/order_fulfilment.rk +27 -0
  222. package/template/base/modules/delivery/models/order_fulfilment_item.rk +10 -0
  223. package/template/base/modules/delivery/models/return_credit.rk +23 -0
  224. package/template/base/modules/delivery/models/sales_return.rk +87 -0
  225. package/template/base/modules/delivery/models/sales_return_item.rk +16 -0
  226. package/template/base/modules/delivery/module.rk +16 -0
  227. package/template/base/modules/delivery/print/delivery_note.html +96 -0
  228. package/template/base/modules/delivery/print/delivery_note.rk +9 -0
  229. package/template/base/modules/distribution/flows/credit_on_invoice_cancelled.rk +17 -0
  230. package/template/base/modules/distribution/flows/credit_on_invoice_submitted.rk +17 -0
  231. package/template/base/modules/distribution/flows/credit_on_order_cancelled.rk +17 -0
  232. package/template/base/modules/distribution/flows/credit_on_order_submitted.rk +25 -0
  233. package/template/base/modules/distribution/flows/credit_on_payment_cancelled.rk +17 -0
  234. package/template/base/modules/distribution/flows/credit_on_payment_submitted.rk +17 -0
  235. package/template/base/modules/distribution/flows/giro_bounced.rk +20 -0
  236. package/template/base/modules/distribution/flows/giro_from_payment.rk +21 -0
  237. package/template/base/modules/distribution/flows/order_tier_pricing_created.rk +17 -0
  238. package/template/base/modules/distribution/flows/order_tier_pricing_updated.rk +17 -0
  239. package/template/base/modules/distribution/models/giro.rk +79 -0
  240. package/template/base/modules/distribution/module.rk +14 -0
  241. package/template/base/modules/invoicing/flows/invoice_due_digest.rk +12 -0
  242. package/template/base/modules/invoicing/flows/milestone_invoiced.rk +23 -0
  243. package/template/base/modules/invoicing/flows/milestone_reopened.rk +19 -0
  244. package/template/base/modules/invoicing/flows/payment_instruction_on_submit.rk +25 -0
  245. package/template/base/modules/invoicing/flows/project_billed_on_cancel.rk +16 -0
  246. package/template/base/modules/invoicing/flows/project_billed_on_submit.rk +16 -0
  247. package/template/base/modules/invoicing/flows/project_revenue_on_cancel.rk +22 -0
  248. package/template/base/modules/invoicing/flows/project_revenue_on_submit.rk +17 -0
  249. package/template/base/modules/invoicing/flows/sales_invoice_credit_recheck.rk +18 -0
  250. package/template/base/modules/invoicing/models/bank_account.rk +134 -0
  251. package/template/base/modules/invoicing/models/invoice_reminder.rk +83 -0
  252. package/template/base/modules/invoicing/models/payment_instruction.rk +72 -0
  253. package/template/base/modules/invoicing/models/sales_invoice.rk +324 -13
  254. package/template/base/modules/invoicing/models/sales_invoice_item.rk +23 -0
  255. package/template/base/modules/invoicing/module.rk +7 -2
  256. package/template/base/modules/invoicing/print/sales_invoice.html +145 -32
  257. package/template/base/modules/invoicing/print/sales_invoice.rk +7 -0
  258. package/template/base/modules/invoicing/print/sales_invoice_nota.html +71 -0
  259. package/template/base/modules/invoicing/print/sales_invoice_nota.rk +13 -0
  260. package/template/base/modules/invoicing/print/sales_invoice_whatsapp.html +45 -0
  261. package/template/base/modules/invoicing/print/sales_invoice_whatsapp.rk +15 -0
  262. package/template/base/modules/kitchen/flows/kitchen_ticket_on_sale.rk +47 -0
  263. package/template/base/modules/kitchen/flows/kitchen_ticket_on_update.rk +30 -0
  264. package/template/base/modules/kitchen/flows/kitchen_ticket_on_void.rk +23 -0
  265. package/template/base/modules/kitchen/models/kitchen_guard.rk +40 -0
  266. package/template/base/modules/kitchen/models/kitchen_route.rk +26 -0
  267. package/template/base/modules/kitchen/models/kitchen_station.rk +40 -0
  268. package/template/base/modules/kitchen/models/kitchen_ticket.rk +83 -0
  269. package/template/base/modules/kitchen/models/kitchen_ticket_item.rk +10 -0
  270. package/template/base/modules/kitchen/module.rk +18 -0
  271. package/template/base/modules/kitchen/print/kitchen_ticket.html +29 -0
  272. package/template/base/modules/kitchen/print/kitchen_ticket.rk +9 -0
  273. package/template/base/modules/kitchen/roles/kitchen.rk +6 -0
  274. package/template/base/modules/kitchen/screens/dapur.rk +22 -0
  275. package/template/base/modules/orders/models/customer_order.rk +90 -2
  276. package/template/base/modules/orders/models/customer_order_item.rk +29 -0
  277. package/template/base/modules/orders/module.rk +7 -2
  278. package/template/base/modules/outlet_sales/flows/moka_api_opened.rk +30 -0
  279. package/template/base/modules/outlet_sales/flows/moka_daily_sales.rk +78 -0
  280. package/template/base/modules/outlet_sales/flows/moka_held_release.rk +35 -0
  281. package/template/base/modules/outlet_sales/flows/moka_legacy_key_overlap.rk +22 -0
  282. package/template/base/modules/outlet_sales/flows/moka_line_mapped.rk +38 -0
  283. package/template/base/modules/outlet_sales/flows/moka_transaction_refused.rk +15 -0
  284. package/template/base/modules/outlet_sales/flows/moka_transaction_staged.rk +171 -0
  285. package/template/base/modules/outlet_sales/flows/outlet_day_backfill_harian.rk +71 -0
  286. package/template/base/modules/outlet_sales/flows/outlet_day_free_sales.rk +19 -0
  287. package/template/base/modules/outlet_sales/flows/outlet_day_free_takings.rk +19 -0
  288. package/template/base/modules/outlet_sales/flows/outlet_day_on_sales.rk +19 -0
  289. package/template/base/modules/outlet_sales/flows/outlet_day_on_takings.rk +19 -0
  290. package/template/base/modules/outlet_sales/flows/refund_on_return_cancelled.rk +15 -0
  291. package/template/base/modules/outlet_sales/flows/refund_on_return_submitted.rk +26 -0
  292. package/template/base/modules/outlet_sales/flows/refund_on_sales_submitted.rk +14 -0
  293. package/template/base/modules/outlet_sales/flows/sales_cancel_guard.rk +18 -0
  294. package/template/base/modules/outlet_sales/imports/daily_form.rk +3 -1
  295. package/template/base/modules/outlet_sales/imports/loyverse_receipts.rk +28 -0
  296. package/template/base/modules/outlet_sales/imports/moka_item_details.rk +14 -4
  297. package/template/base/modules/outlet_sales/imports/pos_sales_file.rk +28 -0
  298. package/template/base/modules/outlet_sales/imports/takings_file.rk +23 -0
  299. package/template/base/modules/outlet_sales/models/moka_sale_line.rk +66 -0
  300. package/template/base/modules/outlet_sales/models/moka_transaction.rk +26 -0
  301. package/template/base/modules/outlet_sales/models/outlet_return.rk +66 -0
  302. package/template/base/modules/outlet_sales/models/outlet_return_item.rk +7 -0
  303. package/template/base/modules/outlet_sales/models/outlet_sales.rk +79 -7
  304. package/template/base/modules/outlet_sales/models/outlet_sales_guard.rk +40 -0
  305. package/template/base/modules/outlet_sales/models/outlet_sales_line.rk +2 -0
  306. package/template/base/modules/outlet_sales/models/outlet_takings.rk +85 -0
  307. package/template/base/modules/outlet_sales/models/outlet_takings_line.rk +37 -0
  308. package/template/base/modules/outlet_sales/models/pos_refund.rk +36 -0
  309. package/template/base/modules/outlet_sales/models/pos_refund_item.rk +9 -0
  310. package/template/base/modules/outlet_sales/module.rk +7 -2
  311. package/template/base/modules/outlets/models/outlet.rk +57 -0
  312. package/template/base/modules/outlets/models/outlet_day.rk +30 -0
  313. package/template/base/modules/outlets/models/outlet_day_backfill.rk +25 -0
  314. package/template/base/modules/outlets/module.rk +7 -2
  315. package/template/base/modules/payments/flows/payment_from_doku.rk +73 -0
  316. package/template/base/modules/payments/flows/payment_from_xendit_invoice.rk +59 -0
  317. package/template/base/modules/payments/flows/payment_from_xendit_qr.rk +59 -0
  318. package/template/base/modules/payments/flows/payment_from_xendit_va.rk +59 -0
  319. package/template/base/modules/payments/flows/payment_gateway_claim_created.rk +19 -0
  320. package/template/base/modules/payments/flows/payment_gateway_claim_submitted.rk +19 -0
  321. package/template/base/modules/payments/flows/payment_gateway_release.rk +12 -0
  322. package/template/base/modules/payments/flows/payment_refund_from_doku.rk +14 -0
  323. package/template/base/modules/payments/models/gateway_ref_claim.rk +42 -0
  324. package/template/base/modules/payments/models/payment.rk +62 -1
  325. package/template/base/modules/payments/models/withholding.rk +16 -2
  326. package/template/base/modules/payments/module.rk +7 -2
  327. package/template/base/modules/payments/print/statement.html +1 -1
  328. package/template/base/modules/payroll/flows/cash_advance_cancel_guard.rk +15 -0
  329. package/template/base/modules/payroll/flows/invoice_payroll_once.rk +20 -0
  330. package/template/base/modules/payroll/flows/invoice_payroll_tag_lock.rk +13 -0
  331. package/template/base/modules/payroll/flows/payroll_close_on_cancel.rk +35 -0
  332. package/template/base/modules/payroll/flows/payroll_close_on_submit.rk +66 -0
  333. package/template/base/modules/payroll/flows/payroll_run_overlap_guard_created.rk +14 -0
  334. package/template/base/modules/payroll/flows/payroll_run_overlap_guard_updated.rk +14 -0
  335. package/template/base/modules/payroll/flows/payroll_totals_on_payslip_cancel.rk +29 -0
  336. package/template/base/modules/payroll/flows/payroll_totals_on_payslip_submit.rk +29 -0
  337. package/template/base/modules/payroll/flows/payslip_advance_guard.rk +23 -0
  338. package/template/base/modules/payroll/flows/payslip_cancel_guard.rk +14 -0
  339. package/template/base/modules/payroll/flows/payslip_casual_guard.rk +19 -0
  340. package/template/base/modules/payroll/flows/payslip_from_recap.rk +76 -0
  341. package/template/base/modules/payroll/flows/payslip_month_guard_created.rk +16 -0
  342. package/template/base/modules/payroll/flows/payslip_month_guard_submitted.rk +16 -0
  343. package/template/base/modules/payroll/flows/payslip_order_guard_cancelled.rk +15 -0
  344. package/template/base/modules/payroll/flows/payslip_order_guard_submitted.rk +15 -0
  345. package/template/base/modules/payroll/flows/payslip_pay_overlap_guard.rk +15 -0
  346. package/template/base/modules/payroll/flows/payslip_ytd_guard.rk +35 -0
  347. package/template/base/modules/payroll/flows/payslip_ytd_on_create.rk +49 -0
  348. package/template/base/modules/payroll/flows/recap_cancel_guard.rk +15 -0
  349. package/template/base/modules/payroll/models/cash_advance.rk +53 -0
  350. package/template/base/modules/payroll/models/payroll_close.rk +80 -0
  351. package/template/base/modules/payroll/models/payroll_guard.rk +89 -0
  352. package/template/base/modules/payroll/models/payroll_profile.rk +146 -0
  353. package/template/base/modules/payroll/models/payroll_run.rk +220 -0
  354. package/template/base/modules/payroll/models/payslip.rk +370 -0
  355. package/template/base/modules/payroll/module.rk +13 -0
  356. package/template/base/modules/payroll/print/payslip.html +54 -0
  357. package/template/base/modules/payroll/print/payslip.rk +7 -0
  358. package/template/base/modules/pipeline/module.rk +5 -0
  359. package/template/base/modules/pos/flows/outlet_day_backfill_kasir.rk +61 -0
  360. package/template/base/modules/pos/flows/pos_daily_form_guard.rk +18 -0
  361. package/template/base/modules/pos/flows/pos_sale_on_cancel.rk +42 -0
  362. package/template/base/modules/pos/flows/pos_sale_on_submit.rk +60 -0
  363. package/template/base/modules/pos/flows/pos_shift_close_on_cancel.rk +26 -0
  364. package/template/base/modules/pos/flows/pos_shift_close_on_submit.rk +23 -0
  365. package/template/base/modules/pos/flows/pos_shift_on_create.rk +21 -0
  366. package/template/base/modules/pos/flows/pos_shift_on_update.rk +10 -0
  367. package/template/base/modules/pos/flows/pos_takings_guard.rk +28 -0
  368. package/template/base/modules/pos/models/pos_guard.rk +76 -0
  369. package/template/base/modules/pos/models/pos_payment.rk +17 -0
  370. package/template/base/modules/pos/models/pos_sale.rk +226 -0
  371. package/template/base/modules/pos/models/pos_sale_item.rk +46 -0
  372. package/template/base/modules/pos/models/pos_shift.rk +92 -0
  373. package/template/base/modules/pos/models/pos_shift_close.rk +77 -0
  374. package/template/base/modules/pos/module.rk +22 -0
  375. package/template/base/modules/pos/print/pos_receipt.html +50 -0
  376. package/template/base/modules/pos/print/pos_receipt.rk +9 -0
  377. package/template/base/modules/pos/screens/kasir.rk +41 -0
  378. package/template/base/modules/procurement/flows/project_vendor_cost_on_cancel.rk +22 -0
  379. package/template/base/modules/procurement/flows/project_vendor_cost_on_submit.rk +17 -0
  380. package/template/base/modules/procurement/imports/opening_stock.rk +25 -0
  381. package/template/base/modules/procurement/models/goods_receipt.rk +1 -1
  382. package/template/base/modules/procurement/models/purchase_order.rk +22 -8
  383. package/template/base/modules/procurement/models/purchase_request.rk +12 -1
  384. package/template/base/modules/procurement/models/purchase_request_item.rk +2 -0
  385. package/template/base/modules/procurement/models/vendor_bill.rk +117 -4
  386. package/template/base/modules/procurement/module.rk +7 -2
  387. package/template/base/modules/production/flows/batch_cancel_guard.rk +12 -0
  388. package/template/base/modules/production/flows/batch_from_bom.rk +19 -0
  389. package/template/base/modules/production/flows/wage_sheet_on_batch_cancelled.rk +14 -0
  390. package/template/base/modules/production/flows/wage_sheet_on_batch_submitted.rk +12 -0
  391. package/template/base/modules/production/flows/work_order_materials_created.rk +20 -0
  392. package/template/base/modules/production/flows/work_order_materials_updated.rk +20 -0
  393. package/template/base/modules/production/models/bom.rk +68 -0
  394. package/template/base/modules/production/models/bom_byproduct.rk +7 -0
  395. package/template/base/modules/production/models/bom_line.rk +11 -0
  396. package/template/base/modules/production/models/production_batch.rk +153 -0
  397. package/template/base/modules/production/models/production_guard.rk +23 -0
  398. package/template/base/modules/production/models/production_labour.rk +10 -0
  399. package/template/base/modules/production/models/production_material.rk +8 -0
  400. package/template/base/modules/production/models/production_output.rk +8 -0
  401. package/template/base/modules/production/models/production_stage.rk +19 -0
  402. package/template/base/modules/production/models/wage_line.rk +15 -0
  403. package/template/base/modules/production/models/wage_sheet.rk +28 -0
  404. package/template/base/modules/production/models/work_order.rk +63 -0
  405. package/template/base/modules/production/models/work_order_material.rk +8 -0
  406. package/template/base/modules/production/module.rk +17 -0
  407. package/template/base/modules/production/print/wage_sheet.html +75 -0
  408. package/template/base/modules/production/print/wage_sheet.rk +9 -0
  409. package/template/base/modules/projects/flows/attendance_close_cancel_guard.rk +15 -0
  410. package/template/base/modules/projects/flows/attendance_close_on_submit.rk +68 -0
  411. package/template/base/modules/projects/flows/attendance_log_cancel_guard.rk +14 -0
  412. package/template/base/modules/projects/flows/attendance_log_guard_created.rk +17 -0
  413. package/template/base/modules/projects/flows/attendance_log_guard_submitted.rk +38 -0
  414. package/template/base/modules/projects/flows/attendance_log_guard_updated.rk +15 -0
  415. package/template/base/modules/projects/flows/milestone_back_on_acceptance_cancel.rk +15 -0
  416. package/template/base/modules/projects/flows/milestone_lock_on_update.rk +16 -0
  417. package/template/base/modules/projects/flows/milestone_ready_on_acceptance.rk +40 -0
  418. package/template/base/modules/projects/flows/milestone_scheduled_on_create.rk +14 -0
  419. package/template/base/modules/projects/flows/milestone_scheduled_on_update.rk +27 -0
  420. package/template/base/modules/projects/flows/project_expense_on_cancel.rk +21 -0
  421. package/template/base/modules/projects/flows/project_expense_on_submit.rk +16 -0
  422. package/template/base/modules/projects/flows/project_labor_on_cancel.rk +22 -0
  423. package/template/base/modules/projects/flows/project_labor_on_submit.rk +17 -0
  424. package/template/base/modules/projects/flows/project_terms_lock.rk +26 -0
  425. package/template/base/modules/projects/flows/timesheet_assignment_on_create.rk +28 -0
  426. package/template/base/modules/projects/flows/timesheet_attendance_overlap_guard.rk +20 -0
  427. package/template/base/modules/projects/flows/vendor_bill_cancel_guard.rk +15 -0
  428. package/template/base/modules/projects/imports/attendance_recap.rk +23 -0
  429. package/template/base/modules/projects/imports/billing_milestone.rk +20 -0
  430. package/template/base/modules/projects/models/assignment.rk +59 -3
  431. package/template/base/modules/projects/models/attendance_close.rk +67 -0
  432. package/template/base/modules/projects/models/attendance_guard.rk +57 -0
  433. package/template/base/modules/projects/models/attendance_log.rk +263 -0
  434. package/template/base/modules/projects/models/billing_milestone.rk +217 -0
  435. package/template/base/modules/projects/models/project.rk +76 -2
  436. package/template/base/modules/projects/models/project_expense.rk +121 -0
  437. package/template/base/modules/projects/models/project_guard.rk +27 -0
  438. package/template/base/modules/projects/models/project_ledger.rk +146 -0
  439. package/template/base/modules/projects/models/timesheet.rk +100 -10
  440. package/template/base/modules/projects/models/work_site.rk +74 -0
  441. package/template/base/modules/projects/module.rk +7 -2
  442. package/template/base/modules/projects/roles/field_worker.rk +9 -0
  443. package/template/base/modules/projects/roles/site_supervisor.rk +7 -0
  444. package/template/base/modules/projects/screens/absen.rk +21 -0
  445. package/template/base/modules/quotation/models/quotation.rk +20 -4
  446. package/template/base/modules/quotation/models/quotation_item.rk +13 -0
  447. package/template/base/modules/quotation/module.rk +6 -1
  448. package/template/base/modules/quotation/print/quotation.html +17 -3
  449. package/template/base/modules/rental/flows/rental_booking_on_cancel.rk +19 -0
  450. package/template/base/modules/rental/flows/rental_booking_on_submit.rk +45 -0
  451. package/template/base/modules/rental/flows/rental_checkout_on_cancel.rk +24 -0
  452. package/template/base/modules/rental/flows/rental_checkout_on_submit.rk +33 -0
  453. package/template/base/modules/rental/flows/rental_invoice_once.rk +20 -0
  454. package/template/base/modules/rental/flows/rental_invoice_tag_lock.rk +12 -0
  455. package/template/base/modules/rental/flows/rental_return_on_cancel.rk +28 -0
  456. package/template/base/modules/rental/flows/rental_return_on_submit.rk +45 -0
  457. package/template/base/modules/rental/models/rental_booking.rk +124 -0
  458. package/template/base/modules/rental/models/rental_checkout.rk +91 -0
  459. package/template/base/modules/rental/models/rental_checkout_unit.rk +22 -0
  460. package/template/base/modules/rental/models/rental_guard.rk +93 -0
  461. package/template/base/modules/rental/models/rental_item.rk +83 -0
  462. package/template/base/modules/rental/models/rental_return.rk +134 -0
  463. package/template/base/modules/rental/models/rental_return_unit.rk +29 -0
  464. package/template/base/modules/rental/models/rental_schedule.rk +59 -0
  465. package/template/base/modules/rental/models/rental_unit.rk +80 -0
  466. package/template/base/modules/rental/module.rk +25 -0
  467. package/template/base/modules/rental/print/rental_bast_in.html +107 -0
  468. package/template/base/modules/rental/print/rental_bast_in.rk +9 -0
  469. package/template/base/modules/rental/print/rental_bast_out.html +98 -0
  470. package/template/base/modules/rental/print/rental_bast_out.rk +11 -0
  471. package/template/base/modules/rental/roles/rental_staff.rk +7 -0
  472. package/template/base/modules/rental/screens/alat_keluar.rk +19 -0
  473. package/template/base/modules/rental/screens/alat_kembali.rk +19 -0
  474. package/template/base/modules/rental/screens/jadwal_alat.rk +21 -0
  475. package/template/base/modules/stock/flows/adjustment_value_backfill.rk +95 -0
  476. package/template/base/modules/stock/flows/adjustment_value_on_cancel.rk +19 -0
  477. package/template/base/modules/stock/flows/adjustment_value_on_submit.rk +17 -0
  478. package/template/base/modules/stock/models/recipe.rk +8 -0
  479. package/template/base/modules/stock/models/stock_adjustment.rk +1 -0
  480. package/template/base/modules/stock/models/stock_adjustment_value.rk +80 -0
  481. package/template/base/modules/stock/models/stock_balance.rk +6 -2
  482. package/template/base/modules/stock/models/stock_move.rk +17 -5
  483. package/template/base/modules/stock/models/stock_transfer_item.rk +1 -1
  484. package/template/base/modules/stock/module.rk +7 -2
  485. package/template/base/modules/subscriptions/flows/collector_deposit_on_submit.rk +57 -0
  486. package/template/base/modules/subscriptions/flows/deposit_payment_kept.rk +17 -0
  487. package/template/base/modules/subscriptions/flows/deposit_payment_not_cancelled.rk +14 -0
  488. package/template/base/modules/subscriptions/flows/deposit_payment_not_deleted.rk +14 -0
  489. package/template/base/modules/subscriptions/flows/field_collection_cap_created.rk +24 -0
  490. package/template/base/modules/subscriptions/flows/field_collection_cap_updated.rk +24 -0
  491. package/template/base/modules/subscriptions/flows/field_collection_locked.rk +12 -0
  492. package/template/base/modules/subscriptions/flows/field_collection_not_deleted.rk +10 -0
  493. package/template/base/modules/subscriptions/flows/invoice_subscription_kept.rk +19 -0
  494. package/template/base/modules/subscriptions/flows/invoice_subscription_once.rk +34 -0
  495. package/template/base/modules/subscriptions/flows/invoice_subscription_tag_lock.rk +13 -0
  496. package/template/base/modules/subscriptions/flows/service_area_collector.rk +14 -0
  497. package/template/base/modules/subscriptions/flows/subscription_billing.rk +79 -0
  498. package/template/base/modules/subscriptions/flows/subscription_dunning.rk +81 -0
  499. package/template/base/modules/subscriptions/flows/subscription_extra_locked.rk +14 -0
  500. package/template/base/modules/subscriptions/flows/subscription_status_on_payment.rk +48 -0
  501. package/template/base/modules/subscriptions/models/collection_visit.rk +47 -0
  502. package/template/base/modules/subscriptions/models/collector_deposit.rk +36 -0
  503. package/template/base/modules/subscriptions/models/field_collection.rk +42 -0
  504. package/template/base/modules/subscriptions/models/service_area.rk +19 -0
  505. package/template/base/modules/subscriptions/models/subscription.rk +235 -0
  506. package/template/base/modules/subscriptions/models/subscription_bill.rk +48 -0
  507. package/template/base/modules/subscriptions/models/subscription_extra.rk +50 -0
  508. package/template/base/modules/subscriptions/models/subscription_guard.rk +65 -0
  509. package/template/base/modules/subscriptions/models/subscription_month.rk +29 -0
  510. package/template/base/modules/subscriptions/models/subscription_plan.rk +75 -0
  511. package/template/base/modules/subscriptions/models/subscription_status_log.rk +27 -0
  512. package/template/base/modules/subscriptions/module.rk +18 -0
  513. package/template/base/modules/subscriptions/roles/collector.rk +7 -0
  514. package/template/base/modules/subscriptions/screens/catat_tagih.rk +18 -0
  515. package/template/base/modules/subscriptions/screens/rute_tagih.rk +25 -0
  516. package/template/base/modules/tax_id/module.rk +5 -0
  517. package/template/base/modules/users/models/user.rk +2 -0
  518. package/template/base/modules/users/module.rk +6 -1
  519. package/template/base/modules/users/roles/cashier.rk +8 -0
  520. package/template/base/modules/users/roles/course_admin.rk +4 -0
  521. package/template/base/modules/users/roles/field_sales.rk +7 -0
  522. package/template/base/modules/workforce/imports/worker_list.rk +21 -0
  523. package/template/base/modules/workforce/models/certification.rk +1 -2
  524. package/template/base/modules/workforce/models/worker.rk +45 -4
  525. package/template/base/modules/workforce/module.rk +5 -0
  526. package/template/demo/fixtures/demo.rk +2 -2
@@ -1,34 +1,106 @@
1
1
  {{define "style"}}
2
- .meta { width: 100%; margin: 12px 0; border-collapse: collapse; }
3
- .meta td { padding: 2px 6px 2px 0; vertical-align: top; }
4
- .items { width: 100%; border-collapse: collapse; margin-top: 12px; }
5
- .items th, .items td { border-bottom: 1px solid #d6d3d1; padding: 6px 8px; text-align: left; }
6
- .items th { background: #f6ede6; }
7
- .num { text-align: right !important; font-variant-numeric: tabular-nums; }
8
- .totals { width: 50%; margin: 12px 0 0 auto; border-collapse: collapse; }
9
- .totals td { padding: 3px 8px; }
10
- .totals tr.grand td { border-top: 2px solid #1c1917; font-weight: 700; }
11
- .note { margin-top: 14px; font-size: 0.9em; }
2
+ /* Arah E: netral, satu tanda merek (logo atau inisial usaha), hierarki dari sisa tagihan, angka rata kanan tabular. */
3
+ .lh { display: flex; gap: 4mm; align-items: flex-start; padding-bottom: 4mm; margin-bottom: 5mm; border-bottom: 1px solid #1C1917; }
4
+ .lh .logo { max-height: 16mm; max-width: 40mm; }
5
+ .lh .mono { width: 12mm; height: 12mm; border-radius: 2.5mm; background: #1C1917; color: #fff; font-weight: 700; font-size: 16pt; line-height: 12mm; text-align: center; flex: none; }
6
+ .lh .legal-name { font-size: 1.3em; font-weight: 600; }
7
+ .lh .address { white-space: pre-line; }
8
+ .lh .contacts span+span::before { content: " · "; }
9
+ .head { display: flex; justify-content: space-between; align-items: flex-start; gap: 6mm; }
10
+ .head h1 { font-size: 1.6em; margin: 0; letter-spacing: 0.02em; }
11
+ .head .no { font-size: 1.1em; font-weight: 600; margin-top: 1mm; }
12
+ .status { display: inline-block; margin-top: 2mm; padding: 0.6mm 2.4mm; border: 1px solid #1C1917; border-radius: 99px; font-size: 0.9em; font-weight: 600; }
13
+ .due { min-width: 62mm; padding: 3mm 4mm; border: 1px solid #D6D3D1; border-radius: 2mm; background: #F5F5F4; text-align: right; }
14
+ .due .k { color: #57534E; }
15
+ .due .v { font-size: 1.9em; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; }
16
+ .meta { display: flex; gap: 8mm; margin: 5mm 0 2mm; }
17
+ .meta > div { flex: 1; }
18
+ .meta table td { border: 0; padding: 0.6mm 0; }
19
+ .meta table td:first-child { color: #57534E; width: 32mm; }
20
+ .meta .k { color: #57534E; }
21
+ .items { margin-top: 4mm; }
22
+ .items th { border-bottom: 1px solid #1C1917; color: #57534E; font-weight: 600; font-size: 0.9em; }
23
+ .num { text-align: right !important; font-variant-numeric: tabular-nums; white-space: nowrap; }
24
+ .totals { width: 55%; margin: 3mm 0 0 auto; }
25
+ .totals td { border: 0; padding: 0.8mm 2mm; }
26
+ .totals tr.small td { color: #57534E; font-size: 0.92em; }
27
+ .totals tr.grand td { border-top: 1px solid #1C1917; padding-top: 2mm; font-weight: 700; font-size: 1.15em; }
28
+ .totals tr.net td { font-weight: 700; }
29
+ .note { margin-top: 3mm; font-size: 0.9em; }
30
+ .pay { margin-top: 6mm; display: flex; gap: 8mm; align-items: flex-start; justify-content: space-between; border: 1px solid #D6D3D1; border-radius: 2mm; padding: 4mm; break-inside: avoid; }
31
+ .pay h2 { font-size: 1em; margin: 0 0 2mm; }
32
+ .pay .ref { font-family: ui-monospace, monospace; font-weight: 700; }
33
+ .pay .qris { text-align: center; font-size: 0.85em; flex: none; }
34
+ .pay .qris img { width: 34mm; height: 34mm; object-fit: contain; display: block; margin: 0 auto 1mm; }
35
+ .foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 8mm; margin-top: 4mm; }
36
+ .foot .signature { margin-top: 6mm; }
12
37
  {{end}}
38
+ {{define "letterhead"}}{{with .Letterhead}}<header class="lh">
39
+ {{if .logo_src}}<img class="logo" src="{{.logo_src}}" alt="">{{else if .legal_name}}<div class="mono" aria-hidden="true">{{upper (slice .legal_name 0 1)}}</div>{{end}}
40
+ <div>
41
+ <div class="legal-name">{{.legal_name}}</div>
42
+ {{with .tagline}}<div class="muted">{{.}}</div>{{end}}
43
+ {{with .address}}<div class="address">{{.}}</div>{{end}}
44
+ {{if or .phone .email .website}}<div class="contacts">{{with .phone}}<span>{{.}}</span>{{end}}{{with .email}}<span>{{.}}</span>{{end}}{{with .website}}<span>{{.}}</span>{{end}}</div>{{end}}
45
+ {{with .npwp}}<div>NPWP {{.}}</div>{{end}}
46
+ </div></header>{{end}}{{end}}
13
47
  {{template "letterhead" .}}
14
48
  {{$fx := and .Doc.currency (ne .Doc.currency "IDR")}}
15
- <h1>Faktur / Invoice</h1>
16
- <table class="meta">
17
- <tr><td>No. faktur</td><td>: {{.Doc.name}}</td><td>Kepada Yth.</td><td>: {{.Links.customer.customer_name}}</td></tr>
18
- <tr><td>Tanggal</td><td>: {{date .Doc.posting_date}}</td><td>Alamat</td><td>: {{.Links.customer.address}}</td></tr>
19
- <tr><td>Jatuh tempo</td><td>: {{date .Doc.due_date}}</td><td>NPWP</td><td>: {{.Links.customer.npwp}}</td></tr>
20
- {{if .Doc.po_number}}<tr><td>No. PO pelanggan</td><td>: {{.Doc.po_number}}</td><td></td><td></td></tr>{{end}}
21
- </table>
49
+ {{- $ds := printf "%v" .Doc.docstatus -}}
50
+ {{- $out := printf "%v" .Doc.outstanding -}}
51
+ {{- $owed := and .Doc.outstanding (ne $out "0") (ne (slice (printf "%v-" $out) 0 1) "-") -}}
52
+ {{- $paid := and .Doc.paid_amount (ne (printf "%v" .Doc.paid_amount) "0") -}}
53
+ {{- $late := overdue .Doc.due_date -}}
54
+ {{- $disc := false -}}{{- range .Doc.items -}}{{- if .discount -}}{{- $disc = true -}}{{- end -}}{{- end -}}
55
+ <div class="head">
56
+ <div>
57
+ <h1>Faktur</h1>
58
+ <div class="no">{{.Doc.name}}</div>
59
+ <div class="status">
60
+ {{- if eq $ds "0"}}Draf
61
+ {{- else if eq $ds "2"}}Batal
62
+ {{- else if not $owed}}Lunas
63
+ {{- else if gt $late 0}}Lewat jatuh tempo {{$late}} hari
64
+ {{- else if $paid}}Dibayar sebagian
65
+ {{- else}}Belum dibayar{{end -}}
66
+ </div>
67
+ </div>
68
+ {{if and (eq $ds "1") $owed}}<div class="due">
69
+ <div class="k">{{if $paid}}Sisa tagihan{{else if or .Doc.retention_amount .Doc.pph23_amount}}Tagihan bersih{{else}}Total tagihan{{end}}</div>
70
+ <div class="v">{{rupiah .Doc.outstanding}}</div>
71
+ <div class="k">Jatuh tempo {{date .Doc.due_date}}</div>
72
+ </div>{{else if and (eq $ds "1") (not $owed)}}<div class="due">
73
+ <div class="k">Sudah dibayar</div>
74
+ <div class="v">{{rupiah .Doc.paid_amount}}</div>
75
+ <div class="k">Terima kasih</div>
76
+ </div>{{end}}
77
+ </div>
78
+ <div class="meta">
79
+ <div>
80
+ <div class="k">Kepada</div>
81
+ <div><strong>{{.Links.customer.customer_name}}</strong></div>
82
+ {{with .Links.customer.address}}<div class="address" style="white-space:pre-line">{{.}}</div>{{end}}
83
+ {{with .Links.customer.npwp}}<div>NPWP {{.}}</div>{{end}}
84
+ </div>
85
+ <div>
86
+ <table>
87
+ <tr><td>Tanggal faktur</td><td>{{date .Doc.posting_date}}</td></tr>
88
+ <tr><td>Jatuh tempo</td><td>{{date .Doc.due_date}}</td></tr>
89
+ {{if .Doc.po_number}}<tr><td>No. PO pelanggan</td><td>{{.Doc.po_number}}</td></tr>{{end}}
90
+ </table>
91
+ </div>
92
+ </div>
22
93
  <table class="items">
23
- <thead><tr><th>Uraian</th><th class="num">Qty</th><th>Satuan</th><th class="num">Harga satuan</th><th class="num">Diskon</th><th class="num">Jumlah</th></tr></thead>
94
+ <thead><tr><th>Uraian</th><th class="num">Qty</th><th>Satuan</th><th class="num">Harga satuan</th>{{if $disc}}<th class="num">Diskon</th>{{end}}<th class="num">Jumlah</th></tr></thead>
24
95
  <tbody>
25
96
  {{range $row := .Doc.items}}
97
+ {{- $u := or $row.uom_name $row.uom -}}
26
98
  <tr>
27
99
  <td>{{if $row.description}}{{$row.description}}{{else}}{{$row.item}}{{end}}</td>
28
100
  <td class="num">{{number $row.qty}}</td>
29
- <td>{{$row.uom}}</td>
101
+ <td>{{$u}}</td>
30
102
  <td class="num">{{if $fx}}{{money $row.rate_fx $.Doc.currency}}{{else}}{{rupiah $row.rate}}{{end}}</td>
31
- <td class="num">{{if $row.discount}}{{number $row.discount}}%{{end}}</td>
103
+ {{if $disc}}<td class="num">{{if $row.discount}}{{number $row.discount}}%{{end}}</td>{{end}}
32
104
  <td class="num">{{if $fx}}{{money $row.amount_fx $.Doc.currency}}{{else}}{{rupiah $row.amount}}{{end}}</td>
33
105
  </tr>
34
106
  {{end}}
@@ -37,10 +109,10 @@
37
109
  {{if $fx}}
38
110
  <table class="totals">
39
111
  <tr><td>Subtotal</td><td class="num">{{money .Doc.subtotal_fx .Doc.currency}}</td></tr>
40
- <tr><td>DPP</td><td class="num">{{money .Doc.dpp_fx .Doc.currency}}</td></tr>
41
- {{if taxrate .Doc .Tax}}<tr><td>PPN {{number (taxrate .Doc .Tax)}}%</td><td class="num">{{money .Doc.ppn_fx .Doc.currency}}</td></tr>{{end}}
112
+ <tr class="small"><td>DPP</td><td class="num">{{money .Doc.dpp_fx .Doc.currency}}</td></tr>
113
+ {{if taxrate .Doc .Tax}}<tr class="small"><td>PPN {{number (taxrate .Doc .Tax)}}%</td><td class="num">{{money .Doc.ppn_fx .Doc.currency}}</td></tr>{{end}}
42
114
  <tr class="grand"><td>Total</td><td class="num">{{money .Doc.grand_total_fx .Doc.currency}}</td></tr>
43
- {{if or .Doc.retention_amount .Doc.pph23_amount}}<tr class="grand"><td>Tagihan bersih</td><td class="num">{{money .Doc.amount_due_fx .Doc.currency}}</td></tr>{{end}}
115
+ {{if or .Doc.retention_amount .Doc.pph23_amount}}<tr class="net"><td>Tagihan bersih</td><td class="num">{{money .Doc.amount_due_fx .Doc.currency}}</td></tr>{{end}}
44
116
  </table>
45
117
  <p class="note">Kurs: 1 {{.Doc.currency}} = {{rupiah .Doc.exchange_rate}}. Setara rupiah (PPN dihitung dalam rupiah):</p>
46
118
  {{end}}
@@ -48,16 +120,57 @@
48
120
  <tr><td>Subtotal</td><td class="num">{{rupiah .Doc.subtotal}}</td></tr>
49
121
  {{if .Doc.discount_amount}}<tr><td>Diskon</td><td class="num">-{{rupiah .Doc.discount_amount}}</td></tr>{{end}}
50
122
  {{if .Doc.down_payment}}<tr><td>Uang muka</td><td class="num">-{{rupiah .Doc.down_payment}}</td></tr>{{end}}
51
- <tr><td>DPP</td><td class="num">{{rupiah .Doc.dpp}}</td></tr>
52
- {{if taxrate .Doc .Tax}}<tr><td>PPN {{number (taxrate .Doc .Tax)}}% (DPP nilai lain {{.Doc.dpp_num}}/{{.Doc.dpp_den}})</td><td class="num">{{rupiah .Doc.ppn}}</td></tr>{{end}}
123
+ {{if taxrate .Doc .Tax}}<tr class="small"><td>DPP</td><td class="num">{{rupiah .Doc.dpp}}</td></tr>
124
+ {{- /* As on the faktur pajak (Coretax, PMK 131/2024): the base, then DPP nilai lain, then PPN = rate x DPP nilai lain.
125
+ An invoice of an org with PPN on the fee only (tax.ppn_fee_only, PMK 83/2012) shows the wages left out first; an
126
+ invoice from before ppn_base existed was taxed on its whole DPP. */}}
127
+ {{- /* the DPP only for a document from before ppn_base that charged PPN (as ppn_dp_base reads it); a base of 0 with
128
+ no PPN (wages only, or a settlement whose base the down payment used up) is that 0 */}}
129
+ {{- $pb := .Doc.dpp}}{{if or .Doc.ppn_base (not .Doc.ppn)}}{{$pb = or .Doc.ppn_base 0}}{{end}}
130
+ {{- if ne (dec $pb) (dec .Doc.dpp)}}
131
+ <tr class="small"><td>Upah tenaga kerja di luar dasar PPN (PMK 83/2012)</td><td class="num">-{{rupiah (sub .Doc.dpp $pb)}}</td></tr>
132
+ <tr class="small"><td>Dasar PPN</td><td class="num">{{rupiah $pb}}</td></tr>
133
+ {{- end}}
134
+ {{- if ne .Doc.dpp_num .Doc.dpp_den}}
135
+ <tr class="small"><td>DPP nilai lain {{.Doc.dpp_num}}/{{.Doc.dpp_den}}</td><td class="num">{{rupiah (round (div (mul $pb .Doc.dpp_num) .Doc.dpp_den))}}</td></tr>
136
+ {{- end}}
137
+ <tr class="small"><td>PPN {{number (taxrate .Doc .Tax)}}%</td><td class="num">{{rupiah .Doc.ppn}}</td></tr>{{end}}
53
138
  <tr class="grand"><td>Total</td><td class="num">{{rupiah .Doc.grand_total}}</td></tr>
54
- {{if .Doc.retention_amount}}<tr><td>Retensi {{number .Doc.retention_percent}}% ditahan</td><td class="num">-{{rupiah .Doc.retention_amount}}</td></tr>{{end}}
55
- {{if .Doc.pph23_amount}}<tr><td>PPh 23 dipotong pelanggan</td><td class="num">-{{rupiah .Doc.pph23_amount}}</td></tr>{{end}}
56
- {{if or .Doc.retention_amount .Doc.pph23_amount}}<tr class="grand"><td>Tagihan bersih</td><td class="num">{{rupiah .Doc.amount_due}}</td></tr>{{end}}
139
+ {{if .Doc.retention_amount}}<tr class="small"><td>Retensi {{number .Doc.retention_percent}}% ditahan</td><td class="num">-{{rupiah .Doc.retention_amount}}</td></tr>{{end}}
140
+ {{if .Doc.pph23_amount}}<tr class="small"><td>PPh 23 dipotong pelanggan{{if .Doc.pph23_dpp}} (dasar {{rupiah .Doc.pph23_dpp}}){{end}}</td><td class="num">-{{rupiah .Doc.pph23_amount}}</td></tr>{{end}}
141
+ {{if or .Doc.retention_amount .Doc.pph23_amount}}<tr class="net"><td>Tagihan bersih</td><td class="num">{{rupiah .Doc.amount_due}}</td></tr>{{end}}
142
+ {{if $paid}}<tr><td>Sudah dibayar</td><td class="num">-{{rupiah .Doc.paid_amount}}</td></tr>
143
+ <tr class="net"><td>Sisa tagihan</td><td class="num">{{rupiah .Doc.outstanding}}</td></tr>{{end}}
57
144
  </table>
58
- <p class="note"><strong>Terbilang:</strong> {{terbilang .Doc.grand_total}}</p>
145
+ <p class="note"><span class="muted">Terbilang:</span> {{terbilang .Doc.grand_total}}</p>
59
146
  {{if .Doc.notes}}<p class="note">{{.Doc.notes}}</p>{{end}}
60
- <p class="note">Bila pembayaran dipotong PPh Pasal 23, mohon kirimkan bukti potongnya kepada kami.</p>
147
+ {{/* Cara bayar only while something is owed (or on a draft, which has no copy yet and shows the letterhead accounts):
148
+ a cancelled or paid invoice must not tell the customer to pay. */}}
149
+ {{if or (eq $ds "0") (and (eq $ds "1") $owed)}}
150
+ {{with .Related.cara_bayar}}{{with index . 0}}
151
+ <section class="pay">
152
+ <div>
153
+ <h2>Cara bayar</h2>
154
+ <div>Transfer ke <strong>{{.bank}} {{.account_no}}</strong> a.n. {{.holder}}</div>
155
+ <div>Tulis di berita transfer: <span class="ref">{{.reference}}</span></div>
156
+ {{with .instructions}}<div class="muted">{{.}}</div>{{end}}
157
+ </div>
158
+ {{if .qris_payload}}<div class="qris">
159
+ <img src="{{qr .qris_payload}}" alt="QRIS">
160
+ <div><strong>Scan QRIS</strong>{{with .qris_merchant_name}} {{.}}{{end}}</div>
161
+ {{with .qris_nmid}}<div class="muted">NMID {{.}}</div>{{end}}
162
+ <div class="muted">Isi nominal {{rupiah $.Doc.outstanding}}</div>
163
+ </div>{{end}}
164
+ </section>
165
+ {{end}}{{else}}
61
166
  {{template "bank_accounts" .}}
62
- {{if taxrate .Doc .Tax}}<p class="note">Faktur pajak (e-Faktur) diterbitkan terpisah.</p>{{end}}
63
- {{template "signature" .}}
167
+ {{if .Letterhead.bank}}<p class="note">Mohon tulis nomor faktur <strong>{{.Doc.name}}</strong> di berita transfer supaya pembayaran langsung tercatat.</p>{{end}}
168
+ {{end}}
169
+ {{end}}
170
+ <div class="foot">
171
+ <div class="note muted">
172
+ Bila pembayaran dipotong PPh Pasal 23, mohon kirimkan bukti potongnya kepada kami.
173
+ {{if taxrate .Doc .Tax}}<br>Faktur pajak (e-Faktur) diterbitkan terpisah.{{end}}
174
+ </div>
175
+ {{template "signature" .}}
176
+ </div>
@@ -5,3 +5,10 @@ label: {id: Faktur, en: Invoice}
5
5
  paper: A4
6
6
  template: sales_invoice.html
7
7
  default: true
8
+ # "Cara bayar" copied when the invoice was submitted (payment_instruction); empty for an older invoice or one
9
+ # submitted without a default account, which then shows the letterhead's bank accounts.
10
+ related:
11
+ cara_bayar:
12
+ model: payment_instruction
13
+ match: {sales_invoice: name}
14
+ limit: 1
@@ -0,0 +1,71 @@
1
+ {{define "style"}}
2
+ /* Arah E untuk thermal: hitam putih, satu tanda merek (nama usaha tebal), angka rata kanan tabular. */
3
+ body { font-size: 8.5pt; }
4
+ .c { text-align: center; }
5
+ .brand { font-size: 1.25em; font-weight: 700; }
6
+ .rule { border-top: 1px dashed #1C1917; margin: 2mm 0; }
7
+ .row { display: flex; justify-content: space-between; gap: 2mm; }
8
+ .row .num { white-space: nowrap; }
9
+ .line { margin: 1mm 0; }
10
+ .line .sub { color: #57534E; }
11
+ .big { font-size: 1.35em; font-weight: 700; }
12
+ .status { font-weight: 700; }
13
+ .qris img { width: 42mm; height: 42mm; display: block; margin: 1mm auto; }
14
+ .muted { color: #57534E; }
15
+ {{end}}
16
+ {{define "letterhead"}}{{with .Letterhead}}<div class="c">
17
+ <div class="brand">{{.legal_name}}</div>
18
+ {{with .address}}<div style="white-space:pre-line">{{.}}</div>{{end}}
19
+ {{with .phone}}<div>{{.}}</div>{{end}}
20
+ {{with .npwp}}<div>NPWP {{.}}</div>{{end}}
21
+ </div>{{end}}{{end}}
22
+ {{template "letterhead" .}}
23
+ {{- $ds := printf "%v" .Doc.docstatus -}}
24
+ {{- $out := printf "%v" .Doc.outstanding -}}
25
+ {{- $owed := and .Doc.outstanding (ne $out "0") (ne (slice (printf "%v-" $out) 0 1) "-") -}}
26
+ {{- $paid := and .Doc.paid_amount (ne (printf "%v" .Doc.paid_amount) "0") -}}
27
+ <div class="rule"></div>
28
+ <div class="row"><span>Nota</span><span>{{.Doc.name}}</span></div>
29
+ <div class="row"><span>Tanggal</span><span>{{date .Doc.posting_date}}</span></div>
30
+ <div class="row"><span>Pelanggan</span><span>{{.Links.customer.customer_name}}</span></div>
31
+ <div class="rule"></div>
32
+ {{range $row := .Doc.items}}
33
+ {{- $u := or $row.uom_name $row.uom -}}
34
+ <div class="line">
35
+ <div>{{if $row.description}}{{$row.description}}{{else}}{{$row.item}}{{end}}</div>
36
+ <div class="row sub"><span>{{number $row.qty}} {{$u}} x {{rupiah $row.rate}}{{if $row.discount}} (-{{number $row.discount}}%){{end}}</span><span class="num">{{rupiah $row.amount}}</span></div>
37
+ </div>
38
+ {{end}}
39
+ <div class="rule"></div>
40
+ {{if .Doc.discount_amount}}<div class="row"><span>Diskon</span><span class="num">-{{rupiah .Doc.discount_amount}}</span></div>{{end}}
41
+ {{if .Doc.down_payment}}<div class="row"><span>Uang muka</span><span class="num">-{{rupiah .Doc.down_payment}}</span></div>{{end}}
42
+ {{if taxrate .Doc .Tax}}<div class="row muted"><span>PPN {{number (taxrate .Doc .Tax)}}%</span><span class="num">{{rupiah .Doc.ppn}}</span></div>{{end}}
43
+ {{- $net := or .Doc.retention_amount .Doc.pph23_amount -}}
44
+ <div class="row{{if not $net}} big{{end}}"><span>Total</span><span class="num">{{rupiah .Doc.grand_total}}</span></div>
45
+ {{if .Doc.retention_amount}}<div class="row"><span>Retensi {{number .Doc.retention_percent}}% ditahan</span><span class="num">-{{rupiah .Doc.retention_amount}}</span></div>{{end}}
46
+ {{if .Doc.pph23_amount}}<div class="row"><span>PPh 23 dipotong</span><span class="num">-{{rupiah .Doc.pph23_amount}}</span></div>{{end}}
47
+ {{if $net}}<div class="row big"><span>Tagihan bersih</span><span class="num">{{rupiah .Doc.amount_due}}</span></div>{{end}}
48
+ {{if $paid}}<div class="row"><span>Sudah dibayar</span><span class="num">-{{rupiah .Doc.paid_amount}}</span></div>{{end}}
49
+ {{if and (eq $ds "1") $owed $paid}}<div class="row big"><span>Sisa</span><span class="num">{{rupiah .Doc.outstanding}}</span></div>{{end}}
50
+ <div class="c status">
51
+ {{- if eq $ds "0"}}DRAF, BELUM DITAGIHKAN
52
+ {{- else if eq $ds "2"}}BATAL
53
+ {{- else if not $owed}}LUNAS
54
+ {{- else}}Jatuh tempo {{date .Doc.due_date}}{{end -}}
55
+ </div>
56
+ {{if and (eq $ds "1") $owed}}
57
+ {{with .Related.cara_bayar}}{{with index . 0}}
58
+ <div class="rule"></div>
59
+ <div class="c">
60
+ <div>Transfer {{.bank}} {{.account_no}}</div>
61
+ <div>a.n. {{.holder}}</div>
62
+ <div>Berita transfer: <strong>{{.reference}}</strong></div>
63
+ {{if .qris_payload}}<div class="qris"><img src="{{qr .qris_payload}}" alt="QRIS"><div>Scan QRIS, isi {{rupiah $.Doc.outstanding}}</div></div>{{end}}
64
+ </div>
65
+ {{end}}{{else}}{{with .Letterhead.bank}}{{with index . 0}}
66
+ <div class="rule"></div>
67
+ <div class="c"><div>Transfer {{.bank}} {{.account}}</div>{{with .holder}}<div>a.n. {{.}}</div>{{end}}<div>Berita transfer: <strong>{{$.Doc.name}}</strong></div></div>
68
+ {{end}}{{end}}{{end}}
69
+ {{end}}
70
+ <div class="rule"></div>
71
+ <div class="c muted">Terima kasih</div>
@@ -0,0 +1,13 @@
1
+ # yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/print.json
2
+ # Nota for an 80 mm receipt printer: the invoice handed over the counter or with the goods (grosir, ritel). Same
3
+ # figures as the A4 faktur, shortened: lines, total, what is still owed, and how to pay (QRIS when the org has one).
4
+ name: sales_invoice_nota
5
+ model: sales_invoice
6
+ label: {id: Nota (printer kasir 80 mm), en: Receipt (80 mm)}
7
+ paper: 80mm
8
+ template: sales_invoice_nota.html
9
+ related:
10
+ cara_bayar:
11
+ model: payment_instruction
12
+ match: {sales_invoice: name}
13
+ limit: 1
@@ -0,0 +1,45 @@
1
+ {{define "style"}}
2
+ /* Arah E: pratinjau pesan netral; tombol utama ink, bukan hijau WhatsApp. */
3
+ h1 { font-size: 1.3em; }
4
+ .to { margin: 0 0 3mm; }
5
+ .msg { white-space: pre-wrap; border: 1px solid #D6D3D1; border-radius: 3mm; border-top-left-radius: 0.8mm; background: #F5F5F4; padding: 4mm; margin: 3mm 0 4mm; font-size: 1.05em; max-width: 120mm; }
6
+ .wa { display: inline-block; padding: 2.4mm 5mm; border-radius: 2mm; background: #1C1917; color: #fff; text-decoration: none; font-weight: 600; }
7
+ .muted { color: #57534E; font-size: 0.9em; }
8
+ @media print { .wa { display: none; } }
9
+ {{end}}
10
+ {{- $c := .Links.customer -}}
11
+ {{- $p := "" -}}{{- with $c.phone -}}{{- $p = . -}}{{- end -}}
12
+ {{- if and $p (eq (slice $p 0 1) "+") -}}{{- $p = slice $p 1 -}}{{- end -}}
13
+ {{- if and $p (eq (slice $p 0 1) "0") -}}{{- $p = printf "62%s" (slice $p 1) -}}{{- end -}}
14
+ {{- $bank := "" -}}{{- with .Letterhead.bank -}}{{- with index . 0 -}}{{- $bank = printf "%s %s a.n. %s" .bank .account .holder -}}{{- end -}}{{- end -}}
15
+ {{- $ref := .Doc.name -}}{{- $qris := "" -}}{{- $howto := "" -}}
16
+ {{- with .Related.cara_bayar -}}{{- with index . 0 -}}
17
+ {{- $bank = printf "%s %s a.n. %s" .bank .account_no .holder -}}{{- $ref = .reference -}}
18
+ {{- if .qris_nmid -}}{{- $qris = printf "\nBisa juga scan QRIS %s (NMID %s), isi nominal %s." .qris_merchant_name .qris_nmid (rupiah $.Doc.outstanding) -}}{{- end -}}
19
+ {{- with .instructions -}}{{- $howto = printf "\n%s" . -}}{{- end -}}
20
+ {{- end -}}{{- end -}}
21
+ {{- $payline := printf "Mohon tulis %s di berita transfer saat membayar." $ref -}}
22
+ {{- if $bank -}}{{- $payline = printf "Pembayaran bisa transfer ke %s. Mohon tulis %s di berita transfer." $bank $ref -}}{{- end -}}
23
+ {{- $late := overdue .Doc.due_date -}}
24
+ {{- $msg := "" -}}
25
+ {{- $open := eq (printf "%v" .Doc.docstatus) "1" -}}
26
+ {{- $owed := gt (printf "%v" .Doc.outstanding | len) 0 -}}{{- if $owed -}}{{- $owed = ne (slice (printf "%v" .Doc.outstanding) 0 1) "-" -}}{{- end -}}
27
+ {{- if not $open -}}
28
+ {{- $p = "" -}}
29
+ {{- if eq (printf "%v" .Doc.docstatus) "2" -}}
30
+ {{- $msg = printf "Faktur %s sudah dibatalkan. Tidak ada tagihan yang dikirim untuk faktur ini." .Doc.name -}}
31
+ {{- else -}}
32
+ {{- $msg = printf "Faktur %s belum diajukan. Ajukan dulu sebelum menagih pelanggan." .Doc.name -}}
33
+ {{- end -}}
34
+ {{- else if or (not .Doc.outstanding) (not $owed) -}}
35
+ {{- $msg = printf "Halo %s, terima kasih. Pembayaran faktur %s sudah kami terima dan faktur ini sudah lunas.\n\n%s" $c.customer_name .Doc.name .Letterhead.legal_name -}}
36
+ {{- else if gt $late 0 -}}
37
+ {{- $msg = printf "Halo %s, kami mengingatkan faktur %s sebesar %s sudah lewat %d hari dari jatuh tempo (%s).\n\n%s%s%s\n\nKalau sudah membayar, abaikan pesan ini. Terima kasih.\n%s" $c.customer_name .Doc.name (rupiah .Doc.outstanding) $late (date .Doc.due_date) $payline $qris $howto .Letterhead.legal_name -}}
38
+ {{- else -}}
39
+ {{- $msg = printf "Halo %s, ini tagihan dari %s.\n\nFaktur %s\nTagihan %s\nJatuh tempo %s\n\n%s%s%s\n\nTerima kasih." $c.customer_name .Letterhead.legal_name .Doc.name (rupiah .Doc.outstanding) (date .Doc.due_date) $payline $qris $howto -}}
40
+ {{- end -}}
41
+ <h1>Pesan tagihan WhatsApp</h1>
42
+ <p class="to">Untuk <strong>{{$c.customer_name}}</strong>{{if $p}} · +{{$p}}{{else if $open}} · <em>nomor WhatsApp pelanggan belum diisi</em>{{end}}</p>
43
+ <div class="msg">{{$msg}}</div>
44
+ {{if $p}}<p><a class="wa" href="https://wa.me/{{$p}}?text={{$msg}}">Buka di WhatsApp</a></p>{{end}}
45
+ <p class="muted">Sesudah terkirim, catat di Pengingat tagihan supaya pelanggan tidak ditagih dua kali di hari yang sama.</p>
@@ -0,0 +1,15 @@
1
+ # yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/print.json
2
+ # Not paper: the reminder text plus a wa.me link that opens WhatsApp with the text filled in, so the owner sends it
3
+ # from their own phone. Same wording as the WhatsApp Business templates in rangka-connectors.
4
+ name: sales_invoice_whatsapp
5
+ model: sales_invoice
6
+ label: {id: Pesan tagihan WA, en: WhatsApp reminder}
7
+ paper: A5
8
+ template: sales_invoice_whatsapp.html
9
+ # "Cara bayar" copied when the invoice was submitted (payment_instruction); empty for an older invoice or one
10
+ # submitted without a default account, which then shows the letterhead's bank accounts.
11
+ related:
12
+ cara_bayar:
13
+ model: payment_instruction
14
+ match: {sales_invoice: name}
15
+ limit: 1
@@ -0,0 +1,47 @@
1
+ # yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/flow.json
2
+ # Runs inside a receipt's payment (pos_sale submitted), as the cashier: one ticket per active station of the outlet
3
+ # with the receipt's lines whose item category (pos_sale_item.category, kept on the line) is routed to that station
4
+ # (kitchen_route). An outlet without stations (a shop) and a receipt without kitchen lines make nothing. A failure here
5
+ # rolls the payment back, so a paid receipt never misses its tickets.
6
+ # A receipt paid again after a void (amend) is a revision: what the voided receipt's picked-up tickets of that station
7
+ # already sent out is not cooked again. The served quantity of an item is spread over the revision's lines of that item
8
+ # in their order (line idx), so two lines of one item never both count the same served portion. The rest goes to the kitchen as Baru, and the part already served is kept as a
9
+ # ticket that is Diambil from the start, so a later revision knows it too.
10
+ name: kitchen_ticket_on_sale
11
+ label: {id: 'Struk dibayar: kirim tiket ke stasiun dapur'}
12
+ on: pos_sale.submitted
13
+ steps:
14
+ - {find_all: kitchen_station, where: outlet == event.outlet && active, as: stations}
15
+ - if: stations.size() > 0
16
+ then:
17
+ - {find_all: kitchen_route, where: outlet == event.outlet, as: routes}
18
+ - if: event.amended_from != ''
19
+ then:
20
+ - {find_all: kitchen_ticket, where: "sale == event.amended_from && status == 'picked_up'", as: served}
21
+ else:
22
+ - {find_all: kitchen_station, where: "false", as: served}
23
+ - for_each: stations
24
+ as: st
25
+ do:
26
+ - if: "event.items.filter(l, routes.filter(r, r.station == st.name && r.category == l.category).size() > 0 && l.qty - max(0, min(l.qty, served.filter(t, t.station == st.name).map(t, t.served.map(x, x.item == l.item ? x.qty : 0).sum()).sum() - event.items.filter(y, y.item == l.item && y.idx < l.idx).map(y, y.qty).sum())) > 0).size() > 0"
27
+ create: kitchen_ticket
28
+ set:
29
+ sale: event.name
30
+ outlet: event.outlet
31
+ station: st.name
32
+ date: event.date
33
+ buyer: event.buyer
34
+ revision_of: event.amended_from
35
+ items: "event.items.filter(l, routes.filter(r, r.station == st.name && r.category == l.category).size() > 0 && l.qty - max(0, min(l.qty, served.filter(t, t.station == st.name).map(t, t.served.map(x, x.item == l.item ? x.qty : 0).sum()).sum() - event.items.filter(y, y.item == l.item && y.idx < l.idx).map(y, y.qty).sum())) > 0).map(l, {'item': l.item, 'description': l.description, 'qty': l.qty - max(0, min(l.qty, served.filter(t, t.station == st.name).map(t, t.served.map(x, x.item == l.item ? x.qty : 0).sum()).sum() - event.items.filter(y, y.item == l.item && y.idx < l.idx).map(y, y.qty).sum())), 'uom': l.uom, 'note': l.note})"
36
+ - if: "event.items.filter(l, routes.filter(r, r.station == st.name && r.category == l.category).size() > 0 && max(0, min(l.qty, served.filter(t, t.station == st.name).map(t, t.served.map(x, x.item == l.item ? x.qty : 0).sum()).sum() - event.items.filter(y, y.item == l.item && y.idx < l.idx).map(y, y.qty).sum())) > 0).size() > 0"
37
+ create: kitchen_ticket
38
+ set:
39
+ sale: event.name
40
+ outlet: event.outlet
41
+ station: st.name
42
+ date: event.date
43
+ buyer: event.buyer
44
+ revision_of: event.amended_from
45
+ status: "'picked_up'"
46
+ picked_up_at: now()
47
+ items: "event.items.filter(l, routes.filter(r, r.station == st.name && r.category == l.category).size() > 0 && max(0, min(l.qty, served.filter(t, t.station == st.name).map(t, t.served.map(x, x.item == l.item ? x.qty : 0).sum()).sum() - event.items.filter(y, y.item == l.item && y.idx < l.idx).map(y, y.qty).sum())) > 0).map(l, {'item': l.item, 'description': l.description, 'qty': max(0, min(l.qty, served.filter(t, t.station == st.name).map(t, t.served.map(x, x.item == l.item ? x.qty : 0).sum()).sum() - event.items.filter(y, y.item == l.item && y.idx < l.idx).map(y, y.qty).sum())), 'uom': l.uom, 'note': l.note})"
@@ -0,0 +1,30 @@
1
+ # yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/flow.json
2
+ # A ticket's status moves one step at a time, forward or back (Baru -> Dimasak -> Siap -> Diambil; back is the work
3
+ # screen's "Urungkan"), and each step is stamped with its time; a step back clears the stamp of the step undone. Batal
4
+ # is set only by flow kitchen_ticket_on_void (writes by flows start no flow), so a person cannot void a ticket, and a
5
+ # void ticket does not come back, nor does a picked-up ticket of a voided receipt (sale_void). Runs inside the write, as the writer; kitchen_guard refuses the write.
6
+ name: kitchen_ticket_on_update
7
+ label: {id: 'Tiket dapur diubah: satu langkah, catat waktunya'}
8
+ on: kitchen_ticket.updated
9
+ if: event.before != null && event.before.status != event.status
10
+ steps:
11
+ - if: event.before.status == 'void'
12
+ create: kitchen_guard
13
+ set: {reason: "'ticket_void'", document: event.name}
14
+ - if: event.status == 'void'
15
+ create: kitchen_guard
16
+ set: {reason: "'void_by_receipt'", document: event.name}
17
+ # a picked-up ticket of a voided receipt stays picked up: its receipt no longer exists to cook for
18
+ - if: event.before.status == 'picked_up' && event.sale_void
19
+ create: kitchen_guard
20
+ set: {reason: "'sale_void'", document: event.name}
21
+ # positions 0..3; a jump of more than one step is refused
22
+ - if: "event.status != 'void' && event.before.status != 'void' && ({'new': 0, 'cooking': 1, 'ready': 2, 'picked_up': 3}[event.status] - {'new': 0, 'cooking': 1, 'ready': 2, 'picked_up': 3}[event.before.status]) * ({'new': 0, 'cooking': 1, 'ready': 2, 'picked_up': 3}[event.status] - {'new': 0, 'cooking': 1, 'ready': 2, 'picked_up': 3}[event.before.status]) > 1"
23
+ create: kitchen_guard
24
+ set: {reason: "'one_step'", document: event.name}
25
+ - {find: kitchen_ticket, where: name == event.name, as: t}
26
+ - update: t
27
+ set:
28
+ cooking_at: "event.status == 'new' ? null : (event.status == 'cooking' && event.before.status == 'new' ? now() : t.cooking_at)"
29
+ ready_at: "event.status == 'new' || event.status == 'cooking' ? null : (event.status == 'ready' && event.before.status == 'cooking' ? now() : t.ready_at)"
30
+ picked_up_at: "event.status == 'picked_up' ? now() : null"
@@ -0,0 +1,23 @@
1
+ # yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/flow.json
2
+ # A voided receipt (pos_sale cancelled, same day, open shift) voids its tickets that are not picked up yet, as the
3
+ # cashier who voided it; the kitchen screen drops them. A ticket already picked up stays Diambil (the food went out)
4
+ # and is marked sale_void, so it cannot be pulled back into the queue (flow kitchen_ticket_on_update).
5
+ name: kitchen_ticket_on_void
6
+ label: {id: 'Struk dibatalkan: tiket dapurnya batal'}
7
+ on: pos_sale.cancelled
8
+ steps:
9
+ - {find_all: kitchen_ticket, where: "sale == event.name && status != 'void' && status != 'picked_up'", as: tickets}
10
+ - for_each: tickets
11
+ as: t
12
+ do:
13
+ - update: t
14
+ set:
15
+ status: "'void'"
16
+ void_at: now()
17
+ - {find_all: kitchen_ticket, where: "sale == event.name && status == 'picked_up' && !sale_void", as: served}
18
+ - for_each: served
19
+ as: t
20
+ do:
21
+ - update: t
22
+ set:
23
+ sale_void: "true"
@@ -0,0 +1,40 @@
1
+ # yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/model.json
2
+ # Never stored: flow kitchen_ticket_on_update creates one when a ticket's status change must be refused (the pattern of
3
+ # pos_guard); the matching rule fails with the reason's message and rolls the write back.
4
+ name: kitchen_guard
5
+ label: {id: Penjaga tiket dapur, en: Kitchen ticket guard}
6
+ icon: check
7
+ naming: KGD-{######}
8
+ title_field: reason
9
+ permissions:
10
+ - {role: head_office, create: true}
11
+ - {role: cashier, create: true}
12
+ - {role: kitchen, create: true}
13
+ fields:
14
+ - name: reason
15
+ type: select
16
+ label: {id: Alasan}
17
+ required: true
18
+ options:
19
+ - {value: ticket_void, label: {id: Tiket sudah batal}}
20
+ - {value: void_by_receipt, label: {id: Batal hanya dari struk}}
21
+ - {value: one_step, label: {id: Satu langkah}}
22
+ - {value: sale_void, label: {id: Struk sudah batal}}
23
+ - {name: document, type: data, label: {id: Dokumen}}
24
+ rules:
25
+ - name: ticket_void
26
+ on: save
27
+ check: reason != 'ticket_void'
28
+ message: {id: 'Tiket ini sudah batal karena struknya dibatalkan; tidak bisa dilanjutkan'}
29
+ - name: void_by_receipt
30
+ on: save
31
+ check: reason != 'void_by_receipt'
32
+ message: {id: 'Tiket dapur batal hanya kalau struknya dibatalkan kasir'}
33
+ - name: one_step
34
+ on: save
35
+ check: reason != 'one_step'
36
+ message: {id: 'Status tiket maju atau mundur satu langkah saja (Baru, Dimasak, Siap, Diambil)'}
37
+ - name: sale_void
38
+ on: save
39
+ check: reason != 'sale_void'
40
+ message: {id: 'Struk tiket ini sudah dibatalkan; tiket yang sudah diambil tidak bisa dikembalikan ke antrean'}
@@ -0,0 +1,26 @@
1
+ # yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/model.json
2
+ # Which item category a station cooks: Kopi -> Bar, Makanan -> Dapur panas. A category can go to one station per
3
+ # outlet; a category with no route at an outlet makes no ticket there (bottled drinks the cashier hands over).
4
+ # A separate model rather than a table of the station: a flow reads records without their table rows.
5
+ name: kitchen_route
6
+ label: {id: Kategori ke stasiun, en: Category to station}
7
+ icon: stock
8
+ naming: RTD-{####}
9
+ title_field: category
10
+ permissions:
11
+ - {role: head_office, read: true, create: true, write: true, delete: true, print: true}
12
+ - {role: cashier, read: true}
13
+ - {role: kitchen, read: true}
14
+ - {role: outlet_staff, read: true}
15
+ fields:
16
+ - {name: station, type: link, to: kitchen_station, label: {id: Stasiun}, required: true, in_list: true, peek: [outlet]}
17
+ - {name: category, type: link, to: item_category, label: {id: Kategori barang}, required: true, in_list: true}
18
+ # the station's outlet, so the row scope of contract 0010 (field outlet) applies to routes too
19
+ - {name: outlet, type: link, to: outlet, label: {id: Outlet}, compute: station.outlet, in_list: true}
20
+ # one station per category and outlet
21
+ - {name: route_key, type: data, label: {id: Kunci rute}, hidden: true, unique: true, compute: "outlet + '/' + category"}
22
+ views:
23
+ list:
24
+ columns: [category, station, outlet]
25
+ filters: [outlet, station, category]
26
+ sort: category
@@ -0,0 +1,40 @@
1
+ # yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/model.json
2
+ # A place in an outlet's kitchen that gets its own tickets: Bar (drinks), Dapur panas (hot food), Pastry. Which items
3
+ # go there is set by kitchen_route (item category -> station). An outlet with no active station makes no ticket.
4
+ name: kitchen_station
5
+ label: {id: Stasiun dapur, en: Kitchen station}
6
+ icon: stock
7
+ naming: STD-{###}
8
+ title_field: station_name
9
+ permissions:
10
+ - {role: head_office, read: true, create: true, write: true, delete: true, print: true}
11
+ # flow kitchen_ticket_on_sale reads the stations of the outlet as the cashier who took the payment
12
+ - {role: cashier, read: true}
13
+ - {role: kitchen, read: true}
14
+ - {role: outlet_staff, read: true}
15
+ fields:
16
+ - name: station_name
17
+ type: data
18
+ label: {id: Nama stasiun}
19
+ help: {id: 'Misalnya Bar, Dapur panas, Pastry'}
20
+ required: true
21
+ in_list: true
22
+ - name: outlet
23
+ type: link
24
+ to: outlet
25
+ label: {id: Outlet}
26
+ required: true
27
+ in_list: true
28
+ - name: active
29
+ type: check
30
+ label: {id: Aktif}
31
+ default: 'true'
32
+ in_list: true
33
+ - {name: notes, type: text, label: {id: Catatan}}
34
+ # one station of a name per outlet
35
+ - {name: station_key, type: data, label: {id: Kunci stasiun}, hidden: true, unique: true, compute: "outlet + '/' + station_name"}
36
+ views:
37
+ list:
38
+ columns: [station_name, outlet, active]
39
+ filters: [outlet, active]
40
+ sort: station_name