Skip to content

Commit 71e1a0e

Browse files
additional fields
1 parent 53fa484 commit 71e1a0e

File tree

2 files changed

+47
-25
lines changed

2 files changed

+47
-25
lines changed

components/quickbooks/actions/create-invoice/create-invoice.mjs

Lines changed: 46 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default {
66
key: "quickbooks-create-invoice",
77
name: "Create Invoice",
88
description: "Creates an invoice. [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/invoice#create-an-invoice)",
9-
version: "0.2.0",
9+
version: "0.2.1",
1010
type: "action",
1111
props: {
1212
quickbooks,
@@ -16,24 +16,36 @@ export default {
1616
"customer",
1717
],
1818
},
19-
currencyRefValue: {
20-
propDefinition: [
21-
quickbooks,
22-
"currency",
23-
],
19+
billEmail: {
20+
type: "string",
21+
label: "Bill Email",
22+
description: "Email address where the invoice should be sent",
23+
optional: true,
2424
},
2525
dueDate: {
2626
type: "string",
2727
label: "Due Date",
2828
description: "Date when the payment of the transaction is due (YYYY-MM-DD)",
2929
optional: true,
3030
},
31-
includeInvoiceLink: {
31+
allowOnlineCreditCardPayment: {
3232
type: "boolean",
33-
label: "Include Invoice Link",
34-
description: "Return the sharable link for the invoice sent to external customers",
33+
label: "Allow Online Credit Card Payment",
34+
description: "Allow online credit card payment",
3535
optional: true,
3636
},
37+
allowOnlineACHPayment: {
38+
type: "boolean",
39+
label: "Allow Online Bank Transfer Payment",
40+
description: "Allow online bank transfer payment",
41+
optional: true,
42+
},
43+
currencyRefValue: {
44+
propDefinition: [
45+
quickbooks,
46+
"currency",
47+
],
48+
},
3749
lineItemsAsObjects: {
3850
propDefinition: [
3951
quickbooks,
@@ -117,23 +129,33 @@ export default {
117129
}
118130
});
119131

132+
const params = {};
133+
const data = {
134+
Line: lines,
135+
CustomerRef: {
136+
value: this.customerRefValue,
137+
},
138+
DueDate: this.dueDate,
139+
AllowOnlineCreditCardPayment: this.allowOnlineCreditCardPayment,
140+
AllowOnlineACHPayment: this.allowOnlineACHPayment,
141+
};
142+
143+
if (this.billEmail) {
144+
params.include = "invoiceLink";
145+
data.BillEmail = {
146+
Address: this.billEmail,
147+
};
148+
}
149+
if (this.currencyRefValue) {
150+
data.CurrencyRef = {
151+
value: this.currencyRefValue,
152+
};
153+
}
154+
120155
const response = await this.quickbooks.createInvoice({
121156
$,
122-
params: {
123-
include: this.includeInvoiceLink
124-
? "invoiceLink"
125-
: undefined,
126-
},
127-
data: {
128-
Line: lines,
129-
DueDate: this.dueDate,
130-
CustomerRef: {
131-
value: this.customerRefValue,
132-
},
133-
CurrencyRef: {
134-
value: this.currencyRefValue,
135-
},
136-
},
157+
params,
158+
data,
137159
});
138160

139161
if (response) {

components/quickbooks/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/quickbooks",
3-
"version": "0.5.2",
3+
"version": "0.5.3",
44
"description": "Pipedream Quickbooks Components",
55
"main": "quickbooks.app.mjs",
66
"keywords": [

0 commit comments

Comments
 (0)