Skip to content

Commit

Permalink
fix(Invoice Ninja Node): Fix payment types (#10462)
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeShakingSheep authored Aug 19, 2024
1 parent ab9faf1 commit 129245d
Show file tree
Hide file tree
Showing 2 changed files with 157 additions and 20 deletions.
138 changes: 128 additions & 10 deletions packages/nodes-base/nodes/InvoiceNinja/ExpenseDescription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export const expenseFields: INodeProperties[] = [
default: {},
displayOptions: {
show: {
apiVersion: ['v4'],
operation: ['create'],
resource: ['expense'],
},
Expand Down Expand Up @@ -120,11 +121,6 @@ export const expenseFields: INodeProperties[] = [
displayName: 'Payment Type',
name: 'paymentType',
type: 'options',
displayOptions: {
show: {
apiVersion: ['v4'],
},
},
options: [
{
name: 'ACH',
Expand Down Expand Up @@ -257,15 +253,137 @@ export const expenseFields: INodeProperties[] = [
],
default: 1,
},
{
displayName: 'Private Notes',
name: 'privateNotes',
type: 'string',
default: '',
},
{
displayName: 'Public Notes',
name: 'publicNotes',
type: 'string',
default: '',
},
{
displayName: 'Tax Name 1',
name: 'taxName1',
type: 'string',
default: '',
},
{
displayName: 'Tax Name 2',
name: 'taxName2',
type: 'string',
default: '',
},
{
displayName: 'Tax Rate 1',
name: 'taxRate1',
type: 'number',
default: 0,
},
{
displayName: 'Tax Rate 2',
name: 'taxRate2',
type: 'number',
default: 0,
},
{
displayName: 'Transaction Reference',
name: 'transactionReference',
type: 'string',
default: '',
},
{
displayName: 'Vendor Name or ID',
name: 'vendor',
type: 'options',
description:
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
typeOptions: {
loadOptionsMethod: 'getVendors',
},
default: '',
},
],
},
{
displayName: 'Additional Fields',
name: 'additionalFields',
type: 'collection',
placeholder: 'Add Field',
default: {},
displayOptions: {
show: {
apiVersion: ['v5'],
operation: ['create'],
resource: ['expense'],
},
},
options: [
{
displayName: 'Amount',
name: 'amount',
type: 'number',
default: 0,
},
{
displayName: 'Billable',
name: 'billable',
type: 'boolean',
default: false,
},
{
displayName: 'Client Name or ID',
name: 'client',
type: 'options',
description:
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
typeOptions: {
loadOptionsMethod: 'getClients',
},
default: '',
},
{
displayName: 'Custom Value 1',
name: 'customValue1',
type: 'string',
default: '',
},
{
displayName: 'Custom Value 2',
name: 'customValue2',
type: 'string',
default: '',
},
{
displayName: 'Category Name or ID',
name: 'category',
type: 'options',
description:
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
typeOptions: {
loadOptionsMethod: 'getExpenseCategories',
},
default: '',
},
{
displayName: 'Expense Date',
name: 'expenseDate',
type: 'dateTime',
default: '',
},
{
displayName: 'Payment Date',
name: 'paymentDate',
type: 'dateTime',
default: '',
},
{
displayName: 'Payment Type',
name: 'paymentType',
type: 'options',
displayOptions: {
show: {
apiVersion: ['v5'],
},
},
options: [
{
name: 'Bank Transfer',
Expand Down
39 changes: 29 additions & 10 deletions packages/nodes-base/nodes/InvoiceNinja/PaymentDescription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ export const paymentFields: INodeProperties[] = [
default: {},
displayOptions: {
show: {
apiVersion: ['v4'],
operation: ['create'],
resource: ['payment'],
},
Expand All @@ -94,11 +95,6 @@ export const paymentFields: INodeProperties[] = [
displayName: 'Payment Type',
name: 'paymentType',
type: 'options',
displayOptions: {
show: {
apiVersion: ['v4'],
},
},
options: [
{
name: 'ACH',
Expand Down Expand Up @@ -231,15 +227,38 @@ export const paymentFields: INodeProperties[] = [
],
default: 1,
},
{
displayName: 'Transfer Reference',
name: 'transferReference',
type: 'string',
default: '',
},
{
displayName: 'Private Notes',
name: 'privateNotes',
type: 'string',
default: '',
},
],
},
{
displayName: 'Additional Fields',
name: 'additionalFields',
type: 'collection',
placeholder: 'Add Field',
default: {},
displayOptions: {
show: {
apiVersion: ['v5'],
operation: ['create'],
resource: ['payment'],
},
},
options: [
{
displayName: 'Payment Type',
name: 'paymentType',
type: 'options',
displayOptions: {
show: {
apiVersion: ['v5'],
},
},
options: [
{
name: 'Bank Transfer',
Expand Down

0 comments on commit 129245d

Please sign in to comment.