QBSDK使用AppendReceivePaymentAddRq

时间:2014-01-07 15:59:52

标签: vb.net qbfc

我正在编写一个自定义应用程序,允许我们的会计师使用qbsdk向我们的会计系统输入付款。具体来说,我使用的是AppendReceivePaymentAddRq(我将在下面详细介绍我的代码)。我担心的是,当使用QB接口转到接收付款时,付款会被存入未存入资金,然后我们可以转到银行>存款,我们看到那里的付款。

使用AppendReceivePaymentAddRq方法时,付款会被存入未存入资金但是当我们转到银行业务时>存款我们不会看到付款。但是,付款确实会应用于发票。

我在AppendReceivePaymentAddRq中做错了什么?这是我的代码。

Dim msgSetRequest As IMsgSetRequest = Common.CreateRequest()
        Dim paymentRequest As IReceivePaymentAdd = msgSetRequest.AppendReceivePaymentAddRq()
        paymentRequest.CustomerRef.ListID.SetValue(Me.CustomerListId)
        paymentRequest.ARAccountRef.FullName.SetValue(Me.ARAccount)
        paymentRequest.TxnDate.SetValue(Me.TransactionDate)
        paymentRequest.TotalAmount.SetValue(Me.TotalAmount)
        paymentRequest.PaymentMethodRef.FullName.SetValue(Me.PaymentMethod)
        paymentRequest.Memo.SetValue(Me.Memo)
        paymentRequest.DepositToAccountRef.FullName.SetValue(Me.DepositToAccount)
        paymentRequest.RefNumber.SetValue(Me.PayRef)
        For Each invoice As Invoice In Me.OpenInvoices
            If invoice.PaymentAmount > 0 Then
                Dim appliedPayment As IAppliedToTxnAdd = paymentRequest.ORApplyPayment.AppliedToTxnAddList.Append()
                appliedPayment.TxnID.SetValue(invoice.TransactionId)
                appliedPayment.PaymentAmount.SetValue(invoice.PaymentAmount)
            End If
        Next

 Dim msgSetResponse As IMsgSetResponse = Common.SessionManager.DoRequests(msgSetRequest)
        Dim responseList As IResponseList = msgSetResponse.ResponseList
        If responseList IsNot Nothing Then
            For i As Integer = 0 To responseList.Count - 1
                Dim response As IResponse = responseList.GetAt(i)
                If (response.StatusCode = 0) Then
                    FieldManager.UpdateChildren(Me)
                Else
                    Dim message = response.StatusMessage
                    Throw New ApplicationException(message)
                End If
            Next
        End If

1 个答案:

答案 0 :(得分:0)

不知道如何将 Hpjchobbes的评论标记为答案,所以我向他投了票,如果有人关心的话,这就是答案。

有2个帐户与Undeposited funds帐户匹配,我错误地发布了错误的帐户。 QB正在寻找标有“* Undeposited Funds”的帐户。更改我的代码,反映*解决了我的问题。

相关问题