📄 frmbillmanage.frm
字号:
.Cell(1, 2).Width = 133
.Cell(1, 2).Range.Paragraphs.Alignment = wdAlignParagraphCenter
.Cell(1, 2).Range.Text = sys.StrToText(rs("CARNUM"))
.Cell(1, 3).Width = 80
.Cell(1, 3).Range.Paragraphs.Alignment = wdAlignParagraphLeft
.Cell(1, 3).Range.Text = "品名:"
.Cell(1, 4).Width = 133
.Cell(1, 4).Range.Paragraphs.Alignment = wdAlignParagraphCenter
inum = 0
isfind = False
For inum = 0 To UBound(arrProduct, 2)
If arrProduct(0, inum) = sys.TextTolong(rs("PRODUCTNAME")) Then
.Cell(1, 4).Range.Text = sys.StrToText(arrProduct(1, inum))
isfind = True
Exit For
End If
Next
If isfind = False Then
.Cell(1, 4).Range.Text = ""
End If
.Cell(2, 1).Width = 80
.Cell(2, 1).Range.Paragraphs.Alignment = wdAlignParagraphLeft
.Cell(2, 1).Range.Text = "发货人"
.Cell(2, 2).Width = 133
.Cell(2, 2).Range.Paragraphs.Alignment = wdAlignParagraphCenter
inum = 0
isfind = False
For inum = 0 To UBound(arrclient, 2)
If arrclient(0, inum) = sys.TextTolong(rs("SENDER")) Then
.Cell(2, 2).Range.Text = sys.StrToText(arrclient(1, inum))
isfind = True
Exit For
End If
Next
If isfind = False Then
.Cell(2, 2).Range.Text = ""
End If
.Cell(2, 3).Width = 80
.Cell(2, 3).Range.Paragraphs.Alignment = wdAlignParagraphLeft
.Cell(2, 3).Range.Text = "收货人:"
.Cell(2, 4).Width = 133
.Cell(2, 4).Range.Paragraphs.Alignment = wdAlignParagraphCenter
inum = 0
isfind = False
For inum = 0 To UBound(arrclient, 2)
If arrclient(0, inum) = sys.TextTolong(rs("RECEIVER")) Then
.Cell(2, 4).Range.Text = sys.StrToText(arrclient(1, inum))
isfind = True
Exit For
End If
Next
If isfind = False Then
.Cell(2, 4).Range.Text = ""
End If
.Cell(3, 1).Width = 80
.Cell(3, 1).Range.Paragraphs.Alignment = wdAlignParagraphLeft
.Cell(3, 1).Range.Text = "国铁运费:"
.Cell(3, 2).Width = 133
.Cell(3, 2).Range.Paragraphs.Alignment = wdAlignParagraphCenter
If Not IsNull(rs("BASICCARRIAGE")) Then
.Cell(3, 2).Range.Text = sys.StrToText(rs("BASICCARRIAGE"))
Else
.Cell(3, 2).Range.Text = "-"
End If
.Cell(3, 3).Width = 80
.Cell(3, 3).Range.Paragraphs.Alignment = wdAlignParagraphLeft
.Cell(3, 3).Range.Text = "地铁运费:"
.Cell(3, 4).Width = 133
.Cell(3, 4).Range.Paragraphs.Alignment = wdAlignParagraphCenter
If Not IsNull(rs("LOCALCARRIAGE")) Then
.Cell(3, 4).Range.Text = sys.StrToText(rs("LOCALCARRIAGE"))
Else
.Cell(3, 4).Range.Text = "-"
End If
.Cell(4, 1).Width = 80
.Cell(4, 1).Range.Paragraphs.Alignment = wdAlignParagraphLeft
.Cell(4, 1).Range.Text = "服务费:"
.Cell(4, 2).Width = 133
.Cell(4, 2).Range.Paragraphs.Alignment = wdAlignParagraphCenter
If Not IsNull(rs("SERVECHARGE")) Then
.Cell(4, 2).Range.Text = sys.StrToText(rs("SERVECHARGE"))
Else
.Cell(4, 2).Range.Text = "-"
End If
.Cell(4, 3).Width = 80
.Cell(4, 3).Range.Paragraphs.Alignment = wdAlignParagraphLeft
.Cell(4, 3).Range.Text = "装卸费:"
.Cell(4, 4).Width = 133
.Cell(4, 4).Range.Paragraphs.Alignment = wdAlignParagraphCenter
If Not IsNull(rs("LOADCHARGE")) Then
.Cell(4, 4).Range.Text = sys.StrToText(rs("LOADCHARGE"))
Else
.Cell(4, 4).Range.Text = "-"
End If
.Cell(5, 1).Width = 80
.Cell(5, 1).Range.Paragraphs.Alignment = wdAlignParagraphLeft
.Cell(5, 1).Range.Text = "短途运费:"
.Cell(5, 2).Width = 133
.Cell(5, 2).Range.Paragraphs.Alignment = wdAlignParagraphCenter
If Not IsNull(rs("SHORTCARRIAGE")) Then
.Cell(5, 2).Range.Text = sys.StrToText(rs("SHORTCARRIAGE"))
Else
.Cell(5, 2).Range.Text = "-"
End If
.Cell(5, 3).Width = 80
.Cell(5, 3).Range.Paragraphs.Alignment = wdAlignParagraphLeft
.Cell(5, 3).Range.Text = "仓储费:"
.Cell(5, 4).Width = 133
.Cell(5, 4).Range.Paragraphs.Alignment = wdAlignParagraphCenter
If Not IsNull(rs("STORAGECHARGE")) Then
.Cell(5, 4).Range.Text = sys.StrToText(rs("STORAGECHARGE"))
Else
.Cell(5, 4).Range.Text = "-"
End If
.Cell(6, 1).Width = 80
.Cell(6, 1).Range.Paragraphs.Alignment = wdAlignParagraphLeft
.Cell(6, 1).Range.Text = "清扫费:"
.Cell(6, 2).Width = 133
.Cell(6, 2).Range.Paragraphs.Alignment = wdAlignParagraphCenter
If Not IsNull(rs("CLEARCHARGE")) Then
.Cell(6, 2).Range.Text = sys.StrToText(rs("CLEARCHARGE"))
Else
.Cell(6, 2).Range.Text = "-"
End If
.Cell(6, 3).Width = 80
.Cell(6, 3).Range.Paragraphs.Alignment = wdAlignParagraphLeft
.Cell(6, 3).Range.Text = "优惠金额:"
.Cell(6, 4).Width = 133
.Cell(6, 4).Range.Paragraphs.Alignment = wdAlignParagraphCenter
If Not IsNull(rs("FAVOURABILE")) Then
.Cell(6, 4).Range.Text = sys.StrToText(rs("FAVOURABILE"))
Else
.Cell(6, 4).Range.Text = "-"
End If
.Cell(7, 1).Width = 80
.Cell(7, 1).Range.Paragraphs.Alignment = wdAlignParagraphLeft
.Cell(7, 1).Range.Text = "单价:"
.Cell(7, 2).Width = 133
.Cell(7, 2).Range.Paragraphs.Alignment = wdAlignParagraphCenter
If (IsNumeric(rs("TOTAL"))) And (IsNumeric(rs("WEIGHT"))) Then
.Cell(7, 2).Range.Text = sys.StrToText(FormatNumber(rs("TOTAL") / rs("WEIGHT"), 2))
Else
.Cell(7, 2).Range.Text = "-"
End If
.Cell(7, 3).Width = 80
.Cell(7, 3).Range.Paragraphs.Alignment = wdAlignParagraphLeft
.Cell(7, 3).Range.Text = "运费合计:"
.Cell(7, 4).Width = 133
.Cell(7, 4).Range.Paragraphs.Alignment = wdAlignParagraphCenter
If Not IsNull(rs("TOTAL")) Then
.Cell(7, 4).Range.Text = sys.StrToText(rs("TOTAL")) & "元"
Else
.Cell(7, 4).Range.Text = "-"
End If
End With
.MoveRight Unit:=wdCharacter, Count:=1, Extend:=wdExtend
.MoveDown Unit:=wdLine, Count:=7
.TypeText Text:="备注: "
.TypeParagraph
.TypeParagraph
.ParagraphFormat.Alignment = wdAlignParagraphRight
.TypeText Text:="宜春市金胜物流有限公司 "
.TypeParagraph
.TypeText Text:=sys.StrToText(Year(Date)) & " 年 " & sys.StrToText(Month(Date)) & " 月" & sys.StrToText(Day(Date)) & " 日"
rs.MoveNext
Loop
.TypeBackspace
End With
wordApp.PrintPreview = True
Else
MsgBox "数据错误!"
Unload Me
End If
Else
MsgBox "请先选择要浏览的记录!"
End If
End Sub
Private Sub cmdForWard_Click()
NowPage = NowPage - 1
Call GotoPage(NowPage, arrTraffic)
End Sub
Private Sub cmdNext_Click()
NowPage = NowPage + 1
Call GotoPage(NowPage, arrTraffic)
End Sub
Private Sub Command3_Click()
If IsNumeric(lsvTraffic.SelectedItem.Tag) Then
frmParticularPrint.Show
Else
MsgBox "请先选择要打印的记录!"
End If
End Sub
Private Sub cmdOnePrint_Click()
If IsNumeric(lsvTraffic.SelectedItem.Tag) Then
'取得数据
Dim inum As Integer
Dim isfind As Boolean
Dim strTemp As String
Dim rs As New ADODB.Recordset
strsql = "SELECT * FROM TRAFFIC WHERE ID = " & sys.TextTolong(lsvTraffic.SelectedItem.Tag)
Set rs = sys.DB.OpenRecordSet(strsql)
If Not rs.EOF Then
Dim wordApp As New Word.Application
Dim mysel As Word.Selection
Dim oTable As Word.Table
wordApp.Documents.Add
wordApp.Visible = True
wordApp.Activate
Set mysel = wordApp.Selection
With mysel
.TypeParagraph
.TypeParagraph
.TypeParagraph
.ParagraphFormat.Alignment = wdAlignParagraphRight
.Paragraphs.Last.Range.Font.Name = "楷体_GB2312"
.Paragraphs.Last.Range.Font.Bold = False
.Paragraphs.Last.Range.Font.Size = 10
.TypeText Text:="第一联:存根"
.TypeParagraph
.TypeParagraph
.TypeParagraph
.ParagraphFormat.Alignment = wdAlignParagraphCenter
.Paragraphs.Last.Range.Font.Bold = True
.Paragraphs.Last.Range.Font.Size = 20
.TypeText Text:="运 输 结 算 单"
.TypeParagraph
.ParagraphFormat.Alignment = wdAlignParagraphLeft
.Paragraphs.Last.Range.Font.Bold = False
.Paragraphs.Last.Range.Font.Size = 12
'客户
inum = 0
isfind = False
strTemp = ""
For inum = 0 To UBound(arrclient, 2)
If arrclient(0, inum) = sys.TextTolong(rs("SENDER")) Then
strTemp = strTemp & "客户名称:" & sys.Str
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -