使用浏览选项

Using the Browse option

我正在为 Twinfield 编写应用程序。我登录了一个包含 4 个主管部门的帐户。我想检索属于未支付发票的所有信息。

通过搜索选项,我得到了某个办公室的所有未结发票。

string[][] finderOptions = new string[2][];

switch (office)
{
    case 0:
       finderOptions[0] = new string[] { "office", "xxxx01-01" };
       break;
    case 1:
       finderOptions[0] = new string[] { "office", "xxxx03-01" };
       break;
}
finderOptions[1] = new string[] { "dim1", "1300" };
TwinfieldFinder.MessageOfErrorCodes[] errorCodes = xmlFinder.Search(hdrXml, "IVT", "*", 0, 1, 0, finderOptions, out findResult);

这行得通。但它会返回发票编号,我还需要交易编号。因此,我执行浏览以查找交易编号。

也许还有另一种方法可以使用发票编号和交易编号来查找完整的交易?

浏览调用如下所示:

 TwinfieldProcessXml.ProcessXmlSoapClient xmlClient = new 
 TwinfieldProcessXml.ProcessXmlSoapClient("ProcessXmlSoap", cluster + "/webservices/processxml.asmx?wsdl");                                            
 TwinfieldProcessXml.Header hdrXml2 = new TwinfieldProcessXml.Header();
                hdrXml2.CompanyCode = finderOptions[0][1];
                hdrXml2.AnyAttr = hdr.AnyAttr;
                hdrXml2.SessionID = hdr.SessionID;

如果我在 headers 中使用 CompanyCode 没关系 它总是 return 属于第一个办公室的信息:xxxx01-01。

在 Twinfield 中使用浏览代码时,请确保向 select 正确的公司发送 SoapCall,如此处所述:

https://c3.twinfield.com/webservices/documentation/#/FAQ

否则您将取回默认公司的数据:

Q. When using the Browse Data functionality, in the response I get data from a different company. What is wrong?
A. In the browse data request there is no option to set the current company. Before sending the request, make sure the correct company is set by using the SelectCompany function. See also Web Services Authentication.

要获取未清发票,最好的方法是使用浏览代码。 Select 代码 100 并在 matchstatus 列上添加过滤器,示例如下:

https://gist.github.com/alexjeen/d4ef3295820dc98c7f0171e47294dbfe