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

企业管理

开发平台:

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 ZB_Frmkmmxzjg 
  5.    Caption         =   "科目明细帐"
  6.    ClientHeight    =   7755
  7.    ClientLeft      =   315
  8.    ClientTop       =   390
  9.    ClientWidth     =   11190
  10.    Icon            =   "帐簿_科目明细帐查询结果.frx":0000
  11.    KeyPreview      =   -1  'True
  12.    LinkTopic       =   "Form1"
  13.    MDIChild        =   -1  'True
  14.    ScaleHeight     =   7755
  15.    ScaleWidth      =   11190
  16.    WindowState     =   2  'Maximized
  17.    Begin VB.Timer Timer1 
  18.       Enabled         =   0   'False
  19.       Interval        =   1
  20.       Left            =   7620
  21.       Top             =   90
  22.    End
  23.    Begin VB.PictureBox Pic_Title 
  24.       Height          =   1185
  25.       Left            =   30
  26.       Picture         =   "帐簿_科目明细帐查询结果.frx":1042
  27.       ScaleHeight     =   1125
  28.       ScaleWidth      =   11535
  29.       TabIndex        =   0
  30.       Top             =   570
  31.       Width           =   11595
  32.       Begin VB.CommandButton Cmd_CancelPrint 
  33.          Caption         =   "取消打印(&C)"
  34.          Height          =   405
  35.          Left            =   9840
  36.          TabIndex        =   19
  37.          Top             =   150
  38.          Visible         =   0   'False
  39.          Width           =   1155
  40.       End
  41.       Begin VB.ComboBox Combo_QueryCcode 
  42.          Height          =   300
  43.          Left            =   1710
  44.          Style           =   2  'Dropdown List
  45.          TabIndex        =   12
  46.          Top             =   780
  47.          Width           =   3915
  48.       End
  49.       Begin VB.ComboBox Combo_AccFormat 
  50.          Height          =   300
  51.          Left            =   9270
  52.          Style           =   2  'Dropdown List
  53.          TabIndex        =   5
  54.          Top             =   780
  55.          Width           =   1725
  56.       End
  57.       Begin VB.Label Label1 
  58.          Appearance      =   0  'Flat
  59.          BackColor       =   &H80000005&
  60.          BackStyle       =   0  'Transparent
  61.          Caption         =   "承前页"
  62.          ForeColor       =   &H80000008&
  63.          Height          =   195
  64.          Index           =   1
  65.          Left            =   8850
  66.          TabIndex        =   18
  67.          Top             =   270
  68.          Width           =   615
  69.       End
  70.       Begin VB.Label Lab_Color 
  71.          Appearance      =   0  'Flat
  72.          BackColor       =   &H00E9F4FA&
  73.          BorderStyle     =   1  'Fixed Single
  74.          ForeColor       =   &H80000008&
  75.          Height          =   195
  76.          Index           =   2
  77.          Left            =   8610
  78.          TabIndex        =   17
  79.          Top             =   270
  80.          Width           =   195
  81.       End
  82.       Begin VB.Label Label1 
  83.          Appearance      =   0  'Flat
  84.          BackColor       =   &H80000005&
  85.          BackStyle       =   0  'Transparent
  86.          Caption         =   "过次页"
  87.          ForeColor       =   &H80000008&
  88.          Height          =   195
  89.          Index           =   0
  90.          Left            =   7920
  91.          TabIndex        =   16
  92.          Top             =   270
  93.          Width           =   615
  94.       End
  95.       Begin VB.Label Lab_Color 
  96.          Appearance      =   0  'Flat
  97.          BackColor       =   &H00DFDFDF&
  98.          BorderStyle     =   1  'Fixed Single
  99.          ForeColor       =   &H80000008&
  100.          Height          =   195
  101.          Index           =   1
  102.          Left            =   7680
  103.          TabIndex        =   15
  104.          Top             =   270
  105.          Width           =   195
  106.       End
  107.       Begin VB.Label Lab_TitleText 
  108.          BackStyle       =   0  'Transparent
  109.          ForeColor       =   &H00000000&
  110.          Height          =   225
  111.          Index           =   1
  112.          Left            =   4080
  113.          TabIndex        =   14
  114.          Top             =   270
  115.          Width           =   1395
  116.       End
  117.       Begin VB.Label Lab_TitleMess 
  118.          BackStyle       =   0  'Transparent
  119.          Caption         =   "外币名称:"
  120.          Height          =   225
  121.          Index           =   2
  122.          Left            =   3150
  123.          TabIndex        =   13
  124.          Top             =   270
  125.          Width           =   915
  126.       End
  127.       Begin VB.Label Lab_TitleMess 
  128.          AutoSize        =   -1  'True
  129.          BackStyle       =   0  'Transparent
  130.          Caption         =   "科目名称:"
  131.          Height          =   180
  132.          Index           =   1
  133.          Left            =   870
  134.          TabIndex        =   11
  135.          Top             =   840
  136.          Width           =   810
  137.       End
  138.       Begin VB.Label Label1 
  139.          Appearance      =   0  'Flat
  140.          BackColor       =   &H80000005&
  141.          BackStyle       =   0  'Transparent
  142.          Caption         =   "未记帐明细会计分录"
  143.          ForeColor       =   &H80000008&
  144.          Height          =   195
  145.          Index           =   2
  146.          Left            =   5940
  147.          TabIndex        =   9
  148.          Top             =   270
  149.          Width           =   1665
  150.       End
  151.       Begin VB.Label Lab_Color 
  152.          Appearance      =   0  'Flat
  153.          BackColor       =   &H00FFFFC0&
  154.          BorderStyle     =   1  'Fixed Single
  155.          ForeColor       =   &H80000008&
  156.          Height          =   195
  157.          Index           =   0
  158.          Left            =   5700
  159.          TabIndex        =   8
  160.          Top             =   270
  161.          Width           =   195
  162.       End
  163.       Begin VB.Label Lab_TitleText 
  164.          AutoSize        =   -1  'True
  165.          BackStyle       =   0  'Transparent
  166.          ForeColor       =   &H00000000&
  167.          Height          =   180
  168.          Index           =   0
  169.          Left            =   6750
  170.          TabIndex        =   7
  171.          Top             =   840
  172.          Width           =   1350
  173.       End
  174.       Begin VB.Label TsLabel 
  175.          AutoSize        =   -1  'True
  176.          BackStyle       =   0  'Transparent
  177.          Caption         =   "帐页格式:"
  178.          Height          =   180
  179.          Index           =   7
  180.          Left            =   8430
  181.          TabIndex        =   6
  182.          Top             =   840
  183.          Width           =   810
  184.       End
  185.       Begin VB.Label TsLabel 
  186.          BackColor       =   &H80000018&
  187.          BackStyle       =   0  'Transparent
  188.          Caption         =   "科目明细帐"
  189.          BeginProperty Font 
  190.             Name            =   "宋体"
  191.             Size            =   14.25
  192.             Charset         =   134
  193.             Weight          =   700
  194.             Underline       =   0   'False
  195.             Italic          =   0   'False
  196.             Strikethrough   =   0   'False
  197.          EndProperty
  198.          ForeColor       =   &H00000000&
  199.          Height          =   330
  200.          Index           =   4
  201.          Left            =   540
  202.          TabIndex        =   2
  203.          Top             =   180
  204.          Width           =   1635
  205.       End
  206.       Begin VB.Label Lab_TitleMess 
  207.          AutoSize        =   -1  'True
  208.          BackStyle       =   0  'Transparent
  209.          Caption         =   "会计期间:"
  210.          Height          =   180
  211.          Index           =   0
  212.          Left            =   5850
  213.          TabIndex        =   1
  214.          Top             =   840
  215.          Width           =   810
  216.       End
  217.    End
  218.    Begin VSFlex8Ctl.VSFlexGrid CxbbGrid 
  219.       Height          =   6885
  220.       Left            =   0
  221.       TabIndex        =   3
  222.       Top             =   1770
  223.       Width           =   11715
  224.       _cx             =   5080
  225.       _cy             =   5080
  226.       Appearance      =   1
  227.       BorderStyle     =   1
  228.       Enabled         =   -1  'True
  229.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  230.          Name            =   "宋体"
  231.          Size            =   9
  232.          Charset         =   134
  233.          Weight          =   400
  234.          Underline       =   0   'False
  235.          Italic          =   0   'False
  236.          Strikethrough   =   0   'False
  237.       EndProperty
  238.       MousePointer    =   0
  239.       BackColor       =   16777215
  240.       ForeColor       =   -2147483640
  241.       BackColorFixed  =   12632256
  242.       ForeColorFixed  =   -2147483630
  243.       BackColorSel    =   -2147483635
  244.       ForeColorSel    =   -2147483634
  245.       BackColorBkg    =   -2147483636
  246.       BackColorAlternate=   16777215
  247.       GridColor       =   -2147483633
  248.       GridColorFixed  =   -2147483632
  249.       TreeColor       =   -2147483632
  250.       FloodColor      =   192
  251.       SheetBorder     =   -2147483642
  252.       FocusRect       =   1
  253.       HighLight       =   1
  254.       AllowSelection  =   -1  'True
  255.       AllowBigSelection=   -1  'True
  256.       AllowUserResizing=   0
  257.       SelectionMode   =   0
  258.       GridLines       =   1
  259.       GridLinesFixed  =   2
  260.       GridLineWidth   =   1
  261.       Rows            =   50
  262.       Cols            =   10
  263.       FixedRows       =   1
  264.       FixedCols       =   1
  265.       RowHeightMin    =   0
  266.       RowHeightMax    =   0
  267.       ColWidthMin     =   0
  268.       ColWidthMax     =   0
  269.       ExtendLastCol   =   0   'False
  270.       FormatString    =   ""
  271.       ScrollTrack     =   0   'False
  272.       ScrollBars      =   3
  273.       ScrollTips      =   0   'False
  274.       MergeCells      =   0
  275.       MergeCompare    =   0
  276.       AutoResize      =   -1  'True
  277.       AutoSizeMode    =   0
  278.       AutoSearch      =   0
  279.       AutoSearchDelay =   2
  280.       MultiTotals     =   -1  'True
  281.       SubtotalPosition=   1
  282.       OutlineBar      =   0
  283.       OutlineCol      =   0
  284.       Ellipsis        =   0
  285.       ExplorerBar     =   0
  286.       PicturesOver    =   0   'False
  287.       FillStyle       =   0
  288.       RightToLeft     =   0   'False
  289.       PictureType     =   0
  290.       TabBehavior     =   0
  291.       OwnerDraw       =   0
  292.       Editable        =   0
  293.       ShowComboButton =   1
  294.       WordWrap        =   0   'False
  295.       TextStyle       =   0
  296.       TextStyleFixed  =   0
  297.       OleDragMode     =   0
  298.       OleDropMode     =   0
  299.       DataMode        =   0
  300.       VirtualData     =   -1  'True
  301.       DataMember      =   ""
  302.       ComboSearch     =   3
  303.       AutoSizeMouse   =   -1  'True
  304.       FrozenRows      =   0
  305.       FrozenCols      =   0
  306.       AllowUserFreezing=   0
  307.       BackColorFrozen =   0
  308.       ForeColorFrozen =   0
  309.       WallPaperAlignment=   9
  310.       AccessibleName  =   ""
  311.       AccessibleDescription=   ""
  312.       AccessibleValue =   ""
  313.       AccessibleRole  =   24
  314.    End
  315.    Begin MSComctlLib.Toolbar SzToolbar 
  316.       Align           =   1  'Align Top
  317.       Height          =   555
  318.       Left            =   0
  319.       TabIndex        =   4
  320.       Top             =   0
  321.       Width           =   11190
  322.       _ExtentX        =   19738
  323.       _ExtentY        =   979
  324.       ButtonWidth     =   820
  325.       ButtonHeight    =   926
  326.       AllowCustomize  =   0   'False
  327.       Appearance      =   1
  328.       Style           =   1
  329.       ImageList       =   "ImageList1"
  330.       _Version        =   393216
  331.       BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  332.          NumButtons      =   12
  333.          BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  334.             Caption         =   "设置"
  335.             Key             =   "ymsz"
  336.             ImageKey        =   "sz"
  337.          EndProperty
  338.          BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  339.             Caption         =   "打印"
  340.             Key             =   "dy"
  341.             ImageKey        =   "dy"
  342.          EndProperty
  343.          BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  344.             Caption         =   "预览"
  345.             Key             =   "yl"
  346.             ImageKey        =   "yl"
  347.          EndProperty
  348.          BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  349.             Caption         =   "连打"
  350.             Key             =   "lxdy"
  351.             Object.ToolTipText     =   "帐页连续打印"
  352.             ImageKey        =   "lxdy"
  353.          EndProperty
  354.          BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  355.             Style           =   3
  356.          EndProperty
  357.          BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  358.             Caption         =   "查询"
  359.             Key             =   "cx"
  360.             ImageKey        =   "cx"
  361.          EndProperty
  362.          BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  363.             Style           =   3
  364.          EndProperty
  365.          BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  366.             Caption         =   "凭证"
  367.             Key             =   "pz"
  368.             ImageKey        =   "pz"
  369.          EndProperty
  370.          BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  371.             Caption         =   "总帐"
  372.             Key             =   "zz"
  373.             ImageKey        =   "zz"
  374.          EndProperty
  375.          BeginProperty Button10 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  376.             Style           =   3
  377.          EndProperty
  378.          BeginProperty Button11 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  379.             Caption         =   "帮助"
  380.             Key             =   "bz"
  381.             ImageKey        =   "bz"
  382.          EndProperty
  383.          BeginProperty Button12 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  384.             Caption         =   "退出"
  385.             Key             =   "fh"
  386.             ImageKey        =   "tc"
  387.          EndProperty
  388.       EndProperty
  389.       BorderStyle     =   1
  390.       Begin MSComctlLib.ImageList ImageList1 
  391.          Left            =   6690
  392.          Top             =   0
  393.          _ExtentX        =   1005
  394.          _ExtentY        =   1005
  395.          BackColor       =   -2147483643
  396.          ImageWidth      =   16
  397.          ImageHeight     =   16
  398.          MaskColor       =   12632256
  399.          _Version        =   393216
  400.          BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  401.             NumListImages   =   34
  402.             BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  403.                Picture         =   "帐簿_科目明细帐查询结果.frx":35106
  404.                Key             =   "sz"
  405.             EndProperty
  406.             BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  407.                Picture         =   "帐簿_科目明细帐查询结果.frx":354A0
  408.                Key             =   "dy"
  409.             EndProperty
  410.             BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  411.                Picture         =   "帐簿_科目明细帐查询结果.frx":3583A
  412.                Key             =   "yl"
  413.             EndProperty
  414.             BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  415.                Picture         =   "帐簿_科目明细帐查询结果.frx":35BD4
  416.                Key             =   "xg"
  417.             EndProperty
  418.             BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  419.                Picture         =   "帐簿_科目明细帐查询结果.frx":35F6E
  420.                Key             =   "zh"
  421.             EndProperty
  422.             BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  423.                Picture         =   "帐簿_科目明细帐查询结果.frx":36308
  424.                Key             =   "sh"
  425.             EndProperty
  426.             BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  427.                Picture         =   "帐簿_科目明细帐查询结果.frx":366A2
  428.                Key             =   "bc"
  429.             EndProperty
  430.             BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  431.                Picture         =   "帐簿_科目明细帐查询结果.frx":36A3C
  432.                Key             =   "fq"
  433.             EndProperty
  434.             BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  435.                Picture         =   "帐簿_科目明细帐查询结果.frx":36DD6
  436.                Key             =   "bz"
  437.             EndProperty
  438.             BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  439.                Picture         =   "帐簿_科目明细帐查询结果.frx":37170
  440.                Key             =   "tc"
  441.             EndProperty
  442.             BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  443.                Picture         =   "帐簿_科目明细帐查询结果.frx":3750A
  444.                Key             =   "bcgs"
  445.             EndProperty
  446.             BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  447.                Picture         =   "帐簿_科目明细帐查询结果.frx":378A4
  448.                Key             =   "mrlk"
  449.             EndProperty
  450.             BeginProperty ListImage13 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  451.                Picture         =   "帐簿_科目明细帐查询结果.frx":37C3E
  452.                Key             =   "xsxm"
  453.             EndProperty
  454.             BeginProperty ListImage14 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  455.                Picture         =   "帐簿_科目明细帐查询结果.frx":37FD8
  456.                Key             =   "first"
  457.             EndProperty
  458.             BeginProperty ListImage15 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  459.                Picture         =   "帐簿_科目明细帐查询结果.frx":38372
  460.                Key             =   "prev"
  461.             EndProperty
  462.             BeginProperty ListImage16 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  463.                Picture         =   "帐簿_科目明细帐查询结果.frx":3870C
  464.                Key             =   "next"
  465.             EndProperty
  466.             BeginProperty ListImage17 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  467.                Picture         =   "帐簿_科目明细帐查询结果.frx":38AA6
  468.                Key             =   "last"
  469.             EndProperty
  470.             BeginProperty ListImage18 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  471.                Picture         =   "帐簿_科目明细帐查询结果.frx":38E40
  472.                Key             =   "xx"
  473.             EndProperty
  474.             BeginProperty ListImage19 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  475.                Picture         =   "帐簿_科目明细帐查询结果.frx":391DA
  476.                Key             =   "define"
  477.             EndProperty
  478.             BeginProperty ListImage20 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  479.                Picture         =   "帐簿_科目明细帐查询结果.frx":39574
  480.                Key             =   "exec"
  481.             EndProperty
  482.             BeginProperty ListImage21 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  483.                Picture         =   "帐簿_科目明细帐查询结果.frx":3990E
  484.                Key             =   "xz"
  485.             EndProperty
  486.             BeginProperty ListImage22 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  487.                Picture         =   "帐簿_科目明细帐查询结果.frx":39CA8
  488.                Key             =   "sc"
  489.             EndProperty
  490.             BeginProperty ListImage23 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  491.                Picture         =   "帐簿_科目明细帐查询结果.frx":3A042
  492.                Key             =   "sx"
  493.             EndProperty
  494.             BeginProperty ListImage24 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  495.                Picture         =   "帐簿_科目明细帐查询结果.frx":3A3DC
  496.                Key             =   "cx"
  497.             EndProperty
  498.             BeginProperty ListImage25 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  499.                Picture         =   "帐簿_科目明细帐查询结果.frx":3A776
  500.                Key             =   "zd"
  501.             EndProperty
  502.             BeginProperty ListImage26 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  503.                Picture         =   "帐簿_科目明细帐查询结果.frx":3AB10
  504.                Key             =   "dz"
  505.             EndProperty
  506.             BeginProperty ListImage27 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  507.                Picture         =   "帐簿_科目明细帐查询结果.frx":3AEAA
  508.                Key             =   "ph"
  509.             EndProperty
  510.             BeginProperty ListImage28 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  511.                Picture         =   "帐簿_科目明细帐查询结果.frx":3B244
  512.                Key             =   "fz"
  513.             EndProperty
  514.             BeginProperty ListImage29 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  515.                Picture         =   "帐簿_科目明细帐查询结果.frx":3B5DE
  516.                Key             =   "dw"
  517.             EndProperty
  518.             BeginProperty ListImage30 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  519.                Picture         =   "帐簿_科目明细帐查询结果.frx":3B978
  520.                Key             =   "hf"
  521.             EndProperty
  522.             BeginProperty ListImage31 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  523.                Picture         =   "帐簿_科目明细帐查询结果.frx":3BD12
  524.                Key             =   "pz"
  525.             EndProperty
  526.             BeginProperty ListImage32 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  527.                Picture         =   "帐簿_科目明细帐查询结果.frx":3C0AC
  528.                Key             =   "check"
  529.             EndProperty
  530.             BeginProperty ListImage33 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  531.                Picture         =   "帐簿_科目明细帐查询结果.frx":3C446
  532.                Key             =   "zz"
  533.             EndProperty
  534.             BeginProperty ListImage34 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  535.                Picture         =   "帐簿_科目明细帐查询结果.frx":3C7E0
  536.                Key             =   "lxdy"
  537.             EndProperty
  538.          EndProperty
  539.       End
  540.       Begin MSComctlLib.Toolbar GsToolbar 
  541.          Height          =   525
  542.          Left            =   9510
  543.          TabIndex        =   10
  544.          Top             =   0
  545.          Width           =   1665
  546.          _ExtentX        =   2937
  547.          _ExtentY        =   926
  548.          ButtonWidth     =   1455
  549.          ButtonHeight    =   926
  550.          AllowCustomize  =   0   'False
  551.          Appearance      =   1
  552.          Style           =   1
  553.          ImageList       =   "ImageList1"
  554.          _Version        =   393216
  555.          BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  556.             NumButtons      =   2
  557.             BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  558.                Caption         =   "保存格式"
  559.                Key             =   "bcgs"
  560.                ImageKey        =   "bcgs"
  561.             EndProperty
  562.             BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  563.                Caption         =   "默认列宽"
  564.                Key             =   "hfmrgs"
  565.                ImageKey        =   "mrlk"
  566.             EndProperty
  567.          EndProperty
  568.       End
  569.    End
  570. End
  571. Attribute VB_Name = "ZB_Frmkmmxzjg"
  572. Attribute VB_GlobalNameSpace = False
  573. Attribute VB_Creatable = False
  574. Attribute VB_PredeclaredId = True
  575. Attribute VB_Exposed = False
  576. '*************************************************************************
  577. '*    模 块 名 称 :科目明细帐
  578. '*    功 能 描 述 :本功能用于查询某科目在某月或某几月的明细帐情况
  579. '*                 并且能够进行立体联查凭证及总帐数据。
  580. '*    程序员姓名  : 张建忠
  581. '*    最后修改人  : 奚俊峰
  582. '*    最后修改时间:2001-12-23
  583. '*    备        注:查询科目明细帐时应从建帐启用月份查询,否则本年累计数据
  584. '*                 有问题,有的软件控制不能小于启用月份查询.
  585. '************************************************************************
  586. Dim ReportTitle As String                '报表主标题
  587. Dim Bln_ClassSum As Boolean              '是否进行科目类别合计
  588. Dim Bln_ConVertFlag As Boolean           '外币折算方式
  589. Dim Int_Wbhlxsws As Integer              '外币汇率小数位数
  590. Dim Bln_CancelPrint As Boolean           '用户是否取消打印
  591. Dim Bln_Printing As Boolean              '用户是否正在打印
  592. '以下为固定使用变量
  593. Dim Dyymctbl As New DY_Dyymsz            '打印页面窗体变量
  594. Dim GridCode As String                   '显示网格网格代码
  595. Dim GridInf() As Variant                 '整个网格设置信息
  596. Dim Tsxx As String                       '系统提示信息
  597. Dim Qslz As Long                         '网格隐藏(非操作显示)列数
  598. Dim Sjhgd As Double                      '网格数据行高度
  599. Dim Sfxshjwg As Boolean                  '是否显示合计网格
  600. Dim GridBoolean() As Boolean             '网格列信息(布尔型)
  601. Dim GridStr()  As String                 '网格列信息(字符型)
  602. Dim GridInt() As Integer                 '网格列信息(整型)
  603. Dim Szzls As Integer                     '数组总列数(网格列数-1)
  604. Dim Bln_Stop As Boolean                  '停止输出查询结果
  605. Private Sub Form_Activate()
  606.     Me.HelpContextID = "0116003"
  607. End Sub
  608. Private Sub Form_Resize()                '根据窗体大小来调整网格,标题栏大小
  609.     On Error Resume Next
  610.     With CxbbGrid
  611.         .Width = Me.Width - 160
  612.         .Height = Me.Height - .Top - 400
  613.     End With
  614.     With Pic_Title
  615.         .Width = Me.Width - 160
  616.     End With
  617.     
  618.     GsToolbar.Left = Me.Width - GsToolbar.Width - 140
  619. End Sub
  620. Private Sub Form_Load()                                                   '窗体装入
  621.     Me.HelpContextID = "0116003"
  622.     
  623.     '调入打印页面设置窗体
  624.     XtReportCode = "Cwzz_mxzcx"
  625.     Load Dyymctbl
  626.     ReportTitle = "明  细  帐"
  627.     
  628.     '调整标题栏及网格、格式工具条位置
  629.     Pic_Title.Left = 40
  630.     Pic_Title.Top = SzToolbar.Top + SzToolbar.Height - 10
  631.     CxbbGrid.Left = Pic_Title.Left
  632.     CxbbGrid.Top = Pic_Title.Top + Pic_Title.Height + 20
  633.     
  634.     '调 入 网 格
  635.     GridCode = "Cwzz_mxzcx"
  636.     Call BzWgcsh(CxbbGrid, GridCode, GridInf(), GridBoolean(), GridInt(), GridStr())
  637.     
  638.     Qslz = GridInf(1)
  639.     Sjhgd = GridInf(2)
  640.     Sfxshjwg = GridInf(7)
  641.     Szzls = CxbbGrid.Cols - 1
  642.     
  643.     '帐页格式
  644.     Call FillCombo(Combo_AccFormat, "Cwzz_zygs", "", 0)
  645.     
  646.     '调整标题位置
  647.     SetTitlePos tsLabel(4)
  648.     
  649. End Sub
  650. Private Sub Form_Unload(Cancel As Integer)                                  '窗体卸载
  651.     '如果用户正在连续打印帐页,则不能关闭窗体
  652.     If Bln_Printing Then
  653.         Cancel = 1
  654.     End If
  655.     '卸载条件窗体
  656.     ZB_Frmkmmxztj.UnloadCheck.Value = 1
  657.     Unload ZB_Frmkmmxztj
  658.     '卸载打印页面设置窗体
  659.     Unload Dyymctbl
  660. End Sub
  661. Private Sub GsToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)       '网格格式调整
  662.     Select Case Button.Key
  663.     Case "bcgs"                                          '保存表格格式
  664.         Call Bcwggs(CxbbGrid, GridCode, GridStr)
  665.     Case "hfmrgs"                                        '恢复默认格式
  666.         Call Hfmrgs(CxbbGrid, GridCode, GridStr)
  667.     Case "szxsxm"                                        '设置显示项目
  668.         Call Szxsxm(CxbbGrid, GridCode)
  669.     End Select
  670. End Sub
  671. Private Sub SzToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)
  672.     '如果用户正在连续打印帐页,则不能执行其他功能
  673.     If Bln_Printing Then
  674.         Exit Sub
  675.     End If
  676.     
  677.     Select Case Button.Key
  678.     Case "ymsz"                                          '页面设置
  679.         Dyymctbl.Show 1
  680.     Case "yl"                                            '预 览
  681.         Call bbyl(True)
  682.     Case "dy"                                            '打 印
  683.         Call bbyl(False)
  684.     Case "lxdy"                                          '连 打
  685.         Call Sub_Lxdy
  686.     Case "cx"                                            '查 询
  687.         If Trim(Combo_QueryCcode.Text) <> "" Then
  688.             ZB_Frmkmmxztj.LrText(0).Text = Trim(Mid(Combo_QueryCcode.Text, 1, InStr(1, Combo_QueryCcode.Text, " ") - 1))
  689.         End If
  690.         ZB_Frmkmmxztj.Show 1
  691.     Case "pz"                                            '凭 证
  692.         Call CxbbGrid_DblClick
  693.     Case "zz"                                            '总 帐
  694.         Call Sub_LcZflz
  695.     Case "bz"                                            '帮 助
  696.         Call F1bz
  697.     Case "fh"                                            '退 出
  698.         Unload Me
  699.     End Select
  700. End Sub
  701. Private Sub Timer1_Timer()                                 '在窗体激活后调入查询程序
  702.     Dim RecTemp As New ADODB.Recordset          '临时使用动态集
  703.     Dim Str_QueryCondi As String                '用户录入查询条件
  704.     
  705.     Timer1.Enabled = False
  706.     
  707.     With ZB_Frmkmmxztj
  708.         
  709.         Str_QueryCondi = " where 1=1 "
  710.         
  711.         Str_QueryCondi = Str_QueryCondi & " and CCode>='" & Trim(.LrText(0).Text) & "'"
  712.         
  713.         If Trim(.LrText(1).Text) <> "" Then
  714.             Str_QueryCondi = Str_QueryCondi & " and CCode<='" & Trim(.LrText(1).Text) & "'"
  715.         End If
  716.         
  717.         
  718.         '判断是否仅限于末级科目查询
  719.         If .Chk_EndFlag.Value = 1 Then
  720.             Str_QueryCondi = Str_QueryCondi & " and EndFlag='1'"
  721.         End If
  722.         
  723.     End With
  724.     
  725.     '根据查询科目范围填充科目列表框
  726.     Sqlstr = "SELECT Ccode,Cname From Cwzz_AccCode" & Str_QueryCondi & " Order By Ccode"
  727.     Set RecTemp = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  728.     
  729.     Combo_QueryCcode.Clear
  730.     Do While Not RecTemp.EOF
  731.         Combo_QueryCcode.AddItem Trim(RecTemp.Fields("Ccode")) + " " + Trim(RecTemp.Fields("Cname") & "")
  732.         RecTemp.MoveNext
  733.     Loop
  734.     
  735.     If Combo_QueryCcode.ListCount <> 0 Then
  736.         Combo_QueryCcode.Text = Combo_QueryCcode.List(0)
  737.     End If
  738.     Lab_TitleText(0).Caption = ZB_Frmkmmxztj.Combo_Kjqj(0).Text & "—" & ZB_Frmkmmxztj.Combo_Kjqj(1).Text
  739. End Sub
  740. Private Sub Combo_QueryCcode_Click()                                      '用户点击科目列表框
  741.     Timer1.Enabled = False
  742.     Xt_Wait.Show
  743.     Xt_Wait.Refresh
  744.     
  745.     '加快显示速度
  746.     CxbbGrid.Redraw = False
  747.     
  748.     '生成查询结果
  749.     Call Sub_Query
  750.     
  751.     CxbbGrid.Redraw = True
  752.     
  753.     Xt_Wait.Hide
  754. End Sub
  755. Private Sub Sub_Query()                                    '生成查询结果
  756.     Dim RecTemp As New ADODB.Recordset          '临时使用动态集
  757.     Dim Sqlstr As String                        '查询字符串
  758.     Dim Coljsq As Long                          '网格列计数器
  759.     Dim Jsqte As Long                           '临时动态计数器
  760.     Dim Str_Ccode As String                     '查询会计科目
  761.     Dim Int_BPeriod As Integer                  '查询起始会计期间
  762.     Dim Int_EPeriod As Integer                  '查询终止会计期间
  763.     Dim Int_Year As Integer                     '查询会计年度
  764.     Dim Bln_IncluNotBook As Boolean             '是否包含未记帐凭证
  765.     Dim Bln_QcZeroShow As Boolean               '查询会计期间期初数据如果为零是否显示
  766.     Dim Bln_CqGcShow As Boolean                 '是否显示承前过次
  767.     Dim Int_Zdzyhs As Integer                   '正式帐页指定报表行数
  768.     Dim Bln_EndFlag As Boolean                  '判断当前科目是否为末级科目
  769.     Dim Int_DqPeriod As Integer                 '查询进行当前会计期间
  770.     Dim Bln_NotFirst As Boolean                 '是否为首次循环
  771.     Dim Bln_ForeignFlag As Boolean              '判断此科目是否外币核算
  772.     Dim Lng_MonthCount As Long                  '本月明细帐记录条数
  773.     Dim Lng_YearCount As Long                   '本年明细帐记录条数
  774.     
  775.     Dim Dbl_Qcyete#, Dbl_Qcslte#, Dbl_Qcwbte#   '期初金额,数量,外币
  776.     Dim Dbl_Jejfhj#, Dbl_Jedfhj#, Dbl_Sljfhj#, Dbl_Sldfhj#, Dbl_Wbjfhj#, Dbl_Wbdfhj# '本期合计(金额,数量,外币)
  777.     Dim Dbl_Jejflj#, Dbl_Jedflj#, Dbl_Sljflj#, Dbl_Sldflj#, Dbl_Wbjflj#, Dbl_Wbdflj# '截止累计(金额,数量,外币)
  778.     Dim Dbl_Qmyete#, Dbl_Qmslte#, Dbl_Qmwbte#   '期末金额,数量,外币
  779.     '以下为用户自定义部分[
  780.     
  781.     '清除原查询数据
  782.     CxbbGrid.Rows = CxbbGrid.FixedRows
  783.     
  784.     '得到当前查询科目,并判断是否为末级科目
  785.     Str_Ccode = Trim(Mid(Combo_QueryCcode.Text, 1, InStr(1, Combo_QueryCcode.Text, " ") - 1))
  786.     Sqlstr = "SELECT EndFlag,AccFormat,ForeignFlag,ForeignCurrName,IDec,ConVertFlag From Cwzz_AccCode Left JOIN Gy_ForeignCurrency ON" & _
  787.     " Cwzz_AccCode.ForeignCurrCode = Gy_ForeignCurrency.ForeignCurrCode Where Ccode='" & Str_Ccode & "'"
  788.     Set RecTemp = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  789.     If Not RecTemp.EOF Then
  790.         Bln_EndFlag = RecTemp.Fields("EndFlag")
  791.         Combo_AccFormat.Text = Trim(RecTemp.Fields("AccFormat") & "")
  792.         If RecTemp.Fields("ForeignFlag") Then
  793.             Lab_TitleMess(2).Visible = True
  794.             Lab_TitleText(1).Caption = Trim(RecTemp.Fields("ForeignCurrName") & "")
  795.             Bln_ForeignFlag = True
  796.             Bln_ConVertFlag = IIf(IsNull(RecTemp.Fields("ConVertFlag")), False, RecTemp.Fields("ConVertFlag"))
  797.             Int_Wbhlxsws = IIf(IsNull(RecTemp.Fields("IDec")), 0, RecTemp.Fields("IDec"))
  798.         Else
  799.             Bln_ForeignFlag = False
  800.             Lab_TitleMess(2).Visible = True
  801.             Lab_TitleText(1).Caption = ""
  802.         End If
  803.     End If
  804.     
  805.     '得到查询起始和截止会计期间,并判断是否包含未记帐凭证
  806.     With ZB_Frmkmmxztj
  807.         Int_Year = Int(Mid(.Combo_Kjqj(0).Text, 1, 4))
  808.         Int_BPeriod = Int(Mid(.Combo_Kjqj(0).Text, 6, 2))
  809.         Int_EPeriod = Int(Mid(.Combo_Kjqj(1).Text, 6, 2))
  810.         
  811.         '是否包含未记帐凭证
  812.         If .Chk_NotBook.Value = 1 Then
  813.             Bln_IncluNotBook = True
  814.         Else
  815.             Bln_IncluNotBook = False
  816.         End If
  817.         
  818.         '查询会计期间期初数据如果为零是否显示
  819.         If .Chk_QcZeroShow = 1 Then
  820.             Bln_QcZeroShow = True
  821.         Else
  822.             Bln_QcZeroShow = False
  823.         End If
  824.         
  825.         '是否显示承前过次,如显示则将页面设置指定行数控制为>1且必须指定报表行数打印输出
  826.         If .Chk_CqGcShow = 1 Then
  827.             Bln_CqGcShow = True
  828.             Dyymctbl.ZdhsCheck.Enabled = False
  829.             Dyymctbl.ZdhsCheck.Value = 1
  830.             Dyymctbl.BbhsText.Enabled = False
  831.             Dyymctbl.BbhsVScroll.Enabled = False
  832.             Dyymctbl.BbhsText.Text = .LrText(2).Text
  833.         Else
  834.             Bln_CqGcShow = False
  835.             Dyymctbl.ZdhsCheck.Enabled = True
  836.             Dyymctbl.BbhsText.Enabled = True
  837.             Dyymctbl.BbhsVScroll.Enabled = True
  838.         End If
  839.         Int_Zdzyhs = Val(.LrText(2).Text)
  840.         
  841.     End With
  842.     
  843.     '初始化各种值
  844.     Dbl_Qcyete = 0
  845.     Dbl_Qcslte = 0
  846.     Dbl_Qcwbte = 0
  847.     
  848.     Dbl_Jejfhj = 0
  849.     Dbl_Jedfhj = 0
  850.     Dbl_Sljfhj = 0
  851.     Dbl_Sldfhj = 0
  852.     Dbl_Wbjfhj = 0
  853.     Dbl_Wbdfhj = 0
  854.     
  855.     Dbl_Jejflj = 0
  856.     Dbl_Jedflj = 0
  857.     Dbl_Sljflj = 0
  858.     Dbl_Sldflj = 0
  859.     Dbl_Wbjflj = 0
  860.     Dbl_Wbdflj = 0
  861.     
  862.     Lng_MonthCount = 0
  863.     Lng_YearCount = 0
  864.     
  865.     Jsqte = CxbbGrid.FixedRows - 1
  866.     
  867.     '1.计算期初余额(金额,数量,外币),并计算截止查询起始会计期间累计数据
  868.     Sqlstr = "SELECT * From Cwzz_AccSum Where Ccode='" & Str_Ccode & "' And Year=" & Int_Year & _
  869.     " And Period=" & Int_BPeriod
  870.     Set RecTemp = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  871.     If Not RecTemp.EOF Then
  872.         Dbl_Qcyete = RecTemp.Fields("Qcye")
  873.         Dbl_Qcslte = RecTemp.Fields("Qcsl")
  874.         Dbl_Qcwbte = RecTemp.Fields("Qcwb")
  875.         
  876.         '截止累计数据需要减掉本会计期间相应记帐数据
  877.         Dbl_Jejflj = RecTemp.Fields("Byjfljje") - RecTemp.Fields("Mjje")
  878.         Dbl_Jedflj = RecTemp.Fields("Bydfljje") - RecTemp.Fields("Mdje")
  879.         Dbl_Sljflj = RecTemp.Fields("Byjfljsl") - RecTemp.Fields("Mjsl")
  880.         Dbl_Sldflj = RecTemp.Fields("Bydfljsl") - RecTemp.Fields("Mdsl")
  881.         Dbl_Wbjflj = RecTemp.Fields("Byjfljwb") - RecTemp.Fields("Mjwb")
  882.         Dbl_Wbdflj = RecTemp.Fields("Bydfljwb") - RecTemp.Fields("Mdwb")
  883.     End If
  884.     
  885.     '如果包含未记帐凭证则计算小于查询起始会计期间包含科目借贷方合计
  886.     If Bln_IncluNotBook Then
  887.         Sqlstr = "SELECT Sum(Jfje) as Jfjehj,Sum(Dfje) as Dfjehj,Sum(Jfsl) as Jfslhj,Sum(Dfsl) as Dfslhj" & _
  888.         ",Sum(Wbjfje) as Wbjfjehj,Sum(Wbdfje) as Wbdfjehj From Cwzz_V_AccVouch Where BookFlag=0 And Ccode like '" & Str_Ccode & "%' And Year=" & Int_Year & _
  889.         " And Period<" & Int_BPeriod
  890.         Set RecTemp = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  891.         If Not RecTemp.EOF Then
  892.             Dbl_Qcyete = Dbl_Qcyete + Val(RecTemp.Fields("Jfjehj") & "") - Val(RecTemp.Fields("Dfjehj") & "")
  893.             Dbl_Qcslte = Dbl_Qcslte + Val(RecTemp.Fields("Jfslhj") & "") - Val(RecTemp.Fields("Dfslhj") & "")
  894.             Dbl_Qcwbte = Dbl_Qcwbte + Val(RecTemp.Fields("Wbjfjehj") & "") - Val(RecTemp.Fields("Wbdfjehj") & "")
  895.             
  896.             '计算相应截止查询起始会计期间累计数据
  897.             Dbl_Jejflj = Dbl_Jejflj + Val(RecTemp.Fields("Jfjehj") & "")
  898.             Dbl_Jedflj = Dbl_Jedflj + Val(RecTemp.Fields("Dfjehj") & "")
  899.             Dbl_Sljflj = Dbl_Sljflj + Val(RecTemp.Fields("Jfslhj") & "")
  900.             Dbl_Sldflj = Dbl_Sldflj + Val(RecTemp.Fields("Dfslhj") & "")
  901.             Dbl_Wbjflj = Dbl_Wbjflj + Val(RecTemp.Fields("Wbjfjehj") & "")
  902.             Dbl_Wbdflj = Dbl_Wbdflj + Val(RecTemp.Fields("Wbdfjehj") & "")
  903.         End If
  904.     End If
  905.     
  906.     If (Dbl_Qcyete <> 0 Or (Bln_EndFlag And (Dbl_Qcslte <> 0 Or Dbl_Qcwbte <> 0))) Or Bln_QcZeroShow Then    '如果期初数据为零,且用户选择不输出则不显示此行数据
  907.         CxbbGrid.AddItem ""
  908.         Jsqte = Jsqte + 1
  909.         
  910.         '将期初数据写入网格(第1会计期间为上年结转,其余会计期间为期初余额)
  911.         If Int_BPeriod = 1 Then
  912.             CxbbGrid.TextMatrix(Jsqte, Sydz("003", GridStr(), Szzls)) = "上年结转"
  913.         Else
  914.             CxbbGrid.TextMatrix(Jsqte, Sydz("003", GridStr(), Szzls)) = "期初余额"
  915.         End If
  916.         
  917.         '输出余额
  918.         Call Sub_OutBalance(Jsqte, Bln_EndFlag, Bln_ForeignFlag, Dbl_Qcyete, Dbl_Qcslte, Dbl_Qcwbte)
  919.     End If
  920.     
  921.     
  922.     '2.读取查询会计期间范围内所有符合条件明细帐数据(以年度+会计期间),并写入网格
  923.     
  924.     Bln_NotFirst = False
  925.     
  926.     '筛选所有符合条件数据
  927.     Sqlstr = "SELECT *" & _
  928.     " From Cwzz_V_AccVouchAss Where Ccode like '" & Str_Ccode & "%'And Year=" & Int_Year & _
  929.     " And Period>=" & Int_BPeriod & " And Period<=" & Int_EPeriod
  930.     If Not Bln_IncluNotBook Then
  931.         Sqlstr = Sqlstr & " And BookFlag=1"
  932.     End If
  933.     Sqlstr = Sqlstr & " Order By Year,Period,Ddate,VouchClassCode,VouchNo"
  934.     
  935.     Set RecTemp = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  936.     
  937.     With RecTemp
  938.         
  939.         Do While Not .EOF
  940.             
  941.             If Bln_NotFirst Then
  942.                 
  943.                 '当前进行会计期间发生变化则添加本月合计及本年累计
  944.                 If .Fields("Period") <> Int_DqPeriod Then
  945.                     '显示本月合计
  946.                     If Lng_MonthCount <> 0 Then
  947.                         CxbbGrid.AddItem ""
  948.                         Jsqte = Jsqte + 1
  949.                         
  950.                         '输出本月合计
  951.                         Call Sub_OutPeriodSum(Jsqte, Bln_EndFlag, Bln_ForeignFlag, Int_DqPeriod, Dbl_Jejfhj, Dbl_Jedfhj, Dbl_Sljfhj, Dbl_Sldfhj, Dbl_Wbjfhj, Dbl_Wbdfhj)
  952.                         
  953.                         '输出余额
  954.                         Call Sub_OutBalance(Jsqte, Bln_EndFlag, Bln_ForeignFlag, Dbl_Qcyete, Dbl_Qcslte, Dbl_Qcwbte)
  955.                     End If
  956.                     
  957.                     '重新初始化本月合计数据
  958.                     Dbl_Jejfhj = 0
  959.                     Dbl_Jedfhj = 0
  960.                     Dbl_Sljfhj = 0
  961.                     Dbl_Sldfhj = 0
  962.                     Dbl_Wbjfhj = 0
  963.                     Dbl_Wbdfhj = 0
  964.                     
  965.                     Lng_MonthCount = 0
  966.                     
  967.                     '显示本年累计
  968.                     If Lng_YearCount <> 0 Then
  969.                         CxbbGrid.AddItem ""
  970.                         Jsqte = Jsqte + 1
  971.                         
  972.                         '输出本年累计
  973.                         Call Sub_OutYearSum(Jsqte, Bln_EndFlag, Bln_ForeignFlag, Int_DqPeriod, Dbl_Jejflj, Dbl_Jedflj, Dbl_Sljflj, Dbl_Sldflj, Dbl_Wbjflj, Dbl_Wbdflj)
  974.                         
  975.                         '输出余额
  976.                         Call Sub_OutBalance(Jsqte, Bln_EndFlag, Bln_ForeignFlag, Dbl_Qcyete, Dbl_Qcslte, Dbl_Qcwbte)
  977.                     End If
  978.                     
  979.                 End If        '显示本月合计,本年累计完毕
  980.             End If
  981.             
  982.             Bln_NotFirst = True
  983.             
  984.             '显示明细数据
  985.             CxbbGrid.AddItem ""
  986.             Jsqte = Jsqte + 1
  987.             
  988.             '本月、本年记录计数器+1
  989.             Lng_MonthCount = Lng_MonthCount + 1
  990.             Lng_YearCount = Lng_YearCount + 1
  991.             
  992.             '未记帐明细分录变色显示
  993.             If .Fields("BookFlag") = 0 Then
  994.                 CxbbGrid.Cell(flexcpBackColor, Jsqte, 0, , CxbbGrid.Cols - 1) = Lab_Color(0).BackColor
  995.             End If
  996.             
  997.             '修改当前会计期间
  998.             Int_DqPeriod = .Fields("Period")
  999.             
  1000.             CxbbGrid.TextMatrix(Jsqte, 0) = .Fields("VouchId")              '凭证ID
  1001.             
  1002.             
  1003.             If IsDate(.Fields("Ddate")) Then
  1004.                 CxbbGrid.TextMatrix(Jsqte, Sydz("001", GridStr(), Szzls)) = .Fields("Ddate")                    '日期
  1005.             End If
  1006.             CxbbGrid.TextMatrix(Jsqte, Sydz("002", GridStr(), Szzls)) = Trim(.Fields("VouchClassCode") & "") + "-" + Mid(Trim(Str(10000 + .Fields("VouchNo"))), 2, 4) '凭证字号
  1007.             CxbbGrid.TextMatrix(Jsqte, Sydz("003", GridStr(), Szzls)) = Trim(.Fields("Digest") & "")           '摘要
  1008.             
  1009.             '部门
  1010.             If Trim(.Fields("DeptName") & "") <> "" Then
  1011.                 CxbbGrid.TextMatrix(Jsqte, Sydz("003", GridStr(), Szzls)) = CxbbGrid.TextMatrix(Jsqte, Sydz("003", GridStr(), Szzls)) + " " + Trim(.Fields("DeptName") & "")
  1012.             End If
  1013.             '个人
  1014.             If Trim(.Fields("PersonName") & "") <> "" Then
  1015.                 CxbbGrid.TextMatrix(Jsqte, Sydz("003", GridStr(), Szzls)) = CxbbGrid.TextMatrix(Jsqte, Sydz("003", GridStr(), Szzls)) + " " + Trim(.Fields("PersonName") & "")
  1016.             End If
  1017.             '客户
  1018.             If Trim(.Fields("CusName") & "") <> "" Then
  1019.                 CxbbGrid.TextMatrix(Jsqte, Sydz("003", GridStr(), Szzls)) = CxbbGrid.TextMatrix(Jsqte, Sydz("003", GridStr(), Szzls)) + " " + Trim(.Fields("CusName") & "")
  1020.             End If
  1021.             '项目
  1022.             If Trim(.Fields("ItemName") & "") <> "" Then
  1023.                 CxbbGrid.TextMatrix(Jsqte, Sydz("003", GridStr(), Szzls)) = CxbbGrid.TextMatrix(Jsqte, Sydz("003", GridStr(), Szzls)) + " " + Trim(.Fields("ItemName") & "")
  1024.             End If
  1025.             
  1026.             If .Fields("Jfje") <> 0 Then                                                                       '借方金额
  1027.                 CxbbGrid.TextMatrix(Jsqte, Sydz("006", GridStr(), Szzls)) = .Fields("Jfje")
  1028.                 CxbbGrid.TextMatrix(Jsqte, Sydz("009", GridStr(), Szzls)) = .Fields("Jfje")
  1029.             End If
  1030.             If .Fields("Dfje") <> 0 Then                                                                       '贷方金额
  1031.                 CxbbGrid.TextMatrix(Jsqte, Sydz("010", GridStr(), Szzls)) = .Fields("Dfje")
  1032.                 CxbbGrid.TextMatrix(Jsqte, Sydz("013", GridStr(), Szzls)) = .Fields("Dfje")
  1033.             End If
  1034.             
  1035.             '只有末级科目才显示数量和外币,数量不为零则计算单价
  1036.             If Bln_EndFlag Then
  1037.                 If .Fields("Jfsl") <> 0 Then                                                                    '借方数量
  1038.                     CxbbGrid.TextMatrix(Jsqte, Sydz("007", GridStr(), Szzls)) = .Fields("Jfsl")
  1039.                     If .Fields("Jfje") <> 0 Then
  1040.                         CxbbGrid.TextMatrix(Jsqte, Sydz("004", GridStr(), Szzls)) = Format(.Fields("Jfje") / .Fields("Jfsl"), "##." + String(Xtdjxsws, "0"))
  1041.                     Else
  1042.                         CxbbGrid.TextMatrix(Jsqte, Sydz("004", GridStr(), Szzls)) = Format(.Fields("Dfje") / .Fields("Jfsl"), "##." + String(Xtdjxsws, "0"))
  1043.                     End If
  1044.                 End If
  1045.                 If .Fields("Dfsl") <> 0 Then                                                                    '贷方数量
  1046.                     CxbbGrid.TextMatrix(Jsqte, Sydz("011", GridStr(), Szzls)) = .Fields("Dfsl")
  1047.                     If .Fields("Jfje") <> 0 Then
  1048.                         CxbbGrid.TextMatrix(Jsqte, Sydz("004", GridStr(), Szzls)) = Format(.Fields("Jfje") / .Fields("Dfsl"), "##." + String(Xtdjxsws, "0"))
  1049.                     Else
  1050.                         CxbbGrid.TextMatrix(Jsqte, Sydz("004", GridStr(), Szzls)) = Format(.Fields("Dfje") / .Fields("Dfsl"), "##." + String(Xtdjxsws, "0"))
  1051.                     End If
  1052.                 End If
  1053.                 If .Fields("Wbjfje") <> 0 Then                                                                  '借方外币
  1054.                     CxbbGrid.TextMatrix(Jsqte, Sydz("008", GridStr(), Szzls)) = .Fields("Wbjfje")
  1055.                 End If
  1056.                 If .Fields("Wbdfje") <> 0 Then                                                                  '贷方外币
  1057.                     CxbbGrid.TextMatrix(Jsqte, Sydz("012", GridStr(), Szzls)) = .Fields("Wbdfje")
  1058.                 End If
  1059.                 If .Fields("AccRate") <> 0 Then                                                                 '记帐汇率
  1060.                     CxbbGrid.TextMatrix(Jsqte, Sydz("005", GridStr(), Szzls)) = Format(.Fields("AccRate"), "##." + String(Int_Wbhlxsws, "0"))
  1061.                 End If
  1062.                 
  1063.             End If
  1064.             
  1065.             '累加本月合计,本年累计数据
  1066.             Dbl_Jejfhj = Dbl_Jejfhj + .Fields("Jfje")
  1067.             Dbl_Jedfhj = Dbl_Jedfhj + .Fields("Dfje")
  1068.             Dbl_Sljfhj = Dbl_Sljfhj + .Fields("Jfsl")
  1069.             Dbl_Sldfhj = Dbl_Sldfhj + .Fields("Dfsl")
  1070.             Dbl_Wbjfhj = Dbl_Wbjfhj + .Fields("Wbjfje")
  1071.             Dbl_Wbdfhj = Dbl_Wbdfhj + .Fields("Wbdfje")
  1072.             
  1073.             Dbl_Jejflj = Dbl_Jejflj + .Fields("Jfje")
  1074.             Dbl_Jedflj = Dbl_Jedflj + .Fields("Dfje")
  1075.             Dbl_Sljflj = Dbl_Sljflj + .Fields("Jfsl")
  1076.             Dbl_Sldflj = Dbl_Sldflj + .Fields("Dfsl")
  1077.             Dbl_Wbjflj = Dbl_Wbjflj + .Fields("Wbjfje")
  1078.             Dbl_Wbdflj = Dbl_Wbdflj + .Fields("Wbdfje")
  1079.             
  1080.             '3.计算余额
  1081.             Dbl_Qcyete = Dbl_Qcyete + .Fields("Jfje") - .Fields("Dfje")
  1082.             Dbl_Qcslte = Dbl_Qcslte + .Fields("Jfsl") - .Fields("Dfsl")
  1083.             Dbl_Qcwbte = Dbl_Qcwbte + .Fields("Wbjfje") - .Fields("Wbdfje")
  1084.             
  1085.             '输出余额
  1086.             Call Sub_OutBalance(Jsqte, Bln_EndFlag, Bln_ForeignFlag, Dbl_Qcyete, Dbl_Qcslte, Dbl_Qcwbte)
  1087.             
  1088.             .MoveNext
  1089.             
  1090.             '计算是否输出承前/过次行(如果用户选择输出承前/过次)
  1091.             If Bln_CqGcShow Then
  1092.                 If Not .EOF Then
  1093.                     If .Fields("Period") = Int_DqPeriod Then
  1094.                         Call Sub_OutQcGc(Jsqte, Int_Zdzyhs, Bln_EndFlag, Bln_ForeignFlag, Int_DqPeriod, Dbl_Jejfhj, Dbl_Jedfhj, Dbl_Sljfhj, Dbl_Sldfhj, Dbl_Wbjfhj, Dbl_Wbdfhj, Dbl_Qcyete, Dbl_Qcslte, Dbl_Qcwbte)
  1095.                     End If
  1096.                 End If
  1097.             End If
  1098.             
  1099.         Loop
  1100.         
  1101.         '添加本月合计及本年累计
  1102.         
  1103.         If Bln_NotFirst Then
  1104.             
  1105.             If Lng_MonthCount <> 0 Then
  1106.                 CxbbGrid.AddItem ""
  1107.                 Jsqte = Jsqte + 1
  1108.                 
  1109.                 '输出本月合计
  1110.                 Call Sub_OutPeriodSum(Jsqte, Bln_EndFlag, Bln_ForeignFlag, Int_DqPeriod, Dbl_Jejfhj, Dbl_Jedfhj, Dbl_Sljfhj, Dbl_Sldfhj, Dbl_Wbjfhj, Dbl_Wbdfhj)
  1111.                 
  1112.                 '输出余额
  1113.                 Call Sub_OutBalance(Jsqte, Bln_EndFlag, Bln_ForeignFlag, Dbl_Qcyete, Dbl_Qcslte, Dbl_Qcwbte)
  1114.             End If
  1115.             
  1116.             '显示本年累计
  1117.             If Lng_YearCount <> 0 Then
  1118.                 CxbbGrid.AddItem ""
  1119.                 Jsqte = Jsqte + 1
  1120.                 
  1121.                 '输出本年累计
  1122.                 Call Sub_OutYearSum(Jsqte, Bln_EndFlag, Bln_ForeignFlag, Int_DqPeriod, Dbl_Jejflj, Dbl_Jedflj, Dbl_Sljflj, Dbl_Sldflj, Dbl_Wbjflj, Dbl_Wbdflj)
  1123.                 
  1124.                 '输出余额
  1125.                 Call Sub_OutBalance(Jsqte, Bln_EndFlag, Bln_ForeignFlag, Dbl_Qcyete, Dbl_Qcslte, Dbl_Qcwbte)
  1126.             End If
  1127.             
  1128.         End If
  1129.         
  1130.     End With
  1131.     
  1132.     '重置网格行高
  1133.     For Jsqte = CxbbGrid.FixedRows To CxbbGrid.Rows - 1
  1134.         CxbbGrid.RowHeight(Jsqte) = Sjhgd
  1135.     Next Jsqte
  1136.     
  1137. End Sub
  1138. Private Sub Combo_AccFormat_Click()                    '用户选择不同帐页格式
  1139.     Dim Int_Coljsq As Integer         '网格列临时计数器
  1140.     
  1141.     '为了加快显示速度
  1142.     CxbbGrid.Redraw = False
  1143.     
  1144.     For Int_Coljsq = Qslz To CxbbGrid.Cols - 1
  1145.         CxbbGrid.ColHidden(Int_Coljsq) = True
  1146.     Next Int_Coljsq
  1147.     
  1148.     Select Case Combo_AccFormat
  1149.     Case "金额式"
  1150.         CxbbGrid.ColHidden(Sydz("001", GridStr(), Szzls)) = False      '日期
  1151.         CxbbGrid.ColHidden(Sydz("002", GridStr(), Szzls)) = False      '凭证字号
  1152.         CxbbGrid.ColHidden(Sydz("003", GridStr(), Szzls)) = False      '摘要
  1153.         CxbbGrid.ColHidden(Sydz("006", GridStr(), Szzls)) = False      '借方.借方
  1154.         CxbbGrid.ColHidden(Sydz("010", GridStr(), Szzls)) = False      '贷方.贷方
  1155.         CxbbGrid.ColHidden(Sydz("014", GridStr(), Szzls)) = False      '方向.方向
  1156.         CxbbGrid.ColHidden(Sydz("020", GridStr(), Szzls)) = False      '余额.余额
  1157.         '重新调入打印页面设置窗体
  1158.         Unload Dyymctbl
  1159.         XtReportCode = "cwzz_mxzcx"
  1160.         Load Dyymctbl
  1161.     Case "外币金额式"
  1162.         CxbbGrid.ColHidden(Sydz("001", GridStr(), Szzls)) = False      '日期
  1163.         CxbbGrid.ColHidden(Sydz("002", GridStr(), Szzls)) = False      '凭证字号
  1164.         CxbbGrid.ColHidden(Sydz("003", GridStr(), Szzls)) = False      '摘要
  1165.         CxbbGrid.ColHidden(Sydz("005", GridStr(), Szzls)) = False      '汇率
  1166.         CxbbGrid.ColHidden(Sydz("008", GridStr(), Szzls)) = False      '借方.外币
  1167.         CxbbGrid.ColHidden(Sydz("009", GridStr(), Szzls)) = False      '借方.金额
  1168.         CxbbGrid.ColHidden(Sydz("012", GridStr(), Szzls)) = False      '贷方.外币
  1169.         CxbbGrid.ColHidden(Sydz("013", GridStr(), Szzls)) = False      '贷方.金额
  1170.         CxbbGrid.ColHidden(Sydz("014", GridStr(), Szzls)) = False      '方向.方向
  1171.         CxbbGrid.ColHidden(Sydz("017", GridStr(), Szzls)) = False      '余额.外币
  1172.         CxbbGrid.ColHidden(Sydz("018", GridStr(), Szzls)) = False      '余额.汇率
  1173.         CxbbGrid.ColHidden(Sydz("019", GridStr(), Szzls)) = False      '余额.金额
  1174.         '重新调入打印页面设置窗体
  1175.         Unload Dyymctbl
  1176.         XtReportCode = "cwzz_mxzcx1"
  1177.         Load Dyymctbl
  1178.     Case "数量金额式"
  1179.         CxbbGrid.ColHidden(Sydz("001", GridStr(), Szzls)) = False      '日期
  1180.         CxbbGrid.ColHidden(Sydz("002", GridStr(), Szzls)) = False      '凭证字号
  1181.         CxbbGrid.ColHidden(Sydz("003", GridStr(), Szzls)) = False      '摘要
  1182.         CxbbGrid.ColHidden(Sydz("004", GridStr(), Szzls)) = False      '单价
  1183.         CxbbGrid.ColHidden(Sydz("007", GridStr(), Szzls)) = False      '借方.数量
  1184.         CxbbGrid.ColHidden(Sydz("009", GridStr(), Szzls)) = False      '借方.金额
  1185.         CxbbGrid.ColHidden(Sydz("011", GridStr(), Szzls)) = False      '贷方.数量
  1186.         CxbbGrid.ColHidden(Sydz("013", GridStr(), Szzls)) = False      '贷方.金额
  1187.         CxbbGrid.ColHidden(Sydz("014", GridStr(), Szzls)) = False      '方向.方向
  1188.         CxbbGrid.ColHidden(Sydz("015", GridStr(), Szzls)) = False      '余额.数量
  1189.         CxbbGrid.ColHidden(Sydz("016", GridStr(), Szzls)) = False      '余额.单价
  1190.         CxbbGrid.ColHidden(Sydz("019", GridStr(), Szzls)) = False      '余额.金额
  1191.         '重新调入打印页面设置窗体
  1192.         Unload Dyymctbl
  1193.         XtReportCode = "cwzz_mxzcx2"
  1194.         Load Dyymctbl
  1195.     Case "数量外币式"
  1196.         CxbbGrid.ColHidden(Sydz("001", GridStr(), Szzls)) = False      '日期
  1197.         CxbbGrid.ColHidden(Sydz("002", GridStr(), Szzls)) = False      '凭证字号
  1198.         CxbbGrid.ColHidden(Sydz("003", GridStr(), Szzls)) = False      '摘要
  1199.         CxbbGrid.ColHidden(Sydz("004", GridStr(), Szzls)) = False      '单价
  1200.         CxbbGrid.ColHidden(Sydz("005", GridStr(), Szzls)) = False      '汇率
  1201.         CxbbGrid.ColHidden(Sydz("007", GridStr(), Szzls)) = False      '借方.数量
  1202.         CxbbGrid.ColHidden(Sydz("008", GridStr(), Szzls)) = False      '借方.外币
  1203.         CxbbGrid.ColHidden(Sydz("009", GridStr(), Szzls)) = False      '借方.金额
  1204.         CxbbGrid.ColHidden(Sydz("011", GridStr(), Szzls)) = False      '贷方.数量
  1205.         CxbbGrid.ColHidden(Sydz("012", GridStr(), Szzls)) = False      '贷方.外币
  1206.         CxbbGrid.ColHidden(Sydz("013", GridStr(), Szzls)) = False      '贷方.金额
  1207.         CxbbGrid.ColHidden(Sydz("014", GridStr(), Szzls)) = False      '方向.方向
  1208.         CxbbGrid.ColHidden(Sydz("015", GridStr(), Szzls)) = False      '余额.数量
  1209.         CxbbGrid.ColHidden(Sydz("016", GridStr(), Szzls)) = False      '余额.单价
  1210.         CxbbGrid.ColHidden(Sydz("017", GridStr(), Szzls)) = False      '余额.外币
  1211.         CxbbGrid.ColHidden(Sydz("018", GridStr(), Szzls)) = False      '余额.汇率
  1212.         CxbbGrid.ColHidden(Sydz("019", GridStr(), Szzls)) = False      '余额.金额
  1213.         '重新调入打印页面设置窗体
  1214.         Unload Dyymctbl
  1215.         XtReportCode = "cwzz_mxzcx3"
  1216.         Load Dyymctbl
  1217.     End Select
  1218.     CxbbGrid.Redraw = True
  1219. End Sub
  1220. Private Sub Sub_OutBalance(Jsqte As Long, Bln_EndFlag As Boolean, Bln_ForeignFlag As Boolean, Dbl_Qcyete#, Dbl_Qcslte#, Dbl_Qcwbte#)         '输出余额
  1221.     If Dbl_Qcyete = 0 Then
  1222.         CxbbGrid.TextMatrix(Jsqte, Sydz("014", GridStr(), Szzls)) = "平"          '期初方向
  1223.         If Bln_EndFlag And Dbl_Qcslte <> 0 Then
  1224.             CxbbGrid.TextMatrix(Jsqte, Sydz("015", GridStr(), Szzls)) = Dbl_Qcslte
  1225.         End If
  1226.         If Bln_EndFlag And Bln_ForeignFlag And Dbl_Qcwbte <> 0 Then
  1227.             CxbbGrid.TextMatrix(Jsqte, Sydz("017", GridStr(), Szzls)) = Dbl_Qcwbte
  1228.         End If
  1229.     Else
  1230.         If Dbl_Qcyete > 0 Then
  1231.             CxbbGrid.TextMatrix(Jsqte, Sydz("014", GridStr(), Szzls)) = "借"
  1232.             CxbbGrid.TextMatrix(Jsqte, Sydz("019", GridStr(), Szzls)) = Dbl_Qcyete
  1233.             CxbbGrid.TextMatrix(Jsqte, Sydz("020", GridStr(), Szzls)) = Dbl_Qcyete
  1234.             If Bln_EndFlag And Dbl_Qcslte <> 0 Then
  1235.                 CxbbGrid.TextMatrix(Jsqte, Sydz("015", GridStr(), Szzls)) = Dbl_Qcslte
  1236.             End If
  1237.             If Bln_EndFlag And Bln_ForeignFlag And Dbl_Qcwbte <> 0 Then
  1238.                 CxbbGrid.TextMatrix(Jsqte, Sydz("017", GridStr(), Szzls)) = Dbl_Qcwbte
  1239.             End If
  1240.         Else
  1241.             CxbbGrid.TextMatrix(Jsqte, Sydz("014", GridStr(), Szzls)) = "贷"
  1242.             CxbbGrid.TextMatrix(Jsqte, Sydz("019", GridStr(), Szzls)) = -Dbl_Qcyete
  1243.             CxbbGrid.TextMatrix(Jsqte, Sydz("020", GridStr(), Szzls)) = -Dbl_Qcyete
  1244.             If Bln_EndFlag And Dbl_Qcslte <> 0 Then
  1245.                 CxbbGrid.TextMatrix(Jsqte, Sydz("015", GridStr(), Szzls)) = -Dbl_Qcslte
  1246.             End If
  1247.             If Bln_EndFlag And Bln_ForeignFlag And Dbl_Qcwbte <> 0 Then
  1248.                 CxbbGrid.TextMatrix(Jsqte, Sydz("017", GridStr(), Szzls)) = -Dbl_Qcwbte
  1249.             End If
  1250.         End If
  1251.         
  1252.         '输出单价
  1253.         If Bln_EndFlag And Dbl_Qcslte <> 0 Then
  1254.             CxbbGrid.TextMatrix(Jsqte, Sydz("016", GridStr(), Szzls)) = Format(Dbl_Qcyete / Dbl_Qcslte, "##." + String(Xtdjxsws, "0"))
  1255.         End If
  1256.         '输出外币汇率
  1257.         If Bln_EndFlag And Bln_ForeignFlag And Dbl_Qcwbte <> 0 Then
  1258.             If Bln_ConVertFlag Then      '(外币/汇率=本位币)
  1259.                 CxbbGrid.TextMatrix(Jsqte, Sydz("018", GridStr(), Szzls)) = Format(Dbl_Qcwbte / Dbl_Qcyete, "##." + String(Int_Wbhlxsws, "0"))
  1260.             Else
  1261.                 CxbbGrid.TextMatrix(Jsqte, Sydz("018", GridStr(), Szzls)) = Format(Dbl_Qcyete / Dbl_Qcwbte, "##." + String(Int_Wbhlxsws, "0"))
  1262.             End If
  1263.         End If
  1264.         
  1265.     End If
  1266. End Sub
  1267. Private Sub Sub_OutPeriodSum(Jsqte As Long, Bln_EndFlag As Boolean, Bln_ForeignFlag As Boolean, Int_DqPeriod%, Dbl_Jejfhj#, Dbl_Jedfhj#, Dbl_Sljfhj#, Dbl_Sldfhj#, Dbl_Wbjfhj#, Dbl_Wbdfhj#) '输出本月合计
  1268.     CxbbGrid.TextMatrix(Jsqte, Sydz("001", GridStr(), Szzls)) = Mid(Trim(Str(100 + Int_DqPeriod)), 2, 2)
  1269.     CxbbGrid.TextMatrix(Jsqte, Sydz("003", GridStr(), Szzls)) = "本月合计"
  1270.     If Dbl_Jejfhj <> 0 Then                                                        '本月借方金额合计
  1271.         CxbbGrid.TextMatrix(Jsqte, Sydz("006", GridStr(), Szzls)) = Dbl_Jejfhj
  1272.         CxbbGrid.TextMatrix(Jsqte, Sydz("009", GridStr(), Szzls)) = Dbl_Jejfhj
  1273.     End If
  1274.     If Dbl_Jedfhj <> 0 Then                                                        '本月贷方金额合计
  1275.         CxbbGrid.TextMatrix(Jsqte, Sydz("010", GridStr(), Szzls)) = Dbl_Jedfhj
  1276.         CxbbGrid.TextMatrix(Jsqte, Sydz("013", GridStr(), Szzls)) = Dbl_Jedfhj
  1277.     End If
  1278.     
  1279.     '只有末级科目才显示数量和外币
  1280.     If Bln_EndFlag Then
  1281.         If Dbl_Sljfhj <> 0 Then                                                     '本月借方数量合计
  1282.             CxbbGrid.TextMatrix(Jsqte, Sydz("007", GridStr(), Szzls)) = Dbl_Sljfhj
  1283.         End If
  1284.         If Dbl_Sldfhj <> 0 Then                                                     '本月贷方数量合计
  1285.             CxbbGrid.TextMatrix(Jsqte, Sydz("011", GridStr(), Szzls)) = Dbl_Sldfhj
  1286.         End If
  1287.     End If
  1288.     If Bln_EndFlag And Bln_ForeignFlag Then
  1289.         If Dbl_Wbjfhj <> 0 Then                                                     '本月借方外币合计
  1290.             CxbbGrid.TextMatrix(Jsqte, Sydz("008", GridStr(), Szzls)) = Dbl_Wbjfhj
  1291.         End If
  1292.         If Dbl_Wbdfhj <> 0 Then                                                     '本月贷方外币合计
  1293.             CxbbGrid.TextMatrix(Jsqte, Sydz("012", GridStr(), Szzls)) = Dbl_Wbdfhj
  1294.         End If
  1295.     End If
  1296. End Sub
  1297. Private Sub Sub_OutYearSum(Jsqte As Long, Bln_EndFlag As Boolean, Bln_ForeignFlag As Boolean, Int_DqPeriod%, Dbl_Jejflj#, Dbl_Jedflj#, Dbl_Sljflj#, Dbl_Sldflj#, Dbl_Wbjflj#, Dbl_Wbdflj#) '输出本年累计
  1298.     CxbbGrid.TextMatrix(Jsqte, Sydz("001", GridStr(), Szzls)) = Mid(Trim(Str(100 + Int_DqPeriod)), 2, 2)
  1299.     CxbbGrid.TextMatrix(Jsqte, Sydz("003", GridStr(), Szzls)) = "本年累计"
  1300.     If Dbl_Jejflj <> 0 Then                                                        '本年借方金额累计
  1301.         CxbbGrid.TextMatrix(Jsqte, Sydz("006", GridStr(), Szzls)) = Dbl_Jejflj
  1302.         CxbbGrid.TextMatrix(Jsqte, Sydz("009", GridStr(), Szzls)) = Dbl_Jejflj
  1303.     End If
  1304.     If Dbl_Jedflj <> 0 Then                                                        '本年贷方金额累计
  1305.         CxbbGrid.TextMatrix(Jsqte, Sydz("010", GridStr(), Szzls)) = Dbl_Jedflj
  1306.         CxbbGrid.TextMatrix(Jsqte, Sydz("013", GridStr(), Szzls)) = Dbl_Jedflj
  1307.     End If
  1308.     
  1309.     '只有末级科目才显示数量和外币
  1310.     If Bln_EndFlag Then
  1311.         If Dbl_Sljflj <> 0 Then                                                     '本年借方数量累计
  1312.             CxbbGrid.TextMatrix(Jsqte, Sydz("007", GridStr(), Szzls)) = Dbl_Sljflj
  1313.         End If
  1314.         If Dbl_Sldflj <> 0 Then                                                     '本年贷方数量累计
  1315.             CxbbGrid.TextMatrix(Jsqte, Sydz("011", GridStr(), Szzls)) = Dbl_Sldflj
  1316.         End If
  1317.     End If
  1318.     If Bln_EndFlag And Bln_ForeignFlag Then
  1319.         If Dbl_Wbjflj <> 0 Then                                                     '本年借方外币累计
  1320.             CxbbGrid.TextMatrix(Jsqte, Sydz("008", GridStr(), Szzls)) = Dbl_Wbjflj
  1321.         End If
  1322.         If Dbl_Wbdflj <> 0 Then                                                     '本年贷方外币累计
  1323.             CxbbGrid.TextMatrix(Jsqte, Sydz("012", GridStr(), Szzls)) = Dbl_Wbdflj
  1324.         End If
  1325.     End If
  1326. End Sub
  1327. Private Sub Sub_OutQcGc(Jsqte As Long, Int_Zdzyhs%, Bln_EndFlag As Boolean, Bln_ForeignFlag As Boolean, Int_DqPeriod%, Dbl_Jejfhj#, Dbl_Jedfhj#, Dbl_Sljfhj#, Dbl_Sldfhj#, Dbl_Wbjfhj#, Dbl_Wbdfhj#, Dbl_Qcyete#, Dbl_Qcslte#, Dbl_Qcwbte#) '输出承前/过次行
  1328.     If (Jsqte - CxbbGrid.FixedRows + 2) Mod Int_Zdzyhs = 0 Then
  1329.         CxbbGrid.AddItem ""
  1330.         Jsqte = Jsqte + 1
  1331.         CxbbGrid.Cell(flexcpBackColor, Jsqte, 0, , CxbbGrid.Cols - 1) = Lab_Color(1).BackColor
  1332.         CxbbGrid.TextMatrix(Jsqte, Sydz("001", GridStr(), Szzls)) = Mid(Trim(Str(100 + Int_DqPeriod)), 2, 2)
  1333.         CxbbGrid.TextMatrix(Jsqte, Sydz("003", GridStr(), Szzls)) = "过次页"
  1334.         If Dbl_Jejfhj <> 0 Then                                                        '本月借方金额合计
  1335.             CxbbGrid.TextMatrix(Jsqte, Sydz("006", GridStr(), Szzls)) = Dbl_Jejfhj
  1336.             CxbbGrid.TextMatrix(Jsqte, Sydz("009", GridStr(), Szzls)) = Dbl_Jejfhj
  1337.         End If
  1338.         If Dbl_Jedfhj <> 0 Then                                                        '本月贷方金额合计
  1339.             CxbbGrid.TextMatrix(Jsqte, Sydz("010", GridStr(), Szzls)) = Dbl_Jedfhj
  1340.             CxbbGrid.TextMatrix(Jsqte, Sydz("013", GridStr(), Szzls)) = Dbl_Jedfhj
  1341.         End If
  1342.         
  1343.         '只有末级科目才显示数量和外币
  1344.         If Bln_EndFlag Then
  1345.             If Dbl_Sljfhj <> 0 Then                                                     '本月借方数量合计
  1346.                 CxbbGrid.TextMatrix(Jsqte, Sydz("007", GridStr(), Szzls)) = Dbl_Sljfhj
  1347.             End If
  1348.             If Dbl_Sldfhj <> 0 Then                                                     '本月贷方数量合计
  1349.                 CxbbGrid.TextMatrix(Jsqte, Sydz("011", GridStr(), Szzls)) = Dbl_Sldfhj
  1350.             End If
  1351.         End If
  1352.         
  1353.         If Bln_EndFlag And Bln_ForeignFlag Then
  1354.             If Dbl_Wbjfhj <> 0 Then                                                     '本月借方外币合计
  1355.                 CxbbGrid.TextMatrix(Jsqte, Sydz("008", GridStr(), Szzls)) = Dbl_Wbjfhj
  1356.             End If
  1357.             If Dbl_Wbdfhj <> 0 Then                                                     '本月贷方外币合计
  1358.                 CxbbGrid.TextMatrix(Jsqte, Sydz("012", GridStr(), Szzls)) = Dbl_Wbdfhj
  1359.             End If
  1360.         End If
  1361.         
  1362.         '输出余额
  1363.         Call Sub_OutBalance(Jsqte, Bln_EndFlag, Bln_ForeignFlag, Dbl_Qcyete, Dbl_Qcslte, Dbl_Qcwbte)
  1364.         
  1365.         CxbbGrid.AddItem ""
  1366.         Jsqte = Jsqte + 1
  1367.         CxbbGrid.Cell(flexcpBackColor, Jsqte, 0, , CxbbGrid.Cols - 1) = Lab_Color(2).BackColor
  1368.         CxbbGrid.TextMatrix(Jsqte, Sydz("001", GridStr(), Szzls)) = Mid(Trim(Str(100 + Int_DqPeriod)), 2, 2)
  1369.         CxbbGrid.TextMatrix(Jsqte, Sydz("003", GridStr(), Szzls)) = "承前页"
  1370.         If Dbl_Jejfhj <> 0 Then                                                        '本月借方金额合计
  1371.             CxbbGrid.TextMatrix(Jsqte, Sydz("006", GridStr(), Szzls)) = Dbl_Jejfhj
  1372.             CxbbGrid.TextMatrix(Jsqte, Sydz("009", GridStr(), Szzls)) = Dbl_Jejfhj
  1373.         End If
  1374.         If Dbl_Jedfhj <> 0 Then                                                        '本月贷方金额合计
  1375.             CxbbGrid.TextMatrix(Jsqte, Sydz("010", GridStr(), Szzls)) = Dbl_Jedfhj
  1376.             CxbbGrid.TextMatrix(Jsqte, Sydz("013", GridStr(), Szzls)) = Dbl_Jedfhj
  1377.         End If
  1378.         
  1379.         '只有末级科目才显示数量和外币
  1380.         If Bln_EndFlag Then
  1381.             If Dbl_Sljfhj <> 0 Then                                                     '本月借方数量合计
  1382.                 CxbbGrid.TextMatrix(Jsqte, Sydz("007", GridStr(), Szzls)) = Dbl_Sljfhj
  1383.             End If
  1384.             If Dbl_Sldfhj <> 0 Then                                                     '本月贷方数量合计
  1385.                 CxbbGrid.TextMatrix(Jsqte, Sydz("011", GridStr(), Szzls)) = Dbl_Sldfhj
  1386.             End If
  1387.         End If
  1388.         
  1389.         If Bln_EndFlag And Bln_ForeignFlag Then
  1390.             If Dbl_Wbjfhj <> 0 Then                                                     '本月借方外币合计
  1391.                 CxbbGrid.TextMatrix(Jsqte, Sydz("008", GridStr(), Szzls)) = Dbl_Wbjfhj
  1392.             End If
  1393.             If Dbl_Wbdfhj <> 0 Then                                                     '本月贷方外币合计
  1394.                 CxbbGrid.TextMatrix(Jsqte, Sydz("012", GridStr(), Szzls)) = Dbl_Wbdfhj
  1395.             End If
  1396.         End If
  1397.         
  1398.         '输出余额
  1399.         Call Sub_OutBalance(Jsqte, Bln_EndFlag, Bln_ForeignFlag, Dbl_Qcyete, Dbl_Qcslte, Dbl_Qcwbte)
  1400.     End If
  1401. End Sub
  1402. Private Sub CxbbGrid_DblClick()          '用户双击网格调入相应凭证
  1403.     Dim RecTemp As New ADODB.Recordset
  1404.     
  1405.     With CxbbGrid
  1406.         '非数据行退出
  1407.         If CxbbGrid.Row < CxbbGrid.FixedRows Then
  1408.             Exit Sub
  1409.         End If
  1410.         If Trim(.TextMatrix(.Row, 0)) = "" Then
  1411.             Exit Sub
  1412.         End If
  1413.     End With
  1414.     Sqlstr = "SELECT VouchID From Cwzz_AccVouchMain" & _
  1415.     " Where VouchID=" & Val(CxbbGrid.TextMatrix(CxbbGrid.Row, 0))
  1416.     
  1417.     Set RecTemp = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  1418.     
  1419.     With RecTemp
  1420.         
  1421.         If .EOF Then
  1422.             Tsxx = "此凭证已被其他用户删除!"
  1423.             Call Xtxxts(Tsxx, 0, 4)
  1424.             Exit Sub
  1425.         Else
  1426.             
  1427.             With PZ_JzpzclFrm
  1428.                 '填充查询凭证标识
  1429.                 .Lab_VouchId = Trim(CxbbGrid.TextMatrix(CxbbGrid.Row, 0))
  1430.                 
  1431.                 '设置凭证处理为列表查询状态
  1432.                 .Lab_Pzclzt.Caption = "4"
  1433.                 
  1434.                 .Show 1
  1435.                 
  1436.             End With
  1437.             
  1438.         End If
  1439.         
  1440.     End With
  1441.     
  1442. End Sub
  1443. Private Sub Sub_LcZflz()                               '联查总分类帐
  1444.     Dim Str_Ccode As String          '查询科目
  1445.     
  1446.     '如果科目为空则不进行查询
  1447.     If Trim(Combo_QueryCcode.Text) <> "" Then
  1448.         Str_Ccode = Trim(Mid(Combo_QueryCcode.Text, 1, InStr(1, Combo_QueryCcode.Text, " ") - 1))
  1449.     Else
  1450.         Exit Sub
  1451.     End If
  1452.     
  1453.     '联查总分类帐
  1454.     If Trim(Str_Ccode) <> "" Then
  1455.         ZB_Frmzflztj.LrText(0).Text = Str_Ccode                                                                                                                 '查询科目
  1456.         ZB_Frmzflztj.LrText(1).Text = Str_Ccode                                                                                                                 '查询科目
  1457.         ZB_Frmzflztj.Chk_NotBook.Value = ZB_Frmkmmxztj.Chk_NotBook.Value      '是否包含未记帐凭证
  1458.         ZB_Frmzflztj.LrText(3) = 6
  1459.         ZB_Frmzflzjg.Timer1.Enabled = True                                    '激活查询总分类帐过程
  1460.         ZB_Frmzflzjg.Show
  1461.         ZB_Frmzflzjg.SetFocus
  1462.     End If
  1463. End Sub
  1464. Private Sub bbyl(bbylte As Boolean)                    '报表打印预览
  1465.     Dim Bbzbt$, Bbxbt() As String, bbxbtzzxs() As Integer, Bbxbtgs As Integer
  1466.     Dim Bbbwh() As String, Bbbwhzzxs() As Integer, Bbbwhgs As Integer
  1467.     Bbxbtgs = 1                                          '报 表 小 标 题 行 数
  1468.     Bbbwhgs = 0                                          '报 表 表 尾 行 数
  1469.     ReDim Bbxbt(1 To Bbxbtgs)
  1470.     ReDim bbxbtzzxs(1 To Bbxbtgs)
  1471.     If Bbbwhgs <> 0 Then
  1472.         ReDim Bbbwh(1 To Bbbwhgs)
  1473.         ReDim Bbbwhzzxs(1 To Bbbwhgs)
  1474.     End If
  1475.     Bbzbt = ReportTitle
  1476.     Bbxbt(1) = Space(2) + "科目名称:" + Me.Combo_QueryCcode.Text
  1477.     bbxbtzzxs(1) = 1                                     '报表行组织形式(0-居左 1-居中 2-居右)
  1478.     Call Scyxsjb(CxbbGrid)                               '生成报表数据
  1479.     Call Scdybb(Dyymctbl, Bbzbt, Bbxbt(), bbxbtzzxs(), Bbxbtgs, Bbbwh(), Bbbwhzzxs(), Bbbwhgs, bbylte)
  1480.     If Not bbylte Then
  1481.         Unload DY_Tybbyldy
  1482.     End If
  1483. End Sub
  1484. Private Sub Sub_Lxdy()                                 '帐页连续打印(帐页每批尽量少选)
  1485.     Dim Bbzbt$, Bbxbt() As String, bbxbtzzxs() As Integer, Bbxbtgs As Integer
  1486.     Dim Bbbwh() As String, Bbbwhzzxs() As Integer, Bbbwhgs As Integer
  1487.     Dim Jsqte As Integer
  1488.     Dim YAnswer As Integer
  1489.     
  1490.     '用户确认是否开始连续打印帐页
  1491.     Tsxx = "请确认是否开始连续打印帐页?"
  1492.     YAnswer = Xtxxts(Tsxx, 2, 2)
  1493.     If YAnswer <> 1 Then
  1494.         Exit Sub
  1495.     End If
  1496.     
  1497.     '初始化连续打印状态
  1498.     Cmd_CancelPrint.Visible = True
  1499.     Cmd_CancelPrint.SetFocus
  1500.     Cmd_CancelPrint.Refresh
  1501.     Bln_CancelPrint = False
  1502.     Bln_Printing = True
  1503.     
  1504.     '循环输出打印作业
  1505.     For Jsqte = 0 To Combo_QueryCcode.ListCount - 1
  1506.         Combo_QueryCcode.Text = Combo_QueryCcode.List(Jsqte)
  1507.         Bbxbtgs = 1                                          '报 表 小 标 题 行 数
  1508.         Bbbwhgs = 0                                          '报 表 表 尾 行 数
  1509.         ReDim Bbxbt(1 To Bbxbtgs)
  1510.         ReDim bbxbtzzxs(1 To Bbxbtgs)
  1511.         If Bbbwhgs <> 0 Then
  1512.             ReDim Bbbwh(1 To Bbbwhgs)
  1513.             ReDim Bbbwhzzxs(1 To Bbbwhgs)
  1514.         End If
  1515.         Bbzbt = ReportTitle
  1516.         Bbxbt(1) = Space(2) + "科目名称:" + Me.Combo_QueryCcode.Text
  1517.         bbxbtzzxs(1) = 1                                     '报表行组织形式(0-居左 1-居中 2-居右)
  1518.         Call Scyxsjb(CxbbGrid)                               '生成报表数据
  1519.         Call Scdybb(Dyymctbl, Bbzbt, Bbxbt(), bbxbtzzxs(), Bbxbtgs, Bbbwh(), Bbbwhzzxs(), Bbbwhgs, False, True)
  1520.         Unload DY_Tybbyldy
  1521.         DoEvents
  1522.         If Bln_CancelPrint Then
  1523.             Bln_Printing = False
  1524.             Exit Sub
  1525.         End If
  1526.     Next Jsqte
  1527.     Bln_Printing = False
  1528.     Cmd_CancelPrint.Visible = False
  1529. End Sub
  1530. Private Sub Cmd_CancelPrint_Click()                    '取消帐页连续打印
  1531.     Bln_CancelPrint = True
  1532.     Cmd_CancelPrint.Visible = False
  1533. End Sub