2022-08-17 08:50:24 -07:00
|
|
|
import { INodeProperties } from 'n8n-workflow';
|
2020-08-10 09:19:26 -07:00
|
|
|
|
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',
|
2022-05-20 14:47:24 -07:00
|
|
|
noDataExpression: true,
|
2020-08-10 09:19:26 -07:00
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['stockOnHand'],
|
2020-08-10 09:19:26 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: 'Get',
|
|
|
|
value: 'get',
|
|
|
|
description: 'Get a stock on hand',
|
2022-07-10 13:50:51 -07:00
|
|
|
action: 'Get a stock on hand',
|
2020-08-10 09:19:26 -07:00
|
|
|
},
|
|
|
|
{
|
2022-09-07 07:51:14 -07:00
|
|
|
name: 'Get Many',
|
2020-08-10 09:19:26 -07:00
|
|
|
value: 'getAll',
|
|
|
|
description: 'Get all stocks on hand',
|
2022-09-08 08:10:13 -07:00
|
|
|
action: 'Get many stocks on hand',
|
2020-08-10 09:19:26 -07:00
|
|
|
},
|
|
|
|
],
|
|
|
|
default: 'getAll',
|
|
|
|
},
|
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:56 -07:00
|
|
|
/* ------------------------------------------------------------------------- */
|
|
|
|
/* stockOnHand:get */
|
|
|
|
/* ------------------------------------------------------------------------- */
|
2020-08-10 09:19:26 -07:00
|
|
|
{
|
|
|
|
displayName: 'Product ID',
|
|
|
|
name: 'productId',
|
|
|
|
type: 'string',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
operation: ['get'],
|
|
|
|
resource: ['stockOnHand'],
|
2020-08-10 09:19:26 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
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: {
|
2022-08-17 08:50:24 -07:00
|
|
|
operation: ['getAll'],
|
|
|
|
resource: ['stockOnHand'],
|
2020-08-10 09:19:26 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
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: {
|
2022-08-17 08:50:24 -07:00
|
|
|
operation: ['getAll'],
|
|
|
|
resource: ['stockOnHand'],
|
|
|
|
returnAll: [false],
|
2020-08-10 09:19:26 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
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: {
|
2022-08-17 08:50:24 -07:00
|
|
|
operation: ['getAll'],
|
|
|
|
resource: ['stockOnHand'],
|
2020-08-10 09:19:26 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
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-08-17 08:50:24 -07:00
|
|
|
description:
|
|
|
|
'Whether 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-08-17 08:50:24 -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-08-17 08:50:24 -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
|
|
|
];
|