From 51134a5a8b9d13d95dd8765d16f87b682d9f0968 Mon Sep 17 00:00:00 2001 From: Adrian Pilarczyk Date: Wed, 17 May 2023 12:49:10 +0200 Subject: [PATCH] fix: returning 0 for line price if item is not taxable (#476) * fix: :bug: returning 0 for line price if item is not taxable * build: :construction_worker: add changeset --- .changeset/thin-owls-beg.md | 5 + .../maps/avatax-calculate-taxes-map.test.ts | 193 ++- .../avatax/maps/avatax-calculate-taxes-map.ts | 81 +- apps/taxes/src/modules/avatax/maps/mocks.ts | 1316 +++++++++++++++++ 4 files changed, 1466 insertions(+), 129 deletions(-) create mode 100644 .changeset/thin-owls-beg.md create mode 100644 apps/taxes/src/modules/avatax/maps/mocks.ts diff --git a/.changeset/thin-owls-beg.md b/.changeset/thin-owls-beg.md new file mode 100644 index 0000000..980c19a --- /dev/null +++ b/.changeset/thin-owls-beg.md @@ -0,0 +1,5 @@ +--- +"saleor-app-taxes": patch +--- + +Fix returning 0 for line price if Avatax returns isItemTaxable: false. This happens in, f.e., certain states in the US where there is no sales tax. After the fix, the app will fall back to the original line price. diff --git a/apps/taxes/src/modules/avatax/maps/avatax-calculate-taxes-map.test.ts b/apps/taxes/src/modules/avatax/maps/avatax-calculate-taxes-map.test.ts index c963c53..6d80b3d 100644 --- a/apps/taxes/src/modules/avatax/maps/avatax-calculate-taxes-map.test.ts +++ b/apps/taxes/src/modules/avatax/maps/avatax-calculate-taxes-map.test.ts @@ -1,111 +1,88 @@ import { describe, expect, it } from "vitest"; import { - AvataxCalculateTaxesMapPayloadArgs, - avataxCalculateTaxesMaps, + SHIPPING_ITEM_CODE, + mapPayloadLines, + mapResponseProductLines, + mapResponseShippingLine, } from "./avatax-calculate-taxes-map"; - -// * Mocked payload data, channel config and avatax config -const MOCKED_CALCULATE_TAXES_ARGS: AvataxCalculateTaxesMapPayloadArgs = { - taxBase: { - pricesEnteredWithTax: false, - currency: "PLN", - channel: { - slug: "channel-pln", - }, - sourceObject: { - __typename: "Order", - user: { - id: "VXNlcjo5ZjY3ZjY0Zi1iZjY5LTQ5ZjYtYjQ4Zi1iZjY3ZjY0ZjY0ZjY=", - }, - }, - discounts: [], - address: { - streetAddress1: "123 Palm Grove Ln", - streetAddress2: "", - city: "LOS ANGELES", - country: { - code: "US", - }, - countryArea: "CA", - postalCode: "90002", - }, - shippingPrice: { - amount: 48.33, - }, - lines: [ - { - quantity: 3, - unitPrice: { - amount: 84, - }, - totalPrice: { - amount: 252, - }, - sourceLine: { - __typename: "OrderLine", - id: "T3JkZXJMaW5lOmY1NGQ1MWY2LTc1OTctNGY2OC1hNDk0LTFjYjZlYjRmOTlhMQ==", - variant: { - id: "UHJvZHVjdFZhcmlhbnQ6MzQ2", - product: { - metafield: null, - productType: { - metafield: null, - }, - }, - }, - }, - }, - { - quantity: 1, - unitPrice: { - amount: 5.99, - }, - totalPrice: { - amount: 5.99, - }, - sourceLine: { - __typename: "OrderLine", - id: "T3JkZXJMaW5lOjU1NTFjNTFjLTM5MWQtNGI0Ny04MGU0LWVjY2Q5ZjU4MjQyNQ==", - variant: { - id: "UHJvZHVjdFZhcmlhbnQ6Mzg1", - product: { - metafield: null, - productType: { - metafield: null, - }, - }, - }, - }, - }, - ], - }, - channel: { - providerInstanceId: "b8c29f49-7cae-4762-8458-e9a27eb83081", - enabled: false, - address: { - country: "US", - zip: "92093", - state: "CA", - city: "La Jolla", - street: "9500 Gilman Drive", - }, - }, - config: { - companyCode: "DEFAULT", - isAutocommit: false, - isSandbox: true, - name: "Avatax-1", - password: "password", - username: "username", - shippingTaxCode: "FR000000", - }, -}; +import { mapPayloadArgsMocks, transactionModelMocks } from "./mocks"; describe("avataxCalculateTaxesMaps", () => { - describe.todo("mapResponse", () => { - it.todo("calculation of fields"); - it.todo("formatting the fields"); - it.todo("rounding of numbers"); + describe("mapResponseShippingLine", () => { + it("when shipping line is not taxable, returns line amount", () => { + const nonTaxableShippingLine = mapResponseShippingLine(transactionModelMocks.nonTaxable); + + expect(nonTaxableShippingLine).toEqual({ + shipping_price_gross_amount: 77.51, + shipping_price_net_amount: 77.51, + shipping_tax_rate: 0, + }); + }); + + it("when shipping line is taxable and tax is included, returns calculated gross & net amounts", () => { + const taxableShippingLine = mapResponseShippingLine( + transactionModelMocks.taxable.taxIncluded + ); + + expect(taxableShippingLine).toEqual({ + shipping_price_gross_amount: 77.51, + shipping_price_net_amount: 70.78, + shipping_tax_rate: 0, + }); + }); + + it("when shipping line is taxable and tax is not included, returns calculated gross & net amounts", () => { + const taxableShippingLine = mapResponseShippingLine( + transactionModelMocks.taxable.taxNotIncluded + ); + + expect(taxableShippingLine).toEqual({ + shipping_price_gross_amount: 84.87, + shipping_price_net_amount: 77.51, + shipping_tax_rate: 0, + }); + }); + }); + describe("mapResponseProductLines", () => { + it("when product lines are not taxable, returns line amount", () => { + const nonTaxableProductLines = mapResponseProductLines(transactionModelMocks.nonTaxable); + + expect(nonTaxableProductLines).toEqual([ + { + total_gross_amount: 20, + total_net_amount: 20, + tax_rate: 0, + }, + ]); + }); + + it("when product lines are taxable and tax is included, returns calculated gross & net amounts", () => { + const taxableProductLines = mapResponseProductLines( + transactionModelMocks.taxable.taxIncluded + ); + + expect(taxableProductLines).toEqual([ + { + total_gross_amount: 40, + total_net_amount: 36.53, + tax_rate: 0, + }, + ]); + }); + + it("when product lines are taxable and tax is not included, returns calculated gross & net amounts", () => { + const taxableProductLines = mapResponseProductLines( + transactionModelMocks.taxable.taxNotIncluded + ); + + expect(taxableProductLines).toEqual([ + { + total_gross_amount: 43.8, + total_net_amount: 40, + tax_rate: 0, + }, + ]); + }); }); describe.todo("mapPayload", () => { it.todo("calculation of fields"); @@ -113,17 +90,17 @@ describe("avataxCalculateTaxesMaps", () => { it.todo("rounding of numbers"); }); describe("mapLines", () => { - const lines = avataxCalculateTaxesMaps.mapLines( - MOCKED_CALCULATE_TAXES_ARGS.taxBase, - MOCKED_CALCULATE_TAXES_ARGS.config + const lines = mapPayloadLines( + mapPayloadArgsMocks.default.taxBase, + mapPayloadArgsMocks.default.config ); it("includes shipping as a line", () => { expect(lines).toContainEqual({ - itemCode: avataxCalculateTaxesMaps.shippingItemCode, + itemCode: SHIPPING_ITEM_CODE, quantity: 1, amount: 48.33, - taxCode: MOCKED_CALCULATE_TAXES_ARGS.config.shippingTaxCode, + taxCode: mapPayloadArgsMocks.default.config.shippingTaxCode, taxIncluded: false, }); }); diff --git a/apps/taxes/src/modules/avatax/maps/avatax-calculate-taxes-map.ts b/apps/taxes/src/modules/avatax/maps/avatax-calculate-taxes-map.ts index f976879..d5d8b75 100644 --- a/apps/taxes/src/modules/avatax/maps/avatax-calculate-taxes-map.ts +++ b/apps/taxes/src/modules/avatax/maps/avatax-calculate-taxes-map.ts @@ -14,9 +14,9 @@ import { avataxAddressFactory } from "./address-factory"; * * Shipping is a regular line item in Avatax * https://developer.avalara.com/avatax/dev-guide/shipping-and-handling/taxability-of-shipping-charges/ */ -const SHIPPING_ITEM_CODE = "Shipping"; +export const SHIPPING_ITEM_CODE = "Shipping"; -function mapLines(taxBase: TaxBaseFragment, config: AvataxConfig): LineItemModel[] { +export function mapPayloadLines(taxBase: TaxBaseFragment, config: AvataxConfig): LineItemModel[] { const productLines = taxBase.lines.map((line) => ({ amount: line.totalPrice.amount, taxIncluded: taxBase.pricesEnteredWithTax, @@ -62,49 +62,88 @@ const mapPayload = (props: AvataxCalculateTaxesMapPayloadArgs): CreateTransactio shipTo: avataxAddressFactory.fromSaleorAddress(taxBase.address!), }, currencyCode: taxBase.currency, - lines: mapLines(taxBase, config), + lines: mapPayloadLines(taxBase, config), date: new Date(), }, }; }; -const mapResponse = (transaction: TransactionModel): CalculateTaxesResponse => { +export function mapResponseShippingLine( + transaction: TransactionModel +): Pick< + CalculateTaxesResponse, + "shipping_price_gross_amount" | "shipping_price_net_amount" | "shipping_tax_rate" +> { const shippingLine = transaction.lines?.find((line) => line.itemCode === SHIPPING_ITEM_CODE); - const productLines = transaction.lines?.filter((line) => line.itemCode !== SHIPPING_ITEM_CODE); + if (!shippingLine?.isItemTaxable) { + return { + shipping_price_gross_amount: shippingLine?.lineAmount ?? 0, + shipping_price_net_amount: shippingLine?.lineAmount ?? 0, + /* + * avatax doesnt return combined tax rate + * // todo: calculate percentage tax rate + */ + shipping_tax_rate: 0, + }; + } + const shippingTaxCalculated = shippingLine?.taxCalculated ?? 0; const shippingTaxableAmount = shippingLine?.taxableAmount ?? 0; const shippingGrossAmount = numbers.roundFloatToTwoDecimals( shippingTaxableAmount + shippingTaxCalculated ); - const shippingNetAmount = shippingGrossAmount; return { shipping_price_gross_amount: shippingGrossAmount, - shipping_price_net_amount: shippingNetAmount, - // todo: add shipping tax rate + shipping_price_net_amount: shippingTaxableAmount, shipping_tax_rate: 0, - lines: - productLines?.map((line) => { - const lineTaxCalculated = line.taxCalculated ?? 0; - const lineTotalNetAmount = line.taxableAmount ?? 0; - const lineTotalGrossAmount = numbers.roundFloatToTwoDecimals( - lineTotalNetAmount + lineTaxCalculated - ); + }; +} +export function mapResponseProductLines( + transaction: TransactionModel +): CalculateTaxesResponse["lines"] { + const productLines = transaction.lines?.filter((line) => line.itemCode !== SHIPPING_ITEM_CODE); + + return ( + productLines?.map((line) => { + if (!line.isItemTaxable) { return { - total_gross_amount: lineTotalGrossAmount, - total_net_amount: lineTotalNetAmount, - // todo: add tax rate + total_gross_amount: line.lineAmount ?? 0, + total_net_amount: line.lineAmount ?? 0, tax_rate: 0, }; - }) ?? [], + } + + const lineTaxCalculated = line.taxCalculated ?? 0; + const lineTotalNetAmount = line.taxableAmount ?? 0; + const lineTotalGrossAmount = numbers.roundFloatToTwoDecimals( + lineTotalNetAmount + lineTaxCalculated + ); + + return { + total_gross_amount: lineTotalGrossAmount, + total_net_amount: lineTotalNetAmount, + /* + * avatax doesnt return combined tax rate + * // todo: calculate percentage tax rate + */ tax_rate: 0, + }; + }) ?? [] + ); +} + +const mapResponse = (transaction: TransactionModel): CalculateTaxesResponse => { + const shipping = mapResponseShippingLine(transaction); + + return { + ...shipping, + lines: mapResponseProductLines(transaction), }; }; export const avataxCalculateTaxesMaps = { mapPayload, mapResponse, - mapLines, - shippingItemCode: SHIPPING_ITEM_CODE, }; diff --git a/apps/taxes/src/modules/avatax/maps/mocks.ts b/apps/taxes/src/modules/avatax/maps/mocks.ts new file mode 100644 index 0000000..d1525d3 --- /dev/null +++ b/apps/taxes/src/modules/avatax/maps/mocks.ts @@ -0,0 +1,1316 @@ +import { AdjustmentReason } from "avatax/lib/enums/AdjustmentReason"; +import { BoundaryLevel } from "avatax/lib/enums/BoundaryLevel"; +import { ChargedTo } from "avatax/lib/enums/ChargedTo"; +import { DocumentStatus } from "avatax/lib/enums/DocumentStatus"; +import { DocumentType } from "avatax/lib/enums/DocumentType"; +import { JurisTypeId } from "avatax/lib/enums/JurisTypeId"; +import { JurisdictionType } from "avatax/lib/enums/JurisdictionType"; +import { LiabilityType } from "avatax/lib/enums/LiabilityType"; +import { RateType } from "avatax/lib/enums/RateType"; +import { TransactionModel } from "avatax/lib/models/TransactionModel"; +import { AvataxCalculateTaxesMapPayloadArgs } from "./avatax-calculate-taxes-map"; + +const TAXABLE_TAX_INCLUDED_TRANSACTION_MOCK: TransactionModel = { + id: 0, + code: "8fc875ce-a929-4556-9f30-0165b1597d9f", + companyId: 7799640, + date: new Date(), + paymentDate: new Date(), + status: DocumentStatus.Temporary, + type: DocumentType.SalesOrder, + batchCode: "", + currencyCode: "USD", + exchangeRateCurrencyCode: "USD", + customerUsageType: "", + entityUseCode: "", + customerVendorCode: "VXNlcjoyMDg0NTEwNDEw", + customerCode: "VXNlcjoyMDg0NTEwNDEw", + exemptNo: "", + reconciled: false, + locationCode: "", + reportingLocationCode: "", + purchaseOrderNo: "", + referenceCode: "", + salespersonCode: "", + totalAmount: 107.31, + totalExempt: 0, + totalDiscount: 0, + totalTax: 10.2, + totalTaxable: 107.31, + totalTaxCalculated: 10.2, + adjustmentReason: AdjustmentReason.NotAdjusted, + locked: false, + version: 1, + exchangeRateEffectiveDate: new Date(), + exchangeRate: 1, + modifiedDate: new Date(), + modifiedUserId: 6479978, + taxDate: new Date(), + lines: [ + { + id: 0, + transactionId: 0, + lineNumber: "1", + customerUsageType: "", + entityUseCode: "", + discountAmount: 0, + exemptAmount: 0, + exemptCertId: 0, + exemptNo: "", + isItemTaxable: true, + itemCode: "", + lineAmount: 36.53, + quantity: 2, + ref1: "", + ref2: "", + reportingDate: new Date(), + tax: 3.47, + taxableAmount: 36.53, + taxCalculated: 3.47, + taxCode: "P0000000", + taxCodeId: 8087, + taxDate: new Date(), + taxIncluded: true, + details: [ + { + id: 0, + transactionLineId: 0, + transactionId: 0, + country: "US", + region: "CA", + exemptAmount: 0, + jurisCode: "06", + jurisName: "CALIFORNIA", + stateAssignedNo: "", + jurisType: JurisTypeId.STA, + jurisdictionType: JurisdictionType.State, + nonTaxableAmount: 0, + rate: 0.06, + tax: 2.19, + taxableAmount: 36.53, + taxType: "Use", + taxSubTypeId: "U", + taxName: "CA STATE TAX", + taxAuthorityTypeId: 45, + taxCalculated: 2.19, + rateType: RateType.General, + rateTypeCode: "G", + unitOfBasis: "PerCurrencyUnit", + isNonPassThru: false, + isFee: false, + reportingTaxableUnits: 36.53, + reportingNonTaxableUnits: 0, + reportingExemptUnits: 0, + reportingTax: 2.19, + reportingTaxCalculated: 2.19, + liabilityType: LiabilityType.Seller, + chargedTo: ChargedTo.Buyer, + }, + { + id: 0, + transactionLineId: 0, + transactionId: 0, + country: "US", + region: "CA", + exemptAmount: 0, + jurisCode: "037", + jurisName: "LOS ANGELES", + stateAssignedNo: "", + jurisType: JurisTypeId.CTY, + jurisdictionType: JurisdictionType.County, + nonTaxableAmount: 0, + rate: 0.0025, + tax: 0.09, + taxableAmount: 36.53, + taxType: "Use", + taxSubTypeId: "U", + taxName: "CA COUNTY TAX", + taxAuthorityTypeId: 45, + taxCalculated: 0.09, + rateType: RateType.General, + rateTypeCode: "G", + unitOfBasis: "PerCurrencyUnit", + isNonPassThru: false, + isFee: false, + reportingTaxableUnits: 36.53, + reportingNonTaxableUnits: 0, + reportingExemptUnits: 0, + reportingTax: 0.09, + reportingTaxCalculated: 0.09, + liabilityType: LiabilityType.Seller, + chargedTo: ChargedTo.Buyer, + }, + { + id: 0, + transactionLineId: 0, + transactionId: 0, + country: "US", + region: "CA", + exemptAmount: 0, + jurisCode: "EMAR0", + jurisName: "LOS ANGELES COUNTY DISTRICT TAX SP", + stateAssignedNo: "594", + jurisType: JurisTypeId.STJ, + jurisdictionType: JurisdictionType.Special, + nonTaxableAmount: 0, + rate: 0.0225, + tax: 0.82, + taxableAmount: 36.53, + taxType: "Use", + taxSubTypeId: "U", + taxName: "CA SPECIAL TAX", + taxAuthorityTypeId: 45, + taxCalculated: 0.82, + rateType: RateType.General, + rateTypeCode: "G", + unitOfBasis: "PerCurrencyUnit", + isNonPassThru: false, + isFee: false, + reportingTaxableUnits: 36.53, + reportingNonTaxableUnits: 0, + reportingExemptUnits: 0, + reportingTax: 0.82, + reportingTaxCalculated: 0.82, + liabilityType: LiabilityType.Seller, + chargedTo: ChargedTo.Buyer, + }, + { + id: 0, + transactionLineId: 0, + transactionId: 0, + country: "US", + region: "CA", + exemptAmount: 0, + jurisCode: "EMTC0", + jurisName: "LOS ANGELES CO LOCAL TAX SL", + stateAssignedNo: "19", + jurisType: JurisTypeId.STJ, + jurisdictionType: JurisdictionType.Special, + nonTaxableAmount: 0, + rate: 0.01, + tax: 0.37, + taxableAmount: 36.53, + taxType: "Use", + taxSubTypeId: "U", + taxName: "CA SPECIAL TAX", + taxAuthorityTypeId: 45, + taxCalculated: 0.37, + rateType: RateType.General, + rateTypeCode: "G", + unitOfBasis: "PerCurrencyUnit", + isNonPassThru: false, + isFee: false, + reportingTaxableUnits: 36.53, + reportingNonTaxableUnits: 0, + reportingExemptUnits: 0, + reportingTax: 0.37, + reportingTaxCalculated: 0.37, + liabilityType: LiabilityType.Seller, + chargedTo: ChargedTo.Buyer, + }, + ], + nonPassthroughDetails: [], + hsCode: "", + costInsuranceFreight: 0, + vatCode: "", + vatNumberTypeId: 0, + }, + { + id: 0, + transactionId: 0, + lineNumber: "2", + customerUsageType: "", + entityUseCode: "", + discountAmount: 0, + exemptAmount: 0, + exemptCertId: 0, + exemptNo: "", + isItemTaxable: true, + itemCode: "Shipping", + lineAmount: 70.78, + quantity: 1, + ref1: "", + ref2: "", + reportingDate: new Date(), + tax: 6.73, + taxableAmount: 70.78, + taxCalculated: 6.73, + taxCode: "P0000000", + taxCodeId: 8087, + taxDate: new Date(), + taxIncluded: true, + details: [ + { + id: 0, + transactionLineId: 0, + transactionId: 0, + country: "US", + region: "CA", + exemptAmount: 0, + jurisCode: "06", + jurisName: "CALIFORNIA", + stateAssignedNo: "", + jurisType: JurisTypeId.STA, + jurisdictionType: JurisdictionType.State, + nonTaxableAmount: 0, + rate: 0.06, + tax: 4.25, + taxableAmount: 70.78, + taxType: "Use", + taxSubTypeId: "U", + taxName: "CA STATE TAX", + taxAuthorityTypeId: 45, + taxCalculated: 4.25, + rateType: RateType.General, + rateTypeCode: "G", + unitOfBasis: "PerCurrencyUnit", + isNonPassThru: false, + isFee: false, + reportingTaxableUnits: 70.78, + reportingNonTaxableUnits: 0, + reportingExemptUnits: 0, + reportingTax: 4.25, + reportingTaxCalculated: 4.25, + liabilityType: LiabilityType.Seller, + chargedTo: ChargedTo.Buyer, + }, + { + id: 0, + transactionLineId: 0, + transactionId: 0, + country: "US", + region: "CA", + exemptAmount: 0, + jurisCode: "037", + jurisName: "LOS ANGELES", + stateAssignedNo: "", + jurisType: JurisTypeId.CTY, + jurisdictionType: JurisdictionType.County, + nonTaxableAmount: 0, + rate: 0.0025, + tax: 0.18, + taxableAmount: 70.78, + taxType: "Use", + taxSubTypeId: "U", + taxName: "CA COUNTY TAX", + taxAuthorityTypeId: 45, + taxCalculated: 0.18, + rateType: RateType.General, + rateTypeCode: "G", + unitOfBasis: "PerCurrencyUnit", + isNonPassThru: false, + isFee: false, + reportingTaxableUnits: 70.78, + reportingNonTaxableUnits: 0, + reportingExemptUnits: 0, + reportingTax: 0.18, + reportingTaxCalculated: 0.18, + liabilityType: LiabilityType.Seller, + chargedTo: ChargedTo.Buyer, + }, + { + id: 0, + transactionLineId: 0, + transactionId: 0, + country: "US", + region: "CA", + exemptAmount: 0, + jurisCode: "EMAR0", + jurisName: "LOS ANGELES COUNTY DISTRICT TAX SP", + stateAssignedNo: "594", + jurisType: JurisTypeId.STJ, + jurisdictionType: JurisdictionType.Special, + nonTaxableAmount: 0, + rate: 0.0225, + tax: 1.59, + taxableAmount: 70.78, + taxType: "Use", + taxSubTypeId: "U", + taxName: "CA SPECIAL TAX", + taxAuthorityTypeId: 45, + taxCalculated: 1.59, + rateType: RateType.General, + rateTypeCode: "G", + unitOfBasis: "PerCurrencyUnit", + isNonPassThru: false, + isFee: false, + reportingTaxableUnits: 70.78, + reportingNonTaxableUnits: 0, + reportingExemptUnits: 0, + reportingTax: 1.59, + reportingTaxCalculated: 1.59, + liabilityType: LiabilityType.Seller, + chargedTo: ChargedTo.Buyer, + }, + { + id: 0, + transactionLineId: 0, + transactionId: 0, + country: "US", + region: "CA", + exemptAmount: 0, + jurisCode: "EMTC0", + jurisName: "LOS ANGELES CO LOCAL TAX SL", + stateAssignedNo: "19", + jurisType: JurisTypeId.STJ, + jurisdictionType: JurisdictionType.Special, + nonTaxableAmount: 0, + rate: 0.01, + tax: 0.71, + taxableAmount: 70.78, + taxType: "Use", + taxSubTypeId: "U", + taxName: "CA SPECIAL TAX", + taxAuthorityTypeId: 45, + taxCalculated: 0.71, + rateType: RateType.General, + rateTypeCode: "G", + unitOfBasis: "PerCurrencyUnit", + isNonPassThru: false, + isFee: false, + reportingTaxableUnits: 70.78, + reportingNonTaxableUnits: 0, + reportingExemptUnits: 0, + reportingTax: 0.71, + reportingTaxCalculated: 0.71, + liabilityType: LiabilityType.Seller, + chargedTo: ChargedTo.Buyer, + }, + ], + nonPassthroughDetails: [], + hsCode: "", + costInsuranceFreight: 0, + vatCode: "", + vatNumberTypeId: 0, + }, + ], + addresses: [ + { + id: 0, + transactionId: 0, + boundaryLevel: BoundaryLevel.Zip5, + line1: "123 Palm Grove Ln", + line2: "", + line3: "", + city: "LOS ANGELES", + region: "CA", + postalCode: "90002", + country: "US", + taxRegionId: 4017056, + latitude: "33.948712", + longitude: "-118.245951", + }, + { + id: 0, + transactionId: 0, + boundaryLevel: BoundaryLevel.Zip5, + line1: "8559 Lake Avenue", + line2: "", + line3: "", + city: "New York", + region: "NY", + postalCode: "10001", + country: "US", + taxRegionId: 2088629, + latitude: "40.748481", + longitude: "-73.993125", + }, + ], + summary: [ + { + country: "US", + region: "CA", + jurisType: JurisdictionType.State, + jurisCode: "06", + jurisName: "CALIFORNIA", + taxAuthorityType: 45, + stateAssignedNo: "", + taxType: "Use", + taxSubType: "U", + taxName: "CA STATE TAX", + rateType: RateType.General, + taxable: 107.31, + rate: 0.06, + tax: 6.44, + taxCalculated: 6.44, + nonTaxable: 0, + exemption: 0, + }, + { + country: "US", + region: "CA", + jurisType: JurisdictionType.County, + jurisCode: "037", + jurisName: "LOS ANGELES", + taxAuthorityType: 45, + stateAssignedNo: "", + taxType: "Use", + taxSubType: "U", + taxName: "CA COUNTY TAX", + rateType: RateType.General, + taxable: 107.31, + rate: 0.0025, + tax: 0.27, + taxCalculated: 0.27, + nonTaxable: 0, + exemption: 0, + }, + { + country: "US", + region: "CA", + jurisType: JurisdictionType.Special, + jurisCode: "EMTC0", + jurisName: "LOS ANGELES CO LOCAL TAX SL", + taxAuthorityType: 45, + stateAssignedNo: "19", + taxType: "Use", + taxSubType: "U", + taxName: "CA SPECIAL TAX", + rateType: RateType.General, + taxable: 107.31, + rate: 0.01, + tax: 1.08, + taxCalculated: 1.08, + nonTaxable: 0, + exemption: 0, + }, + { + country: "US", + region: "CA", + jurisType: JurisdictionType.Special, + jurisCode: "EMAR0", + jurisName: "LOS ANGELES COUNTY DISTRICT TAX SP", + taxAuthorityType: 45, + stateAssignedNo: "594", + taxType: "Use", + taxSubType: "U", + taxName: "CA SPECIAL TAX", + rateType: RateType.General, + taxable: 107.31, + rate: 0.0225, + tax: 2.41, + taxCalculated: 2.41, + nonTaxable: 0, + exemption: 0, + }, + ], +}; + +const NON_TAXABLE_TRANSACTION_MOCK: TransactionModel = { + id: 0, + code: "d431d046-f0b4-4eb3-a412-b2405323d148", + companyId: 7799640, + date: new Date(), + paymentDate: new Date(), + status: DocumentStatus.Temporary, + type: DocumentType.SalesOrder, + batchCode: "", + currencyCode: "USD", + exchangeRateCurrencyCode: "USD", + customerUsageType: "", + entityUseCode: "", + customerVendorCode: "VXNlcjoyMDg0NTEwNDEx", + customerCode: "VXNlcjoyMDg0NTEwNDEx", + exemptNo: "", + reconciled: false, + locationCode: "", + reportingLocationCode: "", + purchaseOrderNo: "", + referenceCode: "", + salespersonCode: "", + totalAmount: 97.51, + totalExempt: 97.51, + totalDiscount: 0, + totalTax: 0, + totalTaxable: 0, + totalTaxCalculated: 0, + adjustmentReason: AdjustmentReason.NotAdjusted, + locked: false, + version: 1, + exchangeRateEffectiveDate: new Date(), + exchangeRate: 1, + modifiedDate: new Date(), + modifiedUserId: 6479978, + taxDate: new Date(), + lines: [ + { + id: 0, + transactionId: 0, + lineNumber: "1", + customerUsageType: "", + entityUseCode: "", + discountAmount: 0, + exemptAmount: 20, + exemptCertId: 0, + exemptNo: "", + isItemTaxable: false, + itemCode: "", + lineAmount: 20, + quantity: 1, + ref1: "", + ref2: "", + reportingDate: new Date(), + tax: 0, + taxableAmount: 0, + taxCalculated: 0, + taxCode: "P0000000", + taxCodeId: 8087, + taxDate: new Date(), + taxIncluded: true, + details: [ + { + id: 0, + transactionLineId: 0, + transactionId: 0, + country: "US", + region: "DE", + exemptAmount: 0, + jurisCode: "10", + jurisName: "DELAWARE", + stateAssignedNo: "", + jurisType: JurisTypeId.STA, + jurisdictionType: JurisdictionType.State, + nonTaxableAmount: 20, + rate: 0, + tax: 0, + taxableAmount: 0, + taxType: "Sales", + taxSubTypeId: "S", + taxName: "DE STATE TAX", + taxAuthorityTypeId: 45, + taxCalculated: 0, + rateType: RateType.General, + rateTypeCode: "G", + unitOfBasis: "PerCurrencyUnit", + isNonPassThru: false, + isFee: false, + reportingTaxableUnits: 0, + reportingNonTaxableUnits: 20, + reportingExemptUnits: 0, + reportingTax: 0, + reportingTaxCalculated: 0, + liabilityType: LiabilityType.Seller, + chargedTo: ChargedTo.Buyer, + }, + ], + nonPassthroughDetails: [], + hsCode: "", + costInsuranceFreight: 0, + vatCode: "", + vatNumberTypeId: 0, + }, + { + id: 0, + transactionId: 0, + lineNumber: "2", + customerUsageType: "", + entityUseCode: "", + discountAmount: 0, + exemptAmount: 77.51, + exemptCertId: 0, + exemptNo: "", + isItemTaxable: false, + itemCode: "Shipping", + lineAmount: 77.51, + quantity: 1, + ref1: "", + ref2: "", + reportingDate: new Date(), + tax: 0, + taxableAmount: 0, + taxCalculated: 0, + taxCode: "P0000000", + taxCodeId: 8087, + taxDate: new Date(), + taxIncluded: true, + details: [ + { + id: 0, + transactionLineId: 0, + transactionId: 0, + country: "US", + region: "DE", + exemptAmount: 0, + jurisCode: "10", + jurisName: "DELAWARE", + stateAssignedNo: "", + jurisType: JurisTypeId.STA, + jurisdictionType: JurisdictionType.State, + nonTaxableAmount: 77.51, + rate: 0, + tax: 0, + taxableAmount: 0, + taxType: "Sales", + taxSubTypeId: "S", + taxName: "DE STATE TAX", + taxAuthorityTypeId: 45, + taxCalculated: 0, + rateType: RateType.General, + rateTypeCode: "G", + unitOfBasis: "PerCurrencyUnit", + isNonPassThru: false, + isFee: false, + reportingTaxableUnits: 0, + reportingNonTaxableUnits: 77.51, + reportingExemptUnits: 0, + reportingTax: 0, + reportingTaxCalculated: 0, + liabilityType: LiabilityType.Seller, + chargedTo: ChargedTo.Buyer, + }, + ], + nonPassthroughDetails: [], + hsCode: "", + costInsuranceFreight: 0, + vatCode: "", + vatNumberTypeId: 0, + }, + ], + addresses: [ + { + id: 0, + transactionId: 0, + boundaryLevel: BoundaryLevel.Address, + line1: "38774 Apple Ct", + line2: "", + line3: "", + city: "OCEAN VIEW", + region: "DE", + postalCode: "19970", + country: "US", + taxRegionId: 4014271, + latitude: "38.58276", + longitude: "-75.074325", + }, + { + id: 0, + transactionId: 0, + boundaryLevel: BoundaryLevel.Zip5, + line1: "8559 Lake Avenue", + line2: "", + line3: "", + city: "New York", + region: "NY", + postalCode: "10001", + country: "US", + taxRegionId: 2088629, + latitude: "40.748481", + longitude: "-73.993125", + }, + ], + summary: [ + { + country: "US", + region: "DE", + jurisType: JurisdictionType.State, + jurisCode: "10", + jurisName: "DELAWARE", + taxAuthorityType: 45, + stateAssignedNo: "", + taxType: "Sales", + taxSubType: "S", + taxName: "DE STATE TAX", + rateType: RateType.General, + taxable: 0, + rate: 0, + tax: 0, + taxCalculated: 0, + nonTaxable: 97.51, + exemption: 0, + }, + ], +}; + +const TAXABLE_TAX_NOT_INCLUDED_TRANSACTION_MOCK: TransactionModel = { + id: 0, + code: "393b71d9-a102-4726-bba4-061832f526a2", + companyId: 7799660, + date: new Date(), + paymentDate: new Date(), + status: DocumentStatus.Temporary, + type: DocumentType.SalesOrder, + batchCode: "", + currencyCode: "USD", + exchangeRateCurrencyCode: "USD", + customerUsageType: "", + entityUseCode: "", + customerVendorCode: "VXNlcjoyMDg0NTEwNDEw", + customerCode: "VXNlcjoyMDg0NTEwNDEw", + exemptNo: "", + reconciled: false, + locationCode: "", + reportingLocationCode: "", + purchaseOrderNo: "", + referenceCode: "", + salespersonCode: "", + totalAmount: 117.51, + totalExempt: 0, + totalDiscount: 0, + totalTax: 11.16, + totalTaxable: 117.51, + totalTaxCalculated: 11.16, + adjustmentReason: AdjustmentReason.NotAdjusted, + locked: false, + version: 1, + exchangeRateEffectiveDate: new Date(), + exchangeRate: 1, + modifiedDate: new Date(), + modifiedUserId: 6479978, + taxDate: new Date(), + lines: [ + { + id: 0, + transactionId: 0, + lineNumber: "1", + customerUsageType: "", + entityUseCode: "", + discountAmount: 0, + exemptAmount: 0, + exemptCertId: 0, + exemptNo: "", + isItemTaxable: true, + itemCode: "", + lineAmount: 40, + quantity: 2, + ref1: "", + ref2: "", + reportingDate: new Date(), + tax: 3.8, + taxableAmount: 40, + taxCalculated: 3.8, + taxCode: "P0000000", + taxCodeId: 8087, + taxDate: new Date(), + taxIncluded: false, + details: [ + { + id: 0, + transactionLineId: 0, + transactionId: 0, + country: "US", + region: "CA", + exemptAmount: 0, + jurisCode: "06", + jurisName: "CALIFORNIA", + stateAssignedNo: "", + jurisType: JurisTypeId.STJ, + jurisdictionType: JurisdictionType.State, + nonTaxableAmount: 0, + rate: 0.06, + tax: 2.4, + taxableAmount: 40, + taxType: "Use", + taxSubTypeId: "U", + taxName: "CA STATE TAX", + taxAuthorityTypeId: 45, + taxCalculated: 2.4, + rateType: RateType.General, + rateTypeCode: "G", + unitOfBasis: "PerCurrencyUnit", + isNonPassThru: false, + isFee: false, + reportingTaxableUnits: 40, + reportingNonTaxableUnits: 0, + reportingExemptUnits: 0, + reportingTax: 2.4, + reportingTaxCalculated: 2.4, + liabilityType: LiabilityType.Seller, + chargedTo: ChargedTo.Buyer, + }, + { + id: 0, + transactionLineId: 0, + transactionId: 0, + country: "US", + region: "CA", + exemptAmount: 0, + jurisCode: "037", + jurisName: "LOS ANGELES", + stateAssignedNo: "", + jurisType: JurisTypeId.CTY, + jurisdictionType: JurisdictionType.County, + nonTaxableAmount: 0, + rate: 0.0025, + tax: 0.1, + taxableAmount: 40, + taxType: "Use", + taxSubTypeId: "U", + taxName: "CA COUNTY TAX", + taxAuthorityTypeId: 45, + taxCalculated: 0.1, + rateType: RateType.General, + rateTypeCode: "G", + unitOfBasis: "PerCurrencyUnit", + isNonPassThru: false, + isFee: false, + reportingTaxableUnits: 40, + reportingNonTaxableUnits: 0, + reportingExemptUnits: 0, + reportingTax: 0.1, + reportingTaxCalculated: 0.1, + liabilityType: LiabilityType.Seller, + chargedTo: ChargedTo.Buyer, + }, + { + id: 0, + transactionLineId: 0, + transactionId: 0, + country: "US", + region: "CA", + exemptAmount: 0, + jurisCode: "EMAR0", + jurisName: "LOS ANGELES COUNTY DISTRICT TAX SP", + stateAssignedNo: "594", + jurisType: JurisTypeId.STJ, + jurisdictionType: JurisdictionType.Special, + nonTaxableAmount: 0, + rate: 0.0225, + tax: 0.9, + taxableAmount: 40, + taxType: "Use", + taxSubTypeId: "U", + taxName: "CA SPECIAL TAX", + taxAuthorityTypeId: 45, + taxCalculated: 0.9, + rateType: RateType.General, + rateTypeCode: "G", + unitOfBasis: "PerCurrencyUnit", + isNonPassThru: false, + isFee: false, + reportingTaxableUnits: 40, + reportingNonTaxableUnits: 0, + reportingExemptUnits: 0, + reportingTax: 0.9, + reportingTaxCalculated: 0.9, + liabilityType: LiabilityType.Seller, + chargedTo: ChargedTo.Buyer, + }, + { + id: 0, + transactionLineId: 0, + transactionId: 0, + country: "US", + region: "CA", + exemptAmount: 0, + jurisCode: "EMTC0", + jurisName: "LOS ANGELES CO LOCAL TAX SL", + stateAssignedNo: "19", + jurisType: JurisTypeId.STJ, + jurisdictionType: JurisdictionType.Special, + nonTaxableAmount: 0, + rate: 0.01, + tax: 0.4, + taxableAmount: 40, + taxType: "Use", + taxSubTypeId: "U", + taxName: "CA SPECIAL TAX", + taxAuthorityTypeId: 45, + taxCalculated: 0.4, + rateType: RateType.General, + rateTypeCode: "G", + unitOfBasis: "PerCurrencyUnit", + isNonPassThru: false, + isFee: false, + reportingTaxableUnits: 40, + reportingNonTaxableUnits: 0, + reportingExemptUnits: 0, + reportingTax: 0.4, + reportingTaxCalculated: 0.4, + liabilityType: LiabilityType.Seller, + chargedTo: ChargedTo.Buyer, + }, + ], + nonPassthroughDetails: [], + hsCode: "", + costInsuranceFreight: 0, + vatCode: "", + vatNumberTypeId: 0, + }, + { + id: 0, + transactionId: 0, + lineNumber: "2", + customerUsageType: "", + entityUseCode: "", + discountAmount: 0, + exemptAmount: 0, + exemptCertId: 0, + exemptNo: "", + isItemTaxable: true, + itemCode: "Shipping", + lineAmount: 77.51, + quantity: 1, + ref1: "", + ref2: "", + reportingDate: new Date(), + tax: 7.36, + taxableAmount: 77.51, + taxCalculated: 7.36, + taxCode: "P0000000", + taxCodeId: 8087, + taxDate: new Date(), + taxIncluded: false, + details: [ + { + id: 0, + transactionLineId: 0, + transactionId: 0, + country: "US", + region: "CA", + exemptAmount: 0, + jurisCode: "06", + jurisName: "CALIFORNIA", + stateAssignedNo: "", + jurisType: JurisTypeId.STA, + jurisdictionType: JurisdictionType.State, + nonTaxableAmount: 0, + rate: 0.06, + tax: 4.65, + taxableAmount: 77.51, + taxType: "Use", + taxSubTypeId: "U", + taxName: "CA STATE TAX", + taxAuthorityTypeId: 45, + taxCalculated: 4.65, + rateType: RateType.General, + rateTypeCode: "G", + unitOfBasis: "PerCurrencyUnit", + isNonPassThru: false, + isFee: false, + reportingTaxableUnits: 77.51, + reportingNonTaxableUnits: 0, + reportingExemptUnits: 0, + reportingTax: 4.65, + reportingTaxCalculated: 4.65, + liabilityType: LiabilityType.Seller, + chargedTo: ChargedTo.Buyer, + }, + { + id: 0, + transactionLineId: 0, + transactionId: 0, + country: "US", + region: "CA", + exemptAmount: 0, + jurisCode: "037", + jurisName: "LOS ANGELES", + stateAssignedNo: "", + jurisType: JurisTypeId.CTY, + jurisdictionType: JurisdictionType.County, + nonTaxableAmount: 0, + rate: 0.0025, + tax: 0.19, + taxableAmount: 77.51, + taxType: "Use", + taxSubTypeId: "U", + taxName: "CA COUNTY TAX", + taxAuthorityTypeId: 45, + taxCalculated: 0.19, + rateType: RateType.General, + rateTypeCode: "G", + unitOfBasis: "PerCurrencyUnit", + isNonPassThru: false, + isFee: false, + reportingTaxableUnits: 77.51, + reportingNonTaxableUnits: 0, + reportingExemptUnits: 0, + reportingTax: 0.19, + reportingTaxCalculated: 0.19, + liabilityType: LiabilityType.Seller, + chargedTo: ChargedTo.Buyer, + }, + { + id: 0, + transactionLineId: 0, + transactionId: 0, + country: "US", + region: "CA", + exemptAmount: 0, + jurisCode: "EMAR0", + jurisName: "LOS ANGELES COUNTY DISTRICT TAX SP", + stateAssignedNo: "594", + jurisType: JurisTypeId.STJ, + jurisdictionType: JurisdictionType.Special, + nonTaxableAmount: 0, + rate: 0.0225, + tax: 1.74, + taxableAmount: 77.51, + taxType: "Use", + taxSubTypeId: "U", + taxName: "CA SPECIAL TAX", + taxAuthorityTypeId: 45, + taxCalculated: 1.74, + rateType: RateType.General, + rateTypeCode: "G", + unitOfBasis: "PerCurrencyUnit", + isNonPassThru: false, + isFee: false, + reportingTaxableUnits: 77.51, + reportingNonTaxableUnits: 0, + reportingExemptUnits: 0, + reportingTax: 1.74, + reportingTaxCalculated: 1.74, + liabilityType: LiabilityType.Seller, + chargedTo: ChargedTo.Buyer, + }, + { + id: 0, + transactionLineId: 0, + transactionId: 0, + country: "US", + region: "CA", + exemptAmount: 0, + jurisCode: "EMTC0", + jurisName: "LOS ANGELES CO LOCAL TAX SL", + stateAssignedNo: "19", + jurisType: JurisTypeId.STJ, + jurisdictionType: JurisdictionType.Special, + nonTaxableAmount: 0, + rate: 0.01, + tax: 0.78, + taxableAmount: 77.51, + taxType: "Use", + taxSubTypeId: "U", + taxName: "CA SPECIAL TAX", + taxAuthorityTypeId: 45, + taxCalculated: 0.78, + rateType: RateType.General, + rateTypeCode: "G", + unitOfBasis: "PerCurrencyUnit", + isNonPassThru: false, + isFee: false, + reportingTaxableUnits: 77.51, + reportingNonTaxableUnits: 0, + reportingExemptUnits: 0, + reportingTax: 0.78, + reportingTaxCalculated: 0.78, + liabilityType: LiabilityType.Seller, + chargedTo: ChargedTo.Buyer, + }, + ], + nonPassthroughDetails: [], + hsCode: "", + costInsuranceFreight: 0, + vatCode: "", + vatNumberTypeId: 0, + }, + ], + addresses: [ + { + id: 0, + transactionId: 0, + boundaryLevel: BoundaryLevel.Zip5, + line1: "123 Palm Grove Ln", + line2: "", + line3: "", + city: "LOS ANGELES", + region: "CA", + postalCode: "90002", + country: "US", + taxRegionId: 4017056, + latitude: "33.948712", + longitude: "-118.245951", + }, + { + id: 0, + transactionId: 0, + boundaryLevel: BoundaryLevel.Zip5, + line1: "8559 Lake Avenue", + line2: "", + line3: "", + city: "New York", + region: "NY", + postalCode: "10001", + country: "US", + taxRegionId: 2088629, + latitude: "40.748481", + longitude: "-73.993125", + }, + ], + summary: [ + { + country: "US", + region: "CA", + jurisType: JurisdictionType.State, + jurisCode: "06", + jurisName: "CALIFORNIA", + taxAuthorityType: 45, + stateAssignedNo: "", + taxType: "Use", + taxSubType: "U", + taxName: "CA STATE TAX", + rateType: RateType.General, + taxable: 117.51, + rate: 0.06, + tax: 7.05, + taxCalculated: 7.05, + nonTaxable: 0, + exemption: 0, + }, + { + country: "US", + region: "CA", + jurisType: JurisdictionType.County, + jurisCode: "037", + jurisName: "LOS ANGELES", + taxAuthorityType: 45, + stateAssignedNo: "", + taxType: "Use", + taxSubType: "U", + taxName: "CA COUNTY TAX", + rateType: RateType.General, + taxable: 117.51, + rate: 0.0025, + tax: 0.29, + taxCalculated: 0.29, + nonTaxable: 0, + exemption: 0, + }, + { + country: "US", + region: "CA", + jurisType: JurisdictionType.Special, + jurisCode: "EMTC0", + jurisName: "LOS ANGELES CO LOCAL TAX SL", + taxAuthorityType: 45, + stateAssignedNo: "19", + taxType: "Use", + taxSubType: "U", + taxName: "CA SPECIAL TAX", + rateType: RateType.General, + taxable: 117.51, + rate: 0.01, + tax: 1.18, + taxCalculated: 1.18, + nonTaxable: 0, + exemption: 0, + }, + { + country: "US", + region: "CA", + jurisType: JurisdictionType.Special, + jurisCode: "EMAR0", + jurisName: "LOS ANGELES COUNTY DISTRICT TAX SP", + taxAuthorityType: 45, + stateAssignedNo: "594", + taxType: "Use", + taxSubType: "U", + taxName: "CA SPECIAL TAX", + rateType: RateType.General, + taxable: 117.51, + rate: 0.0225, + tax: 2.64, + taxCalculated: 2.64, + nonTaxable: 0, + exemption: 0, + }, + ], +}; + +const MOCKED_CALCULATE_TAXES_ARGS: AvataxCalculateTaxesMapPayloadArgs = { + taxBase: { + pricesEnteredWithTax: false, + currency: "PLN", + channel: { + slug: "channel-pln", + }, + sourceObject: { + __typename: "Order", + user: { + id: "VXNlcjo5ZjY3ZjY0Zi1iZjY5LTQ5ZjYtYjQ4Zi1iZjY3ZjY0ZjY0ZjY=", + }, + }, + discounts: [], + address: { + streetAddress1: "123 Palm Grove Ln", + streetAddress2: "", + city: "LOS ANGELES", + country: { + code: "US", + }, + countryArea: "CA", + postalCode: "90002", + }, + shippingPrice: { + amount: 48.33, + }, + lines: [ + { + quantity: 3, + unitPrice: { + amount: 84, + }, + totalPrice: { + amount: 252, + }, + sourceLine: { + __typename: "OrderLine", + id: "T3JkZXJMaW5lOmY1NGQ1MWY2LTc1OTctNGY2OC1hNDk0LTFjYjZlYjRmOTlhMQ==", + variant: { + id: "UHJvZHVjdFZhcmlhbnQ6MzQ2", + product: { + metafield: null, + productType: { + metafield: null, + }, + }, + }, + }, + }, + { + quantity: 1, + unitPrice: { + amount: 5.99, + }, + totalPrice: { + amount: 5.99, + }, + sourceLine: { + __typename: "OrderLine", + id: "T3JkZXJMaW5lOjU1NTFjNTFjLTM5MWQtNGI0Ny04MGU0LWVjY2Q5ZjU4MjQyNQ==", + variant: { + id: "UHJvZHVjdFZhcmlhbnQ6Mzg1", + product: { + metafield: null, + productType: { + metafield: null, + }, + }, + }, + }, + }, + ], + }, + channel: { + providerInstanceId: "b8c29f49-7cae-4762-8458-e9a27eb83081", + enabled: false, + address: { + country: "US", + zip: "92093", + state: "17-05-2023", + city: "La Jolla", + street: "9500 Gilman Drive", + }, + }, + config: { + companyCode: "DEFAULT", + isAutocommit: false, + isSandbox: true, + name: "Avatax-1", + password: "password", + username: "username", + shippingTaxCode: "FR000000", + }, +}; + +export const transactionModelMocks = { + taxable: { + taxIncluded: TAXABLE_TAX_INCLUDED_TRANSACTION_MOCK, + taxNotIncluded: TAXABLE_TAX_NOT_INCLUDED_TRANSACTION_MOCK, + }, + nonTaxable: NON_TAXABLE_TRANSACTION_MOCK, +}; + +export const mapPayloadArgsMocks = { + default: MOCKED_CALCULATE_TAXES_ARGS, +};