This document comprehensively captures all business logic, roles, actors, entities, and flows extracted from the legacy Oracle Forms (FMB) source code for Legacy ERP Head Office (Legacy ERPHQ) and Legacy ERP Hubs.
Source : Extracted from /reference/extracted_fmb_content/ containing:
Legacy ERPHQ_SOSpokeE_CODE : 474 files across 7 modules
Hub_FMBs : 844 files
The ILegacy ERPS (Integrated Legacy ERP System) follows a Hub-and-Spoke architecture:
βββββββββββββββββββββββββββ
β Legacy ERP Head Office β
β β Policy & Procurement β
β β Demand Generation β
βββββββββββββ¬ββββββββββββββ
βββββββββββββββββββββββββΌββββββββββββββββββββββββ
βββββββββββββββββ βββββββββββββββββ βββββββββββββββββ
β Hub 1 β β Hub 2 β β Hub N β
β β Receipts β β β Receipts β β β Receipts β
β β Issues β β β Issues β β β Issues β
β β Spoke Sales β β β Spoke Sales β β β Spoke Sales β
βββββββββ¬ββββββββ βββββββββ¬ββββββββ βββββββββ¬ββββββββ
βββββββββββββββββ βββββββββββββββββ βββββββββββββββββ
β Spoke 1..N β β Spoke 1..N β β Spoke 1..N β
β (End Outlets) β β (End Outlets) β β (End Outlets) β
βββββββββββββββββ βββββββββββββββββ βββββββββββββββββ
Form
Purpose
CCSEC01F
User Master management (USER_MST)
CCSEC02F
Role Master management (ROLE_MST)
CCSEC03F
User-Role assignment (USER_ROLE)
CCSEC04F
Form-level security privileges
CCSEC05F
Menu security
CCSEC06F
Password management
Table
Purpose
Key Fields
USER_MST
System users
USER_CODE, PERSONAL_NUM, PASSWORD, ORACLE_USER_FLG
ROLE_MST
Role definitions
ROLE_CODE, DESCRIPTION
USER_ROLE
User-role mapping
USER_CODE, ROLE_CODE
The system implements product category-based roles :
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β General Stores (GS) β Liquor/Imported Food (LIF) β
β βββββββββββββββββββββ β βββββββββββββββββββββββββ β
β GS1 : Group 1 items β LIF4 : Liquor Group 4 β
β GS2 : Group 2 items β LIF5 : Liquor Group 5 β
β GS3 : Group 3 items β LIF6 : Liquor Group 6 β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β βββββββββββββββββ β
β GL : General Ledger access β
β F : Full access (VALID_GROUPS = -1) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Implementation Logic (from IHMAS03F.fmb):
-- Role prefix determines access level
IF (SUBSTR(vRole, 1 , 3 ) = ' GS1 ' ) THEN : PARAMETER . VALID_GROUPS : = 1 ;
ELSIF (SUBSTR(vRole, 1 , 3 ) = ' GS2 ' ) THEN : PARAMETER . VALID_GROUPS : = 2 ;
ELSIF (SUBSTR(vRole, 1 , 3 ) = ' GS3 ' ) THEN : PARAMETER . VALID_GROUPS : = 3 ;
ELSIF (SUBSTR(vRole, 1 , 4 ) = ' LIF4 ' ) THEN : PARAMETER . VALID_GROUPS : = 4 ;
ELSIF (SUBSTR(vRole, 1 , 4 ) = ' LIF5 ' ) THEN : PARAMETER . VALID_GROUPS : = 5 ;
ELSIF (SUBSTR(vRole, 1 , 4 ) = ' LIF6 ' ) THEN : PARAMETER . VALID_GROUPS : = 6 ;
Legacy ERPHQ_SOSpokeE_CODE/
βββ Audit/ # Audit forms
βββ FNA/ # Finance & Accounts (240 files)
β βββ Bills/ # Bill processing
β βββ Payroll/ # Salary processing
β βββ cash book/ # Cash management
β βββ costing&claims/ # TA/DA, LTC claims
β βββ general ledger/ # GL transactions
β βββ imprest/ # Imprest management
β βββ masters/ # FNA master data
β βββ purchase ledger/ # Supplier ledger
β βββ sales ledger/ # Customer ledger
βββ GM/ # General Management
βββ INV/ # Inventory (189 files)
β βββ Data_Transfer/ # Hub data sync
β βββ forecasting/ # Demand forecasting
β βββ masters/ # Item, Supplier masters
β βββ ordering/ # Demand, PO generation
β βββ stock_monitoring/ # Stock status
β βββ stock_updation/ # Stock updates
βββ MIS/ # Reporting
βββ PNA/ # Personnel & Admin (26 files)
β β βββ Budget/ # HR Budget
β β βββ Employee Family/ # Dependents
β β βββ leave/ # Leave management
β β βββ Pension/ # Pension processing
βββ Security/ # Access control (8 files)
Form
Table
Purpose
IHMAS03F
ITEM_MST
Item/Product Master
IHMAS04F
SUPPLIER_MST
Supplier Master
IHMAS05F
SUB_GROUP_MST
Product Sub-Groups
IHMAS06F
GROUP_MST
Product Groups
IHMAS07F
HUB_MST
Hub Master
IHMAS09F
LOCATION_MST
Hub Locations
IHMAS10F
GENERIC_MST
Generic Product Categories
Form
Purpose
IHQRD01F
Demand Header creation
IHQRD02F
Demand Detail & PO Generation
IHQRD07F
Hub allocation
IHQRD08F
PO approval
IHQRD10F
PO amendments
IHQRD16F
Consolidated PO
IHFCT08F
Forecasting parameters
Demand Consolidation : Aggregates depot demands from Demand_HDR
PO Generation : Creates PO_HDR and PO_DTL records
Hub Allocation : Distributes stock via ALLOCATION_HUB table
Directory
Forms
Purpose
Bills/
56
Supplier bill processing, DB/CR notes
Payroll/
61
Salary, advances, recoveries
cash book/
12
Cash receipts, payments
costing&claims/
70
TA/DA, LTC, medical claims
general ledger/
8
Journal entries, trial balance
imprest/
13
Imprest requisition, statement
purchase ledger/
2
Supplier accounts
sales ledger/
3
Spoke/Customer accounts
Form
Purpose
FHBUD03F
Budget allocation
FHGLD14F-17F
General Ledger entries
FHIMP25F, FHIMP26F
Imprest management
FHCNC05F, FHCNC06F
Costing & claims
FHBIL09F
Bill processing
Directory
Forms
Purpose
Budget/
9
HR budget management
Employee Family/
1
Dependent details
leave/
11
Leave management
Pension/
5
Pension processing
Form
Purpose
AHEMP01F
Employee master
AHLEV01F-14F
Leave applications, orders, credits
AHPEN01F-15F
Pension processing (PPPO β FPPO)
AHATN01F
Attendance
AHBUD08F-99F
Budget allocation & monitoring
Based on naming conventions, the Hub forms cover:
Prefix
Count
Module
IDISS*
~60
Invoice/Issue (Sales to Spokes)
IDRCP*
~80
Receipt (Stock receiving)
IDDirect*
~50
Direct (Against Firm Demand)
IDPRE*
~30
Demand/Demand generation
IDGOD*
~25
Goods/Delivery
IDMAS*
~15
Hub masters
IDEXP*
~15
Export to HQ
FDCAS*
~15
Cash management
FDIMP*
~10
Imprest (Hub)
FDSLD*
~10
Sales ledger
JE_FORM*
~30
Journal entries
pro_*
~50
Pro-forma/Demand
Table
Purpose
Key Fields
HUB_MST
Hub info
HUB_CODE, NAME, ADDRESS
Spoke_MST
Unit Run Canteens
Spoke_CODE, NAME, HUB_CODE
Spoke_EXT
Spoke extensions
Spoke_CODE, EXT
ITEM_MST
Products
INDEX_NUM, DESCRIPTION, GROUP_CODE
SUPPLIER_MST
Suppliers
SUPPLIER_CODE, NAME
SUB_GROUP_MST
Sub-groups
SUB_GROUP_CODE, LIQUOR_ITEM_FLG
LOCATION_MST
Stock locations
INDEX_NUM, ACTIVE_FLG
Table
Purpose
Key Fields
PO_HDR
Purchase Orders
HUB_CODE, PO_NUM, SUPPLIER_CODE
PO_DTL
PO Line Items
PO_NUM, INDEX_NUM, CASES_ORDERED
INDENT_HDR
Spoke Indents
INDENT_NUM, Spoke_CODE, APP_STATUS
INDENT_DTL
Indent Items
INDENT_NUM, INDEX_NUM, QTY_CASES
INDENT_EXTENSION
Extended items
INDENT_NUM, INDEX_NUM
RECEIPT_HDR
Goods receipts
RECEIPT_NUM, PO_NUM
ALLOCATION_HUB
Stock allocation
HUB_CODE, PO_NUM, INDEX_NUM
PRO_DEMAND_HDR
Pro-forma demand
Demand_ID, Spoke_CODE
Demand_HDR
Demand at Hub
Demand_ID, Demand_DTE, Demand_STATUS
Table
Purpose
VOUCHER_HDR
Payment vouchers
Direct_OR_TXN
Direct Order Receipts
Direct_REFUND
Direct Refunds
DB_CR_NOTE_DTL
Debit/Credit notes
CASH_STMT
Cash statements
IMPREST_STMT
Imprest statements
ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ
β Spoke βββββΆβ Hub βββββΆβ HQ βββββΆβ Supplier β
β (Indent) β β (Aggregate) β β (Demand) β β (Supply) β
ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ
INDENT_HDR PRO_DEMAND_HDR Demand_HDR PO_HDR
INDENT_DTL (consolidation) (policy) PO_DTL
Forms Involved :
IDISS02F_INVOICE: Spoke indent processing
IDPRE012F_*: Demand generation at Hub
IHQRD02F: PO generation at HQ
IDRCP02F_*: Receipt processing
ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ
β Customer βββββΆβ Hub βββββΆβ HQ βββββΆβ Supplier β
β (Booking) β β (SR_NUM) β β (Allocate) β β (Deliver) β
ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ
Direct_CUSTOMER_MST Direct_OR_TXN ALLOCATION Form 2 (Invoice)
Direct_CUSTOMER_DTL VOUCHER_HDR _HUB
Forms Involved :
IDDirect01F_*: Direct booking & PO
IDDirect07F_refund: Refund processing
IDDirect11F_*: Direct OR (Order Receipt)
IDDirect12F_*: Direct billing
Key Direct Logic (from IDDirect01F):
-- Check if full refund exists; if so, block Form 2 issuance
SELECT full_refund INTO vfull_refund
WHERE po_num = : afd_customer_mst . po_num ;
IF vfull_refund = ' Y ' THEN
-- Block all modifications
SET_BLOCK_PROPERTY( ' Direct_CUSTOMER_MST ' , UPDATE_ALLOWED, PROPERTY_FALSE);
ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ
β Supplier βββββΆβ Hub βββββΆβ Stock Ledgerβ
β (Delivery) β β (GRN) β β (Update) β
ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ
β RECEIPT_HDR INV_STS_AREA_HUB
β RECEIPT_DTL (bin balances)
(received_qty) (if applicable)
Forms Involved :
IDRCP02F_*: Receipt entry
IDRCP04F_*: Form 2 (Sales document)
IDRCP07F_*: Price revision
IDRCP08F_*: Stock revision
ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ
β Transaction βββββΆβ Voucher βββββΆβ Ledger β
β (Sale/Rcpt) β β Generation β β Posting β
ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ
Source Doc VOUCHER_HDR FDSLD (Sales)
(Invoice/GRN) DB_CR_NOTE_HDR Account Heads
Forms Involved :
JE_FORM*: Journal entry
FDCAS01F_*: Cash statement/OR
FDSLD01F_*: DB/CR notes
FDORT01F_*: Trial balance
The system uses PARAMETER_MST for configuration:
Parameter
Purpose
CURRENT_YEAR_CODE
Active financial year
ILegacy ERPS_INSTALLATION
Hub code (context)
ENCRYPTION_KEY
Password encryption
Accessed via : PARA_NUM_VALUE('PARAMETER_NAME')
Legacy Entity
Framework M Equivalent
Notes
INDENT_HDR/DTL
MaterialRequest
Spoke demand
PRO_DEMAND_HDR
PurchaseRequest
Hub aggregation
Demand_HDR/DTL
PurchaseOrder (Draft)
HQ consolidation
PO_HDR/DTL
PurchaseOrder
Supplier orders
RECEIPT_HDR/DTL
PurchaseReceipt
GRN
Form 2 (IDRCP04F)
SalesInvoice
Spoke billing
Direct_CUSTOMER_MST
SalesOrder
Make-to-order
VOUCHER_HDR
PaymentEntry
Financial vouchers
DB_CR_NOTE_*
JournalEntry
Adjustments
ITEM_MST
Item (m-core)
Product catalog
Spoke_MST
Customer (m-core)
Outlet master
SUPPLIER_MST
Supplier (m-core)
Vendor master
HUB_MST
Warehouse
Stock location
USER_MST
Citadel IAM User
Authentication
ROLE_MST
Citadel IAM Role
Authorization
-- Cannot delete active items
SELECT 1 INTO vId FROM location_mst
WHERE index_num = : item_mst . index_num AND active_flg = ' Y ' ;
RAISE ' This item is active, therefore cannot be deleted. ' ;
-- Liquor sub-groups only allow CR (Contract Rum) or RG (Regular)
IF : item_mst . item_type NOT IN ( ' CR ' , ' RG ' ) THEN
RAISE ' For this subgroup, item type can only be Contract Rum or Regular. ' ;
-- Prevent deletion of master with child records
IF exists ( SELECT 1 FROM indent_dtl WHERE indent_num = : indent_hdr . indent_num ) THEN
RAISE ' Cannot delete master record when matching detail records exist. ' ;
-- Lock blocks after approval
IF app_status = ' C ' THEN -- 'C' = Completed/Approved
SET_BLOCK_PROPERTY( ' INDENT_HDR ' , UPDATE_ALLOWED, PROPERTY_FALSE);
SET_BLOCK_PROPERTY( ' INDENT_DTL ' , UPDATE_ALLOWED, PROPERTY_FALSE);
Module
Files
Key Areas
FNA
240
Bills, Payroll, GL, Imprest, Claims
INV
189
Masters, Ordering, Forecasting, Stock
PNA
26
Leave, Pension, Budget
Security
8
User, Role, Menu security
MIS
4
Reports
GM
6
General
Audit
1
Audit forms
Prefix
~Count
Purpose
IDRCP*
80
Receipts
IDISS*
60
Issues/Invoices
IDDirect*
50
Direct operations
pro_*
50
Pro-forma demand
IDPRE*
30
Demand
JE_FORM*
30
Journal entries
IDGOD*
25
Goods/Delivery
FDCAS*
15
Cash
IDMAS*
15
Masters
IDEXP*
15
HQ Export
FDIMP*
10
Imprest
Others
~460
Various utilities
Based on the legacy analysis, ensure Framework M covers:
Security : USER_MST, ROLE_MST, USER_ROLE β Citadel IAM
Role-based filtering : GS1-3, LIF4-6 category access
Item Master : ITEM_MST with GROUP_CODE, SUB_GROUP_CODE hierarchy
Party Masters : Spoke_MST, SUPPLIER_MST, HUB_MST
Indent Flow : INDENT_HDR/DTL with denial tracking
Demand Flow : Demand aggregation β PO generation
Receipt Flow : PO β GRN with stock update
Direct Flow : Booking β Payment β Delivery with refund logic
Financial : Vouchers, DB/CR notes, Trial Balance
Leave : Applications, Orders, Credits (m-leave)
Pension : PPPO β FPPO lifecycle (m-pension)
Imprest : Requisition, Statement, Voucher (m-imprest)