Inventory & Work Order Reference

How inventory flows through AFTEC: tables, work order types, transaction codes, and floor stock classification.


Work Order Numbering & Prefixes

Work orders in AFTEC follow a prefix-based naming convention that determines their type and cost attribution:

PrefixTypeExampleDescriptionJob-Costed?
FFabricationF96145Machine/weld shop WOs for manufactured partsYes — linked to a job via JOB.WO.XREF
GAssemblyG10871Mechanical/electrical assembly WOsYes
EElectricalE99101Electrical panel build WOsYes
DDesign/DraftD96634Design/drafting WOsYes
B?B17491Seen in transaction data, rareUnknown
C?C69144Seen in transaction data, rareUnknown
{job}Base2399The job-level WO itselfYes
{job}MMiscellaneous2399MMisc/floor stock WO for a jobPartially — costs hit the job but may not tie to specific BOM items
{job}CControls2399CControls-related WO for a jobYes
{job}RRework?2399RSeen on some jobsYes
90000+Mixed92950Not necessarily non-job. 76% of 90000-range WOs in WIPLEDGER ARE tied to customer jobs (F-prefix fab WOs like F93760). The remaining 24% are SPEC.WO departmental overhead buckets (see below).Varies — job-linked WOs hit COGS; SPEC.WOs hit departmental overhead
{5-digit}WWarranty1069WWarranty work orders (4-digit job + W suffix). Not floor stock.Yes — tied to original job

Key Insight: Cost Attribution on 90000-Range WOs

Correction (April 2026): The 90000-range WOs were previously documented as “non-job floor stock.” Data analysis of WIPLEDGER (9,935 WOs in this range) shows 76% are tied to customer jobs via F-prefix fabrication WOs. Only 24% are jobless SPEC.WO departmental overhead buckets.

From the Feb 2026 inventory meeting (Tyler DeWitt, John Tymes, Adam Devereaux, Colin Orlando):

John Tymes: “If it’s a job work order, then that’s cost of goods attributed to a specific job. If there are these floor stock work orders… those are not job-work related. We could tally a cost for over any period of time automatically.”

Colin Orlando: “If our COGS are wrong, our profitability is also wrong. So gotta figure that one out.”

Three cost leakage paths identified:

  1. M work orders (e.g., 2399M) — costs partially attributed to jobs
  2. SPEC.WO departmental overhead WOs (e.g., 91995, 91996, 92000, 92001, 92950) — costs go to departmental overhead, not customer job COGS. These carry material ($2.0M), labor ($1.6M), and sub-assembly ($749K) costs — they are departmental overhead buckets, not traditional floor stock.
  3. GL account direct issues — parts issued to a GL account without any WO at all

SPEC.WO Departmental Overhead Buckets

The SPEC.WO entries in the 90000-range are long-lived departmental work orders that absorb both material and labor. They are NOT floor stock in the MRP sense (MRP type “F” is floor stock — see below).

WOMaterial $Labor $SubAssy $Labor HrsActive Since
91996$1,430K$323K$359K10,165FY2019+
92001$261K$122K$226K4,093FY2019+
92802$56K$82K$3K2,016FY2023
92851$20K$11K$39K501FY2023

339 total SPEC.WO entries, $4.4M grand total (45% material, 38% labor, 17% sub-assembly). Top consumed parts are wear parts, blast media, filters, and fixtures — process services and maintenance for blast/spray operations. Annual spend growing: $135K (2016) to $581K (2024).

Actual Floor Stock (MRP Type “F”)

AFTEC classifies floor stock parts using MRP type “F” — 884 parts, $331K on-hand inventory. These are low-cost shop consumables (wire, cable, conduit, drill bits, cable ties, cord grips) that are grabbed off the shelf without WO issue transactions. Almost zero overlap with SPEC.WO consumption.


AFTEC Inventory Tables

Core Tables

TableKey FormatPurpose
PRODUCT1!{partNumber}Part master — description (F1), UM (F3), MRP type (F10: P=purchased, M=manufactured), INC/OBS flag (F8)
ITEMQTY1!{partNumber}Current inventory quantities — all qty fields are MD3 (÷1000)
INVHIST1!{key}Transaction history — linked list via FPTRP (F18) pointer
INVXREF1!{partNumber}Index into INVHIST — F1 = head of linked list for a part
OPENWO1!{woNumber}Open (active) work orders — F1=Job, F2=Part, F12=Type (P/N)
OPENWO.12871!{woNumber}PSI extension fields for open WOs
JOB.WO.XREF1!{job}All WOs for a job — F1 contains VM-delimited WO list

ITEMQTY Field Positions (Dictionary: all MD3)

PositionNameDescription
F1ONHANDQuantity on hand
F2ALLOC.SALESAllocated to sales orders (shipped)
F3ALLOC.BACKORDAllocated to sales back orders (open)
F4OPEN.POOpen purchase order quantity
F5PO.INTRANSPO quantity in transit
F6JOBPOPO on order with job number
F7OPEN.WOOpen work order quantity
F9ALLOC.WIPAllocated to work-in-process
F10IN.PO.RECQuantity in PO receiving
F12BULK.LOCBulk storage bin location
F13PICK.LOCPick location
F15OUTSIDEQuantity in outside operations
F17LAST.COUNTLast cycle count quantity
F18LAST.DATELast date (D2/ format)
F21CCDATELast cycle count date (D2/)
F25GROSSQTYGross quantity

INVHIST Field Positions

PositionNameConversionDescription
F3PGM.NAMEProgram that created the transaction
F7TRANS.DATED2/Transaction date (days since 12/31/1967)
F9QUANTITYMD3Quantity (÷1000)
F10REFReference — WO number, PO number
F11TYPETransaction type code (see below)
F12AVG.COSTMD4Average cost (÷10000)
F13LOCLocation (e.g., “STOCK”)
F14LOT.NOLot number
F18FPTRPForward pointer — next transaction key in linked list
F22BINSBin location
F42GL.DOCNOGeneral ledger document number
F51USERNAMEUser who performed the transaction

AFTEC Numeric Conversions

CodeMeaningExample
MD33 implied decimalsRaw 3388000 → 3388.000 (÷1000)
MD44 implied decimalsRaw 12701 → 1.2701 (÷10000)
MD22 implied decimalsRaw 350 → 3.50 (÷100)
D2/DateDays since 12/31/1967 → MM/DD/YYYY

Inventory Transaction Type Codes

From INVHIST F11 (TYPE field). Codes may be stored with or without leading zeros.

CodeNameDirectionDescription
01PO Receipt+Purchase order received into stock
02PO Return-Returned to vendor
03PO Receipt (WO)+PO receipt against a work order
04WO Issue-Generic work order issue
05Transfer±Inventory transfer
06Adjustment±Manual adjustment
07Sales Order-Issued to sales order
08Sales Return+Customer return
09Scrap-Scrapped
10PO Issue-PO issued
11WO Material Issue-Material issued to a work order (most common)
12WO Mat Return+Material returned from a work order
13Transfer Out-Transfer out of location
14Transfer In+Transfer into location
15Physical Count±Physical count adjustment
20Cycle Count Adj±Cycle count adjustment — key for inventory accuracy
21FS Issue-Field service issue
22FS Return+Field service return
29Inventory Transfer±Inter-location transfer
31WO Issue (Fabrication)-Material issued to fabrication WO
32WO Return (Fabrication)+Material returned from fabrication WO
41Scrap (WO)-Scrapped against a work order

VB_GET.ITEMHIST Subroutine

Returns 24-month inventory history. All data is in arg 1, not split between args.

Call: VB_GET.ITEMHIST(partNumber, allData_OUT, unused)

Output format: arg 1 contains 10 field-mark (char 254) delimited sections, each value-mark (char 253) delimited by period:

SectionContent
FM[0]Headers — period labels (“24 Month Totals”, “Month 1 02/26”, etc.)
FM[1]Balance — end-of-month balance
FM[2]Beginning Balance
FM[3]Receipts
FM[4]Issues
FM[5]FS Issues (Field Service)
FM[6]Sales
FM[7]Scrap
FM[8](reserved)
FM[9]Adjustments

Monthly values are pre-formatted decimals (e.g., “4005.000”). The totals row (index 0) uses raw integers.


Inventory Investigation Findings (Feb 2026)

WO Reference Analysis

Across A-class parts (069995, 048754, 039496, 065133, 065134), inventory transactions reference:

CategoryCountDescription
F-prefix (Fabrication)771 txns / 525 WOsJob-costed — tied to specific machines
E-prefix (Electrical)218 txns / 198 WOsJob-costed — panel builds for specific machines
4-digit (Direct Job)19 txns / 17 WOsDirect issues to job numbers (2299, 2331, 2338, etc.)
90000+ (SPEC.WO)6 txns / 4 WOsDepartmental overhead — process services/maintenance (not job-costed)
Other (D, B, C prefix)5 txnsRare, likely overhead

