资源名称:ERPSYS.zip [点击查看]
上传用户:zhpu1995
上传日期:2013-09-06
资源大小:61151k
文件大小:54k
源码类别:
企业管理
开发平台:
Visual Basic
- VERSION 5.00
- Object = "{BEEECC20-4D5F-4F8B-BFDC-5D9B6FBDE09D}#1.0#0"; "vsflex8.ocx"
- Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomctl.ocx"
- Begin VB.Form FX_FrmCostReport
- Caption = "生产成本明细表"
- ClientHeight = 7320
- ClientLeft = 690
- ClientTop = 735
- ClientWidth = 10230
- Icon = "成本分析_对象明细表.frx":0000
- KeyPreview = -1 'True
- LinkTopic = "Form4"
- MDIChild = -1 'True
- ScaleHeight = 7320
- ScaleWidth = 10230
- Begin VB.PictureBox Pic_Title
- AutoRedraw = -1 'True
- BackColor = &H00FFFFFF&
- Height = 1065
- Left = 30
- Picture = "成本分析_对象明细表.frx":1042
- ScaleHeight = 1005
- ScaleWidth = 11835
- TabIndex = 0
- Top = 555
- Width = 11895
- Begin VB.ComboBox Combo_ReportType
- Height = 300
- ItemData = "成本分析_对象明细表.frx":35106
- Left = 9600
- List = "成本分析_对象明细表.frx":35113
- Style = 2 'Dropdown List
- TabIndex = 23
- Top = 690
- Width = 1845
- End
- Begin VB.ComboBox Combo_Kjqj
- Height = 300
- Left = 6090
- Style = 2 'Dropdown List
- TabIndex = 21
- Top = 690
- Width = 1875
- End
- Begin VB.ComboBox Cbo_Object
- Height = 300
- Left = 1800
- Style = 2 'Dropdown List
- TabIndex = 11
- Top = 690
- Width = 2925
- End
- Begin VB.Label Label5
- AutoSize = -1 'True
- BackStyle = 0 'Transparent
- Caption = "报表类型:"
- Height = 180
- Left = 8760
- TabIndex = 22
- Top = 750
- Width = 810
- End
- Begin VB.Label Lab_DW
- AutoSize = -1 'True
- BackStyle = 0 'Transparent
- Height = 180
- Left = 9210
- TabIndex = 18
- Top = 210
- Width = 90
- End
- Begin VB.Label Label8
- AutoSize = -1 'True
- BackStyle = 0 'Transparent
- Caption = "单位:"
- Height = 180
- Left = 8670
- TabIndex = 17
- Top = 217
- Width = 450
- End
- Begin VB.Label Lab_LJCL
- AutoSize = -1 'True
- BackStyle = 0 'Transparent
- Height = 180
- Left = 7740
- TabIndex = 16
- Top = 210
- Width = 90
- End
- Begin VB.Label Label6
- AutoSize = -1 'True
- BackStyle = 0 'Transparent
- Caption = "累计产量:"
- Height = 180
- Left = 6870
- TabIndex = 15
- Top = 210
- Width = 810
- End
- Begin VB.Label Lab_YCL
- AutoSize = -1 'True
- BackStyle = 0 'Transparent
- Height = 180
- Left = 5970
- TabIndex = 14
- Top = 210
- Width = 90
- End
- Begin VB.Label Label4
- AutoSize = -1 'True
- BackStyle = 0 'Transparent
- Caption = "月产量:"
- Height = 180
- Left = 5220
- TabIndex = 13
- Top = 210
- Width = 630
- End
- Begin VB.Label Label2
- AutoSize = -1 'True
- BackStyle = 0 'Transparent
- Caption = "会计期间:"
- Height = 180
- Left = 5220
- TabIndex = 12
- Top = 750
- Width = 810
- End
- Begin VB.Label Label1
- AutoSize = -1 'True
- BackStyle = 0 'Transparent
- Caption = "核算对象:"
- Height = 180
- Left = 930
- TabIndex = 10
- Top = 750
- Width = 810
- End
- Begin VB.Label Lab_Row
- Alignment = 2 'Center
- Appearance = 0 'Flat
- AutoSize = -1 'True
- BackColor = &H80000005&
- BackStyle = 0 'Transparent
- ForeColor = &H00FF0000&
- Height = 180
- Left = 11010
- TabIndex = 5
- Top = 210
- Width = 90
- End
- Begin VB.Label tsLabel
- AutoSize = -1 'True
- BackStyle = 0 'Transparent
- Caption = "(第"
- Height = 180
- Index = 3
- Left = 10545
- TabIndex = 4
- Top = 210
- Width = 270
- End
- Begin VB.Label tsLabel
- AutoSize = -1 'True
- BackStyle = 0 'Transparent
- Caption = "行)"
- Height = 180
- Index = 4
- Left = 11160
- TabIndex = 3
- Top = 210
- Width = 270
- End
- Begin VB.Label tsLabel
- AutoSize = -1 'True
- BackStyle = 0 'Transparent
- Caption = "当前记录"
- Height = 180
- Index = 5
- Left = 9735
- TabIndex = 2
- Top = 210
- Width = 720
- End
- Begin VB.Label tsLabel
- AutoSize = -1 'True
- BackColor = &H80000018&
- BackStyle = 0 'Transparent
- Caption = "生产成本明细表"
- BeginProperty Font
- Name = "宋体"
- Size = 12
- Charset = 134
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- ForeColor = &H00000000&
- Height = 240
- Index = 7
- Left = 360
- TabIndex = 1
- Top = 240
- Width = 1785
- End
- Begin VB.Label Lab_Color
- Appearance = 0 'Flat
- BackColor = &H00DFDFDF&
- BorderStyle = 1 'Fixed Single
- ForeColor = &H80000008&
- Height = 195
- Index = 1
- Left = 8520
- TabIndex = 20
- Top = 990
- Visible = 0 'False
- Width = 345
- End
- Begin VB.Label Lab_Color
- Appearance = 0 'Flat
- BackColor = &H00FFFFC0&
- BorderStyle = 1 'Fixed Single
- ForeColor = &H80000008&
- Height = 195
- Index = 0
- Left = 8070
- TabIndex = 19
- Top = 990
- Visible = 0 'False
- Width = 345
- End
- End
- Begin VSFlex8Ctl.VSFlexGrid WglrGrid
- Height = 5925
- Left = 0
- TabIndex = 6
- Top = 1650
- Width = 11910
- _cx = 5080
- _cy = 5080
- 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 = -2147483643
- ForeColor = -2147483640
- BackColorFixed = -2147483633
- ForeColorFixed = -2147483630
- BackColorSel = -2147483635
- ForeColorSel = -2147483634
- BackColorBkg = -2147483632
- BackColorAlternate= -2147483643
- GridColor = -2147483633
- GridColorFixed = -2147483632
- TreeColor = -2147483632
- FloodColor = 192
- SheetBorder = -2147483642
- FocusRect = 1
- HighLight = 1
- AllowSelection = -1 'True
- AllowBigSelection= -1 'True
- AllowUserResizing= 0
- SelectionMode = 0
- GridLines = 1
- GridLinesFixed = 2
- GridLineWidth = 1
- Rows = 5000
- 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
- AutoSearchDelay = 2
- MultiTotals = -1 'True
- SubtotalPosition= 1
- OutlineBar = 0
- OutlineCol = 0
- Ellipsis = 0
- ExplorerBar = 0
- PicturesOver = 0 'False
- FillStyle = 0
- RightToLeft = 0 'False
- PictureType = 0
- TabBehavior = 0
- OwnerDraw = 0
- Editable = 0
- ShowComboButton = 1
- WordWrap = 0 'False
- TextStyle = 0
- TextStyleFixed = 0
- OleDragMode = 0
- OleDropMode = 0
- DataMode = 0
- VirtualData = -1 'True
- DataMember = ""
- ComboSearch = 3
- AutoSizeMouse = -1 'True
- FrozenRows = 0
- FrozenCols = 0
- AllowUserFreezing= 0
- BackColorFrozen = 0
- ForeColorFrozen = 0
- WallPaperAlignment= 9
- AccessibleName = ""
- AccessibleDescription= ""
- AccessibleValue = ""
- AccessibleRole = 24
- End
- Begin MSComctlLib.ImageList ImageList1
- Left = 5280
- Top = 720
- _ExtentX = 1005
- _ExtentY = 1005
- BackColor = -2147483643
- ImageWidth = 16
- ImageHeight = 16
- MaskColor = 12632256
- _Version = 393216
- BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
- NumListImages = 38
- BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "成本分析_对象明细表.frx":35143
- Key = "sz"
- EndProperty
- BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "成本分析_对象明细表.frx":354DD
- Key = "dy"
- EndProperty
- BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "成本分析_对象明细表.frx":35877
- Key = "yl"
- EndProperty
- BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "成本分析_对象明细表.frx":35C11
- Key = "xg"
- EndProperty
- BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "成本分析_对象明细表.frx":35FAB
- Key = "zh"
- EndProperty
- BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "成本分析_对象明细表.frx":36345
- Key = "sh"
- EndProperty
- BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "成本分析_对象明细表.frx":366DF
- Key = "bc"
- EndProperty
- BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "成本分析_对象明细表.frx":36A79
- Key = "fq"
- EndProperty
- BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "成本分析_对象明细表.frx":36E13
- Key = "bz"
- EndProperty
- BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "成本分析_对象明细表.frx":371AD
- Key = "tc"
- EndProperty
- BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "成本分析_对象明细表.frx":37547
- Key = "bcgs"
- EndProperty
- BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "成本分析_对象明细表.frx":378E1
- Key = "mrlk"
- EndProperty
- BeginProperty ListImage13 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "成本分析_对象明细表.frx":37C7B
- Key = "xsxm"
- EndProperty
- BeginProperty ListImage14 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "成本分析_对象明细表.frx":38015
- Key = "first"
- EndProperty
- BeginProperty ListImage15 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "成本分析_对象明细表.frx":383AF
- Key = "prev"
- EndProperty
- BeginProperty ListImage16 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "成本分析_对象明细表.frx":38749
- Key = "next"
- EndProperty
- BeginProperty ListImage17 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "成本分析_对象明细表.frx":38AE3
- Key = "last"
- EndProperty
- BeginProperty ListImage18 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "成本分析_对象明细表.frx":38E7D
- Key = "xx"
- EndProperty
- BeginProperty ListImage19 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "成本分析_对象明细表.frx":39217
- Key = "define"
- EndProperty
- BeginProperty ListImage20 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "成本分析_对象明细表.frx":395B1
- Key = "exec"
- EndProperty
- BeginProperty ListImage21 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "成本分析_对象明细表.frx":3994B
- Key = "xz"
- EndProperty
- BeginProperty ListImage22 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "成本分析_对象明细表.frx":39CE5
- Key = "sc"
- EndProperty
- BeginProperty ListImage23 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "成本分析_对象明细表.frx":3A07F
- Key = "sx"
- EndProperty
- BeginProperty ListImage24 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "成本分析_对象明细表.frx":3A419
- Key = "cx"
- EndProperty
- BeginProperty ListImage25 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "成本分析_对象明细表.frx":3A7B3
- Key = "zd"
- EndProperty
- BeginProperty ListImage26 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "成本分析_对象明细表.frx":3AB4D
- Key = "dz"
- EndProperty
- BeginProperty ListImage27 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "成本分析_对象明细表.frx":3AEE7
- Key = "ph"
- EndProperty
- BeginProperty ListImage28 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "成本分析_对象明细表.frx":3B281
- Key = "fz"
- EndProperty
- BeginProperty ListImage29 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "成本分析_对象明细表.frx":3B61B
- Key = "dw"
- EndProperty
- BeginProperty ListImage30 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "成本分析_对象明细表.frx":3B9B5
- Key = "hf"
- EndProperty
- BeginProperty ListImage31 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "成本分析_对象明细表.frx":3BD4F
- Key = "pz"
- EndProperty
- BeginProperty ListImage32 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "成本分析_对象明细表.frx":3C0E9
- Key = "check"
- EndProperty
- BeginProperty ListImage33 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "成本分析_对象明细表.frx":3C483
- Key = "qs"
- EndProperty
- BeginProperty ListImage34 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "成本分析_对象明细表.frx":3C81D
- Key = "fullcheck"
- EndProperty
- BeginProperty ListImage35 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "成本分析_对象明细表.frx":3CBB7
- Key = "qq"
- EndProperty
- BeginProperty ListImage36 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "成本分析_对象明细表.frx":3CF51
- Key = "bcw"
- EndProperty
- BeginProperty ListImage37 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "成本分析_对象明细表.frx":3D2EB
- Key = "ye"
- EndProperty
- BeginProperty ListImage38 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "成本分析_对象明细表.frx":3D685
- Key = "Auto"
- EndProperty
- EndProperty
- End
- Begin MSComctlLib.Toolbar Tlb_Action
- Align = 1 'Align Top
- Height = 555
- Left = 0
- TabIndex = 9
- Top = 0
- Width = 10230
- _ExtentX = 18045
- _ExtentY = 979
- ButtonWidth = 820
- ButtonHeight = 926
- AllowCustomize = 0 'False
- Wrappable = 0 'False
- Appearance = 1
- Style = 1
- ImageList = "ImageList1"
- _Version = 393216
- BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628}
- NumButtons = 7
- BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "设置"
- Key = "ymsz"
- Object.ToolTipText = "打印页面设置"
- ImageIndex = 1
- EndProperty
- BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "打印"
- Key = "dy"
- Object.ToolTipText = "打印当前单据或Ctrl+P"
- ImageIndex = 2
- EndProperty
- BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "预览"
- Key = "yl"
- ImageIndex = 3
- EndProperty
- BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Style = 3
- EndProperty
- BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "帮助"
- Key = "bz"
- ImageIndex = 9
- EndProperty
- BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Style = 3
- EndProperty
- BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "退出"
- Key = "fh"
- ImageIndex = 10
- EndProperty
- EndProperty
- BorderStyle = 1
- Begin MSComctlLib.Toolbar GsToolbar
- Height = 525
- Left = 9270
- TabIndex = 8
- Top = 0
- Width = 2595
- _ExtentX = 4577
- _ExtentY = 926
- ButtonWidth = 1455
- ButtonHeight = 926
- AllowCustomize = 0 'False
- Appearance = 1
- Style = 1
- ImageList = "ImageList1"
- _Version = 393216
- BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628}
- NumButtons = 3
- BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "保存格式"
- Key = "bcgs"
- ImageKey = "bcgs"
- EndProperty
- BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "默认列宽"
- Key = "hfmrgs"
- ImageKey = "mrlk"
- EndProperty
- BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "显示项目"
- Key = "szxsxm"
- ImageKey = "xsxm"
- EndProperty
- EndProperty
- End
- End
- Begin VB.Label Lab_Pzclzt
- BackColor = &H0000FFFF&
- Caption = "2"
- ForeColor = &H00808080&
- Height = 322
- Left = 9012
- TabIndex = 7
- Top = 553
- Visible = 0 'False
- Width = 403
- End
- End
- Attribute VB_Name = "FX_FrmCostReport"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- '*********************************************************************************************************
- '* 模 块 名 称 :生产成本明细表
- '* 功 能 描 述 :生产成本明细表
- '* 程序员姓名 :xjl
- '* 最后修改人 :xjl
- '* 最后修改时间:2002/1/22
- '* 备 注:
- '*********************************************************************************************************
- '[以下为根据实际情况设置变量
- Dim Rec_Defi As New ADODB.Recordset '定义表
- Dim Bln_BillChange As Boolean '标识单据是否发生改动
- Dim jsqte As Long '临时计数器
- Dim SqlStr As String '临时的SQL字符串
- Dim RecTemp As New ADODB.Recordset '临时使用动态集
- Dim Pr_ObjectCode() As String '归集对象编码
- Dim ShowBillLock As Boolean '显示数据锁
- Dim KJQJLock As Boolean '会计期间锁
- Dim PrivateYear As Integer '当前年
- Dim PrivateMm As Integer '当前月
- ']
- '以下为固定使用变量(网格)
- Dim Cxnrrec As New ADODB.Recordset '显示查询内容动态集
- Dim Dyymctbl As New DY_Dyymsz '打印页面窗体变量
- Dim GridCode As String '显示网格网格代码
- Dim GridInf() As Variant '整个网格设置信息
- Dim ReportTitle As String '报表主标题
- Dim Tsxx As String '系统提示信息
- Dim Pmbcsjhs As Long '屏幕网格保持数据行数(大于等于1)
- Dim Fzxwghs As Integer '辅助项网格行数(包括合计行)
- Dim Sfxshjwg As Boolean '是否显示合计网格
- Dim Qslz As Long '网格隐藏(非操作显示)列数
- Dim Sjhgd As Double '网格数据行高度
- Dim GridBoolean() As Boolean '网格列信息(布尔型)
- Dim GridStr() As String '网格列信息(字符型)
- Dim GridInt() As Integer '网格列信息(整型)
- Dim Sfblbzkd As Boolean '是否保留帮助宽度(字段提供帮助时,是否为按钮保留空间)
- Dim Dqlrwgh As Long '当前录入数据网格行
- Dim Dqlrwgl As Long '当前录入数据网格列
- Dim Dqlkwgh As Long '刚刚离开网格行(不一定为录入行)
- Dim Dqlkwgl As Long '刚刚离开网格列
- Dim Dqtoprow As Long '当前录入状态时最上端可视行
- Dim Dqleftcol As Long '当前录入状态时最左端可视列
- Dim Zdlrqnr As String '字段录入修改前内容(用来判断内容是否修改)
- Dim Wbkbhlock As Boolean '文本框改变值锁
- Dim Changelock As Boolean '网格行列改变控制锁(用来区别用户改变.程序改变)
- Dim Gdtlock As Boolean '滚动条滚动控制(用来区别用户改变.程序改变)
- Dim Yxxpdlock As Boolean '字段有效性判断锁(内容不修改不需进行字段有效性判断)
- Dim Hyxxpdlock As Boolean '行有效性判断锁(字段内容不修改不需进行行有效性判断)
- Dim Valilock As Boolean '文本框失去焦点是否进行有效性控制(TRUE 为锁定*限用网格录入)
- Dim Shsfts As Boolean '删除记录行是否提示
- Dim Szzls As Integer '网格信息数组最大下标值(网格列数-1)
- Private Sub Cbo_Object_Click() '选择成本对象显示数据
- If ShowBillLock = False Then Exit Sub
- Call Lab_List '显示LAB数据
- Call ShowCostReport '显示明细数据
- End Sub
- Private Sub Combo_KJQJ_Click() '选择会计科目显示数据
- If KJQJLock = False Then
- Exit Sub
- End If
- PrivateYear = Mid(Trim(CStr(Combo_KJQJ.List(Combo_KJQJ.ListIndex))), 1, 4)
- PrivateMm = Right(Trim(CStr(Combo_KJQJ.List(Combo_KJQJ.ListIndex))), 2)
- Call Lab_List '显示LAB数据
- Call ShowCostReport '显示明细数据
- End Sub
- Private Sub Combo_ReportType_Click() '选择报表类型
- Call GridHidden(Combo_ReportType.ListIndex)
- End Sub
- Private Sub Form_KeyPress(KeyAscii As Integer) '控制焦点转移
- Dim jdzygs As Integer
- jdzygs = 3
- Select Case KeyAscii
- Case vbKeyReturn
- If Kjjdzy(jdzygs) Then
- KeyAscii = 0
- End If
- Case 39 '屏蔽字符"'"
- KeyAscii = 0
- End Select
- End Sub
- Private Sub Form_Load() '窗体装入
- '初始化各种锁值
- Changelock = False '网格行列改变控制锁
- Gdtlock = False '滚动条滚动控制
- Yxxpdlock = True '字段有效性判断锁
- Hyxxpdlock = True '行有效性判断锁
- Wbkbhlock = False '文本框内容改变锁
- KJQJLock = False
- ShowBillLock = False
- PrivateYear = Xtyear
- PrivateMm = Xtmm
- '报表主标题及报表编码
- ReportTitle = "生产成本明细表"
- XtReportCode = "Cb_CostReport"
- Load Dyymctbl
- '调入网格
- GridCode = "Cb_CostReport" '网格属性编码
- Call BzWgcsh(WglrGrid, GridCode, GridInf(), GridBoolean(), GridInt(), GridStr())
- Qslz = GridInf(1)
- Sjhgd = GridInf(2)
- Pmbcsjhs = GridInf(3)
- Fzxwghs = GridInf(4)
- Sfblbzkd = GridInf(5)
- Shsfts = GridInf(6)
- Sfxshjwg = GridInf(7)
- Szzls = WglrGrid.Cols - 1
- For jsqte = WglrGrid.FixedRows To WglrGrid.Rows - 1
- WglrGrid.RowHeight(jsqte) = Sjhgd
- Next jsqte
- Call Sub_CostObject '显示成本对象
- Call Sub_FillPeriod(Combo_KJQJ, PrivateYear, PrivateMm) '会计期间
- Combo_ReportType.ListIndex = 0 '报表类型
- If Cbo_Object.ListCount > 0 Then
- Call Lab_List '显示LAB数据
- Call ShowCostReport '显示明细数据
- KJQJLock = True
- Else
- Call Sub_OperStatus("10")
- End If
- ShowBillLock = True
- End Sub
- Private Sub Form_Resize() '调整窗体
- On Error Resume Next
- With WglrGrid
- .Width = Me.Width - 160
- .Height = Me.Height - .Top - 400
- End With
- With Pic_Title
- .Width = Me.Width - 160
- End With
- GsToolbar.Left = Me.Width - GsToolbar.Width - 140
- End Sub
- Private Sub Form_Unload(Cancel As Integer) '窗体卸载
- '卸载打印页面窗体
- Unload Dyymctbl
- '判断凭证是否发生变化
- If Bln_BillChange Then
- Xtfhcs = "1"
- Else
- Xtfhcs = "0"
- End If
- Set RecTemp = Nothing
- End Sub
- Private Sub Sub_ShowBill(Index As Integer) '查找当前期间需盘存的项目
- Dim DimYear As Integer
- Dim DimMM As Integer
- DimMM = PrivateMm - 1
- If DimMM = 0 Then
- DimYear = PrivateYear - 1
- DimMM = 12
- Else
- DimYear = PrivateYear
- End If
- If Index = 0 Then '未结帐
- SqlStr = "Select * From (Select Objectcode,ItemCode,Substring(ParentCode,3,3) as ParentCode,Year,Period,ItemName,UnitCode,UnitName,PlanUnitPrice,PlanQuantity,PlanMoney," _
- & "PreMonAmount,PreMonMoney,ScatterQuantity As ThmonAmount,ScatterMoney AS ThmonMoney,InvQuantity As ThmonInvAmount,InvValue As ThmonInvMoney,ThmonConsumeAmount, " _
- & "ThmonConsumeMoney,ThMonFactUnAmount,ThMonFactUnMoney,TotalConsumeAmount,TotalConsumeMoney, " _
- & "TotalConsumeUnAmount,TotalConsumeUnMoney,ThMonRatioAmount,ThMonRatioMoney,TotalRationAmount As TotalRatioAmount, " _
- & "TotalRationMoney As TotalRatioMoney,IsShow,IsSum From Cb_Fn_Sccb('" + CStr(Pr_ObjectCode(Cbo_Object.ListIndex)) + "', " _
- & "" + CStr(PrivateYear) + "," + CStr(PrivateMm) + "," + CStr(DimYear) + "," + CStr(DimMM) + "," + CStr(Val(Lab_YCL.Caption)) + "," + CStr(Val(Lab_LJCL.Caption)) + ") " _
- & "Union " _
- & "Select '','',Substring(ParentCode,3,3),'','','小计','','元',0,0,Sum(PlanMoney),0,Sum(PreMonMoney),0, " _
- & "Sum(ScatterMoney),0,Sum(InvValue),0,Sum(ThmonConsumeMoney), " _
- & "0,Sum(ThMonFactUnMoney),0,Sum(TotalConsumeMoney),0,Sum(TotalConsumeUnMoney),0,Sum(ThMonRatioMoney), " _
- & "0,Sum(TotalRationMoney),'','' " _
- & "From Cb_Fn_Sccb('" + CStr(Pr_ObjectCode(Cbo_Object.ListIndex)) + "'," + CStr(PrivateYear) + "," + CStr(PrivateMm) + ", " _
- & "" + CStr(DimYear) + "," + CStr(DimMM) + "," + CStr(Val(Lab_YCL.Caption)) + "," + CStr(Val(Lab_LJCL.Caption)) + ") Group By Substring(ParentCode,3,3) " _
- & "Union " _
- & "Select '','','总计','','','总计','','元',0,0,Sum(PlanMoney),0,Sum(PreMonMoney),0,Sum(ScatterMoney),0,Sum(InvValue),0,Sum(ThmonConsumeMoney), " _
- & "0,Sum(ThMonFactUnMoney),0,Sum(TotalConsumeMoney),0,Sum(TotalConsumeUnMoney),0,Sum(ThMonRatioMoney), " _
- & "0,Sum(TotalRationMoney),'','' " _
- & "From Cb_Fn_Sccb('" + CStr(Pr_ObjectCode(Cbo_Object.ListIndex)) + "'," + CStr(PrivateYear) + "," + CStr(PrivateMm) + ", " _
- & "" + CStr(DimYear) + "," + CStr(DimMM) + "," + CStr(Val(Lab_YCL.Caption)) + "," + CStr(Val(Lab_LJCL.Caption)) + ")) A Order By ParentCode ,ObjectCode desc"
- Else '已结帐
- SqlStr = "Select * From (Select Objectcode,ItemCode,ParentCode,Year,Period,ItemName,UnitCode,UnitName,PlanUnitPrice,PlanQuantity," _
- & "PlanMoney,PreMonAmount,PreMonMoney,ThmonAmount,ThmonMoney,ThmonInvAmount,ThmonInvMoney, " _
- & "ThmonConsumeAmount,ThmonConsumeMoney,ThmonFactunAmount,ThmonFactunMoney,TotalConsumeAmount, " _
- & "TotalConsumeMoney,TotalConsumeUnAmount,TotalConsumeUnMoney,ThmonRatioAmount,ThmonRatioMoney, " _
- & "TotalRatioAmount,TotalRatioMoney,IsSum,IsShow From Cb_V_CostReprot " _
- & "Where ObjectCode='" + CStr(Pr_ObjectCode(Cbo_Object.ListIndex)) + "' And Year=" + CStr(PrivateYear) + " And Period=" + CStr(PrivateMm) + " " _
- & "Union " _
- & "Select '','',ParentCode,'','','小计','','元',0,0,Sum(PlanMoney),0,Sum(PreMonMoney),0, " _
- & "Sum(ThmonMoney),0,Sum(ThmonInvMoney),0,Sum(ThmonConsumeMoney), 0,Sum(ThmonFactunMoney),0, " _
- & "Sum(TotalConsumeMoney),0,Sum(TotalConsumeUnMoney),0,Sum(ThmonRatioMoney), 0,Sum(TotalRatioMoney),'','' " _
- & "From Cb_V_CostReprot " _
- & "Where ObjectCode='" + CStr(Pr_ObjectCode(Cbo_Object.ListIndex)) + "' And Year=" + CStr(PrivateYear) + " And Period=" + CStr(PrivateMm) + " " _
- & "Group By ParentCode " _
- & "Union " _
- & "Select '','','总计','','','总计','','元',0,0,Sum(PlanMoney),0,Sum(PreMonMoney),0,Sum(ThmonMoney),0, " _
- & "Sum(ThmonInvMoney),0,Sum(ThmonConsumeMoney), 0,Sum(ThmonFactunMoney),0,Sum(TotalConsumeMoney),0, " _
- & "Sum(TotalConsumeUnMoney),0,Sum(ThmonRatioMoney), 0,Sum(TotalRatioMoney),'','' " _
- & "From Cb_V_CostReprot " _
- & "Where ObjectCode='" + CStr(Pr_ObjectCode(Cbo_Object.ListIndex)) + "' And Year=" + CStr(PrivateYear) + " And Period=" + CStr(PrivateMm) + " " _
- & ") A Order By ParentCode ,ObjectCode Desc"
- End If
- Set RecTemp = Cw_DataEnvi.DataConnect.Execute(SqlStr)
- With RecTemp
- WglrGrid.Clear 1
- If .EOF Then
- Exit Sub
- Else
- WglrGrid.Rows = .RecordCount + WglrGrid.FixedRows
- '[>>显示单据头
- jsqte = WglrGrid.FixedRows
- Do While Not .EOF
- If jsqte >= WglrGrid.Rows Then
- WglrGrid.AddItem ""
- End If
- '[>>显示分录
- If Index = 0 Then
- Call Jltcwg(RecTemp, jsqte) '写网格
- Call WriteCostData(RecTemp) '写入成本数据
- Else
- Call Jltcwg(RecTemp, jsqte) '写网格
- End If
- If Trim(.Fields("Itemcode")) = "" Then
- WglrGrid.Cell(flexcpBackColor, jsqte, 0, jsqte, WglrGrid.Cols - 1) = Lab_Color(1).BackColor
- End If
- If Trim(.Fields("ParentCode")) = "总计" Then
- WglrGrid.Cell(flexcpBackColor, jsqte, 0, jsqte, WglrGrid.Cols - 1) = Lab_Color(0).BackColor
- End If
- '<<]
- WglrGrid.RowHeight(jsqte) = Sjhgd
- .MoveNext
- jsqte = jsqte + 1
- Loop
- End If
- End With
- End Sub
- Private Sub Jltcwg(Jlbrec As ADODB.Recordset, jsqte As Long) '记录内容填充网格
- With Jlbrec
- WglrGrid.TextMatrix(jsqte, 0) = "*" '行标识
- WglrGrid.TextMatrix(jsqte, Sydz("001", GridStr(), Szzls)) = Trim(.Fields("ItemCode") & "") '项目编码
- WglrGrid.TextMatrix(jsqte, Sydz("002", GridStr(), Szzls)) = Trim(.Fields("ItemName") & "") '项目名称
- WglrGrid.TextMatrix(jsqte, Sydz("003", GridStr(), Szzls)) = Trim(.Fields("UnitName") & "") '计量单位
- WglrGrid.TextMatrix(jsqte, Sydz("004", GridStr(), Szzls)) = Trim(.Fields("PlanUnitPrice") & "") '单位定额
- WglrGrid.TextMatrix(jsqte, Sydz("005", GridStr(), Szzls)) = Trim(.Fields("PlanQuantity") & "") '单位定额
- WglrGrid.TextMatrix(jsqte, Sydz("006", GridStr(), Szzls)) = Trim(.Fields("PlanMoney") & "") '单位定额
- WglrGrid.TextMatrix(jsqte, Sydz("007", GridStr(), Szzls)) = Trim(.Fields("PreMonAmount") & "") '本月实耗
- WglrGrid.TextMatrix(jsqte, Sydz("008", GridStr(), Szzls)) = Trim(.Fields("PreMonMoney") & "") '本月实耗
- WglrGrid.TextMatrix(jsqte, Sydz("009", GridStr(), Szzls)) = Trim(.Fields("ThmonAmount") & "") '本月实耗
- WglrGrid.TextMatrix(jsqte, Sydz("010", GridStr(), Szzls)) = Trim(.Fields("ThmonMoney") & "") '本月实耗
- WglrGrid.TextMatrix(jsqte, Sydz("011", GridStr(), Szzls)) = Trim(.Fields("ThmonInvAmount") & "") '本月实耗
- WglrGrid.TextMatrix(jsqte, Sydz("012", GridStr(), Szzls)) = Trim(.Fields("ThmonInvMoney") & "") '本月实耗
- WglrGrid.TextMatrix(jsqte, Sydz("013", GridStr(), Szzls)) = Trim(.Fields("ThmonConsumeAmount") & "") '本月实耗
- WglrGrid.TextMatrix(jsqte, Sydz("014", GridStr(), Szzls)) = Trim(.Fields("ThmonConsumeMoney") & "") '本月实耗
- WglrGrid.TextMatrix(jsqte, Sydz("015", GridStr(), Szzls)) = Trim(.Fields("ThMonFactUnAmount") & "") '实单耗
- WglrGrid.TextMatrix(jsqte, Sydz("016", GridStr(), Szzls)) = Trim(.Fields("ThMonFactUnMoney") & "") '实单耗
- WglrGrid.TextMatrix(jsqte, Sydz("017", GridStr(), Szzls)) = Trim(.Fields("TotalConsumeAmount") & "") '累计成本
- WglrGrid.TextMatrix(jsqte, Sydz("018", GridStr(), Szzls)) = Trim(.Fields("TotalConsumeMoney") & "") '累计成本
- WglrGrid.TextMatrix(jsqte, Sydz("019", GridStr(), Szzls)) = Trim(.Fields("TotalConsumeUnAmount") & "") '累计成本
- WglrGrid.TextMatrix(jsqte, Sydz("020", GridStr(), Szzls)) = Trim(.Fields("TotalConsumeUnMoney") & "") '累计成本
- WglrGrid.TextMatrix(jsqte, Sydz("021", GridStr(), Szzls)) = Trim(.Fields("ThMonRatioAmount") & "") '月份与计划比(+/-)
- WglrGrid.TextMatrix(jsqte, Sydz("022", GridStr(), Szzls)) = Trim(.Fields("ThMonRatioMoney") & "") '月份与计划比(+/-)
- WglrGrid.TextMatrix(jsqte, Sydz("023", GridStr(), Szzls)) = Trim(.Fields("TotalRatioAmount") & "") '累计与计划比(+/-)
- WglrGrid.TextMatrix(jsqte, Sydz("024", GridStr(), Szzls)) = Trim(.Fields("TotalRatioMoney") & "") '累计与计划比(+/-)
- End With
- End Sub
- Private Sub Tlb_Action_ButtonClick(ByVal Button As MSComctlLib.Button) '用户点击工具条
- '屏蔽文本框,下拉组合框有效性判断,即在网格单元内录入数据时,点帮助信息等,不执行文本框等验证,即不执行YdText或YdCombo的LostFocus事件.
- Valilock = True
- '屏蔽网格失去焦点产生的有效性判断
- Changelock = True
- Select Case Button.Key
- Case "ymsz" '页面设置
- Dyymctbl.Show 1
- Case "yl" '预 览
- Call bbyl(True)
- Case "dy" '打 印
- Call bbyl(False)
- Case "bz" '帮 助
- Call F1bz
- Case "fh" '退 出
- Unload Me
- End Select
- '解 锁
- Valilock = False
- Changelock = False
- End Sub
- Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer) '支持热键操作,更确切地讲,是工具栏热键
- If Shift = 2 Then 'Ctrl的位屏蔽值=2
- Select Case UCase(Chr(KeyCode))
- Case "P" 'Ctrl+P 打印
- If Tlb_Action.Buttons("dy").Enabled Then Call bbyl(False)
- End Select
- End If
- End Sub
- Private Sub Sub_OperStatus(Str_Status As String) '工具条依据不同状态所进行的变化
- With Tlb_Action
- Select Case Str_Status
- Case "10" '浏览(系统进入、放弃新增单据、填制凭证时删除单据,凭证审核)
- '工具条
- '.Buttons("dy").Enabled = False '打印
- '.Buttons("yl").Enabled = False '预览
- Case "11" '浏览(放弃修改单据,查询单据)
- '工具条
- .Buttons("dy").Enabled = True '打印
- .Buttons("yl").Enabled = True '预览
- .Buttons("xg").Enabled = True '修改
- .Buttons("Auto").Enabled = True '自动填充
- Case "30" '修改
- '工具条
- .Buttons("dy").Enabled = False '打印
- .Buttons("yl").Enabled = False '预览
- .Buttons("xg").Enabled = False '修改
- .Buttons("Auto").Enabled = False '自动填充
- End Select
- End With
- End Sub
- Private Sub WglrGrid_EnterCell() '显示当前数据行相关信息
- With WglrGrid
- If .Row >= .FixedRows Then
- Lab_Row = Trim(Str(.Row - .FixedRows + 1))
- End If
- End With
- End Sub
- Private Sub WglrGrid_GotFocus() '网格得到焦点
- '网格得到焦点,如果当前选择行为非数据行
- '则调整当前焦点至有效数据行
- With WglrGrid
- If .Row < .FixedRows And .Rows > .FixedRows Then
- Changelock = True
- .Select .FixedRows, .Col
- Changelock = False
- End If
- If .Col < Qslz Then
- Changelock = True
- .Select .Row, Qslz
- Changelock = False
- End If
- End With
- End Sub
- Private Sub GsToolbar_ButtonClick(ByVal Button As MSComctlLib.Button) '表格格式设置(通用)
- Select Case Button.Key
- Case "bcgs" '保存表格格式
- Call Bcwggs(WglrGrid, GridCode, GridStr())
- Case "hfmrgs" '恢复默认格式
- Call Hfmrgs(WglrGrid, GridCode, GridStr())
- Case "szxsxm" '设置显示项目
- Call Szxsxm(WglrGrid, GridCode)
- End Select
- End Sub
- Private Sub bbyl(bbylte As Boolean) '打印预览(通用)
- Dim Bbzbt$, Bbxbt() As String, bbxbtzzxs() As Integer, Bbxbtgs As Integer
- Dim Bbbwh() As String, Bbbwhzzxs() As Integer, Bbbwhgs As Integer
- Bbxbtgs = 1 '报 表 小 标 题 行 数
- Bbbwhgs = 1 '报 表 表 尾 行 数
- ReDim Bbxbt(1 To Bbxbtgs)
- ReDim bbxbtzzxs(1 To Bbxbtgs)
- If Bbbwhgs <> 0 Then
- ReDim Bbbwh(1 To Bbbwhgs)
- ReDim Bbbwhzzxs(1 To Bbbwhgs)
- End If
- Bbzbt = ReportTitle
- '报表行组织形式(0-居左 1-居中 2-居右)
- bbxbtzzxs(1) = 0
- '报表行组织形式(0-居左 1-居中 2-居右)
- If Cbo_Object.ListCount > 0 Then
- Bbxbt(1) = Space(2) + Fun_FormatOutPut("成本对象:" + Right(Trim(Cbo_Object.List(Cbo_Object.ListIndex)), Len(Trim(Cbo_Object.List(Cbo_Object.ListIndex))) - 2), 95)
- Bbxbt(1) = Bbxbt(1) + Fun_FormatOutPut(Mid(CStr(Combo_KJQJ.List(Combo_KJQJ.ListIndex)), 1, 4) + "年" + Right(CStr(Combo_KJQJ.List(Combo_KJQJ.ListIndex)), 2) + "月", 35)
- Bbxbt(1) = Bbxbt(1) + "月产量:" + Lab_YCL.Caption + Space(3) + "累计产量:" + Lab_LJCL.Caption + Space(3) + "单位:" + Lab_DW.Caption
- Else
- Bbxbt(1) = Space(2) + "成本对象:"
- End If
- Call Scyxsjb(WglrGrid) '生成报表数据
- Call Scdybb(Dyymctbl, Bbzbt, Bbxbt(), bbxbtzzxs(), Bbxbtgs, Bbbwh(), Bbbwhzzxs(), Bbbwhgs, bbylte)
- If Not bbylte Then
- Unload DY_Tybbyldy
- End If
- End Sub
- Sub Sub_CostObject() '显示对象
- SqlStr = " Select Objectcode,ObjectName From Cb_CostObject"
- Set RecTemp = Cw_DataEnvi.DataConnect.Execute(SqlStr)
- Cbo_Object.Clear
- If Not RecTemp.EOF Then
- ReDim Pr_ObjectCode(RecTemp.RecordCount - 1)
- Do Until RecTemp.EOF
- Cbo_Object.AddItem Trim(RecTemp(0)) + Trim(RecTemp(1))
- Pr_ObjectCode(Cbo_Object.NewIndex) = Trim(RecTemp(0))
- RecTemp.MoveNext
- Loop
- End If
- If Cbo_Object.ListCount >= 1 Then
- Cbo_Object.ListIndex = 0
- End If
- End Sub
- Sub GridHidden(Bz As Integer) '调整网格
- For Int_Coljsq = 0 To WglrGrid.Cols - 1
- WglrGrid.ColHidden(Int_Coljsq) = True
- Next Int_Coljsq
- Select Case Bz
- Case 0
- 'ReportTitle = "生 产 费 用 表(股份分司)"
- WglrGrid.ColHidden(Sydz("002", GridStr(), Szzls)) = False
- WglrGrid.ColHidden(Sydz("003", GridStr(), Szzls)) = False
- WglrGrid.ColHidden(Sydz("004", GridStr(), Szzls)) = False
- WglrGrid.ColHidden(Sydz("005", GridStr(), Szzls)) = False
- WglrGrid.ColHidden(Sydz("006", GridStr(), Szzls)) = False
- WglrGrid.ColHidden(Sydz("007", GridStr(), Szzls)) = False
- WglrGrid.ColHidden(Sydz("008", GridStr(), Szzls)) = False
- WglrGrid.ColHidden(Sydz("009", GridStr(), Szzls)) = False
- WglrGrid.ColHidden(Sydz("010", GridStr(), Szzls)) = False
- WglrGrid.ColHidden(Sydz("011", GridStr(), Szzls)) = False
- WglrGrid.ColHidden(Sydz("012", GridStr(), Szzls)) = False
- WglrGrid.ColHidden(Sydz("013", GridStr(), Szzls)) = False
- WglrGrid.ColHidden(Sydz("014", GridStr(), Szzls)) = False
- WglrGrid.ColHidden(Sydz("015", GridStr(), Szzls)) = False
- WglrGrid.ColHidden(Sydz("016", GridStr(), Szzls)) = False
- WglrGrid.ColHidden(Sydz("017", GridStr(), Szzls)) = False
- WglrGrid.ColHidden(Sydz("018", GridStr(), Szzls)) = False
- WglrGrid.ColHidden(Sydz("019", GridStr(), Szzls)) = False
- WglrGrid.ColHidden(Sydz("020", GridStr(), Szzls)) = False
- WglrGrid.ColHidden(Sydz("021", GridStr(), Szzls)) = False
- WglrGrid.ColHidden(Sydz("022", GridStr(), Szzls)) = False
- WglrGrid.ColHidden(Sydz("023", GridStr(), Szzls)) = False
- WglrGrid.ColHidden(Sydz("024", GridStr(), Szzls)) = False
- Case 1
- 'ReportTitle = "生 产 费 用 核 算 表(股份分司)"
- WglrGrid.ColHidden(Sydz("002", GridStr(), Szzls)) = False
- WglrGrid.ColHidden(Sydz("003", GridStr(), Szzls)) = False
- WglrGrid.ColHidden(Sydz("004", GridStr(), Szzls)) = False
- WglrGrid.ColHidden(Sydz("005", GridStr(), Szzls)) = False
- WglrGrid.ColHidden(Sydz("006", GridStr(), Szzls)) = False
- WglrGrid.ColHidden(Sydz("007", GridStr(), Szzls)) = False
- WglrGrid.ColHidden(Sydz("008", GridStr(), Szzls)) = False
- WglrGrid.ColHidden(Sydz("009", GridStr(), Szzls)) = False
- WglrGrid.ColHidden(Sydz("010", GridStr(), Szzls)) = False
- WglrGrid.ColHidden(Sydz("011", GridStr(), Szzls)) = False
- WglrGrid.ColHidden(Sydz("012", GridStr(), Szzls)) = False
- WglrGrid.ColHidden(Sydz("013", GridStr(), Szzls)) = False
- WglrGrid.ColHidden(Sydz("014", GridStr(), Szzls)) = False
- WglrGrid.ColHidden(Sydz("015", GridStr(), Szzls)) = False
- WglrGrid.ColHidden(Sydz("016", GridStr(), Szzls)) = False
- Case 2
- 'ReportTitle = "生 产 费 用 分 析 表(股份分司)"
- WglrGrid.ColHidden(Sydz("002", GridStr(), Szzls)) = False
- WglrGrid.ColHidden(Sydz("003", GridStr(), Szzls)) = False
- WglrGrid.ColHidden(Sydz("017", GridStr(), Szzls)) = False
- WglrGrid.ColHidden(Sydz("018", GridStr(), Szzls)) = False
- WglrGrid.ColHidden(Sydz("019", GridStr(), Szzls)) = False
- WglrGrid.ColHidden(Sydz("020", GridStr(), Szzls)) = False
- WglrGrid.ColHidden(Sydz("021", GridStr(), Szzls)) = False
- WglrGrid.ColHidden(Sydz("022", GridStr(), Szzls)) = False
- WglrGrid.ColHidden(Sydz("023", GridStr(), Szzls)) = False
- WglrGrid.ColHidden(Sydz("024", GridStr(), Szzls)) = False
- End Select
- End Sub
- Sub Lab_List() 'Lab数据
- '单位
- SqlStr = "Select UnitName From Cb_CostObject A " _
- & "Left Outer Join Gy_UnitSet B On A.MeasureUnitCode=B.UnitCode " _
- & "Where A.ObjectCode='" + Pr_ObjectCode(Cbo_Object.ListIndex) + "'"
- Set RecTemp = Cw_DataEnvi.DataConnect.Execute(SqlStr)
- If Not RecTemp.EOF Then
- Lab_DW = RecTemp.Fields("UnitName") & ""
- Else
- Lab_DW = ""
- End If
- '月产量
- SqlStr = "Select Quantity From Cb_ObjectComplete Where ObjectCode='" + Pr_ObjectCode(Cbo_Object.ListIndex) + "' " _
- & "And Year='" + CStr(PrivateYear) + "' And Period='" + CStr(PrivateMm) + "'"
- Set RecTemp = Cw_DataEnvi.DataConnect.Execute(SqlStr)
- If Not RecTemp.EOF Then
- Lab_YCL = Format(RecTemp.Fields("Quantity"), "0.0000")
- Else
- Lab_YCL = "0.0000"
- End If
- '累计产量
- SqlStr = "Select Sum(Quantity) As CL From Cb_ObjectComplete Where ObjectCode='" + Pr_ObjectCode(Cbo_Object.ListIndex) + "' " _
- & "And Year='" + CStr(PrivateYear) + "' And Period<='" + CStr(PrivateMm) + "'"
- Set RecTemp = Cw_DataEnvi.DataConnect.Execute(SqlStr)
- If Not RecTemp.EOF Then
- Lab_LJCL.Caption = Format(RecTemp.Fields("CL"), "0.0000")
- Else
- Lab_LJCL.Caption = "0.0000"
- End If
- End Sub
- Sub WriteCostData(RecTemp As ADODB.Recordset) '写入成本数据
- If Trim(RecTemp.Fields("ObjectCode")) & "" <> "" Then
- With Cxnrrec
- Cw_DataEnvi.DataConnect.Execute ("Delete From Cb_Sccbb Where ObjectCode='" & Trim(RecTemp.Fields("ObjectCode")) & "' And ItemCode='" & RecTemp.Fields("ItemCode") & "' And Year='" & PrivateYear & "' And Period='" & PrivateMm & "'")
- If .State = 1 Then .Close
- .Open "Select * From Cb_Sccbb Where 1=2", Cw_DataEnvi.DataConnect, adOpenDynamic, adLockOptimistic
- .AddNew
- .Fields("Objectcode") = Trim(RecTemp.Fields("Objectcode")) '对象编码
- .Fields("ItemCode") = Trim(RecTemp.Fields("ItemCode")) '项目编码
- .Fields("ParentCode") = Trim(RecTemp.Fields("ParentCode")) '一级编码
- .Fields("Year") = Trim(RecTemp.Fields("Year")) '会计年度
- .Fields("Period") = Trim(RecTemp.Fields("Period")) '会计期间
- .Fields("UnitCode") = Trim(RecTemp.Fields("UnitCode")) '单位编码
- .Fields("PlanUnitPrice") = Trim(RecTemp.Fields("PlanUnitPrice")) '计划单价
- .Fields("PlanQuantity") = Trim(RecTemp.Fields("PlanQuantity")) '计划数量
- .Fields("PlanMoney") = Trim(RecTemp.Fields("PlanMoney")) '计划成本
- .Fields("PreMonAmount") = Trim(RecTemp.Fields("PreMonAmount")) '本月实耗
- .Fields("PreMonMoney") = Trim(RecTemp.Fields("PreMonMoney")) '本月实耗
- .Fields("ThmonAmount") = Trim(RecTemp.Fields("ThmonAmount")) '本月实耗
- .Fields("ThmonMoney") = Trim(RecTemp.Fields("ThmonMoney")) '本月实耗
- .Fields("ThmonInvAmount") = Trim(RecTemp.Fields("ThmonInvAmount")) '本月实耗
- .Fields("ThmonInvMoney") = Trim(RecTemp.Fields("ThmonInvMoney")) '本月实耗
- .Fields("ThmonConsumeAmount") = Trim(RecTemp.Fields("ThmonConsumeAmount")) '本月实耗
- .Fields("ThmonConsumeMoney") = Trim(RecTemp.Fields("ThmonConsumeMoney")) '本月实耗
- .Fields("ThmonFactunAmount") = Trim(RecTemp.Fields("ThMonFactUnAmount")) '实单耗
- .Fields("ThmonFactunMoney") = Trim(RecTemp.Fields("ThMonFactUnMoney")) '实单耗
- .Fields("TotalConsumeAmount") = Trim(RecTemp.Fields("TotalConsumeAmount")) '累计成本
- .Fields("TotalConsumeMoney") = Trim(RecTemp.Fields("TotalConsumeMoney")) '累计成本
- .Fields("TotalConsumeUnAmount") = Trim(RecTemp.Fields("TotalConsumeUnAmount")) '单位成本
- .Fields("TotalConsumeUnMoney") = Trim(RecTemp.Fields("TotalConsumeUnMoney")) '单位成本
- .Fields("ThmonRatioAmount") = Trim(RecTemp.Fields("ThMonRatioAmount")) '月份与计划比
- .Fields("ThmonRatioMoney") = Trim(RecTemp.Fields("ThMonRatioMoney")) '月份与计划比
- .Fields("TotalRatioAmount") = Trim(RecTemp.Fields("TotalRatioAmount")) '累计与计划比
- .Fields("TotalRatioMoney") = Trim(RecTemp.Fields("TotalRatioMoney")) '累计与计划比
- .Fields("IsSum") = RecTemp.Fields("IsShow") '显示否
- .Fields("IsShow") = RecTemp.Fields("IsSum") '计算否
- .Update
- End With
- End If
- End Sub
- Sub ShowCostReport() '显示报表明细数据
- '会计日历
- SqlStr = "Select Count(*) From gy_kjrlb where kjyear='" + Trim(Str(PrivateYear)) + "' And Period='" + CStr(PrivateMm) + "' " _
- & "And CwzzJzbz='1'"
- Set RecTemp = Cw_DataEnvi.DataConnect.Execute(SqlStr)
- If RecTemp.Fields(0) > 0 Then
- '显示数据
- Call Sub_ShowBill(1)
- Else
- '显示数据
- Call Sub_ShowBill(0)
- End If
- End Sub