Batch numbers in inventory logs

BatchNumberInventoryLog — Returns a single batch number inventory log based on the id provided

query GetBatchNumberInventoryLog($id: ID) {
  BatchNumberInventoryLog(id: $id) {
    id
    on_hand
    inventory_log { id }
    batch_number { id }
  }
}
{
  "id": 100012
}

BatchNumberInventoryLogs — Returns a list of batch number inventory logs with grouping, filters, and ordering

query BatchNumberInventoryLogs(
  $groupBy: QueryBatchNumberInventoryLogsGroupByGroupByClause,
  $where: QueryBatchNumberInventoryLogsWhereWhereConditions,
  $orderBy: [QueryBatchNumberInventoryLogsOrderByOrderByClause!]
) {
  BatchNumberInventoryLogs(
    groupBy: $groupBy
    where: $where
    orderBy: $orderBy
  ) {
    id
    on_hand
    inventory_log { id }
    batch_number { id }
  }
}
{
  "groupBy": {
    "HAVING": [
      { "column": "ID", "value": 100012 }
    ]
  },
  "where": {
    "AND": [
      { "column": "BATCH_NUMBER_ID", "operator": "EQ", "value": 100010 }
    ]
  },
  "orderBy": [
    { "column": "ON_HAND", "order": "DESC" }
  ]
}

Available fields

FieldTypeDescription
idIntUnique identifier of the batch number inventory log.
on_handFloatQuantity on hand for this batch number in the inventory log.
inventory_logObjectLinked inventory log entity.
batch_numberObjectLinked batch number entity.

Filters

You can create filters based on following fields

id - Int
Example: { "column": "ID", "operator": "EQ", "value": 100012 }
on_hand - Float
Example: { "column": "ON_HAND", "operator": "GT", "value": 50 }
inventory_log_id - ID
Example: { "column": "INVENTORY_LOG_ID", "operator": "EQ", "value": 100001 }
batch_number_id - ID
Example: { "column": "BATCH_NUMBER_ID", "operator": "EQ", "value": 100010 }

Sorting

You can sort data based on following fields: id, on_hand, inventory_log_id, batch_number_id

query SortBatchNumberInventoryLogs(
  $where: QueryBatchNumberInventoryLogsWhereWhereConditions
) {
  BatchNumberInventoryLogs(
    where: $where
    orderBy: [{ column: ON_HAND, order: DESC }]
  ) {
    id
    on_hand
    inventory_log { id }
    batch_number { id }
  }
}

Example of data returned

{
  "data": {
    "BatchNumberInventoryLogs": [
      {
        "id": 100001,
        "on_hand": 150.5,
        "inventory_log": { "id": 100001 },
        "batch_number": { "id": 100010 }
      },
      {
        "id": 100002,
        "on_hand": 75.0,
        "inventory_log": { "id": 100002 },
        "batch_number": { "id": 100011 }
      }
    ]
  }
}