Skip to content

Commit f8f94de

Browse files
michelle0927lcaresia
authored andcommitted
Quickbooks Online - new actions (#14630)
* new components * package.json version * versions
1 parent 2e94e1d commit f8f94de

File tree

37 files changed

+563
-33
lines changed

37 files changed

+563
-33
lines changed
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
import quickbooks from "../../quickbooks.app.mjs";
2+
import { AP_AGING_REPORT_COLUMNS } from "../../common/constants.mjs";
3+
4+
export default {
5+
key: "quickbooks-create-ap-aging-report",
6+
name: "Create AP Aging Detail Report",
7+
description: "Creates an AP aging report in Quickbooks Online. [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/apagingdetail#query-a-report)",
8+
version: "0.0.1",
9+
type: "action",
10+
props: {
11+
quickbooks,
12+
shipvia: {
13+
type: "string",
14+
label: "Ship Via",
15+
description: "Filter by the shipping method",
16+
optional: true,
17+
},
18+
termIds: {
19+
propDefinition: [
20+
quickbooks,
21+
"termIds",
22+
],
23+
},
24+
startDueDate: {
25+
type: "string",
26+
label: "Start Due Date",
27+
description: "The range of dates over which receivables are due, in the format `YYYY-MM-DD`. `start_duedate` must be less than `end_duedate`. If not specified, all data is returned.",
28+
optional: true,
29+
},
30+
endDueDate: {
31+
type: "string",
32+
label: "End Due Date",
33+
description: "The range of dates over which receivables are due, in the format `YYYY-MM-DD`. `start_duedate` must be less than `end_duedate`. If not specified, all data is returned.",
34+
optional: true,
35+
},
36+
accountingMethod: {
37+
propDefinition: [
38+
quickbooks,
39+
"accountingMethod",
40+
],
41+
},
42+
reportDate: {
43+
type: "string",
44+
label: "Report Date",
45+
description: "Start date to use for the report, in the format `YYYY-MM-DD`",
46+
optional: true,
47+
},
48+
numPeriods: {
49+
type: "integer",
50+
label: "Num Periods",
51+
description: "The number of periods to be shown in the report",
52+
optional: true,
53+
},
54+
vendorIds: {
55+
propDefinition: [
56+
quickbooks,
57+
"vendorIds",
58+
],
59+
},
60+
pastDue: {
61+
type: "integer",
62+
label: "Past Due",
63+
description: "Filters report contents based on minimum days past due",
64+
optional: true,
65+
},
66+
agingPeriod: {
67+
type: "integer",
68+
label: "Aging Period",
69+
description: "The number of days in the aging period",
70+
optional: true,
71+
},
72+
columns: {
73+
propDefinition: [
74+
quickbooks,
75+
"columns",
76+
],
77+
options: AP_AGING_REPORT_COLUMNS,
78+
},
79+
},
80+
async run({ $ }) {
81+
const response = await this.quickbooks.getApAgingReport({
82+
$,
83+
params: {
84+
shipvia: this.shipvia,
85+
term: this.termIds,
86+
start_duedate: this.startDueDate,
87+
end_duedate: this.endDueDate,
88+
accounting_method: this.accountingMethod,
89+
report_date: this.reportDate,
90+
num_periods: this.numPeriods,
91+
vendor: this.vendorIds,
92+
past_due: this.pastDue,
93+
aging_period: this.agingPeriod,
94+
columns: this.columns,
95+
},
96+
});
97+
if (response) {
98+
$.export("summary", "Successfully created AP Aging Detail Report");
99+
}
100+
return response;
101+
},
102+
};

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
key: "quickbooks-create-bill",
66
name: "Create Bill",
77
description: "Creates a bill. [See docs here](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/bill#create-a-bill)",
8-
version: "0.1.5",
8+
version: "0.1.6",
99
type: "action",
1010
props: {
1111
quickbooks,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
key: "quickbooks-create-customer",
66
name: "Create Customer",
77
description: "Creates a customer. [See docs here](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/customer#create-a-customer)",
8-
version: "0.1.5",
8+
version: "0.1.6",
99
type: "action",
1010
props: {
1111
quickbooks,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
key: "quickbooks-create-invoice",
66
name: "Create Invoice",
77
description: "Creates an invoice. [See docs here](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/invoice#create-an-invoice)",
8-
version: "0.1.5",
8+
version: "0.1.6",
99
type: "action",
1010
props: {
1111
quickbooks,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "quickbooks-create-payment",
55
name: "Create Payment",
66
description: "Creates a payment. [See docs here](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/payment#create-a-payment)",
7-
version: "0.0.4",
7+
version: "0.0.5",
88
type: "action",
99
props: {
1010
quickbooks,
Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
import quickbooks from "../../quickbooks.app.mjs";
2+
import {
3+
DATE_MACRO_OPTIONS, PAYMENT_METHOD_OPTIONS, ACCOUNT_TYPE_OPTIONS, PROFIT_LOSS_REPORT_COLUMNS,
4+
} from "../../common/constants.mjs";
5+
6+
export default {
7+
key: "quickbooks-create-pl-report",
8+
name: "Create Profit and Loss Detail Report",
9+
description: "Creates a profit and loss report in Quickbooks Online. [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/profitandloss#query-a-report)",
10+
version: "0.0.1",
11+
type: "action",
12+
props: {
13+
quickbooks,
14+
customerIds: {
15+
propDefinition: [
16+
quickbooks,
17+
"customer",
18+
],
19+
type: "string[]",
20+
label: "Customer Ids",
21+
description: "Filters report contents to include information for specified customers",
22+
optional: true,
23+
},
24+
accountIds: {
25+
propDefinition: [
26+
quickbooks,
27+
"accountIds",
28+
],
29+
},
30+
accountingMethod: {
31+
propDefinition: [
32+
quickbooks,
33+
"accountingMethod",
34+
],
35+
},
36+
dateMacro: {
37+
type: "string",
38+
label: "Date Macro",
39+
description: "Predefined date range. Use if you want the report to cover a standard report date range; otherwise, use the `start_date` and `end_date` to cover an explicit report date range",
40+
options: DATE_MACRO_OPTIONS,
41+
optional: true,
42+
},
43+
startDate: {
44+
type: "string",
45+
label: "Start Date",
46+
description: "The start date of the report, in the format `YYYY-MM-DD`. `start_date` must be less than `end_date`",
47+
optional: true,
48+
},
49+
endDate: {
50+
type: "string",
51+
label: "End Date",
52+
description: "The end date of the report, in the format `YYYY-MM-DD`. `start_date` must be less than `end_date`",
53+
optional: true,
54+
},
55+
adjustedGainLoss: {
56+
type: "string",
57+
label: "Adjusted Gain Loss",
58+
description: "Specifies whether unrealized gain and losses are included in the report",
59+
options: [
60+
"true",
61+
"false",
62+
],
63+
optional: true,
64+
},
65+
classIds: {
66+
propDefinition: [
67+
quickbooks,
68+
"classIds",
69+
],
70+
},
71+
paymentMethod: {
72+
type: "string",
73+
label: "Payment Method",
74+
description: "Filters report contents based on payment method",
75+
options: PAYMENT_METHOD_OPTIONS,
76+
optional: true,
77+
},
78+
employeeIds: {
79+
propDefinition: [
80+
quickbooks,
81+
"employeeIds",
82+
],
83+
},
84+
departmentIds: {
85+
propDefinition: [
86+
quickbooks,
87+
"departmentIds",
88+
],
89+
},
90+
vendorIds: {
91+
propDefinition: [
92+
quickbooks,
93+
"vendorIds",
94+
],
95+
},
96+
accountType: {
97+
type: "string",
98+
label: "Account Type",
99+
description: "Account type from which transactions are included in the report",
100+
options: ACCOUNT_TYPE_OPTIONS,
101+
optional: true,
102+
},
103+
sortBy: {
104+
type: "string",
105+
label: "Sort By",
106+
description: "The column type used in sorting report rows",
107+
options: PROFIT_LOSS_REPORT_COLUMNS,
108+
optional: true,
109+
},
110+
columns: {
111+
propDefinition: [
112+
quickbooks,
113+
"columns",
114+
],
115+
options: PROFIT_LOSS_REPORT_COLUMNS,
116+
},
117+
},
118+
async run({ $ }) {
119+
const response = await this.quickbooks.getProfitLossReport({
120+
$,
121+
params: {
122+
customer: this.customerIds,
123+
account: this.accountIds,
124+
accounting_method: this.accountingMethod,
125+
date_macro: this.dateMacro,
126+
start_date: this.startDate,
127+
end_date: this.endDate,
128+
adjusted_gain_loss: this.adjustedGainLoss,
129+
class: this.classIds,
130+
payment_method: this.paymentMethod,
131+
employee: this.employeeIds,
132+
department: this.departmentIds,
133+
vendor: this.vendorIds,
134+
account_type: this.accountType,
135+
sort_by: this.sortBy,
136+
columns: this.columns,
137+
},
138+
});
139+
if (response) {
140+
$.export("summary", "Successfully created Profit and Loss Detail Report");
141+
}
142+
return response;
143+
},
144+
};

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
key: "quickbooks-create-purchase",
66
name: "Create Purchase",
77
description: "Creates a new purchase. [See docs here](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/purchase#create-a-purchase)",
8-
version: "0.0.3",
8+
version: "0.0.4",
99
type: "action",
1010
props: {
1111
quickbooks,

components/quickbooks/actions/create-sales-receipt/create-sales-receipt.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
key: "quickbooks-create-sales-receipt",
66
name: "Create Sales Receipt",
77
description: "Creates a sales receipt. [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/salesreceipt#create-a-salesreceipt)",
8-
version: "0.0.4",
8+
version: "0.0.5",
99
type: "action",
1010
props: {
1111
quickbooks,

components/quickbooks/actions/delete-purchase/delete-purchase.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "quickbooks-delete-purchase",
55
name: "Delete Purchase",
66
description: "Delete a specific purchase. [See docs here](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/purchase#delete-a-purchase)",
7-
version: "0.0.3",
7+
version: "0.0.4",
88
type: "action",
99
props: {
1010
quickbooks,

components/quickbooks/actions/get-bill/get-bill.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
key: "quickbooks-get-bill",
66
name: "Get Bill",
77
description: "Returns info about a bill. [See docs here](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/bill#read-a-bill)",
8-
version: "0.1.5",
8+
version: "0.1.6",
99
type: "action",
1010
props: {
1111
quickbooks,

0 commit comments

Comments
 (0)