UNPKG

n8n-nodes-alegra-unofficial

Version:

Unofficial Alegra node for n8n - Community integration with Alegra's accounting platform. NOT OFFICIALLY SUPPORTED BY ALEGRA.

714 lines 21.4 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.invoiceOperations = void 0; exports.invoiceOperations = [ { displayName: 'Operation', name: 'operation', type: 'options', noDataExpression: true, displayOptions: { show: { resource: ['invoice'], }, }, options: [ { name: 'Create', value: 'create', description: 'Create a new invoice', action: 'Create an invoice', }, { name: 'Delete', value: 'delete', description: 'Delete an invoice', action: 'Delete an invoice', }, { name: 'Get', value: 'get', description: 'Get an invoice by ID', action: 'Get an invoice', }, { name: 'Get Many', value: 'getAll', description: 'Get many invoices', action: 'Get many invoices', }, { name: 'Send by Email', value: 'sendEmail', description: 'Send invoice by email', action: 'Send invoice by email', }, { name: 'Update', value: 'update', description: 'Update an invoice', action: 'Update an invoice', }, ], default: 'create', }, // Create Invoice { displayName: 'Date', name: 'date', type: 'dateTime', required: true, default: '', displayOptions: { show: { resource: ['invoice'], operation: ['create'], }, }, description: 'Invoice date (YYYY-MM-DD)', }, { displayName: 'Due Date', name: 'dueDate', type: 'dateTime', required: true, default: '', displayOptions: { show: { resource: ['invoice'], operation: ['create'], }, }, description: 'Invoice due date (YYYY-MM-DD)', }, { displayName: 'Client Name or ID', name: 'client', type: 'options', typeOptions: { loadOptionsMethod: 'getContacts', loadOptionsDependsOn: ['resource'], }, required: true, default: '', displayOptions: { show: { resource: ['invoice'], operation: ['create'], }, }, description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>', }, { displayName: 'Payment Form', name: 'paymentForm', type: 'options', required: true, options: [ { name: 'Cash', value: 'CASH', }, { name: 'Credit', value: 'CREDIT', }, ], default: 'CASH', displayOptions: { show: { resource: ['invoice'], operation: ['create'], }, }, description: 'Payment form (required for Colombia)', }, { displayName: 'Payment Method', name: 'paymentMethod', type: 'options', required: true, options: [ { name: 'Cash', value: 'CASH', }, { name: 'Bank Transfer', value: 'BANK_TRANSFER', }, { name: 'Credit Card', value: 'CREDIT_CARD', }, { name: 'Debit Card', value: 'DEBIT_CARD', }, { name: 'Check', value: 'CHECK', }, { name: 'Other', value: 'OTHER', }, ], default: 'CASH', displayOptions: { show: { resource: ['invoice'], operation: ['create'], }, }, description: 'Payment method (required for Colombia)', }, { displayName: 'Generate Electronic Invoice', name: 'generateStamp', type: 'boolean', default: true, displayOptions: { show: { resource: ['invoice'], operation: ['create'], }, }, description: 'Whether to generate electronic invoice (stamp)', }, { displayName: 'Items', name: 'items', type: 'fixedCollection', typeOptions: { multipleValues: true, }, required: true, default: {}, displayOptions: { show: { resource: ['invoice'], operation: ['create'], }, }, placeholder: 'Add Item', options: [ { name: 'item', displayName: 'Item', values: [ { displayName: 'Item Name or ID', name: 'id', type: 'options', typeOptions: { loadOptionsMethod: 'getItems', }, required: true, default: '', description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>', }, { displayName: 'Price', name: 'price', type: 'number', typeOptions: { numberPrecision: 2, }, required: true, default: 0, description: 'Unit price', }, { displayName: 'Quantity', name: 'quantity', type: 'number', required: true, default: 1, description: 'Quantity', }, { displayName: 'Description', name: 'description', type: 'string', required: true, default: '', description: 'Item description (required for Colombia)', }, { displayName: 'Discount', name: 'discount', type: 'number', typeOptions: { numberPrecision: 2, }, default: 0, description: 'Discount percentage (0-100)', }, { displayName: 'Tax Name or ID', name: 'tax', type: 'multiOptions', typeOptions: { loadOptionsMethod: 'getTaxes', }, default: [], description: 'Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>', }, ], }, ], }, { displayName: 'Additional Fields', name: 'additionalFields', type: 'collection', placeholder: 'Add Field', default: {}, displayOptions: { show: { resource: ['invoice'], operation: ['create'], }, }, options: [ { displayName: 'Seller Name or ID', name: 'seller', type: 'options', typeOptions: { loadOptionsMethod: 'getSellers', }, default: '', description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>', }, { displayName: 'Observations', name: 'observations', type: 'string', typeOptions: { rows: 4, }, default: '', description: 'Internal observations', }, { displayName: 'Anotation', name: 'anotation', type: 'string', typeOptions: { rows: 4, }, default: '', description: 'Notes to print on the invoice', }, { displayName: 'Terms and Conditions', name: 'termsConditions', type: 'string', typeOptions: { rows: 4, }, default: '', description: 'Terms and conditions', }, { displayName: 'Number Template Name or ID', name: 'numberTemplate', type: 'options', typeOptions: { loadOptionsMethod: 'getNumberTemplates', }, default: '', description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>', }, { displayName: 'Cost Center Name or ID', name: 'costCenter', type: 'options', typeOptions: { loadOptionsMethod: 'getCostCenters', }, default: '', description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>', }, { displayName: 'Currency', name: 'currency', type: 'options', options: [ { name: 'COP - Colombian Peso', value: 'COP', }, { name: 'USD - US Dollar', value: 'USD', }, { name: 'EUR - Euro', value: 'EUR', }, { name: 'MXN - Mexican Peso', value: 'MXN', }, { name: 'ARS - Argentine Peso', value: 'ARS', }, { name: 'PEN - Peruvian Sol', value: 'PEN', }, { name: 'CLP - Chilean Peso', value: 'CLP', }, ], default: 'COP', description: 'Invoice currency', }, { displayName: 'Exchange Rate', name: 'exchangeRate', type: 'number', typeOptions: { numberPrecision: 4, }, default: 1, description: 'Exchange rate to local currency', }, { displayName: 'Invoice Type', name: 'type', type: 'options', options: [ { name: 'National', value: 'NATIONAL', }, { name: 'Export', value: 'EXPORT', }, { name: 'Contingency', value: 'CONTINGENCY', }, ], default: 'NATIONAL', description: 'Type of invoice', }, { displayName: 'Retentions', name: 'retentions', type: 'multiOptions', typeOptions: { loadOptionsMethod: 'getRetentions', }, default: [], description: 'Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>', }, ], }, // Get Invoice { displayName: 'Invoice ID', name: 'id', type: 'string', required: true, default: '', displayOptions: { show: { resource: ['invoice'], operation: ['get', 'delete'], }, }, description: 'The ID of the invoice', }, // Get All Invoices { displayName: 'Return All', name: 'returnAll', type: 'boolean', displayOptions: { show: { resource: ['invoice'], operation: ['getAll'], }, }, default: false, description: 'Whether to return all results or only up to a given limit', }, { displayName: 'Limit', name: 'limit', type: 'number', displayOptions: { show: { resource: ['invoice'], operation: ['getAll'], returnAll: [false], }, }, typeOptions: { minValue: 1, maxValue: 100, }, default: 30, description: 'Max number of results to return', }, { displayName: 'Filters', name: 'filters', type: 'collection', placeholder: 'Add Filter', default: {}, displayOptions: { show: { resource: ['invoice'], operation: ['getAll'], }, }, options: [ { displayName: 'Start Date', name: 'start', type: 'dateTime', default: '', description: 'Filter invoices from this date', }, { displayName: 'End Date', name: 'end', type: 'dateTime', default: '', description: 'Filter invoices until this date', }, { displayName: 'Status', name: 'status', type: 'options', options: [ { name: 'Draft', value: 'draft', }, { name: 'Open', value: 'open', }, { name: 'Closed', value: 'closed', }, { name: 'Void', value: 'void', }, ], default: '', description: 'Filter by invoice status', }, { displayName: 'Client Name or ID', name: 'client', type: 'options', typeOptions: { loadOptionsMethod: 'getContacts', }, default: '', description: 'Filter by client. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.', }, { displayName: 'Order By', name: 'orderBy', type: 'options', options: [ { name: 'Date', value: 'date', }, { name: 'ID', value: 'id', }, { name: 'Number', value: 'number', }, ], default: 'date', description: 'Field to order results by', }, { displayName: 'Order Direction', name: 'orderDirection', type: 'options', options: [ { name: 'Ascending', value: 'ASC', }, { name: 'Descending', value: 'DESC', }, ], default: 'DESC', description: 'Order direction', }, ], }, // Send Email { displayName: 'Invoice ID', name: 'id', type: 'string', required: true, default: '', displayOptions: { show: { resource: ['invoice'], operation: ['sendEmail'], }, }, description: 'The ID of the invoice to send', }, { displayName: 'Emails', name: 'emails', type: 'string', typeOptions: { multipleValues: true, }, required: true, default: [], displayOptions: { show: { resource: ['invoice'], operation: ['sendEmail'], }, }, description: 'Email addresses to send the invoice to', }, { displayName: 'Send Copy to User', name: 'sendCopyToUser', type: 'boolean', default: false, displayOptions: { show: { resource: ['invoice'], operation: ['sendEmail'], }, }, description: 'Whether to send a copy to the user', }, { displayName: 'Invoice Type', name: 'invoiceType', type: 'options', options: [ { name: 'Original', value: 'original', }, { name: 'Copy', value: 'copy', }, ], default: 'copy', displayOptions: { show: { resource: ['invoice'], operation: ['sendEmail'], }, }, description: 'Type of invoice to send', }, // Update Invoice { displayName: 'Invoice ID', name: 'id', type: 'string', required: true, default: '', displayOptions: { show: { resource: ['invoice'], operation: ['update'], }, }, description: 'The ID of the invoice to update', }, { displayName: 'Update Fields', name: 'updateFields', type: 'collection', placeholder: 'Add Field', default: {}, displayOptions: { show: { resource: ['invoice'], operation: ['update'], }, }, options: [ { displayName: 'Date', name: 'date', type: 'dateTime', default: '', description: 'Invoice date (YYYY-MM-DD)', }, { displayName: 'Due Date', name: 'dueDate', type: 'dateTime', default: '', description: 'Invoice due date (YYYY-MM-DD)', }, { displayName: 'Observations', name: 'observations', type: 'string', typeOptions: { rows: 4, }, default: '', description: 'Internal observations', }, { displayName: 'Anotation', name: 'anotation', type: 'string', typeOptions: { rows: 4, }, default: '', description: 'Notes to print on the invoice', }, { displayName: 'Status', name: 'status', type: 'options', options: [ { name: 'Draft', value: 'draft', }, { name: 'Open', value: 'open', }, ], default: '', description: 'Invoice status', }, ], }, ]; //# sourceMappingURL=invoice.operations.js.map