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

企业管理

开发平台:

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 CL_PzFrm 
  5.    BackColor       =   &H00E9F4FA&
  6.    BorderStyle     =   1  'Fixed Single
  7.    Caption         =   "记帐凭证"
  8.    ClientHeight    =   6720
  9.    ClientLeft      =   675
  10.    ClientTop       =   720
  11.    ClientWidth     =   10515
  12.    HelpContextID   =   130407
  13.    Icon            =   "处理_凭证处理.frx":0000
  14.    KeyPreview      =   -1  'True
  15.    LinkTopic       =   "Form4"
  16.    MaxButton       =   0   'False
  17.    MinButton       =   0   'False
  18.    ScaleHeight     =   6720
  19.    ScaleWidth      =   10515
  20.    StartUpPosition =   1  '所有者中心
  21.    Begin VB.CommandButton Ydcommand1 
  22.       Height          =   300
  23.       Left            =   6930
  24.       Picture         =   "处理_凭证处理.frx":1042
  25.       Style           =   1  'Graphical
  26.       TabIndex        =   6
  27.       Top             =   1110
  28.       Visible         =   0   'False
  29.       Width           =   300
  30.    End
  31.    Begin VB.CommandButton Ydcommand 
  32.       Height          =   300
  33.       Left            =   6600
  34.       Picture         =   "处理_凭证处理.frx":13CC
  35.       Style           =   1  'Graphical
  36.       TabIndex        =   7
  37.       Top             =   1110
  38.       Visible         =   0   'False
  39.       Width           =   300
  40.    End
  41.    Begin VB.Frame Frame1 
  42.       BackColor       =   &H00E9F4FA&
  43.       Height          =   855
  44.       Left            =   150
  45.       TabIndex        =   19
  46.       Top             =   5400
  47.       Width           =   10215
  48.       Begin VB.Label Lab_Memo 
  49.          Alignment       =   2  'Center
  50.          Appearance      =   0  'Flat
  51.          BackColor       =   &H00E9F4FA&
  52.          BorderStyle     =   1  'Fixed Single
  53.          Caption         =   "备 注"
  54.          ForeColor       =   &H80000008&
  55.          Height          =   675
  56.          Index           =   1
  57.          Left            =   30
  58.          TabIndex        =   21
  59.          Top             =   120
  60.          Width           =   285
  61.          WordWrap        =   -1  'True
  62.       End
  63.       Begin VB.Label Lab_Memo 
  64.          Appearance      =   0  'Flat
  65.          BackColor       =   &H00E9F4FA&
  66.          BorderStyle     =   1  'Fixed Single
  67.          ForeColor       =   &H00FF0000&
  68.          Height          =   675
  69.          Index           =   0
  70.          Left            =   330
  71.          TabIndex        =   20
  72.          Top             =   120
  73.          Width           =   9825
  74.       End
  75.    End
  76.    Begin VB.ComboBox YdCombo 
  77.       Height          =   315
  78.       Left            =   6570
  79.       Style           =   2  'Dropdown List
  80.       TabIndex        =   15
  81.       Top             =   540
  82.       Visible         =   0   'False
  83.       Width           =   1155
  84.    End
  85.    Begin VB.TextBox LrText 
  86.       Appearance      =   0  'Flat
  87.       ForeColor       =   &H00FF0000&
  88.       Height          =   300
  89.       Index           =   1
  90.       Left            =   5280
  91.       TabIndex        =   14
  92.       Text            =   "1"
  93.       Top             =   1320
  94.       Width           =   1155
  95.    End
  96.    Begin VB.TextBox LrText 
  97.       Appearance      =   0  'Flat
  98.       ForeColor       =   &H00FF0000&
  99.       Height          =   300
  100.       Index           =   0
  101.       Left            =   1530
  102.       TabIndex        =   13
  103.       Text            =   "0"
  104.       Top             =   1320
  105.       Width           =   450
  106.    End
  107.    Begin VB.TextBox LrText 
  108.       Appearance      =   0  'Flat
  109.       ForeColor       =   &H00FF0000&
  110.       Height          =   300
  111.       Index           =   2
  112.       Left            =   8700
  113.       TabIndex        =   12
  114.       Text            =   "2"
  115.       Top             =   1320
  116.       Width           =   1095
  117.    End
  118.    Begin VB.TextBox LrText 
  119.       Appearance      =   0  'Flat
  120.       Enabled         =   0   'False
  121.       ForeColor       =   &H00FF0000&
  122.       Height          =   300
  123.       Index           =   3
  124.       Left            =   2250
  125.       TabIndex        =   11
  126.       Text            =   "3"
  127.       Top             =   1320
  128.       Width           =   795
  129.    End
  130.    Begin VB.CheckBox Chk_Quantity 
  131.       BackColor       =   &H00C9ECFE&
  132.       Caption         =   "科目数量核算则数量不能为零"
  133.       Height          =   285
  134.       Left            =   6330
  135.       TabIndex        =   10
  136.       Top             =   3330
  137.       Value           =   1  'Checked
  138.       Visible         =   0   'False
  139.       Width           =   2685
  140.    End
  141.    Begin VB.CheckBox Chk_DeleteMess 
  142.       BackColor       =   &H00C9ECFE&
  143.       Caption         =   "删除会计分录是否提示"
  144.       Height          =   285
  145.       Left            =   6330
  146.       TabIndex        =   9
  147.       Top             =   3030
  148.       Value           =   1  'Checked
  149.       Visible         =   0   'False
  150.       Width           =   2685
  151.    End
  152.    Begin VB.TextBox Ydtext 
  153.       BackColor       =   &H00C0FFFF&
  154.       BorderStyle     =   0  'None
  155.       Height          =   270
  156.       Left            =   2250
  157.       MultiLine       =   -1  'True
  158.       TabIndex        =   8
  159.       Top             =   960
  160.       Visible         =   0   'False
  161.       Width           =   1185
  162.    End
  163.    Begin VB.Timer Timer1 
  164.       Interval        =   1
  165.       Left            =   7230
  166.       Top             =   840
  167.    End
  168.    Begin VB.ComboBox Combo_Kjqj 
  169.       Enabled         =   0   'False
  170.       ForeColor       =   &H00FF0000&
  171.       Height          =   300
  172.       Left            =   8700
  173.       Style           =   1  'Simple Combo
  174.       TabIndex        =   5
  175.       Text            =   "Combo_Kjqj"
  176.       Top             =   960
  177.       Width           =   1095
  178.    End
  179.    Begin VSFlex8Ctl.VSFlexGrid WglrGrid 
  180.       Height          =   3795
  181.       Left            =   120
  182.       TabIndex        =   16
  183.       Top             =   1710
  184.       Width           =   10260
  185.       _cx             =   5080
  186.       _cy             =   5080
  187.       Appearance      =   1
  188.       BorderStyle     =   1
  189.       Enabled         =   -1  'True
  190.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  191.          Name            =   "宋体"
  192.          Size            =   9
  193.          Charset         =   134
  194.          Weight          =   400
  195.          Underline       =   0   'False
  196.          Italic          =   0   'False
  197.          Strikethrough   =   0   'False
  198.       EndProperty
  199.       MousePointer    =   0
  200.       BackColor       =   -2147483643
  201.       ForeColor       =   -2147483640
  202.       BackColorFixed  =   12640511
  203.       ForeColorFixed  =   -2147483630
  204.       BackColorSel    =   -2147483643
  205.       ForeColorSel    =   -2147483640
  206.       BackColorBkg    =   -2147483632
  207.       BackColorAlternate=   -2147483643
  208.       GridColor       =   -2147483633
  209.       GridColorFixed  =   -2147483632
  210.       TreeColor       =   -2147483632
  211.       FloodColor      =   192
  212.       SheetBorder     =   -2147483642
  213.       FocusRect       =   1
  214.       HighLight       =   1
  215.       AllowSelection  =   0   'False
  216.       AllowBigSelection=   0   'False
  217.       AllowUserResizing=   0
  218.       SelectionMode   =   0
  219.       GridLines       =   1
  220.       GridLinesFixed  =   2
  221.       GridLineWidth   =   1
  222.       Rows            =   5000
  223.       Cols            =   10
  224.       FixedRows       =   1
  225.       FixedCols       =   0
  226.       RowHeightMin    =   0
  227.       RowHeightMax    =   0
  228.       ColWidthMin     =   0
  229.       ColWidthMax     =   0
  230.       ExtendLastCol   =   0   'False
  231.       FormatString    =   ""
  232.       ScrollTrack     =   0   'False
  233.       ScrollBars      =   2
  234.       ScrollTips      =   0   'False
  235.       MergeCells      =   0
  236.       MergeCompare    =   0
  237.       AutoResize      =   -1  'True
  238.       AutoSizeMode    =   0
  239.       AutoSearch      =   0
  240.       AutoSearchDelay =   2
  241.       MultiTotals     =   -1  'True
  242.       SubtotalPosition=   1
  243.       OutlineBar      =   0
  244.       OutlineCol      =   0
  245.       Ellipsis        =   0
  246.       ExplorerBar     =   0
  247.       PicturesOver    =   0   'False
  248.       FillStyle       =   0
  249.       RightToLeft     =   0   'False
  250.       PictureType     =   0
  251.       TabBehavior     =   0
  252.       OwnerDraw       =   0
  253.       Editable        =   0
  254.       ShowComboButton =   1
  255.       WordWrap        =   -1  'True
  256.       TextStyle       =   0
  257.       TextStyleFixed  =   0
  258.       OleDragMode     =   0
  259.       OleDropMode     =   0
  260.       DataMode        =   0
  261.       VirtualData     =   -1  'True
  262.       DataMember      =   ""
  263.       ComboSearch     =   3
  264.       AutoSizeMouse   =   -1  'True
  265.       FrozenRows      =   0
  266.       FrozenCols      =   0
  267.       AllowUserFreezing=   0
  268.       BackColorFrozen =   0
  269.       ForeColorFrozen =   0
  270.       WallPaperAlignment=   9
  271.       AccessibleName  =   ""
  272.       AccessibleDescription=   ""
  273.       AccessibleValue =   ""
  274.       AccessibleRole  =   24
  275.       Begin VB.CheckBox Chk_CodeOutput 
  276.          BackColor       =   &H00C9ECFE&
  277.          Caption         =   "打印凭证是否输出科目编码"
  278.          Height          =   255
  279.          Left            =   6060
  280.          TabIndex        =   17
  281.          Top             =   1740
  282.          Visible         =   0   'False
  283.          Width           =   2685
  284.       End
  285.       Begin VSFlex8Ctl.VSFlexGrid HjGrid 
  286.          Height          =   555
  287.          Left            =   0
  288.          TabIndex        =   18
  289.          Top             =   3270
  290.          Width           =   7545
  291.          _cx             =   5080
  292.          _cy             =   5080
  293.          Appearance      =   1
  294.          BorderStyle     =   0
  295.          Enabled         =   -1  'True
  296.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  297.             Name            =   "宋体"
  298.             Size            =   9
  299.             Charset         =   134
  300.             Weight          =   400
  301.             Underline       =   0   'False
  302.             Italic          =   0   'False
  303.             Strikethrough   =   0   'False
  304.          EndProperty
  305.          MousePointer    =   0
  306.          BackColor       =   15332602
  307.          ForeColor       =   -2147483640
  308.          BackColorFixed  =   -2147483633
  309.          ForeColorFixed  =   -2147483630
  310.          BackColorSel    =   -2147483643
  311.          ForeColorSel    =   -2147483640
  312.          BackColorBkg    =   -2147483632
  313.          BackColorAlternate=   15332602
  314.          GridColor       =   -2147483633
  315.          GridColorFixed  =   -2147483632
  316.          TreeColor       =   -2147483632
  317.          FloodColor      =   192
  318.          SheetBorder     =   -2147483642
  319.          FocusRect       =   1
  320.          HighLight       =   1
  321.          AllowSelection  =   0   'False
  322.          AllowBigSelection=   0   'False
  323.          AllowUserResizing=   0
  324.          SelectionMode   =   0
  325.          GridLines       =   1
  326.          GridLinesFixed  =   2
  327.          GridLineWidth   =   1
  328.          Rows            =   5000
  329.          Cols            =   10
  330.          FixedRows       =   1
  331.          FixedCols       =   0
  332.          RowHeightMin    =   0
  333.          RowHeightMax    =   0
  334.          ColWidthMin     =   0
  335.          ColWidthMax     =   0
  336.          ExtendLastCol   =   0   'False
  337.          FormatString    =   ""
  338.          ScrollTrack     =   0   'False
  339.          ScrollBars      =   3
  340.          ScrollTips      =   0   'False
  341.          MergeCells      =   0
  342.          MergeCompare    =   0
  343.          AutoResize      =   -1  'True
  344.          AutoSizeMode    =   0
  345.          AutoSearch      =   0
  346.          AutoSearchDelay =   2
  347.          MultiTotals     =   -1  'True
  348.          SubtotalPosition=   1
  349.          OutlineBar      =   0
  350.          OutlineCol      =   0
  351.          Ellipsis        =   0
  352.          ExplorerBar     =   0
  353.          PicturesOver    =   0   'False
  354.          FillStyle       =   0
  355.          RightToLeft     =   0   'False
  356.          PictureType     =   0
  357.          TabBehavior     =   0
  358.          OwnerDraw       =   0
  359.          Editable        =   0
  360.          ShowComboButton =   1
  361.          WordWrap        =   -1  'True
  362.          TextStyle       =   0
  363.          TextStyleFixed  =   0
  364.          OleDragMode     =   0
  365.          OleDropMode     =   0
  366.          DataMode        =   0
  367.          VirtualData     =   -1  'True
  368.          DataMember      =   ""
  369.          ComboSearch     =   3
  370.          AutoSizeMouse   =   -1  'True
  371.          FrozenRows      =   0
  372.          FrozenCols      =   0
  373.          AllowUserFreezing=   0
  374.          BackColorFrozen =   0
  375.          ForeColorFrozen =   0
  376.          WallPaperAlignment=   9
  377.          AccessibleName  =   ""
  378.          AccessibleDescription=   ""
  379.          AccessibleValue =   ""
  380.          AccessibleRole  =   24
  381.       End
  382.    End
  383.    Begin MSComctlLib.ImageList ImageList1 
  384.       Left            =   9960
  385.       Top             =   660
  386.       _ExtentX        =   1005
  387.       _ExtentY        =   1005
  388.       BackColor       =   -2147483643
  389.       ImageWidth      =   16
  390.       ImageHeight     =   16
  391.       MaskColor       =   12632256
  392.       _Version        =   393216
  393.       BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  394.          NumListImages   =   18
  395.          BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  396.             Picture         =   "处理_凭证处理.frx":1756
  397.             Key             =   "sz"
  398.          EndProperty
  399.          BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  400.             Picture         =   "处理_凭证处理.frx":1AF0
  401.             Key             =   "dy"
  402.          EndProperty
  403.          BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  404.             Picture         =   "处理_凭证处理.frx":1E8A
  405.             Key             =   "yl"
  406.          EndProperty
  407.          BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  408.             Picture         =   "处理_凭证处理.frx":2224
  409.             Key             =   "xg"
  410.          EndProperty
  411.          BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  412.             Picture         =   "处理_凭证处理.frx":25BE
  413.             Key             =   "zh"
  414.          EndProperty
  415.          BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  416.             Picture         =   "处理_凭证处理.frx":2958
  417.             Key             =   "sh"
  418.          EndProperty
  419.          BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  420.             Picture         =   "处理_凭证处理.frx":2CF2
  421.             Key             =   "bc"
  422.          EndProperty
  423.          BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  424.             Picture         =   "处理_凭证处理.frx":308C
  425.             Key             =   "fq"
  426.          EndProperty
  427.          BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  428.             Picture         =   "处理_凭证处理.frx":3426
  429.             Key             =   "bz"
  430.          EndProperty
  431.          BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  432.             Picture         =   "处理_凭证处理.frx":37C0
  433.             Key             =   "tc"
  434.          EndProperty
  435.          BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  436.             Picture         =   "处理_凭证处理.frx":3B5A
  437.             Key             =   "bcgs"
  438.          EndProperty
  439.          BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  440.             Picture         =   "处理_凭证处理.frx":3EF4
  441.             Key             =   "mrlk"
  442.          EndProperty
  443.          BeginProperty ListImage13 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  444.             Picture         =   "处理_凭证处理.frx":428E
  445.             Key             =   "xsxm"
  446.          EndProperty
  447.          BeginProperty ListImage14 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  448.             Picture         =   "处理_凭证处理.frx":4628
  449.             Key             =   "first"
  450.          EndProperty
  451.          BeginProperty ListImage15 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  452.             Picture         =   "处理_凭证处理.frx":49C2
  453.             Key             =   "prev"
  454.          EndProperty
  455.          BeginProperty ListImage16 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  456.             Picture         =   "处理_凭证处理.frx":4D5C
  457.             Key             =   "next"
  458.          EndProperty
  459.          BeginProperty ListImage17 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  460.             Picture         =   "处理_凭证处理.frx":50F6
  461.             Key             =   "last"
  462.          EndProperty
  463.          BeginProperty ListImage18 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  464.             Picture         =   "处理_凭证处理.frx":5490
  465.             Key             =   "xx"
  466.          EndProperty
  467.       EndProperty
  468.    End
  469.    Begin MSComctlLib.Toolbar Tlb_Action 
  470.       Align           =   1  'Align Top
  471.       Height          =   555
  472.       Left            =   0
  473.       TabIndex        =   22
  474.       Top             =   0
  475.       Width           =   10515
  476.       _ExtentX        =   18547
  477.       _ExtentY        =   979
  478.       ButtonWidth     =   820
  479.       ButtonHeight    =   926
  480.       AllowCustomize  =   0   'False
  481.       Wrappable       =   0   'False
  482.       Appearance      =   1
  483.       Style           =   1
  484.       ImageList       =   "ImageList1"
  485.       _Version        =   393216
  486.       BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  487.          NumButtons      =   19
  488.          BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  489.             Caption         =   "设置"
  490.             Key             =   "ymsz"
  491.             Object.ToolTipText     =   "打印页面设置"
  492.             ImageIndex      =   1
  493.          EndProperty
  494.          BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  495.             Caption         =   "打印"
  496.             Key             =   "dy"
  497.             Object.ToolTipText     =   "打印当前单据或Ctrl+P"
  498.             ImageIndex      =   2
  499.          EndProperty
  500.          BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  501.             Caption         =   "预览"
  502.             Key             =   "yl"
  503.             ImageIndex      =   3
  504.          EndProperty
  505.          BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  506.             Style           =   3
  507.          EndProperty
  508.          BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  509.             Enabled         =   0   'False
  510.             Object.Visible         =   0   'False
  511.             Caption         =   "增行"
  512.             Key             =   "zh"
  513.             Object.ToolTipText     =   "插入一行或Insert"
  514.             ImageIndex      =   5
  515.          EndProperty
  516.          BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  517.             Enabled         =   0   'False
  518.             Object.Visible         =   0   'False
  519.             Caption         =   "删行"
  520.             Key             =   "sh"
  521.             Object.ToolTipText     =   "删除当前记录行或Delete"
  522.             ImageIndex      =   6
  523.          EndProperty
  524.          BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  525.             Enabled         =   0   'False
  526.             Object.Visible         =   0   'False
  527.             Key             =   "fgh1"
  528.             Style           =   3
  529.          EndProperty
  530.          BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  531.             Caption         =   "保存"
  532.             Key             =   "bc"
  533.             Object.ToolTipText     =   "保存单据或F6"
  534.             ImageIndex      =   7
  535.          EndProperty
  536.          BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  537.             Object.Visible         =   0   'False
  538.             Caption         =   "放弃"
  539.             Key             =   "fq"
  540.             Object.ToolTipText     =   "放弃此次操作"
  541.             ImageIndex      =   8
  542.          EndProperty
  543.          BeginProperty Button10 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  544.             Key             =   "fgh2"
  545.             Style           =   3
  546.          EndProperty
  547.          BeginProperty Button11 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  548.             Caption         =   "首张"
  549.             Key             =   "first"
  550.             ImageIndex      =   14
  551.          EndProperty
  552.          BeginProperty Button12 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  553.             Caption         =   "上张"
  554.             Key             =   "prev"
  555.             ImageIndex      =   15
  556.          EndProperty
  557.          BeginProperty Button13 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  558.             Caption         =   "下张"
  559.             Key             =   "next"
  560.             ImageIndex      =   16
  561.          EndProperty
  562.          BeginProperty Button14 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  563.             Caption         =   "末张"
  564.             Key             =   "last"
  565.             ImageIndex      =   17
  566.          EndProperty
  567.          BeginProperty Button15 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  568.             Key             =   "fgh5"
  569.             ImageIndex      =   18
  570.             Style           =   3
  571.          EndProperty
  572.          BeginProperty Button16 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  573.             Enabled         =   0   'False
  574.             Object.Visible         =   0   'False
  575.             Caption         =   "选项"
  576.             Key             =   "xx"
  577.             ImageIndex      =   18
  578.          EndProperty
  579.          BeginProperty Button17 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  580.             Enabled         =   0   'False
  581.             Object.Visible         =   0   'False
  582.             Style           =   3
  583.          EndProperty
  584.          BeginProperty Button18 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  585.             Caption         =   "帮助"
  586.             Key             =   "bz"
  587.             ImageIndex      =   9
  588.          EndProperty
  589.          BeginProperty Button19 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  590.             Caption         =   "退出"
  591.             Key             =   "fh"
  592.             ImageIndex      =   10
  593.          EndProperty
  594.       EndProperty
  595.       BorderStyle     =   1
  596.    End
  597.    Begin VB.Label TsLabel 
  598.       BackColor       =   &H80000018&
  599.       BackStyle       =   0  'Transparent
  600.       Caption         =   "记 帐 凭 证"
  601.       BeginProperty Font 
  602.          Name            =   "宋体"
  603.          Size            =   14.25
  604.          Charset         =   134
  605.          Weight          =   700
  606.          Underline       =   0   'False
  607.          Italic          =   0   'False
  608.          Strikethrough   =   0   'False
  609.       EndProperty
  610.       ForeColor       =   &H00000000&
  611.       Height          =   330
  612.       Index           =   4
  613.       Left            =   4290
  614.       TabIndex        =   49
  615.       Top             =   720
  616.       Width           =   2115
  617.    End
  618.    Begin VB.Line Line1 
  619.       BorderColor     =   &H00000000&
  620.       Index           =   1
  621.       X1              =   3930
  622.       X2              =   6270
  623.       Y1              =   1080
  624.       Y2              =   1080
  625.    End
  626.    Begin VB.Line Line1 
  627.       BorderColor     =   &H00000000&
  628.       Index           =   0
  629.       X1              =   3945
  630.       X2              =   6270
  631.       Y1              =   1035
  632.       Y2              =   1035
  633.    End
  634.    Begin VB.Label TsLabel 
  635.       BackStyle       =   0  'Transparent
  636.       Caption         =   "制单日期"
  637.       Height          =   255
  638.       Index           =   1
  639.       Left            =   4470
  640.       TabIndex        =   48
  641.       Top             =   1380
  642.       Width           =   825
  643.    End
  644.    Begin VB.Label TsLabel 
  645.       BackStyle       =   0  'Transparent
  646.       Caption         =   "类别字号"
  647.       Height          =   225
  648.       Index           =   0
  649.       Left            =   750
  650.       TabIndex        =   47
  651.       Top             =   1380
  652.       Width           =   825
  653.    End
  654.    Begin VB.Label TsLabel 
  655.       BackStyle       =   0  'Transparent
  656.       Caption         =   "附单据数"
  657.       Height          =   255
  658.       Index           =   2
  659.       Left            =   7860
  660.       TabIndex        =   46
  661.       Top             =   1380
  662.       Width           =   825
  663.    End
  664.    Begin VB.Label Lab_Book 
  665.       Appearance      =   0  'Flat
  666.       AutoSize        =   -1  'True
  667.       BackColor       =   &H80000005&
  668.       BackStyle       =   0  'Transparent
  669.       ForeColor       =   &H00000000&
  670.       Height          =   195
  671.       Left            =   3240
  672.       TabIndex        =   45
  673.       Top             =   6390
  674.       Width           =   45
  675.    End
  676.    Begin VB.Label Lab_Checker 
  677.       Appearance      =   0  'Flat
  678.       AutoSize        =   -1  'True
  679.       BackColor       =   &H80000005&
  680.       BackStyle       =   0  'Transparent
  681.       ForeColor       =   &H00000000&
  682.       Height          =   195
  683.       Left            =   7380
  684.       TabIndex        =   44
  685.       Top             =   6390
  686.       Width           =   45
  687.    End
  688.    Begin VB.Label Lab_Bill 
  689.       Appearance      =   0  'Flat
  690.       AutoSize        =   -1  'True
  691.       BackColor       =   &H80000005&
  692.       BackStyle       =   0  'Transparent
  693.       ForeColor       =   &H00000000&
  694.       Height          =   195
  695.       Left            =   9180
  696.       TabIndex        =   43
  697.       Top             =   6390
  698.       Width           =   45
  699.    End
  700.    Begin VB.Label TsLabel 
  701.       BackStyle       =   0  'Transparent
  702.       Caption         =   "会计期间"
  703.       Height          =   255
  704.       Index           =   9
  705.       Left            =   7860
  706.       TabIndex        =   42
  707.       Top             =   1050
  708.       Width           =   825
  709.    End
  710.    Begin VB.Label TsLabel 
  711.       BackStyle       =   0  'Transparent
  712.       Caption         =   "字"
  713.       Height          =   195
  714.       Index           =   10
  715.       Left            =   2040
  716.       TabIndex        =   41
  717.       Top             =   1380
  718.       Visible         =   0   'False
  719.       Width           =   255
  720.    End
  721.    Begin VB.Label Lab_OperStatus 
  722.       BackColor       =   &H000080FF&
  723.       Caption         =   "2"
  724.       Height          =   225
  725.       Left            =   6930
  726.       TabIndex        =   40
  727.       Top             =   840
  728.       Visible         =   0   'False
  729.       Width           =   195
  730.    End
  731.    Begin VB.Label Lab_Row 
  732.       Alignment       =   2  'Center
  733.       Appearance      =   0  'Flat
  734.       BackColor       =   &H80000005&
  735.       BackStyle       =   0  'Transparent
  736.       ForeColor       =   &H00FF0000&
  737.       Height          =   225
  738.       Left            =   9000
  739.       TabIndex        =   39
  740.       Top             =   690
  741.       Width           =   315
  742.    End
  743.    Begin VB.Label TsLabel 
  744.       BackStyle       =   0  'Transparent
  745.       Caption         =   "(第"
  746.       Height          =   255
  747.       Index           =   11
  748.       Left            =   8700
  749.       TabIndex        =   38
  750.       Top             =   690
  751.       Width           =   315
  752.    End
  753.    Begin VB.Label TsLabel 
  754.       BackStyle       =   0  'Transparent
  755.       Caption         =   "行)"
  756.       Height          =   255
  757.       Index           =   12
  758.       Left            =   9330
  759.       TabIndex        =   37
  760.       Top             =   690
  761.       Width           =   405
  762.    End
  763.    Begin VB.Label Lab_Pzclzt 
  764.       BackColor       =   &H0000FFFF&
  765.       Caption         =   "1"
  766.       ForeColor       =   &H00808080&
  767.       Height          =   255
  768.       Left            =   6600
  769.       TabIndex        =   36
  770.       Top             =   840
  771.       Visible         =   0   'False
  772.       Width           =   285
  773.    End
  774.    Begin VB.Label TsLabel 
  775.       BackStyle       =   0  'Transparent
  776.       Caption         =   "当前记录"
  777.       Height          =   255
  778.       Index           =   13
  779.       Left            =   7860
  780.       TabIndex        =   35
  781.       Top             =   690
  782.       Width           =   825
  783.    End
  784.    Begin VB.Label Lab_Succeed 
  785.       Appearance      =   0  'Flat
  786.       BackColor       =   &H80000005&
  787.       BackStyle       =   0  'Transparent
  788.       BorderStyle     =   1  'Fixed Single
  789.       Caption         =   "已生成"
  790.       BeginProperty Font 
  791.          Name            =   "宋体"
  792.          Size            =   15
  793.          Charset         =   134
  794.          Weight          =   400
  795.          Underline       =   0   'False
  796.          Italic          =   0   'False
  797.          Strikethrough   =   0   'False
  798.       EndProperty
  799.       ForeColor       =   &H000000FF&
  800.       Height          =   405
  801.       Left            =   90
  802.       TabIndex        =   34
  803.       Top             =   600
  804.       Visible         =   0   'False
  805.       Width           =   1005
  806.    End
  807.    Begin VB.Label Lab_Error 
  808.       Appearance      =   0  'Flat
  809.       BackColor       =   &H80000005&
  810.       BackStyle       =   0  'Transparent
  811.       BorderStyle     =   1  'Fixed Single
  812.       Caption         =   "有错"
  813.       BeginProperty Font 
  814.          Name            =   "宋体"
  815.          Size            =   15.75
  816.          Charset         =   134
  817.          Weight          =   400
  818.          Underline       =   0   'False
  819.          Italic          =   0   'False
  820.          Strikethrough   =   0   'False
  821.       EndProperty
  822.       ForeColor       =   &H000000FF&
  823.       Height          =   390
  824.       Left            =   1200
  825.       TabIndex        =   33
  826.       Top             =   600
  827.       Visible         =   0   'False
  828.       Width           =   825
  829.    End
  830.    Begin VB.Label Label1 
  831.       Appearance      =   0  'Flat
  832.       AutoSize        =   -1  'True
  833.       BackColor       =   &H80000005&
  834.       BackStyle       =   0  'Transparent
  835.       ForeColor       =   &H00000000&
  836.       Height          =   195
  837.       Left            =   10140
  838.       TabIndex        =   32
  839.       Top             =   6330
  840.       Width           =   45
  841.    End
  842.    Begin VB.Label Label2 
  843.       Appearance      =   0  'Flat
  844.       AutoSize        =   -1  'True
  845.       BackColor       =   &H80000005&
  846.       BackStyle       =   0  'Transparent
  847.       ForeColor       =   &H00000000&
  848.       Height          =   195
  849.       Left            =   5100
  850.       TabIndex        =   31
  851.       Top             =   6390
  852.       Width           =   45
  853.    End
  854.    Begin VB.Label Label5 
  855.       Appearance      =   0  'Flat
  856.       BackColor       =   &H80000005&
  857.       BackStyle       =   0  'Transparent
  858.       ForeColor       =   &H00000000&
  859.       Height          =   225
  860.       Left            =   2790
  861.       TabIndex        =   30
  862.       Top             =   30
  863.       Width           =   735
  864.    End
  865.    Begin VB.Label TsLabel 
  866.       AutoSize        =   -1  'True
  867.       BackStyle       =   0  'Transparent
  868.       Caption         =   "出纳:"
  869.       Height          =   195
  870.       Index           =   19
  871.       Left            =   4620
  872.       TabIndex        =   29
  873.       Top             =   6390
  874.       Width           =   405
  875.    End
  876.    Begin VB.Label TsLabel 
  877.       BackStyle       =   0  'Transparent
  878.       Caption         =   "会计主管:"
  879.       Height          =   225
  880.       Index           =   20
  881.       Left            =   360
  882.       TabIndex        =   28
  883.       Top             =   6390
  884.       Width           =   855
  885.    End
  886.    Begin VB.Label TsLabel 
  887.       AutoSize        =   -1  'True
  888.       BackStyle       =   0  'Transparent
  889.       Caption         =   "记帐人:"
  890.       Height          =   195
  891.       Index           =   21
  892.       Left            =   2595
  893.       TabIndex        =   27
  894.       Top             =   6390
  895.       Width           =   585
  896.    End
  897.    Begin VB.Label TsLabel 
  898.       AutoSize        =   -1  'True
  899.       BackStyle       =   0  'Transparent
  900.       Caption         =   "审核人:"
  901.       Height          =   195
  902.       Index           =   22
  903.       Left            =   6645
  904.       TabIndex        =   26
  905.       Top             =   6390
  906.       Width           =   585
  907.    End
  908.    Begin VB.Label TsLabel 
  909.       AutoSize        =   -1  'True
  910.       BackStyle       =   0  'Transparent
  911.       Caption         =   "制单人:"
  912.       Height          =   195
  913.       Index           =   23
  914.       Left            =   8520
  915.       TabIndex        =   25
  916.       Top             =   6390
  917.       Width           =   585
  918.    End
  919.    Begin VB.Label Lab_VouchId 
  920.       AutoSize        =   -1  'True
  921.       BackColor       =   &H0080C0FF&
  922.       Height          =   300
  923.       Left            =   2250
  924.       TabIndex        =   24
  925.       Top             =   630
  926.       Visible         =   0   'False
  927.       Width           =   1170
  928.    End
  929.    Begin VB.Label lbl_Tag 
  930.       BackColor       =   &H00FF8080&
  931.       Height          =   285
  932.       Left            =   3510
  933.       TabIndex        =   23
  934.       Top             =   690
  935.       Visible         =   0   'False
  936.       Width           =   555
  937.    End
  938.    Begin VB.Label TsLabel 
  939.       BackStyle       =   0  'Transparent
  940.       Caption         =   "出纳:"
  941.       Height          =   225
  942.       Index           =   14
  943.       Left            =   4680
  944.       TabIndex        =   4
  945.       Top             =   6900
  946.       Width           =   645
  947.    End
  948.    Begin VB.Label TsLabel 
  949.       BackStyle       =   0  'Transparent
  950.       Caption         =   "会计主管:"
  951.       Height          =   225
  952.       Index           =   3
  953.       Left            =   420
  954.       TabIndex        =   3
  955.       Top             =   6900
  956.       Width           =   855
  957.    End
  958.    Begin VB.Label TsLabel 
  959.       BackStyle       =   0  'Transparent
  960.       Caption         =   "记帐:"
  961.       Height          =   225
  962.       Index           =   8
  963.       Left            =   2655
  964.       TabIndex        =   2
  965.       Top             =   6900
  966.       Width           =   645
  967.    End
  968.    Begin VB.Label TsLabel 
  969.       BackStyle       =   0  'Transparent
  970.       Caption         =   "审核:"
  971.       Height          =   225
  972.       Index           =   7
  973.       Left            =   6705
  974.       TabIndex        =   1
  975.       Top             =   6900
  976.       Width           =   495
  977.    End
  978.    Begin VB.Label TsLabel 
  979.       BackStyle       =   0  'Transparent
  980.       Caption         =   "制单:"
  981.       Height          =   225
  982.       Index           =   5
  983.       Left            =   8580
  984.       TabIndex        =   0
  985.       Top             =   6900
  986.       Width           =   525
  987.    End
  988. End
  989. Attribute VB_Name = "CL_PzFrm"
  990. Attribute VB_GlobalNameSpace = False
  991. Attribute VB_Creatable = False
  992. Attribute VB_PredeclaredId = True
  993. Attribute VB_Exposed = False
  994. '*********************************************************************************************************
  995. '*    模 块 名 称 :自动转帐凭证处理
  996. '*    功 能 描 述 :此功能模块主要完成凭证录入、修改、删除、预览打印等。
  997. '*    程序员姓名  : 杨波
  998. '*    最后修改人  : 杨波
  999. '*    最后修改时间:2001/10/19
  1000. '*    备        注:程序中所有依实际情况自定义部分均用[>>  <<]括起
  1001. '*
  1002. '*    1.每次调入外部功能窗体,均要加锁ChangeLock=True,窗体关闭后解锁ChangeLock=false
  1003. '*
  1004. '*    2.网格列存储内容注解
  1005. '*      0-行有效标识 1-结算方式编码 2-结算方式名称 3-票号 4-发生日期 5-数量 6-用户录入单价(显示时自动计算)
  1006. '*      7-计量单位 8-外币编码 9-外币名称 10-外币金额 11-汇率 12-部门编码 13-部门名称
  1007. '*      14-客户编码 15-客户名称  16-职员编码 17-职员名称 18-项目大类编码 19-项目大类名称
  1008. '*      20-项目编码 21-项目名称  22-项目数量 23-项目计量单位 24-经办人 25-供应商编码 26-供应商名称
  1009. '*
  1010. '*      索引对照:001-摘要  002-科目编码 003-科目名称 004-借方金额 005-贷方金额
  1011. '*
  1012. '*    3.Lab_OperStatus 用此标签来标识单据录入状态(默认值为1) "1"-浏览 "2"-新增 "3"-修改
  1013. '*
  1014. '*    4.Lab_Pzclzt 用此标签来标识凭证处理状态(默认值为1) "1"-填制凭证 "2"-查询凭证列表 "3"-审核凭证
  1015. '*                                                       "4"-明细帐联查凭证
  1016. '*
  1017. '*    5.原则:只要单据能够存盘(无论修改或新增)则其必须接受完整性及有效性规则检查
  1018. '*    6.当执行“下张、上张、首张、末张”,写临时凭证;当“保存”时,则保存到正式凭证中,同时写临时凭证。
  1019. '*
  1020. '*********************************************************************************************************
  1021.  
  1022.  '[以下为根据实际情况设置变量
  1023. Dim Int_AssCount As Integer                     '辅助核算项目总数
  1024. Dim Bln_AssShow() As Boolean                    '辅助核算项目是否显示
  1025. Dim Bln_AssHelp() As Boolean                    '辅助核算项目是否有帮助
  1026. Dim Str_Digest As String                        '最后录入的一条凭证分录的摘要内容
  1027. Dim Bln_BillChange As Boolean                   '标识单据是否发生改动
  1028. Dim Int_Year As Integer     '年份
  1029. Dim Int_Period As Integer   '会计期间
  1030. Dim Rec_VouchMainTemp As New ADODB.Recordset    '临时凭证主表
  1031. Dim Rec_VouchTemp As New ADODB.Recordset        '临时凭证辅表
  1032. Dim Rectemp As New ADODB.Recordset              '临时数据表
  1033. Dim SqlStr As String                            '临时查询字符串
  1034. Dim Rec_TranMainTemp  As New ADODB.Recordset    '本批结转的所有凭证记录集
  1035. Dim Max_VouchIdTemp As Integer                  '本批凭证中最大的VouchIdTemp值
  1036. Dim Min_VouchIdTemp As Integer                  '本批凭证中最小的VouchIdTemp值
  1037.     
  1038.  ']
  1039.  
  1040.  '以下为固定使用变量(网格)
  1041. Dim Cxnrrec As New ADODB.Recordset              '显示查询内容动态集
  1042. Dim Dyymctbl As New DY_Dyymsz                   '打印页面窗体变量
  1043. Dim GridCode As String                          '显示网格网格代码
  1044. Dim GridInf() As Variant                        '整个网格设置信息
  1045. Dim ReportTitle As String                       '报表主标题
  1046. Dim Tsxx As String                              '系统提示信息
  1047. Dim Pmbcsjhs As Long                            '屏幕网格保持数据行数(大于等于1)
  1048. Dim Fzxwghs As Integer                          '辅助项网格行数(包括合计行)
  1049. Dim Sfxshjwg As Boolean                         '是否显示合计网格
  1050. Dim Qslz As Long                                '网格隐藏(非操作显示)列数
  1051. Dim Sjhgd As Double                             '网格数据行高度
  1052. Dim GridBoolean() As Boolean                    '网格列信息(布尔型)
  1053. Dim GridStr()  As String                        '网格列信息(字符型)
  1054. Dim GridInt() As Integer                        '网格列信息(整型)
  1055. Dim Sfblbzkd As Boolean                         '是否保留帮助宽度(字段提供帮助时,是否为按钮保留空间)
  1056. Dim Dqlrwgh As Long                             '当前录入数据网格行
  1057. Dim Dqlrwgl As Long                             '当前录入数据网格列
  1058. Dim Dqlkwgh As Long                             '刚刚离开网格行(不一定为录入行)
  1059. Dim Dqlkwgl As Long                             '刚刚离开网格列
  1060. Dim Dqtoprow As Long                            '当前录入状态时最上端可视行
  1061. Dim Dqleftcol As Long                           '当前录入状态时最左端可视列
  1062. Dim Zdlrqnr As String                           '字段录入修改前内容(用来判断内容是否修改)
  1063. Dim Wbkbhlock As Boolean                        '文本框改变值锁
  1064. Dim Changelock As Boolean                       '网格行列改变控制锁(用来区别用户改变.程序改变)
  1065. Dim Gdtlock As Boolean                          '滚动条滚动控制(用来区别用户改变.程序改变)
  1066. Dim Yxxpdlock As Boolean                        '字段有效性判断锁(内容不修改不需进行字段有效性判断)
  1067. Dim Hyxxpdlock As Boolean                       '行有效性判断锁(字段内容不修改不需进行行有效性判断)
  1068. Dim Valilock As Boolean                         '文本框失去焦点是否进行有效性控制(TRUE 为锁定*限用网格录入)
  1069. Dim Shsfts As Boolean                           '删除记录行是否提示
  1070. Dim Szzls As Integer                            '网格信息数组最大下标值(网格列数-1)
  1071.     
  1072. '以下为固定使用变量 (文本框)
  1073. Dim Textvar() As Variant                        '存储变体型文本框信息
  1074. Dim Textboolean() As Boolean                    '存储布尔型文本框信息
  1075. Dim Textint() As Integer                        '存储整型文本框信息
  1076. Dim Textstr() As String                         '存储字符型文本框信息
  1077. Dim Max_Text_Index As Integer                   '最大录入文本框索引值
  1078. Dim TextGroupCode As String                     '文本框录入分组编码
  1079. Dim TextValiLock As Boolean                     '文本框失去焦点是否进行有效性控制判断
  1080. Dim TextValiJudgeLock() As Boolean              '文本框录入有效性判断控制锁
  1081. Dim TextChangeLock As Boolean                   '文本框内容变换控制锁
  1082. Dim Bln_Cancel As Boolean                       '取消按钮信息传递
  1083. Dim currrecord As Integer
  1084. Dim MLoadMassage As Integer
  1085.     
  1086. Private Sub Form_KeyPress(KeyAscii As Integer)       '控 制 焦 点 转 移
  1087.     Dim jdzygs As Integer
  1088.     
  1089.     jdzygs = 3
  1090.    
  1091.     Select Case KeyAscii
  1092.         Case vbKeyReturn
  1093.             If Kjjdzy(jdzygs) Then
  1094.                 KeyAscii = 0
  1095.             End If
  1096.         Case 39           '屏蔽字符"'"
  1097.         KeyAscii = 0
  1098.     End Select
  1099.    
  1100. End Sub
  1101. Private Sub Form_Load()                              '窗 体 装 入
  1102.     
  1103.     '初始化各种锁值
  1104.     
  1105.     Changelock = False             '网格行列改变控制锁
  1106.     Gdtlock = False                '滚动条滚动控制
  1107.     Yxxpdlock = True               '字段有效性判断锁
  1108.     Hyxxpdlock = True              '行有效性判断锁
  1109.     Wbkbhlock = False              '文本框内容改变锁
  1110.   
  1111.    
  1112.     '[>>开始 设置辅助核算项目属性
  1113.     Int_AssCount = 14
  1114.     ReDim Bln_AssShow(Int_AssCount - 1)
  1115.     ReDim Bln_AssHelp(Int_AssCount - 1)
  1116.     Bln_AssHelp(0) = True         '结算方式
  1117.     Bln_AssHelp(2) = True         '发生日期
  1118.     Bln_AssHelp(7) = True         '部门
  1119.     Bln_AssHelp(8) = True         '往来客户
  1120.     Bln_AssHelp(9) = True         '个人
  1121.     Bln_AssHelp(10) = True        '项目
  1122.     Bln_AssHelp(12) = True        '供应商
  1123.     Bln_AssHelp(13) = True        '经办人
  1124.    
  1125.      
  1126.     '完毕<<]
  1127.     
  1128.     '报表主标题及报表编码
  1129.     ReportTitle = "记 帐 凭 证"
  1130.     XtReportCode = "chhs_jzpzcl"
  1131.     Load Dyymctbl
  1132.     
  1133.     '以下为文本框处理程序
  1134.     TextGroupCode = "chhs_jzpzcl"
  1135.     
  1136.     Call Drwbkxx(TextGroupCode, Textvar(), Textboolean(), Textint(), Textstr())  '读入文本框录入信息
  1137.     Call Wbkcsh
  1138.     
  1139.     '调 入 网 格
  1140.     GridCode = "chhs_jzpzcl"          '网格属性编码
  1141.     Call BzWgcsh(WglrGrid, GridCode, GridInf(), GridBoolean(), GridInt(), GridStr())
  1142.     
  1143.     Qslz = GridInf(1)
  1144.     Sjhgd = GridInf(2)
  1145.     Pmbcsjhs = GridInf(3)
  1146.     Fzxwghs = GridInf(4)
  1147.     Sfblbzkd = GridInf(5)
  1148.     Shsfts = GridInf(6)
  1149.     Sfxshjwg = GridInf(7)
  1150.     Szzls = WglrGrid.Cols - 1
  1151.     
  1152.     GridBoolean(Sydz("002", GridStr(), Szzls), 1) = False
  1153.     GridBoolean(Sydz("004", GridStr(), Szzls), 1) = False
  1154.     GridBoolean(Sydz("005", GridStr(), Szzls), 1) = False
  1155.     
  1156.     For Jsqte = WglrGrid.FixedRows To WglrGrid.Rows - 1
  1157.         WglrGrid.RowHeight(Jsqte) = Sjhgd
  1158.     Next Jsqte
  1159.   
  1160.   
  1161.     '[>>置删行是否提示状态
  1162.     If Shsfts Then
  1163.         Chk_DeleteMess.Value = 1
  1164.     Else
  1165.         Chk_DeleteMess.Value = 0
  1166.     End If
  1167.     '<<]
  1168.   
  1169.     '设置首张、上张、下张、末张的状态
  1170.     If CL_MakeVoucherSub.vsFlex_PzMain.Rows - CL_MakeVoucherSub.vsFlex_PzMain.FixedRows > 1 Then
  1171.         Tlb_Action.Buttons("first").Enabled = True               '首张
  1172.         Tlb_Action.Buttons("prev").Enabled = True                '上张
  1173.         Tlb_Action.Buttons("next").Enabled = True                '下张
  1174.         Tlb_Action.Buttons("last").Enabled = True                '末张
  1175.     Else
  1176.         Tlb_Action.Buttons("first").Enabled = False              '首张
  1177.         Tlb_Action.Buttons("prev").Enabled = False               '上张
  1178.         Tlb_Action.Buttons("next").Enabled = False               '下张
  1179.         Tlb_Action.Buttons("last").Enabled = False               '末张
  1180.     End If
  1181.     currrecord = 1
  1182.   
  1183.     '当前会计区间
  1184.     Combo_Kjqj.Text = Trim(Str(PGKjYear)) + "." + Trim(Str(PGNowmon))
  1185.     '初始化合计网格
  1186.   
  1187.     Call Cshhjwg
  1188.   
  1189.     '单据变动置为False
  1190.     Bln_BillChange = False
  1191.     
  1192.     
  1193.   
  1194. End Sub
  1195. Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
  1196.        
  1197.     Dim count As Integer
  1198. '   判断是否有没有存盘的转帐凭证
  1199.     If lbl_Tag.Caption = "0" Then
  1200.         For count = CL_MakeVoucherSub.vsFlex_PzMain.FixedRows To CL_MakeVoucherSub.vsFlex_PzMain.Rows - CL_MakeVoucherSub.vsFlex_PzMain.FixedRows
  1201.             If CL_MakeVoucherSub.vsFlex_PzMain.TextMatrix(count, 3) <> "1" Then
  1202.                 CL_NoSaveList.Show 1
  1203.                 Tsxx = "凭证没有全部保存,退出吗?"
  1204.                 If Xtxxts(Tsxx, 1, 2) = 6 Then  '若退出
  1205.                     GoTo a1
  1206.                 Else
  1207.                     Cancel = 1
  1208.                     Exit Sub
  1209.                 End If
  1210.             End If
  1211.         Next count
  1212.     End If
  1213.     
  1214.     If lbl_Tag.Caption = "1" Then
  1215.         If CL_MakeVoucherSub.vsFlex_PzMain.TextMatrix(CL_MakeVoucherSub.vsFlex_PzMain.FixedRows, 3) <> "1" Then
  1216.             CL_NoSaveList.Show 1
  1217.             Tsxx = "凭证没有全部保存,退出吗?"
  1218.             If Xtxxts(Tsxx, 1, 2) = 6 Then  '若退出
  1219.                 GoTo a1
  1220.             Else
  1221.                 Cancel = 1
  1222.                 Exit Sub
  1223.             End If
  1224.         End If
  1225.     End If
  1226.     
  1227. a1:
  1228.  
  1229.     '卸载打印页面窗体
  1230.     Unload Dyymctbl
  1231.     
  1232.     '卸载生成凭证子窗体
  1233.     If MLoadMassage = 0 Then
  1234.         Unload CL_MakeVoucherSub
  1235.         CL_MakeVoucher.Timer1.Enabled = True
  1236.     End If
  1237.     '判断凭证是否发生变化
  1238.     If Bln_BillChange Then
  1239.         Xtfhcs = "1"
  1240.     Else
  1241.         Xtfhcs = "0"
  1242.     End If
  1243.     
  1244.     Set Rec_VouchMainTemp = Nothing
  1245.     Set Rec_VouchTemp = Nothing
  1246.     Set Rectemp = Nothing
  1247.     Set Rec_TranMainTemp = Nothing
  1248.     Set Rs_TranMainTemp = Nothing
  1249.     
  1250.     Unload Me
  1251.     
  1252. End Sub
  1253. Private Sub Timer1_Timer()                           '根据不同凭证或单据状态处理不同的数据初始化
  1254.     '关闭定时器
  1255.     Timer1.Enabled = False
  1256.     
  1257.     Call Sjcsh(Trim(Lab_Pzclzt.Caption))
  1258.     
  1259.     '填充会计期间列表框(年度默认为用户选择年度)
  1260.     Int_Year = Val(Mid(Combo_Kjqj.Text, 1, 4))
  1261.     Int_Period = Val(Mid(Combo_Kjqj.Text, 6, 2))
  1262.     
  1263. End Sub
  1264. Private Sub Sjcsh(Str_Pzclzt As String)              '数据初始化模块(根据实际情况)
  1265.     Dim SqlStr As String       '查询凭证列表条件
  1266.     
  1267.     '[>>根据实际情况初始化
  1268.     Select Case Str_Pzclzt
  1269.         Case "1"   '编辑凭证
  1270.         
  1271.             '日期默认值为用户选择日期
  1272.             LrText(1).Text = Format(Xtrq, "yyyy-mm-dd")
  1273.         
  1274.             '设置操作状态为浏览
  1275.             Select Case lbl_Tag.Caption
  1276.                 Case "0"
  1277.                     Lab_OperStatus = "2"         '新增状态
  1278.                     Call Sub_OperStatus("30")
  1279.                     Call Sub_ShowBill(1)
  1280.                 Case "1"
  1281.                     Lab_OperStatus = "2"         '新增状态
  1282.                     Call Sub_OperStatus("30")
  1283.                     Call sub_HBShow
  1284.                 Case "2"
  1285.                     Lab_OperStatus = "1"         '浏览状态
  1286.                     Call Sub_OperStatus("11")
  1287.                     Call Sub_ShowPz
  1288.                 Case "3"
  1289.                     Lab_OperStatus = "2"         '浏览状态
  1290.                     Call Sub_OperStatus("30")
  1291.                     Call Sub_ShowPz
  1292.                 
  1293.             End Select
  1294.             
  1295.     End Select
  1296.   
  1297.     '<<]
  1298.     
  1299.     '重 置 网 格
  1300.     Call Sub_AdjustGrid
  1301.     
  1302. End Sub
  1303. Private Sub Sub_ShowBill(arry As Integer)                                            '根据当前单据号显示整张单据内容
  1304.             
  1305.     Dim count As Long                           '临时计数器
  1306.             
  1307.     '[>>显示单据头
  1308.     TextChangeLock = True
  1309.     
  1310.     LrText(0) = vouchz                          '凭证类别
  1311.     
  1312.     LrText(1) = Format(Trim(CL_MakeVoucherSub.vsFlex_PzMain.TextMatrix(arry, 1)), "yyyy-mm-dd")     '制单日期
  1313.     LrText(2) = Trim(CL_MakeVoucherSub.vsFlex_PzMain.TextMatrix(arry, 2))                           '随单据
  1314.     Lab_Bill = Xtczy                                                                                '制单人
  1315.     
  1316.     
  1317.     TextChangeLock = False
  1318.     WglrGrid.Rows = WglrGrid.FixedRows
  1319.      '[>>显示单据分录
  1320.     With CL_MakeVoucherSub.vsFlex_PzChild
  1321.         For count = .FixedRows To .Rows - 1
  1322.             If Trim(.TextMatrix(count, 0)) = Trim(CL_MakeVoucherSub.vsFlex_PzMain.TextMatrix(arry, 0)) And Val(.TextMatrix(count, 28)) = Val(CL_MakeVoucherSub.vsFlex_PzMain.TextMatrix(arry, 5)) Then
  1323.                If Val(.TextMatrix(count, 4)) = Val(.TextMatrix(count, 5)) Then
  1324.                Else
  1325.                     WglrGrid.AddItem ""
  1326.                     WglrGrid.TextMatrix(WglrGrid.Rows - WglrGrid.FixedRows, 0) = "*"                                                             '行标识
  1327.                     WglrGrid.TextMatrix(WglrGrid.Rows - WglrGrid.FixedRows, 1) = Trim(.TextMatrix(count, 7))            '结算方式
  1328.                     WglrGrid.TextMatrix(WglrGrid.Rows - WglrGrid.FixedRows, 2) = Trim(.TextMatrix(count, 8))
  1329.                     WglrGrid.TextMatrix(WglrGrid.Rows - WglrGrid.FixedRows, 3) = Trim(.TextMatrix(count, 9))            '票号
  1330.                     WglrGrid.TextMatrix(WglrGrid.Rows - WglrGrid.FixedRows, 4) = Trim(.TextMatrix(count, 10))           '发生日期
  1331.                     WglrGrid.TextMatrix(WglrGrid.Rows - WglrGrid.FixedRows, 5) = Trim(.TextMatrix(count, 11))           '数量
  1332.                     WglrGrid.TextMatrix(WglrGrid.Rows - WglrGrid.FixedRows, 6) = Trim(.TextMatrix(count, 12))           '单价
  1333.                     WglrGrid.TextMatrix(WglrGrid.Rows - WglrGrid.FixedRows, 10) = Trim(.TextMatrix(count, 13))          '外币金额
  1334.                     WglrGrid.TextMatrix(WglrGrid.Rows - WglrGrid.FixedRows, 11) = Trim(.TextMatrix(count, 14))          '汇率
  1335.                     WglrGrid.TextMatrix(WglrGrid.Rows - WglrGrid.FixedRows, 12) = Trim(.TextMatrix(count, 15))          '部门
  1336.                     WglrGrid.TextMatrix(WglrGrid.Rows - WglrGrid.FixedRows, 13) = Trim(.TextMatrix(count, 16))
  1337.                     WglrGrid.TextMatrix(WglrGrid.Rows - WglrGrid.FixedRows, 14) = Trim(.TextMatrix(count, 17))          '客户
  1338.                     WglrGrid.TextMatrix(WglrGrid.Rows - WglrGrid.FixedRows, 15) = Trim(.TextMatrix(count, 18))
  1339.                     WglrGrid.TextMatrix(WglrGrid.Rows - WglrGrid.FixedRows, 16) = Trim(.TextMatrix(count, 19))          '个人
  1340.                     WglrGrid.TextMatrix(WglrGrid.Rows - WglrGrid.FixedRows, 17) = Trim(.TextMatrix(count, 20))
  1341.                     WglrGrid.TextMatrix(WglrGrid.Rows - WglrGrid.FixedRows, 20) = Trim(.TextMatrix(count, 21))          '项目
  1342.                     WglrGrid.TextMatrix(WglrGrid.Rows - WglrGrid.FixedRows, 21) = Trim(.TextMatrix(count, 22))
  1343.                     WglrGrid.TextMatrix(WglrGrid.Rows - WglrGrid.FixedRows, 22) = Trim(.TextMatrix(count, 23))          '项目数量
  1344.                     WglrGrid.TextMatrix(WglrGrid.Rows - WglrGrid.FixedRows, 23) = Trim(.TextMatrix(count, 24))
  1345.                     WglrGrid.TextMatrix(WglrGrid.Rows - WglrGrid.FixedRows, 25) = Trim(.TextMatrix(count, 25))          '供应商
  1346.                     WglrGrid.TextMatrix(WglrGrid.Rows - WglrGrid.FixedRows, 26) = Trim(.TextMatrix(count, 26))
  1347.                     WglrGrid.TextMatrix(WglrGrid.Rows - WglrGrid.FixedRows, 24) = Trim(.TextMatrix(count, 27))          '经办人
  1348.                     WglrGrid.TextMatrix(WglrGrid.Rows - WglrGrid.FixedRows, 27) = Trim(.TextMatrix(count, 6))           '科目标志
  1349.                     WglrGrid.TextMatrix(WglrGrid.Rows - WglrGrid.FixedRows, Sydz("001", GridStr(), Szzls)) = Trim(.TextMatrix(count, 1))          '摘 要
  1350.                     WglrGrid.TextMatrix(WglrGrid.Rows - WglrGrid.FixedRows, Sydz("002", GridStr(), Szzls)) = Trim(.TextMatrix(count, 2))          '科目编码
  1351.                     WglrGrid.TextMatrix(WglrGrid.Rows - WglrGrid.FixedRows, Sydz("003", GridStr(), Szzls)) = Trim(.TextMatrix(count, 3))          '科目名称
  1352.                     If Val(.TextMatrix(count, 4)) > Val(.TextMatrix(count, 5)) Then
  1353.                         WglrGrid.TextMatrix(WglrGrid.Rows - WglrGrid.FixedRows, Sydz("004", GridStr(), Szzls)) = Val(.TextMatrix(count, 4)) - Val(.TextMatrix(count, 5))        '借方金额
  1354.                     Else
  1355.                         WglrGrid.TextMatrix(WglrGrid.Rows - WglrGrid.FixedRows, Sydz("005", GridStr(), Szzls)) = Val(.TextMatrix(count, 5)) - Val(.TextMatrix(count, 4))          '贷方金额
  1356.                     End If
  1357.                 End If
  1358.             End If
  1359.         Next count
  1360.     End With
  1361.     
  1362.     '计算凭证号
  1363.     Call Sub_JsVouchNo
  1364.        
  1365.     '调整网格
  1366.     Call Sub_AdjustGrid
  1367.     
  1368.     '显示备注信息
  1369.     Call Sub_ShowMemo(WglrGrid.Row)
  1370.       
  1371.     '计算合计数据
  1372.     For count = Qslz To WglrGrid.Cols - 1
  1373.         Call Sjhj(count)
  1374.     Next count
  1375.     
  1376.     '
  1377.     If CL_MakeVoucherSub.vsFlex_PzMain.TextMatrix(currrecord, 3) = "1" Then
  1378.         Lab_Succeed.Visible = True
  1379.         Lab_OperStatus = "1"
  1380.         Call Sub_OperStatus("11")
  1381.     Else
  1382.         Lab_Succeed.Visible = False
  1383.         Lab_OperStatus = "2"
  1384.         Call Sub_OperStatus("30")
  1385.     End If
  1386.       
  1387. End Sub
  1388. Private Sub sub_HBShow()
  1389.     Dim count As Long                           '临时计数器
  1390.             
  1391.     '[>>显示单据头
  1392.     TextChangeLock = True
  1393.     
  1394.     LrText(0) = vouchz                          '凭证类别
  1395.     
  1396.     LrText(1) = Format(Xtrq, "yyyy-mm-dd")     '制单日期
  1397.     LrText(2) = Trim(CL_MakeVoucherSub.vsFlex_PzMain.Rows - 1)                 '随单据
  1398.     Lab_Bill = Xtczy                                                       '制单人
  1399.     
  1400.     
  1401.     TextChangeLock = False
  1402.     WglrGrid.Rows = WglrGrid.FixedRows
  1403.      '[>>显示单据分录
  1404.     With CL_MakeVoucherSub.vsFlex_PzChild
  1405.         For count = .FixedRows To .Rows - 1
  1406.             If Val(.TextMatrix(count, 4)) = Val(.TextMatrix(count, 5)) Then
  1407.             Else
  1408.                 WglrGrid.AddItem ""
  1409.                 WglrGrid.RowHeight(count) = Sjhgd
  1410.                 WglrGrid.TextMatrix(WglrGrid.Rows - WglrGrid.FixedRows, 0) = "*"                                                             '行标识
  1411.                 WglrGrid.TextMatrix(WglrGrid.Rows - WglrGrid.FixedRows, 1) = Trim(.TextMatrix(count, 7))            '结算方式
  1412.                 WglrGrid.TextMatrix(WglrGrid.Rows - WglrGrid.FixedRows, 2) = Trim(.TextMatrix(count, 8))
  1413.                 WglrGrid.TextMatrix(WglrGrid.Rows - WglrGrid.FixedRows, 3) = Trim(.TextMatrix(count, 9))            '票号
  1414.                 WglrGrid.TextMatrix(WglrGrid.Rows - WglrGrid.FixedRows, 4) = Trim(.TextMatrix(count, 10))           '发生日期
  1415.                 WglrGrid.TextMatrix(WglrGrid.Rows - WglrGrid.FixedRows, 5) = Trim(.TextMatrix(count, 11))           '数量
  1416.                 WglrGrid.TextMatrix(WglrGrid.Rows - WglrGrid.FixedRows, 6) = Trim(.TextMatrix(count, 12))           '单价
  1417.                 WglrGrid.TextMatrix(WglrGrid.Rows - WglrGrid.FixedRows, 10) = Trim(.TextMatrix(count, 13))          '外币金额
  1418.                 WglrGrid.TextMatrix(WglrGrid.Rows - WglrGrid.FixedRows, 11) = Trim(.TextMatrix(count, 14))          '汇率
  1419.                 WglrGrid.TextMatrix(WglrGrid.Rows - WglrGrid.FixedRows, 12) = Trim(.TextMatrix(count, 15))          '部门
  1420.                 WglrGrid.TextMatrix(WglrGrid.Rows - WglrGrid.FixedRows, 13) = Trim(.TextMatrix(count, 16))
  1421.                 WglrGrid.TextMatrix(WglrGrid.Rows - WglrGrid.FixedRows, 14) = Trim(.TextMatrix(count, 17))          '客户
  1422.                 WglrGrid.TextMatrix(WglrGrid.Rows - WglrGrid.FixedRows, 15) = Trim(.TextMatrix(count, 18))
  1423.                 WglrGrid.TextMatrix(WglrGrid.Rows - WglrGrid.FixedRows, 16) = Trim(.TextMatrix(count, 19))          '个人
  1424.                 WglrGrid.TextMatrix(WglrGrid.Rows - WglrGrid.FixedRows, 17) = Trim(.TextMatrix(count, 20))
  1425.                 WglrGrid.TextMatrix(WglrGrid.Rows - WglrGrid.FixedRows, 20) = Trim(.TextMatrix(count, 21))          '项目
  1426.                 WglrGrid.TextMatrix(WglrGrid.Rows - WglrGrid.FixedRows, 21) = Trim(.TextMatrix(count, 22))
  1427.                 WglrGrid.TextMatrix(WglrGrid.Rows - WglrGrid.FixedRows, 22) = Trim(.TextMatrix(count, 23))          '项目数量
  1428.                 WglrGrid.TextMatrix(WglrGrid.Rows - WglrGrid.FixedRows, 23) = Trim(.TextMatrix(count, 24))
  1429.                 WglrGrid.TextMatrix(WglrGrid.Rows - WglrGrid.FixedRows, 25) = Trim(.TextMatrix(count, 25))          '供应商
  1430.                 WglrGrid.TextMatrix(WglrGrid.Rows - WglrGrid.FixedRows, 26) = Trim(.TextMatrix(count, 26))
  1431.                 WglrGrid.TextMatrix(WglrGrid.Rows - WglrGrid.FixedRows, 24) = Trim(.TextMatrix(count, 27))          '经办人
  1432.                 WglrGrid.TextMatrix(WglrGrid.Rows - WglrGrid.FixedRows, 27) = Trim(.TextMatrix(count, 6))           '科目标志
  1433.                 WglrGrid.TextMatrix(WglrGrid.Rows - WglrGrid.FixedRows, Sydz("001", GridStr(), Szzls)) = Trim(.TextMatrix(count, 1))          '摘 要
  1434.                 WglrGrid.TextMatrix(WglrGrid.Rows - WglrGrid.FixedRows, Sydz("002", GridStr(), Szzls)) = Trim(.TextMatrix(count, 2))          '科目编码
  1435.                 WglrGrid.TextMatrix(WglrGrid.Rows - WglrGrid.FixedRows, Sydz("003", GridStr(), Szzls)) = Trim(.TextMatrix(count, 3))          '科目名称
  1436.                 If Val(.TextMatrix(count, 4)) > Val(.TextMatrix(count, 5)) Then
  1437.                     WglrGrid.TextMatrix(WglrGrid.Rows - WglrGrid.FixedRows, Sydz("004", GridStr(), Szzls)) = Val(.TextMatrix(count, 4)) - Val(.TextMatrix(count, 5))        '借方金额
  1438.                 Else
  1439.                     WglrGrid.TextMatrix(WglrGrid.Rows - WglrGrid.FixedRows, Sydz("005", GridStr(), Szzls)) = Val(.TextMatrix(count, 5)) - Val(.TextMatrix(count, 4))        '贷方金额
  1440.                 End If
  1441.             End If
  1442.         Next count
  1443.     End With
  1444.     
  1445.     '计算凭证号
  1446.     Call Sub_JsVouchNo
  1447.        
  1448.     '调整网格
  1449.     Call Sub_AdjustGrid
  1450.     
  1451.     '显示备注信息
  1452.     Call Sub_ShowMemo(WglrGrid.Row)
  1453.       
  1454.     '计算合计数据
  1455.     For count = Qslz To WglrGrid.Cols - 1
  1456.         Call Sjhj(count)
  1457.     Next count
  1458.     
  1459.     '
  1460.     If CL_MakeVoucherSub.vsFlex_PzMain.TextMatrix(currrecord, 3) = "1" Then
  1461.         Lab_Succeed.Visible = True
  1462.         Lab_OperStatus = "1"
  1463.         Call Sub_OperStatus("11")
  1464.     Else
  1465.         Lab_Succeed.Visible = False
  1466.         Lab_OperStatus = "2"
  1467.         Call Sub_OperStatus("30")
  1468.     End If
  1469. End Sub
  1470. Private Sub Sub_ShowPz()
  1471.     
  1472.     Dim Jsqte As Long                       '临时计数器
  1473.     Dim SqlStr As String
  1474.     Dim Rectemp As ADODB.Recordset
  1475.     
  1476.     
  1477.     
  1478.     SqlStr = "select * from chhs_v_vouch where VouchId='" & Val(Trim(Lab_VouchId.Caption)) & "' Order by SerialID"
  1479.     
  1480.     Set Rectemp = Cw_DataEnvi.DataConnect.Execute(SqlStr)
  1481.     With Rectemp
  1482.         WglrGrid.Clear 1
  1483.         If .EOF Then
  1484.             Exit Sub
  1485.         Else
  1486.             
  1487.             WglrGrid.Rows = .RecordCount + WglrGrid.FixedRows
  1488.             
  1489.             '[>>显示单据头
  1490.             TextChangeLock = True
  1491.             LrText(0).Text = Trim(.Fields("VouchClassCode"))                                        '凭证类别
  1492.             If Lab_Succeed.Caption = "已生成" Then
  1493.                LrText(3).Text = Mid(Trim(Str(10000 + .Fields("VouchNo"))), 2, 4)                    '凭证号
  1494.             End If
  1495.             If IsDate(.Fields("DDate")) Then
  1496.                LrText(1).Text = Format(.Fields("Ddate"), "yyyy-mm-dd")                              '制单日期
  1497.             End If
  1498.             LrText(2).Text = Trim(Str(.Fields("Doc")))                                              '附单据数
  1499.             Lab_Bill.Caption = Trim(.Fields("Bill") & "")                                           '制单人
  1500.             Lab_Checker.Caption = ""                                                                '审核人
  1501.             Lab_Book.Caption = ""                                                                   '记帐人
  1502.             Lab_Error.Visible = False                                                               '标错
  1503.              TextChangeLock = False
  1504.             '<<]
  1505.          End If
  1506.          Jsqte = WglrGrid.FixedRows
  1507.          Do While Not .EOF
  1508.            If Jsqte >= WglrGrid.Rows Then
  1509.               WglrGrid.AddItem ""
  1510.            End If
  1511.            
  1512.            '[>>显示单据分录
  1513.            WglrGrid.TextMatrix(Jsqte, 0) = "*"                                                     '行标识
  1514.            WglrGrid.TextMatrix(Jsqte, 1) = ""                                                      '结算方式编码
  1515.            WglrGrid.TextMatrix(Jsqte, 2) = ""                                                      '结算方式名称
  1516.            WglrGrid.TextMatrix(Jsqte, 3) = ""                                                      '票号
  1517.            If IsDate(.Fields("BillDate") & "") Then
  1518.               WglrGrid.TextMatrix(Jsqte, 4) = Format(.Fields("BillDate"), "yyyy-mm-dd")            '发生日期
  1519.            End If
  1520.            If .Fields("Jfsl") <> 0 Then
  1521.               WglrGrid.TextMatrix(Jsqte, 5) = Trim(Str(.Fields("Jfsl")))                           '数量
  1522.            End If
  1523.            If .Fields("Dfsl") <> 0 Then
  1524.               WglrGrid.TextMatrix(Jsqte, 5) = Trim(Str(.Fields("Dfsl")))                           '数量
  1525.            End If
  1526.            WglrGrid.TextMatrix(Jsqte, 7) = ""                                                      '计量单位
  1527.             '币种为外币时填充网格
  1528.            If Trim(.Fields("ForeignCurrCode") & "") <> XtSCurrCode Then
  1529.                WglrGrid.TextMatrix(Jsqte, 8) = Trim(.Fields("ForeignCurrCode") & "")                         '原币编码
  1530.                WglrGrid.TextMatrix(Jsqte, 9) = Trim(.Fields("ForeignCurrName") & "")                         '原币名称
  1531.                If .Fields("Wbjfje") <> 0 Then
  1532.                   WglrGrid.TextMatrix(Jsqte, 10) = Trim(Str(.Fields("Wbjfje")))                              '原币金额
  1533.                End If
  1534.                If .Fields("Wbdfje") <> 0 Then
  1535.                   WglrGrid.TextMatrix(Jsqte, 10) = Trim(Str(.Fields("Wbdfje")))                              '原币金额
  1536.                End If
  1537.                If .Fields("AccRate") <> 0 Then
  1538.                   WglrGrid.TextMatrix(Jsqte, 11) = Trim(Str(.Fields("AccRate")))                             '记帐汇率
  1539.                End If
  1540.            End If
  1541.            WglrGrid.TextMatrix(Jsqte, 12) = Trim(.Fields("DeptCode") & "")                         '部门编码
  1542.            WglrGrid.TextMatrix(Jsqte, 13) = Trim(.Fields("DeptName") & "")                         '部门名称
  1543.            WglrGrid.TextMatrix(Jsqte, 14) = Trim(.Fields("CusCode") & "")                          '客户编码
  1544.            WglrGrid.TextMatrix(Jsqte, 15) = Trim(.Fields("CusName") & "")                          '客户名称
  1545.            WglrGrid.TextMatrix(Jsqte, 25) = Trim(.Fields("SupplierCode") & "")                    '供应商编码
  1546.            WglrGrid.TextMatrix(Jsqte, 26) = Trim(.Fields("SupplierName") & "")                    '供应商名称
  1547.            WglrGrid.TextMatrix(Jsqte, 16) = Trim(.Fields("PersonCode") & "")                       '职员编码
  1548.            WglrGrid.TextMatrix(Jsqte, 17) = Trim(.Fields("PersonName") & "")                       '职员名称
  1549.            WglrGrid.TextMatrix(Jsqte, 18) = Trim(.Fields("ItemClassCode") & "")                    '项目类别编码
  1550.            WglrGrid.TextMatrix(Jsqte, 19) = Trim(.Fields("ItemClassName") & "")                    '项目类别名称
  1551.            WglrGrid.TextMatrix(Jsqte, 20) = Trim(.Fields("ItemCode") & "")                         '项目编码
  1552.            WglrGrid.TextMatrix(Jsqte, 21) = Trim(.Fields("ItemName") & "")                         '项目名称
  1553.            If Val(Trim(.Fields("ItemJfsl") & "")) <> 0 Then
  1554.                WglrGrid.TextMatrix(Jsqte, 22) = Trim(Str(.Fields("ItemJfsl")))                     '项目数量
  1555.            End If
  1556.            If Val(Trim(.Fields("ItemDfsl") & "")) <> 0 Then
  1557.               WglrGrid.TextMatrix(Jsqte, 22) = Trim(Str(.Fields("ItemDfsl")))                      '项目数量
  1558.            End If
  1559.            WglrGrid.TextMatrix(Jsqte, 24) = Trim(.Fields("TranPerson") & "")                       '经办人
  1560.            WglrGrid.TextMatrix(Jsqte, Sydz("001", GridStr(), Szzls)) = Trim(.Fields("Digest"))     '摘 要
  1561.            WglrGrid.TextMatrix(Jsqte, Sydz("002", GridStr(), Szzls)) = Trim(.Fields("Ccode"))        '科目编码
  1562.            WglrGrid.TextMatrix(Jsqte, Sydz("003", GridStr(), Szzls)) = Trim(.Fields("Cname") & "")   '科目名称
  1563.            If .Fields("Jfje") <> 0 Then
  1564.               WglrGrid.TextMatrix(Jsqte, Sydz("004", GridStr(), Szzls)) = Trim(Str(.Fields("Jfje"))) '借方金额
  1565.            Else
  1566.               WglrGrid.TextMatrix(Jsqte, Sydz("005", GridStr(), Szzls)) = Trim(Str(.Fields("Dfje"))) '贷方金额
  1567.            End If
  1568.            
  1569.            '<<]
  1570.            
  1571.            WglrGrid.RowHeight(Jsqte) = Sjhgd
  1572.            .MoveNext
  1573.            Jsqte = Jsqte + 1
  1574.          Loop
  1575.       End With
  1576.             
  1577.       '调整网格
  1578.        Call Sub_AdjustGrid
  1579.       
  1580.        '显示备注信息
  1581.        Call Sub_ShowMemo(WglrGrid.Row)
  1582.       
  1583.       '计算合计数据
  1584.        For Jsqte = Qslz To WglrGrid.Cols - 1
  1585.            Call Sjhj(Jsqte)
  1586.        Next Jsqte
  1587.     
  1588. End Sub
  1589. Private Sub Tlb_Action_ButtonClick(ByVal Button As MSComctlLib.Button)             '用户点击工具条
  1590.      
  1591.     '屏蔽文本框,下拉组合框有效性判断
  1592.     Valilock = True
  1593.     
  1594.     '屏蔽网格失去焦点产生的有效性判断
  1595.     Changelock = True
  1596.      
  1597.     Select Case Button.Key
  1598.         Case "ymsz"                                          '页面设置
  1599.             Dyymctbl.Show 1
  1600.         Case "yl"                                            '预 览
  1601.             If Fun_Drfrmyxxpd Then
  1602.                 Call bbyl(True)
  1603.             End If
  1604.         Case "dy"                                            '打 印
  1605.             If Fun_Drfrmyxxpd Then
  1606.                 Call bbyl(False)
  1607.             End If
  1608.         Case "bc"                                            '保 存
  1609.             Call Sub_SaveBill
  1610.         Case "fq"                                            '放 弃
  1611.             Call Sub_AbandonBill
  1612.         Case "first"                                         '首 张
  1613.             Call Sub_First
  1614.         Case "prev"                                          '上 张
  1615.             Call Sub_Prev
  1616.         Case "next"                                          '下 张
  1617.             Call Sub_next
  1618.         Case "last"                                          '末 张
  1619.             Call Sub_Last
  1620.         Case "bz"                                            '帮 助
  1621.            Call F1bz
  1622.         Case "fh"                                            '退 出
  1623.             Unload Me
  1624.     End Select
  1625.        
  1626.     '解 锁
  1627.     Valilock = False
  1628.     Changelock = False
  1629.         
  1630. End Sub
  1631. Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)     '支持热键操作
  1632.     Select Case KeyCode
  1633.         Case vbKeyF6                                                 '保存凭证
  1634.             If Tlb_Action.Buttons("bc").Enabled Then
  1635.                 Call Sub_SaveBill
  1636.             End If
  1637.     End Select
  1638.    
  1639. End Sub
  1640. Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)       '支持热键操作
  1641.     If Shift = 2 Then
  1642.         Select Case UCase(Chr(KeyCode))
  1643.             Case "P"                   'Ctrl+P 打印
  1644.                 If Tlb_Action.Buttons("dy").Enabled Then
  1645.                     Call bbyl(False)
  1646.                 End If
  1647.         End Select
  1648.     End If
  1649.     
  1650. End Sub
  1651. Private Sub Sub_OperStatus(Str_Status As String)                 '工具条依据不同状态所进行的变化
  1652.     With Tlb_Action
  1653.         Select Case Str_Status
  1654.           Case "11"   '浏览(放弃修改单据,查询单据,明细帐联查凭证)
  1655.              '工具条
  1656.             .Buttons("dy").Enabled = True      '打印
  1657.             .Buttons("yl").Enabled = True      '预览
  1658.             .Buttons("zh").Enabled = False     '增行
  1659.             .Buttons("sh").Enabled = False     '删行
  1660.             .Buttons("bc").Enabled = False     '保存
  1661.             .Buttons("fq").Enabled = False     '放弃
  1662.             
  1663.            '录入文本框
  1664.             For Jsqte = Max_Text_Index To 0 Step -1
  1665.                 LrText(Jsqte).Enabled = False
  1666.             Next Jsqte
  1667.             
  1668.             Ydtext.Visible = False
  1669.             Ydcommand.Visible = False
  1670.     
  1671.             '合计金额大写显示
  1672.             HjGrid.TextMatrix(0, Sydz("003", GridStr(), Szzls)) = Fun_Jezh(Val(HjGrid.TextMatrix(0, Sydz("004", GridStr(), Szzls))))
  1673.         
  1674.             Case "30"   '修改(生成)
  1675.         
  1676.                 '工具条
  1677.                 If Lab_Succeed.Caption = "已生成" Then
  1678.                     .Buttons("dy").Enabled = True                   '打印
  1679.                     .Buttons("yl").Enabled = True                   '预览
  1680.                 Else
  1681.                     .Buttons("dy").Enabled = False                  '打印
  1682.                     .Buttons("yl").Enabled = False                  '预览
  1683.                 End If
  1684.                 .Buttons("zh").Enabled = True                       '增行
  1685.                 .Buttons("sh").Enabled = True                       '删行
  1686.                 .Buttons("bc").Enabled = True                       '保存
  1687.                 .Buttons("fq").Enabled = True                       '放弃
  1688.                 
  1689.                 Select Case lbl_Tag.Caption
  1690.                     Case "1", "2", "3"
  1691.                         .Buttons("first").Enabled = False
  1692.                         .Buttons("prev").Enabled = False
  1693.                         .Buttons("next").Enabled = False
  1694.                         .Buttons("last").Enabled = False
  1695.                 End Select
  1696.                 
  1697.                 
  1698.                 '录入文本框
  1699.                 For Jsqte = 0 To Max_Text_Index
  1700.                     LrText(Jsqte).Enabled = True
  1701.                 Next Jsqte
  1702.                 
  1703.                 LrText(0).Enabled = False
  1704.                 LrText(3).Enabled = False
  1705.                 Ydtext.Visible = False
  1706.                 Ydcommand.Visible = False
  1707.                 
  1708.                 '清空合计大写
  1709.                 HjGrid.TextMatrix(0, Sydz("003", GridStr(), Szzls)) = ""
  1710.                 
  1711.             Case "30"   '修改(合并)
  1712.             
  1713.         End Select
  1714.     End With
  1715.     
  1716. End Sub
  1717. Private Sub Wbkcl()                                                 '文本框录入之前处理(根据实际情况)
  1718.     Dim xswbrr As String
  1719.     
  1720.     With WglrGrid
  1721.         Zdlrqnr = Trim(.Text)
  1722.         xswbrr = Trim(.Text)
  1723.        
  1724.         If GridBoolean(.Col, 3) Then   '列表框录入
  1725.        
  1726.         Else
  1727.             Wbkbhlock = True
  1728.             
  1729.             '====以下为用户自定义
  1730.             Ydtext.Text = xswbrr
  1731.             '====以上为用户自定义
  1732.             
  1733.             Wbkbhlock = False
  1734.             Ydtext.SelStart = Len(Ydtext.Text)
  1735.         End If
  1736.     End With
  1737.     
  1738. End Sub
  1739. Private Function sjzdyxxpd(Dqpdwgh As Long, Dqpdwgl As Long)        '录入数据字段有效性判断,同时进行字段录入事后处理
  1740.     
  1741.     Dim Str_JudgeText As String            '临时有效性判断字段内容
  1742.     Dim Coljsq As Long                     '临时列计数器
  1743.     Dim Rectemp As New ADODB.Recordset     '临时使用动态集
  1744.     
  1745.     With WglrGrid
  1746.         
  1747.         '非录入状态有效性为合法
  1748.         If Yxxpdlock Or .Row < .FixedRows Then
  1749.             sjzdyxxpd = True
  1750.             Exit Function
  1751.         End If
  1752.         
  1753.         Str_JudgeText = Trim(.TextMatrix(Dqpdwgh, Dqpdwgl))
  1754.         Select Case GridStr(Dqpdwgl, 1)
  1755.              
  1756.             '以下为自定义部分[
  1757.             Case "001"          '凭证摘要(如用户录入编码正确,则自动调入摘要内容)
  1758.                 If Len(Str_JudgeText) <> 0 Then
  1759.                     SqlStr = "SELECT * FROM Cwzz_Digest Where DigestCode='" & Str_JudgeText & "'"
  1760.                     Set Rectemp = Cw_DataEnvi.DataConnect.Execute(SqlStr)
  1761.                     If Not Rectemp.EOF Then
  1762.                         .TextMatrix(Dqpdwgh, Sydz("001", GridStr(), Szzls)) = Trim(Rectemp.Fields("DigestText"))
  1763.                     End If
  1764.                      
  1765.                      '保存最后录入的一条凭证分录的摘要内容
  1766.                     Str_Digest = .TextMatrix(Dqpdwgh, Sydz("001", GridStr(), Szzls))
  1767.                 End If
  1768.                 '2.放置字段事后处理程序
  1769.                 '以上为自定义部分]
  1770.          End Select
  1771.          
  1772.          '字段录入正确后为零字段清空
  1773.          Call Qkwlzd(Dqpdwgh, Dqpdwgl)
  1774.          
  1775.          '字段录入正确后进行数据合计
  1776.          For Coljsq = Qslz To .Cols - 1
  1777.              Call Sjhj(Coljsq)
  1778.          Next Coljsq
  1779.          sjzdyxxpd = True
  1780.          Yxxpdlock = True
  1781.          Exit Function
  1782.     End With
  1783.     
  1784. Lrcwcl:    '录入错误处理
  1785.     With WglrGrid
  1786.         Call Xtxxts(Tsxx, 0, 1)
  1787.         Changelock = True
  1788.         .Select Dqpdwgh, Dqpdwgl
  1789.         Changelock = False
  1790.         Call xswbk
  1791.         sjzdyxxpd = False
  1792.         Exit Function
  1793.      End With
  1794.    
  1795. End Function
  1796. Private Function Sjhzyxxpd(ByVal Yxxpdh As Long) As Boolean                  '录入数据行有效性判断,同时进行行处理
  1797.     Dim Lrywlz As Long
  1798.     Dim Rectemp As New ADODB.Recordset     '临时使用动态集
  1799.     Dim Bln_AssVali As Boolean             '辅助核算错误
  1800.     Dim Jsqte As Long                      '临时计数器
  1801.     
  1802.     With WglrGrid
  1803.         If Yxxpdh > (.Rows - .FixedRows) Then Exit Function
  1804.         '判断行为空和无效数据行则清除当前行
  1805.         If .TextMatrix(Yxxpdh, 0) <> "*" Then
  1806.             Sjhzyxxpd = True
  1807.             Exit Function
  1808.         Else
  1809.             If pdhwk(Yxxpdh) And Yxxpdh + 1 <= .Rows - 1 Then
  1810.                 If .TextMatrix(Yxxpdh + 1, 0) <> "*" Then
  1811.                     Changelock = True
  1812.                     .RemoveItem Yxxpdh
  1813.                     If .Rows < Pmbcsjhs + .FixedRows + Fzxwghs + 1 Then
  1814.                         .AddItem ""
  1815.                         .RowHeight(.Rows - 1) = Sjhgd
  1816.                     End If
  1817.                     Changelock = False
  1818.                     Sjhzyxxpd = True
  1819.                     Exit Function
  1820.                 End If
  1821.             End If
  1822.         End If
  1823.   
  1824.         '行没有发生变化则不进行有效性判断
  1825.         If Hyxxpdlock Then
  1826.            Sjhzyxxpd = True
  1827.            Exit Function
  1828.         End If
  1829.   
  1830.         '以下为自定义部分[
  1831.         '1.放置行有效性判断程序
  1832.            '首先进行为空判断(固定不变)
  1833.         For Jsqte = Qslz To .Cols - 1
  1834.             If (GridInt(Jsqte, 5) = 1 And Len(Trim(.TextMatrix(Yxxpdh, Jsqte))) = 0) Or (GridInt(Jsqte, 5) = 2 And Val(Trim(.TextMatrix(Yxxpdh, Jsqte))) = 0) Then
  1835.                Tsxx = GridStr(Jsqte, 2)
  1836.                Lrywlz = Jsqte
  1837.                GoTo Lrcwcl
  1838.                Exit For
  1839.             End If
  1840.         Next Jsqte
  1841.         '2.[自定义判断(补丁)
  1842.         If Val(Trim(.TextMatrix(Yxxpdh, Sydz("004", GridStr(), Szzls)))) = 0 And Val(Trim(.TextMatrix(Yxxpdh, Sydz("005", GridStr(), Szzls)))) = 0 Then
  1843.            Tsxx = "借方和贷方金额不能同时为零!"
  1844.            Lrywlz = Sydz("004", GridStr(), Szzls)
  1845.            GoTo Lrcwcl
  1846.         End If
  1847.         If Val(Trim(.TextMatrix(Yxxpdh, Sydz("004", GridStr(), Szzls)))) <> 0 And Val(Trim(.TextMatrix(Yxxpdh, Sydz("005", GridStr(), Szzls)))) <> 0 Then
  1848.            Tsxx = "借方和贷方金额不能同时不为零!"
  1849.            Lrywlz = Sydz("004", GridStr(), Szzls)
  1850.            GoTo Lrcwcl
  1851.         End If
  1852.         '判断辅助核算项目是否填写
  1853.         SqlStr = "Select * FROM Cwzz_AccCode Where Ccode='" & Trim(.TextMatrix(Yxxpdh, Sydz("002", GridStr(), Szzls))) & "'"
  1854.         Set Rectemp = Cw_DataEnvi.DataConnect.Execute(SqlStr)
  1855.         With Rectemp
  1856.             If Not .EOF Then
  1857.             
  1858.               '如有数量核算且用户选择数量不能为零则数量项不能为零
  1859.                 If Rectemp.Fields("QuantityFlag") And Chk_Quantity.Value = 1 And Val(WglrGrid.TextMatrix(Yxxpdh, 5)) = 0 Then
  1860.                    Tsxx = "此科目需要数量核算,数量项不能为零!"
  1861.                    Lrywlz = Sydz("002", GridStr(), Szzls)
  1862.                    Bln_AssVali = True
  1863.                    GoTo Lrcwcl
  1864.                 End If
  1865.                 
  1866.                 '部门核算则部门不能为空
  1867.                 If Rectemp.Fields("DeptFlag") And Len(Trim(WglrGrid.TextMatrix(Yxxpdh, 12))) = 0 Then
  1868.                    Tsxx = "此科目需要部门核算,部门项不能为空!"
  1869.                    Lrywlz = Sydz("002", GridStr(), Szzls)
  1870.                    Bln_AssVali = True
  1871.                    GoTo Lrcwcl
  1872.                 End If
  1873.         
  1874.                 '往来客户核算则往来单位不能为空
  1875.                 If Rectemp.Fields("CusFlag") And Len(Trim(WglrGrid.TextMatrix(Yxxpdh, 14))) = 0 Then
  1876.                    Tsxx = "此科目需要往来客户核算,往来客户项不能为空!"
  1877.                    Lrywlz = Sydz("002", GridStr(), Szzls)
  1878.                    Bln_AssVali = True
  1879.                    GoTo Lrcwcl
  1880.                 End If
  1881.                 
  1882.                 '往来供应商核算则往来供应商不能为空
  1883.                 If Rectemp.Fields("SupplierFlag") And Len(Trim(WglrGrid.TextMatrix(Yxxpdh, 25))) = 0 Then
  1884.                    Tsxx = "此科目需要往来供应商核算,往来供应商项不能为空!"
  1885.                    Lrywlz = Sydz("002", GridStr(), Szzls)
  1886.                    Bln_AssVali = True
  1887.                    GoTo Lrcwcl
  1888.                 End If
  1889.                 
  1890.                 '个人往来核算则个人项不能为空
  1891.                 If Rectemp.Fields("PersonFlag") And Len(Trim(WglrGrid.TextMatrix(Yxxpdh, 16))) = 0 Then
  1892.                    Tsxx = "此科目需要个人往来核算,个人项不能为空!"
  1893.                    Lrywlz = Sydz("002", GridStr(), Szzls)
  1894.                    Bln_AssVali = True
  1895.                    GoTo Lrcwcl
  1896.                 End If
  1897.                 
  1898.                 '项目核算则项目不能为空
  1899.                 If Rectemp.Fields("ItemFlag") And Len(Trim(WglrGrid.TextMatrix(Yxxpdh, 20))) = 0 Then
  1900.                    Tsxx = "此科目需要项目核算,核算项目不能为空!"
  1901.                    Lrywlz = Sydz("002", GridStr(), Szzls)
  1902.                    Bln_AssVali = True
  1903.                    GoTo Lrcwcl
  1904.                 End If
  1905.             End If
  1906.         End With
  1907.         '2.放置行处理程序
  1908.    '以上为自定义部分]
  1909.  End With
  1910.  Sjhzyxxpd = True
  1911.  Hyxxpdlock = True
  1912.  Exit Function
  1913. Lrcwcl:      '录入错误处理
  1914.     With WglrGrid
  1915.         Call Xtxxts(Tsxx, 0, 1)
  1916.         Changelock = True
  1917.         .Select Yxxpdh, Lrywlz
  1918.         Changelock = False
  1919.     
  1920.         '[>>如果辅助核算出现错误则调用辅助核算功能
  1921.         If Bln_AssVali Then
  1922.            Call Sub_Drfzhsx(Yxxpdh, Trim(.TextMatrix(Yxxpdh, Sydz("002", GridStr(), Szzls))))
  1923.            
  1924.            '解决鼠标点击取消造成的换行
  1925.            Changelock = True
  1926.              .Select Yxxpdh, Lrywlz
  1927.            Changelock = False
  1928.            
  1929.         '<<]
  1930.         Else
  1931.            Call xswbk
  1932.         End If
  1933.         Sjhzyxxpd = False
  1934.         Exit Function
  1935.     End With
  1936. End Function
  1937. Private Sub Lab_Memo_DblClick(Index As Integer)            '点击辅助核算信息列
  1938.   
  1939.     '如果单据操作状态为浏览状态则不能显示录入载体
  1940.     If Trim(Lab_OperStatus.Caption) = "1" Then
  1941.         Exit Sub
  1942.     End If
  1943.     
  1944.     '当科目编码处于录入状态时不能调入辅助核算项目
  1945.     If Ydtext.Visible And GridStr(WglrGrid.Col, 1) = "002" Then
  1946.         Exit Sub
  1947.     End If
  1948.     
  1949.     '当焦点处于非录入区域时也不能调入辅助核算项目
  1950.     If WglrGrid.Row < WglrGrid.FixedRows Then
  1951.         Exit Sub
  1952.     End If
  1953.     
  1954.     '屏蔽文本框,下拉组合框有效性判断
  1955.     Valilock = True
  1956.     Call Sub_Drfzhsx(WglrGrid.Row, Trim(WglrGrid.TextMatrix(WglrGrid.Row, Sydz("002", GridStr(), Szzls))))
  1957.     Valilock = False
  1958. End Sub
  1959. Private Sub Sub_Drfzhsx(Dqpdwgh As Long, Str_JudgeText As String)   '判断科目是否有辅助核算,如有则调入辅助核算窗体
  1960. '   函数参数:当前判断网格行,判断科目
  1961.    Dim Coljsq As Long                     '临时列计数器
  1962.    Dim Rectemp As New ADODB.Recordset     '临时使用动态集
  1963.    If Len(Str_JudgeText) <> 0 Then
  1964.        SqlStr = "Select Cwzz_AccCode.* ,ItemClassName,ForeignCurrName,ConVertFlag FROM  Cwzz_AccCode " & _
  1965.        " LEFT OUTER JOIN Cwzz_ItemClass ON Cwzz_AccCode.ItemClassCode = Cwzz_ItemClass.ItemClassCode " & _
  1966.        " LEFT OUTER JOIN Gy_ForeignCurrency ON Cwzz_AccCode.ForeignCurrCode= Gy_ForeignCurrency.ForeignCurrCode " & _
  1967.        " Where Ccode='" + Str_JudgeText + "' and EndFlag=1 and StopFlag=0"
  1968.        Set Rectemp = Cw_DataEnvi.DataConnect.Execute(SqlStr)
  1969.        With Rectemp
  1970.             If .EOF Then
  1971.                Exit Sub
  1972.             Else
  1973.                '判断科目进行哪些辅助核算
  1974.                   '清空辅助核算标识
  1975.                   For Jsqte = 0 To Int_AssCount - 1
  1976.                        Bln_AssShow(Jsqte) = False
  1977.                   Next Jsqte
  1978. '                  客户往来,供应商往来,银行科目需录入经办人
  1979.                    If Trim(Rectemp.Fields("Cproperty")) = "银行" Or Rectemp.Fields("CusFlag") Or Rectemp.Fields("SupplierFlag") Then
  1980.                       Bln_AssShow(13) = True '经办人
  1981.                    Else
  1982.                       WglrGrid.TextMatrix(Dqpdwgh, 24) = ""
  1983.                    End If
  1984. '                  银行科目 --结算方式?票号?日期
  1985.                    If Trim(Rectemp.Fields("Cproperty")) = "银行" Then
  1986.                       Bln_AssShow(0) = True  '结算方式
  1987.                       Bln_AssShow(1) = True  '票号
  1988.                       Bln_AssShow(2) = True  '日期
  1989.                       Bln_AssShow(13) = True '经办人
  1990.                    Else
  1991.                       WglrGrid.TextMatrix(Dqpdwgh, 1) = ""
  1992.                       WglrGrid.TextMatrix(Dqpdwgh, 2) = ""
  1993.                       WglrGrid.TextMatrix(Dqpdwgh, 3) = ""
  1994.                       WglrGrid.TextMatrix(Dqpdwgh, 4) = ""
  1995.                    End If
  1996.                    '数量核算 --数量, 单价
  1997.                    If Rectemp.Fields("QuantityFlag") Then
  1998.                       Bln_AssShow(3) = True  '数量
  1999.                       Bln_AssShow(4) = True  '单价
  2000.                       WglrGrid.TextMatrix(Dqpdwgh, 6) = ""
  2001.                       WglrGrid.TextMatrix(Dqpdwgh, 7) = Trim(.Fields("measure")) '单位
  2002.                    Else
  2003.                       WglrGrid.TextMatrix(Dqpdwgh, 5) = ""
  2004.                       WglrGrid.TextMatrix(Dqpdwgh, 6) = ""
  2005.                       WglrGrid.TextMatrix(Dqpdwgh, 7) = ""
  2006.                    End If
  2007.                    '外币核算 --外币, 汇率
  2008.                    If Rectemp.Fields("ForeignFlag") Then
  2009.                       WglrGrid.TextMatrix(Dqpdwgh, 8) = Trim(.Fields("ForeignCurrCode"))
  2010.                       WglrGrid.TextMatrix(Dqpdwgh, 9) = Trim(.Fields("ForeignCurrName"))
  2011.                       Bln_AssShow(5) = True  '外币金额
  2012.                       Bln_AssShow(6) = True  '汇率
  2013.                    Else
  2014.                       WglrGrid.TextMatrix(Dqpdwgh, 8) = ""
  2015.                       WglrGrid.TextMatrix(Dqpdwgh, 9) = ""
  2016.                       WglrGrid.TextMatrix(Dqpdwgh, 10) = ""
  2017.                       WglrGrid.TextMatrix(Dqpdwgh, 11) = ""
  2018.                    End If
  2019.                    '部门核算
  2020.                    If Rectemp.Fields("DeptFlag") Then
  2021.                       Bln_AssShow(7) = True  '部门
  2022.                    Else
  2023.                       WglrGrid.TextMatrix(Dqpdwgh, 12) = ""
  2024.                       WglrGrid.TextMatrix(Dqpdwgh, 13) = ""
  2025.                    End If
  2026.                    '客户核算
  2027.                    If Rectemp.Fields("CusFlag") Then
  2028.                       Bln_AssShow(8) = True  '客户
  2029.                    Else
  2030.                       WglrGrid.TextMatrix(Dqpdwgh, 14) = ""
  2031.                       WglrGrid.TextMatrix(Dqpdwgh, 15) = ""
  2032.                    End If
  2033.                    '供应商核算
  2034.                    If Rectemp.Fields("SupplierFlag") Then
  2035.                       Bln_AssShow(12) = True  '供应商
  2036.                    Else
  2037.                       WglrGrid.TextMatrix(Dqpdwgh, 25) = ""
  2038.                       WglrGrid.TextMatrix(Dqpdwgh, 26) = ""
  2039.                    End If
  2040.                    '个人核算
  2041.                    If Rectemp.Fields("PersonFlag") Then
  2042.                       Bln_AssShow(9) = True  '个人
  2043.                    Else
  2044.                       WglrGrid.TextMatrix(Dqpdwgh, 16) = ""
  2045.                       WglrGrid.TextMatrix(Dqpdwgh, 17) = ""
  2046.                    End If
  2047.                    '项目核算
  2048.                    If Rectemp.Fields("ItemFlag") Then
  2049.                       If WglrGrid.TextMatrix(Dqpdwgh, 18) <> Trim(.Fields("ItemClassCode")) Then
  2050.                          WglrGrid.TextMatrix(Dqpdwgh, 20) = ""
  2051.                          WglrGrid.TextMatrix(Dqpdwgh, 21) = ""
  2052.                          WglrGrid.TextMatrix(Dqpdwgh, 22) = ""
  2053.                          WglrGrid.TextMatrix(Dqpdwgh, 23) = ""
  2054.                       End If
  2055.                       WglrGrid.TextMatrix(Dqpdwgh, 18) = Trim(.Fields("ItemClassCode")) '项目类别编码
  2056.                       WglrGrid.TextMatrix(Dqpdwgh, 19) = Trim(.Fields("ItemClassName")) '项目类别名称
  2057.                       Bln_AssShow(10) = True  '项目
  2058.                       Bln_AssShow(11) = True  '项目数量
  2059.                    Else
  2060.                       WglrGrid.TextMatrix(Dqpdwgh, 18) = ""
  2061.                       WglrGrid.TextMatrix(Dqpdwgh, 19) = ""
  2062.                       WglrGrid.TextMatrix(Dqpdwgh, 20) = ""
  2063.                       WglrGrid.TextMatrix(Dqpdwgh, 21) = ""
  2064.                       WglrGrid.TextMatrix(Dqpdwgh, 22) = ""
  2065.                       WglrGrid.TextMatrix(Dqpdwgh, 23) = ""
  2066.                    End If
  2067.                    '调入科目辅助核算项目
  2068.                    For Jsqte = 0 To Int_AssCount - 1
  2069.                       If Bln_AssShow(Jsqte) Then
  2070.                          CL_PzAss.lab_GridRow = Dqpdwgh
  2071.                          Call Kmfzhsx(Dqpdwgh)
  2072. '                         判断用户录入数量单价是否为零,如不为零则由数量*单价=金额
  2073. '                         (考虑销售收入主要为贷方则借贷金额均为零时,金额自动填入贷方)
  2074.                          If Val(WglrGrid.TextMatrix(Dqpdwgh, 5)) <> 0 And Val(WglrGrid.TextMatrix(Dqpdwgh, 6)) <> 0 Then
  2075.                             If Val(Trim(WglrGrid.TextMatrix(Dqpdwgh, Sydz("004", GridStr(), Szzls)))) <> 0 Then
  2076.                                WglrGrid.TextMatrix(Dqpdwgh, Sydz("004", GridStr(), Szzls)) = Format(Val(WglrGrid.TextMatrix(Dqpdwgh, 5)) * Val(WglrGrid.TextMatrix(Dqpdwgh, 6)), "##." + String(Xtjexsws, "0"))
  2077.                             Else
  2078.                                WglrGrid.TextMatrix(Dqpdwgh, Sydz("005", GridStr(), Szzls)) = Format(Val(WglrGrid.TextMatrix(Dqpdwgh, 5)) * Val(WglrGrid.TextMatrix(Dqpdwgh, 6)), "##." + String(Xtjexsws, "0"))
  2079.                             End If
  2080.                          End If
  2081. '                         判断用户录入外币汇率是否为零,如不为零则由外币*汇率=金额
  2082. '                         (借贷金额均为零时,金额自动填入借方)
  2083.                          If Val(WglrGrid.TextMatrix(Dqpdwgh, 10)) <> 0 And Val(WglrGrid.TextMatrix(Dqpdwgh, 11)) <> 0 Then
  2084.                             If Val(Trim(WglrGrid.TextMatrix(Dqpdwgh, Sydz("005", GridStr(), Szzls)))) <> 0 Then
  2085.                                '判断外币折算方式
  2086.                                If Rectemp.Fields("ConVertFlag") Then
  2087.                                   WglrGrid.TextMatrix(Dqpdwgh, Sydz("005", GridStr(), Szzls)) = Format(Val(WglrGrid.TextMatrix(Dqpdwgh, 10)) / Val(WglrGrid.TextMatrix(Dqpdwgh, 11)), "##." + String(Xtjexsws, "0"))
  2088.                                Else
  2089.                                   WglrGrid.TextMatrix(Dqpdwgh, Sydz("005", GridStr(), Szzls)) = Format(Val(WglrGrid.TextMatrix(Dqpdwgh, 10)) * Val(WglrGrid.TextMatrix(Dqpdwgh, 11)), "##." + String(Xtjexsws, "0"))
  2090.                                End If
  2091.                             Else
  2092.                                 '判断外币折算方式
  2093.                                If Rectemp.Fields("ConVertFlag") Then
  2094.                                   WglrGrid.TextMatrix(Dqpdwgh, Sydz("004", GridStr(), Szzls)) = Format(Val(WglrGrid.TextMatrix(Dqpdwgh, 10)) / Val(WglrGrid.TextMatrix(Dqpdwgh, 11)), "##." + String(Xtjexsws, "0"))
  2095.                                Else
  2096.                                    WglrGrid.TextMatrix(Dqpdwgh, Sydz("004", GridStr(), Szzls)) = Format(Val(WglrGrid.TextMatrix(Dqpdwgh, 10)) * Val(WglrGrid.TextMatrix(Dqpdwgh, 11)), "##." + String(Xtjexsws, "0"))
  2097.                                End If
  2098.                             End If
  2099.                          End If
  2100.                          Exit For
  2101.                       End If
  2102.                    Next Jsqte
  2103.                End If
  2104.         End With
  2105.         ' 计算合计数据
  2106.         For Coljsq = Qslz To WglrGrid.Cols - 1
  2107.             Call Sjhj(Coljsq)
  2108.         Next Coljsq
  2109.         '重新显示辅助核算信息
  2110.         Call Sub_ShowMemo(WglrGrid.Row)
  2111.     End If
  2112. End Sub
  2113. Private Sub Kmfzhsx(Lng_GridRow As Long)                  '调用科目辅助核算项
  2114.     '过程函数;Lng_gridrow当前网格调入辅助核算行
  2115.     Dim Kjqstop#, Kjqsleft#, Kjjg#, Ctzxgd#, Kjxsgs%, Jsqte%
  2116.     Dim Rectemp As New ADODB.Recordset     '临时使用动态集
  2117.     Kjqstop = 300          '控件显示起始高度
  2118.     Kjqsleft = 300         '控件显示起始左边界
  2119.     Kjjg = 450             '控件显示间隔
  2120.     Kjxsgs = 0             '控件显示个数
  2121.     Ctzxgd = 1500          '窗体显示最小高度
  2122.     With CL_PzAss          '辅助核算项目窗体
  2123.         .Caption = "辅助核算项目_" + Trim(WglrGrid.TextMatrix(Lng_GridRow, Sydz("003", GridStr(), Szzls)))
  2124.         For Jsqte = 0 To Int_AssCount - 1
  2125.            If Bln_AssShow(Jsqte) Then
  2126.               .tsLabel(Jsqte).Visible = True
  2127.               .tsLabel(Jsqte).Move Kjqsleft, Kjqstop + Kjxsgs * Kjjg
  2128.               .LrText(Jsqte).Visible = True
  2129.               .LrText(Jsqte).Move .tsLabel(Jsqte).Left + .tsLabel(Jsqte).Width + 50, .tsLabel(Jsqte).Top - 100
  2130.               If Bln_AssHelp(Jsqte) Then
  2131.                  .Ydcommand1(Jsqte).Visible = True
  2132.                  .Ydcommand1(Jsqte).Move .LrText(Jsqte).Left + .LrText(Jsqte).Width, .LrText(Jsqte).Top, .Ydcommand1(Jsqte).Width, .LrText(Jsqte).Height
  2133.               End If
  2134.               Kjxsgs = Kjxsgs + 1
  2135.               Select Case Jsqte
  2136.                  Case 0     '结算方式
  2137.                    .LrText(Jsqte).Tag = Trim(WglrGrid.TextMatrix(Lng_GridRow, 1))
  2138.                    .LrText(Jsqte).Text = Trim(WglrGrid.TextMatrix(Lng_GridRow, 2))
  2139.                  Case 1     '票号
  2140.                    .LrText(Jsqte).Text = Trim(WglrGrid.TextMatrix(Lng_GridRow, 3))
  2141.                  Case 2     '发生日期
  2142.                    .LrText(Jsqte).Text = Trim(WglrGrid.TextMatrix(Lng_GridRow, 4))
  2143.                  Case 3     '数量
  2144.                    .LrText(Jsqte).Text = WglrGrid.TextMatrix(Lng_GridRow, 5)
  2145.                    .Lab_Measure = Trim(WglrGrid.TextMatrix(Lng_GridRow, 7))