Skip to content

Commit b62dbb5

Browse files
committed
new components
1 parent f35b601 commit b62dbb5

File tree

4 files changed

+530
-0
lines changed

4 files changed

+530
-0
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+
};
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+
};
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,125 @@
11
export const LIMIT = 100;
22
export const MAX_RETRIES = 5;
33
export const INITIAL_BACKOFF_MILLISECONDS = 1500;
4+
5+
export const AP_AGING_REPORT_COLUMNS = [
6+
"create_by",
7+
"create_date",
8+
"doc_num",
9+
"due_date",
10+
"last_mod_by",
11+
"last_mod_date",
12+
"memo",
13+
"past_due",
14+
"term_name",
15+
"tx_date",
16+
"txn_type",
17+
"vend_bill_addr",
18+
"vend_comp_name",
19+
"vend_name",
20+
"vend_pri_cont",
21+
"vend_pri_email",
22+
"vend_pri_tel",
23+
"dept_name",
24+
"currency",
25+
"exch_rate",
26+
"subt_neg_open_bal",
27+
"subt_neg_amount",
28+
"neg_foreign_open_bal",
29+
"subt_neg_home_open_bal",
30+
"neg_foreign_amount",
31+
"subt_neg_home_amount",
32+
];
33+
34+
export const PROFIT_LOSS_REPORT_COLUMNS = [
35+
"create_by",
36+
"create_date",
37+
"doc_num",
38+
"last_mod_by",
39+
"last_mod_date",
40+
"memo",
41+
"name",
42+
"pmt_mthd",
43+
"split_acc",
44+
"tx_date",
45+
"txn_type",
46+
"tax_code",
47+
"klass_name",
48+
"dept_name",
49+
"debt_amt",
50+
"credit_amt",
51+
"nat_open_bal",
52+
"subt_nat_amount",
53+
"subt_nat_amount_nt",
54+
"rbal_nat_amount",
55+
"rbal_nat_amount_nt",
56+
"tax_amount",
57+
"net_amount",
58+
"debt_home_amt",
59+
"credit_home_amt",
60+
"currency",
61+
"exch_rate",
62+
"nat_home_open_bal",
63+
"nat_foreign_open_bal",
64+
"subt_nat_home_amount",
65+
"subt_nat_amount_home_nt",
66+
"rbal_nat_home_amount",
67+
"rbal_nat_amount_home_nt",
68+
"home_tax_amount",
69+
"home_net_amount",
70+
];
71+
72+
export const DATE_MACRO_OPTIONS = [
73+
"Today",
74+
"Yesterday",
75+
"This Week",
76+
"Last Week",
77+
"This Week-to-date",
78+
"Last Week-to-date",
79+
"Next Week",
80+
"Next 4 Weeks",
81+
"This Month",
82+
"Last Month",
83+
"This Month-to-date",
84+
"Last Month-to-date",
85+
"Next Month",
86+
"This Fiscal Quarter",
87+
"Last Fiscal Quarter",
88+
"This Fiscal Quarter-to-date",
89+
"Last Fiscal Quarter-to-date",
90+
"Next Fiscal Quarter",
91+
"This Fiscal Year",
92+
"Last Fiscal Year",
93+
"This Fiscal Year-to-date",
94+
"Last Fiscal Year-to-date",
95+
"Next Fiscal Year",
96+
];
97+
98+
export const PAYMENT_METHOD_OPTIONS = [
99+
"Cash",
100+
"Check",
101+
"Dinners Club",
102+
"American Express",
103+
"Discover",
104+
"MasterCard",
105+
"Visa",
106+
];
107+
108+
export const ACCOUNT_TYPE_OPTIONS = [
109+
"AccountsPayable",
110+
"AccountsReceivable",
111+
"Bank",
112+
"CostOfGoodsSold",
113+
"CreditCard",
114+
"Equity",
115+
"Expense",
116+
"FixedAsset",
117+
"Income",
118+
"LongTermLiability",
119+
"NonPosting",
120+
"OtherAsset",
121+
"OtherCurrentAsset",
122+
"OtherCurrentLiability",
123+
"OtherExpense",
124+
"OtherIncome",
125+
];

0 commit comments

Comments
 (0)