eCentric Workspace · Architecture Guide
Cấu trúc DocType, approval workflow, master data và integration roadmap ERPNext.
1. DocType Hierarchy & Flow
Master
MSO Request
Cấp campaign · 1 lần/tháng/phòng ban
Recipe: MSO Standard (4 levels)
Manager → Leader → Finance → CEO
Manager → Leader → Finance → CEO
↓ master_service_ref (1:N)
Service per MSO
Service Request (SO)
Recipe: In-Budget (1 cấp) | Out-Budget (4 cấp)
service_type → Item · brand_code → Brand Approver
service_type → Item · brand_code → Brand Approver
↓ service_request_id (1:N)
Procurement
Procurement Request (PO)
Recipe: In-Budget (2 cấp) | Out-Budget (4 cấp)
item_group → Procurement Type · vendor_name
item_group → Procurement Type · vendor_name
↓ procurement_request_id (1:N)
Reconciliation
Reconciliation Request (REC)
Recipe: REC Standard (2 cấp)
Manager → Finance · chênh lệch auto compute
Manager → Finance · chênh lệch auto compute
Master Requests (Độc lập)
VRQ
Vendor Code Request
Recipe: HOF only (1 cấp)
Approve → auto-create Supplier
Approve → auto-create Supplier
CRQ
Client Code Request
Recipe: HOF only (1 cấp)
Approve → auto-create Customer
Approve → auto-create Customer
2. Approval Recipes
Cách resolve approver:
- Brand-specific: doc có
brand_code→ lookupBrand Approver/<code>→ manager_email / leader_email / finance_email - Global Role fallback: nếu Brand thiếu email → lookup
Global Roletheorole_key(manager / leader / finance_lead / hof / ceo) - Nếu cả 2 đều trống → bỏ qua level đó
3. Master Data & Admin URLs
4. Custom Fields
Item Group: description (Small Text) — giải thích từng Procurement Type
Item: default_procurement_type (Link) + allowed_procurement_types (Table) — mapping service ↔ procurement (1-N)
Brand Approver: manager_email, leader_email, finance_email + approval_recipe, parent_client_code
Global Role: role_key (Select), user_email, active
5. ERPNext Integration Roadmap (Phase 2)
Phase 1 (hiện tại): MSO/SO/PO/REC là custom DocType với approval workflow riêng. Master data dùng ERPNext native (Customer, Item, Supplier, Item Group).
Phase 2 (tương lai): Auto-create ERPNext native khi approved:
- SO Approved → ERPNext
Sales Order - PO Approved → ERPNext
Purchase Order - REC Approved → ERPNext
Payment Entry
Lợi ích: full report ERPNext (Stock, Accounting, Sales) tự động có data.