toga-ai 1.0.702 → 1.0.704

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.
@@ -314,16 +314,21 @@ Parameters are stored **per client DB** but accessed **through the TOGa2 API**,
314
314
  checkbox `custbody_stocking_order`, read by `App_Api_Toga2::isTransferOrder()`/`isStockingOrder()`
315
315
  — **not** a dollar/hold heuristic. Full mechanics, PO bridges, and origin-location resolution:
316
316
  [NYCHH NetSuite → TransferOrders import](../../../clients/nychh/features/netsuite-transfer-order-import.md).
317
- - **Transfer-order integration clients (beyond NYCHH's stocking-flag routing).** GroWrk, Adyen, and Elite
318
- run transfer-order integration (wrapper toggle reported as `IS_ENABLED_INTEGRATION_TRANSFER_ORDERS=true`)
319
- and are the clients exercised by the shared `syncTransferOrderFromNetsuite` / `getTransferOrderItemsByUuid`
320
- fixes (2026-08-30 above). These orders **masquerade as NetSuite sales orders** ($0, `holdInvoice` for
321
- GroWrk) and are split into `TransferOrders` vs `SalesOrders` by `App_Api_Toga2::isTransferOrder()`.
322
- The **routing SIGNAL is per-client**: NYCHH routes by the `custbody_stocking_order` stocking flag (above),
323
- while GroWrk's own signal is `holdInvoice + total === 0` — do **not** assume one universal rule.
324
- (⚠ Confirm the exact enable-flag name for GroWrk/Adyen/Elite against the wrappers: the stocking-flag const
325
- `IS_ENABLED_TRANSFER_ORDER_STOCKING_FLAG_ROUTING` is documented as NYCHH-only, so
326
- `IS_ENABLED_INTEGRATION_TRANSFER_ORDERS` is either a distinct toggle or a loose name for it.)
317
+ - **Transfer-order integration is governed by TWO DISTINCT wrapper flags — a master enable switch and a
318
+ NYCHH-only classification-mode switch (do not conflate them).**
319
+ - **`IS_ENABLED_INTEGRATION_TRANSFER_ORDERS`** — the master "do transfer-order integration at all"
320
+ switch, defined in every `sync_togasupply_*.php` launcher. `true` for **GroWrk, Adyen, Elite, and
321
+ NYCHH**; `false` for the rest. These are the clients exercised by the shared
322
+ `syncTransferOrderFromNetsuite` / `getTransferOrderItemsByUuid` fixes (2026-08-30 above).
323
+ - **`IS_ENABLED_TRANSFER_ORDER_STOCKING_FLAG_ROUTING`** — a **separate classification-mode** switch,
324
+ **NYCHH-only** (`sync_togasupply_hh.php`), that makes `App_Api_Toga2::isTransferOrder()` classify by
325
+ the NetSuite `custbody_stocking_order` checkbox instead of the legacy rule.
326
+
327
+ These orders **masquerade as NetSuite sales orders** and are split into `TransferOrders` vs
328
+ `SalesOrders` by `isTransferOrder()`. The classification **SIGNAL is per-client**: **NYCHH** routes by
329
+ the `custbody_stocking_order` stocking flag (above); **GroWrk / Elite / Adyen** use the **legacy rule**
330
+ (`holdInvoice AND total === 0`). Do **not** assume one universal signal — the master enable is shared,
331
+ the classification mode is not.
327
332
  - `isParentCustomer` — `true` walks NetSuite child customers (`listChildCustomers`); `false`
328
333
  syncs the single customer. Prudential-EDI and the live Quad wrapper use `false`.
329
334
  - The original combined-array entries used `App_Api_Toga2::CLIENT_UUID_*` consts for Quad and
@@ -658,6 +663,22 @@ Parameters are stored **per client DB** but accessed **through the TOGa2 API**,
658
663
  `/locations` for the unit's own location before the write**, mirroring the existing item-line location
659
664
  create one level up. Shared/general fix (any client running serialized item receipts), surfaced by
660
665
  **GroWrk** location **1569**. Deployed.
666
+ - **The inventory-ADJUSTMENT unit path now has the SAME auto-create (fixed 2026-08-30) — it did not
667
+ before, which froze GroWrk.** `syncInventoryAdjustmentFromNetsuite`'s serialized-unit processing took
668
+ the unit's location from the inventory number's `custitemnumber_location` (the unit's own current
669
+ location, falling back to the adjustment line location), but — unlike `syncItemReceiptFromNetsuite` —
670
+ **never auto-created a missing warehouse**, so `POST /units` failed **EV-12** "unable to find a unique
671
+ match" on `location` (`searchCriteria c_netsuiteInternalLocationId=1596`; **0 rows** in
672
+ `Client_Growrk.Locations` for 1596), leaving `NETSUITE_EXECUTION_MODE_INVENTORY_ADJUSTMENTS` stuck at
673
+ `1-RUNNING`. **Fix:** capture the unit location's NAME (`$unitNetsuiteLocationName` from the
674
+ `custitemnumber_location` ref, carried in `$unitsToGet` as `netsuiteLocationName`) and, before **both**
675
+ unit-location reference points (the per-unit PUT-create path and the batch `POST /units` path),
676
+ `POST /locations` when the id is not already in `$lookupWarehouseByNetsuiteLocationInternalId` and a
677
+ name is present — same payload as the receipt sync (`name`, `c_netsuiteInternalLocationId`,
678
+ `locationType = WAREHOUSE_LOCATION_TYPE_UUID`, `isActive=true`, `allowReceiving`/`allowSending=false`),
679
+ then register it in the warehouse lookup. Guarded by `!isset(lookup[id]) && !empty(name)` so it fires
680
+ only for genuinely-missing locations and never duplicates. Shared 1.0 path — benefits all
681
+ serialized-adjustment clients.
661
682
 
662
683
  - **⚠ The exact api2 rejection detail lives in `Logs_<Client>.Api`, not `Logs.Event` (which TRUNCATES
663
684
  it).** When a section throws on an api2 non-success, `Logs.Event` records the error envelope but
@@ -737,6 +758,14 @@ Parameters are stored **per client DB** but accessed **through the TOGa2 API**,
737
758
 
738
759
  ## Change history
739
760
 
761
+ - 2026-08-30 — **Inventory-adjustment serialized-unit path now auto-creates a missing unit warehouse
762
+ (`library`).** `syncInventoryAdjustmentFromNetsuite` took the unit's location from the inventory
763
+ number's `custitemnumber_location` but never created a missing warehouse (unlike
764
+ `syncItemReceiptFromNetsuite`), so `POST /units` failed EV-12 on `location` for GroWrk location **1596**
765
+ (0 rows in `Client_Growrk.Locations`), stuck `INVENTORY_ADJUSTMENTS` at `1-RUNNING`. Fix captures the
766
+ location NAME (`netsuiteLocationName`) and `POST /locations` before both the PUT-create and batch
767
+ `POST /units` paths — guarded `!isset(lookup[id]) && !empty(name)`, same payload as the receipt sync —
768
+ then registers it in the warehouse lookup. Shared path (all serialized-adjustment clients). (jcardinal)
740
769
  - 2026-08-30 — **Rebuilt GroWrk transfer-order integration + shared IF/inventory-adjustment fixes (all in
741
770
  `library/app/api/toga2.php`).** Root-caused the shared `syncTransferOrderFromNetsuite` **non-idempotency**
742
771
  to api2 never inlining `transferOrderItems` (`transfer-orders` has no `InherentRecordChildren` row) — the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "toga-ai",
3
- "version": "1.0.702",
3
+ "version": "1.0.704",
4
4
  "description": "TOGA Technology Team Claude Knowledge System — shared AI coding harness with skills, knowledge base CLI, and project installer for Claude Code.",
5
5
  "keywords": [
6
6
  "claude",