@rangka-os/create 0.5.0-alpha.27 → 0.5.0-alpha.29
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.
- package/package.json +1 -1
- package/template/base/apps/absen_karyawan/app.rk +37 -0
- package/template/base/apps/absen_karyawan/dashboards/absen_hari_ini.rk +20 -0
- package/template/base/apps/absen_karyawan/dashboards/absen_karyawan_saya.rk +14 -0
- package/template/base/apps/absen_karyawan/dashboards/rekap_absen_karyawan.rk +12 -0
- package/template/base/apps/jasa_proyek/app.rk +4 -1
- package/template/base/apps/kasir/app.rk +5 -1
- package/template/base/apps/kasir/dashboards/kasir_ringkas.rk +4 -0
- package/template/base/apps/kasir/skills/rangka-app-kasir/SKILL.md +20 -0
- package/template/base/apps/pembukuan/app.rk +3 -0
- package/template/base/connectors/midtrans/connector.rk +249 -0
- package/template/base/connectors/midtrans/fixtures/charge_gopay.json +34 -0
- package/template/base/connectors/midtrans/fixtures/charge_qris.json +23 -0
- package/template/base/connectors/midtrans/fixtures/charge_va.json +20 -0
- package/template/base/connectors/midtrans/fixtures/create_snap.json +4 -0
- package/template/base/connectors/midtrans/fixtures/expect.json +88 -0
- package/template/base/connectors/midtrans/fixtures/get_status.json +15 -0
- package/template/base/connectors/midtrans/fixtures/payment_notified.json +28 -0
- package/template/base/connectors/midtrans/fixtures/payment_notified_challenge.json +24 -0
- package/template/base/connectors/midtrans/fixtures/payment_notified_expire.json +24 -0
- package/template/base/connectors/midtrans/fixtures/payment_notified_other_amount.json +28 -0
- package/template/base/connectors/midtrans/fixtures/payment_notified_partial_refund.json +34 -0
- package/template/base/connectors/midtrans/fixtures/payment_notified_pending.json +31 -0
- package/template/base/connectors/midtrans/fixtures/payment_notified_refund.json +34 -0
- package/template/base/connectors/midtrans/fixtures/payment_notified_relabelled.json +28 -0
- package/template/base/connectors/midtrans/fixtures/payment_notified_va.json +32 -0
- package/template/base/connectors/midtrans/fixtures/signature_vector.txt +3 -0
- package/template/base/connectors/midtrans/mock/midtrans_mock.py +335 -0
- package/template/base/connectors/rangka_whatsapp/README.md +105 -0
- package/template/base/connectors/rangka_whatsapp/connector.rk +141 -0
- package/template/base/connectors/rangka_whatsapp/fixtures/expect.json +9 -0
- package/template/base/connectors/rangka_whatsapp/fixtures/message_received.json +1 -0
- package/template/base/connectors/rangka_whatsapp/fixtures/message_status.json +1 -0
- package/template/base/connectors/rangka_whatsapp/fixtures/message_status_refused.json +1 -0
- package/template/base/connectors/rangka_whatsapp/fixtures/opted_out.json +1 -0
- package/template/base/connectors/rangka_whatsapp/fixtures/send_template.json +1 -0
- package/template/base/connectors/rangka_whatsapp/fixtures/send_template_duplicate.json +1 -0
- package/template/base/connectors/rangka_whatsapp/fixtures/set_opt_out.json +1 -0
- package/template/base/connectors/rangka_whatsapp/mock/rangka_whatsapp_mock.py +354 -0
- package/template/base/connectors/shopee/connector.rk +360 -0
- package/template/base/connectors/shopee/fixtures/expect.json +119 -0
- package/template/base/connectors/shopee/fixtures/get_models.json +52 -0
- package/template/base/connectors/shopee/fixtures/get_order_detail.json +396 -0
- package/template/base/connectors/shopee/fixtures/get_settlement.json +90 -0
- package/template/base/connectors/shopee/fixtures/get_tracking.json +13 -0
- package/template/base/connectors/shopee/fixtures/list_items.json +29 -0
- package/template/base/connectors/shopee/fixtures/list_orders.json +31 -0
- package/template/base/connectors/shopee/fixtures/list_settlements.json +15 -0
- package/template/base/connectors/shopee/fixtures/order_changed.json +101 -0
- package/template/base/connectors/shopee/fixtures/order_changed_cancelled.json +72 -0
- package/template/base/connectors/shopee/fixtures/order_changed_completed.json +101 -0
- package/template/base/connectors/shopee/fixtures/order_changed_in_cancel.json +72 -0
- package/template/base/connectors/shopee/fixtures/order_changed_unpaid.json +71 -0
- package/template/base/connectors/shopee/fixtures/order_settled.json +92 -0
- package/template/base/connectors/shopee/fixtures/push_received.json +12 -0
- package/template/base/connectors/shopee/fixtures/push_received_tracking.json +11 -0
- package/template/base/connectors/shopee/fixtures/update_stock.json +15 -0
- package/template/base/connectors/shopee/mock/shopee_mock.py +894 -0
- package/template/base/connectors/tiktok_shop/connector.rk +300 -0
- package/template/base/connectors/tiktok_shop/fixtures/expect.json +105 -0
- package/template/base/connectors/tiktok_shop/fixtures/get_order_detail.json +136 -0
- package/template/base/connectors/tiktok_shop/fixtures/get_settlement.json +83 -0
- package/template/base/connectors/tiktok_shop/fixtures/get_tracking.json +28 -0
- package/template/base/connectors/tiktok_shop/fixtures/list_orders.json +242 -0
- package/template/base/connectors/tiktok_shop/fixtures/list_products.json +77 -0
- package/template/base/connectors/tiktok_shop/fixtures/list_settlements.json +22 -0
- package/template/base/connectors/tiktok_shop/fixtures/list_shops.json +17 -0
- package/template/base/connectors/tiktok_shop/fixtures/order_changed.json +129 -0
- package/template/base/connectors/tiktok_shop/fixtures/order_changed_cancelled.json +81 -0
- package/template/base/connectors/tiktok_shop/fixtures/order_changed_completed.json +106 -0
- package/template/base/connectors/tiktok_shop/fixtures/order_changed_on_hold.json +104 -0
- package/template/base/connectors/tiktok_shop/fixtures/order_changed_tokopedia.json +106 -0
- package/template/base/connectors/tiktok_shop/fixtures/order_changed_unpaid.json +79 -0
- package/template/base/connectors/tiktok_shop/fixtures/order_settled.json +73 -0
- package/template/base/connectors/tiktok_shop/fixtures/update_stock.json +6 -0
- package/template/base/connectors/tiktok_shop/fixtures/webhook_received.json +12 -0
- package/template/base/connectors/tiktok_shop/fixtures/webhook_received_cancellation.json +13 -0
- package/template/base/connectors/tiktok_shop/mock/tiktok_shop_mock.py +819 -0
- package/template/base/connectors/whatsapp_business/connector.rk +3 -1
- package/template/base/connectors/whatsapp_business/templates.md +13 -1
- package/template/base/modules/accounting/flows/gl_asset_disposal_post.rk +68 -0
- package/template/base/modules/accounting/flows/gl_asset_disposal_reverse.rk +194 -0
- package/template/base/modules/accounting/flows/gl_depreciation_run_post.rk +43 -0
- package/template/base/modules/accounting/flows/gl_depreciation_run_reverse.rk +36 -0
- package/template/base/modules/accounting/flows/gl_fixed_asset_post.rk +51 -0
- package/template/base/modules/accounting/flows/gl_fixed_asset_reverse.rk +194 -0
- package/template/base/modules/accounting/flows/gl_vendor_bill_post.rk +2 -2
- package/template/base/modules/accounting/models/gl_entry.rk +2 -0
- package/template/base/modules/accounting/module.rk +2 -2
- package/template/base/modules/attendance/flows/attendance_missing_digest.rk +30 -0
- package/template/base/modules/attendance/flows/attendance_period_on_cancel.rk +15 -0
- package/template/base/modules/attendance/flows/attendance_period_on_submit.rk +60 -0
- package/template/base/modules/attendance/flows/staff_attendance_cancel_guard.rk +14 -0
- package/template/base/modules/attendance/flows/staff_attendance_guard_created.rk +16 -0
- package/template/base/modules/attendance/flows/staff_attendance_guard_submitted.rk +37 -0
- package/template/base/modules/attendance/flows/staff_attendance_guard_updated.rk +14 -0
- package/template/base/modules/attendance/models/attendance_period.rk +62 -0
- package/template/base/modules/attendance/models/attendance_summary.rk +37 -0
- package/template/base/modules/attendance/models/staff_attendance.rk +281 -0
- package/template/base/modules/attendance/models/staff_attendance_guard.rk +50 -0
- package/template/base/modules/attendance/module.rk +18 -0
- package/template/base/modules/attendance/screens/absen_outlet.rk +22 -0
- package/template/base/modules/catalogue/models/item.rk +69 -0
- package/template/base/modules/catalogue/module.rk +1 -1
- package/template/base/modules/contacts/models/customer.rk +43 -19
- package/template/base/modules/contacts/module.rk +1 -1
- package/template/base/modules/coretax/module.rk +1 -1
- package/template/base/modules/coretax/print/coretax_faktur.rk +3 -2
- package/template/base/modules/coretax/print/coretax_faktur.xml +3 -1
- package/template/base/modules/coretax/print/rekap_ppn.html +9 -7
- package/template/base/modules/courses/flows/charge_invoice_on_submit.rk +15 -0
- package/template/base/modules/courses/module.rk +1 -1
- package/template/base/modules/courses/screens/absen_kelas.rk +1 -0
- package/template/base/modules/fixed_assets/flows/asset_disposal_on_cancel.rk +14 -0
- package/template/base/modules/fixed_assets/flows/asset_disposal_on_submit.rk +21 -0
- package/template/base/modules/fixed_assets/flows/asset_from_vendor_bill.rk +41 -0
- package/template/base/modules/fixed_assets/flows/depreciation_run_fill.rk +28 -0
- package/template/base/modules/fixed_assets/flows/depreciation_run_monthly.rk +36 -0
- package/template/base/modules/fixed_assets/flows/depreciation_run_on_cancel.rk +30 -0
- package/template/base/modules/fixed_assets/flows/depreciation_run_on_submit.rk +34 -0
- package/template/base/modules/fixed_assets/flows/fixed_asset_on_cancel.rk +24 -0
- package/template/base/modules/fixed_assets/flows/fixed_asset_on_submit.rk +69 -0
- package/template/base/modules/fixed_assets/flows/fixed_assets_setup.rk +29 -0
- package/template/base/modules/fixed_assets/flows/opening_balance_asset_guard.rk +15 -0
- package/template/base/modules/fixed_assets/flows/vendor_bill_asset_guard.rk +14 -0
- package/template/base/modules/fixed_assets/imports/asset_list.rk +22 -0
- package/template/base/modules/fixed_assets/models/asset_bill_line.rk +24 -0
- package/template/base/modules/fixed_assets/models/asset_book.rk +83 -0
- package/template/base/modules/fixed_assets/models/asset_category.rk +54 -0
- package/template/base/modules/fixed_assets/models/asset_disposal.rk +97 -0
- package/template/base/modules/fixed_assets/models/asset_guard.rk +90 -0
- package/template/base/modules/fixed_assets/models/depreciation_line.rk +13 -0
- package/template/base/modules/fixed_assets/models/depreciation_run.rk +65 -0
- package/template/base/modules/fixed_assets/models/fixed_asset.rk +165 -0
- package/template/base/modules/fixed_assets/models/fixed_asset_setting.rk +34 -0
- package/template/base/modules/fixed_assets/module.rk +30 -0
- package/template/base/modules/fixed_assets/print/fixed_asset_register.html +45 -0
- package/template/base/modules/fixed_assets/print/fixed_asset_register.rk +17 -0
- package/template/base/modules/invoicing/flows/invoice_due_digest.rk +45 -7
- package/template/base/modules/invoicing/models/sales_invoice_item.rk +4 -1
- package/template/base/modules/invoicing/module.rk +15 -2
- package/template/base/modules/kitchen/screens/dapur.rk +1 -0
- package/template/base/modules/outlets/models/outlet.rk +69 -0
- package/template/base/modules/outlets/module.rk +1 -1
- package/template/base/modules/payments/flows/payment_from_midtrans.rk +85 -0
- package/template/base/modules/payments/flows/payment_refund_from_midtrans.rk +22 -0
- package/template/base/modules/payments/models/payment.rk +2 -1
- package/template/base/modules/payments/module.rk +1 -1
- package/template/base/modules/payroll/flows/payroll_close_on_cancel.rk +8 -5
- package/template/base/modules/payroll/flows/payroll_close_on_submit.rk +8 -5
- package/template/base/modules/payroll/flows/payroll_reminder.rk +106 -0
- package/template/base/modules/payroll/flows/payroll_run_overlap_guard_created.rk +5 -3
- package/template/base/modules/payroll/flows/payroll_run_overlap_guard_updated.rk +5 -3
- package/template/base/modules/payroll/flows/payslip_from_recap.rk +1 -1
- package/template/base/modules/payroll/imports/payroll_profile_list.rk +27 -0
- package/template/base/modules/payroll/models/payroll_close.rk +10 -6
- package/template/base/modules/payroll/models/payroll_run.rk +64 -15
- package/template/base/modules/payroll/models/payslip.rk +48 -9
- package/template/base/modules/payroll/module.rk +22 -5
- package/template/base/modules/payroll/print/payslip.html +4 -1
- package/template/base/modules/pos/models/pos_sale.rk +136 -9
- package/template/base/modules/pos/models/pos_sale_item.rk +33 -1
- package/template/base/modules/pos/module.rk +5 -3
- package/template/base/modules/pos/print/pos_receipt.html +7 -3
- package/template/base/modules/pos/screens/kasir.rk +7 -2
- package/template/base/modules/procurement/flows/reorder_draft_po.rk +57 -0
- package/template/base/modules/procurement/models/vendor_bill.rk +21 -2
- package/template/base/modules/procurement/module.rk +11 -2
- package/template/base/modules/projects/screens/absen.rk +1 -0
- package/template/base/modules/promotions/flows/promo_code_batch_on_submit.rk +26 -0
- package/template/base/modules/promotions/flows/promotion_apply.rk +110 -0
- package/template/base/modules/promotions/flows/promotion_apply_on_create.rk +110 -0
- package/template/base/modules/promotions/flows/promotion_apply_on_delete.rk +111 -0
- package/template/base/modules/promotions/flows/promotion_apply_on_update.rk +110 -0
- package/template/base/modules/promotions/flows/promotion_on_sale.rk +95 -0
- package/template/base/modules/promotions/flows/promotion_on_sale_cancel.rk +43 -0
- package/template/base/modules/promotions/models/promo_code.rk +27 -0
- package/template/base/modules/promotions/models/promo_code_batch.rk +36 -0
- package/template/base/modules/promotions/models/promo_guard.rk +44 -0
- package/template/base/modules/promotions/models/promotion.rk +197 -0
- package/template/base/modules/promotions/models/promotion_ledger.rk +35 -0
- package/template/base/modules/promotions/module.rk +20 -0
- package/template/base/modules/rental/models/rental_unit.rk +13 -3
- package/template/base/modules/rental/module.rk +2 -2
- package/template/base/modules/rental/screens/alat_keluar.rk +1 -0
- package/template/base/modules/rental/screens/alat_kembali.rk +1 -0
- package/template/base/modules/rental/screens/jadwal_alat.rk +1 -0
- package/template/base/modules/stock/flows/stock_low_alert.rk +65 -0
- package/template/base/modules/stock/flows/stock_negative_alert.rk +14 -5
- package/template/base/modules/stock/models/stock_reorder.rk +34 -0
- package/template/base/modules/stock/module.rk +17 -2
- package/template/base/modules/subscriptions/screens/catat_tagih.rk +1 -0
- package/template/base/modules/subscriptions/screens/rute_tagih.rk +1 -0
- package/template/base/modules/users/flows/summary_daily.rk +83 -0
- package/template/base/modules/users/flows/summary_monthly.rk +83 -0
- package/template/base/modules/users/flows/summary_weekly.rk +83 -0
- package/template/base/modules/users/models/business_summary.rk +67 -0
- package/template/base/modules/users/models/summary_setting.rk +35 -0
- package/template/base/modules/users/models/user.rk +11 -3
- package/template/base/modules/users/module.rk +21 -2
- package/template/base/modules/users/roles/employee.rk +8 -0
- package/template/base/modules/users/roles/outlet_supervisor.rk +7 -0
- package/template/base/modules/whatsapp/flows/whatsapp_customer_opt_out.rk +16 -0
- package/template/base/modules/whatsapp/flows/whatsapp_customer_opt_out_new.rk +17 -0
- package/template/base/modules/whatsapp/flows/whatsapp_message_status.rk +24 -0
- package/template/base/modules/whatsapp/flows/whatsapp_opted_out.rk +26 -0
- package/template/base/modules/whatsapp/models/whatsapp_message.rk +99 -0
- package/template/base/modules/whatsapp/models/whatsapp_opt_out.rk +44 -0
- package/template/base/modules/whatsapp/module.rk +23 -0
- package/template/base/modules/whatsapp_booking/flows/whatsapp_booking_tomorrow.rk +48 -0
- package/template/base/modules/whatsapp_booking/module.rk +13 -0
- package/template/base/modules/whatsapp_order_ready/flows/whatsapp_pickup_on_sale.rk +19 -0
- package/template/base/modules/whatsapp_order_ready/flows/whatsapp_ticket_ready.rk +40 -0
- package/template/base/modules/whatsapp_order_ready/models/whatsapp_pickup.rk +22 -0
- package/template/base/modules/whatsapp_order_ready/module.rk +14 -0
- package/template/base/modules/whatsapp_receipt/flows/whatsapp_receipt_on_sale.rk +43 -0
- package/template/base/modules/whatsapp_receipt/module.rk +13 -0
- package/template/base/modules/whatsapp_reminder/flows/whatsapp_invoice_overdue.rk +64 -0
- package/template/base/modules/whatsapp_reminder/module.rk +15 -0
- package/template/base/modules/workforce/imports/worker_list.rk +4 -1
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/model.json
|
|
2
|
+
# One fixed asset (a camera body, a car, a laptop) depreciated straight-line per month: (cost - residual value) /
|
|
3
|
+
# useful life, rounded to the rupiah; the last month takes what is left, so the depreciation adds up to the cost minus
|
|
4
|
+
# the residual exactly. Its submit journals the purchase by its source (accounting flow gl_fixed_asset_post, none for
|
|
5
|
+
# a vendor bill: the bill already debited 1-2100) and opens its asset_book (flow fixed_asset_on_submit): a submitted
|
|
6
|
+
# document cannot change, so the accumulated depreciation, the last month depreciated and the state live there,
|
|
7
|
+
# written only by the flows of this module. Cancelling an asset that has been depreciated or disposed of is refused.
|
|
8
|
+
name: fixed_asset
|
|
9
|
+
label: {id: Aset tetap, en: Fixed asset}
|
|
10
|
+
icon: building-2-line
|
|
11
|
+
is_submittable: true
|
|
12
|
+
naming: AST-{YYYY}-{####}
|
|
13
|
+
title_field: asset_name
|
|
14
|
+
permissions:
|
|
15
|
+
- {role: finance_manager, read: true, create: true, write: true, delete: true, submit: true, cancel: true, amend: true, export: true, print: true, import: true}
|
|
16
|
+
- {role: head_office, read: true, create: true, write: true, delete: true, submit: true, cancel: true, amend: true, export: true, print: true, import: true}
|
|
17
|
+
# the bill's submit drafts the assets (flow asset_from_vendor_bill runs as the purchasing manager); finance completes
|
|
18
|
+
# and submits them
|
|
19
|
+
- {role: purchasing_manager, read: true, create: true}
|
|
20
|
+
# the warehouse sees which unit is which asset, not what it cost (hidden_for below, contract 0027)
|
|
21
|
+
- {role: rental_staff, read: true}
|
|
22
|
+
fields:
|
|
23
|
+
- {name: asset_name, type: data, label: {id: Nama aset}, required: true, in_list: true}
|
|
24
|
+
- name: category
|
|
25
|
+
type: link
|
|
26
|
+
to: asset_category
|
|
27
|
+
label: {id: Kelompok aset}
|
|
28
|
+
in_list: true
|
|
29
|
+
peek: [useful_life_months, residual_percent, fiscal_group]
|
|
30
|
+
- name: source
|
|
31
|
+
type: select
|
|
32
|
+
label: {id: Asal aset}
|
|
33
|
+
required: true
|
|
34
|
+
default: "'other'"
|
|
35
|
+
options:
|
|
36
|
+
- {value: vendor_bill, label: {id: Dibeli lewat tagihan pemasok}}
|
|
37
|
+
- {value: opening, label: {id: Aset lama (saldo awal)}}
|
|
38
|
+
- {value: other, label: {id: Dibeli tunai atau transfer tanpa tagihan}}
|
|
39
|
+
- name: vendor_bill
|
|
40
|
+
type: link
|
|
41
|
+
to: vendor_bill
|
|
42
|
+
label: {id: Tagihan pemasok}
|
|
43
|
+
depends_on: app_installed('procurement') && source == 'vendor_bill'
|
|
44
|
+
# the bill line this asset came from (its idx): its submit checks the cost against asset_bill_line, which only the
|
|
45
|
+
# bill's flow writes (audit F1: a cost typed by hand never reaches the register)
|
|
46
|
+
- {name: bill_line, type: int, label: {id: Baris tagihan}, hidden: true}
|
|
47
|
+
- name: paid_from
|
|
48
|
+
type: select
|
|
49
|
+
label: {id: Dibayar dari}
|
|
50
|
+
default: "'bank'"
|
|
51
|
+
depends_on: source == 'other'
|
|
52
|
+
options:
|
|
53
|
+
- {value: cash, label: {id: Kas}}
|
|
54
|
+
- {value: bank, label: {id: Bank}}
|
|
55
|
+
- {name: acquisition_date, type: date, label: {id: Tanggal beli}, required: true, in_list: true}
|
|
56
|
+
- name: book_date
|
|
57
|
+
type: date
|
|
58
|
+
label: {id: Tanggal dicatat di buku}
|
|
59
|
+
help: {id: 'Aset lama: tanggal saldo awal pembukuan. Selain itu sama dengan tanggal beli'}
|
|
60
|
+
default: acquisition_date
|
|
61
|
+
relative_to: acquisition_date
|
|
62
|
+
required: true
|
|
63
|
+
- name: cost
|
|
64
|
+
type: currency
|
|
65
|
+
label: {id: Harga perolehan}
|
|
66
|
+
required: true
|
|
67
|
+
in_list: true
|
|
68
|
+
hidden_for: [rental_staff]
|
|
69
|
+
- name: useful_life_months
|
|
70
|
+
type: int
|
|
71
|
+
label: {id: Umur manfaat (bulan)}
|
|
72
|
+
default: category.useful_life_months
|
|
73
|
+
- name: residual_value
|
|
74
|
+
type: currency
|
|
75
|
+
label: {id: Nilai sisa}
|
|
76
|
+
help: {id: 'Perkiraan nilai jual di akhir umur manfaat. Tidak ikut disusutkan'}
|
|
77
|
+
default: "round(cost * category.residual_percent / 100)"
|
|
78
|
+
hidden_for: [rental_staff]
|
|
79
|
+
- name: depreciation_start
|
|
80
|
+
type: date
|
|
81
|
+
label: {id: Mulai disusutkan}
|
|
82
|
+
help: {id: 'Bulan pertama penyusutan, biasanya bulan setelah aset dibeli atau dicatat'}
|
|
83
|
+
default: "add_months(truncate(string(book_date), 7) + '-01', 1)"
|
|
84
|
+
required: true
|
|
85
|
+
- name: opening_accumulated
|
|
86
|
+
type: currency
|
|
87
|
+
label: {id: Akumulasi penyusutan sebelumnya}
|
|
88
|
+
help: {id: 'Aset lama: penyusutan yang sudah dicatat sampai tanggal saldo awal'}
|
|
89
|
+
default: '0'
|
|
90
|
+
depends_on: source == 'opening'
|
|
91
|
+
hidden_for: [rental_staff]
|
|
92
|
+
- {name: outlet, type: link, to: outlet, label: {id: Cabang}, in_list: true, depends_on: app_installed('outlets')}
|
|
93
|
+
- {name: project, type: link, to: project, label: {id: Proyek}, depends_on: app_installed('projects')}
|
|
94
|
+
- {name: rental_unit, type: link, to: rental_unit, label: {id: Unit alat sewa}, depends_on: app_installed('rental')}
|
|
95
|
+
- {name: serial_no, type: data, label: {id: Nomor seri}}
|
|
96
|
+
- name: monthly_depreciation
|
|
97
|
+
type: currency
|
|
98
|
+
label: {id: Penyusutan per bulan}
|
|
99
|
+
compute: "useful_life_months > 0 ? round((cost - residual_value) / useful_life_months) : 0"
|
|
100
|
+
hidden_for: [rental_staff]
|
|
101
|
+
- {name: notes, type: text, label: {id: Catatan}}
|
|
102
|
+
rules:
|
|
103
|
+
- name: cost_positive
|
|
104
|
+
on: save
|
|
105
|
+
check: cost > 0
|
|
106
|
+
message: {id: Harga perolehan harus lebih dari 0}
|
|
107
|
+
- name: residual_below_cost
|
|
108
|
+
on: save
|
|
109
|
+
check: residual_value >= 0 && residual_value < cost
|
|
110
|
+
message: {id: Nilai sisa tidak boleh negatif dan harus di bawah harga perolehan}
|
|
111
|
+
# A draft made by a vendor bill's submit has no category or life yet: finance completes it, so these two are checked
|
|
112
|
+
# at submit only.
|
|
113
|
+
- name: category_set
|
|
114
|
+
on: submit
|
|
115
|
+
check: category != ''
|
|
116
|
+
message: {id: Pilih kelompok aset dulu}
|
|
117
|
+
- name: life_positive
|
|
118
|
+
on: submit
|
|
119
|
+
check: useful_life_months > 0 && useful_life_months <= 600
|
|
120
|
+
message: {id: Umur manfaat antara 1 dan 600 bulan}
|
|
121
|
+
- name: depreciation_positive
|
|
122
|
+
on: submit
|
|
123
|
+
check: monthly_depreciation > 0 || opening_accumulated >= cost - residual_value
|
|
124
|
+
message: {id: 'Penyusutan per bulan 0 rupiah: harga dikurangi nilai sisa terlalu kecil untuk umur manfaatnya'}
|
|
125
|
+
- name: start_is_month_start
|
|
126
|
+
on: save
|
|
127
|
+
check: "string(depreciation_start) == truncate(string(depreciation_start), 7) + '-01'"
|
|
128
|
+
message: {id: Mulai disusutkan selalu tanggal 1}
|
|
129
|
+
- name: start_after_book
|
|
130
|
+
on: save
|
|
131
|
+
check: depreciation_start > book_date
|
|
132
|
+
message: {id: 'Penyusutan dimulai bulan setelah aset dicatat di buku'}
|
|
133
|
+
- name: book_not_before_purchase
|
|
134
|
+
on: save
|
|
135
|
+
check: book_date >= acquisition_date
|
|
136
|
+
message: {id: Tanggal dicatat di buku tidak boleh sebelum tanggal beli}
|
|
137
|
+
- name: opening_accumulated_range
|
|
138
|
+
on: save
|
|
139
|
+
check: "opening_accumulated >= 0 && opening_accumulated <= cost - residual_value && (source == 'opening' || opening_accumulated == 0)"
|
|
140
|
+
message: {id: 'Akumulasi penyusutan sebelumnya hanya untuk aset lama, dan tidak boleh melebihi harga dikurangi nilai sisa'}
|
|
141
|
+
- name: bill_source
|
|
142
|
+
on: submit
|
|
143
|
+
check: "source != 'vendor_bill' || (vendor_bill != '' && vendor_bill.docstatus == 1 && vendor_bill.posting == 'asset')"
|
|
144
|
+
message: {id: 'Aset dari tagihan pemasok: tagihannya harus sudah diajukan sebagai Aset tetap'}
|
|
145
|
+
- name: bill_only_from_bill
|
|
146
|
+
on: save
|
|
147
|
+
check: source == 'vendor_bill' || vendor_bill == ''
|
|
148
|
+
message: {id: 'Aset yang menunjuk tagihan pemasok berasal dari tagihan itu'}
|
|
149
|
+
views:
|
|
150
|
+
list:
|
|
151
|
+
columns: [name, asset_name, category, outlet, acquisition_date, cost, status]
|
|
152
|
+
filters: [category, outlet, source]
|
|
153
|
+
sort: -acquisition_date
|
|
154
|
+
form:
|
|
155
|
+
layout:
|
|
156
|
+
- section: {id: Aset}
|
|
157
|
+
columns:
|
|
158
|
+
- [asset_name, category, serial_no, outlet, project, rental_unit]
|
|
159
|
+
- [source, vendor_bill, paid_from, acquisition_date, book_date]
|
|
160
|
+
- section: {id: Penyusutan}
|
|
161
|
+
columns:
|
|
162
|
+
- [cost, residual_value, useful_life_months, depreciation_start, opening_accumulated]
|
|
163
|
+
- [monthly_depreciation]
|
|
164
|
+
- section: {id: Catatan}
|
|
165
|
+
fields: [notes]
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/model.json
|
|
2
|
+
# One record per business (`key` is unique and always 'usaha'), made with the default categories by flow
|
|
3
|
+
# fixed_assets_setup (run on the 1st with the monthly depreciation, or by hand from the flow list). The capitalisation
|
|
4
|
+
# threshold (batas kapitalisasi): a purchase below it is an expense, not an asset. Rp 1.000.000 by default, the common
|
|
5
|
+
# policy of Indonesian SMEs under SAK EMKM, which leaves the threshold to the business (DECISIONS.md, rangka-apps#113).
|
|
6
|
+
# 0 turns the check off.
|
|
7
|
+
name: fixed_asset_setting
|
|
8
|
+
label: {id: Pengaturan aset tetap, en: Fixed asset settings}
|
|
9
|
+
icon: settings-3-line
|
|
10
|
+
naming: AST-SET-{##}
|
|
11
|
+
title_field: title
|
|
12
|
+
permissions:
|
|
13
|
+
- {role: finance_manager, read: true, create: true, write: true}
|
|
14
|
+
- {role: head_office, read: true, create: true, write: true}
|
|
15
|
+
# the bill's flow (asset_from_vendor_bill) runs as the purchasing manager who submits it and reads the threshold
|
|
16
|
+
- {role: purchasing_manager, read: true}
|
|
17
|
+
fields:
|
|
18
|
+
- {name: key, type: data, label: {id: Kunci}, default: "'usaha'", required: true, unique: true, read_only: true}
|
|
19
|
+
- {name: title, type: data, label: {id: Nama}, compute: "'Pengaturan aset tetap'"}
|
|
20
|
+
- name: capitalisation_threshold
|
|
21
|
+
type: currency
|
|
22
|
+
label: {id: Batas kapitalisasi}
|
|
23
|
+
help: {id: 'Pembelian di bawah nilai ini dicatat sebagai beban, bukan aset tetap. Isi 0 bila semua pembelian boleh jadi aset.'}
|
|
24
|
+
default: '1000000'
|
|
25
|
+
rules:
|
|
26
|
+
- name: threshold_not_negative
|
|
27
|
+
on: save
|
|
28
|
+
check: capitalisation_threshold >= 0
|
|
29
|
+
message: {id: Batas kapitalisasi tidak boleh negatif}
|
|
30
|
+
views:
|
|
31
|
+
form:
|
|
32
|
+
layout:
|
|
33
|
+
- section: {id: Aset tetap}
|
|
34
|
+
fields: [capitalisation_threshold]
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/module.json
|
|
2
|
+
name: fixed_assets
|
|
3
|
+
version: 1.0.0
|
|
4
|
+
title: {id: Aset tetap, en: Fixed assets}
|
|
5
|
+
summary:
|
|
6
|
+
id: Catat aset tetap dan susutkan otomatis tiap bulan.
|
|
7
|
+
en: Record fixed assets and depreciate them every month.
|
|
8
|
+
category: finance
|
|
9
|
+
icon: building-2-line
|
|
10
|
+
# Fixed assets and their straight-line monthly depreciation (garis lurus, with a residual value), rangka-apps#113.
|
|
11
|
+
# An asset comes in three ways (fixed_asset.source): bought on a vendor bill whose posting is "Aset tetap" (the bill
|
|
12
|
+
# debits 1-2100 and flow asset_from_vendor_bill drafts one asset per bill line; the asset posts nothing itself), an old
|
|
13
|
+
# asset brought in with the depreciation it already had (opening, against 3-1900), or bought without a bill (cash or
|
|
14
|
+
# bank). Depreciation is a document per month (depreciation_run): flow depreciation_run_fill lists every asset due and
|
|
15
|
+
# its amount when the draft is made, and its submit journals 6-1950 Beban penyusutan against 1-2900 Akumulasi
|
|
16
|
+
# penyusutan per asset (with its outlet and project) and moves each asset's accumulated depreciation. On the 1st at
|
|
17
|
+
# 06:00 flow depreciation_run_monthly drafts last month's run and tells finance; a person submits it (nothing posts by
|
|
18
|
+
# itself). Selling or writing off an asset (asset_disposal) takes its cost and depreciation out and books the gain or
|
|
19
|
+
# loss on one signed account 4-9300. Journals are those of the accounting module (scripts/gen_accounting_flows.py).
|
|
20
|
+
# Fiscal depreciation (PMK 72/2023 groups, declining balance) is stored per category for later Coretax reports only.
|
|
21
|
+
# One setting per business (fixed_asset_setting): the capitalisation threshold, below which a purchase is an expense.
|
|
22
|
+
requires: {rangka: '>=0.5', users: ^1.2, accounting: ^1.4}
|
|
23
|
+
optional: {procurement: ^1.0, rental: ^1.0, outlets: ^1.0, projects: ^1.0}
|
|
24
|
+
notices:
|
|
25
|
+
- name: depreciation_ready
|
|
26
|
+
label: {id: Penyusutan bulanan siap diajukan, en: Monthly depreciation ready}
|
|
27
|
+
description: {id: 'Tiap tanggal 1: draft penyusutan bulan lalu sudah dibuat dan menunggu diperiksa dan diajukan.'}
|
|
28
|
+
severity: info
|
|
29
|
+
to: [owner, finance_manager, head_office]
|
|
30
|
+
can: {model: depreciation_run, action: read}
|
|
@@ -0,0 +1,45 @@
|
|
|
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; font-size: 0.9em; }
|
|
5
|
+
.items th, .items td { border-bottom: 1px solid #d6d3d1; padding: 5px 6px; text-align: left; }
|
|
6
|
+
.items th { border-bottom: 1px solid #1c1917; color: #57534e; font-weight: 600; }
|
|
7
|
+
.items tr.total td { border-top: 2px solid #1c1917; font-weight: 700; }
|
|
8
|
+
.num { text-align: right !important; font-variant-numeric: tabular-nums; white-space: nowrap; }
|
|
9
|
+
.note { margin-top: 14px; font-size: 0.9em; }
|
|
10
|
+
{{end}}
|
|
11
|
+
{{template "letterhead" .}}
|
|
12
|
+
<h1>Daftar aset tetap</h1>
|
|
13
|
+
<table class="meta">
|
|
14
|
+
<tr><td>Penyusutan bulan</td><td>: {{date .Doc.period}} s.d. {{date .Doc.posting_date}}</td><td>Dicetak</td><td>: {{date .Printed}}</td></tr>
|
|
15
|
+
<tr><td>Penyusutan bulan ini</td><td>: {{rupiah .Doc.total_depreciation}} ({{.Doc.asset_count}} aset)</td><td></td><td></td></tr>
|
|
16
|
+
</table>
|
|
17
|
+
<table class="items">
|
|
18
|
+
<thead><tr><th>Aset</th><th>Kelompok</th><th>Tanggal beli</th><th class="num">Harga perolehan</th><th class="num">Akumulasi penyusutan</th><th class="num">Nilai buku</th><th>Status</th></tr></thead>
|
|
19
|
+
<tbody>
|
|
20
|
+
{{range $b := .Related.books}}
|
|
21
|
+
<tr>
|
|
22
|
+
<td>{{$b.asset_name}}<br><small>{{$b.asset}}</small></td>
|
|
23
|
+
<td>{{$b.category_name}}</td>
|
|
24
|
+
<td>{{date $b.acquisition_date}}</td>
|
|
25
|
+
<td class="num">{{rupiah $b.cost}}</td>
|
|
26
|
+
<td class="num">{{rupiah $b.accumulated_total}}</td>
|
|
27
|
+
<td class="num">{{rupiah $b.book_value}}</td>
|
|
28
|
+
<td>{{$b.state_label}}</td>
|
|
29
|
+
</tr>
|
|
30
|
+
{{end}}
|
|
31
|
+
<tr class="total"><td colspan="3">Total</td><td class="num">{{rupiah (sum .Related.books "cost")}}</td><td class="num">{{rupiah (sum .Related.books "accumulated_total")}}</td><td class="num">{{rupiah (sum .Related.books "book_value")}}</td><td></td></tr>
|
|
32
|
+
</tbody>
|
|
33
|
+
</table>
|
|
34
|
+
<h2>Penyusutan bulan ini</h2>
|
|
35
|
+
<table class="items">
|
|
36
|
+
<thead><tr><th>Aset</th><th class="num">Bulan</th><th class="num">Penyusutan</th></tr></thead>
|
|
37
|
+
<tbody>
|
|
38
|
+
{{range $l := .Doc.lines}}
|
|
39
|
+
<tr><td>{{range $b := $.Related.books}}{{if eq $b.asset $l.asset}}{{$b.asset_name}}<br>{{end}}{{end}}<small>{{$l.asset}}</small></td><td class="num">{{$l.months}}</td><td class="num">{{rupiah $l.amount}}</td></tr>
|
|
40
|
+
{{end}}
|
|
41
|
+
<tr class="total"><td colspan="2">Total</td><td class="num">{{rupiah .Doc.total_depreciation}}</td></tr>
|
|
42
|
+
</tbody>
|
|
43
|
+
</table>
|
|
44
|
+
{{if .Truncated.books}}<p class="note"><strong>Daftar dipotong:</strong> hanya 1.000 aset pertama yang ditampilkan.</p>{{end}}
|
|
45
|
+
<p class="note">Nilai di daftar aset adalah nilai saat dicetak. Dicetak dari penyusutan bulan terakhir, nilainya adalah nilai akhir bulan itu.</p>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/print.json
|
|
2
|
+
# Daftar aset tetap, printed from a monthly depreciation run: every asset still held (asset_book Aktif or Habis
|
|
3
|
+
# disusutkan; sold, written-off and cancelled ones are out of the books) with its cost,
|
|
4
|
+
# accumulated depreciation and book value, by category, and this run's depreciation per asset. The register values are
|
|
5
|
+
# those of today: printed from the latest submitted run, they are the values at the end of its month. A4.
|
|
6
|
+
name: fixed_asset_register
|
|
7
|
+
model: depreciation_run
|
|
8
|
+
label: {id: Daftar aset tetap, en: Fixed asset register}
|
|
9
|
+
paper: A4
|
|
10
|
+
template: fixed_asset_register.html
|
|
11
|
+
related:
|
|
12
|
+
books:
|
|
13
|
+
model: asset_book
|
|
14
|
+
match: {}
|
|
15
|
+
filter: state in ['active', 'fully_depreciated']
|
|
16
|
+
sort: category
|
|
17
|
+
limit: 1000
|
|
@@ -1,12 +1,50 @@
|
|
|
1
1
|
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/flow.json
|
|
2
|
-
# Morning
|
|
3
|
-
#
|
|
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
|
-
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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.
|
|
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.
|
|
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]
|
|
@@ -14,6 +14,9 @@ permissions:
|
|
|
14
14
|
- {role: sales_rep, read: true}
|
|
15
15
|
- {role: field_sales, read: true}
|
|
16
16
|
- {role: cashier, read: true}
|
|
17
|
+
# module attendance: staff pick the outlet they clock in at; the outlet supervisor reads the outlets they keep
|
|
18
|
+
- {role: outlet_supervisor, read: true, print: true}
|
|
19
|
+
- {role: employee, read: true, if: "name in user.outlets"}
|
|
17
20
|
fields:
|
|
18
21
|
- name: outlet_name
|
|
19
22
|
type: data
|
|
@@ -87,6 +90,56 @@ fields:
|
|
|
87
90
|
label: {id: Modal kas kasir}
|
|
88
91
|
help: {id: 'Uang kembalian di laci tiap sesi kasir dibuka. Kosongkan kalau kasir yang mengisi'}
|
|
89
92
|
depends_on: app_installed('pos')
|
|
93
|
+
# module attendance (staff clock-in per outlet): the outlet's point and radius are the geofence of the clock screen
|
|
94
|
+
# (screens/absen_outlet.rk), and the default hours are the schedule lateness is measured against when the employee has
|
|
95
|
+
# no shift. Decimal degrees, as a phone's GPS or a map gives them (Bandung is about -6.9, 107.6).
|
|
96
|
+
- name: lat
|
|
97
|
+
type: float
|
|
98
|
+
label: {id: Lintang (lat)}
|
|
99
|
+
help: {id: 'Titik outlet untuk absen. Buka peta di HP saat berada di outlet, salin angka pertama'}
|
|
100
|
+
depends_on: app_installed('attendance')
|
|
101
|
+
- name: lng
|
|
102
|
+
type: float
|
|
103
|
+
label: {id: Bujur (lng)}
|
|
104
|
+
help: {id: 'Angka kedua dari titik peta yang sama'}
|
|
105
|
+
depends_on: app_installed('attendance')
|
|
106
|
+
# Empty until both numbers are set: an outlet without a point measures every clock-in as "no position" (held, never
|
|
107
|
+
# refused), so a forgotten point cannot make a far clock-in count as inside.
|
|
108
|
+
- {name: point, type: geo, label: {id: Titik lokasi}, read_only: true, depends_on: app_installed('attendance'), compute: "lat != 0 || lng != 0 ? {'lat': lat, 'lng': lng} : ''"}
|
|
109
|
+
# Indoor GPS in malls drifts 50 to 150 m: 100 is the default, the owner widens it per outlet.
|
|
110
|
+
- name: radius_m
|
|
111
|
+
type: int
|
|
112
|
+
label: {id: Radius absen (meter)}
|
|
113
|
+
default: '100'
|
|
114
|
+
depends_on: app_installed('attendance')
|
|
115
|
+
# The org timezone is not readable in CEL, so each outlet carries its own zone for the local work day and hours
|
|
116
|
+
# (staff_attendance turns it into the UTC offset +07:00, +08:00 or +09:00).
|
|
117
|
+
- name: time_zone
|
|
118
|
+
type: select
|
|
119
|
+
label: {id: Zona waktu}
|
|
120
|
+
default: "'wib'"
|
|
121
|
+
depends_on: app_installed('attendance')
|
|
122
|
+
options:
|
|
123
|
+
- {value: wib, label: {id: WIB (UTC+7)}}
|
|
124
|
+
- {value: wita, label: {id: WITA (UTC+8)}}
|
|
125
|
+
- {value: wit, label: {id: WIT (UTC+9)}}
|
|
126
|
+
# Empty = no default schedule: no lateness or early leave is measured for this outlet (F&B outlets keep very different
|
|
127
|
+
# hours, so no hour is assumed).
|
|
128
|
+
- name: work_start
|
|
129
|
+
type: data
|
|
130
|
+
label: {id: Jam masuk default}
|
|
131
|
+
help: {id: 'Format JJ:MM, misalnya 08:00. Kosong berarti keterlambatan tidak dihitung'}
|
|
132
|
+
depends_on: app_installed('attendance')
|
|
133
|
+
- name: work_end
|
|
134
|
+
type: data
|
|
135
|
+
label: {id: Jam pulang default}
|
|
136
|
+
help: {id: 'Format JJ:MM, misalnya 17:00. Lebih awal dari jam masuk berarti pulang besok (shift malam)'}
|
|
137
|
+
depends_on: app_installed('attendance')
|
|
138
|
+
- name: late_grace_min
|
|
139
|
+
type: int
|
|
140
|
+
label: {id: Toleransi terlambat (menit)}
|
|
141
|
+
default: '10'
|
|
142
|
+
depends_on: app_installed('attendance')
|
|
90
143
|
rules:
|
|
91
144
|
# The code is part of document numbers (cashier receipts STRK-<code>-..., kernel contract 0009 §2a), which take it
|
|
92
145
|
# as it is: capital letters and digits, parts joined by "-".
|
|
@@ -94,3 +147,19 @@ rules:
|
|
|
94
147
|
on: save
|
|
95
148
|
check: "code == '' || code.matches('^[A-Z0-9]+(-[A-Z0-9]+)*$')"
|
|
96
149
|
message: {id: 'Kode outlet hanya huruf besar dan angka, boleh dipisah tanda -, misalnya DGO atau BDG-1'}
|
|
150
|
+
- name: point_valid
|
|
151
|
+
on: save
|
|
152
|
+
check: "!app_installed('attendance') || (lat == 0 && lng == 0) || (lat >= -90.0 && lat <= 90.0 && lng >= -180.0 && lng <= 180.0)"
|
|
153
|
+
message: {id: 'Titik outlet tidak valid: lintang -90 sampai 90, bujur -180 sampai 180'}
|
|
154
|
+
- name: radius_range
|
|
155
|
+
on: save
|
|
156
|
+
check: "!app_installed('attendance') || radius_m == 0 || (radius_m >= 20 && radius_m <= 2000)"
|
|
157
|
+
message: {id: 'Radius absen 20 sampai 2000 meter'}
|
|
158
|
+
- name: work_hours_shape
|
|
159
|
+
on: save
|
|
160
|
+
check: "!app_installed('attendance') || ((work_start == '' || work_start.matches('^([01][0-9]|2[0-3]):[0-5][0-9]$')) && (work_end == '' || work_end.matches('^([01][0-9]|2[0-3]):[0-5][0-9]$')))"
|
|
161
|
+
message: {id: 'Jam masuk dan jam pulang ditulis JJ:MM, misalnya 08:00 atau 17:30'}
|
|
162
|
+
- name: grace_range
|
|
163
|
+
on: save
|
|
164
|
+
check: "!app_installed('attendance') || (late_grace_min >= 0 && late_grace_min <= 120)"
|
|
165
|
+
message: {id: 'Toleransi terlambat 0 sampai 120 menit'}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/flow.json
|
|
2
|
+
# A Midtrans payment notification (connector midtrans, trigger payment_notified; Snap page, QRIS, virtual account or
|
|
3
|
+
# GoPay) whose order id is a sales invoice becomes a DRAFT payment allocated to that invoice, gateway midtrans, as the
|
|
4
|
+
# DOKU and Xendit flows do (payment_from_xendit_qr holds the reasoning). The kernel checks the notification's
|
|
5
|
+
# signature_key before this runs (rangka-os contract 0002, body-field signatures), so a forged notification never
|
|
6
|
+
# starts it.
|
|
7
|
+
# Midtrans signs only the order id, the status code and the gross amount, so the connector confirms every
|
|
8
|
+
# notification with Midtrans (GET status) before this runs: paid, the status and the channel come from Midtrans's own
|
|
9
|
+
# answer, and paid also needs it to name the same order id and amount. gateway_ref is the order id (one Midtrans
|
|
10
|
+
# transaction per order id), external_id the invoice number in it (an order id of a second or later attempt ends in
|
|
11
|
+
# ~2 ... ~9) and paid_amount the gross amount (a text with two decimals). A genuine notification resent with unsigned
|
|
12
|
+
# fields changed carries the same gateway_ref, so it finds the payment it already made.
|
|
13
|
+
# One Midtrans account per business: the server key is the org's, and an order id is looked up among this org's
|
|
14
|
+
# invoices only. Two businesses that share one Midtrans account and number invoices alike could see each other's
|
|
15
|
+
# notifications; give each business its own Midtrans account (or merchant) and notification URL.
|
|
16
|
+
# Only a completed payment of a positive amount records money. gateway_ref is the flow's idempotency key and the
|
|
17
|
+
# payment's gateway_ref, claimed in gateway_ref_claim BEFORE the payment is made, so two notifications racing
|
|
18
|
+
# (Midtrans retries after 2, 10, 30, 90 and 210 minutes, and sends capture then settlement for a card) record one
|
|
19
|
+
# payment. A notification for an unknown or cancelled invoice records nothing and tells the owner: the money is at
|
|
20
|
+
# Midtrans.
|
|
21
|
+
# Method: Midtrans payment_type qris is qris, bank_transfer and echannel (Mandiri bill) are va, gopay, shopeepay, dana
|
|
22
|
+
# and ovo are ewallet, the rest other.
|
|
23
|
+
name: payment_from_midtrans
|
|
24
|
+
label: {id: Pembayaran Midtrans jadi pembayaran faktur}
|
|
25
|
+
on: midtrans.payment_notified
|
|
26
|
+
# Every paid notification runs the flow; one without the order id or with no readable positive amount records nothing
|
|
27
|
+
# and tells the owner (the money is at Midtrans), instead of being skipped silently.
|
|
28
|
+
if: "'paid' in event && event.paid == true"
|
|
29
|
+
idempotency: "'gateway_ref' in event ? event.gateway_ref : ''"
|
|
30
|
+
steps:
|
|
31
|
+
- find: payment
|
|
32
|
+
if: "'gateway_ref' in event && event.gateway_ref != '' && 'external_id' in event && 'paid_amount' in event && string(event.paid_amount).matches('^[0-9]+([.][0-9]+)?$') && double(string(event.paid_amount)) > 0"
|
|
33
|
+
where: "gateway_ref == event.gateway_ref && docstatus != 2"
|
|
34
|
+
as: done
|
|
35
|
+
- find: sales_invoice
|
|
36
|
+
if: "'gateway_ref' in event && event.gateway_ref != '' && 'external_id' in event && 'paid_amount' in event && string(event.paid_amount).matches('^[0-9]+([.][0-9]+)?$') && double(string(event.paid_amount)) > 0"
|
|
37
|
+
where: "name == event.external_id && docstatus == 1"
|
|
38
|
+
as: inv
|
|
39
|
+
- find_all: payment
|
|
40
|
+
if: "'gateway_ref' in event && event.gateway_ref != '' && 'external_id' in event && 'paid_amount' in event && string(event.paid_amount).matches('^[0-9]+([.][0-9]+)?$') && double(string(event.paid_amount)) > 0"
|
|
41
|
+
where: "docstatus == 0 && reference == event.external_id"
|
|
42
|
+
as: drafts
|
|
43
|
+
- find: gateway_ref_claim
|
|
44
|
+
if: "'gateway_ref' in event && event.gateway_ref != '' && 'external_id' in event && 'paid_amount' in event && string(event.paid_amount).matches('^[0-9]+([.][0-9]+)?$') && double(string(event.paid_amount)) > 0"
|
|
45
|
+
where: gateway_ref == event.gateway_ref
|
|
46
|
+
as: held
|
|
47
|
+
- find: payment
|
|
48
|
+
if: "'gateway_ref' in event && event.gateway_ref != '' && 'external_id' in event && 'paid_amount' in event && string(event.paid_amount).matches('^[0-9]+([.][0-9]+)?$') && double(string(event.paid_amount)) > 0"
|
|
49
|
+
where: "held != null && name == held.payment && docstatus != 2"
|
|
50
|
+
as: holder
|
|
51
|
+
- update: held
|
|
52
|
+
if: "'gateway_ref' in event && event.gateway_ref != '' && 'external_id' in event && 'paid_amount' in event && string(event.paid_amount).matches('^[0-9]+([.][0-9]+)?$') && double(string(event.paid_amount)) > 0 && done == null && inv != null && held != null && holder == null"
|
|
53
|
+
set: {gateway_ref: "''", released_ref: event.gateway_ref}
|
|
54
|
+
- create: gateway_ref_claim
|
|
55
|
+
if: "'gateway_ref' in event && event.gateway_ref != '' && 'external_id' in event && 'paid_amount' in event && string(event.paid_amount).matches('^[0-9]+([.][0-9]+)?$') && double(string(event.paid_amount)) > 0 && done == null && inv != null && (held == null || holder == null)"
|
|
56
|
+
set: {gateway_ref: event.gateway_ref, payment: "''"}
|
|
57
|
+
as: claim
|
|
58
|
+
- create: payment
|
|
59
|
+
if: "'gateway_ref' in event && event.gateway_ref != '' && 'external_id' in event && 'paid_amount' in event && string(event.paid_amount).matches('^[0-9]+([.][0-9]+)?$') && double(string(event.paid_amount)) > 0 && done == null && inv != null && (held == null || holder == null)"
|
|
60
|
+
set:
|
|
61
|
+
direction: "'receive'"
|
|
62
|
+
customer: inv.customer
|
|
63
|
+
payment_date: today()
|
|
64
|
+
amount: "double(string(event.paid_amount))"
|
|
65
|
+
method: >-
|
|
66
|
+
'channel' in event && event.channel == 'qris' ? 'qris'
|
|
67
|
+
: ('channel' in event && event.channel in ['bank_transfer', 'echannel'] ? 'va'
|
|
68
|
+
: ('channel' in event && event.channel in ['gopay', 'shopeepay', 'dana', 'ovo'] ? 'ewallet' : 'other'))
|
|
69
|
+
gateway: "'midtrans'"
|
|
70
|
+
gateway_ref: event.gateway_ref
|
|
71
|
+
reference: inv.name
|
|
72
|
+
notes: "'Dari Midtrans ' + event.gateway_ref"
|
|
73
|
+
allocations: "min(double(string(event.paid_amount)), inv.outstanding - drafts.map(p, p.allocated_total).sum()) > 0 ? [{'sales_invoice': inv.name, 'amount': min(double(string(event.paid_amount)), inv.outstanding - drafts.map(p, p.allocated_total).sum())}] : []"
|
|
74
|
+
as: pay
|
|
75
|
+
- update: claim
|
|
76
|
+
if: "'gateway_ref' in event && event.gateway_ref != '' && 'external_id' in event && 'paid_amount' in event && string(event.paid_amount).matches('^[0-9]+([.][0-9]+)?$') && double(string(event.paid_amount)) > 0 && done == null && inv != null && (held == null || holder == null)"
|
|
77
|
+
set: {payment: pay.name}
|
|
78
|
+
- notify: owner
|
|
79
|
+
if: "'gateway_ref' in event && event.gateway_ref != '' && 'external_id' in event && 'paid_amount' in event && string(event.paid_amount).matches('^[0-9]+([.][0-9]+)?$') && double(string(event.paid_amount)) > 0 && done == null && inv == null"
|
|
80
|
+
channel: email
|
|
81
|
+
template: {id: 'Midtrans {event.gateway_ref}: Rp {event.paid_amount} untuk {event.external_id}, faktur tidak ada/terbuka. Catat manual.'}
|
|
82
|
+
- notify: owner
|
|
83
|
+
if: "!('gateway_ref' in event && event.gateway_ref != '' && 'external_id' in event && 'paid_amount' in event && string(event.paid_amount).matches('^[0-9]+([.][0-9]+)?$') && double(string(event.paid_amount)) > 0)"
|
|
84
|
+
channel: email
|
|
85
|
+
template: {id: 'Midtrans: ada pembayaran lunas tanpa order id atau jumlah yang terbaca. Cek dashboard Midtrans dan log connector, catat manual.'}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/flow.json
|
|
2
|
+
# A Midtrans refund (trigger payment_notified, transaction_status refund or partial_refund, status code 200): the money
|
|
3
|
+
# went back to the payer from the Midtrans balance. It is never money in (payment_from_midtrans runs only for
|
|
4
|
+
# paid == true) and it is not booked here either (no credit note or money-out document yet), so the owner is told,
|
|
5
|
+
# with the order id (the invoice number, plus ~<attempt> for a later attempt), to record it, as payment_refund_from_doku does.
|
|
6
|
+
# The status and the refunded amount come from Midtrans's own answer (the connector confirms every notification with
|
|
7
|
+
# GET status), not from the notification, which Midtrans signs only in part. The message still sends the owner to the
|
|
8
|
+
# Midtrans dashboard: the refund is recorded there, not here.
|
|
9
|
+
name: payment_refund_from_midtrans
|
|
10
|
+
label: {id: Refund Midtrans diberitahukan ke pemilik}
|
|
11
|
+
on: midtrans.payment_notified
|
|
12
|
+
if: "'refunded' in event && event.refunded == true && 'gateway_ref' in event && event.gateway_ref != ''"
|
|
13
|
+
idempotency: "'refund:' + event.gateway_ref + ':' + ('status' in event && event.status != null ? event.status : '') + ':' + ('refund_amount' in event && event.refund_amount != null ? string(event.refund_amount) : '')"
|
|
14
|
+
steps:
|
|
15
|
+
- notify: owner
|
|
16
|
+
if: "'refund_amount' in event && event.refund_amount != null"
|
|
17
|
+
channel: email
|
|
18
|
+
template: {id: 'Refund Midtrans {event.gateway_ref}: Rp {event.refund_amount} menurut notifikasi. Cek dashboard Midtrans, lalu catat pengembaliannya.'}
|
|
19
|
+
- notify: owner
|
|
20
|
+
if: "!('refund_amount' in event && event.refund_amount != null)"
|
|
21
|
+
channel: email
|
|
22
|
+
template: {id: 'Refund Midtrans {event.gateway_ref}. Cek jumlahnya di dashboard Midtrans, lalu catat pengembaliannya.'}
|
|
@@ -82,7 +82,7 @@ fields:
|
|
|
82
82
|
label: {id: Salesman}
|
|
83
83
|
default: customer.salesman
|
|
84
84
|
depends_on: "app_installed('distribution') && direction == 'receive'"
|
|
85
|
-
# Payments that arrive through a payment gateway (Xendit VA, QRIS, payment link) carry the gateway's id, so a
|
|
85
|
+
# Payments that arrive through a payment gateway (Xendit, DOKU, Midtrans: VA, QRIS, payment link) carry the gateway's id, so a
|
|
86
86
|
# callback delivered twice finds the payment it already made instead of paying the invoice again. One live
|
|
87
87
|
# payment per id is kept by gateway_ref_claim, not by `unique` here: the kernel's unique index also holds the id
|
|
88
88
|
# on a cancelled payment, which made amending it fail (500) and the callback impossible to record again.
|
|
@@ -92,6 +92,7 @@ fields:
|
|
|
92
92
|
options:
|
|
93
93
|
- {value: xendit, label: {id: Xendit}}
|
|
94
94
|
- {value: doku, label: {id: DOKU}}
|
|
95
|
+
- {value: midtrans, label: {id: Midtrans}}
|
|
95
96
|
- name: gateway_ref
|
|
96
97
|
type: data
|
|
97
98
|
label: {id: ID transaksi gateway}
|