@rangka-os/create 0.5.0-alpha.26 → 0.5.0-alpha.28

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 (189) hide show
  1. package/package.json +1 -1
  2. package/template/base/apps/absen_karyawan/app.rk +37 -0
  3. package/template/base/apps/absen_karyawan/dashboards/absen_hari_ini.rk +20 -0
  4. package/template/base/apps/absen_karyawan/dashboards/absen_karyawan_saya.rk +14 -0
  5. package/template/base/apps/absen_karyawan/dashboards/rekap_absen_karyawan.rk +12 -0
  6. package/template/base/apps/jasa_proyek/app.rk +1 -1
  7. package/template/base/apps/kasir/app.rk +5 -1
  8. package/template/base/apps/kasir/dashboards/kasir_ringkas.rk +4 -0
  9. package/template/base/apps/kasir/skills/rangka-app-kasir/SKILL.md +20 -0
  10. package/template/base/connectors/email/connector.rk +144 -0
  11. package/template/base/connectors/email/fixtures/email_received.json +33 -0
  12. package/template/base/connectors/email/fixtures/email_received_reply.json +31 -0
  13. package/template/base/connectors/email/fixtures/expect.json +20 -0
  14. package/template/base/connectors/email/fixtures/fetch_email.json +66 -0
  15. package/template/base/connectors/email/fixtures/send_email.json +4 -0
  16. package/template/base/connectors/midtrans/connector.rk +249 -0
  17. package/template/base/connectors/midtrans/fixtures/charge_gopay.json +34 -0
  18. package/template/base/connectors/midtrans/fixtures/charge_qris.json +23 -0
  19. package/template/base/connectors/midtrans/fixtures/charge_va.json +20 -0
  20. package/template/base/connectors/midtrans/fixtures/create_snap.json +4 -0
  21. package/template/base/connectors/midtrans/fixtures/expect.json +88 -0
  22. package/template/base/connectors/midtrans/fixtures/get_status.json +15 -0
  23. package/template/base/connectors/midtrans/fixtures/payment_notified.json +28 -0
  24. package/template/base/connectors/midtrans/fixtures/payment_notified_challenge.json +24 -0
  25. package/template/base/connectors/midtrans/fixtures/payment_notified_expire.json +24 -0
  26. package/template/base/connectors/midtrans/fixtures/payment_notified_other_amount.json +28 -0
  27. package/template/base/connectors/midtrans/fixtures/payment_notified_partial_refund.json +34 -0
  28. package/template/base/connectors/midtrans/fixtures/payment_notified_pending.json +31 -0
  29. package/template/base/connectors/midtrans/fixtures/payment_notified_refund.json +34 -0
  30. package/template/base/connectors/midtrans/fixtures/payment_notified_relabelled.json +28 -0
  31. package/template/base/connectors/midtrans/fixtures/payment_notified_va.json +32 -0
  32. package/template/base/connectors/midtrans/fixtures/signature_vector.txt +3 -0
  33. package/template/base/connectors/midtrans/mock/midtrans_mock.py +335 -0
  34. package/template/base/connectors/rangka_whatsapp/README.md +105 -0
  35. package/template/base/connectors/rangka_whatsapp/connector.rk +141 -0
  36. package/template/base/connectors/rangka_whatsapp/fixtures/expect.json +9 -0
  37. package/template/base/connectors/rangka_whatsapp/fixtures/message_received.json +1 -0
  38. package/template/base/connectors/rangka_whatsapp/fixtures/message_status.json +1 -0
  39. package/template/base/connectors/rangka_whatsapp/fixtures/message_status_refused.json +1 -0
  40. package/template/base/connectors/rangka_whatsapp/fixtures/opted_out.json +1 -0
  41. package/template/base/connectors/rangka_whatsapp/fixtures/send_template.json +1 -0
  42. package/template/base/connectors/rangka_whatsapp/fixtures/send_template_duplicate.json +1 -0
  43. package/template/base/connectors/rangka_whatsapp/fixtures/set_opt_out.json +1 -0
  44. package/template/base/connectors/rangka_whatsapp/mock/rangka_whatsapp_mock.py +354 -0
  45. package/template/base/connectors/shopee/connector.rk +360 -0
  46. package/template/base/connectors/shopee/fixtures/expect.json +119 -0
  47. package/template/base/connectors/shopee/fixtures/get_models.json +52 -0
  48. package/template/base/connectors/shopee/fixtures/get_order_detail.json +396 -0
  49. package/template/base/connectors/shopee/fixtures/get_settlement.json +90 -0
  50. package/template/base/connectors/shopee/fixtures/get_tracking.json +13 -0
  51. package/template/base/connectors/shopee/fixtures/list_items.json +29 -0
  52. package/template/base/connectors/shopee/fixtures/list_orders.json +31 -0
  53. package/template/base/connectors/shopee/fixtures/list_settlements.json +15 -0
  54. package/template/base/connectors/shopee/fixtures/order_changed.json +101 -0
  55. package/template/base/connectors/shopee/fixtures/order_changed_cancelled.json +72 -0
  56. package/template/base/connectors/shopee/fixtures/order_changed_completed.json +101 -0
  57. package/template/base/connectors/shopee/fixtures/order_changed_in_cancel.json +72 -0
  58. package/template/base/connectors/shopee/fixtures/order_changed_unpaid.json +71 -0
  59. package/template/base/connectors/shopee/fixtures/order_settled.json +92 -0
  60. package/template/base/connectors/shopee/fixtures/push_received.json +12 -0
  61. package/template/base/connectors/shopee/fixtures/push_received_tracking.json +11 -0
  62. package/template/base/connectors/shopee/fixtures/update_stock.json +15 -0
  63. package/template/base/connectors/shopee/mock/shopee_mock.py +894 -0
  64. package/template/base/connectors/tiktok_shop/connector.rk +300 -0
  65. package/template/base/connectors/tiktok_shop/fixtures/expect.json +105 -0
  66. package/template/base/connectors/tiktok_shop/fixtures/get_order_detail.json +136 -0
  67. package/template/base/connectors/tiktok_shop/fixtures/get_settlement.json +83 -0
  68. package/template/base/connectors/tiktok_shop/fixtures/get_tracking.json +28 -0
  69. package/template/base/connectors/tiktok_shop/fixtures/list_orders.json +242 -0
  70. package/template/base/connectors/tiktok_shop/fixtures/list_products.json +77 -0
  71. package/template/base/connectors/tiktok_shop/fixtures/list_settlements.json +22 -0
  72. package/template/base/connectors/tiktok_shop/fixtures/list_shops.json +17 -0
  73. package/template/base/connectors/tiktok_shop/fixtures/order_changed.json +129 -0
  74. package/template/base/connectors/tiktok_shop/fixtures/order_changed_cancelled.json +81 -0
  75. package/template/base/connectors/tiktok_shop/fixtures/order_changed_completed.json +106 -0
  76. package/template/base/connectors/tiktok_shop/fixtures/order_changed_on_hold.json +104 -0
  77. package/template/base/connectors/tiktok_shop/fixtures/order_changed_tokopedia.json +106 -0
  78. package/template/base/connectors/tiktok_shop/fixtures/order_changed_unpaid.json +79 -0
  79. package/template/base/connectors/tiktok_shop/fixtures/order_settled.json +73 -0
  80. package/template/base/connectors/tiktok_shop/fixtures/update_stock.json +6 -0
  81. package/template/base/connectors/tiktok_shop/fixtures/webhook_received.json +12 -0
  82. package/template/base/connectors/tiktok_shop/fixtures/webhook_received_cancellation.json +13 -0
  83. package/template/base/connectors/tiktok_shop/mock/tiktok_shop_mock.py +819 -0
  84. package/template/base/connectors/whatsapp_business/connector.rk +3 -1
  85. package/template/base/connectors/whatsapp_business/templates.md +13 -1
  86. package/template/base/modules/attendance/flows/attendance_missing_digest.rk +30 -0
  87. package/template/base/modules/attendance/flows/attendance_period_on_cancel.rk +15 -0
  88. package/template/base/modules/attendance/flows/attendance_period_on_submit.rk +60 -0
  89. package/template/base/modules/attendance/flows/staff_attendance_cancel_guard.rk +14 -0
  90. package/template/base/modules/attendance/flows/staff_attendance_guard_created.rk +16 -0
  91. package/template/base/modules/attendance/flows/staff_attendance_guard_submitted.rk +37 -0
  92. package/template/base/modules/attendance/flows/staff_attendance_guard_updated.rk +14 -0
  93. package/template/base/modules/attendance/models/attendance_period.rk +62 -0
  94. package/template/base/modules/attendance/models/attendance_summary.rk +37 -0
  95. package/template/base/modules/attendance/models/staff_attendance.rk +281 -0
  96. package/template/base/modules/attendance/models/staff_attendance_guard.rk +50 -0
  97. package/template/base/modules/attendance/module.rk +18 -0
  98. package/template/base/modules/attendance/screens/absen_outlet.rk +22 -0
  99. package/template/base/modules/catalogue/models/item.rk +69 -0
  100. package/template/base/modules/catalogue/module.rk +1 -1
  101. package/template/base/modules/contacts/models/customer.rk +43 -19
  102. package/template/base/modules/contacts/module.rk +1 -1
  103. package/template/base/modules/coretax/module.rk +1 -1
  104. package/template/base/modules/coretax/print/coretax_faktur.rk +3 -2
  105. package/template/base/modules/coretax/print/coretax_faktur.xml +3 -1
  106. package/template/base/modules/coretax/print/rekap_ppn.html +9 -7
  107. package/template/base/modules/courses/flows/charge_invoice_on_submit.rk +15 -0
  108. package/template/base/modules/courses/module.rk +1 -1
  109. package/template/base/modules/courses/screens/absen_kelas.rk +1 -0
  110. package/template/base/modules/invoicing/flows/invoice_due_digest.rk +45 -7
  111. package/template/base/modules/invoicing/models/sales_invoice_item.rk +4 -1
  112. package/template/base/modules/invoicing/module.rk +15 -2
  113. package/template/base/modules/kitchen/screens/dapur.rk +1 -0
  114. package/template/base/modules/outlets/models/outlet.rk +69 -0
  115. package/template/base/modules/outlets/module.rk +1 -1
  116. package/template/base/modules/payments/flows/payment_from_midtrans.rk +85 -0
  117. package/template/base/modules/payments/flows/payment_refund_from_midtrans.rk +22 -0
  118. package/template/base/modules/payments/models/payment.rk +2 -1
  119. package/template/base/modules/payments/module.rk +1 -1
  120. package/template/base/modules/payroll/flows/payroll_close_on_cancel.rk +8 -5
  121. package/template/base/modules/payroll/flows/payroll_close_on_submit.rk +8 -5
  122. package/template/base/modules/payroll/flows/payroll_reminder.rk +106 -0
  123. package/template/base/modules/payroll/flows/payroll_run_overlap_guard_created.rk +5 -3
  124. package/template/base/modules/payroll/flows/payroll_run_overlap_guard_updated.rk +5 -3
  125. package/template/base/modules/payroll/flows/payslip_from_recap.rk +1 -1
  126. package/template/base/modules/payroll/imports/payroll_profile_list.rk +27 -0
  127. package/template/base/modules/payroll/models/payroll_close.rk +10 -6
  128. package/template/base/modules/payroll/models/payroll_run.rk +64 -15
  129. package/template/base/modules/payroll/models/payslip.rk +48 -9
  130. package/template/base/modules/payroll/module.rk +22 -5
  131. package/template/base/modules/payroll/print/payslip.html +4 -1
  132. package/template/base/modules/pos/models/pos_sale.rk +136 -9
  133. package/template/base/modules/pos/models/pos_sale_item.rk +33 -1
  134. package/template/base/modules/pos/module.rk +5 -3
  135. package/template/base/modules/pos/print/pos_receipt.html +7 -3
  136. package/template/base/modules/pos/screens/kasir.rk +7 -2
  137. package/template/base/modules/procurement/flows/reorder_draft_po.rk +57 -0
  138. package/template/base/modules/procurement/models/vendor_bill.rk +14 -1
  139. package/template/base/modules/procurement/module.rk +11 -2
  140. package/template/base/modules/projects/screens/absen.rk +1 -0
  141. package/template/base/modules/promotions/flows/promo_code_batch_on_submit.rk +26 -0
  142. package/template/base/modules/promotions/flows/promotion_apply.rk +110 -0
  143. package/template/base/modules/promotions/flows/promotion_apply_on_create.rk +110 -0
  144. package/template/base/modules/promotions/flows/promotion_apply_on_delete.rk +111 -0
  145. package/template/base/modules/promotions/flows/promotion_apply_on_update.rk +110 -0
  146. package/template/base/modules/promotions/flows/promotion_on_sale.rk +95 -0
  147. package/template/base/modules/promotions/flows/promotion_on_sale_cancel.rk +43 -0
  148. package/template/base/modules/promotions/models/promo_code.rk +27 -0
  149. package/template/base/modules/promotions/models/promo_code_batch.rk +36 -0
  150. package/template/base/modules/promotions/models/promo_guard.rk +44 -0
  151. package/template/base/modules/promotions/models/promotion.rk +197 -0
  152. package/template/base/modules/promotions/models/promotion_ledger.rk +35 -0
  153. package/template/base/modules/promotions/module.rk +20 -0
  154. package/template/base/modules/rental/screens/alat_keluar.rk +1 -0
  155. package/template/base/modules/rental/screens/alat_kembali.rk +1 -0
  156. package/template/base/modules/rental/screens/jadwal_alat.rk +1 -0
  157. package/template/base/modules/stock/flows/stock_low_alert.rk +65 -0
  158. package/template/base/modules/stock/flows/stock_negative_alert.rk +14 -5
  159. package/template/base/modules/stock/models/stock_reorder.rk +34 -0
  160. package/template/base/modules/stock/module.rk +17 -2
  161. package/template/base/modules/subscriptions/screens/catat_tagih.rk +1 -0
  162. package/template/base/modules/subscriptions/screens/rute_tagih.rk +1 -0
  163. package/template/base/modules/users/flows/summary_daily.rk +83 -0
  164. package/template/base/modules/users/flows/summary_monthly.rk +83 -0
  165. package/template/base/modules/users/flows/summary_weekly.rk +83 -0
  166. package/template/base/modules/users/models/business_summary.rk +67 -0
  167. package/template/base/modules/users/models/summary_setting.rk +35 -0
  168. package/template/base/modules/users/models/user.rk +11 -3
  169. package/template/base/modules/users/module.rk +21 -2
  170. package/template/base/modules/users/roles/employee.rk +8 -0
  171. package/template/base/modules/users/roles/outlet_supervisor.rk +7 -0
  172. package/template/base/modules/whatsapp/flows/whatsapp_customer_opt_out.rk +16 -0
  173. package/template/base/modules/whatsapp/flows/whatsapp_customer_opt_out_new.rk +17 -0
  174. package/template/base/modules/whatsapp/flows/whatsapp_message_status.rk +24 -0
  175. package/template/base/modules/whatsapp/flows/whatsapp_opted_out.rk +26 -0
  176. package/template/base/modules/whatsapp/models/whatsapp_message.rk +99 -0
  177. package/template/base/modules/whatsapp/models/whatsapp_opt_out.rk +44 -0
  178. package/template/base/modules/whatsapp/module.rk +23 -0
  179. package/template/base/modules/whatsapp_booking/flows/whatsapp_booking_tomorrow.rk +48 -0
  180. package/template/base/modules/whatsapp_booking/module.rk +13 -0
  181. package/template/base/modules/whatsapp_order_ready/flows/whatsapp_pickup_on_sale.rk +19 -0
  182. package/template/base/modules/whatsapp_order_ready/flows/whatsapp_ticket_ready.rk +40 -0
  183. package/template/base/modules/whatsapp_order_ready/models/whatsapp_pickup.rk +22 -0
  184. package/template/base/modules/whatsapp_order_ready/module.rk +14 -0
  185. package/template/base/modules/whatsapp_receipt/flows/whatsapp_receipt_on_sale.rk +43 -0
  186. package/template/base/modules/whatsapp_receipt/module.rk +13 -0
  187. package/template/base/modules/whatsapp_reminder/flows/whatsapp_invoice_overdue.rk +64 -0
  188. package/template/base/modules/whatsapp_reminder/module.rk +15 -0
  189. package/template/base/modules/workforce/imports/worker_list.rk +4 -1
