mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-21 11:49:59 +00:00
fix(Invoice Ninja Node): Fix line items not being correctly set for quotes and invoices (#5304)
This commit is contained in:
@@ -472,15 +472,25 @@ export class InvoiceNinja implements INodeType {
|
|||||||
cost: itemValue.cost as number,
|
cost: itemValue.cost as number,
|
||||||
notes: itemValue.description as string,
|
notes: itemValue.description as string,
|
||||||
product_key: itemValue.service as string,
|
product_key: itemValue.service as string,
|
||||||
qty: itemValue.hours as number,
|
|
||||||
tax_rate1: itemValue.taxRate1 as number,
|
tax_rate1: itemValue.taxRate1 as number,
|
||||||
tax_rate2: itemValue.taxRate2 as number,
|
tax_rate2: itemValue.taxRate2 as number,
|
||||||
tax_name1: itemValue.taxName1 as string,
|
tax_name1: itemValue.taxName1 as string,
|
||||||
tax_name2: itemValue.taxName2 as string,
|
tax_name2: itemValue.taxName2 as string,
|
||||||
};
|
};
|
||||||
|
if (apiVersion === 'v4') {
|
||||||
|
item.qty = itemValue.hours as number;
|
||||||
|
}
|
||||||
|
if (apiVersion === 'v5') {
|
||||||
|
item.quantity = itemValue.hours as number;
|
||||||
|
}
|
||||||
invoiceItems.push(item);
|
invoiceItems.push(item);
|
||||||
}
|
}
|
||||||
body.invoice_items = invoiceItems;
|
if (apiVersion === 'v4') {
|
||||||
|
body.invoice_items = invoiceItems;
|
||||||
|
}
|
||||||
|
if (apiVersion === 'v5') {
|
||||||
|
body.line_items = invoiceItems;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
responseData = await invoiceNinjaApiRequest.call(
|
responseData = await invoiceNinjaApiRequest.call(
|
||||||
this,
|
this,
|
||||||
@@ -902,15 +912,25 @@ export class InvoiceNinja implements INodeType {
|
|||||||
cost: itemValue.cost as number,
|
cost: itemValue.cost as number,
|
||||||
notes: itemValue.description as string,
|
notes: itemValue.description as string,
|
||||||
product_key: itemValue.service as string,
|
product_key: itemValue.service as string,
|
||||||
qty: itemValue.hours as number,
|
|
||||||
tax_rate1: itemValue.taxRate1 as number,
|
tax_rate1: itemValue.taxRate1 as number,
|
||||||
tax_rate2: itemValue.taxRate2 as number,
|
tax_rate2: itemValue.taxRate2 as number,
|
||||||
tax_name1: itemValue.taxName1 as string,
|
tax_name1: itemValue.taxName1 as string,
|
||||||
tax_name2: itemValue.taxName2 as string,
|
tax_name2: itemValue.taxName2 as string,
|
||||||
};
|
};
|
||||||
|
if (apiVersion === 'v4') {
|
||||||
|
item.qty = itemValue.hours as number;
|
||||||
|
}
|
||||||
|
if (apiVersion === 'v5') {
|
||||||
|
item.quantity = itemValue.hours as number;
|
||||||
|
}
|
||||||
invoiceItems.push(item);
|
invoiceItems.push(item);
|
||||||
}
|
}
|
||||||
body.invoice_items = invoiceItems;
|
if (apiVersion === 'v4') {
|
||||||
|
body.invoice_items = invoiceItems;
|
||||||
|
}
|
||||||
|
if (apiVersion === 'v5') {
|
||||||
|
body.line_items = invoiceItems;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
responseData = await invoiceNinjaApiRequest.call(
|
responseData = await invoiceNinjaApiRequest.call(
|
||||||
this,
|
this,
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ export interface IItem {
|
|||||||
notes?: string;
|
notes?: string;
|
||||||
product_key?: string;
|
product_key?: string;
|
||||||
qty?: number;
|
qty?: number;
|
||||||
|
quantity?: number;
|
||||||
tax_rate1?: number;
|
tax_rate1?: number;
|
||||||
tax_rate2?: number;
|
tax_rate2?: number;
|
||||||
tax_name1?: string;
|
tax_name1?: string;
|
||||||
@@ -20,6 +21,7 @@ export interface IQuote {
|
|||||||
email?: string;
|
email?: string;
|
||||||
invoice_date?: string;
|
invoice_date?: string;
|
||||||
invoice_items?: IItem[];
|
invoice_items?: IItem[];
|
||||||
|
line_items?: IItem[];
|
||||||
invoice_number?: string;
|
invoice_number?: string;
|
||||||
invoice_status_id?: number;
|
invoice_status_id?: number;
|
||||||
is_amount_discount?: boolean;
|
is_amount_discount?: boolean;
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ export interface IItem {
|
|||||||
notes?: string;
|
notes?: string;
|
||||||
product_key?: string;
|
product_key?: string;
|
||||||
qty?: number;
|
qty?: number;
|
||||||
|
quantity?: number;
|
||||||
tax_rate1?: number;
|
tax_rate1?: number;
|
||||||
tax_rate2?: number;
|
tax_rate2?: number;
|
||||||
tax_name1?: string;
|
tax_name1?: string;
|
||||||
@@ -20,6 +21,7 @@ export interface IInvoice {
|
|||||||
due_date?: string;
|
due_date?: string;
|
||||||
invoice_date?: string;
|
invoice_date?: string;
|
||||||
invoice_items?: IItem[];
|
invoice_items?: IItem[];
|
||||||
|
line_items?: IItem[];
|
||||||
invoice_number?: string;
|
invoice_number?: string;
|
||||||
invoice_status_id?: number;
|
invoice_status_id?: number;
|
||||||
is_amount_discount?: boolean;
|
is_amount_discount?: boolean;
|
||||||
|
|||||||
Reference in New Issue
Block a user