我正在使用 C# 连接 QuickBooks desktop 2013。我需要根据账单记录付款,但无法弄清楚它为什么不起作用。我当前的代码不断抛出 3120 的错误,说它找不到账单,即使账单对象在我的控制中是打开的。我已将 intuit 提供的 IDN Unified OSR 用于 BillPaymentCheckAdd 对象结构,但它们传入的“数据”只是随机的,对我实际需要作为值传入的内容没有帮助。所以我可以使用一些帮助。这是我的支付账单方法的代码:
IBillPaymentCheckAdd paymentAdd = requestMsgSet.AppendBillPaymentCheckAddRq();
paymentAdd.PayeeEntityRef.ListID.SetValue(vendorId);
paymentAdd.TxnDate.SetValue(DateTime.Now);
paymentAdd.BankAccountRef.ListID.SetValue(bankAccount.ListID.GetValue());
paymentAdd.ORCheckPrint.IsToBePrinted.SetValue(true);
paymentAdd.Memo.SetValue(bankAccount.Name.GetValue());
IAppliedToTxnAdd appliedToTxnAdd = paymentAdd.AppliedToTxnAddList.Append();
appliedToTxnAdd.TxnID.SetValue(bill.TxnID.GetValue());
appliedToTxnAdd.PaymentAmount.SetValue((double)amount);
ISetCredit setCredit = appliedToTxnAdd.SetCreditList.Append();
setCredit.CreditTxnID.SetValue(bill.TxnID.GetValue());
setCredit.AppliedAmount.SetValue((double)amount);
paymentAdd.IncludeRetElementList.Add(bankAccount.Name.GetValue());
IMsgSetResponse responseMsgSet = sessionManager.DoRequests(requestMsgSet);
IResponse response = responseMsgSet.ResponseList.GetAt(0);
IBillPaymentCheckRet paymentRet = (IBillPaymentCheckRet)response.Detail;