Skip to content
aniketdvnks edited this page Dec 22, 2025 · 2 revisions

THTPL ERPNext Integration Architecture & Data Flow

Document Flow Visualization

Sales Order to Delivery Flow

┌─────────────────────────────────────────────────────────────────────┐
│                        CUSTOMER INQUIRY                             │
│                      (A2: Follow-Up Record)                         │
└─────────────────────────────────────────────────────────────────────┘
                              │
                              ▼
┌─────────────────────────────────────────────────────────────────────┐
│                         QUOTATION (B1)                              │
│              Enquiry Review Checklist → Quote                       │
│         ├─ Item description                                         │
│         ├─ Technical requirements                                   │
│         ├─ Feasibility check                                        │
│         └─ Review completion date                                   │
└─────────────────────────────────────────────────────────────────────┘
                              │
                              ▼
┌─────────────────────────────────────────────────────────────────────┐
│                      SALES ORDER (B2)                               │
│            Order Acceptance #001 → Sales Order Created              │
│         ├─ Order Acceptance Number (Auto-Generated)                 │
│         ├─ Design Manager Link                                      │
│         ├─ Design Input Reference                                   │
│         └─ Auto-generate Transmittal to Design                      │
└─────────────────────────────────────────────────────────────────────┘
                              │
                              ▼
┌─────────────────────────────────────────────────────────────────────┐
│                   DESIGN INPUT (C1)                                 │
│        Auto-linked to Sales Order upon Order Acceptance             │
│         ├─ Sales Order Reference                                    │
│         ├─ Design Parameters (Table)                                │
│         ├─ Design Engineer Assignment                               │
│         ├─ Design Drawings (Attachment)                             │
│         └─ Revision Tracking (Rev.00 → Rev.01)                      │
└─────────────────────────────────────────────────────────────────────┘
                              │
                              ▼
┌─────────────────────────────────────────────────────────────────────┐
│                     BOM CREATION (C2-C3)                            │
│         Drawing & BOM Rev.00 → Item + BOM Creation                 │
│         ├─ Design Input Reference (Auto-linked)                     │
│         ├─ Approved Drawing Attachment                              │
│         ├─ Design Approval Status (Workflow)                        │
│         ├─ POS Generation (Parts/Specifications)                    │
│         └─ Auto-generate Transmittal (Design → PUR, PRD, QC)        │
└─────────────────────────────────────────────────────────────────────┘
                              │
              ┌───────────────┼───────────────┐
              ▼               ▼               ▼
    ┌──────────────┐ ┌──────────────┐ ┌──────────────┐
    │   PURCHASE   │ │  PRODUCTION  │ │ QUALITY CTRL │
    │   (D Module) │ │   (G Module) │ │   (H Module) │
    └──────────────┘ └──────────────┘ └──────────────┘
              │               │               │
              └───────────────┼───────────────┘
                              │
                              ▼
┌─────────────────────────────────────────────────────────────────────┐
│              QUALITY CONTROL PLAN (H1)                              │
│         Auto-created based on Sales Order + Item ASME Info          │
│         ├─ ASME Standard Reference (ASME Sec VIII Div 1)            │
│         ├─ Inspection Activities (Linked to each stage)             │
│         ├─ WPS/PQR/WPQ References                                   │
│         ├─ NDE Procedures (LPT, RT, VT)                             │
│         └─ Acceptance Criteria per ASME                             │
└─────────────────────────────────────────────────────────────────────┘
                              │
              ┌───────────────┼───────────────┐
              ▼               ▼               ▼
    ┌──────────────────┐ ┌──────────────────┐ ┌───────────────────────────────┐
    │ RAW MATERIAL     │ │ IN-PROCESS       │ │ FINAL TESTING                 │
    │ INSPECTION (H4)  │ │ INSPECTION (H5-6)│ │ (H6-7)                        │
    │                  │ │                  │ │                               │
    │ ├─ Material ID   │ │ ├─ Heat Treat    │ │ ├─ Pressure Test              │
    │ │                │ │ │                │ │ ├─ Final Dimension Inspection │
    │ ├─ MTC Attached  │ │ ├─ Stage Insp    │ │ ├─ Painting Insp              │
    │ ├─ Plate/Pipe    │ │ ├─ LPT Report    │ │ └─ Final Release              │
    │ │  Inspection    │ │ ├─ Visual Insp   │ │                               │
    │ └─ Discrepancies │ │ └─ RT Reports    │ │                               │
    └──────────────────┘ └──────────────────┘ └───────────────────────────────┘
              │               │                                 │
              └───────────────┼─────────────────────────────────┘
                              │
                              ▼
