toga-ai 1.0.56 → 1.0.57
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
| Doc | Framework | Summary | Files |
|
|
4
4
|
|-----|-----------|---------|-------|
|
|
5
5
|
| [Compass ASN → ItemFulfillment Auto-Creation](features/asn-to-item-fulfillment.md) | 2.0 | For Compass USA, posting an AdvanceShippingNotice (ASN) auto-creates the ItemFulfillment (IF) on the upstream SalesOrder. | _underscore/Model/Compass/AdvanceShippingNotice.php, api2/Component/Api/Cxml/Cxml.php, dbchanges2/Client_Compass/2026-06-11 - AsnItemTrackingNumberAcl.sql |
|
|
6
|
-
| [Compass: Item
|
|
6
|
+
| [Compass: Item-Fulfillment TableViews (for-sales-order-items & for-sales-orders, tracking via bridge)](features/item-fulfillment-tracking-tableview.md) | 2.0 | Two sibling Compass TableViews in `Client_Compass` display fulfilled items in toga2-supply, both driven by `TableViews` / `TableViewJoins` / `TableViewFields` c | dbchanges2/Client_Compass/2026-06-10 - ItemFulfillmentsForSalesOrderItemsTableView.sql, dbchanges2/Client_Compass/2026-06-11 - ItemFulfillmentsForSalesOrdersTableView.sql |
|
|
7
7
|
| [Compass MITS PO → SO Item Linking](features/mits-po-to-so-item-linking.md) | 2.0 | MITS sends Compass inbound Purchase Orders (`POST /v2/purchase-orders`) against a Sales Order (`mitsSalesOrder`). | _underscore/Model/Compass/PurchaseOrder.php |
|
|
8
8
|
| [Compass USA](profile.md) | 2.0 | Compass USA is a TOGA client running a multi-tier supply-chain commerce operation. | |
|
|
@@ -1,46 +1,85 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "Compass: Item
|
|
2
|
+
title: "Compass: Item-Fulfillment TableViews (for-sales-order-items & for-sales-orders, tracking via bridge)"
|
|
3
3
|
framework: "2.0"
|
|
4
4
|
project: _Underscore
|
|
5
5
|
client: compass-usa
|
|
6
6
|
type: client-feature
|
|
7
7
|
status: active
|
|
8
|
-
updated: 2026-06-
|
|
8
|
+
updated: 2026-06-11
|
|
9
9
|
owners: ["jcardinal"]
|
|
10
10
|
files:
|
|
11
11
|
- dbchanges2/Client_Compass/2026-06-10 - ItemFulfillmentsForSalesOrderItemsTableView.sql
|
|
12
|
+
- dbchanges2/Client_Compass/2026-06-11 - ItemFulfillmentsForSalesOrdersTableView.sql
|
|
12
13
|
related:
|
|
13
14
|
- ../../../2.0/apps/_underscore/features/tracking-number-bridges.md
|
|
14
15
|
---
|
|
15
16
|
|
|
16
17
|
## Summary
|
|
17
18
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
**Units** with INNER joins (so non-serialized items with no unit never appeared) and sourced the
|
|
21
|
-
outbound tracking number from the now-dropped `ItemFulfillmentItemUnits.trackingNumberId`.
|
|
19
|
+
Two sibling Compass TableViews in `Client_Compass` display fulfilled items in toga2-supply,
|
|
20
|
+
both driven by `TableViews` / `TableViewJoins` / `TableViewFields` config (no PHP):
|
|
22
21
|
|
|
23
|
-
|
|
22
|
+
- **`item-fulfillments-for-sales-order-items`** (`TableViews.id = 13`) — fulfilled items for a
|
|
23
|
+
single sales-order line.
|
|
24
|
+
- **`item-fulfillments-for-sales-orders`** (`TableViews.id = 12`) — fulfilled items across the
|
|
25
|
+
whole sales order.
|
|
24
26
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
Both were originally **rooted at `Units` (record 31) with INNER joins upward**, so any fulfilled
|
|
28
|
+
item with no serialized unit (no `ItemFulfillmentItemUnits` / `Units`) never appeared — and for
|
|
29
|
+
view 12, an entire order with zero unit-level rows returned **0 records** even though its items
|
|
30
|
+
were fulfilled. View 13 was re-rooted on 2026-06-10; view 12 on 2026-06-11.
|
|
31
|
+
|
|
32
|
+
## How it works (new definitions)
|
|
33
|
+
|
|
34
|
+
Both views are re-rooted at **`ItemFulfillmentItems` (record 29)** so every fulfilled item appears,
|
|
35
|
+
with the unit/tracking chain made **OUTER** so missing units no longer drop rows.
|
|
36
|
+
|
|
37
|
+
**View 13 — `item-fulfillments-for-sales-order-items`:**
|
|
38
|
+
- INNER `SalesOrderItems`; OUTER `ItemFulfillmentItemUnits` → OUTER `Units` → OUTER
|
|
39
|
+
`ItemFulfillmentItemUnits_TrackingNumbers` (record 319) → OUTER `TrackingNumbers` → OUTER `ShippingCarriers`.
|
|
40
|
+
- Columns: **Sales Order Line Number, Quantity Fulfilled (`ItemFulfillmentItems.quantity`),
|
|
30
41
|
Outbound Tracking #, Carrier, Serial #, Asset Tag.**
|
|
31
|
-
|
|
42
|
+
|
|
43
|
+
**View 12 — `item-fulfillments-for-sales-orders`:**
|
|
44
|
+
- Same base + OUTER unit/tracking chain, plus the order-scoping INNER joins:
|
|
45
|
+
INNER `SalesOrderItems`, INNER `ItemFulfillments`, INNER `SalesOrders`, INNER `Items`.
|
|
46
|
+
- Columns: **Sales Order Line Number, Part Number (`Items.partNumber`), Quantity Fulfilled,
|
|
47
|
+
Outbound Tracking # (hyperlink via `TrackingNumbers._hyperlink` rf 1272), Carrier, Serial #, Asset Tag.**
|
|
48
|
+
- Default sort re-pointed to the line-number field.
|
|
49
|
+
|
|
50
|
+
Stable Core ids used: records 29 IFI, 30 IFIU, 31 Units, 15 SalesOrderItems, 14 SalesOrders,
|
|
51
|
+
28 ItemFulfillments, 21 Items, 319 IFIU-tracking bridge, 62 TrackingNumbers, 9 ShippingCarriers.
|
|
52
|
+
|
|
53
|
+
## Data model
|
|
54
|
+
|
|
55
|
+
Join keys (RecordField ids): 60 SOI.id / 368 IFI.salesOrderItemId; 360 IF.id / 367 IFI.itemFulfillmentId;
|
|
56
|
+
59 SO.id / 254 SOI.salesOrderId; 105 Item.id / 66 SOI.itemId; 374 IFIU.itemFulfillmentItemId / 365 IFI.id;
|
|
57
|
+
236 Unit.id / 375 IFIU.unitId; 2183 bridge.itemFulfillmentItemUnitId / 372 IFIU.id;
|
|
58
|
+
336 TN.id / 2184 bridge.trackingNumberId; 21 SC.id / 613 TN.shippingCarrierId.
|
|
32
59
|
|
|
33
60
|
## Gotchas / known issues
|
|
34
61
|
|
|
62
|
+
- **A Unit-rooted view returns 0 rows whenever the order has no unit-level breakdown.** Symptom
|
|
63
|
+
seen on SA132740 (salesOrderId 105826): 13 SalesOrderItems, 7 ItemFulfillmentItems, but **0
|
|
64
|
+
ItemFulfillmentItemUnits / 0 Units** → view 12 showed "0 records" while the re-rooted sibling
|
|
65
|
+
view 13 showed the items fine. Fix is structural (re-root + OUTER chain), independent of the
|
|
66
|
+
missing-unit data issue.
|
|
35
67
|
- Tracking is sourced through the bridge join (`ItemFulfillmentItemUnits_TrackingNumbers.trackingNumberId`),
|
|
36
|
-
NOT the dropped column. The bridge record/fields
|
|
37
|
-
|
|
38
|
-
- `TableViews.sortPrimaryTableViewFieldId` is a FK to `TableViewFields`; it
|
|
39
|
-
old fields
|
|
68
|
+
NOT the dropped `ItemFulfillmentItemUnits.trackingNumberId` column. The bridge record/fields
|
|
69
|
+
(319 / 2183 / 2184) come from the Core migration and must exist before these files run.
|
|
70
|
+
- `TableViews.sortPrimaryTableViewFieldId` is a FK to `TableViewFields`; set it NULL before deleting
|
|
71
|
+
the old fields, then re-point via a multi-table UPDATE (not a self-subquery) to avoid MySQL 1093.
|
|
40
72
|
- `TableViewFields` must be deleted before `TableViewJoins` (`tableViewJoinId` FK).
|
|
73
|
+
- With null `joinOnTableViewJoinId`, the engine resolves a join's parent table by the `recordId` of
|
|
74
|
+
`parentRecordFieldId` — this only works because each record appears once in the graph. Reusing a
|
|
75
|
+
record twice in one view would require an explicit `joinOnTableViewJoinId`.
|
|
41
76
|
|
|
42
77
|
## Client variations
|
|
43
|
-
|
|
78
|
+
Compass-only. The underlying bridge model is shared (see the _underscore feature doc).
|
|
79
|
+
|
|
80
|
+
## Change history
|
|
81
|
+
- 2026-06-11 — Re-rooted `item-fulfillments-for-sales-orders` (id 12) from Units to ItemFulfillmentItems with OUTER unit/tracking chain; fixes 0-records on orders lacking unit breakdown (e.g. SA132740). (jcardinal)
|
|
82
|
+
- 2026-06-10 — Re-rooted `item-fulfillments-for-sales-order-items` (id 13) and moved tracking to the bridge join. (jcardinal)
|
|
44
83
|
|
|
45
84
|
## Related docs
|
|
46
85
|
- 2.0 _underscore: Tracking-Number Bridge Migration.
|
package/package.json
CHANGED