@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,201 @@
1
+ # yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/model.json
2
+ name: quotation
3
+ label: {id: Penawaran harga, en: Quotation}
4
+ icon: invoice
5
+ is_submittable: true
6
+ naming: {series: quotation, pattern: "QUO-{YYYY}-{#####}"}
7
+ title_field: subject
8
+ permissions:
9
+ - {role: sales_manager, read: true, create: true, write: true, delete: true, submit: true, cancel: true, amend: true, export: true, print: true}
10
+ - {role: project_admin, read: true, create: true, write: true, submit: true}
11
+ - {role: finance_manager, read: true, print: true}
12
+ fields:
13
+ - name: customer
14
+ type: link
15
+ to: customer
16
+ label: {id: Pelanggan}
17
+ required: true
18
+ in_list: true
19
+ peek: [npwp, payment_days]
20
+ - name: contact_person
21
+ type: data
22
+ label: {id: Up. (PIC pelanggan)}
23
+ - name: subject
24
+ type: data
25
+ label: {id: Perihal}
26
+ required: true
27
+ - name: rfq_ref
28
+ type: data
29
+ label: {id: No. RFQ}
30
+ - name: rfq_date
31
+ type: date
32
+ label: {id: Tanggal RFQ}
33
+ - name: quotation_date
34
+ type: date
35
+ label: {id: Tanggal penawaran}
36
+ default: today()
37
+ required: true
38
+ in_list: true
39
+ - name: valid_until
40
+ type: date
41
+ label: {id: Berlaku sampai}
42
+ default: quotation_date + duration(30)
43
+ relative_to: quotation_date
44
+ - name: revision
45
+ type: int
46
+ label: {id: Revisi}
47
+ default: '0'
48
+ read_only: true
49
+ in_list: true
50
+ - name: items
51
+ type: table
52
+ of: quotation_item
53
+ label: {id: Barang/jasa}
54
+ min_rows: 1
55
+ - name: subtotal
56
+ type: currency
57
+ label: {id: Subtotal}
58
+ # Foreign-currency document (currency is not IDR): the rupiah subtotal is the IDR twin of subtotal_fx (contract 0013),
59
+ # so dpp, PPN (assessed in rupiah), grand_total, retention, PPh 23 and amount_due stay IDR computes from it.
60
+ # Lines are entered with rate_fx; the IDR line `amount` (qty x rate) cannot see the parent's currency, so the header ignores it.
61
+ compute: "currency != '' && currency != 'IDR' ? subtotal_fx_idr : items.map(i, i.amount).sum()"
62
+ # No header discount: a quotation discounts per line (quotation_item.discount), which the order and the invoice
63
+ # made from it carry as the net line rate. A lump sum is spread over the lines.
64
+ - name: dpp
65
+ type: currency
66
+ label: {id: DPP}
67
+ compute: subtotal
68
+ - name: tax_rate
69
+ type: percent
70
+ label: {id: Tarif PPN}
71
+ help: {id: 'Dari config tax.ppn_rate; 0 bila perusahaan bukan PKP. Tersimpan di dokumen.'}
72
+ default: "tax.pkp ? tax.ppn_rate : 0"
73
+ # Not read_only: a generic amend zeroes read-only fields, and a zero dpp_den would break ppn (kernel follow-up).
74
+ - {name: dpp_num, type: int, label: {id: DPP nilai lain (pembilang)}, default: 'tax.dpp_num'}
75
+ - {name: dpp_den, type: int, label: {id: DPP nilai lain (penyebut)}, default: 'tax.dpp_den'}
76
+ - name: ppn
77
+ type: currency
78
+ label: {id: PPN (DPP x rasio DPP nilai lain x tarif)}
79
+ compute: "round(dpp * dpp_num / dpp_den * tax_rate / 100)"
80
+ - name: grand_total
81
+ type: currency
82
+ label: {id: Total}
83
+ compute: dpp + ppn
84
+ in_list: true
85
+ - name: payment_terms
86
+ type: text
87
+ label: {id: Syarat pembayaran}
88
+ - name: delivery_terms
89
+ type: text
90
+ label: {id: Waktu pelaksanaan}
91
+ - name: outcome
92
+ type: select
93
+ label: {id: Hasil penawaran}
94
+ default: "'open'"
95
+ read_only: true
96
+ in_list: true
97
+ chip: true
98
+ options:
99
+ - {value: open, label: {id: Menunggu}}
100
+ - {value: accepted, label: {id: Diterima}}
101
+ - {value: lost, label: {id: Kalah}}
102
+ - name: lost_reason
103
+ type: text
104
+ label: {id: Alasan kalah}
105
+ read_only: true
106
+ depends_on: outcome == 'lost'
107
+ - name: notes
108
+ type: text
109
+ label: {id: Catatan}
110
+ - {name: currency, type: data, label: {id: Mata uang}, default: "'IDR'"}
111
+ - {name: exchange_rate, type: float, label: {id: Kurs}, default: '1'}
112
+ - {name: subtotal_fx, type: money, currency_field: currency, rate_field: exchange_rate, label: {id: Subtotal (valas)}, compute: "sum(items.map(i, i.amount_fx))"}
113
+ - {name: dpp_fx, type: money, currency_field: currency, rate_field: exchange_rate, label: {id: DPP (valas)}, compute: "subtotal_fx"}
114
+ - {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)"}
115
+ - {name: grand_total_fx, type: money, currency_field: currency, rate_field: exchange_rate, label: {id: Total (valas)}, compute: "dpp_fx + ppn_fx"}
116
+ rules:
117
+ - name: foreign_needs_rate
118
+ on: save
119
+ check: currency == '' || currency == 'IDR' || exchange_rate > 1
120
+ message: {id: Dokumen valas wajib diisi kursnya (rupiah per 1 unit mata uang asing)}
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.pkp || tax_rate == 0
128
+ message: {id: Perusahaan bukan PKP tidak boleh memungut PPN (tarif PPN harus 0)}
129
+ - name: valid_after_date
130
+ on: save
131
+ check: valid_until >= quotation_date
132
+ message: {id: Masa berlaku tidak boleh sebelum tanggal penawaran}
133
+ - name: draft_outcome_open
134
+ on: save
135
+ check: docstatus != 0 || outcome == 'open' || outcome == ''
136
+ message: {id: Penawaran yang belum disubmit harus berstatus menunggu}
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
+ - name: line_discount_range
146
+ on: save
147
+ check: "items.map(i, i.discount < 0 || i.discount > 100 ? 1 : 0).sum() == 0"
148
+ message: {id: Diskon baris antara 0 dan 100 persen}
149
+ actions:
150
+ - name: new_revision
151
+ label: {id: Buat revisi, en: New revision}
152
+ icon: edit
153
+ hook: quotation.revise
154
+ if: (docstatus == 1 || docstatus == 2) && (outcome == 'open' || outcome == '')
155
+ # Args come from the call body: {outcome: accepted|lost, lost_reason}. Needed because a submitted document
156
+ # cannot be edited, so `outcome` is changed only through this hook (docs/kernel-hooks.md).
157
+ - name: mark_outcome
158
+ label: {id: Catat hasil penawaran, en: Record outcome}
159
+ icon: check
160
+ hook: quotation.mark_outcome
161
+ if: docstatus == 1 && (outcome == 'open' || outcome == '')
162
+ - name: make_order
163
+ label: {id: Buat pesanan pelanggan, en: Create customer order}
164
+ icon: check
165
+ primary: true
166
+ hook: orders.from_quotation
167
+ if: docstatus == 1 && outcome == 'accepted'
168
+ approvals:
169
+ - name: manager_approval
170
+ on: submit
171
+ approvers: [sales_manager]
172
+ label: {id: Persetujuan manajer, en: Manager approval}
173
+
174
+ views:
175
+ list:
176
+ columns: [name, customer, subject, quotation_date, revision, status, grand_total, outcome]
177
+ sort: -quotation_date
178
+ form:
179
+ layout:
180
+ - section: {id: Penawaran}
181
+ columns:
182
+ - [customer, contact_person, subject, revision]
183
+ - [rfq_ref, rfq_date, quotation_date, valid_until]
184
+ - section: {id: Barang/jasa}
185
+ fields: [items]
186
+ - section: {id: Harga}
187
+ columns:
188
+ - [subtotal, dpp]
189
+ - [tax_rate, dpp_num, dpp_den, ppn, grand_total]
190
+ - section: {id: Syarat}
191
+ columns:
192
+ - [payment_terms, delivery_terms]
193
+ - section: {id: Hasil}
194
+ columns:
195
+ - [outcome, lost_reason]
196
+ - section: {id: Catatan}
197
+ fields: [notes]
198
+ - section: {id: Mata uang asing}
199
+ columns:
200
+ - [currency, exchange_rate, subtotal_fx]
201
+ - [grand_total_fx]
@@ -0,0 +1,37 @@
1
+ # yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/model.json
2
+ name: quotation_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.sales_uom != '' ? item.sales_uom : item.stock_uom"
23
+ - name: rate
24
+ type: currency
25
+ label: {id: Harga}
26
+ default: item.rate
27
+ - name: discount
28
+ type: percent
29
+ label: {id: Diskon %}
30
+ default: '0'
31
+ - name: amount
32
+ type: currency
33
+ label: {id: Jumlah}
34
+ compute: round(qty * rate * (1 - discount / 100))
35
+
36
+ - {name: rate_fx, type: money, currency_field: currency, rate_field: exchange_rate, label: {id: Harga (valas)}, default: '0'}
37
+ - {name: amount_fx, type: money, currency_field: currency, rate_field: exchange_rate, label: {id: Jumlah (valas)}, compute: "round(qty * rate_fx * (1 - discount / 100), 2)"}
@@ -0,0 +1,9 @@
1
+ # yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/module.json
2
+ name: quotation
3
+ version: 1.0.0
4
+ title: {id: Penawaran, en: Quotation}
5
+ requires: {rangka: '>=0.5', users: ^1.0, contacts: ^1.0, catalogue: ^1.0}
6
+ optional: {tax_id: ^1.0, currency: ^1.0}
7
+ # Semantics fixed in docs/kernel-hooks.md. orders.from_quotation is declared here because the make_order action lives
8
+ # on quotation; the hook is implemented with the orders module.
9
+ hooks: [quotation.revise, quotation.mark_outcome, orders.from_quotation]
@@ -0,0 +1,65 @@
1
+ {{define "style"}}
2
+ .meta { width: 100%; margin: 12px 0; border-collapse: collapse; }
3
+ .meta td { padding: 2px 6px 2px 0; vertical-align: top; }
4
+ .items { width: 100%; border-collapse: collapse; margin-top: 12px; }
5
+ .items th, .items td { border-bottom: 1px solid #d6d3d1; padding: 6px 8px; text-align: left; vertical-align: top; }
6
+ .items th { background: #f6ede6; }
7
+ .num { text-align: right !important; font-variant-numeric: tabular-nums; }
8
+ .totals { width: 50%; margin: 12px 0 0 auto; border-collapse: collapse; }
9
+ .totals td { padding: 3px 8px; }
10
+ .totals tr.grand td { border-top: 2px solid #1c1917; font-weight: 700; }
11
+ .note { margin-top: 14px; font-size: 0.9em; }
12
+ .terms { margin-top: 14px; border-collapse: collapse; }
13
+ .terms td { padding: 2px 8px 2px 0; vertical-align: top; }
14
+ {{end}}
15
+ {{template "letterhead" .}}
16
+ {{$fx := and .Doc.currency (ne .Doc.currency "IDR")}}
17
+ <h1>Surat Penawaran Harga</h1>
18
+ <table class="meta">
19
+ <tr><td>Nomor</td><td>: {{.Doc.name}} Rev.{{printf "%02d" .Doc.revision}}</td><td>Kepada Yth.</td><td>: {{.Links.customer.customer_name}}</td></tr>
20
+ <tr><td>Tanggal</td><td>: {{date .Doc.quotation_date}}</td><td>Alamat</td><td>: {{.Links.customer.address}}</td></tr>
21
+ <tr><td>Perihal</td><td>: {{.Doc.subject}}</td><td>Up.</td><td>: {{.Doc.contact_person}}</td></tr>
22
+ {{if .Doc.rfq_ref}}<tr><td>Ref. RFQ</td><td>: {{.Doc.rfq_ref}}{{if .Doc.rfq_date}} ({{date .Doc.rfq_date}}){{end}}</td><td></td><td></td></tr>{{end}}
23
+ </table>
24
+ <p>Dengan hormat, bersama ini kami sampaikan penawaran harga sebagai berikut.</p>
25
+ <table class="items">
26
+ <thead><tr><th>No</th><th>Uraian</th><th class="num">Qty</th><th>Satuan</th><th class="num">Harga satuan</th><th class="num">Diskon</th><th class="num">Jumlah</th></tr></thead>
27
+ <tbody>
28
+ {{range $i, $row := .Doc.items}}
29
+ <tr>
30
+ <td>{{sub $i -1}}</td>
31
+ <td>{{if $row.description}}{{$row.description}}{{else}}{{$row.item}}{{end}}</td>
32
+ <td class="num">{{number $row.qty}}</td>
33
+ <td>{{$row.uom}}</td>
34
+ <td class="num">{{if $fx}}{{money $row.rate_fx $.Doc.currency}}{{else}}{{rupiah $row.rate}}{{end}}</td>
35
+ <td class="num">{{if $row.discount}}{{number $row.discount}}%{{end}}</td>
36
+ <td class="num">{{if $fx}}{{money $row.amount_fx $.Doc.currency}}{{else}}{{rupiah $row.amount}}{{end}}</td>
37
+ </tr>
38
+ {{end}}
39
+ </tbody>
40
+ </table>
41
+ {{if $fx}}
42
+ <table class="totals">
43
+ <tr><td>Subtotal</td><td class="num">{{money .Doc.subtotal_fx .Doc.currency}}</td></tr>
44
+ {{if taxrate .Doc .Tax}}<tr><td>PPN {{number (taxrate .Doc .Tax)}}%</td><td class="num">{{money .Doc.ppn_fx .Doc.currency}}</td></tr>{{end}}
45
+ <tr class="grand"><td>Total</td><td class="num">{{money .Doc.grand_total_fx .Doc.currency}}</td></tr>
46
+ </table>
47
+ <p class="note">Kurs: 1 {{.Doc.currency}} = {{rupiah .Doc.exchange_rate}}. Setara rupiah (PPN dihitung dalam rupiah):</p>
48
+ {{end}}
49
+ <table class="totals">
50
+ <tr><td>Subtotal</td><td class="num">{{rupiah .Doc.subtotal}}</td></tr>
51
+ <tr><td>DPP</td><td class="num">{{rupiah .Doc.dpp}}</td></tr>
52
+ {{if taxrate .Doc .Tax}}<tr><td>PPN {{number (taxrate .Doc .Tax)}}% (DPP nilai lain {{.Doc.dpp_num}}/{{.Doc.dpp_den}})</td><td class="num">{{rupiah .Doc.ppn}}</td></tr>{{end}}
53
+ <tr class="grand"><td>Total</td><td class="num">{{rupiah .Doc.grand_total}}</td></tr>
54
+ </table>
55
+ <p class="note"><strong>Terbilang:</strong> {{terbilang .Doc.grand_total}}</p>
56
+ <table class="terms">
57
+ <tr><td><strong>Syarat</strong></td><td></td></tr>
58
+ <tr><td>Masa berlaku</td><td>: sampai {{date .Doc.valid_until}}</td></tr>
59
+ {{if .Doc.payment_terms}}<tr><td>Pembayaran</td><td>: {{.Doc.payment_terms}}</td></tr>{{end}}
60
+ {{if .Doc.delivery_terms}}<tr><td>Waktu pelaksanaan</td><td>: {{.Doc.delivery_terms}}</td></tr>{{end}}
61
+ </table>
62
+ {{if .Doc.notes}}<p class="note">{{.Doc.notes}}</p>{{end}}
63
+ <p class="note">Demikian penawaran ini kami sampaikan. Atas perhatian dan kerja samanya kami ucapkan terima kasih.</p>
64
+ <p class="note">Hormat kami,</p>
65
+ {{template "signature" .}}
@@ -0,0 +1,7 @@
1
+ # yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/print.json
2
+ name: quotation
3
+ model: quotation
4
+ label: {id: Surat penawaran harga, en: Quotation}
5
+ paper: A4
6
+ template: quotation.html
7
+ default: true
@@ -0,0 +1,15 @@
1
+ # yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/flow.json
2
+ name: stock_negative_alert
3
+ label: {id: Peringatan stok minus}
4
+ # The kernel passes the stock_move record as `event` (name, outlet, item, qty, balance_qty, negative, ...). It does not
5
+ # yet dispatch `<model>.created` events to flows (S8c finding), so head office also sees the "Stok minus" list.
6
+ # The two find steps turn the record names into item and outlet names for the message; when a record cannot be found
7
+ # (deleted, or outside the actor's scope) the text falls back to the plain names.
8
+ on: stock_move.created
9
+ if: event.negative == true
10
+ steps:
11
+ - {find: item, where: name == event.item, as: it}
12
+ - {find: outlet, where: name == event.outlet, as: ou}
13
+ - notify: head_office
14
+ channel: in_app
15
+ template: {id: 'Stok {it != null ? it.item_name : event.item} di {ou != null ? ou.outlet_name : event.outlet} minus ({event.balance_qty})'}
@@ -0,0 +1,60 @@
1
+ # yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/model.json
2
+ name: recipe
3
+ label: {id: Resep, en: Recipe}
4
+ icon: stock
5
+ naming: RSP-{####}
6
+ title_field: recipe_name
7
+ permissions:
8
+ - {role: head_office, read: true, create: true, write: true, delete: true, export: true}
9
+ - {role: outlet_staff, read: true}
10
+ fields:
11
+ - name: product
12
+ type: link
13
+ to: item
14
+ label: {id: Produk}
15
+ required: true
16
+ in_list: true
17
+ - name: recipe_name
18
+ type: data
19
+ label: {id: Nama resep}
20
+ in_list: true
21
+ - name: yield_qty
22
+ type: float
23
+ label: {id: Hasil per resep (porsi)}
24
+ help: {id: 'Satu resep menghasilkan berapa porsi; bahan di bawah dihitung per resep'}
25
+ default: '1'
26
+ - name: active
27
+ type: check
28
+ label: {id: Aktif}
29
+ default: 'true'
30
+ in_list: true
31
+ - name: lines
32
+ type: table
33
+ of: recipe_line
34
+ label: {id: Bahan}
35
+ min_rows: 1
36
+ rules:
37
+ - name: product_is_product
38
+ on: save
39
+ check: product.kind == 'product'
40
+ message: {id: Resep hanya untuk barang berjenis produk jadi}
41
+ - name: yield_positive
42
+ on: save
43
+ check: yield_qty > 0
44
+ message: {id: Hasil per resep harus lebih dari 0}
45
+ - name: qty_positive
46
+ on: save
47
+ check: "lines.map(l, l.qty <= 0 ? 1 : 0).sum() == 0"
48
+ message: {id: Jumlah bahan harus lebih dari 0}
49
+ views:
50
+ list:
51
+ columns: [name, product, recipe_name, yield_qty, active]
52
+ sort: product
53
+ form:
54
+ layout:
55
+ - section: {id: Resep}
56
+ columns:
57
+ - [product, recipe_name]
58
+ - [yield_qty, active]
59
+ - section: {id: Bahan}
60
+ fields: [lines]
@@ -0,0 +1,24 @@
1
+ # yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/model.json
2
+ name: recipe_line
3
+ is_child: true
4
+ fields:
5
+ - name: material
6
+ type: link
7
+ to: item
8
+ label: {id: Bahan}
9
+ required: true
10
+ - name: description
11
+ type: text
12
+ label: {id: Uraian}
13
+ default: material.item_name
14
+ - name: qty
15
+ type: float
16
+ label: {id: Qty per resep}
17
+ help: {id: 'Dalam satuan stok bahan'}
18
+ required: true
19
+ - name: uom
20
+ type: link
21
+ to: uom
22
+ label: {id: Satuan}
23
+ default: material.stock_uom
24
+ read_only: true
@@ -0,0 +1,61 @@
1
+ # yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/model.json
2
+ name: stock_adjustment
3
+ label: {id: Penyesuaian stok, en: Stock adjustment}
4
+ icon: stock
5
+ is_submittable: true
6
+ naming: ADJ-{YYYY}-{#####}
7
+ on_submit: [stock.post_moves]
8
+ on_cancel: [stock.reverse_moves]
9
+ permissions:
10
+ - {role: head_office, read: true, create: true, write: true, delete: true, submit: true, cancel: true, amend: true, export: true, print: true}
11
+ - {role: outlet_staff, read: true, create: true, write: true, submit: true}
12
+ fields:
13
+ - name: outlet
14
+ type: link
15
+ to: outlet
16
+ label: {id: Outlet}
17
+ required: true
18
+ in_list: true
19
+ - name: adjustment_date
20
+ type: date
21
+ label: {id: Tanggal}
22
+ default: today()
23
+ required: true
24
+ in_list: true
25
+ - name: reason
26
+ type: select
27
+ label: {id: Alasan}
28
+ required: true
29
+ in_list: true
30
+ chip: true
31
+ options:
32
+ - {value: waste, label: {id: Terbuang}}
33
+ - {value: damage, label: {id: Rusak}}
34
+ - {value: expired, label: {id: Kedaluwarsa}}
35
+ - {value: other, label: {id: Lainnya}}
36
+ - name: items
37
+ type: table
38
+ of: stock_adjustment_item
39
+ label: {id: Barang}
40
+ min_rows: 1
41
+ - name: notes
42
+ type: text
43
+ label: {id: Catatan}
44
+ rules:
45
+ - name: qty_positive
46
+ on: save
47
+ check: "items.map(i, i.qty <= 0 ? 1 : 0).sum() == 0"
48
+ message: {id: Jumlah barang harus lebih dari 0}
49
+ views:
50
+ list:
51
+ columns: [name, outlet, adjustment_date, reason, status]
52
+ sort: -adjustment_date
53
+ form:
54
+ layout:
55
+ - section: {id: Penyesuaian}
56
+ columns:
57
+ - [outlet, adjustment_date, reason]
58
+ - section: {id: Barang}
59
+ fields: [items]
60
+ - section: {id: Catatan}
61
+ fields: [notes]
@@ -0,0 +1,32 @@
1
+ # yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/model.json
2
+ name: stock_adjustment_item
3
+ is_child: true
4
+ fields:
5
+ - name: item
6
+ type: link
7
+ to: item
8
+ label: {id: Barang}
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 keluar}
17
+ help: {id: 'Jumlah positif yang dikurangi dari stok'}
18
+ required: true
19
+ stock: true
20
+ - name: uom
21
+ type: link
22
+ to: uom
23
+ label: {id: Satuan}
24
+ default: "packing != '' ? packing.uom : item.stock_uom"
25
+ - name: packing
26
+ type: link
27
+ to: uom_conversion
28
+ label: {id: Kemasan}
29
+ - name: stock_qty
30
+ type: float
31
+ label: {id: Qty stok}
32
+ compute: "packing == '' ? qty : qty * packing.factor"
@@ -0,0 +1,23 @@
1
+ # yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/model.json
2
+ name: stock_balance
3
+ label: {id: Saldo stok, en: Stock balance}
4
+ icon: stock
5
+ naming: SB-{######}
6
+ # One row per outlet and item, created and updated only by the stock hooks. A balance below zero is the
7
+ # negative-stock exception: `negative` is true and head office sees it in the "Stok minus" list.
8
+ permissions:
9
+ - {role: head_office, read: true, export: true}
10
+ - {role: outlet_staff, read: true}
11
+ fields:
12
+ - {name: outlet, type: link, to: outlet, label: {id: Outlet}, required: true, read_only: true, in_list: true}
13
+ - {name: item, type: link, to: item, label: {id: Barang}, required: true, read_only: true, in_list: true}
14
+ - {name: qty, type: float, label: {id: Qty}, read_only: true, in_list: true}
15
+ - {name: value, type: currency, label: {id: Nilai}, read_only: true, in_list: true}
16
+ - {name: avg_cost, type: currency, label: {id: Rata-rata biaya}, read_only: true, in_list: true}
17
+ - {name: negative, type: check, label: {id: Stok minus}, compute: qty < 0, in_list: true}
18
+ - {name: last_move, type: data, label: {id: Mutasi terakhir}, read_only: true}
19
+ views:
20
+ list:
21
+ columns: [outlet, item, qty, value, avg_cost, negative]
22
+ filters: [outlet, item, negative]
23
+ sort: outlet
@@ -0,0 +1,54 @@
1
+ # yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/model.json
2
+ name: stock_count
3
+ label: {id: Stok opname, en: Stock count}
4
+ icon: stock
5
+ is_submittable: true
6
+ naming: OPN-{YYYY}-{#####}
7
+ on_submit: [stock.post_moves]
8
+ on_cancel: [stock.reverse_moves]
9
+ permissions:
10
+ - {role: head_office, read: true, create: true, write: true, delete: true, submit: true, cancel: true, amend: true, export: true, print: true}
11
+ - {role: outlet_staff, read: true, create: true, write: true, submit: true}
12
+ fields:
13
+ - name: outlet
14
+ type: link
15
+ to: outlet
16
+ label: {id: Outlet}
17
+ required: true
18
+ in_list: true
19
+ - name: count_date
20
+ type: date
21
+ label: {id: Tanggal opname}
22
+ default: today()
23
+ required: true
24
+ in_list: true
25
+ - name: counted_by
26
+ type: link
27
+ to: user
28
+ label: {id: Dihitung oleh}
29
+ - name: items
30
+ type: table
31
+ of: stock_count_item
32
+ label: {id: Barang}
33
+ min_rows: 1
34
+ - name: notes
35
+ type: text
36
+ label: {id: Catatan}
37
+ rules:
38
+ - name: counted_not_negative
39
+ on: save
40
+ check: "items.map(i, i.counted_qty < 0 ? 1 : 0).sum() == 0"
41
+ message: {id: Hasil hitung tidak boleh negatif}
42
+ views:
43
+ list:
44
+ columns: [name, outlet, count_date, counted_by, status]
45
+ sort: -count_date
46
+ form:
47
+ layout:
48
+ - section: {id: Opname}
49
+ columns:
50
+ - [outlet, count_date, counted_by]
51
+ - section: {id: Barang}
52
+ fields: [items]
53
+ - section: {id: Catatan}
54
+ fields: [notes]
@@ -0,0 +1,33 @@
1
+ # yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/model.json
2
+ name: stock_count_item
3
+ is_child: true
4
+ fields:
5
+ - name: item
6
+ type: link
7
+ to: item
8
+ label: {id: Barang}
9
+ required: true
10
+ - name: description
11
+ type: text
12
+ label: {id: Uraian}
13
+ default: item.item_name
14
+ - name: counted_qty
15
+ type: float
16
+ label: {id: Hasil hitung}
17
+ required: true
18
+ stock: true
19
+ - name: uom
20
+ type: link
21
+ to: uom
22
+ label: {id: Satuan}
23
+ default: item.stock_uom
24
+ read_only: true
25
+ - name: system_qty
26
+ type: float
27
+ label: {id: Qty sistem}
28
+ help: {id: 'Diisi sistem saat opname diajukan'}
29
+ read_only: true
30
+ - name: difference
31
+ type: float
32
+ label: {id: Selisih}
33
+ read_only: true
@@ -0,0 +1,41 @@
1
+ # yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/model.json
2
+ name: stock_move
3
+ label: {id: Mutasi stok, en: Stock move}
4
+ icon: stock
5
+ naming: SM-{YYYY}-{######}
6
+ # Written only by stock.post_moves and stock.reverse_moves. No role but owner may create, change or delete one.
7
+ permissions:
8
+ - {role: head_office, read: true, export: true}
9
+ - {role: outlet_staff, read: true}
10
+ fields:
11
+ - {name: posting_date, type: date, label: {id: Tanggal}, read_only: true, in_list: true}
12
+ - {name: outlet, type: link, to: outlet, label: {id: Outlet}, required: true, read_only: true, in_list: true}
13
+ - {name: item, type: link, to: item, label: {id: Barang}, required: true, read_only: true, in_list: true}
14
+ - {name: qty, type: float, label: {id: 'Qty (+ masuk, - keluar)'}, read_only: true, in_list: true}
15
+ - {name: unit_cost, type: currency, label: {id: Biaya per satuan}, read_only: true}
16
+ - {name: value, type: currency, label: {id: Nilai}, read_only: true, in_list: true}
17
+ - {name: balance_qty, type: float, label: {id: Saldo qty}, read_only: true, in_list: true}
18
+ - {name: balance_value, type: currency, label: {id: Saldo nilai}, read_only: true}
19
+ - {name: avg_cost, type: currency, label: {id: Rata-rata biaya}, read_only: true}
20
+ - {name: negative, type: check, label: {id: Stok minus}, read_only: true, in_list: true}
21
+ - {name: voucher_type, type: data, label: {id: Jenis dokumen}, read_only: true, in_list: true}
22
+ - {name: voucher, type: data, label: {id: Dokumen}, read_only: true, in_list: true}
23
+ - name: reason
24
+ type: select
25
+ label: {id: Sebab}
26
+ read_only: true
27
+ in_list: true
28
+ options:
29
+ - {value: receipt, label: {id: Penerimaan}}
30
+ - {value: transfer_in, label: {id: Transfer masuk}}
31
+ - {value: transfer_out, label: {id: Transfer keluar}}
32
+ - {value: sale, label: {id: Penjualan}}
33
+ - {value: count, label: {id: Opname}}
34
+ - {value: waste, label: {id: Barang rusak}}
35
+ - {value: adjustment, label: {id: Penyesuaian}}
36
+ - {value: reversal, label: {id: Pembatalan}}
37
+ views:
38
+ list:
39
+ columns: [name, posting_date, outlet, item, qty, value, balance_qty, negative, voucher_type, voucher, reason]
40
+ filters: [outlet, item, reason, negative]
41
+ sort: -name