C# 使用QBFC12为QuickBooks 2013支付不起作用的账单
我正在使用C#连接QuickBooks desktop 2013。我需要根据账单记录付款情况,但无法找出它不起作用的原因。我当前的代码不断抛出3120错误,表示它找不到账单,即使账单对象在我的控件中是打开的。我在BillPaymentCheckAdd对象结构中使用了intuit提供的IDN统一OSR,但它们传入的“数据”只是随机的,对我实际需要作为值传入的内容没有帮助。所以我需要一些帮助。以下是我的付费方式代码:C# 使用QBFC12为QuickBooks 2013支付不起作用的账单,c#,payment,quickbooks,qbfc,C#,Payment,Quickbooks,Qbfc,我正在使用C#连接QuickBooks desktop 2013。我需要根据账单记录付款情况,但无法找出它不起作用的原因。我当前的代码不断抛出3120错误,表示它找不到账单,即使账单对象在我的控件中是打开的。我在BillPaymentCheckAdd对象结构中使用了intuit提供的IDN统一OSR,但它们传入的“数据”只是随机的,对我实际需要作为值传入的内容没有帮助。所以我需要一些帮助。以下是我的付费方式代码: IBillPaymentCheckAdd paymentA
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;
我认为您得到的错误是指setCredit部分。信用证用于将以前的供应商信用证应用于票据。您将票据TxnID作为信用证传递,但这是票据交易,不是信用证交易,因此QuickBooks说它找不到信用证交易,因为它实际上不存在
如果您删除ISetCredit的4行部分,您的付款应该正确。非常感谢!我花了两个星期的大部分时间试图弄明白这一点。Intuit论坛/OSR上的所有人都说要这样做,他们应该知道,不要效仿他们的例子。