资源名称:ERPSYS.zip [点击查看]
上传用户:zhpu1995
上传日期:2013-09-06
资源大小:61151k
文件大小:10k
源码类别:
企业管理
开发平台:
Visual Basic
- VERSION 5.00
- Object = "{D76D7128-4A96-11D3-BD95-D296DC2DD072}#1.0#0"; "VSOCX7.OCX"
- Begin VB.Form Cask_Comeback
- BorderStyle = 3 'Fixed Dialog
- Caption = "恢复月末结帐"
- ClientHeight = 4245
- ClientLeft = 45
- ClientTop = 330
- ClientWidth = 5280
- HelpContextID = 1715002
- Icon = "包装物管理系统_结帐处理_恢复月末结帐.frx":0000
- KeyPreview = -1 'True
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 4245
- ScaleWidth = 5280
- ShowInTaskbar = 0 'False
- StartUpPosition = 1 '所有者中心
- Begin VB.CommandButton CmdCheck
- Caption = "恢复月末结帐"
- Height = 300
- Left = 2670
- TabIndex = 1
- Top = 3870
- Width = 1215
- End
- Begin VB.CommandButton CmdExit
- Caption = "退出"
- Height = 300
- Left = 4005
- TabIndex = 0
- Top = 3870
- Width = 1185
- End
- Begin VSFlex8Ctl.VSFlexGrid CzxsGrid
- Height = 3735
- Left = 90
- TabIndex = 2
- Top = 60
- Width = 5100
- _ExtentX = 8996
- _ExtentY = 6588
- Appearance = 1
- BorderStyle = 1
- Enabled = -1 'True
- BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- Name = "宋体"
- Size = 9
- Charset = 134
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- MousePointer = 0
- BackColor = 16777215
- ForeColor = -2147483640
- BackColorFixed = -2147483633
- ForeColorFixed = 0
- BackColorSel = 16777215
- ForeColorSel = -2147483634
- BackColorBkg = 12632256
- BackColorAlternate= 16777215
- GridColor = -2147483633
- GridColorFixed = 16777215
- TreeColor = -2147483632
- FloodColor = 0
- SheetBorder = -2147483642
- FocusRect = 1
- HighLight = 1
- AllowSelection = 0 'False
- AllowBigSelection= 0 'False
- AllowUserResizing= 0
- SelectionMode = 0
- GridLines = 3
- GridLinesFixed = 2
- GridLineWidth = 1
- Rows = 50
- Cols = 10
- FixedRows = 1
- FixedCols = 0
- RowHeightMin = 0
- RowHeightMax = 0
- ColWidthMin = 0
- ColWidthMax = 0
- ExtendLastCol = 0 'False
- FormatString = ""
- ScrollTrack = 0 'False
- ScrollBars = 3
- ScrollTips = 0 'False
- MergeCells = 0
- MergeCompare = 0
- AutoResize = -1 'True
- AutoSizeMode = 0
- AutoSearch = 0
- MultiTotals = -1 'True
- SubtotalPosition= 1
- OutlineBar = 0
- OutlineCol = 0
- Ellipsis = 0
- ExplorerBar = 0
- PicturesOver = 0 'False
- FillStyle = 1
- RightToLeft = 0 'False
- PictureType = 0
- TabBehavior = 0
- OwnerDraw = 0
- Editable = 0 'False
- ShowComboButton = -1 'True
- WordWrap = 0 'False
- TextStyle = 0
- TextStyleFixed = 0
- OleDragMode = 0
- OleDropMode = 0
- DataMode = 0
- VirtualData = -1 'True
- End
- End
- Attribute VB_Name = "Cask_Comeback"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- '******************************************************************
- '* 模 块 名 称 :恢复月末结帐
- '* 功 能 描 述 :
- '* 程序员姓名 :邹力
- '* 最后修改人 :
- '* 最后修改时间:2001/12/10
- '* 备 注:程序中所有依实际情况自定义部分均用[>> <<]括起
- '******************************************************************
- '以下为固定使用变量(网格)
- Dim Cxnrrec As New ADODB.Recordset '显示查询内容动态集
- Dim Dyymctbl As New DY_Dyymsz '打印页面窗体变量
- Dim GridCode As String '显示网格网格代码
- Dim GridInf() As Variant '整个网格设置信息
- Dim Tsxx As String '系统提示信息
- Dim Qslz As Long '网格隐藏(非操作显示)列数
- Dim Sjhgd As Double '网格数据行高度
- Dim GridBoolean() As Boolean '网格列信息(布尔型)
- Dim GridStr() As String '网格列信息(字符型)
- Dim GridInt() As Integer '网格列信息(整型)
- Dim Szzls As Integer '数组总列数(网格列数-1)
- Dim Rec_KJ As New ADODB.Recordset
- Dim jl_row As Integer
- Dim JL_Rec_KJ As Integer
- Dim QSRQ As String, ZZRQ As String
- Dim retrun_str As String
- Private Sub CmdCheck_Click()
- Call tc_zz '删除库存总帐
- End Sub
- Private Sub CmdExit_Click()
- Unload Me
- End Sub
- Private Sub Form_Load()
- '调入网格设置信息
- GridCode = "Cask_CheckOut"
- Call BzWgcsh(CzxsGrid, GridCode, GridInf(), GridBoolean(), GridInt(), GridStr())
- Qslz = GridInf(1)
- Sjhgd = GridInf(2)
- Szzls = CzxsGrid.Cols - 1
- '填 充 网 格
- Call Cxnrtcwg
- Set CxnrrecTemp = Cw_DataEnvi.DataConnect.Execute("select kjyear,period,CaskJzbz from gy_kjrlb where beginflag=1")
- With CzxsGrid
- .Cell(flexcpBackColor, CxnrrecTemp!Period, 0, CxnrrecTemp!Period, .Cols - 1) = &HFFFFC0
- End With
- End Sub
- Private Sub Cxnrtcwg() '查询内容填充网格
- Dim Sqlstr As String '查询连接串
- Dim Jsqte As Long '查询临时使用变量
- '为加快显示速度,将网格刷新动作冻结
- CzxsGrid.Redraw = False
- '[>>查询连接串
- Sqlstr = "SELECT * FROM Gy_Kjrlb Order By KjYear,Period"
- '<<]
- Set Cxnrrec = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
- With Cxnrrec
- CzxsGrid.Rows = CzxsGrid.FixedRows
- If .EOF And .BOF Then
- CzxsGrid.Redraw = True
- Exit Sub
- End If
- Jsqte = CzxsGrid.FixedRows
- Do While Not .EOF
- CzxsGrid.AddItem ""
- Call Jltcwg(Cxnrrec, Jsqte) '调入填充网格子过程
- CzxsGrid.RowHeight(Jsqte) = Sjhgd '设置网格高度
- .MoveNext
- Jsqte = Jsqte + 1
- Loop
- End With
- '将网格刷新动作解冻
- CzxsGrid.Redraw = True
- End Sub
- Private Sub Jltcwg(Jlbrec As ADODB.Recordset, Rowjsq As Long) '记录内容填充网格
- '[>>以下为自定义部分
- With Jlbrec
- CzxsGrid.TextMatrix(Rowjsq, Sydz("001", GridStr(), Szzls)) = !KjYear '会计年度
- CzxsGrid.TextMatrix(Rowjsq, Sydz("002", GridStr(), Szzls)) = !Period '会计期间
- CzxsGrid.TextMatrix(Rowjsq, Sydz("003", GridStr(), Szzls)) = !QSRQ '起始日期
- CzxsGrid.TextMatrix(Rowjsq, Sydz("004", GridStr(), Szzls)) = !ZZRQ '终止日期
- CzxsGrid.TextMatrix(Rowjsq, Sydz("005", GridStr(), Szzls)) = !CaskJzbz '结帐
- End With
- '以上为自定义部分<<]
- End Sub
- Private Sub tc_zz()
- Dim Sqlstr As String
- Dim Rec_Cask As New Recordset
- Dim StrCheck As String
- Dim RecList As New Recordset
- Dim RecLast As New Recordset
- Dim RecTemp As New Recordset
- Dim T_Query As New Recordset
- On Error GoTo Swcwcl
- '该年度是否恢复结帐完成
- Sqlstr = "SELECT * FROM Gy_Kjrlb where CaskJzbz=1 Order By KjYear,Period"
- Set Cxnrrec = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
- If Cxnrrec.EOF Then
- Tsxx = "该会计年度没有结帐月份!"
- Call Xtxxts(Tsxx, 0, 1)
- Exit Sub
- Else
- Cxnrrec.MoveLast
- End If
- Sqlstr = "SELECT * FROM Gy_Kjrlb where BeginFlag=1"
- Set Rec_Query = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
- If Not (Cxnrrec!ZZRQ >= Xtrq And Xtrq >= Cxnrrec!QSRQ) Then
- Tsxx = "登录日期不在恢复月末结帐会计期间内,不能恢复月末结帐,请重新登录!"
- Call Xtxxts(Tsxx, 0, 1)
- Exit Sub
- End If
- If ((Val(Rec_Query!Period) <> Val(Cxnrrec!Period)) And (Val(Rec_Query!KjYear) = Val(Cxnrrec!KjYear))) Then
- Sqlstr = "Delete Cask_Ledger where Period= " & Val(Trim(Cxnrrec!Period)) & " and KJYear=" & Val(Trim(Cxnrrec!KjYear))
- Cw_DataEnvi.DataConnect.Execute (Sqlstr)
- If Val(Cxnrrec!Period) = 12 Then
- Sqlstr = "Delete Cask_Ledger where KJYear=" & Val(Trim(Cxnrrec!KjYear)) + 1
- Cw_DataEnvi.DataConnect.Execute (Sqlstr)
- End If
- Else
- Cw_DataEnvi.DataConnect.Execute ("Update Cask_Ledger Set AmountIn=0,AmountOut=0 where Period= " & Val(Trim(Cxnrrec!Period)) & " and KJYear=" & Val(Trim(Cxnrrec!KjYear)) & "")
- End If
- Cw_DataEnvi.DataConnect.Execute ("Delete Cask_Ledger where AmountIn=0 and AmountOut=0 and StartQuan=0")
- '回填结帐人
- Cw_DataEnvi.DataConnect.Execute ("Update Cask_HarvestIssueMain Set ChalkitupMan='' Where BillType<>1 and HIDate Between '" & CDate(Trim(Cxnrrec!QSRQ)) & "' and '" & CDate(Trim(Cxnrrec!ZZRQ)) & "'")
- '回填会计日期
- If ((Val(Rec_Query!Period) = Val(Cxnrrec!Period)) And (Val(Rec_Query!KjYear) = Val(Cxnrrec!KjYear))) Then
- Cw_DataEnvi.DataConnect.Execute ("Update Gy_Kjrlb Set CaskJzbz=0 where KJYear=" & Val(Trim(Cxnrrec!KjYear)))
- Else
- Cw_DataEnvi.DataConnect.Execute ("Update Gy_Kjrlb Set CaskJzbz=0 where Period= " & Val(Trim(Cxnrrec!Period)) & " and KJYear=" & Val(Trim(Cxnrrec!KjYear)))
- End If
- Call th_focus
- Tsxx = "您已成功恢复结帐! "
- Call Xtxxts(Tsxx, 0, 4)
- Exit Sub
- Swcwcl:
- Tsxx = "恢复结帐过程中出现错误!请重试!"
- Call Xtxxts(Tsxx, 0, 4)
- Exit Sub
- End Sub
- Private Sub th_focus()
- Dim R_Temp As ADODB.Recordset
- Sqlstr = "SELECT * FROM Gy_Kjrlb Order By KjYear,Period"
- Set R_Temp = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
- For i = CzxsGrid.FixedRows To CzxsGrid.Rows - 1
- CzxsGrid.TextMatrix(i, Sydz("005", GridStr(), Szzls)) = R_Temp!CaskJzbz '结帐
- R_Temp.MoveNext
- Next i
- End Sub
- Private Sub Form_Unload(Cancel As Integer)
- Unload Me
- End Sub