📄
字号:
VERSION 5.00
Begin VB.Form YM_FrmYmfjz
BorderStyle = 3 'Fixed Dialog
Caption = "月末反结帐"
ClientHeight = 2325
ClientLeft = 2760
ClientTop = 3750
ClientWidth = 4320
Icon = "月末结帐_月末反结帐.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2325
ScaleWidth = 4320
ShowInTaskbar = 0 'False
StartUpPosition = 1 '所有者中心
Begin VB.CommandButton cmdExecute
Caption = "反结帐(&E)"
Height = 300
Left = 1710
TabIndex = 1
Top = 1740
Width = 1120
End
Begin VB.CommandButton cmdCancel
Caption = "关闭(&C)"
Height = 300
Left = 2910
TabIndex = 0
Top = 1740
Width = 1120
End
Begin VB.Line Line1
Index = 2
X1 = 150
X2 = 4020
Y1 = 1290
Y2 = 1290
End
Begin VB.Line Line2
BorderColor = &H00FFFFFF&
Index = 2
X1 = 150
X2 = 4080
Y1 = 1320
Y2 = 1320
End
Begin VB.Label Lab_jzyf
Caption = "2003年01月月末反结帐"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 315
Left = 870
TabIndex = 2
Top = 450
Width = 2625
End
End
Attribute VB_Name = "YM_FrmYmfjz"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'********************************************************************
'* 模 块 名 称 :月末反结帐
'* 功 能 描 述 :
'* 程序员姓名 :奚俊峰
'* 最后修改人 :奚俊峰
'* 最后修改时间:2001-12-10
'* 备 注:
'********************************************************************
Dim Int_Year As Integer '当前会计年度
Dim Int_Period As Integer '当前会计期间
Dim Ztxxrec As Recordset '记录集
Const str_Info = "百利/ERP5.0-财务总帐"
Private Sub cmdCancel_Click()
Unload Me
End Sub
Private Sub cmdExecute_Click()
Dim str_Sql As String
Dim rs As Recordset
'大于当前期间的凭证主表中存在记帐凭证,不能反结帐
str_Sql = "select 1 from cwzz_accvouchmain where year=" & Int_Year & " and period>" & Int_Period & " and bookflag=1"
Set rs = Cw_DataEnvi.DataConnect.Execute(str_Sql)
If Not rs.EOF Then
MsgBox "大于" & Int_Period & "的会计期间内存在已记帐凭证," & vbCrLf & "不能继续月末反结帐!", vbCritical, str_Info
Exit Sub
End If
'年末结帐后,不能月末反结帐
If Int_Period = 12 Then
str_Sql = "select * from cwzz_accsum where year=" & (Int_Year + 1)
Set rs = Cw_DataEnvi.DataConnect.Execute(str_Sql)
If Not rs.EOF Then
MsgBox "已经年末结帐,不能月末反结帐!", vbInformation, str_Info
Exit Sub
End If
End If
If Fun_JzCheck = True Then Unload Me
End Sub
Private Sub Form_Activate()
'取出当前的会计期间
Set Ztxxrec = Cw_DataEnvi.DataConnect.Execute("Select isnull(max(kjyear),0),isnull(max(period),0) From Gy_kjrlb Where Cwzzjzbz=1 and kjyear=(select max(kjyear) from Gy_kjrlb where cwzzjzbz=1)")
Int_Year = Ztxxrec(0)
Int_Period = Ztxxrec(1)
If Int_Year = 0 Then
MsgBox "此时不能月末反结帐!", vbInformation, str_Info
Unload Me
Exit Sub
Else
Lab_jzyf.Caption = Int_Year & "年" & Int_Period & "月月末反结帐"
End If
End Sub
'月末反结帐过程处理
Private Function Fun_JzCheck() As Boolean
On Error GoTo ErrHandle
Cw_DataEnvi.DataConnect.BeginTrans
'置本会计期间结帐标识为 0
Cw_DataEnvi.DataConnect.Execute ("update gy_kjrlb set Cwzzjzbz=0 where kjYear=" & Int_Year & "and period=" & Int_Period)
Cw_DataEnvi.DataConnect.CommitTrans
MsgBox "月末反结帐完毕!", vbInformation, str_Info
Fun_JzCheck = True
Exit Function
ErrHandle:
Fun_JzCheck = False
Cw_DataEnvi.DataConnect.RollbackTrans
End Function
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -