@rangka-os/create 0.5.0-alpha.5 → 0.5.0-alpha.7
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/fnb_cabang/dashboards/stock_recap.rk +6 -4
- package/template/base/apps/grosir_distribusi/app.rk +48 -0
- package/template/base/apps/grosir_distribusi/dashboards/grosir_ar.rk +62 -0
- package/template/base/apps/grosir_distribusi/dashboards/grosir_overview.rk +85 -0
- package/template/base/apps/jasa_proyek/app.rk +5 -4
- package/template/base/apps/jasa_proyek/dashboards/jasa_overview.rk +20 -0
- package/template/base/apps/jasa_proyek/dashboards/project_margin.rk +66 -0
- package/template/base/apps/jasa_proyek/processes/quote_to_cash.rk +2 -1
- package/template/base/apps/produksi_pabrik/app.rk +46 -0
- package/template/base/apps/produksi_pabrik/dashboards/produksi_overview.rk +96 -0
- package/template/base/apps/produksi_pabrik/dashboards/produksi_upah.rk +39 -0
- package/template/base/apps/ritel_cabang/app.rk +50 -0
- package/template/base/apps/ritel_cabang/dashboards/ritel_overview.rk +123 -0
- package/template/base/apps/ritel_cabang/dashboards/ritel_stock.rk +146 -0
- package/template/base/apps/ritel_cabang/dashboards/ritel_tax.rk +76 -0
- package/template/base/connectors/loyverse/connector.rk +93 -0
- package/template/base/connectors/moka/connector.rk +81 -0
- package/template/base/connectors/whatsapp_business/connector.rk +16 -0
- package/template/base/connectors/whatsapp_business/templates.md +32 -0
- package/template/base/connectors/xendit/connector.rk +179 -0
- package/template/base/modules/bank_statement/flows/bank_transaction_claim.rk +19 -0
- package/template/base/modules/bank_statement/flows/bank_transaction_confirm.rk +43 -0
- package/template/base/modules/bank_statement/flows/bank_transaction_link_locked.rk +11 -0
- package/template/base/modules/bank_statement/flows/bank_transaction_matched.rk +13 -0
- package/template/base/modules/bank_statement/flows/bank_transaction_release.rk +11 -0
- package/template/base/modules/bank_statement/flows/bank_transaction_suggest.rk +21 -0
- package/template/base/modules/bank_statement/flows/bank_transaction_unmatched.rk +11 -0
- package/template/base/modules/bank_statement/imports/bank_statement_csv.rk +25 -0
- package/template/base/modules/bank_statement/models/bank_transaction.rk +124 -0
- package/template/base/modules/bank_statement/models/bank_transaction_claim.rk +49 -0
- package/template/base/modules/bank_statement/module.rk +7 -0
- package/template/base/modules/catalogue/imports/item_list.rk +20 -0
- package/template/base/modules/catalogue/imports/item_master.rk +25 -0
- package/template/base/modules/catalogue/models/item.rk +56 -1
- package/template/base/modules/catalogue/models/item_category.rk +27 -0
- package/template/base/modules/catalogue/models/uom.rk +1 -0
- package/template/base/modules/catalogue/module.rk +2 -1
- package/template/base/modules/consignment/flows/consignment_bill.rk +36 -0
- package/template/base/modules/consignment/flows/consignment_bill_cancelled.rk +14 -0
- package/template/base/modules/consignment/models/consignment_settlement.rk +93 -0
- package/template/base/modules/consignment/models/consignment_settlement_item.rk +37 -0
- package/template/base/modules/consignment/module.rk +10 -0
- package/template/base/modules/contacts/imports/customer_list.rk +17 -0
- package/template/base/modules/contacts/imports/vendor_list.rk +16 -0
- package/template/base/modules/contacts/models/customer.rk +58 -1
- package/template/base/modules/contacts/module.rk +1 -1
- package/template/base/modules/delivery/flows/delivery_cancel_guard.rk +18 -0
- package/template/base/modules/delivery/flows/fulfilment_on_delivery_cancelled.rk +21 -0
- package/template/base/modules/delivery/flows/fulfilment_on_delivery_submitted.rk +21 -0
- package/template/base/modules/delivery/flows/fulfilment_on_invoice_cancelled.rk +22 -0
- package/template/base/modules/delivery/flows/fulfilment_on_invoice_submitted.rk +22 -0
- package/template/base/modules/delivery/flows/fulfilment_on_order_created.rk +18 -0
- package/template/base/modules/delivery/flows/fulfilment_on_order_submitted.rk +16 -0
- package/template/base/modules/delivery/flows/fulfilment_on_order_updated.rk +19 -0
- package/template/base/modules/delivery/flows/fulfilment_on_return_cancelled.rk +16 -0
- package/template/base/modules/delivery/flows/fulfilment_on_return_submitted.rk +16 -0
- package/template/base/modules/delivery/flows/invoice_qty_from_deliveries.rk +20 -0
- package/template/base/modules/delivery/flows/order_cancel_guard.rk +10 -0
- package/template/base/modules/delivery/flows/return_cancel_guard.rk +11 -0
- package/template/base/modules/delivery/flows/return_credit_on_payment_cancelled.rk +11 -0
- package/template/base/modules/delivery/flows/return_credit_on_payment_submitted.rk +21 -0
- package/template/base/modules/delivery/flows/return_credit_on_return_cancelled.rk +11 -0
- package/template/base/modules/delivery/flows/return_credit_on_return_submitted.rk +10 -0
- package/template/base/modules/delivery/models/delivery_guard.rk +48 -0
- package/template/base/modules/delivery/models/delivery_note.rk +94 -0
- package/template/base/modules/delivery/models/delivery_note_item.rk +9 -0
- package/template/base/modules/delivery/models/order_fulfilment.rk +27 -0
- package/template/base/modules/delivery/models/order_fulfilment_item.rk +10 -0
- package/template/base/modules/delivery/models/return_credit.rk +23 -0
- package/template/base/modules/delivery/models/sales_return.rk +87 -0
- package/template/base/modules/delivery/models/sales_return_item.rk +16 -0
- package/template/base/modules/delivery/module.rk +11 -0
- package/template/base/modules/distribution/flows/credit_on_invoice_cancelled.rk +17 -0
- package/template/base/modules/distribution/flows/credit_on_invoice_submitted.rk +17 -0
- package/template/base/modules/distribution/flows/credit_on_order_cancelled.rk +17 -0
- package/template/base/modules/distribution/flows/credit_on_order_submitted.rk +17 -0
- package/template/base/modules/distribution/flows/credit_on_payment_cancelled.rk +17 -0
- package/template/base/modules/distribution/flows/credit_on_payment_submitted.rk +17 -0
- package/template/base/modules/distribution/flows/giro_bounced.rk +20 -0
- package/template/base/modules/distribution/flows/giro_from_payment.rk +21 -0
- package/template/base/modules/distribution/flows/order_tier_pricing_created.rk +17 -0
- package/template/base/modules/distribution/flows/order_tier_pricing_updated.rk +17 -0
- package/template/base/modules/distribution/models/giro.rk +79 -0
- package/template/base/modules/distribution/module.rk +9 -0
- package/template/base/modules/invoicing/flows/invoice_due_digest.rk +12 -0
- package/template/base/modules/invoicing/flows/milestone_invoiced.rk +23 -0
- package/template/base/modules/invoicing/flows/milestone_reopened.rk +19 -0
- package/template/base/modules/invoicing/flows/project_billed_on_cancel.rk +16 -0
- package/template/base/modules/invoicing/flows/project_billed_on_submit.rk +16 -0
- package/template/base/modules/invoicing/flows/project_revenue_on_cancel.rk +22 -0
- package/template/base/modules/invoicing/flows/project_revenue_on_submit.rk +17 -0
- package/template/base/modules/invoicing/models/invoice_reminder.rk +83 -0
- package/template/base/modules/invoicing/models/sales_invoice.rk +108 -3
- package/template/base/modules/invoicing/models/sales_invoice_item.rk +9 -0
- package/template/base/modules/invoicing/module.rk +2 -2
- package/template/base/modules/invoicing/print/sales_invoice.html +2 -1
- package/template/base/modules/invoicing/print/sales_invoice_whatsapp.html +33 -0
- package/template/base/modules/invoicing/print/sales_invoice_whatsapp.rk +8 -0
- package/template/base/modules/orders/models/customer_order.rk +80 -2
- package/template/base/modules/orders/models/customer_order_item.rk +19 -0
- package/template/base/modules/orders/module.rk +2 -2
- package/template/base/modules/outlet_sales/flows/moka_legacy_key_overlap.rk +22 -0
- package/template/base/modules/outlet_sales/imports/daily_form.rk +3 -1
- package/template/base/modules/outlet_sales/imports/loyverse_receipts.rk +28 -0
- package/template/base/modules/outlet_sales/imports/moka_item_details.rk +14 -4
- package/template/base/modules/outlet_sales/imports/pos_sales_file.rk +28 -0
- package/template/base/modules/outlet_sales/imports/takings_file.rk +23 -0
- package/template/base/modules/outlet_sales/models/outlet_sales.rk +72 -6
- package/template/base/modules/outlet_sales/models/outlet_sales_line.rk +1 -0
- package/template/base/modules/outlet_sales/models/outlet_takings.rk +83 -0
- package/template/base/modules/outlet_sales/models/outlet_takings_line.rk +37 -0
- package/template/base/modules/outlets/models/outlet.rk +18 -0
- package/template/base/modules/outlets/module.rk +1 -1
- package/template/base/modules/payments/flows/payment_gateway_claim_created.rk +19 -0
- package/template/base/modules/payments/flows/payment_gateway_claim_submitted.rk +19 -0
- package/template/base/modules/payments/flows/payment_gateway_release.rk +12 -0
- package/template/base/modules/payments/models/gateway_ref_claim.rk +42 -0
- package/template/base/modules/payments/models/payment.rk +59 -1
- package/template/base/modules/payments/models/withholding.rk +3 -1
- package/template/base/modules/payments/module.rk +2 -2
- package/template/base/modules/procurement/flows/project_vendor_cost_on_cancel.rk +22 -0
- package/template/base/modules/procurement/flows/project_vendor_cost_on_submit.rk +17 -0
- package/template/base/modules/procurement/imports/opening_stock.rk +25 -0
- package/template/base/modules/procurement/models/goods_receipt.rk +1 -1
- package/template/base/modules/procurement/models/purchase_order.rk +15 -7
- package/template/base/modules/procurement/models/purchase_request.rk +11 -1
- package/template/base/modules/procurement/models/vendor_bill.rk +12 -1
- package/template/base/modules/procurement/module.rk +1 -1
- package/template/base/modules/production/flows/batch_cancel_guard.rk +12 -0
- package/template/base/modules/production/flows/batch_from_bom.rk +19 -0
- package/template/base/modules/production/flows/wage_sheet_on_batch_cancelled.rk +14 -0
- package/template/base/modules/production/flows/wage_sheet_on_batch_submitted.rk +12 -0
- package/template/base/modules/production/flows/work_order_materials_created.rk +20 -0
- package/template/base/modules/production/flows/work_order_materials_updated.rk +20 -0
- package/template/base/modules/production/models/bom.rk +67 -0
- package/template/base/modules/production/models/bom_byproduct.rk +7 -0
- package/template/base/modules/production/models/bom_line.rk +11 -0
- package/template/base/modules/production/models/production_batch.rk +149 -0
- package/template/base/modules/production/models/production_guard.rk +23 -0
- package/template/base/modules/production/models/production_labour.rk +10 -0
- package/template/base/modules/production/models/production_material.rk +8 -0
- package/template/base/modules/production/models/production_output.rk +8 -0
- package/template/base/modules/production/models/production_stage.rk +19 -0
- package/template/base/modules/production/models/wage_line.rk +11 -0
- package/template/base/modules/production/models/wage_sheet.rk +28 -0
- package/template/base/modules/production/models/work_order.rk +63 -0
- package/template/base/modules/production/models/work_order_material.rk +8 -0
- package/template/base/modules/production/module.rk +12 -0
- package/template/base/modules/projects/flows/milestone_back_on_acceptance_cancel.rk +15 -0
- package/template/base/modules/projects/flows/milestone_lock_on_update.rk +16 -0
- package/template/base/modules/projects/flows/milestone_ready_on_acceptance.rk +40 -0
- package/template/base/modules/projects/flows/milestone_scheduled_on_create.rk +14 -0
- package/template/base/modules/projects/flows/milestone_scheduled_on_update.rk +27 -0
- package/template/base/modules/projects/flows/project_expense_on_cancel.rk +21 -0
- package/template/base/modules/projects/flows/project_expense_on_submit.rk +16 -0
- package/template/base/modules/projects/flows/project_labor_on_cancel.rk +22 -0
- package/template/base/modules/projects/flows/project_labor_on_submit.rk +17 -0
- package/template/base/modules/projects/flows/project_terms_lock.rk +26 -0
- package/template/base/modules/projects/flows/vendor_bill_cancel_guard.rk +15 -0
- package/template/base/modules/projects/imports/billing_milestone.rk +20 -0
- package/template/base/modules/projects/models/assignment.rk +21 -1
- package/template/base/modules/projects/models/billing_milestone.rk +217 -0
- package/template/base/modules/projects/models/project.rk +76 -2
- package/template/base/modules/projects/models/project_expense.rk +119 -0
- package/template/base/modules/projects/models/project_guard.rk +27 -0
- package/template/base/modules/projects/models/project_ledger.rk +132 -0
- package/template/base/modules/projects/models/timesheet.rk +38 -3
- package/template/base/modules/projects/module.rk +1 -1
- package/template/base/modules/stock/flows/adjustment_value_backfill.rk +94 -0
- package/template/base/modules/stock/flows/adjustment_value_on_cancel.rk +19 -0
- package/template/base/modules/stock/flows/adjustment_value_on_submit.rk +17 -0
- package/template/base/modules/stock/models/recipe.rk +8 -0
- package/template/base/modules/stock/models/stock_adjustment.rk +1 -0
- package/template/base/modules/stock/models/stock_adjustment_value.rk +75 -0
- package/template/base/modules/stock/models/stock_balance.rk +3 -0
- package/template/base/modules/stock/models/stock_move.rk +10 -1
- package/template/base/modules/stock/module.rk +1 -1
- package/template/base/modules/users/models/user.rk +1 -0
- package/template/base/modules/users/module.rk +1 -1
- package/template/base/modules/users/roles/field_sales.rk +7 -0
- package/template/base/modules/workforce/imports/worker_list.rk +16 -0
- package/template/base/modules/workforce/models/worker.rk +22 -1
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/connector.json
|
|
2
|
+
# Xendit (Indonesia): fixed virtual accounts, dynamic QRIS and payment links, for one business or a xenPlatform
|
|
3
|
+
# sub-account (header for-user-id). Every request uses the secret key as the Basic auth user name with an empty password.
|
|
4
|
+
# Callbacks carry the account's callback token in the x-callback-token header (a static token, not an HMAC).
|
|
5
|
+
# Every trigger emits gateway_ref (Xendit's payment id): flows use it as idempotency key and as payment.gateway_ref,
|
|
6
|
+
# held by one live payment at a time in rangka-apps (gateway_ref_claim), so a callback delivered twice cannot pay an
|
|
7
|
+
# invoice twice.
|
|
8
|
+
# A trigger fires for every callback of its kind, not only for payments: Xendit sends the invoice callback for
|
|
9
|
+
# EXPIRED links too, and a QR callback carries event (qr.payment, qr.refund) and data.status. Every trigger therefore emits `paid` (true only for a
|
|
10
|
+
# completed payment: VA always, QR qr.payment SUCCEEDED, link PAID or SETTLED), and a flow that records money starts with
|
|
11
|
+
# `if: event.paid` (the trigger format has no filter of its own). See the README example.
|
|
12
|
+
# Test mode: a secret key starting with xnd_development_ talks to the same URLs; the dashboard simulates VA and QRIS
|
|
13
|
+
# payments and sends the callbacks.
|
|
14
|
+
name: xendit
|
|
15
|
+
label: {id: Xendit}
|
|
16
|
+
version: 0.1.0
|
|
17
|
+
vendor: Xendit
|
|
18
|
+
docs: https://developers.xendit.co/api-reference/
|
|
19
|
+
auth:
|
|
20
|
+
type: basic
|
|
21
|
+
fields:
|
|
22
|
+
- name: secret_key
|
|
23
|
+
label: {id: Secret key}
|
|
24
|
+
secret: true
|
|
25
|
+
help: {id: 'Dashboard Xendit > Settings > API keys. Kunci xnd_development_ untuk mode test.'}
|
|
26
|
+
- name: callback_token
|
|
27
|
+
label: {id: Callback verification token}
|
|
28
|
+
secret: true
|
|
29
|
+
help: {id: Dashboard Xendit > Settings > Callbacks. Dipakai memeriksa header x-callback-token}
|
|
30
|
+
- name: for_user_id
|
|
31
|
+
label: {id: ID sub-account xenPlatform}
|
|
32
|
+
help: {id: Kosongkan kalau akun Xendit milik usaha ini sendiri}
|
|
33
|
+
triggers:
|
|
34
|
+
- name: va_paid
|
|
35
|
+
label: {id: Virtual account dibayar}
|
|
36
|
+
via: webhook
|
|
37
|
+
verify:
|
|
38
|
+
header: x-callback-token
|
|
39
|
+
equals: auth.callback_token
|
|
40
|
+
emit:
|
|
41
|
+
gateway_ref: payment_id
|
|
42
|
+
external_id: external_id
|
|
43
|
+
paid_amount: amount
|
|
44
|
+
paid_at: transaction_timestamp
|
|
45
|
+
method: "'va'"
|
|
46
|
+
paid: 'true'
|
|
47
|
+
bank_code: bank_code
|
|
48
|
+
account_number: account_number
|
|
49
|
+
sub_account: owner_id
|
|
50
|
+
- name: qr_paid
|
|
51
|
+
label: {id: QRIS dibayar}
|
|
52
|
+
via: webhook
|
|
53
|
+
verify:
|
|
54
|
+
header: x-callback-token
|
|
55
|
+
equals: auth.callback_token
|
|
56
|
+
emit:
|
|
57
|
+
gateway_ref: data.id
|
|
58
|
+
external_id: data.reference_id
|
|
59
|
+
paid_amount: data.amount
|
|
60
|
+
paid_at: data.created
|
|
61
|
+
status: data.status
|
|
62
|
+
paid: event == 'qr.payment' && data.status == 'SUCCEEDED'
|
|
63
|
+
method: "'qris'"
|
|
64
|
+
sub_account: business_id
|
|
65
|
+
- name: invoice_paid
|
|
66
|
+
label: {id: Link bayar dibayar}
|
|
67
|
+
via: webhook
|
|
68
|
+
verify:
|
|
69
|
+
header: x-callback-token
|
|
70
|
+
equals: auth.callback_token
|
|
71
|
+
emit:
|
|
72
|
+
gateway_ref: id
|
|
73
|
+
external_id: external_id
|
|
74
|
+
status: status
|
|
75
|
+
paid: status == 'PAID' || status == 'SETTLED'
|
|
76
|
+
paid_amount: paid_amount
|
|
77
|
+
paid_at: paid_at
|
|
78
|
+
# Xendit's payment_method (BANK_TRANSFER, QR_CODE, EWALLET, ...) as rangka-apps payment.method
|
|
79
|
+
method: "payment_method == 'BANK_TRANSFER' ? 'va' : payment_method == 'QR_CODE' ? 'qris' : payment_method == 'EWALLET' ? 'ewallet' : 'other'"
|
|
80
|
+
channel: payment_channel
|
|
81
|
+
fee: fees_paid_amount
|
|
82
|
+
sub_account: user_id
|
|
83
|
+
actions:
|
|
84
|
+
- name: create_fixed_va
|
|
85
|
+
label: {id: Buat virtual account}
|
|
86
|
+
request:
|
|
87
|
+
method: POST
|
|
88
|
+
url: https://api.xendit.co/callback_virtual_accounts
|
|
89
|
+
headers: {for-user-id: '{auth.for_user_id}'}
|
|
90
|
+
body:
|
|
91
|
+
external_id: '{input.external_id}'
|
|
92
|
+
bank_code: '{input.bank_code}'
|
|
93
|
+
name: '{input.customer_name}'
|
|
94
|
+
expected_amount: '{input.amount}'
|
|
95
|
+
is_closed: '{input.amount > 0}'
|
|
96
|
+
is_single_use: '{input.single_use}'
|
|
97
|
+
expiration_date: '{input.expires_at}'
|
|
98
|
+
input:
|
|
99
|
+
- {name: external_id, type: data, required: true, help: {id: Nomor faktur}}
|
|
100
|
+
- {name: bank_code, type: data, required: true, help: {id: 'BCA, BNI, BRI, MANDIRI, PERMATA, BSI, CIMB'}}
|
|
101
|
+
- {name: customer_name, type: data, required: true}
|
|
102
|
+
- {name: amount, type: currency, help: {id: 'Kosong atau 0: VA terbuka, nominal bebas'}}
|
|
103
|
+
- {name: single_use, type: check}
|
|
104
|
+
- {name: expires_at, type: datetime}
|
|
105
|
+
output:
|
|
106
|
+
gateway_ref: id
|
|
107
|
+
account_number: account_number
|
|
108
|
+
bank_code: bank_code
|
|
109
|
+
status: status
|
|
110
|
+
retry: {max: 5, backoff: exponential, on: [429, 500, 502, 503]}
|
|
111
|
+
idempotency: input.external_id + ':' + string(input.amount)
|
|
112
|
+
- name: create_qr_code
|
|
113
|
+
label: {id: Buat QRIS dinamis}
|
|
114
|
+
request:
|
|
115
|
+
method: POST
|
|
116
|
+
url: https://api.xendit.co/qr_codes
|
|
117
|
+
headers: {api-version: '2022-07-31', for-user-id: '{auth.for_user_id}'}
|
|
118
|
+
body:
|
|
119
|
+
reference_id: '{input.external_id}'
|
|
120
|
+
type: DYNAMIC
|
|
121
|
+
currency: IDR
|
|
122
|
+
amount: '{input.amount}'
|
|
123
|
+
expires_at: '{input.expires_at}'
|
|
124
|
+
input:
|
|
125
|
+
- {name: external_id, type: data, required: true}
|
|
126
|
+
- {name: amount, type: currency, required: true}
|
|
127
|
+
- {name: expires_at, type: datetime}
|
|
128
|
+
output:
|
|
129
|
+
gateway_ref: id
|
|
130
|
+
qr_string: qr_string
|
|
131
|
+
expires_at: expires_at
|
|
132
|
+
status: status
|
|
133
|
+
retry: {max: 5, backoff: exponential, on: [429, 500, 502, 503]}
|
|
134
|
+
idempotency: input.external_id + ':' + string(input.amount)
|
|
135
|
+
- name: create_invoice
|
|
136
|
+
label: {id: Buat link bayar}
|
|
137
|
+
request:
|
|
138
|
+
method: POST
|
|
139
|
+
url: https://api.xendit.co/v2/invoices
|
|
140
|
+
headers: {for-user-id: '{auth.for_user_id}'}
|
|
141
|
+
body:
|
|
142
|
+
external_id: '{input.external_id}'
|
|
143
|
+
amount: '{input.amount}'
|
|
144
|
+
description: '{input.description}'
|
|
145
|
+
invoice_duration: '{input.duration_seconds}'
|
|
146
|
+
customer:
|
|
147
|
+
given_names: '{input.customer_name}'
|
|
148
|
+
mobile_number: '{input.phone}'
|
|
149
|
+
currency: IDR
|
|
150
|
+
input:
|
|
151
|
+
- {name: external_id, type: data, required: true}
|
|
152
|
+
- {name: amount, type: currency, required: true}
|
|
153
|
+
- {name: description, type: data}
|
|
154
|
+
- {name: customer_name, type: data}
|
|
155
|
+
- {name: phone, type: phone}
|
|
156
|
+
- {name: duration_seconds, type: int, default: '604800'}
|
|
157
|
+
output:
|
|
158
|
+
gateway_ref: id
|
|
159
|
+
url: invoice_url
|
|
160
|
+
expires_at: expiry_date
|
|
161
|
+
status: status
|
|
162
|
+
retry: {max: 5, backoff: exponential, on: [429, 500, 502, 503]}
|
|
163
|
+
idempotency: input.external_id + ':' + string(input.amount)
|
|
164
|
+
- name: get_invoice
|
|
165
|
+
label: {id: Cek status link bayar}
|
|
166
|
+
request:
|
|
167
|
+
method: GET
|
|
168
|
+
url: https://api.xendit.co/v2/invoices/{input.gateway_ref}
|
|
169
|
+
headers: {for-user-id: '{auth.for_user_id}'}
|
|
170
|
+
input:
|
|
171
|
+
- {name: gateway_ref, type: data, required: true}
|
|
172
|
+
output:
|
|
173
|
+
status: status
|
|
174
|
+
paid_amount: paid_amount
|
|
175
|
+
paid_at: paid_at
|
|
176
|
+
retry: {max: 3, backoff: exponential, on: [429, 500, 502, 503]}
|
|
177
|
+
idempotency: input.gateway_ref
|
|
178
|
+
limits:
|
|
179
|
+
note: {id: 'Biaya per transaksi VA dan QRIS dipotong Xendit sebelum settlement ke rekening usaha.'}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/flow.json
|
|
2
|
+
# A payment that names a statement line is submitted: it claims the line (bank_transaction_claim). The unique index
|
|
3
|
+
# refuses the claim, and with it the whole submit, when another live payment already holds the line. The claim's
|
|
4
|
+
# rule refuses it too when the payment is not the line's own: not the draft the line made (line.draft_payment, the
|
|
5
|
+
# draft's name before submit) nor the amend of a payment of the same line, or not for the line's amount.
|
|
6
|
+
name: bank_transaction_claim
|
|
7
|
+
label: {id: Klaim mutasi saat pembayaran diajukan}
|
|
8
|
+
on: payment.submitted
|
|
9
|
+
if: event.direction == 'receive' && event.bank_transaction != ''
|
|
10
|
+
steps:
|
|
11
|
+
- {find: bank_transaction, where: name == event.bank_transaction, as: line}
|
|
12
|
+
- find: payment
|
|
13
|
+
where: "event.amended_from != '' && name == event.amended_from && bank_transaction == event.bank_transaction"
|
|
14
|
+
as: source
|
|
15
|
+
- create: bank_transaction_claim
|
|
16
|
+
set:
|
|
17
|
+
bank_transaction: event.bank_transaction
|
|
18
|
+
payment: event.name
|
|
19
|
+
valid: "line != null && line.amount == event.amount && (line.draft_payment == event.before.name || source != null)"
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/flow.json
|
|
2
|
+
# The owner sets a line to "Dikonfirmasi": draft a payment from the customer of the chosen invoice, for the line's
|
|
3
|
+
# amount, allocated to that invoice (up to what it still owes; any rest stays unallocated on the payment), naming the
|
|
4
|
+
# line in payment.bank_transaction. The draft is submitted by a person (finance), which settles the invoice.
|
|
5
|
+
# A draft of this line that is still open (an earlier draft, or the amend of a cancelled one) is pointed at the
|
|
6
|
+
# invoice chosen last instead of drafting another. Extra drafts are harmless anyway: bank_transaction_claim lets only
|
|
7
|
+
# one live payment per line be submitted.
|
|
8
|
+
name: bank_transaction_confirm
|
|
9
|
+
label: {id: Mutasi dikonfirmasi jadi pembayaran}
|
|
10
|
+
on: bank_transaction.updated
|
|
11
|
+
if: event.status == 'confirmed' && event.payment == '' && event.suggested_invoice != ''
|
|
12
|
+
steps:
|
|
13
|
+
- {find: payment, where: "docstatus == 0 && bank_transaction == event.name", as: draft}
|
|
14
|
+
# a live payment already names the line (it is matched then, or a payment typed by hand carries the line in its
|
|
15
|
+
# reference): no new draft, so the same transfer is never drafted twice
|
|
16
|
+
- {find: payment, where: "docstatus == 1 && direction == 'receive' && (bank_transaction == event.name || reference == event.name)", as: paid}
|
|
17
|
+
- {find: sales_invoice, where: name == event.suggested_invoice, as: inv}
|
|
18
|
+
- {find: bank_transaction, where: name == event.name, as: line}
|
|
19
|
+
- update: draft
|
|
20
|
+
if: inv != null && draft != null
|
|
21
|
+
set:
|
|
22
|
+
customer: inv.customer
|
|
23
|
+
amount: event.amount
|
|
24
|
+
allocations: "[{'sales_invoice': inv.name, 'amount': min(event.amount, inv.outstanding)}]"
|
|
25
|
+
- create: payment
|
|
26
|
+
if: inv != null && draft == null && paid == null
|
|
27
|
+
set:
|
|
28
|
+
direction: "'receive'"
|
|
29
|
+
customer: inv.customer
|
|
30
|
+
payment_date: event.date
|
|
31
|
+
method: "'transfer'"
|
|
32
|
+
reference: event.name
|
|
33
|
+
bank_transaction: event.name
|
|
34
|
+
amount: event.amount
|
|
35
|
+
allocations: "[{'sales_invoice': inv.name, 'amount': min(event.amount, inv.outstanding)}]"
|
|
36
|
+
notes: "'Dari mutasi ' + event.name + ': ' + event.description"
|
|
37
|
+
as: pay
|
|
38
|
+
- update: line
|
|
39
|
+
if: inv != null && draft != null && draft.name != event.draft_payment
|
|
40
|
+
set: {draft_payment: draft.name}
|
|
41
|
+
- update: line
|
|
42
|
+
if: inv != null && draft == null && paid == null
|
|
43
|
+
set: {draft_payment: pay.name}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/flow.json
|
|
2
|
+
# payment.bank_transaction is set when the payment is made (the line's draft, or by hand) and never changed after:
|
|
3
|
+
# clearing it would let the draft be submitted without claiming the line, moving it would let it claim another line.
|
|
4
|
+
# A change is refused by creating an invalid claim, whose rule rolls the whole save back.
|
|
5
|
+
name: bank_transaction_link_locked
|
|
6
|
+
label: {id: Mutasi bank di pembayaran tidak bisa diubah}
|
|
7
|
+
on: payment.updated
|
|
8
|
+
if: event.before != null && event.before.bank_transaction != event.bank_transaction
|
|
9
|
+
steps:
|
|
10
|
+
- create: bank_transaction_claim
|
|
11
|
+
set: {bank_transaction: "''", payment: event.name, valid: 'false'}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/flow.json
|
|
2
|
+
# A payment that names a statement line (payment.bank_transaction) is submitted: the line is matched to it. By then
|
|
3
|
+
# bank_transaction_claim (same event, earlier in name order) has made sure no other live payment holds the line.
|
|
4
|
+
# reference is free text and never picks the line.
|
|
5
|
+
name: bank_transaction_matched
|
|
6
|
+
label: {id: Mutasi cocok saat pembayaran diajukan}
|
|
7
|
+
on: payment.submitted
|
|
8
|
+
if: event.direction == 'receive' && event.bank_transaction != ''
|
|
9
|
+
steps:
|
|
10
|
+
- {find: bank_transaction, where: name == event.bank_transaction, as: line}
|
|
11
|
+
- update: line
|
|
12
|
+
if: line != null
|
|
13
|
+
set: {status: "'matched'", payment: event.name, draft_payment: "''"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/flow.json
|
|
2
|
+
# A payment that held a statement line is cancelled: its claim gives the line back.
|
|
3
|
+
name: bank_transaction_release
|
|
4
|
+
label: {id: Lepas klaim mutasi saat pembayaran dibatalkan}
|
|
5
|
+
on: payment.cancelled
|
|
6
|
+
if: event.direction == 'receive' && event.bank_transaction != ''
|
|
7
|
+
steps:
|
|
8
|
+
- {find: bank_transaction_claim, where: bank_transaction == event.bank_transaction && payment == event.name, as: held}
|
|
9
|
+
- update: held
|
|
10
|
+
if: held != null
|
|
11
|
+
set: {bank_transaction: "''", released_line: event.bank_transaction}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/flow.json
|
|
2
|
+
# A new statement line with money in looks for the invoice it pays. First choice: an open invoice whose number is in
|
|
3
|
+
# the transfer note. Otherwise: exactly one open invoice whose remaining amount equals the line. Two candidates of
|
|
4
|
+
# the same amount -> no suggestion (the owner picks). It only suggests; the payment comes after the owner confirms.
|
|
5
|
+
# outstanding is already net of PPh 23, so a customer who withheld tax still matches.
|
|
6
|
+
name: bank_transaction_suggest
|
|
7
|
+
label: {id: Usulan cocok mutasi ke faktur}
|
|
8
|
+
on: bank_transaction.created
|
|
9
|
+
if: event.amount > 0 && event.status == 'unmatched'
|
|
10
|
+
steps:
|
|
11
|
+
- {find_all: sales_invoice, where: "docstatus == 1 && outstanding > 0 && event.description.contains(name)", as: by_number}
|
|
12
|
+
- {find_all: sales_invoice, where: "docstatus == 1 && outstanding == event.amount", as: by_amount}
|
|
13
|
+
- {find: bank_transaction, where: name == event.name, as: line}
|
|
14
|
+
- if: size(by_number) == 1
|
|
15
|
+
then:
|
|
16
|
+
- update: line
|
|
17
|
+
set: {suggested_invoice: "by_number[0].name", status: "'suggested'"}
|
|
18
|
+
else:
|
|
19
|
+
- update: line
|
|
20
|
+
if: size(by_amount) == 1
|
|
21
|
+
set: {suggested_invoice: "by_amount[0].name", status: "'suggested'"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/flow.json
|
|
2
|
+
# The payment of a matched line is cancelled: the line goes back to unmatched and can be matched again (by the amend
|
|
3
|
+
# of that payment, which keeps bank_transaction, or by a new confirmation; only one of them can be submitted).
|
|
4
|
+
name: bank_transaction_unmatched
|
|
5
|
+
label: {id: Mutasi kembali belum cocok saat pembayaran dibatalkan}
|
|
6
|
+
on: payment.cancelled
|
|
7
|
+
steps:
|
|
8
|
+
- {find: bank_transaction, where: payment == event.name && status == 'matched', as: line}
|
|
9
|
+
- update: line
|
|
10
|
+
if: line != null
|
|
11
|
+
set: {status: "'unmatched'", payment: "''"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/import.json
|
|
2
|
+
# Bank statement in a fixed layout: Tanggal (dd/mm/yyyy), Urutan, Keterangan, Masuk, Keluar, Saldo, Rekening.
|
|
3
|
+
# Bank exports differ by bank and channel (KlikBCA, Livin, BRImo), so each gets its own import once a real export
|
|
4
|
+
# is in hand; until then the owner pastes the bank's rows into this layout (template in the module docs).
|
|
5
|
+
# Same file twice -> duplicate (file hash). Overlapping exports -> only rows whose key is new. Urutan (the number of
|
|
6
|
+
# the line within its day in the bank's export: 1, 2, 3, ...) is in the key, so two equal transfers on one day
|
|
7
|
+
# differ whether or not the export has a running balance. Saldo is in the key too when it is filled: it tells lines
|
|
8
|
+
# apart even if a pasted part of a day is numbered from 1 again, so a column more in the key can only add a line
|
|
9
|
+
# (visible, can be ignored), never drop one. Without Saldo, Urutan must be the line's place in the whole day.
|
|
10
|
+
# A file without Urutan is refused (missing column), never deduplicated by content alone.
|
|
11
|
+
name: bank_statement_csv
|
|
12
|
+
label: {id: Mutasi rekening (CSV), en: Bank statement (CSV)}
|
|
13
|
+
model: bank_transaction
|
|
14
|
+
source: csv
|
|
15
|
+
header_row: 1
|
|
16
|
+
per: org
|
|
17
|
+
key: [Rekening, Tanggal, Urutan, Keterangan, Masuk, Keluar, Saldo]
|
|
18
|
+
map:
|
|
19
|
+
account: Rekening
|
|
20
|
+
date: Tanggal
|
|
21
|
+
seq: Urutan
|
|
22
|
+
description: Keterangan
|
|
23
|
+
credit: Masuk
|
|
24
|
+
debit: Keluar
|
|
25
|
+
balance: Saldo
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/model.json
|
|
2
|
+
# One line of the bank statement. Money in is positive, money out negative. Status:
|
|
3
|
+
# unmatched -> suggested (flow bank_transaction_suggest found exactly one invoice) -> confirmed (the owner agrees,
|
|
4
|
+
# flow bank_transaction_confirm drafts the payment into draft_payment) -> matched (that very draft is submitted;
|
|
5
|
+
# flow bank_transaction_matched sets payment). ignored = not a sale.
|
|
6
|
+
# payment is only ever a submitted payment and only flows write it, so "Cocok" cannot be set by hand. The payment
|
|
7
|
+
# names the line in payment.bank_transaction, and bank_transaction_claim allows one live payment per line, whatever
|
|
8
|
+
# path made it. draft_payment points at the line's open draft, which confirming again reuses; a deleted draft is
|
|
9
|
+
# drafted again by saving the line as "Dikonfirmasi". Cancelling the payment sends the line back to unmatched.
|
|
10
|
+
name: bank_transaction
|
|
11
|
+
label: {id: Mutasi bank, en: Bank transaction}
|
|
12
|
+
icon: bank
|
|
13
|
+
naming: MUT-{YYYY}-{#####}
|
|
14
|
+
title_field: description
|
|
15
|
+
permissions:
|
|
16
|
+
- {role: finance_manager, read: true, create: true, write: true, export: true, import: true}
|
|
17
|
+
# a line that is paid (payment set) is never deleted: its payment and claim would point at nothing
|
|
18
|
+
- {role: finance_manager, delete: true, if: payment == ''}
|
|
19
|
+
- {role: sales_manager, read: true, create: true, write: true, export: true, import: true}
|
|
20
|
+
- {role: head_office, read: true, create: true, write: true, export: true, import: true}
|
|
21
|
+
fields:
|
|
22
|
+
- name: account
|
|
23
|
+
type: data
|
|
24
|
+
label: {id: Rekening}
|
|
25
|
+
in_list: true
|
|
26
|
+
- name: date
|
|
27
|
+
type: date
|
|
28
|
+
label: {id: Tanggal}
|
|
29
|
+
required: true
|
|
30
|
+
in_list: true
|
|
31
|
+
- name: seq
|
|
32
|
+
type: int
|
|
33
|
+
label: {id: Urutan}
|
|
34
|
+
help: {id: 'Nomor baris transaksi di hari itu sesuai mutasi bank (1, 2, 3, ...). Membedakan dua transfer yang sama di hari yang sama.'}
|
|
35
|
+
required: true
|
|
36
|
+
- name: description
|
|
37
|
+
type: data
|
|
38
|
+
label: {id: Keterangan}
|
|
39
|
+
required: true
|
|
40
|
+
in_list: true
|
|
41
|
+
- name: credit
|
|
42
|
+
type: currency
|
|
43
|
+
label: {id: Masuk}
|
|
44
|
+
default: '0'
|
|
45
|
+
- name: debit
|
|
46
|
+
type: currency
|
|
47
|
+
label: {id: Keluar}
|
|
48
|
+
default: '0'
|
|
49
|
+
- name: amount
|
|
50
|
+
type: currency
|
|
51
|
+
label: {id: Jumlah}
|
|
52
|
+
compute: credit - debit
|
|
53
|
+
in_list: true
|
|
54
|
+
- name: balance
|
|
55
|
+
type: currency
|
|
56
|
+
label: {id: Saldo}
|
|
57
|
+
help: {id: 'Salin dari mutasi bank kalau ada. Kalau kosong, Urutan harus nomor baris di seluruh hari itu, bukan nomor di potongan yang ditempel.'}
|
|
58
|
+
- name: status
|
|
59
|
+
type: select
|
|
60
|
+
label: {id: Status cocok}
|
|
61
|
+
default: "'unmatched'"
|
|
62
|
+
required: true
|
|
63
|
+
chip: true
|
|
64
|
+
in_list: true
|
|
65
|
+
in_filter: true
|
|
66
|
+
options:
|
|
67
|
+
- {value: unmatched, label: {id: Belum cocok}}
|
|
68
|
+
- {value: suggested, label: {id: Ada usulan}}
|
|
69
|
+
- {value: confirmed, label: {id: Dikonfirmasi}}
|
|
70
|
+
- {value: matched, label: {id: Cocok, en: Matched}}
|
|
71
|
+
- {value: ignored, label: {id: Abaikan}}
|
|
72
|
+
- name: suggested_invoice
|
|
73
|
+
type: link
|
|
74
|
+
to: sales_invoice
|
|
75
|
+
label: {id: Faktur}
|
|
76
|
+
help: {id: 'Diisi otomatis kalau tepat satu faktur cocok; boleh diganti sebelum konfirmasi.'}
|
|
77
|
+
peek: [customer, outstanding, due_date]
|
|
78
|
+
in_list: true
|
|
79
|
+
# data, not link: the draft may be deleted (and is renamed on submit); a link to a missing record would make the
|
|
80
|
+
# line unsavable.
|
|
81
|
+
- name: draft_payment
|
|
82
|
+
type: data
|
|
83
|
+
label: {id: Draf pembayaran}
|
|
84
|
+
read_only: true
|
|
85
|
+
- name: payment
|
|
86
|
+
type: link
|
|
87
|
+
to: payment
|
|
88
|
+
label: {id: Pembayaran}
|
|
89
|
+
read_only: true
|
|
90
|
+
rules:
|
|
91
|
+
- name: one_side_only
|
|
92
|
+
on: save
|
|
93
|
+
check: credit >= 0 && debit >= 0 && (credit == 0 || debit == 0)
|
|
94
|
+
message: {id: 'Isi Masuk atau Keluar saja, tidak boleh negatif'}
|
|
95
|
+
- name: confirm_needs_invoice
|
|
96
|
+
on: save
|
|
97
|
+
check: status != 'confirmed' || suggested_invoice != ''
|
|
98
|
+
message: {id: Pilih faktur sebelum konfirmasi}
|
|
99
|
+
- name: confirm_only_money_in
|
|
100
|
+
on: save
|
|
101
|
+
check: status != 'confirmed' || amount > 0
|
|
102
|
+
message: {id: Hanya uang masuk yang bisa dicocokkan ke faktur penjualan}
|
|
103
|
+
- name: matched_needs_payment
|
|
104
|
+
on: save
|
|
105
|
+
check: (status == 'matched') == (payment != '')
|
|
106
|
+
message: {id: Status Cocok diisi otomatis saat pembayarannya diajukan dan hanya lepas saat pembayaran itu dibatalkan}
|
|
107
|
+
- name: seq_positive
|
|
108
|
+
on: save
|
|
109
|
+
check: seq > 0
|
|
110
|
+
message: {id: Urutan mulai dari 1}
|
|
111
|
+
views:
|
|
112
|
+
list:
|
|
113
|
+
columns: [date, description, amount, status, suggested_invoice, payment]
|
|
114
|
+
sort: -date
|
|
115
|
+
form:
|
|
116
|
+
layout:
|
|
117
|
+
- section: {id: Mutasi}
|
|
118
|
+
columns:
|
|
119
|
+
- [date, seq, account, description]
|
|
120
|
+
- [credit, debit, amount, balance]
|
|
121
|
+
- section: {id: Pencocokan}
|
|
122
|
+
columns:
|
|
123
|
+
- [status, suggested_invoice]
|
|
124
|
+
- [draft_payment, payment]
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/model.json
|
|
2
|
+
# The invariant of the money rail: one statement line is paid by at most one live (submitted) payment. A payment
|
|
3
|
+
# names its line in payment.bank_transaction (set when the line is confirmed; amend copies it). When such a payment
|
|
4
|
+
# is submitted, flow bank_transaction_claim creates the claim for the line in the same transaction, and the unique
|
|
5
|
+
# index on bank_transaction refuses the submit (422) when another live payment holds the line, whatever path made the
|
|
6
|
+
# payment (a new draft, an amend, an old draft left behind, two submits at once). Cancelling the payment releases the
|
|
7
|
+
# claim (bank_transaction emptied, the name kept in released_line). Only flows write it.
|
|
8
|
+
# A claim is also only valid for the line's own payment: the draft the line made (line.draft_payment) or the amend of
|
|
9
|
+
# a payment of that line, for the line's amount. The flows set `valid` and the rule refuses the save otherwise; the
|
|
10
|
+
# same rule refuses a change of payment.bank_transaction (flow bank_transaction_link_locked).
|
|
11
|
+
name: bank_transaction_claim
|
|
12
|
+
label: {id: Klaim mutasi bank, en: Bank transaction claim}
|
|
13
|
+
icon: bank
|
|
14
|
+
naming: MTC-{YYYY}-{#####}
|
|
15
|
+
title_field: bank_transaction
|
|
16
|
+
permissions:
|
|
17
|
+
- {role: finance_manager, read: true, create: true, write: true, export: true}
|
|
18
|
+
- {role: sales_manager, read: true, create: true, write: true, export: true}
|
|
19
|
+
- {role: head_office, read: true, create: true, write: true}
|
|
20
|
+
fields:
|
|
21
|
+
- name: bank_transaction
|
|
22
|
+
type: data
|
|
23
|
+
label: {id: Mutasi bank yang sudah dibayar}
|
|
24
|
+
unique: true
|
|
25
|
+
read_only: true
|
|
26
|
+
in_list: true
|
|
27
|
+
- name: payment
|
|
28
|
+
type: data
|
|
29
|
+
label: {id: Pembayaran}
|
|
30
|
+
read_only: true
|
|
31
|
+
in_list: true
|
|
32
|
+
- name: released_line
|
|
33
|
+
type: data
|
|
34
|
+
label: {id: Mutasi yang dilepas}
|
|
35
|
+
read_only: true
|
|
36
|
+
in_list: true
|
|
37
|
+
- name: valid
|
|
38
|
+
type: check
|
|
39
|
+
label: {id: Sah}
|
|
40
|
+
default: 'true'
|
|
41
|
+
read_only: true
|
|
42
|
+
rules:
|
|
43
|
+
- name: own_payment_only
|
|
44
|
+
on: save
|
|
45
|
+
check: valid
|
|
46
|
+
message: {id: 'Mutasi bank hanya bisa dibayar oleh draf dari mutasi itu (atau amend-nya) sebesar nilai mutasi, dan tidak bisa diubah'}
|
|
47
|
+
views:
|
|
48
|
+
list:
|
|
49
|
+
columns: [bank_transaction, payment, released_line]
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/module.json
|
|
2
|
+
# Bank statement lines (mutasi rekening) imported from the bank's export, matched to sales invoices and turned into
|
|
3
|
+
# payments. A payment stays the only thing that settles an invoice: a statement line never pays one by itself.
|
|
4
|
+
name: bank_statement
|
|
5
|
+
version: 1.0.0
|
|
6
|
+
title: {id: Mutasi bank, en: Bank statement}
|
|
7
|
+
requires: {rangka: '>=0.5', users: ^1.0, contacts: ^1.0, invoicing: ^1.0, payments: ^1.0}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/import.json
|
|
2
|
+
# The opening item list of a new installation: one row per item, the same file for F&B materials and products and for
|
|
3
|
+
# services. SKU is required (it is the duplicate key and what the sales imports match on). Jenis is read without regard
|
|
4
|
+
# to case (Bahan baku, Produk jadi, Jasa; anything else is Barang). Units are matched by name (Kg, Liter, Pcs,
|
|
5
|
+
# Orang-hari...), so the units must exist first. Imports only create: a SKU already imported is skipped, prices are
|
|
6
|
+
# changed on the item itself.
|
|
7
|
+
name: item_list
|
|
8
|
+
label: {id: Daftar barang & harga, en: Item list}
|
|
9
|
+
model: item
|
|
10
|
+
source: csv
|
|
11
|
+
header_row: 1
|
|
12
|
+
key: [SKU]
|
|
13
|
+
map:
|
|
14
|
+
item_name: Nama barang
|
|
15
|
+
sku: SKU
|
|
16
|
+
kind: "=row['Jenis'].lowerAscii().trim() == 'bahan baku' ? 'material' : row['Jenis'].lowerAscii().trim() == 'produk jadi' ? 'product' : row['Jenis'].lowerAscii().trim() == 'jasa' ? 'service' : 'good'"
|
|
17
|
+
stock_uom: {value: Satuan, match: uom_name}
|
|
18
|
+
sales_uom: {value: Satuan, match: uom_name}
|
|
19
|
+
rate: Harga jual
|
|
20
|
+
standard_cost: Harga pokok
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/import.json
|
|
2
|
+
# Juragan's item list template (one row per item or variant), the way a shop moves its POS item list or its Excel in.
|
|
3
|
+
# Headers: SKU, Barcode, Nama barang, Kategori, Grup varian, Varian, Satuan, Harga jual, Harga pokok, Penitip, Harga
|
|
4
|
+
# setor. Satuan, Kategori and Penitip (a vendor) must already exist, by name; empty cells leave the field empty. Imports only create: an SKU already imported is skipped (key), so an updated
|
|
5
|
+
# list adds the new items and leaves the old ones as they are. Columns are matched by name, so the order is free.
|
|
6
|
+
# Not checked against a real POS item export yet: Moka, Loyverse and majoo each name these columns differently.
|
|
7
|
+
name: item_master
|
|
8
|
+
label: {id: Daftar barang, en: Item list}
|
|
9
|
+
model: item
|
|
10
|
+
source: csv
|
|
11
|
+
header_row: 1
|
|
12
|
+
key: [SKU]
|
|
13
|
+
map:
|
|
14
|
+
sku: SKU
|
|
15
|
+
barcode: Barcode
|
|
16
|
+
item_name: Nama barang
|
|
17
|
+
kind: "='good'"
|
|
18
|
+
category: {value: Kategori, match: category_name}
|
|
19
|
+
variant_group: Grup varian
|
|
20
|
+
variant_label: Varian
|
|
21
|
+
stock_uom: {value: Satuan, match: uom_name}
|
|
22
|
+
rate: Harga jual
|
|
23
|
+
standard_cost: Harga pokok
|
|
24
|
+
consignor: {value: Penitip, match: vendor_name}
|
|
25
|
+
consignment_cost: Harga setor
|
|
@@ -9,9 +9,10 @@ permissions:
|
|
|
9
9
|
- {role: finance_manager, read: true, create: true, write: true, print: true}
|
|
10
10
|
- {role: purchasing_manager, read: true, create: true, write: true, print: true}
|
|
11
11
|
- {role: project_admin, read: true, create: true, write: true, print: true}
|
|
12
|
-
- {role: head_office, read: true, create: true, write: true, print: true}
|
|
12
|
+
- {role: head_office, read: true, create: true, write: true, import: true, print: true}
|
|
13
13
|
- {role: outlet_staff, read: true}
|
|
14
14
|
- {role: sales_rep, read: true}
|
|
15
|
+
- {role: field_sales, read: true}
|
|
15
16
|
fields:
|
|
16
17
|
- name: item_name
|
|
17
18
|
type: data
|
|
@@ -23,6 +24,26 @@ fields:
|
|
|
23
24
|
label: {id: SKU}
|
|
24
25
|
in_list: true
|
|
25
26
|
unique: true
|
|
27
|
+
# A shop scans or types the barcode (EAN-13 / PLU) printed on the pack; a POS export usually carries it as the SKU.
|
|
28
|
+
- name: barcode
|
|
29
|
+
type: data
|
|
30
|
+
label: {id: Barcode}
|
|
31
|
+
unique: true
|
|
32
|
+
- name: category
|
|
33
|
+
type: link
|
|
34
|
+
to: item_category
|
|
35
|
+
label: {id: Kategori}
|
|
36
|
+
in_list: true
|
|
37
|
+
# Variants are separate items (every Indonesian POS exports a variant as its own SKU). Items of one product share
|
|
38
|
+
# variant_group (e.g. KAOS-POLOS) and differ in variant_label (e.g. "M / Hitam"); no size x colour generator.
|
|
39
|
+
- name: variant_group
|
|
40
|
+
type: data
|
|
41
|
+
label: {id: Grup varian}
|
|
42
|
+
help: {id: 'Kode yang sama untuk semua varian satu produk, misalnya KAOS-POLOS'}
|
|
43
|
+
- name: variant_label
|
|
44
|
+
type: data
|
|
45
|
+
label: {id: Varian}
|
|
46
|
+
help: {id: 'Misalnya "M / Hitam" atau "600 ml"'}
|
|
26
47
|
- name: kind
|
|
27
48
|
type: select
|
|
28
49
|
label: {id: Jenis}
|
|
@@ -48,6 +69,27 @@ fields:
|
|
|
48
69
|
type: currency
|
|
49
70
|
label: {id: Harga jual}
|
|
50
71
|
in_list: true
|
|
72
|
+
# Tier prices of a distributor (module distribution): a customer's price_tier picks rate, rate_wholesale or
|
|
73
|
+
# rate_agent on its orders. Empty (0) falls back to rate.
|
|
74
|
+
- name: rate_wholesale
|
|
75
|
+
type: currency
|
|
76
|
+
label: {id: Harga grosir}
|
|
77
|
+
depends_on: app_installed('distribution')
|
|
78
|
+
- name: rate_agent
|
|
79
|
+
type: currency
|
|
80
|
+
label: {id: Harga agen}
|
|
81
|
+
depends_on: app_installed('distribution')
|
|
82
|
+
# Production (module production): the BOM this item is made with (also how a semi-finished line costs in a
|
|
83
|
+
# multi-level BOM) and its shelf life, which sets the expiry date of a batch.
|
|
84
|
+
- name: default_bom
|
|
85
|
+
type: link
|
|
86
|
+
to: bom
|
|
87
|
+
label: {id: Resep produksi}
|
|
88
|
+
depends_on: app_installed('production')
|
|
89
|
+
- name: shelf_life_days
|
|
90
|
+
type: int
|
|
91
|
+
label: {id: Umur simpan (hari)}
|
|
92
|
+
depends_on: app_installed('production')
|
|
51
93
|
- name: standard_cost
|
|
52
94
|
type: currency
|
|
53
95
|
label: {id: Harga pokok standar}
|
|
@@ -55,6 +97,19 @@ fields:
|
|
|
55
97
|
type: float
|
|
56
98
|
label: {id: Stok}
|
|
57
99
|
in_list: true
|
|
100
|
+
# Consignment in (barang titipan): the consignor still owns the goods; the shop pays consignment_cost per unit sold
|
|
101
|
+
# in the monthly settlement (module consignment). Empty consignor = the shop's own goods.
|
|
102
|
+
- name: consignor
|
|
103
|
+
type: link
|
|
104
|
+
to: vendor
|
|
105
|
+
label: {id: Penitip}
|
|
106
|
+
help: {id: 'Isi kalau barang ini titipan. Kosongkan untuk barang milik sendiri'}
|
|
107
|
+
depends_on: app_installed('consignment')
|
|
108
|
+
- name: consignment_cost
|
|
109
|
+
type: currency
|
|
110
|
+
label: {id: Harga setor titipan}
|
|
111
|
+
help: {id: 'Yang dibayar ke penitip per barang terjual'}
|
|
112
|
+
depends_on: app_installed('consignment') && consignor != ''
|
|
58
113
|
- name: notes
|
|
59
114
|
type: text
|
|
60
115
|
label: {id: Catatan}
|