📄 dt_tsfcx.frm
字号:
'* 功 能 : 明细列表的显示
'* 作 者 : 梁卫
'* 作成日期 : 1999.03.18
'* 修改日期 : 1999.03.18
'**************************************************************************************************
Private Sub tPxs_ZKCX()
Dim temp_tsf As Recordset
Dim temp_rq_s As Date
Dim temp_rq_e As Date
Dim temp_day As Integer
Dim temp_sql As String
If Trim(m_month.Text) = "" Then
temp_rq_s = Format(DateSerial(CInt(m_year.Text), 1, 1), "yyyy-mm-dd")
temp_rq_e = Format(DateSerial(CInt(m_year.Text), 12, 31), "yyyy-mm-dd")
Else
temp_rq_s = Format(DateSerial(CInt(m_year.Text), CInt(m_month.Text), 1), "yyyy-mm-dd")
temp_day = DateSerial(CInt(m_year.Text), CInt(m_month.Text) + 1, 1) - DateSerial(CInt(m_year.Text), CInt(m_month.Text), 1)
temp_rq_e = Format(DateSerial(CInt(m_year.Text), CInt(m_month.Text), temp_day), "yyyy-mm-dd")
End If
lb_name.Caption = Trim(m_year.Text) & "年" & IIf(Trim(m_month.Text) = "", "", Trim(m_month.Text) & "月") & "特殊房一览表 (折扣率:" & Str(m_zkl.Text) & "%)"
temp_sql = "SELECT ZH,KR_X,KR_M,YW_X,YW_M,BDJDDW_MC,GJMC,KF_FZ,RZRQ,LDRQ,ZK_SQR,ZK_SPR,KF_ZKL,ZKLX_MC,JD_BZ1 FROM DT_KRQD WHERE CHAR(RZRQ)<='" & temp_rq_e & "' AND LENGTH(RTRIM(ZH))=4 AND (KF_ZKL*100)<=" & CInt(m_zkl.Text) & " AND ZKLX=" & LoadResString(SYS_SKLX)
temp_sql = temp_sql & " UNION "
temp_sql = temp_sql & "SELECT ZH,KR_X,KR_M,YW_X,YW_M,BDJDDW_MC,GJMC,KF_FZ,RZRQ,LDRQ,ZK_SQR,ZK_SPR,KF_ZKL,ZKLX_MC,JD_BZ1 FROM KR" & year(temp_rq_e) & " WHERE (CHAR(LDRQ) BETWEEN '" & temp_rq_s & "' AND '" & temp_rq_e & "') AND LD_FT='1' AND LENGTH(RTRIM(ZH))=4 AND (KF_ZKL*100)<=" & CInt(m_zkl.Text) & " AND ZKLX=" & LoadResString(SYS_SKLX)
'????
Set temp_tsf = PUB_data.OpenRecordset(temp_sql, 4, 64)
If Not temp_tsf.BOF Then
temp_tsf.MoveLast
End If
Call flex_refresh(gd1, t_bt, temp_tsf, t_fields, t_fdcounts, t_fdxs)
lb_jls.Caption = gd1.Rows - 1
temp_tsf.Close
End Sub
'**************************************************************************************************
'* 功 能 :
'* 作 者 : 梁卫
'* 作成日期 : 1999.03.18
'* 修改日期 : 1999.03.18
'**************************************************************************************************
Private Sub flex_refresh(temp_gd As MSFlexGrid, temp_bt As String, temp_rec As Recordset, temp_fields As Variant, temp_fdcounts As Integer, temp_fdxs As Variant)
Call Flex_full(temp_gd, temp_bt, temp_rec, temp_fields, temp_fdcounts - 1, temp_fdxs)
temp_gd.Refresh
End Sub
'**************************************************************************************************
'* 功 能 :
'* 作 者 : 梁卫
'* 作成日期 : 1999.03.18
'* 修改日期 : 1999.03.18
'**************************************************************************************************
Private Sub CMD_EXIT_Click()
Unload Me
End Sub
Private Sub Form_Activate()
m_year.SetFocus
End Sub
'**************************************************************************************************
'* 功 能 :
'* 作 者 : 梁卫
'* 作成日期 : 1999.03.18
'* 修改日期 : 1999.03.18
'**************************************************************************************************
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
frm_msg.Caption = ""
frm_msg.Visible = False
If KeyCode = vbKeyEscape Then
Call CMD_EXIT_Click
End If
End Sub
'**************************************************************************************************
'* 功 能 :
'* 作 者 : 梁卫
'* 作成日期 : 1999.03.18
'* 修改日期 : 1999.03.18
'**************************************************************************************************
Private Sub Form_Load()
dt_tsfcx.KeyPreview = True
frm_msg.Visible = True
frm_msg.Caption = ""
m_year.Text = year(Date)
m_month.Text = month(Date)
m_zkl.Text = 60
'明细显示字段设置
t_fields = Array("ZH", "KR_X", "KR_M", "YW_X", "YW_M", "GJMC", "KF_FZ", "RZRQ", "LDRQ", "ZK_SQR", "ZK_SPR", "BDJDDW_MC") '设置显示字段
t_fdxs = Array(0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0) '设置显示字段
t_bt = "<帐号 |<客人姓 |<客人名 |<外文姓 |<外文名 |<国籍 |>房租 |^入住日期 |^离店日期|^申请人 |^审批人 |<接待单位 " '设置显示表头格式
t_fdcounts = 12
Call tPxs_ZKCX
End Sub
Private Sub gd1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then
CMD_print.SetFocus
End If
End Sub
'**************************************************************************************************
'* 功 能 :
'* 作 者 : 梁卫
'* 作成日期 : 1999.03.18
'* 修改日期 : 1999.03.18
'**************************************************************************************************
Private Sub m_year_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then
m_month.SetFocus
End If
End Sub
'**************************************************************************************************
'* 功 能 :
'* 作 者 : 梁卫
'* 作成日期 : 1999.03.18
'* 修改日期 : 1999.03.18
'**************************************************************************************************
Private Sub m_year_LostFocus()
Dim temp_ft As Boolean
frm_msg.Visible = False
frm_msg.Caption = ""
temp_ft = PUB_SZJY(m_year, frm_msg)
If temp_ft Then
If CInt(m_year.Text) >= year(LoadResString(SYS_START)) And CInt(m_year.Text) <= year(Date) Then
Else
frm_msg.Visible = True
frm_msg.Caption = "年份范围应在 " & year(LoadResString(SYS_START)) & " 至 " & year(Date) & " 之间"
m_year.Text = year(Date)
End If
End If
Call tPxs_ZKCX
End Sub
'**************************************************************************************************
'* 功 能 :
'* 作 者 : 梁卫
'* 作成日期 : 1999.03.18
'* 修改日期 : 1999.03.18
'**************************************************************************************************
Private Sub m_month_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then
m_zkl.SetFocus
End If
End Sub
'**************************************************************************************************
'* 功 能 :
'* 作 者 : 梁卫
'* 作成日期 : 1999.03.18
'* 修改日期 : 1999.03.18
'**************************************************************************************************
Private Sub m_month_LostFocus()
Dim temp_ft As Boolean
frm_msg.Visible = False
frm_msg.Caption = ""
If Trim(m_month.Text) = "" Then
Else
temp_ft = PUB_SZJY(m_month, frm_msg)
If temp_ft Then
If m_year.Text <> year(Date) Then
If CInt(m_month.Text) >= 1 And CInt(m_month.Text) <= 12 Then
Else
frm_msg.Visible = True
frm_msg.Caption = "月份范围应在 1 至 12 之间"
m_month.Text = month(Date)
End If
Else
If CInt(m_month.Text) >= 1 And CInt(m_month.Text) <= month(Date) Then
Else
frm_msg.Visible = True
frm_msg.Caption = "月份范围应在 1 至 " & month(Date) & " 之间"
m_month.Text = month(Date)
End If
End If
End If
End If
Call tPxs_ZKCX
End Sub
Private Sub m_zkl_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then
gd1.SetFocus
End If
End Sub
Private Sub m_zkl_LostFocus()
If PUB_SZJY(m_zkl, frm_msg) Then
m_zkl.Text = CInt(m_zkl.Text)
If Not (CInt(m_zkl.Text) >= 0 And CInt(m_zkl.Text) <= 100) Then
frm_msg.Visible = True
frm_msg.Caption = "折扣率应在 0 至 100 之间"
Else
Call tPxs_ZKCX
End If
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -