conductor-node 3.2.1 → 3.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import type Client from "@conductor/client/Client";
1
+ import type Client from "./Client";
2
2
  export default class BaseClient {
3
3
  protected readonly root: Client;
4
4
  constructor(client: Client);
File without changes
@@ -1,5 +1,5 @@
1
- import type { Environment } from "@conductor/client/environment";
2
- import ClientQbd from "@conductor/client/qbd/ClientQbd";
1
+ import type { Environment } from "./environment";
2
+ import ClientQbd from "./qbd/ClientQbd";
3
3
  export interface ClientOptions {
4
4
  /** Log the each request and response. */
5
5
  verbose?: boolean;
@@ -3,8 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const environment_1 = require("@conductor/client/environment");
7
- const ClientQbd_1 = __importDefault(require("@conductor/client/qbd/ClientQbd"));
6
+ const environment_1 = require("./environment");
7
+ const ClientQbd_1 = __importDefault(require("./qbd/ClientQbd"));
8
8
  const graphql_request_1 = require("graphql-request");
9
9
  class Client {
10
10
  /** QuickBooks Desktop integration. */
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const Client_1 = __importDefault(require("@conductor/client/Client"));
6
+ const Client_1 = __importDefault(require("../Client"));
7
7
  describe("Client", () => {
8
8
  test("Create a new Client", () => {
9
9
  const client = new Client_1.default("mock_api_key");
File without changes
File without changes
@@ -1,5 +1,5 @@
1
- import BaseClient from "@conductor/client/BaseClient";
2
- import type * as qbd from "@conductor/client/qbd/qbdTypes";
1
+ import BaseClient from "../BaseClient";
2
+ import type * as qbd from "../qbd/qbdTypes";
3
3
  export default class ClientQbd extends BaseClient {
4
4
  account: {
5
5
  /**
@@ -28,6 +28,261 @@ export default class ClientQbd extends BaseClient {
28
28
  */
29
29
  query: (integrationUserConnectionId: string, params: qbd.AccountQueryRq) => Promise<NonNullable<qbd.AccountQueryRs["AccountRet"]>>;
30
30
  };
31
+ bill: {
32
+ /**
33
+ * This API provides the functionality of the QuickBooks “Enter Bills” form,
34
+ * which is used when the QuickBooks user owes money to a vendor, either
35
+ * through expenses incurred by the vendor (specified in the Expenses tab
36
+ * within the Enter Bills form), or through receiving items (specified in
37
+ * the Items tab within the Enter Bills form). When a bill is added,
38
+ * QuickBooks enters the billed amount into the `AccountsPayable` register.
39
+ *
40
+ * The Enter Bills form can be reached in the QuickBooks UI by selecting
41
+ * "Vendors" -> "Enter Bills", or by clicking on the Bill icon on the main
42
+ * menubar. Notice that the `ExpenseLineAdd` aggregate maps to a line item
43
+ * inside the Expense tab in the Enter Bills form, and the `ItemLineAdd`
44
+ * aggregate maps to a line item inside the Item tab.
45
+ *
46
+ * If you are receiving items against one or more open `PurchaseOrders` for
47
+ * the vendor, you can use the `LinkToTxnID` element (links in all line
48
+ * items from a `PurchaseOrder`) and/or the `LinkToTxn` aggregate within a
49
+ * line item (links in a specific `PurchaseOrder` line item).
50
+ * - See the chapter on handling receive payment and bill payment in the QB
51
+ * SDK Programmer’s Guide for complete details and rules: "The Life Cycle
52
+ * of Inventory Items and Effects of Sales and Purchases".
53
+ *
54
+ * The value of inventory is set when an inventory item is created or
55
+ * bought. QuickBooks uses cost averaging and decreases the value of the
56
+ * inventory asset account at the price when the sale is recorded.
57
+ *
58
+ * So, lets say a company starts carrying widgets as inventory items. First
59
+ * the inventory item must be created in QuickBooks. If the widgets are
60
+ * already in inventory based on a purchase made that will not be recorded
61
+ * in QuickBooks, the user or application would add the inventory item
62
+ * description along with the quantity on hand and the value (total purchase
63
+ * price) of the quantity on hand. If the purchase is to be recorded in
64
+ * QuickBooks the inventory item would be created with quantity and value of
65
+ * 0 (zero). Then a bill would be added to QB which would increase the
66
+ * inventory quantity and value. Lets say we bought 10 widgets for $100.
67
+ * QuickBooks would then consider each widget to be worth $10. The next day
68
+ * a customer buys 5 widgets for $20 each. A sales receipt or invoice is
69
+ * created for the purchase, the quantity of widgets is reduced by 5, to 5
70
+ * and the value is reduced by $50 to $50. The inventory asset account is
71
+ * reduced by $50 and the undeposited funds or accounts receivable account
72
+ * is increased by $100. It appears that widgets will be a big seller, so
73
+ * the small business owner goes out and buys 10 more widgets. However, the
74
+ * supplier has also noticed a widget buying trend, so he’s increased the
75
+ * price to $25 each. So now our quantity is increased from 5 to 15 and the
76
+ * value is increased from $50 to $300, so they are considered to be worth
77
+ * $20 each. After purchasing the widgets another customer decides to buy 10
78
+ * widgets but the price has been raised to $50 each. After the sales
79
+ * receipt or invoice is entered, the inventory is reduced to 5 and the
80
+ * value
81
+ *
82
+ * https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/BillAdd
83
+ */
84
+ add: (integrationUserConnectionId: string, params: qbd.BillAddRq["BillAdd"]) => Promise<NonNullable<qbd.BillAddRs["BillRet"]>>;
85
+ /**
86
+ * Edit an existing Bill, similar to editing a Bill in the Enter Bills form
87
+ * in the QuickBooks UI.
88
+ *
89
+ * Notice that you cannot link a `PurchaseOrder` to an existing Bill using
90
+ * the `BillMod` request. You can link to a `PurchaseOrder` only in new
91
+ * Bills, using `BillAdd`.
92
+ *
93
+ * Notice also that some fields in a `BillMod` request cannot be cleared. If
94
+ * any of the following fields is included in a bill modify request, it must
95
+ * contain a value:
96
+ * - `VendorRef`
97
+ * - `APAccountRef`
98
+ * - `TxnDate`
99
+ * - `DueDate`
100
+ * - `ClearExpenseLines`
101
+ * - `ClearItemLines`
102
+ *
103
+ * Within` ExpenseLineMod`:
104
+ * - `Amount`
105
+ * - `BillableStatus`
106
+ *
107
+ * Within `ItemLineMod` or `ItemGroupMod`:
108
+ * - `ItemRef`
109
+ * - `Quantity`
110
+ * - `Cost`
111
+ * - `Amount`
112
+ * - `BillableStatus`
113
+ * - `OverrideItemAccountRef`
114
+ *
115
+ * (For more details about what it means for a field to be clearable or not
116
+ * clearable, see the QB SDK Programmer’s Guide.)
117
+ *
118
+ * https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/BillMod
119
+ */
120
+ mod: (integrationUserConnectionId: string, params: qbd.BillModRq["BillMod"]) => Promise<NonNullable<qbd.BillModRs["BillRet"]>>;
121
+ /**
122
+ * Provides functionality found in the Find/Advanced-Find window to find
123
+ * bills that are to be paid by check. The Find/Advanced-Find windows can be
124
+ * reached by clicking the Find button on the main QuickBooks menubar, by
125
+ * selecting Edit->Find, or simply by using the shortcut CTRL-F. Notice that
126
+ * you can use the `metaData` attribute inside the query tag if you want
127
+ * only a count of the bills that will be returned from the query. If you
128
+ * know the bill’s transaction ID or reference number, you could use these,
129
+ * or search by transaction date, or search by the date where the bill was
130
+ * last modified. You can search for paid/unpaid bills by using the
131
+ * `PaidStatus` flag.
132
+ *
133
+ * If you need additional filters, you can use the entity filter to search
134
+ * for bills from a specific vendor or vendor sub (using the
135
+ * `ListIDWithChildren` or `FullNameWithChildren` tags). You can also search
136
+ * for bills entered against a particular account (the `APAccountRef`
137
+ * specified in the originating `BillAdd` request). You can specify all
138
+ * subaccounts by using the various `*WithChildren` tags. For example, to
139
+ * find all bills entered against Checking where you have multiple checking
140
+ * accounts, you would use the `ListIDWithChildren` or
141
+ * `FullNameWithChildren` tags inside your AccountFilter tags. You can
142
+ * filter on the `RefNumber` or `RefNumber` range. Notice that all of these
143
+ * filters can be used together (ANDed) if desired.
144
+ *
145
+ * If you want bill line items returned from the query, you must use the
146
+ * `IncludeLineItems` tag. Notice that you don’t specify line item groups.
147
+ * If line item groups were set up for the line items, the returned line
148
+ * items are automatically segregated by group.
149
+ *
150
+ * You can get all of the linked transactions such as `PurchaseOrders` and
151
+ * Credits by using the `IncludeLinkedTxns` tag. You can get public data
152
+ * extensions (these are custom data whose fields can be displayed in
153
+ * QuickBooks) by supplying the OwnerID tag set to 0. To get private data
154
+ * extensions (custom data not displayable in QuickBooks) you must use the
155
+ * `OwnerID` tag set to the known GUID value. You must know the GUID value
156
+ * in order to access private data extensions.
157
+ *
158
+ * To prevent the return of too much data, you can use `MaxReturned` to
159
+ * limit the total number of bills returned from the query. In addition, you
160
+ * can limit the type of data that is returned for each bill, using
161
+ * `IncludeRetElement`. Finally, you can specify whether each bill contains
162
+ * line items using the `IncludeLineItems`, which by default is False (no
163
+ * line item data).
164
+ *
165
+ * https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/BillQuery
166
+ */
167
+ query: (integrationUserConnectionId: string, params: qbd.BillQueryRq) => Promise<NonNullable<qbd.BillQueryRs["BillRet"]>>;
168
+ };
169
+ billPaymentCheck: {
170
+ /**
171
+ * A `BillPaymentCheckAdd` request must include either `PaymentAmount`,
172
+ * `SetCredit`, or `DiscountAmount` (or more than one of these). If none of
173
+ * these three is included, the SDK will return an error.
174
+ *
175
+ * Also, the `AppliedToTxnAdd` aggregate needs both the `TxnID` and the
176
+ * payment amount if you are not using the `SetCredit` sub-aggregate or
177
+ * QuickBooks won’t have an amount to apply. If you are using the
178
+ * `SetCredit` sub-aggregate, you’ll need to set the amount in the
179
+ * `AppliedAmount` field.
180
+ *
181
+ * `BillPaymentCheckAdd` provides the functionality found in the Pay Bills
182
+ * form in the QuickBooks UI. You can reach this form by selecting "Retail"
183
+ * -> "Pay Bills" from the main QuickBooks menubar. `BillPayment` is
184
+ * described in detail in the chapter on handling receive payment and bill
185
+ * payment in the QB SDK Programmer’s Guide. Notice that you can supply only
186
+ * one of these sub aggregates in the request. If you want to pay multiple
187
+ * bills, you must issue a separate request for each bill pay.
188
+ *
189
+ * If you are using more than one A/P account, make sure that the
190
+ * `APAccountRef` in the `BillPaymentCheckAdd` matches the `APAccountRef`
191
+ * that was used when the Bill was originally added. That is, the Bill was
192
+ * entered in a particular account payable: use that same account payable
193
+ * when you pay the bill using this request.
194
+ *
195
+ * Notice that although you can set the `IsToBePrinted` flag, you cannot
196
+ * print checks using the SDK.
197
+ *
198
+ * Notice that you set the check number, if desired, using the `RefNumber`
199
+ * tags.
200
+ *
201
+ * https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/BillPaymentCheckAdd
202
+ */
203
+ add: (integrationUserConnectionId: string, params: qbd.BillPaymentCheckAddRq["BillPaymentCheckAdd"]) => Promise<NonNullable<qbd.BillPaymentCheckAddRs["BillPaymentCheckRet"]>>;
204
+ /**
205
+ * Modifies the specified bill payment check.
206
+ *
207
+ * Note: the `AppliedToTxnMod` aggregate needs both the `TxnID` and the
208
+ * payment amount if you are not using the `SetCredit` sub-aggregate or
209
+ * QuickBooks won’t have an amount to apply. If you are using the
210
+ * `SetCredit` sub-aggregate, you’ll need to set the amount in the
211
+ * `AppliedAmount` field.
212
+ *
213
+ * Generally, this is what you can do with `BillPaymentCheckMod`:
214
+ * - Modify or clear the `RefNumber` or Memo.
215
+ * - Modify (not clear) the `TxnDate`.
216
+ * - Modify (not clear) the `BankAccountRef`
217
+ * - Modify (not clear) the `IsToBePrinted` flag.
218
+ * - For a bill payment check transaction that has been applied to several
219
+ * existing bills, redistribute the payment amounts applied to the bills.
220
+ * - Change the discount amount applied to particular bill.
221
+ * - You CANNOT change the credit amount applied to a particular bill. NOT
222
+ * SUPPORTED!
223
+ * - Apply the payment amount to a different bill. Apply a discount, and a
224
+ * credit. The existing distribution is cleared, except for any credit
225
+ * that may have been applied.
226
+ * - Use a `BillPaymentCheckMod` to simply apply an additional credit to a
227
+ * bill. Additional payment amount is available as a credit
228
+ *
229
+ * Other things you need to know: When a `BillPaymentCheckMod` request is
230
+ * processed, if the `AppliedToTxnMod` aggregate is specified, then the
231
+ * existing payments and discounts will be cleared (but not the credits).
232
+ * The original payment amount will be redistributed according to the
233
+ * `AppliedToTxnMod` aggregates (0 or more) contained in the
234
+ * `BillPaymentCheckMod` request. The `AppliedToTxnMod` aggregate may
235
+ * specify discounts, just as does the `AppliedToTxnAdd` aggregate. These
236
+ * discounts will replace any original discounts. Credits may also be
237
+ * specified. But if so, then the credits will be additional credits, and
238
+ * will not affect any credits that were originally applied. The existing
239
+ * payments and discounts will be cleared only if `AppliedToTxnMod` is
240
+ * specified in the request. This will allow clients to modify other
241
+ * information without modifying the distribution of the payment.
242
+ *
243
+ * In summary, in the `BillPaymentCheckMod` request, in the
244
+ * `AppliedToTxnMod` aggregate, discounts replace those given in the
245
+ * original payment. However credits simply add to any credits that may have
246
+ * been applied before.
247
+ *
248
+ * https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/BillPaymentCheckMod
249
+ */
250
+ mod: (integrationUserConnectionId: string, params: qbd.BillPaymentCheckModRq["BillPaymentCheckMod"]) => Promise<NonNullable<qbd.BillPaymentCheckModRs["BillPaymentCheckRet"]>>;
251
+ /**
252
+ * Provides functionality found in the Find/Advanced-Find window to find
253
+ * bill payments paid by check. The Find/Advanced-Find windows can be
254
+ * reached by clicking the Find button on the main QuickBooks menubar, by
255
+ * selecting Edit->Find, or simply by using the shortcut CTRL-F. Notice that
256
+ * you can use the `metaData` attribute inside the query tag if you want
257
+ * only a count of the bill payments that will be returned from the query.
258
+ *
259
+ * If you know the bill payment transaction ID or reference number, you
260
+ * could use these, or search by transaction date, or search by the date
261
+ * where the bill was last modified.
262
+ *
263
+ * If you need additional filters, you can use the entity filter to search
264
+ * for bills from a specific vendor or vendor sub (using the
265
+ * `ListIDWithChildren` or `FullNameWithChildren` tags). You can also search
266
+ * for bills entered against a particular account (the `APAccountRef`
267
+ * specified in the originating `BillAdd` request). You can specify all
268
+ * subaccounts by using the various `*WithChildren` tags. For example, to
269
+ * find all bills entered against Checking where you have multiple checking
270
+ * accounts, you would use the `ListIDWithChildren` or
271
+ * `FullNameWithChildren` tags inside your `AccountFilter` tags. Finally,
272
+ * you can filter on the `RefNumber` or `RefNumber` range. Notice that all
273
+ * of these filters can be used together (ANDed) if desired.
274
+ *
275
+ * To prevent the return of too much data, you can use `MaxReturned` to limit
276
+ * the total number of bills returned from the query. In addition, you can
277
+ * limit the type of data that is returned for each bill, using
278
+ * `IncludeRetElement`. Finally, you can specify whether each bill contains
279
+ * line items using the `IncludeLineItems`, which by default is `False` (no
280
+ * line item data).
281
+ *
282
+ * https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/BillPaymentCheckQuery
283
+ */
284
+ query: (integrationUserConnectionId: string, params: qbd.BillPaymentCheckQueryRq) => Promise<NonNullable<qbd.BillPaymentCheckQueryRs["BillPaymentCheckRet"]>>;
285
+ };
31
286
  check: {
32
287
  /**
33
288
  * The amount of a check is the total of the amounts assigned to expense
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const BaseClient_1 = __importDefault(require("@conductor/client/BaseClient"));
6
+ const BaseClient_1 = __importDefault(require("../BaseClient"));
7
7
  class ClientQbd extends BaseClient_1.default {
8
8
  account = {
9
9
  /**
@@ -32,6 +32,261 @@ class ClientQbd extends BaseClient_1.default {
32
32
  */
33
33
  query: async (integrationUserConnectionId, params) => this.sendRequestBase(integrationUserConnectionId, { AccountQueryRq: params }, "AccountQueryRs", "AccountRet"),
34
34
  };
35
+ bill = {
36
+ /**
37
+ * This API provides the functionality of the QuickBooks “Enter Bills” form,
38
+ * which is used when the QuickBooks user owes money to a vendor, either
39
+ * through expenses incurred by the vendor (specified in the Expenses tab
40
+ * within the Enter Bills form), or through receiving items (specified in
41
+ * the Items tab within the Enter Bills form). When a bill is added,
42
+ * QuickBooks enters the billed amount into the `AccountsPayable` register.
43
+ *
44
+ * The Enter Bills form can be reached in the QuickBooks UI by selecting
45
+ * "Vendors" -> "Enter Bills", or by clicking on the Bill icon on the main
46
+ * menubar. Notice that the `ExpenseLineAdd` aggregate maps to a line item
47
+ * inside the Expense tab in the Enter Bills form, and the `ItemLineAdd`
48
+ * aggregate maps to a line item inside the Item tab.
49
+ *
50
+ * If you are receiving items against one or more open `PurchaseOrders` for
51
+ * the vendor, you can use the `LinkToTxnID` element (links in all line
52
+ * items from a `PurchaseOrder`) and/or the `LinkToTxn` aggregate within a
53
+ * line item (links in a specific `PurchaseOrder` line item).
54
+ * - See the chapter on handling receive payment and bill payment in the QB
55
+ * SDK Programmer’s Guide for complete details and rules: "The Life Cycle
56
+ * of Inventory Items and Effects of Sales and Purchases".
57
+ *
58
+ * The value of inventory is set when an inventory item is created or
59
+ * bought. QuickBooks uses cost averaging and decreases the value of the
60
+ * inventory asset account at the price when the sale is recorded.
61
+ *
62
+ * So, lets say a company starts carrying widgets as inventory items. First
63
+ * the inventory item must be created in QuickBooks. If the widgets are
64
+ * already in inventory based on a purchase made that will not be recorded
65
+ * in QuickBooks, the user or application would add the inventory item
66
+ * description along with the quantity on hand and the value (total purchase
67
+ * price) of the quantity on hand. If the purchase is to be recorded in
68
+ * QuickBooks the inventory item would be created with quantity and value of
69
+ * 0 (zero). Then a bill would be added to QB which would increase the
70
+ * inventory quantity and value. Lets say we bought 10 widgets for $100.
71
+ * QuickBooks would then consider each widget to be worth $10. The next day
72
+ * a customer buys 5 widgets for $20 each. A sales receipt or invoice is
73
+ * created for the purchase, the quantity of widgets is reduced by 5, to 5
74
+ * and the value is reduced by $50 to $50. The inventory asset account is
75
+ * reduced by $50 and the undeposited funds or accounts receivable account
76
+ * is increased by $100. It appears that widgets will be a big seller, so
77
+ * the small business owner goes out and buys 10 more widgets. However, the
78
+ * supplier has also noticed a widget buying trend, so he’s increased the
79
+ * price to $25 each. So now our quantity is increased from 5 to 15 and the
80
+ * value is increased from $50 to $300, so they are considered to be worth
81
+ * $20 each. After purchasing the widgets another customer decides to buy 10
82
+ * widgets but the price has been raised to $50 each. After the sales
83
+ * receipt or invoice is entered, the inventory is reduced to 5 and the
84
+ * value
85
+ *
86
+ * https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/BillAdd
87
+ */
88
+ add: async (integrationUserConnectionId, params) => this.sendRequestBase(integrationUserConnectionId, { BillAddRq: { BillAdd: params } }, "BillAddRs", "BillRet"),
89
+ /**
90
+ * Edit an existing Bill, similar to editing a Bill in the Enter Bills form
91
+ * in the QuickBooks UI.
92
+ *
93
+ * Notice that you cannot link a `PurchaseOrder` to an existing Bill using
94
+ * the `BillMod` request. You can link to a `PurchaseOrder` only in new
95
+ * Bills, using `BillAdd`.
96
+ *
97
+ * Notice also that some fields in a `BillMod` request cannot be cleared. If
98
+ * any of the following fields is included in a bill modify request, it must
99
+ * contain a value:
100
+ * - `VendorRef`
101
+ * - `APAccountRef`
102
+ * - `TxnDate`
103
+ * - `DueDate`
104
+ * - `ClearExpenseLines`
105
+ * - `ClearItemLines`
106
+ *
107
+ * Within` ExpenseLineMod`:
108
+ * - `Amount`
109
+ * - `BillableStatus`
110
+ *
111
+ * Within `ItemLineMod` or `ItemGroupMod`:
112
+ * - `ItemRef`
113
+ * - `Quantity`
114
+ * - `Cost`
115
+ * - `Amount`
116
+ * - `BillableStatus`
117
+ * - `OverrideItemAccountRef`
118
+ *
119
+ * (For more details about what it means for a field to be clearable or not
120
+ * clearable, see the QB SDK Programmer’s Guide.)
121
+ *
122
+ * https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/BillMod
123
+ */
124
+ mod: async (integrationUserConnectionId, params) => this.sendRequestBase(integrationUserConnectionId, { BillModRq: { BillMod: params } }, "BillModRs", "BillRet"),
125
+ /**
126
+ * Provides functionality found in the Find/Advanced-Find window to find
127
+ * bills that are to be paid by check. The Find/Advanced-Find windows can be
128
+ * reached by clicking the Find button on the main QuickBooks menubar, by
129
+ * selecting Edit->Find, or simply by using the shortcut CTRL-F. Notice that
130
+ * you can use the `metaData` attribute inside the query tag if you want
131
+ * only a count of the bills that will be returned from the query. If you
132
+ * know the bill’s transaction ID or reference number, you could use these,
133
+ * or search by transaction date, or search by the date where the bill was
134
+ * last modified. You can search for paid/unpaid bills by using the
135
+ * `PaidStatus` flag.
136
+ *
137
+ * If you need additional filters, you can use the entity filter to search
138
+ * for bills from a specific vendor or vendor sub (using the
139
+ * `ListIDWithChildren` or `FullNameWithChildren` tags). You can also search
140
+ * for bills entered against a particular account (the `APAccountRef`
141
+ * specified in the originating `BillAdd` request). You can specify all
142
+ * subaccounts by using the various `*WithChildren` tags. For example, to
143
+ * find all bills entered against Checking where you have multiple checking
144
+ * accounts, you would use the `ListIDWithChildren` or
145
+ * `FullNameWithChildren` tags inside your AccountFilter tags. You can
146
+ * filter on the `RefNumber` or `RefNumber` range. Notice that all of these
147
+ * filters can be used together (ANDed) if desired.
148
+ *
149
+ * If you want bill line items returned from the query, you must use the
150
+ * `IncludeLineItems` tag. Notice that you don’t specify line item groups.
151
+ * If line item groups were set up for the line items, the returned line
152
+ * items are automatically segregated by group.
153
+ *
154
+ * You can get all of the linked transactions such as `PurchaseOrders` and
155
+ * Credits by using the `IncludeLinkedTxns` tag. You can get public data
156
+ * extensions (these are custom data whose fields can be displayed in
157
+ * QuickBooks) by supplying the OwnerID tag set to 0. To get private data
158
+ * extensions (custom data not displayable in QuickBooks) you must use the
159
+ * `OwnerID` tag set to the known GUID value. You must know the GUID value
160
+ * in order to access private data extensions.
161
+ *
162
+ * To prevent the return of too much data, you can use `MaxReturned` to
163
+ * limit the total number of bills returned from the query. In addition, you
164
+ * can limit the type of data that is returned for each bill, using
165
+ * `IncludeRetElement`. Finally, you can specify whether each bill contains
166
+ * line items using the `IncludeLineItems`, which by default is False (no
167
+ * line item data).
168
+ *
169
+ * https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/BillQuery
170
+ */
171
+ query: async (integrationUserConnectionId, params) => this.sendRequestBase(integrationUserConnectionId, { BillQueryRq: params }, "BillQueryRs", "BillRet"),
172
+ };
173
+ billPaymentCheck = {
174
+ /**
175
+ * A `BillPaymentCheckAdd` request must include either `PaymentAmount`,
176
+ * `SetCredit`, or `DiscountAmount` (or more than one of these). If none of
177
+ * these three is included, the SDK will return an error.
178
+ *
179
+ * Also, the `AppliedToTxnAdd` aggregate needs both the `TxnID` and the
180
+ * payment amount if you are not using the `SetCredit` sub-aggregate or
181
+ * QuickBooks won’t have an amount to apply. If you are using the
182
+ * `SetCredit` sub-aggregate, you’ll need to set the amount in the
183
+ * `AppliedAmount` field.
184
+ *
185
+ * `BillPaymentCheckAdd` provides the functionality found in the Pay Bills
186
+ * form in the QuickBooks UI. You can reach this form by selecting "Retail"
187
+ * -> "Pay Bills" from the main QuickBooks menubar. `BillPayment` is
188
+ * described in detail in the chapter on handling receive payment and bill
189
+ * payment in the QB SDK Programmer’s Guide. Notice that you can supply only
190
+ * one of these sub aggregates in the request. If you want to pay multiple
191
+ * bills, you must issue a separate request for each bill pay.
192
+ *
193
+ * If you are using more than one A/P account, make sure that the
194
+ * `APAccountRef` in the `BillPaymentCheckAdd` matches the `APAccountRef`
195
+ * that was used when the Bill was originally added. That is, the Bill was
196
+ * entered in a particular account payable: use that same account payable
197
+ * when you pay the bill using this request.
198
+ *
199
+ * Notice that although you can set the `IsToBePrinted` flag, you cannot
200
+ * print checks using the SDK.
201
+ *
202
+ * Notice that you set the check number, if desired, using the `RefNumber`
203
+ * tags.
204
+ *
205
+ * https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/BillPaymentCheckAdd
206
+ */
207
+ add: async (integrationUserConnectionId, params) => this.sendRequestBase(integrationUserConnectionId, { BillPaymentCheckAddRq: { BillPaymentCheckAdd: params } }, "BillPaymentCheckAddRs", "BillPaymentCheckRet"),
208
+ /**
209
+ * Modifies the specified bill payment check.
210
+ *
211
+ * Note: the `AppliedToTxnMod` aggregate needs both the `TxnID` and the
212
+ * payment amount if you are not using the `SetCredit` sub-aggregate or
213
+ * QuickBooks won’t have an amount to apply. If you are using the
214
+ * `SetCredit` sub-aggregate, you’ll need to set the amount in the
215
+ * `AppliedAmount` field.
216
+ *
217
+ * Generally, this is what you can do with `BillPaymentCheckMod`:
218
+ * - Modify or clear the `RefNumber` or Memo.
219
+ * - Modify (not clear) the `TxnDate`.
220
+ * - Modify (not clear) the `BankAccountRef`
221
+ * - Modify (not clear) the `IsToBePrinted` flag.
222
+ * - For a bill payment check transaction that has been applied to several
223
+ * existing bills, redistribute the payment amounts applied to the bills.
224
+ * - Change the discount amount applied to particular bill.
225
+ * - You CANNOT change the credit amount applied to a particular bill. NOT
226
+ * SUPPORTED!
227
+ * - Apply the payment amount to a different bill. Apply a discount, and a
228
+ * credit. The existing distribution is cleared, except for any credit
229
+ * that may have been applied.
230
+ * - Use a `BillPaymentCheckMod` to simply apply an additional credit to a
231
+ * bill. Additional payment amount is available as a credit
232
+ *
233
+ * Other things you need to know: When a `BillPaymentCheckMod` request is
234
+ * processed, if the `AppliedToTxnMod` aggregate is specified, then the
235
+ * existing payments and discounts will be cleared (but not the credits).
236
+ * The original payment amount will be redistributed according to the
237
+ * `AppliedToTxnMod` aggregates (0 or more) contained in the
238
+ * `BillPaymentCheckMod` request. The `AppliedToTxnMod` aggregate may
239
+ * specify discounts, just as does the `AppliedToTxnAdd` aggregate. These
240
+ * discounts will replace any original discounts. Credits may also be
241
+ * specified. But if so, then the credits will be additional credits, and
242
+ * will not affect any credits that were originally applied. The existing
243
+ * payments and discounts will be cleared only if `AppliedToTxnMod` is
244
+ * specified in the request. This will allow clients to modify other
245
+ * information without modifying the distribution of the payment.
246
+ *
247
+ * In summary, in the `BillPaymentCheckMod` request, in the
248
+ * `AppliedToTxnMod` aggregate, discounts replace those given in the
249
+ * original payment. However credits simply add to any credits that may have
250
+ * been applied before.
251
+ *
252
+ * https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/BillPaymentCheckMod
253
+ */
254
+ mod: async (integrationUserConnectionId, params) => this.sendRequestBase(integrationUserConnectionId, { BillPaymentCheckModRq: { BillPaymentCheckMod: params } }, "BillPaymentCheckModRs", "BillPaymentCheckRet"),
255
+ /**
256
+ * Provides functionality found in the Find/Advanced-Find window to find
257
+ * bill payments paid by check. The Find/Advanced-Find windows can be
258
+ * reached by clicking the Find button on the main QuickBooks menubar, by
259
+ * selecting Edit->Find, or simply by using the shortcut CTRL-F. Notice that
260
+ * you can use the `metaData` attribute inside the query tag if you want
261
+ * only a count of the bill payments that will be returned from the query.
262
+ *
263
+ * If you know the bill payment transaction ID or reference number, you
264
+ * could use these, or search by transaction date, or search by the date
265
+ * where the bill was last modified.
266
+ *
267
+ * If you need additional filters, you can use the entity filter to search
268
+ * for bills from a specific vendor or vendor sub (using the
269
+ * `ListIDWithChildren` or `FullNameWithChildren` tags). You can also search
270
+ * for bills entered against a particular account (the `APAccountRef`
271
+ * specified in the originating `BillAdd` request). You can specify all
272
+ * subaccounts by using the various `*WithChildren` tags. For example, to
273
+ * find all bills entered against Checking where you have multiple checking
274
+ * accounts, you would use the `ListIDWithChildren` or
275
+ * `FullNameWithChildren` tags inside your `AccountFilter` tags. Finally,
276
+ * you can filter on the `RefNumber` or `RefNumber` range. Notice that all
277
+ * of these filters can be used together (ANDed) if desired.
278
+ *
279
+ * To prevent the return of too much data, you can use `MaxReturned` to limit
280
+ * the total number of bills returned from the query. In addition, you can
281
+ * limit the type of data that is returned for each bill, using
282
+ * `IncludeRetElement`. Finally, you can specify whether each bill contains
283
+ * line items using the `IncludeLineItems`, which by default is `False` (no
284
+ * line item data).
285
+ *
286
+ * https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/BillPaymentCheckQuery
287
+ */
288
+ query: async (integrationUserConnectionId, params) => this.sendRequestBase(integrationUserConnectionId, { BillPaymentCheckQueryRq: params }, "BillPaymentCheckQueryRs", "BillPaymentCheckRet"),
289
+ };
35
290
  check = {
36
291
  /**
37
292
  * The amount of a check is the total of the amounts assigned to expense
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const Client_1 = __importDefault(require("@conductor/client/Client"));
6
+ const Client_1 = __importDefault(require("../../Client"));
7
7
  describe("ClientQbd", () => {
8
8
  const client = new Client_1.default("sk_test_miter", { environment: "staging" });
9
9
  jest.setTimeout(10000);