简体   繁体   English

如何在网上速成书上使用PHP代码制作发票付款

[英]How to make an Invoice as paid using PHP code at quickbooks online sdk

I have created Invoice using this code : https://github.com/intuit/QuickBooks-V3-PHP-SDK/blob/master/src/_Samples/InvoiceCreate.php 我使用以下代码创建了发票: https : //github.com/intuit/QuickBooks-V3-PHP-SDK/blob/master/src/_Samples/InvoiceCreate.php

But how can make this invoice as paid using PHP sdk? 但是如何使用PHP sdk将此发票设为已付款?

Here I am getting payment using paper check ... so I am creating Invoice just for bookkeeping and not sending to client. 在这里,我使用纸质支票付款...因此,我创建的发票仅用于簿记,而不发送给客户。 ( not using QBO Payment ) so when I rec payment how to mark invoice as paid using php sdk ? (不使用QBO付款),所以当我记帐付款时如何将发票标记为使用php sdk付款?

I try to update "Balance" as 0 but its not marking as paid. 我尝试将“余额”更新为0,但未将其标记为已付款。

Thanks 谢谢

I'm not a 100% sure about this, but I think you have to create payments for that invoice amounting to the full sum of the invoice. 我对此并不十分确定,但我认为您必须为该发票创建总计发票金额的付款。 To see the required contents of the payload, see https://developer.intuit.com/docs/api/accounting/payment . 要查看有效内容的必需内容,请参阅https://developer.intuit.com/docs/api/accounting/payment

First I'd really recommend you use The library written by Keith Palmer for this as the QBO documentation is garbage that's all over the place. 首先,我真的建议您使用Keith Palmer编写的库来实现此目的,因为QBO文档到处都是垃圾。

With that being said: 话虽这么说:

You need to return the transaction Id from the invoice: 您需要从发票中返回交易ID:

return $resultingObj->TxnId;

And then create a payment using supplying that transaction id: 然后使用提供的交易ID创建付款:

$invoiceId = CreateInvoice(); //returns txnId above

$qbLinkedInvoice = new IPPLinkedTxn();
$qbLinkedInvoice->TxnId = $invoiceId;
$qbLinkedInvoice->TxnType = 'Invoice';

$qbLine = new IPPLine();
$qbLine->Amount = "";//set amount;
$qbLine->LinkedTxn = $qbLinkedInvoice;

$qbPayment = new IPPPayment();
$qbPayment->CustomerRef = "";//customer id
$qbPayment->TotalAmt = "";//I think this must match amount above;
$qbPayment->Line = array($qbLine);

$createdQbPayment = $this->dataService->Add($qbPayment);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM