1

我正在使用 QBFC13 创建一个程序,该程序应该创建从其他当前资产类型账户到银行账户的存款。但是,当执行 depositadd 方法时,收款人不会在银行帐户中填写。如何填写收款人信息?我没有足够高的声誉来发布图片,所以这是我需要填写的字段图片的链接:http: //i.stack.imgur.com/nqWOh.jpg

这是我当前的代码:

    Public Sub CreateDeposit()
    On Error GoTo Errs
    Dim depositadd As IDepositAdd
    depositadd = msgSetRequest.AppendDepositAddRq()
    depositadd.DepositToAccountRef.FullName.SetValue("checking")

    depositadd.Memo.SetValue("newdeposit test")
    depositadd.TxnDate.SetValue(Date.Today)



    Dim depositLineAdd As IDepositLineAdd
    depositLineAdd = depositadd.DepositLineAddList.Append()
    depositLineAdd.ORDepositLineAdd.DepositInfo.AccountRef.ListID.SetValue("1EE0000-943382783")
    depositLineAdd.ORDepositLineAdd.DepositInfo.EntityRef.ListID.SetValue("80002534-1335362979")
    depositLineAdd.ORDepositLineAdd.DepositInfo.Amount.SetValue(150.0)
    depositLineAdd.ORDepositLineAdd.DepositInfo.Memo.SetValue("test memo lineitem")


    ' send the request to QB
    Dim msgSetResponse As IMsgSetResponse
    msgSetResponse = qbSessionManager.DoRequests(msgSetRequest)

    ' check to make sure we have objects to access first
    ' and that there are responses in the list
    If (msgSetResponse Is Nothing) Or _
        (msgSetResponse.ResponseList Is Nothing) Or _
        (msgSetResponse.ResponseList.Count <= 0) Then
        Exit Sub
    End If

    ' Start parsing the response list
    Dim responseList As IResponseList
    responseList = msgSetResponse.ResponseList
    MsgBox(msgSetRequest.ToXMLString())
    ' go thru each response and process the response.
    ' this example will only have one response in the list
    ' so we will look at index=0
    Dim response As IResponse
    response = responseList.GetAt(1)
    If (Not response Is Nothing) Then
        If response.StatusCode <> "0" Then
            MsgBox("DepositFunds unexpexcted Error - " & vbCrLf & "StatusCode = " & response.StatusCode & vbCrLf & vbCrLf & response.StatusMessage)
        Else
            MsgBox("The funds were successfully deposited in Checking")
            MsgBox(msgSetResponse.ToXMLString())
        End If
    End If

    Exit Sub

Errs:
        MsgBox("HRESULT = " & Err.Number & " (" & Hex(Err.Number) & ") " & vbCrLf & vbCrLf & Err.Description, _
                MsgBoxStyle.Critical, _
                "Error in DepositFunds")



End Sub
4

1 回答 1

0

这实际上不是 SDK 问题,因为它是 QuickBooks 的设计方式。因为 QuickBooks 中的存款交易可以包含多行,所以即使只有一行,银行登记簿也不会显示任何名称。您可以手动进入银行注册并添加名称,但无法通过 SDK 完成。甚至在 QuickBooks 中执行此操作也是一个两步过程,您可以在其中创建存款,然后在寄存器中进行编辑。

如果您需要使用 SDK 从交易中显示此信息,那么您可能必须使用日记帐分录而不是存款交易。

于 2014-05-23T17:03:11.097 回答