Skip to content

Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.

fix(inventory): set itemId on adjustment-created tracked entities, backfill existing rows

aashub58d7ff346ac
diff --git a/packages/database/supabase/functions/post-inventory-adjustment/index.ts b/packages/database/supabase/functions/post-inventory-adjustment/index.ts
index c478b7b9d2..745b092ef9 100644
--- a/packages/database/supabase/functions/post-inventory-adjustment/index.ts
+++ b/packages/database/supabase/functions/post-inventory-adjustment/index.ts
@@ -997,6 +997,9 @@ serve(async (req: Request) => {
sourceDocumentId: itemId,
sourceDocumentReadableId:
itemResult.data.readableIdWithRevision ?? undefined,
+ // Every by-item consumer filters on this column (notably the
+ // sales-return picker); omitting it made this stock unreturnable.
+ itemId,
readableId: readableId ?? null,
quantity: signedQuantity,
status: "Available",
diff --git a/packages/database/supabase/migrations/20260911130000_backfill-tracked-entity-item-id.sql b/packages/database/supabase/migrations/20260911130000_backfill-tracked-entity-item-id.sql
new file mode 100644
index 0000000000..9b6ebfe1a1
--- /dev/null
+++ b/packages/database/supabase/migrations/20260911130000_backfill-tracked-entity-item-id.sql
@@ -0,0 +1,16 @@
+-- Backfill trackedEntity."itemId" for adjustment-created entities:
+-- post-inventory-adjustment set sourceDocumentId to the item but left the
+-- itemId column null, hiding this stock from every by-item consumer — the
+-- sales-return picker found no candidates, so return receipts minted a
+-- duplicate entity instead of reactivating the shipped one. The insert now
+-- sets itemId; this repairs rows already written. Scoped to
+-- sourceDocument = 'Item' (there sourceDocumentId IS the item id) and joined
+-- to "item" so only ids that still resolve are written.
+
+UPDATE "trackedEntity" te
+SET "itemId" = i."id"
+FROM "item" i
+WHERE te."itemId" IS NULL
+ AND te."sourceDocument" = 'Item'
+ AND te."sourceDocumentId" = i."id"
+ AND te."companyId" = i."companyId";
diff --git a/packages/jobs/manifests/schema.json b/packages/jobs/manifests/schema.json
index a452db122b..e19d9cdefc 100644
--- a/packages/jobs/manifests/schema.json
+++ b/packages/jobs/manifests/schema.json
@@ -1,11 +1,11 @@
{
"kind": "carbon-company-backup",
"version": 1,
- "schemaVersion": "20260910093006",
+ "schemaVersion": "20260911130000",
"sourceCompanyId": "schema-baseline",
"sourceCompanyGroupId": null,
"sourceCompanyName": null,
- "exportedAt": "2026-09-10T09:58:59.067Z",
+ "exportedAt": "2026-09-11T12:46:13.101Z",
"exportedBy": "schema-baseline",
"label": "schema baseline",
"includeStorage": "none",
@@ -40,6 +40,7 @@
"columns": [
"laborAbsorptionAccount",
"updatedBy",
+ "salesReturnsAccount",
"laborAndMachineVarianceAccount",
"rawMaterialsAccount",
"workInProgressAccount",
@@ -672,12 +673,20 @@
{
"name": "documentFavorite",
"rows": 0,
- "columns": ["documentId", "userId"]
+ "columns": [
+ "documentId",
+ "userId"
+ ]
},
{
"name": "documentLabel",
"rows": 0,
- "columns": ["userId", "documentId", "companyId", "label"]
+ "columns": [
+ "userId",
+ "documentId",
+ "companyId",
+ "label"
+ ]
},
{
"name": "documentSection",
@@ -742,7 +751,13 @@
{
"name": "employee",
"rows": 0,
- "columns": ["id", "companyId", "pin", "active", "employeeTypeId"]
+ "columns": [
+ "id",
+ "companyId",
+ "pin",
+ "active",
+ "employeeTypeId"
+ ]
},
{
"name": "employeeTypePermission",
@@ -811,7 +826,12 @@
{
"name": "fiscalYearSettings",
"rows": 0,
- "columns": ["startMonth", "companyId", "taxStartMonth", "updatedBy"]
+ "columns": [
+ "startMonth",
+ "companyId",
+ "taxStartMonth",
+ "updatedBy"
+ ]
},
{
"name": "fixedAssetClass",
@@ -848,14 +868,14 @@
"name": "gaugeType",
"rows": 0,
"columns": [
- "id",
- "createdBy",
- "name",
- "updatedBy",
- "createdAt",
"customFields",
"companyId",
- "updatedAt"
+ "updatedAt",
+ "createdAt",
+ "name",
+ "updatedBy",
+ "id",
+ "createdBy"
]
},
{
@@ -997,7 +1017,12 @@
{
"name": "itemStockQuantities",
"rows": 0,
- "columns": ["itemId", "companyId", "quantityOnHand", "locationId"]
+ "columns": [
+ "itemId",
+ "companyId",
+ "quantityOnHand",
+ "locationId"
+ ]
},
{
"name": "journal",
@@ -1268,7 +1293,13 @@
{
"name": "materialDimension",
"rows": 0,
- "columns": ["name", "isMetric", "companyId", "materialFormId", "id"]
+ "columns": [
+ "isMetric",
+ "name",
+ "companyId",
+ "materialFormId",
+ "id"
+ ]
},
{
"name": "materialSubstance",
@@ -1289,23 +1320,33 @@
{
"name": "materialFinish",
"rows": 0,
- "columns": ["companyId", "materialSubstanceId", "name", "id"]
+ "columns": [
+ "companyId",
+ "materialSubstanceId",
+ "id",
+ "name"
+ ]
},
{
"name": "materialGrade",
"rows": 0,
- "columns": ["companyId", "name", "id", "materialSubstanceId"]
+ "columns": [
+ "id",
+ "materialSubstanceId",
+ "companyId",
+ "name"
+ ]
},
{
"name": "materialType",
"rows": 0,
"columns": [
- "code",
- "materialSubstanceId",
- "materialFormId",
- "name",
"id",
- "companyId"
+ "companyId",
+ "name",
+ "materialFormId",
+ "code",
+ "materialSubstanceId"
]
},
{
@@ -1333,7 +1374,12 @@
{
"name": "membership",
"rows": 0,
- "columns": ["groupId", "id", "memberUserId", "memberGroupId"]
+ "columns": [
+ "groupId",
+ "id",
+ "memberUserId",
+ "memberGroupId"
+ ]
},
{
"name": "modelUpload",
@@ -1387,13 +1433,13 @@
"rows": 0,
"columns": [
"createdBy",
- "updatedAt",
"createdAt",
"companyId",
- "updatedBy",
+ "updatedAt",
"id",
- "customFields",
- "name"
+ "updatedBy",
+ "name",
+ "customFields"
]
},
{
@@ -1401,80 +1447,80 @@
"rows": 0,
"columns": [
"createdAt",
- "active",
- "name",
"updatedAt",
- "id",
- "systemType",
+ "name",
+ "active",
"createdBy",
- "companyId",
- "updatedBy"
+ "systemType",
+ "id",
+ "updatedBy",
+ "companyId"
]
},
{
"name": "nonConformanceType",
"rows": 0,
"columns": [
- "name",
- "customFields",
"id",
"updatedAt",
+ "name",
+ "customFields",
+ "createdBy",
"createdAt",
"companyId",
- "updatedBy",
- "createdBy"
+ "updatedBy"
]
},
{
"name": "nonConformanceWorkflow",
"rows": 0,
"columns": [
- "createdBy",
- "description",
- "content",
- "requiredActionIds",
"priority",
"companyId",
"updatedAt",
+ "content",
+ "description",
+ "createdBy",
+ "requiredActionIds",
+ "id",
+ "approvalRequirements",
+ "tags",
+ "source",
"updatedBy",
"createdAt",
"name",
- "active",
- "approvalRequirements",
- "id",
- "tags",
- "source"
+ "active"
]
},
{
"name": "nonConformance",
"rows": 0,
"columns": [
- "locationId",
- "nonConformanceId",
- "dueDate",
- "createdAt",
- "approvalRequirements",
- "requiredActionIds",
- "updatedBy",
- "nonConformanceWorkflowId",
- "id",
- "createdBy",
- "status",
+ "assignee",
+ "content",
+ "source",
+ "tags",
+ "updatedAt",
+ "closeDate",
+ "customFields",
+ "openDate",
"quantity",
"description",
- "name",
"nonConformanceTypeId",
+ "name",
"companyId",
"priority",
- "source",
- "assignee",
- "content",
- "tags",
- "openDate",
- "customFields",
- "updatedAt",
- "closeDate"
+ "updatedBy",
+ "nonConformanceWorkflowId",
+ "id",
+ "createdBy",
+ "status",
+ "nonConformanceId",
+ "locationId",
+ "dueDate",
+ "approvalRequirements",
+ "createdAt",
+ "requiredActionIds"
]
},
{
@@ -1533,39 +1579,39 @@
"name": "nonConformanceApprovalTask",
"rows": 0,
"columns": [
- "updatedBy",
- "dueDate",
- "createdAt",
- "assignee",
"status",
"updatedAt",
"approvalType",
- "completedDate",
+ "assignee",
+ "createdAt",
+ "dueDate",
+ "updatedBy",
+ "nonConformanceId",
+ "createdBy",
+ "tags",
+ "notes",
+ "companyId",
"id",
"sortOrder",
- "companyId",
- "notes",
- "tags",
- "createdBy",
- "nonConformanceId"
+ "completedDate"
]
},
{
"name": "nonConformanceReviewer",
"rows": 0,
"columns": [
- "status",
- "nonConformanceId",
- "companyId",
- "completedDate",
- "notes",
"title",
"createdAt",
"updatedAt",
"createdBy",
"id",
"updatedBy",
- "assignee"
+ "assignee",
+ "status",
+ "nonConformanceId",
+ "companyId",
+ "notes",
+ "completedDate"
]
},
{
@@ -1880,35 +1926,35 @@
"name": "procedure",
"rows": 0,
"columns": [
- "id",
- "companyId",
- "createdBy",
- "status",
- "name",
- "updatedBy",
- "assignee",
- "createdAt",
- "updatedAt",
- "version",
- "description",
"processId",
"tags",
- "content"
+ "description",
+ "content",
+ "version",
+ "updatedAt",
+ "updatedBy",
+ "name",
+ "createdAt",
+ "assignee",
+ "createdBy",
+ "companyId",
+ "id",
+ "status"
]
},
{
"name": "procedureParameter",
"rows": 0,
"columns": [
+ "createdAt",
"id",
"updatedBy",
- "createdAt",
- "procedureId",
"updatedAt",
+ "procedureId",
"companyId",
+ "createdBy",
"value",
- "key",
- "createdBy"
+ "key"
]
},
{
@@ -1937,7 +1983,10 @@
{
"name": "purchasingRfqFavorite",
"rows": 0,
- "columns": ["rfqId", "userId"]
+ "columns": [
+ "rfqId",
+ "userId"
+ ]
},
{
"name": "qualityDocument",
@@ -1988,6 +2037,21 @@
"reportKey"
]
},
+ {
+ "name": "returnReason",
+ "rows": 0,
+ "columns": [
+ "createdBy",
+ "inventoryValueZero",
+ "companyId",
+ "updatedBy",
+ "customFields",
+ "id",
+ "createdAt",
+ "name",
+ "updatedAt"
+ ]
+ },
{
"name": "scrapReason",
"rows": 0,
@@ -2005,7 +2069,11 @@
{
"name": "searchIndexRegistry",
"rows": 0,
- "columns": ["companyId", "createdAt", "lastRebuiltAt"]
+ "columns": [
+ "companyId",
+ "createdAt",
+ "lastRebuiltAt"
+ ]
},
{
"name": "sequence",
@@ -2089,7 +2157,12 @@
{
"name": "employeeShift",
"rows": 0,
- "columns": ["shiftId", "companyId", "employeeId", "id"]
+ "columns": [
+ "shiftId",
+ "companyId",
+ "employeeId",
+ "id"
+ ]
},
{
"name": "peopleAbsence",
@@ -2145,16 +2218,16 @@
"name": "slackDocumentThread",
"rows": 0,
"columns": [
- "createdAt",
+ "updatedAt",
+ "id",
+ "threadTs",
+ "companyId",
+ "createdBy",
+ "updatedBy",
+ "channelId",
"documentType",
"documentId",
- "channelId",
- "updatedBy",
- "createdBy",
- "companyId",
- "threadTs",
- "updatedAt",
- "id"
+ "createdAt"
]
},
{
@@ -2285,21 +2358,21 @@
"name": "tableView",
"rows": 0,
"columns": [
- "updatedBy",
- "type",
- "companyId",
- "columnOrder",
- "table",
- "createdBy",
- "description",
"sortOrder",
- "sorts",
"columnVisibility",
"id",
- "filters",
+ "sorts",
"columnPinning",
+ "filters",
"createdAt",
- "name"
+ "name",
+ "updatedBy",
+ "type",
+ "companyId",
+ "columnOrder",
+ "table",
+ "createdBy",
+ "description"
]
},
{
@@ -2362,16 +2435,16 @@
"name": "trackedActivity",
"rows": 0,
"columns": [
- "companyId",
+ "id",
+ "createdBy",
+ "attributes",
+ "type",
+ "createdAt",
+ "updatedBy",
+ "sourceDocumentReadableId",
"sourceDocumentId",
"sourceDocument",
- "sourceDocumentReadableId",
- "updatedBy",
- "createdAt",
- "type",
- "attributes",
- "id",
- "createdBy"
+ "companyId"
]
},
{
@@ -2649,17 +2722,17 @@
"name": "batchProperty",
"rows": 0,
"columns": [
- "label",
- "dataType",
- "companyId",
- "listOptions",
- "itemId",
"createdAt",
"updatedAt",
+ "itemId",
+ "sortOrder",
"createdBy",
"id",
"updatedBy",
- "sortOrder"
+ "companyId",
+ "label",
+ "dataType",
+ "listOptions"
]
},
{
@@ -2687,8 +2760,8 @@
"itemId",
"id",
"companyId",
- "sortOrder",
"name",
+ "sortOrder",
"isUngrouped"
]
},
@@ -2696,20 +2769,20 @@
"name": "configurationParameter",
"rows": 0,
"columns": [
- "updatedBy",
+ "label",
+ "materialFormFilterId",
+ "key",
+ "configurationParameterGroupId",
+ "updatedAt",
+ "dataType",
"itemId",
+ "updatedBy",
"sortOrder",
"createdAt",
- "id",
"companyId",
+ "id",
"createdBy",
- "listOptions",
- "key",
- "label",
- "materialFormFilterId",
- "configurationParameterGroupId",
- "dataType",
- "updatedAt"
+ "listOptions"
]
},
{
@@ -2728,18 +2801,18 @@
"name": "demandForecast",
"rows": 0,
"columns": [
- "updatedBy",
- "forecastMethod",
- "periodId",
- "forecastQuantity",
- "notes",
+ "confidence",
"createdBy",
"itemId",
"updatedAt",
- "confidence",
- "locationId",
"companyId",
- "createdAt"
+ "createdAt",
+ "locationId",
+ "updatedBy",
+ "forecastMethod",
+ "notes",
+ "periodId",
+ "forecastQuantity"
]
},
{
@@ -3038,39 +3111,39 @@
"name": "nonConformanceItem",
"rows": 0,
"columns": [
- "createdAt",
- "companyId",
"itemId",
+ "companyId",
"updatedAt",
- "id",
- "disposition",
- "createdBy",
+ "createdAt",
"nonConformanceId",
+ "updatedBy",
"quantity",
- "updatedBy"
+ "disposition",
+ "id",
+ "createdBy"
]
},
{
"name": "procedureStep",
"rows": 0,
"columns": [
- "fileTypes",
- "required",
- "updatedBy",
- "createdBy",
- "createdAt",
- "name",
- "description",
- "type",
+ "maxValue",
+ "unitOfMeasureCode",
+ "companyId",
+ "procedureId",
+ "updatedAt",
+ "sortOrder",
+ "listValues",
"minValue",
"id",
- "listValues",
- "sortOrder",
- "updatedAt",
- "procedureId",
- "companyId",
- "unitOfMeasureCode",
- "maxValue"
+ "type",
+ "description",
+ "name",
+ "createdAt",
+ "createdBy",
+ "updatedBy",
+ "required",
+ "fileTypes"
]
},
{
@@ -3158,20 +3231,20 @@
"name": "trackedEntity",
"rows": 0,
"columns": [
- "status",
+ "attributes",
"updatedBy",
+ "status",
"sourceDocument",
- "attributes",
"itemId",
"sourceDocumentId",
- "quantity",
- "expirationDate",
"createdBy",
"companyId",
+ "quantity",
+ "expirationDate",
+ "sourceDocumentReadableId",
"readableId",
"createdAt",
- "id",
- "sourceDocumentReadableId"
+ "id"
]
},
{
@@ -3199,8 +3272,8 @@
"createdBy",
"id",
"updatedAt",
- "trackedEntityId",
"companyId",
+ "trackedEntityId",
"createdAt"
]
},
@@ -3208,26 +3281,26 @@
"name": "trackedActivityInput",
"rows": 0,
"columns": [
- "updatedBy",
- "trackedEntityId",
- "createdAt",
- "trackedActivityId",
- "createdBy",
+ "companyId",
"quantity",
- "companyId"
+ "createdBy",
+ "trackedActivityId",
+ "createdAt",
+ "trackedEntityId",
+ "updatedBy"
]
},
{
"name": "trackedActivityOutput",
"rows": 0,
"columns": [
- "createdAt",
- "quantity",
- "companyId",
- "updatedBy",
- "trackedActivityId",
+ "trackedEntityId",
"createdBy",
- "trackedEntityId"
+ "trackedActivityId",
+ "updatedBy",
+ "companyId",
+ "quantity",
+ "createdAt"
]
},
{
@@ -3300,7 +3373,11 @@
{
"name": "userToCompany",
"rows": 0,
- "columns": ["userId", "companyId", "role"]
+ "columns": [
+ "userId",
+ "companyId",
+ "role"
+ ]
},
{
"name": "warehouse",
@@ -3326,22 +3403,22 @@
"name": "warehouseTransfer",
"rows": 0,
"columns": [
- "tags",
- "transferId",
- "updatedBy",
- "notes",
- "companyId",
+ "transferDate",
+ "createdBy",
"id",
"reference",
- "createdBy",
- "transferDate",
+ "companyId",
+ "notes",
+ "updatedBy",
+ "transferId",
+ "tags",
+ "customFields",
+ "status",
+ "createdAt",
+ "expectedReceiptDate",
"toLocationId",
"fromLocationId",
- "updatedAt",
- "expectedReceiptDate",
- "createdAt",
- "status",
- "customFields"
+ "updatedAt"
]
},
{
@@ -3375,19 +3452,19 @@
"name": "jobOperationBatch",
"rows": 0,
"columns": [
+ "status",
"processId",
"companyId",
- "status",
- "workCenterId",
"updatedBy",
- "updatedAt",
- "readableId",
- "createdBy",
+ "workCenterId",
"notes",
- "createdAt",
+ "createdBy",
+ "readableId",
+ "updatedAt",
+ "locationId",
"id",
"customFields",
- "locationId"
+ "createdAt"
]
},
{
@@ -3650,24 +3727,24 @@
"name": "warehouseTransferLine",
"rows": 0,
"columns": [
- "toStorageUnitId",
- "fromStorageUnitId",
- "companyId",
- "transferId",
- "updatedBy",
- "receivedQuantity",
- "unitOfMeasureCode",
- "id",
- "toLocationId",
- "fromLocationId",
- "customFields",
"quantity",
- "createdBy",
"itemId",
- "createdAt",
- "updatedAt",
+ "createdBy",
+ "customFields",
+ "fromLocationId",
+ "notes",
"shippedQuantity",
- "notes"
+ "updatedAt",
+ "createdAt",
+ "updatedBy",
+ "transferId",
+ "companyId",
+ "fromStorageUnitId",
+ "toStorageUnitId",
+ "id",
+ "toLocationId",
+ "unitOfMeasureCode",
+ "receivedQuantity"
]
},
{
@@ -3798,7 +3875,12 @@
{
"name": "customerAccount",
"rows": 0,
- "columns": ["active", "companyId", "customerId", "id"]
+ "columns": [
+ "active",
+ "companyId",
+ "customerId",
+ "id"
+ ]
},
{
"name": "customerItemPriceOverride",
@@ -3945,14 +4027,14 @@
"name": "nonConformanceCustomer",
"rows": 0,
"columns": [
- "customerId",
- "companyId",
"updatedAt",
+ "companyId",
+ "customerId",
"createdAt",
- "nonConformanceId",
"updatedBy",
- "id",
- "createdBy"
+ "nonConformanceId",
+ "createdBy",
+ "id"
]
},
{
@@ -4004,7 +4086,10 @@
{
"name": "salesOrderFavorite",
"rows": 0,
- "columns": ["userId", "salesOrderId"]
+ "columns": [
+ "userId",
+ "salesOrderId"
+ ]
},
{
"name": "salesOrderLine",
@@ -4054,16 +4139,16 @@
"name": "nonConformanceSalesOrderLine",
"rows": 0,
"columns": [
- "salesOrderReadableId",
- "createdAt",
- "salesOrderId",
- "salesOrderLineId",
"companyId",
- "id",
"updatedAt",
+ "id",
"createdBy",
"updatedBy",
- "nonConformanceId"
+ "nonConformanceId",
+ "salesOrderReadableId",
+ "createdAt",
+ "salesOrderLineId",
+ "salesOrderId"
]
},
{
@@ -4135,6 +4220,35 @@
"salesOrderId"
]
},
+ {
+ "name": "salesReturnOrder",
+ "rows": 0,
+ "columns": [
+ "assignee",
+ "internalNotes",
+ "updatedBy",
+ "updatedAt",
+ "createdAt",
+ "exchangeRate",
+ "customerLocationId",
+ "customFields",
+ "customerReference",
+ "customerId",
+ "expirationDate",
+ "status",
+ "companyId",
+ "createdBy",
+ "customerContactId",
+ "id",
+ "salesOrderId",
+ "currencyCode",
+ "locationId",
+ "replacementSalesOrderId",
+ "externalNotes",
+ "salesReturnOrderId",
+ "orderDate"
+ ]
+ },
{
"name": "salesRfq",
"rows": 0,
@@ -4171,7 +4285,10 @@
{
"name": "salesRfqFavorite",
"rows": 0,
- "columns": ["rfqId", "userId"]
+ "columns": [
+ "rfqId",
+ "userId"
+ ]
},
{
"name": "salesRfqLine",
@@ -4301,26 +4418,32 @@
"name": "fulfillment",
"rows": 0,
"columns": [
- "companyId",
- "updatedBy",
- "id",
- "createdBy",
"salesOrderLineId",
- "jobId",
- "createdAt",
+ "createdBy",
+ "id",
+ "updatedBy",
+ "companyId",
+ "quantity",
"type",
- "quantity"
+ "createdAt",
+ "jobId"
]
},
{
"name": "jobFavorite",
"rows": 0,
- "columns": ["jobId", "userId"]
+ "columns": [
+ "jobId",
+ "userId"
+ ]
},
{
"name": "quoteFavorite",
"rows": 0,
- "columns": ["userId", "quoteId"]
+ "columns": [
+ "userId",
+ "quoteId"
+ ]
},
{
"name": "quoteLine",
@@ -4440,55 +4563,55 @@
"name": "gauge",
"rows": 0,
"columns": [
- "updatedBy",
+ "gaugeRole",
+ "gaugeCalibrationStatus",
+ "id",
+ "description",
+ "lastCalibrationDate",
+ "gaugeId",
+ "storageUnitId",
+ "gaugeStatus",
+ "gaugeTypeId",
"serialNumber",
"calibrationIntervalInMonths",
"createdBy",
- "locationId",
+ "updatedBy",
"updatedAt",
+ "locationId",
"companyId",
- "supplierId",
- "nextCalibrationDate",
- "modelNumber",
"createdAt",
"customFields",
+ "nextCalibrationDate",
+ "supplierId",
+ "modelNumber",
"dateAcquired",
- "lastCalibrationStatus",
- "gaugeCalibrationStatus",
- "id",
- "gaugeRole",
- "description",
- "storageUnitId",
- "lastCalibrationDate",
- "gaugeId",
- "gaugeTypeId",
- "gaugeStatus"
+ "lastCalibrationStatus"
]
},
{
"name": "gaugeCalibrationRecord",
"rows": 0,
"columns": [
- "customFields",
+ "calibrationAttempts",
+ "createdBy",
+ "requiresAction",
+ "humidity",
+ "supplierId",
+ "inspectionStatus",
+ "updatedBy",
+ "dateCalibrated",
+ "approvedBy",
+ "measurementStandard",
+ "requiresRepair",
"id",
+ "customFields",
"createdAt",
"requiresAdjustment",
"temperature",
- "updatedAt",
"gaugeId",
+ "updatedAt",
"notes",
- "companyId",
- "requiresAction",
- "createdBy",
- "calibrationAttempts",
- "supplierId",
- "humidity",
- "dateCalibrated",
- "updatedBy",
- "inspectionStatus",
- "measurementStandard",
- "approvedBy",
- "requiresRepair"
+ "companyId"
]
},
{
@@ -4723,7 +4846,11 @@
{
"name": "jobMaterialStep",
"rows": 0,
- "columns": ["quantity", "jobOperationStepId", "jobMaterialId"]
+ "columns": [
+ "quantity",
+ "jobOperationStepId",
+ "jobMaterialId"
+ ]
},
{
"name": "jobOperation",
@@ -4785,26 +4912,26 @@
"name": "jobOperationDependency",
"rows": 0,
"columns": [
- "createdAt",
+ "dependsOnId",
+ "operationId",
"jobId",
"companyId",
- "operationId",
- "dependsOnId"
+ "createdAt"
]
},
{
"name": "jobOperationParameter",
"rows": 0,
"columns": [
- "operationId",
- "value",
- "createdBy",
- "companyId",
+ "updatedBy",
+ "id",
+ "createdAt",
"key",
"updatedAt",
- "id",
- "updatedBy",
- "createdAt"
+ "companyId",
+ "value",
+ "operationId",
+ "createdBy"
]
},
{
@@ -4826,16 +4953,16 @@
"name": "nonConformanceJobOperation",
"rows": 0,
"columns": [
- "createdAt",
- "jobOperationId",
- "jobId",
"jobReadableId",
- "updatedBy",
- "createdBy",
- "nonConformanceId",
- "companyId",
+ "jobId",
+ "jobOperationId",
+ "createdAt",
+ "id",
"updatedAt",
- "id"
+ "companyId",
+ "nonConformanceId",
+ "createdBy",
+ "updatedBy"
]
},
{
@@ -4920,15 +5047,15 @@
"name": "jobOperationNote",
"rows": 0,
"columns": [
- "createdAt",
- "updatedBy",
"companyId",
"note",
- "createdBy",
+ "updatedBy",
+ "createdAt",
+ "jobOperationId",
+ "updatedAt",
"id",
"productionQuantityId",
- "updatedAt",
- "jobOperationId"
+ "createdBy"
]
},
{
@@ -4952,44 +5079,44 @@
"name": "jobOperationStep",
"rows": 0,
"columns": [
- "updatedAt",
- "companyId",
- "name",
- "minValue",
- "listValues",
- "id",
- "maxValue",
- "fileTypes",
- "type",
- "required",
- "createdAt",
- "nonConformanceActionId",
- "description",
- "unitOfMeasureCode",
- "sortOrder",
"nonConformanceInvestigationId",
"operationId",
+ "sortOrder",
+ "updatedBy",
"assemblyInstructionStepId",
"createdBy",
- "updatedBy"
+ "description",
+ "nonConformanceActionId",
+ "required",
+ "createdAt",
+ "unitOfMeasureCode",
+ "fileTypes",
+ "id",
+ "maxValue",
+ "type",
+ "name",
+ "companyId",
+ "updatedAt",
+ "listValues",
+ "minValue"
]
},
{
"name": "jobOperationStepRecord",
"rows": 0,
"columns": [
- "userValue",
- "index",
- "booleanValue",
- "numericValue",
- "createdAt",
- "jobOperationStepId",
+ "createdBy",
+ "updatedBy",
+ "value",
+ "companyId",
"updatedAt",
+ "jobOperationStepId",
"id",
- "companyId",
- "value",
- "createdBy",
- "updatedBy"
+ "createdAt",
+ "numericValue",
+ "booleanValue",
+ "userValue",
+ "index"
]
},
{
@@ -5014,62 +5141,34 @@
{
"name": "jobOperationToolStep",
"rows": 0,
- "columns": ["jobOperationToolId", "jobOperationStepId"]
+ "columns": [
+ "jobOperationToolId",
+ "jobOperationStepId"
+ ]
},
{
"name": "kanban",
"rows": 0,
"columns": [
- "updatedBy",
- "completedBarcodeOverride",
+ "companyId",
+ "id",
+ "conversionFactor",
+ "storageUnitId",
+ "createdBy",
+ "itemId",
+ "autoStartJob",
+ "autoRelease",
+ "purchaseUnitOfMeasureCode",
"locationId",
"createdAt",
- "supplierId",
+ "updatedBy",
+ "completedBarcodeOverride",
"fromStorageUnitId",
"jobId",
- "replenishmentSystem",
- "updatedAt",
"quantity",
- "storageUnitId",
- "companyId",
- "conversionFactor",
- "id",
- "autoRelease",
- "purchaseUnitOfMeasureCode",
- "createdBy",
- "itemId",
- "autoStartJob"
- ]
- },
- {
- "name": "memo",
- "rows": 0,
- "columns": [
- "postedAt",
- "memoId",
- "reference",
- "postingDate",
- "exchangeRate",
"updatedAt",
- "currencyCode",
- "id",
- "amount",
- "supplierId",
- "customFields",
- "direction",
- "notes",
- "status",
- "voidedAt",
- "voidedBy",
- "memoDate",
- "updatedBy",
- "createdAt",
- "reasonAccount",
- "companyId",
- "customerId",
- "postedBy",
- "journalId",
- "createdBy"
+ "replenishmentSystem",
+ "supplierId"
]
},
{
@@ -5102,7 +5201,11 @@
{
"name": "methodMaterialStep",
"rows": 0,
- "columns": ["methodOperationStepId", "methodMaterialId", "quantity"]
+ "columns": [
+ "methodOperationStepId",
+ "methodMaterialId",
+ "quantity"
+ ]
},
{
"name": "methodOperation",
@@ -5143,39 +5246,39 @@
"name": "methodOperationParameter",
"rows": 0,
"columns": [
- "value",
- "operationId",
- "createdBy",
- "companyId",
"key",
"updatedAt",
- "updatedBy",
"id",
- "createdAt"
+ "updatedBy",
+ "createdAt",
+ "operationId",
+ "value",
+ "createdBy",
+ "companyId"
]
},
{
"name": "methodOperationStep",
"rows": 0,
"columns": [
- "sortOrder",
- "operationId",
- "createdBy",
- "updatedBy",
"assemblyInstructionStepId",
"description",
"createdAt",
"required",
"unitOfMeasureCode",
- "fileTypes",
- "maxValue",
- "id",
- "type",
+ "sortOrder",
+ "operationId",
+ "createdBy",
+ "updatedBy",
"companyId",
"name",
"updatedAt",
"listValues",
- "minValue"
+ "minValue",
+ "fileTypes",
+ "maxValue",
+ "id",
+ "type"
]
},
{
@@ -5215,7 +5318,10 @@
{
"name": "methodOperationToolStep",
"rows": 0,
- "columns": ["methodOperationToolId", "methodOperationStepId"]
+ "columns": [
+ "methodOperationToolId",
+ "methodOperationStepId"
+ ]
},
{
"name": "nonConformanceActionProcess",
@@ -5236,8 +5342,8 @@
"rows": 0,
"columns": [
"assignee",
- "status",
"updatedAt",
+ "status",
"supplierId",
"updatedBy",
"createdAt",
@@ -5249,8 +5355,41 @@
"actionTypeId",
"completedDate",
"companyId",
+ "sortOrder",
+ "id"
+ ]
+ },
+ {
+ "name": "nonConformancePurchaseReturnOrderLine",
+ "rows": 0,
+ "columns": [
+ "purchaseReturnOrderLineId",
+ "purchaseReturnOrderId",
+ "companyId",
+ "purchaseReturnOrderReadableId",
+ "nonConformanceId",
+ "updatedAt",
+ "createdAt",
+ "updatedBy",
+ "createdBy",
+ "id",
+ "quantity"
+ ]
+ },
+ {
+ "name": "nonConformanceSalesReturnOrderLine",
+ "rows": 0,
+ "columns": [
+ "salesReturnOrderReadableId",
+ "createdAt",
+ "salesReturnOrderId",
+ "salesReturnOrderLineId",
+ "companyId",
"id",
- "sortOrder"
+ "updatedAt",
+ "updatedBy",
+ "createdBy",
+ "nonConformanceId"
]
},
{
@@ -5320,23 +5459,29 @@
"name": "purchaseInvoiceDelivery",
"rows": 0,
"columns": [
- "companyId",
- "incotermLocation",
"customFields",
"id",
- "incoterm",
- "updatedAt",
+ "incotermLocation",
+ "companyId",
"locationId",
+ "updatedAt",
+ "incoterm",
"supplierShippingCost",
- "updatedBy",
"shippingMethodId",
- "shippingTermId"
+ "shippingTermId",
+ "updatedBy"
]
},
{
"name": "purchaseInvoiceStatusHistory",
"rows": 0,
- "columns": ["createdAt", "companyId", "invoiceId", "id", "status"]
+ "columns": [
+ "createdAt",
+ "companyId",
+ "invoiceId",
+ "id",
+ "status"
+ ]
},
{
"name": "purchaseOrderDelivery",
@@ -5367,7 +5512,10 @@
{
"name": "purchaseOrderFavorite",
"rows": 0,
- "columns": ["userId", "purchaseOrderId"]
+ "columns": [
+ "userId",
+ "purchaseOrderId"
+ ]
},
{
"name": "purchaseOrderLine",
@@ -5423,15 +5571,15 @@
"rows": 0,
"columns": [
"companyId",
- "id",
"updatedAt",
- "createdBy",
+ "id",
"updatedBy",
+ "createdBy",
"nonConformanceId",
"purchaseOrderReadableId",
"createdAt",
- "purchaseOrderId",
- "purchaseOrderLineId"
+ "purchaseOrderLineId",
+ "purchaseOrderId"
]
},
{
@@ -5459,6 +5607,20 @@
"type"
]
},
+ {
+ "name": "purchaseReturnOrderLineTrackedEntity",
+ "rows": 0,
+ "columns": [
+ "createdBy",
+ "updatedBy",
+ "companyId",
+ "quantity",
+ "createdAt",
+ "purchaseReturnOrderLineId",
+ "updatedAt",
+ "trackedEntityId"
+ ]
+ },
{
"name": "purchasingRfqSupplier",
"rows": 0,
@@ -5475,12 +5637,20 @@
{
"name": "purchasingRfqToPurchaseOrder",
"rows": 0,
- "columns": ["companyId", "purchasingRfqId", "purchaseOrderId"]
+ "columns": [
+ "companyId",
+ "purchasingRfqId",
+ "purchaseOrderId"
+ ]
},
{
"name": "purchasingRfqToSupplierQuote",
"rows": 0,
- "columns": ["companyId", "purchasingRfqId", "supplierQuoteId"]
+ "columns": [
+ "companyId",
+ "purchasingRfqId",
+ "supplierQuoteId"
+ ]
},
{
"name": "quoteMakeMethod",
@@ -5535,7 +5705,11 @@
{
"name": "quoteMaterialStep",
"rows": 0,
- "columns": ["quantity", "quoteOperationStepId", "quoteMaterialId"]
+ "columns": [
+ "quantity",
+ "quoteOperationStepId",
+ "quoteMaterialId"
+ ]
},
{
"name": "quoteOperation",
@@ -5581,38 +5755,38 @@
"name": "quoteOperationParameter",
"rows": 0,
"columns": [
- "updatedAt",
- "key",
"createdAt",
- "id",
"updatedBy",
+ "id",
+ "updatedAt",
+ "key",
+ "companyId",
"createdBy",
- "operationId",
"value",
- "companyId"
+ "operationId"
]
},
{
"name": "quoteOperationStep",
"rows": 0,
"columns": [
- "unitOfMeasureCode",
- "description",
- "required",
- "createdAt",
- "updatedBy",
- "createdBy",
- "operationId",
- "sortOrder",
+ "type",
+ "fileTypes",
+ "id",
+ "maxValue",
"listValues",
"minValue",
"name",
"companyId",
"updatedAt",
- "type",
- "fileTypes",
- "id",
- "maxValue"
+ "updatedBy",
+ "createdBy",
+ "operationId",
+ "sortOrder",
+ "unitOfMeasureCode",
+ "description",
+ "required",
+ "createdAt"
]
},
{
@@ -5652,7 +5826,10 @@
{
"name": "quoteOperationToolStep",
"rows": 0,
- "columns": ["quoteOperationStepId", "quoteOperationToolId"]
+ "columns": [
+ "quoteOperationStepId",
+ "quoteOperationToolId"
+ ]
},
{
"name": "receiptFixedAssetLine",
@@ -5699,138 +5876,170 @@
"name": "nonConformanceReceiptLine",
"rows": 0,
"columns": [
- "createdAt",
"receiptLineId",
"receiptId",
+ "createdAt",
"receiptReadableId",
- "createdBy",
- "updatedBy",
"nonConformanceId",
- "companyId",
+ "updatedBy",
+ "createdBy",
"updatedAt",
- "id"
+ "id",
+ "companyId"
]
},
{
"name": "salesInvoice",
"rows": 0,
"columns": [
+ "currencyCode",
+ "exchangeRate",
+ "companyId",
+ "totalDiscount",
+ "exchangeRateUpdatedAt",
+ "customerReference",
+ "createdAt",
+ "dateDue",
+ "opportunityId",
+ "invoiceCustomerLocationId",
+ "internalNotes",
+ "createdBy",
+ "customerId",
"locationId",
"status",
- "customerId",
"totalTax",
"totalAmount",
- "invoiceCustomerLocationId",
- "opportunityId",
- "internalNotes",
- "createdBy",
- "exchangeRateUpdatedAt",
- "customerReference",
- "dateDue",
- "createdAt",
- "exchangeRate",
- "currencyCode",
- "totalDiscount",
- "companyId",
- "subtotal",
- "datePaid",
- "invoiceId",
- "updatedBy",
- "externalNotes",
+ "invoiceCustomerId",
+ "assignee",
+ "id",
+ "paymentTermId",
+ "customFields",
+ "dateIssued",
"tags",
"invoiceCustomerContactId",
+ "externalNotes",
"shipmentId",
- "postingDate",
"updatedAt",
- "paymentTermId",
- "id",
- "dateIssued",
- "customFields",
- "invoiceCustomerId",
- "assignee"
+ "postingDate",
+ "subtotal",
+ "datePaid",
+ "invoiceId",
+ "updatedBy"
]
},
{
"name": "salesInvoiceLine",
"rows": 0,
"columns": [
- "methodType",
- "internalNotes",
- "id",
- "assetId",
+ "nonTaxableAddOnCost",
"opportunityId",
"unitOfMeasureCode",
- "nonTaxableAddOnCost",
- "customFields",
- "salesOrderLineId",
- "quantity",
- "createdBy",
- "externalNotes",
- "setupPrice",
+ "id",
+ "assetId",
+ "internalNotes",
+ "methodType",
+ "storageUnitId",
"updatedAt",
"invoiceId",
- "storageUnitId",
+ "setupPrice",
+ "externalNotes",
+ "createdBy",
+ "quantity",
+ "customFields",
+ "salesOrderLineId",
+ "itemId",
+ "companyId",
+ "locationId",
+ "unitPrice",
"modelUploadId",
"addOnCost",
- "unitPrice",
- "locationId",
- "companyId",
- "itemId",
- "salesOrderId",
- "accountId",
- "updatedBy",
- "createdAt",
+ "taxPercent",
+ "sortOrder",
+ "shippingCost",
"description",
"invoiceLineType",
"exchangeRate",
- "shippingCost",
- "sortOrder",
- "taxPercent"
+ "createdAt",
+ "accountId",
+ "updatedBy",
+ "salesOrderId"
]
},
{
"name": "salesInvoiceShipment",
"rows": 0,
"columns": [
- "companyId",
+ "shippingCost",
+ "incotermLocation",
+ "createdAt",
+ "updatedAt",
+ "createdBy",
+ "id",
+ "updatedBy",
+ "customFields",
"locationId",
"shippingMethodId",
+ "companyId",
"incoterm",
- "shippingTermId",
+ "shippingTermId"
+ ]
+ },
+ {
+ "name": "salesReturnOrderLine",
+ "rows": 0,
+ "columns": [
+ "salesInvoiceLineId",
+ "salesReturnOrderId",
+ "companyId",
+ "returnReasonId",
+ "unitPrice",
+ "salesOrderLineId",
+ "id",
+ "restockFeePercent",
+ "quantityReceived",
+ "updatedBy",
"createdAt",
+ "itemId",
+ "disposition",
+ "lineNumber",
+ "unitOfMeasureCode",
+ "quantity",
"updatedAt",
- "shippingCost",
- "incotermLocation",
+ "shipmentLineId",
+ "closedComplete",
"customFields",
- "createdBy",
- "id",
- "updatedBy"
+ "createdBy"
]
},
{
- "name": "invoiceSettlement",
+ "name": "salesReturnOrderLineTrackedEntity",
"rows": 0,
"columns": [
- "targetExchangeRate",
- "id",
- "writeOffAmount",
- "targetMemoId",
- "appliedDate",
- "paymentId",
+ "updatedAt",
+ "trackedEntityId",
"createdAt",
- "sourceExchangeRate",
- "discountAmount",
- "targetPurchaseInvoiceId",
- "sourceAmount",
- "fxGainLossAmount",
+ "salesReturnOrderLineId",
+ "updatedBy",
+ "companyId",
+ "quantity",
+ "createdBy"
+ ]
+ },
+ {
+ "name": "salesReturnOrderCreditLine",
+ "rows": 0,
+ "columns": [
+ "companyId",
+ "salesReturnOrderLineId",
+ "quantity",
+ "unitPrice",
"createdBy",
- "appliedViaPaymentId",
- "sourcePaymentId",
"updatedBy",
- "targetSalesInvoiceId",
"memoId",
- "companyId",
- "appliedAmount"
+ "restockFee",
+ "createdAt",
+ "id",
+ "updatedAt"
]
},
{
@@ -5853,41 +6062,41 @@
"name": "shipmentLine",
"rows": 0,
"columns": [
- "shippedQuantity",
- "storageUnitId",
- "createdAt",
- "requiresSerialTracking",
- "shipmentId",
- "orderQuantity",
- "locationId",
- "id",
- "unitOfMeasure",
- "outstandingQuantity",
+ "fulfillmentId",
+ "unitPrice",
+ "companyId",
+ "createdBy",
+ "itemId",
"requiresBatchTracking",
"lineId",
- "itemId",
"updatedBy",
"updatedAt",
- "companyId",
- "createdBy",
- "unitPrice",
- "fulfillmentId"
+ "outstandingQuantity",
+ "id",
+ "locationId",
+ "unitOfMeasure",
+ "orderQuantity",
+ "createdAt",
+ "requiresSerialTracking",
+ "shipmentId",
+ "shippedQuantity",
+ "storageUnitId"
]
},
{
"name": "nonConformanceShipmentLine",
"rows": 0,
"columns": [
- "createdBy",
- "updatedBy",
- "nonConformanceId",
- "companyId",
- "id",
- "updatedAt",
- "createdAt",
- "shipmentId",
+ "shipmentReadableId",
"shipmentLineId",
- "shipmentReadableId"
+ "shipmentId",
+ "createdAt",
+ "updatedAt",
+ "id",
+ "companyId",
+ "nonConformanceId",
+ "updatedBy",
+ "createdBy"
]
},
{
@@ -5923,12 +6132,21 @@
{
"name": "supplierAccount",
"rows": 0,
- "columns": ["active", "companyId", "id", "supplierId"]
+ "columns": [
+ "active",
+ "companyId",
+ "id",
+ "supplierId"
+ ]
},
{
"name": "supplierInteraction",
"rows": 0,
- "columns": ["supplierId", "id", "companyId"]
+ "columns": [
+ "supplierId",
+ "id",
+ "companyId"
+ ]
},
{
"name": "receipt",
@@ -5962,33 +6180,33 @@
"name": "shipment",
"rows": 0,
"columns": [
- "customerId",
- "id",
- "postingDate",
- "externalDocumentId",
- "sourceDocumentReadableId",
- "supplierId",
- "externalNotes",
- "invoiced",
- "shipmentId",
- "trackingNumber",
- "customFields",
- "status",
- "updatedBy",
- "sourceDocumentId",
- "postedBy",
- "createdBy",
- "internalNotes",
- "updatedAt",
- "opportunityId",
- "supplierInteractionId",
+ "shippingMethodId",
+ "tags",
"locationId",
"assignee",
"sourceDocument",
- "createdAt",
"companyId",
- "shippingMethodId",
- "tags"
+ "createdAt",
+ "opportunityId",
+ "supplierInteractionId",
+ "internalNotes",
+ "updatedAt",
+ "updatedBy",
+ "postedBy",
+ "createdBy",
+ "sourceDocumentId",
+ "trackingNumber",
+ "status",
+ "customFields",
+ "externalNotes",
+ "shipmentId",
+ "invoiced",
+ "sourceDocumentReadableId",
+ "supplierId",
+ "customerId",
+ "id",
+ "postingDate",
+ "externalDocumentId"
]
},
{
@@ -6178,6 +6396,137 @@
"paymentComplete"
]
},
+ {
+ "name": "purchaseReturnOrder",
+ "rows": 0,
+ "columns": [
+ "currencyCode",
+ "id",
+ "purchaseOrderId",
+ "supplierContactId",
+ "purchaseReturnOrderId",
+ "orderDate",
+ "externalNotes",
+ "replacementPurchaseOrderId",
+ "locationId",
+ "createdAt",
+ "exchangeRate",
+ "supplierLocationId",
+ "updatedAt",
+ "assignee",
+ "internalNotes",
+ "updatedBy",
+ "companyId",
+ "createdBy",
+ "supplierId",
+ "expirationDate",
+ "status",
+ "customFields",
+ "supplierReference"
+ ]
+ },
+ {
+ "name": "memo",
+ "rows": 0,
+ "columns": [
+ "postedAt",
+ "memoId",
+ "reference",
+ "postingDate",
+ "exchangeRate",
+ "updatedAt",
+ "currencyCode",
+ "id",
+ "amount",
+ "purchaseReturnOrderId",
+ "supplierId",
+ "customFields",
+ "direction",
+ "notes",
+ "status",
+ "voidedAt",
+ "voidedBy",
+ "memoDate",
+ "updatedBy",
+ "createdAt",
+ "reasonAccount",
+ "companyId",
+ "customerId",
+ "postedBy",
+ "salesReturnOrderId",
+ "journalId",
+ "createdBy"
+ ]
+ },
+ {
+ "name": "invoiceSettlement",
+ "rows": 0,
+ "columns": [
+ "targetExchangeRate",
+ "id",
+ "writeOffAmount",
+ "targetMemoId",
+ "appliedDate",
+ "paymentId",
+ "createdAt",
+ "sourceExchangeRate",
+ "discountAmount",
+ "targetPurchaseInvoiceId",
+ "sourceAmount",
+ "fxGainLossAmount",
+ "createdBy",
+ "appliedViaPaymentId",
+ "sourcePaymentId",
+ "updatedBy",
+ "targetSalesInvoiceId",
+ "memoId",
+ "companyId",
+ "appliedAmount"
+ ]
+ },
+ {
+ "name": "purchaseReturnOrderLine",
+ "rows": 0,
+ "columns": [
+ "companyId",
+ "createdAt",
+ "quantity",
+ "customFields",
+ "receiptLineId",
+ "unitOfMeasureCode",
+ "updatedAt",
+ "updatedBy",
+ "itemId",
+ "lineNumber",
+ "closedComplete",
+ "quantityShipped",
+ "purchaseOrderLineId",
+ "id",
+ "restockFeePercent",
+ "returnReasonId",
+ "unitPrice",
+ "purchaseInvoiceLineId",
+ "purchaseReturnOrderId",
+ "createdBy"
+ ]
+ },
+ {
+ "name": "purchaseReturnOrderCreditLine",
+ "rows": 0,
+ "columns": [
+ "unitPrice",
+ "quantity",
+ "purchaseReturnOrderLineId",
+ "companyId",
+ "id",
+ "createdAt",
+ "updatedAt",
+ "restockFee",
+ "memoId",
+ "createdBy",
+ "updatedBy"
+ ]
+ },
{
"name": "supplierPart",
"rows": 0,
@@ -6287,7 +6636,10 @@
{
"name": "supplierQuoteFavorite",
"rows": 0,
- "columns": ["userId", "supplierQuoteId"]
+ "columns": [
+ "userId",
+ "supplierQuoteId"
+ ]
},
{
"name": "supplierQuoteLine",