在Reckon / Quickbooks桌面版VB.NET中添加付款

时间:2018-11-21 22:51:02

标签: c# vb.net sdk payment quickbooks

我正在尝试在Reckon / Quickbooks桌面上添加付款,尝试了许多其他方式,但是我还是没有运气。以下是我从Quickbooks API reference

找到的代码
 Dim paymentAdd As IReceivePaymentAdd = requestMsgSet.AppendReceivePaymentAddRq()
paymentAdd.CustomerRef.ListID.SetValue("Code007")
Dim paymentLine As IAppliedToTxnAdd = paymentAdd.ORApplyPayment.AppliedToTxnAddList.Append()
''Set the invoice TxnID and amount of the payment to apply
paymentLine.TxnID.SetValue(12)
paymentLine.PaymentAmount.SetValue(5.50)
paymentAdd.Memo.SetValue("Comments")
paymentAdd.PaymentMethodRef.FullName.SetValue("Cash")
paymentAdd.DepositToAccountRef.FullName.SetValue("Funds to be deposited")
paymentAdd.TxnDate.SetValue(New Date())
paymentAdd.TotalAmount.SetValue(5.50))
''paymentAdd.ORApplyPayment.IsAutoApply.SetValue(False)

sessionManager.OpenConnection("My connection")
sessionManager.BeginSession("Beginning the Session")

''Send the request and get the response from QuickBooks
Dim responseMsgSet As IMsgSetResponse = sessionManager.DoRequests(requestMsgSet)

'End the session and close the connection to QuickBooks
sessionManager.EndSession()
sessionManager.CloseConnection()

Dim response As IResponse = responseMsgSet.ResponseList.GetAt(0)

Dim responseType As ENResponseType
responseType = CType(response.Type.GetValue(), ENResponseType)
'If (responseType = ENResponseType.rtReceivePaymentAddRs) Then
'End If

Dim paymentRet As IReceivePaymentRet = DirectCast(response.Detail, IReceivePaymentRet)

现在在最后一行中,我从responce.Detail中的快速簿接收响应,该响应在响应中始终为空。消息我得到以下消息,

  

相关对象已在使用中,或无法获取该对象的锁。

我正在尝试将数据导入ReckonAccounts Enterprise 2018并使用QBFC12库。以单用户模式使用,仅在应用程序内部打开“主页”窗口。

我在stackoverflow上发现了一个付款问题,代码几乎相同,但不确定为什么我无法添加付款。

任何帮助将不胜感激。谢谢。

0 个答案:

没有答案
相关问题