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,
|
|
|
|
description: 'If all results should be returned or only up to a given limit.',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Limit',
|
|
|
|
name: 'limit',
|
|
|
|
type: 'number',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
operation: [
|
|
|
|
'getAll',
|
|
|
|
],
|
|
|
|
resource: [
|
|
|
|
'stockOnHand',
|
|
|
|
],
|
|
|
|
returnAll: [
|
|
|
|
false,
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
typeOptions: {
|
|
|
|
minValue: 1,
|
|
|
|
maxValue: 1000,
|
|
|
|
},
|
|
|
|
default: 100,
|
|
|
|
description: 'How many results to return.',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
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: '',
|
2020-08-10 09:19:56 -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',
|
|
|
|
default: '',
|
2020-08-10 09:19:56 -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: '',
|
2020-08-10 09:19:56 -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: '',
|
2020-08-10 09:19:56 -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: '',
|
2020-08-10 09:19:56 -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: '',
|
2020-08-10 09:19:56 -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: '',
|
2020-08-10 09:19:56 -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
|
|
|
];
|