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

企业管理

开发平台:

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 Start_BillChalkitup 
  5.    Caption         =   "单据记帐"
  6.    ClientHeight    =   7950
  7.    ClientLeft      =   60
  8.    ClientTop       =   345
  9.    ClientWidth     =   11640
  10.    HelpContextID   =   130203
  11.    Icon            =   "期初_单据记帐.frx":0000
  12.    KeyPreview      =   -1  'True
  13.    LinkTopic       =   "Form1"
  14.    MDIChild        =   -1  'True
  15.    ScaleHeight     =   7950
  16.    ScaleWidth      =   11640
  17.    WindowState     =   2  'Maximized
  18.    Begin VB.PictureBox Pic_Title 
  19.       BackColor       =   &H00FFFFFF&
  20.       Height          =   1095
  21.       Left            =   0
  22.       Picture         =   "期初_单据记帐.frx":1042
  23.       ScaleHeight     =   1035
  24.       ScaleWidth      =   11715
  25.       TabIndex        =   0
  26.       Top             =   570
  27.       Width           =   11775
  28.       Begin VB.Label Lbl_TitleMess 
  29.          AutoSize        =   -1  'True
  30.          BackStyle       =   0  'Transparent
  31.          Caption         =   "月份:"
  32.          Height          =   195
  33.          Index           =   0
  34.          Left            =   900
  35.          TabIndex        =   8
  36.          Top             =   780
  37.          Width           =   405
  38.       End
  39.       Begin VB.Label Lbl_TitleText 
  40.          AutoSize        =   -1  'True
  41.          BackStyle       =   0  'Transparent
  42.          Caption         =   "仓库"
  43.          ForeColor       =   &H00000000&
  44.          Height          =   195
  45.          Index           =   0
  46.          Left            =   1410
  47.          TabIndex        =   7
  48.          Top             =   780
  49.          Width           =   360
  50.       End
  51.       Begin VB.Label Label2 
  52.          AutoSize        =   -1  'True
  53.          BackStyle       =   0  'Transparent
  54.          Caption         =   "不允许记帐单据颜色标记"
  55.          Height          =   195
  56.          Left            =   9270
  57.          TabIndex        =   6
  58.          Top             =   780
  59.          Width           =   1980
  60.       End
  61.       Begin VB.Label Lbl_Color 
  62.          Appearance      =   0  'Flat
  63.          BackColor       =   &H00FFFFC0&
  64.          BorderStyle     =   1  'Fixed Single
  65.          ForeColor       =   &H80000008&
  66.          Height          =   195
  67.          Left            =   8970
  68.          TabIndex        =   5
  69.          Top             =   780
  70.          Width           =   225
  71.       End
  72.       Begin VB.Label Lab_Title 
  73.          AutoSize        =   -1  'True
  74.          BackColor       =   &H80000018&
  75.          BackStyle       =   0  'Transparent
  76.          Caption         =   "期初单据列表"
  77.          BeginProperty Font 
  78.             Name            =   "宋体"
  79.             Size            =   12
  80.             Charset         =   134
  81.             Weight          =   700
  82.             Underline       =   0   'False
  83.             Italic          =   0   'False
  84.             Strikethrough   =   0   'False
  85.          EndProperty
  86.          ForeColor       =   &H00000000&
  87.          Height          =   240
  88.          Index           =   4
  89.          Left            =   480
  90.          TabIndex        =   1
  91.          Top             =   210
  92.          Width           =   1530
  93.       End
  94.    End
  95.    Begin VB.Timer Timer1 
  96.       Enabled         =   0   'False
  97.       Interval        =   1
  98.       Left            =   7620
  99.       Top             =   90
  100.    End
  101.    Begin MSComctlLib.Toolbar GsToolbar 
  102.       Height          =   525
  103.       Left            =   9330
  104.       TabIndex        =   2
  105.       Top             =   30
  106.       Width           =   2475
  107.       _ExtentX        =   4366
  108.       _ExtentY        =   926
  109.       ButtonWidth     =   1455
  110.       ButtonHeight    =   926
  111.       Appearance      =   1
  112.       Style           =   1
  113.       ImageList       =   "ImageList2"
  114.       _Version        =   393216
  115.       BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  116.          NumButtons      =   3
  117.          BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  118.             Caption         =   "保存格式"
  119.             Key             =   "bcgs"
  120.             ImageKey        =   "bcgs"
  121.          EndProperty
  122.          BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  123.             Caption         =   "默认列宽"
  124.             Key             =   "hfmrgs"
  125.             ImageKey        =   "mrlk"
  126.          EndProperty
  127.          BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  128.             Caption         =   "显示项目"
  129.             Key             =   "szxsxm"
  130.             ImageKey        =   "xsxm"
  131.          EndProperty
  132.       EndProperty
  133.    End
  134.    Begin VSFlex8Ctl.VSFlexGrid CxbbGrid 
  135.       Height          =   7275
  136.       Left            =   0
  137.       TabIndex        =   3
  138.       Top             =   1740
  139.       Width           =   11775
  140.       _cx             =   5080
  141.       _cy             =   5080
  142.       Appearance      =   1
  143.       BorderStyle     =   1
  144.       Enabled         =   -1  'True
  145.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  146.          Name            =   "宋体"
  147.          Size            =   9
  148.          Charset         =   134
  149.          Weight          =   400
  150.          Underline       =   0   'False
  151.          Italic          =   0   'False
  152.          Strikethrough   =   0   'False
  153.       EndProperty
  154.       MousePointer    =   0
  155.       BackColor       =   16777215
  156.       ForeColor       =   -2147483640
  157.       BackColorFixed  =   13826538
  158.       ForeColorFixed  =   -2147483630
  159.       BackColorSel    =   -2147483635
  160.       ForeColorSel    =   -2147483634
  161.       BackColorBkg    =   -2147483636
  162.       BackColorAlternate=   16777215
  163.       GridColor       =   -2147483633
  164.       GridColorFixed  =   -2147483632
  165.       TreeColor       =   -2147483632
  166.       FloodColor      =   192
  167.       SheetBorder     =   -2147483642
  168.       FocusRect       =   1
  169.       HighLight       =   1
  170.       AllowSelection  =   -1  'True
  171.       AllowBigSelection=   -1  'True
  172.       AllowUserResizing=   0
  173.       SelectionMode   =   0
  174.       GridLines       =   1
  175.       GridLinesFixed  =   2
  176.       GridLineWidth   =   1
  177.       Rows            =   50
  178.       Cols            =   10
  179.       FixedRows       =   1
  180.       FixedCols       =   1
  181.       RowHeightMin    =   0
  182.       RowHeightMax    =   0
  183.       ColWidthMin     =   0
  184.       ColWidthMax     =   0
  185.       ExtendLastCol   =   0   'False
  186.       FormatString    =   ""
  187.       ScrollTrack     =   0   'False
  188.       ScrollBars      =   3
  189.       ScrollTips      =   0   'False
  190.       MergeCells      =   0
  191.       MergeCompare    =   0
  192.       AutoResize      =   -1  'True
  193.       AutoSizeMode    =   0
  194.       AutoSearch      =   0
  195.       AutoSearchDelay =   2
  196.       MultiTotals     =   -1  'True
  197.       SubtotalPosition=   1
  198.       OutlineBar      =   0
  199.       OutlineCol      =   0
  200.       Ellipsis        =   0
  201.       ExplorerBar     =   0
  202.       PicturesOver    =   0   'False
  203.       FillStyle       =   0
  204.       RightToLeft     =   0   'False
  205.       PictureType     =   0
  206.       TabBehavior     =   0
  207.       OwnerDraw       =   0
  208.       Editable        =   0
  209.       ShowComboButton =   1
  210.       WordWrap        =   0   'False
  211.       TextStyle       =   0
  212.       TextStyleFixed  =   0
  213.       OleDragMode     =   0
  214.       OleDropMode     =   0
  215.       DataMode        =   0
  216.       VirtualData     =   -1  'True
  217.       DataMember      =   ""
  218.       ComboSearch     =   3
  219.       AutoSizeMouse   =   -1  'True
  220.       FrozenRows      =   0
  221.       FrozenCols      =   0
  222.       AllowUserFreezing=   0
  223.       BackColorFrozen =   0
  224.       ForeColorFrozen =   0
  225.       WallPaperAlignment=   9
  226.       AccessibleName  =   ""
  227.       AccessibleDescription=   ""
  228.       AccessibleValue =   ""
  229.       AccessibleRole  =   24
  230.       Begin MSComctlLib.ImageList ImageList2 
  231.          Left            =   0
  232.          Top             =   0
  233.          _ExtentX        =   1005
  234.          _ExtentY        =   1005
  235.          BackColor       =   -2147483643
  236.          ImageWidth      =   16
  237.          ImageHeight     =   16
  238.          MaskColor       =   12632256
  239.          _Version        =   393216
  240.          BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  241.             NumListImages   =   40
  242.             BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  243.                Picture         =   "期初_单据记帐.frx":35106
  244.                Key             =   "sz"
  245.             EndProperty
  246.             BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  247.                Picture         =   "期初_单据记帐.frx":354A0
  248.                Key             =   "dy"
  249.             EndProperty
  250.             BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  251.                Picture         =   "期初_单据记帐.frx":3583A
  252.                Key             =   "yl"
  253.             EndProperty
  254.             BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  255.                Picture         =   "期初_单据记帐.frx":35BD4
  256.                Key             =   "xg"
  257.             EndProperty
  258.             BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  259.                Picture         =   "期初_单据记帐.frx":35F6E
  260.                Key             =   "zh"
  261.             EndProperty
  262.             BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  263.                Picture         =   "期初_单据记帐.frx":36308
  264.                Key             =   "sh"
  265.             EndProperty
  266.             BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  267.                Picture         =   "期初_单据记帐.frx":366A2
  268.                Key             =   "bc"
  269.             EndProperty
  270.             BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  271.                Picture         =   "期初_单据记帐.frx":36A3C
  272.                Key             =   "fq"
  273.             EndProperty
  274.             BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  275.                Picture         =   "期初_单据记帐.frx":36DD6
  276.                Key             =   "bz"
  277.             EndProperty
  278.             BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  279.                Picture         =   "期初_单据记帐.frx":37170
  280.                Key             =   "tc"
  281.             EndProperty
  282.             BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  283.                Picture         =   "期初_单据记帐.frx":3750A
  284.                Key             =   "bcgs"
  285.             EndProperty
  286.             BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  287.                Picture         =   "期初_单据记帐.frx":378A4
  288.                Key             =   "mrlk"
  289.             EndProperty
  290.             BeginProperty ListImage13 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  291.                Picture         =   "期初_单据记帐.frx":37C3E
  292.                Key             =   "xsxm"
  293.             EndProperty
  294.             BeginProperty ListImage14 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  295.                Picture         =   "期初_单据记帐.frx":37FD8
  296.                Key             =   "first"
  297.             EndProperty
  298.             BeginProperty ListImage15 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  299.                Picture         =   "期初_单据记帐.frx":38372
  300.                Key             =   "prev"
  301.             EndProperty
  302.             BeginProperty ListImage16 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  303.                Picture         =   "期初_单据记帐.frx":3870C
  304.                Key             =   "next"
  305.             EndProperty
  306.             BeginProperty ListImage17 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  307.                Picture         =   "期初_单据记帐.frx":38AA6
  308.                Key             =   "last"
  309.             EndProperty
  310.             BeginProperty ListImage18 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  311.                Picture         =   "期初_单据记帐.frx":38E40
  312.                Key             =   "xx"
  313.             EndProperty
  314.             BeginProperty ListImage19 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  315.                Picture         =   "期初_单据记帐.frx":391DA
  316.                Key             =   "define"
  317.             EndProperty
  318.             BeginProperty ListImage20 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  319.                Picture         =   "期初_单据记帐.frx":39574
  320.                Key             =   "exec"
  321.             EndProperty
  322.             BeginProperty ListImage21 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  323.                Picture         =   "期初_单据记帐.frx":3990E
  324.                Key             =   "xz"
  325.             EndProperty
  326.             BeginProperty ListImage22 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  327.                Picture         =   "期初_单据记帐.frx":39CA8
  328.                Key             =   "sc"
  329.             EndProperty
  330.             BeginProperty ListImage23 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  331.                Picture         =   "期初_单据记帐.frx":3A042
  332.                Key             =   "sx"
  333.             EndProperty
  334.             BeginProperty ListImage24 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  335.                Picture         =   "期初_单据记帐.frx":3A3DC
  336.                Key             =   "cx"
  337.             EndProperty
  338.             BeginProperty ListImage25 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  339.                Picture         =   "期初_单据记帐.frx":3A776
  340.                Key             =   "zd"
  341.             EndProperty
  342.             BeginProperty ListImage26 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  343.                Picture         =   "期初_单据记帐.frx":3AB10
  344.                Key             =   "dz"
  345.             EndProperty
  346.             BeginProperty ListImage27 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  347.                Picture         =   "期初_单据记帐.frx":3AEAA
  348.                Key             =   "ph"
  349.             EndProperty
  350.             BeginProperty ListImage28 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  351.                Picture         =   "期初_单据记帐.frx":3B244
  352.                Key             =   "fz"
  353.             EndProperty
  354.             BeginProperty ListImage29 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  355.                Picture         =   "期初_单据记帐.frx":3B5DE
  356.                Key             =   "dw"
  357.             EndProperty
  358.             BeginProperty ListImage30 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  359.                Picture         =   "期初_单据记帐.frx":3B978
  360.                Key             =   "hf"
  361.             EndProperty
  362.             BeginProperty ListImage31 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  363.                Picture         =   "期初_单据记帐.frx":3BD12
  364.                Key             =   "pz"
  365.             EndProperty
  366.             BeginProperty ListImage32 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  367.                Picture         =   "期初_单据记帐.frx":3C0AC
  368.                Key             =   "check"
  369.             EndProperty
  370.             BeginProperty ListImage33 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  371.                Picture         =   "期初_单据记帐.frx":3C446
  372.                Key             =   "qs"
  373.             EndProperty
  374.             BeginProperty ListImage34 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  375.                Picture         =   "期初_单据记帐.frx":3C7E0
  376.                Key             =   "fullcheck"
  377.             EndProperty
  378.             BeginProperty ListImage35 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  379.                Picture         =   "期初_单据记帐.frx":3CB7A
  380.                Key             =   "qq"
  381.             EndProperty
  382.             BeginProperty ListImage36 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  383.                Picture         =   "期初_单据记帐.frx":3CF14
  384.                Key             =   "bcw"
  385.             EndProperty
  386.             BeginProperty ListImage37 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  387.                Picture         =   "期初_单据记帐.frx":3D2AE
  388.                Key             =   "ye"
  389.             EndProperty
  390.             BeginProperty ListImage38 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  391.                Picture         =   "期初_单据记帐.frx":3D648
  392.                Key             =   ""
  393.             EndProperty
  394.             BeginProperty ListImage39 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  395.                Picture         =   "期初_单据记帐.frx":3D9E2
  396.                Key             =   "frist"
  397.             EndProperty
  398.             BeginProperty ListImage40 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  399.                Picture         =   "期初_单据记帐.frx":3DD7C
  400.                Key             =   "dj"
  401.             EndProperty
  402.          EndProperty
  403.       End
  404.    End
  405.    Begin MSComctlLib.Toolbar SzToolbar 
  406.       Align           =   1  'Align Top
  407.       Height          =   555
  408.       Left            =   0
  409.       TabIndex        =   4
  410.       Top             =   0
  411.       Width           =   11640
  412.       _ExtentX        =   20532
  413.       _ExtentY        =   979
  414.       ButtonWidth     =   820
  415.       ButtonHeight    =   926
  416.       AllowCustomize  =   0   'False
  417.       Appearance      =   1
  418.       Style           =   1
  419.       ImageList       =   "ImageList1"
  420.       _Version        =   393216
  421.       BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  422.          NumButtons      =   15
  423.          BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  424.             Caption         =   "设置"
  425.             Key             =   "ymsz"
  426.             ImageKey        =   "sz"
  427.          EndProperty
  428.          BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  429.             Caption         =   "打印"
  430.             Key             =   "dy"
  431.             ImageKey        =   "dy"
  432.          EndProperty
  433.          BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  434.             Caption         =   "预览"
  435.             Key             =   "yl"
  436.             ImageKey        =   "yl"
  437.          EndProperty
  438.          BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  439.             Style           =   3
  440.          EndProperty
  441.          BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  442.             Caption         =   "查询"
  443.             Key             =   "cx"
  444.             ImageKey        =   "cx"
  445.          EndProperty
  446.          BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  447.             Caption         =   "单据"
  448.             Key             =   "Bill"
  449.             ImageKey        =   "pz"
  450.          EndProperty
  451.          BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  452.             Style           =   4
  453.          EndProperty
  454.          BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  455.             Caption         =   "明细"
  456.             Key             =   "mx"
  457.             ImageKey        =   "mx"
  458.          EndProperty
  459.          BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  460.             Caption         =   "汇总"
  461.             Key             =   "hz"
  462.             ImageKey        =   "hz"
  463.          EndProperty
  464.          BeginProperty Button10 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  465.             Style           =   3
  466.          EndProperty
  467.          BeginProperty Button11 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  468.             Caption         =   "记帐"
  469.             Key             =   "jz"
  470.             ImageKey        =   "jz"
  471.          EndProperty
  472.          BeginProperty Button12 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  473.             Caption         =   "恢复"
  474.             Key             =   "hf"
  475.             ImageKey        =   "hf"
  476.          EndProperty
  477.          BeginProperty Button13 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  478.             Style           =   3
  479.          EndProperty
  480.          BeginProperty Button14 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  481.             Caption         =   "帮助"
  482.             Key             =   "bz"
  483.             ImageKey        =   "bz"
  484.          EndProperty
  485.          BeginProperty Button15 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  486.             Caption         =   "退出"
  487.             Key             =   "fh"
  488.             ImageKey        =   "tc"
  489.          EndProperty
  490.       EndProperty
  491.       BorderStyle     =   1
  492.       Begin MSComctlLib.ImageList ImageList1 
  493.          Left            =   6990
  494.          Top             =   30
  495.          _ExtentX        =   1005
  496.          _ExtentY        =   1005
  497.          BackColor       =   -2147483643
  498.          ImageWidth      =   16
  499.          ImageHeight     =   16
  500.          MaskColor       =   12632256
  501.          _Version        =   393216
  502.          BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  503.             NumListImages   =   35
  504.             BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  505.                Picture         =   "期初_单据记帐.frx":3E116
  506.                Key             =   "sz"
  507.             EndProperty
  508.             BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  509.                Picture         =   "期初_单据记帐.frx":3E4B0
  510.                Key             =   "dy"
  511.             EndProperty
  512.             BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  513.                Picture         =   "期初_单据记帐.frx":3E84A
  514.                Key             =   "yl"
  515.             EndProperty
  516.             BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  517.                Picture         =   "期初_单据记帐.frx":3EBE4
  518.                Key             =   "xg"
  519.             EndProperty
  520.             BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  521.                Picture         =   "期初_单据记帐.frx":3EF7E
  522.                Key             =   "zh"
  523.             EndProperty
  524.             BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  525.                Picture         =   "期初_单据记帐.frx":3F318
  526.                Key             =   "sh"
  527.             EndProperty
  528.             BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  529.                Picture         =   "期初_单据记帐.frx":3F6B2
  530.                Key             =   "bc"
  531.             EndProperty
  532.             BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  533.                Picture         =   "期初_单据记帐.frx":3FA4C
  534.                Key             =   "fq"
  535.             EndProperty
  536.             BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  537.                Picture         =   "期初_单据记帐.frx":3FDE6
  538.                Key             =   "bz"
  539.             EndProperty
  540.             BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  541.                Picture         =   "期初_单据记帐.frx":40180
  542.                Key             =   "tc"
  543.             EndProperty
  544.             BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  545.                Picture         =   "期初_单据记帐.frx":4051A
  546.                Key             =   "bcgs"
  547.             EndProperty
  548.             BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  549.                Picture         =   "期初_单据记帐.frx":408B4
  550.                Key             =   "mrlk"
  551.             EndProperty
  552.             BeginProperty ListImage13 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  553.                Picture         =   "期初_单据记帐.frx":40C4E
  554.                Key             =   "xsxm"
  555.             EndProperty
  556.             BeginProperty ListImage14 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  557.                Picture         =   "期初_单据记帐.frx":40FE8
  558.                Key             =   "first"
  559.             EndProperty
  560.             BeginProperty ListImage15 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  561.                Picture         =   "期初_单据记帐.frx":41382
  562.                Key             =   "prev"
  563.             EndProperty
  564.             BeginProperty ListImage16 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  565.                Picture         =   "期初_单据记帐.frx":4171C
  566.                Key             =   "next"
  567.             EndProperty
  568.             BeginProperty ListImage17 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  569.                Picture         =   "期初_单据记帐.frx":41AB6
  570.                Key             =   "last"
  571.             EndProperty
  572.             BeginProperty ListImage18 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  573.                Picture         =   "期初_单据记帐.frx":41E50
  574.                Key             =   "xx"
  575.             EndProperty
  576.             BeginProperty ListImage19 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  577.                Picture         =   "期初_单据记帐.frx":421EA
  578.                Key             =   "define"
  579.             EndProperty
  580.             BeginProperty ListImage20 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  581.                Picture         =   "期初_单据记帐.frx":42584
  582.                Key             =   "exec"
  583.             EndProperty
  584.             BeginProperty ListImage21 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  585.                Picture         =   "期初_单据记帐.frx":4291E
  586.                Key             =   "xz"
  587.             EndProperty
  588.             BeginProperty ListImage22 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  589.                Picture         =   "期初_单据记帐.frx":42CB8
  590.                Key             =   "sc"
  591.             EndProperty
  592.             BeginProperty ListImage23 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  593.                Picture         =   "期初_单据记帐.frx":43052
  594.                Key             =   "sx"
  595.             EndProperty
  596.             BeginProperty ListImage24 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  597.                Picture         =   "期初_单据记帐.frx":433EC
  598.                Key             =   "cx"
  599.             EndProperty
  600.             BeginProperty ListImage25 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  601.                Picture         =   "期初_单据记帐.frx":43786
  602.                Key             =   "zd"
  603.             EndProperty
  604.             BeginProperty ListImage26 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  605.                Picture         =   "期初_单据记帐.frx":43B20
  606.                Key             =   "dz"
  607.             EndProperty
  608.             BeginProperty ListImage27 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  609.                Picture         =   "期初_单据记帐.frx":43EBA
  610.                Key             =   "ph"
  611.             EndProperty
  612.             BeginProperty ListImage28 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  613.                Picture         =   "期初_单据记帐.frx":44254
  614.                Key             =   "fz"
  615.             EndProperty
  616.             BeginProperty ListImage29 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  617.                Picture         =   "期初_单据记帐.frx":445EE
  618.                Key             =   "dw"
  619.             EndProperty
  620.             BeginProperty ListImage30 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  621.                Picture         =   "期初_单据记帐.frx":44988
  622.                Key             =   "hf"
  623.             EndProperty
  624.             BeginProperty ListImage31 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  625.                Picture         =   "期初_单据记帐.frx":44D22
  626.                Key             =   "pz"
  627.             EndProperty
  628.             BeginProperty ListImage32 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  629.                Picture         =   "期初_单据记帐.frx":450BC
  630.                Key             =   "check"
  631.             EndProperty
  632.             BeginProperty ListImage33 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  633.                Picture         =   "期初_单据记帐.frx":45456
  634.                Key             =   "mx"
  635.             EndProperty
  636.             BeginProperty ListImage34 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  637.                Picture         =   "期初_单据记帐.frx":457F0
  638.                Key             =   "jz"
  639.             EndProperty
  640.             BeginProperty ListImage35 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  641.                Picture         =   "期初_单据记帐.frx":45B8A
  642.                Key             =   "hz"
  643.             EndProperty
  644.          EndProperty
  645.       End
  646.    End
  647. End
  648. Attribute VB_Name = "Start_BillChalkitup"
  649. Attribute VB_GlobalNameSpace = False
  650. Attribute VB_Creatable = False
  651. Attribute VB_PredeclaredId = True
  652. Attribute VB_Exposed = False
  653. '**************************************************************************
  654. '*    模 块 名 称 :期初记帐单据列表
  655. '*    功 能 描 述 :
  656. '*    程序员姓名  :白凤英
  657. '*    最后修改人  :白凤英
  658. '*    最后修改时间:2001/11/28
  659. '*    备        注:程序中所有依实际情况自定义部分均用[>>  <<]括起
  660. '**************************************************************************
  661. Dim mStr As String                       '暂估条件
  662. Dim GridColHide() As Boolean             '网格列隐藏
  663. Dim ReportTitle As String                '报表主标题
  664. Dim Str_QueryCondi As String             '用户录入查询条件
  665. Dim Rec_BillID As New ADODB.Recordset    '用户查询单据ID动态集
  666. '以下为固定使用变量
  667. Dim Dyymctbl As New DY_Dyymsz            '打印页面窗体变量
  668. Dim GridCode As String                   '显示网格网格代码
  669. Dim GridInf() As Variant                 '整个网格设置信息
  670. Dim Tsxx As String                       '系统提示信息
  671. Dim Qslz As Long                         '网格隐藏(非操作显示)列数
  672. Dim Sjhgd As Double                      '网格数据行高度
  673. Dim Sfxshjwg As Boolean                  '是否显示合计网格
  674. Dim GridBoolean() As Boolean             '网格列信息(布尔型)
  675. Dim GridStr()  As String                 '网格列信息(字符型)
  676. Dim GridInt() As Integer                 '网格列信息(整型)
  677. Dim Szzls As Integer                     '数组总列数(网格列数-1)
  678. Private Sub Form_Resize()                '根据窗体大小来调整网格,标题栏大小(Fixed)
  679.     On Error Resume Next
  680.     With CxbbGrid
  681.         .Width = Me.Width - 160
  682.         .Height = Me.Height - .Top - 400
  683.     End With
  684.     With Pic_Title
  685.         .Width = Me.Width - 160
  686.     End With
  687.     
  688.     GsToolbar.Left = Me.Width - GsToolbar.Width - 140
  689. End Sub
  690. Private Sub Form_Load()                                                   '窗体装入
  691.   
  692.     '调入打印页面设置窗体
  693.     ReportTitle = "期初单据列表"
  694.     XtReportCode = "Chhs_StartBillList"
  695.     Load Dyymctbl
  696.       
  697.     '调整标题栏及网格、格式工具条位置(Fixed)
  698.     Pic_Title.Left = 40
  699.     Pic_Title.Top = SzToolbar.Top + SzToolbar.Height - 10
  700.     CxbbGrid.Left = Pic_Title.Left
  701.     CxbbGrid.Top = Pic_Title.Top + Pic_Title.Height + 20
  702.      
  703.     '调 入 网 格(Fixed)
  704.     GridCode = "Chhs_StartBillList"
  705.     Call BzWgcsh(CxbbGrid, GridCode, GridInf(), GridBoolean(), GridInt(), GridStr())
  706.       
  707.     Qslz = GridInf(1)
  708.     Sjhgd = GridInf(2)
  709.     Sfxshjwg = GridInf(7)
  710.     Szzls = CxbbGrid.Cols - 1
  711.     Lbl_TitleText(0) = CStr(Xtyear) + "." + CStr(StartMon)
  712. End Sub
  713. Private Sub Form_Unload(Cancel As Integer)                                  '窗体卸载
  714.     '卸载条件窗体
  715.     Start_BillChalkitupCond.UnloadCheck.Value = 1
  716.     Unload Start_BillChalkitupCond
  717.     
  718.     '卸载打印页面设置窗体
  719.     Unload Dyymctbl
  720. End Sub
  721. Private Sub CxbbGrid_BeforeMoveColumn(ByVal Col As Long, Position As Long)           '网格列发生移动时自动交换网格索引信息
  722.     Call FnBln_RefreshArray(Col, Position, GridStr(), GridInf())
  723. End Sub
  724. Private Sub GsToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)                '网格格式调整(Fixed)
  725.   
  726.     Select Case Button.Key
  727.         Case "bcgs"                                          '保存表格格式
  728.             Call Bcwggs(CxbbGrid, GridCode, GridStr())
  729.         Case "hfmrgs"                                        '恢复默认格式
  730.             Call Hfmrgs(CxbbGrid, GridCode, GridStr())
  731.         Case "szxsxm"                                        '设置显示项目
  732.             Call Szxsxm(CxbbGrid, GridCode)
  733.     End Select
  734. End Sub
  735. Private Sub SzToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)
  736.     
  737.     Select Case Button.Key
  738.         Case "ymsz"                                          '页面设置
  739.             Dyymctbl.Show 1
  740.         Case "yl"                                            '预 览
  741.             Call bbyl(True)
  742.         Case "dy"                                            '打 印
  743.             Call bbyl(False)
  744.         Case "cx"                                            '查 询
  745.             Start_BillChalkitupCond.Show 1
  746.         Case "Bill"                                          '单 据
  747.             Call CxbbGrid_DblClick
  748.         Case "mx"                                            '明 细
  749.             Call Sub_Mx
  750.         Case "hz"                                            '汇 总
  751.             Call Sub_Hz
  752.         Case "jz"                                            '记 帐
  753.             Call Sub_Qcjz
  754.         Case "hf"                                            '恢 复
  755.             Call Sub_Hfjz
  756.         Case "bz"                                            '帮 助
  757.             Call F1bz
  758.         Case "fh"                                            '退 出
  759.            Unload Me
  760.     End Select
  761. End Sub
  762. Private Sub Timer1_Timer()                                 '在窗体激活后调入查询程序
  763.     
  764.     Timer1.Enabled = False
  765.     Xt_Wait.Show
  766.     Xt_Wait.Refresh
  767.    
  768.     ReDim GridColHide(CxbbGrid.Cols)
  769.    
  770.     '加快显示速度
  771.     CxbbGrid.Redraw = False
  772.     '生成查询结果
  773.     Call Sub_Mx
  774.     
  775.     CxbbGrid.Redraw = True
  776.     
  777.     Xt_Wait.Hide
  778. End Sub
  779. Private Sub Sub_Query(Int_QueryType As Integer)                                     '生成查询结果(Define)
  780.     
  781.     '过程参数:Int_QueryType 0-"点确定按钮"查询  1-"刷新"查询
  782.     Dim Rec_Query As Recordset                  '查询结果动态集
  783.     Dim Coljsq As Long                          '网格列计数器
  784.     Dim Jsqte As Long                        '临时动态计数器
  785.     Dim Str1 As String
  786.     
  787.     '以下为自定义部分[
  788.  
  789.     If Int_QueryType = 0 Then   '0-"点确定按钮"查询
  790.         With Start_BillChalkitupCond
  791.          
  792.             '生成查询条件
  793.             Str_QueryCondi = " where " + .WhCode + "and a.kjyear=" & Xtyear & " and a.period=" & StartMon
  794.             
  795.             If .Opt_Wjz.Value Then
  796.                 Str_QueryCondi = Str_QueryCondi & " and  chalkitupman=''  "
  797.             Else
  798.                 Str_QueryCondi = Str_QueryCondi & " and  chalkitupman<>''  "
  799.             End If
  800.         End With
  801.     End If
  802.      
  803.     '期初单据
  804.     SqlStr = "SELECT * FROM Chhs_V_StartBill a " & _
  805.              Trim(Str_QueryCondi) & " and a.checker<>'' Order By a.Whcode,a.StartInputMainId,a.StartInputSubId"
  806.     Set Rec_Query = Cw_DataEnvi.DataConnect.Execute(SqlStr)
  807.     With Rec_Query
  808.         CxbbGrid.Rows = CxbbGrid.FixedRows
  809.         Jsqte = CxbbGrid.FixedRows
  810.         Do While Not .EOF
  811.     
  812.             CxbbGrid.AddItem ""
  813.             '[>>自定义填充内容
  814.             CxbbGrid.TextMatrix(Jsqte, 0) = .Fields("StartInputMainId")                                            'ID(主要用来查询定位用)
  815.             CxbbGrid.TextMatrix(Jsqte, 1) = .Fields("BillCode")                                            'ID(主要用来查询定位用)
  816.             CxbbGrid.TextMatrix(Jsqte, Sydz("001", GridStr(), Szzls)) = Trim(.Fields("BillNum") & "")              '单据号
  817.             CxbbGrid.TextMatrix(Jsqte, Sydz("002", GridStr(), Szzls)) = Trim(.Fields("WhName") & "")               '仓库名称
  818.             CxbbGrid.TextMatrix(Jsqte, Sydz("003", GridStr(), Szzls)) = Format(.Fields("BillDate"), "yyyy-mm-dd")  '入库日期
  819.             CxbbGrid.TextMatrix(Jsqte, Sydz("004", GridStr(), Szzls)) = Trim(.Fields("SupplierName") & "")         '供应商
  820.             CxbbGrid.TextMatrix(Jsqte, Sydz("005", GridStr(), Szzls)) = Trim(.Fields("Deptname") & "")             '部门
  821.             CxbbGrid.TextMatrix(Jsqte, Sydz("006", GridStr(), Szzls)) = Trim(.Fields("InoutClassName") & "")       '收发类别
  822.             CxbbGrid.TextMatrix(Jsqte, Sydz("007", GridStr(), Szzls)) = Trim(.Fields("PersonName") & "")           '业务员
  823.             CxbbGrid.TextMatrix(Jsqte, Sydz("008", GridStr(), Szzls)) = Trim(.Fields("Maker") & "")                '制单人
  824.             CxbbGrid.TextMatrix(Jsqte, Sydz("009", GridStr(), Szzls)) = Trim(.Fields("Checker") & "")              '审核人
  825.             CxbbGrid.TextMatrix(Jsqte, Sydz("010", GridStr(), Szzls)) = Trim(.Fields("ChalkitupMan") & "")         '记帐人
  826.             CxbbGrid.TextMatrix(Jsqte, Sydz("019", GridStr(), Szzls)) = Trim(.Fields("Mnumber") & "")              '存货编码
  827.             CxbbGrid.TextMatrix(Jsqte, Sydz("011", GridStr(), Szzls)) = Trim(.Fields("MName") & "")                '存货名称
  828.             CxbbGrid.TextMatrix(Jsqte, Sydz("012", GridStr(), Szzls)) = Trim(.Fields("Model") & "")                '规格型号
  829.             CxbbGrid.TextMatrix(Jsqte, Sydz("013", GridStr(), Szzls)) = Trim(.Fields("PrimaryUnitName") & "")      '主计量单位
  830.             CxbbGrid.TextMatrix(Jsqte, Sydz("020", GridStr(), Szzls)) = Trim(.Fields("kjyear") & "")               '年度
  831.             CxbbGrid.TextMatrix(Jsqte, Sydz("021", GridStr(), Szzls)) = Trim(.Fields("period") & "")               '月份
  832.             If .Fields("Quan") <> 0 Then                                                                           '数量
  833.                 CxbbGrid.TextMatrix(Jsqte, Sydz("014", GridStr(), Szzls)) = .Fields("Quan")
  834.             End If
  835.             If .Fields("PlanPrice") <> 0 Then                                                                      '计划单价
  836.                 CxbbGrid.TextMatrix(Jsqte, Sydz("015", GridStr(), Szzls)) = .Fields("PlanPrice")
  837.             End If
  838.             If .Fields("PlanMoney") <> 0 Then                                                                      '计划金额
  839.                 CxbbGrid.TextMatrix(Jsqte, Sydz("016", GridStr(), Szzls)) = .Fields("PlanMoney")
  840.             End If
  841.             If .Fields("Price") <> 0 Then                                                                          '实际单价
  842.                 CxbbGrid.TextMatrix(Jsqte, Sydz("017", GridStr(), Szzls)) = .Fields("Price")
  843.             End If
  844.             If .Fields("Emoney") <> 0 Then                                                                         '实际金额
  845.                 CxbbGrid.TextMatrix(Jsqte, Sydz("018", GridStr(), Szzls)) = .Fields("EMoney")
  846.             Else
  847.                 CxbbGrid.Cell(flexcpBackColor, CxbbGrid.Row, Qslz, CxbbGrid.Row, CxbbGrid.Cols - 1) = &HFFFFC0
  848.             End If
  849.             
  850.             '<<]
  851.             '设置数据行高度(Fixed)
  852.             CxbbGrid.RowHeight(Jsqte) = Sjhgd
  853.      
  854.             '动态集指针加1,同时将计数器加1(Fixed)
  855.             .MoveNext
  856.             Jsqte = Jsqte + 1
  857.         Loop
  858.     End With
  859.     
  860.     '暂估单据
  861.     If Xtclzg Then
  862.     
  863.         '筛选暂估条件
  864.         mStr = ""
  865.         Set Rec_Query = Cw_DataEnvi.DataConnect.Execute("select * from chhs_evalu order by whcode")
  866.         If Not Rec_Query.EOF Then
  867.              For Jsqte = 1 To Rec_Query.RecordCount
  868.                 Str1 = "1=1"
  869.                 If Trim(Rec_Query.Fields("whcode") & "") <> "" Then
  870.                     Str1 = Str1 + " and  a.whcode='" & Trim(Rec_Query.Fields("whcode")) & "'"
  871.                 End If
  872.                 If Trim(Rec_Query.Fields("msort") & "") <> "" Then
  873.                     Str1 = Str1 + " and a.invsortcode like '" & Trim(Rec_Query.Fields("msort")) & "%'"
  874.                 End If
  875.                 If Trim(Rec_Query.Fields("mnumber") & "") <> "" Then
  876.                     Str1 = Str1 + " and a.mnumber='" & Trim(Rec_Query.Fields("mnumber")) & "'"
  877.                 End If
  878.                 If mStr = "" Then
  879.                      mStr = "(" + Str1 + ")"
  880.                 Else
  881.                     mStr = mStr + " or (" + Str1 + ")"
  882.                 End If
  883.                 Rec_Query.MoveNext
  884.             Next
  885.             
  886.             mStr = "(" + mStr + ")"
  887.             '筛选期初暂估单
  888.             SqlStr = "SELECT * FROM Chhs_V_StartEval a " & Trim(Str_QueryCondi) & " and " & Trim(mStr) & _
  889.                       " and a.billcode='1211' and Emoney<>0 Order By a.BillDate,a.InoutMainId,a.InoutSubId"
  890.             Set Rec_Query = Cw_DataEnvi.DataConnect.Execute(SqlStr)
  891.             With Rec_Query
  892.                 Do While Not .EOF
  893.                     CxbbGrid.AddItem ""
  894.                     Jsqte = CxbbGrid.Rows - 1
  895.                     
  896.                     '[>>自定义填充内容
  897.                     CxbbGrid.TextMatrix(Jsqte, 0) = .Fields("InoutMainId")                                            'ID(主要用来查询定位用)
  898.                     CxbbGrid.TextMatrix(Jsqte, 1) = .Fields("BillCode")                                            'ID(主要用来查询定位用)
  899.                     CxbbGrid.TextMatrix(Jsqte, Sydz("001", GridStr(), Szzls)) = Trim(.Fields("BillNum") & "")              '单据号
  900.                     CxbbGrid.TextMatrix(Jsqte, Sydz("002", GridStr(), Szzls)) = Trim(.Fields("WhName") & "")               '仓库名称
  901.                     CxbbGrid.TextMatrix(Jsqte, Sydz("003", GridStr(), Szzls)) = Format(.Fields("BillDate"), "yyyy-mm-dd")  '入库日期
  902.                     CxbbGrid.TextMatrix(Jsqte, Sydz("004", GridStr(), Szzls)) = Trim(.Fields("SupplierName") & "")         '供应商
  903.                     CxbbGrid.TextMatrix(Jsqte, Sydz("005", GridStr(), Szzls)) = Trim(.Fields("Deptname") & "")             '部门
  904.                     CxbbGrid.TextMatrix(Jsqte, Sydz("006", GridStr(), Szzls)) = Trim(.Fields("InoutClassName") & "")       '收发类别
  905.                     CxbbGrid.TextMatrix(Jsqte, Sydz("007", GridStr(), Szzls)) = Trim(.Fields("PersonName") & "")           '业务员
  906.                     CxbbGrid.TextMatrix(Jsqte, Sydz("008", GridStr(), Szzls)) = Trim(.Fields("Maker") & "")                '制单人
  907.                     CxbbGrid.TextMatrix(Jsqte, Sydz("009", GridStr(), Szzls)) = Trim(.Fields("chhsChecker") & "")              '审核人
  908.                     CxbbGrid.TextMatrix(Jsqte, Sydz("010", GridStr(), Szzls)) = Trim(.Fields("ChalkitupMan") & "")         '记帐人
  909.                     CxbbGrid.TextMatrix(Jsqte, Sydz("019", GridStr(), Szzls)) = Trim(.Fields("Mnumber") & "")              '存货编码
  910.                     CxbbGrid.TextMatrix(Jsqte, Sydz("011", GridStr(), Szzls)) = Trim(.Fields("MName") & "")                '存货名称
  911.                     CxbbGrid.TextMatrix(Jsqte, Sydz("012", GridStr(), Szzls)) = Trim(.Fields("Model") & "")                '规格型号
  912.                     CxbbGrid.TextMatrix(Jsqte, Sydz("013", GridStr(), Szzls)) = Trim(.Fields("PrimaryUnitName") & "")      '主计量单位
  913.                     CxbbGrid.TextMatrix(Jsqte, Sydz("020", GridStr(), Szzls)) = Trim(.Fields("kjyear") & "")               '年度
  914.                     CxbbGrid.TextMatrix(Jsqte, Sydz("021", GridStr(), Szzls)) = Trim(.Fields("period") & "")               '月份
  915.                     If .Fields("FactReceiptQuan") <> 0 Then                                                                           '数量
  916.                         CxbbGrid.TextMatrix(Jsqte, Sydz("014", GridStr(), Szzls)) = .Fields("FactReceiptQuan")
  917.                     End If
  918.                     If .Fields("PlanPrice") <> 0 Then                                                                      '计划单价
  919.                         CxbbGrid.TextMatrix(Jsqte, Sydz("015", GridStr(), Szzls)) = .Fields("PlanPrice")
  920.                     End If
  921.                     If .Fields("PlanMoney") <> 0 Then                                                                      '计划金额
  922.                         CxbbGrid.TextMatrix(Jsqte, Sydz("016", GridStr(), Szzls)) = .Fields("PlanMoney")
  923.                     End If
  924.                     If .Fields("Price") <> 0 Then                                                                          '实际单价
  925.                         CxbbGrid.TextMatrix(Jsqte, Sydz("017", GridStr(), Szzls)) = .Fields("Price")
  926.                     End If
  927.                     If .Fields("Emoney") <> 0 Then                                                                         '实际金额
  928.                         CxbbGrid.TextMatrix(Jsqte, Sydz("018", GridStr(), Szzls)) = .Fields("EMoney")
  929.                     Else
  930.                         CxbbGrid.Cell(flexcpBackColor, CxbbGrid.Row, Qslz, CxbbGrid.Row, CxbbGrid.Cols - 1) = &HFFFFC0
  931.                     End If
  932.                     
  933.                     '<<]
  934.                     '设置数据行高度(Fixed)
  935.                     CxbbGrid.RowHeight(Jsqte) = Sjhgd
  936.                     
  937.                     '动态集指针加1,同时将计数器加1(Fixed)
  938.                     .MoveNext
  939.                     Jsqte = Jsqte + 1
  940.                 Loop
  941.             End With
  942.         End If
  943.     End If
  944.     
  945.     '输入合计
  946.     With CxbbGrid
  947.         If Start_BillChalkitupCond.Chk_Sum.Value <> 0 Then
  948.            .SubtotalPosition = flexSTBelow
  949.            For Jsqte = Qslz To .Cols - 1
  950.                 If GridBoolean(Jsqte, 4) Then
  951.                      .Subtotal flexSTSum, 0, Jsqte, , &HF7F3EC, , , , , True
  952.                 End If
  953.            Next
  954.            
  955.            For Jsqte = .FixedRows To .Rows - 1
  956.                 If .IsSubtotal(Jsqte) Then
  957.                     For Coljsq = Qslz To .Cols - 1
  958.                         If Val(.TextMatrix(Jsqte, Coljsq)) = 0 And GridBoolean(Coljsq, 4) Then
  959.                             .TextMatrix(Jsqte, Coljsq) = ""
  960.                         End If
  961.                     Next
  962.                     .TextMatrix(Jsqte, 0) = .TextMatrix(Jsqte - 1, 0)
  963.                     .TextMatrix(Jsqte, 1) = .TextMatrix(Jsqte - 1, 1)
  964.                     .TextMatrix(Jsqte, Sydz("002", GridStr(), Szzls)) = "    合计 "
  965.                     .RowHeight(Jsqte) = Sjhgd
  966.                 End If
  967.            Next
  968.         End If
  969.     End With
  970.     
  971.     ']以上为用户自定义部分
  972.     
  973.     Set Rec_Query = Nothing
  974. End Sub
  975. Private Sub Sub_QueryHz(Int_QueryType As Integer)                                     '生成查询结果(Define)
  976.     
  977.     '过程参数:Int_QueryType 0-"点确定按钮"查询  1-"刷新"查询
  978.     Dim Rec_Query As New ADODB.Recordset        '查询结果动态集
  979.     Dim Coljsq As Long                          '网格列计数器
  980.     Dim Jsqte As Long                        '临时动态计数器
  981.     Dim Str As String
  982.     Dim FindRow As Integer
  983.     
  984.     '以下为自定义部分[
  985.      
  986.     CxbbGrid.ColHidden(Sydz("001", GridStr(), Szzls)) = True
  987.     CxbbGrid.ColHidden(Sydz("003", GridStr(), Szzls)) = True
  988.     CxbbGrid.ColHidden(Sydz("004", GridStr(), Szzls)) = True
  989.     CxbbGrid.ColHidden(Sydz("005", GridStr(), Szzls)) = True
  990.     CxbbGrid.ColHidden(Sydz("006", GridStr(), Szzls)) = True
  991.     CxbbGrid.ColHidden(Sydz("007", GridStr(), Szzls)) = True
  992.     CxbbGrid.ColHidden(Sydz("008", GridStr(), Szzls)) = True
  993.     CxbbGrid.ColHidden(Sydz("009", GridStr(), Szzls)) = True
  994.     CxbbGrid.ColHidden(Sydz("010", GridStr(), Szzls)) = True
  995.     CxbbGrid.ColHidden(Sydz("020", GridStr(), Szzls)) = True
  996.     CxbbGrid.ColHidden(Sydz("021", GridStr(), Szzls)) = True
  997.     
  998.     SqlStr = "SELECT  a.Whcode, WhName, MNumber, MName, Model, PrimaryUnitName, SUM(Quan) AS SumQuan, " & _
  999.          " SUM(PlanMoney) AS SumPlanMoney, SUM(EMoney) AS SumEMoney FROM Chhs_V_StartBill a " & _
  1000.          " LEFT OUTER JOIN  Gy_Whlimit ON a.WhCode = Gy_Whlimit.WhCode " & Trim(Str_QueryCondi) & _
  1001.          " and Gy_Whlimit.Czybm = '" & Xtczybm & "' and kjyear=" & Xtyear & " and period=" & StartMon & _
  1002.          " GROUP BY a.WhName, a.MNumber, " & _
  1003.          " a.MName, a.Model, a.PrimaryUnitName, a.WhCode ORDER BY a.WhCode, a.MNumber "
  1004.     Set Rec_Query = Cw_DataEnvi.DataConnect.Execute(SqlStr)
  1005.     With Rec_Query
  1006.         CxbbGrid.Rows = CxbbGrid.FixedRows
  1007.         Jsqte = CxbbGrid.FixedRows
  1008.         Do While Not .EOF
  1009.             CxbbGrid.AddItem ""
  1010.             '[>>自定义填充内容
  1011.             
  1012.             CxbbGrid.TextMatrix(Jsqte, 1) = Trim(.Fields("WhCode") & "") + Trim(.Fields("Mnumber") & "")                 '仓库+存货
  1013.             CxbbGrid.TextMatrix(Jsqte, Sydz("002", GridStr(), Szzls)) = Trim(.Fields("WhName") & "")                   '仓库
  1014.             CxbbGrid.TextMatrix(Jsqte, Sydz("019", GridStr(), Szzls)) = Trim(.Fields("Mnumber") & "")                  '存货编码
  1015.             CxbbGrid.TextMatrix(Jsqte, Sydz("011", GridStr(), Szzls)) = Trim(.Fields("MName") & "")                    '存货名称
  1016.             CxbbGrid.TextMatrix(Jsqte, Sydz("012", GridStr(), Szzls)) = Trim(.Fields("Model") & "")                    '规格型号
  1017.             CxbbGrid.TextMatrix(Jsqte, Sydz("013", GridStr(), Szzls)) = Trim(.Fields("PrimaryUnitName") & "")          '主计量单位
  1018.             If .Fields("SumQuan") <> 0 Then                                                                            '数量
  1019.                 CxbbGrid.TextMatrix(Jsqte, Sydz("014", GridStr(), Szzls)) = .Fields("SumQuan")
  1020.             End If
  1021.             If .Fields("SumQuan") <> 0 And .Fields("SumPlanMoney") <> 0 Then                                                                           '计划单价
  1022.                 CxbbGrid.TextMatrix(Jsqte, Sydz("015", GridStr(), Szzls)) = .Fields("SumPlanMoney") / .Fields("SumQuan")
  1023.             End If
  1024.             If .Fields("SumPlanMoney") <> 0 Then                                                                       '计划金额
  1025.                 CxbbGrid.TextMatrix(Jsqte, Sydz("016", GridStr(), Szzls)) = .Fields("SumPlanMoney")
  1026.             End If
  1027.             If .Fields("SumQuan") <> 0 Then                                                                            '实际金额
  1028.                 CxbbGrid.TextMatrix(Jsqte, Sydz("017", GridStr(), Szzls)) = .Fields("SumEMoney") / .Fields("SumQuan")
  1029.             End If
  1030.             If .Fields("SumEmoney") <> 0 Then                                                                          '实际金额
  1031.                 CxbbGrid.TextMatrix(Jsqte, Sydz("018", GridStr(), Szzls)) = .Fields("SumEMoney")
  1032.             End If
  1033.             
  1034.             '<<]
  1035.             '设置数据行高度(Fixed)
  1036.             CxbbGrid.RowHeight(Jsqte) = Sjhgd
  1037.      
  1038.             '动态集指针加1,同时将计数器加1(Fixed)
  1039.             .MoveNext
  1040.             Jsqte = Jsqte + 1
  1041.         Loop
  1042.     End With
  1043.     
  1044.     '期初暂估单
  1045.     If Xtclzg And mStr <> "" Then
  1046.         SqlStr = "SELECT a.Whcode,WhName, MNumber, MName, Model, PrimaryUnitName, SUM(FactReceiptQuan) AS SumQuan, " & _
  1047.              " SUM(PlanMoney) AS SumPlanMoney, SUM(EMoney) AS SumEMoney FROM Chhs_V_StartEval a " & _
  1048.              " LEFT OUTER JOIN  Gy_Whlimit ON a.WhCode = Gy_Whlimit.WhCode " & Trim(Str_QueryCondi) & _
  1049.              " and Gy_Whlimit.Czybm = '" & Xtczybm & "'and kjyear=" & Xtyear & " and period=" & StartMon & _
  1050.              " and " & Trim(mStr) & "GROUP BY a.WhName, a.MNumber, " & _
  1051.              " a.MName, a.Model, a.PrimaryUnitName, a.WhCode ORDER BY a.WhCode, a.MNumber "
  1052.         Set Rec_Query = Cw_DataEnvi.DataConnect.Execute(SqlStr)
  1053.         With Rec_Query
  1054.             Jsqte = CxbbGrid.Rows - 1
  1055.             Do While Not .EOF
  1056.                 '[>>自定义填充内容
  1057.                 FindRow = CxbbGrid.FindRow(Trim(.Fields("WhCode") & "") + Trim(.Fields("Mnumber") & ""), , 1)
  1058.                 If Not FindRow > 0 Then
  1059.                     CxbbGrid.AddItem ""
  1060.                     Jsqte = Jsqte + 1
  1061.                     CxbbGrid.TextMatrix(Jsqte, 1) = Trim(.Fields("WhCode") & "") + Trim(.Fields("Mnumber") & "")               '仓库+存货
  1062.                     CxbbGrid.TextMatrix(Jsqte, Sydz("002", GridStr(), Szzls)) = Trim(.Fields("WhName") & "")                   '仓库
  1063.                     CxbbGrid.TextMatrix(Jsqte, Sydz("019", GridStr(), Szzls)) = Trim(.Fields("Mnumber") & "")                  '存货编码
  1064.                     CxbbGrid.TextMatrix(Jsqte, Sydz("011", GridStr(), Szzls)) = Trim(.Fields("MName") & "")                    '存货名称
  1065.                     CxbbGrid.TextMatrix(Jsqte, Sydz("012", GridStr(), Szzls)) = Trim(.Fields("Model") & "")                    '规格型号
  1066.                     CxbbGrid.TextMatrix(Jsqte, Sydz("013", GridStr(), Szzls)) = Trim(.Fields("PrimaryUnitName") & "")          '主计量单位
  1067.                     If .Fields("SumQuan") <> 0 Then                                                                            '数量
  1068.                         CxbbGrid.TextMatrix(Jsqte, Sydz("014", GridStr(), Szzls)) = .Fields("SumQuan")
  1069.                     End If
  1070.                     If .Fields("SumQuan") <> 0 Then                                                                            '计划单价
  1071.                         CxbbGrid.TextMatrix(Jsqte, Sydz("015", GridStr(), Szzls)) = .Fields("SumPlanMoney") / .Fields("SumQuan")
  1072.                     End If
  1073.                     If .Fields("SumPlanMoney") <> 0 Then                                                                       '计划金额
  1074.                         CxbbGrid.TextMatrix(Jsqte, Sydz("016", GridStr(), Szzls)) = .Fields("SumPlanMoney")
  1075.                     End If
  1076.                     If .Fields("SumQuan") <> 0 Then                                                                            '实际金额
  1077.                         CxbbGrid.TextMatrix(Jsqte, Sydz("017", GridStr(), Szzls)) = .Fields("SumEMoney") / .Fields("SumQuan")
  1078.                     End If
  1079.                     If .Fields("SumEmoney") <> 0 Then                                                                          '实际金额
  1080.                         CxbbGrid.TextMatrix(Jsqte, Sydz("018", GridStr(), Szzls)) = .Fields("SumEMoney")
  1081.                     End If
  1082.                 
  1083.                 Else
  1084.                     Jsqte = FindRow
  1085.                     If .Fields("SumQuan") <> 0 Then                                                                            '数量
  1086.                         CxbbGrid.TextMatrix(Jsqte, Sydz("014", GridStr(), Szzls)) = Val(CxbbGrid.TextMatrix(Jsqte, Sydz("014", GridStr(), Szzls))) + .Fields("SumQuan")
  1087.                     End If
  1088.                     If .Fields("SumQuan") <> 0 Then                                                                            '计划单价
  1089.                         CxbbGrid.TextMatrix(Jsqte, Sydz("015", GridStr(), Szzls)) = .Fields("SumPlanMoney") / .Fields("SumQuan")
  1090.                     End If
  1091.                     If .Fields("SumPlanMoney") <> 0 Then                                                                       '计划金额
  1092.                         CxbbGrid.TextMatrix(Jsqte, Sydz("016", GridStr(), Szzls)) = Val(CxbbGrid.TextMatrix(Jsqte, Sydz("016", GridStr(), Szzls))) + .Fields("SumPlanMoney")
  1093.                     End If
  1094.                     If .Fields("SumQuan") <> 0 Then                                                                            '实际金额
  1095.                         CxbbGrid.TextMatrix(Jsqte, Sydz("017", GridStr(), Szzls)) = .Fields("SumEMoney") / .Fields("SumQuan")
  1096.                     End If
  1097.                     If .Fields("SumEmoney") <> 0 Then                                                                          '实际金额
  1098.                         CxbbGrid.TextMatrix(Jsqte, Sydz("018", GridStr(), Szzls)) = Val(CxbbGrid.TextMatrix(Jsqte, Sydz("018", GridStr(), Szzls))) + .Fields("SumEMoney")
  1099.                     End If
  1100.                 End If
  1101.                 
  1102.                 '<<]
  1103.                 '设置数据行高度(Fixed)
  1104.                 CxbbGrid.RowHeight(Jsqte) = Sjhgd
  1105.                 
  1106.                 '动态集指针加1,同时将计数器加1(Fixed)
  1107.                 .MoveNext
  1108.             Loop
  1109.         End With
  1110.     End If
  1111.     
  1112.     
  1113.     '输入合计
  1114.     With CxbbGrid
  1115.         If Not .Rows = .FixedRows Then
  1116.            .SubtotalPosition = flexSTBelow
  1117.            For Jsqte = Qslz To .Cols - 1
  1118.                 If GridBoolean(Jsqte, 4) Then
  1119.                      .Subtotal flexSTSum, 0, Jsqte, , &HF7F3EC, , , , , True
  1120.                 End If
  1121.            Next
  1122.            .RowHeight(.Rows - 1) = Sjhgd
  1123.            .TextMatrix(.Rows - 1, Sydz("002", GridStr(), Szzls)) = " 合计 "
  1124.         End If
  1125.     End With
  1126.     
  1127.     ']以上为用户自定义部分
  1128. End Sub
  1129. Private Sub CxbbGrid_DblClick()                                              '用户双击网格调入相应单据
  1130.     
  1131.     Dim Rectemp As New ADODB.Recordset               '临时使用动态集
  1132.     If CxbbGrid.Rows = CxbbGrid.FixedRows Then Exit Sub
  1133.     
  1134.     '非数据行退出
  1135.     If CxbbGrid.Row < CxbbGrid.FixedRows Or Val(CxbbGrid.TextMatrix(CxbbGrid.Row, 0)) = 0 Then
  1136.         Exit Sub
  1137.     End If
  1138.     If Trim(CxbbGrid.TextMatrix(CxbbGrid.Row, 1)) = "1308" Then
  1139.         SqlStr = "SELECT StartInputMainId From Chhs_StartInputMain Where StartInputMainId=" & Val(CxbbGrid.TextMatrix(CxbbGrid.Row, 0))
  1140.         Set Rectemp = Cw_DataEnvi.DataConnect.Execute(SqlStr)
  1141.         With Rectemp
  1142.             If .EOF Then
  1143.                 Tsxx = "此期初单据已被其他用户删除!"
  1144.                 Call Xtxxts(Tsxx, 0, 4)
  1145.                 Exit Sub
  1146.             Else
  1147.                 '填充查询单据标识
  1148.                 XT_BillID = CxbbGrid.TextMatrix(CxbbGrid.Row, 0)
  1149.                 Xtcdcsfz = Str_QueryCondi
  1150.                 
  1151.                 '设置单据处理为列表查询(修改)状态
  1152.                 Xtcdcs = "3"
  1153.                  
  1154.                  '调入单据处理窗体
  1155.                 Start_BillInput.Show 1
  1156.             End If
  1157.         End With
  1158.     Else
  1159.                 '期初暂估单
  1160.         SqlStr = "SELECT InoutMainId From Gy_InoutMain Where InoutMainId=" & Val(CxbbGrid.TextMatrix(CxbbGrid.Row, 0))
  1161.         Set Rectemp = Cw_DataEnvi.DataConnect.Execute(SqlStr)
  1162.         With Rectemp
  1163.             If .EOF Then
  1164.                 Tsxx = "此期初单据已被其他用户删除!"
  1165.                 Call Xtxxts(Tsxx, 0, 4)
  1166.                 Exit Sub
  1167.             Else
  1168.                     
  1169.                 XT_BillID = CxbbGrid.TextMatrix(CxbbGrid.Row, 0)
  1170.                 Xtcdcsfz = Str_QueryCondi
  1171.                 
  1172.                 '设置单据处理为列表查询(修改)状态
  1173.                 Xtcdcs = "3"
  1174.                 
  1175.                 '调入单据处理窗体
  1176.                 If Start_BillChalkitupCond.Opt_Wjz Then
  1177.                     Xtcdcsfz = "1211"
  1178.                     Eval_StockInBill.Show 1
  1179.                 Else
  1180.                     Xtcdcsfz = " startflag=1 and kjyear=" & PGKjYear & " and period =" & StartMon
  1181.                     Eval_BlueBill.Show 1
  1182.                 End If
  1183.             End If
  1184.         End With
  1185.     End If
  1186. End Sub
  1187. Private Sub Sub_Mx()                                             '明细
  1188.     
  1189.     '生成查询结果
  1190.     CxbbGrid.Redraw = False
  1191.     Call Sub_Query(0)
  1192.     CxbbGrid.Redraw = True
  1193.     
  1194.     '调整工具条
  1195.     With SzToolbar
  1196.         If CxbbGrid.Rows = CxbbGrid.FixedRows Then
  1197.             .Buttons("Bill").Enabled = False
  1198.             .Buttons("mx").Enabled = False
  1199.             .Buttons("hz").Enabled = False
  1200.             .Buttons("jz").Enabled = False
  1201.             .Buttons("hf").Enabled = False
  1202.         Else
  1203.             .Buttons("cx").Enabled = True
  1204.             .Buttons("Bill").Enabled = True
  1205.             .Buttons("hz").Enabled = True
  1206.             .Buttons("mx").Enabled = False
  1207.             If Start_BillChalkitupCond.Opt_Wjz Then
  1208.                 .Buttons("jz").Enabled = True
  1209.                 .Buttons("hf").Enabled = False
  1210.             Else
  1211.                 .Buttons("jz").Enabled = False
  1212.                 .Buttons("hf").Enabled = True
  1213.             End If
  1214.        End If
  1215.     End With
  1216.    
  1217.     If GsToolbar.Enabled = False Then
  1218.         
  1219.         '显示汇总后隐藏的网格列
  1220.         For Jsqte = Qslz To CxbbGrid.Cols - 1
  1221.             CxbbGrid.ColHidden(Jsqte) = GridColHide(Jsqte)
  1222.         Next
  1223.     End If
  1224.     
  1225.     GsToolbar.Enabled = True
  1226.     
  1227. End Sub
  1228. Private Sub Sub_Hz()                                            '汇总
  1229.     
  1230.     If CxbbGrid.Rows = CxbbGrid.FixedRows Then Exit Sub
  1231.     
  1232.     '生成查询结果
  1233.     CxbbGrid.Redraw = False
  1234.     Call Sub_QueryHz(0)
  1235.     CxbbGrid.Redraw = True
  1236.     
  1237.     With SzToolbar
  1238.         .Buttons("cx").Enabled = False
  1239.         .Buttons("Bill").Enabled = False
  1240.         .Buttons("jz").Enabled = False
  1241.         .Buttons("hf").Enabled = False
  1242.         .Buttons("hz").Enabled = False
  1243.         .Buttons("mx").Enabled = True
  1244.     End With
  1245.     
  1246.     GsToolbar.Enabled = False
  1247.     
  1248.     For Jsqte = Qslz To CxbbGrid.Cols - 1
  1249.         GridColHide(Jsqte) = CxbbGrid.ColHidden(Jsqte)
  1250.     Next
  1251.        
  1252. End Sub
  1253. Private Sub Sub_Qcjz()               '期初记帐
  1254. Dim Rectemp As Recordset
  1255. Dim RecTempFz As New ADODB.Recordset
  1256. Dim RectempMx As New ADODB.Recordset
  1257. Dim RecTempZz As New ADODB.Recordset
  1258.     If CxbbGrid.Rows = CxbbGrid.FixedRows Then Exit Sub
  1259.     
  1260.     
  1261.     '日常单据已记帐期初单据不能记帐
  1262.     SqlStr = "select distinct chalkitupman from chhs_list a " & _
  1263.             Trim(Str_QueryCondi) & " and startflag=0 "
  1264.     Set Rectemp = Cw_DataEnvi.DataConnect.Execute(SqlStr)
  1265.     If Not Rectemp.EOF Then
  1266.         Tsxx = "日常单据已记帐,期初单据不能记帐!"
  1267.         Call Xtxxts(Tsxx, 0, 1)
  1268.         Exit Sub
  1269.     End If
  1270.     
  1271.     On Error GoTo Cwcl
  1272.     
  1273.     Xt_Wait.Show
  1274.     Xt_Wait.Refresh
  1275.     
  1276.     Cw_DataEnvi.DataConnect.BeginTrans
  1277.     
  1278.     '打开明细帐
  1279.     If RectempMx.State = 1 Then RectempMx.Close
  1280.     RectempMx.Open "select * from Chhs_List", Cw_DataEnvi.DataConnect, adOpenDynamic, adLockBatchOptimistic
  1281.     
  1282.     '期初单据
  1283.     SqlStr = "SELECT * FROM Chhs_V_StartBill a " & _
  1284.              Trim(Str_QueryCondi) & " Order By a.Whcode,a.StartInputMainId,a.StartInputSubId"
  1285.     Set Rectemp = Cw_DataEnvi.DataConnect.Execute(SqlStr)
  1286.     Do While Not Rectemp.EOF
  1287.                 
  1288.         '入库金额为零,不允许记帐
  1289.         If Rectemp.Fields("emoney") <> 0 Then
  1290.             With RectempMx
  1291.                 .AddNew
  1292.                 .Fields("inoutflag") = 1
  1293.                 .Fields("billnum") = Trim(Rectemp.Fields("billnum"))
  1294.                 .Fields("inoutmainid") = Rectemp.Fields("startinputmainid") + 0
  1295.                 .Fields("inoutsubid") = Rectemp.Fields("startinputsubid") + 0
  1296.                 If Trim(Rectemp.Fields("billdate") & "") <> "" Then
  1297.                     .Fields("billdate") = CDate(Rectemp.Fields("billdate"))
  1298.                 End If
  1299.                 .Fields("chalkdate") = Xtrq
  1300.                 .Fields("kjyear") = Xtyear
  1301.                 .Fields("period") = StartMon
  1302.                 .Fields("billcode") = Trim(Rectemp.Fields("billcode"))
  1303.                 .Fields("whcode") = Trim(Rectemp.Fields("whcode"))
  1304.                 .Fields("mnumber") = Trim(Rectemp.Fields("mnumber"))
  1305.                 .Fields("maker") = Trim(Rectemp.Fields("maker"))
  1306.                 .Fields("checker") = Trim(Rectemp.Fields("checker"))
  1307.                 .Fields("chalkitupman") = Xtczy
  1308.                 .Fields("startflag") = 1
  1309.                 .Fields("remark") = Trim(Rectemp.Fields("remark") & "")
  1310.                 If Not IsNull(Trim(Rectemp.Fields("deptcode"))) Then
  1311.                     .Fields("deptcode") = Trim(Rectemp.Fields("deptcode"))
  1312.                 End If
  1313.                 If Not IsNull(Trim(Rectemp.Fields("suppliercode"))) Then
  1314.                     .Fields("suppliercode") = Trim(Rectemp.Fields("suppliercode"))
  1315.                 End If
  1316.                 If Not IsNull(Trim(Rectemp.Fields("inoutclasscode"))) Then
  1317.                     .Fields("inoutclasscode") = Trim(Rectemp.Fields("inoutclasscode"))
  1318.                 End If
  1319.                 If Not IsNull(Trim(Rectemp.Fields("personcode"))) Then
  1320.                     .Fields("personcode") = Trim(Rectemp.Fields("personcode"))
  1321.                 End If
  1322.                 
  1323.                 '存货科目
  1324.                 Xtfhcs = ""
  1325.                 Xtfhcsfz = ""
  1326.                 Call MaccCode(Trim(Rectemp.Fields("whcode")), Trim(Rectemp.Fields("mnumber")), Trim(Rectemp.Fields("invsortcode")))
  1327.                 .Fields("mateacct") = Xtfhcs
  1328.                 If Qmclcy And Trim(Rectemp.Fields("pricemode")) = "计划价法" Then
  1329.                     .Fields("diffacct") = Xtfhcsfz
  1330.                 End If
  1331.                 
  1332.                 '对方科目
  1333.                 Xtfhcs = ""
  1334.                 Call DfaccCode(Trim(Rectemp.Fields("inoutclasscode") & ""), Trim(Rectemp.Fields("deptcode") & ""), Trim(Rectemp.Fields("invsortcode")), Trim(Rectemp.Fields("mnumber")))
  1335.                 .Fields("dfacct") = Xtfhcs
  1336.                 
  1337.                 .Fields("inquan") = Rectemp.Fields("quan")
  1338.                 Select Case Trim(Rectemp.Fields("pricemode"))
  1339.                     Case "计划价法"
  1340.                         If Qmclcy Then
  1341.                             .Fields("inprice") = Rectemp.Fields("planprice")
  1342.                             .Fields("inmoney") = Rectemp.Fields("planmoney")
  1343.                             If Rectemp.Fields("emoney") - Rectemp.Fields("planmoney") > 0 Then
  1344.                                 .Fields("jfdiff") = Rectemp.Fields("emoney") - Rectemp.Fields("planmoney")
  1345.                             Else
  1346.                                 .Fields("dfdiff") = Rectemp.Fields("planmoney") - Rectemp.Fields("emoney")
  1347.                             End If
  1348.                         Else
  1349.                             .Fields("inprice") = Rectemp.Fields("price")
  1350.                             .Fields("inmoney") = Rectemp.Fields("emoney")
  1351.                         End If
  1352.                     Case "全月平均法", "移动平均法"
  1353.                         .Fields("inprice") = Rectemp.Fields("price")
  1354.                         .Fields("inmoney") = Rectemp.Fields("emoney")
  1355.                         .UpdateBatch
  1356.                     Case "先进先出法", "后进先出法"
  1357.                         .Fields("inprice") = Rectemp.Fields("price")
  1358.                         .Fields("inmoney") = Rectemp.Fields("emoney")
  1359.                         .UpdateBatch
  1360.                         
  1361.                          '入辅助帐
  1362.                         If RecTempFz.State = 1 Then RecTempFz.Close
  1363.                         RecTempFz.Open "select * from Chhs_AssiPrice ", Cw_DataEnvi.DataConnect, adOpenDynamic, adLockBatchOptimistic
  1364.                         RecTempFz.AddNew
  1365.                         RecTempFz.Fields("inbillnum") = Trim(Rectemp.Fields("billnum"))
  1366.                         RecTempFz.Fields("whcode") = Trim(Rectemp.Fields("whcode"))
  1367.                         RecTempFz.Fields("mnumber") = Trim(Rectemp.Fields("mnumber"))
  1368.                         RecTempFz.Fields("inoutmaininid") = Rectemp.Fields("startinputmainid")
  1369.                         RecTempFz.Fields("inoutsubinid") = Rectemp.Fields("startinputsubid")
  1370.                         If Trim(Rectemp.Fields("billdate") & "") <> "" Then
  1371.                             RecTempFz.Fields("indate") = Rectemp.Fields("billdate")
  1372.                         End If
  1373.                         RecTempFz.Fields("inbillcode") = Trim(Rectemp.Fields("billcode"))
  1374.                         RecTempFz.Fields("inquan") = Rectemp.Fields("quan")
  1375.                         RecTempFz.Fields("inprice") = Rectemp.Fields("price")
  1376.                         RecTempFz.Fields("inmoney") = Rectemp.Fields("emoney")
  1377.                         RecTempFz.Fields("inchalkdate") = Xtrq
  1378.                         RecTempFz.Fields("listid") = .Fields("listid")
  1379.                         RecTempFz.UpdateBatch
  1380.                 End Select
  1381.                 .UpdateBatch
  1382.             End With
  1383.         
  1384.             '修改期初单据中的记账人
  1385.             Cw_DataEnvi.DataConnect.Execute ("update chhs_startinputmain set chalkitupman ='" & Xtczy & "'" & _
  1386.                         " where startinputmainid='" & Rectemp.Fields("startinputmainid") & "'")
  1387.         End If
  1388.         Rectemp.MoveNext
  1389.     Loop
  1390.     
  1391.     '期初暂估单
  1392.     If Xtclzg And mStr <> "" Then
  1393.         SqlStr = "SELECT * FROM Chhs_V_StartEval a " & Trim(Str_QueryCondi) & " and " & Trim(mStr) & _
  1394.                   "and a.BillCode='1211' and Emoney<>0 Order By a.BillDate,a.InoutMainId,a.InoutSubId"
  1395.         Set Rectemp = Cw_DataEnvi.DataConnect.Execute(SqlStr)
  1396.         With RectempMx
  1397.             Do While Not Rectemp.EOF
  1398.             
  1399.                 '入库金额为零,不允许记帐
  1400.                 If Not Rectemp.Fields("emoney") = 0 Then
  1401.                 
  1402.                     '蓝字暂估单
  1403.                     .AddNew
  1404.                     .Fields("inoutflag") = 1
  1405.                     .Fields("billnum") = Trim(Rectemp.Fields("billnum"))
  1406.                     .Fields("inoutmainid") = Trim(Rectemp.Fields("inoutmainid"))
  1407.                     .Fields("inoutsubid") = Trim(Rectemp.Fields("inoutsubid"))
  1408.                     .Fields("billdate") = Xtrq
  1409.                     .Fields("chalkdate") = Xtrq
  1410.                     .Fields("kjyear") = Xtyear
  1411.                     .Fields("period") = StartMon
  1412.                     .Fields("billcode") = "1304"
  1413.                     .Fields("whcode") = Trim(Rectemp.Fields("whcode"))
  1414.                     .Fields("mnumber") = Trim(Rectemp.Fields("mnumber"))
  1415.                     .Fields("maker") = Trim(Rectemp.Fields("maker"))
  1416.                     .Fields("checker") = Xtczy
  1417.                     .Fields("chalkitupman") = Xtczy
  1418.                     .Fields("startflag") = 1
  1419.                     .Fields("remark") = Trim(Rectemp.Fields("remark") & "")
  1420.                     If Not IsNull(Trim(Rectemp.Fields("deptcode"))) Then
  1421.                         .Fields("deptcode") = Trim(Rectemp.Fields("deptcode"))
  1422.                     End If
  1423.                     If Not IsNull(Trim(Rectemp.Fields("suppliercode"))) Then
  1424.                         .Fields("suppliercode") = Trim(Rectemp.Fields("suppliercode"))
  1425.                     End If
  1426.                     If Not IsNull(Trim(Rectemp.Fields("inoutclasscode"))) Then
  1427.                         .Fields("inoutclasscode") = Trim(Rectemp.Fields("inoutclasscode"))
  1428.                     End If
  1429.                     If Not IsNull(Trim(Rectemp.Fields("personcode"))) Then
  1430.                         .Fields("personcode") = Trim(Rectemp.Fields("personcode"))
  1431.                     End If
  1432.                     
  1433.                     '存货科目
  1434.                     Xtcdcs = ""
  1435.                     Xtcdcsfz = ""
  1436.                     Call MaccCode(Trim(Rectemp.Fields("whcode")), Trim(Rectemp.Fields("mnumber")), Trim(Rectemp.Fields("invsortcode")))
  1437.                     .Fields("mateacct") = Xtcdcs
  1438.                     .Fields("diffacct") = Xtcdcsfz
  1439.                     
  1440.                     '对方科目
  1441.                     Xtfhcs = ""
  1442.                     Call DfaccCode(Trim(Rectemp.Fields("inoutclasscode") & ""), Trim(Rectemp.Fields("deptcode") & ""), Trim(Rectemp.Fields("invsortcode")), Trim(Rectemp.Fields("mnumber")))
  1443.                     If Trim(Rectemp.Fields("pricemode")) = "计划价法" And Qmclcy Then
  1444.                         .Fields("diffacct") = Xtcdcsfz
  1445.                     End If
  1446.                     
  1447.                     .Fields("inquan") = Rectemp.Fields("factreceiptquan")
  1448.                     Select Case Trim(Rectemp.Fields("pricemode"))
  1449.                         Case "计划价法"
  1450.                             If Qmclcy Then
  1451.                                 .Fields("inprice") = Rectemp.Fields("planprice")
  1452.                                 .Fields("inmoney") = Rectemp.Fields("planmoney")
  1453.                                 If Rectemp.Fields("emoney") - Rectemp.Fields("planmoney") > 0 Then
  1454.                                     .Fields("jfdiff") = Rectemp.Fields("emoney") - Rectemp.Fields("planmoney")
  1455.                                 Else
  1456.                                     .Fields("dfdiff") = Rectemp.Fields("planmoney") - Rectemp.Fields("emoney")
  1457.                                 End If
  1458.                             Else
  1459.                                 .Fields("inprice") = Rectemp.Fields("price")
  1460.                                 .Fields("inmoney") = Rectemp.Fields("emoney")
  1461.                             End If
  1462.                         Case "全月平均法" ', "移动平均法", "先进先出法", "后进先出法"
  1463.                             .Fields("inprice") = Rectemp.Fields("price")
  1464.                             .Fields("inmoney") = Rectemp.Fields("emoney")
  1465.                     End Select
  1466.                     .UpdateBatch
  1467.                     
  1468.                     '红字回冲单
  1469.                     .AddNew
  1470.                     .Fields("inoutflag") = 1
  1471.                     .Fields("billnum") = Trim(Rectemp.Fields("billnum"))
  1472.                     .Fields("inoutmainid") = Trim(Rectemp.Fields("inoutmainid"))
  1473.                     .Fields("inoutsubid") = Trim(Rectemp.Fields("inoutsubid"))
  1474.                     .Fields("billdate") = Xtrq
  1475.                     .Fields("chalkdate") = Xtrq
  1476.                     .Fields("kjyear") = Xtyear
  1477.                     .Fields("period") = StartMon
  1478.                     .Fields("billcode") = "1305"
  1479.                     .Fields("whcode") = Trim(Rectemp.Fields("whcode"))
  1480.                     .Fields("mnumber") = Trim(Rectemp.Fields("mnumber"))
  1481.                     .Fields("maker") = Trim(Rectemp.Fields("maker"))
  1482.                     .Fields("checker") = Xtczy
  1483.                     .Fields("chalkitupman") = Xtczy
  1484.                     .Fields("remark") = Trim(Rectemp.Fields("remark") & "")
  1485.                     If Not IsNull(Trim(Rectemp.Fields("deptcode"))) Then
  1486.                         .Fields("deptcode") = Trim(Rectemp.Fields("deptcode"))
  1487.                     End If
  1488.                     If Not IsNull(Trim(Rectemp.Fields("suppliercode"))) Then
  1489.                         .Fields("suppliercode") = Trim(Rectemp.Fields("suppliercode"))
  1490.                     End If
  1491.                     If Not IsNull(Trim(Rectemp.Fields("inoutclasscode"))) Then
  1492.                         .Fields("inoutclasscode") = Trim(Rectemp.Fields("inoutclasscode"))
  1493.                     End If
  1494.                     If Not IsNull(Trim(Rectemp.Fields("personcode"))) Then
  1495.                         .Fields("personcode") = Trim(Rectemp.Fields("personcode"))
  1496.                     End If
  1497.                     
  1498.                     '存货科目
  1499.                     Xtcdcs = ""
  1500.                     Xtcdcsfz = ""
  1501.                     Call MaccCode(Trim(Rectemp.Fields("whcode")), Trim(Rectemp.Fields("mnumber")), Trim(Rectemp.Fields("invsortcode")))
  1502.                     .Fields("mateacct") = Xtcdcs
  1503.                     If Trim(Rectemp.Fields("pricemode")) = "计划价法" And Qmclcy Then
  1504.                         .Fields("diffacct") = Xtcdcsfz
  1505.                     End If
  1506.                     
  1507.                     '对方科目
  1508.                     Xtfhcs = ""
  1509.                     Call DfaccCode(Trim(Rectemp.Fields("inoutclasscode") & ""), Trim(Rectemp.Fields("deptcode") & ""), Trim(Rectemp.Fields("invsortcode")), Trim(Rectemp.Fields("mnumber")))
  1510.                     .Fields("dfacct") = Xtfhcs
  1511.                     
  1512.                     .Fields("inquan") = 0 - Rectemp.Fields("factreceiptquan")
  1513.                     Select Case Trim(Rectemp.Fields("pricemode"))
  1514.                         Case "计划价法"
  1515.                             If Qmclcy Then
  1516.                                 .Fields("inprice") = Rectemp.Fields("planprice")
  1517.                                 .Fields("inmoney") = 0 - Rectemp.Fields("planmoney")
  1518.                                 If Rectemp.Fields("emoney") - Rectemp.Fields("planmoney") > 0 Then
  1519.                                     .Fields("dfdiff") = Rectemp.Fields("emoney") - Rectemp.Fields("planmoney")
  1520.                                 Else
  1521.                                     .Fields("jfdiff") = Rectemp.Fields("planmoney") - Rectemp.Fields("emoney")
  1522.                                 End If
  1523.                             Else
  1524.                                 .Fields("inprice") = Rectemp.Fields("price")
  1525.                                 .Fields("inmoney") = 0 - Rectemp.Fields("emoney")
  1526.                             End If
  1527.                         Case "全月平均法" ', "移动平均法", "先进先出法", "后进先出法"
  1528.                             .Fields("inprice") = Rectemp.Fields("price")
  1529.                             .Fields("inmoney") = 0 - Rectemp.Fields("emoney")
  1530.                     End Select
  1531.                     .UpdateBatch
  1532.                 
  1533.                      '修改期初单据中的记帐人
  1534.                     Cw_DataEnvi.DataConnect.Execute ("update Gy_InoutMain set chalkitupman ='" & Xtczy & "'" & _
  1535.                                 " where Inoutmainid='" & Rectemp.Fields("Inoutmainid") & "'")
  1536.                
  1537.                 End If
  1538.                 Rectemp.MoveNext
  1539.             Loop
  1540.         End With
  1541.     End If
  1542.     
  1543.     '调整总帐
  1544.     If RecTempZz.State = 1 Then RecTempZz.Close
  1545.     RecTempZz.Open "select * from chhs_mate ", Cw_DataEnvi.DataConnect, adOpenDynamic, adLockBatchOptimistic
  1546.     With RecTempZz
  1547.     
  1548.         '期初单据包括蓝字暂估单
  1549.         SqlStr = "SELECT WhCode, MNumber,SUM(InQuan) AS SumInQuan,SUM(InMoney) AS SumInMoney, " & _
  1550.                 " SUM(JfDiff) AS SumJfDiff, SUM(DfDiff) AS SumDfDiff From Chhs_List a " & _
  1551.                 " Where KjYear = " & Xtyear & " And Period = " & StartMon & _
  1552.                 " and a.startflag=1 and " & Start_BillChalkitupCond.WhCode & _
  1553.                 " GROUP BY WhCode, MNumber ORDER BY WhCode, MNumber "
  1554.         
  1555.         Set Rectemp = Cw_DataEnvi.DataConnect.Execute(SqlStr)
  1556.         Do While Not Rectemp.EOF
  1557.             
  1558.             '删除总帐中原有记录
  1559.             Cw_DataEnvi.DataConnect.Execute ("Delete Chhs_Mate where whcode='" & Trim(Rectemp.Fields("whcode")) & "' and mnumber='" & Trim(Rectemp.Fields("mnumber")) & "'")
  1560.             
  1561.             .AddNew
  1562.             .Fields("whcode") = Trim(Rectemp.Fields("whcode"))
  1563.             .Fields("mnumber") = Trim(Rectemp.Fields("mnumber"))
  1564.             .Fields("kjyear") = Xtyear
  1565.             .Fields("period") = StartMon
  1566.             .Fields("startquan") = Rectemp.Fields("suminquan")
  1567.             .Fields("startmoney") = Rectemp.Fields("suminmoney")
  1568.             If .Fields("startquan") <> 0 Then
  1569.                 .Fields("startprice") = .Fields("startmoney") / .Fields("startquan")
  1570.             End If
  1571.             .Fields("startdiff") = Rectemp.Fields("sumjfdiff") - Rectemp.Fields("sumdfdiff")
  1572.             .UpdateBatch
  1573.             Rectemp.MoveNext
  1574.         Loop
  1575.         
  1576.         '红字回冲单
  1577.         SqlStr = "SELECT WhCode, MNumber,SUM(InQuan) AS SumInQuan,SUM(InMoney) AS SumInMoney, " & _
  1578.                 " SUM(JfDiff) AS SumJfDiff, SUM(DfDiff) AS SumDfDiff From Chhs_List a " & _
  1579.                 " Where KjYear = " & Xtyear & " And Period = " & StartMon & _
  1580.                 " and a.startflag=0 and " & Start_BillChalkitupCond.WhCode & _
  1581.                 " GROUP BY WhCode, MNumber ORDER BY WhCode, MNumber "
  1582.         
  1583.         Set Rectemp = Cw_DataEnvi.DataConnect.Execute(SqlStr)
  1584.         Do While Not Rectemp.EOF
  1585.             
  1586.             '查找仓库+存货是否存在: 存在修改 不存在添加
  1587.             SqlStr = "select * from chhs_mate where KjYear = " & Xtyear & " And Period = " & StartMon & " and whcode='" & Trim(Rectemp.Fields("whcode")) & "' and mnumber='" & Trim(Rectemp.Fields("mnumber")) & "'"
  1588.             If RecTempFz.State = 1 Then RecTempFz.Close
  1589.             RecTempFz.Open SqlStr, Cw_DataEnvi.DataConnect, adOpenDynamic, adLockBatchOptimistic
  1590.             If Not RecTempFz.EOF Then
  1591.                 RecTempFz.Fields("inquan") = Rectemp.Fields("suminquan")
  1592.                 RecTempFz.Fields("inmoney") = Rectemp.Fields("suminmoney")
  1593.                 If RecTempFz.Fields("inquan") <> 0 Then
  1594.                     RecTempFz.Fields("inprice") = RecTempFz.Fields("inmoney") / RecTempFz.Fields("inquan")
  1595.                 End If
  1596.                 RecTempFz.Fields("jfdiff") = Rectemp.Fields("sumjfdiff")
  1597.                 RecTempFz.Fields("dfdiff") = Rectemp.Fields("sumdfdiff")
  1598.                 RecTempFz.UpdateBatch
  1599.             End If
  1600.         
  1601.             Rectemp.MoveNext
  1602.         Loop
  1603.     End With
  1604.     
  1605.     Cw_DataEnvi.DataConnect.CommitTrans
  1606.     
  1607.     Call Sub_Query(1)
  1608.     
  1609.     Xt_Wait.Hide
  1610.     Tsxx = "期初记帐成功!"
  1611.     Call Xtxxts(Tsxx, 0, 4)
  1612.     Exit Sub
  1613. Cwcl:
  1614.     Xt_Wait.Hide
  1615.     Cw_DataEnvi.DataConnect.RollbackTrans
  1616.     Tsxx = "期初记帐失败!"
  1617.     Call Xtxxts(Tsxx, 0, 1)
  1618.     Exit Sub
  1619.     
  1620. End Sub
  1621. Private Sub Sub_Hfjz()               '恢复记帐
  1622. Dim Rectemp As Recordset
  1623. Dim Str_Query As String
  1624.     
  1625.     If CxbbGrid.Rows = CxbbGrid.FixedRows Then Exit Sub
  1626.     
  1627.     '日常单据已记帐期初单据不能记帐
  1628.     SqlStr = "select distinct chalkitupman from Chhs_List a " & _
  1629.             Trim(Str_QueryCondi) & " and StartFlag=0  and billcode<>'1305' "
  1630.     Set Rectemp = Cw_DataEnvi.DataConnect.Execute(SqlStr)
  1631.     If Not Rectemp.EOF Then
  1632.         Tsxx = "日常单据已记帐,期初单据不允许恢复记帐!"
  1633.         Call Xtxxts(Tsxx, 0, 1)
  1634.         Exit Sub
  1635.     End If
  1636.    
  1637.     On Error GoTo Cwcl
  1638.     
  1639.     Xt_Wait.Show
  1640.     Xt_Wait.Refresh
  1641.     
  1642.     Cw_DataEnvi.DataConnect.BeginTrans
  1643.         
  1644.     '删除明细帐内容
  1645.     SqlStr = "SELECT * FROM Chhs_list a " & Trim(Str_QueryCondi)
  1646.     Set Rectemp = Cw_DataEnvi.DataConnect.Execute(SqlStr)
  1647.     Do While Not Rectemp.EOF
  1648.         If Trim(Rectemp.Fields("billcode")) = "1308" Then
  1649.             
  1650.             '修改期初单据的记帐人
  1651.             Cw_DataEnvi.DataConnect.Execute ("update chhs_startinputmain set chalkitupman='' where startinputmainid='" & Trim(Rectemp.Fields("inoutmainid")) & "'")
  1652.             
  1653.         Else
  1654.             '修改期初暂估单的记帐人
  1655.             Cw_DataEnvi.DataConnect.Execute ("update Gy_InoutMain set chalkitupman='' where inoutmainid='" & Trim(Rectemp.Fields("inoutmainid")) & "'")
  1656.             
  1657.         End If
  1658.             
  1659.         '删除明细帐内容
  1660.         Cw_DataEnvi.DataConnect.Execute ("delete chhs_list where listid=" & Rectemp.Fields("listid"))
  1661.         
  1662.         Rectemp.MoveNext
  1663.     Loop
  1664.     
  1665.     '删除总帐内容
  1666.     Str_Query = Replace(Trim(Start_BillChalkitupCond.WhCode), "a.", "", 1, , vbTextCompare)
  1667.     SqlStr = "delete chhs_mate where " & Str_Query & " and   kjyear =" & Xtyear & " and period =" & StartMon
  1668.     Cw_DataEnvi.DataConnect.Execute (SqlStr)
  1669.     
  1670.     '删除辅助帐
  1671.     SqlStr = "delete Chhs_AssiPrice where " & Str_Query
  1672.     Cw_DataEnvi.DataConnect.Execute (SqlStr)
  1673.     
  1674.     Cw_DataEnvi.DataConnect.CommitTrans
  1675.     
  1676.     Call Sub_Query(1)
  1677.     
  1678.     Xt_Wait.Hide
  1679.     Tsxx = "恢复记帐成功!"
  1680.     Call Xtxxts(Tsxx, 0, 4)
  1681.     Exit Sub
  1682.     
  1683. Cwcl:
  1684.     Xt_Wait.Hide
  1685.     Cw_DataEnvi.DataConnect.RollbackTrans
  1686.     Tsxx = "恢复记帐失败!"
  1687.     Call Xtxxts(Tsxx, 0, 1)
  1688.     Exit Sub
  1689. End Sub
  1690. Private Sub bbyl(bbylte As Boolean)                    '报表打印预览
  1691.     
  1692.     Dim Bbzbt$, Bbxbt() As String, bbxbtzzxs() As Integer, Bbxbtgs As Integer
  1693.     Dim Bbbwh() As String, Bbbwhzzxs() As Integer, Bbbwhgs As Integer
  1694.     Bbxbtgs = 1                                          '报 表 小 标 题 行 数
  1695.     Bbbwhgs = 0                                          '报 表 表 尾 行 数
  1696.     ReDim Bbxbt(1 To Bbxbtgs)
  1697.     ReDim bbxbtzzxs(1 To Bbxbtgs)
  1698.     If Bbbwhgs <> 0 Then
  1699.         ReDim Bbbwh(1 To Bbbwhgs)
  1700.         ReDim Bbbwhzzxs(1 To Bbbwhgs)
  1701.     End If
  1702.     Bbzbt = ReportTitle
  1703.     Bbxbt(1) = ""
  1704.     bbxbtzzxs(1) = 0                                     '报表行组织形式(0-居左 1-居中 2-居右)
  1705.     Call Scyxsjb(CxbbGrid)                               '生成报表数据
  1706.     Call Scdybb(Dyymctbl, Bbzbt, Bbxbt(), bbxbtzzxs(), Bbxbtgs, Bbbwh(), Bbbwhzzxs(), Bbbwhgs, bbylte)
  1707.     If Not bbylte Then
  1708.         Unload DY_Tybbyldy
  1709.     End If
  1710. End Sub