Happy Business Starts Here

Highlighted
Support SME

Issue: Invoice has amount of 0.01 remaining even though item is written off 100%

The issue is Invoice has the amount of 0.01 remaining even though item is written off 100% already. 

 

The example Invoice: 

Screen_Shot_2018-09-13_at_4_21_59_PM.png

 

The related 8 IIAs in it: 

Screen Shot 2018-09-13 at 3.53.26 PM.png

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Support SME

Re: Issue: Invoice has amount of 0.01 remaining even though item is written off 100%

We find the external tax engine Avalara is used to calculate tax in the affected invoice. The issue is caused by rounding. 

The invoice has only one Invoice Item amount $1,946.69. After IIAs, now its Outstanding Balance is $0.01. The remaining $0.01 is in located in Invoice Item's tax 'NY SPECIAL TAX'.

Screen_Shot_2018-09-11_at_10_52_30_AM__1_.png

There are 8 IIAs in total. Two of them are for the 2 Invoice Items and the amounts are $1,336.09 and $451.91. The rest 6 IIAs are used to adjust tax since each Invoice Item has 3 tax: NY STATE TAX, NY CITY TAX, NY SPECIAL TAX.

 

The tax rate of NY SPECIAL TAX is 0.00375. 

We passed $451.91 to Avalara. Based on the tax rate, the amount is $451.91*0.00375 is rounded to $1.69 by Avalara and it is returned to Zuora. 
The second tax amount $1336.09*0.00375 is rounded to $5.01 by Avalara and it is returned to Zuora.

 

As you may notice, 1.69+5.01=6.7 But originally, the NY SPECIAL TAX 6.71. That is why there is $0.01 difference.

 

There are 3 workarounds to avoid this: 
1. Recommended: If Avalara tax engine is used, create one IIA only against one invoice item. 


2. Turn off 'Use Avalara to calculate tax for IIA'. This permission can be disabled from Zuora backend. When this feature is turned off and you create IIA, no API call will be made to Avalara to calculate the tax. So the rounding issue will not happen. But please note the information will mismatch from Zuora and Avalara and you need to update the information on Avalara side manually if you would like to compare the information from Zuora to Avalara, such as run a report on Avalara side. Reference: https://community.zuora.com/t5/Billing-Payments/Error-IIA-tax-calculated-by-Avalara-is-inconsistent-...


3. Calculate the IIA's tax amount based on the tax rate before creating IIA to prevent the rounding issue. It is a random try if you must create multiple IIAs against one Invoice Item. Here is one example:  
452*0.00375=1.70, 1336*0.00375=5.01. 1.70+5.01=6.71 and the issue will not happen.

 

View solution in original post

8 REPLIES 8
Highlighted
Support SME

Re: Issue: Invoice has amount of 0.01 remaining even though item is written off 100%

We find the external tax engine Avalara is used to calculate tax in the affected invoice. The issue is caused by rounding. 

The invoice has only one Invoice Item amount $1,946.69. After IIAs, now its Outstanding Balance is $0.01. The remaining $0.01 is in located in Invoice Item's tax 'NY SPECIAL TAX'.

Screen_Shot_2018-09-11_at_10_52_30_AM__1_.png

There are 8 IIAs in total. Two of them are for the 2 Invoice Items and the amounts are $1,336.09 and $451.91. The rest 6 IIAs are used to adjust tax since each Invoice Item has 3 tax: NY STATE TAX, NY CITY TAX, NY SPECIAL TAX.

 

The tax rate of NY SPECIAL TAX is 0.00375. 

We passed $451.91 to Avalara. Based on the tax rate, the amount is $451.91*0.00375 is rounded to $1.69 by Avalara and it is returned to Zuora. 
The second tax amount $1336.09*0.00375 is rounded to $5.01 by Avalara and it is returned to Zuora.

 

As you may notice, 1.69+5.01=6.7 But originally, the NY SPECIAL TAX 6.71. That is why there is $0.01 difference.

 

There are 3 workarounds to avoid this: 
1. Recommended: If Avalara tax engine is used, create one IIA only against one invoice item. 


2. Turn off 'Use Avalara to calculate tax for IIA'. This permission can be disabled from Zuora backend. When this feature is turned off and you create IIA, no API call will be made to Avalara to calculate the tax. So the rounding issue will not happen. But please note the information will mismatch from Zuora and Avalara and you need to update the information on Avalara side manually if you would like to compare the information from Zuora to Avalara, such as run a report on Avalara side. Reference: https://community.zuora.com/t5/Billing-Payments/Error-IIA-tax-calculated-by-Avalara-is-inconsistent-...


3. Calculate the IIA's tax amount based on the tax rate before creating IIA to prevent the rounding issue. It is a random try if you must create multiple IIAs against one Invoice Item. Here is one example:  
452*0.00375=1.70, 1336*0.00375=5.01. 1.70+5.01=6.71 and the issue will not happen.

 

View solution in original post

Tutor

Re: Issue: Invoice has amount of 0.01 remaining even though item is written off 100%

The API call to Avalara is for the tax rate, not the tax amount as described in this KC articles: Avalara IntegrationAvalara Taxes in API Calls and Bill Runs.

This suggests the variance stems from how Zuora calculates tax for the INV vs the IIA using the rate from Avalara.

 

Avalara's tax calculation can be tested by logging into Avalara and going to Transactions > Tax Calculator > enter the details to match the transcation to be tested > click calculate.

We tested the calculation on a transaction that had this 1 cent issue and the tax amounts returned by Avalara for the INV and the IIA offset each other (0.91 and -0.91, respectively). If these amounts were used by Zuora, there would be no variance.

 

  • How does Zuora calculate use the tax rate from Avalara to calculate the tax amount for an INV vs an IIA?
  • What rounding algorithm is applied to the tax amount?
  • Is the same logic used for both INV and IIA transactions?
Highlighted
Support SME

Re: Issue: Invoice has amount of 0.01 remaining even though item is written off 100%

Hi @kbarins 

When Avalara integration is used, Zuora uses api call to get the tax information from Avalara. Here is a sample request to Avalara. The rounding algorithm is controlled by Avalara. The same logic is used for both INV and IIA transactions. 

