Quality Control Reports

Quality Control Reports

1. Current State of the QC Module

A. Architecture & Data Flow

  1. Parameter Master (QualityParameter):
    • Defines inspection parameters with type:
      • S (System): Numeric with MinValue and MaxValue.
      • U (User): Qualitative evaluation (P - Pass / F - Fail).
  2. Test Plan Master (TestPlanMst & TestPlanMst1):
    • Links parameters to a specific Item Group (itemgroupid) and QC Stage (IQC - Incoming, PQC - In-process, FQC - Final).
  3. QC Transactions:
    • QualityControl (Header): Stores qcno, qcdate, qcstage, refdoc, refno, refdate, mode (S, M, X), qcstatus (O Open, C Closed, P Partial), checkedby, approvedby.
    • QualityControl1 (Lines): Currently records at the Item Group level (itemgrpid), storing testplancode, reportno, reportdate, itemqcstatus (N Pending, P Pass, F Fail), and remarks.
    • QualityControl2 (Parameter Values): Stores the individual parameter readings (parameterCode, actualValue, result). Supports Excel bulk download/upload with formula validation.
  4. Approval & Certificate:
    • Approval workflow sets approvedby.
    • QuestPDF document QuestPDF_QualityControl.cs generates a single-document Quality Control Certificate.

2. Analysis of the 5 Proposed Reports & Improvisations

# Proposed Report What Is Needed / Current Status Improvisation & Value Add
1 QC Inspection Report
(Single QC transaction details)
Existing base available: QuestPDF_QualityControl.cs already formats a complete certificate.
Needed: A unified report option UI where users can search/filter by QC No, Ref Doc, or Date and either view/preview on screen, print PDF, or export to Excel.
Add Excel export in addition to PDF for vendor/customer compliance documentation. Include tolerance deviations (ActualValue - Target).
2 Item-wise QC Report
(QC performance history per item)
⚠️ Key Schema Insight: In QualityControl1, lines are grouped by itemgrpid (Item Group) rather than individual itemid.
To show individual items, we join through the reference document (e.g. Grn1.itemid).
• Include Vendor Name for Incoming QC (IQC) — answering “Which vendor supplied this item when it failed?”
• Show inspection count, Pass %, Fail %, and common failing parameters per item.
3 Transaction-wise QC
(Linked to GRN, Job Work, MIRS, Sales Return)
⚠️ Current Limitation: Currently, QualityControlCreate and its validation queries only support GRN. Job Work, MIRS, and Sales Return are not yet hooked up into QC creation.
For Reporting: This report can act as a Quality Gate / Pending QC Register.
• List business documents with columns: Doc Type, Doc No, Doc Date, Party/Dept, Item Group, Received Qty, QC Status (Not Started / Pending / Passed / Rejected), QC No, Delay (Days to QC).
• This solves a major operational pain point: identifying un-inspected goods blocking inventory.
4 Pass vs Fail Summary Report
(Quality Health Snapshot)
Aggregate metrics grouped by: Stage (IQC, PQC, FQC), Month/Period, Item Group, or Vendor. • Add KPI Summary cards: Total Inspected, Pass Rate % (First Time Yield), Rejection Rate %, Pending Lots.
• Provide Monthly/Weekly trend comparison.
5 Parameter Fail Report
(Pareto / Frequent failure analysis)
Pulls from QualityControl2 where result = 'F'.
Shows: Parameter Name, Parameter Type, Times Tested, Times Failed, Failure % (Times Failed / Times Tested).
• Pareto 80/20 sorting (highest failing parameters on top).
• Drill-down to see which Item Groups failed on that specific parameter. Critical for Root Cause Analysis (RCA / CAPA).

3. Impact of Removing “Manual” (‘M’) and “Mixed” (‘X’) Modes

You mentioned that Manual and Mixed modes are going to be removed from QualityControlCreate. This is a great simplification:

  1. Strict Test-Plan-Driven QC (System Mode ‘S’ Only):
    • In QualityControlCreate.razor: The QC Mode dropdown can be defaulted/fixed to System ("S"), or hidden and set automatically.
    • In QualityControlValidateCreate:
      • Eliminate the checks for planStatus == "M" and planStatus == "X".
      • Enforce: Every Item Group in the reference document must have an active Test Plan with parameters defined. If any item group lacks a test plan, the system prompts the user to create the test plan first.
  2. Simplified Reporting:
    • No need to handle “Manual” report uploads (QualityControl1Upload.razor) where parameters are bypassed. All inspections will consistently have parameter readings in QualityControl2, making the Parameter Fail Report and Pass vs Fail Summary 100% reliable and complete.

4. Recommended Report Structure (Unified QC Analysis Hub)

Following the proven pattern of existing modules (like GrnAnalysisReportOption and PurchaseAnalysisReportOption):

A. Single Option Page: QualityControlReportOption.razor

  • Report Type Dropdown:
    1. QC Inspection Register / Details
    2. Item / Item-Group QC History
    3. Transaction QC Status (Pending & Completed)
    4. Pass vs Fail Quality Snapshot
    5. Parameter Failure Analysis (Pareto)
  • Filters:
    • Date Range (FromDate to ToDate)
    • Stage (All, IQC - Incoming, PQC - In-process, FQC - Final)
    • Ref Document Type (All, GRN, Job Work, MIRS, Sales Return)
    • Item Group / Item combo
    • Status (All, Pass, Fail, Pending)
  • Output Formats:
    • Screen DataGrid for immediate browsing and drilldown to QC Details.
    • Excel Download via ClosedXML (formatted headers, auto-width, summary rows).
    • PDF Export via QuestPDF (for formal inspection certificates/summaries).

B. Menu Placement

  • Add a new entry “Quality Control Analysis” in:
    • SupplyChainMenu.razor (under Reports column) or
    • A dedicated Quality subsection if you plan to expand QC further.

5. Open Points for Alignment Before Implementation

  1. Granularity for Item-wise QC Report:
    • Since QualityControl1 tracks at the Item Group level, should the report display at the Item Group level, or should it pull the specific Items from the linked GRN lines (Grn1) under that group?
  2. Transaction-wise QC Scope:
    • For Job Work, MIRS, and Sales Return: Since QC creation currently only accepts GRN, should the transaction-wise report initially show GRN QC status (and placeholder joins for the others), or are you planning to enable QC creation for Job Work, MIRS, and Sales Return alongside this?
  3. Execution Order:
    • Would you like to first remove the Manual / Mixed mode from QualityControlCreate and its API validation, and then implement the new QC Report Hub?