@@ -0,0 +1,50 @@
1
+ # yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/model.json
2
+ name: staff_attendance_guard
3
+ label: {id: Penjaga absen karyawan, en: Staff attendance guard}
4
+ icon: check
5
+ naming: SAG-{######}
6
+ title_field: reason
7
+ # Never stored (the pattern of projects/models/attendance_guard.rk): a flow that must refuse the action it runs in
8
+ # creates one, and the rule of its reason fails with that message, which rolls the whole action back. Create is granted
9
+ # to every role whose saves, submits and cancels run those flows (an approved submit runs as the employee who asked).
10
+ permissions:
11
+ - {role: cashier, create: true}
12
+ - {role: outlet_staff, create: true}
13
+ - {role: employee, create: true}
14
+ - {role: outlet_supervisor, create: true}
15
+ - {role: head_office, create: true}
16
+ fields:
17
+ - name: reason
18
+ type: select
19
+ label: {id: Alasan}
20
+ required: true
21
+ options:
22
+ - {value: second_log, label: {id: Absen kedua di hari yang sama}}
23
+ - {value: period_closed, label: {id: Periode absen sudah direkap}}
24
+ - {value: period_overlap, label: {id: Periode rekap tumpang tindih}}
25
+ - {value: photo_reused, label: {id: Foto absen dipakai ulang}}
26
+ - {value: period_summarised, label: {id: Rekap absen sudah diringkas}}
27
+ - name: document
28
+ type: data
29
+ label: {id: Dokumen}
30
+ rules:
31
+ - name: second_log
32
+ on: save
33
+ check: reason != 'second_log'
34
+ message: {id: 'Karyawan ini sudah punya absen di tanggal itu (satu absen per orang per hari)'}
35
+ - name: period_closed
36
+ on: save
37
+ check: reason != 'period_closed'
38
+ message: {id: 'Absen tanggal ini sudah masuk rekap absen karyawan yang diajukan; batalkan rekapnya dulu'}
39
+ - name: period_overlap
40
+ on: save
41
+ check: reason != 'period_overlap'
42
+ message: {id: 'Sudah ada rekap absen karyawan yang tanggal dan outletnya tumpang tindih'}
43
+ - name: photo_reused
44
+ on: save
45
+ check: reason != 'photo_reused'
46
+ message: {id: 'Foto ini sudah dipakai absen lain; ambil foto baru untuk absen hari ini'}
47
+ - name: period_summarised
48
+ on: save
49
+ check: reason != 'period_summarised'
50
+ message: {id: 'Rekap absen ini sudah punya ringkasan; batalkan rekapnya dulu kalau mau mengulang'}
@@ -0,0 +1,18 @@
1
+ # yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/module.json
2
+ name: attendance
3
+ version: 1.0.1
4
+ title: {id: Absen karyawan, en: Staff attendance}
5
+ summary:
6
+ id: Absen masuk dan pulang dari HP di outlet, dengan lokasi GPS dan selfie, terlambat dan lembur, rekap bulanan per karyawan.
7
+ en: Clock in and out from the phone at an outlet with GPS position and a selfie, lateness and overtime, a monthly summary per employee.
8
+ category: people
9
+ icon: time-line
10
+ # Outlet staff attendance (rangka-apps#100). Field workers of projects keep their own attendance_log (module projects):
11
+ # project billing and work sites differ, so the two are not merged.
12
+ requires: {rangka: '>=0.5', users: ^1.5, outlets: ^1.6}
13
+ notices:
14
+ - name: attendance_missing
15
+ label: {id: Belum absen masuk, en: Not clocked in yet}
16
+ description: {id: 'Tiap pagi jam 10: karyawan outlet yang belum absen masuk hari ini.'}
17
+ severity: info
18
+ to: [owner, head_office]
@@ -0,0 +1,22 @@
1
+ # yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/screen.json
2
+ name: absen_outlet
3
+ type: clock
4
+ label: {id: Absen, en: Clock in}
5
+ description: {id: 'Absen masuk dan pulang di outlet dari HP, dengan foto dan lokasimu.'}
6
+ icon: clock
7
+ # Outlet staff clock in and out at their outlet from their phone (contract 0030 §2 clock). The outlets offered are the
8
+ # member's own (the outlets set in Tim; only head office or the owner without outlets sees every active outlet), with the outlet's point and
9
+ # radius. A clock-in outside the radius or without a position is saved with the reason and waits for the outlet
10
+ # supervisor or head office (staff_attendance approvals); the record's computes decide, not the phone. No offline queue:
11
+ # every clock-in carries a selfie, which needs the connection (contract 0030 §7). The kitchen role is not listed, so the
12
+ # module installs without module kitchen: kitchen staff clock in with the employee role (docs/attendance.md).
13
+ roles: [cashier, outlet_staff, employee, outlet_supervisor, head_office]
14
+ device: phone
15
+ needs: [location, photo]
16
+ clock:
17
+ record: {model: staff_attendance, filter: "docstatus == 0 && employee == user.name"}
18
+ in: {field: clock_in, location: in_pos, photo: in_photo}
19
+ out: {field: clock_out, location: out_pos, photo: out_photo}
20
+ site: {model: outlet, link: outlet, filter: "active && (name in user.outlets || (user.outlets.size() == 0 && ('head_office' in user.roles || 'owner' in user.roles)))", title: outlet_name, location: point, radius_m: radius_m}
21
+ reason: reason
22
+ submit: true
@@ -115,6 +115,27 @@ fields:
115
115
  help: {id: 'Yang dibayar ke penitip per barang terjual'}
116
116
  depends_on: app_installed('consignment') && consignor != ''
117
117
  hidden_for: [outlet_staff, cashier, field_sales, sales_rep]
118
+ # Reorder point (modules stock and procurement): when the balance of this item in an outlet falls below
119
+ # reorder_level, flow stock/stock_low_alert tells head office once, and procurement/reorder_draft_po puts it on a
120
+ # draft purchase order for default_vendor. 0 = not watched. Nothing is ordered without a person submitting the draft.
121
+ - name: reorder_level
122
+ type: float
123
+ label: {id: Batas stok minimum, en: Reorder level}
124
+ help: {id: 'Kalau stok di sebuah outlet turun di bawah angka ini, kamu dikabari. Isi 0 kalau tidak perlu dipantau'}
125
+ default: '0'
126
+ depends_on: app_installed('stock')
127
+ - name: reorder_qty
128
+ type: float
129
+ label: {id: Jumlah pesan ulang, en: Reorder quantity}
130
+ help: {id: 'Jumlah di draft pesanan pembelian. Isi 0 untuk memesan sampai stok kembali ke batas minimum'}
131
+ default: '0'
132
+ depends_on: app_installed('stock') && app_installed('procurement')
133
+ - name: default_vendor
134
+ type: link
135
+ to: vendor
136
+ label: {id: Pemasok utama, en: Main supplier}
137
+ help: {id: 'Draft pesanan pembelian otomatis dibuat untuk pemasok ini. Kosongkan kalau tidak perlu draft'}
138
+ depends_on: app_installed('stock') && app_installed('procurement')
118
139
  - name: notes
119
140
  type: text
120
141
  label: {id: Catatan}
@@ -124,6 +145,50 @@ fields:
124
145
  label: {id: Kode barang/jasa Coretax}
125
146
  help: {id: '6 angka dari referensi kode barang/jasa Coretax. Kosongkan bila tidak tahu (000000)'}
126
147
  depends_on: app_installed('coretax')
148
+ # Promo (module promotions): the live all-outlet item promo with the highest priority that covers this item, written only by
149
+ # flow promotion_apply (every 5 minutes and when a promo is saved) and cleared when it ends. A sale line computes its
150
+ # promo from these fields as it computes its price from rate, so a paired device pulls them with the catalogue and
151
+ # computes the same total offline (rangka-os contract 0058 §10). promo is a promotion's name as text: catalogue does
152
+ # not link a module above it. promo_invoice_pct is the live percent promo for invoices (channel invoice or both, all
153
+ # outlets), the default line discount of a new sales invoice line.
154
+ - {name: promo, type: data, label: {id: Promo aktif}, read_only: true, in_list: true, depends_on: app_installed('promotions')}
155
+ - {name: promo_name, type: data, label: {id: Nama promo}, read_only: true, depends_on: app_installed('promotions')}
156
+ - name: promo_kind
157
+ type: select
158
+ label: {id: Jenis promo}
159
+ read_only: true
160
+ depends_on: app_installed('promotions')
161
+ options:
162
+ - {value: pct, label: {id: Diskon persen}}
163
+ - {value: 'off', label: {id: Potongan rupiah}}
164
+ - {value: buy_get, label: {id: Beli X gratis Y}}
165
+ - {name: promo_pct, type: float, label: {id: 'Diskon promo %'}, read_only: true, depends_on: app_installed('promotions')}
166
+ - {name: promo_off, type: currency, label: {id: Potongan promo per barang}, read_only: true, depends_on: app_installed('promotions')}
167
+ - {name: promo_buy, type: int, label: {id: Promo beli}, read_only: true, depends_on: app_installed('promotions')}
168
+ - {name: promo_get, type: int, label: {id: Promo gratis}, read_only: true, depends_on: app_installed('promotions')}
169
+ - {name: promo_outlet, type: data, label: {id: Outlet promo}, read_only: true, depends_on: app_installed('promotions')}
170
+ - {name: promo_until, type: date, label: {id: Promo sampai}, read_only: true, depends_on: app_installed('promotions')}
171
+ - {name: promo_invoice_pct, type: float, label: {id: 'Diskon promo faktur %'}, read_only: true, depends_on: app_installed('promotions')}
172
+ # the live promo of one outlet that beats the all-outlet one above there (same priority or higher); a sale at that
173
+ # outlet takes it, every other outlet keeps promo. Two outlet promos on one item at once: the higher priority one
174
+ # holds this slot (promotion.help says so).
175
+ - {name: promo_o, type: data, label: {id: Promo outlet}, read_only: true, depends_on: app_installed('promotions')}
176
+ - {name: promo_o_name, type: data, label: {id: Nama promo outlet}, read_only: true, depends_on: app_installed('promotions')}
177
+ - name: promo_o_kind
178
+ type: select
179
+ label: {id: Jenis promo outlet}
180
+ read_only: true
181
+ depends_on: app_installed('promotions')
182
+ options:
183
+ - {value: pct, label: {id: Diskon persen}}
184
+ - {value: 'off', label: {id: Potongan rupiah}}
185
+ - {value: buy_get, label: {id: Beli X gratis Y}}
186
+ - {name: promo_o_pct, type: float, label: {id: 'Diskon promo outlet %'}, read_only: true, depends_on: app_installed('promotions')}
187
+ - {name: promo_o_off, type: currency, label: {id: Potongan promo outlet}, read_only: true, depends_on: app_installed('promotions')}
188
+ - {name: promo_o_buy, type: int, label: {id: Promo outlet beli}, read_only: true, depends_on: app_installed('promotions')}
189
+ - {name: promo_o_get, type: int, label: {id: Promo outlet gratis}, read_only: true, depends_on: app_installed('promotions')}
190
+ - {name: promo_o_outlet, type: data, label: {id: Outlet promo khusus}, read_only: true, depends_on: app_installed('promotions')}
191
+ - {name: promo_o_until, type: date, label: {id: Promo outlet sampai}, read_only: true, depends_on: app_installed('promotions')}
127
192
  # Records already linked by documents cannot be deleted (kernel: 409 linked); one no longer used is switched off
128
193
  # instead and kept for its history. Hiding it from link pickers is a kernel follow-up (web).
129
194
  - name: active
@@ -134,6 +199,10 @@ fields:
134
199
  in_list: true
135
200
  in_filter: true
136
201
  rules:
202
+ - name: reorder_not_negative
203
+ on: save
204
+ check: reorder_level >= 0 && reorder_qty >= 0
205
+ message: {id: Batas stok minimum dan jumlah pesan ulang tidak boleh negatif}
137
206
  - name: coretax_code_6
138
207
  on: save
139
208
  check: "coretax_code == '' || coretax_code.matches('^[0-9]{6}$')"
@@ -1,6 +1,6 @@
1
1
  # yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/module.json
2
2
  name: catalogue
3
- version: 1.3.1
3
+ version: 1.5.0
4
4
  title: {id: Katalog, en: Catalogue}
5
5
  summary:
6
6
  id: Daftar barang dan jasa dengan kategori, satuan dan daftar harga.
@@ -13,6 +13,9 @@ permissions:
13
13
  # outlet staff pick customers (POS, outlet sales, returns) but never see their money, credit or tax identity: the
14
14
  # money and identity fields are hidden_for outlet_staff (contract 0027; card t_5ba74e22)
15
15
  - {role: outlet_staff, read: true}
16
+ # the cashier picks a customer at the counter or signs a new one up (module pos, rangka-apps#103): name and number
17
+ # only; money, credit and tax identity stay hidden from it like from outlet staff
18
+ - {role: cashier, read: true, create: true}
16
19
  - {role: sales_rep, read: true, create: true, write: true}
17
20
  # credit_limit, credit_hold, credit_hold_reason, payment_days and price_tier (the customer's credit and terms) are
18
21
  # decided by the sales and finance managers (and the owner):
@@ -39,6 +42,27 @@ fields:
39
42
  - name: phone
40
43
  type: phone
41
44
  label: {id: Nomor WhatsApp}
45
+ # WhatsApp (module whatsapp): the number in one form, digits with the country code, the form Rangka Cloud's opt-out
46
+ # events carry; empty when phone is not a number. The same rule as Rangka Cloud's NormalizePhone: without a plus, a
47
+ # number starting with 0 or 8 is Indonesian (0812…, 812… -> 62812…) and 00 starts an international one; with a
48
+ # plus the country code is as written; a trunk 0 after 62 is dropped (+62 0812… -> 62812…). Vectors in
49
+ # tests/day_one_whatsapp.py PHONE_VECTORS and rangka-cloud TestPhoneRuleVectors.
50
+ - name: wa_number
51
+ type: data
52
+ label: {id: Nomor WhatsApp (seragam)}
53
+ hidden: true
54
+ index: true
55
+ depends_on: app_installed('whatsapp')
56
+ compute: "(phone.trim().startsWith('+') ? ('x' + phone.replace(' ', '').replace('-', '').replace('.', '').replace('(', '').replace(')', '').replace('+', '')).replace('x620', 'x62').replace('x', '') : ('x' + phone.replace(' ', '').replace('-', '').replace('.', '').replace('(', '').replace(')', '').replace('+', '')).replace('x8', 'x628').replace('x00', 'x').replace('x0', 'x62').replace('x620', 'x62').replace('x', '')).matches('^[1-9][0-9]{7,14}$') ? (phone.trim().startsWith('+') ? ('x' + phone.replace(' ', '').replace('-', '').replace('.', '').replace('(', '').replace(')', '').replace('+', '')).replace('x620', 'x62').replace('x', '') : ('x' + phone.replace(' ', '').replace('-', '').replace('.', '').replace('(', '').replace(')', '').replace('+', '')).replace('x8', 'x628').replace('x00', 'x').replace('x0', 'x62').replace('x620', 'x62').replace('x', '')) : ''"
57
+ # Ticked by staff, or by flow whatsapp_opted_out when the customer replied BERHENTI: the WhatsApp flows skip the
58
+ # customer and Rangka Cloud is told (flow whatsapp_customer_opt_out). Unticking does not bring the messages back.
59
+ - name: wa_opt_out
60
+ type: check
61
+ label: {id: Tidak mau dikirimi WA}
62
+ help: {id: 'Pelanggan tidak dikirimi struk, pengingat atau kabar lewat WhatsApp'}
63
+ default: 'false'
64
+ in_filter: true
65
+ depends_on: app_installed('whatsapp')
42
66
  - name: email
43
67
  type: data
44
68
  label: {id: Email}
@@ -47,19 +71,19 @@ fields:
47
71
  label: {id: Tempo (hari)}
48
72
  default: '30'
49
73
  in_list: true
50
- read_only_for: [purchasing_manager, project_admin, head_office, sales_rep, course_admin]
74
+ read_only_for: [purchasing_manager, project_admin, head_office, sales_rep, course_admin, cashier]
51
75
  - name: credit_limit
52
76
  type: currency
53
77
  label: {id: Batas kredit}
54
78
  default: '25000000'
55
- hidden_for: [outlet_staff]
56
- read_only_for: [purchasing_manager, project_admin, head_office, sales_rep, course_admin]
79
+ hidden_for: [outlet_staff, cashier]
80
+ read_only_for: [purchasing_manager, project_admin, head_office, sales_rep, course_admin, cashier]
57
81
  - name: outstanding
58
82
  type: currency
59
83
  label: {id: Piutang}
60
84
  read_only: true
61
85
  in_list: true
62
- hidden_for: [outlet_staff]
86
+ hidden_for: [outlet_staff, cashier]
63
87
  # Distributor sales (module distribution): the salesman who visits the customer, the route, the price tier, and
64
88
  # the credit control that holds its orders (customer_order approvals). oldest_open_due is the earliest due date of
65
89
  # its open invoices, kept by the distribution flows; an order is held while it is before today.
@@ -87,42 +111,42 @@ fields:
87
111
  - {value: retail, label: {id: Eceran}}
88
112
  - {value: wholesale, label: {id: Grosir}}
89
113
  - {value: agent, label: {id: Agen}}
90
- read_only_for: [purchasing_manager, project_admin, head_office, sales_rep, course_admin]
114
+ read_only_for: [purchasing_manager, project_admin, head_office, sales_rep, course_admin, cashier]
91
115
  - name: credit_hold
92
116
  type: check
93
117
  label: {id: Tahan kredit}
94
118
  help: {id: Semua pesanan pelanggan ini butuh persetujuan sampai dicentang lagi}
95
119
  depends_on: app_installed('distribution')
96
- read_only_for: [purchasing_manager, project_admin, head_office, sales_rep, course_admin]
97
- hidden_for: [outlet_staff]
120
+ read_only_for: [purchasing_manager, project_admin, head_office, sales_rep, course_admin, cashier]
121
+ hidden_for: [outlet_staff, cashier]
98
122
  - name: credit_hold_reason
99
123
  type: data
100
124
  label: {id: Alasan tahan kredit}
101
125
  depends_on: app_installed('distribution')
102
- hidden_for: [outlet_staff]
103
- read_only_for: [purchasing_manager, project_admin, head_office, sales_rep, course_admin]
126
+ hidden_for: [outlet_staff, cashier]
127
+ read_only_for: [purchasing_manager, project_admin, head_office, sales_rep, course_admin, cashier]
104
128
  - name: oldest_open_due
105
129
  type: date
106
130
  label: {id: Jatuh tempo tertua yang belum lunas}
107
131
  read_only: true
108
132
  depends_on: app_installed('distribution')
109
- hidden_for: [outlet_staff]
133
+ hidden_for: [outlet_staff, cashier]
110
134
  - name: open_orders
111
135
  type: currency
112
136
  label: {id: Pesanan belum ditagih (dengan PPN)}
113
137
  read_only: true
114
138
  depends_on: app_installed('distribution')
115
- hidden_for: [outlet_staff]
139
+ hidden_for: [outlet_staff, cashier]
116
140
  - name: uninvoiced_deliveries
117
141
  type: currency
118
142
  label: {id: Terkirim belum ditagih (dengan PPN)}
119
143
  read_only: true
120
144
  depends_on: app_installed('delivery')
121
- hidden_for: [outlet_staff]
145
+ hidden_for: [outlet_staff, cashier]
122
146
  - name: npwp
123
147
  type: npwp
124
148
  label: {id: NPWP}
125
- hidden_for: [outlet_staff]
149
+ hidden_for: [outlet_staff, cashier]
126
150
  # Tax identity for e-Faktur (module coretax, contract 0029): a buyer is identified by NPWP 16 digits plus its NITKU
127
151
  # (22 digits, NPWP + 000000 for the head office), else NIK, else a passport. vat_collector sets the transaction
128
152
  # code (02 government, 03 other collectors such as BUMN).
@@ -131,32 +155,32 @@ fields:
131
155
  label: {id: NITKU}
132
156
  help: {id: 'ID TKU 22 digit dari Coretax. Kosongkan bila pusat (NPWP + 000000)'}
133
157
  depends_on: app_installed('coretax')
134
- hidden_for: [outlet_staff]
158
+ hidden_for: [outlet_staff, cashier]
135
159
  - name: nik
136
160
  type: data
137
161
  label: {id: NIK}
138
162
  help: {id: 'Untuk pembeli orang pribadi tanpa NPWP'}
139
163
  depends_on: app_installed('coretax')
140
- hidden_for: [outlet_staff]
164
+ hidden_for: [outlet_staff, cashier]
141
165
  - name: passport_no
142
166
  type: data
143
167
  label: {id: No. paspor}
144
168
  help: {id: 'Untuk pembeli warga negara asing tanpa NPWP/NIK'}
145
169
  depends_on: app_installed('coretax')
146
- hidden_for: [outlet_staff]
170
+ hidden_for: [outlet_staff, cashier]
147
171
  - name: country
148
172
  type: data
149
173
  label: {id: Kode negara}
150
174
  help: {id: 'Kode 3 huruf, IDN untuk Indonesia'}
151
175
  default: "'IDN'"
152
176
  depends_on: app_installed('coretax')
153
- read_only_for: [sales_manager, purchasing_manager, project_admin, head_office, sales_rep, course_admin]
177
+ read_only_for: [sales_manager, purchasing_manager, project_admin, head_office, sales_rep, course_admin, cashier]
154
178
  - name: vat_collector
155
179
  type: select
156
180
  label: {id: Pemungut PPN}
157
181
  default: "'none'"
158
182
  depends_on: app_installed('coretax')
159
- read_only_for: [sales_manager, purchasing_manager, project_admin, head_office, sales_rep, course_admin]
183
+ read_only_for: [sales_manager, purchasing_manager, project_admin, head_office, sales_rep, course_admin, cashier]
160
184
  options:
161
185
  - {value: none, label: {id: Bukan pemungut}}
162
186
  - {value: government, label: {id: Instansi pemerintah}}
@@ -197,7 +221,7 @@ views:
197
221
  - section: {id: Identitas}
198
222
  columns:
199
223
  - [customer_name, city, address, active]
200
- - [npwp, phone, email]
224
+ - [npwp, phone, email, wa_opt_out]
201
225
  - section: {id: Data pajak (e-Faktur)}
202
226
  columns:
203
227
  - [nitku, nik, passport_no]
@@ -1,6 +1,6 @@
1
1
  # yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/module.json
2
2
  name: contacts
3
- version: 1.2.6
3
+ version: 1.4.0
4
4
  title: {id: Kontak, en: Contacts}
5
5
  summary:
6
6
  id: Catat pelanggan dan pemasok di satu tempat, lengkap dengan batas kredit.
@@ -3,7 +3,7 @@
3
3
  # (TaxInvoiceBulk) and the unified withholding slips the firm issues (BPPU, BpuBulk), checked before download.
4
4
  # Decisions and sources: reports/keputusan-riset/09-pajak-coretax.md in the project folder.
5
5
  name: coretax
6
- version: 1.3.0
6
+ version: 1.3.1
7
7
  title: {id: Lapor pajak Coretax, en: Coretax tax filing}
8
8
  summary:
9
9
  id: Siapkan masa pajak dan berkas unduhan untuk lapor di Coretax.
@@ -12,8 +12,9 @@ related:
12
12
  model: sales_invoice
13
13
  range: {posting_date: [period_start, period_end]}
14
14
  # 07/08 (tidak dipungut, dibebaskan): a faktur pajak with PPN stated but not collected (card t_611be720); export
15
- # (PEB is its faktur) and Pasal 4A (no faktur) stay out
16
- filter: "docstatus == 1 && kind != 'retention' && ((tax_rate > 0 && ppn > 0) || efaktur_code == '07' || efaktur_code == '08')"
15
+ # (PEB is its faktur) and Pasal 4A (no faktur) stay out. A 07/08 with PPN base 0 (wages only in a fee-only PT, a
16
+ # settlement the down payment covers) has no tax base to state and is no faktur pajak, like a 04 with PPN 0 (card t_d3395a0a)
17
+ filter: "docstatus == 1 && kind != 'retention' && ((tax_rate > 0 && ppn > 0) || ((efaktur_code == '07' || efaktur_code == '08') && ppn_base > 0))"
17
18
  sort: name
18
19
  children: true
19
20
  limit: 1000
@@ -12,7 +12,9 @@
12
12
  {{- range .Related.invoices}}{{$inv := .}}
13
13
  {{- $fx := and .currency (ne .currency "IDR")}}
14
14
  {{- /* an invoice submitted before ppn_base existed has none (the kernel leaves such computes empty on frozen documents):
15
- its PPN was taken on the whole DPP */}}
15
+ its PPN was taken on the whole DPP. A 0 base never reaches here: a code with PPN has a base above 0, and a 07/08 with
16
+ base 0 (wages only in a fee-only PT, or a settlement the down payment covers) is filtered out as no faktur pajak
17
+ (card t_d3395a0a); every 07/08 has a stored base, which is older than the 07/08 codes */}}
16
18
  {{- $pb := .dpp}}{{if .ppn_base}}{{$pb = .ppn_base}}{{end}}
