@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,119 @@
|
|
|
1
|
+
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/model.json
|
|
2
|
+
name: lead
|
|
3
|
+
label: {id: Lead, en: Lead}
|
|
4
|
+
icon: user
|
|
5
|
+
naming: LEAD-{#####}
|
|
6
|
+
title_field: lead_name
|
|
7
|
+
permissions:
|
|
8
|
+
- {role: sales_manager, read: true, create: true, write: true, delete: true, submit: true, cancel: true, amend: true, export: true, print: true}
|
|
9
|
+
- {role: finance_manager, read: true}
|
|
10
|
+
- {role: purchasing_manager, read: true}
|
|
11
|
+
- {role: project_admin, read: true}
|
|
12
|
+
- {role: head_office, read: true}
|
|
13
|
+
- {role: outlet_staff, read: true}
|
|
14
|
+
- {role: sales_rep, read: true, create: true, write: true, if: owner == user.name}
|
|
15
|
+
fields:
|
|
16
|
+
- name: lead_name
|
|
17
|
+
type: data
|
|
18
|
+
label: {id: Nama}
|
|
19
|
+
required: true
|
|
20
|
+
in_list: true
|
|
21
|
+
- name: company_name
|
|
22
|
+
type: data
|
|
23
|
+
label: {id: Nama usaha}
|
|
24
|
+
in_list: true
|
|
25
|
+
- name: phone
|
|
26
|
+
type: phone
|
|
27
|
+
label: {id: Nomor WhatsApp}
|
|
28
|
+
in_list: true
|
|
29
|
+
unique: true
|
|
30
|
+
- name: email
|
|
31
|
+
type: data
|
|
32
|
+
label: {id: Email}
|
|
33
|
+
- name: city
|
|
34
|
+
type: data
|
|
35
|
+
label: {id: Kota}
|
|
36
|
+
- name: source
|
|
37
|
+
type: select
|
|
38
|
+
label: {id: Sumber}
|
|
39
|
+
in_list: true
|
|
40
|
+
options:
|
|
41
|
+
- value: whatsapp
|
|
42
|
+
label: {id: WhatsApp}
|
|
43
|
+
- value: instagram
|
|
44
|
+
label: {id: Instagram}
|
|
45
|
+
- value: referral
|
|
46
|
+
label: {id: Referensi}
|
|
47
|
+
- value: walk_in
|
|
48
|
+
label: {id: Datang langsung}
|
|
49
|
+
- value: website
|
|
50
|
+
label: {id: Website}
|
|
51
|
+
- value: marketplace
|
|
52
|
+
label: {id: Marketplace}
|
|
53
|
+
- name: status
|
|
54
|
+
type: select
|
|
55
|
+
label: {id: Status}
|
|
56
|
+
default: "'new'"
|
|
57
|
+
in_list: true
|
|
58
|
+
chip: true
|
|
59
|
+
options:
|
|
60
|
+
- value: new
|
|
61
|
+
label: {id: Baru}
|
|
62
|
+
tone: info
|
|
63
|
+
- value: contacted
|
|
64
|
+
label: {id: Dihubungi}
|
|
65
|
+
tone: neutral
|
|
66
|
+
- value: qualified
|
|
67
|
+
label: {id: Memenuhi syarat}
|
|
68
|
+
tone: ok
|
|
69
|
+
- value: lost
|
|
70
|
+
label: {id: Tidak cocok}
|
|
71
|
+
tone: muted
|
|
72
|
+
- name: owner
|
|
73
|
+
type: link
|
|
74
|
+
to: user
|
|
75
|
+
label: {id: Penanggung jawab}
|
|
76
|
+
in_list: true
|
|
77
|
+
- name: notes
|
|
78
|
+
type: text
|
|
79
|
+
label: {id: Catatan}
|
|
80
|
+
- name: converted_customer
|
|
81
|
+
type: link
|
|
82
|
+
to: customer
|
|
83
|
+
label: {id: Jadi pelanggan}
|
|
84
|
+
read_only: true
|
|
85
|
+
- name: converted_deal
|
|
86
|
+
type: link
|
|
87
|
+
to: deal
|
|
88
|
+
label: {id: Jadi peluang}
|
|
89
|
+
read_only: true
|
|
90
|
+
rules:
|
|
91
|
+
- name: reach
|
|
92
|
+
on: save
|
|
93
|
+
check: phone != '' || email != ''
|
|
94
|
+
message: {id: Isi nomor WhatsApp atau email supaya lead bisa dihubungi}
|
|
95
|
+
actions:
|
|
96
|
+
- name: convert
|
|
97
|
+
label:
|
|
98
|
+
id: Jadikan pelanggan + peluang
|
|
99
|
+
en: Convert to customer + deal
|
|
100
|
+
icon: check
|
|
101
|
+
hook: crm.convert_lead
|
|
102
|
+
primary: true
|
|
103
|
+
if: status != 'lost' && converted_deal == ''
|
|
104
|
+
views:
|
|
105
|
+
list:
|
|
106
|
+
columns: [name, lead_name, company_name, source, status, owner]
|
|
107
|
+
sort: -created_at
|
|
108
|
+
form:
|
|
109
|
+
layout:
|
|
110
|
+
- section: {id: Kontak}
|
|
111
|
+
columns:
|
|
112
|
+
- [lead_name, company_name, city]
|
|
113
|
+
- [phone, email, source]
|
|
114
|
+
- section: {id: Tindak lanjut}
|
|
115
|
+
columns:
|
|
116
|
+
- [status, owner]
|
|
117
|
+
- [converted_customer, converted_deal]
|
|
118
|
+
- section: {id: Catatan}
|
|
119
|
+
fields: [notes]
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/module.json
|
|
2
|
+
name: pipeline
|
|
3
|
+
version: 1.0.0
|
|
4
|
+
title: {id: Pipeline penjualan, en: Sales pipeline}
|
|
5
|
+
summary:
|
|
6
|
+
id: Lead, peluang dan aktivitas penjualan sampai closing.
|
|
7
|
+
en: Leads, deals and sales activities through to closing.
|
|
8
|
+
category: sales
|
|
9
|
+
icon: funnel-line
|
|
10
|
+
requires: {rangka: '>=0.5', contacts: ^1.0, users: ^1.0}
|
|
11
|
+
optional: {invoicing: ^1.0}
|
|
12
|
+
hooks: [crm.convert_lead, crm.mark_won]
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/flow.json
|
|
2
|
+
# Jalur A and B never on the same outlet and day (audit kasir M2): a daily sales record (form, Moka, POS file) of an
|
|
3
|
+
# outlet and day that already has a paid cashier receipt is refused, so the day's revenue and stock are never taken
|
|
4
|
+
# twice even when head office switches the outlet's sales_source. Runs as whoever submits the record (head office,
|
|
5
|
+
# outlet staff), who read the receipts of their outlets for it.
|
|
6
|
+
name: pos_daily_form_guard
|
|
7
|
+
label: {id: 'Penjualan harian diajukan: tolak kalau outlet itu sudah memakai kasir hari itu'}
|
|
8
|
+
on: outlet_sales.submitted
|
|
9
|
+
steps:
|
|
10
|
+
- find_all: pos_sale
|
|
11
|
+
where: outlet == event.outlet && date == event.date && docstatus == 1
|
|
12
|
+
limit: 1
|
|
13
|
+
as: receipts
|
|
14
|
+
- if: receipts.size() > 0
|
|
15
|
+
create: pos_guard
|
|
16
|
+
set:
|
|
17
|
+
reason: "'cashier_same_day'"
|
|
18
|
+
document: receipts[0].name
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/flow.json
|
|
2
|
+
# Runs inside a sale's cancel (a void), as the cashier. A void is for the sale's own day only (void_other_day) and
|
|
3
|
+
# while its shift is open (void_shift_closed: the closing count already holds this receipt's cash); the kernel runs no
|
|
4
|
+
# `on: cancel` rule, so both checks are here, under the shift's lock. Otherwise the money goes back out of the drawer
|
|
5
|
+
# (or back to the buyer's QRIS) and the shift's totals shrink; the void is counted. Only the shift's own cashier (or
|
|
6
|
+
# head office) voids its receipts.
|
|
7
|
+
name: pos_sale_on_cancel
|
|
8
|
+
label: {id: 'Transaksi kasir dibatalkan: kurangi dari sesi kasir'}
|
|
9
|
+
on: pos_sale.cancelled
|
|
10
|
+
steps:
|
|
11
|
+
- {find: pos_shift, where: name == event.shift && state == 'open', as: s}
|
|
12
|
+
- if: event.date != today()
|
|
13
|
+
create: pos_guard
|
|
14
|
+
set: {reason: "'void_other_day'", document: event.name}
|
|
15
|
+
- if: s == null
|
|
16
|
+
create: pos_guard
|
|
17
|
+
set: {reason: "'void_shift_closed'", document: event.name}
|
|
18
|
+
# only the cashier of the shift (or head office, the owner) voids its receipts: the cash leaves that drawer's count
|
|
19
|
+
- if: "s != null && s.cashier != user.email && !('head_office' in user.roles) && !('owner' in user.roles)"
|
|
20
|
+
create: pos_guard
|
|
21
|
+
set: {reason: "'void_not_own'", document: event.name}
|
|
22
|
+
- update: s
|
|
23
|
+
if: s != null
|
|
24
|
+
set:
|
|
25
|
+
sales_count: s.sales_count - 1
|
|
26
|
+
gross_total: s.gross_total - event.gross_total
|
|
27
|
+
discount_total: s.discount_total - event.discount_total
|
|
28
|
+
net_total: s.net_total - event.grand_total
|
|
29
|
+
cash_total: s.cash_total - event.cash_amount
|
|
30
|
+
qris_total: s.qris_total - event.qris_amount
|
|
31
|
+
cogs_total: s.cogs_total - event.cogs_total
|
|
32
|
+
void_count: s.void_count + 1
|
|
33
|
+
void_total: s.void_total + event.grand_total
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/flow.json
|
|
2
|
+
# Runs inside a sale's submit (the payment), as the cashier. Reading pos_shift takes the flow read lock of contract
|
|
3
|
+
# 0025, so the sales of a shift are added one after the other and each sees the totals the previous one left. A shift
|
|
4
|
+
# closed meanwhile is not found open: the sale is refused (pos_guard shift_closed) and rolls back with its stock
|
|
5
|
+
# moves and its number. Otherwise the shift's totals grow by this receipt.
|
|
6
|
+
name: pos_sale_on_submit
|
|
7
|
+
label: {id: 'Transaksi kasir dibayar: tambah ke sesi kasir'}
|
|
8
|
+
on: pos_sale.submitted
|
|
9
|
+
steps:
|
|
10
|
+
- {find: pos_shift, where: name == event.shift && state == 'open', as: s}
|
|
11
|
+
# Jalur A and B never on the same outlet and day: a daily sales record (form, Moka, POS file) of this outlet and day
|
|
12
|
+
# refuses the receipt (and flow pos_daily_form_guard refuses the record after a receipt), whatever sales_source says
|
|
13
|
+
- find_all: outlet_sales
|
|
14
|
+
if: app_installed('outlet_sales')
|
|
15
|
+
where: outlet == event.outlet && date == event.date && docstatus == 1
|
|
16
|
+
limit: 1
|
|
17
|
+
as: forms
|
|
18
|
+
- if: forms != null && forms.size() > 0
|
|
19
|
+
create: pos_guard
|
|
20
|
+
set:
|
|
21
|
+
reason: "'daily_sales_same_day'"
|
|
22
|
+
document: forms[0].name
|
|
23
|
+
# a Setoran harian of this outlet and day was booked outside the cashier: the shift's close would book the cash again
|
|
24
|
+
- find_all: outlet_takings
|
|
25
|
+
if: app_installed('outlet_sales')
|
|
26
|
+
where: outlet == event.outlet && date == event.date && docstatus == 1
|
|
27
|
+
limit: 1
|
|
28
|
+
as: takings
|
|
29
|
+
- if: takings != null && takings.size() > 0
|
|
30
|
+
create: pos_guard
|
|
31
|
+
set:
|
|
32
|
+
reason: "'daily_sales_same_day'"
|
|
33
|
+
document: takings[0].name
|
|
34
|
+
- if: s == null
|
|
35
|
+
create: pos_guard
|
|
36
|
+
set: {reason: "'shift_closed'", document: event.name}
|
|
37
|
+
- update: s
|
|
38
|
+
if: s != null
|
|
39
|
+
set:
|
|
40
|
+
sales_count: s.sales_count + 1
|
|
41
|
+
gross_total: s.gross_total + event.gross_total
|
|
42
|
+
discount_total: s.discount_total + event.discount_total
|
|
43
|
+
net_total: s.net_total + event.grand_total
|
|
44
|
+
cash_total: s.cash_total + event.cash_amount
|
|
45
|
+
qris_total: s.qris_total + event.qris_amount
|
|
46
|
+
cogs_total: s.cogs_total + event.cogs_total
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/flow.json
|
|
2
|
+
# Head office cancels a close (a miscount): the shift opens again, without its counted figures, and is closed with a
|
|
3
|
+
# new Tutup sesi. Its selisih kas journal is reversed by gl_pos_shift_close_reverse.
|
|
4
|
+
name: pos_shift_close_on_cancel
|
|
5
|
+
label: {id: 'Tutup sesi dibatalkan: sesi kasir dibuka lagi'}
|
|
6
|
+
on: pos_shift_close.cancelled
|
|
7
|
+
steps:
|
|
8
|
+
- {find: pos_shift, where: name == event.shift, as: s}
|
|
9
|
+
# one open shift per cashier per outlet: a shift opened since cannot be joined by the reopened one (audit kasir L6)
|
|
10
|
+
- find_all: pos_shift
|
|
11
|
+
if: s != null
|
|
12
|
+
where: outlet == s.outlet && cashier == s.cashier && state == 'open' && name != s.name
|
|
13
|
+
limit: 1
|
|
14
|
+
as: open
|
|
15
|
+
- if: s != null && open.size() > 0
|
|
16
|
+
create: pos_guard
|
|
17
|
+
set:
|
|
18
|
+
reason: "'shift_already_open'"
|
|
19
|
+
document: open[0].name
|
|
20
|
+
- update: s
|
|
21
|
+
if: s != null && s.closed_by == event.name
|
|
22
|
+
set:
|
|
23
|
+
state: "'open'"
|
|
24
|
+
closed_by: "''"
|
|
25
|
+
counted_cash: '0'
|
|
26
|
+
cash_difference: '0'
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/flow.json
|
|
2
|
+
# Runs inside the close's submit, as the cashier. Reading pos_shift takes the flow read lock of contract 0025, the
|
|
3
|
+
# same one the sales' flows take, so a sale is either counted before the close or refused after it. A shift already
|
|
4
|
+
# closed (two closes at once) is refused, and so is a close whose figures went stale: a sale was paid or voided between
|
|
5
|
+
# the figures being read and this lock, so the cash and QRIS it would settle in the journal are not the shift's.
|
|
6
|
+
name: pos_shift_close_on_submit
|
|
7
|
+
label: {id: 'Tutup sesi diajukan: sesi kasir ditutup'}
|
|
8
|
+
on: pos_shift_close.submitted
|
|
9
|
+
steps:
|
|
10
|
+
- {find: pos_shift, where: name == event.shift, as: s}
|
|
11
|
+
- if: s == null || s.state != 'open'
|
|
12
|
+
create: pos_guard
|
|
13
|
+
set: {reason: "'shift_closed'", document: event.name}
|
|
14
|
+
- if: s != null && (s.cash_total != event.cash_total || s.qris_total != event.qris_total || s.opening_cash != event.opening_cash)
|
|
15
|
+
create: pos_guard
|
|
16
|
+
set: {reason: "'close_stale'", document: event.name}
|
|
17
|
+
- update: s
|
|
18
|
+
if: s != null
|
|
19
|
+
set:
|
|
20
|
+
state: "'closed'"
|
|
21
|
+
closed_by: event.name
|
|
22
|
+
counted_cash: event.counted_cash
|
|
23
|
+
cash_difference: event.cash_difference
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/flow.json
|
|
2
|
+
# When head office set one, the shift opens with the outlet's float (an outlet without a code cannot open a shift:
|
|
3
|
+
# the kernel refuses its number, 409 numbering). One open shift per cashier per outlet: a second one would split the drawer's cash over two counts. The read lock of
|
|
4
|
+
# contract 0025 serializes two opens at the same moment, so the later one sees the first.
|
|
5
|
+
name: pos_shift_on_create
|
|
6
|
+
label: {id: 'Sesi kasir dibuka: hanya satu sesi terbuka per kasir per outlet'}
|
|
7
|
+
on: pos_shift.created
|
|
8
|
+
steps:
|
|
9
|
+
- {find: outlet, where: name == event.outlet, as: o}
|
|
10
|
+
- if: o != null && o.cash_float > 0 && event.opening_cash != o.cash_float
|
|
11
|
+
create: pos_guard
|
|
12
|
+
set: {reason: "'float_of_outlet'", document: event.name}
|
|
13
|
+
- find_all: pos_shift
|
|
14
|
+
where: outlet == event.outlet && cashier == event.cashier && state == 'open' && name != event.name
|
|
15
|
+
limit: 1
|
|
16
|
+
as: open
|
|
17
|
+
- if: open.size() > 0
|
|
18
|
+
create: pos_guard
|
|
19
|
+
set:
|
|
20
|
+
reason: "'shift_already_open'"
|
|
21
|
+
document: open[0].name
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/flow.json
|
|
2
|
+
# The float and the outlet of a shift are fixed once it is open: the expected cash is counted from the float, so
|
|
3
|
+
# raising it later would hide a shortage. Writes by the flows (totals, the close) start no flow, so they pass.
|
|
4
|
+
name: pos_shift_on_update
|
|
5
|
+
label: {id: 'Sesi kasir diubah: modal dan outlet tetap'}
|
|
6
|
+
on: pos_shift.updated
|
|
7
|
+
steps:
|
|
8
|
+
- if: event.before != null && (event.before.opening_cash != event.opening_cash || event.before.outlet != event.outlet)
|
|
9
|
+
create: pos_guard
|
|
10
|
+
set: {reason: "'shift_changed'", document: event.name}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/flow.json
|
|
2
|
+
# A day an outlet rang up in Juragan's cashier is settled when each shift closes (Tutup sesi: cash to Kas, QRIS to
|
|
3
|
+
# Bank, the difference to Selisih kas); a Setoran harian for that outlet and day would book them a second time (audit
|
|
4
|
+
# kasir H1, R2-1, R3-1). Refused when the outlet and day have a paid receipt, whatever the outlet's sales_source says
|
|
5
|
+
# now; and refused for an outlet on the cashier unless that day has a daily sales record (a day of the daily form
|
|
6
|
+
# before the outlet moved to the cashier can still take its setoran). pos_sale_on_submit refuses a receipt on a day
|
|
7
|
+
# that already has a setoran, so neither order books the cash twice.
|
|
8
|
+
name: pos_takings_guard
|
|
9
|
+
label: {id: 'Setoran harian diajukan: tolak kalau hari itu outlet memakai kasir'}
|
|
10
|
+
on: outlet_takings.submitted
|
|
11
|
+
steps:
|
|
12
|
+
- {find: outlet, where: name == event.outlet, as: o}
|
|
13
|
+
- find_all: outlet_sales
|
|
14
|
+
where: outlet == event.outlet && date == event.date && docstatus == 1
|
|
15
|
+
limit: 1
|
|
16
|
+
as: forms
|
|
17
|
+
- if: o != null && o.sales_source == 'kasir' && forms.size() == 0
|
|
18
|
+
create: pos_guard
|
|
19
|
+
set: {reason: "'cashier_takings'", document: event.name}
|
|
20
|
+
- find_all: pos_sale
|
|
21
|
+
where: outlet == event.outlet && date == event.date && docstatus == 1
|
|
22
|
+
limit: 1
|
|
23
|
+
as: receipts
|
|
24
|
+
- if: receipts.size() > 0
|
|
25
|
+
create: pos_guard
|
|
26
|
+
set:
|
|
27
|
+
reason: "'cashier_takings'"
|
|
28
|
+
document: receipts[0].name
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/model.json
|
|
2
|
+
# Never stored: a flow of this module creates one when the write it runs in must be refused (the pattern of
|
|
3
|
+
# rental_guard and outlet_sales_guard); the matching rule fails with the reason's message, which rolls the whole write
|
|
4
|
+
# back (the flow runs inside it). Create is granted to the roles whose writes run those flows.
|
|
5
|
+
name: pos_guard
|
|
6
|
+
label: {id: Penjaga kasir, en: Cashier guard}
|
|
7
|
+
icon: check
|
|
8
|
+
naming: PGD-{######}
|
|
9
|
+
title_field: reason
|
|
10
|
+
permissions:
|
|
11
|
+
- {role: head_office, create: true}
|
|
12
|
+
- {role: cashier, create: true}
|
|
13
|
+
- {role: outlet_staff, create: true} # flow pos_daily_form_guard, inside a daily form's submit
|
|
14
|
+
fields:
|
|
15
|
+
- name: reason
|
|
16
|
+
type: select
|
|
17
|
+
label: {id: Alasan}
|
|
18
|
+
required: true
|
|
19
|
+
options:
|
|
20
|
+
- {value: shift_already_open, label: {id: Sesi kasir masih terbuka}}
|
|
21
|
+
- {value: shift_closed, label: {id: Sesi kasir sudah ditutup}}
|
|
22
|
+
- {value: shift_changed, label: {id: Data pembukaan sesi diubah}}
|
|
23
|
+
- {value: close_stale, label: {id: Angka tutup sesi sudah berubah}}
|
|
24
|
+
- {value: void_other_day, label: {id: Batal di hari lain}}
|
|
25
|
+
- {value: void_shift_closed, label: {id: Batal setelah sesi ditutup}}
|
|
26
|
+
- {value: void_not_own, label: {id: Batal struk sesi kasir lain}}
|
|
27
|
+
- {value: daily_sales_same_day, label: {id: Outlet sudah punya penjualan harian di tanggal itu}}
|
|
28
|
+
- {value: cashier_same_day, label: {id: Outlet sudah memakai kasir di tanggal itu}}
|
|
29
|
+
- {value: cashier_takings, label: {id: Setoran hari kasir}}
|
|
30
|
+
- {value: float_of_outlet, label: {id: Modal kas beda dengan outlet}}
|
|
31
|
+
- {name: document, type: data, label: {id: Dokumen}}
|
|
32
|
+
rules:
|
|
33
|
+
- name: shift_already_open
|
|
34
|
+
on: save
|
|
35
|
+
check: reason != 'shift_already_open'
|
|
36
|
+
message: {id: 'Kamu masih punya sesi kasir terbuka di outlet ini; tutup sesi itu dulu atau lanjutkan di sana'}
|
|
37
|
+
- name: shift_closed
|
|
38
|
+
on: save
|
|
39
|
+
check: reason != 'shift_closed'
|
|
40
|
+
message: {id: 'Sesi kasir ini baru saja ditutup; buka sesi baru lalu ulangi transaksinya'}
|
|
41
|
+
- name: shift_changed
|
|
42
|
+
on: save
|
|
43
|
+
check: reason != 'shift_changed'
|
|
44
|
+
message: {id: 'Outlet dan modal kas tidak bisa diubah setelah sesi dibuka; tutup sesi ini dan buka sesi baru'}
|
|
45
|
+
- name: close_stale
|
|
46
|
+
on: save
|
|
47
|
+
check: reason != 'close_stale'
|
|
48
|
+
message: {id: 'Ada transaksi baru di sesi ini sejak tutup sesi disimpan; simpan lagi untuk membaca angka terbaru, lalu ajukan'}
|
|
49
|
+
- name: void_other_day
|
|
50
|
+
on: save
|
|
51
|
+
check: reason != 'void_other_day'
|
|
52
|
+
message: {id: 'Transaksi hanya bisa dibatalkan di hari yang sama. Untuk hari lain, catat retur lewat kantor pusat'}
|
|
53
|
+
- name: void_shift_closed
|
|
54
|
+
on: save
|
|
55
|
+
check: reason != 'void_shift_closed'
|
|
56
|
+
message: {id: 'Sesi kasir transaksi ini sudah ditutup; transaksinya tidak bisa dibatalkan lagi'}
|
|
57
|
+
- name: void_not_own
|
|
58
|
+
on: save
|
|
59
|
+
check: reason != 'void_not_own'
|
|
60
|
+
message: {id: 'Struk ini dari sesi kasir orang lain; minta kasirnya atau kantor pusat yang membatalkan'}
|
|
61
|
+
- name: daily_sales_same_day
|
|
62
|
+
on: save
|
|
63
|
+
check: reason != 'daily_sales_same_day'
|
|
64
|
+
message: {id: 'Outlet ini sudah punya penjualan atau setoran harian di tanggal ini; satu outlet satu sumber penjualan per hari'}
|
|
65
|
+
- name: cashier_same_day
|
|
66
|
+
on: save
|
|
67
|
+
check: reason != 'cashier_same_day'
|
|
68
|
+
message: {id: 'Outlet ini sudah mencatat penjualan lewat kasir Juragan di tanggal ini; penjualan harian tanggal itu tidak bisa diajukan'}
|
|
69
|
+
- name: cashier_takings
|
|
70
|
+
on: save
|
|
71
|
+
check: reason != 'cashier_takings'
|
|
72
|
+
message: {id: 'Outlet ini memakai kasir Juragan: setorannya dibukukan saat Tutup sesi kasir, bukan di Setoran harian'}
|
|
73
|
+
- name: float_of_outlet
|
|
74
|
+
on: save
|
|
75
|
+
check: reason != 'float_of_outlet'
|
|
76
|
+
message: {id: 'Modal kas outlet ini sudah ditetapkan kantor pusat; isi sesuai Modal kas kasir di data outlet'}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/model.json
|
|
2
|
+
# One payment of a cashier sale: cash handed over (the change comes back from it) or a QRIS payment to the outlet's
|
|
3
|
+
# QRIS (exact, with the reference of the notification). Two rows make a split payment. The shape is the one the
|
|
4
|
+
# counter work screen fills (rangka-os proposal 0030: payments {table, method, amount}).
|
|
5
|
+
name: pos_payment
|
|
6
|
+
is_child: true
|
|
7
|
+
fields:
|
|
8
|
+
- name: method
|
|
9
|
+
type: select
|
|
10
|
+
label: {id: Cara bayar}
|
|
11
|
+
required: true
|
|
12
|
+
default: "'cash'"
|
|
13
|
+
options:
|
|
14
|
+
- {value: cash, label: {id: Tunai}}
|
|
15
|
+
- {value: qris, label: {id: QRIS}}
|
|
16
|
+
- {name: amount, type: currency, label: {id: Jumlah}, required: true}
|
|
17
|
+
- {name: ref, type: data, label: {id: Ref QRIS}, help: {id: 'Nomor referensi di notifikasi QRIS, kalau ada'}}
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/model.json
|
|
2
|
+
# Transaksi kasir: one receipt. A draft is the open basket; submitting it is the payment: the receipt gets its number
|
|
3
|
+
# per outlet and month (STRK-<outlet code>-<YYMM>-<n>, contract 0009 §2a), the goods leave the outlet's stock (a menu
|
|
4
|
+
# item through its active recipe), and the shift's totals grow (flow pos_sale_on_submit). Prices come from the item
|
|
5
|
+
# (or from the unit picked on the line, uom_conversion.rate); the cashier gives discounts, never a price. Prices
|
|
6
|
+
# include PPN for a PKP business, as on outlet_sales, so the journal splits the PPN out the same way.
|
|
7
|
+
# Payment is a table (cash with change, QRIS, or both), the shape of the counter work screen (proposal 0030).
|
|
8
|
+
# Void: cancel, only on the sale's day while its shift is open (flow pos_sale_on_cancel: the kernel runs no
|
|
9
|
+
# `on: cancel` rule, so the checks live in the flow, under the shift's lock); the stock comes back at the cost it
|
|
10
|
+
# left with and the shift's totals shrink. A partial return on the same day is a void and an amended receipt without the returned items
|
|
11
|
+
# (the amendment keeps the number with -1). Goods that went to waste after the void go out with a stock_adjustment.
|
|
12
|
+
name: pos_sale
|
|
13
|
+
label: {id: Transaksi kasir, en: Cashier sale}
|
|
14
|
+
icon: receipt
|
|
15
|
+
is_submittable: true
|
|
16
|
+
naming: STRK-{outlet.code}-{YY}{MM}-{#####}
|
|
17
|
+
title_field: grand_total
|
|
18
|
+
on_submit: [stock.post_moves]
|
|
19
|
+
on_cancel: [stock.reverse_moves]
|
|
20
|
+
permissions:
|
|
21
|
+
- {role: head_office, read: true, create: true, write: true, delete: true, submit: true, cancel: true, amend: true, export: true, print: true}
|
|
22
|
+
- {role: cashier, read: true, create: true, write: true, delete: true, submit: true, cancel: true, amend: true, print: true}
|
|
23
|
+
# flow pos_daily_form_guard reads the receipts of the outlet a daily sales record is submitted for
|
|
24
|
+
- {role: outlet_staff, read: true}
|
|
25
|
+
fields:
|
|
26
|
+
- name: shift
|
|
27
|
+
type: link
|
|
28
|
+
to: pos_shift
|
|
29
|
+
label: {id: Sesi kasir}
|
|
30
|
+
required: true
|
|
31
|
+
peek: [outlet, opening_date, cashier]
|
|
32
|
+
# outlet and date are not read_only: an amendment (a partial return) copies only writable values. The rules hold
|
|
33
|
+
# them to the shift's outlet and to the day of payment.
|
|
34
|
+
- name: outlet
|
|
35
|
+
type: link
|
|
36
|
+
to: outlet
|
|
37
|
+
label: {id: Outlet}
|
|
38
|
+
default: shift.outlet
|
|
39
|
+
in_list: true
|
|
40
|
+
- name: date
|
|
41
|
+
type: date
|
|
42
|
+
label: {id: Tanggal}
|
|
43
|
+
default: today()
|
|
44
|
+
in_list: true
|
|
45
|
+
- name: buyer
|
|
46
|
+
type: data
|
|
47
|
+
label: {id: Pembeli atau meja}
|
|
48
|
+
help: {id: 'Boleh kosong. Nama pembeli, nomor meja atau nomor antrean'}
|
|
49
|
+
in_list: true
|
|
50
|
+
- name: items
|
|
51
|
+
type: table
|
|
52
|
+
of: pos_sale_item
|
|
53
|
+
label: {id: Barang}
|
|
54
|
+
min_rows: 1
|
|
55
|
+
- name: gross_total
|
|
56
|
+
type: currency
|
|
57
|
+
label: {id: Harga sebelum diskon}
|
|
58
|
+
compute: "items.map(l, l.gross).sum()"
|
|
59
|
+
- name: subtotal
|
|
60
|
+
type: currency
|
|
61
|
+
label: {id: Subtotal}
|
|
62
|
+
compute: "items.map(l, l.amount).sum()"
|
|
63
|
+
- name: discount_amount
|
|
64
|
+
type: currency
|
|
65
|
+
label: {id: Diskon nota}
|
|
66
|
+
help: {id: 'Potongan rupiah untuk seluruh nota, setelah diskon per barang'}
|
|
67
|
+
default: '0'
|
|
68
|
+
- name: discount_total
|
|
69
|
+
type: currency
|
|
70
|
+
label: {id: Total diskon}
|
|
71
|
+
compute: gross_total - subtotal + discount_amount
|
|
72
|
+
- name: grand_total
|
|
73
|
+
type: currency
|
|
74
|
+
label: {id: Total}
|
|
75
|
+
compute: subtotal - discount_amount
|
|
76
|
+
in_list: true
|
|
77
|
+
# Payment (table payments, rows of pos_payment): no row means exact cash; a cash row is what the buyer handed over,
|
|
78
|
+
# a QRIS row is paid exactly. Change comes only out of cash, so QRIS may not exceed the total.
|
|
79
|
+
- {name: payments, type: table, of: pos_payment, label: {id: Pembayaran}}
|
|
80
|
+
- name: qris_amount
|
|
81
|
+
type: currency
|
|
82
|
+
label: {id: Dibayar QRIS}
|
|
83
|
+
compute: "payments.map(p, p.method == 'qris' ? p.amount : 0).sum()"
|
|
84
|
+
- name: cash_received
|
|
85
|
+
type: currency
|
|
86
|
+
label: {id: Uang tunai diterima}
|
|
87
|
+
compute: "payments.size() == 0 ? grand_total : payments.map(p, p.method == 'cash' ? p.amount : 0).sum()"
|
|
88
|
+
- name: cash_amount
|
|
89
|
+
type: currency
|
|
90
|
+
label: {id: Dibayar tunai}
|
|
91
|
+
help: {id: 'Total dikurangi QRIS: uang tunai yang tinggal di laci'}
|
|
92
|
+
compute: grand_total - qris_amount
|
|
93
|
+
- name: change_amount
|
|
94
|
+
type: currency
|
|
95
|
+
label: {id: Kembalian}
|
|
96
|
+
compute: cash_received + qris_amount - grand_total
|
|
97
|
+
- name: method
|
|
98
|
+
type: select
|
|
99
|
+
label: {id: Cara bayar}
|
|
100
|
+
compute: "qris_amount == 0 ? 'cash' : (qris_amount >= grand_total ? 'qris' : 'split')"
|
|
101
|
+
in_list: true
|
|
102
|
+
chip: true
|
|
103
|
+
options:
|
|
104
|
+
- {value: cash, label: {id: Tunai}}
|
|
105
|
+
- {value: qris, label: {id: QRIS}}
|
|
106
|
+
- {value: split, label: {id: Tunai + QRIS}}
|
|
107
|
+
- name: cogs_total
|
|
108
|
+
type: currency
|
|
109
|
+
label: {id: Harga pokok}
|
|
110
|
+
help: {id: 'Diisi sistem saat dibayar: barang atau bahan resep x rata-rata biaya'}
|
|
111
|
+
read_only: true
|
|
112
|
+
- name: margin
|
|
113
|
+
type: currency
|
|
114
|
+
label: {id: Margin}
|
|
115
|
+
compute: grand_total - cogs_total
|
|
116
|
+
# Same monthly tax recap as outlet_sales: PPN inside a PKP shop's prices, and the 0,5% final PPh of PP 55/2022.
|
|
117
|
+
- name: ppn_in_sales
|
|
118
|
+
type: currency
|
|
119
|
+
label: {id: PPN dalam penjualan}
|
|
120
|
+
compute: "tax.pkp ? round(grand_total * tax.ppn_rate * tax.dpp_num / (100 * tax.dpp_den + tax.ppn_rate * tax.dpp_num)) : 0"
|
|
121
|
+
- name: pph_final
|
|
122
|
+
type: currency
|
|
123
|
+
label: {id: 'PPh final 0,5%'}
|
|
124
|
+
compute: round((grand_total - ppn_in_sales) * 5 / 1000)
|
|
125
|
+
# Cashier controls (audit kasir M5): a receipt whose discounts exceed 20% of its price waits for head office
|
|
126
|
+
# (contract 0007; the owner may always approve). A void is not held: an approved verb runs again as a requester
|
|
127
|
+
# without their outlets, so the flow's own-shift check cannot run (kernel card t_7782ebb1 follow-up); voids stay
|
|
128
|
+
# same day, open shift, own shift, and are counted on the shift and the dashboard.
|
|
129
|
+
approvals:
|
|
130
|
+
- name: big_discount
|
|
131
|
+
on: submit
|
|
132
|
+
when: "discount_total * 100 > gross_total * 20 && !('head_office' in user.roles) && !('owner' in user.roles)"
|
|
133
|
+
approvers: [head_office]
|
|
134
|
+
label: {id: Persetujuan kantor pusat untuk diskon di atas 20%, en: Head office approves a discount above 20%}
|
|
135
|
+
stock:
|
|
136
|
+
date: date
|
|
137
|
+
moves:
|
|
138
|
+
- {lines: items, out: outlet, explode: recipe, reason: sale, cogs: cogs}
|
|
139
|
+
cogs_total: cogs_total
|
|
140
|
+
rules:
|
|
141
|
+
# the receipt number carries the outlet code (STRK-<code>-...); head office could have emptied it since the shift
|
|
142
|
+
# opened: say so when saving, not only at payment (kernel 409 numbering)
|
|
143
|
+
- name: outlet_has_code
|
|
144
|
+
on: save
|
|
145
|
+
check: outlet.code != ''
|
|
146
|
+
message: {id: 'Outlet ini belum punya Kode; minta kantor pusat mengisi Kode outlet (dipakai di nomor struk)'}
|
|
147
|
+
- name: outlet_of_shift
|
|
148
|
+
on: save
|
|
149
|
+
check: outlet == shift.outlet
|
|
150
|
+
message: {id: 'Outlet transaksi harus sama dengan outlet sesi kasirnya'}
|
|
151
|
+
- name: shift_open
|
|
152
|
+
on: save
|
|
153
|
+
check: shift.state == 'open'
|
|
154
|
+
message: {id: 'Sesi kasir ini sudah ditutup; buka sesi baru'}
|
|
155
|
+
- name: own_shift
|
|
156
|
+
on: save
|
|
157
|
+
check: "shift.cashier == user.email || 'head_office' in user.roles || 'owner' in user.roles"
|
|
158
|
+
message: {id: 'Ini sesi kasir orang lain; pakai sesi kasirmu sendiri'}
|
|
159
|
+
# Jalur A or Jalur B per outlet: with outlet_sales installed, only an outlet whose sales source is the cashier.
|
|
160
|
+
- name: outlet_uses_cashier
|
|
161
|
+
on: save
|
|
162
|
+
check: "!app_installed('outlet_sales') || (outlet.moka_name == '' && outlet.sales_source == 'kasir')"
|
|
163
|
+
message: {id: 'Outlet ini mencatat penjualan lewat Moka, file POS atau formulir harian. Ubah Sumber penjualan outlet ke Kasir Juragan dulu'}
|
|
164
|
+
- name: qty_positive
|
|
165
|
+
on: save
|
|
166
|
+
check: "items.map(l, l.qty <= 0 ? 1 : 0).sum() == 0"
|
|
167
|
+
message: {id: Jumlah barang harus lebih dari 0}
|
|
168
|
+
- name: line_discount_range
|
|
169
|
+
on: save
|
|
170
|
+
check: "items.map(l, l.discount_pct < 0 || l.discount_pct > 100 ? 1 : 0).sum() == 0"
|
|
171
|
+
message: {id: Diskon barang harus 0 sampai 100 persen}
|
|
172
|
+
- name: unit_of_item
|
|
173
|
+
on: save
|
|
174
|
+
check: "items.map(l, l.packing_item != l.item ? 1 : 0).sum() == 0"
|
|
175
|
+
message: {id: 'Satuan yang dipilih bukan satuan barang itu'}
|
|
176
|
+
- name: priced
|
|
177
|
+
on: save
|
|
178
|
+
check: "items.map(l, l.rate <= 0 ? 1 : 0).sum() == 0"
|
|
179
|
+
message: {id: 'Ada barang tanpa harga jual; isi Harga jual di data barang'}
|
|
180
|
+
- name: receipt_discount_range
|
|
181
|
+
on: save
|
|
182
|
+
check: discount_amount >= 0 && discount_amount <= subtotal
|
|
183
|
+
message: {id: Diskon nota tidak boleh negatif atau melebihi subtotal}
|
|
184
|
+
- name: payment_positive
|
|
185
|
+
on: save
|
|
186
|
+
check: "payments.map(p, p.amount <= 0 ? 1 : 0).sum() == 0"
|
|
187
|
+
message: {id: Jumlah pembayaran harus lebih dari 0}
|
|
188
|
+
- name: qris_not_over
|
|
189
|
+
on: save
|
|
190
|
+
check: qris_amount <= grand_total
|
|
191
|
+
message: {id: 'QRIS tidak boleh melebihi total; kembalian hanya dari uang tunai'}
|
|
192
|
+
- name: paid_enough
|
|
193
|
+
on: save
|
|
194
|
+
check: change_amount >= 0
|
|
195
|
+
message: {id: 'Pembayaran kurang dari total'}
|
|
196
|
+
- name: paid_today
|
|
197
|
+
on: submit
|
|
198
|
+
check: date == today()
|
|
199
|
+
message: {id: 'Draf ini dari hari lain; buat transaksi baru untuk hari ini'}
|
|
200
|
+
views:
|
|
201
|
+
list:
|
|
202
|
+
columns: [name, date, outlet, grand_total, method, status, buyer]
|
|
203
|
+
filters: [outlet, method, shift]
|
|
204
|
+
sort: -name
|
|
205
|
+
form:
|
|
206
|
+
layout:
|
|
207
|
+
- section: {id: Transaksi}
|
|
208
|
+
columns:
|
|
209
|
+
- [shift, outlet, date]
|
|
210
|
+
- [buyer]
|
|
211
|
+
- section: {id: Barang}
|
|
212
|
+
fields: [items]
|
|
213
|
+
- section: {id: Bayar}
|
|
214
|
+
columns:
|
|
215
|
+
- [subtotal, discount_amount, grand_total]
|
|
216
|
+
- [cash_received, qris_amount, change_amount]
|
|
217
|
+
- section: {id: Pembayaran}
|
|
218
|
+
fields: [payments]
|
|
219
|
+
- section: {id: Ringkasan}
|
|
220
|
+
columns:
|
|
221
|
+
- [gross_total, discount_total, cogs_total, margin]
|
|
222
|
+
- [ppn_in_sales, pph_final]
|