?? frmfee1.frm
字號:
Orientation = 0
Enabled = -1
Connect = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin MSFlexGridLib.MSFlexGrid mfgFee
Height = 3765
Left = 240
TabIndex = 2
Top = 2640
Width = 5490
_ExtentX = 9684
_ExtentY = 6641
_Version = 393216
Cols = 9
FixedCols = 0
WordWrap = -1 'True
AllowUserResizing= 3
Appearance = 0
FormatString = "用戶號|用戶名|用戶地址|上次抄表時間|上次表讀數|本次抄表時間|本次表讀數|電量|電費"
End
Begin MSComCtl2.DTPicker DTPicker2
Height = 375
Left = 5280
TabIndex = 22
Top = 600
Width = 1575
_ExtentX = 2778
_ExtentY = 661
_Version = 393216
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋體"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Format = 24510465
CurrentDate = 37954
End
End
Attribute VB_Name = "frmfee1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim sPrecinct() As String
Dim sUserNumber() As String
Dim P As Object
Dim print_H As Integer
Dim print_W As Integer
Private Sub Command1_Click(Index As Integer)
On Error Resume Next
Dim MYSET As New ADODB.Recordset
Dim MyFeeset As New ADODB.Recordset
Dim MyFeeSet1 As New ADODB.Recordset
Dim MyFeeSet2 As New ADODB.Recordset
Dim strsql As String
Dim sStart As Single, dStart As Date
Dim sEnd As Single, dEnd As Date
Dim MyChangeSet As Recordset
Dim sPowerValue As Single, sTotalValue As Single, sTotalFee As Single
Dim dChange As Date, I As Integer, u As Integer, j As Integer
Dim CY As Single, CX As Single
Dim CY1 As Single, CX1 As Single
Dim CY2 As Single, CX2 As Single
Dim CY3 As Single, CX3 As Single
Dim MySet2 As Recordset
Dim sTotalValue_D As Single
Dim sTotalFee_D As Single
Dim sTotalValue_Water As Single
Dim sTotalFee_Water As Single
Dim changestotalfee As Single
Select Case Index
Case 0 '確定
'lblTitle.Caption = cmbElement.Text & " " & dtpStart.Year & "年" & dtpStart.Month & "月 水電費明細"
With mfgFee
.Clear
.FormatString = "<序號|< 樓 號 |<房 主|>日 期|>上繳金額|>電 費|>水 費"
.Rows = 1
.Cols = 7
strsql = "SELECT * FROM USERFEE WHERE CLLODAY Between #" & dtpStart & "# And #" & DTPicker1 & "#"
If cmbElement.Text = "" Then
Else
strsql = strsql & " and louhaoid='" & cmbElement.Text & "'"
End If
strsql = strsql & " order by userid1"
MYSET.Open strsql, config.cnZdx, adOpenStatic, adLockReadOnly
Do Until MYSET.EOF
.Rows = .Rows + 1
.row = .Rows - 1
' sTotalfee = 0
strsql = "select * from USER1 where userid1=" & _
MYSET("userid1")
MyFeeset.Open strsql, config.cnZdx, adOpenStatic, adLockReadOnly
If MyFeeset.EOF Then
Exit Sub
End If
strsql = "select * from datawork where userid1=" & _
MYSET("userid1") & _
" and clloyear=" & MYSET("CLLOYEAR") & " and cllomonth=" & _
MYSET("CLLOMONTH")
MyFeeSet1.Open strsql, config.cnZdx, adOpenStatic, adLockReadOnly
If MyFeeSet1.EOF Then
GoTo e:
End If
DTPicker2.Year = MYSET("clloyear")
DTPicker2.Month = MYSET("cllomonth")
filldate1 MYSET("userid1")
e: MyFeeSet2.Close
If DTPicker2.Year < 2003 Then
GoTo g:
End If
strsql = "select * from datawork where userid1=" & _
MYSET("userid1") & _
" and clloyear=" & _
IIf(DTPicker2.Month = 1, DTPicker2.Year - 1, DTPicker2.Year) & _
" and cllomonth=" & IIf(DTPicker2.Month = 1, 12, DTPicker2.Month - 1)
MyFeeSet2.Open strsql, config.cnZdx, adOpenStatic, adLockReadOnly
If MyFeeSet2.EOF Then
DTPicker2.Year = IIf(DTPicker2.Month = 1, DTPicker2.Year - 1, DTPicker2.Year)
DTPicker2.Month = IIf(DTPicker2.Month = 1, 12, DTPicker2.Month - 1)
GoTo e:
End If
g: .Col = 0
.Text = .row
.Col = 1
.Text = MyFeeset("HUHAO")
.Col = 2
.Text = MyFeeset("NAME")
.Col = 3
.Text = MYSET("CLLODAY")
.Col = 4
.Text = MYSET("FEE")
sTotalFee = sTotalFee + .Text
.Col = 5
.Text = Format((MyFeeSet1("elcmeter") - MyFeeSet2("elcmeter")) * MyFeeset("elcmeterfee"), "0.00")
sTotalFee_D = sTotalFee_D + VAL(.Text)
.Col = 6
.Text = Format((MyFeeSet1("watermeter") + MyFeeSet1("watermeter1") - MyFeeSet2("watermeter") - MyFeeSet2("watermeter1")) * MyFeeset("watermeterfee"), "0.00")
sTotalFee_Water = sTotalFee_Water + VAL(.Text)
MyFeeset.Close
MyFeeSet1.Close
MyFeeSet2.Close
MYSET.MoveNext
Loop
'
MYSET.Close
.Rows = .Rows + 1
.row = .Rows - 1
.Col = 0: .Text = "合計"
.Col = 4: .Text = Format(sTotalFee, , "0.0")
.Col = 5: .Text = sTotalFee_D
.Col = 6: .Text = sTotalFee_Water
Text1.Text = .Rows - 2
Text2.Text = Format(sTotalFee, "0.0")
Text3.Text = sTotalFee_D
Text4.Text = sTotalFee_Water
' .ColWidth(3) = 850
End With
Case 1 '打印
On Error Resume Next
'On Error GoTo ErrHandler
dlgCommonDialog.CancelError = True
dlgCommonDialog.ShowPrinter
If Err.Number = 32755 Then Exit Sub
Printer.ScaleMode = vbMillimeters '設置度量單位為毫米
Printer.ColorMode = vbPRCMColor '設置打印機為單色打印輸出
print_H = Printer.Height / 56.7
print_W = Printer.Width / 56.7
' Printer.Orientation = vbPRORPortrait '設置橫向打印
' Printer.PrintQuality = vbPRPQHigh '設置打印質量為低分辨率
Printer.DrawWidth = 1
dlgCommonDialog.Copies = 1
' dlgCommonDialog.Min = 1
' dlgCommonDialog.Max = 1
' dlgCommonDialog.FromPage = 1
' dlgCommonDialog.ToPage = 1
'CY = 30
With mfgFee
If MsgBox("打印電費收據請按“是”,打印電費明細請按“否”", vbYesNoCancel) = vbYes Then
.row = 0
For u = 1 To .Rows
For I = 0 To 2
CY = I * 90 - 20
Printer.FontSize = 16
Printer.CurrentX = 50
Printer.CurrentY = 25 + CY
' Printer.Print RTU(0).RTUName & "費用結算單"
Printer.Line (23, 48 + CY)-(160, 80 + CY), 0, B
Printer.Line (23, 56 + CY)-(160, 56 + CY), 0, B
Printer.Line (23, 64 + CY)-(160, 64 + CY), 0, B
Printer.Line (23, 72 + CY)-(160, 72 + CY), 0, B
Printer.Line (40, 48 + CY)-(40, 80 + CY), 0, B
Printer.Line (61, 48 + CY)-(61, 80 + CY), 0, B
Printer.Line (82, 48 + CY)-(82, 72 + CY), 0, B
Printer.Line (103, 48 + CY)-(103, 72 + CY), 0, B
Printer.Line (125, 48 + CY)-(125, 72 + CY), 0, B
Printer.Line (139, 48 + CY)-(139, 72 + CY), 0, B
Printer.FontSize = 12
Printer.CurrentX = 43
Printer.CurrentY = 50 + CY
Printer.Print "上月表底"
Printer.CurrentX = 64
Printer.CurrentY = 50 + CY
Printer.Print "本月表底"
Printer.CurrentX = 85
Printer.CurrentY = 50 + CY
' Printer.Print "倍率"
Printer.Print "換表度差"
Printer.CurrentX = 106
Printer.CurrentY = 50 + CY
Printer.Print "使用量"
Printer.CurrentX = 127
Printer.CurrentY = 50 + CY
Printer.Print "單 價"
Printer.CurrentX = 143
Printer.CurrentY = 50 + CY
Printer.Print "金 額"
.row = .row + 1
.Col = 0
Printer.CurrentX = 28
Printer.CurrentY = 38 + CY
' Printer.Print "戶號: " & cboPrecinct.Text & .Text
.Col = 1
Printer.CurrentX = 70
Printer.CurrentY = 38 + CY
Printer.Print "戶名: "; .Text
Printer.CurrentX = 125
Printer.CurrentY = 38 + CY
Printer.Print Year(Now) & " 年 " & Month(Now) & " 月"
Printer.CurrentX = 25
Printer.CurrentY = 59 + CY
Printer.Print "電表"
'上月表底
.Col = 4
Printer.CurrentX = 43
Printer.CurrentY = 59 + CY
Printer.Print .Text
'本月表底
.Col = 5
Printer.CurrentX = 63
Printer.CurrentY = 59 + CY
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -