Order Parts Form (Order_Parts)
Field-by-field reference for the Order Parts form and its embedded Order Line Items subform — the structure that holds purchase-order line items. Includes a review of legacy/redundant fields (see Field Review).
- Display name: Order Parts
- Success message: "Data Added Successfully!"
- Last documented: 25 July 2026
Background
Historically, purchase orders did not have line items as separate records — part descriptions were maintained as free text in a single Description field. The Order_Line_Items grid on this form introduced line items as proper child records (one record per part, with quantity, part number, supplier, and pricing). The Purchase Order Form's Order_Line_Items grid references these same child records — this subform is where they are defined and populated.
Because the form evolved from the older free-text approach, it carries fields from earlier iterations that may no longer be needed — flagged in the review below.
Order Source — Form Entry Points
The form behaves differently based on how it was opened. The Order_Source field (hidden) determines which fields are visible and how data is populated.
| Order Source | Entry Point | Description |
|---|---|---|
Direct_Order | Manual entry | User creates order from scratch — must select Parts to be Ordered For first |
Claim_Dhtml_Request | Claim DHTML button | Pre-populated from claim record, limited editing |
From_Pending_Request | Parts to Order report | Pre-populated from selected Part_Item_Request records |
Order Source Behavior Matrix
┌─────────────────────────────────────────────────────────────┐
│ ORDER SOURCE LOGIC │
└──────────────────────────┬──────────────────────────────────┘
│
┌─────────────────┼─────────────────┐
│ │ │
▼ ▼ ▼
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ Direct Order │ │ Claim DHTML │ │ From Pending │
│ │ │ Request │ │ Request │
└────────┬────────┘ └────────┬────────┘ └────────┬────────┘
│ │ │
▼ ▼ ▼
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ Show: │ │ Show: │ │ Iterates Parts │
│ Parts_to_be_ │ │ File_Number │ │ to Order recs │
│ ordered_for │ │ (disabled) │ │ │
│ │ │ │ │ Pre-populates │
│ Hide: │ │ Auto-populate │ │ Order_Line_Items│
│ Everything else │ │ from Claim │ │ from selected │
│ initially │ │ │ │ records │
└─────────────────┘ └─────────────────┘ └─────────────────┘
Direct Order — Parts to be Ordered For Selection
When Order_Source == Direct_Order, user must first select Parts to be Ordered For:
| Selection | Fields Shown | Fields Hidden | Behavior |
|---|---|---|---|
| Claim | File_Number, Registration, VIN_No, Make, Model, Date_Ordered, Ordered_By, Purchase_Order_No_I_Body, Order_Line_Items, Upload_Parts_Ordered, Total_Calculation | Fleet_Vehicle_Rego, Supplier, Part_Type, Parts_Status | Registration/Make/Model disabled |
| Fleet Vehicle | Fleet_Vehicle_Rego, VIN_No, Make, Model, Date_Ordered, Ordered_By, Order_Line_Items, Upload_Parts_Ordered, Supplier, Part_Type, Parts_Status, Total_Calculation | Registration, File_Number, Purchase_Order_No_I_Body | Date_Ordered enabled |
| Private Job | Registration, VIN_No, Make, Model, Colour, Date_Ordered, Ordered_By, Order_Line_Items, Upload_Parts_Ordered, Supplier, Part_Type, Parts_Status, Total_Calculation | File_Number, Fleet_Vehicle_Rego, Purchase_Order_No_I_Body | All fields editable, Date_Ordered enabled |
From Pending Request — Auto-Population
When opened from Parts to Order report with selected Part_Item_Request records:
- Clears existing Order_Line_Items
- Iterates through selected
Parts_to_Orderrecords - Creates Order_Line_Items rows with:
- Description, Quantity, Notes, Suppliers, Part_Number, Parts_Type
- Unit_List_Ex_GST, Unit_Net_Ex_GST, Due_In_date, Upload_Evidence
- Status set to
Ordered - Calculates line totals
- Determines Parts_to_be_ordered_for from first record
- Auto-populates header fields from claim/fleet/private job record
- Calculates Total_Amount_Excl_GST, GST_Amount, Total_Amount_Incl_GST
Main Section — Order Details
| Field | Type | Source / Values | Notes |
|---|---|---|---|
Parts_to_be_ordered_for | Picklist | Claim, Fleet Vehicle, Private Job | Determines which vehicle lookup applies. |
File_Rego_Search | Picklist (lookup) | Claim_Form.ID, displays [File_Number] - [Registration] - [Date_Received] | New combined search field — replaces the old File_Number lookup. Shows File Number, Registration, and Date Received for easier claim identification. |
Fleet_Vehicle_Rego | Picklist (lookup) | logistics_app.Add_Car.ID, displays [Registration] | Populated for Fleet Vehicle orders. Cross-app lookup into the logistics app. |
Ordered_By | Picklist (lookup) | User.ID, displays full name | Staff member raising the order. |
Registration | Text | Free text | Mandatory. Denormalised copy of vehicle rego. |
VIN_No | Text | Free text | Denormalised copy of VIN. |
Make | Text | Free text | Denormalised. |
Model | Text | Free text | Denormalised. |
Colour | Text | Free text | Denormalised. Not present on the PO form. |
Date_Ordered | Date | Defaults to ${zoho.currentdate} | Mandatory (must have). |
Purchase_Order_No_I_Body | Text | Free text | iBody purchase number — also exists on the PO form (see review). |
Upload_Parts_Ordered | File upload | Local drive | PDF upload for Claude AI extraction. See Claude AI PDF Extraction. |
Fleet Vehicle / Private Job Fields
These fields appear only when Parts_to_be_ordered_for is Fleet Vehicle or Private Job. They apply values to all line items in the subform.
| Field | Type | Source / Values | Notes |
|---|---|---|---|
Supplier | Picklist (lookup) | Suppliers.ID, displays [Supplier_Name] | When set, applies to all line items and locks the per-line Suppliers field. |
Part_Type | Picklist | OEM, Parallel, Aftermatket, Used | When set, applies to all line items. |
Parts_Status | Picklist | Ordered, Arrived | When set, applies to all line items. Also sets Due_In_date (see below). |
Parts Status — Due In Date Logic
| Parts Status | Due In Date Set To |
|---|---|
Ordered | Next working day (skips weekends) |
Arrived | Current date |
Supplier Lock Behavior
┌─────────────────────────────────────────────────────────────┐
│ Main Form: Supplier = [Australian Automotive...] │
└──────────────────────────┬──────────────────────────────────┘
│
▼ (Auto-apply to all + Lock)
┌─────────────────────────────────────────────────────────────┐
│ Order Line Items Subform │
│ ┌─────────────────────────────────────────────────────┐ │
│ │ Part 1: Supplier = Australian Automotive (LOCKED) │ │
│ │ Part 2: Supplier = Australian Automotive (LOCKED) │ │
│ │ Part 3: Supplier = Australian Automotive (LOCKED) │ │
│ └─────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────┘
Order Line Items (embedded grid / subform)
One row per part. These are the records the invoice extraction module matches invoice lines against.
| Field | Type | Source / Values | Notes |
|---|---|---|---|
Mark_as_Deleted | Checkbox | — | Soft-delete flag for the line item. When checked, the line is excluded from processing. |
Parts_to_Order | Picklist (lookup) | Parts_to_Order.ID, displays [ID] | Back-link to the originating parts request line. |
Description | Text | Free text | Part description — comparison target for the extracted invoice line description. |
Quantity1 | Number (integer) | — | Display name "Quantity" — the authoritative quantity field (review item 1). |
Quantity | Decimal | — | Duplicate, displays as "Quantity" — to be removed from the form (review item 1). |
Part_Number | Text | Free text | Comparison target for the extracted invoice part_number. |
Suppliers | Picklist (lookup) | Suppliers.ID, displays [Supplier_Name] | Not used — supplier is taken from the PO header Supplier_Name (review item 2). |
Parts_Type | Picklist | OEM, Parallel, Aftermatket, Used | Note the typo in the stored value "Aftermatket" — see review. |
Request_Status | Picklist | Part to Order, Part to Repair | Initial value Part to Order. Triage-stage status — see review. |
Unit_List_Ex_GST | Decimal | — | List price ex GST — maps to extracted unit_list. |
Unit_Net_Ex_GST | Decimal | — | Net (agreed) price ex GST — maps to extracted unit_net. This is the price the supplier should invoice. |
Due_In_date | Date | All days allowed | Expected arrival. |
Status | Picklist | Ordered, Arrived, Unavailable | Per-line fulfilment status. |
Notes | Textarea | — | Free notes. |
Upload_Evidence | File upload | Local drive | Supporting attachment per line. |
Invoice_No | Text | Free text | Supplier invoice number. Conditionally visible — only shown when Parts_Status == Arrived. See Field Rule: Show Invoice_No. |
GST | Decimal | Computed | 10% of line Total. Auto-calculated, disabled. |
Total | Decimal | Computed | Quantity1 × Unit_Net_Ex_GST. Auto-calculated, disabled. |
Total_Inc_GST | Decimal | Computed | Total + GST. Auto-calculated, disabled. |
Line Item Deletion Options
There are 3 deletion mechanisms for Order Line Items, controlled by Order Source:
| Order Source | Mark_as_Deleted Checkbox | Subform Delete Button (Row Removal) |
|---|---|---|
Direct_Order | ✅ Available | ✅ Available |
Claim_Dhtml_Request | ❌ Hidden | ✅ Available |
From_Pending_Request | ✅ Available | ❌ Hidden |
Field Rule: Hide Subform Delete Entry
Execute only if:
Order_Source != "Direct Order" && Order_Source != "Claim Dhtml Request"
Action:
Hide subform delete entry [Order_Line_Items]
This means:
- Direct Order / Claim DHTML: Users can physically remove rows using the delete button
- From Pending Request: Users can only soft-delete using
Mark_as_Deletedcheckbox (original Part_Item_Request records need to be tracked)
Field Rule: Show Invoice_No
Execute only if:
Parts_to_be_ordered_for is not null && Parts_Status == "Arrived"
Action:
Show fields [Invoice_No]
This rule makes the Invoice_No field visible only when:
- A job type has been selected (
Parts_to_be_ordered_foris not null) - The parts have already arrived (
Parts_Status == Arrived)
This allows users to record the supplier invoice number once the parts are received.
Mark as Deleted Behavior
When Mark_as_Deleted is checked on a line item:
- Calculation skipped — Total, GST, Total_Inc_GST are set to 0
- Excluded from totals — The line is excluded from main form total calculations
- Row remains visible — The line is not physically deleted, only flagged
┌─────────────────────────────────────────────────────────────┐
│ Mark_as_Deleted = ☑ (checked) │
├─────────────────────────────────────────────────────────────┤
│ │
│ • row.Total = 0 │
│ • row.GST = 0 │
│ • row.Total_Inc_GST = 0 │
│ • Excluded from Total_Amount_Excl_GST calculation │
│ • Row remains visible (soft delete) │
│ │
└─────────────────────────────────────────────────────────────┘
Subform Workflow Events
The Order Line Items subform has 3 workflow triggers:
1. On Add Row — Update Line Item Values
When a new row is added and Parts_to_be_ordered_for is Fleet Vehicle or Private Job:
┌─────────────────────────────────────────────────────────────┐
│ ON ADD ROW (Fleet Vehicle / Private Job only) │
└──────────────────────────┬──────────────────────────────────┘
│
▼
┌────────────────────────┐
│ Copy from Main Form: │
│ │
│ row.Suppliers = │
│ input.Supplier │
│ │
│ row.Parts_Type = │
│ input.Part_Type │
│ │
│ row.Status = │
│ input.Parts_Status │
└────────────┬───────────┘
│
▼
┌────────────────────────┐
│ Parts_Status set? │
└────────────┬───────────┘
│
┌────────────┴────────────┐
│ │
▼ ▼
┌─────────────────┐ ┌─────────────────┐
│ Ordered │ │ Arrived │
└────────┬────────┘ └────────┬────────┘
│ │
▼ ▼
┌─────────────────┐ ┌─────────────────┐
│ Due_In_date = │ │ Due_In_date = │
│ next working │ │ current date │
│ day │ │ │
└─────────────────┘ └─────────────────┘
2. On Add Row — GST Calculation
When a row is added, calculates line totals and updates main form totals:
| Step | Calculation |
|---|---|
| 1 | row.Total = row.Quantity1 × row.Unit_Net_Ex_GST |
| 2 | row.GST = row.Total × 0.10 |
| 3 | row.Total_Inc_GST = row.Total + row.GST |
| 4 | Sum all line item Totals → Total_Amount_Excl_GST |
| 5 | GST_Amount = Total_Amount_Excl_GST × 0.10 |
| 6 | Total_Amount_Incl_GST = Total_Amount_Excl_GST + GST_Amount |
3. On Delete Row — GST Calculation
When a row is deleted, recalculates totals excluding the deleted row:
| Step | Calculation |
|---|---|
| 1 | Sum all remaining line item Totals |
| 2 | Deduct deleted row.Total from sum |
| 3 | Update Total_Amount_Excl_GST |
| 4 | GST_Amount = Total_Amount_Excl_GST × 0.10 |
| 5 | Total_Amount_Incl_GST = Total_Amount_Excl_GST + GST_Amount |
Line Item Calculation Logic
When Quantity1 or Unit_Net_Ex_GST changes:
┌─────────────────────────────────────────────────────────────┐
│ ON CHANGE: Quantity1 or Unit_Net_Ex_GST │
└──────────────────────────┬──────────────────────────────────┘
│
▼
┌────────────────────────┐
│ Mark_as_Deleted? │
└────────────┬───────────┘
│
┌────────────┴────────────┐
│ │
▼ ▼
┌─────────────────┐ ┌─────────────────┐
│ YES (checked) │ │ NO (unchecked) │
└────────┬────────┘ └────────┬────────┘
│ │
▼ ▼
┌─────────────────┐ ┌─────────────────┐
│ Total = 0 │ │ Total = │
│ GST = 0 │ │ Qty × Unit_Net │
│ Total_Inc = 0 │ │ │
│ │ │ GST = Total×0.10│
│ RETURN (skip) │ │ │
└─────────────────┘ │ Total_Inc = │
│ Total + GST │
└────────┬────────┘
│
▼
┌──────────────────────────────────┐
│ Recalculate Main Form Totals │
│ │
│ Total_Amount_Excl_GST = sum of │
│ all line item Totals │
│ │
│ GST_Amount = Total × 0.10 │
│ │
│ Total_Amount_Incl_GST = │
│ Total_Excl + GST_Amount │
└──────────────────────────────────┘
Totals Section
| Field | Type | Source / Values | Notes |
|---|---|---|---|
Total_Amount_Excl_GST | Currency (AUD) | Computed | Sum of Unit_Net_Ex_GST × Quantity for all line items. |
GST | Currency (AUD) | Computed | 10% of Total Amount (Excl GST). |
Total_Amount_Incl_GST | Currency (AUD) | Computed | Total Amount (Excl GST) + GST. |
System Section
| Field | Type | Source / Values | Notes |
|---|---|---|---|
Parts_to_Order | List (multi-lookup) | Part_Item_Request.ID, displays [ID] | Order-level list of source request lines — used to pre-populate line items. |
Order_Source | Picklist | Direct_Order, Claim_Dhtml_Request, From_Pending_Request | Hidden. Determines form behavior on load. See Order Source. |
PO_PDF_Extraction | Picklist (lookup) | PO_PDF_Extraction.ID | Hidden. Reference to the Claude AI extraction job record. |
Check_Status | Decision Box | — | Hidden until PDF uploaded. Click to check extraction status. |
plain | Text (display only) | — | Hidden. Shows processing message with Job ID. |
Total_Calculation | Section | — | Hidden until line items exist. Contains total fields. |
Auto_Number | Autonumber | Starts at 1 | Internal sequence. |
Claude AI PDF Extraction
The Upload Parts Ordered field enables Claude AI-powered PDF extraction for order confirmations.
Upload Process
- User uploads a PDF file (supplier order confirmation) using the Upload Parts Ordered field
- System creates a
PO_PDF_Extractionrecord with the uploaded PDF - System calls
order_parts_pdf_extraction.extract_details_from_order_parts_pdf - Shows processing message with Job ID
- Check Status checkbox appears
┌─────────────────────────────────────────────────────────────┐
│ ON UPLOAD: Upload_Parts_Ordered │
└──────────────────────────┬──────────────────────────────────┘
│
▼
┌────────────────────────┐
│ Insert into │
│ PO_PDF_Extraction │
│ [Uploaded_PDF = file] │
└────────────┬───────────┘
│
▼
┌────────────────────────┐
│ Call Claude AI │
│ extraction API │
└────────────┬───────────┘
│
▼
┌────────────────────────┐
│ Show message: │
│ "PDF is still │
│ processing. Job ID: │
│ {job_id}. Click │
│ checkbox to check." │
└────────────┬───────────┘
│
▼
┌────────────────────────┐
│ Clear existing │
│ Order_Line_Items │
│ (ready for extraction) │
└────────────────────────┘
Check Status Flow
┌─────────────────┐
│ Check Status │
│ (Click) │
└────────┬────────┘
│
▼
┌─────────────────┐
│ API Call to │
│ get_job_status │
└────────┬────────┘
│
┌────┴────┐
│ │
▼ ▼
┌────────┐ ┌────────────────┐
│Complete│ │ Not Completed │
└───┬────┘ └───────┬────────┘
│ │
▼ ▼
┌────────────┐ ┌────────────┐
│ Process │ │ Reset │
│ Response │ │ Check_ │
│ JSON │ │ Status │
│ │ │ │
│ Validate │ │ Show Alert │
│ Rego match │ │ "Still │
│ │ │ processing"│
│ Populate │ │ │
│ Line Items │ └────────────┘
└────────────┘
Registration Mismatch Validation
If the form already has a Registration value and the extracted registration differs:
┌─────────────────────────────────────────────────────────────┐
│ REGISTRATION MISMATCH ALERT │
├─────────────────────────────────────────────────────────────┤
│ │
│ "Registration mismatch! Existing Rego: {existing} │
│ does not match Extracted Rego: {extracted}" │
│ │
│ • Alert shown to user │
│ • Existing Registration is NOT overwritten │
│ • User must manually verify │
│ │
└─────────────────────────────────────────────────────────────┘
Extracted Fields Mapping
| Extracted JSON Field | Maps To | Notes |
|---|---|---|
vin | VIN_No | Vehicle identification number |
quote_no | Purchase_Order_No_I_Body | Supplier quote/order reference |
registration_no | Registration | Validated against existing value |
line_items[] | Order_Line_Items | Array of parts |
Per Line Item:
| JSON Field | Maps To | Notes |
|---|---|---|
part_description | Description | |
part_number | Part_Number | |
qty | Quantity1 | |
supplier | Suppliers | Looks up Supplier by name |
part_type | Parts_Type | OEM/Parallel/Aftermarket/Used |
cost_price | Unit_Net_Ex_GST | Net price |
sell_price | Unit_List_Ex_GST | List price |
comment | Notes |
Auto-Calculated on Extraction:
| Field | Value |
|---|---|
Due_In_date | Current date + 1 day |
GST | Total × 0.10 |
Total | Qty × Unit_Net_Ex_GST |
Total_Inc_GST | Total + GST |
Fleet Vehicle Auto-Lookup
If a registration is extracted, the system attempts to find a matching Fleet Vehicle:
vehicle_id = logistics_app.add_car.get_vehicle_id(Registration)
if vehicle_id exists:
Fleet_Vehicle_Rego = vehicle_id
Form Submission Validations
Claim Validation
When Parts_to_be_ordered_for == Claim:
| Field | Validation | Error Message |
|---|---|---|
File_Number | Required | "File / Rego Search' is mandatory field." |
Fleet and Private Job Validation
When Parts_to_be_ordered_for == Fleet Vehicle OR Private Job:
Main Form Required Fields
| Field | Validation | Error Message |
|---|---|---|
Supplier | Required | "Supplier is required field" |
Part_Type | Required | "Part Type is required field" |
Parts_Status | Required | "Parts status is required field" |
Line Item Consistency Validation
Each line item must match the main form values:
| Line Item Field | Must Match | Error Message |
|---|---|---|
Suppliers | input.Supplier | "Line Item's supplier is not matching with selected supplier" |
Parts_Type | input.Part_Type | "Line Item's Part Type is not matching with the selected Part Type" |
Status | input.Parts_Status | "Line Item's Status is not matching with selected Parts status" |
┌─────────────────────────────────────────────────────────────┐
│ ON SUBMIT: Fleet Vehicle / Private Job │
└──────────────────────────┬──────────────────────────────────┘
│
▼
┌────────────────────────┐
│ Validate Main Form: │
│ • Supplier required │
│ • Part_Type required │
│ • Parts_Status req'd │
└────────────┬───────────┘
│
▼
┌────────────────────────┐
│ For Each Line Item: │
│ │
│ • Suppliers must match │
│ main form Supplier │
│ │
│ • Parts_Type must │
│ match main Part_Type │
│ │
│ • Status must match │
│ main Parts_Status │
└────────────┬───────────┘
│
┌────────────┴────────────┐
│ │
▼ ▼
┌─────────────────┐ ┌─────────────────┐
│ All Match │ │ Mismatch Found │
└────────┬────────┘ └────────┬────────┘
│ │
▼ ▼
┌─────────────────┐ ┌─────────────────┐
│ Submit proceeds │ │ Alert + Cancel │
│ │ │ Submit │
└─────────────────┘ └─────────────────┘
Note: This validation ensures that when a main form Supplier/Part_Type/Parts_Status is set, ALL line items must have matching values. This enforces the "apply to all" behavior documented in the Fleet Vehicle / Private Job Fields section.
Actions
| Event | Buttons |
|---|---|
| On add | Submit |
| On edit | Update, Cancel |
On Success Behavior
When the form is submitted successfully, the system calls parts_assessment.handle_Order_Parts_Form_Submission.
Post-Submission Actions
┌─────────────────────────────────────────────────────────────┐
│ ON SUCCESS │
└──────────────────────────┬──────────────────────────────────┘
│
▼
┌────────────────────────┐
│ Call handle_Order_ │
│ Parts_Form_Submission │
└────────────┬───────────┘
│
▼
┌────────────────────────┐
│ Check_Status == true? │
│ (PDF extraction used) │
└────────────┬───────────┘
│
┌────────────┴────────────┐
│ │
▼ ▼
┌─────────────────┐ ┌─────────────────┐
│ YES │ │ NO │
└────────┬────────┘ └────────┬────────┘
│ │
▼ │
┌─────────────────┐ │
│ Mark original │ │
│ Part_Item_Req │ │
│ as Is_Deleted │ │
└────────┬────────┘ │
│ │
└────────────┬────────────┘
│
▼
┌────────────────────────┐
│ Order_Source? │
└────────────┬───────────┘
│
┌────────────┴────────────┐
│ │
▼ ▼
┌─────────────────┐ ┌─────────────────┐
│ Claim_Dhtml_ │ │ Other │
│ Request │ │ │
└────────┬────────┘ └────────┬────────┘
│ │
▼ ▼
┌─────────────────┐ ┌─────────────────┐
│ Open Claim DHTML│ │ Refresh Parent │
│ with Parts tab │ │ │
└─────────────────┘ └─────────────────┘
handle_Order_Parts_Form_Submission — Processing Flow
┌─────────────────────────────────────────────────────────────┐
│ SUBMISSION PROCESSING │
└──────────────────────────┬──────────────────────────────────┘
│
▼
┌────────────────────────┐
│ 1. Collect Unique │
│ Suppliers │
└────────────┬───────────┘
│
▼
┌────────────────────────┐
│ 2. Process Line Items │
│ with NULL Due_In │
└────────────┬───────────┘
│
▼
┌────────────────────────┐
│ 3. Create Purchase │
│ Orders (per supplier│
└────────────┬───────────┘
│
▼
┌────────────────────────┐
│ 4. Process Line Items │
│ → Create Parts_Order│
└────────────┬───────────┘
│
▼
┌────────────────────────┐
│ 5. Update Claims Mgmt │
│ Counts (Claim only) │
└────────────┬───────────┘
│
▼
┌────────────────────────┐
│ 6. Build Notes & │
│ Add Timeline │
└────────────────────────┘
Step 2: Line Items with NULL Due_In_date
| Condition | Action |
|---|---|
Parts_to_Order == null | Create new Part_Item_Request with Status = Pending, Tender_Status = Completed |
Parts_to_Order != null | Update existing Part_Item_Request to Status = Unavailable |
Step 3: Create Purchase Order (per supplier)
| Field | Source |
|---|---|
File_Number | From order record |
Ordered_By | Login user |
Date_Ordered | Order record's Added_Time |
Supplier_Name | Current supplier |
Registration, Make, Model, VIN_No | From order record |
Purchase_Order_No_I_Body | Auto-generated iBody sequence (Claim) OR {Rego}-{sequence} (Fleet/Private) |
Rego_PO_Number | {Registration} - {iBody} (Claim) OR just iBody (Fleet/Private) |
Total_Amount_Excl_GST, GST, Total_Amount_Incl_GST | From order record |
Step 4: Process Line Items
For each line item per supplier:
┌─────────────────────────────────────────────────────────────┐
│ FOR EACH LINE ITEM (per supplier) │
└──────────────────────────┬──────────────────────────────────┘
│
┌─────────────────┼─────────────────┬─────────────────┐
│ │ │ │
▼ ▼ ▼ ▼
┌─────────────┐ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│Mark_as_ │ │Request_ │ │Due_In_date │ │Normal │
│Deleted=true │ │Status= │ │== null │ │Processing │
│ │ │Part to │ │ │ │ │
│ │ │Repair │ │ │ │ │
└──────┬──────┘ └──────┬──────┘ └──────┬──────┘ └──────┬──────┘
│ │ │ │
▼ ▼ ▼ ▼
┌─────────────┐ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│Part_Item_Req│ │Create Parts │ │SKIP │ │Create │
│.Is_Deleted │ │_to_Repair │ │(already │ │Parts_Order │
│= true │ │record │ │handled in │ │record │
│ │ │ │ │Step 2) │ │ │
│CONTINUE │ │Part_Item_Req│ │ │ │Update │
│(skip) │ │.Is_Deleted │ │ │ │Part_Item_Req│
│ │ │= true │ │ │ │ │
│ │ │ │ │ │ │Add to notes │
│ │ │CONTINUE │ │ │ │ │
└─────────────┘ └─────────────┘ └─────────────┘ └─────────────┘
Parts_Order Record Created
| Field | Source |
|---|---|
Purchase_Order_Form | New PO ID |
Date_Ordered | From order record |
Job_Type | Claim / Loan Car / Private Job |
Supplier | Current supplier |
Description, Part_Number | From line item |
Ordered | Quantity1 |
Part_Type | From line item |
Unit_List_Ex_GST, Unit_Net_Ex_GST | From line item |
Due_In | From line item |
Status | Arrived (if Parts_Status=Arrived) or Ordered |
Upload_Evidence | From line item |
Claim_Form, Claims_Management_Form | From order record |
Loan_Vehicle | Fleet vehicle ID (if Fleet Vehicle) |
Total_Amount, Total_Amount_Inc_GST | From line item |
Step 5: Update Claims Management Counts (Claim only)
| Field | Count Logic |
|---|---|
Parts_Needed | Part_Item_Request where Tender_Status=Pending OR Status=Pending/Awaiting Approval |
Parts_Ordered | Parts_Order where Status = Ordered/Back Ordered |
Parts_at_Crash_Claim | Parts_Order where Status = Arrived/Delivered Back to HQ |
Parts_at_Repairer | Parts_Order where Status = Delivered to Repair Shop |
Also updates:
Parts_Assessment_Status→CompletedParts_Tendered_Status→CompletedOrder_Parts→Yes
Step 6: Build Notes & Add Timeline
Notes Format (Ordered):
Parts Ordered - {date}
1. {Description} - {Supplier Name} - {Due In Date}
2. {Description} - {Supplier Name} - {Due In Date}
...
Notes Format (Unavailable):
Parts Unavailable - {date}
1. {Description} - {Quantity} - {Notes}
...
Actions by Job Type:
| Job Type | Actions |
|---|---|
| Claim | Add claim note, Create timeline record (Parts_Ordered_date), Update Claim VIN |
| Fleet Vehicle | Add notes via logistics_app.notes.add_notes_by_logged_in_user |
| Private Job | No notes logic |
Field Review — Legacy and Redundant Fields
Fields flagged during the 12 June 2026 review, with decisions recorded. Do not delete any field without first auditing data and Deluge workflow references — removing a field that scripts read/write will break the parts flow silently.
| # | Finding | Decision (12 Jun 2026) |
|---|---|---|
| 1 | Duplicate quantity fields | ✅ Decided — remove Quantity (decimal); Quantity1 is authoritative |
| 2 | Per-line Suppliers lookup | ✅ Decided — not needed; supplier comes from the PO header |
| 3 | Purchase_Order_No_I_Body on both forms | ✅ Decided — PO form's value is authoritative |
| 4 | Request_Status looks vestigial | ✅ Keep — used elsewhere in the app |
| 5 | Parts_to_Order linked twice | 🟡 Pending verification against the live form |
| 6 | Denormalised vehicle fields | 📋 Noted — revisit later |
| 7 | Parts_Type typo "Aftermatket" | 📋 Noted — fix later (with record migration, see below) |
| 8 | No line-total field | 📋 Noted — matcher computes it |
1. Duplicate quantity fields — Quantity1 vs Quantity — RESOLVED
The grid has two quantity fields, both displaying as "Quantity" in the UI: Quantity1 (integer) and Quantity (decimal).
Decision: the decimal Quantity field will be removed from the form. Quantity1 (integer) is the live field — all code, including invoice line matching, reads Quantity1.
2. Per-line Suppliers vs PO-header Supplier_Name — RESOLVED
The PO form has a single supplier at header level; the line items each carry their own supplier lookup.
Decision: the per-line Suppliers field is not needed. The supplier is taken from the Purchase Order header (Supplier_Name) — that is what invoice supplier matching resolves against.
3. Purchase_Order_No_I_Body exists on both forms — RESOLVED
Both Order_Parts and Purchase_Order_Form carry the iBody number.
Decision: the Purchase Order form's value is authoritative — same principle as the supplier field. Invoice-to-PO matching reads Purchase_Order_No_I_Body from the PO form.
4. Request_Status (Part to Order / Part to Repair) — KEEP
Initially flagged as vestigial (a triage-stage decision). Decision: the field is used elsewhere in the app — keep as-is.
5. Parts_to_Order duplicated (per-line lookup + order-level list) — PENDING VERIFICATION
The exported form definition contains the link twice: a per-line picklist inside the Order_Line_Items grid (first grid field), and an order-level list field in the System section (row = 3, height = 60px). The team did not find the second field when reviewing — possibly hidden in the form builder's System section, or the export predates a removal. Action: check the live form builder's System section; if the list field is genuinely gone, update this page and the export.
6. Denormalised vehicle fields (Registration, VIN_No, Make, Model, Colour) — NOTED
Copied from the claim/fleet record rather than looked up. Standard Creator practice, but they can drift from the source record. Colour exists here but not on the PO form. To be revisited later; treat the claim record as the source of truth.
7. Typo in Parts_Type picklist: "Aftermatket" — NOTED, FIX LATER
Should be "Aftermarket". Caution for whoever fixes it: picklist values are stored as literal strings — fixing the option without migrating existing records leaves old rows holding the misspelled value, and any Deluge/report filters on "Aftermatket" will silently stop matching. Fix the value, update records, and grep workflows for the misspelling in one pass.
8. No line-total field — NOTED
Lines carry unit prices but no extended total (qty × unit_net); the PO form's Total_Value is presumably computed by workflow. Fine as-is — the invoice matcher computes line totals itself.
Relevance to Invoice Extraction
Line-item matching compares extracted invoice lines against Order_Line_Items records:
| Extracted invoice field | Line item field | Match approach |
|---|---|---|
description | Description | Normalised text similarity (supplier wording differs from internal wording) |
part_number | Part_Number | Exact match after normalisation — strongest signal when both sides have it |
quantity | Quantity1 | Numeric exact match (Quantity decimal field is being removed) |
unit_list | Unit_List_Ex_GST | Tolerance comparison |
unit_net / unit_price | Unit_Net_Ex_GST | Tolerance comparison — the price-discrepancy check that catches list-vs-net overbilling |
total (per line) | computed qty × Unit_Net_Ex_GST | Computed, no stored field |
Both sides are ex-GST at line level, so no GST conversion is needed for line matching (header totals still need the GST basis of Total_Value confirmed).