📄 n_sycx.frm
字号:
VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Object = "{7FA02506-686A-11D3-889C-0020AF388BC7}#1.0#0"; "Vbnpr32d.ocx"
Object = "{74848F95-A02A-4286-AF0C-A3C755E4A5B3}#1.0#0"; "actskn43.ocx"
Begin VB.Form N_SYCX
Caption = "消费统计"
ClientHeight = 7380
ClientLeft = 60
ClientTop = 450
ClientWidth = 7875
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 7380
ScaleWidth = 7875
StartUpPosition = 3 '窗口缺省
Begin ACTIVESKINLibCtl.SkinLabel SkinLabel1
Height = 2775
Left = 6000
OleObjectBlob = "N_SYCX.frx":0000
TabIndex = 7
Top = 3480
Width = 1575
End
Begin ACTIVESKINLibCtl.Skin Skin1
Left = 6360
OleObjectBlob = "N_SYCX.frx":0112
Top = 5880
End
Begin VB.CommandButton Command1
Caption = "<收银统计"
Height = 615
Left = 6240
TabIndex = 6
Top = 1080
Width = 1215
End
Begin VB.CommandButton Command4
Caption = "退出"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 6960
TabIndex = 4
Top = 6600
Width = 735
End
Begin VB.CommandButton Command2
Caption = "查询"
Height = 375
Left = 6840
TabIndex = 3
Top = 2880
Width = 735
End
Begin VB.TextBox Text1
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 6240
TabIndex = 2
Top = 2160
Width = 1335
End
Begin VB.CommandButton Command10
Caption = "<消 费 表"
Height = 615
Left = 6240
TabIndex = 1
Top = 240
Width = 1215
End
Begin VB.CommandButton Command11
Caption = "打印"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 6000
TabIndex = 0
Top = 6600
Width = 735
End
Begin vbNpr32D.vbnprn vbnprn1
Left = 5160
Top = 6720
_ExtentX = 1032
_ExtentY = 979
prnOrientation = -1 'True
AppMode = -1 'True
End
Begin MSFlexGridLib.MSFlexGrid gd1
Height = 7380
Left = 0
TabIndex = 5
Top = 0
Width = 5820
_ExtentX = 10266
_ExtentY = 13018
_Version = 393216
Rows = 10
Cols = 4
FixedCols = 0
BackColor = 12648447
FocusRect = 0
SelectionMode = 1
End
End
Attribute VB_Name = "N_SYCX"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim sqlstr As String '分项目记录语句
Dim sqlstr1 As String '记录语句
Dim t_bt1 As String '存储列表显示的表头
Dim t_fields1 As Variant '存储列表显示的字段名
Dim t_fdxs1 As Variant '表示显示列是否由代码转换成文字
Dim t_fdcounts1 As Integer '表示列表所显示的字段的个数
Dim t_pri1 As Variant
Dim GDTEMP As MSFlexGrid
Private Sub Command1_Click()
Dim xfjl_rec As ADODB.Recordset
Dim xfbt_rec As ADODB.Recordset
Dim xfzk_rec As ADODB.Recordset
Set xfjl_rec = New ADODB.Recordset
xfjl_rec.Source = "select sum(xfje*zkl/100) as num from N_XFJL " + sqlstr1 + "and jssj<>''"
Set xfjl_rec.ActiveConnection = objConn
xfjl_rec.CursorType = adOpenDynamic
xfjl_rec.LockType = adLockOptimistic
xfjl_rec.Open
Set xfbt_rec = New ADODB.Recordset
xfbt_rec.Source = "select sum(BTJE) as num from n_jebt " + sqlstr1 + ""
Set xfbt_rec.ActiveConnection = objConn
xfbt_rec.CursorType = adOpenDynamic
xfbt_rec.LockType = adLockOptimistic
xfbt_rec.Open
Set xfzk_rec = New ADODB.Recordset
xfzk_rec.Source = "select sum(xfje) as num from N_XFJL " + sqlstr1 + ""
Set xfzk_rec.ActiveConnection = objConn
xfzk_rec.CursorType = adOpenDynamic
xfzk_rec.LockType = adLockOptimistic
xfzk_rec.Open
If IsNull(xfjl_rec.Fields("num")) = False Then
gd1.Rows = 5
gd1.Cols = 2
gd1.TextMatrix(0, 0) = ""
gd1.TextMatrix(0, 1) = ""
gd1.TextMatrix(1, 0) = "消费总计"
gd1.TextMatrix(1, 1) = xfzk_rec.Fields("num")
gd1.TextMatrix(2, 0) = "抵退总计"
If IsNull(xfbt_rec.Fields("num")) = False Then
gd1.TextMatrix(2, 1) = xfbt_rec.Fields("num")
Else
gd1.TextMatrix(2, 1) = ""
End If
gd1.TextMatrix(3, 0) = "折扣统计"
gd1.TextMatrix(3, 1) = Val(xfzk_rec.Fields("num")) - Val(xfjl_rec.Fields("num"))
gd1.TextMatrix(4, 0) = "合计"
If IsNull(xfbt_rec.Fields("num")) = False Then
gd1.TextMatrix(4, 1) = Val(xfjl_rec.Fields("num")) - Val(xfbt_rec.Fields("num"))
Else
gd1.TextMatrix(4, 1) = Val(xfjl_rec.Fields("num"))
End If
End If
End Sub
Private Sub Command10_Click()
Call flex1_refresh("select * from N_XFJL " + sqlstr1 + " ORDER BY CZH")
End Sub
Private Sub Command11_Click()
Dim intrtn As Integer
intrtn = MsgBox("打印信息吗?", vbOKCancel, "打印信息")
If intrtn = vbCancel Then
Exit Sub
End If
If gd1.Visible Then
Set GDTEMP = gd1
Else
Set GDTEMP = gd2
End If
vbnprn1.Show
End Sub
Private Sub Command4_Click()
Unload Me
End Sub
Private Sub Command2_Click()
Dim i As Integer
i = Len(Trim(Text1.Text))
If i = 0 Then
sqlstr = "" '分项目记录语句
sqlstr1 = "" '记录语句
' Call Command5_Click
Exit Sub
End If
If i = 4 Then
sqlstr = "AND RQ like '" + Trim(Text1.Text) + "%%%%'" '分项目记录语句
sqlstr1 = "WHERE RQ like '" + Trim(Text1.Text) + "%%%%'" '记录语句
' Call Command5_Click
Exit Sub
End If
If i = 6 Then
sqlstr = "AND RQ like '" + Trim(Text1.Text) + "%%'" '分项目记录语句
sqlstr1 = "WHERE RQ like '" + Trim(Text1.Text) + "%%'" '记录语句
'Call Command5_Click
Exit Sub
End If
If i = 8 Then
sqlstr = "AND RQ = '" + Trim(Text1.Text) + "'" '分项目记录语句
sqlstr1 = "WHERE RQ = '" + Trim(Text1.Text) + "'" '记录语句
'Call Command5_Click
Exit Sub
End If
MsgBox "输入查询信息有错误!"
End Sub
Private Sub Form_Load()
Skin1.LoadSkin App.Path + "\棋牌界面"
Skin1.ApplySkin hWnd
t_fields1 = Array("CZH", "ZH", "XFLB", "XFWP", "ZKL", "RQ", "XFSJ", "XFJE", "JSSJ") '设置显示字段
t_fdxs1 = Array(0, 0, 0, 0, 0, 0, 0, 0) '设置显示字段
t_bt1 = "< 棋 牌 桌 号 |< 帐 号 |< 消费类别 |<消费物品 |<折扣率 |<消费日期 |<消费时间 |<消费金额 |<结帐日期 " '设置显示表头格式
t_fdcounts1 = 9
t_pri1 = Array("支出项", "款项名", "消费数", "消费金额", "消费日期")
t_fields2 = Array("Kx", "JE", "RQ", "SJ", "JD", "MS") '设置显示字段
t_fdxs2 = Array(0, 0, 0, 0, 0, 0) '设置显示字段
t_bt2 = "< 款项名 |<金额 |<发生日期 |<发生时间 |<操作员 |<发生描述 " '设置显示表头格式
t_fdcounts2 = 6
t_pri2 = Array("款项名", "金额", "发生日期", "发生描述")
Text1.Text = Trim(CStr(Val(Format(Date$, "yyyymmdd"))))
Call Command2_Click
End Sub
Private Sub flex1_refresh(sqlstr As String)
On Error Resume Next
Dim xf_Rec As ADODB.Recordset
Set xf_Rec = New ADODB.Recordset
xf_Rec.Source = sqlstr
Set xf_Rec.ActiveConnection = objConn
xf_Rec.CursorType = adOpenDynamic
xf_Rec.LockType = adLockOptimistic
xf_Rec.Open
Call Flex_full(gd1, t_bt1, xf_Rec, t_fields1, t_fdcounts1 - 1, t_fdxs1)
lb_jls.Caption = gd1.Rows - 1
gd1.Refresh
xf_Rec.Close
Set xf_Rec = Nothing
Error_Handler:
End Sub
Private Sub vbnprn1_PrCreareData(PrDemo As Integer)
Dim i As Integer
Dim j As Integer
Dim h As Integer
Dim bth, btw, wzh, wzw As Integer
h = 1
i = 0
j = 0
bth = CInt(Trim(Get_ProfileInfo("jdgl.ini", "[printDJ]", "bth")))
btw = CInt(Trim(Get_ProfileInfo("jdgl.ini", "[printDJ]", "btw")))
wzh = CInt(Trim(Get_ProfileInfo("jdgl.ini", "[printDJ]", "wzh")))
wzw = CInt(Trim(Get_ProfileInfo("jdgl.ini", "[printDJ]", "wzw")))
vbnprn1.PrnsaSet Val(Trim(Get_ProfileInfo("jdgl.ini", "[printDJ]", "size"))), 1, 25, 25, 25, 25, 0, 10
'Fwait.Show
vbnprn1.PrBasic
vbnprn1.PrPageNew
' Fwait.Label3.Caption = Str(vbnprn1.PageNumber) & "/9"
' Fwait.Refresh
vbnprn1.PrOutText CInt(btw), CInt(bth), " ", 18, 0, 1, 0, 0, 1, CStr(Trim(Get_ProfileInfo("jdgl.ini", "[printDJ]", "name"))) + Text1.Text + "报表"
'MsgBox CStr(Len("1111")) + " B" + CStr(LenB("1111")) + " " + CStr(Len("帐号")) + " B" + CStr(LenB("帐号"))
For i = 0 To GDTEMP.Rows - 1
Dim temp As Integer
Dim str As String
str = ""
For j = 0 To GDTEMP.Cols - 1
If j = 0 Or i = 0 Then
temp = 12 - 2 * Len(Trim(GDTEMP.TextArray(i * GDTEMP.Cols + j)))
Else
temp = 12 - Len(Trim(GDTEMP.TextArray(i * GDTEMP.Cols + j)))
End If
If temp < 0 Then
temp = 0
End If
str = str + IIf(Trim(GDTEMP.TextArray(i * GDTEMP.Cols + j)) = "", "*", Trim(GDTEMP.TextArray(i * GDTEMP.Cols + j))) + Space(temp)
Next
'MsgBox CStr((i + 1) Mod CInt(Trim(Get_ProfileInfo("jdgl.ini", "[printDJ]", "line"))))
If ((i + 1) * Val(Trim(Get_ProfileInfo("jdgl.ini", "[printDJ]", "linesize")))) \ 15000 >= h Then
vbnprn1.PrPageNew
h = h + 1
End If
'MsgBox str
vbnprn1.PrOutText CInt(wzw), wzh + ((i + 1) * Val(Trim(Get_ProfileInfo("jdgl.ini", "[printDJ]", "linesize")))) Mod 15000, " ", CInt(Trim(Get_ProfileInfo("jdgl.ini", "[printDJ]", "size1"))), 0, 1, 0, 0, 0, str
Next
Me.Refresh
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -