@rangka-os/create 0.0.0-stage → 0.5.0-alpha.3

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.
Files changed (122) hide show
  1. package/index.js +101 -0
  2. package/package.json +29 -4
  3. package/template/base/README.md +32 -0
  4. package/template/base/_gitignore +3 -0
  5. package/template/base/_vscode/settings.json +4 -0
  6. package/template/base/apps/crm/app.rk +42 -0
  7. package/template/base/apps/crm/dashboards/crm_overview.rk +88 -0
  8. package/template/base/apps/crm/dashboards/sales_overview.rk +66 -0
  9. package/template/base/apps/fnb_cabang/app.rk +41 -0
  10. package/template/base/apps/fnb_cabang/dashboards/fnb_overview.rk +80 -0
  11. package/template/base/apps/fnb_cabang/dashboards/stock_recap.rk +129 -0
  12. package/template/base/apps/jasa_proyek/app.rk +49 -0
  13. package/template/base/apps/jasa_proyek/dashboards/ar_aging.rk +88 -0
  14. package/template/base/apps/jasa_proyek/dashboards/jasa_overview.rk +121 -0
  15. package/template/base/connectors/whatsapp_business/connector.rk +68 -0
  16. package/template/base/docker-compose.yml +16 -0
  17. package/template/base/env.example +12 -0
  18. package/template/base/modules/catalogue/models/item.rk +60 -0
  19. package/template/base/modules/catalogue/models/price_list.rk +34 -0
  20. package/template/base/modules/catalogue/models/price_list_item.rk +21 -0
  21. package/template/base/modules/catalogue/models/uom.rk +20 -0
  22. package/template/base/modules/catalogue/models/uom_conversion.rk +36 -0
  23. package/template/base/modules/catalogue/module.rk +5 -0
  24. package/template/base/modules/contacts/models/contact_person.rk +21 -0
  25. package/template/base/modules/contacts/models/customer.rk +72 -0
  26. package/template/base/modules/contacts/models/vendor.rk +71 -0
  27. package/template/base/modules/contacts/module.rk +5 -0
  28. package/template/base/modules/currency/models/currency.rk +34 -0
  29. package/template/base/modules/currency/models/exchange_rate.rk +39 -0
  30. package/template/base/modules/currency/module.rk +5 -0
  31. package/template/base/modules/invoicing/models/sales_invoice.rk +290 -0
  32. package/template/base/modules/invoicing/models/sales_invoice_item.rk +37 -0
  33. package/template/base/modules/invoicing/module.rk +9 -0
  34. package/template/base/modules/invoicing/print/sales_invoice.html +63 -0
  35. package/template/base/modules/invoicing/print/sales_invoice.rk +7 -0
  36. package/template/base/modules/orders/models/customer_order.rk +100 -0
  37. package/template/base/modules/orders/models/customer_order_item.rk +30 -0
  38. package/template/base/modules/orders/module.rk +9 -0
  39. package/template/base/modules/outlet_sales/imports/daily_form.rk +20 -0
  40. package/template/base/modules/outlet_sales/imports/moka_item_details.rk +24 -0
  41. package/template/base/modules/outlet_sales/models/outlet_sales.rk +106 -0
  42. package/template/base/modules/outlet_sales/models/outlet_sales_line.rk +39 -0
  43. package/template/base/modules/outlet_sales/module.rk +7 -0
  44. package/template/base/modules/outlets/models/outlet.rk +39 -0
  45. package/template/base/modules/outlets/module.rk +5 -0
  46. package/template/base/modules/payments/models/payment.rk +154 -0
  47. package/template/base/modules/payments/models/payment_allocation.rk +35 -0
  48. package/template/base/modules/payments/models/withholding.rk +62 -0
  49. package/template/base/modules/payments/module.rk +8 -0
  50. package/template/base/modules/payments/print/statement.html +55 -0
  51. package/template/base/modules/payments/print/statement.rk +13 -0
  52. package/template/base/modules/pipeline/flows/morning_follow_up.rk +10 -0
  53. package/template/base/modules/pipeline/flows/whatsapp_to_lead.rk +24 -0
  54. package/template/base/modules/pipeline/models/activity.rk +83 -0
  55. package/template/base/modules/pipeline/models/deal.rk +139 -0
  56. package/template/base/modules/pipeline/models/lead.rk +119 -0
  57. package/template/base/modules/pipeline/module.rk +7 -0
  58. package/template/base/modules/procurement/models/goods_receipt.rk +85 -0
  59. package/template/base/modules/procurement/models/goods_receipt_item.rk +42 -0
  60. package/template/base/modules/procurement/models/purchase_order.rk +148 -0
  61. package/template/base/modules/procurement/models/purchase_order_item.rk +46 -0
  62. package/template/base/modules/procurement/models/purchase_request.rk +81 -0
  63. package/template/base/modules/procurement/models/purchase_request_item.rk +35 -0
  64. package/template/base/modules/procurement/models/vendor_bill.rk +166 -0
  65. package/template/base/modules/procurement/models/vendor_bill_item.rk +33 -0
  66. package/template/base/modules/procurement/module.rk +9 -0
  67. package/template/base/modules/procurement/print/purchase_order.html +120 -0
  68. package/template/base/modules/procurement/print/purchase_order.rk +7 -0
  69. package/template/base/modules/projects/models/acceptance.rk +68 -0
  70. package/template/base/modules/projects/models/assignment.rk +63 -0
  71. package/template/base/modules/projects/models/project.rk +81 -0
  72. package/template/base/modules/projects/models/timesheet.rk +82 -0
  73. package/template/base/modules/projects/module.rk +6 -0
  74. package/template/base/modules/quotation/models/quotation.rk +201 -0
  75. package/template/base/modules/quotation/models/quotation_item.rk +37 -0
  76. package/template/base/modules/quotation/module.rk +9 -0
  77. package/template/base/modules/quotation/print/quotation.html +65 -0
  78. package/template/base/modules/quotation/print/quotation.rk +7 -0
  79. package/template/base/modules/stock/flows/stock_negative_alert.rk +15 -0
  80. package/template/base/modules/stock/models/recipe.rk +60 -0
  81. package/template/base/modules/stock/models/recipe_line.rk +24 -0
  82. package/template/base/modules/stock/models/stock_adjustment.rk +61 -0
  83. package/template/base/modules/stock/models/stock_adjustment_item.rk +32 -0
  84. package/template/base/modules/stock/models/stock_balance.rk +23 -0
  85. package/template/base/modules/stock/models/stock_count.rk +54 -0
  86. package/template/base/modules/stock/models/stock_count_item.rk +33 -0
  87. package/template/base/modules/stock/models/stock_move.rk +41 -0
  88. package/template/base/modules/stock/models/stock_transfer.rk +70 -0
  89. package/template/base/modules/stock/models/stock_transfer_item.rk +34 -0
  90. package/template/base/modules/stock/models/stock_transfer_receipt.rk +57 -0
  91. package/template/base/modules/stock/models/stock_transfer_receipt_item.rk +18 -0
  92. package/template/base/modules/stock/module.rk +8 -0
  93. package/template/base/modules/tax_id/models/tax_code.rk +49 -0
  94. package/template/base/modules/tax_id/module.rk +5 -0
  95. package/template/base/modules/users/models/user.rk +27 -0
  96. package/template/base/modules/users/module.rk +5 -0
  97. package/template/base/modules/users/roles/finance_manager.rk +4 -0
  98. package/template/base/modules/users/roles/head_office.rk +4 -0
  99. package/template/base/modules/users/roles/outlet_staff.rk +6 -0
  100. package/template/base/modules/users/roles/project_admin.rk +4 -0
  101. package/template/base/modules/users/roles/purchasing_manager.rk +4 -0
  102. package/template/base/modules/users/roles/sales_manager.rk +4 -0
  103. package/template/base/modules/users/roles/sales_rep.rk +4 -0
  104. package/template/base/modules/workforce/models/certification.rk +26 -0
  105. package/template/base/modules/workforce/models/worker.rk +53 -0
  106. package/template/base/modules/workforce/module.rk +5 -0
  107. package/template/base/package.json +17 -0
  108. package/template/blank/fixtures/start.rk +5 -0
  109. package/template/blank/site/config.rk +13 -0
  110. package/template/blank/site/custom/README.md +2 -0
  111. package/template/blank/site/features.rk +13 -0
  112. package/template/blank/site/layouts/main.rk +14 -0
  113. package/template/blank/site/system.rk +20 -0
  114. package/template/blank/site/themes/main.rk +8 -0
  115. package/template/demo/fixtures/crm_demo.rk +168 -0
  116. package/template/demo/fixtures/demo.rk +417 -0
  117. package/template/demo/site/config.rk +13 -0
  118. package/template/demo/site/features.rk +13 -0
  119. package/template/demo/site/layouts/crm_first.rk +23 -0
  120. package/template/demo/site/system.rk +26 -0
  121. package/template/demo/site/themes/kopi_senja.rk +10 -0
  122. package/README.md +0 -3
@@ -0,0 +1,166 @@
1
+ # yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/model.json
2
+ name: vendor_bill
3
+ label: {id: Tagihan pemasok, en: Vendor bill}
4
+ icon: invoice
5
+ is_submittable: true
6
+ naming: BILL-{YYYY}-{#####}
7
+ title_field: bill_no
8
+ on_submit: [procurement.post_payable]
9
+ on_cancel: [procurement.reverse_payable]
10
+ permissions:
11
+ - {role: purchasing_manager, read: true, create: true, write: true, delete: true, submit: true, cancel: true, amend: true, export: true, print: true}
12
+ - {role: finance_manager, read: true, submit: true, print: true}
13
+ - {role: head_office, read: true, create: true, write: true, delete: true, submit: true, cancel: true, amend: true, export: true, print: true}
14
+ fields:
15
+ - name: vendor
16
+ type: link
17
+ to: vendor
18
+ label: {id: Pemasok}
19
+ required: true
20
+ in_list: true
21
+ peek: [outstanding, payment_days, npwp]
22
+ - name: purchase_order
23
+ type: link
24
+ to: purchase_order
25
+ label: {id: Pesanan pembelian}
26
+ - name: goods_receipt
27
+ type: link
28
+ to: goods_receipt
29
+ label: {id: Penerimaan barang}
30
+ - name: bill_no
31
+ type: data
32
+ label: {id: No. faktur pemasok}
33
+ required: true
34
+ in_list: true
35
+ - name: bill_date
36
+ type: date
37
+ label: {id: Tanggal faktur}
38
+ required: true
39
+ in_list: true
40
+ - name: due_date
41
+ type: date
42
+ label: {id: Jatuh tempo}
43
+ default: bill_date + duration(vendor.payment_days)
44
+ relative_to: bill_date
45
+ in_list: true
46
+ - name: items
47
+ type: table
48
+ of: vendor_bill_item
49
+ label: {id: Barang/jasa}
50
+ min_rows: 1
51
+ - name: subtotal
52
+ type: currency
53
+ label: {id: Subtotal}
54
+ # Foreign-currency document (currency is not IDR): the rupiah subtotal is the IDR twin of subtotal_fx (contract 0013),
55
+ # so dpp, PPN (assessed in rupiah), grand_total, retention, PPh 23 and amount_due stay IDR computes from it.
56
+ # Lines are entered with rate_fx; the IDR line `amount` (qty x rate) cannot see the parent's currency, so the header ignores it.
57
+ compute: "currency != '' && currency != 'IDR' ? subtotal_fx_idr : items.map(i, i.amount).sum()"
58
+ - name: dpp
59
+ type: currency
60
+ label: {id: DPP}
61
+ compute: subtotal
62
+ - name: tax_rate
63
+ type: percent
64
+ label: {id: Tarif PPN}
65
+ help: {id: 'Dari pesanan pembelian bila ada, bila tidak dari config tax.ppn_rate; 0 bila pemasok bukan PKP. Tersimpan di dokumen.'}
66
+ default: "purchase_order != '' ? purchase_order.tax_rate : (vendor.pkp ? tax.ppn_rate : 0)"
67
+ # Not read_only: a generic amend zeroes read-only fields, and a zero dpp_den would break ppn (kernel follow-up).
68
+ - {name: dpp_num, type: int, label: {id: DPP nilai lain (pembilang)}, default: "purchase_order != '' ? purchase_order.dpp_num : tax.dpp_num"}
69
+ - {name: dpp_den, type: int, label: {id: DPP nilai lain (penyebut)}, default: "purchase_order != '' ? purchase_order.dpp_den : tax.dpp_den"}
70
+ - name: ppn
71
+ type: currency
72
+ label: {id: PPN (DPP x rasio DPP nilai lain x tarif)}
73
+ compute: "round(dpp * dpp_num / dpp_den * tax_rate / 100)"
74
+ - name: grand_total
75
+ type: currency
76
+ label: {id: Total}
77
+ compute: dpp + ppn
78
+ in_list: true
79
+ - name: pph23_amount
80
+ type: currency
81
+ label: {id: PPh 23 yang kami potong}
82
+ help: {id: 'Dipotong dari pembayaran ke pemasok jasa; bukti potong kami terbitkan'}
83
+ default: '0'
84
+ - name: amount_due
85
+ type: currency
86
+ label: {id: Tagihan bersih}
87
+ compute: grand_total - pph23_amount
88
+ in_list: true
89
+ - name: paid_amount
90
+ type: currency
91
+ label: {id: Sudah dibayar}
92
+ read_only: true
93
+ - name: outstanding
94
+ type: currency
95
+ label: {id: Sisa tagihan}
96
+ compute: amount_due - paid_amount
97
+ in_list: true
98
+ - name: notes
99
+ type: text
100
+ label: {id: Catatan}
101
+ - {name: currency, type: data, label: {id: Mata uang}, default: "'IDR'"}
102
+ - {name: exchange_rate, type: float, label: {id: Kurs}, default: '1'} # IDR per 1 unit of the foreign currency
103
+ - {name: subtotal_fx, type: money, currency_field: currency, rate_field: exchange_rate, label: {id: Subtotal (valas)}, compute: "sum(items.map(i, i.amount_fx))"}
104
+ - {name: dpp_fx, type: money, currency_field: currency, rate_field: exchange_rate, label: {id: DPP (valas)}, compute: "subtotal_fx"}
105
+ - {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)"}
106
+ - {name: grand_total_fx, type: money, currency_field: currency, rate_field: exchange_rate, label: {id: Total (valas)}, compute: "dpp_fx + ppn_fx"}
107
+ - {name: amount_due_fx, type: money, currency_field: currency, rate_field: exchange_rate, label: {id: Tagihan bersih (valas)}, compute: "currency != '' && currency != 'IDR' ? round(grand_total_fx - pph23_amount / exchange_rate, 2) : 0"} # pph23_amount is entered in rupiah only
108
+ rules:
109
+ - name: foreign_needs_rate
110
+ on: save
111
+ check: currency == '' || currency == 'IDR' || exchange_rate > 1
112
+ message: {id: Dokumen valas wajib diisi kursnya (rupiah per 1 unit mata uang asing)}
113
+ - name: po_same_vendor
114
+ on: save
115
+ check: purchase_order == '' || purchase_order.vendor == vendor
116
+ message: {id: Pesanan pembelian harus dari pemasok yang sama}
117
+ - name: receipt_same_vendor
118
+ on: save
119
+ check: goods_receipt == '' || goods_receipt.vendor == vendor
120
+ message: {id: Penerimaan barang harus dari pemasok yang sama}
121
+ - name: tax_valid
122
+ on: save
123
+ check: dpp_den > 0 && dpp_num > 0 && dpp_num <= dpp_den && tax_rate >= 0 && tax_rate <= 100
124
+ message: {id: Tarif PPN atau faktor DPP tidak valid}
125
+ - name: ppn_needs_pkp
126
+ on: save
127
+ check: "tax_rate == 0 || (purchase_order != '' ? purchase_order.tax_rate > 0 : vendor.pkp)"
128
+ message: {id: Pemasok bukan PKP (atau PO tanpa PPN) tidak boleh dikenai PPN (tarif PPN harus 0)}
129
+ - name: due_after_bill
130
+ on: save
131
+ check: due_date == '' || due_date >= bill_date
132
+ message: {id: Jatuh tempo tidak boleh sebelum tanggal faktur}
133
+ - name: pph23_within_total
134
+ on: save
135
+ check: pph23_amount >= 0 && pph23_amount <= grand_total
136
+ message: {id: PPh 23 tidak boleh negatif atau melebihi total}
137
+ - name: qty_positive
138
+ on: save
139
+ check: "items.map(i, i.qty <= 0 ? 1 : 0).sum() == 0"
140
+ message: {id: Jumlah barang harus lebih dari 0}
141
+ - name: rate_not_negative
142
+ on: save
143
+ check: "items.map(i, i.rate < 0 || i.rate_fx < 0 ? 1 : 0).sum() == 0"
144
+ message: {id: Harga tidak boleh negatif}
145
+ views:
146
+ list:
147
+ columns: [name, vendor, bill_no, bill_date, due_date, status, amount_due, outstanding]
148
+ sort: -bill_date
149
+ form:
150
+ layout:
151
+ - section: {id: Pemasok}
152
+ columns:
153
+ - [vendor, bill_no, purchase_order, goods_receipt]
154
+ - [bill_date, due_date]
155
+ - section: {id: Barang/jasa}
156
+ fields: [items]
157
+ - section: {id: Pajak & potongan}
158
+ columns:
159
+ - [subtotal, dpp, tax_rate, dpp_num, dpp_den, ppn, grand_total]
160
+ - [pph23_amount, amount_due, paid_amount, outstanding]
161
+ - section: {id: Catatan}
162
+ fields: [notes]
163
+ - section: {id: Mata uang asing}
164
+ columns:
165
+ - [currency, exchange_rate, subtotal_fx]
166
+ - [grand_total_fx, amount_due_fx]
@@ -0,0 +1,33 @@
1
+ # yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/model.json
2
+ name: vendor_bill_item
3
+ is_child: true
4
+ fields:
5
+ - name: item
6
+ type: link
7
+ to: item
8
+ label: {id: Barang/jasa}
9
+ required: true
10
+ - name: description
11
+ type: text
12
+ label: {id: Uraian}
13
+ default: item.item_name
14
+ - name: qty
15
+ type: float
16
+ label: {id: Qty}
17
+ default: '1'
18
+ - name: uom
19
+ type: link
20
+ to: uom
21
+ label: {id: Satuan}
22
+ default: item.stock_uom
23
+ - name: rate
24
+ type: currency
25
+ label: {id: Harga satuan}
26
+ required: true
27
+ - name: amount
28
+ type: currency
29
+ label: {id: Jumlah}
30
+ compute: round(qty * rate)
31
+
32
+ - {name: rate_fx, type: money, currency_field: currency, rate_field: exchange_rate, label: {id: Harga (valas)}, default: '0'}
33
+ - {name: amount_fx, type: money, currency_field: currency, rate_field: exchange_rate, label: {id: Jumlah (valas)}, compute: "round(qty * rate_fx, 2)"}
@@ -0,0 +1,9 @@
1
+ # yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/module.json
2
+ name: procurement
3
+ version: 1.0.0
4
+ title: {id: Pembelian, en: Procurement}
5
+ requires: {rangka: '>=0.5', users: ^1.0, contacts: ^1.0, catalogue: ^1.0}
6
+ optional: {outlets: ^1.0, currency: ^1.0, stock: ^1.0}
7
+ # Semantics fixed in docs/kernel-hooks.md (section procurement). stock.post_moves is a core hook (goods_receipt.on_submit);
8
+ # stock.reverse_moves (goods_receipt.on_cancel) is declared here too, since stock is optional for procurement (a no-op without it).
9
+ hooks: [procurement.make_po, procurement.receive, procurement.post_payable, procurement.reverse_payable, stock.reverse_moves]
@@ -0,0 +1,120 @@
1
+ {{/* Pesanan pembelian (purchase order). Reference layout, contract 0008 §6; "Kirim ke" reads the outlet link. */}}
2
+ {{define "style"}}
3
+ .doc-title{font-size:15pt;margin:0 0 4mm}
4
+ .fields{width:auto;margin-bottom:5mm}
5
+ .fields th,.fields td{border:0;padding:.4mm 4mm .4mm 0}
6
+ .fields th{font-weight:400;color:#57534E;white-space:nowrap}
7
+ .parties{display:flex;gap:10mm;margin-bottom:5mm}
8
+ .parties>div{flex:1}
9
+ .parties .name{font-weight:600}
10
+ .pre{white-space:pre-line}
11
+ .items{margin:3mm 0}
12
+ .items thead th{border-bottom:1px solid #1C1917}
13
+ .items .no{width:9mm}
14
+ .items tr,.totals tr{break-inside:avoid}
15
+ .totals{width:95mm;margin-left:auto}
16
+ .totals th{font-weight:400}
17
+ .totals .grand th,.totals .grand td{font-weight:600;border-top:1px solid #1C1917;border-bottom:0}
18
+ .terbilang{margin:3mm 0 4mm}
19
+ .note{margin:0 0 2mm}
20
+ .approval{margin-top:8mm;width:60mm;break-inside:avoid}
21
+ .approval .space{height:18mm}
22
+ {{end}}
23
+ {{template "letterhead" .}}
24
+ {{$fx := and .Doc.currency (ne .Doc.currency "IDR")}}
25
+ <h1 class="doc-title">Pesanan pembelian</h1>
26
+ <table class="fields">
27
+ <tr><th>Nomor</th><td>{{.Doc.name}}</td></tr>
28
+ <tr><th>Tanggal</th><td>{{date .Doc.order_date}}</td></tr>
29
+ {{- with .Doc.delivery_date}}
30
+ <tr><th>Tanggal kirim</th><td>{{date .}}</td></tr>
31
+ {{- end}}
32
+ {{- with .Doc.payment_terms}}
33
+ <tr><th>Syarat pembayaran</th><td>{{.}}</td></tr>
34
+ {{- end}}
35
+ </table>
36
+
37
+ <div class="parties">
38
+ <div>
39
+ <div class="muted">Kepada (pemasok)</div>
40
+ {{- with .Links.vendor}}
41
+ <div class="name">{{.vendor_name}}</div>
42
+ {{- with .address}}
43
+ <div class="pre">{{.}}</div>
44
+ {{- end}}
45
+ {{- with .npwp}}
46
+ <div>NPWP {{.}}</div>
47
+ {{- end}}
48
+ {{- else}}
49
+ <div class="name">{{.Doc.vendor}}</div>
50
+ {{- end}}
51
+ </div>
52
+ <div>
53
+ <div class="muted">Kirim ke</div>
54
+ {{- with .Links.outlet}}
55
+ <div class="name">{{.outlet_name}}</div>
56
+ {{- with .address}}
57
+ <div class="pre">{{.}}</div>
58
+ {{- end}}
59
+ {{- else}}
60
+ <div class="pre">{{.Letterhead.address}}</div>
61
+ {{- end}}
62
+ </div>
63
+ </div>
64
+
65
+ <p>Mohon dikirimkan barang berikut sesuai harga dan syarat di bawah ini:</p>
66
+
67
+ <table class="items">
68
+ <thead>
69
+ <tr><th class="no">No</th><th>Uraian</th><th class="num">Qty</th><th>Satuan</th><th class="num">Harga satuan</th><th class="num">Jumlah</th></tr>
70
+ </thead>
71
+ <tbody>
72
+ {{- range $i, $row := .Doc.items}}
73
+ <tr>
74
+ <td>{{sub $i -1}}</td>
75
+ <td class="pre">{{or $row.description $row.item}}</td>
76
+ <td class="num">{{number $row.qty}}</td>
77
+ <td>{{$row.uom}}</td>
78
+ <td class="num">{{if $fx}}{{money $row.rate_fx $.Doc.currency}}{{else}}{{rupiah $row.rate}}{{end}}</td>
79
+ <td class="num">{{if $fx}}{{money $row.amount_fx $.Doc.currency}}{{else}}{{rupiah $row.amount}}{{end}}</td>
80
+ </tr>
81
+ {{- end}}
82
+ </tbody>
83
+ </table>
84
+
85
+ {{- if $fx}}
86
+ <table class="totals">
87
+ <tr><th>Subtotal</th><td class="num">{{money .Doc.subtotal_fx .Doc.currency}}</td></tr>
88
+ {{- if taxrate .Doc .Tax}}
89
+ <tr><th>PPN {{number (taxrate .Doc .Tax)}}%</th><td class="num">{{money .Doc.ppn_fx .Doc.currency}}</td></tr>
90
+ {{- end}}
91
+ <tr class="grand"><th>Total</th><td class="num">{{money .Doc.grand_total_fx .Doc.currency}}</td></tr>
92
+ </table>
93
+ <p class="note">Kurs: 1 {{.Doc.currency}} = {{rupiah .Doc.exchange_rate}}. Setara rupiah (PPN dihitung dalam rupiah):</p>
94
+ {{- end}}
95
+ <table class="totals">
96
+ <tr><th>Subtotal</th><td class="num">{{rupiah .Doc.subtotal}}</td></tr>
97
+ {{- if taxrate .Doc .Tax}}
98
+ <tr><th>DPP</th><td class="num">{{rupiah .Doc.dpp}}</td></tr>
99
+ <tr><th>PPN {{number (taxrate .Doc .Tax)}}% (DPP nilai lain {{.Doc.dpp_num}}/{{.Doc.dpp_den}})</th><td class="num">{{rupiah .Doc.ppn}}</td></tr>
100
+ {{- end}}
101
+ <tr class="grand"><th>Total</th><td class="num">{{rupiah .Doc.grand_total}}</td></tr>
102
+ </table>
103
+ <p class="terbilang"><em>Terbilang: {{terbilang .Doc.grand_total}}</em></p>
104
+ {{- with .Doc.notes}}
105
+ <p class="note pre">{{.}}</p>
106
+ {{- end}}
107
+ <p class="note">Mohon cantumkan nomor pesanan ini pada surat jalan dan faktur.</p>
108
+
109
+ <div class="approval">
110
+ <div>Disetujui oleh,</div>
111
+ <div class="space"></div>
112
+ {{- with .Letterhead.signatory}}
113
+ <div>{{.name}}</div>
114
+ {{- with .title}}
115
+ <div class="muted">{{.}}</div>
116
+ {{- end}}
117
+ {{- else}}
118
+ <div>{{.Letterhead.legal_name}}</div>
119
+ {{- end}}
120
+ </div>
@@ -0,0 +1,7 @@
1
+ # yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/print.json
2
+ name: purchase_order
3
+ model: purchase_order
4
+ label: {id: Pesanan pembelian, en: Purchase order}
5
+ paper: A4
6
+ template: purchase_order.html
7
+ default: true
@@ -0,0 +1,68 @@
1
+ # yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/model.json
2
+ name: acceptance
3
+ label: {id: Berita acara, en: Acceptance report}
4
+ icon: check
5
+ is_submittable: true
6
+ naming: BA-{YYYY}-{####}
7
+ title_field: project
8
+ permissions:
9
+ - {role: project_admin, read: true, create: true, write: true, delete: true, submit: true, cancel: true, amend: true, export: true, print: true}
10
+ - {role: sales_manager, read: true}
11
+ - {role: finance_manager, read: true}
12
+ fields:
13
+ - name: project
14
+ type: link
15
+ to: project
16
+ label: {id: Proyek}
17
+ required: true
18
+ in_list: true
19
+ - name: customer_order
20
+ type: link
21
+ to: customer_order
22
+ label: {id: Pesanan pelanggan}
23
+ - name: accepted_on
24
+ type: date
25
+ label: {id: Tanggal serah terima}
26
+ required: true
27
+ in_list: true
28
+ - name: accepted_by
29
+ type: data
30
+ label: {id: Diterima oleh (PIC pelanggan)}
31
+ required: true
32
+ - name: period_from
33
+ type: date
34
+ label: {id: Periode dari}
35
+ - name: period_to
36
+ type: date
37
+ label: {id: Periode sampai}
38
+ - name: scope
39
+ type: text
40
+ label: {id: Lingkup pekerjaan yang diterima}
41
+ required: true
42
+ - name: amount
43
+ type: currency
44
+ label: {id: Nilai pekerjaan}
45
+ in_list: true
46
+ - name: document
47
+ type: attach
48
+ label: {id: Dokumen BA bertanda tangan}
49
+ rules:
50
+ - name: period_order
51
+ on: save
52
+ check: period_from == '' || period_to == '' || period_to >= period_from
53
+ message: {id: Periode selesai tidak boleh sebelum periode mulai}
54
+ views:
55
+ list:
56
+ columns: [name, project, accepted_on, accepted_by, status, amount]
57
+ sort: -accepted_on
58
+ form:
59
+ layout:
60
+ - section: {id: Serah terima}
61
+ columns:
62
+ - [project, customer_order, accepted_on]
63
+ - [accepted_by, period_from, period_to]
64
+ - section: {id: Lingkup}
65
+ fields: [scope]
66
+ - section: {id: Nilai}
67
+ columns:
68
+ - [amount, document]
@@ -0,0 +1,63 @@
1
+ # yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/model.json
2
+ name: assignment
3
+ label: {id: Penugasan, en: Assignment}
4
+ icon: user
5
+ naming: ASG-{#####}
6
+ title_field: worker
7
+ permissions:
8
+ - {role: project_admin, read: true, create: true, write: true, delete: true, submit: true, cancel: true, amend: true, export: true, print: true}
9
+ - {role: sales_manager, read: true}
10
+ - {role: finance_manager, read: true}
11
+ fields:
12
+ - name: project
13
+ type: link
14
+ to: project
15
+ label: {id: Proyek}
16
+ required: true
17
+ in_list: true
18
+ - name: worker
19
+ type: link
20
+ to: worker
21
+ label: {id: Tenaga kerja}
22
+ required: true
23
+ in_list: true
24
+ peek: [role_title, day_rate]
25
+ - name: site
26
+ type: data
27
+ label: {id: Lokasi}
28
+ default: project.site
29
+ - name: start_date
30
+ type: date
31
+ label: {id: Mulai}
32
+ required: true
33
+ in_list: true
34
+ - name: end_date
35
+ type: date
36
+ label: {id: Selesai}
37
+ required: true
38
+ in_list: true
39
+ - name: day_rate
40
+ type: currency
41
+ label: {id: Tarif per hari}
42
+ default: worker.day_rate
43
+ in_list: true
44
+ - name: notes
45
+ type: text
46
+ label: {id: Catatan}
47
+ rules:
48
+ - name: end_after_start
49
+ on: save
50
+ check: end_date >= start_date
51
+ message: {id: Tanggal selesai tidak boleh sebelum tanggal mulai}
52
+ views:
53
+ list:
54
+ columns: [name, project, worker, start_date, end_date, day_rate]
55
+ sort: -start_date
56
+ form:
57
+ layout:
58
+ - section: {id: Penugasan}
59
+ columns:
60
+ - [project, worker, site]
61
+ - [start_date, end_date, day_rate]
62
+ - section: {id: Catatan}
63
+ fields: [notes]
@@ -0,0 +1,81 @@
1
+ # yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/model.json
2
+ name: project
3
+ label: {id: Proyek, en: Project}
4
+ icon: card
5
+ naming: PRJ-{YYYY}-{####}
6
+ title_field: project_name
7
+ permissions:
8
+ - {role: project_admin, read: true, create: true, write: true, delete: true, submit: true, cancel: true, amend: true, export: true, print: true}
9
+ - {role: sales_manager, read: true}
10
+ - {role: finance_manager, read: true}
11
+ fields:
12
+ - name: project_name
13
+ type: data
14
+ label: {id: Nama proyek}
15
+ required: true
16
+ in_list: true
17
+ - name: customer
18
+ type: link
19
+ to: customer
20
+ label: {id: Pelanggan}
21
+ required: true
22
+ in_list: true
23
+ - name: customer_order
24
+ type: link
25
+ to: customer_order
26
+ label: {id: Pesanan pelanggan}
27
+ in_list: true
28
+ - name: site
29
+ type: data
30
+ label: {id: Lokasi}
31
+ in_list: true
32
+ - name: start_date
33
+ type: date
34
+ label: {id: Mulai}
35
+ - name: end_date
36
+ type: date
37
+ label: {id: Selesai}
38
+ - name: state
39
+ type: select
40
+ label: {id: Status proyek}
41
+ default: "'planned'"
42
+ in_list: true
43
+ chip: true
44
+ options:
45
+ - {value: planned, label: {id: Direncanakan}}
46
+ - {value: running, label: {id: Berjalan}}
47
+ - {value: done, label: {id: Selesai}}
48
+ - {value: closed, label: {id: Ditutup}}
49
+ - name: manager
50
+ type: link
51
+ to: user
52
+ label: {id: Penanggung jawab}
53
+ - name: notes
54
+ type: text
55
+ label: {id: Catatan}
56
+ rules:
57
+ - name: end_after_start
58
+ on: save
59
+ check: start_date == '' || end_date == '' || end_date >= start_date
60
+ message: {id: Tanggal selesai tidak boleh sebelum tanggal mulai}
61
+ - name: order_same_customer
62
+ on: save
63
+ check: customer_order == '' || customer_order.customer == customer
64
+ message: {id: Pesanan harus milik pelanggan yang sama}
65
+ views:
66
+ list:
67
+ columns: [name, project_name, customer, site, state, start_date, end_date]
68
+ sort: -start_date
69
+ kanban:
70
+ group_by: state
71
+ title: project_name
72
+ card: [customer, site, start_date, end_date]
73
+ default: kanban
74
+ form:
75
+ layout:
76
+ - section: {id: Proyek}
77
+ columns:
78
+ - [project_name, customer, customer_order, site]
79
+ - [state, manager, start_date, end_date]
80
+ - section: {id: Catatan}
81
+ fields: [notes]
@@ -0,0 +1,82 @@
1
+ # yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/model.json
2
+ name: timesheet
3
+ label: {id: Timesheet}
4
+ icon: calendar
5
+ is_submittable: true
6
+ naming: TS-{YYYY}-{#####}
7
+ title_field: worker
8
+ permissions:
9
+ - {role: project_admin, read: true, create: true, write: true, delete: true, submit: true, cancel: true, amend: true, export: true, print: true}
10
+ - {role: sales_manager, read: true}
11
+ - {role: finance_manager, read: true}
12
+ fields:
13
+ - name: project
14
+ type: link
15
+ to: project
16
+ label: {id: Proyek}
17
+ required: true
18
+ in_list: true
19
+ - name: worker
20
+ type: link
21
+ to: worker
22
+ label: {id: Tenaga kerja}
23
+ required: true
24
+ in_list: true
25
+ - name: assignment
26
+ type: link
27
+ to: assignment
28
+ label: {id: Penugasan}
29
+ - name: work_date
30
+ type: date
31
+ label: {id: Tanggal kerja}
32
+ required: true
33
+ in_list: true
34
+ - name: days
35
+ type: float
36
+ label: {id: Hari kerja}
37
+ default: '1'
38
+ in_list: true
39
+ - name: hours
40
+ type: float
41
+ label: {id: Jam}
42
+ - name: description
43
+ type: text
44
+ label: {id: Uraian pekerjaan}
45
+ required: true
46
+ - name: evidence
47
+ type: attach
48
+ label: {id: Bukti kerja}
49
+ - name: billable
50
+ type: check
51
+ label: {id: Dapat ditagih}
52
+ default: 'true'
53
+ - name: day_rate
54
+ type: currency
55
+ label: {id: Tarif per hari}
56
+ default: assignment.day_rate
57
+ - name: amount
58
+ type: currency
59
+ label: {id: Jumlah}
60
+ compute: round(days * day_rate)
61
+ in_list: true
62
+ rules:
63
+ - name: days_range
64
+ on: save
65
+ check: days > 0 && days <= 1.5
66
+ message: {id: 'Hari kerja harus lebih dari 0 dan paling banyak 1,5'}
67
+ views:
68
+ list:
69
+ columns: [name, project, worker, work_date, days, status, amount]
70
+ sort: -work_date
71
+ form:
72
+ layout:
73
+ - section: {id: Timesheet}
74
+ columns:
75
+ - [project, worker, assignment]
76
+ - [work_date, days, hours]
77
+ - section: {id: Pekerjaan}
78
+ columns:
79
+ - [description, evidence]
80
+ - section: {id: Tagihan}
81
+ columns:
82
+ - [billable, day_rate, amount]
@@ -0,0 +1,6 @@
1
+ # yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/module.json
2
+ name: projects
3
+ version: 1.0.0
4
+ title: {id: Proyek, en: Projects}
5
+ requires: {rangka: '>=0.5', contacts: ^1.0, users: ^1.0, workforce: ^1.0}
6
+ optional: {orders: ^1.0}