Cycle Count Accuracy (Tyler DeWitt)

PeriodA-Class Accuracy
Start of 2025~73%
End of 2025~mid 80%
Counting cadenceA=quarterly, B=semi-annual, C=annual

Chronic Problem Parts

See C:\git\Inventory\A-Class Inventory Analysis Report.md for the full 34-part repeat offender analysis.

Key patterns:

  • Phoenix Contact terminals (069995, 072212-072214): CHRONIC_SHRINKAGE + WO_OVERPICK_LIKELY — workers take more than BOM quantity
  • Allen-Bradley I/O modules (048754, 039496): FLIP_FLOP — adjustments swing positive and negative

WIPLEDGER — WO Cost Ledger

The WIPLEDGER table (and CSV export wipledger.csv) contains per-WO cost breakdowns by fiscal period.

CSV location: \\ad.ptihome.com\DFS\DATA\unixshare\dgwreportfiles\wipledger.csv (99,461 rows)

Key format: {WO}-{FiscalPeriod} (e.g., F54424-2307, 92950-2509)

ColumnDescription
Work OrderWO number (F54424, 92950, etc.)
Fiscal PeriodYYMM format (2509 = Sept 2025)
Job NoJob number (blank for floor stock)
Part NoPart number or SPEC.WO
TypeP=Production, N=Non-assembly
Material $Material cost
MaterialOH $Material overhead
Labor $Labor cost
LaborOH $Labor overhead
Outside $Outside services cost
OutsideOH $Outside overhead
SubAssy $Sub-assembly cost
Labor HrsLabor hours

SPEC.WO Cost Example (92950)

PeriodMaterial $Labor $Outside $Direct $
2509$199.98$0$0$0
2510$1,824.43$0$0$50.90
2511$983.80$28.83$0$31.05
2512$1,135.51
2601$887.15
2602$686.51$0$0$13.33

Key finding: WO numbers in the 90000-99999 range overlap with F-prefix fabrication WOs. F92945 is a Fabrication WO tied to job 2395, while 92945 without prefix is a SPEC.WO departmental overhead WO. The prefix matters — most 90000-range WOs with an F-prefix are job-costed manufacturing WOs, not departmental overhead.


OPENWO Table — Contains ALL Work Orders (Not Just Open)

Despite its name, the AFTEC OPENWO table contains both open and closed/historical work orders. The nightly CSV export (openwo.csv) has 519K rows, of which 514K are Complete and only ~1,178 are Released/Open.

WO StatusCount
Complete514,011
Released1,178
Other~4,096

The 90000-99999 range includes two distinct populations: (1) F-prefix fabrication WOs tied to customer jobs (76% of WOs in this range), and (2) SPEC.WO departmental overhead WOs with no job number (24%), used for process services and maintenance. The OPENWO CSV export contains very few 90000-range records; WIPLEDGER is the authoritative source with 9,935 WOs in this range.


IBM (Issued But Missing) — Material Tracking

Last Verified: 2026-03-12 — 112 IBM records found across all WOs, 10 on active (Released) WOs.

IBM = a component part that was issued to a work order (pulled from inventory) but is physically unaccounted for on the shop floor. This is tracked at the WIPBMF component level, not at the WO header level.

WIPBMF Fields (WIP Bill of Materials)

FieldPositionDescription
IBM.QTYF31Issued But Missing quantity (MD3 = ÷1000)
(line note)F27Single-line BOM component note
RTSF29Return to Stock flag (1 char)
RTS.QTYF30Return to Stock quantity (MD3)
QTY.ALLOCF15Quantity allocated to WO
QTY.PERF7Quantity per assembly (BOM qty)

WIPBMF key format: 1!{WO_NUMBER}!{PART_NUMBER}

WIPBMF.NOTES Table (BOM Line Notes)

A separate table (not a field within WIPBMF) that stores multi-value notes per BOM line. Same key format as WIPBMF: 1!{WO_NUMBER}!{PART_NUMBER}.

  • Field 1 contains value-mark-separated (char 253) notes
  • Created and consumed by the WIPBOM desktop app (PSI.All → PSI.WorkInProcessBOM.View)
  • Notes are generic BOM line notes — not IBM-specific, but often contain context about IBM issues
  • The API returns both lineNote (F27) and notes (WIPBMF.NOTES) on IBM endpoint responses
