Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/symfony/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 向所有者显示不带帐户的附件_Php_Exact Online - Fatal编程技术网

Php 向所有者显示不带帐户的附件

Php 向所有者显示不带帐户的附件,php,exact-online,Php,Exact Online,我有一小段代码,用于检索发票附件的所有URL $salesInvoice = new \Picqer\Financials\Exact\SalesInvoice($connection); $salesInvoices = $salesInvoice->filter("InvoiceToName eq 'my dude'"); $this->addTplParam("oItems", $salesInvoices); $aInvoices = ar

我有一小段代码,用于检索发票附件的所有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;
    }
不管它写得好不好,因为它不能完成任务。比如说,我得到了这样的结果:

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


现在我的问题是:有没有可能用这个链接创建一个“动态”的PDF?我怎样才能继续?它只在我登录到exact online时起作用。然而,客户在那里没有账户

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


您所要做的是使您的客户能够在以安全方式进行身份验证的同时获取文档。没有什么现成的东西可以帮你做这件事,所以我想这对你来说意味着大量的手工工作。

每个打给Exact Online的电话都需要经过身份验证。 在这种情况下,还需要使用访问令牌指定授权标头。 我认为您希望向客户展示您在网上准确开具的发票。为此,请使用上述指定的方法。 检索数据后,您可以根据自己的需要/标准将其显示给客户,因为您是数据的所有者。 如果您指定业务案例,我们可以进一步讨论。或者你可以输入一张票。
(免责声明:我是一名正式员工)

(旁注:有一些解决方案可以使用SQL脚本语言轻松检索文档。我们公司有一些解决方案可以帮助您解决这一问题。如果您想查看,请随时访问我的个人资料。)