mirror of
https://github.com/n8n-io/n8n.git
synced 2025-02-21 02:56:40 -08:00
fix(Invoice Ninja Node): Fix line items not being correctly set for quotes and invoices (#5304)
This commit is contained in:
parent
04c058a34e
commit
3b5e1d127f
|
@ -472,15 +472,25 @@ export class InvoiceNinja implements INodeType {
|
|||
cost: itemValue.cost as number,
|
||||
notes: itemValue.description as string,
|
||||
product_key: itemValue.service as string,
|
||||
qty: itemValue.hours as number,
|
||||
tax_rate1: itemValue.taxRate1 as number,
|
||||
tax_rate2: itemValue.taxRate2 as number,
|
||||
tax_name1: itemValue.taxName1 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);
|
||||
}
|
||||
body.invoice_items = invoiceItems;
|
||||
if (apiVersion === 'v4') {
|
||||
body.invoice_items = invoiceItems;
|
||||
}
|
||||
if (apiVersion === 'v5') {
|
||||
body.line_items = invoiceItems;
|
||||
}
|
||||
}
|
||||
responseData = await invoiceNinjaApiRequest.call(
|
||||
this,
|
||||
|
@ -902,15 +912,25 @@ export class InvoiceNinja implements INodeType {
|
|||
cost: itemValue.cost as number,
|
||||
notes: itemValue.description as string,
|
||||
product_key: itemValue.service as string,
|
||||
qty: itemValue.hours as number,
|
||||
tax_rate1: itemValue.taxRate1 as number,
|
||||
tax_rate2: itemValue.taxRate2 as number,
|
||||
tax_name1: itemValue.taxName1 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);
|
||||
}
|
||||
body.invoice_items = invoiceItems;
|
||||
if (apiVersion === 'v4') {
|
||||
body.invoice_items = invoiceItems;
|
||||
}
|
||||
if (apiVersion === 'v5') {
|
||||
body.line_items = invoiceItems;
|
||||
}
|
||||
}
|
||||
responseData = await invoiceNinjaApiRequest.call(
|
||||
this,
|
||||
|
|
|
@ -3,6 +3,7 @@ export interface IItem {
|
|||
notes?: string;
|
||||
product_key?: string;
|
||||
qty?: number;
|
||||
quantity?: number;
|
||||
tax_rate1?: number;
|
||||
tax_rate2?: number;
|
||||
tax_name1?: string;
|
||||
|
@ -20,6 +21,7 @@ export interface IQuote {
|
|||
email?: string;
|
||||
invoice_date?: string;
|
||||
invoice_items?: IItem[];
|
||||
line_items?: IItem[];
|
||||
invoice_number?: string;
|
||||
invoice_status_id?: number;
|
||||
is_amount_discount?: boolean;
|
||||
|
|
|
@ -3,6 +3,7 @@ export interface IItem {
|
|||
notes?: string;
|
||||
product_key?: string;
|
||||
qty?: number;
|
||||
quantity?: number;
|
||||
tax_rate1?: number;
|
||||
tax_rate2?: number;
|
||||
tax_name1?: string;
|
||||
|
@ -20,6 +21,7 @@ export interface IInvoice {
|
|||
due_date?: string;
|
||||
invoice_date?: string;
|
||||
invoice_items?: IItem[];
|
||||
line_items?: IItem[];
|
||||
invoice_number?: string;
|
||||
invoice_status_id?: number;
|
||||
is_amount_discount?: boolean;
|
||||
|
|
Loading…
Reference in a new issue