上传用户:zhpu1995
上传日期:2013-09-06
资源大小:61151k
文件大小:39k
源码类别:

企业管理

开发平台:

Visual Basic

  1. VERSION 5.00
  2. Object = "{BEEECC20-4D5F-4F8B-BFDC-5D9B6FBDE09D}#1.0#0"; "vsflex8.ocx"
  3. Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomctl.ocx"
  4. Begin VB.Form PZ_FrmPzhzjg 
  5.    Caption         =   "凭证汇总表"
  6.    ClientHeight    =   8595
  7.    ClientLeft      =   315
  8.    ClientTop       =   390
  9.    ClientWidth     =   11820
  10.    HelpContextID   =   5001
  11.    Icon            =   "凭证处理_凭证汇总结果.frx":0000
  12.    KeyPreview      =   -1  'True
  13.    LinkTopic       =   "Form1"
  14.    MDIChild        =   -1  'True
  15.    ScaleHeight     =   8595
  16.    ScaleWidth      =   11820
  17.    WindowState     =   2  'Maximized
  18.    Begin VB.Timer Timer1 
  19.       Enabled         =   0   'False
  20.       Interval        =   1
  21.       Left            =   7620
  22.       Top             =   90
  23.    End
  24.    Begin VB.PictureBox Pic_Title 
  25.       Height          =   1095
  26.       Left            =   60
  27.       Picture         =   "凭证处理_凭证汇总结果.frx":1042
  28.       ScaleHeight     =   1035
  29.       ScaleWidth      =   11535
  30.       TabIndex        =   0
  31.       Top             =   660
  32.       Width           =   11595
  33.       Begin VB.Label Lab_TitleText 
  34.          AutoSize        =   -1  'True
  35.          BackStyle       =   0  'Transparent
  36.          ForeColor       =   &H00000000&
  37.          Height          =   180
  38.          Index           =   2
  39.          Left            =   6720
  40.          TabIndex        =   9
  41.          Top             =   780
  42.          Width           =   2160
  43.       End
  44.       Begin VB.Label Lab_TitleMess 
  45.          AutoSize        =   -1  'True
  46.          BackStyle       =   0  'Transparent
  47.          Caption         =   "凭证号:"
  48.          Height          =   180
  49.          Index           =   2
  50.          Left            =   5940
  51.          TabIndex        =   8
  52.          Top             =   780
  53.          Width           =   630
  54.       End
  55.       Begin VB.Label Lab_TitleMess 
  56.          AutoSize        =   -1  'True
  57.          BackStyle       =   0  'Transparent
  58.          Caption         =   "凭证范围:"
  59.          Height          =   180
  60.          Index           =   1
  61.          Left            =   2820
  62.          TabIndex        =   7
  63.          Top             =   780
  64.          Width           =   810
  65.       End
  66.       Begin VB.Label Lab_TitleText 
  67.          AutoSize        =   -1  'True
  68.          BackStyle       =   0  'Transparent
  69.          ForeColor       =   &H00000000&
  70.          Height          =   180
  71.          Index           =   1
  72.          Left            =   3780
  73.          TabIndex        =   6
  74.          Top             =   780
  75.          Width           =   2010
  76.       End
  77.       Begin VB.Label Lab_Color 
  78.          Appearance      =   0  'Flat
  79.          BackColor       =   &H00F7F3EC&
  80.          BorderStyle     =   1  'Fixed Single
  81.          ForeColor       =   &H80000008&
  82.          Height          =   195
  83.          Index           =   0
  84.          Left            =   9990
  85.          TabIndex        =   5
  86.          Top             =   270
  87.          Width           =   195
  88.       End
  89.       Begin VB.Label Label1 
  90.          Appearance      =   0  'Flat
  91.          BackColor       =   &H80000005&
  92.          BackStyle       =   0  'Transparent
  93.          Caption         =   "科目类别合计"
  94.          ForeColor       =   &H80000008&
  95.          Height          =   195
  96.          Index           =   2
  97.          Left            =   10230
  98.          TabIndex        =   4
  99.          Top             =   300
  100.          Width           =   1155
  101.       End
  102.       Begin VB.Label Lab_TitleText 
  103.          AutoSize        =   -1  'True
  104.          BackStyle       =   0  'Transparent
  105.          ForeColor       =   &H00000000&
  106.          Height          =   180
  107.          Index           =   0
  108.          Left            =   1980
  109.          TabIndex        =   3
  110.          Top             =   780
  111.          Width           =   750
  112.       End
  113.       Begin VB.Label Lab_TitleMess 
  114.          AutoSize        =   -1  'True
  115.          BackStyle       =   0  'Transparent
  116.          Caption         =   "会计期间:"
  117.          Height          =   180
  118.          Index           =   0
  119.          Left            =   1020
  120.          TabIndex        =   2
  121.          Top             =   780
  122.          Width           =   810
  123.       End
  124.       Begin VB.Label tsLabel 
  125.          AutoSize        =   -1  'True
  126.          BackColor       =   &H80000018&
  127.          BackStyle       =   0  'Transparent
  128.          Caption         =   "凭证汇总表"
  129.          BeginProperty Font 
  130.             Name            =   "宋体"
  131.             Size            =   12
  132.             Charset         =   134
  133.             Weight          =   700
  134.             Underline       =   0   'False
  135.             Italic          =   0   'False
  136.             Strikethrough   =   0   'False
  137.          EndProperty
  138.          ForeColor       =   &H00000000&
  139.          Height          =   240
  140.          Index           =   4
  141.          Left            =   480
  142.          TabIndex        =   1
  143.          Top             =   240
  144.          Width           =   1275
  145.       End
  146.    End
  147.    Begin MSComctlLib.Toolbar GsToolbar 
  148.       Height          =   525
  149.       Left            =   9330
  150.       TabIndex        =   10
  151.       Top             =   0
  152.       Width           =   2475
  153.       _ExtentX        =   4366
  154.       _ExtentY        =   926
  155.       ButtonWidth     =   1455
  156.       ButtonHeight    =   926
  157.       AllowCustomize  =   0   'False
  158.       Appearance      =   1
  159.       Style           =   1
  160.       ImageList       =   "ImageList1"
  161.       _Version        =   393216
  162.       BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  163.          NumButtons      =   3
  164.          BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  165.             Caption         =   "保存格式"
  166.             Key             =   "bcgs"
  167.             ImageKey        =   "bcgs"
  168.          EndProperty
  169.          BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  170.             Caption         =   "默认列宽"
  171.             Key             =   "hfmrgs"
  172.             ImageKey        =   "mrlk"
  173.          EndProperty
  174.          BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  175.             Caption         =   "显示项目"
  176.             Key             =   "szxsxm"
  177.             ImageKey        =   "xsxm"
  178.          EndProperty
  179.       EndProperty
  180.    End
  181.    Begin VSFlex8Ctl.VSFlexGrid CxbbGrid 
  182.       Height          =   6885
  183.       Left            =   60
  184.       TabIndex        =   11
  185.       Top             =   1800
  186.       Width           =   11715
  187.       _cx             =   5080
  188.       _cy             =   5080
  189.       Appearance      =   1
  190.       BorderStyle     =   1
  191.       Enabled         =   -1  'True
  192.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  193.          Name            =   "宋体"
  194.          Size            =   9
  195.          Charset         =   134
  196.          Weight          =   400
  197.          Underline       =   0   'False
  198.          Italic          =   0   'False
  199.          Strikethrough   =   0   'False
  200.       EndProperty
  201.       MousePointer    =   0
  202.       BackColor       =   16777215
  203.       ForeColor       =   -2147483640
  204.       BackColorFixed  =   12632256
  205.       ForeColorFixed  =   -2147483630
  206.       BackColorSel    =   -2147483635
  207.       ForeColorSel    =   -2147483634
  208.       BackColorBkg    =   -2147483636
  209.       BackColorAlternate=   16777215
  210.       GridColor       =   -2147483633
  211.       GridColorFixed  =   -2147483632
  212.       TreeColor       =   -2147483632
  213.       FloodColor      =   192
  214.       SheetBorder     =   -2147483642
  215.       FocusRect       =   1
  216.       HighLight       =   1
  217.       AllowSelection  =   -1  'True
  218.       AllowBigSelection=   -1  'True
  219.       AllowUserResizing=   0
  220.       SelectionMode   =   0
  221.       GridLines       =   1
  222.       GridLinesFixed  =   2
  223.       GridLineWidth   =   1
  224.       Rows            =   50
  225.       Cols            =   10
  226.       FixedRows       =   1
  227.       FixedCols       =   1
  228.       RowHeightMin    =   0
  229.       RowHeightMax    =   0
  230.       ColWidthMin     =   0
  231.       ColWidthMax     =   0
  232.       ExtendLastCol   =   0   'False
  233.       FormatString    =   ""
  234.       ScrollTrack     =   0   'False
  235.       ScrollBars      =   3
  236.       ScrollTips      =   0   'False
  237.       MergeCells      =   0
  238.       MergeCompare    =   0
  239.       AutoResize      =   -1  'True
  240.       AutoSizeMode    =   0
  241.       AutoSearch      =   0
  242.       AutoSearchDelay =   2
  243.       MultiTotals     =   -1  'True
  244.       SubtotalPosition=   1
  245.       OutlineBar      =   0
  246.       OutlineCol      =   0
  247.       Ellipsis        =   0
  248.       ExplorerBar     =   0
  249.       PicturesOver    =   0   'False
  250.       FillStyle       =   0
  251.       RightToLeft     =   0   'False
  252.       PictureType     =   0
  253.       TabBehavior     =   0
  254.       OwnerDraw       =   0
  255.       Editable        =   0
  256.       ShowComboButton =   1
  257.       WordWrap        =   0   'False
  258.       TextStyle       =   0
  259.       TextStyleFixed  =   0
  260.       OleDragMode     =   0
  261.       OleDropMode     =   0
  262.       DataMode        =   0
  263.       VirtualData     =   -1  'True
  264.       DataMember      =   ""
  265.       ComboSearch     =   3
  266.       AutoSizeMouse   =   -1  'True
  267.       FrozenRows      =   0
  268.       FrozenCols      =   0
  269.       AllowUserFreezing=   0
  270.       BackColorFrozen =   0
  271.       ForeColorFrozen =   0
  272.       WallPaperAlignment=   9
  273.       AccessibleName  =   ""
  274.       AccessibleDescription=   ""
  275.       AccessibleValue =   ""
  276.       AccessibleRole  =   24
  277.    End
  278.    Begin MSComctlLib.Toolbar SzToolbar 
  279.       Align           =   1  'Align Top
  280.       Height          =   555
  281.       Left            =   0
  282.       TabIndex        =   12
  283.       Top             =   0
  284.       Width           =   11820
  285.       _ExtentX        =   20849
  286.       _ExtentY        =   979
  287.       ButtonWidth     =   820
  288.       ButtonHeight    =   926
  289.       AllowCustomize  =   0   'False
  290.       Appearance      =   1
  291.       Style           =   1
  292.       ImageList       =   "ImageList1"
  293.       _Version        =   393216
  294.       BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  295.          NumButtons      =   10
  296.          BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  297.             Caption         =   "设置"
  298.             Key             =   "ymsz"
  299.             ImageKey        =   "sz"
  300.          EndProperty
  301.          BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  302.             Caption         =   "打印"
  303.             Key             =   "dy"
  304.             ImageKey        =   "dy"
  305.          EndProperty
  306.          BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  307.             Caption         =   "预览"
  308.             Key             =   "yl"
  309.             ImageKey        =   "yl"
  310.          EndProperty
  311.          BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  312.             Style           =   3
  313.          EndProperty
  314.          BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  315.             Caption         =   "查询"
  316.             Key             =   "cx"
  317.             ImageKey        =   "cx"
  318.          EndProperty
  319.          BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  320.             Style           =   3
  321.          EndProperty
  322.          BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  323.             Caption         =   "刷新"
  324.             Key             =   "sx"
  325.             ImageKey        =   "sx"
  326.          EndProperty
  327.          BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  328.             Style           =   3
  329.          EndProperty
  330.          BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  331.             Caption         =   "帮助"
  332.             Key             =   "bz"
  333.             ImageKey        =   "bz"
  334.          EndProperty
  335.          BeginProperty Button10 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  336.             Caption         =   "退出"
  337.             Key             =   "fh"
  338.             ImageKey        =   "tc"
  339.          EndProperty
  340.       EndProperty
  341.       BorderStyle     =   1
  342.       Begin MSComctlLib.ImageList ImageList1 
  343.          Left            =   6900
  344.          Top             =   0
  345.          _ExtentX        =   1005
  346.          _ExtentY        =   1005
  347.          BackColor       =   -2147483643
  348.          ImageWidth      =   16
  349.          ImageHeight     =   16
  350.          MaskColor       =   12632256
  351.          _Version        =   393216
  352.          BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  353.             NumListImages   =   32
  354.             BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  355.                Picture         =   "凭证处理_凭证汇总结果.frx":35106
  356.                Key             =   "sz"
  357.             EndProperty
  358.             BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  359.                Picture         =   "凭证处理_凭证汇总结果.frx":354A0
  360.                Key             =   "dy"
  361.             EndProperty
  362.             BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  363.                Picture         =   "凭证处理_凭证汇总结果.frx":3583A
  364.                Key             =   "yl"
  365.             EndProperty
  366.             BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  367.                Picture         =   "凭证处理_凭证汇总结果.frx":35BD4
  368.                Key             =   "xg"
  369.             EndProperty
  370.             BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  371.                Picture         =   "凭证处理_凭证汇总结果.frx":35F6E
  372.                Key             =   "zh"
  373.             EndProperty
  374.             BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  375.                Picture         =   "凭证处理_凭证汇总结果.frx":36308
  376.                Key             =   "sh"
  377.             EndProperty
  378.             BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  379.                Picture         =   "凭证处理_凭证汇总结果.frx":366A2
  380.                Key             =   "bc"
  381.             EndProperty
  382.             BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  383.                Picture         =   "凭证处理_凭证汇总结果.frx":36A3C
  384.                Key             =   "fq"
  385.             EndProperty
  386.             BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  387.                Picture         =   "凭证处理_凭证汇总结果.frx":36DD6
  388.                Key             =   "bz"
  389.             EndProperty
  390.             BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  391.                Picture         =   "凭证处理_凭证汇总结果.frx":37170
  392.                Key             =   "tc"
  393.             EndProperty
  394.             BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  395.                Picture         =   "凭证处理_凭证汇总结果.frx":3750A
  396.                Key             =   "bcgs"
  397.             EndProperty
  398.             BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  399.                Picture         =   "凭证处理_凭证汇总结果.frx":378A4
  400.                Key             =   "mrlk"
  401.             EndProperty
  402.             BeginProperty ListImage13 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  403.                Picture         =   "凭证处理_凭证汇总结果.frx":37C3E
  404.                Key             =   "xsxm"
  405.             EndProperty
  406.             BeginProperty ListImage14 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  407.                Picture         =   "凭证处理_凭证汇总结果.frx":37FD8
  408.                Key             =   "first"
  409.             EndProperty
  410.             BeginProperty ListImage15 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  411.                Picture         =   "凭证处理_凭证汇总结果.frx":38372
  412.                Key             =   "prev"
  413.             EndProperty
  414.             BeginProperty ListImage16 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  415.                Picture         =   "凭证处理_凭证汇总结果.frx":3870C
  416.                Key             =   "next"
  417.             EndProperty
  418.             BeginProperty ListImage17 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  419.                Picture         =   "凭证处理_凭证汇总结果.frx":38AA6
  420.                Key             =   "last"
  421.             EndProperty
  422.             BeginProperty ListImage18 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  423.                Picture         =   "凭证处理_凭证汇总结果.frx":38E40
  424.                Key             =   "xx"
  425.             EndProperty
  426.             BeginProperty ListImage19 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  427.                Picture         =   "凭证处理_凭证汇总结果.frx":391DA
  428.                Key             =   "define"
  429.             EndProperty
  430.             BeginProperty ListImage20 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  431.                Picture         =   "凭证处理_凭证汇总结果.frx":39574
  432.                Key             =   "exec"
  433.             EndProperty
  434.             BeginProperty ListImage21 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  435.                Picture         =   "凭证处理_凭证汇总结果.frx":3990E
  436.                Key             =   "xz"
  437.             EndProperty
  438.             BeginProperty ListImage22 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  439.                Picture         =   "凭证处理_凭证汇总结果.frx":39CA8
  440.                Key             =   "sc"
  441.             EndProperty
  442.             BeginProperty ListImage23 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  443.                Picture         =   "凭证处理_凭证汇总结果.frx":3A042
  444.                Key             =   "sx"
  445.             EndProperty
  446.             BeginProperty ListImage24 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  447.                Picture         =   "凭证处理_凭证汇总结果.frx":3A3DC
  448.                Key             =   "cx"
  449.             EndProperty
  450.             BeginProperty ListImage25 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  451.                Picture         =   "凭证处理_凭证汇总结果.frx":3A776
  452.                Key             =   "zd"
  453.             EndProperty
  454.             BeginProperty ListImage26 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  455.                Picture         =   "凭证处理_凭证汇总结果.frx":3AB10
  456.                Key             =   "dz"
  457.             EndProperty
  458.             BeginProperty ListImage27 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  459.                Picture         =   "凭证处理_凭证汇总结果.frx":3AEAA
  460.                Key             =   "ph"
  461.             EndProperty
  462.             BeginProperty ListImage28 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  463.                Picture         =   "凭证处理_凭证汇总结果.frx":3B244
  464.                Key             =   "fz"
  465.             EndProperty
  466.             BeginProperty ListImage29 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  467.                Picture         =   "凭证处理_凭证汇总结果.frx":3B5DE
  468.                Key             =   "dw"
  469.             EndProperty
  470.             BeginProperty ListImage30 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  471.                Picture         =   "凭证处理_凭证汇总结果.frx":3B978
  472.                Key             =   "hf"
  473.             EndProperty
  474.             BeginProperty ListImage31 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  475.                Picture         =   "凭证处理_凭证汇总结果.frx":3BD12
  476.                Key             =   "pz"
  477.             EndProperty
  478.             BeginProperty ListImage32 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  479.                Picture         =   "凭证处理_凭证汇总结果.frx":3C0AC
  480.                Key             =   "check"
  481.             EndProperty
  482.          EndProperty
  483.       End
  484.    End
  485. End
  486. Attribute VB_Name = "PZ_FrmPzhzjg"
  487. Attribute VB_GlobalNameSpace = False
  488. Attribute VB_Creatable = False
  489. Attribute VB_PredeclaredId = True
  490. Attribute VB_Exposed = False
  491. '**************************************************
  492. '*    模 块 名 称 :凭证汇总表
  493. '*    功 能 描 述 :
  494. '*    程序员姓名  : 张建忠
  495. '*    最后修改人  :奚俊峰
  496. '*    最后修改时间:2001/12/27
  497. '*    备        注:程序中所有依实际情况自定义部分均用[>>  <<]括起
  498. '**************************************************
  499. Dim ReportTitle As String                '报表主标题
  500. Dim Int_CodeScheme() As Integer          '会计科目编码方案
  501. Dim Int_CodeLev As Integer               '会计科目编码级数
  502. '以下为固定使用变量
  503. Dim Dyymctbl As New DY_Dyymsz            '打印页面窗体变量
  504. Dim GridCode As String                   '显示网格网格代码
  505. Dim GridInf() As Variant                 '整个网格设置信息
  506. Dim Tsxx As String                       '系统提示信息
  507. Dim Qslz As Long                         '网格隐藏(非操作显示)列数
  508. Dim Sjhgd As Double                      '网格数据行高度
  509. Dim Sfxshjwg As Boolean                  '是否显示合计网格
  510. Dim GridBoolean() As Boolean             '网格列信息(布尔型)
  511. Dim GridStr()  As String                 '网格列信息(字符型)
  512. Dim GridInt() As Integer                 '网格列信息(整型)
  513. Dim Szzls As Integer                     '数组总列数(网格列数-1)
  514. Private Sub Form_Resize()                '根据窗体大小来调整网格,标题栏大小
  515.     On Error Resume Next
  516.     With CxbbGrid
  517.         .Width = Me.Width - 160
  518.         .Height = Me.Height - .Top - 400
  519.     End With
  520.     With Pic_Title
  521.         .Width = Me.Width - 160
  522.     End With
  523.     
  524.     GsToolbar.Left = Me.Width - GsToolbar.Width - 140
  525. End Sub
  526. Private Sub Form_Load()                                                   '窗体装入
  527.     
  528.     '调入打印页面设置窗体
  529.     
  530.     XtReportCode = "Cwzz_jzpzhz"
  531.     Load Dyymctbl
  532.     ReportTitle = "凭证汇总表"
  533.     
  534.     '调整标题栏及网格、格式工具条位置
  535.     Pic_Title.Left = 40
  536.     Pic_Title.Top = SzToolbar.Top + SzToolbar.Height - 10
  537.     CxbbGrid.Left = Pic_Title.Left
  538.     CxbbGrid.Top = Pic_Title.Top + Pic_Title.Height + 20
  539.     
  540.     '调 入 网 格
  541.     GridCode = "Cwzz_jzpzhz"
  542.     Call BzWgcsh(CxbbGrid, GridCode, GridInf(), GridBoolean(), GridInt(), GridStr())
  543.     
  544.     Qslz = GridInf(1)
  545.     Sjhgd = GridInf(2)
  546.     Sfxshjwg = GridInf(7)
  547.     Szzls = CxbbGrid.Cols - 1
  548.     
  549.     '读入科目编码方案
  550.     Call Sub_CodeScheme("Cwzz_Kmcode", Int_CodeLev, Int_CodeScheme())
  551.     
  552.     SetTitlePos tsLabel(4)
  553.     
  554. End Sub
  555. Private Sub Form_Unload(Cancel As Integer)                                  '窗体卸载
  556.     '卸载条件窗体
  557.     PZ_FrmPzhztj.UnloadCheck.Value = 1
  558.     Unload PZ_FrmPzhztj
  559.     '卸载打印页面设置窗体
  560.     Unload Dyymctbl
  561. End Sub
  562. Private Sub GsToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)       '网格格式调整
  563.     Select Case Button.Key
  564.     Case "bcgs"                                          '保存表格格式
  565.         Call Bcwggs(CxbbGrid, GridCode, GridStr)
  566.     Case "hfmrgs"                                        '恢复默认格式
  567.         Call Hfmrgs(CxbbGrid, GridCode, GridStr)
  568.     Case "szxsxm"                                        '设置显示项目
  569.         Call Szxsxm(CxbbGrid, GridCode)
  570.     End Select
  571. End Sub
  572. Private Sub SzToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)
  573.     Select Case Button.Key
  574.     Case "ymsz"                                          '页面设置
  575.         Dyymctbl.Show 1
  576.     Case "yl"                                            '预 览
  577.         Call bbyl(True)
  578.     Case "dy"                                            '打 印
  579.         Call bbyl(False)
  580.     Case "cx"                                            '查 询
  581.         PZ_FrmPzhztj.Show 1
  582.     Case "sx"                                            '刷 新
  583.         Call Timer1_Timer
  584.     Case "bz"                                            '帮 助
  585.         Call F1bz
  586.     Case "fh"                                            '退 出
  587.         Unload Me
  588.     End Select
  589. End Sub
  590. Private Sub Timer1_Timer()                                 '在窗体激活后调入查询程序
  591.     Timer1.Enabled = False
  592.     Xt_Wait.Show
  593.     Xt_Wait.Refresh
  594.     CxbbGrid.Redraw = True
  595.     
  596.     '加快显示速度
  597.     CxbbGrid.Redraw = False
  598.     
  599.     '生成查询结果
  600.     Call Sub_Query
  601.     
  602.     CxbbGrid.Redraw = True
  603.     
  604.     Xt_Wait.Hide
  605. End Sub
  606. Private Sub Sub_Query()                                    '生成查询结果
  607.     Dim Rec_Query As New ADODB.Recordset        '查询结果动态集
  608.     Dim RecTemp As New ADODB.Recordset          '临时使用动态集
  609.     Dim Str_QueryCondi As String                '用户录入查询条件
  610.     Dim Sqlstr As String                        '查询字符串
  611.     Dim Coljsq As Long                          '网格列计数器
  612.     Dim Jsqte As Long                           '临时动态计数器
  613.     Dim Int_LevTe As Integer                    '编码级数计数器
  614.     Dim Str_Parent As String                    '上级科目号
  615.     Dim Lng_ParCol As Long                      '上级科目所在列
  616.     Dim Str_CclassIndex As String               '科目类别索引号
  617.     Dim Int_VouchNoMax As Integer               '实际最大凭证号
  618.     Dim Int_VouchNoMin As Integer               '实际最小凭证号
  619.     
  620.     '以下为用户自定义部分[
  621.     
  622.     With PZ_FrmPzhztj
  623.         
  624.         '显示查询条件
  625.         
  626.         Lab_TitleText(0).Caption = .Combo_Kjqj.Text   '会计期间
  627.         
  628.         If Trim(.Imgebo_VouchClass.Text) <> "" Then   '凭证范围
  629.             Lab_TitleText(1).Caption = .Combo_Pzfw.Text & Mid(Trim(.Imgebo_VouchClass.Text), Len(Trim(GetComboKey(.Imgebo_VouchClass, 0))) + 1, Len(Trim(.Imgebo_VouchClass.Text)))
  630.         Else
  631.             Lab_TitleText(1).Caption = .Combo_Pzfw.Text
  632.         End If
  633.         
  634.         Str_QueryCondi = " where 1=1 "
  635.         For Jsqte = 1 To 26
  636.             Select Case Jsqte
  637.                 
  638.             Case 1   '凭证范围
  639.                 Select Case Trim(.Combo_Pzfw.Text)
  640.                 Case "未记帐凭证"
  641.                     Str_QueryCondi = Str_QueryCondi & " and BookFlag=0"
  642.                 Case "记帐凭证"
  643.                     Str_QueryCondi = Str_QueryCondi & " and BookFlag=1"
  644.                 End Select
  645.                 
  646.             Case 2   '凭证类别
  647.                 If GetComboKey(.Imgebo_VouchClass, 0) <> "" Then
  648.                     Str_QueryCondi = Str_QueryCondi & " and VouchClassCode='" & Trim(GetComboKey(.Imgebo_VouchClass, 0)) & "'"
  649.                 End If
  650.                 
  651.             Case 3   '会计期间
  652.                 Str_QueryCondi = Str_QueryCondi & " and Year='" & Mid(Trim(.Combo_Kjqj.Text), 1, 4) & "' and Period='" & Mid(Trim(.Combo_Kjqj.Text), 6, 2) & "'"
  653.                 
  654.             Case 4   '凭证号范围(起始)
  655.                 Str_QueryCondi = Str_QueryCondi & " and VouchNo>= " & Val(.LrText(0).Text)
  656.                 
  657.             Case 5   '凭证号范围(终止)
  658.                 If Val(.LrText(1)) <> 0 Then
  659.                     Str_QueryCondi = Str_QueryCondi & " and VouchNo<= " & Val(.LrText(1).Text)
  660.                 End If
  661.             End Select
  662.         Next Jsqte
  663.     End With
  664.     
  665.     '计算并显示实际最大、最小凭证号
  666.     Sqlstr = "SELECT MAX(VouchNo) VouchNoMax,Min(VouchNo) VouchNoMin From Cwzz_V_AccVouch" & Str_QueryCondi
  667.     Set RecTemp = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  668.     If Not IsNull(RecTemp.Fields("VouchNoMax")) Then
  669.         Int_VouchNoMax = RecTemp.Fields("VouchNoMax")
  670.     End If
  671.     If Not IsNull(RecTemp.Fields("VouchNoMin")) Then
  672.         Int_VouchNoMin = RecTemp.Fields("VouchNoMin")
  673.     End If
  674.     
  675.     '显示实际凭证号范围
  676.     Lab_TitleText(2).Caption = ""
  677.     If Int_VouchNoMin <> 0 Then
  678.         Lab_TitleText(2).Caption = Mid(Trim(Str(10000 + Int_VouchNoMin)), 2, 4) + "-"
  679.     End If
  680.     If Int_VouchNoMax <> 0 Then
  681.         Lab_TitleText(2).Caption = Lab_TitleText(2).Caption + Mid(Trim(Str(10000 + Int_VouchNoMax)), 2, 4)
  682.     End If
  683.     
  684.     '显示查询结果
  685.     
  686.     Sqlstr = "SELECT c.*, d.ForeignCurrName FROM " & _
  687.     " (SELECT A.*, B.Cname,B.ForeignCurrCode, B.measure,B.CodeLevel,B.Cclass FROM " & _
  688.     " (SELECT SUM(Jfje) Jfjehj, SUM(Dfje) Dfjehj,SUM(WbJfje) WbJfjehj,SUM(WbDfje) WbDfjehj,SUM(Jfsl) Jfslhj,SUM(Dfsl) Dfslhj, Ccode From Cwzz_V_AccVouch " & _
  689.     Str_QueryCondi & " GROUP BY Ccode) A LEFT OUTER JOIN " & _
  690.     " Cwzz_AccCode B ON A.Ccode = B.Ccode) C " & _
  691.     " LEFT OUTER JOIN Gy_ForeignCurrency d ON c.ForeignCurrCode = d.ForeignCurrCode Order by C.Ccode"
  692.     Set Rec_Query = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  693.     With Rec_Query
  694.         CxbbGrid.Rows = CxbbGrid.FixedRows
  695.         CxbbGrid.Rows = CxbbGrid.FixedRows + .RecordCount
  696.         Jsqte = CxbbGrid.FixedRows
  697.         Do While Not .EOF
  698.             
  699.             Str_CclassIndex = Fun_GetIndex("Cwzz_kmlx", Trim(.Fields("Cclass")))
  700.             
  701.             '1.添加末级科目合计数据
  702.             If .Fields("CodeLevel") <= Int(PZ_FrmPzhztj.LrText(2).Text) Then
  703.                 If Jsqte >= CxbbGrid.Rows Then
  704.                     CxbbGrid.AddItem ""
  705.                 End If
  706.                 
  707.                 '添加科目类别和科目编码(目的为了排序)
  708.                 CxbbGrid.TextMatrix(Jsqte, 0) = Str_CclassIndex + Trim(.Fields("Ccode"))
  709.                 
  710.                 CxbbGrid.TextMatrix(Jsqte, Sydz("001", GridStr(), Szzls)) = Trim(.Fields("Ccode"))
  711.                 CxbbGrid.TextMatrix(Jsqte, Sydz("002", GridStr(), Szzls)) = Trim(.Fields("Cname"))
  712.                 CxbbGrid.TextMatrix(Jsqte, Sydz("003", GridStr(), Szzls)) = Trim(.Fields("ForeignCurrName") & "")
  713.                 CxbbGrid.TextMatrix(Jsqte, Sydz("004", GridStr(), Szzls)) = Trim(.Fields("Measure") & "")
  714.                 If .Fields("Jfjehj") <> 0 Then                                                                     '借方金额合计
  715.                     CxbbGrid.TextMatrix(Jsqte, Sydz("005", GridStr(), Szzls)) = Trim(Str(.Fields("Jfjehj")))
  716.                 End If
  717.                 If .Fields("Dfjehj") <> 0 Then                                                                     '贷方金额合计
  718.                     CxbbGrid.TextMatrix(Jsqte, Sydz("006", GridStr(), Szzls)) = Trim(Str(.Fields("Dfjehj")))
  719.                 End If
  720.                 If .Fields("WbJfjehj") <> 0 And Trim(.Fields("ForeignCurrName") & "") <> "" Then                   '外币借方金额合计
  721.                     CxbbGrid.TextMatrix(Jsqte, Sydz("007", GridStr(), Szzls)) = Trim(Str(.Fields("WbJfjehj")))
  722.                 End If
  723.                 If .Fields("WbDfjehj") <> 0 And Trim(.Fields("ForeignCurrName") & "") <> "" Then                   '外币贷方金额合计
  724.                     CxbbGrid.TextMatrix(Jsqte, Sydz("008", GridStr(), Szzls)) = Trim(Str(.Fields("WbDfjehj")))
  725.                 End If
  726.                 If .Fields("Jfslhj") <> 0 Then                                                                     '借方数量合计
  727.                     CxbbGrid.TextMatrix(Jsqte, Sydz("009", GridStr(), Szzls)) = Trim(Str(.Fields("Jfslhj")))
  728.                 End If
  729.                 If .Fields("Dfslhj") <> 0 Then                                                                     '贷方数量合计
  730.                     CxbbGrid.TextMatrix(Jsqte, Sydz("010", GridStr(), Szzls)) = Trim(Str(.Fields("Dfslhj")))
  731.                 End If
  732.                 CxbbGrid.RowHeight(Jsqte) = Sjhgd
  733.                 Jsqte = Jsqte + 1
  734.             End If
  735.             
  736.             '2.累计上级科目数据
  737.             For Int_LevTe = 1 To Int(PZ_FrmPzhztj.LrText(2).Text)
  738.                 If Mid(Trim(.Fields("Ccode")), 1, Int_CodeScheme(Int_LevTe)) <> Trim(.Fields("Ccode")) Then
  739.                     Str_Parent = Trim(Mid(Trim(.Fields("Ccode")), 1, Int_CodeScheme(Int_LevTe)))
  740.                     Lng_ParCol = CxbbGrid.FindRow(Str_Parent, , Sydz("001", GridStr(), Szzls))
  741.                     If Lng_ParCol = -1 Then
  742.                         If Jsqte >= CxbbGrid.Rows Then
  743.                             CxbbGrid.AddItem ""
  744.                         End If
  745.                         CxbbGrid.RowHeight(Jsqte) = Sjhgd
  746.                         CxbbGrid.TextMatrix(Jsqte, 0) = Str_CclassIndex + Str_Parent
  747.                         CxbbGrid.TextMatrix(Jsqte, Sydz("001", GridStr(), Szzls)) = Str_Parent
  748.                         Set RecTemp = Cw_DataEnvi.DataConnect.Execute("Select Cwzz_AccCode.Cname FROM Cwzz_AccCode Where Ccode='" & Str_Parent & "'")
  749.                         If Not RecTemp.EOF Then
  750.                             CxbbGrid.TextMatrix(Jsqte, Sydz("002", GridStr(), Szzls)) = Trim(RecTemp.Fields("Cname"))
  751.                         End If
  752.                         
  753.                         If Val(CxbbGrid.TextMatrix(Jsqte, Sydz("005", GridStr(), Szzls))) + .Fields("Jfjehj") <> 0 Then
  754.                             CxbbGrid.TextMatrix(Jsqte, Sydz("005", GridStr(), Szzls)) = Trim(Str(Val(CxbbGrid.TextMatrix(Jsqte, Sydz("005", GridStr(), Szzls))) + .Fields("Jfjehj")))
  755.                         Else
  756.                             CxbbGrid.TextMatrix(Jsqte, Sydz("005", GridStr(), Szzls)) = ""
  757.                         End If
  758.                         If Val(CxbbGrid.TextMatrix(Jsqte, Sydz("006", GridStr(), Szzls))) + .Fields("Dfjehj") <> 0 Then
  759.                             CxbbGrid.TextMatrix(Jsqte, Sydz("006", GridStr(), Szzls)) = Trim(Str(Val(CxbbGrid.TextMatrix(Jsqte, Sydz("006", GridStr(), Szzls))) + .Fields("Dfjehj")))
  760.                         Else
  761.                             CxbbGrid.TextMatrix(Jsqte, Sydz("006", GridStr(), Szzls)) = ""
  762.                         End If
  763.                         Jsqte = Jsqte + 1
  764.                     Else
  765.                         If Val(CxbbGrid.TextMatrix(Lng_ParCol, Sydz("005", GridStr(), Szzls))) + .Fields("Jfjehj") <> 0 Then
  766.                             CxbbGrid.TextMatrix(Lng_ParCol, Sydz("005", GridStr(), Szzls)) = Trim(Str(Val(CxbbGrid.TextMatrix(Lng_ParCol, Sydz("005", GridStr(), Szzls))) + .Fields("Jfjehj")))
  767.                         Else
  768.                             CxbbGrid.TextMatrix(Lng_ParCol, Sydz("005", GridStr(), Szzls)) = ""
  769.                         End If
  770.                         If Val(CxbbGrid.TextMatrix(Lng_ParCol, Sydz("006", GridStr(), Szzls))) + .Fields("Dfjehj") <> 0 Then
  771.                             CxbbGrid.TextMatrix(Lng_ParCol, Sydz("006", GridStr(), Szzls)) = Trim(Str(Val(CxbbGrid.TextMatrix(Lng_ParCol, Sydz("006", GridStr(), Szzls))) + .Fields("Dfjehj")))
  772.                         Else
  773.                             CxbbGrid.TextMatrix(Lng_ParCol, Sydz("006", GridStr(), Szzls)) = ""
  774.                         End If
  775.                     End If
  776.                 Else
  777.                     Exit For
  778.                 End If
  779.             Next Int_LevTe
  780.             
  781.             '3.按科目类别累计
  782.             Lng_ParCol = CxbbGrid.FindRow(Trim(.Fields("Cclass")) + "类合计", , Sydz("002", GridStr(), Szzls))
  783.             If Lng_ParCol = -1 Then
  784.                 If Jsqte >= CxbbGrid.Rows Then
  785.                     CxbbGrid.AddItem ""
  786.                 End If
  787.                 CxbbGrid.RowHeight(Jsqte) = Sjhgd
  788.                 CxbbGrid.TextMatrix(Jsqte, 0) = Str_CclassIndex + "合计"
  789.                 CxbbGrid.TextMatrix(Jsqte, Sydz("002", GridStr(), Szzls)) = Trim(.Fields("Cclass")) + "类合计"
  790.                 
  791.                 If Val(CxbbGrid.TextMatrix(Jsqte, Sydz("005", GridStr(), Szzls))) + .Fields("Jfjehj") <> 0 Then
  792.                     CxbbGrid.TextMatrix(Jsqte, Sydz("005", GridStr(), Szzls)) = Trim(Str(Val(CxbbGrid.TextMatrix(Jsqte, Sydz("005", GridStr(), Szzls))) + .Fields("Jfjehj")))
  793.                 Else
  794.                     CxbbGrid.TextMatrix(Jsqte, Sydz("005", GridStr(), Szzls)) = ""
  795.                 End If
  796.                 If Val(CxbbGrid.TextMatrix(Jsqte, Sydz("006", GridStr(), Szzls))) + .Fields("Dfjehj") <> 0 Then
  797.                     CxbbGrid.TextMatrix(Jsqte, Sydz("006", GridStr(), Szzls)) = Trim(Str(Val(CxbbGrid.TextMatrix(Jsqte, Sydz("006", GridStr(), Szzls))) + .Fields("Dfjehj")))
  798.                 Else
  799.                     CxbbGrid.TextMatrix(Jsqte, Sydz("006", GridStr(), Szzls)) = ""
  800.                 End If
  801.                 CxbbGrid.Cell(flexcpBackColor, Jsqte, 0, , CxbbGrid.Cols - 1) = Lab_Color(0).BackColor
  802.                 Jsqte = Jsqte + 1
  803.             Else
  804.                 If Val(CxbbGrid.TextMatrix(Lng_ParCol, Sydz("005", GridStr(), Szzls))) + .Fields("Jfjehj") <> 0 Then
  805.                     CxbbGrid.TextMatrix(Lng_ParCol, Sydz("005", GridStr(), Szzls)) = Trim(Str(Val(CxbbGrid.TextMatrix(Lng_ParCol, Sydz("005", GridStr(), Szzls))) + .Fields("Jfjehj")))
  806.                 Else
  807.                     CxbbGrid.TextMatrix(Lng_ParCol, Sydz("005", GridStr(), Szzls)) = ""
  808.                 End If
  809.                 If Val(CxbbGrid.TextMatrix(Lng_ParCol, Sydz("006", GridStr(), Szzls))) + .Fields("Dfjehj") <> 0 Then
  810.                     CxbbGrid.TextMatrix(Lng_ParCol, Sydz("006", GridStr(), Szzls)) = Trim(Str(Val(CxbbGrid.TextMatrix(Lng_ParCol, Sydz("006", GridStr(), Szzls))) + .Fields("Dfjehj")))
  811.                 Else
  812.                     CxbbGrid.TextMatrix(Lng_ParCol, Sydz("006", GridStr(), Szzls)) = ""
  813.                 End If
  814.             End If
  815.             
  816.             .MoveNext
  817.         Loop
  818.     End With
  819.     
  820.     '截取无用行
  821.     CxbbGrid.Rows = Jsqte
  822.     
  823.     '将网格按科目编码排序
  824.     With CxbbGrid
  825.         .Col = 0
  826.         .Sort = flexSortStringAscending
  827.     End With
  828.     
  829.     '计算本币发生总合计
  830.     Sqlstr = "SELECT SUM(Jfje) Jfjehj, SUM(Dfje) Dfjehj From Cwzz_V_AccVouch " & _
  831.     Str_QueryCondi
  832.     Set Rec_Query = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  833.     
  834.     With Rec_Query
  835.         If Not .EOF Then
  836.             CxbbGrid.AddItem ""
  837.             Jsqte = CxbbGrid.Rows - 1
  838.             CxbbGrid.RowHeight(Jsqte) = Sjhgd
  839.             CxbbGrid.TextMatrix(Jsqte, Sydz("002", GridStr(), Szzls)) = "合计"
  840.             If .Fields("Jfjehj") <> 0 Then
  841.                 CxbbGrid.TextMatrix(Jsqte, Sydz("005", GridStr(), Szzls)) = .Fields("Jfjehj")
  842.             End If
  843.             If .Fields("Dfjehj") <> 0 Then
  844.                 CxbbGrid.TextMatrix(Jsqte, Sydz("006", GridStr(), Szzls)) = .Fields("Dfjehj")
  845.             End If
  846.         End If
  847.     End With
  848.     
  849.     '计算各外币发生合计(去掉本位币)
  850.     
  851.     Sqlstr = "Select b.*,c.ForeignCurrName From (SELECT SUM(WbJfje) WbJfjehj, SUM(WbDfje) WbDfjehj,a.ForeignCurrCode From Cwzz_V_AccVouch a" & _
  852.     Str_QueryCondi & "Group By a.ForeignCurrCode) b LEFT OUTER JOIN Gy_ForeignCurrency c ON b.ForeignCurrCode = c.ForeignCurrCode"
  853.     Set Rec_Query = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  854.     
  855.     With Rec_Query
  856.         Do While Not .EOF
  857.             
  858.             If Trim(.Fields("ForeignCurrCode")) <> "" And Trim(.Fields("ForeignCurrCode")) <> XtSCurrCode Then
  859.                 CxbbGrid.AddItem ""
  860.                 Jsqte = CxbbGrid.Rows - 1
  861.                 CxbbGrid.RowHeight(Jsqte) = Sjhgd
  862.                 CxbbGrid.TextMatrix(Jsqte, Sydz("002", GridStr(), Szzls)) = Trim(.Fields("ForeignCurrName")) & "合计"
  863.                 If .Fields("WbJfjehj") <> 0 Then
  864.                     CxbbGrid.TextMatrix(Jsqte, Sydz("007", GridStr(), Szzls)) = .Fields("WbJfjehj")
  865.                 End If
  866.                 If .Fields("WbDfjehj") <> 0 Then
  867.                     CxbbGrid.TextMatrix(Jsqte, Sydz("008", GridStr(), Szzls)) = .Fields("WbDfjehj")
  868.                 End If
  869.             End If
  870.             
  871.             .MoveNext
  872.         Loop
  873.     End With
  874.     
  875.     ']以上为用户自定义部分
  876.     
  877. End Sub
  878. Private Sub bbyl(bbylte As Boolean)                    '报表打印预览
  879.     Dim Bbzbt$, Bbxbt() As String, bbxbtzzxs() As Integer, Bbxbtgs As Integer
  880.     Dim Bbbwh() As String, Bbbwhzzxs() As Integer, Bbbwhgs As Integer
  881.     Bbxbtgs = 1                                          '报 表 小 标 题 行 数
  882.     Bbbwhgs = 0                                          '报 表 表 尾 行 数
  883.     ReDim Bbxbt(1 To Bbxbtgs)
  884.     ReDim bbxbtzzxs(1 To Bbxbtgs)
  885.     If Bbbwhgs <> 0 Then
  886.         ReDim Bbbwh(1 To Bbbwhgs)
  887.         ReDim Bbbwhzzxs(1 To Bbbwhgs)
  888.     End If
  889.     Bbzbt = ReportTitle
  890.     Bbxbt(1) = Space(2) + "会计期间:" + Lab_TitleText(0) + Space(5) + "凭证范围:" + Lab_TitleText(1) + Space(5) + "凭证号:" + Lab_TitleText(2)
  891.     bbxbtzzxs(1) = 1                                    '报表行组织形式(0-居左 1-居中 2-居右)
  892.     Call Scyxsjb(CxbbGrid)                               '生成报表数据
  893.     Call Scdybb(Dyymctbl, Bbzbt, Bbxbt(), bbxbtzzxs(), Bbxbtgs, Bbbwh(), Bbbwhzzxs(), Bbbwhgs, bbylte)
  894.     If Not bbylte Then
  895.         Unload DY_Tybbyldy
  896.     End If
  897. End Sub