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

企业管理

开发平台:

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 ArNote_FrmFpgzCxjg 
  5.    Caption         =   "发票过帐"
  6.    ClientHeight    =   8595
  7.    ClientLeft      =   315
  8.    ClientTop       =   390
  9.    ClientWidth     =   11820
  10.    HelpContextID   =   20301
  11.    Icon            =   "应收单据_发票过帐查询结果.frx":0000
  12.    KeyPreview      =   -1  'True
  13.    LinkTopic       =   "Form1"
  14.    MDIChild        =   -1  'True
  15.    ScaleHeight     =   8595
  16.    ScaleWidth      =   11820
  17.    WindowState     =   2  'Maximized
  18.    Begin MSComctlLib.Toolbar GsToolbar 
  19.       Height          =   525
  20.       Left            =   9330
  21.       TabIndex        =   3
  22.       Top             =   30
  23.       Width           =   2475
  24.       _ExtentX        =   4366
  25.       _ExtentY        =   926
  26.       ButtonWidth     =   1455
  27.       ButtonHeight    =   926
  28.       Appearance      =   1
  29.       Style           =   1
  30.       ImageList       =   "ImageList2"
  31.       _Version        =   393216
  32.       BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  33.          NumButtons      =   3
  34.          BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  35.             Caption         =   "保存格式"
  36.             Key             =   "bcgs"
  37.             ImageKey        =   "bcgs"
  38.          EndProperty
  39.          BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  40.             Caption         =   "默认列宽"
  41.             Key             =   "hfmrgs"
  42.             ImageKey        =   "mrlk"
  43.          EndProperty
  44.          BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  45.             Caption         =   "显示项目"
  46.             Key             =   "szxsxm"
  47.             ImageKey        =   "xsxm"
  48.          EndProperty
  49.       EndProperty
  50.    End
  51.    Begin VB.PictureBox Pic_Title 
  52.       BackColor       =   &H00FFFFFF&
  53.       Height          =   780
  54.       Left            =   0
  55.       Picture         =   "应收单据_发票过帐查询结果.frx":1042
  56.       ScaleHeight     =   720
  57.       ScaleWidth      =   11715
  58.       TabIndex        =   2
  59.       Top             =   570
  60.       Width           =   11775
  61.       Begin VB.Label tsLabel 
  62.          BackColor       =   &H80000018&
  63.          BackStyle       =   0  'Transparent
  64.          Caption         =   "销售发票过帐"
  65.          BeginProperty Font 
  66.             Name            =   "宋体"
  67.             Size            =   12
  68.             Charset         =   134
  69.             Weight          =   700
  70.             Underline       =   0   'False
  71.             Italic          =   0   'False
  72.             Strikethrough   =   0   'False
  73.          EndProperty
  74.          ForeColor       =   &H00000000&
  75.          Height          =   360
  76.          Index           =   4
  77.          Left            =   510
  78.          TabIndex        =   4
  79.          Top             =   210
  80.          Width           =   1605
  81.       End
  82.    End
  83.    Begin VB.Timer Timer1 
  84.       Enabled         =   0   'False
  85.       Interval        =   1
  86.       Left            =   8190
  87.       Top             =   90
  88.    End
  89.    Begin VSFlex8Ctl.VSFlexGrid CxbbGrid 
  90.       Height          =   7260
  91.       Left            =   30
  92.       TabIndex        =   0
  93.       Top             =   1380
  94.       Width           =   11775
  95.       _cx             =   5080
  96.       _cy             =   5080
  97.       Appearance      =   1
  98.       BorderStyle     =   1
  99.       Enabled         =   -1  'True
  100.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  101.          Name            =   "宋体"
  102.          Size            =   9
  103.          Charset         =   134
  104.          Weight          =   400
  105.          Underline       =   0   'False
  106.          Italic          =   0   'False
  107.          Strikethrough   =   0   'False
  108.       EndProperty
  109.       MousePointer    =   0
  110.       BackColor       =   16777215
  111.       ForeColor       =   -2147483640
  112.       BackColorFixed  =   13826538
  113.       ForeColorFixed  =   -2147483630
  114.       BackColorSel    =   -2147483635
  115.       ForeColorSel    =   -2147483634
  116.       BackColorBkg    =   -2147483636
  117.       BackColorAlternate=   16777215
  118.       GridColor       =   -2147483633
  119.       GridColorFixed  =   -2147483632
  120.       TreeColor       =   -2147483632
  121.       FloodColor      =   192
  122.       SheetBorder     =   -2147483642
  123.       FocusRect       =   1
  124.       HighLight       =   1
  125.       AllowSelection  =   -1  'True
  126.       AllowBigSelection=   -1  'True
  127.       AllowUserResizing=   0
  128.       SelectionMode   =   0
  129.       GridLines       =   1
  130.       GridLinesFixed  =   2
  131.       GridLineWidth   =   1
  132.       Rows            =   50
  133.       Cols            =   10
  134.       FixedRows       =   1
  135.       FixedCols       =   1
  136.       RowHeightMin    =   0
  137.       RowHeightMax    =   0
  138.       ColWidthMin     =   0
  139.       ColWidthMax     =   0
  140.       ExtendLastCol   =   0   'False
  141.       FormatString    =   ""
  142.       ScrollTrack     =   0   'False
  143.       ScrollBars      =   3
  144.       ScrollTips      =   0   'False
  145.       MergeCells      =   0
  146.       MergeCompare    =   0
  147.       AutoResize      =   -1  'True
  148.       AutoSizeMode    =   0
  149.       AutoSearch      =   0
  150.       AutoSearchDelay =   2
  151.       MultiTotals     =   -1  'True
  152.       SubtotalPosition=   1
  153.       OutlineBar      =   0
  154.       OutlineCol      =   0
  155.       Ellipsis        =   0
  156.       ExplorerBar     =   0
  157.       PicturesOver    =   0   'False
  158.       FillStyle       =   0
  159.       RightToLeft     =   0   'False
  160.       PictureType     =   0
  161.       TabBehavior     =   0
  162.       OwnerDraw       =   0
  163.       Editable        =   0
  164.       ShowComboButton =   1
  165.       WordWrap        =   0   'False
  166.       TextStyle       =   0
  167.       TextStyleFixed  =   0
  168.       OleDragMode     =   0
  169.       OleDropMode     =   0
  170.       DataMode        =   0
  171.       VirtualData     =   -1  'True
  172.       DataMember      =   ""
  173.       ComboSearch     =   3
  174.       AutoSizeMouse   =   -1  'True
  175.       FrozenRows      =   0
  176.       FrozenCols      =   0
  177.       AllowUserFreezing=   0
  178.       BackColorFrozen =   0
  179.       ForeColorFrozen =   0
  180.       WallPaperAlignment=   9
  181.       AccessibleName  =   ""
  182.       AccessibleDescription=   ""
  183.       AccessibleValue =   ""
  184.       AccessibleRole  =   24
  185.       Begin MSComctlLib.ImageList ImageList2 
  186.          Left            =   0
  187.          Top             =   0
  188.          _ExtentX        =   1005
  189.          _ExtentY        =   1005
  190.          BackColor       =   -2147483643
  191.          ImageWidth      =   16
  192.          ImageHeight     =   16
  193.          MaskColor       =   12632256
  194.          _Version        =   393216
  195.          BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  196.             NumListImages   =   44
  197.             BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  198.                Picture         =   "应收单据_发票过帐查询结果.frx":1DF82
  199.                Key             =   "sz"
  200.             EndProperty
  201.             BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  202.                Picture         =   "应收单据_发票过帐查询结果.frx":1E31C
  203.                Key             =   "dy"
  204.             EndProperty
  205.             BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  206.                Picture         =   "应收单据_发票过帐查询结果.frx":1E6B6
  207.                Key             =   "yl"
  208.             EndProperty
  209.             BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  210.                Picture         =   "应收单据_发票过帐查询结果.frx":1EA50
  211.                Key             =   "xg"
  212.             EndProperty
  213.             BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  214.                Picture         =   "应收单据_发票过帐查询结果.frx":1EDEA
  215.                Key             =   "zh"
  216.             EndProperty
  217.             BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  218.                Picture         =   "应收单据_发票过帐查询结果.frx":1F184
  219.                Key             =   "sh"
  220.             EndProperty
  221.             BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  222.                Picture         =   "应收单据_发票过帐查询结果.frx":1F51E
  223.                Key             =   "bc"
  224.             EndProperty
  225.             BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  226.                Picture         =   "应收单据_发票过帐查询结果.frx":1F8B8
  227.                Key             =   "fq"
  228.             EndProperty
  229.             BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  230.                Picture         =   "应收单据_发票过帐查询结果.frx":1FC52
  231.                Key             =   "bz"
  232.             EndProperty
  233.             BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  234.                Picture         =   "应收单据_发票过帐查询结果.frx":1FFEC
  235.                Key             =   "tc"
  236.             EndProperty
  237.             BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  238.                Picture         =   "应收单据_发票过帐查询结果.frx":20386
  239.                Key             =   "bcgs"
  240.             EndProperty
  241.             BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  242.                Picture         =   "应收单据_发票过帐查询结果.frx":20720
  243.                Key             =   "mrlk"
  244.             EndProperty
  245.             BeginProperty ListImage13 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  246.                Picture         =   "应收单据_发票过帐查询结果.frx":20ABA
  247.                Key             =   "xsxm"
  248.             EndProperty
  249.             BeginProperty ListImage14 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  250.                Picture         =   "应收单据_发票过帐查询结果.frx":20E54
  251.                Key             =   "first"
  252.             EndProperty
  253.             BeginProperty ListImage15 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  254.                Picture         =   "应收单据_发票过帐查询结果.frx":211EE
  255.                Key             =   "prev"
  256.             EndProperty
  257.             BeginProperty ListImage16 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  258.                Picture         =   "应收单据_发票过帐查询结果.frx":21588
  259.                Key             =   "next"
  260.             EndProperty
  261.             BeginProperty ListImage17 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  262.                Picture         =   "应收单据_发票过帐查询结果.frx":21922
  263.                Key             =   "last"
  264.             EndProperty
  265.             BeginProperty ListImage18 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  266.                Picture         =   "应收单据_发票过帐查询结果.frx":21CBC
  267.                Key             =   "xx"
  268.             EndProperty
  269.             BeginProperty ListImage19 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  270.                Picture         =   "应收单据_发票过帐查询结果.frx":22056
  271.                Key             =   "define"
  272.             EndProperty
  273.             BeginProperty ListImage20 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  274.                Picture         =   "应收单据_发票过帐查询结果.frx":223F0
  275.                Key             =   "exec"
  276.             EndProperty
  277.             BeginProperty ListImage21 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  278.                Picture         =   "应收单据_发票过帐查询结果.frx":2278A
  279.                Key             =   "xz"
  280.             EndProperty
  281.             BeginProperty ListImage22 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  282.                Picture         =   "应收单据_发票过帐查询结果.frx":22B24
  283.                Key             =   "sc"
  284.             EndProperty
  285.             BeginProperty ListImage23 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  286.                Picture         =   "应收单据_发票过帐查询结果.frx":22EBE
  287.                Key             =   "sx"
  288.             EndProperty
  289.             BeginProperty ListImage24 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  290.                Picture         =   "应收单据_发票过帐查询结果.frx":23258
  291.                Key             =   "cx"
  292.             EndProperty
  293.             BeginProperty ListImage25 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  294.                Picture         =   "应收单据_发票过帐查询结果.frx":235F2
  295.                Key             =   "zd"
  296.             EndProperty
  297.             BeginProperty ListImage26 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  298.                Picture         =   "应收单据_发票过帐查询结果.frx":2398C
  299.                Key             =   "dz"
  300.             EndProperty
  301.             BeginProperty ListImage27 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  302.                Picture         =   "应收单据_发票过帐查询结果.frx":23D26
  303.                Key             =   "ph"
  304.             EndProperty
  305.             BeginProperty ListImage28 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  306.                Picture         =   "应收单据_发票过帐查询结果.frx":240C0
  307.                Key             =   "fz"
  308.             EndProperty
  309.             BeginProperty ListImage29 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  310.                Picture         =   "应收单据_发票过帐查询结果.frx":2445A
  311.                Key             =   "dw"
  312.             EndProperty
  313.             BeginProperty ListImage30 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  314.                Picture         =   "应收单据_发票过帐查询结果.frx":247F4
  315.                Key             =   "hf"
  316.             EndProperty
  317.             BeginProperty ListImage31 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  318.                Picture         =   "应收单据_发票过帐查询结果.frx":24B8E
  319.                Key             =   "pz"
  320.             EndProperty
  321.             BeginProperty ListImage32 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  322.                Picture         =   "应收单据_发票过帐查询结果.frx":24F28
  323.                Key             =   "check"
  324.             EndProperty
  325.             BeginProperty ListImage33 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  326.                Picture         =   "应收单据_发票过帐查询结果.frx":252C2
  327.                Key             =   "qs"
  328.             EndProperty
  329.             BeginProperty ListImage34 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  330.                Picture         =   "应收单据_发票过帐查询结果.frx":2565C
  331.                Key             =   "fullcheck"
  332.             EndProperty
  333.             BeginProperty ListImage35 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  334.                Picture         =   "应收单据_发票过帐查询结果.frx":259F6
  335.                Key             =   "qq"
  336.             EndProperty
  337.             BeginProperty ListImage36 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  338.                Picture         =   "应收单据_发票过帐查询结果.frx":25D90
  339.                Key             =   "bcw"
  340.             EndProperty
  341.             BeginProperty ListImage37 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  342.                Picture         =   "应收单据_发票过帐查询结果.frx":2612A
  343.                Key             =   "ye"
  344.             EndProperty
  345.             BeginProperty ListImage38 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  346.                Picture         =   "应收单据_发票过帐查询结果.frx":264C4
  347.                Key             =   ""
  348.             EndProperty
  349.             BeginProperty ListImage39 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  350.                Picture         =   "应收单据_发票过帐查询结果.frx":2685E
  351.                Key             =   "frist"
  352.             EndProperty
  353.             BeginProperty ListImage40 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  354.                Picture         =   "应收单据_发票过帐查询结果.frx":26BF8
  355.                Key             =   "dj"
  356.             EndProperty
  357.             BeginProperty ListImage41 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  358.                Picture         =   "应收单据_发票过帐查询结果.frx":26F92
  359.                Key             =   "xj"
  360.             EndProperty
  361.             BeginProperty ListImage42 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  362.                Picture         =   "应收单据_发票过帐查询结果.frx":2732C
  363.                Key             =   "qx"
  364.             EndProperty
  365.             BeginProperty ListImage43 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  366.                Picture         =   "应收单据_发票过帐查询结果.frx":276C6
  367.                Key             =   "qx1"
  368.             EndProperty
  369.             BeginProperty ListImage44 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  370.                Picture         =   "应收单据_发票过帐查询结果.frx":27A60
  371.                Key             =   "gz"
  372.             EndProperty
  373.          EndProperty
  374.       End
  375.    End
  376.    Begin MSComctlLib.Toolbar SzToolbar 
  377.       Align           =   1  'Align Top
  378.       Height          =   555
  379.       Left            =   0
  380.       TabIndex        =   1
  381.       Top             =   0
  382.       Width           =   11820
  383.       _ExtentX        =   20849
  384.       _ExtentY        =   979
  385.       ButtonWidth     =   820
  386.       ButtonHeight    =   926
  387.       AllowCustomize  =   0   'False
  388.       Appearance      =   1
  389.       Style           =   1
  390.       ImageList       =   "ImageList2"
  391.       _Version        =   393216
  392.       BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  393.          NumButtons      =   14
  394.          BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  395.             Caption         =   "设置"
  396.             Key             =   "ymsz"
  397.             ImageKey        =   "sz"
  398.          EndProperty
  399.          BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  400.             Caption         =   "打印"
  401.             Key             =   "dy"
  402.             ImageKey        =   "dy"
  403.          EndProperty
  404.          BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  405.             Caption         =   "预览"
  406.             Key             =   "yl"
  407.             ImageKey        =   "yl"
  408.          EndProperty
  409.          BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  410.             ImageKey        =   "dj"
  411.             Style           =   3
  412.          EndProperty
  413.          BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  414.             Caption         =   "单据"
  415.             Key             =   "dj"
  416.             ImageKey        =   "pz"
  417.          EndProperty
  418.          BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  419.             Caption         =   "查询"
  420.             Key             =   "cx"
  421.             ImageKey        =   "cx"
  422.          EndProperty
  423.          BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  424.             Style           =   3
  425.          EndProperty
  426.          BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  427.             Caption         =   "全选"
  428.             Key             =   "qbxz"
  429.             ImageKey        =   "qx1"
  430.          EndProperty
  431.          BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  432.             Caption         =   "全消"
  433.             Key             =   "qbqx"
  434.             ImageKey        =   "qx"
  435.          EndProperty
  436.          BeginProperty Button10 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  437.             Style           =   3
  438.          EndProperty
  439.          BeginProperty Button11 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  440.             Caption         =   "过帐"
  441.             Key             =   "jz"
  442.             ImageKey        =   "gz"
  443.          EndProperty
  444.          BeginProperty Button12 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  445.             Style           =   3
  446.          EndProperty
  447.          BeginProperty Button13 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  448.             Caption         =   "帮助"
  449.             Key             =   "bz"
  450.             ImageKey        =   "bz"
  451.          EndProperty
  452.          BeginProperty Button14 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  453.             Caption         =   "退出"
  454.             Key             =   "fh"
  455.             ImageKey        =   "tc"
  456.          EndProperty
  457.       EndProperty
  458.       BorderStyle     =   1
  459.    End
  460. End
  461. Attribute VB_Name = "ArNote_FrmFpgzCxjg"
  462. Attribute VB_GlobalNameSpace = False
  463. Attribute VB_Creatable = False
  464. Attribute VB_PredeclaredId = True
  465. Attribute VB_Exposed = False
  466. '*******************************************************************************
  467. '*    模 块 名 称 :发票过帐
  468. '*    功 能 描 述 :将销售已审核但未过帐赊销发票进行形成应收明细帐操作。因为
  469. '*                 发票有跨会计期间过帐情况 , 所以过帐业务日期必须处于当前会
  470. '*                 计期间且应序时.
  471. '*    程序员姓名  :张建忠
  472. '*    最后修改人  :张建忠
  473. '*    最后修改时间:2001/12/24
  474. '*    备        注:程序中所有依实际情况自定义部分均用[>>  <<]括起
  475. '*******************************************************************************
  476. Dim ReportTitle As String                '报表主标题
  477. Dim Str_QueryCondi As String             '用户录入查询条件
  478. '以下为固定使用变量
  479. Dim Dyymctbl As New DY_Dyymsz            '打印页面窗体变量
  480. Dim GridCode As String                   '显示网格网格代码
  481. Dim GridInf() As Variant                 '整个网格设置信息
  482. Dim Tsxx As String                       '系统提示信息
  483. Dim Qslz As Long                         '网格隐藏(非操作显示)列数
  484. Dim Sjhgd As Double                      '网格数据行高度
  485. Dim Sfxshjwg As Boolean                  '是否显示合计网格
  486. Dim GridBoolean() As Boolean             '网格列信息(布尔型)
  487. Dim GridStr()  As String                 '网格列信息(字符型)
  488. Dim GridInt() As Integer                 '网格列信息(整型)
  489. Dim Szzls As Integer                     '数组总列数(网格列数-1)
  490. Private Sub Form_Resize()                '根据窗体大小来调整网格,标题栏大小
  491.     On Error Resume Next
  492.     With CxbbGrid
  493.       .Width = Me.Width - 160
  494.       .Height = Me.Height - .Top - 400
  495.     End With
  496.     With Pic_Title
  497.       .Width = Me.Width - 160
  498.     End With
  499.     
  500.     GsToolbar.Left = Me.Width - GsToolbar.Width - 160
  501. End Sub
  502. Private Sub Form_Load()                                                   '窗体装入
  503.     
  504.   '调入打印页面设置窗体
  505.   
  506.   XtReportCode = "Ar_InvPostAcc"
  507.   Load Dyymctbl
  508.   ReportTitle = "发票过帐列表"
  509.   
  510.  '调整标题栏及网格、格式工具条位置
  511.   Pic_Title.Left = 40
  512.   Pic_Title.Top = SzToolbar.Top + SzToolbar.Height - 10
  513.   CxbbGrid.Left = Pic_Title.Left
  514.   CxbbGrid.Top = Pic_Title.Top + Pic_Title.Height + 20
  515.  
  516.  '调 入 网 格
  517.   GridCode = "Ar_InvPostAcc"
  518.   Call BzWgcsh(CxbbGrid, GridCode, GridInf(), GridBoolean(), GridInt(), GridStr())
  519.   
  520.   Qslz = GridInf(1)
  521.   Sjhgd = GridInf(2)
  522.   Sfxshjwg = GridInf(7)
  523.   Szzls = CxbbGrid.Cols - 1
  524. End Sub
  525. Private Sub Form_Unload(Cancel As Integer)                                  '窗体卸载
  526.     '卸载条件窗体
  527.     ArNote_FrmFpgzcxtj.UnloadCheck.Value = 1
  528.     Unload ArNote_FrmFpgzcxtj
  529.     
  530.     '卸载打印页面设置窗体
  531.     Unload Dyymctbl
  532. End Sub
  533. Private Sub CxbbGrid_BeforeMoveColumn(ByVal Col As Long, Position As Long)           '网格列发生移动时自动交换网格索引信息
  534.     Call FnBln_RefreshArray(Col, Position, GridStr(), GridInf())
  535. End Sub
  536. Private Sub GsToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)       '网格格式调整(Fixed)
  537.     
  538.     Select Case Button.Key
  539.         Case "bcgs"                                          '保存表格格式
  540.             Call Bcwggs(CxbbGrid, GridCode, GridStr())
  541.         Case "hfmrgs"                                        '恢复默认格式
  542.             Call Hfmrgs(CxbbGrid, GridCode, GridStr())
  543.         Case "szxsxm"                                        '设置显示项目
  544.             Call Szxsxm(CxbbGrid, GridCode)
  545.     End Select
  546. End Sub
  547. Private Sub SzToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)
  548.   Select Case Button.Key
  549.       Case "ymsz"                                          '页面设置
  550.           Dyymctbl.Show 1
  551.       Case "yl"                                            '预 览
  552.          Call bbyl(True)
  553.       Case "dy"                                            '打 印
  554.         Call bbyl(False)
  555.       Case "qbxz"                                          '全 选
  556.         Call Sub_SelectAll
  557.       Case "qbqx"                                          '全 消
  558.         Call Sub_AbandonAll
  559.       Case "dj"                                            '单 据
  560.           Call Sub_DisplayBill
  561.       Case "jz"                                            '过 帐
  562.         Call Sub_Sxfpgz
  563.       Case "cx"                                            '查询
  564.         ArNote_FrmFpgzcxtj.Show
  565.       Case "bz"                                            '帮 助
  566.         Call F1bz
  567.       Case "fh"                                            '退 出
  568.        Unload Me
  569.    End Select
  570. End Sub
  571. '根据单据编号显示单据信息
  572. Private Sub Sub_DisplayBill()                        '用户单击单据后显示相应单据(销售发票)
  573.     Dim RecTemp As New ADODB.Recordset               '临时使用动态集
  574.     '记录行总数与固定行数相等则退出
  575.     If CxbbGrid.Rows = CxbbGrid.FixedRows Then Exit Sub
  576.     
  577.     '非数据行或者单据号为空退出
  578.     If CxbbGrid.Row < CxbbGrid.FixedRows Or Val(CxbbGrid.TextMatrix(CxbbGrid.Row, 0)) = 0 Then
  579.         Exit Sub
  580.     End If
  581.     
  582.     Select Case Trim(CxbbGrid.TextMatrix(CxbbGrid.Row, Sydz("003", GridStr(), Szzls)))
  583.         
  584.                
  585.         Case "普通发票"
  586.             
  587.             Sqlstr = "SELECT InvoiceBillMainID,returnflag From Xs_InvoiceBillMain Where InvoiceBillMainID='" & CxbbGrid.TextMatrix(CxbbGrid.Row, 0) & "'"
  588.             Set RecTemp = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  589.             With RecTemp
  590.                 If .EOF Then
  591.                     Tsxx = "此发票已被其他用户删除!"
  592.                     Call Xtxxts(Tsxx, 0, 4)
  593.                     Exit Sub
  594.                 Else
  595.                     XT_BillID = Val(RecTemp.Fields!InvoiceBillMainID)       '填充查询单据标识
  596.                     Xtcdcs = "3"                                            '设置单据处理为列表查询(修改)状态
  597.                     '调入单据处理窗体
  598.                     If Trim(.Fields("returnflag")) Then
  599.                         Xtcdcsfz = Str_QueryCondi & " and returnflag = 1"
  600.                         Xs_I_RedInvoice.Show 1
  601.                     Else
  602.                         Xtcdcsfz = Str_QueryCondi & " and returnflag = 0"
  603.                         Xs_I_InvoiceBill.Show 1
  604.                     End If
  605.                 End If
  606.             End With
  607.         
  608.         Case "专用发票"
  609.             
  610.             Sqlstr = "SELECT InvoiceBillMainID,returnflag From Xs_InvoiceBillMain Where InvoiceBillMainID='" & CxbbGrid.TextMatrix(CxbbGrid.Row, 0) & "'"
  611.             Set RecTemp = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  612.             With RecTemp
  613.                 If .EOF Then
  614.                     Tsxx = "此发票已被其他用户删除!"
  615.                     Call Xtxxts(Tsxx, 0, 4)
  616.                     Exit Sub
  617.                 Else
  618.                     XT_BillID = Val(RecTemp.Fields!InvoiceBillMainID)       '填充查询单据标识
  619.                     Xtcdcs = "3"                                            '设置单据处理为列表查询(修改)状态
  620.                     '调入单据处理窗体
  621.                     If Trim(.Fields("returnflag")) Then
  622.                         Xtcdcsfz = Str_QueryCondi & " and returnflag = 1"
  623.                         Xs_I_UseRedInvoice.Show 1
  624.                     Else
  625.                         Xtcdcsfz = Str_QueryCondi & " and returnflag = 0"
  626.                         Xs_I_UseInvoice.Show 1
  627.                     End If
  628.                 End If
  629.             End With
  630.     End Select
  631.     
  632. End Sub
  633.     
  634. Private Sub Timer1_Timer()                                 '在窗体激活后调入查询程序
  635.     
  636.     Timer1.Enabled = False
  637.     Xt_Wait.Show
  638.     Xt_Wait.Refresh
  639.    
  640.     '加快显示速度
  641.     CxbbGrid.Redraw = False
  642.  
  643.     '生成查询结果
  644.     Call Sub_Query(0)
  645.    
  646.     CxbbGrid.Redraw = True
  647.     
  648.     Xt_Wait.Hide
  649. End Sub
  650. Private Sub Sub_Query(Int_QueryType As Integer)                                     '生成查询结果(Define)
  651.     '过程参数:Int_QueryType 0-"点确定按钮"查询  1-"刷新"查询
  652.     
  653.     Dim Rec_Query As New ADODB.Recordset        '查询结果动态集
  654.     Dim Coljsq As Long                          '网格列计数器
  655.     Dim jsqte As Long                           '临时动态计数器
  656.     
  657.     '以下为自定义部分[
  658.     
  659.     If Int_QueryType = 0 Then   '0-"点确定按钮"查询
  660.     
  661.         With ArNote_FrmFpgzcxtj
  662.             
  663.             '生成查询条件
  664.             Str_QueryCondi = " Where 1=1 "
  665.             
  666.             For jsqte = 1 To 3
  667.                 Select Case jsqte
  668.                     Case 1  '查询日期范围(起始)
  669.                         If Trim(.LrText(0).Text) <> "" Then
  670.                             Str_QueryCondi = Str_QueryCondi & " And a.InvoiceDate>=' " & Trim(.LrText(0).Text) & "'"
  671.                         End If
  672.                     Case 2  '查询日期范围(终止)
  673.                         If Trim(.LrText(1).Text) <> "" Then
  674.                             Str_QueryCondi = Str_QueryCondi & " And a.InvoiceDate<= ' " & Trim(.LrText(1).Text) & "'"
  675.                         End If
  676.                     Case 3  '客户
  677.                         If Trim(.LrText(2).Text) <> "" Then
  678.                             Str_QueryCondi = Str_QueryCondi & " and a.CusCode = '" & Trim(.LrText(2).Tag) & "'"
  679.                         End If
  680.                 End Select
  681.             Next jsqte
  682.          End With
  683.     Else
  684.          '1-"刷新"查询
  685.         If Str_QueryCondi = "" Then
  686.             Str_QueryCondi = " where 1=2 "
  687.         End If
  688.     End If
  689.         
  690.     Sqlstr = "SELECT a.*,Gy_Person.PersonName,Gy_Customer.CusName,Gy_ForeignCurrency.ForeignCurrName" & _
  691.              " FROM XS_InvoiceBillMain a LEFT OUTER JOIN " & _
  692.              " Gy_Customer ON a.CusCode = Gy_Customer.CusCode LEFT OUTER JOIN " & _
  693.              " Gy_Person ON a.PersonCode = Gy_Person.PersonCode LEFT OUTER JOIN " & _
  694.              " Gy_ForeignCurrency ON a.ForeignCurrCode = Gy_ForeignCurrency.ForeignCurrCode " & Str_QueryCondi & " And InvoiceFlag=1 And ArBookFlag=0 And Checker<>'' And InvalideMaker=''  Order By InvoiceDate,InvoiceCode"
  695.     
  696.     Set Rec_Query = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  697.     With Rec_Query
  698.         CxbbGrid.Rows = CxbbGrid.FixedRows
  699.         jsqte = CxbbGrid.FixedRows
  700.         Do While Not .EOF
  701.             CxbbGrid.AddItem ""
  702.             
  703.             '[>>自定义填充内容
  704.             CxbbGrid.TextMatrix(jsqte, 0) = .Fields("InvoiceBillMainID")                                             '发票主表ID
  705.             CxbbGrid.TextMatrix(jsqte, Sydz("001", GridStr(), Szzls)) = False                                        '选中
  706.             CxbbGrid.TextMatrix(jsqte, Sydz("002", GridStr(), Szzls)) = Format(.Fields("InvoiceDate"), "yyyy-mm-dd") '单据日期
  707.             If Trim(.Fields("InvoiceType") & "") = "0" Then
  708.                 CxbbGrid.TextMatrix(jsqte, Sydz("003", GridStr(), Szzls)) = "普通发票"                               '普通发票
  709.             Else
  710.                 CxbbGrid.TextMatrix(jsqte, Sydz("003", GridStr(), Szzls)) = "专用发票"                               '专用发票
  711.             End If
  712.             CxbbGrid.TextMatrix(jsqte, Sydz("004", GridStr(), Szzls)) = Trim(.Fields("InvoiceCode") & "")            '发票号
  713.             CxbbGrid.TextMatrix(jsqte, Sydz("005", GridStr(), Szzls)) = Trim(.Fields("CusName") & "")                '客户
  714.             CxbbGrid.TextMatrix(jsqte, Sydz("006", GridStr(), Szzls)) = Trim(.Fields("ForeignCurrName") & "")        '币别
  715.             If .Fields("NowValueFor") <> 0 Then                                                                      '原币金额
  716.                CxbbGrid.TextMatrix(jsqte, Sydz("007", GridStr(), Szzls)) = .Fields("NowValueFor")
  717.             End If
  718.             If .Fields("NowValue") <> 0 Then                                                                         '本币金额
  719.                CxbbGrid.TextMatrix(jsqte, Sydz("008", GridStr(), Szzls)) = .Fields("NowValue")
  720.             End If
  721.             CxbbGrid.TextMatrix(jsqte, Sydz("009", GridStr(), Szzls)) = Trim(.Fields("PersonName") & "")             '业务员
  722.             CxbbGrid.TextMatrix(jsqte, Sydz("010", GridStr(), Szzls)) = Trim(.Fields("Maker") & "")                  '制单人
  723.             CxbbGrid.TextMatrix(jsqte, Sydz("011", GridStr(), Szzls)) = Trim(.Fields("Checker") & "")                '审核人
  724.             
  725.             
  726.             '设置数据行高度(Fixed)
  727.             CxbbGrid.RowHeight(jsqte) = Sjhgd
  728.             
  729.             '动态集指针加1,同时将计数器加1(Fixed)
  730.             .MoveNext
  731.             jsqte = jsqte + 1
  732.             
  733.         Loop
  734.         
  735.         '<<]
  736.             
  737.             
  738.     End With
  739.     
  740.     ']以上为用户自定义部分
  741.     
  742. End Sub
  743. '====================================以下为单据选中操作======================================'
  744. Private Sub CxbbGrid_DblClick()                         '双击切换
  745.    With CxbbGrid
  746.      If .Row < .FixedRows Then
  747.        Exit Sub
  748.      End If
  749.      If CxbbGrid.TextMatrix(.Row, Sydz("001", GridStr(), Szzls)) Then
  750.         CxbbGrid.TextMatrix(.Row, Sydz("001", GridStr(), Szzls)) = False
  751.      Else
  752.         CxbbGrid.TextMatrix(.Row, Sydz("001", GridStr(), Szzls)) = True
  753.      End If
  754.   End With
  755. End Sub
  756. Private Sub CxbbGrid_KeyPress(KeyAscii As Integer)      '用户按空格表示切换,按回车表示选中
  757.    With CxbbGrid
  758.      If Chr(KeyAscii) = " " Then
  759.         For jsqte = .Row To .RowSel
  760.           If CxbbGrid.TextMatrix(jsqte, Sydz("001", GridStr(), Szzls)) Then
  761.              CxbbGrid.TextMatrix(jsqte, Sydz("001", GridStr(), Szzls)) = False
  762.           Else
  763.              CxbbGrid.TextMatrix(jsqte, Sydz("001", GridStr(), Szzls)) = True
  764.           End If
  765.         Next jsqte
  766.      End If
  767.      
  768.      If KeyAscii = vbKeyReturn Then
  769.         For jsqte = .Row To .RowSel
  770.             CxbbGrid.TextMatrix(jsqte, Sydz("001", GridStr(), Szzls)) = True
  771.         Next jsqte
  772.      End If
  773.      
  774.    End With
  775. End Sub
  776. Private Sub Sub_SelectAll()                             '全选
  777.   With CxbbGrid
  778.     For jsqte = .FixedRows To .Rows - 1
  779.         CxbbGrid.TextMatrix(jsqte, Sydz("001", GridStr(), Szzls)) = True
  780.     Next jsqte
  781.   End With
  782. End Sub
  783. Private Sub Sub_AbandonAll()                            '全消
  784.   With CxbbGrid
  785.     For jsqte = .FixedRows To .Rows - 1
  786.         CxbbGrid.TextMatrix(jsqte, Sydz("001", GridStr(), Szzls)) = False
  787.     Next jsqte
  788.   End With
  789. End Sub
  790. '====================================以上为单据选中操作======================================'
  791. Private Sub Sub_Sxfpgz()                                '赊销发票过帐
  792.   Dim RecTemp As New ADODB.Recordset      '临时使用动态集
  793.   Dim jsqte As Long
  794.   Dim Lng_Fpjsq As Long        '选中发票计数器
  795.   Dim Int_Dqyear As Integer    '用户选择会计年度
  796.   Dim Int_DqPeriod As Integer  '用户选择会计期间
  797.   Dim Lng_BillID As Long       '单据标识
  798.   Dim yhAnswer As Integer      '回答是否确认
  799.   
  800.   '判断用户选中发票张数
  801.   Lng_Fpjsq = 0
  802.   For jsqte = CxbbGrid.FixedRows To CxbbGrid.Rows - 1
  803.     If CxbbGrid.TextMatrix(jsqte, Sydz("001", GridStr(), Szzls)) Then
  804.        Lng_Fpjsq = Lng_Fpjsq + 1
  805.     End If
  806.   Next jsqte
  807.    
  808.   If Lng_Fpjsq = 0 Then
  809.      Tsxx = "请先选中过帐发票!"
  810.      Call Xtxxts(Tsxx, 0, 4)
  811.      Exit Sub
  812.   End If
  813.      
  814.      
  815.   '判断用户所选业务日期与当前会计期间是否一致
  816.   Sqlstr = "Select Top 1 * FROM Gy_Kjrlb Where ArJzbz=0 Order By Kjyear,Period"
  817.   Set RecTemp = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  818.   With RecTemp
  819.     If Not .EOF Then
  820.        If Not (Xtrq >= .Fields("Qsrq") And Xtrq <= .Fields("Zzrq")) Then
  821.           Tsxx = "业务日期应在当前会计期间范围内!"
  822.           Call Xtxxts(Tsxx, 0, 4)
  823.           Exit Sub
  824.        Else
  825.           Int_Dqyear = .Fields("Kjyear")
  826.           Int_DqPeriod = .Fields("Period")
  827.        End If
  828.     Else
  829.        Tsxx = "所有会计期间已结帐完毕!"
  830.        Call Xtxxts(Tsxx, 0, 4)
  831.        Exit Sub
  832.     End If
  833.   End With
  834.   '让用户确认是否过帐选中发票
  835.   
  836.   Tsxx = "请确认是否将选中发票过帐到" & Mid(Trim(Str(10000 + Int_Dqyear)), 2, 4) & "." & Mid(Trim(Str(100 + Int_DqPeriod)), 2, 2) & "会计期间?"
  837.   yhAnswer = Xtxxts(Tsxx, 2, 2)
  838.   If yhAnswer = 2 Then
  839.      Exit Sub
  840.   End If
  841.   
  842.   '销售发票过帐
  843.   For jsqte = CxbbGrid.FixedRows To CxbbGrid.Rows - 1
  844.     If CxbbGrid.TextMatrix(jsqte, Sydz("001", GridStr(), Szzls)) Then
  845.        Lng_BillID = Val(CxbbGrid.TextMatrix(jsqte, 0))
  846.        If Not Fun_AccInvoiceBill(Lng_BillID, Int_Dqyear, Int_DqPeriod) Then
  847.           Exit Sub
  848.        End If
  849.     End If
  850.   Next jsqte
  851.   
  852.   '过帐完毕,刷新网格
  853.   Xt_Wait.Show
  854.   Xt_Wait.Refresh
  855.    
  856.   '加快显示速度
  857.   CxbbGrid.Redraw = False
  858.  
  859.   '生成查询结果
  860.   Call Sub_Query(1)
  861.    
  862.   CxbbGrid.Redraw = True
  863.     
  864.   Xt_Wait.Hide
  865.   
  866.   Tsxx = "销售发票过帐完毕!"
  867.   Call Xtxxts(Tsxx, 0, 4)
  868.   
  869. End Sub
  870. Private Sub bbyl(bbylte As Boolean)                    '报表打印预览
  871.   Dim Bbzbt$, Bbxbt() As String, bbxbtzzxs() As Integer, Bbxbtgs As Integer
  872.   Dim Bbbwh() As String, Bbbwhzzxs() As Integer, Bbbwhgs As Integer
  873.   Bbxbtgs = 1                                          '报 表 小 标 题 行 数
  874.   Bbbwhgs = 0                                          '报 表 表 尾 行 数
  875.   ReDim Bbxbt(1 To Bbxbtgs)
  876.   ReDim bbxbtzzxs(1 To Bbxbtgs)
  877.   If Bbbwhgs <> 0 Then
  878.      ReDim Bbbwh(1 To Bbbwhgs)
  879.      ReDim Bbbwhzzxs(1 To Bbbwhgs)
  880.   End If
  881.   Bbzbt = ReportTitle
  882.   Bbxbt(1) = " "
  883.   bbxbtzzxs(1) = 0                                     '报表行组织形式(0-居左 1-居中 2-居右)
  884.   Call Scyxsjb(CxbbGrid)                               '生成报表数据
  885.   Call Scdybb(Dyymctbl, Bbzbt, Bbxbt(), bbxbtzzxs(), Bbxbtgs, Bbbwh(), Bbbwhzzxs(), Bbbwhgs, bbylte)
  886.   If Not bbylte Then
  887.      Unload DY_Tybbyldy
  888.   End If
  889. End Sub