@rangka-os/create 0.5.0-alpha.5 → 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/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 +2 -1
- 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/worker.rk +22 -1
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/flow.json
|
|
2
|
+
name: project_terms_lock
|
|
3
|
+
label: {id: Syarat komersial proyek terkunci}
|
|
4
|
+
# Inside a person's edit of a project that changes its contract value or billing model: refused (locked_terms + rule
|
|
5
|
+
# terms_locked) once the project has a submitted invoice or any billing milestone, read from the documents themselves
|
|
6
|
+
# so data from before this flow existed is covered too. Contract 0 stays "no limit" for projects billed without a
|
|
7
|
+
# contract value, but cannot be reached after the fact.
|
|
8
|
+
on: project.updated
|
|
9
|
+
if: event.contract_value != event.before.contract_value || event.billing_model != event.before.billing_model
|
|
10
|
+
steps:
|
|
11
|
+
- find_all: sales_invoice
|
|
12
|
+
where: project == event.name && docstatus == 1
|
|
13
|
+
limit: 1
|
|
14
|
+
as: invs
|
|
15
|
+
- find_all: billing_milestone
|
|
16
|
+
where: project == event.name
|
|
17
|
+
limit: 1
|
|
18
|
+
as: ms
|
|
19
|
+
- if: size(invs) > 0 || size(ms) > 0
|
|
20
|
+
find: project
|
|
21
|
+
where: name == event.name
|
|
22
|
+
as: prj
|
|
23
|
+
- if: size(invs) > 0 || size(ms) > 0
|
|
24
|
+
update: prj
|
|
25
|
+
set:
|
|
26
|
+
locked_terms: 'true'
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/flow.json
|
|
2
|
+
name: vendor_bill_cancel_guard
|
|
3
|
+
label: {id: Tagihan dipakai biaya proyek tidak bisa dibatalkan}
|
|
4
|
+
# Inside a vendor bill's cancel: when a live project expense links this bill, the cancel is refused (project_guard),
|
|
5
|
+
# so the bill cannot be amended with the project and counted again next to the expense.
|
|
6
|
+
on: vendor_bill.cancelled
|
|
7
|
+
steps:
|
|
8
|
+
- find: project_expense
|
|
9
|
+
where: vendor_bill == event.name && docstatus == 1
|
|
10
|
+
as: ex
|
|
11
|
+
- if: ex != null
|
|
12
|
+
create: project_guard
|
|
13
|
+
set:
|
|
14
|
+
reason: "'bill_has_expense'"
|
|
15
|
+
document: ex.name
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/import.json
|
|
2
|
+
# A project's billing schedule from a sheet: twelve monthly retainers or the milestones of an SPK in one upload.
|
|
3
|
+
# Proyek is the project number (PRJ-...). One row = one milestone; the same row twice is skipped by the key.
|
|
4
|
+
name: billing_milestone
|
|
5
|
+
label: {id: Jadwal termin tagihan, en: Billing schedule}
|
|
6
|
+
model: billing_milestone
|
|
7
|
+
source: csv
|
|
8
|
+
header_row: 1
|
|
9
|
+
key: [Proyek, Urutan]
|
|
10
|
+
map:
|
|
11
|
+
project: Proyek
|
|
12
|
+
seq: Urutan
|
|
13
|
+
title: Judul
|
|
14
|
+
kind: Jenis
|
|
15
|
+
basis: "='amount'"
|
|
16
|
+
amount_fixed: Nominal
|
|
17
|
+
trigger: "='date'"
|
|
18
|
+
due_date: Jatuh tempo
|
|
19
|
+
period_from: Periode dari
|
|
20
|
+
period_to: Periode sampai
|
|
@@ -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'}
|