How to post $1.69 amount to Canadian QuickBooks Online Tax Inclusive Invoice with QBXML - intuit-partner-platform

I cannot seem to post an item to a Canadian QuickBooks Online Tax Inclusive Invoice with QBXML for an amount of $1.69. The tax rate involved is 13%. Per How do i push a bill with taxes included response, I am dividing the desired amount of $1.69 by 1.13, sending that amount and the resulting invoice shows $1.70. I tried different amounts in the request and discovered that sending $1.495 results in $1.70 on the invoice and sending $1.494 results in $1.68 on the invoice. Any ideas how I could get $1.69 to show up on the Tax Inclusive invoice amount when that is what it should be?
Here is a copy of the request that results in $1.68. Change the Amount tag to 1.495 and it results in $1.70.
Edit: I took it out a few more decimal places and discovered that 1.4949999 results in $1.68 and 1.49499999 results in $1.70. Still no $1.69.
Edit: $1.69 isn't so special. I recreated the process in a spreadsheet with a 13% tax rate starting at $1.50 and incrementing by $0.01. About every eighth or ninth value is one that cannot be added to one of these invoices.
<Invoice xmlns="http://schema.intuit.com/finance/v3">
<Line>
<Description>Guest Book</Description>
<Amount>1.494</Amount>
<DetailType>SalesItemLineDetail</DetailType>
<SalesItemLineDetail>
<ItemRef>7</ItemRef>
<Qty>1</Qty>
<TaxCodeRef>5</TaxCodeRef>
<ServiceDate>2017-03-08</ServiceDate>
</SalesItemLineDetail>
</Line>
<CustomerRef>2</CustomerRef>
<GlobalTaxCalculation>TaxInclusive</GlobalTaxCalculation>
</Invoice>

Related

Braintree Prorate amount is wrong

I have two plans.
The first one is 4.99€.
The second one is 9.99€.
When using prorate_charges = true option.
I pick the 4.99€ subscription, the transaction amount is 4,99 €.
Now I want to upgrade from the 4.99€ plan to the 9.99€ plan and apply the prorate charges. I should pay 5€ on day one since 9.99€ - 4.99€ but instead of paying 5€, braintree generate a transaction with an amount of 4,83 € and I don't know why. The billing cycle is set to one month but It looks like it calculate the proration without 1 day.

Mapping payments in IIF to QBXML

For having deprecated IIF, you'd think Intuit would make it easier to map the calls but I've found myself in something of a corner.
I have a fairly old script mapping our stuff to IIF.
!TRNS TRNSTYPE DATE ACCNT NAME AMOUNT DOCNUM MEMO CLEAR REP PAYMETH ADDR1 ADDR2 ADDR3 ADDR4
!SPL TRNSTYPE DATE ACCNT NAME AMOUNT DOCNUM MEMO CLEAR QNTY PRICE INVITEM PAYMETH EXTRA
!ENDTRNS
TRNS PAYMENT 1/21/2010 Paypal Account Dear Customer 1230.9 PAYPAL - Invoice123 N PAYPAL Dear Customer 123 Dear Dr
SPL PAYMENT 1/21/2010 Accounts Receivable Dear Customer -1230.9 Invoice123 PAYPAL - Invoice123 N PAYPAL
ENDTRNS
TRNS CHECK 1/21/2010 Paypal Account Paypal Account -29.84 Transaction Fees - Invoice123 N
SPL CHECK 1/21/2010 Fees:Paypal Fees Dear Customer 29.84 Transaction Fees - Invoice123 N
ENDTRNS
Now, I have a script that handles the customer and finding the right record in QB but I'm trying to find the right call to put all these records in. It looks like the first two can fit into ReceivePaymentAddRq but it's less clear on the second set.
Then I have another set that starts with BILL
TRNS BILL 5/15/2014 Accounts Payable Our Vendor -344.81 450608 N 6/14/2014 Net 30
SPL BILL 5/15/2014 Cost of Goods Sold:Purchases Dear Customer 344.81 450608 Invoice123 N
ENDTRNS
I think both fall under BillAdd but that COGS line could also fall under ChargeAdd
The transaction type PAYMENT would indeed be a ReceivePaymentAddRq. The CHECK type would be a CheckAddRq as you are not effecting an Accounts Receivable account. The transaction type of BILL would be a BillAddRq, as you are wanting to effect Accounts Payable. The ChargeAddRq is used for a customer charge, which is not the same as a CreditCardChargeAddRq.
It helps to have used QuickBooks manually a bit to understand the types of transactions that are used, but here's a quick little reference (these include the AddRq, QueryRq and ModRq where applicable). Note that this is not 100% as there are situations where you might use a different transaction type, but it's a good starting point:
Effect Accounts Receivable:
Invoice
ReceivePayment
Charge
CreditMemo
Effect Accounts Payable:
Bill
ItemReceipt
VendorCredit
BillPaymentCheck
BillPaymentCreditCard
Effect Bank Account:
Check
Deposit
Effect Credit Card Account:
CreditCardCharge
CreditCardCredit

Can't send invoice date or PO number on invoice to QB

I have a working QBXML interface but I can't seem to add a couple of
data items to an invoice upload (to QB). I am trying to add the
Invoice Date and P.O. Number.
The error QB is returning is:
QuickBooks found an error when parsing the provided XML text stream.
In an effort to make sure I am using
the correct XML format I did a transfer in the opposite directions
(from QB) in order to see what it is sending.
When sending an invoice to QB I have added the two following XML
elements (which cause the problem):
<TxnDate>2013-04-02</TxnDate>
and
<PONumber>ABC123</PONumber>
Either or both create the error. If I omit both it works.
For example, the following works:
<?xml version="1.0" ?><?qbxml version="10.0"?><QBXML><QBXMLMsgsRq onError = "stopOnError"><InvoiceAddRq requestID = "1"><InvoiceAdd><CustomerRef><ListID>800000D1-1371755142</ListID></CustomerRef><RefNumber>0071010001P</RefNumber><Memo></Memo><InvoiceLineAdd><ItemRef><ListID>80000001-1288815007</ListID></ItemRef><Desc>Software License Fee as per 6/19/07 Licensing Agreement</Desc><Quantity>1.00</Quantity><Rate>4000.0000</Rate></InvoiceLineAdd><InvoiceLineAdd><ItemRef><ListID>80000001-1288815007</ListID></ItemRef><Desc>Consulting hours as per 7/16/07 Large Contract for Consulting Services</Desc><Quantity>50.00</Quantity><Rate>100.0000</Rate></InvoiceLineAdd></InvoiceAdd></InvoiceAddRq> </QBXMLMsgsRq></QBXML>
but the following doesn't work:
<?xml version="1.0" ?><?qbxml version="10.0"?><QBXML><QBXMLMsgsRq onError = "stopOnError"><InvoiceAddRq requestID = "1"><InvoiceAdd><CustomerRef><ListID>800000D1-1371755142</ListID></CustomerRef><RefNumber>0071010001P</RefNumber><Memo></Memo><TxnDate>2013-04-02</TxnDate><InvoiceLineAdd><ItemRef><ListID>80000001-1288815007</ListID></ItemRef><Desc>Software License Fee as per 6/19/07 Licensing Agreement</Desc><Quantity>1.00</Quantity><Rate>4000.0000</Rate></InvoiceLineAdd><InvoiceLineAdd><ItemRef><ListID>80000001-1288815007</ListID></ItemRef><Desc>Consulting hours as per 7/16/07 Large Contract for Consulting Services</Desc><Quantity>50.00</Quantity><Rate>100.0000</Rate></InvoiceLineAdd></InvoiceAdd></InvoiceAddRq> </QBXMLMsgsRq></QBXML>
and the following doesn't work:
<?xml version="1.0" ?><?qbxml version="10.0"?><QBXML><QBXMLMsgsRq onError = "stopOnError"><InvoiceAddRq requestID = "1"><InvoiceAdd><CustomerRef><ListID>800000D1-1371755142</ListID></CustomerRef><RefNumber>0071010001P</RefNumber><Memo></Memo><PONumber >ABC123</PONumber><InvoiceLineAdd><ItemRef><ListID>80000001-1288815007</ListID></ItemRef><Desc>Software License Fee as per 6/19/07 Licensing Agreement</Desc><Quantity>1.00</Quantity><Rate>4000.0000</Rate></InvoiceLineAdd><InvoiceLineAdd><ItemRef><ListID>80000001-1288815007</ListID></ItemRef><Desc>Consulting hours as per 7/16/07 Large Contract for Consulting Services</Desc><Quantity>50.00</Quantity><Rate>100.0000</Rate></InvoiceLineAdd></InvoiceAdd></InvoiceAddRq> </QBXMLMsgsRq></QBXML>
I have spend at least 30 hours on this. I am at a total loss of more ideas. Any help would be appreciated.
Blake McBride
The order of the tags you submit is important.
That means that if the QuickBooks OSR tells you that the correct order of tags is:
TxnDate
RefNumber
PONumber
Memo
Then you must send the tags in that order. Any other order will not work.
Your examples have tags in this order: (Memo before TxnDate)
RefNumber
Memo
TxnDate
And this order: (Memo before PONumber)
RefNumber
Memo
PONumber
Neither of which is correct.
If you re-order your tags, it will work.
Relevant QuickBooks development FAQ entry over here. Also, make sure you check out the XML Validator tool included with the QuickBooks SDK (it will tell you if your tags are out of order).
The QuickBooks OSR will show you the correct tag order.

Recurring payments: how to specify an initial payment TAX value different than the subsequent cycles?

If I do a request with the INITAMT equal to the recurring payment amount, it works.
But if I try to bill a different INITAMT (and so different TAX), I get this error:
Tax calculation mismatch. The tax amount for the regular non-trial billing period is different than the sum of the tax for each item in the cart.
My actual request:
I have an initial payment of 4.84€ including 0.84€ of VAT tax.
The next month the amount to bill should be 25.09€ (including 6.09€ VAT).
The request I send is basically this:
Method: CreateRecurringPaymentsProfile
"CURRENCYCODE":"EUR",
"INITAMT":4.84,
"TAXAMT":0.84,
"DESC":"Subscription",
"BILLINGPERIOD":"Month",
"BILLINGFREQUENCY":1,
"AMT":29,
"L_PAYMENTREQUEST_0_ITEMCATEGORY0":"Digital",
"L_PAYMENTREQUEST_0_NAME0":"Subscription",
"L_PAYMENTREQUEST_0_AMT0":29,
"L_PAYMENTREQUEST_0_TAXAMT0":6.09,
"L_PAYMENTREQUEST_0_QTY0":1
"PROFILEREFERENCE":"51a1f8f4732baf580a000031",
"PAYMENTREQUEST_0_INVNUM":"51a1f8f4732baf580a000031",
"INVNUM":"51a1f8f4732baf580a000031",
"PROFILESTARTDATE":"2013-06-26T11:59:12+0000",
And the response:
"TIMESTAMP":"2013-05-27T10:55:46Z",
"CORRELATIONID":"969d07e2cef8a",
"ACK":"Failure",
"VERSION":"74",
"BUILD":"5908853",
"L_ERRORCODE0":"10004",
"L_SHORTMESSAGE0":"Tax calculation mismatch.",
"L_LONGMESSAGE0":"Tax calculation mismatch. The tax amount for the regular non-trial billing period is different than the sum of the tax for each item in the cart.",
"L_SEVERITYCODE0":"Error"
I'd like to do this with the INITAMT value, so that the user can see the two purchases as correlated in the Paypal private area (ie: a subscription with an inital payment).
Otherwise I'll have to do a separate DoExpressCheckout for the initial payment.
What's happening is that you cannot (I believe) set a tax amount for the Initial Amount.
The TAXAMT is for the recurring payment, not the Initial Amount.
Your statement is saying "Billing 29€ with a tax of 0.84€".
However your item list says the tax should be 6.09€
Change your TAXAMT to 6.09€ and it should be fine.

PayPal Charge Tax on shipping (not just items)

I am using the PayPal url approach which works well but when I try charge tax it only seems to apply the tax to the total value of all of the goods, whereas I would like to charge Tax on the Total goods + Shipping, ie
Goods $100.00,
Shipping $20.00,
SubTotal $120.00,
Tax (10%) $12.00,
Grand Total $132.00
This is what I have
https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_cart&business=xxxxxxxxxxxxxx_biz#gmail.com&button_subtype=services&upload=1&no_note=1&currency_code=USD&rm=1&item_name_1=Product1&amount_1=200.00&quantity_1=2&item_name_2=Product2&amount_2=200.00&quantity_2=22&shipping_2=6&tax_1=10&tax_2=10&return=http://staging.xxxx.com/store/success.aspx&cancel_return=http://staging.xxxx.com/store/failed.aspx
I made a change to the tax variable to apply a rate rather than an amount. At this time PayPal doesn't charge tax including shipping as services are typically not taxable.
If this is a requirement I'd recommend calculating the total tax amount on your site before sending the Post to PayPal. The value can be entered in the tax_1 field. I've shown an example of this in the second post.
https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_cart
&business=xxxxxxxxxxxxxx_biz#gmail.com
&button_subtype=services
&upload=1
&no_note=1
&currency_code=USD
&rm=1
&item_name_1=Product1
&amount_1=200.00
&quantity_1=2
&item_name_2=Product2
&amount_2=200.00
&quantity_2=2
&shipping_2=6
&tax_rate_1=10
&tax_rate_2=10
&return=http://staging.xxxx.com/store/success.aspx
&cancel_return=http://staging.xxxx.com/store/failed.aspx
Here's an example with you calculating the amount. Notice you're only sending one tax amount rather than a tax amount for each item. PayPal doesn't show itemized tax amounts to the customer so there is no impact on the customer's end.
https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_cart
&business=xxxxxxxxxxxxxx_biz#gmail.com
&button_subtype=services
&upload=1
&no_note=1
&currency_code=USD
&rm=1
&item_name_1=Product1
&amount_1=200.00
&quantity_1=2
&item_name_2=Product2
&amount_2=200.00
&quantity_2=2
&shipping_2=6
&tax_1=10
&return=http://staging.xxxx.com/store/success.aspx
&cancel_return=http://staging.xxxx.com/store/failed.aspx