17
19
  {{- $fee := ne (dec $pb 2) (dec .dpp 2)}}
18
20
  {{- /* 07/08: the faktur states the PPN the facility leaves uncollected at the company's rate (coretax_vat_rate, frozen on
@@ -40,9 +40,11 @@ h2 { font-size: 1.05em; margin-top: 2mm; }
40
40
  {{- range $inv := .Related.invoices}}
41
41
  {{- $c := .efaktur_code}}
42
42
  {{- $tb0 := .dpp}}{{$otb0 := "0"}}{{$vat0 := "0"}}
43
- {{- /* in the XML exactly when coretax_faktur's filter takes it: 07/08, or a code with PPN charged (audit rekap F1: a coded
43
+ {{- /* in the XML exactly when coretax_faktur's filter takes it: 07/08 with a PPN base above 0, or a code with PPN charged (audit rekap F1: a coded
44
44
  invoice with ppn 0, wages only under PPN on the fee or a settlement the down payment covers, is not a faktur pajak) */}}
45
- {{- $inx := or (eq $c "07") (eq $c "08") (and $c .ppn)}}
45
+ {{- /* a 07/08 with PPN base 0 (wages only in a fee-only PT, a settlement the down payment covers) states no tax base,
46
+ so it is no faktur pajak either: counted under Z like a 04 with PPN 0 (card t_d3395a0a) */}}
47
+ {{- $inx := or (and (or (eq $c "07") (eq $c "08")) .ppn_base) (and $c .ppn)}}
46
48
  {{- if $inx}}
47
49
  {{- $fx := and .currency (ne .currency "IDR")}}
48
50
  {{- $pb := .dpp}}{{if .ppn_base}}{{$pb = .ppn_base}}{{end}}
@@ -66,8 +68,8 @@ h2 { font-size: 1.05em; margin-top: 2mm; }
66
68
  {{- if and $old $inx}}{{$g = "P"}}{{$pc = add $pc 1}}{{$pt = add $pt $tb0}}{{$pp = add $pp .ppn}}
67
69
  {{- else if $old}}{{$g = "X"}}
68
70
  {{- else if or (eq $c "02") (eq $c "03")}}{{$g = "B"}}{{$bc = add $bc 1}}{{$bt = add $bt $tb0}}{{$bo = add $bo $otb0}}{{$bv = add $bv $vat0}}{{$bp = add $bp .ppn}}
69
- {{- else if eq $c "07"}}{{$g = "C"}}{{$cc = add $cc 1}}{{$ct = add $ct $tb0}}{{$co = add $co $otb0}}{{$cv = add $cv $vat0}}{{$cp = add $cp .ppn}}
70
- {{- else if eq $c "08"}}{{$g = "D"}}{{$dc = add $dc 1}}{{$dt = add $dt $tb0}}{{$do = add $do $otb0}}{{$dv = add $dv $vat0}}{{$dp = add $dp .ppn}}
71
+ {{- else if and $inx (eq $c "07")}}{{$g = "C"}}{{$cc = add $cc 1}}{{$ct = add $ct $tb0}}{{$co = add $co $otb0}}{{$cv = add $cv $vat0}}{{$cp = add $cp .ppn}}
72
+ {{- else if and $inx (eq $c "08")}}{{$g = "D"}}{{$dc = add $dc 1}}{{$dt = add $dt $tb0}}{{$do = add $do $otb0}}{{$dv = add $dv $vat0}}{{$dp = add $dp .ppn}}
71
73
  {{- else if $inx}}{{$g = "A"}}{{$ac = add $ac 1}}{{$at = add $at $tb0}}{{$ao = add $ao $otb0}}{{$av = add $av $vat0}}{{$ap = add $ap .ppn}}
