我正在尝试添加包含多个订单项的帐单。我可以遍历要添加的值,完成后仅广告最后一组值。
商品说明金额
001 desc1 $ 1221
002 desc2 15.15美元
003 desk3 45.78美元
Dim SessionManager As New QBFC13Lib.QBSessionManager
SessionManager.OpenConnection("", ApplicationName)
SessionManager.BeginSession("", QBFC13Lib.ENOpenMode.omDontCare)
Dim BillAddSet As QBFC13Lib.IMsgSetRequest = Nothing
Dim BillAddRq As QBFC13Lib.IBillAdd = Nothing
Dim Expense As QBFC13Lib.IExpenseLineAdd = Nothing
Dim ResponseSet As QBFC13Lib.IMsgSetResponse = Nothing
Dim response As QBFC13Lib.IResponse = Nothing
Dim billRet As QBFC13Lib.IBillRet = Nothing
BillAddSet = GetLatestMsgSetRequest(SessionManager)
BillAddRq = BillAddSet.AppendBillAddRq
BillAddRq.VendorRef.FullName.SetValue(strDWVendorCustomerName)
BillAddRq.RefNumber.SetValue(strDWInvoiceNumber)
BillAddRq.TxnDate.SetValue(strDWInvoiceDate)
Expense = BillAddRq.ExpenseLineAddList.Append
For I As Integer = 0 To strDWKeywordGLAccount.Count - 1
Expense.Amount.SetValue(CDbl(strDWKeywordAmount(I)))
Expense.AccountRef.FullName.SetValue(strDWKeywordGLAccount(I))
Expense.Memo.SetValue(strDWKeywordDescription(I))
Next
ResponseSet = SessionManager.DoRequests(BillAddSet)
response = ResponseSet.ResponseList.GetAt(0)
SessionManager.EndSession()
SessionManager.CloseConnection()
Return response.StatusCode