FieldPositionDescriptionValues
ISSUE.STATF11Pick/Issue Status1=Partial, 2=Fully Issued, 3=Complete
WO.NOTESF13Work Order NotesFree text (often empty)
SHORT.MTLF18Short Material FlagY/blank
WIP.ISS.LOCF14WIP Issue Locatione.g. “2386 SKID A”, “E CART 5”
WIP.MTLF16Component summarye.g. “COMP:52” (52 components)

How to Query IBM Data

Via API (preferred):

EndpointDescription
GET /api/ibm/dev/activeAll IBM items on active (Released) work orders
GET /api/ibm/dev/allAll IBM items across all WOs (active + completed)
GET /api/ibm/dev/job/{jobNumber}IBM items for a specific job
GET /api/ibm/dev/summaryCounts by WO status, grouped by job

Via raw UniData command (VB_SYSTEMSTAT.REV1):

LIST WIPBMF WITH IBM.QTY # "" AND WITH WOSTAT = "R" WONO PRODNO PDESC JOBNO IBM.QTY TOXML

Key Subroutines

SubroutineDescription
VB_WIPBMFWIP BOM for single WO — returns header + component lines with qty/alloc/issued
VB_WIPBMF.REV5Enhanced version with WO/WOLIST/JOB/JOBWRITE modes, bin/picking info, hold status

Data Availability

  • Not in any CSV export — IBM.QTY exists only in the live UniData WIPBMF table
  • Not in Fabric/Power BI — no WIPBMF table in the ProgressiveDataSet
  • No MCP tool — not yet surfaced in the PSI Machine Intelligence MCP server

API Endpoints

Inventory Endpoints

EndpointDescription
GET /api/inventory/dev/{pn}/statusCurrent on-hand, allocated, available, cost, bins
GET /api/inventory/dev/{pn}/transactions?max=NINVHIST linked list traversal with decoded types
GET /api/inventory/dev/{pn}/monthly24-month history from VB_GET.ITEMHIST

Cost Attribution & Classification Endpoints

Note: These endpoints were originally built around the assumption that 90000-range WOs were “floor stock.” The naming is legacy — the data shows most 90000-range WOs are job-linked fabrication WOs. The SPEC.WO entries (no job) are departmental overhead for process services/maintenance.

EndpointDescription
GET /api/floorstock/dev/{pn}/cost-breakdown?max=NClassify transactions by WO type, compute cost per category + leakage %
GET /api/floorstock/dev/{pn}/classified-transactions?max=NSame as above + full classified transaction list
GET /api/floorstock/dev/floor-stock-wosList SPEC.WO departmental overhead WOs (90000-99999 range, no job)
GET /api/floorstock/dev/{job}/cost-attributionJob-level WO classification and cost attribution

IBM (Issued But Missing) Endpoints

EndpointDescription
GET /api/ibm/dev/activeAll IBM items on active (Released) work orders
GET /api/ibm/dev/allAll IBM items across all WOs (active + completed)
GET /api/ibm/dev/job/{jobNumber}IBM items for a specific job
GET /api/ibm/dev/summaryCounts by WO status, grouped by job

Useful Subroutines

SubroutinePurpose
VB_PARTINFO.REV2Part info + standard cost (field 5 of output)
VB_GET.ITEMHIST24-month history (all data in arg 1)
VB_ITEMQTY_DETAIL.REV2Job-level on-hand/on-order breakdown
VB_INVINQ.2Bin/lot detail (3 args, returns empty for some parts)

Data Sources

All ERP data is exported nightly to \\ad.ptihome.com\DFS\DATA\unixshare\dgwreportfiles\. Key files for inventory/WO analysis:

FileRowsDescription
inventoryhistory.csv4.1MFull INVHIST transaction history
openwo.csv519KAll work orders (open + closed)
wipledger.csv99KWIP ledger — per-WO cost by fiscal period
wiplabor.csv253KWIP labor detail
wiprouteline.csv927KWIP routing operations
inventory.csv17KCurrent inventory with bin/lot detail
partmaster.csv421KPart master with cost, lead time, ABC class
jobparts.csv203KJob-to-parts mapping

These same files are imported into Microsoft Fabric’s ProgressiveDataSet via the on-premises data gateway, refreshed daily at 5:00 AM ET.


Last updated: April 2026 — Corrected 90000-range WO classification (76% are job-linked, not floor stock). Added SPEC.WO departmental overhead documentation. Added MRP type “F” floor stock reference.