2020-08-10 09:19:26 -07:00
|
|
|
import {
|
|
|
|
INodeProperties,
|
|
|
|
} from 'n8n-workflow';
|
|
|
|
|
2021-12-03 00:44:16 -08:00
|
|
|
export const stockOnHandOperations: INodeProperties[] = [
|
2020-08-10 09:19:26 -07:00
|
|
|
{
|
|
|
|
displayName: 'Operation',
|
|
|
|
name: 'operation',
|
|
|
|
type: 'options',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'stockOnHand',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: 'Get',
|
|
|
|
value: 'get',
|
|
|
|
description: 'Get a stock on hand',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Get All',
|
|
|
|
value: 'getAll',
|
|
|
|
description: 'Get all stocks on hand',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
default: 'getAll',
|
|
|
|
description: 'The operation to perform.',
|
|
|
|
},
|
2021-12-03 00:44:16 -08:00
|
|
|
];
|
2020-08-10 09:19:26 -07:00
|
|
|
|
2021-12-03 00:44:16 -08:00
|
|
|
export const stockOnHandFields: INodeProperties[] = [
|
2020-08-10 09:19:26 -07:00
|
|
|
|
2020-08-10 09:19:56 -07:00
|
|
|
/* ------------------------------------------------------------------------- */
|
|
|
|
/* stockOnHand:get */
|
|
|
|
/* ------------------------------------------------------------------------- */
|
2020-08-10 09:19:26 -07:00
|
|
|
{
|
|
|
|
displayName: 'Product ID',
|
|
|
|
name: 'productId',
|
|
|
|
type: 'string',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
operation: [
|
|
|
|
'get',
|
|
|
|
],
|
|
|
|
resource: [
|
|
|
|
'stockOnHand',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
default: '',
|
|
|
|
},
|
2020-08-10 09:19:56 -07:00
|
|
|
/* ------------------------------------------------------------------------- */
|
|
|
|
/* stockOnHand:getAll */
|
|
|
|
/* ------------------------------------------------------------------------- */
|
2020-08-10 09:19:26 -07:00
|
|
|
{
|
|
|
|
displayName: 'Return All',
|
|
|
|
name: 'returnAll',
|
|
|
|
type: 'boolean',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
operation: [
|
|
|
|
'getAll',
|
|
|
|
],
|
|
|
|
resource: [
|
|
|
|
'stockOnHand',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
default: false,
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Whether to return all results or only up to a given limit',
|
2020-08-10 09:19:26 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Limit',
|
|
|
|
name: 'limit',
|
|
|
|
type: 'number',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
operation: [
|
|
|
|
'getAll',
|
|
|
|
],
|
|
|
|
resource: [
|
|
|
|
'stockOnHand',
|
|
|
|
],
|
|
|
|
returnAll: [
|
|
|
|
false,
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
typeOptions: {
|
|
|
|
minValue: 1,
|
|
|
|
maxValue: 1000,
|
|
|
|
},
|
|
|
|
default: 100,
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Max number of results to return',
|
2020-08-10 09:19:26 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Filters',
|
|
|
|
name: 'filters',
|
|
|
|
type: 'collection',
|
|
|
|
placeholder: 'Add Filter',
|
|
|
|
default: {},
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
operation: [
|
|
|
|
'getAll',
|
|
|
|
],
|
|
|
|
resource: [
|
|
|
|
'stockOnHand',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
displayName: 'As at Date',
|
|
|
|
name: 'asAtDate',
|
|
|
|
type: 'dateTime',
|
|
|
|
default: '',
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Returns the stock on hand for a specific date',
|
2020-08-10 09:19:26 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Is Assembled',
|
|
|
|
name: 'IsAssembled',
|
|
|
|
type: 'boolean',
|
2022-04-22 09:29:51 -07:00
|
|
|
default: false,
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'If set to True, the AvailableQty will also include the quantity that can be assembled',
|
2020-08-10 09:19:26 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Modified Since',
|
|
|
|
name: 'modifiedSince',
|
|
|
|
type: 'dateTime',
|
|
|
|
default: '',
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Returns stock on hand values modified after a specific date',
|
2020-08-10 09:19:26 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Order By',
|
|
|
|
name: 'orderBy',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Orders the list by a specific column, by default the list is ordered by productCode',
|
2020-08-10 09:19:26 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Product ID',
|
|
|
|
name: 'productId',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Returns products with the specific Product Guid. You can enter multiple product IDs separated by commas.',
|
2020-08-10 09:19:26 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Warehouse Code',
|
|
|
|
name: 'warehouseCode',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Returns stock on hand for a specific warehouse code',
|
2020-08-10 09:19:26 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Warehouse Name',
|
|
|
|
name: 'warehouseName',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Returns stock on hand for a specific warehouse name',
|
2020-08-10 09:19:26 -07:00
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
2021-12-03 00:44:16 -08:00
|
|
|
];
|