Advertisement
Guest User

Untitled

a guest
Mar 27th, 2017
38
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.59 KB | None | 0 0
  1. Dim invoice As Invoice = invoiceList(i)
  2. qbInvoice = msgReq.AppendInvoiceAddRq
  3.  
  4.  
  5. qbInvoice.CustomerRef.ListID.SetValue(invoice.CustomerListID)
  6. qbInvoice.ARAccountRef.ListID.SetValue(invoice.AccountListID)
  7. qbInvoice.TxnDate.SetValue(invoice.NextDte)
  8. qbInvoice.TemplateRef.ListID.SetValue(invoice.TemplateListID)
  9. qbInvoice.CustomerMsgRef.ListID.SetValue("220000-1173472448")
  10. qbInvoice.ItemSalesTaxRef.ListID.SetValue(invoice.TaxAccountListID)
  11.  
  12.  
  13. Dim Subtotal As Decimal = 0
  14. For Each LineItem In invoice.NextLineItems
  15. If Not IsNothing(LineItem.Amount) Then Subtotal = Subtotal + LineItem.Amount
  16. Next
  17.  
  18. If Subtotal <> 0 Then
  19. If String.Compare(invoice.Printed, "Yes") = 0 Then
  20. qbInvoice.IsToBePrinted.SetValue(True)
  21. Else
  22. qbInvoice.IsToBePrinted.SetValue(False)
  23. End If
  24.  
  25. If String.Compare(invoice.Emailed, "Yes") = 0 Then
  26. qbInvoice.IsToBeEmailed.SetValue(True)
  27. Else
  28. qbInvoice.IsToBeEmailed.SetValue(False)
  29. End If
  30. Else
  31. qbInvoice.IsToBePrinted.SetValue(False)
  32. qbInvoice.IsToBeEmailed.SetValue(False)
  33. qbInvoice.IsPending.SetValue(True)
  34. End If
  35.  
  36. If Not IsNothing(invoice.PONumber) Then qbInvoice.PONumber.SetValue(invoice.PONumber)
  37. If Not IsNothing(invoice.BusRepListID) Then qbInvoice.SalesRepRef.ListID.SetValue(invoice.BusRepListID)
  38.  
  39. If Not IsNothing(invoice.BillLineOne) Then qbInvoice.BillAddress.Addr1.SetValue(invoice.BillLineOne)
  40. If Not IsNothing(invoice.BillLineTwo) Then qbInvoice.BillAddress.Addr2.SetValue(invoice.BillLineTwo)
  41. If Not IsNothing(invoice.BillLineThree) Then qbInvoice.BillAddress.Addr3.SetValue(invoice.BillLineThree)
  42. If Not IsNothing(invoice.BillLineFour) Then qbInvoice.BillAddress.Addr4.SetValue(invoice.BillLineFour)
  43. If Not IsNothing(invoice.BillLineFive) Then qbInvoice.BillAddress.Addr5.SetValue(invoice.BillLineFive)
  44. If Not IsNothing(invoice.BillCity) Then qbInvoice.BillAddress.City.SetValue(invoice.BillCity)
  45. If Not IsNothing(invoice.BillCountry) Then qbInvoice.BillAddress.Country.SetValue(invoice.BillCountry)
  46. If Not IsNothing(invoice.BillState) Then qbInvoice.BillAddress.State.SetValue(invoice.BillState)
  47. If Not IsNothing(invoice.BillZip) Then qbInvoice.BillAddress.PostalCode.SetValue(invoice.BillZip)
  48.  
  49. If Not IsNothing(invoice.ShipLineOne) Then qbInvoice.ShipAddress.Addr1.SetValue(invoice.ShipLineOne)
  50. If Not IsNothing(invoice.ShipLineTwo) Then qbInvoice.ShipAddress.Addr2.SetValue(invoice.ShipLineTwo)
  51. If Not IsNothing(invoice.ShipLineThree) Then qbInvoice.ShipAddress.Addr3.SetValue(invoice.ShipLineThree)
  52. If Not IsNothing(invoice.ShipLineFour) Then qbInvoice.ShipAddress.Addr4.SetValue(invoice.ShipLineFour)
  53. If Not IsNothing(invoice.ShipLineFive) Then qbInvoice.ShipAddress.Addr5.SetValue(invoice.ShipLineFive)
  54. If Not IsNothing(invoice.ShipCity) Then qbInvoice.ShipAddress.City.SetValue(invoice.ShipCity)
  55. If Not IsNothing(invoice.ShipCountry) Then qbInvoice.ShipAddress.Country.SetValue(invoice.ShipCountry)
  56. If Not IsNothing(invoice.ShipState) Then qbInvoice.ShipAddress.State.SetValue(invoice.ShipState)
  57. If Not IsNothing(invoice.ShipZip) Then qbInvoice.ShipAddress.PostalCode.SetValue(invoice.ShipZip)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement