@rangka-os/create 0.5.0-alpha.4 → 0.5.0-alpha.6
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/crm/processes/lead_to_cash.rk +8 -0
- package/template/base/apps/fnb_cabang/dashboards/stock_recap.rk +6 -4
- 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 +10 -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 +34 -1
- package/template/base/modules/catalogue/models/item_category.rk +26 -0
- 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/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 +93 -3
- package/template/base/modules/invoicing/models/sales_invoice_item.rk +9 -0
- package/template/base/modules/invoicing/module.rk +1 -1
- 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/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 +17 -0
- 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 +26 -1
- package/template/base/modules/payments/models/withholding.rk +3 -1
- package/template/base/modules/payments/module.rk +1 -1
- 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/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 +6 -1
- package/template/base/modules/workforce/imports/worker_list.rk +16 -0
- package/template/base/modules/workforce/models/certification.rk +1 -2
- package/template/base/modules/workforce/models/worker.rk +22 -1
- package/template/demo/fixtures/demo.rk +2 -2
|
@@ -11,6 +11,8 @@ permissions:
|
|
|
11
11
|
- {role: finance_manager, read: true, create: true, write: true, delete: true, submit: true, cancel: true, amend: true, export: true, print: true}
|
|
12
12
|
- {role: sales_manager, read: true, create: true, write: true, delete: true, submit: true, cancel: true, amend: true, export: true, print: true}
|
|
13
13
|
- {role: sales_rep, read: true}
|
|
14
|
+
# project admins read invoices: the project flows that freeze contract terms read them as the project admin
|
|
15
|
+
- {role: project_admin, read: true}
|
|
14
16
|
fields:
|
|
15
17
|
- name: kind
|
|
16
18
|
type: select
|
|
@@ -29,6 +31,7 @@ fields:
|
|
|
29
31
|
required: true
|
|
30
32
|
in_list: true
|
|
31
33
|
peek: [outstanding, payment_days, npwp]
|
|
34
|
+
default: billing_milestone.customer
|
|
32
35
|
- name: customer_order
|
|
33
36
|
type: link
|
|
34
37
|
to: customer_order
|
|
@@ -37,10 +40,27 @@ fields:
|
|
|
37
40
|
type: link
|
|
38
41
|
to: project
|
|
39
42
|
label: {id: Proyek}
|
|
43
|
+
default: billing_milestone.project
|
|
44
|
+
# The billing milestone this invoice bills (projects module); flows mark it invoiced on submit, ready on cancel.
|
|
45
|
+
# milestone_claim (unique) = milestone:<its bill_token> from the invoice's first save: one invoice per milestone, draft
|
|
46
|
+
# or submitted, and the database refuses a second one even when both are made at the same moment (an amendment
|
|
47
|
+
# re-pointed at the milestone included). A cancelled invoice keeps its claim (the kernel does not recompute on
|
|
48
|
+
# cancel); the cancel flow sets the milestone's bill_token to that invoice, so the next invoice claims a new key.
|
|
49
|
+
- name: billing_milestone
|
|
50
|
+
type: link
|
|
51
|
+
to: billing_milestone
|
|
52
|
+
label: {id: Termin tagihan}
|
|
53
|
+
- name: milestone_claim
|
|
54
|
+
type: data
|
|
55
|
+
label: {id: Faktur untuk termin ini}
|
|
56
|
+
hidden: true
|
|
57
|
+
unique: true
|
|
58
|
+
compute: "billing_milestone == '' ? '' : billing_milestone + ':' + billing_milestone.bill_token"
|
|
40
59
|
- name: acceptance
|
|
41
60
|
type: link
|
|
42
61
|
to: acceptance
|
|
43
62
|
label: {id: Berita acara}
|
|
63
|
+
default: billing_milestone.acceptance
|
|
44
64
|
- name: po_number
|
|
45
65
|
type: data
|
|
46
66
|
label: {id: No. PO pelanggan}
|
|
@@ -127,10 +147,39 @@ fields:
|
|
|
127
147
|
type: percent
|
|
128
148
|
label: {id: Tarif PPh 23}
|
|
129
149
|
default: '2'
|
|
150
|
+
# The PPh 23 base: (subtotal - header discount) x the share of lines not marked pph23_exclude, minus the base already
|
|
151
|
+
# taken on the down-payment invoice this one deducts (that invoice's line base in proportion to down_payment). Equal
|
|
152
|
+
# to dpp when no line is excluded and the DP invoice had none either. Foreign-currency documents take the share from
|
|
153
|
+
# the lines' rupiah twins (amount_fx_idr). "* 1.0" keeps the products in float, clear of int64 overflow. Foreign
|
|
154
|
+
# amounts (money) are Decimal, capped by the kernel at 16 whole digits (an overflow is stored as 0), so a product of a
|
|
155
|
+
# money field and a rupiah amount is never formed: the share is taken from the twins, and pph23_amount_fx multiplies
|
|
156
|
+
# dpp_fx by a ratio below 1.
|
|
157
|
+
- name: pph23_lines_base
|
|
158
|
+
type: currency
|
|
159
|
+
label: {id: Dasar PPh 23 baris}
|
|
160
|
+
hidden: true
|
|
161
|
+
compute: "currency != '' && currency != 'IDR' ? (items.map(i, i.amount_fx_idr).sum() == 0 ? 0 : round((subtotal - discount_amount) * 1.0 * items.map(i, i.pph23_exclude ? 0 : i.amount_fx_idr).sum() / items.map(i, i.amount_fx_idr).sum())) : (subtotal == 0 ? 0 : round((subtotal - discount_amount) * 1.0 * items.map(i, i.pph23_exclude ? 0 : i.amount).sum() / subtotal))"
|
|
162
|
+
- name: pph23_dp_base
|
|
163
|
+
type: currency
|
|
164
|
+
label: {id: Dasar PPh 23 di faktur uang muka}
|
|
165
|
+
hidden: true
|
|
166
|
+
# Recomputed from the DP invoice's own lines with the formula of pph23_lines_base (never its stored pph23_dpp), so a
|
|
167
|
+
# DP invoiced before pph23_dpp existed, in rupiah or in a foreign currency, is deducted like a new one: its lines
|
|
168
|
+
# have no pph23_exclude, so the whole DP is base, as before the upgrade. A foreign DP takes the share from its twins.
|
|
169
|
+
compute: >-
|
|
170
|
+
dp_invoice == '' || dp_invoice.dpp == 0 ? 0 :
|
|
171
|
+
round((dp_invoice.currency != '' && dp_invoice.currency != 'IDR'
|
|
172
|
+
? (dp_invoice.items.map(i, i.amount_fx_idr).sum() == 0 ? 0 : (dp_invoice.subtotal - dp_invoice.discount_amount) * 1.0 * dp_invoice.items.map(i, i.pph23_exclude ? 0 : i.amount_fx_idr).sum() / dp_invoice.items.map(i, i.amount_fx_idr).sum())
|
|
173
|
+
: (dp_invoice.subtotal == 0 ? 0 : (dp_invoice.subtotal - dp_invoice.discount_amount) * 1.0 * dp_invoice.items.map(i, i.pph23_exclude ? 0 : i.amount).sum() / dp_invoice.subtotal))
|
|
174
|
+
* down_payment / dp_invoice.dpp)
|
|
175
|
+
- name: pph23_dpp
|
|
176
|
+
type: currency
|
|
177
|
+
label: {id: Dasar PPh 23}
|
|
178
|
+
compute: "pph23_lines_base > pph23_dp_base ? pph23_lines_base - pph23_dp_base : 0"
|
|
130
179
|
- name: pph23_amount
|
|
131
180
|
type: currency
|
|
132
181
|
label: {id: PPh 23 dipotong pelanggan}
|
|
133
|
-
compute: "pph23_applies ? round(
|
|
182
|
+
compute: "pph23_applies ? round(pph23_dpp * pph23_rate / 100) : 0"
|
|
134
183
|
- name: amount_due
|
|
135
184
|
type: currency
|
|
136
185
|
label: {id: Tagihan bersih}
|
|
@@ -157,7 +206,7 @@ fields:
|
|
|
157
206
|
- {name: ppn_fx, type: money, currency_field: currency, rate_field: exchange_rate, label: {id: PPN (valas)}, compute: "round(dpp_fx * dpp_num / dpp_den * tax_rate / 100, 2)"}
|
|
158
207
|
- {name: grand_total_fx, type: money, currency_field: currency, rate_field: exchange_rate, label: {id: Total (valas)}, compute: "dpp_fx + ppn_fx"}
|
|
159
208
|
- {name: retention_amount_fx, type: money, currency_field: currency, rate_field: exchange_rate, label: {id: Retensi ditahan (valas)}, compute: "round(dpp_fx * retention_percent / 100, 2)"}
|
|
160
|
-
- {name: pph23_amount_fx, type: money, currency_field: currency, rate_field: exchange_rate, label: {id: PPh 23 dipotong (valas)}, compute: "pph23_applies ? round(dpp_fx * pph23_rate / 100, 2) : 0"}
|
|
209
|
+
- {name: pph23_amount_fx, type: money, currency_field: currency, rate_field: exchange_rate, label: {id: PPh 23 dipotong (valas)}, compute: "pph23_applies && dpp != 0 ? round(dpp_fx * (pph23_dpp * 1.0 / dpp * pph23_rate / 100), 2) : 0"}
|
|
161
210
|
- {name: amount_due_fx, type: money, currency_field: currency, rate_field: exchange_rate, label: {id: Tagihan bersih (valas)}, compute: "grand_total_fx - retention_amount_fx - pph23_amount_fx"}
|
|
162
211
|
rules:
|
|
163
212
|
- name: qty_positive
|
|
@@ -193,6 +242,47 @@ rules:
|
|
|
193
242
|
on: save
|
|
194
243
|
check: project == '' || project.customer == customer
|
|
195
244
|
message: {id: Proyek harus milik pelanggan yang sama}
|
|
245
|
+
- name: milestone_same_project
|
|
246
|
+
on: save
|
|
247
|
+
check: billing_milestone == '' || billing_milestone.project == project
|
|
248
|
+
message: {id: Termin harus milik proyek yang sama}
|
|
249
|
+
- name: milestone_same_customer
|
|
250
|
+
on: save
|
|
251
|
+
check: billing_milestone == '' || billing_milestone.customer == customer
|
|
252
|
+
message: {id: Termin harus milik pelanggan yang sama}
|
|
253
|
+
- name: milestone_amount_cap
|
|
254
|
+
on: save
|
|
255
|
+
check: billing_milestone == '' || dpp <= billing_milestone.amount
|
|
256
|
+
message: {id: DPP faktur tidak boleh melebihi nilai termin}
|
|
257
|
+
- name: retainer_invoice_via_milestone
|
|
258
|
+
on: save
|
|
259
|
+
check: project == '' || project.billing_model != 'retainer' || billing_milestone != '' || kind == 'retention'
|
|
260
|
+
message: {id: 'Faktur proyek retainer dibuat dari termin bulanannya (satu termin, satu faktur per bulan)'}
|
|
261
|
+
- name: retainer_invoice_monthly
|
|
262
|
+
on: save
|
|
263
|
+
check: project == '' || project.billing_model != 'retainer' || billing_milestone == '' || billing_milestone.kind == 'retainer'
|
|
264
|
+
message: {id: 'Faktur proyek retainer hanya dari termin jenis Retainer (satu per bulan)'}
|
|
265
|
+
- name: retention_same_project
|
|
266
|
+
on: save
|
|
267
|
+
check: retention_of == '' || retention_of.project == project
|
|
268
|
+
message: {id: Faktur retensi harus untuk proyek yang sama dengan faktur asalnya}
|
|
269
|
+
- name: retainer_invoice_within_fee
|
|
270
|
+
on: save
|
|
271
|
+
check: project == '' || project.billing_model != 'retainer' || project.contract_value == 0 || dpp <= project.contract_value
|
|
272
|
+
message: {id: Faktur retainer tidak boleh melebihi fee bulanan (nilai kontrak)}
|
|
273
|
+
- name: milestone_ready_to_bill
|
|
274
|
+
on: save
|
|
275
|
+
check: billing_milestone == '' || billing_milestone.trigger != 'acceptance' || billing_milestone.state == 'ready' || (billing_milestone.sales_invoice != '' && billing_milestone.sales_invoice == name)
|
|
276
|
+
message: {id: Termin ini belum siap ditagih (berita acaranya belum ada atau sudah dibatalkan)}
|
|
277
|
+
- name: milestone_not_invoiced
|
|
278
|
+
on: save
|
|
279
|
+
check: billing_milestone == '' || billing_milestone.state != 'invoiced' || billing_milestone.sales_invoice == name
|
|
280
|
+
message: {id: Termin ini sudah ditagih di faktur lain}
|
|
281
|
+
- name: dp_base_above_lines
|
|
282
|
+
on: save
|
|
283
|
+
level: warn
|
|
284
|
+
check: "!pph23_applies || pph23_dp_base <= pph23_lines_base"
|
|
285
|
+
message: {id: 'Dasar PPh 23 di faktur uang muka lebih besar dari dasar baris faktur ini; pisahkan baris gaji di faktur DP juga'}
|
|
196
286
|
- name: acceptance_same_customer
|
|
197
287
|
on: save
|
|
198
288
|
check: acceptance == '' || acceptance.project.customer == customer
|
|
@@ -270,7 +360,7 @@ views:
|
|
|
270
360
|
layout:
|
|
271
361
|
- section: {id: Pelanggan}
|
|
272
362
|
columns:
|
|
273
|
-
- [kind, customer, po_number, customer_order, project]
|
|
363
|
+
- [kind, customer, po_number, customer_order, project, billing_milestone]
|
|
274
364
|
- [posting_date, due_date, outlet, acceptance]
|
|
275
365
|
- section: {id: Barang/jasa}
|
|
276
366
|
fields: [items]
|
|
@@ -32,6 +32,15 @@ fields:
|
|
|
32
32
|
type: currency
|
|
33
33
|
label: {id: Jumlah}
|
|
34
34
|
compute: round(qty * rate * (1 - discount / 100))
|
|
35
|
+
# PPh 23 is withheld on the fee for a service, not on what the firm passes through: the workers' wages billed on their
|
|
36
|
+
# own line (jasa tenaga kerja, PMK 141/2015) or a reimbursed cost. Ticked lines stay out of the invoice's PPh 23 base.
|
|
37
|
+
# The flag says "excluded" so that a line written before the field existed (NULL after migrate, read as false) keeps
|
|
38
|
+
# the old behaviour: part of the base.
|
|
39
|
+
- name: pph23_exclude
|
|
40
|
+
type: check
|
|
41
|
+
label: {id: Bukan dasar PPh 23}
|
|
42
|
+
help: {id: 'Centang untuk baris gaji tenaga kerja yang dirinci terpisah atau penggantian biaya'}
|
|
43
|
+
default: 'false'
|
|
35
44
|
|
|
36
45
|
- {name: rate_fx, type: money, currency_field: currency, rate_field: exchange_rate, label: {id: Harga (valas)}, default: '0'}
|
|
37
46
|
- {name: amount_fx, type: money, currency_field: currency, rate_field: exchange_rate, label: {id: Jumlah (valas)}, compute: "round(qty * rate_fx * (1 - discount / 100), 2)"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/module.json
|
|
2
2
|
name: invoicing
|
|
3
|
-
version: 1.
|
|
3
|
+
version: 1.2.0
|
|
4
4
|
title: {id: Faktur, en: Invoicing}
|
|
5
5
|
requires: {rangka: '>=0.5', users: ^1.0, contacts: ^1.0, catalogue: ^1.0}
|
|
6
6
|
optional: {outlets: ^1.0, tax_id: ^1.0, currency: ^1.0, orders: ^1.0, projects: ^1.0}
|
|
@@ -52,12 +52,13 @@
|
|
|
52
52
|
{{if taxrate .Doc .Tax}}<tr><td>PPN {{number (taxrate .Doc .Tax)}}% (DPP nilai lain {{.Doc.dpp_num}}/{{.Doc.dpp_den}})</td><td class="num">{{rupiah .Doc.ppn}}</td></tr>{{end}}
|
|
53
53
|
<tr class="grand"><td>Total</td><td class="num">{{rupiah .Doc.grand_total}}</td></tr>
|
|
54
54
|
{{if .Doc.retention_amount}}<tr><td>Retensi {{number .Doc.retention_percent}}% ditahan</td><td class="num">-{{rupiah .Doc.retention_amount}}</td></tr>{{end}}
|
|
55
|
-
{{if .Doc.pph23_amount}}<tr><td>PPh 23 dipotong pelanggan</td><td class="num">-{{rupiah .Doc.pph23_amount}}</td></tr>{{end}}
|
|
55
|
+
{{if .Doc.pph23_amount}}<tr><td>PPh 23 dipotong pelanggan{{if .Doc.pph23_dpp}} (dasar {{rupiah .Doc.pph23_dpp}}){{end}}</td><td class="num">-{{rupiah .Doc.pph23_amount}}</td></tr>{{end}}
|
|
56
56
|
{{if or .Doc.retention_amount .Doc.pph23_amount}}<tr class="grand"><td>Tagihan bersih</td><td class="num">{{rupiah .Doc.amount_due}}</td></tr>{{end}}
|
|
57
57
|
</table>
|
|
58
58
|
<p class="note"><strong>Terbilang:</strong> {{terbilang .Doc.grand_total}}</p>
|
|
59
59
|
{{if .Doc.notes}}<p class="note">{{.Doc.notes}}</p>{{end}}
|
|
60
60
|
<p class="note">Bila pembayaran dipotong PPh Pasal 23, mohon kirimkan bukti potongnya kepada kami.</p>
|
|
61
61
|
{{template "bank_accounts" .}}
|
|
62
|
+
{{if .Letterhead.bank}}<p class="note">Mohon tulis nomor faktur <strong>{{.Doc.name}}</strong> di berita transfer supaya pembayaran langsung tercatat.</p>{{end}}
|
|
62
63
|
{{if taxrate .Doc .Tax}}<p class="note">Faktur pajak (e-Faktur) diterbitkan terpisah.</p>{{end}}
|
|
63
64
|
{{template "signature" .}}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{{define "style"}}
|
|
2
|
+
.msg { white-space: pre-wrap; border: 1px solid #d6d3d1; border-radius: 8px; padding: 12px; margin: 12px 0; font-size: 1.05em; }
|
|
3
|
+
.wa { display: inline-block; padding: 8px 14px; border-radius: 6px; background: #128c7e; color: #fff; text-decoration: none; font-weight: 700; }
|
|
4
|
+
.muted { color: #78716c; font-size: 0.9em; }
|
|
5
|
+
{{end}}
|
|
6
|
+
{{- $c := .Links.customer -}}
|
|
7
|
+
{{- $p := "" -}}{{- with $c.phone -}}{{- $p = . -}}{{- end -}}
|
|
8
|
+
{{- if and $p (eq (slice $p 0 1) "+") -}}{{- $p = slice $p 1 -}}{{- end -}}
|
|
9
|
+
{{- if and $p (eq (slice $p 0 1) "0") -}}{{- $p = printf "62%s" (slice $p 1) -}}{{- end -}}
|
|
10
|
+
{{- $bank := "" -}}{{- with .Letterhead.bank -}}{{- with index . 0 -}}{{- $bank = printf "%s %s a.n. %s" .bank .account .holder -}}{{- end -}}{{- end -}}
|
|
11
|
+
{{- $late := overdue .Doc.due_date -}}
|
|
12
|
+
{{- $msg := "" -}}
|
|
13
|
+
{{- $open := eq (printf "%v" .Doc.docstatus) "1" -}}
|
|
14
|
+
{{- $owed := gt (printf "%v" .Doc.outstanding | len) 0 -}}{{- if $owed -}}{{- $owed = ne (slice (printf "%v" .Doc.outstanding) 0 1) "-" -}}{{- end -}}
|
|
15
|
+
{{- if not $open -}}
|
|
16
|
+
{{- $p = "" -}}
|
|
17
|
+
{{- if eq (printf "%v" .Doc.docstatus) "2" -}}
|
|
18
|
+
{{- $msg = printf "Faktur %s sudah dibatalkan. Tidak ada tagihan yang dikirim untuk faktur ini." .Doc.name -}}
|
|
19
|
+
{{- else -}}
|
|
20
|
+
{{- $msg = printf "Faktur %s belum diajukan. Ajukan dulu sebelum menagih pelanggan." .Doc.name -}}
|
|
21
|
+
{{- end -}}
|
|
22
|
+
{{- else if or (not .Doc.outstanding) (not $owed) -}}
|
|
23
|
+
{{- $msg = printf "Halo %s, terima kasih. Pembayaran faktur %s sudah kami terima dan faktur ini sudah lunas.\n\n%s" $c.customer_name .Doc.name .Letterhead.legal_name -}}
|
|
24
|
+
{{- else if gt $late 0 -}}
|
|
25
|
+
{{- $msg = printf "Halo %s, kami mengingatkan faktur %s sebesar %s sudah lewat %d hari dari jatuh tempo (%s).\n\nPembayaran ke %s. Mohon tulis %s di berita transfer.\n\nAbaikan pesan ini kalau sudah membayar. Terima kasih.\n%s" $c.customer_name .Doc.name (rupiah .Doc.outstanding) $late (date .Doc.due_date) $bank .Doc.name .Letterhead.legal_name -}}
|
|
26
|
+
{{- else -}}
|
|
27
|
+
{{- $msg = printf "Halo %s, berikut tagihan %s no. %s sebesar %s, jatuh tempo %s.\n\nPembayaran ke %s. Mohon tulis %s di berita transfer.\n\nTerima kasih." $c.customer_name .Letterhead.legal_name .Doc.name (rupiah .Doc.outstanding) (date .Doc.due_date) $bank .Doc.name -}}
|
|
28
|
+
{{- end -}}
|
|
29
|
+
<h1>Pesan tagihan WhatsApp</h1>
|
|
30
|
+
<p>Untuk: <strong>{{$c.customer_name}}</strong>{{if $p}} · +{{$p}}{{else if $open}} · <em>nomor WhatsApp pelanggan belum diisi</em>{{end}}</p>
|
|
31
|
+
<div class="msg">{{$msg}}</div>
|
|
32
|
+
{{if $p}}<p><a class="wa" href="https://wa.me/{{$p}}?text={{$msg}}">Buka di WhatsApp</a></p>{{end}}
|
|
33
|
+
<p class="muted">Setelah terkirim, catat di Pengingat tagihan supaya tidak menagih dua kali di hari yang sama.</p>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/print.json
|
|
2
|
+
# Not paper: the reminder text plus a wa.me link that opens WhatsApp with the text filled in, so the owner sends it
|
|
3
|
+
# from their own phone. Same wording as the WhatsApp Business templates in rangka-connectors.
|
|
4
|
+
name: sales_invoice_whatsapp
|
|
5
|
+
model: sales_invoice
|
|
6
|
+
label: {id: Pesan tagihan WA, en: WhatsApp reminder}
|
|
7
|
+
paper: A5
|
|
8
|
+
template: sales_invoice_whatsapp.html
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/flow.json
|
|
2
|
+
name: moka_legacy_key_overlap
|
|
3
|
+
label: {id: Tandai impor Moka yang tumpang tindih dengan impor lama}
|
|
4
|
+
# A Moka record written by the current import (key_version 2) for an outlet and day that already has a live Moka record
|
|
5
|
+
# from before Time joined the import key: those keys never match, so the repeated rows came in again. The record is
|
|
6
|
+
# marked and rule legacy_key_reviewed holds its submit until head office removed the repeated lines.
|
|
7
|
+
on: outlet_sales.created
|
|
8
|
+
if: event.source == 'moka' && event.key_version == 2
|
|
9
|
+
steps:
|
|
10
|
+
- find: outlet_sales
|
|
11
|
+
where: >-
|
|
12
|
+
source == 'moka' && outlet == event.outlet && date == event.date && docstatus != 2 && name != event.name
|
|
13
|
+
&& key_version != 2
|
|
14
|
+
as: old
|
|
15
|
+
- find: outlet_sales
|
|
16
|
+
if: old != null
|
|
17
|
+
where: name == event.name
|
|
18
|
+
as: rec
|
|
19
|
+
- update: rec
|
|
20
|
+
if: old != null
|
|
21
|
+
set:
|
|
22
|
+
legacy_key_overlap: "true"
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/import.json
|
|
2
2
|
# The daily sales sheet an outlet fills in when it has no Moka export: one row per item sold, one file per day.
|
|
3
|
+
# No key on purpose: import keys are never released, so with [Tanggal, SKU] a corrected sheet for a day could not
|
|
4
|
+
# import again even after the old record was cancelled. The same file twice is still refused by its hash, and two
|
|
5
|
+
# submitted forms for one outlet and day are refused at submit (409 duplicate_sales).
|
|
3
6
|
name: daily_form
|
|
4
7
|
label: {id: Formulir penjualan harian, en: Daily sales form}
|
|
5
8
|
model: outlet_sales
|
|
6
9
|
source: csv
|
|
7
10
|
header_row: 1
|
|
8
11
|
per: outlet
|
|
9
|
-
key: [Tanggal, SKU]
|
|
10
12
|
group: [Tanggal]
|
|
11
13
|
map:
|
|
12
14
|
date: Tanggal
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/import.json
|
|
2
|
+
# Loyverse Back Office "Receipts by item" export (Reports > Receipts > Export > Receipts by item), one store per file.
|
|
3
|
+
# GUESSED HEADERS: taken from Loyverse's help pages, not from a real export yet. Check them against the first real
|
|
4
|
+
# file and fix them here (the Moka import failed on guessed headers before rangka-apps P2).
|
|
5
|
+
# Loyverse writes a refund as its own receipt (Receipt type "Refund") with a positive Quantity; it is turned into a
|
|
6
|
+
# negative line with its Net sales in refund, so net sales match Loyverse; the sign of Quantity and Net sales on a
|
|
7
|
+
# refund row does not matter (both are taken as amounts). The Date column must be a date without
|
|
8
|
+
# the time (set the export's date format in Loyverse), else the row is refused.
|
|
9
|
+
name: loyverse_receipts
|
|
10
|
+
label: {id: Penjualan Loyverse (per barang), en: Loyverse sales (receipts by item)}
|
|
11
|
+
model: outlet_sales
|
|
12
|
+
source: csv
|
|
13
|
+
header_row: 1
|
|
14
|
+
per: outlet
|
|
15
|
+
key: [Date, Receipt number, SKU, Variant]
|
|
16
|
+
group: [Date]
|
|
17
|
+
map:
|
|
18
|
+
date: Date
|
|
19
|
+
source: "='loyverse'"
|
|
20
|
+
note: "='Loyverse ' + row['Date']"
|
|
21
|
+
lines:
|
|
22
|
+
field: lines
|
|
23
|
+
map:
|
|
24
|
+
item: {value: SKU, match: sku}
|
|
25
|
+
qty: "=row['Receipt type'] == 'Refund' ? -max(double(row['Quantity']), -double(row['Quantity'])) : double(row['Quantity'])"
|
|
26
|
+
gross: "=row['Receipt type'] == 'Refund' ? 0 : int(row['Gross sales'])"
|
|
27
|
+
discount: "=row['Receipt type'] == 'Refund' ? 0 : int(row['Discounts'])"
|
|
28
|
+
refund: "=row['Receipt type'] == 'Refund' ? max(int(row['Net sales']), -int(row['Net sales'])) : 0"
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/import.json
|
|
2
|
-
# Moka Backoffice "Export Item Details"
|
|
3
|
-
#
|
|
2
|
+
# Moka Backoffice "Export Item Details" (Reports > Transactions > Export > Item Details), one file per outlet and day
|
|
3
|
+
# (or several days), unzipped. The 25 English headers (Outlet, Receipt Number, Date, Time, Category, Brand, Items,
|
|
4
|
+
# Variant, SKU, Quantity, Modifier Applied, Discount Applied, Gross Sales, Discounts, Refunds, Net Sales, Gratuity, Tax,
|
|
5
|
+
# Sales Type, Collected By, Served By, Customer, Payment Method, Event Type, Reason of Refund) come from code that reads
|
|
6
|
+
# real exports; columns are matched by name, so their order does not matter. Dates are dd-mm-yyyy (rangka-os #32).
|
|
7
|
+
# When a pilot's real export differs, fix the headers here, not in the kernel.
|
|
8
|
+
# One outlet per file (choose it at upload): a row whose Outlet is not that outlet's moka_name is refused, so an All
|
|
9
|
+
# Outlets export or a file uploaded for the wrong outlet cannot land in another outlet's stock.
|
|
10
|
+
# Time is in the key: two partial refunds of one item on one receipt are two rows, not a "Baris ganda". Keys stored
|
|
11
|
+
# before Time joined do not match, so a day imported earlier is held at submit (outlet_sales.legacy_key_reviewed).
|
|
4
12
|
# Same file twice -> duplicate (file hash). Overlapping exports -> only rows whose key is new. Records arrive as drafts.
|
|
5
13
|
name: moka_item_details
|
|
6
14
|
label: {id: Penjualan Moka (detail item), en: Moka sales (item details)}
|
|
@@ -8,11 +16,13 @@ model: outlet_sales
|
|
|
8
16
|
source: csv
|
|
9
17
|
header_row: 1
|
|
10
18
|
per: outlet
|
|
11
|
-
key: [Date, Receipt Number,
|
|
12
|
-
group: [Date]
|
|
19
|
+
key: [Date, Time, Receipt Number, Items, Variant, Modifier Applied]
|
|
20
|
+
group: [Date, Outlet]
|
|
13
21
|
map:
|
|
14
22
|
date: Date
|
|
15
23
|
source: "='moka'"
|
|
24
|
+
moka_outlet: Outlet
|
|
25
|
+
key_version: "=2"
|
|
16
26
|
note: "='Moka ' + row['Date']"
|
|
17
27
|
lines:
|
|
18
28
|
field: lines
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/import.json
|
|
2
|
+
# Juragan's sales template for any POS without its own import (Kasir Pintar, Pawoon, majoo, Olsera, a spreadsheet):
|
|
3
|
+
# one row per item sold per day, one outlet per file. Headers: Tanggal, No struk, Jenis (Jual or Retur), SKU, Qty,
|
|
4
|
+
# Penjualan kotor, Diskon, Retur. A return is its own row (Jenis Retur) with a negative Qty, Penjualan kotor 0 and the
|
|
5
|
+
# returned value in Retur, as Moka writes it. No struk may be empty when the POS only exports a daily total per item:
|
|
6
|
+
# then each SKU appears once per day and Jenis. The key leaves Qty out on purpose: a re-export of a day whose totals
|
|
7
|
+
# changed skips the rows already imported instead of adding them a second time; correct such a day on its draft.
|
|
8
|
+
# The outlet must have Sumber penjualan = File POS. Same file twice -> duplicate; overlapping files -> only new rows.
|
|
9
|
+
name: pos_sales_file
|
|
10
|
+
label: {id: Penjualan dari file POS, en: Sales from a POS file}
|
|
11
|
+
model: outlet_sales
|
|
12
|
+
source: csv
|
|
13
|
+
header_row: 1
|
|
14
|
+
per: outlet
|
|
15
|
+
key: [Tanggal, No struk, Jenis, SKU]
|
|
16
|
+
group: [Tanggal]
|
|
17
|
+
map:
|
|
18
|
+
date: Tanggal
|
|
19
|
+
source: "='file'"
|
|
20
|
+
note: "='File POS ' + row['Tanggal']"
|
|
21
|
+
lines:
|
|
22
|
+
field: lines
|
|
23
|
+
map:
|
|
24
|
+
item: {value: SKU, match: sku}
|
|
25
|
+
qty: Qty
|
|
26
|
+
gross: Penjualan kotor
|
|
27
|
+
discount: Diskon
|
|
28
|
+
refund: Retur
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/import.json
|
|
2
|
+
# Juragan's daily takings template, one outlet per file: Tanggal, Metode (Tunai, QRIS, Kartu debit, Kartu kredit,
|
|
3
|
+
# Transfer bank, Dompet digital, Lainnya), Menurut POS, Disetor, Potongan, Referensi. Fill Menurut POS from the POS's
|
|
4
|
+
# payment report (Moka "Payment Methods", Loyverse "Sales by payment type"); a native import of those reports waits
|
|
5
|
+
# for a real export file.
|
|
6
|
+
name: takings_file
|
|
7
|
+
label: {id: Setoran harian (template), en: Daily takings (template)}
|
|
8
|
+
model: outlet_takings
|
|
9
|
+
source: csv
|
|
10
|
+
header_row: 1
|
|
11
|
+
per: outlet
|
|
12
|
+
key: [Tanggal, Metode]
|
|
13
|
+
group: [Tanggal]
|
|
14
|
+
map:
|
|
15
|
+
date: Tanggal
|
|
16
|
+
lines:
|
|
17
|
+
field: lines
|
|
18
|
+
map:
|
|
19
|
+
method: "=row['Metode'] == 'Tunai' ? 'cash' : row['Metode'] == 'QRIS' ? 'qris' : row['Metode'] == 'Kartu debit' ? 'debit' : row['Metode'] == 'Kartu kredit' ? 'credit' : row['Metode'] == 'Transfer bank' ? 'transfer' : row['Metode'] == 'Dompet digital' ? 'ewallet' : 'other'"
|
|
20
|
+
expected: Menurut POS
|
|
21
|
+
received: Disetor
|
|
22
|
+
fee: Potongan
|
|
23
|
+
bank_ref: Referensi
|
|
@@ -8,11 +8,20 @@ title_field: date
|
|
|
8
8
|
# Created as a draft (by the daily form or by an import); stock moves only when head office or the outlet submits it.
|
|
9
9
|
# stock.post_moves explodes each line through its active recipe, writes the line cogs and cogs_total, and refuses
|
|
10
10
|
# a second submitted record for the same outlet and date when source is form (409 duplicate_sales).
|
|
11
|
+
# A refund from a POS file (Moka, Loyverse, Juragan's template) is its own line (qty < 0, gross 0, refund > 0, net < 0).
|
|
12
|
+
# The kernel posts no stock move for a line with qty <= 0, so the goods of the original sale stay out of stock: a refund
|
|
13
|
+
# lowers net sales and margin, not stock. For a shop that puts returned goods back on the shelf this undervalues stock
|
|
14
|
+
# until the kernel has a return document (draft contract 0021); the retail dashboard shows returned qty per day.
|
|
15
|
+
# That is also what Moka does with base ingredients on a refund. Returning materials to stock needs the kernel.
|
|
11
16
|
on_submit: [stock.post_moves]
|
|
12
17
|
on_cancel: [stock.reverse_moves]
|
|
13
18
|
permissions:
|
|
14
19
|
- {role: head_office, read: true, create: true, write: true, delete: true, submit: true, cancel: true, amend: true, export: true, import: true, print: true}
|
|
15
|
-
|
|
20
|
+
# Outlet staff keep the daily form only. A record from Moka, a POS file or Loyverse (negative refund lines allowed) is
|
|
21
|
+
# the importer's, head office: staff cannot type such a source to book a negative net (audit #7 S1, kept for file
|
|
22
|
+
# and loyverse when ritel_cabang added them).
|
|
23
|
+
- {role: outlet_staff, read: true, create: true, write: true, submit: true, if: source == 'form'}
|
|
24
|
+
- {role: outlet_staff, read: true}
|
|
16
25
|
fields:
|
|
17
26
|
- name: outlet
|
|
18
27
|
type: link
|
|
@@ -25,6 +34,9 @@ fields:
|
|
|
25
34
|
label: {id: Tanggal}
|
|
26
35
|
required: true
|
|
27
36
|
in_list: true
|
|
37
|
+
# Set by the import (moka, file, loyverse) or left at form. Not read_only: the kernel drops read_only input from imports
|
|
38
|
+
# too. The outlet_staff permission holds only while source == 'form', so only head office (who imports) can write a
|
|
39
|
+
# record from Moka, a POS file or Loyverse.
|
|
28
40
|
- name: source
|
|
29
41
|
type: select
|
|
30
42
|
label: {id: Sumber}
|
|
@@ -34,9 +46,30 @@ fields:
|
|
|
34
46
|
options:
|
|
35
47
|
- {value: moka, label: {id: Moka}}
|
|
36
48
|
- {value: form, label: {id: Formulir harian}}
|
|
49
|
+
- {value: file, label: {id: File POS}}
|
|
50
|
+
- {value: loyverse, label: {id: Loyverse}}
|
|
37
51
|
- name: note
|
|
38
52
|
type: data
|
|
39
53
|
label: {id: Catatan}
|
|
54
|
+
# The Outlet column of the Moka file this record came from; must equal the chosen outlet's moka_name.
|
|
55
|
+
- name: moka_outlet
|
|
56
|
+
type: data
|
|
57
|
+
label: {id: Outlet di file Moka}
|
|
58
|
+
depends_on: source == 'moka'
|
|
59
|
+
# The Moka import key gained Time (two partial refunds of one item on one receipt). Keys stored before that never
|
|
60
|
+
# match the new key, so an overlapping export re-imports rows of a day already imported. key_version is 2 on every
|
|
61
|
+
# record the current import writes; flow moka_legacy_key_overlap marks a new record whose outlet and day already have
|
|
62
|
+
# a live Moka record without it, and rule legacy_key_reviewed holds its submit until head office has removed the
|
|
63
|
+
# repeated lines and ticks legacy_key_checked.
|
|
64
|
+
- {name: key_version, type: int, label: {id: Versi kunci impor}, hidden: true}
|
|
65
|
+
- name: legacy_key_overlap
|
|
66
|
+
type: check
|
|
67
|
+
label: {id: Tumpang tindih impor lama}
|
|
68
|
+
read_only: true
|
|
69
|
+
help: {id: 'Tanggal ini sudah punya penjualan Moka yang diimpor sebelum pembaruan; baris yang sama bisa masuk lagi'}
|
|
70
|
+
- name: legacy_key_checked
|
|
71
|
+
type: check
|
|
72
|
+
label: {id: Baris ganda sudah dihapus}
|
|
40
73
|
- name: lines
|
|
41
74
|
type: table
|
|
42
75
|
of: outlet_sales_line
|
|
@@ -74,19 +107,52 @@ fields:
|
|
|
74
107
|
label: {id: Margin}
|
|
75
108
|
compute: net_total - cogs_total
|
|
76
109
|
in_list: true
|
|
110
|
+
# Monthly tax recap (no file): a PKP shop's sales prices include PPN, so the PPN inside net sales is
|
|
111
|
+
# net x rate x dpp / (100 + rate x dpp) (Digunggung amounts). The 0,5% final PPh of PP 55/2022 depends on turnover
|
|
112
|
+
# (up to Rp 4,8 miliar a year), not on PKP status, so it is shown for every shop on turnover without PPN; a shop
|
|
113
|
+
# above the limit ignores it.
|
|
114
|
+
# The XML for Coretax needs a kernel export.
|
|
115
|
+
- name: ppn_in_sales
|
|
116
|
+
type: currency
|
|
117
|
+
label: {id: PPN dalam penjualan}
|
|
118
|
+
compute: "tax.pkp ? round(net_total * tax.ppn_rate * tax.dpp_num / (100 * tax.dpp_den + tax.ppn_rate * tax.dpp_num)) : 0"
|
|
119
|
+
- name: pph_final
|
|
120
|
+
type: currency
|
|
121
|
+
label: {id: 'PPh final 0,5%'}
|
|
122
|
+
compute: round((net_total - ppn_in_sales) * 5 / 1000)
|
|
77
123
|
rules:
|
|
124
|
+
- name: moka_outlet_matches
|
|
125
|
+
on: save
|
|
126
|
+
check: "source != 'moka' || moka_outlet == outlet.moka_name"
|
|
127
|
+
message: {id: 'Kolom Outlet di file Moka beda dengan Nama outlet di Moka pada outlet ini. Ekspor per outlet, atau cek data outlet'}
|
|
128
|
+
# One sales source per outlet: a Moka outlet (moka_name set) imports Moka files only, any other outlet uses the
|
|
129
|
+
# daily form. Without it, a form and a Moka export for the same outlet and day both take stock out.
|
|
130
|
+
- name: form_only_for_non_moka_outlets
|
|
131
|
+
on: save
|
|
132
|
+
check: "source != 'form' || outlet.moka_name == ''"
|
|
133
|
+
message: {id: 'Outlet ini memakai Moka: penjualannya diimpor dari file Moka, bukan formulir harian'}
|
|
134
|
+
# An outlet without Moka has one sales_source (empty = form): a POS file or a Loyverse export is accepted only for
|
|
135
|
+
# the outlet that names it, and a form only for an outlet whose source is the form.
|
|
136
|
+
- name: source_matches_outlet
|
|
137
|
+
on: save
|
|
138
|
+
check: "source == 'moka' || (outlet.moka_name == '' && (outlet.sales_source == '' ? 'form' : outlet.sales_source) == source)"
|
|
139
|
+
message: {id: 'Sumber penjualan ini beda dengan Sumber penjualan di data outlet. Cek data outlet, atau pilih outlet yang benar'}
|
|
78
140
|
- name: qty_not_negative
|
|
79
141
|
on: save
|
|
80
|
-
check: "lines.map(l, l.qty < 0 ? 1 : 0).sum() == 0"
|
|
81
|
-
message: {id: Jumlah terjual
|
|
142
|
+
check: "lines.map(l, l.qty < 0 && (l.refund == 0 || (source != 'moka' && source != 'file' && source != 'loyverse')) ? 1 : 0).sum() == 0"
|
|
143
|
+
message: {id: Jumlah terjual hanya boleh negatif di baris retur dari file POS}
|
|
82
144
|
- name: discount_within_gross
|
|
83
145
|
on: save
|
|
84
146
|
check: "lines.map(l, l.discount > l.gross ? 1 : 0).sum() == 0"
|
|
85
147
|
message: {id: Diskon tidak boleh melebihi penjualan kotor}
|
|
86
148
|
- name: net_not_negative
|
|
87
149
|
on: save
|
|
88
|
-
check: "lines.map(l, l.net < 0 ? 1 : 0).sum() == 0"
|
|
89
|
-
message: {id: Penjualan bersih per baris
|
|
150
|
+
check: "lines.map(l, l.net < 0 && (l.refund == 0 || (source != 'moka' && source != 'file' && source != 'loyverse')) ? 1 : 0).sum() == 0"
|
|
151
|
+
message: {id: Penjualan bersih per baris hanya boleh negatif di baris retur dari file POS}
|
|
152
|
+
- name: legacy_key_reviewed
|
|
153
|
+
on: submit
|
|
154
|
+
check: "!legacy_key_overlap || legacy_key_checked"
|
|
155
|
+
message: {id: 'Tanggal ini sudah diimpor sebelum pembaruan: hapus baris yang terulang, lalu centang Baris ganda sudah dihapus'}
|
|
90
156
|
views:
|
|
91
157
|
list:
|
|
92
158
|
columns: [name, outlet, date, source, status, net_total, cogs_total, margin]
|
|
@@ -97,7 +163,7 @@ views:
|
|
|
97
163
|
- section: {id: Penjualan}
|
|
98
164
|
columns:
|
|
99
165
|
- [outlet, date, source]
|
|
100
|
-
- [note]
|
|
166
|
+
- [note, legacy_key_overlap, legacy_key_checked]
|
|
101
167
|
- section: {id: Barang terjual}
|
|
102
168
|
fields: [lines]
|
|
103
169
|
- section: {id: Ringkasan}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/model.json
|
|
2
|
+
name: outlet_takings
|
|
3
|
+
label: {id: Setoran harian, en: Daily takings}
|
|
4
|
+
icon: wallet
|
|
5
|
+
is_submittable: true
|
|
6
|
+
naming: STR-{YYYY}-{#####}
|
|
7
|
+
title_field: date
|
|
8
|
+
# What each payment method should have brought in per outlet per day (the POS's payment report) against what was
|
|
9
|
+
# deposited or credited (cash banked, QRIS/EDC settlement after MDR). The difference per line is the shortfall head
|
|
10
|
+
# office follows up. Matching a line to a bank statement line is manual for now (bank_ref holds the statement's
|
|
11
|
+
# reference); a link to bank_statement comes with the money rail (plan Tahap 1). No stock, no ledger: submit only
|
|
12
|
+
# freezes the day.
|
|
13
|
+
permissions:
|
|
14
|
+
- {role: head_office, read: true, create: true, write: true, delete: true, submit: true, cancel: true, amend: true, export: true, import: true, print: true}
|
|
15
|
+
- {role: outlet_staff, read: true, create: true, write: true, submit: true}
|
|
16
|
+
fields:
|
|
17
|
+
- name: outlet
|
|
18
|
+
type: link
|
|
19
|
+
to: outlet
|
|
20
|
+
label: {id: Outlet}
|
|
21
|
+
required: true
|
|
22
|
+
in_list: true
|
|
23
|
+
- name: date
|
|
24
|
+
type: date
|
|
25
|
+
label: {id: Tanggal}
|
|
26
|
+
required: true
|
|
27
|
+
default: today()
|
|
28
|
+
in_list: true
|
|
29
|
+
- name: lines
|
|
30
|
+
type: table
|
|
31
|
+
of: outlet_takings_line
|
|
32
|
+
label: {id: Per metode bayar}
|
|
33
|
+
min_rows: 1
|
|
34
|
+
- name: expected_total
|
|
35
|
+
type: currency
|
|
36
|
+
label: {id: Menurut POS}
|
|
37
|
+
compute: lines.map(l, l.expected).sum()
|
|
38
|
+
in_list: true
|
|
39
|
+
- name: received_total
|
|
40
|
+
type: currency
|
|
41
|
+
label: {id: Disetor atau diterima}
|
|
42
|
+
compute: lines.map(l, l.received).sum()
|
|
43
|
+
in_list: true
|
|
44
|
+
- name: fee_total
|
|
45
|
+
type: currency
|
|
46
|
+
label: {id: Potongan MDR}
|
|
47
|
+
compute: lines.map(l, l.fee).sum()
|
|
48
|
+
- name: difference_total
|
|
49
|
+
type: currency
|
|
50
|
+
label: {id: Selisih}
|
|
51
|
+
help: {id: 'Diterima ditambah potongan dikurangi menurut POS. Minus berarti setoran kurang'}
|
|
52
|
+
compute: lines.map(l, l.difference).sum()
|
|
53
|
+
in_list: true
|
|
54
|
+
- name: short
|
|
55
|
+
type: check
|
|
56
|
+
label: {id: Setoran kurang}
|
|
57
|
+
compute: difference_total < 0
|
|
58
|
+
in_list: true
|
|
59
|
+
- name: note
|
|
60
|
+
type: text
|
|
61
|
+
label: {id: Catatan}
|
|
62
|
+
rules:
|
|
63
|
+
- name: amounts_not_negative
|
|
64
|
+
on: save
|
|
65
|
+
check: "lines.map(l, l.expected < 0 || l.received < 0 || l.fee < 0 ? 1 : 0).sum() == 0"
|
|
66
|
+
message: {id: Nilai setoran dan potongan tidak boleh negatif}
|
|
67
|
+
views:
|
|
68
|
+
list:
|
|
69
|
+
columns: [name, outlet, date, status, expected_total, received_total, difference_total, short]
|
|
70
|
+
filters: [outlet, short]
|
|
71
|
+
sort: -date
|
|
72
|
+
form:
|
|
73
|
+
layout:
|
|
74
|
+
- section: {id: Setoran}
|
|
75
|
+
columns:
|
|
76
|
+
- [outlet, date]
|
|
77
|
+
- [note]
|
|
78
|
+
- section: {id: Per metode bayar}
|
|
79
|
+
fields: [lines]
|
|
80
|
+
- section: {id: Ringkasan}
|
|
81
|
+
columns:
|
|
82
|
+
- [expected_total, received_total]
|
|
83
|
+
- [fee_total, difference_total]
|