72
74
  {{- else if $c}}{{$g = "Z"}}{{$zc = add $zc 1}}{{$zt = add $zt .dpp}}
73
75
  {{- else if .ppn}}{{$g = "G"}}{{$gc = add $gc 1}}{{$gt = add $gt .dpp}}{{$gp = add $gp .ppn}}
@@ -90,11 +92,11 @@ h2 { font-size: 1.05em; margin-top: 2mm; }
90
92
  </table></div>
91
93
  {{if .Truncated.invoices}}<p class="note"><strong>Daftar dipotong:</strong> hanya 1.000 faktur pertama yang dihitung, jadi rekap di atas lebih kecil dari yang sebenarnya.</p>{{end}}
92
94
  {{- /* audit rekap F2/F3: an invoice of this period cancelled and replaced in another period. With a faktur pajak (the
93
- XML's own test: 07/08, or a code with PPN) its Faktur Pengganti goes to this period's pembetulan and is listed with its
95
+ XML's own test: 07/08 with a PPN base, or a code with PPN) its Faktur Pengganti goes to this period's pembetulan and is listed with its
94
96
  amounts; without one it is counted here in its group (export, Pasal 4A, PPN 0), where the original was */}}
95
97
  {{- $rn := "0"}}{{$rc := "0"}}{{$rt := "0"}}{{$rp := "0"}}
96
98
  {{- range .Related.replacements}}{{$pd := isodate .posting_date}}{{if or (gt $pd $.Doc.period_end) (lt $pd $.Doc.period_start)}}
97
- {{- $c := .efaktur_code}}{{$inx := or (eq $c "07") (eq $c "08") (and $c .ppn)}}
99
+ {{- $c := .efaktur_code}}{{$inx := or (and (or (eq $c "07") (eq $c "08")) .ppn_base) (and $c .ppn)}}
98
100
  {{- if eq $rn "0"}}
99
101
  <h2>Faktur yang diganti di masa lain</h2>
100
102
  <p class="note">Faktur asalnya di masa ini sudah dibatalkan dan diganti dengan tanggal di masa lain. Yang punya faktur pajak: buat Faktur Pengganti di Coretax dan masukkan ke pembetulan SPT masa ini. Yang tidak punya faktur pajak dihitung di kelompoknya di rekap masa ini; bila faktur asalnya dulu sudah punya faktur pajak di Coretax, batalkan faktur pajak itu. DPP yang tercantum adalah DPP faktur pajak (tanpa upah bila PPN hanya atas fee).</p>
@@ -149,7 +151,7 @@ h2 { font-size: 1.05em; margin-top: 2mm; }
149
151
  <tbody>
150
152
  <tr data-group="E" data-count="{{dec $ec 0}}" data-dpp="{{dec $et 2}}"><td>Ekspor BKP/JKP (tarif 0)</td><td class="num">{{dec $ec 0}}</td><td class="num">{{number $et 2}}</td><td class="num">0,00</td><td>PEB atau dokumen ekspor, bukan faktur keluaran</td></tr>
151
153
  <tr data-group="F" data-count="{{dec $fc 0}}" data-dpp="{{dec $ft 2}}"><td>Bukan objek PPN (Pasal 4A)</td><td class="num">{{dec $fc 0}}</td><td class="num">{{number $ft 2}}</td><td class="num">0,00</td><td>Tidak dilaporkan di SPT Masa PPN</td></tr>
152
- <tr data-group="Z" data-count="{{dec $zc 0}}" data-dpp="{{dec $zt 2}}"><td>Bertarif PPN tetapi PPN 0 (mis. upah saja atau lunas oleh uang muka)</td><td class="num">{{dec $zc 0}}</td><td class="num">{{number $zt 2}}</td><td class="num">0,00</td><td>Tidak ada faktur pajak; PPN-nya sudah di faktur uang muka atau tidak ada</td></tr>
154
+ <tr data-group="Z" data-count="{{dec $zc 0}}" data-dpp="{{dec $zt 2}}"><td>Bertarif PPN tetapi PPN 0, atau 07/08 tanpa DPP (mis. upah saja atau lunas oleh uang muka)</td><td class="num">{{dec $zc 0}}</td><td class="num">{{number $zt 2}}</td><td class="num">0,00</td><td>Tidak ada faktur pajak; PPN-nya sudah di faktur uang muka atau tidak ada</td></tr>
153
155
  <tr data-group="G" data-count="{{dec $gc 0}}" data-dpp="{{dec $gt 2}}" data-ppn="{{dec $gp 2}}"><td>Ditagih PPN tanpa kode faktur pajak</td><td class="num">{{dec $gc 0}}</td><td class="num">{{number $gt 2}}</td><td class="num">{{number $gp 2}}</td><td>Buat faktur pajaknya langsung di Coretax</td></tr>
154
156
  <tr data-group="H" data-count="{{dec $hc 0}}" data-dpp="{{dec $ht 2}}"><td>Tarif 0 lain (usaha belum PKP, tanpa dasar, atau fasilitas belum dipilih)</td><td class="num">{{dec $hc 0}}</td><td class="num">{{number $ht 2}}</td><td class="num">0,00</td><td>Periksa status PKP dan dasar tarif 0</td></tr>
155
157
  <tr data-group="P" data-count="{{dec $pc 0}}" data-dpp="{{dec $pt 2}}" data-ppn="{{dec $pp 2}}"><td>Faktur Pengganti untuk faktur masa lain</td><td class="num">{{dec $pc 0}}</td><td class="num">{{number $pt 2}}</td><td class="num">{{number $pp 2}}</td><td>Faktur Pengganti di Coretax dan pembetulan SPT masa asalnya</td></tr>
@@ -35,6 +35,21 @@ steps:
35
35
  - find: sales_invoice
36
36
  where: event.amended_from != '' && docstatus == 0 && notes.contains('[' + event.amended_from + ']')
37
37
  as: old
38
+ # card t_a010bbec (audit zero-rate-reason N3): a 0% draft this flow made before courses 1.3.0 has no tax_rate_reason,
39
+ # and in a PKP org every save of it is refused (zero_rate_needs_reason), so marking it replaced failed with a tax
40
+ # message the course admin cannot fix. The old flow wrote 0% for a VAT-exempt course, and any course is 0% when it was
41
+ # billed before the school became PKP. So the draft gets what this flow writes today for the same program (the
42
+ # amendment's vat_exempt): exempt course -> ground dibebaskan, education under PP 49/2022; taxable course -> the
43
+ # company's PPN rate. Only a 0% draft without a ground is touched; it is marked replaced below and never submitted.
44
+ - if: "old != null && tax.pkp && old.tax_rate == 0 && !(old.tax_rate_reason in ['export', 'exempt', 'not_collected', 'not_taxable']) && event.vat_exempt"
45
+ update: old
46
+ set:
47
+ tax_rate_reason: "'exempt'"
48
+ coretax_facility: "'education_pp49'"
49
+ - if: "old != null && tax.pkp && old.tax_rate == 0 && !(old.tax_rate_reason in ['export', 'exempt', 'not_collected', 'not_taxable']) && !event.vat_exempt"
50
+ update: old
51
+ set:
52
+ tax_rate: tax.ppn_rate
38
53
  - if: old != null
39
54
  update: old
40
55
  set:
@@ -1,6 +1,6 @@
1
1
  # yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/module.json
2
2
  name: courses
3
- version: 1.3.1
3
+ version: 1.3.2
4
4
  title: {id: Kursus dan pelatihan, en: Courses and training}
5
5
  summary:
6
6
  id: Program kursus, angkatan, peserta, pendaftaran, jadwal pertemuan dan tagihannya.
@@ -2,6 +2,7 @@
2
2
  name: absen_kelas
3
3
  type: roll
4
4
  label: {id: Absen kelas, en: Class roll}
5
+ description: {id: 'Buka sesi kelas hari ini, semua siswa sudah tertanda hadir; ubah yang izin, sakit atau tidak hadir.'}
5
6
  icon: users
6
7
  # The instructor marks today's class from the phone (plans/layar-kerja.md §3 #5, contract 0030 §2 roll): every
7
8
  # student starts present (flow session_of_the_day or session_fill_attendance), the instructor marks only who is
@@ -1,12 +1,50 @@
1
1
  # yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/flow.json
2
- # Morning list of invoices to chase: submitted, money still owed, due today or earlier. Goes to the owner today
3
- # (notify writes the audit log and email); the WhatsApp reminder to the customer waits for the connector runtime.
2
+ # Morning collection notices, Monday to Saturday at 08:00 (scheduler.timezone), to the owner and finance (contract 0066):
3
+ # - invoice_due: the submitted invoices due today with money still owed. One notice for the day, linked to the
4
+ # first of them. The WhatsApp reminder to the customer stays a person's click (print "Pesan tagihan WA").
5
+ # - invoice_overdue: only on a morning when at least one invoice became overdue since the last run (due yesterday;
6
+ # on Monday also Saturday's, since the flow does not run on Sunday). It gives the whole overdue position and
7
+ # links to the oldest invoice. A morning without a new overdue invoice sends nothing: the standing position is in
8
+ # the owner's daily summary (users/summary_daily).
9
+ # Each notice has one id per day, so running the flow twice tells nobody twice.
10
+ # The day is today, or event.as_of (YYYY-MM-DD) when the owner runs the flow by hand for another day (and in tests).
11
+ # Amounts are shortened (12,5 juta; 850 ribu) so the text stays a short message for mail now and WhatsApp later; the
12
+ # exact figures are on the invoices. `2024-01-01` was a Monday: days_between(...) % 7 == 0 is a Monday.
4
13
  name: invoice_due_digest
