@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
|
@@ -41,6 +41,22 @@ fields:
|
|
|
41
41
|
label: {id: Tarif per hari}
|
|
42
42
|
default: worker.day_rate
|
|
43
43
|
in_list: true
|
|
44
|
+
# Billed per day (manpower, the default) or per hour (consultants); the rates default from the worker.
|
|
45
|
+
- name: rate_basis
|
|
46
|
+
type: select
|
|
47
|
+
label: {id: Satuan tarif}
|
|
48
|
+
default: "'day'"
|
|
49
|
+
options:
|
|
50
|
+
- {value: day, label: {id: Per hari}}
|
|
51
|
+
- {value: hour, label: {id: Per jam}}
|
|
52
|
+
- name: hour_rate
|
|
53
|
+
type: currency
|
|
54
|
+
label: {id: Tarif per jam}
|
|
55
|
+
default: worker.hour_rate
|
|
56
|
+
- name: cost_rate
|
|
57
|
+
type: currency
|
|
58
|
+
label: {id: Biaya per satuan}
|
|
59
|
+
default: "rate_basis == 'hour' ? worker.cost_hour_rate : worker.cost_day_rate"
|
|
44
60
|
- name: notes
|
|
45
61
|
type: text
|
|
46
62
|
label: {id: Catatan}
|
|
@@ -58,6 +74,10 @@ views:
|
|
|
58
74
|
- section: {id: Penugasan}
|
|
59
75
|
columns:
|
|
60
76
|
- [project, worker, site]
|
|
61
|
-
- [start_date, end_date
|
|
77
|
+
- [start_date, end_date]
|
|
78
|
+
- section: {id: Tarif}
|
|
79
|
+
columns:
|
|
80
|
+
- [rate_basis, day_rate, hour_rate]
|
|
81
|
+
- [cost_rate]
|
|
62
82
|
- section: {id: Catatan}
|
|
63
83
|
fields: [notes]
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/model.json
|
|
2
|
+
name: billing_milestone
|
|
3
|
+
label: {id: Termin tagihan, en: Billing milestone}
|
|
4
|
+
icon: invoice
|
|
5
|
+
naming: TRM-{YYYY}-{#####}
|
|
6
|
+
title_field: title
|
|
7
|
+
# The billing schedule of a project: down payment, milestones (by date or after an acceptance report), monthly
|
|
8
|
+
# retainers, time-and-material periods, retention. state is written by flows only: planned -> ready when the project's
|
|
9
|
+
# acceptance report is submitted (trigger acceptance), -> invoiced when an invoice linked to it is submitted, back to
|
|
10
|
+
# ready when that invoice is cancelled. A date-triggered milestone stays planned and shows as due from its due_date.
|
|
11
|
+
permissions:
|
|
12
|
+
# No delete: there is no delete event for flows, so project.scheduled_amount would keep a deleted milestone; and an
|
|
13
|
+
# invoiced milestone must keep its invoice link. Create and import are the project admin's (the schedule flows update
|
|
14
|
+
# the project, which only project admins may write); finance writes the state through the invoice flows.
|
|
15
|
+
- {role: project_admin, read: true, create: true, write: true, export: true, import: true}
|
|
16
|
+
- {role: finance_manager, read: true, write: true, export: true}
|
|
17
|
+
- {role: sales_manager, read: true, write: true}
|
|
18
|
+
fields:
|
|
19
|
+
- name: project
|
|
20
|
+
type: link
|
|
21
|
+
to: project
|
|
22
|
+
label: {id: Proyek}
|
|
23
|
+
required: true
|
|
24
|
+
in_list: true
|
|
25
|
+
- name: customer
|
|
26
|
+
type: link
|
|
27
|
+
to: customer
|
|
28
|
+
label: {id: Pelanggan}
|
|
29
|
+
default: project.customer
|
|
30
|
+
read_only: true
|
|
31
|
+
in_list: true
|
|
32
|
+
- name: seq
|
|
33
|
+
type: int
|
|
34
|
+
label: {id: Urutan}
|
|
35
|
+
default: '1'
|
|
36
|
+
- name: title
|
|
37
|
+
type: data
|
|
38
|
+
label: {id: Judul}
|
|
39
|
+
required: true
|
|
40
|
+
in_list: true
|
|
41
|
+
- name: kind
|
|
42
|
+
type: select
|
|
43
|
+
label: {id: Jenis}
|
|
44
|
+
default: "'milestone'"
|
|
45
|
+
options:
|
|
46
|
+
- {value: down_payment, label: {id: Uang muka (DP)}}
|
|
47
|
+
- {value: milestone, label: {id: Termin}}
|
|
48
|
+
- {value: retainer, label: {id: Retainer}}
|
|
49
|
+
- {value: time_material, label: {id: Jam atau hari kerja}}
|
|
50
|
+
- {value: retention, label: {id: Pelepasan retensi}}
|
|
51
|
+
- name: basis
|
|
52
|
+
type: select
|
|
53
|
+
label: {id: Dasar nilai}
|
|
54
|
+
default: "'amount'"
|
|
55
|
+
options:
|
|
56
|
+
- {value: percent, label: {id: Persen nilai kontrak}}
|
|
57
|
+
- {value: amount, label: {id: Nominal}}
|
|
58
|
+
- name: percent
|
|
59
|
+
type: percent
|
|
60
|
+
label: {id: Persen}
|
|
61
|
+
default: '0'
|
|
62
|
+
depends_on: basis == 'percent'
|
|
63
|
+
- name: amount_fixed
|
|
64
|
+
type: currency
|
|
65
|
+
label: {id: Nominal}
|
|
66
|
+
default: '0'
|
|
67
|
+
depends_on: basis == 'amount'
|
|
68
|
+
# The contract value when the milestone was made: a percent milestone is a share of it, so its amount does not move
|
|
69
|
+
# when the contract changes later or when a flow saves the milestone again (the schedule flows only see edits).
|
|
70
|
+
- name: contract_snapshot
|
|
71
|
+
type: currency
|
|
72
|
+
label: {id: Nilai kontrak saat termin dibuat}
|
|
73
|
+
read_only: true
|
|
74
|
+
default: project.contract_value
|
|
75
|
+
- name: amount
|
|
76
|
+
type: currency
|
|
77
|
+
label: {id: Nilai termin (DPP)}
|
|
78
|
+
# contract_snapshot is empty on milestones made before it existed: those use the project's contract (frozen once billed).
|
|
79
|
+
compute: "basis == 'percent' ? round((contract_snapshot > 0 ? contract_snapshot : project.contract_value) * percent / 100) : amount_fixed"
|
|
80
|
+
in_list: true
|
|
81
|
+
- name: trigger
|
|
82
|
+
type: select
|
|
83
|
+
label: {id: Ditagih saat}
|
|
84
|
+
default: "'date'"
|
|
85
|
+
options:
|
|
86
|
+
- {value: date, label: {id: Tanggal}}
|
|
87
|
+
- {value: acceptance, label: {id: Setelah berita acara}}
|
|
88
|
+
- name: due_date
|
|
89
|
+
type: date
|
|
90
|
+
label: {id: Jatuh tempo tagih}
|
|
91
|
+
in_list: true
|
|
92
|
+
- name: period_from
|
|
93
|
+
type: date
|
|
94
|
+
label: {id: Periode dari}
|
|
95
|
+
depends_on: kind == 'retainer' || kind == 'time_material'
|
|
96
|
+
- name: period_to
|
|
97
|
+
type: date
|
|
98
|
+
label: {id: Periode sampai}
|
|
99
|
+
depends_on: kind == 'retainer' || kind == 'time_material'
|
|
100
|
+
# One retainer milestone per project and month: period_from is the 1st of the month and this key is unique.
|
|
101
|
+
- name: retainer_key
|
|
102
|
+
type: data
|
|
103
|
+
label: {id: Bulan retainer}
|
|
104
|
+
hidden: true
|
|
105
|
+
unique: true
|
|
106
|
+
compute: "kind == 'retainer' ? project + ':' + period_from : ''"
|
|
107
|
+
- name: state
|
|
108
|
+
type: select
|
|
109
|
+
label: {id: Status}
|
|
110
|
+
default: "'planned'"
|
|
111
|
+
read_only: true
|
|
112
|
+
in_list: true
|
|
113
|
+
chip: true
|
|
114
|
+
options:
|
|
115
|
+
- {value: planned, label: {id: Direncanakan}}
|
|
116
|
+
- {value: ready, label: {id: Siap ditagih}}
|
|
117
|
+
- {value: invoiced, label: {id: Sudah ditagih}}
|
|
118
|
+
- name: acceptance
|
|
119
|
+
type: link
|
|
120
|
+
to: acceptance
|
|
121
|
+
label: {id: Berita acara}
|
|
122
|
+
read_only: true
|
|
123
|
+
- name: sales_invoice
|
|
124
|
+
type: link
|
|
125
|
+
to: sales_invoice
|
|
126
|
+
label: {id: Faktur}
|
|
127
|
+
read_only: true
|
|
128
|
+
in_list: true
|
|
129
|
+
# Set only by flow milestone_lock_on_update, inside an edit that changes the amount or the project of a milestone
|
|
130
|
+
# that is no longer planned; rule edit_locked then refuses that edit.
|
|
131
|
+
# The last cancelled invoice of this milestone (set by milestone_reopened): part of the invoices' milestone_claim, so
|
|
132
|
+
# a new invoice after a cancel claims a key the cancelled one does not hold.
|
|
133
|
+
- name: bill_token
|
|
134
|
+
type: data
|
|
135
|
+
label: {id: Faktur batal terakhir}
|
|
136
|
+
read_only: true
|
|
137
|
+
# Set by milestone_invoiced when the invoice's DPP is above the milestone's amount (an edit that raced the submit);
|
|
138
|
+
# rule not_over_billed then refuses the submit.
|
|
139
|
+
- name: over_billed
|
|
140
|
+
type: check
|
|
141
|
+
label: {id: Tertagih melebihi termin}
|
|
142
|
+
hidden: true
|
|
143
|
+
default: 'false'
|
|
144
|
+
# Set by milestone_invoiced when another milestone of the same project and month is already invoiced (it reads the
|
|
145
|
+
# milestones' state, so a month billed before retainer_key existed counts too); rule month_not_billed refuses the submit.
|
|
146
|
+
- name: month_billed
|
|
147
|
+
type: check
|
|
148
|
+
label: {id: Bulan ini sudah ditagih}
|
|
149
|
+
hidden: true
|
|
150
|
+
default: 'false'
|
|
151
|
+
- name: locked_edit
|
|
152
|
+
type: check
|
|
153
|
+
label: {id: Perubahan terkunci}
|
|
154
|
+
hidden: true
|
|
155
|
+
default: 'false'
|
|
156
|
+
rules:
|
|
157
|
+
- name: not_over_billed
|
|
158
|
+
on: save
|
|
159
|
+
check: "!over_billed"
|
|
160
|
+
message: {id: DPP faktur melebihi nilai termin}
|
|
161
|
+
- name: edit_locked
|
|
162
|
+
on: save
|
|
163
|
+
check: "!locked_edit"
|
|
164
|
+
message: {id: 'Termin siap ditagih atau sudah ditagih: nilai, proyek, jenis, dan periodenya tidak bisa diubah'}
|
|
165
|
+
- name: month_not_billed
|
|
166
|
+
on: save
|
|
167
|
+
check: "!month_billed"
|
|
168
|
+
message: {id: Bulan retainer ini sudah ditagih di termin lain}
|
|
169
|
+
# A retainer project bills each month once through its retainer milestones (retainer_key, month_not_billed); a milestone
|
|
170
|
+
# of another kind would bill the month again, so it is refused there.
|
|
171
|
+
- name: retainer_project_monthly
|
|
172
|
+
on: save
|
|
173
|
+
check: project.billing_model != 'retainer' || kind == 'retainer'
|
|
174
|
+
message: {id: 'Proyek retainer hanya memakai termin jenis Retainer (satu per bulan)'}
|
|
175
|
+
- name: percent_needs_contract
|
|
176
|
+
on: save
|
|
177
|
+
check: basis != 'percent' || contract_snapshot > 0 || project.contract_value > 0
|
|
178
|
+
message: {id: Termin persen butuh nilai kontrak di proyek}
|
|
179
|
+
- name: retainer_month
|
|
180
|
+
on: save
|
|
181
|
+
check: kind != 'retainer' || (period_from != '' && period_from.endsWith('-01'))
|
|
182
|
+
message: {id: 'Termin retainer satu per bulan: Periode dari harus tanggal 1'}
|
|
183
|
+
- name: retainer_month_within_fee
|
|
184
|
+
on: save
|
|
185
|
+
check: project.billing_model != 'retainer' || project.contract_value == 0 || amount <= project.contract_value
|
|
186
|
+
message: {id: Termin retainer tidak boleh melebihi fee bulanan (nilai kontrak)}
|
|
187
|
+
- name: percent_range
|
|
188
|
+
on: save
|
|
189
|
+
check: basis != 'percent' || (percent > 0 && percent <= 100)
|
|
190
|
+
message: {id: Persen termin harus di atas 0 dan paling besar 100}
|
|
191
|
+
- name: amount_positive
|
|
192
|
+
on: save
|
|
193
|
+
check: basis != 'amount' || amount_fixed > 0
|
|
194
|
+
message: {id: Nominal termin harus lebih dari 0}
|
|
195
|
+
- name: due_date_for_date_trigger
|
|
196
|
+
on: save
|
|
197
|
+
check: trigger != 'date' || due_date != ''
|
|
198
|
+
message: {id: Termin berdasarkan tanggal wajib punya jatuh tempo tagih}
|
|
199
|
+
- name: period_order
|
|
200
|
+
on: save
|
|
201
|
+
check: period_from == '' || period_to == '' || period_to >= period_from
|
|
202
|
+
message: {id: Periode sampai tidak boleh sebelum periode dari}
|
|
203
|
+
views:
|
|
204
|
+
list:
|
|
205
|
+
columns: [name, project, customer, seq, title, kind, amount, due_date, state, sales_invoice]
|
|
206
|
+
filters: [project, state, kind]
|
|
207
|
+
sort: due_date
|
|
208
|
+
form:
|
|
209
|
+
layout:
|
|
210
|
+
- section: {id: Termin}
|
|
211
|
+
columns:
|
|
212
|
+
- [project, customer, seq, title, kind]
|
|
213
|
+
- [basis, percent, amount_fixed, amount]
|
|
214
|
+
- section: {id: Kapan ditagih}
|
|
215
|
+
columns:
|
|
216
|
+
- [trigger, due_date, period_from, period_to]
|
|
217
|
+
- [state, acceptance, sales_invoice]
|
|
@@ -6,8 +6,10 @@ naming: PRJ-{YYYY}-{####}
|
|
|
6
6
|
title_field: project_name
|
|
7
7
|
permissions:
|
|
8
8
|
- {role: project_admin, read: true, create: true, write: true, delete: true, submit: true, cancel: true, amend: true, export: true, print: true}
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
# Finance and sales write projects only so the invoice flows (which run as them) can keep billed_amount; the terms
|
|
10
|
+
# they could edit freeze once the project has a schedule or invoices (project_terms_lock).
|
|
11
|
+
- {role: sales_manager, read: true, write: true}
|
|
12
|
+
- {role: finance_manager, read: true, write: true}
|
|
11
13
|
fields:
|
|
12
14
|
- name: project_name
|
|
13
15
|
type: data
|
|
@@ -53,7 +55,75 @@ fields:
|
|
|
53
55
|
- name: notes
|
|
54
56
|
type: text
|
|
55
57
|
label: {id: Catatan}
|
|
58
|
+
# The engagement: how the client is billed and against which contract (SPK, agreement, PO). All optional, so a
|
|
59
|
+
# manpower project that only logs days keeps working as before.
|
|
60
|
+
- name: billing_model
|
|
61
|
+
type: select
|
|
62
|
+
label: {id: Model tagihan}
|
|
63
|
+
default: "'fixed'"
|
|
64
|
+
options:
|
|
65
|
+
- {value: fixed, label: {id: Harga borongan}}
|
|
66
|
+
- {value: milestone, label: {id: Termin}}
|
|
67
|
+
- {value: retainer, label: {id: Retainer bulanan}}
|
|
68
|
+
- {value: time_material, label: {id: Per jam atau hari}}
|
|
69
|
+
- name: contract_kind
|
|
70
|
+
type: select
|
|
71
|
+
label: {id: Jenis kontrak}
|
|
72
|
+
options:
|
|
73
|
+
- {value: spk, label: {id: SPK}}
|
|
74
|
+
- {value: agreement, label: {id: Surat perjanjian}}
|
|
75
|
+
- {value: po, label: {id: PO klien}}
|
|
76
|
+
- {value: receipt, label: {id: Kuitansi}}
|
|
77
|
+
- name: contract_no
|
|
78
|
+
type: data
|
|
79
|
+
label: {id: No. kontrak}
|
|
80
|
+
in_list: true
|
|
81
|
+
- name: contract_date
|
|
82
|
+
type: date
|
|
83
|
+
label: {id: Tanggal kontrak}
|
|
84
|
+
- name: contract_value
|
|
85
|
+
type: currency
|
|
86
|
+
label: {id: Nilai kontrak (DPP)}
|
|
87
|
+
default: '0'
|
|
88
|
+
# The sum of this project's billing milestones, kept by flows when a milestone is created or its amount changes
|
|
89
|
+
# (milestones cannot be deleted by people, so the sum never misses one). Rule schedule_within_contract keeps it at or
|
|
90
|
+
# under the contract value, which refuses a milestone that would overfill the schedule and a contract lowered below it.
|
|
91
|
+
# A retainer's contract value is the monthly fee: each month is checked against it instead (billing_milestone).
|
|
92
|
+
- name: scheduled_amount
|
|
93
|
+
type: currency
|
|
94
|
+
label: {id: Nilai termin terjadwal}
|
|
95
|
+
read_only: true
|
|
96
|
+
default: '0'
|
|
97
|
+
# The DPP of this project's live invoices (retention releases excluded), recomputed from the invoices by flows at each
|
|
98
|
+
# invoice's submit and cancel; rule billing_within_contract refuses the submit that would take it above the contract.
|
|
99
|
+
- name: billed_amount
|
|
100
|
+
type: currency
|
|
101
|
+
label: {id: Nilai tertagih}
|
|
102
|
+
read_only: true
|
|
103
|
+
default: '0'
|
|
104
|
+
# Set only by flow project_terms_lock, inside an edit that changes frozen commercial terms; rule terms_locked refuses it.
|
|
105
|
+
- name: locked_terms
|
|
106
|
+
type: check
|
|
107
|
+
label: {id: Syarat komersial terkunci}
|
|
108
|
+
hidden: true
|
|
109
|
+
default: 'false'
|
|
56
110
|
rules:
|
|
111
|
+
- name: terms_locked
|
|
112
|
+
on: save
|
|
113
|
+
check: "!locked_terms"
|
|
114
|
+
message: {id: 'Nilai kontrak dan model tagihan terkunci: proyek sudah punya termin atau faktur'}
|
|
115
|
+
- name: billing_within_contract
|
|
116
|
+
on: save
|
|
117
|
+
check: billing_model == 'retainer' || contract_value == 0 || billed_amount <= contract_value
|
|
118
|
+
message: {id: Tagihan proyek melebihi nilai kontrak}
|
|
119
|
+
- name: schedule_within_contract
|
|
120
|
+
on: save
|
|
121
|
+
check: billing_model == 'retainer' || contract_value == 0 || scheduled_amount <= contract_value
|
|
122
|
+
message: {id: Jumlah termin melebihi nilai kontrak}
|
|
123
|
+
- name: contract_value_not_negative
|
|
124
|
+
on: save
|
|
125
|
+
check: contract_value >= 0
|
|
126
|
+
message: {id: Nilai kontrak tidak boleh negatif}
|
|
57
127
|
- name: end_after_start
|
|
58
128
|
on: save
|
|
59
129
|
check: start_date == '' || end_date == '' || end_date >= start_date
|
|
@@ -77,5 +147,9 @@ views:
|
|
|
77
147
|
columns:
|
|
78
148
|
- [project_name, customer, customer_order, site]
|
|
79
149
|
- [state, manager, start_date, end_date]
|
|
150
|
+
- section: {id: Kontrak}
|
|
151
|
+
columns:
|
|
152
|
+
- [billing_model, contract_kind, contract_no]
|
|
153
|
+
- [contract_date, contract_value]
|
|
80
154
|
- section: {id: Catatan}
|
|
81
155
|
fields: [notes]
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/model.json
|
|
2
|
+
name: project_expense
|
|
3
|
+
label: {id: Biaya proyek, en: Project expense}
|
|
4
|
+
icon: invoice
|
|
5
|
+
is_submittable: true
|
|
6
|
+
naming: EXP-{YYYY}-{#####}
|
|
7
|
+
title_field: description
|
|
8
|
+
# A cost spent on a project outside a vendor bill (travel, lodging, printing, a freelancer paid in cash), and whether
|
|
9
|
+
# it is billed on to the client. A reimbursable cost needs its receipt. Margin always counts this record at its own
|
|
10
|
+
# full amount. A vendor bill may be linked only when it is submitted and carries no project (so its cost reaches the
|
|
11
|
+
# project through this record); a bill of this project is counted on its own and is never linked here. A linked bill
|
|
12
|
+
# cannot be cancelled while this record is live (flow vendor_bill_cancel_guard), so it cannot come back with the
|
|
13
|
+
# project and be counted twice. On the invoice a re-billed cost is a line marked pph23_exclude (Bukan dasar PPh 23),
|
|
14
|
+
# so PPh 23 is not withheld on it.
|
|
15
|
+
permissions:
|
|
16
|
+
- {role: project_admin, read: true, create: true, write: true, delete: true, submit: true, cancel: true, amend: true, export: true, print: true}
|
|
17
|
+
- {role: finance_manager, read: true, create: true, write: true, submit: true, cancel: true, amend: true, export: true, print: true}
|
|
18
|
+
- {role: sales_manager, read: true}
|
|
19
|
+
# purchasing reads expenses: the guard flow on a vendor bill's cancel looks for expenses linking it, as them
|
|
20
|
+
- {role: purchasing_manager, read: true}
|
|
21
|
+
fields:
|
|
22
|
+
- name: project
|
|
23
|
+
type: link
|
|
24
|
+
to: project
|
|
25
|
+
label: {id: Proyek}
|
|
26
|
+
required: true
|
|
27
|
+
in_list: true
|
|
28
|
+
- name: expense_date
|
|
29
|
+
type: date
|
|
30
|
+
label: {id: Tanggal}
|
|
31
|
+
required: true
|
|
32
|
+
default: today()
|
|
33
|
+
in_list: true
|
|
34
|
+
- name: category
|
|
35
|
+
type: select
|
|
36
|
+
label: {id: Jenis biaya}
|
|
37
|
+
default: "'other'"
|
|
38
|
+
in_list: true
|
|
39
|
+
options:
|
|
40
|
+
- {value: travel, label: {id: Perjalanan}}
|
|
41
|
+
- {value: lodging, label: {id: Penginapan}}
|
|
42
|
+
- {value: printing, label: {id: Cetak dan dokumen}}
|
|
43
|
+
- {value: subcontract, label: {id: Pihak ketiga}}
|
|
44
|
+
- {value: other, label: {id: Lainnya}}
|
|
45
|
+
- name: description
|
|
46
|
+
type: text
|
|
47
|
+
label: {id: Uraian}
|
|
48
|
+
required: true
|
|
49
|
+
- name: vendor
|
|
50
|
+
type: link
|
|
51
|
+
to: vendor
|
|
52
|
+
label: {id: Pemasok}
|
|
53
|
+
- name: vendor_bill
|
|
54
|
+
type: link
|
|
55
|
+
to: vendor_bill
|
|
56
|
+
label: {id: Tagihan pemasok}
|
|
57
|
+
help: {id: 'Tagihan pemasok tanpa proyek yang menjadi bukti biaya ini. Tagihan yang sudah berproyek tidak perlu dicatat sebagai biaya proyek'}
|
|
58
|
+
- name: amount
|
|
59
|
+
type: currency
|
|
60
|
+
label: {id: Biaya}
|
|
61
|
+
in_list: true
|
|
62
|
+
- name: reimbursable
|
|
63
|
+
type: check
|
|
64
|
+
label: {id: Ditagihkan ke klien}
|
|
65
|
+
default: 'false'
|
|
66
|
+
- name: markup_percent
|
|
67
|
+
type: percent
|
|
68
|
+
label: {id: Markup %}
|
|
69
|
+
default: '0'
|
|
70
|
+
depends_on: reimbursable
|
|
71
|
+
- name: rebill_amount
|
|
72
|
+
type: currency
|
|
73
|
+
label: {id: Ditagihkan}
|
|
74
|
+
compute: "reimbursable ? round(amount * (1 + markup_percent / 100)) : 0"
|
|
75
|
+
in_list: true
|
|
76
|
+
- name: receipt
|
|
77
|
+
type: attach
|
|
78
|
+
label: {id: 'Bukti (kuitansi, nota)'}
|
|
79
|
+
- name: rebill_invoice
|
|
80
|
+
type: link
|
|
81
|
+
to: sales_invoice
|
|
82
|
+
label: {id: Faktur penagihan}
|
|
83
|
+
depends_on: reimbursable
|
|
84
|
+
rules:
|
|
85
|
+
- name: amount_positive
|
|
86
|
+
on: save
|
|
87
|
+
check: amount > 0
|
|
88
|
+
message: {id: Biaya harus lebih dari 0}
|
|
89
|
+
- name: markup_range
|
|
90
|
+
on: save
|
|
91
|
+
check: markup_percent >= 0 && markup_percent <= 100
|
|
92
|
+
message: {id: 'Markup harus 0 sampai 100%'}
|
|
93
|
+
- name: receipt_for_rebill
|
|
94
|
+
on: save
|
|
95
|
+
check: "!reimbursable || receipt != ''"
|
|
96
|
+
message: {id: Biaya yang ditagihkan ke klien wajib punya bukti}
|
|
97
|
+
- name: rebill_same_project
|
|
98
|
+
on: save
|
|
99
|
+
check: rebill_invoice == '' || rebill_invoice.project == project
|
|
100
|
+
message: {id: Faktur penagihan harus untuk proyek yang sama}
|
|
101
|
+
- name: bill_same_project
|
|
102
|
+
on: save
|
|
103
|
+
check: vendor_bill == '' || (vendor_bill.project == '' && vendor_bill.docstatus == 1)
|
|
104
|
+
message: {id: 'Tautkan hanya tagihan pemasok yang sudah diajukan dan tanpa proyek (tagihan berproyek dihitung sendiri)'}
|
|
105
|
+
views:
|
|
106
|
+
list:
|
|
107
|
+
columns: [name, project, expense_date, category, amount, rebill_amount, status]
|
|
108
|
+
filters: [project, category, reimbursable]
|
|
109
|
+
sort: -expense_date
|
|
110
|
+
form:
|
|
111
|
+
layout:
|
|
112
|
+
- section: {id: Biaya}
|
|
113
|
+
columns:
|
|
114
|
+
- [project, expense_date, category, description]
|
|
115
|
+
- [amount, vendor, vendor_bill, receipt]
|
|
116
|
+
- section: {id: Tagih ke klien}
|
|
117
|
+
columns:
|
|
118
|
+
- [reimbursable, markup_percent]
|
|
119
|
+
- [rebill_amount, rebill_invoice]
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/model.json
|
|
2
|
+
name: project_guard
|
|
3
|
+
label: {id: Penjaga proyek, en: Project guard}
|
|
4
|
+
icon: check
|
|
5
|
+
naming: GRD-{######}
|
|
6
|
+
title_field: reason
|
|
7
|
+
# Never stored: a flow that must refuse the document it runs in creates one of these with a reason, and the matching
|
|
8
|
+
# rule fails with that reason's message, which rolls the whole save back (the flow runs inside it). Create is granted
|
|
9
|
+
# to the roles whose actions run such a flow.
|
|
10
|
+
permissions:
|
|
11
|
+
- {role: purchasing_manager, create: true}
|
|
12
|
+
- {role: finance_manager, create: true}
|
|
13
|
+
fields:
|
|
14
|
+
- name: reason
|
|
15
|
+
type: select
|
|
16
|
+
label: {id: Alasan}
|
|
17
|
+
required: true
|
|
18
|
+
options:
|
|
19
|
+
- {value: bill_has_expense, label: {id: Tagihan dipakai biaya proyek}}
|
|
20
|
+
- name: document
|
|
21
|
+
type: data
|
|
22
|
+
label: {id: Dokumen}
|
|
23
|
+
rules:
|
|
24
|
+
- name: bill_has_expense
|
|
25
|
+
on: save
|
|
26
|
+
check: reason != 'bill_has_expense'
|
|
27
|
+
message: {id: 'Tagihan ini dipakai biaya proyek yang masih aktif; batalkan biaya proyek itu dulu'}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/model.json
|
|
2
|
+
name: project_ledger
|
|
3
|
+
label: {id: Buku untung proyek, en: Project ledger}
|
|
4
|
+
icon: chart
|
|
5
|
+
naming: PL-{YYYY}-{######}
|
|
6
|
+
title_field: project
|
|
7
|
+
# One signed row per submitted document that changes a project's result: revenue + (invoice dpp, retention releases
|
|
8
|
+
# excluded), costs - (timesheet cost, project expense not on a vendor bill, vendor bill dpp). Cancelling the document
|
|
9
|
+
# writes the opposite row on the document's own date, so the sum per project (and per period) is its margin. Rows are
|
|
10
|
+
# written by flows inside the document's submit or cancel. A flow runs as the person submitting, so those roles hold
|
|
11
|
+
# create, and a rule cannot tell a flow from a person; the rules therefore make every row true to its document:
|
|
12
|
+
# - a post row links its source document, on the same project, submitted, with exactly the document's amount and
|
|
13
|
+
# date; one per document (entry_key = source:post);
|
|
14
|
+
# - a reverse row links the post row it reverses (reverses, unique) for the same document, now cancelled, with the
|
|
15
|
+
# opposite amount; one per post row (entry_key = source:reverse).
|
|
16
|
+
# So each cancelled document has exactly one reversal, and only if it had a post row: a document submitted before
|
|
17
|
+
# this model existed has none, and none can be reversed by hand. The only row a person could add by hand is a true
|
|
18
|
+
# post row for such an old, still submitted document.
|
|
19
|
+
permissions:
|
|
20
|
+
- {role: project_admin, read: true, create: true, export: true}
|
|
21
|
+
- {role: finance_manager, read: true, create: true, export: true}
|
|
22
|
+
- {role: sales_manager, read: true, create: true, export: true}
|
|
23
|
+
- {role: purchasing_manager, read: true, create: true}
|
|
24
|
+
fields:
|
|
25
|
+
- name: project
|
|
26
|
+
type: link
|
|
27
|
+
to: project
|
|
28
|
+
label: {id: Proyek}
|
|
29
|
+
required: true
|
|
30
|
+
in_list: true
|
|
31
|
+
- name: posting_date
|
|
32
|
+
type: date
|
|
33
|
+
label: {id: Tanggal}
|
|
34
|
+
required: true
|
|
35
|
+
in_list: true
|
|
36
|
+
- name: kind
|
|
37
|
+
type: select
|
|
38
|
+
label: {id: Jenis}
|
|
39
|
+
required: true
|
|
40
|
+
in_list: true
|
|
41
|
+
chip: true
|
|
42
|
+
options:
|
|
43
|
+
- {value: revenue, label: {id: Pendapatan}}
|
|
44
|
+
- {value: labor, label: {id: Biaya tenaga kerja}}
|
|
45
|
+
- {value: expense, label: {id: Biaya proyek}}
|
|
46
|
+
- {value: vendor, label: {id: Biaya pemasok}}
|
|
47
|
+
- name: source_model
|
|
48
|
+
type: data
|
|
49
|
+
label: {id: Dokumen}
|
|
50
|
+
required: true
|
|
51
|
+
- name: source_name
|
|
52
|
+
type: data
|
|
53
|
+
label: {id: No. dokumen}
|
|
54
|
+
required: true
|
|
55
|
+
in_list: true
|
|
56
|
+
- name: sales_invoice
|
|
57
|
+
type: link
|
|
58
|
+
to: sales_invoice
|
|
59
|
+
label: {id: Faktur}
|
|
60
|
+
- name: timesheet
|
|
61
|
+
type: link
|
|
62
|
+
to: timesheet
|
|
63
|
+
label: {id: Timesheet}
|
|
64
|
+
- name: project_expense
|
|
65
|
+
type: link
|
|
66
|
+
to: project_expense
|
|
67
|
+
label: {id: Biaya proyek}
|
|
68
|
+
- name: vendor_bill
|
|
69
|
+
type: link
|
|
70
|
+
to: vendor_bill
|
|
71
|
+
label: {id: Tagihan pemasok}
|
|
72
|
+
- name: entry
|
|
73
|
+
type: select
|
|
74
|
+
label: {id: Baris}
|
|
75
|
+
default: "'post'"
|
|
76
|
+
options:
|
|
77
|
+
- {value: post, label: {id: Diajukan}}
|
|
78
|
+
- {value: reverse, label: {id: Pembalik}}
|
|
79
|
+
- name: reverses
|
|
80
|
+
type: link
|
|
81
|
+
to: project_ledger
|
|
82
|
+
label: {id: Membalik baris}
|
|
83
|
+
unique: true
|
|
84
|
+
- name: source_status
|
|
85
|
+
type: int
|
|
86
|
+
label: {id: Status dokumen}
|
|
87
|
+
hidden: true
|
|
88
|
+
compute: "kind == 'revenue' ? sales_invoice.docstatus : (kind == 'labor' ? timesheet.docstatus : (kind == 'expense' ? project_expense.docstatus : vendor_bill.docstatus))"
|
|
89
|
+
- name: source_amount
|
|
90
|
+
type: currency
|
|
91
|
+
label: {id: Nilai dokumen}
|
|
92
|
+
hidden: true
|
|
93
|
+
compute: "kind == 'revenue' ? sales_invoice.dpp : (kind == 'labor' ? 0 - timesheet.cost_amount : (kind == 'expense' ? 0 - project_expense.amount : 0 - vendor_bill.dpp))"
|
|
94
|
+
- name: source_date
|
|
95
|
+
type: date
|
|
96
|
+
label: {id: Tanggal dokumen}
|
|
97
|
+
hidden: true
|
|
98
|
+
compute: "kind == 'revenue' ? sales_invoice.posting_date : (kind == 'labor' ? timesheet.work_date : (kind == 'expense' ? project_expense.expense_date : vendor_bill.bill_date))"
|
|
99
|
+
- name: entry_key
|
|
100
|
+
type: data
|
|
101
|
+
label: {id: Kunci baris}
|
|
102
|
+
hidden: true
|
|
103
|
+
unique: true
|
|
104
|
+
compute: "source_name + ':' + entry"
|
|
105
|
+
- name: amount
|
|
106
|
+
type: currency
|
|
107
|
+
label: {id: 'Nilai (+ pendapatan, - biaya)'}
|
|
108
|
+
in_list: true
|
|
109
|
+
rules:
|
|
110
|
+
- name: source_matches
|
|
111
|
+
on: save
|
|
112
|
+
check: >-
|
|
113
|
+
(kind == 'revenue' && sales_invoice != '' && source_name == sales_invoice && sales_invoice.project == project && sales_invoice.kind != 'retention')
|
|
114
|
+
|| (kind == 'labor' && timesheet != '' && source_name == timesheet && timesheet.project == project)
|
|
115
|
+
|| (kind == 'expense' && project_expense != '' && source_name == project_expense && project_expense.project == project)
|
|
116
|
+
|| (kind == 'vendor' && vendor_bill != '' && source_name == vendor_bill && vendor_bill.project == project)
|
|
117
|
+
message: {id: Baris buku untung proyek harus menunjuk dokumen sumbernya di proyek yang sama}
|
|
118
|
+
- name: post_matches_document
|
|
119
|
+
on: save
|
|
120
|
+
check: entry != 'post' || (reverses == '' && source_status == 1 && amount == source_amount && posting_date == source_date)
|
|
121
|
+
message: {id: Baris diajukan hanya untuk dokumen yang diajukan dengan nilai yang sama}
|
|
122
|
+
- name: reverse_matches_post
|
|
123
|
+
on: save
|
|
124
|
+
check: >-
|
|
125
|
+
entry != 'reverse' || (reverses != '' && source_status == 2 && reverses.entry == 'post' && reverses.source_name == source_name
|
|
126
|
+
&& reverses.kind == kind && reverses.project == project && amount == 0 - reverses.amount && posting_date == reverses.posting_date)
|
|
127
|
+
message: {id: Baris pembalik hanya untuk dokumen yang dibatalkan dan harus menunjuk baris aslinya}
|
|
128
|
+
views:
|
|
129
|
+
list:
|
|
130
|
+
columns: [name, project, posting_date, kind, entry, source_name, amount]
|
|
131
|
+
filters: [project, kind]
|
|
132
|
+
sort: -posting_date
|
|
@@ -54,16 +54,48 @@ fields:
|
|
|
54
54
|
type: currency
|
|
55
55
|
label: {id: Tarif per hari}
|
|
56
56
|
default: assignment.day_rate
|
|
57
|
+
# Per hour when the assignment bills per hour (consultants); per day otherwise, as before.
|
|
58
|
+
- name: rate_basis
|
|
59
|
+
type: select
|
|
60
|
+
label: {id: Satuan tarif}
|
|
61
|
+
default: "assignment != '' ? assignment.rate_basis : 'day'"
|
|
62
|
+
options:
|
|
63
|
+
- {value: day, label: {id: Per hari}}
|
|
64
|
+
- {value: hour, label: {id: Per jam}}
|
|
65
|
+
- name: hour_rate
|
|
66
|
+
type: currency
|
|
67
|
+
label: {id: Tarif per jam}
|
|
68
|
+
default: "assignment != '' ? assignment.hour_rate : worker.hour_rate"
|
|
69
|
+
- name: cost_rate
|
|
70
|
+
type: currency
|
|
71
|
+
label: {id: Biaya per satuan}
|
|
72
|
+
default: "assignment != '' ? assignment.cost_rate : (rate_basis == 'hour' ? worker.cost_hour_rate : worker.cost_day_rate)"
|
|
57
73
|
- name: amount
|
|
58
74
|
type: currency
|
|
59
75
|
label: {id: Jumlah}
|
|
60
|
-
compute: round(days * day_rate)
|
|
76
|
+
compute: "rate_basis == 'hour' ? round(hours * hour_rate) : round(days * day_rate)"
|
|
61
77
|
in_list: true
|
|
78
|
+
- name: cost_amount
|
|
79
|
+
type: currency
|
|
80
|
+
label: {id: Biaya}
|
|
81
|
+
compute: "round((rate_basis == 'hour' ? hours : days) * cost_rate)"
|
|
82
|
+
- name: billable_amount
|
|
83
|
+
type: currency
|
|
84
|
+
label: {id: Jumlah dapat ditagih}
|
|
85
|
+
compute: "billable ? amount : 0"
|
|
62
86
|
rules:
|
|
63
87
|
- name: days_range
|
|
64
88
|
on: save
|
|
65
|
-
check: days > 0 && days <= 1.5
|
|
89
|
+
check: rate_basis == 'hour' || (days > 0 && days <= 1.5)
|
|
66
90
|
message: {id: 'Hari kerja harus lebih dari 0 dan paling banyak 1,5'}
|
|
91
|
+
- name: hour_rate_for_billable_hours
|
|
92
|
+
on: save
|
|
93
|
+
check: rate_basis != 'hour' || !billable || hour_rate > 0
|
|
94
|
+
message: {id: 'Timesheet per jam yang ditagih butuh tarif per jam (isi di tenaga kerja atau penugasan)'}
|
|
95
|
+
- name: hours_range
|
|
96
|
+
on: save
|
|
97
|
+
check: rate_basis != 'hour' || (hours > 0 && hours <= 24)
|
|
98
|
+
message: {id: 'Jam kerja harus lebih dari 0 dan paling banyak 24'}
|
|
67
99
|
views:
|
|
68
100
|
list:
|
|
69
101
|
columns: [name, project, worker, work_date, days, status, amount]
|
|
@@ -79,4 +111,7 @@ views:
|
|
|
79
111
|
- [description, evidence]
|
|
80
112
|
- section: {id: Tagihan}
|
|
81
113
|
columns:
|
|
82
|
-
- [billable, day_rate, amount]
|
|
114
|
+
- [billable, rate_basis, day_rate, hour_rate, amount]
|
|
115
|
+
- section: {id: Biaya internal}
|
|
116
|
+
columns:
|
|
117
|
+
- [cost_rate, cost_amount]
|