┌─────────────────────────────────────────────────────────────────────┐
│              WORK ORDER COMPLETION                                  │
│         All Quality Checks PASSED → Ready for Dispatch              │
│         ├─ Manufacturing Processes Completed                        │
│         ├─ Quality Status = ACCEPTED                                │
│         ├─ All Inspection Reports Linked                            │
│         └─ Final Inspection Released                                │
└─────────────────────────────────────────────────────────────────────┘
                              │
                              ▼
┌─────────────────────────────────────────────────────────────────────┐
│              DELIVERY NOTE & DISPATCH                               │
│         Delivery Challan (E8) → Delivery Note Created               │
│         ├─ Packing List                                             │
│         ├─ All Quality Documents Attached                           │
│         ├─ Customer Reference                                       │
│         └─ Shipping Details                                         │
└─────────────────────────────────────────────────────────────────────┘
                              │
                              ▼
┌─────────────────────────────────────────────────────────────────────┐
│              CUSTOMER SATISFACTION                                  │
│         (B5-B8) Post-Delivery Follow-up                             │
│         ├─ Satisfaction Survey (B6)                                 │
│         ├─ Complaint Register (B8)                                  │
│         └─ Analysis Report (B7)                                     │
└─────────────────────────────────────────────────────────────────────┘

Department Integration Points

1. MARKETING ↔ SALES ↔ DESIGN

┌──────────────┐
│  MARKETING   │
│ Lead, Opp    │
└──────────────┘
     │ (A2, A3, A4)
     │ Tender Submission
     │
     ▼
┌──────────────┐
│   SALES      │
│ Quotation,   │
│ Sales Order  │
└──────────────┘
     │ (B1, B2)
     │ Order Acceptance
     │
     ▼
┌──────────────┐
│   DESIGN     │
│ Design Input,│
│ Drawing, BOM │
└──────────────┘
     │ (C1, C2, C3)
     │ Auto-transmit to PUR, PRD, QC
     │
     ├─────────────────┬──────────────────┐
     ▼                 ▼                  ▼
┌──────────┐    ┌──────────┐      ┌──────────┐
│ PURCHASE │    │ PRODUCTION│      │ QUALITY  │
│          │    │           │      │ CONTROL  │
└──────────┘    └──────────┘      └──────────┘

Data Flow:

  • Lead → Opportunity (when tender identified)
  • Opportunity → Quotation (when interested)
  • Quotation → Sales Order (when accepted)
  • Sales Order → Design Input (automatic creation)
  • Design Input → Item + BOM (when design finalized)
  • BOM → Work Order (triggers to PUR, PRD)
  • Work Order → Quality Plan (automatic creation)

2. PURCHASE ↔ STORES ↔ PRODUCTION

┌──────────────────────────────────────┐
│       PURCHASE ORDER (D2)            │
│   Material Stock Verified Check      │
│   Quality Inspection Flag            │
│   Supplier Performance Score Auto-   │
│   fetched from Supplier Master       │
└──────────────────────────────────────┘
           │
           ▼
┌──────────────────────────────────────┐
│   PURCHASE RECEIPT (E1: GRIR)        │
│   ├─ Material Inspection Status      │
│   ├─ Quality Inspector Assignment    │
│   ├─ MTC (Material Test Cert) Link   │
│   ├─ Visual Inspection Details       │
│   └─ Auto-flag if ASME required      │
└──────────────────────────────────────┘
           │
           ▼