{
   "addresses":[
      {
         "country":"",
         "zipCode":"",
         "city":"",
         "address2":"",
         "address1":"",
         "id":"TaxOriginalAddressCode",
         "state":""
      },
      {
         "country":"US",
         "zipCode":"30305",
         "ShippingCity_c":"Foster",
         "ShippingStatec":"RI",
         "ShippingPostalCodec":"02825",
         "city":"Atlanta",
         "address2":"",
         "ShippingAddress1c":"xxxx Road",
         "ServiceCountryc":"United States",
         "address1":"xxxx Road",
         "county":"",
         "ServicePostalCodec":"94403",
         "taxRegion":"",
         "ServiceAddress1c":"xxxx Road",
         "ServiceCityc":"San Mateo",
         "ShippingCountryc":"United States",
         "ServiceStatec":"CA",
         "id":"2c92c0f9652ad8f901653594efb3xxxx",
         "state":"Georgia"
      }
   ],
   "subscriptions":[
      {
         "id":"2c92c0f86524468701655f00ae30xxxx"
      }
   ],
   "documents":[
      {
         "SerialNumberc":"",
         "id":"2c92c085652a7d4801655f018707xxxx"
      }
   ],
   "documentOwners":[
      {
         "id":"2c92c0f9652ad8f901653594efafxxxx"
      }
   ],
   "productRatePlanCharges":[
      {
         "id":"2c92c0f8644618e8016461b24b96xxxx"
      },
      {
         "id":"2c92c0f864b6edb60164b8c52397xxxx"
      }
   ],
   "invoice":{
      "SerialNumberc":"",
      "invoiceItems":[
         {
            "productRatePlanChargeId":"2c92c0f8644618e8016461b24b96xxxx",
            "taxExemptStatus":0,
            "originalAddressId":"TaxOriginalAddressCode",
            "taxExemptCertificateType":"",
            "taxCompanyCode":"test",
            "amount":"1899",
            "taxExemptCertificateID":"",
            "quantity":"1",
            "vatId":"",
            "discountAmount":"0",
            "subscriptionRatePlanChargeId":"2c92c0f86524468701655f00ae48xxxx",
            "taxExemptEntityUseCode":"",
            "taxCode":"P0000000",
            "taxCalculationOwnerOption":0,
            "taxDate":"2018-08-21",
            "subscriptionOwnerId":"2c92c0f9652ad8f901653594efafxxxx",
            "taxExemptIssuingJurisdiction":"",
            "documentOwnerId":"2c92c0f9652ad8f901653594efafxxxx",
            "taxMode":0,
            "subscriptionName":"A-S00000033",
            "documentId":"2c92c085652a7d4801655f018707xxxx",
            "id":"2c92c085652a7d4801655f01870fxxxx",
            "subscriptionId":"2c92c0f86524468701655f00ae30xxxx",
            "destinationAddressId":"2c92c0f9652ad8f901653594efb3xxxx"
         },
         {
            "productRatePlanChargeId":"2c92c0f864b6edb60164b8c52397xxxx",
            "taxExemptStatus":0,
            "originalAddressId":"TaxOriginalAddressCode",
            "taxExemptCertificateType":"",
            "taxCompanyCode":"test",
            "amount":"1000",
            "taxExemptCertificateID":"",
            "quantity":"1",
            "vatId":"",
            "discountAmount":"0",
            "subscriptionRatePlanChargeId":"2c92c0f86524468701655f00ae48xxxx",
            "taxExemptEntityUseCode":"",
            "taxCode":"FR000000",
            "taxCalculationOwnerOption":0,
            "taxDate":"2018-08-21",
            "subscriptionOwnerId":"2c92c0f9652ad8f901653594efafxxxx",
            "taxExemptIssuingJurisdiction":"",
            "documentOwnerId":"2c92c0f9652ad8f901653594efafxxxx",
            "taxMode":0,
            "subscriptionName":"A-S00000033",
            "documentId":"2c92c085652a7d4801655f018707xxxx",
            "id":"2c92c085652a7d4801655f018710xxxx",
            "subscriptionId":"2c92c0f86524468701655f00ae30xxxx",
            "destinationAddressId":"2c92c0f9652ad8f901653594efb3xxxx"
         }
      ],
      "invoiceNumber":"INV00000032",
      "id":"2c92c085652a7d4801655f018707xxxx",
      "invoiceDate":"2018-08-21"
   },
   "subscriptionRatePlanCharges":[
      {
         "ContactTaxTypec":"ShippingAddress",
         "id":"2c92c0f86524468701655f00ae48xxxx"
      },
      {
         "ContactTaxType_c":"ServiceAddress",
         "id":"2c92c0f86524468701655f00ae48xxxx"
      }
   ],
   "version":"2.0",
   "account":{
      "crmAccountId":"",
      "currency":"USD",
      "id":"2c92c0f9652ad8f901653594efafxxxx",
      "accountNumber":"A00000001"
   },
   "subscriptionOwners":[
      {
         "crmAccountId":"",
         "currency":"USD",
         "id":"2c92c0f9652ad8f901653594efafxxxx",
         "accountNumber":"A00000001"
      }
   ]
}

 

Highlighted
Tutor

Re: Issue: Invoice has amount of 0.01 remaining even though item is written off 100%

Thanks for the response Smiley Happy

In the prodvided example I see information related to the invoice, address, invoice item, subscription, account and two distinct product rate plans. Are there additional call/response logs that show the tax amount calculated and the rate used? That additioal information would help fill in the picture. ...It should be available since we can see this information on the Taxation Item record in Zuora.

 

Thanks again!

 

 

Highlighted
Support SME

Re: Issue: Invoice has amount of 0.01 remaining even though item is written off 100%

Tax amount calculated and the rate used is included in the response from Avalara. In the Zuora to Avalara request, there are no tax amount and tax rate. 

We have two avalara integration solutions: 

https://knowledgecenter.zuora.com/CB_Billing/J_Billing_Operations/L_Taxes/B_Avalara_Integration/A_Co...

https://knowledgecenter.zuora.com/CB_Billing/J_Billing_Operations/L_Taxes/Connect_Tax_Engines

 

The provided sample is using the first solution. The second solution is much flexible compared to the first one. 

Highlighted
Tutor

Re: Issue: Invoice has amount of 0.01 remaining even though item is written off 100%

Where in the response string are is the tax amount and the tax rate? 

The KC articles related to the Avalara integration states that the tax rate is called and returned and they don't mention anything about the tax amount:

-The Avalara Integration article states that Avalara "holds up-to-the-minute tax rate data for thousands of sales tax jurisdictions around the world. Avalara automatically calculates the correct tax rates for your billing documents (invoicescredit and debit memos)"

 

Highlighted
Tutor

Re: Issue: Invoice has amount of 0.01 remaining even though item is written off 100%

Avalara confirmed the cause of the variance is due to different values being sent for the taxIncluded flag on the tax call made for the original (INV) vs. the refunding (IIA) transaction. They also said to fix this issue the values for the taxIncluded flag need to be made the same for both INV and IIA transaction types.

Current configuration:

INV taxIncluded = true

IIA taxInclued = false

 

The business case is clear: the full amount(s) of the INV should be offset by the IIA(s) and leave a no balance. 

 

It would be great if Zuora would fix this issue with the integration to Avalara and make the values of the flags consistent for both transactions. Or, at a minimum, expose the flag in the UI so users can configure this setting themselves.

 

Link to Avalara Developer Documentation - taxIncluded 

API Call:

{
  "lines": [
    {
      "amount": 100,
      "taxIncluded": "true"
    }
  ],
  "type": "SalesInvoice",
  "companyCode": "DEFAULT",
  "date": "2017-10-02",
  "customerCode": "ABC",
  "addresses": {
    "singleLocation": {
      "line1": "2000 Main Street",
      "city": "Irvine",
      "region": "CA",
      "country": "US",
      "postalCode": "92614"
    }
  }
}

 

Note from Avalara:

download.png

Highlighted
Support SME

Re: Issue: Invoice has amount of 0.01 remaining even though item is written off 100%

Hi @kbarins 

Thanks for your feedback. You are correct, when tax inclusive is used when you are trying to create an IIA and Avalara integration is used, this 0.01 rounding issue could happen because IIA "taxInclued = false" is hardcoded in zuora application.

 

The workaround is turn off "calculate IIA tax with Avalara" temporarily. Our product roadmap is using Invoice Settlement feature to replace IIA, so our apologies that we cannot provide an ETA of the IIA+Avalara integration fix/improvement ETA yet. Reference https://knowledgecenter.zuora.com/CB_Billing/Invoice_Settlement

 

Invoice Settlement is in limited availability status, if you are interested, please reach out to your Zuora account manager for more information. 

 

Please also note Invoice in Tax Inclusive Mode has limitation when created from invoices. 

https://knowledgecenter.zuora.com/CB_Billing/Invoice_Settlement/B_Credit_and_Debit_Memos/Tax_Calcula...

 

The workaround is much easier. You can  check https://community.zuora.com/t5/Billing-Payments/How-to-only-credit-back-the-invoice-taxation-item/m-...

 

Feel free to let us know if you have further concerns.