diff --git a/components/quickbooks/actions/create-ap-aging-report/create-ap-aging-report.mjs b/components/quickbooks/actions/create-ap-aging-report/create-ap-aging-report.mjs new file mode 100644 index 0000000000000..a93338dc8b751 --- /dev/null +++ b/components/quickbooks/actions/create-ap-aging-report/create-ap-aging-report.mjs @@ -0,0 +1,102 @@ +import quickbooks from "../../quickbooks.app.mjs"; +import { AP_AGING_REPORT_COLUMNS } from "../../common/constants.mjs"; + +export default { + key: "quickbooks-create-ap-aging-report", + name: "Create AP Aging Detail Report", + 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)", + version: "0.0.1", + type: "action", + props: { + quickbooks, + shipvia: { + type: "string", + label: "Ship Via", + description: "Filter by the shipping method", + optional: true, + }, + termIds: { + propDefinition: [ + quickbooks, + "termIds", + ], + }, + startDueDate: { + type: "string", + label: "Start Due Date", + 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.", + optional: true, + }, + endDueDate: { + type: "string", + label: "End Due Date", + 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.", + optional: true, + }, + accountingMethod: { + propDefinition: [ + quickbooks, + "accountingMethod", + ], + }, + reportDate: { + type: "string", + label: "Report Date", + description: "Start date to use for the report, in the format `YYYY-MM-DD`", + optional: true, + }, + numPeriods: { + type: "integer", + label: "Num Periods", + description: "The number of periods to be shown in the report", + optional: true, + }, + vendorIds: { + propDefinition: [ + quickbooks, + "vendorIds", + ], + }, + pastDue: { + type: "integer", + label: "Past Due", + description: "Filters report contents based on minimum days past due", + optional: true, + }, + agingPeriod: { + type: "integer", + label: "Aging Period", + description: "The number of days in the aging period", + optional: true, + }, + columns: { + propDefinition: [ + quickbooks, + "columns", + ], + options: AP_AGING_REPORT_COLUMNS, + }, + }, + async run({ $ }) { + const response = await this.quickbooks.getApAgingReport({ + $, + params: { + shipvia: this.shipvia, + term: this.termIds, + start_duedate: this.startDueDate, + end_duedate: this.endDueDate, + accounting_method: this.accountingMethod, + report_date: this.reportDate, + num_periods: this.numPeriods, + vendor: this.vendorIds, + past_due: this.pastDue, + aging_period: this.agingPeriod, + columns: this.columns, + }, + }); + if (response) { + $.export("summary", "Successfully created AP Aging Detail Report"); + } + return response; + }, +}; diff --git a/components/quickbooks/actions/create-bill/create-bill.mjs b/components/quickbooks/actions/create-bill/create-bill.mjs index 38a800d3ab5ec..bb2bb2fed3ae2 100644 --- a/components/quickbooks/actions/create-bill/create-bill.mjs +++ b/components/quickbooks/actions/create-bill/create-bill.mjs @@ -5,7 +5,7 @@ export default { key: "quickbooks-create-bill", name: "Create Bill", description: "Creates a bill. [See docs here](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/bill#create-a-bill)", - version: "0.1.5", + version: "0.1.6", type: "action", props: { quickbooks, diff --git a/components/quickbooks/actions/create-customer/create-customer.mjs b/components/quickbooks/actions/create-customer/create-customer.mjs index df11cc7297c22..a5d419c22de74 100644 --- a/components/quickbooks/actions/create-customer/create-customer.mjs +++ b/components/quickbooks/actions/create-customer/create-customer.mjs @@ -5,7 +5,7 @@ export default { key: "quickbooks-create-customer", name: "Create Customer", description: "Creates a customer. [See docs here](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/customer#create-a-customer)", - version: "0.1.5", + version: "0.1.6", type: "action", props: { quickbooks, diff --git a/components/quickbooks/actions/create-invoice/create-invoice.mjs b/components/quickbooks/actions/create-invoice/create-invoice.mjs index 408f0706437e7..408be0eeacc87 100644 --- a/components/quickbooks/actions/create-invoice/create-invoice.mjs +++ b/components/quickbooks/actions/create-invoice/create-invoice.mjs @@ -5,7 +5,7 @@ export default { key: "quickbooks-create-invoice", name: "Create Invoice", description: "Creates an invoice. [See docs here](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/invoice#create-an-invoice)", - version: "0.1.5", + version: "0.1.6", type: "action", props: { quickbooks, diff --git a/components/quickbooks/actions/create-payment/create-payment.mjs b/components/quickbooks/actions/create-payment/create-payment.mjs index ffd877c3221af..01758a39a6827 100644 --- a/components/quickbooks/actions/create-payment/create-payment.mjs +++ b/components/quickbooks/actions/create-payment/create-payment.mjs @@ -4,7 +4,7 @@ export default { key: "quickbooks-create-payment", name: "Create Payment", description: "Creates a payment. [See docs here](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/payment#create-a-payment)", - version: "0.0.4", + version: "0.0.5", type: "action", props: { quickbooks, diff --git a/components/quickbooks/actions/create-pl-report/create-pl-report.mjs b/components/quickbooks/actions/create-pl-report/create-pl-report.mjs new file mode 100644 index 0000000000000..54cf14deec88d --- /dev/null +++ b/components/quickbooks/actions/create-pl-report/create-pl-report.mjs @@ -0,0 +1,144 @@ +import quickbooks from "../../quickbooks.app.mjs"; +import { + DATE_MACRO_OPTIONS, PAYMENT_METHOD_OPTIONS, ACCOUNT_TYPE_OPTIONS, PROFIT_LOSS_REPORT_COLUMNS, +} from "../../common/constants.mjs"; + +export default { + key: "quickbooks-create-pl-report", + name: "Create Profit and Loss Detail Report", + 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)", + version: "0.0.1", + type: "action", + props: { + quickbooks, + customerIds: { + propDefinition: [ + quickbooks, + "customer", + ], + type: "string[]", + label: "Customer Ids", + description: "Filters report contents to include information for specified customers", + optional: true, + }, + accountIds: { + propDefinition: [ + quickbooks, + "accountIds", + ], + }, + accountingMethod: { + propDefinition: [ + quickbooks, + "accountingMethod", + ], + }, + dateMacro: { + type: "string", + label: "Date Macro", + 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", + options: DATE_MACRO_OPTIONS, + optional: true, + }, + startDate: { + type: "string", + label: "Start Date", + description: "The start date of the report, in the format `YYYY-MM-DD`. `start_date` must be less than `end_date`", + optional: true, + }, + endDate: { + type: "string", + label: "End Date", + description: "The end date of the report, in the format `YYYY-MM-DD`. `start_date` must be less than `end_date`", + optional: true, + }, + adjustedGainLoss: { + type: "string", + label: "Adjusted Gain Loss", + description: "Specifies whether unrealized gain and losses are included in the report", + options: [ + "true", + "false", + ], + optional: true, + }, + classIds: { + propDefinition: [ + quickbooks, + "classIds", + ], + }, + paymentMethod: { + type: "string", + label: "Payment Method", + description: "Filters report contents based on payment method", + options: PAYMENT_METHOD_OPTIONS, + optional: true, + }, + employeeIds: { + propDefinition: [ + quickbooks, + "employeeIds", + ], + }, + departmentIds: { + propDefinition: [ + quickbooks, + "departmentIds", + ], + }, + vendorIds: { + propDefinition: [ + quickbooks, + "vendorIds", + ], + }, + accountType: { + type: "string", + label: "Account Type", + description: "Account type from which transactions are included in the report", + options: ACCOUNT_TYPE_OPTIONS, + optional: true, + }, + sortBy: { + type: "string", + label: "Sort By", + description: "The column type used in sorting report rows", + options: PROFIT_LOSS_REPORT_COLUMNS, + optional: true, + }, + columns: { + propDefinition: [ + quickbooks, + "columns", + ], + options: PROFIT_LOSS_REPORT_COLUMNS, + }, + }, + async run({ $ }) { + const response = await this.quickbooks.getProfitLossReport({ + $, + params: { + customer: this.customerIds, + account: this.accountIds, + accounting_method: this.accountingMethod, + date_macro: this.dateMacro, + start_date: this.startDate, + end_date: this.endDate, + adjusted_gain_loss: this.adjustedGainLoss, + class: this.classIds, + payment_method: this.paymentMethod, + employee: this.employeeIds, + department: this.departmentIds, + vendor: this.vendorIds, + account_type: this.accountType, + sort_by: this.sortBy, + columns: this.columns, + }, + }); + if (response) { + $.export("summary", "Successfully created Profit and Loss Detail Report"); + } + return response; + }, +}; diff --git a/components/quickbooks/actions/create-purchase/create-purchase.mjs b/components/quickbooks/actions/create-purchase/create-purchase.mjs index be79a5bc3deec..fcf186c2cd465 100644 --- a/components/quickbooks/actions/create-purchase/create-purchase.mjs +++ b/components/quickbooks/actions/create-purchase/create-purchase.mjs @@ -5,7 +5,7 @@ export default { key: "quickbooks-create-purchase", name: "Create Purchase", description: "Creates a new purchase. [See docs here](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/purchase#create-a-purchase)", - version: "0.0.3", + version: "0.0.4", type: "action", props: { quickbooks, diff --git a/components/quickbooks/actions/create-sales-receipt/create-sales-receipt.mjs b/components/quickbooks/actions/create-sales-receipt/create-sales-receipt.mjs index c62a07bbcd777..02d9f84627e96 100644 --- a/components/quickbooks/actions/create-sales-receipt/create-sales-receipt.mjs +++ b/components/quickbooks/actions/create-sales-receipt/create-sales-receipt.mjs @@ -5,7 +5,7 @@ export default { key: "quickbooks-create-sales-receipt", name: "Create Sales Receipt", description: "Creates a sales receipt. [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/salesreceipt#create-a-salesreceipt)", - version: "0.0.4", + version: "0.0.5", type: "action", props: { quickbooks, diff --git a/components/quickbooks/actions/delete-purchase/delete-purchase.mjs b/components/quickbooks/actions/delete-purchase/delete-purchase.mjs index 379e6d1d772a7..707d945323344 100644 --- a/components/quickbooks/actions/delete-purchase/delete-purchase.mjs +++ b/components/quickbooks/actions/delete-purchase/delete-purchase.mjs @@ -4,7 +4,7 @@ export default { key: "quickbooks-delete-purchase", name: "Delete Purchase", description: "Delete a specific purchase. [See docs here](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/purchase#delete-a-purchase)", - version: "0.0.3", + version: "0.0.4", type: "action", props: { quickbooks, diff --git a/components/quickbooks/actions/get-bill/get-bill.mjs b/components/quickbooks/actions/get-bill/get-bill.mjs index 1d56b0b24c2b5..afb7b60c592bd 100644 --- a/components/quickbooks/actions/get-bill/get-bill.mjs +++ b/components/quickbooks/actions/get-bill/get-bill.mjs @@ -5,7 +5,7 @@ export default { key: "quickbooks-get-bill", name: "Get Bill", 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)", - version: "0.1.5", + version: "0.1.6", type: "action", props: { quickbooks, diff --git a/components/quickbooks/actions/get-customer/get-customer.mjs b/components/quickbooks/actions/get-customer/get-customer.mjs index 172efd7969298..6ea17e0340607 100644 --- a/components/quickbooks/actions/get-customer/get-customer.mjs +++ b/components/quickbooks/actions/get-customer/get-customer.mjs @@ -5,7 +5,7 @@ export default { key: "quickbooks-get-customer", name: "Get Customer", description: "Returns info about a customer. [See docs here](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/most-commonly-used/customer#read-a-customer)", - version: "0.3.5", + version: "0.3.6", type: "action", props: { quickbooks, diff --git a/components/quickbooks/actions/get-invoice/get-invoice.mjs b/components/quickbooks/actions/get-invoice/get-invoice.mjs index 5e2b23e99e5b8..898ee0495e57a 100644 --- a/components/quickbooks/actions/get-invoice/get-invoice.mjs +++ b/components/quickbooks/actions/get-invoice/get-invoice.mjs @@ -5,7 +5,7 @@ export default { key: "quickbooks-get-invoice", name: "Get Invoice", description: "Returns info about an invoice. [See docs here](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/invoice#read-an-invoice)", - version: "0.2.6", + version: "0.2.7", type: "action", props: { quickbooks, diff --git a/components/quickbooks/actions/get-my-company/get-my-company.mjs b/components/quickbooks/actions/get-my-company/get-my-company.mjs index 2e3c0f122d2d5..334150777e38a 100644 --- a/components/quickbooks/actions/get-my-company/get-my-company.mjs +++ b/components/quickbooks/actions/get-my-company/get-my-company.mjs @@ -4,7 +4,7 @@ export default { key: "quickbooks-get-my-company", name: "Get My Company", description: "Gets info about a company. [See docs here](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/companyinfo)", - version: "0.1.5", + version: "0.1.6", type: "action", props: { quickbooks, diff --git a/components/quickbooks/actions/get-purchase-order/get-purchase-order.mjs b/components/quickbooks/actions/get-purchase-order/get-purchase-order.mjs index 237b2f5534099..5bdfc45477ac4 100644 --- a/components/quickbooks/actions/get-purchase-order/get-purchase-order.mjs +++ b/components/quickbooks/actions/get-purchase-order/get-purchase-order.mjs @@ -5,7 +5,7 @@ export default { key: "quickbooks-get-purchase-order", name: "Get Purchase Order", description: "Returns details about a purchase order. [See docs here](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/purchaseorder#read-a-purchase-order)", - version: "0.1.5", + version: "0.1.6", type: "action", props: { quickbooks, diff --git a/components/quickbooks/actions/get-purchase/get-purchase.mjs b/components/quickbooks/actions/get-purchase/get-purchase.mjs index 1a733bad674a0..d10339ef55fba 100644 --- a/components/quickbooks/actions/get-purchase/get-purchase.mjs +++ b/components/quickbooks/actions/get-purchase/get-purchase.mjs @@ -5,7 +5,7 @@ export default { key: "quickbooks-get-purchase", name: "Get Purchase", description: "Returns info about a purchase. [See docs here](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/purchase#read-a-purchase)", - version: "0.1.5", + version: "0.1.6", type: "action", props: { quickbooks, diff --git a/components/quickbooks/actions/get-sales-receipt/get-sales-receipt.mjs b/components/quickbooks/actions/get-sales-receipt/get-sales-receipt.mjs index 622e5aa3d5584..c630ea1e62c6e 100644 --- a/components/quickbooks/actions/get-sales-receipt/get-sales-receipt.mjs +++ b/components/quickbooks/actions/get-sales-receipt/get-sales-receipt.mjs @@ -5,7 +5,7 @@ export default { key: "quickbooks-get-sales-receipt", name: "Get Sales Receipt", description: "Returns details about a sales receipt. [See docs here](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/salesreceipt#read-a-salesreceipt)", - version: "0.1.5", + version: "0.1.6", type: "action", props: { quickbooks, diff --git a/components/quickbooks/actions/get-time-activity/get-time-activity.mjs b/components/quickbooks/actions/get-time-activity/get-time-activity.mjs index 968cc3f4e266c..6b6ad07ffb380 100644 --- a/components/quickbooks/actions/get-time-activity/get-time-activity.mjs +++ b/components/quickbooks/actions/get-time-activity/get-time-activity.mjs @@ -5,7 +5,7 @@ export default { key: "quickbooks-get-time-activity", name: "Get Time Activity", description: "Returns info about an activity. [See docs here](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/timeactivity#read-a-timeactivity-object)", - version: "0.1.5", + version: "0.1.6", type: "action", props: { quickbooks, diff --git a/components/quickbooks/actions/sandbox-search-invoices/sandbox-search-invoices.mjs b/components/quickbooks/actions/sandbox-search-invoices/sandbox-search-invoices.mjs index 77ff78098a203..164006f4750d8 100644 --- a/components/quickbooks/actions/sandbox-search-invoices/sandbox-search-invoices.mjs +++ b/components/quickbooks/actions/sandbox-search-invoices/sandbox-search-invoices.mjs @@ -5,7 +5,7 @@ export default { key: "quickbooks-sandbox-search-invoices", name: "Search Invoices", description: "Searches for invoices. [See docs here](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/invoice#query-an-invoice)", - version: "0.1.5", + version: "0.1.6", type: "action", props: { quickbooks, diff --git a/components/quickbooks/actions/search-accounts/search-accounts.mjs b/components/quickbooks/actions/search-accounts/search-accounts.mjs index 9d48857a508ab..ebee75f17be3b 100644 --- a/components/quickbooks/actions/search-accounts/search-accounts.mjs +++ b/components/quickbooks/actions/search-accounts/search-accounts.mjs @@ -5,7 +5,7 @@ export default { key: "quickbooks-search-accounts", name: "Search Accounts", description: "Search for accounts. [See docs here](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/account#query-an-account)", - version: "0.2.5", + version: "0.2.6", type: "action", props: { quickbooks, diff --git a/components/quickbooks/actions/search-customers/search-customers.mjs b/components/quickbooks/actions/search-customers/search-customers.mjs index e537b75d1f604..2ec5f2752b675 100644 --- a/components/quickbooks/actions/search-customers/search-customers.mjs +++ b/components/quickbooks/actions/search-customers/search-customers.mjs @@ -5,7 +5,7 @@ export default { key: "quickbooks-search-customers", name: "Search Customers", description: "Searches for customers. [See docs here](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/customer#query-a-customer)", - version: "0.1.5", + version: "0.1.6", type: "action", props: { quickbooks, diff --git a/components/quickbooks/actions/search-items/search-items.mjs b/components/quickbooks/actions/search-items/search-items.mjs index 14392a3d32ef0..1913190a94d4d 100644 --- a/components/quickbooks/actions/search-items/search-items.mjs +++ b/components/quickbooks/actions/search-items/search-items.mjs @@ -5,7 +5,7 @@ export default { key: "quickbooks-search-items", name: "Search Items", description: "Searches for items. [See docs here](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/item#query-an-item)", - version: "0.1.5", + version: "0.1.6", type: "action", props: { quickbooks, diff --git a/components/quickbooks/actions/search-products/search-products.mjs b/components/quickbooks/actions/search-products/search-products.mjs index 1356711e07dc2..6abe33fefa886 100644 --- a/components/quickbooks/actions/search-products/search-products.mjs +++ b/components/quickbooks/actions/search-products/search-products.mjs @@ -5,7 +5,7 @@ export default { key: "quickbooks-search-products", name: "Search Products", description: "Search for products. [See docs here](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/item#query-an-item)", - version: "0.1.5", + version: "0.1.6", type: "action", props: { quickbooks, diff --git a/components/quickbooks/actions/search-purchases/search-purchases.mjs b/components/quickbooks/actions/search-purchases/search-purchases.mjs index b4a8851f46fd0..ac08e79571e04 100644 --- a/components/quickbooks/actions/search-purchases/search-purchases.mjs +++ b/components/quickbooks/actions/search-purchases/search-purchases.mjs @@ -4,7 +4,7 @@ export default { key: "quickbooks-search-purchases", name: "Search Purchases", description: "Searches for purchases. [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/purchase#query-a-purchase)", - version: "0.0.3", + version: "0.0.4", type: "action", props: { quickbooks, diff --git a/components/quickbooks/actions/search-query/search-query.mjs b/components/quickbooks/actions/search-query/search-query.mjs index c92ee509128b6..5515f8038650b 100644 --- a/components/quickbooks/actions/search-query/search-query.mjs +++ b/components/quickbooks/actions/search-query/search-query.mjs @@ -5,7 +5,7 @@ export default { key: "quickbooks-search-query", name: "Search Query", description: "Performs a search query against a Quickbooks entity. [See docs here](https://developer.intuit.com/app/develophttps://developer.intuit.com/app/developer/qbo/docs/develop/explore-the-quickbooks-online-api/data-queries)", - version: "0.1.5", + version: "0.1.6", type: "action", props: { quickbooks, diff --git a/components/quickbooks/actions/search-time-activities/search-time-activities.mjs b/components/quickbooks/actions/search-time-activities/search-time-activities.mjs index 2ff57a1484e4f..4f52319d3c300 100644 --- a/components/quickbooks/actions/search-time-activities/search-time-activities.mjs +++ b/components/quickbooks/actions/search-time-activities/search-time-activities.mjs @@ -5,7 +5,7 @@ export default { key: "quickbooks-search-time-activities", name: "Search Time Activities", description: "Searches for time activities. [See docs here](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/timeactivity#query-a-timeactivity-object)", - version: "0.1.5", + version: "0.1.6", type: "action", props: { quickbooks, diff --git a/components/quickbooks/actions/search-vendors/search-vendors.mjs b/components/quickbooks/actions/search-vendors/search-vendors.mjs index 578129bd80caf..20e4752e1d35c 100644 --- a/components/quickbooks/actions/search-vendors/search-vendors.mjs +++ b/components/quickbooks/actions/search-vendors/search-vendors.mjs @@ -5,7 +5,7 @@ export default { key: "quickbooks-search-vendors", name: "Search Vendors", description: "Searches for vendors. [See docs here](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/vendor#query-a-vendor)", - version: "0.1.5", + version: "0.1.6", type: "action", props: { quickbooks, diff --git a/components/quickbooks/actions/sparse-update-invoice/sparse-update-invoice.mjs b/components/quickbooks/actions/sparse-update-invoice/sparse-update-invoice.mjs index 85fcbb6927fe9..9495fc93a8d89 100644 --- a/components/quickbooks/actions/sparse-update-invoice/sparse-update-invoice.mjs +++ b/components/quickbooks/actions/sparse-update-invoice/sparse-update-invoice.mjs @@ -6,7 +6,7 @@ export default { key: "quickbooks-sparse-update-invoice", name: "Sparse Update Invoice", description: "Sparse updating provides the ability to update a subset of properties for a given object; only elements specified in the request are updated. Missing elements are left untouched. The ID of the object to update is specified in the request body.​ [See docs here](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/invoice#sparse-update-an-invoice)", - version: "0.1.3", + version: "0.1.4", type: "action", props: { quickbooks, diff --git a/components/quickbooks/actions/update-customer/update-customer.mjs b/components/quickbooks/actions/update-customer/update-customer.mjs index 6b6c5bdc72b77..ab971febe78df 100644 --- a/components/quickbooks/actions/update-customer/update-customer.mjs +++ b/components/quickbooks/actions/update-customer/update-customer.mjs @@ -5,7 +5,7 @@ export default { key: "quickbooks-update-customer", name: "Update Customer", description: "Updates a customer. [See docs here](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/customer#full-update-a-customer)", - version: "0.1.5", + version: "0.1.6", type: "action", props: { quickbooks, diff --git a/components/quickbooks/common/constants.mjs b/components/quickbooks/common/constants.mjs index 02f549d432bf3..bf001cba36632 100644 --- a/components/quickbooks/common/constants.mjs +++ b/components/quickbooks/common/constants.mjs @@ -1,3 +1,125 @@ export const LIMIT = 100; export const MAX_RETRIES = 5; export const INITIAL_BACKOFF_MILLISECONDS = 1500; + +export const AP_AGING_REPORT_COLUMNS = [ + "create_by", + "create_date", + "doc_num", + "due_date", + "last_mod_by", + "last_mod_date", + "memo", + "past_due", + "term_name", + "tx_date", + "txn_type", + "vend_bill_addr", + "vend_comp_name", + "vend_name", + "vend_pri_cont", + "vend_pri_email", + "vend_pri_tel", + "dept_name", + "currency", + "exch_rate", + "subt_neg_open_bal", + "subt_neg_amount", + "neg_foreign_open_bal", + "subt_neg_home_open_bal", + "neg_foreign_amount", + "subt_neg_home_amount", +]; + +export const PROFIT_LOSS_REPORT_COLUMNS = [ + "create_by", + "create_date", + "doc_num", + "last_mod_by", + "last_mod_date", + "memo", + "name", + "pmt_mthd", + "split_acc", + "tx_date", + "txn_type", + "tax_code", + "klass_name", + "dept_name", + "debt_amt", + "credit_amt", + "nat_open_bal", + "subt_nat_amount", + "subt_nat_amount_nt", + "rbal_nat_amount", + "rbal_nat_amount_nt", + "tax_amount", + "net_amount", + "debt_home_amt", + "credit_home_amt", + "currency", + "exch_rate", + "nat_home_open_bal", + "nat_foreign_open_bal", + "subt_nat_home_amount", + "subt_nat_amount_home_nt", + "rbal_nat_home_amount", + "rbal_nat_amount_home_nt", + "home_tax_amount", + "home_net_amount", +]; + +export const DATE_MACRO_OPTIONS = [ + "Today", + "Yesterday", + "This Week", + "Last Week", + "This Week-to-date", + "Last Week-to-date", + "Next Week", + "Next 4 Weeks", + "This Month", + "Last Month", + "This Month-to-date", + "Last Month-to-date", + "Next Month", + "This Fiscal Quarter", + "Last Fiscal Quarter", + "This Fiscal Quarter-to-date", + "Last Fiscal Quarter-to-date", + "Next Fiscal Quarter", + "This Fiscal Year", + "Last Fiscal Year", + "This Fiscal Year-to-date", + "Last Fiscal Year-to-date", + "Next Fiscal Year", +]; + +export const PAYMENT_METHOD_OPTIONS = [ + "Cash", + "Check", + "Dinners Club", + "American Express", + "Discover", + "MasterCard", + "Visa", +]; + +export const ACCOUNT_TYPE_OPTIONS = [ + "AccountsPayable", + "AccountsReceivable", + "Bank", + "CostOfGoodsSold", + "CreditCard", + "Equity", + "Expense", + "FixedAsset", + "Income", + "LongTermLiability", + "NonPosting", + "OtherAsset", + "OtherCurrentAsset", + "OtherCurrentLiability", + "OtherExpense", + "OtherIncome", +]; diff --git a/components/quickbooks/package.json b/components/quickbooks/package.json index d674ade55f074..b53bc5fa84355 100644 --- a/components/quickbooks/package.json +++ b/components/quickbooks/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/quickbooks", - "version": "0.2.1", + "version": "0.3.0", "description": "Pipedream Quickbooks Components", "main": "quickbooks.app.mjs", "keywords": [ diff --git a/components/quickbooks/quickbooks.app.mjs b/components/quickbooks/quickbooks.app.mjs index 14dfb8c6596ac..9f5c38b071291 100644 --- a/components/quickbooks/quickbooks.app.mjs +++ b/components/quickbooks/quickbooks.app.mjs @@ -195,6 +195,154 @@ export default { description: "Suffix of the name. For example, `Jr`. The `DisplayName` attribute or at least one of `Title`, `GivenName`, `MiddleName`, `FamilyName`, or `Suffix` attributes is required for object create.", optional: true, }, + accountingMethod: { + type: "string", + label: "Accounting Method", + description: "The accounting method used in the report", + options: [ + "Cash", + "Accrual", + ], + optional: true, + }, + columns: { + type: "string[]", + label: "Columns", + description: "Column types to be shown in the report", + optional: true, + }, + termIds: { + type: "string[]", + label: "Term Ids", + description: "Filters report contents based on term or terms supplied", + optional: true, + async options({ page }) { + const position = 1 + (page * 10); + const { QueryResponse: { Term: terms } } = await this.query({ + params: { + query: `select * from term maxresults 10 ${page + ? `startposition ${position}` + : ""} `, + }, + }); + return terms?.map(({ + Id: value, Name: label, + }) => ({ + value, + label, + })) || []; + }, + }, + vendorIds: { + type: "string[]", + label: "Vendor Ids", + description: "Filters report contents to include information for specified vendors", + optional: true, + async options({ page }) { + const position = 1 + (page * 10); + const { QueryResponse: { Vendor: vendors } } = await this.query({ + params: { + query: `select * from vendor maxresults 10 ${page + ? `startposition ${position}` + : ""} `, + }, + }); + return vendors?.map(({ + Id: value, DisplayName: label, + }) => ({ + value, + label, + })) || []; + }, + }, + accountIds: { + type: "string[]", + label: "Account Ids", + description: "Filters report contents to include information for specified accounts", + optional: true, + async options({ page }) { + const position = 1 + (page * 10); + const { QueryResponse: { Account: accounts } } = await this.query({ + params: { + query: `select * from account maxresults 10 ${page + ? `startposition ${position}` + : ""} `, + }, + }); + return accounts?.map(({ + Id: value, Name: label, + }) => ({ + value, + label, + })) || []; + }, + }, + classIds: { + type: "string[]", + label: "Class Ids", + description: "Filters report contents to include information for specified classes if so configured in the company file", + optional: true, + async options({ page }) { + const position = 1 + (page * 10); + const { QueryResponse: { Class: classes } } = await this.query({ + params: { + query: `select * from class maxresults 10 ${page + ? `startposition ${position}` + : ""} `, + }, + }); + return classes?.map(({ + Id: value, Name: label, + }) => ({ + value, + label, + })) || []; + }, + }, + employeeIds: { + type: "string[]", + label: "Employee Ids", + description: "Filters report contents to include information for specified employees", + optional: true, + async options({ page }) { + const position = 1 + (page * 10); + const { QueryResponse: { Employee: employees } } = await this.query({ + params: { + query: `select * from employee maxresults 10 ${page + ? `startposition ${position}` + : ""} `, + }, + }); + return employees?.map(({ + Id: value, DisplayName: label, + }) => ({ + value, + label, + })) || []; + }, + }, + departmentIds: { + type: "string[]", + label: "Department Ids", + description: "Filters report contents to include information for specified departments if so configured in the company file", + optional: true, + async options({ page }) { + const position = 1 + (page * 10); + const { QueryResponse: { Department: departments } } = await this.query({ + params: { + query: `select * from department maxresults 10 ${page + ? `startposition ${position}` + : ""} `, + }, + }); + return departments?.map(({ + Id: value, Name: label, + }) => ({ + value, + label, + })) || []; + }, + }, }, methods: { _companyId() { @@ -354,6 +502,20 @@ export default { params, }, $); }, + getApAgingReport({ + $, params, + }) { + return this._makeRequest(`company/${this._companyId()}/reports/AgedPayableDetail`, { + params, + }, $); + }, + getProfitLossReport({ + $, params, + }) { + return this._makeRequest(`company/${this._companyId()}/reports/ProfitAndLoss`, { + params, + }, $); + }, async *paginate({ fn, params = {}, fieldList, query, maxResults = null, ...opts }) { diff --git a/components/quickbooks/sources/new-customer-created/new-customer-created.mjs b/components/quickbooks/sources/new-customer-created/new-customer-created.mjs index 4e4672910f85f..1e4d533c14d38 100644 --- a/components/quickbooks/sources/new-customer-created/new-customer-created.mjs +++ b/components/quickbooks/sources/new-customer-created/new-customer-created.mjs @@ -6,7 +6,7 @@ export default { key: "quickbooks-new-customer-created", name: "New Customer Created", description: "Emit new event when a new customer is created.", - version: "0.0.2", + version: "0.0.3", type: "source", dedupe: "unique", methods: { diff --git a/components/quickbooks/sources/new-customer-updated/new-customer-updated.mjs b/components/quickbooks/sources/new-customer-updated/new-customer-updated.mjs index cc65e923c5350..9525dbdd22ca2 100644 --- a/components/quickbooks/sources/new-customer-updated/new-customer-updated.mjs +++ b/components/quickbooks/sources/new-customer-updated/new-customer-updated.mjs @@ -6,7 +6,7 @@ export default { key: "quickbooks-new-customer-updated", name: "New Customer Updated", description: "Emit new event when a customer is updated.", - version: "0.0.2", + version: "0.0.3", type: "source", dedupe: "unique", methods: { diff --git a/components/quickbooks/sources/new-invoice-created/new-invoice-created.mjs b/components/quickbooks/sources/new-invoice-created/new-invoice-created.mjs index 78981811cc033..b59049a23143b 100644 --- a/components/quickbooks/sources/new-invoice-created/new-invoice-created.mjs +++ b/components/quickbooks/sources/new-invoice-created/new-invoice-created.mjs @@ -6,7 +6,7 @@ export default { key: "quickbooks-new-invoice-created", name: "New Invoice Created", description: "Emit new event when a new invoice is created.", - version: "0.0.2", + version: "0.0.3", type: "source", dedupe: "unique", methods: { diff --git a/components/quickbooks/sources/new-invoice-updated/new-invoice-updated.mjs b/components/quickbooks/sources/new-invoice-updated/new-invoice-updated.mjs index 79f19f1965357..f9d2f68c20417 100644 --- a/components/quickbooks/sources/new-invoice-updated/new-invoice-updated.mjs +++ b/components/quickbooks/sources/new-invoice-updated/new-invoice-updated.mjs @@ -6,7 +6,7 @@ export default { key: "quickbooks-new-invoice-updated", name: "New Invoice Updated", description: "Emit new event when an invoice is updated.", - version: "0.0.2", + version: "0.0.3", type: "source", dedupe: "unique", methods: { diff --git a/components/quickbooks/sources/new-item-created/new-item-created.mjs b/components/quickbooks/sources/new-item-created/new-item-created.mjs index 6a19ced4a2e01..e0f890385281e 100644 --- a/components/quickbooks/sources/new-item-created/new-item-created.mjs +++ b/components/quickbooks/sources/new-item-created/new-item-created.mjs @@ -6,7 +6,7 @@ export default { key: "quickbooks-new-item-created", name: "New Item Created", description: "Emit new event when a new item is created.", - version: "0.0.2", + version: "0.0.3", type: "source", dedupe: "unique", methods: { diff --git a/components/quickbooks/sources/new-item-updated/new-item-updated.mjs b/components/quickbooks/sources/new-item-updated/new-item-updated.mjs index 01d5b38c12b23..02a64206cb400 100644 --- a/components/quickbooks/sources/new-item-updated/new-item-updated.mjs +++ b/components/quickbooks/sources/new-item-updated/new-item-updated.mjs @@ -6,7 +6,7 @@ export default { key: "quickbooks-new-item-updated", name: "New Item Updated", description: "Emit new event when an item is updated.", - version: "0.0.2", + version: "0.0.3", type: "source", dedupe: "unique", methods: {