5
14
  label: {id: Daftar tagih pagi, en: Morning collection list}
15
+ description: {id: 'Tiap pagi, pemilik dan bagian keuangan dikabari faktur yang jatuh tempo hari ini dan yang baru lewat jatuh tempo.'}
6
16
  schedule: 0 8 * * 1-6
7
17
  steps:
8
- - {find_all: sales_invoice, where: "docstatus == 1 && outstanding > 0 && due_date <= today()", sort: due_date, as: due}
9
- - if: size(due) > 0
10
- notify: owner
11
- channel: email
12
- template: {id: 'Tagih hari ini: {size(due)} faktur jatuh tempo, sisa Rp {due.map(i, i.outstanding).sum()}. Cetak "Pesan tagihan WA" di tiap faktur.'}
18
+ - find_all: sales_invoice
19
+ where: "docstatus == 1 && due_date == ('as_of' in event ? event.as_of : today()) && outstanding > 0"
20
+ sort: name
21
+ as: due
22
+ - find_all: sales_invoice
23
+ where: "docstatus == 1 && due_date < ('as_of' in event ? event.as_of : today()) && due_date != '' && outstanding > 0"
24
+ sort: due_date
25
+ as: late
26
+ - for_each: "size(due) > 0 ? [due[0]] : []"
27
+ as: first
28
+ do:
29
+ - notify: finance_manager
30
+ notice: invoice_due
31
+ channel: email
32
+ record: first
33
+ id: "'due:' + ('as_of' in event ? event.as_of : today())"
34
+ title: 'Tagih hari ini: {size(due)} faktur jatuh tempo'
35
+ template: >-
36
+ Sisa tagihan Rp {(int(due.map(i, i.outstanding).sum()) >= 1000000000 ? string(int(due.map(i, i.outstanding).sum()) / 1000000000) + ',' + string(int(due.map(i, i.outstanding).sum()) / 100000000 % 10) + ' miliar' : (int(due.map(i, i.outstanding).sum()) >= 1000000 ? string(int(due.map(i, i.outstanding).sum()) / 1000000) + ',' + string(int(due.map(i, i.outstanding).sum()) / 100000 % 10) + ' juta' : (int(due.map(i, i.outstanding).sum()) >= 1000 ? string(int(due.map(i, i.outstanding).sum()) / 1000) + ' ribu' : string(int(due.map(i, i.outstanding).sum())))))}. Mulai dari {first.name}.
37
+ Cetak "Pesan tagihan WA" di faktur untuk mengingatkan pelanggan.
38
+ - for_each: "late.filter(i, days_between(i.due_date, ('as_of' in event ? event.as_of : today())) <= (days_between('2024-01-01', ('as_of' in event ? event.as_of : today())) % 7 == 0 ? 2 : 1)).size() > 0 ? [late[0]] : []"
39
+ as: oldest
40
+ do:
41
+ - notify: finance_manager
42
+ notice: invoice_overdue
43
+ channel: email
44
+ record: oldest
45
+ id: "'late:' + ('as_of' in event ? event.as_of : today())"
46
+ title: >-
47
+ {late.filter(i, days_between(i.due_date, ('as_of' in event ? event.as_of : today())) <= (days_between('2024-01-01', ('as_of' in event ? event.as_of : today())) % 7 == 0 ? 2 : 1)).size()} faktur baru lewat jatuh tempo
48
+ template: >-
49
+ Sekarang {size(late)} faktur lewat jatuh tempo, sisa tagihan Rp {(int(late.map(i, i.outstanding).sum()) >= 1000000000 ? string(int(late.map(i, i.outstanding).sum()) / 1000000000) + ',' + string(int(late.map(i, i.outstanding).sum()) / 100000000 % 10) + ' miliar' : (int(late.map(i, i.outstanding).sum()) >= 1000000 ? string(int(late.map(i, i.outstanding).sum()) / 1000000) + ',' + string(int(late.map(i, i.outstanding).sum()) / 100000 % 10) + ' juta' : (int(late.map(i, i.outstanding).sum()) >= 1000 ? string(int(late.map(i, i.outstanding).sum()) / 1000) + ' ribu' : string(int(late.map(i, i.outstanding).sum())))))}.
50
+ Paling lama {oldest.name}, telat {days_between(oldest.due_date, ('as_of' in event ? event.as_of : today()))} hari.
@@ -26,10 +26,13 @@ fields:
26
26
  type: currency
27
27
  label: {id: Harga}
28
28
  default: item.rate
29
+ # a new line takes the item's live invoice promo (module promotions: a percent promo of channel invoice or both, for
30
+ # all outlets, kept on item.promo_invoice_pct) as its default discount; the user can still change it, and lines
31
+ # already saved keep theirs
29
32
  - name: discount
30
33
  type: percent
31
34
  label: {id: Diskon %}
32
- default: '0'
35
+ default: "app_installed('promotions') ? item.promo_invoice_pct : 0"
33
36
  - name: amount
34
37
  type: currency
35
38
  label: {id: Jumlah}
@@ -1,14 +1,27 @@
1
1
  # yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/module.json
2
2
  name: invoicing
3
- version: 1.11.0
3
+ version: 1.13.0
4
4
  title: {id: Faktur, en: Invoicing}
5
5
  summary:
6
6
  id: Buat faktur penjualan, pilih cara bayar termasuk QRIS, dan kirim pengingat tagihan.
7
7
  en: Sales invoices with payment options including QRIS, and payment reminders.
8
8
  category: sales
9
9
  icon: bill-line
10
- requires: {rangka: '>=0.5', users: ^1.0, contacts: ^1.0, catalogue: ^1.0}
10
+ requires: {rangka: '>=0.5', users: ^1.0, contacts: ^1.0, catalogue: ^1.5}
11
11
  optional: {outlets: ^1.0, tax_id: ^1.0, currency: ^1.0, orders: ^1.0, projects: ^1.0, delivery: ^1.0}
12
12
  # ledger.post_receivable is a core hook; this one is semantics fixed in docs/kernel-hooks.md.
13
13
  # invoicing.from_order is declared by the orders module, where the make_invoice action lives.
14
14
  hooks: [invoicing.reverse_receivable]
15
+ # What this module tells people (contract 0066 §1.1), both from flow invoice_due_digest. A person switches the mail of
16
+ # a kind off in Pengaturan › Notifikasi.
17
+ notices:
18
+ - name: invoice_due
19
+ label: {id: Faktur jatuh tempo hari ini, en: Invoices due today}
20
+ description: {id: 'Faktur yang jatuh tempo hari ini dan belum lunas.'}
21
+ severity: info
22
+ to: [owner, finance_manager]
23
+ - name: invoice_overdue
24
+ label: {id: Faktur lewat jatuh tempo, en: Overdue invoices}
25
+ description: {id: 'Ada faktur yang baru lewat jatuh tempo dan belum lunas.'}
26
+ severity: warn
27
+ to: [owner, finance_manager]
@@ -7,6 +7,7 @@
7
7
  name: dapur
8
8
  type: queue
9
9
  label: {id: Dapur, en: Kitchen}
10
+ description: {id: 'Tiket pesanan dari kasir masuk di sini; tekan Masak, lalu Siap, lalu Diambil.'}
10
11
  icon: list
11
12
  roles: [kitchen, cashier, head_office]
12
13
  device: tablet