以下代码有助于将销售行导入发票:
Dim LineItems(dtItem.Rows.Count) As taSopLineIvcInsert_ItemsTaSopLineIvcInsert
Dim salesLine As New taSopLineIvcInsert_ItemsTaSopLineIvcInsert
'Create Invoice Sales lines
For Each dr In dtItem.Rows
With salesLine
.CUSTNMBR = dr.Item("acctno")
.SOPNUMBE = invoiceNumber
.SOPTYPE = 3
.DOCID = "STD INV"
.QUANTITY = dr.Item("Qty")
.ITEMNMBR = dr.Item("Item")
.ITEMDESC = dr.Item("Memo")
.UNITPRCE = dr.Item("SalesPrice")
.XTNDPRCE = dr.Item("Credit")
.TAXAMNT = 0
.UOFM = "Each"
.SALSTERR = "GENERAL"
.ReqShipDate = dtHdr.Rows(0).Item("InvoiceDate").ToString()
.FUFILDAT = dr.Item("Date1").ToString()
.ACTLSHIP = dr.Item("Date1").ToString()
'.NONINVEN = 0
.DOCDATE = dtHdr.Rows(0).Item("InvoiceDate").ToString()
.SLPRSNID = "C1"
End With
LineItems(rowCtr) = salesLine
rowCtr = rowCtr + 1
Next
SLPRSNID 和 SALSTERR 的字段将被忽略。正在使用所有行项目创建发票本身。感谢任何有使用此 API 经验的人提出的任何想法!