┌──────────────────────────────────────┐
│   STOCK ENTRY (E3, E4, E5)           │
│   ├─ Shelf-Life Tracking (E7)        │
│   ├─ Oven Storage Req. (E9 Register) │
│   ├─ Material Requisition (E4)       │
│   ├─ Issue Slip (E5)                 │
│   └─ Stock Summary (E2)              │
└──────────────────────────────────────┘
           │
           ▼
┌──────────────────────────────────────┐
│   PRODUCTION PLANNING (G1)           │
│   ├─ Work Order Creation             │
│   ├─ Manufacturing Processes         │
│   ├─ Gantt Chart Display             │
│   └─ Equipment Assignment            │
└──────────────────────────────────────┘
           │
           ▼
┌──────────────────────────────────────┐
│   DAILY PRODUCTION REPORT (G2)       │
│   ├─ Date-wise Operations            │
│   ├─ Employee & Equipment Tracking   │
│   ├─ Production Qty & Quality Status │
│   └─ Supervisor Approval             │
└──────────────────────────────────────┘

3. QUALITY CONTROL - COMPLETE FLOW

QC FLOW - 8 SECTIONS:
━━━━━━━━━━━━━━━━━━━━━━

SECTION 1: PLANNING ┌─────────────────────────────┐ │ Quality Control Plan (H1) │ ← Based on: Item + Design Input ├─────────────────────────────┤ │ • ASME Standard Reference │ │ • Inspection Activities │ │ • Acceptance Criteria │ │ • WPS/PQR/WPQ Links │ └─────────────────────────────┘ │ ├─→ MDR (H2) - Master Data Reference └─→ Inspection Checklist (H3)

SECTION 2: RAW MATERIAL ┌─────────────────────────────┐ │ Material Identification (H4)│ ← From: Purchase Receipt ├─────────────────────────────┤ │ ├─ Plate Inspection (H4a) │ │ ├─ Pipe Inspection (H4b) │ │ ├─ Flanges Inspection (H4c) │ │ └─ Fitting Inspection (H4d) │ ├─────────────────────────────┤ │ • Attaches MTC Document │ │ • Verifies Chemistry │ │ • Verifies Mechanical Props │ │ • Links to Material Spec │ └─────────────────────────────┘

SECTION 3: IN-PROCESS INSPECTION ┌─────────────────────────────┐ │ Dish End Forming (H5) │ │ Heat Treatment (H6-H7) │ ← From: Production WO ├─────────────────────────────┤ │ • Heat Cycle & Sketch │ │ • Heat Treatment Report │ │ • Temperature Monitoring │ │ • Soaking Time Verification │ ├─────────────────────────────┤ │ Stage Inspections (H9-H12) │ ← During: Manufacturing ├─────────────────────────────┤ │ • Long Seam Setup │ │ • Dish End Inspection │ │ • Back Chip & PT │ │ • Circular Seam Fit-up │ │ • Nozzle Inspections │ │ • Internal Weld Visual │ │ • Measuring Instruments │ └─────────────────────────────┘ │ ├─→ Liquid Penetrant Test (H10) [LPT] ├─→ Radiography Report (H13-H15) [RT] └─→ Visual Inspection Report (H17)

SECTION 6: TESTING & CODE STAMPING ┌─────────────────────────────┐ │ Pressure/Hydro Test (H16) │ ← After: All fabrication ├─────────────────────────────┤ │ • Test Medium (Water/Air) │ │ • Design Pressure Calc │ │ • Gauge Calibration Links │ │ • Holding Time │ │ • Result: Pass/Fail │ ├─────────────────────────────┤ │ Painting Inspection (H18) │ ← Surface Prep & Paint ├─────────────────────────────┤ │ • Surface Preparation Grade │ │ • DFT (Dry Film Thickness) │ │ • Paint Batch Details │ │ • Humidity/Temp Recording │ └─────────────────────────────┘

SECTION 7-8: DOCUMENTATION & FINAL RELEASE ┌─────────────────────────────┐ │ Weld Summary (H11-H12) │ │ • Weld Details by Joint │ │ • All NDE Reports Linked │ │ • Final Acceptance Status │ ├─────────────────────────────┤ │ Name-plate Details (H19-H20)│ ├─────────────────────────────┤ │ Welder Qualification │ │ • Continuity Record (H21) │ │ • Qualified Welder List (H22) │ • WPS/PQR/WPQ Links │ ├─────────────────────────────┤ │ Instrument Calibration │ │ • Calibration List (H23) │ │ • Out of Cal Form (H24) │ ├─────────────────────────────┤ │ Deviation/Non-Conformity │ │ • Deviation Change Note (H25) │ • NCR Record (if any) │ ├─────────────────────────────┤ │ FINAL INSPECTION RELEASE │ │ ✓ All documents linked │ │ ✓ All tests passed │ │ ✓ Ready for delivery │ └─────────────────────────────┘ │ ▼ DISPATCH


Data Linking Architecture

Sales Order (SO)
├─ Links to: Quotation
├─ Links to: Customer/Opportunity
├─ Creates: Design Input (auto)
├─ Creates: Item (via Design)
├─ Creates: BOM (via Design)
├─ Creates: Work Order
├─ Creates: Quality Control Plan (auto)
├─ Creates: Material Requisitions (via BOM)
├─ Generates: Document Transmittals (auto)
└─ References in: Purchase Orders

Item (Product) ├─ ASME Compliance flag ├─ Material Specification ├─ Pressure/Temperature Ratings ├─ Links to: Multiple Sales Orders ├─ Links to: BOMs ├─ Links to: Quality Control Plans └─ References in: Purchase Orders

BOM ├─ Links to: Sales Order ├─ Links to: Design Input ├─ Links to: Item(s) ├─ Design Approval Workflow ├─ Revision Tracking (Rev.00 → Rev.01) └─ Generates: Work Orders

Work Order ├─ Links to: Sales Order ├─ Links to: BOM ├─ Links to: Quality Control Plan ├─ Manufacturing Processes (Table) │ └─ Equipment, Timeline, Employee ├─ Generates: Production Reports ├─ Triggers: Inspection Checkpoints └─ References: All Quality Documents

Quality Control Plan ├─ Links to: Sales Order ├─ Links to: Item (ASME reference) ├─ ASME Standard + Edition ├─ Inspection Activities (Table) ├─ WPS/PQR/WPQ Links ├─ NDE Procedure Links └─ Acceptance Criteria

Material Identification Report ├─ Links to: Work Order ├─ Links to: Item ├─ Links to: Purchase Receipt (GRIR) ├─ Attaches: Material Test Certificates (MTC) └─ Quality Inspector Assignment

Liquid Penetrant Test Report ├─ Links to: Work Order ├─ Links to: Weld Specification (WPS) ├─ References: ASME Procedure └─ Result: Accepted/Rejected

Radiography Report ├─ Links to: Work Order ├─ Covers: Multiple Joints ├─ Film Numbers └─ Defects Documentation

Pressure Test Report ├─ Links to: Work Order (final gate) ├─ Links to: Item (pressure rating) ├─ Gauge Calibration Records └─ Test Duration & Results

Weld Summary ├─ Links to: Work Order ├─ References: All Weld Joints ├─ Links to: Visual Inspection Reports ├─ Links to: LPT Reports ├─ Links to: RT Reports └─ Final Acceptance Status

Delivery Note ├─ Links to: Sales Order ├─ References: Work Order ├─ Attaches: All QC Documents ├─ Attaches: Test Reports ├─ Attaches: Certificates └─ Includes: Packing List


Workflow State Transitions

Sales Order → Quality Gate → Delivery

Sales Order Created
│
▼
Design Input Created (auto)
│
▼
BOM Approved (Design Approval)
│
├─→ Material Requisition Created
│
▼
Work Order Created (auto)
│
├─→ Purchase Orders Created
├─→ Quality Control Plan Created (auto)
│
▼
Raw Materials Received & Inspected
│
├─→ If PASS: Proceed
└─→ If FAIL: Deviation/NCR → Supplier Action
│
▼
Production Started
│
├─→ Daily Production Reports
├─→ Stage Inspections (multiple gates)
│
├─→ Gate 1: Material ID Report ✓
├─→ Gate 2: Heat Treatment Report ✓
├─→ Gate 3: Stage Inspection ✓
├─→ Gate 4: Weld Visual ✓
├─→ Gate 5: LPT Report ✓
├─→ Gate 6: RT Report ✓
│
├─→ If ANY GATE FAILS: Rejection → Rework or Deviation
│
▼
Pre-Pressure Test Internal Inspection
│
▼
Pressure Test (Hydrostatic/Pneumatic)
│
├─→ If PASS: Proceed
└─→ If FAIL: Rejection
│
▼
Surface Preparation & Painting
│
├─→ Painting Inspection ✓
│
▼
Final Inspection Release
│
├─ Verify all documents linked
├─ Verify all tests passed
├─ Verify welder qualifications
├─ Verify instrument calibration
└─ Verify name-plate details
│
▼
Delivery Note Created
│
├─→ Attach all QC documents
├─→ Attach test certificates
├─→ Attach AS-BUILT drawings
│
▼
Goods Dispatched
│
▼
Customer Satisfaction Survey (post-delivery)

Database Relationship Diagram

Key Master Data:

MASTER DATA
├── Supplier
│   ├─ Category (Mfg/Trader/Service)
│   ├─ Quality Rating (1-5)
│   ├─ Performance Score (calculated)
│   ├─ Approvals & Certifications
│   ├─ Audit History
│   └─ Corrective Actions
│
├── Employee
│   ├─ Skill Matrix
│   ├─ Training Records
│   ├─ Welder Qualifications
│   ├─ Quality Inspector Status
│   ├─ Incident History
│   └─ Certifications
│
├── Item
│   ├─ ASME Compliance Flag
│   ├─ Material Specification
│   ├─ Pressure/Temperature Ratings
│   ├─ Revision History
│   └─ Standard Inspection Plan
│
├── Asset
│   ├─ Machine Identification
│   ├─ Capacity/Specifications
│   ├─ Maintenance Schedule
│   ├─ Calibration History
│   └─ Last Service Date
│
└── Document Template
├─ Quality Control Plan
├─ Inspection Checklist
├─ Acceptance Criteria
└─ Standard Procedures

OPERATIONAL DATA (per Sales Order) ├── Sales Order │ ├─ Order Acceptance # (unique) │ ├─ Design Input (1:1) │ ├─ Work Order (1:1) │ └─ Quality Control Plan (1:1) │ ├── Design Input │ ├─ Sales Order Link (1:1) │ ├─ Items Created (1:M) │ ├─ BOM Created (1:M) │ └─ Revisions Tracked │ ├── Work Order │ ├─ BOM Link (1:1) │ ├─ Manufacturing Processes (1:M) │ ├─ Quality Inspections (1:M) │ ├─ Purchase Requisitions (1:M) │ └─ Production Reports (1:M) │ ├── Quality Control Plan │ ├─ Inspection Activities (1:M) │ ├─ Material ID Report (1:1) │ ├─ Heat Treatment Report (1:1) │ ├─ Stage Inspections (1:M) │ ├─ LPT Reports (1:M) │ ├─ RT Reports (1:M) │ ├─ Pressure Test Report (1:1) │ ├─ Weld Summary (1:1) │ └─ Final Inspection Report (1:1) │ └── Delivery Note ├─ Sales Order Link (1:1) ├─ Work Order Reference ├─ QC Documents (1:M attachments) ├─ Test Certificates (1:M attachments) └─ Packing List Items (1:M)


Approval Workflow Levels

Design Approval Workflow:

Sales Order Submitted
│
▼
Design Input Created & Assigned to Design Engineer
│
▼
Design Engineer Completes Design
├─→ Uploads Drawing (Attachment)
├─→ Sets Design Parameters
└─→ Marks "Ready for Approval"
│
▼
Design Manager Review
├─→ Reviews Drawings
├─→ Verifies ASME Compliance
├─→ Checks WPS/PQR/WPQ References
└─→ Approval/Rejection with Comments
│
├─→ If APPROVED (Design Manager):
│       └─→ Proceed to BOM
│
└─→ If REJECTED:
└─→ Send back to Design Engineer
(revision cycle)

BOM Approval Workflow:

BOM Created from Design Input │ ▼ Design Manager Approval └─→ Verify Component Selection └─→ Verify Against Drawing └─→ Approve or Reject │ ├─→ If APPROVED: │ ▼ │ Work Order Creation (auto) │ ▼ │ Transmittal Generated to: │ ├─ Purchase Department │ ├─ Production Department │ └─ Quality Control Department │ └─→ If REJECTED: └─→ Return to Design Input

Quality Inspection Approval Workflow:

Inspection Report Submitted (LPT/RT/Pressure Test)
│
▼
Quality Inspector Review
├─→ Verify Test Parameters
├─→ Compare to Acceptance Criteria
├─→ Check Attachments/Photos
└─→ Inspection Complete
│
├─→ If PASS:
│       ▼
│   Mark as "Accepted"
│   └─→ Update Quality Status
│
└─→ If FAIL:
├─→ Create NCR/Deviation
├─→ Assign Rework/Repair
└─→ Update Quality Status

Final Inspection Release:

All QC Gates Passed │ ├─ Material ID Report ✓ ├─ Heat Treatment ✓ ├─ All Stage Inspections ✓ ├─ LPT/RT/Pressure Tests ✓ ├─ Painting Inspection ✓ └─ Welder Qualifications Verified ✓ │ ▼ Quality Manager Final Review │ ├─→ Verify All Documents Linked ├─→ Check for Any Outstanding NCRs ├─→ Review Welder Continuity ├─→ Verify Instrument Calibration └─→ Approve Final Release │ ├─→ If APPROVED: │ ▼ │ Release for Delivery (auto) │ └─→ Update Work Order Status │ └─→ If REJECTED: └─→ Identify Issues └─→ Corrective Action Required


Auto-Generated Documents

Automatic Document Creation Triggers:

Trigger Auto-Generated Document Condition
Sales Order Submitted Design Input Always
Design Input Approved Item + BOM When design finalized
BOM Approved Work Order When design approved
BOM Approved Document Transmittal (to PUR, PRD, QC) Always
Work Order Created Quality Control Plan When Item has ASME flag
Work Order Created Material Requisition (from BOM) Always
Purchase Receipt Submitted Material ID Report (pending) When QC flag set
Work Order Started Daily Production Report (template) On demand
Daily Production Report Submitted Stage Inspection Report (pending) When inspection needed
Stage Inspection Complete Transmittal (to QC) If issues found
Pressure Test Passed Final Inspection Report (template) Automatically created
Final Inspection Approved Delivery Note (draft) When all gates passed

Next Implementation Steps

  1. Setup Custom Doctypes: Create the 24+ custom doctypes first
  2. Add Custom Fields: Use the provided JSON specifications
  3. Configure Workflows: Set up approval state machines
  4. Build Automations: Create server-side events for auto-generation
  5. Setup Notifications: Email alerts for approvals, failures, due dates
  6. Create Reports: Dashboard for quality metrics, production status
  7. Integrate Documents: Setup file attachments and links
  8. Test Data Flow: End-to-end testing with sample SO
  9. Train Users: Department-wise training sessions
  10. Go-Live: Phased rollout starting with most critical departments

Document Version: 1.0
Last Updated: December 12, 2025
Status: Ready for Development Phase