0

我正在为我的公司开发一个会计第三方 C# 表单应用程序,它从外部源批量加载付款,对于原型,我使用 excel 文件来获取实际付款数据。

现在我有了IRecievePaymenttoDeposit,我得到了所有带有客户参考的未付发票,并且IInvoiceQuery我可以得到客户,但是这两个查询的参考键是什么?

我将获得客户姓名、客户 ID 和发票编号,如何将金额添加到所选付款中。

4

1 回答 1

0

要将付款应用到发票,您需要发票的 TxnID,它与发票编号不同。您可以使用发票编号,但是查询发票以获取 TxnID。

IInvoiceQuery invQuery = MsgRequest.AppendInvoiceQueryRq();
invQuery.ORInvoiceQuery.InvoiceFilter.ORRefNumberFilter.RefNumberFilter.RefNumber.SetValue(invoiceNumber);

// Use either the full name of the customer or the ListID invQuery.ORInvoiceQuery.InvoiceFilter.EntityFilter.OREntityFilter.FullNameList.Add(customerName); invQuery.ORInvoiceQuery.InvoiceFilter.EntityFilter.OREntityFilter.ListIDList.Add(customerid);

一旦你有了发票,你就可以得到 TxnID。然后,当您创建 ReceivePaymentAdd 时,您指定 TxnID 以将付款应用到:

// Create the payment add request
IReceivePaymentAdd pmtAdd = MsgRequest.AppendReceivePaymentAddRq();

// Create the AppliedToTxn request for the payment. IAppliedToTxnAdd appAdd = pmtAdd.ORApplyPayment.AppliedToTxnAddList.Append();

// Set the invoice TxnID and amount of the payment to apply appAdd.TxnID.SetValue(invoiceTxnID); appAdd.PaymentAmount.SetValue(amountToApply);

于 2014-01-20T19:42:16.490 回答