-
Notifications
You must be signed in to change notification settings - Fork 306
Open
Description
This is probably user error but I think worth mentioning as an issue for posterity.
I am building an invoice in Canadian Quickbooks and assigning the TransactionTaxDetail like this...
txn_tax_detail = Quickbooks::Model::TransactionTaxDetail.new
code = @tax_code_service.find_by(:name, tc).entries.first
tld = Quickbooks::Model::TaxLineDetail.new(:tax_rate_ref=>code)
txn_tax_detail.lines << tldAdding the TaxLine like this results in a Quickbooks Business Validation Error: TxnTaxDetail.TaxLine.DetailTypeEnum is missing in the request
It appears that quickbooks-ruby is creating the TaxLine wrapper automatically but the TaxLine element is missing the detail type attribute.
<TxnTaxDetail>
<TaxLine>
<NetAmountTaxable>0.0</NetAmountTaxable>
<TaxInclusiveAmount>0.0</TaxInclusiveAmount>
<OverrideDeltaAmount>0.0</OverrideDeltaAmount>
<TaxPercent>0.0</TaxPercent>
<TaxRateRef>
<Id>3</Id>
<SyncToken>0</SyncToken>
<MetaData>
<CreateTime>2016-01-27T21:58:46-0800</CreateTime>
<LastUpdatedTime>2016-01-27T21:58:46-0800</LastUpdatedTime>
</MetaData>
<Name>Zero-rated</Name>
<Description>Zero-rated</Description>
<Active>true</Active>
<Taxable>true</Taxable>
<TaxGroup>true</TaxGroup>
<SalesTaxRateList>
<TaxRateDetail>
<TaxRateRef name="GST/HST ZR">4</TaxRateRef>
<TaxTypeApplicable>TaxOnAmount</TaxTypeApplicable>
<TaxOrder>0</TaxOrder>
</TaxRateDetail>
</SalesTaxRateList>
<PurchaseTaxRateList>
<TaxRateDetail>
<TaxRateRef name="GST/HST (ITC) ZR">3</TaxRateRef>
<TaxTypeApplicable>TaxOnAmount</TaxTypeApplicable>
<TaxOrder>0</TaxOrder>
</TaxRateDetail>
</PurchaseTaxRateList>
</TaxRateRef>
</TaxLine>
<TaxLine>
<NetAmountTaxable>0.0</NetAmountTaxable>
<TaxInclusiveAmount>0.0</TaxInclusiveAmount>
<OverrideDeltaAmount>0.0</OverrideDeltaAmount>
<TaxPercent>0.0</TaxPercent>
<TaxRateRef>
<Id>5</Id>
<SyncToken>0</SyncToken>
<MetaData>
<CreateTime>2016-01-27T21:58:46-0800</CreateTime>
<LastUpdatedTime>2016-01-27T21:58:46-0800</LastUpdatedTime>
</MetaData>
<Name>HST ON</Name>
<Description>Harmonized federal and provincial tax (Ontario)</Description>
<Active>true</Active>
<Taxable>true</Taxable>
<TaxGroup>true</TaxGroup>
<SalesTaxRateList>
<TaxRateDetail>
<TaxRateRef name="HST ON">12</TaxRateRef>
<TaxTypeApplicable>TaxOnAmount</TaxTypeApplicable>
<TaxOrder>0</TaxOrder>
</TaxRateDetail>
</SalesTaxRateList>
<PurchaseTaxRateList>
<TaxRateDetail>
<TaxRateRef name="HST (ITC) ON">11</TaxRateRef>
<TaxTypeApplicable>TaxOnAmount</TaxTypeApplicable>
<TaxOrder>0</TaxOrder>
</TaxRateDetail>
</PurchaseTaxRateList>
</TaxRateRef>
</TaxLine>
</TxnTaxDetail>Notice the TaxLine entries are missing the DetailType attribute, which should be TaxLineDetail.
Metadata
Metadata
Assignees
Labels
No labels