【问题标题】:Payment on a bill not working using QBFC12 for QuickBooks 2013使用 QuickBooks 2013 的 QBFC12 支付账单不起作用
【发布时间】:2014-03-03 17:29:03
【问题描述】:

我正在使用 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;

【问题讨论】:

    标签: c# payment quickbooks qbfc


    【解决方案1】:

    我认为你得到的错误是指 setCredit 部分。信用用于将先前的供应商信用应用于账单。您将 Bi​​ll TxnID 作为信用传递,但它是帐单交易,而不是信用交易,因此 QuickBooks 说它无法找到信用交​​易,因为它实际上并不存在。

    如果您删除 ISetCredit 的 4 行部分,您的付款应该会正确进行。

    【讨论】:

    • 非常感谢!我花了两周的大部分时间试图弄清楚这一点。 Intuit 论坛/OSR 上的所有内容都说要这样做,应该知道比效仿他们的例子更好。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-06-01
    • 2010-11-14
    • 1970-01-01
    • 2015-05-25
    • 1970-01-01
    相关资源
    最近更新 更多