Question

I am writing a custom application that will allow our accountant to enter payments into our Accounting system using the qbsdk. Specifically I am using the AppendReceivePaymentAddRq (I will detail my code below). My concern is when using the QB interface by going to Receive payment, the payment gets put into Undeposited Funds, then we can go to Banking > Make Deposit and we see the payment there.

While using the AppendReceivePaymentAddRq method the payments gets put into Undeposited Funds however when we go to Banking > Make Deposit we don't see the payment. However the payments does get applied to the invoice.

Am I doing something wrong in the AppendReceivePaymentAddRq?? Here is my code.

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
Was it helpful?

Solution

Didn't know how to mark Hpjchobbes's comment as the answer, so I up-voted him and here is the answer if anyone cares.

There were 2 accounts matching the Undeposited funds account, I was mistakenly posting the the wrong one. QB was looking in the account marked "*Undeposited Funds" Changing my code the reflect the * solved my issue.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top