Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Dim invoice As Invoice = invoiceList(i)
- qbInvoice = msgReq.AppendInvoiceAddRq
- qbInvoice.CustomerRef.ListID.SetValue(invoice.CustomerListID)
- qbInvoice.ARAccountRef.ListID.SetValue(invoice.AccountListID)
- qbInvoice.TxnDate.SetValue(invoice.NextDte)
- qbInvoice.TemplateRef.ListID.SetValue(invoice.TemplateListID)
- qbInvoice.CustomerMsgRef.ListID.SetValue("220000-1173472448")
- qbInvoice.ItemSalesTaxRef.ListID.SetValue(invoice.TaxAccountListID)
- Dim Subtotal As Decimal = 0
- For Each LineItem In invoice.NextLineItems
- If Not IsNothing(LineItem.Amount) Then Subtotal = Subtotal + LineItem.Amount
- Next
- If Subtotal <> 0 Then
- If String.Compare(invoice.Printed, "Yes") = 0 Then
- qbInvoice.IsToBePrinted.SetValue(True)
- Else
- qbInvoice.IsToBePrinted.SetValue(False)
- End If
- If String.Compare(invoice.Emailed, "Yes") = 0 Then
- qbInvoice.IsToBeEmailed.SetValue(True)
- Else
- qbInvoice.IsToBeEmailed.SetValue(False)
- End If
- Else
- qbInvoice.IsToBePrinted.SetValue(False)
- qbInvoice.IsToBeEmailed.SetValue(False)
- qbInvoice.IsPending.SetValue(True)
- End If
- If Not IsNothing(invoice.PONumber) Then qbInvoice.PONumber.SetValue(invoice.PONumber)
- If Not IsNothing(invoice.BusRepListID) Then qbInvoice.SalesRepRef.ListID.SetValue(invoice.BusRepListID)
- If Not IsNothing(invoice.BillLineOne) Then qbInvoice.BillAddress.Addr1.SetValue(invoice.BillLineOne)
- If Not IsNothing(invoice.BillLineTwo) Then qbInvoice.BillAddress.Addr2.SetValue(invoice.BillLineTwo)
- If Not IsNothing(invoice.BillLineThree) Then qbInvoice.BillAddress.Addr3.SetValue(invoice.BillLineThree)
- If Not IsNothing(invoice.BillLineFour) Then qbInvoice.BillAddress.Addr4.SetValue(invoice.BillLineFour)
- If Not IsNothing(invoice.BillLineFive) Then qbInvoice.BillAddress.Addr5.SetValue(invoice.BillLineFive)
- If Not IsNothing(invoice.BillCity) Then qbInvoice.BillAddress.City.SetValue(invoice.BillCity)
- If Not IsNothing(invoice.BillCountry) Then qbInvoice.BillAddress.Country.SetValue(invoice.BillCountry)
- If Not IsNothing(invoice.BillState) Then qbInvoice.BillAddress.State.SetValue(invoice.BillState)
- If Not IsNothing(invoice.BillZip) Then qbInvoice.BillAddress.PostalCode.SetValue(invoice.BillZip)
- If Not IsNothing(invoice.ShipLineOne) Then qbInvoice.ShipAddress.Addr1.SetValue(invoice.ShipLineOne)
- If Not IsNothing(invoice.ShipLineTwo) Then qbInvoice.ShipAddress.Addr2.SetValue(invoice.ShipLineTwo)
- If Not IsNothing(invoice.ShipLineThree) Then qbInvoice.ShipAddress.Addr3.SetValue(invoice.ShipLineThree)
- If Not IsNothing(invoice.ShipLineFour) Then qbInvoice.ShipAddress.Addr4.SetValue(invoice.ShipLineFour)
- If Not IsNothing(invoice.ShipLineFive) Then qbInvoice.ShipAddress.Addr5.SetValue(invoice.ShipLineFive)
- If Not IsNothing(invoice.ShipCity) Then qbInvoice.ShipAddress.City.SetValue(invoice.ShipCity)
- If Not IsNothing(invoice.ShipCountry) Then qbInvoice.ShipAddress.Country.SetValue(invoice.ShipCountry)
- If Not IsNothing(invoice.ShipState) Then qbInvoice.ShipAddress.State.SetValue(invoice.ShipState)
- If Not IsNothing(invoice.ShipZip) Then qbInvoice.ShipAddress.PostalCode.SetValue(invoice.ShipZip)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement