@rangka-os/create 0.5.0-alpha.15 → 0.5.0-alpha.17

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 (40) hide show
  1. package/package.json +1 -1
  2. package/template/base/apps/grosir_distribusi/app.rk +2 -1
  3. package/template/base/apps/langganan_jasa/app.rk +3 -0
  4. package/template/base/apps/produksi_pabrik/dashboards/produksi_overview.rk +1 -1
  5. package/template/base/apps/ritel_cabang/app.rk +3 -0
  6. package/template/base/connectors/doku/mock/doku_mock.py +16 -5
  7. package/template/base/connectors/moka/mock/moka_mock.py +210 -0
  8. package/template/base/connectors/xendit/mock/xendit_mock.py +231 -0
  9. package/template/base/modules/bank_statement/flows/bank_transaction_booked.rk +12 -0
  10. package/template/base/modules/bank_statement/flows/bank_transaction_booked_released.rk +11 -0
  11. package/template/base/modules/bank_statement/flows/bank_transaction_claim.rk +11 -1
  12. package/template/base/modules/bank_statement/flows/bank_transaction_confirm.rk +23 -5
  13. package/template/base/modules/bank_statement/flows/bank_transaction_suggest.rk +56 -14
  14. package/template/base/modules/bank_statement/models/bank_transaction.rk +27 -4
  15. package/template/base/modules/bank_statement/models/bank_transaction_claim.rk +1 -1
  16. package/template/base/modules/catalogue/models/item_category.rk +2 -0
  17. package/template/base/modules/coretax/module.rk +2 -2
  18. package/template/base/modules/coretax/print/coretax_faktur.rk +1 -1
  19. package/template/base/modules/coretax/print/coretax_faktur.xml +13 -7
  20. package/template/base/modules/delivery/flows/invoice_qty_from_deliveries.rk +1 -1
  21. package/template/base/modules/delivery/module.rk +1 -1
  22. package/template/base/modules/distribution/flows/order_tier_pricing_created.rk +2 -2
  23. package/template/base/modules/distribution/flows/order_tier_pricing_updated.rk +2 -2
  24. package/template/base/modules/distribution/module.rk +1 -1
  25. package/template/base/modules/invoicing/models/sales_invoice.rk +31 -4
  26. package/template/base/modules/invoicing/models/sales_invoice_item.rk +7 -0
  27. package/template/base/modules/invoicing/module.rk +1 -1
  28. package/template/base/modules/invoicing/print/sales_invoice.html +15 -2
  29. package/template/base/modules/orders/models/customer_order.rk +2 -0
  30. package/template/base/modules/orders/models/customer_order_item.rk +10 -0
  31. package/template/base/modules/orders/module.rk +1 -1
  32. package/template/base/modules/payments/flows/payment_refund_from_doku.rk +14 -0
  33. package/template/base/modules/payroll/flows/payroll_close_on_submit.rk +2 -2
  34. package/template/base/modules/payroll/module.rk +2 -2
  35. package/template/base/modules/production/models/production_batch.rk +3 -0
  36. package/template/base/modules/production/module.rk +1 -1
  37. package/template/base/modules/quotation/models/quotation.rk +14 -4
  38. package/template/base/modules/quotation/models/quotation_item.rk +13 -0
  39. package/template/base/modules/quotation/module.rk +1 -1
  40. package/template/base/modules/quotation/print/quotation.html +16 -2
@@ -73,10 +73,20 @@ fields:
73
73
  # Not read_only: a generic amend zeroes read-only fields, and a zero dpp_den would break ppn (kernel follow-up).
74
74
  - {name: dpp_num, type: int, label: {id: DPP nilai lain (pembilang)}, default: 'tax.dpp_num'}
75
75
  - {name: dpp_den, type: int, label: {id: DPP nilai lain (penyebut)}, default: 'tax.dpp_den'}
76
+ # The PPN base as on the invoice (sales_invoice.ppn_base): the DPP, or with config tax.ppn_fee_only the share of the
77
+ # lines not marked ppn_exclude, so the quoted total equals the invoice's. No down payment on a quotation.
78
+ - name: ppn_base
79
+ type: currency
80
+ label: {id: Dasar PPN}
81
+ compute: >-
82
+ !('ppn_fee_only' in tax && tax.ppn_fee_only) ? dpp :
83
+ (currency != '' && currency != 'IDR'
84
+ ? (items.map(i, i.amount_fx_idr).sum() == 0 ? 0 : round(dpp * 1.0 * items.map(i, i.ppn_exclude ? 0 : i.amount_fx_idr).sum() / items.map(i, i.amount_fx_idr).sum()))
85
+ : (subtotal == 0 ? 0 : round(dpp * 1.0 * items.map(i, i.ppn_exclude ? 0 : i.amount).sum() / subtotal)))
76
86
  - name: ppn
77
87
  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)"
88
+ label: {id: PPN (dasar PPN x rasio DPP nilai lain x tarif)}
89
+ compute: "round(ppn_base * dpp_num / dpp_den * tax_rate / 100)"
80
90
  - name: grand_total
81
91
  type: currency
82
92
  label: {id: Total}
@@ -111,7 +121,7 @@ fields:
111
121
  - {name: exchange_rate, type: float, label: {id: Kurs}, default: '1'}
112
122
  - {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
123
  - {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)"}
124
+ - {name: ppn_fx, type: money, currency_field: currency, rate_field: exchange_rate, label: {id: PPN (valas)}, compute: "dpp == 0 ? 0 : round(dpp_fx * (ppn_base * 1.0 / dpp) * dpp_num / dpp_den * tax_rate / 100, 2)"}
115
125
  - {name: grand_total_fx, type: money, currency_field: currency, rate_field: exchange_rate, label: {id: Total (valas)}, compute: "dpp_fx + ppn_fx"}
116
126
  rules:
117
127
  - name: foreign_needs_rate
@@ -186,7 +196,7 @@ views:
186
196
  - section: {id: Harga}
187
197
  columns:
188
198
  - [subtotal, dpp]
189
- - [tax_rate, dpp_num, dpp_den, ppn, grand_total]
199
+ - [tax_rate, dpp_num, dpp_den, ppn_base, ppn, grand_total]
190
200
  - section: {id: Syarat}
191
201
  columns:
192
202
  - [payment_terms, delivery_terms]
@@ -32,6 +32,19 @@ fields:
32
32
  type: currency
33
33
  label: {id: Jumlah}
34
34
  compute: round(qty * rate * (1 - discount / 100))
35
+ # The workers' wages or a reimbursed cost quoted on their own line: outside the PPh 23 base of the invoice made from
36
+ # the quotation (carried by the kernel conversions through the order); the quotation itself has no PPh 23.
37
+ - name: pph23_exclude
38
+ type: check
39
+ label: {id: Bukan dasar PPh 23}
40
+ default: 'false'
41
+ # The workers' wages quoted on their own line: outside the PPN base when the org charges PPN on its fee only
42
+ # (config tax.ppn_fee_only, PMK 83/2012), as on the invoice (sales_invoice_item.ppn_exclude).
43
+ - name: ppn_exclude
44
+ type: check
45
+ label: {id: Upah tenaga kerja (di luar dasar PPN)}
46
+ help: {id: 'Centang untuk baris upah pekerja yang dirinci terpisah; hanya berlaku bila usaha memakai PPN atas fee'}
47
+ default: 'false'
35
48
 
36
49
  - {name: rate_fx, type: money, currency_field: currency, rate_field: exchange_rate, label: {id: Harga (valas)}, default: '0'}
37
50
  - {name: amount_fx, type: money, currency_field: currency, rate_field: exchange_rate, label: {id: Jumlah (valas)}, compute: "round(qty * rate_fx * (1 - discount / 100), 2)"}
@@ -1,6 +1,6 @@
1
1
  # yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/module.json
2
2
  name: quotation
3
- version: 1.0.0
3
+ version: 1.2.0
4
4
  title: {id: Penawaran, en: Quotation}
5
5
  summary:
6
6
  id: Kirim penawaran harga ke pelanggan sebelum jadi pesanan.
@@ -48,8 +48,22 @@
48
48
  {{end}}
49
49
  <table class="totals">
50
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}}
51
+ {{if not (taxrate .Doc .Tax)}}<tr><td>DPP</td><td class="num">{{rupiah .Doc.dpp}}</td></tr>{{end}}
52
+ {{if taxrate .Doc .Tax}}<tr><td>DPP</td><td class="num">{{rupiah .Doc.dpp}}</td></tr>
53
+ {{- /* As on the faktur pajak (Coretax, PMK 131/2024): the base, then DPP nilai lain, then PPN = rate x DPP nilai lain.
54
+ An invoice of an org with PPN on the fee only (tax.ppn_fee_only, PMK 83/2012) shows the wages left out first; an
55
+ invoice from before ppn_base existed was taxed on its whole DPP. */}}
56
+ {{- /* the DPP only for a document from before ppn_base that charged PPN (as ppn_dp_base reads it); a base of 0 with
57
+ no PPN (wages only, or a settlement whose base the down payment used up) is that 0 */}}
58
+ {{- $pb := .Doc.dpp}}{{if or .Doc.ppn_base (not .Doc.ppn)}}{{$pb = or .Doc.ppn_base 0}}{{end}}
59
+ {{- if ne (dec $pb) (dec .Doc.dpp)}}
60
+ <tr><td>Upah tenaga kerja di luar dasar PPN (PMK 83/2012)</td><td class="num">-{{rupiah (sub .Doc.dpp $pb)}}</td></tr>
61
+ <tr><td>Dasar PPN</td><td class="num">{{rupiah $pb}}</td></tr>
62
+ {{- end}}
63
+ {{- if ne .Doc.dpp_num .Doc.dpp_den}}
64
+ <tr><td>DPP nilai lain {{.Doc.dpp_num}}/{{.Doc.dpp_den}}</td><td class="num">{{rupiah (round (div (mul $pb .Doc.dpp_num) .Doc.dpp_den))}}</td></tr>
65
+ {{- end}}
66
+ <tr><td>PPN {{number (taxrate .Doc .Tax)}}%</td><td class="num">{{rupiah .Doc.ppn}}</td></tr>{{end}}
53
67
  <tr class="grand"><td>Total</td><td class="num">{{rupiah .Doc.grand_total}}</td></tr>
54
68
  </table>
55
69
  <p class="note"><strong>Terbilang:</strong> {{terbilang .Doc.grand_total}}</p>