ʰ
资源名称:ERPSYS.zip [点击查看]
上传用户:zhpu1995
上传日期:2013-09-06
资源大小:61151k
文件大小:15k
源码类别:
企业管理
开发平台:
Visual Basic
- VERSION 5.00
- Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
- Begin VB.Form YH_FrmHx
- BorderStyle = 3 'Fixed Dialog
- Caption = "核销银行帐"
- ClientHeight = 1785
- ClientLeft = 45
- ClientTop = 330
- ClientWidth = 5205
- HelpContextID = 5106
- Icon = "银行_核对银行帐.frx":0000
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 1785
- ScaleWidth = 5205
- ShowInTaskbar = 0 'False
- StartUpPosition = 2 '屏幕中心
- Begin VB.Frame Frame1
- Height = 1785
- Left = 30
- TabIndex = 0
- Top = -60
- Width = 5175
- Begin VB.Frame Frame2
- Caption = "注意"
- ForeColor = &H00FF0000&
- Height = 855
- Left = 60
- TabIndex = 5
- Top = 870
- Width = 3555
- Begin VB.Label Label2
- Caption = "为了防止核销后出现错误无法恢复数据,核销已两清的单位日记帐和银行对帐单之前请做好数据备份工作。"
- ForeColor = &H00FF0000&
- Height = 585
- Left = 120
- TabIndex = 6
- Top = 180
- Width = 3255
- End
- End
- Begin VB.CommandButton Command2
- Caption = "取消(&C)"
- Height = 300
- Left = 3930
- TabIndex = 4
- Top = 1410
- Width = 1120
- End
- Begin VB.CommandButton Command1
- Caption = "确定(&O)"
- Height = 300
- Left = 3930
- TabIndex = 3
- Top = 990
- Width = 1120
- End
- Begin VB.ComboBox Combo1
- Height = 300
- Left = 990
- TabIndex = 1
- Top = 420
- Width = 4095
- End
- Begin VB.Label Label1
- Caption = "银行科目:"
- Height = 255
- Left = 150
- TabIndex = 2
- Top = 450
- Width = 1125
- End
- End
- Begin MSComctlLib.ImageList ImageList1
- Left = 8940
- Top = 570
- _ExtentX = 1005
- _ExtentY = 1005
- BackColor = -2147483643
- ImageWidth = 16
- ImageHeight = 16
- MaskColor = 12632256
- _Version = 393216
- BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
- NumListImages = 16
- BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "银行_核对银行帐.frx":1042
- Key = "ymsz"
- EndProperty
- BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "银行_核对银行帐.frx":10A0
- Key = "dy"
- EndProperty
- BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "银行_核对银行帐.frx":10FE
- Key = "yl"
- EndProperty
- BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "银行_核对银行帐.frx":115C
- Key = "fh"
- EndProperty
- BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "银行_核对银行帐.frx":11BA
- Key = "zh"
- EndProperty
- BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "银行_核对银行帐.frx":1218
- Key = "fq"
- EndProperty
- BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "银行_核对银行帐.frx":1276
- Key = "xg"
- EndProperty
- BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "银行_核对银行帐.frx":12D4
- Key = "cx"
- EndProperty
- BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "银行_核对银行帐.frx":1332
- Key = "bc"
- EndProperty
- BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "银行_核对银行帐.frx":1390
- Key = "sc"
- EndProperty
- BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "银行_核对银行帐.frx":13EE
- Key = "sx"
- EndProperty
- BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "银行_核对银行帐.frx":144C
- Key = "bz"
- EndProperty
- BeginProperty ListImage13 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "银行_核对银行帐.frx":14AA
- Key = "kp"
- EndProperty
- BeginProperty ListImage14 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "银行_核对银行帐.frx":1508
- Key = "xsxm"
- EndProperty
- BeginProperty ListImage15 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "银行_核对银行帐.frx":1566
- Key = "dw"
- EndProperty
- BeginProperty ListImage16 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "银行_核对银行帐.frx":15C4
- Key = "txfx"
- EndProperty
- EndProperty
- End
- End
- Attribute VB_Name = "YH_FrmHx"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- '*************************************************************
- '* 模 块 名 称 :核销银行对帐
- '* 功 能 描 述 :核销已勾对的银行帐
- '* 程序员姓名 : xjl
- '* 最后修改人 : xjl
- '* 最后修改时间:2000/11/07
- '* 备 注:
- '*************************************************************
- Dim Tsxx As String
- '核销银行已达帐
- Private Sub Command1_Click()
- Dim Msg As String
- Dim DWYE, YHYE, DWJF, DWDF, YHJF, YHDF As Currency
- Dim RecTemp As New ADODB.Recordset
- If Combo1.ListCount <= 0 Then
- Tsxx = "科目编码不存在!"
- Call Xtxxts(Tsxx, 0, 1)
- Exit Sub
- End If
- '是否是银行帐户
- SQL_Str = "Select * From CWZZ_ACCCODE Where Cproperty='银行' And EndFlag=1 and Ccode='" & Val(Combo1.Text) & "'"
- Set RecTemp = Cw_DataEnvi.DataConnect.Execute(SQL_Str)
- If RecTemp.EOF Then
- MsgBox "科目编码输入有误!", vbOKOnly + 16, "百利/ERP5.0-财务总帐"
- Combo1.SetFocus
- Exit Sub
- End If
- '此帐户的余额是否平衡
- DWYE = 0
- YHYE = 0
- '单位帐面余额
- SQL_Str = "SELECT SUM(JFJE)-SUM(DFJE) From Cwzz_RjzNotCheck Where RecType=0 And Ccode='" & Val(Combo1.Text) & "'"
- Set RecTemp = Cw_DataEnvi.DataConnect.Execute(SQL_Str)
- If Not IsNull(RecTemp(0)) Then
- DWYE = RecTemp(0)
- End If
- SQL_Str = "Select SUM(JFJE)-SUM(DFJE) From Cwzz_V_AccVouch where Ccode='" & Val(Combo1.Text) & "' " _
- & "And Convert(Char(8),Ddate,112)>=(Select Convert(Char(8),Ddate,112) From " _
- & "Cwzz_RjzNotCheck Where RecType=0 And Ccode='" & Val(Combo1.Text) & "') " _
- & "And Convert(Char(6),Ddate,112)<=(select Convert(Char(6),max(qsrq),112) from GY_kjrlb where cwzzjzbz='1')"
- Set RecTemp = Cw_DataEnvi.DataConnect.Execute(SQL_Str)
- If Not IsNull(RecTemp(0)) Then
- DWYE = DWYE + RecTemp(0)
- End If
- ' '银行帐面余额
- SQL_Str = "SELECT SUM(DFJE)-SUM(JFJE) From Cwzz_BankBill Where (RecType=0) And Ccode='" & Val(Combo1.Text) & "'"
- Set RecTemp = Cw_DataEnvi.DataConnect.Execute(SQL_Str)
- If Not IsNull(RecTemp(0)) Then
- YHYE = RecTemp(0)
- End If
- SQL_Str = "SELECT SUM(DFJE)-SUM(JFJE) From Cwzz_BankBill Where (RecType=2) And Ccode='" & Val(Combo1.Text) & "'"
- Set RecTemp = Cw_DataEnvi.DataConnect.Execute(SQL_Str)
- If Not IsNull(RecTemp(0)) Then
- YHYE = YHYE + RecTemp(0)
- End If
- '银行调整后余额=银行帐面余额+(企业己收银行未收-企业己付银行未付)
- SQL_Str = "SELECT SUM(JFJE)-SUM(DFJE) From Cwzz_RjzNotCheck Where RecType=1 And BDelete=0 And Ccode='" & Val(Combo1.Text) & "'"
- Set RecTemp = Cw_DataEnvi.DataConnect.Execute(SQL_Str)
- If Not IsNull(RecTemp(0)) Then
- YHYE = YHYE + RecTemp(0)
- End If
- SQL_Str = "Select SUM(JFJE)-SUM(DFJE) From Cwzz_V_AccVouch where Ccode='" & Val(Combo1.Text) & "' " _
- & "And Convert(Char(8),Ddate,112)>=(Select Convert(Char(8),Ddate,112) From " _
- & "Cwzz_RjzNotCheck Where RecType=0 And Ccode='" & Val(Combo1.Text) & "') And BDelete=0 " _
- & "And Convert(Char(6),Ddate,112)<=(select Convert(Char(6),max(qsrq),112) from Gy_kjrlb where cwzzjzbz='1')"
- Set RecTemp = Cw_DataEnvi.DataConnect.Execute(SQL_Str)
- If Not IsNull(RecTemp(0)) Then
- YHYE = YHYE + RecTemp(0)
- End If
- '单位调整后余额=银行帐面余额+(银行己收企业未收-银行己付企业未付)
- SQL_Str = "SELECT SUM(JFJE)-SUM(DFJE) From Cwzz_BankBill Where RecType=1 And BDelete=0 And Ccode='" & Val(Combo1.Text) & "'"
- Set RecTemp = Cw_DataEnvi.DataConnect.Execute(SQL_Str)
- If Not IsNull(RecTemp(0)) Then
- DWYE = DWYE + RecTemp(0)
- End If
- SQL_Str = "SELECT SUM(DFJE)-SUM(JFJE) From Cwzz_BankBill Where RecType=2 And BDelete=0 And Ccode='" & Val(Combo1.Text) & "'"
- Set RecTemp = Cw_DataEnvi.DataConnect.Execute(SQL_Str)
- If Not IsNull(RecTemp(0)) Then
- DWYE = DWYE + RecTemp(0)
- End If
- If DWYE <> YHYE Then
- MsgBox "《" + Combo1.Text + "》帐户调整余额不平,不能进行核销", 16, "百利/ERP5.0-财务总帐"
- Exit Sub
- End If
- '判断己勾对的帐是否平衡
- DWJF = 0
- DWDF = 0
- YHJF = 0
- YHDF = 0
- '银行对帐单
- SQL_Str = " Select sum(jfje),sum(dfje) From Cwzz_BankBill Where bcheckflag=1 And BDelete='0' And RecType='1' "
- Set RecTemp = Cw_DataEnvi.DataConnect.Execute(SQL_Str)
- If Not IsNull(RecTemp(0)) Then
- YHDF = RecTemp(0)
- End If
- If Not IsNull(RecTemp(1)) Then
- YHJF = RecTemp(1)
- End If
- SQL_Str = " Select sum(jfje),sum(dfje) From Cwzz_BankBill Where bcheckflag=1 And BDelete='0' And RecType='2'"
- Set RecTemp = Cw_DataEnvi.DataConnect.Execute(SQL_Str)
- If Not IsNull(RecTemp(0)) Then
- YHJF = YHJF + RecTemp(0)
- End If
- If Not IsNull(RecTemp(1)) Then
- YHDF = YHDF + RecTemp(1)
- End If
- '单位日记帐
- SQL_Str = " Select sum(jfje),sum(dfje) From cwzz_accvouchSub Where bcheckflag=1 And BDelete='0'"
- Set RecTemp = Cw_DataEnvi.DataConnect.Execute(SQL_Str)
- If Not IsNull(RecTemp(0)) Then
- DWJF = RecTemp(0)
- End If
- If Not IsNull(RecTemp(1)) Then
- DWDF = RecTemp(1)
- End If
- SQL_Str = " Select sum(jfje),sum(dfje) From Cwzz_RjzNotCheck Where bcheckflag=1 And BDelete='0'"
- Set RecTemp = Cw_DataEnvi.DataConnect.Execute(SQL_Str)
- If Not IsNull(RecTemp(0)) Then
- DWJF = DWJF + RecTemp(0)
- End If
- If Not IsNull(RecTemp(1)) Then
- DWDF = DWDF + RecTemp(1)
- End If
- If DWJF = YHDF And DWDF = YHJF Then
- Else
- If DWDF = DWJF Then
- Else
- MsgBox "银行自动对帐数据不平衡,不能进行核销。", 16, "百利/ERP5.0-财务总帐"
- Exit Sub
- End If
- End If
- '判断是否有可核销的数据
- Sqlstr = "Select Count(*) From Cwzz_BankBill Where BCheckFlag='1' And BDelete='0'"
- Set RecTemp = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
- If RecTemp.Fields(0) <= 0 Then
- MsgBox "没有可核销的数据!", vbOKOnly + 64, "百利/ERP5.0-财务总帐"
- Exit Sub
- End If
- On Error GoTo Err:
- Cw_DataEnvi.DataConnect.BeginTrans
- Msg = MsgBox("你要核销银行已经对帐的数据吗?", vbYesNo + 32, "百利/ERP5.0-财务总帐")
- If Msg = vbYes Then
- '核销银行帐
- If RecTemp.State = 1 Then RecTemp.Close
- RecTemp.Open "select * from cwzz_bankbill where bcheckflag=1", Cw_DataEnvi.DataConnect, adOpenDynamic, adLockOptimistic
- Do While Not RecTemp.EOF()
- RecTemp.Fields("bdelete") = 1
- RecTemp.Update
- RecTemp.MoveNext
- Loop
- '核销日记帐
- If RecTemp.State = 1 Then RecTemp.Close
- RecTemp.Open "select * from cwzz_accvouchSub where bcheckflag=1", Cw_DataEnvi.DataConnect, adOpenDynamic, adLockOptimistic
- Do While Not RecTemp.EOF()
- RecTemp.Fields("bdelete") = 1
- RecTemp.Update
- RecTemp.MoveNext
- Loop
- '核销单位未达帐
- If RecTemp.State = 1 Then RecTemp.Close
- RecTemp.Open "select * from Cwzz_RjzNotCheck where bcheckflag=1", Cw_DataEnvi.DataConnect, adOpenDynamic, adLockOptimistic
- Do While Not RecTemp.EOF()
- RecTemp.Fields("bdelete") = 1
- RecTemp.Update
- RecTemp.MoveNext
- Loop
- '核销结算方式相同,票号相同,金额相反的数据
- Sqlstr = "Select * From CWZZ_V_BILL"
- Set RecDir = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
- Do While Not RecDir.EOF()
- If RecTemp.State = 1 Then RecTemp.Close
- Sqlstr = "Select * From Cwzz_Accvouchsub Where SerialID=" + CStr(RecDir.Fields("SerialID")) + " Or SerialID=" + CStr(RecDir.Fields("B_Id")) + ""
- RecTemp.Open Sqlstr, Cw_DataEnvi.DataConnect, adOpenDynamic, adLockOptimistic
- Do While Not RecTemp.EOF
- RecTemp.Fields("BCheckFlag") = 1
- RecTemp.Fields("bdelete") = 1
- RecTemp.Update
- RecTemp.MoveNext
- Loop
- RecDir.MoveNext
- Loop
- MsgBox "核销完毕!", 64, "百利/ERP5.0-财务总帐"
- End If
- Cw_DataEnvi.DataConnect.CommitTrans
- Exit Sub
- Err:
- Cw_DataEnvi.DataConnect.RollbackTrans
- End Sub
- '退出
- Private Sub Command2_Click()
- Unload Me
- End Sub
- '显示银行科目
- Private Sub Sub_ShowBill()
- Dim RecTemp As New ADODB.Recordset
- SQL_Str = "select * from cwzz_acccode where cproperty='银行' and endflag=1 order by ccode"
- Set RecTemp = Cw_DataEnvi.DataConnect.Execute(SQL_Str)
- If Not RecTemp.EOF Then
- Combo1.Text = Trim(RecTemp.Fields("ccode")) + Space(2) + Trim(RecTemp.Fields("cname"))
- Do While Not RecTemp.EOF()
- Combo1.AddItem Trim(RecTemp.Fields("ccode")) + Space(2) + Trim(RecTemp.Fields("cname"))
- RecTemp.MoveNext
- Loop
- End If
- End Sub
- '调入窗体
- Private Sub Form_Load()
- Call Sub_ShowBill
- End Sub