@rangka-os/create 0.0.0-stage → 0.5.0-alpha.10
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/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/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 +61 -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/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/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 +29 -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/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/loyverse/connector.rk +98 -0
- package/template/base/connectors/moka/connector.rk +86 -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 +112 -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 +90 -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/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_legacy_key_overlap.rk +22 -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/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 +175 -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 +75 -0
- package/template/base/modules/outlets/module.rk +10 -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 +214 -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/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/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 +96 -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 +161 -0
- package/template/base/modules/projects/module.rk +11 -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 +13 -0
- package/template/base/modules/rental/flows/rental_checkout_on_submit.rk +21 -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 +15 -0
- package/template/base/modules/rental/flows/rental_return_on_submit.rk +28 -0
- package/template/base/modules/rental/models/rental_booking.rk +123 -0
- package/template/base/modules/rental/models/rental_checkout.rk +37 -0
- package/template/base/modules/rental/models/rental_guard.rk +72 -0
- package/template/base/modules/rental/models/rental_item.rk +75 -0
- package/template/base/modules/rental/models/rental_return.rk +83 -0
- package/template/base/modules/rental/models/rental_schedule.rk +49 -0
- package/template/base/modules/rental/module.rk +19 -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,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,13 @@
|
|
|
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
|
+
on: rental_checkout.cancelled
|
|
6
|
+
steps:
|
|
7
|
+
- {find: rental_schedule, where: booking == event.booking, as: s}
|
|
8
|
+
- create: rental_guard
|
|
9
|
+
if: s == null || s.state != 'out' || s.checkout != event.name
|
|
10
|
+
set: {reason: "'already_returned'", document: event.name}
|
|
11
|
+
- update: s
|
|
12
|
+
if: s != null
|
|
13
|
+
set: {state: "'booked'", out_date: "null", checkout: "''"}
|
|
@@ -0,0 +1,21 @@
|
|
|
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, like every flow of this module (one lock order).
|
|
8
|
+
on: rental_checkout.submitted
|
|
9
|
+
steps:
|
|
10
|
+
- {find: rental_item, where: name == event.rental_item, as: ri}
|
|
11
|
+
- {find: rental_schedule, where: booking == event.booking, as: s}
|
|
12
|
+
- {find_all: rental_schedule, where: "rental_item == event.rental_item && state == 'out'", as: out}
|
|
13
|
+
- create: rental_guard
|
|
14
|
+
if: s == null || s.state != 'booked'
|
|
15
|
+
set: {reason: "'not_booked'", document: event.name}
|
|
16
|
+
- create: rental_guard
|
|
17
|
+
if: s != null && ri != null && out.map(x, x.qty).sum() + s.qty > ri.units
|
|
18
|
+
set: {reason: "'still_out'", document: event.name}
|
|
19
|
+
- update: s
|
|
20
|
+
if: s != null
|
|
21
|
+
set: {state: "'out'", out_date: event.out_date, 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,15 @@
|
|
|
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).
|
|
6
|
+
on: rental_return.cancelled
|
|
7
|
+
steps:
|
|
8
|
+
- {find: rental_schedule, where: booking == event.booking, as: s}
|
|
9
|
+
- {find: sales_invoice, where: "docstatus == 1 && notes.contains('(' + event.name + ')')", as: inv}
|
|
10
|
+
- create: rental_guard
|
|
11
|
+
if: inv != null
|
|
12
|
+
set: {reason: "'invoice_submitted'", document: event.name}
|
|
13
|
+
- update: s
|
|
14
|
+
if: s != null && s.rental_return == event.name
|
|
15
|
+
set: {state: "'out'", returned_date: "null", rental_return: "''"}
|
|
@@ -0,0 +1,28 @@
|
|
|
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
|
+
on: rental_return.submitted
|
|
9
|
+
steps:
|
|
10
|
+
- {find: rental_item, where: name == event.rental_item, as: ri}
|
|
11
|
+
- {find: rental_schedule, where: booking == event.booking, as: s}
|
|
12
|
+
- create: rental_guard
|
|
13
|
+
if: s == null || s.state != 'out'
|
|
14
|
+
set: {reason: "'not_out'", document: event.name}
|
|
15
|
+
- create: rental_guard
|
|
16
|
+
if: s != null && s.out_date != null && s.out_date != '' && event.return_date < s.out_date
|
|
17
|
+
set: {reason: "'before_out'", document: event.name}
|
|
18
|
+
- update: s
|
|
19
|
+
if: s != null
|
|
20
|
+
set: {state: "'returned'", returned_date: event.return_date, rental_return: event.name}
|
|
21
|
+
- create: sales_invoice
|
|
22
|
+
if: event.extra_due > 0 && ri != null
|
|
23
|
+
set:
|
|
24
|
+
customer: event.customer
|
|
25
|
+
posting_date: event.return_date
|
|
26
|
+
notes: "'Denda dan kerusakan sewa ' + event.booking + ' (' + event.name + ')'"
|
|
27
|
+
items: >-
|
|
28
|
+
[{'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}]
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/model.json
|
|
2
|
+
name: rental_booking
|
|
3
|
+
label: {id: Pesanan sewa, en: Rental booking}
|
|
4
|
+
icon: calendar
|
|
5
|
+
is_submittable: true
|
|
6
|
+
naming: SWA-{YYYY}-{#####}
|
|
7
|
+
title_field: customer
|
|
8
|
+
# One rental item, a number of units and a range of dates [start_date, end_date): the end date is the planned return
|
|
9
|
+
# day, free for the next booking. Submitting it books the units (flow rental_booking_on_submit refuses a booking that
|
|
10
|
+
# needs more units than the item has on its busiest day, under the read lock of contract 0025, so two bookings sent at
|
|
11
|
+
# the same moment never both pass), records the deposit received and drafts the rent invoice. Cancelling is allowed
|
|
12
|
+
# only while the equipment has not gone out (rental_booking_on_cancel); the deposit journal is reversed (paid back).
|
|
13
|
+
# The person types the number of days; the return date is computed (the rule language has no date difference).
|
|
14
|
+
permissions:
|
|
15
|
+
- {role: sales_manager, read: true, create: true, write: true, delete: true, submit: true, cancel: true, amend: true, export: true, print: true}
|
|
16
|
+
- {role: finance_manager, read: true, cancel: true, export: true, print: true}
|
|
17
|
+
- {role: head_office, read: true, export: true, print: true}
|
|
18
|
+
fields:
|
|
19
|
+
- name: customer
|
|
20
|
+
type: link
|
|
21
|
+
to: customer
|
|
22
|
+
label: {id: Pelanggan}
|
|
23
|
+
required: true
|
|
24
|
+
in_list: true
|
|
25
|
+
- name: rental_item
|
|
26
|
+
type: link
|
|
27
|
+
to: rental_item
|
|
28
|
+
label: {id: Alat}
|
|
29
|
+
required: true
|
|
30
|
+
in_list: true
|
|
31
|
+
- name: qty
|
|
32
|
+
type: int
|
|
33
|
+
label: {id: Jumlah unit}
|
|
34
|
+
required: true
|
|
35
|
+
default: '1'
|
|
36
|
+
in_list: true
|
|
37
|
+
- name: booking_date
|
|
38
|
+
type: date
|
|
39
|
+
label: {id: Tanggal pesan}
|
|
40
|
+
required: true
|
|
41
|
+
default: today()
|
|
42
|
+
- name: start_date
|
|
43
|
+
type: date
|
|
44
|
+
label: {id: Mulai sewa}
|
|
45
|
+
required: true
|
|
46
|
+
in_list: true
|
|
47
|
+
- name: days
|
|
48
|
+
type: int
|
|
49
|
+
label: {id: Lama sewa (hari)}
|
|
50
|
+
required: true
|
|
51
|
+
default: '1'
|
|
52
|
+
in_list: true
|
|
53
|
+
- name: end_date
|
|
54
|
+
type: date
|
|
55
|
+
label: {id: Tanggal kembali}
|
|
56
|
+
help: {id: Mulai sewa ditambah lama sewa. Di hari itu alat sudah bisa disewa orang lain}
|
|
57
|
+
compute: start_date + duration(days)
|
|
58
|
+
in_list: true
|
|
59
|
+
- name: daily_rate
|
|
60
|
+
type: currency
|
|
61
|
+
label: {id: Tarif per unit per hari}
|
|
62
|
+
default: rental_item.daily_rate
|
|
63
|
+
- name: rent_amount
|
|
64
|
+
type: currency
|
|
65
|
+
label: {id: Biaya sewa}
|
|
66
|
+
compute: qty * daily_rate * days
|
|
67
|
+
in_list: true
|
|
68
|
+
- name: deposit
|
|
69
|
+
type: currency
|
|
70
|
+
label: {id: Deposit diterima}
|
|
71
|
+
default: rental_item.deposit_per_unit * qty
|
|
72
|
+
- name: deposit_method
|
|
73
|
+
type: select
|
|
74
|
+
label: {id: Deposit dibayar lewat}
|
|
75
|
+
default: "'cash'"
|
|
76
|
+
options:
|
|
77
|
+
- {value: cash, label: {id: Tunai}}
|
|
78
|
+
- {value: transfer, label: {id: Transfer bank}}
|
|
79
|
+
- name: late_fee_per_day
|
|
80
|
+
type: currency
|
|
81
|
+
label: {id: Denda telat per unit per hari}
|
|
82
|
+
default: rental_item.late_fee_per_day
|
|
83
|
+
- name: notes
|
|
84
|
+
type: text
|
|
85
|
+
label: {id: Catatan}
|
|
86
|
+
rules:
|
|
87
|
+
- name: qty_positive
|
|
88
|
+
on: save
|
|
89
|
+
check: qty > 0
|
|
90
|
+
message: {id: Jumlah unit minimal 1}
|
|
91
|
+
- name: days_range
|
|
92
|
+
on: save
|
|
93
|
+
check: days >= 1 && days <= 366
|
|
94
|
+
message: {id: Lama sewa 1 sampai 366 hari}
|
|
95
|
+
- name: within_units
|
|
96
|
+
on: save
|
|
97
|
+
check: qty <= rental_item.units
|
|
98
|
+
message: {id: Jumlah unit melebihi unit alat yang dimiliki}
|
|
99
|
+
- name: item_active
|
|
100
|
+
on: save
|
|
101
|
+
check: rental_item.active
|
|
102
|
+
message: {id: Alat ini sudah tidak disewakan}
|
|
103
|
+
- name: money_not_negative
|
|
104
|
+
on: save
|
|
105
|
+
check: daily_rate >= 0 && deposit >= 0 && late_fee_per_day >= 0
|
|
106
|
+
message: {id: 'Tarif, deposit, dan denda tidak boleh minus'}
|
|
107
|
+
views:
|
|
108
|
+
list:
|
|
109
|
+
columns: [name, customer, rental_item, qty, start_date, end_date, rent_amount, status]
|
|
110
|
+
filters: [customer, rental_item]
|
|
111
|
+
sort: -start_date
|
|
112
|
+
form:
|
|
113
|
+
layout:
|
|
114
|
+
- section: {id: Pesanan}
|
|
115
|
+
columns:
|
|
116
|
+
- [customer, rental_item, qty]
|
|
117
|
+
- [booking_date, start_date, days, end_date]
|
|
118
|
+
- section: {id: Biaya dan deposit}
|
|
119
|
+
columns:
|
|
120
|
+
- [daily_rate, rent_amount, late_fee_per_day]
|
|
121
|
+
- [deposit, deposit_method]
|
|
122
|
+
- section: {id: Catatan}
|
|
123
|
+
fields: [notes]
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/model.json
|
|
2
|
+
name: rental_checkout
|
|
3
|
+
label: {id: Alat keluar, en: Rental checkout}
|
|
4
|
+
icon: truck
|
|
5
|
+
is_submittable: true
|
|
6
|
+
naming: KLR-{YYYY}-{#####}
|
|
7
|
+
title_field: booking
|
|
8
|
+
# The equipment of a booking leaves on its actual date. Submitting it moves the booking's schedule from booked to out
|
|
9
|
+
# (flow rental_checkout_on_submit refuses a booking that is not waiting to go out); cancelling it moves it back.
|
|
10
|
+
permissions:
|
|
11
|
+
- {role: sales_manager, read: true, create: true, write: true, delete: true, submit: true, cancel: true, amend: true, export: true, print: true}
|
|
12
|
+
- {role: finance_manager, read: true, export: true, print: true}
|
|
13
|
+
- {role: head_office, read: true, export: true, print: true}
|
|
14
|
+
fields:
|
|
15
|
+
- {name: booking, type: link, to: rental_booking, label: {id: Pesanan sewa}, required: true, in_list: true}
|
|
16
|
+
- {name: customer, type: data, label: {id: Pelanggan}, compute: booking.customer, in_list: true}
|
|
17
|
+
- {name: rental_item, type: data, label: {id: Alat}, compute: booking.rental_item, in_list: true}
|
|
18
|
+
- {name: qty, type: int, label: {id: Jumlah unit}, compute: booking.qty}
|
|
19
|
+
- {name: out_date, type: date, label: {id: Tanggal keluar}, required: true, default: today(), in_list: true}
|
|
20
|
+
- {name: notes, type: text, label: {id: 'Catatan (kondisi alat, kelengkapan)'}}
|
|
21
|
+
rules:
|
|
22
|
+
- name: booking_submitted
|
|
23
|
+
on: save
|
|
24
|
+
check: booking.docstatus == 1
|
|
25
|
+
message: {id: Pesanan sewa belum diajukan atau sudah batal}
|
|
26
|
+
views:
|
|
27
|
+
list:
|
|
28
|
+
columns: [name, booking, customer, rental_item, out_date, status]
|
|
29
|
+
sort: -out_date
|
|
30
|
+
form:
|
|
31
|
+
layout:
|
|
32
|
+
- section: {id: Alat keluar}
|
|
33
|
+
columns:
|
|
34
|
+
- [booking, out_date]
|
|
35
|
+
- [customer, rental_item, qty]
|
|
36
|
+
- section: {id: Catatan}
|
|
37
|
+
fields: [notes]
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/model.json
|
|
2
|
+
name: rental_guard
|
|
3
|
+
label: {id: Penjaga jadwal sewa, en: Rental guard}
|
|
4
|
+
icon: check
|
|
5
|
+
naming: RGD-{######}
|
|
6
|
+
title_field: reason
|
|
7
|
+
# Never stored: a flow of this module creates one when the document it runs in must be refused (the pattern of
|
|
8
|
+
# credit_guard); the matching rule fails with the reason's message, which rolls the whole submit or cancel back.
|
|
9
|
+
# Create is granted to the roles whose submits and cancels run those flows.
|
|
10
|
+
permissions:
|
|
11
|
+
- {role: sales_manager, create: true}
|
|
12
|
+
- {role: finance_manager, create: true}
|
|
13
|
+
fields:
|
|
14
|
+
- name: reason
|
|
15
|
+
type: select
|
|
16
|
+
label: {id: Alasan}
|
|
17
|
+
required: true
|
|
18
|
+
options:
|
|
19
|
+
- {value: over_capacity, label: {id: Unit tidak cukup}}
|
|
20
|
+
- {value: not_booked, label: {id: Bukan pesanan yang menunggu keluar}}
|
|
21
|
+
- {value: not_out, label: {id: Alat belum keluar}}
|
|
22
|
+
- {value: in_use, label: {id: Alat sudah keluar}}
|
|
23
|
+
- {value: already_returned, label: {id: Alat sudah kembali}}
|
|
24
|
+
- {value: invoice_submitted, label: {id: Fakturnya sudah diajukan}}
|
|
25
|
+
- {value: invoice_stale, label: {id: Faktur untuk dokumen batal atau sudah ditagih}}
|
|
26
|
+
- {value: invoice_tag, label: {id: Catatan faktur sewa diubah}}
|
|
27
|
+
- {value: still_out, label: {id: Unit masih di luar}}
|
|
28
|
+
- {value: before_out, label: {id: Kembali sebelum keluar}}
|
|
29
|
+
- name: document
|
|
30
|
+
type: data
|
|
31
|
+
label: {id: Dokumen}
|
|
32
|
+
rules:
|
|
33
|
+
- name: over_capacity
|
|
34
|
+
on: save
|
|
35
|
+
check: reason != 'over_capacity'
|
|
36
|
+
message: {id: 'Unit alat tidak cukup di tanggal itu: sudah dipesan pelanggan lain. Pilih tanggal lain atau kurangi jumlahnya.'}
|
|
37
|
+
- name: not_booked
|
|
38
|
+
on: save
|
|
39
|
+
check: reason != 'not_booked'
|
|
40
|
+
message: {id: 'Pesanan ini tidak sedang menunggu alat keluar (sudah keluar, kembali, atau batal).'}
|
|
41
|
+
- name: not_out
|
|
42
|
+
on: save
|
|
43
|
+
check: reason != 'not_out'
|
|
44
|
+
message: {id: 'Alat pesanan ini belum tercatat keluar, atau sudah kembali.'}
|
|
45
|
+
- name: in_use
|
|
46
|
+
on: save
|
|
47
|
+
check: reason != 'in_use'
|
|
48
|
+
message: {id: 'Alat pesanan ini sudah keluar. Catat alat kembali dulu, pesanan tidak bisa dibatalkan.'}
|
|
49
|
+
- name: already_returned
|
|
50
|
+
on: save
|
|
51
|
+
check: reason != 'already_returned'
|
|
52
|
+
message: {id: 'Alat sudah tercatat kembali. Batalkan catatan alat kembali dulu.'}
|
|
53
|
+
- name: invoice_submitted
|
|
54
|
+
on: save
|
|
55
|
+
check: reason != 'invoice_submitted'
|
|
56
|
+
message: {id: 'Fakturnya sudah diajukan. Batalkan fakturnya dulu.'}
|
|
57
|
+
- name: invoice_stale
|
|
58
|
+
on: save
|
|
59
|
+
check: reason != 'invoice_stale'
|
|
60
|
+
message: {id: 'Faktur ini untuk pesanan atau catatan alat kembali yang sudah batal, atau sudah ditagih di faktur lain. Hapus draf ini.'}
|
|
61
|
+
- name: invoice_tag
|
|
62
|
+
on: save
|
|
63
|
+
check: reason != 'invoice_tag'
|
|
64
|
+
message: {id: 'Catatan faktur sewa tidak bisa diubah: nomor pesanan di dalamnya dipakai untuk mencocokkan faktur.'}
|
|
65
|
+
- name: still_out
|
|
66
|
+
on: save
|
|
67
|
+
check: reason != 'still_out'
|
|
68
|
+
message: {id: 'Unit alat ini masih di luar (ada yang belum kembali). Catat alat kembali dulu sebelum alat keluar lagi.'}
|
|
69
|
+
- name: before_out
|
|
70
|
+
on: save
|
|
71
|
+
check: reason != 'before_out'
|
|
72
|
+
message: {id: Tanggal kembali tidak boleh sebelum tanggal alat keluar}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/model.json
|
|
2
|
+
name: rental_item
|
|
3
|
+
label: {id: Alat sewa, en: Rental item}
|
|
4
|
+
icon: stock
|
|
5
|
+
naming: ALT-{####}
|
|
6
|
+
title_field: title
|
|
7
|
+
# A catalogue item rented out by the day: how many units there are, the rate per unit per day, the deposit per unit
|
|
8
|
+
# and the late fee per unit per day. A booking copies the rate, deposit and late fee when it is made.
|
|
9
|
+
permissions:
|
|
10
|
+
- {role: finance_manager, read: true, create: true, write: true, export: true, print: true}
|
|
11
|
+
- {role: sales_manager, read: true, export: true}
|
|
12
|
+
- {role: head_office, read: true, export: true}
|
|
13
|
+
fields:
|
|
14
|
+
- name: item
|
|
15
|
+
type: link
|
|
16
|
+
to: item
|
|
17
|
+
label: {id: Barang}
|
|
18
|
+
required: true
|
|
19
|
+
unique: true
|
|
20
|
+
in_list: true
|
|
21
|
+
- name: title
|
|
22
|
+
type: data
|
|
23
|
+
label: {id: Nama alat}
|
|
24
|
+
compute: item.item_name
|
|
25
|
+
in_list: true
|
|
26
|
+
- name: units
|
|
27
|
+
type: int
|
|
28
|
+
label: {id: Jumlah unit}
|
|
29
|
+
required: true
|
|
30
|
+
default: '1'
|
|
31
|
+
in_list: true
|
|
32
|
+
- name: daily_rate
|
|
33
|
+
type: currency
|
|
34
|
+
label: {id: Tarif per hari}
|
|
35
|
+
required: true
|
|
36
|
+
in_list: true
|
|
37
|
+
- name: deposit_per_unit
|
|
38
|
+
type: currency
|
|
39
|
+
label: {id: Deposit per unit}
|
|
40
|
+
default: '0'
|
|
41
|
+
in_list: true
|
|
42
|
+
- name: late_fee_per_day
|
|
43
|
+
type: currency
|
|
44
|
+
label: {id: Denda telat per hari}
|
|
45
|
+
help: {id: Per unit untuk setiap hari lewat dari tanggal kembali}
|
|
46
|
+
default: '0'
|
|
47
|
+
- name: active
|
|
48
|
+
type: check
|
|
49
|
+
label: {id: Masih disewakan}
|
|
50
|
+
default: 'true'
|
|
51
|
+
- name: notes
|
|
52
|
+
type: text
|
|
53
|
+
label: {id: Catatan}
|
|
54
|
+
rules:
|
|
55
|
+
- name: units_positive
|
|
56
|
+
on: save
|
|
57
|
+
check: units > 0
|
|
58
|
+
message: {id: Jumlah unit minimal 1}
|
|
59
|
+
- name: money_not_negative
|
|
60
|
+
on: save
|
|
61
|
+
check: daily_rate >= 0 && deposit_per_unit >= 0 && late_fee_per_day >= 0
|
|
62
|
+
message: {id: 'Tarif, deposit, dan denda tidak boleh minus'}
|
|
63
|
+
views:
|
|
64
|
+
list:
|
|
65
|
+
columns: [name, title, units, daily_rate, deposit_per_unit, late_fee_per_day]
|
|
66
|
+
filters: [active]
|
|
67
|
+
sort: name
|
|
68
|
+
form:
|
|
69
|
+
layout:
|
|
70
|
+
- section: {id: Alat}
|
|
71
|
+
columns:
|
|
72
|
+
- [item, title, units, active]
|
|
73
|
+
- [daily_rate, deposit_per_unit, late_fee_per_day]
|
|
74
|
+
- section: {id: Catatan}
|
|
75
|
+
fields: [notes]
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/model.json
|
|
2
|
+
name: rental_return
|
|
3
|
+
label: {id: Alat kembali, en: Rental return}
|
|
4
|
+
icon: undo
|
|
5
|
+
is_submittable: true
|
|
6
|
+
naming: KBL-{YYYY}-{#####}
|
|
7
|
+
title_field: booking
|
|
8
|
+
# The equipment comes back on its actual date. Each day after the booking's end date costs the late fee per unit
|
|
9
|
+
# (copied on the booking); damage is typed in. Both are kept from the deposit, late fee first, and the rest of the
|
|
10
|
+
# deposit is paid back (journal: 2-1400 against 4-9200 Pendapatan denda dan ganti rugi and cash or bank). What the
|
|
11
|
+
# deposit does not cover (extra_due) becomes a draft invoice to the customer. Submitting it moves the schedule from
|
|
12
|
+
# out to returned (flow rental_return_on_submit); cancelling it moves it back, refused once the extra invoice is
|
|
13
|
+
# submitted. The late fee counts at most 60 days; a loss beyond that is charged as damage (Biaya kerusakan atau hilang).
|
|
14
|
+
permissions:
|
|
15
|
+
- {role: sales_manager, read: true, create: true, write: true, delete: true, submit: true, export: true, print: true}
|
|
16
|
+
- {role: finance_manager, read: true, cancel: true, amend: true, export: true, print: true}
|
|
17
|
+
- {role: head_office, read: true, export: true, print: true}
|
|
18
|
+
fields:
|
|
19
|
+
- {name: booking, type: link, to: rental_booking, label: {id: Pesanan sewa}, required: true, in_list: true}
|
|
20
|
+
- {name: customer, type: data, label: {id: Pelanggan}, compute: booking.customer, in_list: true}
|
|
21
|
+
- {name: rental_item, type: data, label: {id: Alat}, compute: booking.rental_item}
|
|
22
|
+
- {name: return_date, type: date, label: {id: Tanggal kembali aktual}, required: true, default: today(), in_list: true}
|
|
23
|
+
- {name: planned_end, type: date, label: {id: Seharusnya kembali}, compute: booking.end_date}
|
|
24
|
+
- name: late_days
|
|
25
|
+
type: int
|
|
26
|
+
label: {id: Telat (hari)}
|
|
27
|
+
# 60 conditions summed (no date difference in the rule language): days after the planned end, at most 60.
|
|
28
|
+
compute: >-
|
|
29
|
+
(booking.end_date + duration(1) <= return_date ? 1 : 0) + (booking.end_date + duration(2) <= return_date ? 1 : 0) + (booking.end_date + duration(3) <= return_date ? 1 : 0) + (booking.end_date + duration(4) <= return_date ? 1 : 0) + (booking.end_date + duration(5) <= return_date ? 1 : 0) + (booking.end_date + duration(6) <= return_date ? 1 : 0) + (booking.end_date + duration(7) <= return_date ? 1 : 0) + (booking.end_date + duration(8) <= return_date ? 1 : 0) + (booking.end_date + duration(9) <= return_date ? 1 : 0) + (booking.end_date + duration(10) <= return_date ? 1 : 0) + (booking.end_date + duration(11) <= return_date ? 1 : 0) + (booking.end_date + duration(12) <= return_date ? 1 : 0) + (booking.end_date + duration(13) <= return_date ? 1 : 0) + (booking.end_date + duration(14) <= return_date ? 1 : 0) + (booking.end_date + duration(15) <= return_date ? 1 : 0) + (booking.end_date + duration(16) <= return_date ? 1 : 0) + (booking.end_date + duration(17) <= return_date ? 1 : 0) + (booking.end_date + duration(18) <= return_date ? 1 : 0) + (booking.end_date + duration(19) <= return_date ? 1 : 0) + (booking.end_date + duration(20) <= return_date ? 1 : 0) + (booking.end_date + duration(21) <= return_date ? 1 : 0) + (booking.end_date + duration(22) <= return_date ? 1 : 0) + (booking.end_date + duration(23) <= return_date ? 1 : 0) + (booking.end_date + duration(24) <= return_date ? 1 : 0) + (booking.end_date + duration(25) <= return_date ? 1 : 0) + (booking.end_date + duration(26) <= return_date ? 1 : 0) + (booking.end_date + duration(27) <= return_date ? 1 : 0) + (booking.end_date + duration(28) <= return_date ? 1 : 0) + (booking.end_date + duration(29) <= return_date ? 1 : 0) + (booking.end_date + duration(30) <= return_date ? 1 : 0) + (booking.end_date + duration(31) <= return_date ? 1 : 0) + (booking.end_date + duration(32) <= return_date ? 1 : 0) + (booking.end_date + duration(33) <= return_date ? 1 : 0) + (booking.end_date + duration(34) <= return_date ? 1 : 0) + (booking.end_date + duration(35) <= return_date ? 1 : 0) + (booking.end_date + duration(36) <= return_date ? 1 : 0) + (booking.end_date + duration(37) <= return_date ? 1 : 0) + (booking.end_date + duration(38) <= return_date ? 1 : 0) + (booking.end_date + duration(39) <= return_date ? 1 : 0) + (booking.end_date + duration(40) <= return_date ? 1 : 0) + (booking.end_date + duration(41) <= return_date ? 1 : 0) + (booking.end_date + duration(42) <= return_date ? 1 : 0) + (booking.end_date + duration(43) <= return_date ? 1 : 0) + (booking.end_date + duration(44) <= return_date ? 1 : 0) + (booking.end_date + duration(45) <= return_date ? 1 : 0) + (booking.end_date + duration(46) <= return_date ? 1 : 0) + (booking.end_date + duration(47) <= return_date ? 1 : 0) + (booking.end_date + duration(48) <= return_date ? 1 : 0) + (booking.end_date + duration(49) <= return_date ? 1 : 0) + (booking.end_date + duration(50) <= return_date ? 1 : 0) + (booking.end_date + duration(51) <= return_date ? 1 : 0) + (booking.end_date + duration(52) <= return_date ? 1 : 0) + (booking.end_date + duration(53) <= return_date ? 1 : 0) + (booking.end_date + duration(54) <= return_date ? 1 : 0) + (booking.end_date + duration(55) <= return_date ? 1 : 0) + (booking.end_date + duration(56) <= return_date ? 1 : 0) + (booking.end_date + duration(57) <= return_date ? 1 : 0) + (booking.end_date + duration(58) <= return_date ? 1 : 0) + (booking.end_date + duration(59) <= return_date ? 1 : 0) + (booking.end_date + duration(60) <= return_date ? 1 : 0)
|
|
30
|
+
in_list: true
|
|
31
|
+
- {name: late_fee, type: currency, label: {id: Denda telat}, compute: late_days * booking.qty * booking.late_fee_per_day}
|
|
32
|
+
- {name: damage_fee, type: currency, label: {id: Biaya kerusakan atau hilang}, default: '0'}
|
|
33
|
+
- {name: damage_notes, type: text, label: {id: Catatan kerusakan}}
|
|
34
|
+
- {name: deposit, type: currency, label: {id: Deposit diterima}, compute: booking.deposit}
|
|
35
|
+
# A PKP business charges PPN on the fee: nothing is kept from the deposit, the whole fee goes on the invoice (finding 3).
|
|
36
|
+
- {name: deposit_kept, type: check, label: {id: Denda dipotong dari deposit}, compute: '!tax.pkp'}
|
|
37
|
+
- {name: covered_late, type: currency, label: {id: Denda telat dipotong dari deposit}, compute: "!deposit_kept ? 0 : (late_fee < deposit ? late_fee : deposit)"}
|
|
38
|
+
- {name: covered_damage, type: currency, label: {id: Kerusakan dipotong dari deposit}, compute: "!deposit_kept ? 0 : (damage_fee < deposit - covered_late ? damage_fee : deposit - covered_late)"}
|
|
39
|
+
- {name: deposit_refund, type: currency, label: {id: Deposit dikembalikan}, compute: deposit - covered_late - covered_damage, in_list: true}
|
|
40
|
+
- {name: extra_due, type: currency, label: {id: Kekurangan ditagih}, compute: late_fee + damage_fee - covered_late - covered_damage, in_list: true}
|
|
41
|
+
- name: refund_method
|
|
42
|
+
type: select
|
|
43
|
+
label: {id: Deposit dikembalikan lewat}
|
|
44
|
+
default: "'cash'"
|
|
45
|
+
options:
|
|
46
|
+
- {value: cash, label: {id: Tunai}}
|
|
47
|
+
- {value: transfer, label: {id: Transfer bank}}
|
|
48
|
+
rules:
|
|
49
|
+
- name: booking_submitted
|
|
50
|
+
on: save
|
|
51
|
+
check: booking.docstatus == 1
|
|
52
|
+
message: {id: Pesanan sewa belum diajukan atau sudah batal}
|
|
53
|
+
- name: not_before_start
|
|
54
|
+
on: save
|
|
55
|
+
check: return_date >= booking.start_date
|
|
56
|
+
message: {id: Tanggal kembali tidak boleh sebelum mulai sewa}
|
|
57
|
+
- name: late_over_60_days
|
|
58
|
+
on: save
|
|
59
|
+
level: warn
|
|
60
|
+
check: return_date <= booking.end_date + duration(60)
|
|
61
|
+
message: {id: 'Telat lebih dari 60 hari: denda telat dihitung 60 hari saja. Masukkan sisa kerugian di biaya kerusakan atau hilang.'}
|
|
62
|
+
- name: damage_not_negative
|
|
63
|
+
on: save
|
|
64
|
+
check: damage_fee >= 0
|
|
65
|
+
message: {id: Biaya kerusakan tidak boleh minus}
|
|
66
|
+
views:
|
|
67
|
+
list:
|
|
68
|
+
columns: [name, booking, customer, return_date, late_days, deposit_refund, extra_due, status]
|
|
69
|
+
sort: -return_date
|
|
70
|
+
form:
|
|
71
|
+
layout:
|
|
72
|
+
- section: {id: Alat kembali}
|
|
73
|
+
columns:
|
|
74
|
+
- [booking, return_date, refund_method]
|
|
75
|
+
- [customer, rental_item, planned_end, late_days]
|
|
76
|
+
- section: {id: Denda dan kerusakan}
|
|
77
|
+
columns:
|
|
78
|
+
- [late_fee, damage_fee, damage_notes]
|
|
79
|
+
- [deposit, deposit_kept, covered_late, covered_damage]
|
|
80
|
+
- section: {id: Hasil}
|
|
81
|
+
columns:
|
|
82
|
+
- [deposit_refund]
|
|
83
|
+
- [extra_due]
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/model.json
|
|
2
|
+
name: rental_schedule
|
|
3
|
+
label: {id: Jadwal alat, en: Rental schedule}
|
|
4
|
+
icon: calendar
|
|
5
|
+
naming: JDW-{######}
|
|
6
|
+
title_field: rental_item
|
|
7
|
+
# One row per submitted booking, made and kept current by the flows of this module (a submitted document cannot
|
|
8
|
+
# change): booked, out, returned or cancelled, with the actual dates. The availability check of a new booking reads
|
|
9
|
+
# these rows. Its state fields are read_only, so a person cannot change them by hand; only the flows write them.
|
|
10
|
+
permissions:
|
|
11
|
+
- {role: sales_manager, read: true, create: true, write: true, export: true}
|
|
12
|
+
- {role: finance_manager, read: true, write: true, export: true}
|
|
13
|
+
- {role: head_office, read: true, export: true}
|
|
14
|
+
fields:
|
|
15
|
+
- {name: booking, type: link, to: rental_booking, label: {id: Pesanan sewa}, required: true, unique: true, read_only: true, in_list: true}
|
|
16
|
+
- {name: customer, type: link, to: customer, label: {id: Pelanggan}, read_only: true, in_list: true}
|
|
17
|
+
- {name: rental_item, type: link, to: rental_item, label: {id: Alat}, required: true, read_only: true, in_list: true}
|
|
18
|
+
- {name: qty, type: int, label: {id: Jumlah unit}, read_only: true, in_list: true}
|
|
19
|
+
- {name: start_date, type: date, label: {id: Mulai sewa}, read_only: true, in_list: true}
|
|
20
|
+
- {name: end_date, type: date, label: {id: Tanggal kembali}, read_only: true, in_list: true}
|
|
21
|
+
- {name: deposit, type: currency, label: {id: Deposit}, read_only: true}
|
|
22
|
+
- name: state
|
|
23
|
+
type: select
|
|
24
|
+
label: {id: Status}
|
|
25
|
+
default: "'booked'"
|
|
26
|
+
read_only: true
|
|
27
|
+
in_list: true
|
|
28
|
+
chip: true
|
|
29
|
+
options:
|
|
30
|
+
- {value: booked, label: {id: Dipesan}}
|
|
31
|
+
- {value: out, label: {id: Keluar}}
|
|
32
|
+
- {value: returned, label: {id: Kembali}}
|
|
33
|
+
- {value: cancelled, label: {id: Batal}}
|
|
34
|
+
- {name: out_date, type: date, label: {id: Tanggal keluar}, read_only: true}
|
|
35
|
+
- {name: returned_date, type: date, label: {id: Tanggal kembali aktual}, read_only: true}
|
|
36
|
+
- {name: checkout, type: link, to: rental_checkout, label: {id: Bukti alat keluar}, read_only: true}
|
|
37
|
+
- {name: rental_return, type: link, to: rental_return, label: {id: Bukti alat kembali}, read_only: true}
|
|
38
|
+
rules:
|
|
39
|
+
# Made by rental_booking_on_submit inside the booking's submit; a row for a draft booking (made by hand) would hold
|
|
40
|
+
# units for a booking that was never confirmed, and would block that booking's own row (booking is unique).
|
|
41
|
+
- name: booking_submitted
|
|
42
|
+
on: save
|
|
43
|
+
check: booking.docstatus != 0
|
|
44
|
+
message: {id: Jadwal hanya dibuat dari pesanan sewa yang sudah diajukan}
|
|
45
|
+
views:
|
|
46
|
+
list:
|
|
47
|
+
columns: [booking, customer, rental_item, qty, start_date, end_date, state]
|
|
48
|
+
filters: [rental_item, state, customer]
|
|
49
|
+
sort: start_date
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/module.json
|
|
2
|
+
name: rental
|
|
3
|
+
version: 1.0.0
|
|
4
|
+
title: {id: Sewa alat, en: Equipment rental}
|
|
5
|
+
summary:
|
|
6
|
+
id: Sewa alat dengan jadwal tanpa bentrok, alat keluar dan kembali.
|
|
7
|
+
en: Equipment rental with clash-free schedules, check-out and return.
|
|
8
|
+
category: operations
|
|
9
|
+
icon: tools-line
|
|
10
|
+
# Rental of countable equipment (cameras, party tents, chairs, sound systems): a rental item is a catalogue item with
|
|
11
|
+
# a number of units, a daily rate, a deposit per unit and a late fee per day. A booking reserves units for a range of
|
|
12
|
+
# dates [start_date, end_date): the return day is free for the next booking. Its submit refuses a booking whose
|
|
13
|
+
# overlap would need more units than the item has (flow rental_booking_on_submit, read lock of contract 0025), takes
|
|
14
|
+
# the deposit (journal to 2-1400 Uang muka pelanggan) and drafts the rent invoice. Checkout and return are documents
|
|
15
|
+
# of their own with the actual dates; the return computes the late fee and damage, keeps them from the deposit and
|
|
16
|
+
# pays the rest back; what the deposit does not cover becomes a draft invoice. A submitted document cannot change, so
|
|
17
|
+
# the state of each booking lives in rental_schedule, written only by the flows of this module.
|
|
18
|
+
requires: {rangka: '>=0.5', users: ^1.0, contacts: ^1.0, catalogue: ^1.0, invoicing: ^1.0}
|
|
19
|
+
optional: {accounting: ^1.0}
|