@rangka-os/create 0.0.0-stage → 0.5.0-alpha.11
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/index.js +137 -0
- package/package.json +29 -4
- package/template/base/README.md +32 -0
- package/template/base/_gitignore +3 -0
- package/template/base/_vscode/settings.json +4 -0
- package/template/base/apps/crm/app.rk +44 -0
- package/template/base/apps/crm/dashboards/crm_overview.rk +88 -0
- package/template/base/apps/crm/dashboards/sales_overview.rk +66 -0
- package/template/base/apps/crm/processes/lead_to_cash.rk +8 -0
- package/template/base/apps/dapur/app.rk +35 -0
- package/template/base/apps/dapur/dashboards/dapur_hari_ini.rk +26 -0
- package/template/base/apps/faktur_piutang/app.rk +31 -0
- package/template/base/apps/faktur_piutang/dashboards/piutang_ringkas.rk +88 -0
- package/template/base/apps/fnb_cabang/app.rk +46 -0
- package/template/base/apps/fnb_cabang/dashboards/fnb_overview.rk +104 -0
- package/template/base/apps/fnb_cabang/dashboards/outlet_harian.rk +36 -0
- package/template/base/apps/fnb_cabang/dashboards/stock_recap.rk +132 -0
- package/template/base/apps/grosir_distribusi/app.rk +56 -0
- package/template/base/apps/grosir_distribusi/dashboards/grosir_ar.rk +62 -0
- package/template/base/apps/grosir_distribusi/dashboards/grosir_overview.rk +87 -0
- package/template/base/apps/jasa_proyek/app.rk +64 -0
- package/template/base/apps/jasa_proyek/dashboards/absen_saya.rk +15 -0
- package/template/base/apps/jasa_proyek/dashboards/ar_aging.rk +88 -0
- package/template/base/apps/jasa_proyek/dashboards/jasa_overview.rk +148 -0
- package/template/base/apps/jasa_proyek/dashboards/project_margin.rk +94 -0
- package/template/base/apps/jasa_proyek/dashboards/rekap_absen.rk +18 -0
- package/template/base/apps/jasa_proyek/processes/quote_to_cash.rk +10 -0
- package/template/base/apps/kasir/app.rk +38 -0
- package/template/base/apps/kasir/dashboards/kasir_ringkas.rk +20 -0
- package/template/base/apps/kasir/skills/rangka-app-kasir/SKILL.md +64 -0
- package/template/base/apps/kelas_kursus/app.rk +29 -0
- package/template/base/apps/kelas_kursus/dashboards/kelas_saya.rk +41 -0
- package/template/base/apps/kelas_kursus/dashboards/kursus_ringkas.rk +67 -0
- package/template/base/apps/langganan_jasa/app.rk +32 -0
- package/template/base/apps/langganan_jasa/dashboards/langganan_ringkas.rk +167 -0
- package/template/base/apps/langganan_jasa/dashboards/penagihan_saya.rk +54 -0
- package/template/base/apps/mutasi_bank/app.rk +22 -0
- package/template/base/apps/pajak/app.rk +25 -0
- package/template/base/apps/pembelian_pemasok/app.rk +23 -0
- package/template/base/apps/pembukuan/app.rk +19 -0
- package/template/base/apps/penjualan_harian/app.rk +34 -0
- package/template/base/apps/penjualan_harian/dashboards/penjualan_ringkas.rk +87 -0
- package/template/base/apps/produksi_pabrik/app.rk +54 -0
- package/template/base/apps/produksi_pabrik/dashboards/produksi_overview.rk +101 -0
- package/template/base/apps/produksi_pabrik/dashboards/produksi_upah.rk +39 -0
- package/template/base/apps/ritel_cabang/app.rk +58 -0
- package/template/base/apps/ritel_cabang/dashboards/ritel_overview.rk +137 -0
- package/template/base/apps/ritel_cabang/dashboards/ritel_stock.rk +147 -0
- package/template/base/apps/ritel_cabang/dashboards/ritel_tax.rk +76 -0
- package/template/base/apps/sewa_alat/app.rk +31 -0
- package/template/base/apps/sewa_alat/dashboards/alat_hari_ini.rk +90 -0
- package/template/base/apps/sewa_alat/dashboards/sewa_ringkas.rk +86 -0
- package/template/base/apps/stok_outlet/app.rk +34 -0
- package/template/base/apps/stok_outlet/dashboards/outlet_hari_ini.rk +33 -0
- package/template/base/apps/stok_outlet/dashboards/stok_ringkas.rk +50 -0
- package/template/base/connectors/biteship/connector.rk +246 -0
- package/template/base/connectors/biteship/fixtures/cancel_order.json +1 -0
- package/template/base/connectors/biteship/fixtures/create_order.json +8 -0
- package/template/base/connectors/biteship/fixtures/expect.json +9 -0
- package/template/base/connectors/biteship/fixtures/get_order.json +2 -0
- package/template/base/connectors/biteship/fixtures/get_rates.json +7 -0
- package/template/base/connectors/biteship/fixtures/get_tracking.json +7 -0
- package/template/base/connectors/biteship/fixtures/order_price.json +11 -0
- package/template/base/connectors/biteship/fixtures/order_status.json +15 -0
- package/template/base/connectors/biteship/fixtures/order_status_cancelled.json +15 -0
- package/template/base/connectors/biteship/fixtures/order_waybill.json +7 -0
- package/template/base/connectors/biteship/fixtures/search_areas.json +1 -0
- package/template/base/connectors/doku/connector.rk +128 -0
- package/template/base/connectors/doku/fixtures/create_checkout.json +6 -0
- package/template/base/connectors/doku/fixtures/expect.json +38 -0
- package/template/base/connectors/doku/fixtures/payment_notified.json +5 -0
- package/template/base/connectors/doku/fixtures/payment_notified_failed.json +3 -0
- package/template/base/connectors/doku/fixtures/payment_notified_no_type.json +3 -0
- package/template/base/connectors/doku/fixtures/payment_notified_null_type.json +3 -0
- package/template/base/connectors/doku/fixtures/payment_notified_refund.json +3 -0
- package/template/base/connectors/doku/mock/doku_mock.py +206 -0
- package/template/base/connectors/loyverse/connector.rk +98 -0
- package/template/base/connectors/moka/connector.rk +120 -0
- package/template/base/connectors/moka/fixtures/expect.json +44 -0
- package/template/base/connectors/moka/fixtures/latest_transactions.json +79 -0
- package/template/base/connectors/moka/fixtures/list_items.json +4 -0
- package/template/base/connectors/moka/fixtures/list_outlets.json +4 -0
- package/template/base/connectors/moka/fixtures/transaction_created.json +44 -0
- package/template/base/connectors/moka/fixtures/transaction_created_refund.json +39 -0
- package/template/base/connectors/moka/fixtures/transaction_created_refund_later.json +51 -0
- package/template/base/connectors/whatsapp_business/connector.rk +89 -0
- package/template/base/connectors/whatsapp_business/templates.md +32 -0
- package/template/base/connectors/xendit/connector.rk +184 -0
- package/template/base/docker-compose.yml +16 -0
- package/template/base/env.example +12 -0
- package/template/base/modules/accounting/flows/financial_report_compute.rk +47 -0
- package/template/base/modules/accounting/flows/financial_report_recompute.rk +47 -0
- package/template/base/modules/accounting/flows/gl_delivery_note_post.rk +37 -0
- package/template/base/modules/accounting/flows/gl_delivery_note_reverse.rk +194 -0
- package/template/base/modules/accounting/flows/gl_goods_receipt_post.rk +41 -0
- package/template/base/modules/accounting/flows/gl_goods_receipt_reverse.rk +194 -0
- package/template/base/modules/accounting/flows/gl_opening_balance_post.rk +132 -0
- package/template/base/modules/accounting/flows/gl_opening_balance_reverse.rk +194 -0
- package/template/base/modules/accounting/flows/gl_outlet_return_post.rk +38 -0
- package/template/base/modules/accounting/flows/gl_outlet_return_reverse.rk +194 -0
- package/template/base/modules/accounting/flows/gl_outlet_sales_post.rk +95 -0
- package/template/base/modules/accounting/flows/gl_outlet_sales_reverse.rk +194 -0
- package/template/base/modules/accounting/flows/gl_outlet_takings_post.rk +71 -0
- package/template/base/modules/accounting/flows/gl_outlet_takings_reverse.rk +194 -0
- package/template/base/modules/accounting/flows/gl_payment_post.rk +63 -0
- package/template/base/modules/accounting/flows/gl_payment_reverse.rk +194 -0
- package/template/base/modules/accounting/flows/gl_payroll_close_post.rk +89 -0
- package/template/base/modules/accounting/flows/gl_payroll_close_reverse.rk +194 -0
- package/template/base/modules/accounting/flows/gl_pos_sale_post.rk +95 -0
- package/template/base/modules/accounting/flows/gl_pos_sale_reverse.rk +194 -0
- package/template/base/modules/accounting/flows/gl_pos_shift_close_post.rk +59 -0
- package/template/base/modules/accounting/flows/gl_pos_shift_close_reverse.rk +194 -0
- package/template/base/modules/accounting/flows/gl_production_batch_post.rk +62 -0
- package/template/base/modules/accounting/flows/gl_production_batch_reverse.rk +194 -0
- package/template/base/modules/accounting/flows/gl_project_expense_post.rk +64 -0
- package/template/base/modules/accounting/flows/gl_project_expense_reverse.rk +194 -0
- package/template/base/modules/accounting/flows/gl_rental_booking_post.rk +35 -0
- package/template/base/modules/accounting/flows/gl_rental_booking_reverse.rk +194 -0
- package/template/base/modules/accounting/flows/gl_rental_return_post.rk +47 -0
- package/template/base/modules/accounting/flows/gl_rental_return_reverse.rk +194 -0
- package/template/base/modules/accounting/flows/gl_sales_invoice_post.rk +95 -0
- package/template/base/modules/accounting/flows/gl_sales_invoice_reverse.rk +194 -0
- package/template/base/modules/accounting/flows/gl_sales_return_post.rk +40 -0
- package/template/base/modules/accounting/flows/gl_sales_return_reverse.rk +194 -0
- package/template/base/modules/accounting/flows/gl_stock_adjustment_post.rk +38 -0
- package/template/base/modules/accounting/flows/gl_stock_adjustment_reverse.rk +194 -0
- package/template/base/modules/accounting/flows/gl_stock_count_post.rk +38 -0
- package/template/base/modules/accounting/flows/gl_stock_count_reverse.rk +194 -0
- package/template/base/modules/accounting/flows/gl_stock_transfer_post.rk +38 -0
- package/template/base/modules/accounting/flows/gl_stock_transfer_receipt_post.rk +38 -0
- package/template/base/modules/accounting/flows/gl_stock_transfer_receipt_reverse.rk +194 -0
- package/template/base/modules/accounting/flows/gl_stock_transfer_reverse.rk +194 -0
- package/template/base/modules/accounting/flows/gl_timesheet_post.rk +35 -0
- package/template/base/modules/accounting/flows/gl_timesheet_reverse.rk +194 -0
- package/template/base/modules/accounting/flows/gl_vendor_bill_post.rk +63 -0
- package/template/base/modules/accounting/flows/gl_vendor_bill_reverse.rk +194 -0
- package/template/base/modules/accounting/imports/opening_balance_sheet.rk +22 -0
- package/template/base/modules/accounting/models/financial_report.rk +85 -0
- package/template/base/modules/accounting/models/gl_entry.rk +161 -0
- package/template/base/modules/accounting/models/opening_balance.rk +48 -0
- package/template/base/modules/accounting/models/period_close.rk +33 -0
- package/template/base/modules/accounting/module.rk +16 -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 +31 -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 +12 -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 +129 -0
- package/template/base/modules/catalogue/models/item_category.rk +27 -0
- package/template/base/modules/catalogue/models/price_list.rk +34 -0
- package/template/base/modules/catalogue/models/price_list_item.rk +21 -0
- package/template/base/modules/catalogue/models/uom.rk +34 -0
- package/template/base/modules/catalogue/models/uom_conversion.rk +44 -0
- package/template/base/modules/catalogue/module.rk +11 -0
- package/template/base/modules/consignment/flows/consignment_bill.rk +39 -0
- package/template/base/modules/consignment/flows/consignment_bill_cancelled.rk +14 -0
- package/template/base/modules/consignment/models/consignment_settlement.rk +111 -0
- package/template/base/modules/consignment/models/consignment_settlement_item.rk +37 -0
- package/template/base/modules/consignment/module.rk +15 -0
- package/template/base/modules/contacts/imports/customer_list.rk +17 -0
- package/template/base/modules/contacts/imports/vendor_list.rk +16 -0
- package/template/base/modules/contacts/models/contact_person.rk +21 -0
- package/template/base/modules/contacts/models/credit_guard.rk +40 -0
- package/template/base/modules/contacts/models/customer.rk +180 -0
- package/template/base/modules/contacts/models/vendor.rk +104 -0
- package/template/base/modules/contacts/module.rk +10 -0
- package/template/base/modules/coretax/models/tax_period.rk +89 -0
- package/template/base/modules/coretax/module.rk +13 -0
- package/template/base/modules/coretax/print/coretax_bupot.rk +26 -0
- package/template/base/modules/coretax/print/coretax_bupot.xml +28 -0
- package/template/base/modules/coretax/print/coretax_faktur.rk +34 -0
- package/template/base/modules/coretax/print/coretax_faktur.xml +58 -0
- package/template/base/modules/courses/flows/charge_cancel_guard.rk +23 -0
- package/template/base/modules/courses/flows/charge_invoice_on_submit.rk +56 -0
- package/template/base/modules/courses/flows/enrollment_seats_on_create.rk +15 -0
- package/template/base/modules/courses/flows/enrollment_seats_on_update.rk +35 -0
- package/template/base/modules/courses/flows/invoice_course_once.rk +22 -0
- package/template/base/modules/courses/flows/invoice_course_tag_lock.rk +16 -0
- package/template/base/modules/courses/flows/session_fill_attendance.rk +16 -0
- package/template/base/modules/courses/flows/student_billing_on_create.rk +25 -0
- package/template/base/modules/courses/models/course_attendance.rk +22 -0
- package/template/base/modules/courses/models/course_batch.rk +119 -0
- package/template/base/modules/courses/models/course_batch_slot.rk +18 -0
- package/template/base/modules/courses/models/course_charge.rk +125 -0
- package/template/base/modules/courses/models/course_guard.rk +50 -0
- package/template/base/modules/courses/models/course_program.rk +101 -0
- package/template/base/modules/courses/models/course_session.rk +93 -0
- package/template/base/modules/courses/models/enrollment.rk +136 -0
- package/template/base/modules/courses/models/student.rk +68 -0
- package/template/base/modules/courses/module.rk +14 -0
- package/template/base/modules/courses/roles/instructor.rk +7 -0
- package/template/base/modules/currency/models/currency.rk +34 -0
- package/template/base/modules/currency/models/exchange_rate.rk +39 -0
- package/template/base/modules/currency/module.rk +10 -0
- package/template/base/modules/delivery/flows/delivery_cancel_guard.rk +18 -0
- package/template/base/modules/delivery/flows/fulfilment_on_delivery_cancelled.rk +21 -0
- package/template/base/modules/delivery/flows/fulfilment_on_delivery_submitted.rk +28 -0
- package/template/base/modules/delivery/flows/fulfilment_on_invoice_cancelled.rk +22 -0
- package/template/base/modules/delivery/flows/fulfilment_on_invoice_submitted.rk +22 -0
- package/template/base/modules/delivery/flows/fulfilment_on_order_created.rk +18 -0
- package/template/base/modules/delivery/flows/fulfilment_on_order_submitted.rk +16 -0
- package/template/base/modules/delivery/flows/fulfilment_on_order_updated.rk +19 -0
- package/template/base/modules/delivery/flows/fulfilment_on_return_cancelled.rk +16 -0
- package/template/base/modules/delivery/flows/fulfilment_on_return_submitted.rk +16 -0
- package/template/base/modules/delivery/flows/invoice_qty_from_deliveries.rk +20 -0
- package/template/base/modules/delivery/flows/order_cancel_guard.rk +10 -0
- package/template/base/modules/delivery/flows/return_cancel_guard.rk +11 -0
- package/template/base/modules/delivery/flows/return_credit_on_payment_cancelled.rk +11 -0
- package/template/base/modules/delivery/flows/return_credit_on_payment_submitted.rk +21 -0
- package/template/base/modules/delivery/flows/return_credit_on_return_cancelled.rk +11 -0
- package/template/base/modules/delivery/flows/return_credit_on_return_submitted.rk +10 -0
- package/template/base/modules/delivery/models/delivery_guard.rk +48 -0
- package/template/base/modules/delivery/models/delivery_note.rk +101 -0
- package/template/base/modules/delivery/models/delivery_note_item.rk +11 -0
- package/template/base/modules/delivery/models/order_fulfilment.rk +27 -0
- package/template/base/modules/delivery/models/order_fulfilment_item.rk +10 -0
- package/template/base/modules/delivery/models/return_credit.rk +23 -0
- package/template/base/modules/delivery/models/sales_return.rk +87 -0
- package/template/base/modules/delivery/models/sales_return_item.rk +16 -0
- package/template/base/modules/delivery/module.rk +16 -0
- package/template/base/modules/delivery/print/delivery_note.html +96 -0
- package/template/base/modules/delivery/print/delivery_note.rk +9 -0
- package/template/base/modules/distribution/flows/credit_on_invoice_cancelled.rk +17 -0
- package/template/base/modules/distribution/flows/credit_on_invoice_submitted.rk +17 -0
- package/template/base/modules/distribution/flows/credit_on_order_cancelled.rk +17 -0
- package/template/base/modules/distribution/flows/credit_on_order_submitted.rk +25 -0
- package/template/base/modules/distribution/flows/credit_on_payment_cancelled.rk +17 -0
- package/template/base/modules/distribution/flows/credit_on_payment_submitted.rk +17 -0
- package/template/base/modules/distribution/flows/giro_bounced.rk +20 -0
- package/template/base/modules/distribution/flows/giro_from_payment.rk +21 -0
- package/template/base/modules/distribution/flows/order_tier_pricing_created.rk +17 -0
- package/template/base/modules/distribution/flows/order_tier_pricing_updated.rk +17 -0
- package/template/base/modules/distribution/models/giro.rk +79 -0
- package/template/base/modules/distribution/module.rk +14 -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/payment_instruction_on_submit.rk +25 -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/flows/sales_invoice_credit_recheck.rk +18 -0
- package/template/base/modules/invoicing/models/bank_account.rk +134 -0
- package/template/base/modules/invoicing/models/invoice_reminder.rk +83 -0
- package/template/base/modules/invoicing/models/payment_instruction.rk +72 -0
- package/template/base/modules/invoicing/models/sales_invoice.rk +480 -0
- package/template/base/modules/invoicing/models/sales_invoice_item.rk +53 -0
- package/template/base/modules/invoicing/module.rk +14 -0
- package/template/base/modules/invoicing/print/sales_invoice.html +163 -0
- package/template/base/modules/invoicing/print/sales_invoice.rk +14 -0
- package/template/base/modules/invoicing/print/sales_invoice_nota.html +71 -0
- package/template/base/modules/invoicing/print/sales_invoice_nota.rk +13 -0
- package/template/base/modules/invoicing/print/sales_invoice_whatsapp.html +45 -0
- package/template/base/modules/invoicing/print/sales_invoice_whatsapp.rk +15 -0
- package/template/base/modules/kitchen/flows/kitchen_ticket_on_sale.rk +29 -0
- package/template/base/modules/kitchen/flows/kitchen_ticket_on_update.rk +26 -0
- package/template/base/modules/kitchen/flows/kitchen_ticket_on_void.rk +15 -0
- package/template/base/modules/kitchen/models/kitchen_guard.rk +35 -0
- package/template/base/modules/kitchen/models/kitchen_route.rk +26 -0
- package/template/base/modules/kitchen/models/kitchen_station.rk +40 -0
- package/template/base/modules/kitchen/models/kitchen_ticket.rk +78 -0
- package/template/base/modules/kitchen/models/kitchen_ticket_item.rk +10 -0
- package/template/base/modules/kitchen/module.rk +18 -0
- package/template/base/modules/kitchen/print/kitchen_ticket.html +29 -0
- package/template/base/modules/kitchen/print/kitchen_ticket.rk +9 -0
- package/template/base/modules/kitchen/roles/kitchen.rk +6 -0
- package/template/base/modules/kitchen/screens/dapur.rk +22 -0
- package/template/base/modules/orders/models/customer_order.rk +186 -0
- package/template/base/modules/orders/models/customer_order_item.rk +49 -0
- package/template/base/modules/orders/module.rk +14 -0
- package/template/base/modules/outlet_sales/flows/moka_daily_sales.rk +57 -0
- package/template/base/modules/outlet_sales/flows/moka_legacy_key_overlap.rk +22 -0
- package/template/base/modules/outlet_sales/flows/moka_line_mapped.rk +14 -0
- package/template/base/modules/outlet_sales/flows/moka_transaction_staged.rk +90 -0
- package/template/base/modules/outlet_sales/flows/refund_on_return_cancelled.rk +15 -0
- package/template/base/modules/outlet_sales/flows/refund_on_return_submitted.rk +26 -0
- package/template/base/modules/outlet_sales/flows/refund_on_sales_submitted.rk +14 -0
- package/template/base/modules/outlet_sales/flows/sales_cancel_guard.rk +14 -0
- package/template/base/modules/outlet_sales/imports/daily_form.rk +22 -0
- package/template/base/modules/outlet_sales/imports/loyverse_receipts.rk +28 -0
- package/template/base/modules/outlet_sales/imports/moka_item_details.rk +34 -0
- 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/moka_sale_line.rk +53 -0
- package/template/base/modules/outlet_sales/models/moka_transaction.rk +26 -0
- package/template/base/modules/outlet_sales/models/outlet_return.rk +66 -0
- package/template/base/modules/outlet_sales/models/outlet_return_item.rk +7 -0
- package/template/base/modules/outlet_sales/models/outlet_sales.rk +176 -0
- package/template/base/modules/outlet_sales/models/outlet_sales_guard.rk +35 -0
- package/template/base/modules/outlet_sales/models/outlet_sales_line.rk +40 -0
- package/template/base/modules/outlet_sales/models/outlet_takings.rk +85 -0
- package/template/base/modules/outlet_sales/models/outlet_takings_line.rk +37 -0
- package/template/base/modules/outlet_sales/models/pos_refund.rk +33 -0
- package/template/base/modules/outlet_sales/models/pos_refund_item.rk +9 -0
- package/template/base/modules/outlet_sales/module.rk +12 -0
- package/template/base/modules/outlets/models/outlet.rk +84 -0
- package/template/base/modules/outlets/module.rk +10 -0
- package/template/base/modules/payments/flows/payment_from_doku.rk +73 -0
- package/template/base/modules/payments/flows/payment_from_xendit_invoice.rk +59 -0
- package/template/base/modules/payments/flows/payment_from_xendit_qr.rk +59 -0
- package/template/base/modules/payments/flows/payment_from_xendit_va.rk +59 -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 +215 -0
- package/template/base/modules/payments/models/payment_allocation.rk +35 -0
- package/template/base/modules/payments/models/withholding.rk +76 -0
- package/template/base/modules/payments/module.rk +13 -0
- package/template/base/modules/payments/print/statement.html +55 -0
- package/template/base/modules/payments/print/statement.rk +13 -0
- package/template/base/modules/payroll/flows/invoice_payroll_once.rk +20 -0
- package/template/base/modules/payroll/flows/invoice_payroll_tag_lock.rk +13 -0
- package/template/base/modules/payroll/flows/payroll_close_on_cancel.rk +35 -0
- package/template/base/modules/payroll/flows/payroll_close_on_submit.rk +66 -0
- package/template/base/modules/payroll/flows/payroll_run_overlap_guard_created.rk +14 -0
- package/template/base/modules/payroll/flows/payroll_run_overlap_guard_updated.rk +14 -0
- package/template/base/modules/payroll/flows/payroll_totals_on_payslip_cancel.rk +29 -0
- package/template/base/modules/payroll/flows/payroll_totals_on_payslip_submit.rk +29 -0
- package/template/base/modules/payroll/flows/payslip_cancel_guard.rk +14 -0
- package/template/base/modules/payroll/flows/payslip_from_recap.rk +47 -0
- package/template/base/modules/payroll/flows/payslip_month_guard_created.rk +16 -0
- package/template/base/modules/payroll/flows/payslip_month_guard_submitted.rk +16 -0
- package/template/base/modules/payroll/flows/payslip_order_guard_cancelled.rk +15 -0
- package/template/base/modules/payroll/flows/payslip_order_guard_submitted.rk +15 -0
- package/template/base/modules/payroll/flows/payslip_pay_overlap_guard.rk +15 -0
- package/template/base/modules/payroll/flows/payslip_ytd_guard.rk +16 -0
- package/template/base/modules/payroll/flows/payslip_ytd_on_create.rk +20 -0
- package/template/base/modules/payroll/flows/recap_cancel_guard.rk +15 -0
- package/template/base/modules/payroll/models/payroll_close.rk +80 -0
- package/template/base/modules/payroll/models/payroll_guard.rk +74 -0
- package/template/base/modules/payroll/models/payroll_profile.rk +136 -0
- package/template/base/modules/payroll/models/payroll_run.rk +220 -0
- package/template/base/modules/payroll/models/payslip.rk +293 -0
- package/template/base/modules/payroll/module.rk +13 -0
- package/template/base/modules/payroll/print/payslip.html +53 -0
- package/template/base/modules/payroll/print/payslip.rk +7 -0
- package/template/base/modules/pipeline/flows/morning_follow_up.rk +10 -0
- package/template/base/modules/pipeline/flows/whatsapp_to_lead.rk +24 -0
- package/template/base/modules/pipeline/models/activity.rk +83 -0
- package/template/base/modules/pipeline/models/deal.rk +139 -0
- package/template/base/modules/pipeline/models/lead.rk +119 -0
- package/template/base/modules/pipeline/module.rk +12 -0
- package/template/base/modules/pos/flows/pos_daily_form_guard.rk +18 -0
- package/template/base/modules/pos/flows/pos_sale_on_cancel.rk +33 -0
- package/template/base/modules/pos/flows/pos_sale_on_submit.rk +46 -0
- package/template/base/modules/pos/flows/pos_shift_close_on_cancel.rk +26 -0
- package/template/base/modules/pos/flows/pos_shift_close_on_submit.rk +23 -0
- package/template/base/modules/pos/flows/pos_shift_on_create.rk +21 -0
- package/template/base/modules/pos/flows/pos_shift_on_update.rk +10 -0
- package/template/base/modules/pos/flows/pos_takings_guard.rk +28 -0
- package/template/base/modules/pos/models/pos_guard.rk +76 -0
- package/template/base/modules/pos/models/pos_payment.rk +17 -0
- package/template/base/modules/pos/models/pos_sale.rk +222 -0
- package/template/base/modules/pos/models/pos_sale_item.rk +43 -0
- package/template/base/modules/pos/models/pos_shift.rk +92 -0
- package/template/base/modules/pos/models/pos_shift_close.rk +77 -0
- package/template/base/modules/pos/module.rk +22 -0
- package/template/base/modules/pos/print/pos_receipt.html +50 -0
- package/template/base/modules/pos/print/pos_receipt.rk +9 -0
- package/template/base/modules/pos/screens/kasir.rk +41 -0
- 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 +85 -0
- package/template/base/modules/procurement/models/goods_receipt_item.rk +42 -0
- package/template/base/modules/procurement/models/purchase_order.rk +156 -0
- package/template/base/modules/procurement/models/purchase_order_item.rk +46 -0
- package/template/base/modules/procurement/models/purchase_request.rk +91 -0
- package/template/base/modules/procurement/models/purchase_request_item.rk +35 -0
- package/template/base/modules/procurement/models/vendor_bill.rk +272 -0
- package/template/base/modules/procurement/models/vendor_bill_item.rk +33 -0
- package/template/base/modules/procurement/module.rk +14 -0
- package/template/base/modules/procurement/print/purchase_order.html +120 -0
- package/template/base/modules/procurement/print/purchase_order.rk +7 -0
- package/template/base/modules/production/flows/batch_cancel_guard.rk +12 -0
- package/template/base/modules/production/flows/batch_from_bom.rk +19 -0
- package/template/base/modules/production/flows/wage_sheet_on_batch_cancelled.rk +14 -0
- package/template/base/modules/production/flows/wage_sheet_on_batch_submitted.rk +12 -0
- package/template/base/modules/production/flows/work_order_materials_created.rk +20 -0
- package/template/base/modules/production/flows/work_order_materials_updated.rk +20 -0
- package/template/base/modules/production/models/bom.rk +67 -0
- package/template/base/modules/production/models/bom_byproduct.rk +7 -0
- package/template/base/modules/production/models/bom_line.rk +11 -0
- package/template/base/modules/production/models/production_batch.rk +149 -0
- package/template/base/modules/production/models/production_guard.rk +23 -0
- package/template/base/modules/production/models/production_labour.rk +10 -0
- package/template/base/modules/production/models/production_material.rk +8 -0
- package/template/base/modules/production/models/production_output.rk +8 -0
- package/template/base/modules/production/models/production_stage.rk +19 -0
- package/template/base/modules/production/models/wage_line.rk +15 -0
- package/template/base/modules/production/models/wage_sheet.rk +28 -0
- package/template/base/modules/production/models/work_order.rk +63 -0
- package/template/base/modules/production/models/work_order_material.rk +8 -0
- package/template/base/modules/production/module.rk +17 -0
- package/template/base/modules/production/print/wage_sheet.html +75 -0
- package/template/base/modules/production/print/wage_sheet.rk +9 -0
- package/template/base/modules/projects/flows/attendance_close_cancel_guard.rk +15 -0
- package/template/base/modules/projects/flows/attendance_close_on_submit.rk +64 -0
- package/template/base/modules/projects/flows/attendance_log_cancel_guard.rk +14 -0
- package/template/base/modules/projects/flows/attendance_log_guard_created.rk +15 -0
- package/template/base/modules/projects/flows/attendance_log_guard_submitted.rk +34 -0
- package/template/base/modules/projects/flows/attendance_log_guard_updated.rk +14 -0
- package/template/base/modules/projects/flows/milestone_back_on_acceptance_cancel.rk +15 -0
- package/template/base/modules/projects/flows/milestone_lock_on_update.rk +16 -0
- package/template/base/modules/projects/flows/milestone_ready_on_acceptance.rk +40 -0
- package/template/base/modules/projects/flows/milestone_scheduled_on_create.rk +14 -0
- package/template/base/modules/projects/flows/milestone_scheduled_on_update.rk +27 -0
- package/template/base/modules/projects/flows/project_expense_on_cancel.rk +21 -0
- package/template/base/modules/projects/flows/project_expense_on_submit.rk +16 -0
- package/template/base/modules/projects/flows/project_labor_on_cancel.rk +22 -0
- package/template/base/modules/projects/flows/project_labor_on_submit.rk +17 -0
- package/template/base/modules/projects/flows/project_terms_lock.rk +26 -0
- package/template/base/modules/projects/flows/timesheet_assignment_on_create.rk +28 -0
- package/template/base/modules/projects/flows/timesheet_attendance_overlap_guard.rk +20 -0
- package/template/base/modules/projects/flows/vendor_bill_cancel_guard.rk +15 -0
- package/template/base/modules/projects/imports/attendance_recap.rk +23 -0
- package/template/base/modules/projects/imports/billing_milestone.rk +20 -0
- package/template/base/modules/projects/models/acceptance.rk +68 -0
- package/template/base/modules/projects/models/assignment.rk +116 -0
- package/template/base/modules/projects/models/attendance_close.rk +63 -0
- package/template/base/modules/projects/models/attendance_guard.rk +57 -0
- package/template/base/modules/projects/models/attendance_log.rk +266 -0
- package/template/base/modules/projects/models/billing_milestone.rk +217 -0
- package/template/base/modules/projects/models/project.rk +155 -0
- package/template/base/modules/projects/models/project_expense.rk +121 -0
- package/template/base/modules/projects/models/project_guard.rk +27 -0
- package/template/base/modules/projects/models/project_ledger.rk +146 -0
- package/template/base/modules/projects/models/timesheet.rk +167 -0
- package/template/base/modules/projects/models/work_site.rk +73 -0
- package/template/base/modules/projects/module.rk +11 -0
- package/template/base/modules/projects/roles/field_worker.rk +7 -0
- package/template/base/modules/projects/roles/site_supervisor.rk +7 -0
- package/template/base/modules/quotation/models/quotation.rk +201 -0
- package/template/base/modules/quotation/models/quotation_item.rk +37 -0
- package/template/base/modules/quotation/module.rk +14 -0
- package/template/base/modules/quotation/print/quotation.html +65 -0
- package/template/base/modules/quotation/print/quotation.rk +7 -0
- package/template/base/modules/rental/flows/rental_booking_on_cancel.rk +19 -0
- package/template/base/modules/rental/flows/rental_booking_on_submit.rk +45 -0
- package/template/base/modules/rental/flows/rental_checkout_on_cancel.rk +24 -0
- package/template/base/modules/rental/flows/rental_checkout_on_submit.rk +33 -0
- package/template/base/modules/rental/flows/rental_invoice_once.rk +20 -0
- package/template/base/modules/rental/flows/rental_invoice_tag_lock.rk +12 -0
- package/template/base/modules/rental/flows/rental_return_on_cancel.rk +26 -0
- package/template/base/modules/rental/flows/rental_return_on_submit.rk +45 -0
- package/template/base/modules/rental/models/rental_booking.rk +124 -0
- package/template/base/modules/rental/models/rental_checkout.rk +96 -0
- package/template/base/modules/rental/models/rental_checkout_unit.rk +22 -0
- package/template/base/modules/rental/models/rental_guard.rk +93 -0
- package/template/base/modules/rental/models/rental_item.rk +83 -0
- package/template/base/modules/rental/models/rental_return.rk +142 -0
- package/template/base/modules/rental/models/rental_return_unit.rk +29 -0
- package/template/base/modules/rental/models/rental_schedule.rk +51 -0
- package/template/base/modules/rental/models/rental_unit.rk +73 -0
- package/template/base/modules/rental/module.rk +25 -0
- package/template/base/modules/rental/print/rental_bast_in.html +107 -0
- package/template/base/modules/rental/print/rental_bast_in.rk +9 -0
- package/template/base/modules/rental/print/rental_bast_out.html +98 -0
- package/template/base/modules/rental/print/rental_bast_out.rk +11 -0
- package/template/base/modules/rental/roles/rental_staff.rk +7 -0
- package/template/base/modules/stock/flows/adjustment_value_backfill.rk +95 -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/flows/stock_negative_alert.rk +15 -0
- package/template/base/modules/stock/models/recipe.rk +68 -0
- package/template/base/modules/stock/models/recipe_line.rk +24 -0
- package/template/base/modules/stock/models/stock_adjustment.rk +62 -0
- package/template/base/modules/stock/models/stock_adjustment_item.rk +32 -0
- package/template/base/modules/stock/models/stock_adjustment_value.rk +79 -0
- package/template/base/modules/stock/models/stock_balance.rk +27 -0
- package/template/base/modules/stock/models/stock_count.rk +54 -0
- package/template/base/modules/stock/models/stock_count_item.rk +33 -0
- package/template/base/modules/stock/models/stock_move.rk +53 -0
- package/template/base/modules/stock/models/stock_transfer.rk +70 -0
- package/template/base/modules/stock/models/stock_transfer_item.rk +34 -0
- package/template/base/modules/stock/models/stock_transfer_receipt.rk +57 -0
- package/template/base/modules/stock/models/stock_transfer_receipt_item.rk +18 -0
- package/template/base/modules/stock/module.rk +13 -0
- package/template/base/modules/subscriptions/flows/collector_deposit_on_submit.rk +57 -0
- package/template/base/modules/subscriptions/flows/deposit_payment_kept.rk +17 -0
- package/template/base/modules/subscriptions/flows/deposit_payment_not_cancelled.rk +14 -0
- package/template/base/modules/subscriptions/flows/deposit_payment_not_deleted.rk +14 -0
- package/template/base/modules/subscriptions/flows/field_collection_cap_created.rk +24 -0
- package/template/base/modules/subscriptions/flows/field_collection_cap_updated.rk +24 -0
- package/template/base/modules/subscriptions/flows/field_collection_locked.rk +12 -0
- package/template/base/modules/subscriptions/flows/field_collection_not_deleted.rk +10 -0
- package/template/base/modules/subscriptions/flows/invoice_subscription_kept.rk +19 -0
- package/template/base/modules/subscriptions/flows/invoice_subscription_once.rk +34 -0
- package/template/base/modules/subscriptions/flows/invoice_subscription_tag_lock.rk +13 -0
- package/template/base/modules/subscriptions/flows/service_area_collector.rk +14 -0
- package/template/base/modules/subscriptions/flows/subscription_billing.rk +79 -0
- package/template/base/modules/subscriptions/flows/subscription_dunning.rk +81 -0
- package/template/base/modules/subscriptions/flows/subscription_extra_locked.rk +14 -0
- package/template/base/modules/subscriptions/flows/subscription_status_on_payment.rk +48 -0
- package/template/base/modules/subscriptions/models/collector_deposit.rk +36 -0
- package/template/base/modules/subscriptions/models/field_collection.rk +42 -0
- package/template/base/modules/subscriptions/models/service_area.rk +19 -0
- package/template/base/modules/subscriptions/models/subscription.rk +233 -0
- package/template/base/modules/subscriptions/models/subscription_bill.rk +48 -0
- package/template/base/modules/subscriptions/models/subscription_extra.rk +50 -0
- package/template/base/modules/subscriptions/models/subscription_guard.rk +65 -0
- package/template/base/modules/subscriptions/models/subscription_month.rk +29 -0
- package/template/base/modules/subscriptions/models/subscription_plan.rk +75 -0
- package/template/base/modules/subscriptions/models/subscription_status_log.rk +27 -0
- package/template/base/modules/subscriptions/module.rk +18 -0
- package/template/base/modules/subscriptions/roles/collector.rk +7 -0
- package/template/base/modules/tax_id/models/tax_code.rk +49 -0
- package/template/base/modules/tax_id/module.rk +10 -0
- package/template/base/modules/users/models/user.rk +29 -0
- package/template/base/modules/users/module.rk +10 -0
- package/template/base/modules/users/roles/cashier.rk +8 -0
- package/template/base/modules/users/roles/course_admin.rk +4 -0
- package/template/base/modules/users/roles/field_sales.rk +7 -0
- package/template/base/modules/users/roles/finance_manager.rk +4 -0
- package/template/base/modules/users/roles/head_office.rk +4 -0
- package/template/base/modules/users/roles/outlet_staff.rk +6 -0
- package/template/base/modules/users/roles/project_admin.rk +4 -0
- package/template/base/modules/users/roles/purchasing_manager.rk +4 -0
- package/template/base/modules/users/roles/sales_manager.rk +4 -0
- package/template/base/modules/users/roles/sales_rep.rk +4 -0
- package/template/base/modules/workforce/imports/worker_list.rk +21 -0
- package/template/base/modules/workforce/models/certification.rk +25 -0
- package/template/base/modules/workforce/models/worker.rk +94 -0
- package/template/base/modules/workforce/module.rk +10 -0
- package/template/base/package.json +17 -0
- package/template/blank/fixtures/start.rk +5 -0
- package/template/blank/site/config.rk +13 -0
- package/template/blank/site/custom/README.md +2 -0
- package/template/blank/site/features.rk +13 -0
- package/template/blank/site/layouts/main.rk +14 -0
- package/template/blank/site/system.rk +20 -0
- package/template/blank/site/themes/main.rk +8 -0
- package/template/demo/fixtures/crm_demo.rk +168 -0
- package/template/demo/fixtures/demo.rk +417 -0
- package/template/demo/site/config.rk +13 -0
- package/template/demo/site/features.rk +13 -0
- package/template/demo/site/layouts/crm_first.rk +23 -0
- package/template/demo/site/system.rk +26 -0
- package/template/demo/site/themes/kopi_senja.rk +10 -0
- 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,14 @@
|
|
|
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
|
+
summary:
|
|
6
|
+
id: Kirim penawaran harga ke pelanggan sebelum jadi pesanan.
|
|
7
|
+
en: Send price quotations to customers before they become orders.
|
|
8
|
+
category: sales
|
|
9
|
+
icon: file-text-line
|
|
10
|
+
requires: {rangka: '>=0.5', users: ^1.0, contacts: ^1.0, catalogue: ^1.0}
|
|
11
|
+
optional: {tax_id: ^1.0, currency: ^1.0}
|
|
12
|
+
# Semantics fixed in docs/kernel-hooks.md. orders.from_quotation is declared here because the make_order action lives
|
|
13
|
+
# on quotation; the hook is implemented with the orders module.
|
|
14
|
+
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 { border-bottom: 1px solid #1c1917; color: #57534e; font-weight: 600; }
|
|
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,19 @@
|
|
|
1
|
+
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/flow.json
|
|
2
|
+
name: rental_booking_on_cancel
|
|
3
|
+
label: {id: Pesanan sewa dibatalkan}
|
|
4
|
+
# Only a booking whose equipment has not gone out can be cancelled, and only while its rent invoice is not submitted
|
|
5
|
+
# (cancel that first). The schedule row becomes cancelled, which frees the units. The deposit journal is reversed by
|
|
6
|
+
# gl_rental_booking_reverse (paid back in full).
|
|
7
|
+
on: rental_booking.cancelled
|
|
8
|
+
steps:
|
|
9
|
+
- {find: rental_schedule, where: booking == event.name, as: s}
|
|
10
|
+
- {find: sales_invoice, where: "docstatus == 1 && notes.contains('(' + event.name + ')')", as: inv}
|
|
11
|
+
- create: rental_guard
|
|
12
|
+
if: s != null && s.state != 'booked'
|
|
13
|
+
set: {reason: "'in_use'", document: event.name}
|
|
14
|
+
- create: rental_guard
|
|
15
|
+
if: inv != null
|
|
16
|
+
set: {reason: "'invoice_submitted'", document: event.name}
|
|
17
|
+
- update: s
|
|
18
|
+
if: s != null
|
|
19
|
+
set: {state: "'cancelled'"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/flow.json
|
|
2
|
+
name: rental_booking_on_submit
|
|
3
|
+
label: {id: 'Pesanan sewa diajukan: cek unit dan buat jadwal'}
|
|
4
|
+
# Runs inside the booking's submit, as the person submitting it. Reading rental_schedule takes the flow read lock of
|
|
5
|
+
# contract 0025 (org + model), so two bookings submitted at the same moment run one after the other and the second
|
|
6
|
+
# one sees the first one's schedule row. The busiest day of the range is at the start of the range or at the start
|
|
7
|
+
# of an overlapping booking: peak = the most units booked on one of those days. Equipment still out after its end
|
|
8
|
+
# date counts as out until tomorrow. A booking that would need more than the item's units creates a rental_guard
|
|
9
|
+
# (over_capacity), whose rule refuses the whole submit. Then the schedule row and a draft rent invoice (a flow cannot
|
|
10
|
+
# submit) whose notes carry the booking number in ().
|
|
11
|
+
on: rental_booking.submitted
|
|
12
|
+
steps:
|
|
13
|
+
- {find: rental_item, where: name == event.rental_item, as: ri}
|
|
14
|
+
- find_all: rental_schedule
|
|
15
|
+
where: >-
|
|
16
|
+
rental_item == event.rental_item && state in ['booked', 'out'] && start_date < event.end_date
|
|
17
|
+
&& (state == 'out' && end_date <= today() ? today() + duration(1) : end_date) > event.start_date
|
|
18
|
+
as: ov
|
|
19
|
+
- create: rental_guard
|
|
20
|
+
if: >-
|
|
21
|
+
(ov.size() == 0 ? 0 : max(ov.map(h, ov.filter(x,
|
|
22
|
+
x.start_date <= (h.start_date > event.start_date ? h.start_date : event.start_date)
|
|
23
|
+
&& (x.state == 'out' && x.end_date <= today() ? today() + duration(1) : x.end_date) > (h.start_date > event.start_date ? h.start_date : event.start_date)
|
|
24
|
+
).map(x, x.qty).sum()))) + event.qty > ri.units
|
|
25
|
+
set:
|
|
26
|
+
reason: "'over_capacity'"
|
|
27
|
+
document: event.name
|
|
28
|
+
- create: rental_schedule
|
|
29
|
+
set:
|
|
30
|
+
booking: event.name
|
|
31
|
+
customer: event.customer
|
|
32
|
+
rental_item: event.rental_item
|
|
33
|
+
qty: event.qty
|
|
34
|
+
start_date: event.start_date
|
|
35
|
+
end_date: event.end_date
|
|
36
|
+
deposit: event.deposit
|
|
37
|
+
state: "'booked'"
|
|
38
|
+
- create: sales_invoice
|
|
39
|
+
if: event.rent_amount > 0
|
|
40
|
+
set:
|
|
41
|
+
customer: event.customer
|
|
42
|
+
posting_date: event.start_date
|
|
43
|
+
notes: "'Sewa ' + ri.title + ' (' + event.name + ')'"
|
|
44
|
+
items: >-
|
|
45
|
+
[{'item': ri.item, 'description': 'Sewa ' + ri.title + ' ' + string(event.qty) + ' unit, ' + event.start_date + ' s.d. ' + event.end_date + ' (' + string(event.days) + ' hari)', 'qty': event.qty * event.days, 'rate': event.daily_rate}]
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/flow.json
|
|
2
|
+
name: rental_checkout_on_cancel
|
|
3
|
+
label: {id: Alat keluar dibatalkan}
|
|
4
|
+
# A checkout entered by mistake: the schedule goes back to booked, refused once the equipment is recorded as returned.
|
|
5
|
+
# Its units go back to the warehouse (refused for a unit that another document has moved since).
|
|
6
|
+
on: rental_checkout.cancelled
|
|
7
|
+
steps:
|
|
8
|
+
- {find: rental_schedule, where: booking == event.booking, as: s}
|
|
9
|
+
- create: rental_guard
|
|
10
|
+
if: s == null || s.state != 'out' || s.checkout != event.name
|
|
11
|
+
set: {reason: "'already_returned'", document: event.name}
|
|
12
|
+
- update: s
|
|
13
|
+
if: s != null
|
|
14
|
+
set: {state: "'booked'", out_date: "null", checkout: "''"}
|
|
15
|
+
- for_each: event.units
|
|
16
|
+
as: row
|
|
17
|
+
do:
|
|
18
|
+
- {find: rental_unit, where: name == row.unit, as: u}
|
|
19
|
+
- create: rental_guard
|
|
20
|
+
if: "u == null || u.state != 'out' || u.booking != event.booking || u.last_checkout != event.name"
|
|
21
|
+
set: {reason: "'unit_moved'", document: event.name}
|
|
22
|
+
- update: u
|
|
23
|
+
if: u != null
|
|
24
|
+
set: {state: "'in'", booking: "''", last_checkout: "''"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/flow.json
|
|
2
|
+
name: rental_checkout_on_submit
|
|
3
|
+
label: {id: Alat keluar dicatat}
|
|
4
|
+
# The booking must be waiting to go out (schedule booked): a second checkout of the same booking, or one of a
|
|
5
|
+
# cancelled booking, is refused. The units physically out (other bookings still out, also late ones) plus this one
|
|
6
|
+
# may not exceed the item's units. The schedule becomes out with the actual date. Reads rental_item before
|
|
7
|
+
# rental_schedule, then rental_unit, like every flow of this module (one lock order). Each unit on the checklist must
|
|
8
|
+
# be in the warehouse, still used, and not last recorded broken or lost; it becomes out with this booking, and its
|
|
9
|
+
# condition is the one on the checklist (kept as out_condition for a cancelled return).
|
|
10
|
+
on: rental_checkout.submitted
|
|
11
|
+
steps:
|
|
12
|
+
- {find: rental_item, where: name == event.rental_item, as: ri}
|
|
13
|
+
- {find: rental_schedule, where: booking == event.booking, as: s}
|
|
14
|
+
- {find_all: rental_schedule, where: "rental_item == event.rental_item && state == 'out'", as: out}
|
|
15
|
+
- create: rental_guard
|
|
16
|
+
if: s == null || s.state != 'booked'
|
|
17
|
+
set: {reason: "'not_booked'", document: event.name}
|
|
18
|
+
- create: rental_guard
|
|
19
|
+
if: s != null && ri != null && out.map(x, x.qty).sum() + s.qty > ri.units
|
|
20
|
+
set: {reason: "'still_out'", document: event.name}
|
|
21
|
+
- update: s
|
|
22
|
+
if: s != null
|
|
23
|
+
set: {state: "'out'", out_date: event.out_date, checkout: event.name}
|
|
24
|
+
- for_each: event.units
|
|
25
|
+
as: row
|
|
26
|
+
do:
|
|
27
|
+
- {find: rental_unit, where: name == row.unit, as: u}
|
|
28
|
+
- create: rental_guard
|
|
29
|
+
if: "u == null || u.state != 'in' || !u.active || u.condition == 'rusak' || u.condition == 'hilang'"
|
|
30
|
+
set: {reason: "'unit_busy'", document: event.name}
|
|
31
|
+
- update: u
|
|
32
|
+
if: u != null
|
|
33
|
+
set: {state: "'out'", booking: event.booking, condition: row.condition, out_condition: row.condition, last_checkout: event.name}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/flow.json
|
|
2
|
+
name: rental_invoice_once
|
|
3
|
+
label: {id: Satu faktur per pesanan sewa atau per alat kembali}
|
|
4
|
+
# The rent invoice of a booking carries its number in () (SWA-...), the invoice for what a deposit did not cover the
|
|
5
|
+
# return's (KBL-...); an invoice cannot link the rental module. Such an invoice is submitted only while that document
|
|
6
|
+
# is submitted (not a draft left behind by a cancel and amend) and when no other submitted invoice carries the same
|
|
7
|
+
# number, so a booking or a return is never billed twice (audit 2026-11-07-audit-sewa-alat, finding 1).
|
|
8
|
+
on: sales_invoice.submitted
|
|
9
|
+
if: event.notes.contains('SWA-') || event.notes.contains('KBL-')
|
|
10
|
+
steps:
|
|
11
|
+
- {find: rental_booking, where: "event.notes.contains('(' + name + ')')", as: b}
|
|
12
|
+
- {find: rental_return, where: "event.notes.contains('(' + name + ')')", as: r}
|
|
13
|
+
- find: sales_invoice
|
|
14
|
+
where: "name != event.name && docstatus == 1 && ((b != null && notes.contains('(' + b.name + ')')) || (r != null && notes.contains('(' + r.name + ')')))"
|
|
15
|
+
as: twin
|
|
16
|
+
- if: (b == null && r == null) || (b != null && b.docstatus != 1) || (r != null && r.docstatus != 1) || twin != null
|
|
17
|
+
create: rental_guard
|
|
18
|
+
set:
|
|
19
|
+
reason: "'invoice_stale'"
|
|
20
|
+
document: event.name
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/flow.json
|
|
2
|
+
name: rental_invoice_tag_lock
|
|
3
|
+
label: {id: Catatan faktur sewa dikunci}
|
|
4
|
+
# The guards of this module find a rental invoice by the document number in its notes. Nobody edits those notes by
|
|
5
|
+
# hand, or a submitted rent invoice would no longer hold back the booking's cancel (finding 2, the payroll pattern).
|
|
6
|
+
on: sales_invoice.updated
|
|
7
|
+
if: event.before != null && (event.before.notes.contains('SWA-') || event.before.notes.contains('KBL-')) && event.notes != event.before.notes
|
|
8
|
+
steps:
|
|
9
|
+
- create: rental_guard
|
|
10
|
+
set:
|
|
11
|
+
reason: "'invoice_tag'"
|
|
12
|
+
document: event.name
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/flow.json
|
|
2
|
+
name: rental_return_on_cancel
|
|
3
|
+
label: {id: Alat kembali dibatalkan}
|
|
4
|
+
# A return entered by mistake: the schedule goes back to out (the deposit journal is reversed by gl_rental_return_reverse),
|
|
5
|
+
# refused while the invoice for what the deposit did not cover is submitted (cancel that first). Its units go back out
|
|
6
|
+
# with the booking in the condition they left in, refused for a unit that went out again since.
|
|
7
|
+
on: rental_return.cancelled
|
|
8
|
+
steps:
|
|
9
|
+
- {find: rental_schedule, where: booking == event.booking, as: s}
|
|
10
|
+
- {find: sales_invoice, where: "docstatus == 1 && notes.contains('(' + event.name + ')')", as: inv}
|
|
11
|
+
- create: rental_guard
|
|
12
|
+
if: inv != null
|
|
13
|
+
set: {reason: "'invoice_submitted'", document: event.name}
|
|
14
|
+
- update: s
|
|
15
|
+
if: s != null && s.rental_return == event.name
|
|
16
|
+
set: {state: "'out'", returned_date: "null", rental_return: "''"}
|
|
17
|
+
- for_each: event.units
|
|
18
|
+
as: row
|
|
19
|
+
do:
|
|
20
|
+
- {find: rental_unit, where: name == row.unit, as: u}
|
|
21
|
+
- create: rental_guard
|
|
22
|
+
if: "u == null || u.state != 'in' || u.last_return != event.name"
|
|
23
|
+
set: {reason: "'unit_moved'", document: event.name}
|
|
24
|
+
- update: u
|
|
25
|
+
if: u != null
|
|
26
|
+
set: {state: "'out'", booking: event.booking, condition: u.out_condition, last_return: "''"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/flow.json
|
|
2
|
+
name: rental_return_on_submit
|
|
3
|
+
label: {id: Alat kembali dicatat}
|
|
4
|
+
# The equipment must be out: a return before the checkout, or a second return, is refused, and so is a return dated
|
|
5
|
+
# before the equipment went out. The schedule becomes returned with the actual date. The deposit journal (2-1400
|
|
6
|
+
# against 4-9200 and cash or bank) is gl_rental_return_post. What the deposit does not cover (in a PKP business: all
|
|
7
|
+
# of the fee, with PPN on the invoice) becomes a draft invoice whose notes carry this return's number in ().
|
|
8
|
+
# Units: the checklist must list exactly the units out with this booking (none for a booking that went out without a
|
|
9
|
+
# checklist); each goes back to the warehouse with the condition on the checklist (a lost one stays recorded hilang
|
|
10
|
+
# and cannot go out again until someone changes its condition).
|
|
11
|
+
on: rental_return.submitted
|
|
12
|
+
steps:
|
|
13
|
+
- {find: rental_item, where: name == event.rental_item, as: ri}
|
|
14
|
+
- {find: rental_schedule, where: booking == event.booking, as: s}
|
|
15
|
+
- {find_all: rental_unit, where: "booking == event.booking && state == 'out'", as: outs}
|
|
16
|
+
- create: rental_guard
|
|
17
|
+
if: outs.size() != event.units.size()
|
|
18
|
+
set: {reason: "'units_mismatch'", document: event.name}
|
|
19
|
+
- for_each: event.units
|
|
20
|
+
as: row
|
|
21
|
+
do:
|
|
22
|
+
- {find: rental_unit, where: name == row.unit, as: u}
|
|
23
|
+
- create: rental_guard
|
|
24
|
+
if: "u == null || u.state != 'out' || u.booking != event.booking"
|
|
25
|
+
set: {reason: "'unit_not_out'", document: event.name}
|
|
26
|
+
- update: u
|
|
27
|
+
if: u != null
|
|
28
|
+
set: {state: "'in'", booking: "''", condition: row.condition, last_return: event.name}
|
|
29
|
+
- create: rental_guard
|
|
30
|
+
if: s == null || s.state != 'out'
|
|
31
|
+
set: {reason: "'not_out'", document: event.name}
|
|
32
|
+
- create: rental_guard
|
|
33
|
+
if: s != null && s.out_date != null && s.out_date != '' && event.return_date < s.out_date
|
|
34
|
+
set: {reason: "'before_out'", document: event.name}
|
|
35
|
+
- update: s
|
|
36
|
+
if: s != null
|
|
37
|
+
set: {state: "'returned'", returned_date: event.return_date, rental_return: event.name}
|
|
38
|
+
- create: sales_invoice
|
|
39
|
+
if: event.extra_due > 0 && ri != null
|
|
40
|
+
set:
|
|
41
|
+
customer: event.customer
|
|
42
|
+
posting_date: event.return_date
|
|
43
|
+
notes: "'Denda dan kerusakan sewa ' + event.booking + ' (' + event.name + ')'"
|
|
44
|
+
items: >-
|
|
45
|
+
[{'item': ri.item, 'description': 'Denda telat ' + string(event.late_days) + ' hari dan kerusakan' + (event.deposit_kept ? ', setelah dipotong deposit' : ''), 'qty': 1, 'rate': event.extra_due}]
|