当我尝试通过 .net IPP SDK 添加发票时,发票添加请求运行成功,但是一旦从 Quickbooks 中的同步管理器启动同步,我就会收到错误消息。该错误仅在使用 GetSyncActivity() 检索状态时可见
我看到的错误是:
QBXML 验证错误:[severity=FATAL_ERROR,message=cvc-complex-type.2.4.a:发现以元素“TxnDate”开头的无效内容。需要“{CustomerRef}”之一。,locator=[url=null,line=-1,column=-1,node=null,object=com.intuit.sb.datasync.writeback.qbxml.schema.InvoiceAdd@ 4538d9d1,字段=空]]
我启用了请求日志记录,并且在查看生成和发送的发票 XML 时,如果我将其与在线文档中的示例请求进行比较,它看起来没有任何问题。我已经尝试指定可能是问题的其他客户 ID 的想法,指定帐单地址/送货地址,并指定 ARAccountRef,但这些更改都没有对错误产生任何影响。
有什么我遗漏的东西,或者你能想到的任何我可以尝试解决的问题吗?
要求:
<Add xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.intuit.com/sb/cdm/v2" RequestId="fd0822d7666248119d8ee482f264bd84" FullResponse="true">
<ExternalRealmId>Realm ID removed</ExternalRealmId>
<Object xsi:type="Invoice">
<SyncToken>0</SyncToken>
<MetaData>
<CreateTime>2013-02-24T18:05:21.1706511-05:00</CreateTime>
<LastUpdatedTime>2013-02-24T18:05:21.1706511-05:00</LastUpdatedTime>
</MetaData>
<Header>
<DocNumber>232751</DocNumber>
<CustomerId>11505739</CustomerId>
<CustomerName/>
<TotalAmt>900.00</TotalAmt>
<SalesTermId idDomain="QB">3</SalesTermId>
<DueDate>2013-02-24T00:00:00-05:00</DueDate>
<BillAddr/>
<ShipAddr/>
<ShipMethodId/>
<DiscountAmt>0</DiscountAmt>
</Header>
<Line>
<Desc>Test</Desc>
<Amount>900.00</Amount>
<ItemId>3377682</ItemId>
<UnitPrice>180.00</UnitPrice>
<Qty>5</Qty>
<ServiceDate>2013-02-24T18:05:21.1956543-05:00</ServiceDate>
</Line>
</Object>
</Add>
回复:
<RestResponse xmlns="http://www.intuit.com/sb/cdm/v2">
<Success RequestId="fd0822d7666248119d8ee482f264bd84">
<Invoice>
<Id idDomain="NG">12313656</Id>
<SyncToken>1</SyncToken>
<MetaData>
<CreatedBy>app</CreatedBy>
<CreateTime>2013-02-24T23:05:25Z</CreateTime>
<LastModifiedBy>app</LastModifiedBy>
<LastUpdatedTime>2013-02-24T23:05:25Z</LastUpdatedTime>
</MetaData>
<Synchronized>false</Synchronized>
<Header>
<DocNumber>232751</DocNumber>
<TxnDate>2013-02-24T00:00:00Z</TxnDate>
<CustomerId idDomain="NG">11505739</CustomerId>
<SubTotalAmt>900</SubTotalAmt>
<TaxRate>0</TaxRate>
<TaxAmt>0</TaxAmt>
<TotalAmt>900</TotalAmt>
<SalesTermId idDomain="QB">3</SalesTermId>
<DueDate>2013-02-24T00:00:00Z</DueDate>
<BillAddr>
<Tag>Billing</Tag>
</BillAddr>
<ShipAddr>
<Tag>Shipping</Tag>
</ShipAddr>
<Balance>900</Balance>
</Header>
<Line>
<Id idDomain="NG">37505805</Id>
<Desc>Test</Desc>
<Amount>900</Amount>
<Taxable>false</Taxable>
<ItemId idDomain="NG">3377682</ItemId>
<UnitPrice>180</UnitPrice>
<Qty>5</Qty>
<ServiceDate>2013-02-24T00:00:00Z</ServiceDate>
</Line>
</Invoice>
<RequestName>InvoiceAdd</RequestName>
<ProcessedTime>2013-02-24T23:05:25Z</ProcessedTime>
</Success>
</RestResponse>
通过调用 GetSyncStatus(...) 检索到的信息,指定 ErroredObjectsOnly=True
requestId: "fd0822d7666248119d8ee482f264bd84",
stateCode: "9",
stateDesc: "Record has fatal error",
messageCode: "100",
messageDesc: "QBXML validation error: [severity=FATAL_ERROR,message=cvc-complex-type.2.4.a: Invalid content was found starting with element 'TxnDate'. One of '{CustomerRef}' is expected.,locator=[url=null,line=-1,column=-1,node=null,object=com.intuit.sb.datasync.writeback.qbxml.schema.InvoiceAdd@4538d9d1,field=null]] ",
responseLogTMS: "2013-02-24T23:06:22Z",
idsType: "Intuit.Ipp.Data.Qbd"