workPro Documentation
┌─────────────────────────────────────────────────────────────────┐
│ All Work Management System │
├─────────────────────────────────────────────────────────────────┤
│ │
│ Work Table showing: │
│ ┌─────┬──────────┬──────────┬─────────┬────────────────┐ │
│ │Item │BOQ ID │Done By │Status │Remarks │ │
│ ├─────┼──────────┼──────────┼─────────┼────────────────┤ │
│ │IGL │BOQ-001 │John D. │Pending │Awaiting parts │ │
│ │SIPL │BOQ-002 │Jane S. │In Prog │50% complete │ │
│ └─────┴──────────┴──────────┴─────────┴────────────────┘ │
│ │
│ User sees "IGL" (Item Code) in CYAN - it's clickable! │
│
└─────────────────────────────────────────────────────────────────┘
User Action: CLICK on "IGL" (cyan link)
↓
Event Handler Fires:
- Extract itemId = 5 from data-item-id
- Extract dcId = 1 from data-dc-id
- Call showItemInfo(5, 1)
↓
Modal Opens with Loading Spinner
┌──────────────────────────────────────────────────┐
│ Item Information Modal │
├──────────────────────────────────────────────────┤
│ │
│ ⟳ Loading... │
│ │
│ (Fetching DC-wise quantities) │
│ │
└──────────────────────────────────────────────────┘
┌──────────────────────────────────────────────────────────────┐
│ Item Information Modal │
├──────────────────────────────────────────────────────────────┤
│ │
│ Item Code: IGL-001 Item ID: 5 UOM: Meter │
│ │
│ Item Name: IGL Gas Distribution Pipe 2mm Copper Wire │
│ │
│ ┌──────────────────────────────────────────────────────┐ │
│ │ DC-wise Quantities │ │
│ ├──────────────────┬──────────┬──────────┬───────────┤ │
│ │ DC Name │BOQ Qty │Done Qty │ % │ │
│ ├──────────────────┼──────────┼──────────┼───────────┤ │
│ │ IGL New Delhi │ 1,000 │ 800 │ 80.0% │ │
│ │ IGL Mumbai │ 800 │ 500 │ 62.5% │ │
│ │ IGL Bangalore │ 1,200 │ 0 │ 0% │ │
│ │ IGL Chennai │ 600 │ 60 │ 10.0% │ │
│ └──────────────────┴──────────┴──────────┴───────────┘ │
│ │
│ Total BOQ Qty: 3,600 │ Total Done: 1,360 │ Overall: 37.8% │
│ │
│ [X] Close │
└──────────────────────────────────────────────────────────────┘
Item Code: IGL-001
Item ID: 5
UOM: Meter
Purpose: Quick identification of the item
Item Name: IGL Gas Distribution Pipe 2mm Copper Wire
Purpose: Full descriptive name for context
Shows 4 DCs with:
DC Name BOQ Qty Done Qty %
─────────────────────────────────────────
New Delhi 1,000 800 80.0%
Mumbai 800 500 62.5%
Bangalore 1,200 0 0%
Chennai 600 60 10.0%
What each column means:
Total BOQ Qty: 3,600 (sum of all DC BOQ Qty)
Total Done Qty: 1,360 (sum of all DC Done Qty)
Overall Completion: 37.8% (1,360 / 3,600 × 100)
Purpose: Quick view of overall project status
🔵 CYAN (#0dcaf0)
Used for: Item Code, DC headers, Percentage column
Meaning: Primary information, clickable elements
🟡 GOLD (#ffc107)
Used for: BOQ Qty column
Meaning: Planned/ordered quantities, target amounts
🟢 GREEN (#28a745)
Used for: Done Qty column
Meaning: Completed/done work, progress indicator
🔷 BLUE (#17a2b8)
Used for: Percentage column
Meaning: Completion status, metric tracking
Manager's Workflow:
Manager's Insights:
Action Taken:
For New Delhi DC (dcId = 1):
Step 1: Query BOQ quantities
SELECT SUM(totalQty)
FROM workpro.boq
WHERE itemId = 5 AND dcId = 1
Result: 1,000 units
Step 2: Query work (completed) quantities
SELECT SUM(doneQty)
FROM workpro.work
WHERE boqId IN (SELECT boqId FROM workpro.boq
WHERE itemId = 5 AND dcId = 1)
Result: 800 units
Step 3: Calculate percentage
Percentage = (800 / 1,000) × 100 = 80.0%
Display Result:
New Delhi │ 1,000 │ 800 │ 80.0%
When user hovers over a DC row:
┌──────────────────────────────────────────────┐
│ Normal State │
└──────────────────────────────────────────────┘
↓
[User Hovers]
↓
┌──────────────────────────────────────────────┐
│ Highlighted State (darker background) │
└──────────────────────────────────────────────┘
Visual Feedback: Row background slightly darkens,
indicating it's interactive
Manager views modal to see:
"How much work did each DC complete today?"
→ Table shows completion % per DC
→ Can compare DC performance
Manager checks which DC needs help:
"Which DC is most behind?"
→ Table sorted by DC name
→ Identifies lagging DCs by % column
→ Allocates extra resources
Director prepares report:
"What's the status of IGL items?"
→ Modal shows DC-wise breakdown
→ Can report: "37.8% complete overall"
→ DC-wise status: Delhi 80%, Mumbai 62.5%, etc.
QA team verifies completions:
"Which DCs have completed their IGL work?"
→ Table shows completion % per DC
→ Can identify DCs ready for quality check
CLICK Item Code (IGL)
↓
JavaScript Event Handler
↓
Extract: itemId=5, dcId=1
↓
Call showItemInfo(5, 1)
↓
Display Loading Spinner
↓
AJAX POST → item-info-drilldown.php
↓
PHP API:
├─ Check authentication ✓
├─ Validate itemId ✓
├─ Query item from workpro.item
├─ Query DCs: GROUP BY dcId
│ ├─ SUM(boq.totalQty) = BOQ Qty
│ ├─ SUM(work.doneQty) = Done Qty
│ └─ Calculate %
├─ Calculate totals
└─ Return JSON
↓
JSON Response:
{
"item": { itemCode, itemName, ... },
"dcWiseQuantities": [
{ dcName, boqQuantity, doneQuantity, % },
{ dcName, boqQuantity, doneQuantity, % },
...
],
"summary": { totalBoq, totalDone, % }
}
↓
JavaScript Success Handler
↓
Build HTML:
├─ Item header (Code, ID, UOM)
├─ Item name
├─ DC-wise table (loop through array)
└─ Summary totals
↓
Display Modal with Table
↓
USER SEES: DC-wise Quantities Breakdown
| Metric | Expected Time |
|---|---|
| Click to modal open | <500ms |
| API call + response | 200-500ms |
| Table render | <100ms |
| Total Time | <1 second |
Users should see the full populated modal within 1 second of clicking an Item Code.