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

企业管理

开发平台:

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 JZ_FrmHfjz 
  5.    Caption         =   "恢复记帐处理"
  6.    ClientHeight    =   8250
  7.    ClientLeft      =   480
  8.    ClientTop       =   525
  9.    ClientWidth     =   11325
  10.    HelpContextID   =   5001
  11.    Icon            =   "记帐_恢复记帐.frx":0000
  12.    KeyPreview      =   -1  'True
  13.    LinkTopic       =   "Form1"
  14.    ScaleHeight     =   8250
  15.    ScaleWidth      =   11325
  16.    StartUpPosition =   1  '所有者中心
  17.    Begin VB.PictureBox Pic_Title 
  18.       Height          =   1155
  19.       Left            =   0
  20.       Picture         =   "记帐_恢复记帐.frx":1042
  21.       ScaleHeight     =   1095
  22.       ScaleWidth      =   11535
  23.       TabIndex        =   0
  24.       Top             =   540
  25.       Width           =   11595
  26.       Begin VB.Label Lab_TitleMess 
  27.          BackStyle       =   0  'Transparent
  28.          Caption         =   "(下面列表为当前记帐月所有已记帐凭证)"
  29.          ForeColor       =   &H00000000&
  30.          Height          =   225
  31.          Index           =   1
  32.          Left            =   2850
  33.          TabIndex        =   9
  34.          Top             =   810
  35.          Width           =   4005
  36.       End
  37.       Begin VB.Label tsLabel 
  38.          BackColor       =   &H80000018&
  39.          BackStyle       =   0  'Transparent
  40.          Caption         =   "恢复记帐处理"
  41.          BeginProperty Font 
  42.             Name            =   "宋体"
  43.             Size            =   14.25
  44.             Charset         =   134
  45.             Weight          =   700
  46.             Underline       =   0   'False
  47.             Italic          =   0   'False
  48.             Strikethrough   =   0   'False
  49.          EndProperty
  50.          ForeColor       =   &H00000000&
  51.          Height          =   330
  52.          Index           =   4
  53.          Left            =   690
  54.          TabIndex        =   3
  55.          Top             =   180
  56.          Width           =   2085
  57.       End
  58.       Begin VB.Label Lab_TitleMess 
  59.          BackStyle       =   0  'Transparent
  60.          Caption         =   "会计期间:"
  61.          Height          =   225
  62.          Index           =   0
  63.          Left            =   1140
  64.          TabIndex        =   2
  65.          Top             =   810
  66.          Width           =   915
  67.       End
  68.       Begin VB.Label Lab_TitleText 
  69.          BackStyle       =   0  'Transparent
  70.          ForeColor       =   &H00000000&
  71.          Height          =   225
  72.          Left            =   2100
  73.          TabIndex        =   1
  74.          Top             =   810
  75.          Width           =   675
  76.       End
  77.    End
  78.    Begin VSFlex8Ctl.VSFlexGrid CxbbGrid 
  79.       Height          =   6705
  80.       Left            =   0
  81.       TabIndex        =   4
  82.       Top             =   1740
  83.       Width           =   11715
  84.       _cx             =   5080
  85.       _cy             =   5080
  86.       Appearance      =   1
  87.       BorderStyle     =   1
  88.       Enabled         =   -1  'True
  89.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  90.          Name            =   "宋体"
  91.          Size            =   9
  92.          Charset         =   134
  93.          Weight          =   400
  94.          Underline       =   0   'False
  95.          Italic          =   0   'False
  96.          Strikethrough   =   0   'False
  97.       EndProperty
  98.       MousePointer    =   0
  99.       BackColor       =   16777215
  100.       ForeColor       =   -2147483640
  101.       BackColorFixed  =   13826538
  102.       ForeColorFixed  =   -2147483630
  103.       BackColorSel    =   -2147483635
  104.       ForeColorSel    =   -2147483634
  105.       BackColorBkg    =   -2147483636
  106.       BackColorAlternate=   16777215
  107.       GridColor       =   -2147483633
  108.       GridColorFixed  =   -2147483632
  109.       TreeColor       =   -2147483632
  110.       FloodColor      =   192
  111.       SheetBorder     =   -2147483642
  112.       FocusRect       =   1
  113.       HighLight       =   1
  114.       AllowSelection  =   -1  'True
  115.       AllowBigSelection=   -1  'True
  116.       AllowUserResizing=   0
  117.       SelectionMode   =   0
  118.       GridLines       =   1
  119.       GridLinesFixed  =   2
  120.       GridLineWidth   =   1
  121.       Rows            =   50
  122.       Cols            =   10
  123.       FixedRows       =   1
  124.       FixedCols       =   1
  125.       RowHeightMin    =   0
  126.       RowHeightMax    =   0
  127.       ColWidthMin     =   0
  128.       ColWidthMax     =   0
  129.       ExtendLastCol   =   0   'False
  130.       FormatString    =   ""
  131.       ScrollTrack     =   0   'False
  132.       ScrollBars      =   3
  133.       ScrollTips      =   0   'False
  134.       MergeCells      =   0
  135.       MergeCompare    =   0
  136.       AutoResize      =   -1  'True
  137.       AutoSizeMode    =   0
  138.       AutoSearch      =   0
  139.       AutoSearchDelay =   2
  140.       MultiTotals     =   -1  'True
  141.       SubtotalPosition=   1
  142.       OutlineBar      =   0
  143.       OutlineCol      =   0
  144.       Ellipsis        =   0
  145.       ExplorerBar     =   0
  146.       PicturesOver    =   0   'False
  147.       FillStyle       =   0
  148.       RightToLeft     =   0   'False
  149.       PictureType     =   0
  150.       TabBehavior     =   0
  151.       OwnerDraw       =   0
  152.       Editable        =   0
  153.       ShowComboButton =   1
  154.       WordWrap        =   0   'False
  155.       TextStyle       =   0
  156.       TextStyleFixed  =   0
  157.       OleDragMode     =   0
  158.       OleDropMode     =   0
  159.       DataMode        =   0
  160.       VirtualData     =   -1  'True
  161.       DataMember      =   ""
  162.       ComboSearch     =   3
  163.       AutoSizeMouse   =   -1  'True
  164.       FrozenRows      =   0
  165.       FrozenCols      =   0
  166.       AllowUserFreezing=   0
  167.       BackColorFrozen =   0
  168.       ForeColorFrozen =   0
  169.       WallPaperAlignment=   9
  170.       AccessibleName  =   ""
  171.       AccessibleDescription=   ""
  172.       AccessibleValue =   ""
  173.       AccessibleRole  =   24
  174.       Begin VB.Frame Fra_Book 
  175.          BackColor       =   &H00C0C0C0&
  176.          Caption         =   "系统正在恢复记帐,请稍候..."
  177.          ForeColor       =   &H00FF0000&
  178.          Height          =   1515
  179.          Left            =   1500
  180.          TabIndex        =   7
  181.          Top             =   1050
  182.          Visible         =   0   'False
  183.          Width           =   8025
  184.          Begin MSComctlLib.ProgressBar Prg_Book 
  185.             Height          =   285
  186.             Left            =   30
  187.             TabIndex        =   8
  188.             Top             =   1020
  189.             Width           =   7965
  190.             _ExtentX        =   14049
  191.             _ExtentY        =   503
  192.             _Version        =   393216
  193.             BorderStyle     =   1
  194.             Appearance      =   1
  195.          End
  196.          Begin VB.Label Lab_Ccode 
  197.             BackColor       =   &H00C0C0C0&
  198.             ForeColor       =   &H00FF0000&
  199.             Height          =   255
  200.             Left            =   3600
  201.             TabIndex        =   11
  202.             Top             =   600
  203.             Width           =   2175
  204.          End
  205.          Begin VB.Label Label1 
  206.             BackColor       =   &H00C0C0C0&
  207.             Caption         =   "正在恢复记帐科目"
  208.             Height          =   255
  209.             Left            =   1920
  210.             TabIndex        =   10
  211.             Top             =   600
  212.             Width           =   1575
  213.          End
  214.       End
  215.    End
  216.    Begin MSComctlLib.Toolbar SzToolbar 
  217.       Align           =   1  'Align Top
  218.       Height          =   555
  219.       Left            =   0
  220.       TabIndex        =   5
  221.       Top             =   0
  222.       Width           =   11325
  223.       _ExtentX        =   19976
  224.       _ExtentY        =   979
  225.       ButtonWidth     =   820
  226.       ButtonHeight    =   926
  227.       AllowCustomize  =   0   'False
  228.       Appearance      =   1
  229.       Style           =   1
  230.       ImageList       =   "ImageList1"
  231.       _Version        =   393216
  232.       BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  233.          NumButtons      =   8
  234.          BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  235.             Caption         =   "设置"
  236.             Key             =   "ymsz"
  237.             ImageKey        =   "sz"
  238.          EndProperty
  239.          BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  240.             Caption         =   "打印"
  241.             Key             =   "dy"
  242.             ImageKey        =   "dy"
  243.          EndProperty
  244.          BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  245.             Caption         =   "预览"
  246.             Key             =   "yl"
  247.             ImageKey        =   "yl"
  248.          EndProperty
  249.          BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  250.             Style           =   3
  251.          EndProperty
  252.          BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  253.             Caption         =   "恢复"
  254.             Key             =   "hf"
  255.             ImageKey        =   "hf"
  256.          EndProperty
  257.          BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  258.             Style           =   3
  259.          EndProperty
  260.          BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  261.             Caption         =   "帮助"
  262.             Key             =   "bz"
  263.             ImageKey        =   "bz"
  264.          EndProperty
  265.          BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  266.             Caption         =   "退出"
  267.             Key             =   "fh"
  268.             ImageKey        =   "tc"
  269.          EndProperty
  270.       EndProperty
  271.       BorderStyle     =   1
  272.       Begin MSComctlLib.ImageList ImageList1 
  273.          Left            =   5400
  274.          Top             =   60
  275.          _ExtentX        =   1005
  276.          _ExtentY        =   1005
  277.          BackColor       =   -2147483643
  278.          ImageWidth      =   16
  279.          ImageHeight     =   16
  280.          MaskColor       =   12632256
  281.          _Version        =   393216
  282.          BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  283.             NumListImages   =   30
  284.             BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  285.                Picture         =   "记帐_恢复记帐.frx":35106
  286.                Key             =   "sz"
  287.             EndProperty
  288.             BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  289.                Picture         =   "记帐_恢复记帐.frx":354A0
  290.                Key             =   "dy"
  291.             EndProperty
  292.             BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  293.                Picture         =   "记帐_恢复记帐.frx":3583A
  294.                Key             =   "yl"
  295.             EndProperty
  296.             BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  297.                Picture         =   "记帐_恢复记帐.frx":35BD4
  298.                Key             =   "xg"
  299.             EndProperty
  300.             BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  301.                Picture         =   "记帐_恢复记帐.frx":35F6E
  302.                Key             =   "zh"
  303.             EndProperty
  304.             BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  305.                Picture         =   "记帐_恢复记帐.frx":36308
  306.                Key             =   "sh"
  307.             EndProperty
  308.             BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  309.                Picture         =   "记帐_恢复记帐.frx":366A2
  310.                Key             =   "bc"
  311.             EndProperty
  312.             BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  313.                Picture         =   "记帐_恢复记帐.frx":36A3C
  314.                Key             =   "fq"
  315.             EndProperty
  316.             BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  317.                Picture         =   "记帐_恢复记帐.frx":36DD6
  318.                Key             =   "bz"
  319.             EndProperty
  320.             BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  321.                Picture         =   "记帐_恢复记帐.frx":37170
  322.                Key             =   "tc"
  323.             EndProperty
  324.             BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  325.                Picture         =   "记帐_恢复记帐.frx":3750A
  326.                Key             =   "bcgs"
  327.             EndProperty
  328.             BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  329.                Picture         =   "记帐_恢复记帐.frx":378A4
  330.                Key             =   "mrlk"
  331.             EndProperty
  332.             BeginProperty ListImage13 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  333.                Picture         =   "记帐_恢复记帐.frx":37C3E
  334.                Key             =   "xsxm"
  335.             EndProperty
  336.             BeginProperty ListImage14 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  337.                Picture         =   "记帐_恢复记帐.frx":37FD8
  338.                Key             =   "first"
  339.             EndProperty
  340.             BeginProperty ListImage15 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  341.                Picture         =   "记帐_恢复记帐.frx":38372
  342.                Key             =   "prev"
  343.             EndProperty
  344.             BeginProperty ListImage16 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  345.                Picture         =   "记帐_恢复记帐.frx":3870C
  346.                Key             =   "next"
  347.             EndProperty
  348.             BeginProperty ListImage17 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  349.                Picture         =   "记帐_恢复记帐.frx":38AA6
  350.                Key             =   "last"
  351.             EndProperty
  352.             BeginProperty ListImage18 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  353.                Picture         =   "记帐_恢复记帐.frx":38E40
  354.                Key             =   "xx"
  355.             EndProperty
  356.             BeginProperty ListImage19 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  357.                Picture         =   "记帐_恢复记帐.frx":391DA
  358.                Key             =   "define"
  359.             EndProperty
  360.             BeginProperty ListImage20 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  361.                Picture         =   "记帐_恢复记帐.frx":39574
  362.                Key             =   "exec"
  363.             EndProperty
  364.             BeginProperty ListImage21 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  365.                Picture         =   "记帐_恢复记帐.frx":3990E
  366.                Key             =   "xz"
  367.             EndProperty
  368.             BeginProperty ListImage22 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  369.                Picture         =   "记帐_恢复记帐.frx":39CA8
  370.                Key             =   "sc"
  371.             EndProperty
  372.             BeginProperty ListImage23 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  373.                Picture         =   "记帐_恢复记帐.frx":3A042
  374.                Key             =   "sx"
  375.             EndProperty
  376.             BeginProperty ListImage24 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  377.                Picture         =   "记帐_恢复记帐.frx":3A3DC
  378.                Key             =   "cx"
  379.             EndProperty
  380.             BeginProperty ListImage25 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  381.                Picture         =   "记帐_恢复记帐.frx":3A776
  382.                Key             =   "zd"
  383.             EndProperty
  384.             BeginProperty ListImage26 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  385.                Picture         =   "记帐_恢复记帐.frx":3AB10
  386.                Key             =   "dz"
  387.             EndProperty
  388.             BeginProperty ListImage27 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  389.                Picture         =   "记帐_恢复记帐.frx":3AEAA
  390.                Key             =   "ph"
  391.             EndProperty
  392.             BeginProperty ListImage28 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  393.                Picture         =   "记帐_恢复记帐.frx":3B244
  394.                Key             =   "fz"
  395.             EndProperty
  396.             BeginProperty ListImage29 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  397.                Picture         =   "记帐_恢复记帐.frx":3B5DE
  398.                Key             =   "dw"
  399.             EndProperty
  400.             BeginProperty ListImage30 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  401.                Picture         =   "记帐_恢复记帐.frx":3B978
  402.                Key             =   "hf"
  403.             EndProperty
  404.          EndProperty
  405.       End
  406.       Begin VB.Timer Timer1 
  407.          Interval        =   1
  408.          Left            =   5940
  409.          Top             =   120
  410.       End
  411.       Begin MSComctlLib.Toolbar GsToolbar 
  412.          Height          =   525
  413.          Left            =   8820
  414.          TabIndex        =   6
  415.          Top             =   0
  416.          Width           =   2475
  417.          _ExtentX        =   4366
  418.          _ExtentY        =   926
  419.          ButtonWidth     =   1455
  420.          ButtonHeight    =   926
  421.          AllowCustomize  =   0   'False
  422.          Appearance      =   1
  423.          Style           =   1
  424.          ImageList       =   "ImageList1"
  425.          _Version        =   393216
  426.          BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  427.             NumButtons      =   3
  428.             BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  429.                Caption         =   "保存格式"
  430.                Key             =   "bcgs"
  431.                ImageKey        =   "bcgs"
  432.             EndProperty
  433.             BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  434.                Caption         =   "默认列宽"
  435.                Key             =   "hfmrgs"
  436.                ImageKey        =   "mrlk"
  437.             EndProperty
  438.             BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  439.                Caption         =   "显示项目"
  440.                Key             =   "szxsxm"
  441.                ImageKey        =   "xsxm"
  442.             EndProperty
  443.          EndProperty
  444.       End
  445.    End
  446. End
  447. Attribute VB_Name = "JZ_FrmHfjz"
  448. Attribute VB_GlobalNameSpace = False
  449. Attribute VB_Creatable = False
  450. Attribute VB_PredeclaredId = True
  451. Attribute VB_Exposed = False
  452. '******************************************************************
  453. '*    模 块 名 称 :恢复记帐处理
  454. '*    功 能 描 述 :完成对已记帐的凭证的恢复
  455. '*    程序员姓名  :张建忠
  456. '*    最后修改人  :张建忠
  457. '*    最后修改时间:2000/03/09
  458. '*    备        注:由于凭证恢复过程复杂,本程序没有使用存储过程,因此
  459. '*                 恢复速度较慢,有待于以后改进
  460. '******************************************************************
  461. Dim ReportTitle As String                '报表主标题
  462. Dim Int_CodeScheme() As Integer          '会计科目编码方案
  463. Dim Int_CodeLev As Integer               '会计科目编码级数
  464. '以下为固定使用变量
  465. Dim Dyymctbl As New DY_Dyymsz            '打印页面窗体变量
  466. Dim GridCode As String                   '显示网格网格代码
  467. Dim GridInf() As Variant                 '整个网格设置信息
  468. Dim Tsxx As String                       '系统提示信息
  469. Dim Qslz As Long                         '网格隐藏(非操作显示)列数
  470. Dim Sjhgd As Double                      '网格数据行高度
  471. Dim Sfxshjwg As Boolean                  '是否显示合计网格
  472. Dim GridBoolean() As Boolean             '网格列信息(布尔型)
  473. Dim GridStr()  As String                 '网格列信息(字符型)
  474. Dim GridInt() As Integer                 '网格列信息(整型)
  475. Dim Szzls As Integer                     '数组总列数(网格列数-1)
  476. Dim Int_DqYear As Integer                '系统当前会计年度
  477. Dim Int_DqPeriod As Integer              '系统当前会计期间
  478. Private Sub Form_Resize()                '根据窗体大小来调整网格,标题栏大小
  479.     On Error Resume Next
  480.     With CxbbGrid
  481.         .Width = Me.Width - 160
  482.         .Height = Me.Height - .Top - 400
  483.     End With
  484.     With Pic_Title
  485.         .Width = Me.Width - 160
  486.     End With
  487.     
  488.     GsToolbar.Left = Me.Width - GsToolbar.Width - 140
  489. End Sub
  490. Private Sub Form_Load()                                                   '窗体装入
  491.     
  492.     '调入打印页面设置窗体
  493.     
  494.     XtReportCode = "Cwzz_hfjz"
  495.     Load Dyymctbl
  496.     ReportTitle = "记帐凭证列表"
  497.     
  498.     '调整标题栏及网格、格式工具条位置
  499.     Pic_Title.Left = 40
  500.     Pic_Title.Top = SzToolbar.Top + SzToolbar.Height - 10
  501.     CxbbGrid.Left = Pic_Title.Left
  502.     CxbbGrid.Top = Pic_Title.Top + Pic_Title.Height + 20
  503.     
  504.     '调 入 网 格
  505.     GridCode = "Cwzz_hfjz"
  506.     Call BzWgcsh(CxbbGrid, GridCode, GridInf(), GridBoolean(), GridInt(), GridStr())
  507.     
  508.     Qslz = GridInf(1)
  509.     Sjhgd = GridInf(2)
  510.     Sfxshjwg = GridInf(7)
  511.     Szzls = CxbbGrid.Cols - 1
  512.     
  513.     '读入科目编码方案
  514.     Call Sub_CodeScheme("Cwzz_kmcode", Int_CodeLev, Int_CodeScheme())
  515.     
  516.     '调整标题位置
  517.     SetTitlePos tsLabel(4)
  518.     
  519.     
  520. End Sub
  521. Private Sub Form_Unload(Cancel As Integer)                                  '窗体卸载
  522.     '卸载条件窗体
  523.     PZ_FrmPzcxtj.UnloadCheck.Value = 1
  524.     Unload PZ_FrmPzcxtj
  525.     '卸载打印页面设置窗体
  526.     Unload Dyymctbl
  527. End Sub
  528. Private Sub GsToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)       '网格格式调整
  529.     Select Case Button.Key
  530.     Case "bcgs"                                          '保存表格格式
  531.         Call Bcwggs(CxbbGrid, GridCode, GridStr)
  532.     Case "hfmrgs"                                        '恢复默认格式
  533.         Call Hfmrgs(CxbbGrid, GridCode, GridStr)
  534.     Case "szxsxm"                                        '设置显示项目
  535.         Call Szxsxm(CxbbGrid, GridCode)
  536.     End Select
  537. End Sub
  538. Private Sub SzToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)
  539.     Select Case Button.Key
  540.     Case "ymsz"                                          '页面设置
  541.         Dyymctbl.Show 1
  542.     Case "yl"                                            '预 览
  543.         Call bbyl(True)
  544.     Case "dy"                                            '打 印
  545.         Call bbyl(False)
  546.     Case "hf"                                            '恢 复
  547.         Call Sun_AbandonBook
  548.     Case "sx"                                            '刷 新
  549.         Call Timer1_Timer
  550.     Case "bz"                                            '帮 助
  551.         Call F1bz
  552.     Case "fh"                                            '退 出
  553.         Unload Me
  554.     End Select
  555. End Sub
  556. Private Sub Timer1_Timer()                                 '在窗体激活后调入查询程序
  557.     Timer1.Enabled = False
  558.     
  559.     CxbbGrid.Redraw = True
  560.     
  561.     '加快显示速度
  562.     CxbbGrid.Redraw = False
  563.     
  564.     '生成查询结果
  565.     Call Sub_Query
  566.     
  567.     CxbbGrid.Redraw = True
  568. End Sub
  569. Private Sub Sub_Query()                                    '生成查询结果
  570.     Dim Rec_Query As New ADODB.Recordset        '查询结果动态集
  571.     Dim RecTemp As New ADODB.Recordset          '临时使用动态集
  572.     Dim Str_QueryCondi As String                '用户录入查询条件
  573.     Dim Sqlstr As String                        '查询字符串
  574.     Dim Coljsq As Long                          '网格列计数器
  575.     Dim Jsqte As Long                           '临时动态计数器
  576.     Dim Int_LevTe As Integer                    '编码级数计数器
  577.     Dim Str_Parent As String                    '上级科目号
  578.     Dim DD As String
  579.     
  580.     '以下为用户自定义部分[
  581.     Set RecTemp = Cw_DataEnvi.DataConnect.Execute("Select * From Gy_kjrlb where cwzzjzbz='0' order by kjyear,period")
  582.     If Not RecTemp.EOF Then
  583.         Int_DqYear = RecTemp.Fields("KjYear")
  584.         Int_DqPeriod = RecTemp.Fields("period")
  585.         Lab_TitleText.Caption = Mid(Trim(Str(10000 + Int_DqYear)), 2, 4) + "." + Mid(Trim(Str(100 + Int_DqPeriod)), 2, 2)
  586.     End If
  587.     
  588.     '筛选所有当前会计期间已记帐凭证
  589.     
  590.     Sqlstr = "SELECT A.*,Cwzz_AccVouchMain.Ddate,Cwzz_AccVouchMain.VouchClassCode, Cwzz_AccVouchMain.VouchNo,Cwzz_AccVouchMain.Bill, Cwzz_AccVouchMain.Checker,Cwzz_AccVouchMain.Book" & _
  591.     " FROM (SELECT VouchID, SUM(jfje) Jfjehj, SUM(Dfje) Dfjehj From Cwzz_V_AccVouch WHERE BookFlag=1 and Year =" & Int_DqYear & " AND Period = " & Int_DqPeriod & _
  592.     " GROUP BY VouchID) A LEFT OUTER JOIN " & _
  593.     " Cwzz_AccVouchMain ON A.VouchID = Cwzz_AccVouchMain.VouchId Order by VouchClassCode,VouchNo"
  594.     
  595.     Set Rec_Query = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  596.     With Rec_Query
  597.         CxbbGrid.Rows = CxbbGrid.FixedRows
  598.         CxbbGrid.Rows = CxbbGrid.FixedRows + .RecordCount
  599.         Jsqte = CxbbGrid.FixedRows
  600.         
  601.         Do While Not .EOF
  602.             If Jsqte >= CxbbGrid.Rows Then
  603.                 CxbbGrid.AddItem ""
  604.             End If
  605.             
  606.             CxbbGrid.TextMatrix(Jsqte, 0) = .Fields("VouchID")                                                '凭证ID
  607.             
  608.             CxbbGrid.TextMatrix(Jsqte, Sydz("001", GridStr(), Szzls)) = .Fields("Ddate")                      '制单日期
  609.             CxbbGrid.TextMatrix(Jsqte, Sydz("002", GridStr(), Szzls)) = Trim(.Fields("VouchClassCode") & "") + "-" + Mid(Trim(Str(10000 + .Fields("VouchNo"))), 2, 4) '凭证字号
  610.             If .Fields("Jfjehj") <> 0 Then                                                                   '借方金额合计
  611.                 CxbbGrid.TextMatrix(Jsqte, Sydz("003", GridStr(), Szzls)) = Trim(Str(.Fields("Jfjehj")))
  612.             End If
  613.             If .Fields("Dfjehj") <> 0 Then                                                                    '贷方金额合计
  614.                 CxbbGrid.TextMatrix(Jsqte, Sydz("004", GridStr(), Szzls)) = Trim(Str(.Fields("Dfjehj")))
  615.             End If
  616.             CxbbGrid.TextMatrix(Jsqte, Sydz("005", GridStr(), Szzls)) = Trim(.Fields("Bill") & "")             '制单人
  617.             CxbbGrid.TextMatrix(Jsqte, Sydz("006", GridStr(), Szzls)) = Trim(.Fields("Book") & "")             '记帐人
  618.             
  619.             CxbbGrid.RowHeight(Jsqte) = Sjhgd
  620.             
  621.             Jsqte = Jsqte + 1
  622.             .MoveNext
  623.             
  624.         Loop
  625.         
  626.     End With
  627.     
  628.     ']以上为用户自定义部分
  629.     
  630. End Sub
  631. Private Sub Sun_AbandonBook()                                 '恢复记帐处理
  632.     Dim Lng_Rowjsq As Long                      '网格行值计数器
  633.     Dim Int_VouchJsq As Integer                 '记帐凭证张数计数器
  634.     Dim Int_LevTe As Integer                    '编码级数计数器
  635.     Dim Str_Parent As String                    '上级科目号
  636.     Dim Yhanswer As Integer                     '回答是否确认
  637.     Dim Sqlstr As String                        '查询字符串
  638.     Dim RecTemp As New ADODB.Recordset          '临时使用动态集
  639.     Dim Rec_AccSum As New ADODB.Recordset       '科目总帐动态集
  640.     Dim Rec_AccSumAssi As New ADODB.Recordset   '科目辅助帐动态集
  641.     Dim Int_PeriodTe As Integer                 '临时会计期间变量
  642.     
  643.     '用户确认是否开始恢复记帐
  644.     
  645.     Tsxx = "请确认是否开始恢复记帐?"
  646.     Yhanswer = Xtxxts(Tsxx, 2, 2)
  647.     If Yhanswer = 2 Then
  648.         Exit Sub
  649.     End If
  650.     
  651.     '打开科目总帐动态集
  652.     With Rec_AccSum
  653.         If .State = 1 Then .Close
  654.         .Open "SELECT Cwzz_AccSum.* From Cwzz_AccSum WHERE Year =" & Int_DqYear & " AND Period = " & Int_DqPeriod, Cw_DataEnvi.DataConnect, adOpenDynamic, adLockOptimistic
  655.     End With
  656.     
  657.     '恢复记帐主要处理过程
  658.     
  659.     '筛选符合条件记录并汇总
  660.     
  661.     Sqlstr = "SELECT Ccode, PersonCode,DeptCode,CusCode,SupplierCode,ItemClassCode,ItemCode,SUM(Wbjfje) AS WbjfjeHj, SUM(Wbdfje) AS Wbdfjehj, SUM(Jfje) AS Jfjehj," & _
  662.     " SUM(Dfje) AS Dfjehj, SUM(Jfsl) AS Jfslhj, SUM(Dfsl) AS Dfslhj,Sum(ItemJfsl) AS ItemJfslhj,Sum(ItemDfsl) AS ItemDfslhj" & _
  663.     " From Cwzz_V_AccVouch " & _
  664.     " Where Year = " & Int_DqYear & " And Period = " & Int_DqPeriod & " AND bookflag = 1 " & _
  665.     " GROUP BY Ccode,PersonCode,DeptCode,CusCode,SupplierCode,ItemClassCode,ItemCode ORDER BY Ccode"
  666.     
  667.     Set RecTemp = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  668.     
  669.     If RecTemp.EOF Then
  670.         Tsxx = "无符合条件恢复记帐记录!"
  671.         Call Xtxxts(Tsxx, 0, 4)
  672.         Exit Sub
  673.     End If
  674.     
  675.     '初始化进度情况
  676.     Prg_Book.Max = RecTemp.RecordCount
  677.     Prg_Book.Min = 0
  678.     Prg_Book.Value = 0
  679.     Fra_Book.Visible = True
  680.     Fra_Book.Refresh
  681.     
  682.     '开始恢复
  683.     
  684.     On Error GoTo Swcwcl
  685.     
  686.     Cw_DataEnvi.DataConnect.BeginTrans
  687.     
  688.     Do While Not RecTemp.EOF
  689.         
  690.         '显示恢复科目
  691.         Lab_Ccode.Caption = Trim(RecTemp.Fields("Ccode")) & "--" & Str(Prg_Book.Value)
  692.         Lab_Ccode.Refresh
  693.         
  694.         '1.恢复总帐(注意需要对其上级科目恢复)
  695.         
  696.         Int_LevTe = 1
  697.         
  698.         Do While True
  699.             Str_Parent = Trim(Mid(Trim(RecTemp.Fields("Ccode")), 1, Int_CodeScheme(Int_LevTe)))
  700.             
  701.             With Rec_AccSum
  702.                 
  703.                 If Not (.EOF And .BOF) Then
  704.                     .MoveFirst
  705.                 End If
  706.                 
  707.                 '判断恢复科目是否存在
  708.                 
  709.                 .Find "Ccode ='" & Str_Parent & "'"
  710.                 
  711.                 If Not Rec_AccSum.EOF Then
  712.                     
  713.                     .Fields("Mjje") = .Fields("Mjje") - RecTemp.Fields("Jfjehj")               '本月借方金额合计
  714.                     .Fields("Mdje") = .Fields("Mdje") - RecTemp.Fields("Dfjehj")               '本月贷方金额合计
  715.                     .Fields("Byjfljje") = .Fields("Byjfljje") - RecTemp.Fields("Jfjehj")       '本年借方金额累计
  716.                     .Fields("Bydfljje") = .Fields("Bydfljje") - RecTemp.Fields("Dfjehj")       '本月贷方金额累计
  717.                     .Fields("Qmye") = .Fields("Qcye") + .Fields("Mjje") - .Fields("Mdje")      '本月期末余额
  718.                     
  719.                     '只有末级科目才进行数量及外币累加
  720.                     If Str_Parent = Trim(RecTemp.Fields("Ccode")) Then
  721.                         .Fields("Mjsl") = .Fields("Mjsl") - RecTemp.Fields("Jfslhj") - 0             '本月借方数量合计
  722.                         .Fields("Mdsl") = .Fields("Mdsl") - RecTemp.Fields("Dfslhj") - 0             '本月贷方数量合计
  723.                         .Fields("Byjfljsl") = .Fields("Byjfljsl") - RecTemp.Fields("Jfslhj") - 0     '本年借方数量累计
  724.                         .Fields("Bydfljsl") = .Fields("Bydfljsl") - RecTemp.Fields("Dfslhj") - 0     '本月贷方数量累计
  725.                         .Fields("Qmsl") = .Fields("Qcsl") + .Fields("Mjsl") - .Fields("Mdsl") + 0    '本月数量余额
  726.                         
  727.                         .Fields("Mjwb") = .Fields("Mjwb") - RecTemp.Fields("Wbjfjehj")               '本月借方外币合计
  728.                         .Fields("Mdwb") = .Fields("Mdwb") - RecTemp.Fields("Wbdfjehj")               '本月贷方外币合计
  729.                         .Fields("Byjfljwb") = .Fields("Byjfljwb") - RecTemp.Fields("Wbjfjehj")       '本年借方外币累计
  730.                         .Fields("Bydfljwb") = .Fields("Bydfljwb") - RecTemp.Fields("Wbdfjehj")       '本月贷方外币累计
  731.                         .Fields("Qmwb") = .Fields("Qcwb") + .Fields("Mjwb") - .Fields("Mdwb")        '本月外币余额
  732.                     End If
  733.                     
  734.                     .Update
  735.                     
  736.                     Sqlstr = "Update Cwzz_AccSum Set Qcye=" & .Fields("Qmye") & ",Byjfljje=" & .Fields("Byjfljje") & ",Bydfljje=" & .Fields("Bydfljje") & ",Qmye=" & .Fields("Qmye") & _
  737.                     ",Qcsl=" & .Fields("Qmsl") + 0 & ",Byjfljsl=" & .Fields("Byjfljsl") + 0 & ",Bydfljsl=" & .Fields("Bydfljsl") + 0 & ",Qmsl=" & .Fields("Qmsl") + 0 & _
  738.                     ",Qcwb=" & .Fields("Qmwb") + 0 & ",Byjfljwb=" & .Fields("Byjfljwb") + 0 & ",Bydfljwb=" & .Fields("Bydfljwb") + 0 & ",Qmwb=" & .Fields("Qmwb") + 0 & _
  739.                     " Where Ccode='" & Str_Parent & "' And Year=" & Int_DqYear & " And Period > " & Int_DqPeriod
  740.                     
  741.                     Cw_DataEnvi.DataConnect.Execute (Sqlstr)
  742.                     
  743.                 End If
  744.                 
  745.                 
  746.             End With
  747.             
  748.             If Str_Parent = Trim(RecTemp.Fields("Ccode")) Then
  749.                 Exit Do
  750.             End If
  751.             
  752.             Int_LevTe = Int_LevTe + 1
  753.             
  754.         Loop
  755.         
  756.         '2.恢复辅助帐
  757.         
  758.         With Rec_AccSumAssi
  759.             
  760.             '2.1 如果有辅助项不为空则恢复辅助帐
  761.             If Trim(RecTemp.Fields("DeptCode") & "") <> "" Or Trim(RecTemp.Fields("PersonCode") & "") <> "" Or Trim(RecTemp.Fields("CusCode") & "") <> "" Or Trim(RecTemp.Fields("SupplierCode") & "") <> "" Or Trim(RecTemp.Fields("ItemClassCode") & "") <> "" Or Trim(RecTemp.Fields("ItemCode") & "") <> "" Then
  762.                 
  763.                 If .State = 1 Then .Close
  764.                 Sqlstr = "SELECT Cwzz_AccSumAssi.* From Cwzz_AccSumAssi WHERE Year =" & Int_DqYear & " AND Period = " & Int_DqPeriod & " And Ccode ='" & Trim(RecTemp.Fields("Ccode")) & "'" & _
  765.                 " And DeptCode='" & Trim(RecTemp.Fields("DeptCode")) & "' And PersonCode='" & Trim(RecTemp.Fields("PersonCode")) & "' And CusCode='" & Trim(RecTemp.Fields("CusCode")) & "'" & _
  766.                 " And SupplierCode='" & Trim(RecTemp.Fields("SupplierCode")) & "' And ItemClassCode='" & Trim(RecTemp.Fields("ItemClassCode")) & "' And ItemCode='" & Trim(RecTemp.Fields("ItemCode")) & "'"
  767.                 
  768.                 .Open Sqlstr, Cw_DataEnvi.DataConnect, adOpenDynamic, adLockOptimistic
  769.                 
  770.                 If Not Rec_AccSumAssi.EOF Then
  771.                     .Fields("Mjje") = .Fields("Mjje") - RecTemp.Fields("Jfjehj")               '本月借方金额合计
  772.                     .Fields("Mdje") = .Fields("Mdje") - RecTemp.Fields("Dfjehj")               '本月贷方金额合计
  773.                     .Fields("Byjfljje") = .Fields("Byjfljje") - RecTemp.Fields("Jfjehj")       '本年借方金额累计
  774.                     .Fields("Bydfljje") = .Fields("Bydfljje") - RecTemp.Fields("Dfjehj")       '本月贷方金额累计
  775.                     .Fields("Qmye") = .Fields("Qcye") + .Fields("Mjje") - .Fields("Mdje")      '本月期末余额
  776.                     .Fields("Mjsl") = .Fields("Mjsl") - RecTemp.Fields("Jfslhj")               '本月借方数量合计
  777.                     .Fields("Mdsl") = .Fields("Mdsl") - RecTemp.Fields("Dfslhj")               '本月贷方数量合计
  778.                     .Fields("Byjfljsl") = .Fields("Byjfljsl") - RecTemp.Fields("Jfslhj")       '本年借方数量累计
  779.                     .Fields("Bydfljsl") = .Fields("Bydfljsl") - RecTemp.Fields("Dfslhj")       '本月贷方数量累计
  780.                     .Fields("Qmsl") = .Fields("Qcsl") + .Fields("Mjsl") - .Fields("Mdsl")      '本月数量余额
  781.                     .Fields("Mjwb") = .Fields("Mjwb") - RecTemp.Fields("Wbjfjehj")             '本月借方外币合计
  782.                     .Fields("Mdwb") = .Fields("Mdwb") - RecTemp.Fields("Wbdfjehj")             '本月贷方外币合计
  783.                     .Fields("Byjfljwb") = .Fields("Byjfljwb") - RecTemp.Fields("Wbjfjehj")     '本年借方外币累计
  784.                     .Fields("Bydfljwb") = .Fields("Bydfljwb") - RecTemp.Fields("Wbdfjehj")     '本月贷方外币累计
  785.                     .Fields("Qmwb") = .Fields("Qcwb") + .Fields("Mjwb") - .Fields("Mdwb")      '本月外币余额
  786.                     .Fields("ItemMjsl") = .Fields("ItemMjsl") - RecTemp.Fields("ItemJfslhj")          '本月借方项目数量合计
  787.                     .Fields("ItemMdsl") = .Fields("ItemMdsl") - RecTemp.Fields("ItemDfslhj")          '本月贷方项目数量合计
  788.                     .Fields("ItemByljjfsl") = .Fields("ItemByljjfsl") - RecTemp.Fields("ItemJfslhj")  '本年借方项目数量累计
  789.                     .Fields("ItemByljdfsl") = .Fields("ItemByljdfsl") - RecTemp.Fields("ItemDfslhj")  '本月贷方外币累计
  790.                     .Fields("QmItemsl") = .Fields("QcItemsl") + .Fields("ItemMjsl") - .Fields("ItemMdsl")  '本月项目数量余额
  791.                     .Update
  792.                     
  793.                     Sqlstr = "Update Cwzz_AccSumAssi Set Qcye=" & .Fields("Qmye") & ",Byjfljje=" & .Fields("Byjfljje") & ",Bydfljje=" & .Fields("Bydfljje") & ",Qmye=" & .Fields("Qmye") & _
  794.                     ",Qcsl=" & .Fields("Qmsl") + 0 & ",Byjfljsl=" & .Fields("Byjfljsl") + 0 & ",Bydfljsl=" & .Fields("Bydfljsl") + 0 & ",Qmsl=" & .Fields("Qmsl") + 0 & _
  795.                     ",Qcwb=" & .Fields("Qmwb") + 0 & ",Byjfljwb=" & .Fields("Byjfljwb") + 0 & ",Bydfljwb=" & .Fields("Bydfljwb") + 0 & ",Qmwb=" & .Fields("Qmwb") + 0 & _
  796.                     ",QcItemsl=" & .Fields("QmItemsl") & ",ItemByljjfsl=" & .Fields("ItemByljjfsl") & ",ItemByLjdfsl=" & .Fields("ItemByLjdfsl") & ",QmItemsl=" & .Fields("QmItemsl") & _
  797.                     " Where Ccode='" & Trim(RecTemp.Fields("Ccode")) & "' And DeptCode='" & Trim(RecTemp.Fields("DeptCode") & "") & "' And PersonCode='" & Trim(RecTemp.Fields("PersonCode") & "") & "' And CusCode='" & Trim(RecTemp.Fields("CusCode") & "") & "'" & _
  798.                     " And SupplierCode='" & Trim(RecTemp.Fields("SupplierCode") & "") & "' And ItemClassCode='" & Trim(RecTemp.Fields("ItemClassCode") & "") & "' And ItemCode='" & Trim(RecTemp.Fields("ItemCode") & "") & "'" & _
  799.                     " And Year=" & Int_DqYear & " And Period > " & Int_DqPeriod
  800.                     
  801.                     Cw_DataEnvi.DataConnect.Execute (Sqlstr)
  802.                     
  803.                 End If
  804.                 
  805.                 
  806.             End If
  807.             
  808.         End With  'Rec_AccSumAssi
  809.         
  810.         '指针移动到下一条记录
  811.         RecTemp.MoveNext
  812.         
  813.         Prg_Book.Value = Prg_Book.Value + 1
  814.         
  815.     Loop
  816.     
  817.     '恢复凭证明细记录写恢复标识
  818.     Sqlstr = "Update Cwzz_AccVouchMain Set BookFlag=0,Book='' WHERE  Year = " & Int_DqYear & " And Period = " & Int_DqPeriod & " And bookflag = 1 "
  819.     Cw_DataEnvi.DataConnect.Execute (Sqlstr)
  820.     
  821.     Cw_DataEnvi.DataConnect.CommitTrans
  822.     
  823.     '隐藏进度显示
  824.     Fra_Book.Visible = False
  825.     
  826.     Tsxx = "恢 复 完 毕!"
  827.     Call Xtxxts(Tsxx, 0, 4)
  828.     
  829.     Unload Me
  830.     
  831.     Exit Sub
  832.     
  833. Swcwcl:
  834.     Cw_DataEnvi.DataConnect.RollbackTrans
  835.     Tsxx = "恢复过程中出现未知错误,程序自动恢复此前状态!"
  836.     Call Xtxxts(Tsxx, 0, 1)
  837.     Exit Sub
  838. End Sub
  839. Private Sub bbyl(bbylte As Boolean)                    '报表打印预览
  840.     Dim Bbzbt$, Bbxbt() As String, bbxbtzzxs() As Integer, Bbxbtgs As Integer
  841.     Dim Bbbwh() As String, Bbbwhzzxs() As Integer, Bbbwhgs As Integer
  842.     Bbxbtgs = 1                                          '报 表 小 标 题 行 数
  843.     Bbbwhgs = 0                                          '报 表 表 尾 行 数
  844.     ReDim Bbxbt(1 To Bbxbtgs)
  845.     ReDim bbxbtzzxs(1 To Bbxbtgs)
  846.     If Bbbwhgs <> 0 Then
  847.         ReDim Bbbwh(1 To Bbbwhgs)
  848.         ReDim Bbbwhzzxs(1 To Bbbwhgs)
  849.     End If
  850.     Bbzbt = ReportTitle
  851.     Bbxbt(1) = " "
  852.     bbxbtzzxs(1) = 0                                     '报表行组织形式(0-居左 1-居中 2-居右)
  853.     Call Scyxsjb(CxbbGrid)                               '生成报表数据
  854.     Call Scdybb(Dyymctbl, Bbzbt, Bbxbt(), bbxbtzzxs(), Bbxbtgs, Bbbwh(), Bbbwhzzxs(), Bbbwhgs, bbylte)
  855.     If Not bbylte Then
  856.         Unload DY_Tybbyldy
  857.     End If
  858. End Sub