gpt4 book ai didi

c# - SAP DI API : How to add payments with multiple invoice?

转载 作者:行者123 更新时间:2023-12-05 07:46:16 24 4
gpt4 key购买 nike

我正在尝试使用多张发票从我的附加应用程序付款过账到 sap。我使用 C# 开发我的附加应用程序。发布后,sap 为每张发票或付款明细创建一笔付款,但假设这些付款的发票属于我的附加应用程序中的一笔付款。这是我的代码。

    Payments _pay = (Payments)company.GetBusinessObject(BoObjectTypes.oIncomingPayments);
Recordset _oRecordSet = (Recordset)company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset);
_oRecordSet.DoQuery("select NextNumber from NNM1 where Series = 98");
int docnum = int.Parse(_oRecordSet.Fields.Item(0).Value.ToString());
int errCode = 0;

_pay.DocNum = docnum;
_pay.DocDate = pay.DocDate;
_pay.TaxDate = pay.TaxDate;
_pay.DueDate = pay.DocDueDate;
_pay.CashSum = pay.CashSum;
_pay.CashAccount = pay.CashAcct;
_pay.Invoices.SumApplied = pay.TotalPaid;
_pay.Invoices.AppliedFC = pay.TotalPaid;
_pay.Invoices.InvoiceType = BoRcptInvTypes.it_Invoice;

foreach (var i in pay.Details)
{
InvoiceHeader inv = new InvoiceHeader();
inv = context.InvoiceHeaders.FirstOrDefault(x => x.Id == i.TransactionDocumentNo);
_pay.Invoices.DocEntry = Convert.ToInt32(inv.DocumentNumber);

errCode = _pay.Add();

if (errCode != 0)
{
string _errMsg = "";
company.GetLastError(out errCode, out _errMsg);
}
}

最佳答案

关于c# - SAP DI API : How to add payments with multiple invoice?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40901364/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com