1

我有一小段代码,它检索发票附件的所有 url

    $salesInvoice = new \Picqer\Financials\Exact\SalesInvoice($connection);
    $salesInvoices = $salesInvoice->filter("InvoiceToName eq 'my dude'");

    $this->addTplParam("oItems", $salesInvoices);

    $aInvoices = array();
    $aDocuments = array();
    $aDocumentAttachments = array();

    // we collect all the invoices numbers
    foreach($salesInvoices as $salesInvoice)
    {
        $aInvoices[] = $salesInvoice->InvoiceNumber;
    }

    // now we check the Documents
    $document = new \Picqer\Financials\Exact\Document($connection);
    $documents = $document->filter("SalesInvoiceNumber eq ".$aInvoices[0]);


    foreach($documents as $document) {
        $aDocuments[] = $document->ID;
    }

    // now the attachments
    $documentAttachment = new \Picqer\Financials\Exact\DocumentAttachment($connection);
    $documentAttachments = $documentAttachment->filter("Document eq guid'".$aDocuments[0]."'");

    foreach($documentAttachments as $documentAttachment)
    {
        $aDocumentAttachments[] = $documentAttachment->Url;
    }

不管它写得好不好,因为它不能完成工作。所以,例如,我得到这样的东西:

https://start.exactonline.de/docs/SysAttachment.aspx?ID=123123-123123-123123&除法=1234

尝试访问此文档时,我收到一条错误消息,提示我无权查看此文档。

现在我的问题是:是否可以使用此链接“即时”创建 PDF?我该如何进行?只要我登录到exact-online,它就可以工作。但是,客户在那里没有帐户。

4

2 回答 2

2

不,那是不可能的。您不能仅通过使用资源的 URL 来规避 ExactOnline 的安全性。

您需要做的是让您的客户能够在以安全方式进行身份验证的同时获取文档。没有什么开箱即用的东西可以为你做这件事,所以我猜这对你来说意味着很多手工工作。

于 2016-10-27T13:55:04.660 回答
0

对 Exact Online 的每次调用都需要进行身份验证。在这种情况下,您还需要使用访问令牌指定 Authorization 标头。我认为您想向您的客户展示您在 Exact Online 中制作的发票。为此,请使用上述指定方法。检索数据后,您可以根据自己的需求/标准将其展示给您的客户,因为您是数据的所有者。如果您指定业务案例,我们可以进一步讨论。或者你可以输入一张票。(免责声明:我是确切的员工)

于 2016-10-28T18:16:28.277 回答