@happyvertical/accounting 0.100.3 → 0.101.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.
package/README.md CHANGED
@@ -4,6 +4,50 @@ Provider-neutral accounting synchronization with Stripe billing support.
4
4
 
5
5
  ## QuickBooks invoice creation and retries
6
6
 
7
+ QuickBooks sales lines can carry explicit references to existing entities in the
8
+ target company:
9
+
10
+ ```ts
11
+ const invoice = {
12
+ // ...provider-neutral invoice fields...
13
+ currency: 'CAD',
14
+ subtotal: 100,
15
+ taxAmount: 5,
16
+ totalAmount: 105,
17
+ quickbooksMapping: { globalTaxCalculation: 'TaxExcluded' },
18
+ lineItems: [
19
+ {
20
+ description: 'Reviewed work',
21
+ quantity: 1,
22
+ unitPrice: 100,
23
+ quickbooksMapping: {
24
+ itemRef: '123', // Item.Id in this QuickBooks company
25
+ taxCodeRef: 'GST', // TaxCode.Id in this QuickBooks company
26
+ },
27
+ },
28
+ ],
29
+ };
30
+ ```
31
+
32
+ The QuickBooks adapter maps these values to `SalesItemLineDetail.ItemRef`,
33
+ `SalesItemLineDetail.TaxCodeRef`, `GlobalTaxCalculation`, and
34
+ `TxnTaxDetail.TotalTax`. It supports `TaxExcluded` and zero-tax
35
+ `NotApplicable`; tax-inclusive inputs are rejected because the provider-neutral
36
+ line model does not allocate included tax. Every mapped line must supply both
37
+ realm-specific references. The caller must validate that those IDs belong to
38
+ the configured company. See Intuit's [invoice API](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/most-commonly-used/invoice)
39
+ and [item API](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/item).
40
+
41
+ Legacy untaxed invoices without `quickbooksMapping` remain supported. The
42
+ adapter fails before authentication or HTTP when an input would otherwise be
43
+ silently discarded: nonzero line `discount`, nonzero numeric `taxRate`, generic
44
+ `taxCode`, `automaticTax`, inconsistent totals, partial mappings, or invalid
45
+ references. Explicit zero `discount` and `taxRate` are accepted. This mapping
46
+ API has no discount representation and does not silently net discounts into
47
+ prices. An explicit line `amount` must agree with `quantity × unitPrice`; the
48
+ adapter compares ordinary decimal calculations without assuming a fixed number
49
+ of decimal places for every currency.
50
+
7
51
  Prepare a caller-owned request descriptor **once**, persist it with the approved
8
52
  invoice in your durable outbox, then pass it on every create attempt:
9
53
 
@@ -76,8 +120,7 @@ The [static documentation](https://static.developer.intuit.com/output_html/qbo/d
76
120
  confirms the 50-character limit and per-realm uniqueness requirement.
77
121
  Our regression tests mock remote acceptance and response loss; they prove SDK
78
122
  identity/byte preservation and retry policy, **not live Intuit deduplication**.
79
- No sandbox credentials were available for this change. Before relying on remote
80
- idempotency, verify in an authorized sandbox: send a uniquely identified invoice,
123
+ Before relying on remote idempotency, verify in an authorized sandbox: send a uniquely identified invoice,
81
124
  repeat the identical request with the same ID, confirm the same Invoice.Id and
82
125
  one invoice, and simulate a lost response before replaying it. Record realm,
83
126
  environment, request ID, timestamps, and returned IDs without credentials.
@@ -1,4 +1,4 @@
1
- import { a as __toCommonJS, i as __require, n as __esmMin, r as __exportAll, t as __commonJSMin } from "./quickbooks-DLkypnT9.js";
1
+ import { a as __toCommonJS, i as __require, n as __esmMin, r as __exportAll, t as __commonJSMin } from "./quickbooks-BJlHXQSw.js";
2
2
  //#region ../../node_modules/.pnpm/atob@2.1.2/node_modules/atob/browser-atob.js
3
3
  var require_browser_atob = /* @__PURE__ */ __commonJSMin(((exports, module) => {
4
4
  (function(w) {
@@ -18261,4 +18261,4 @@ var require_OAuthClient = /* @__PURE__ */ __commonJSMin(((exports, module) => {
18261
18261
  //#endregion
18262
18262
  export default require_OAuthClient();
18263
18263
 
18264
- //# sourceMappingURL=OAuthClient-CF65pAW_.js.map
18264
+ //# sourceMappingURL=OAuthClient-BbD5jYu3.js.map