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

企业管理

开发平台:

Visual Basic

  1. VERSION 5.00
  2. Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX"
  3. Begin VB.Form Cg_InvoiceQuery 
  4.    BorderStyle     =   3  'Fixed Dialog
  5.    Caption         =   "发票查询条件"
  6.    ClientHeight    =   4995
  7.    ClientLeft      =   45
  8.    ClientTop       =   330
  9.    ClientWidth     =   4830
  10.    Icon            =   "采购系统_发票查询条件.frx":0000
  11.    KeyPreview      =   -1  'True
  12.    LinkTopic       =   "Form1"
  13.    MaxButton       =   0   'False
  14.    MinButton       =   0   'False
  15.    ScaleHeight     =   4995
  16.    ScaleWidth      =   4830
  17.    ShowInTaskbar   =   0   'False
  18.    StartUpPosition =   1  '所有者中心
  19.    Begin VB.Timer Timer3 
  20.       Enabled         =   0   'False
  21.       Interval        =   1
  22.       Left            =   3240
  23.       Top             =   1770
  24.    End
  25.    Begin VB.Timer Timer2 
  26.       Enabled         =   0   'False
  27.       Interval        =   1
  28.       Left            =   2610
  29.       Top             =   2460
  30.    End
  31.    Begin VB.Timer Timer1 
  32.       Enabled         =   0   'False
  33.       Interval        =   1
  34.       Left            =   1830
  35.       Top             =   2400
  36.    End
  37.    Begin VB.CheckBox UnloadCheck 
  38.       Caption         =   "卸载窗体"
  39.       Height          =   615
  40.       Left            =   5970
  41.       TabIndex        =   15
  42.       Top             =   1110
  43.       Width           =   825
  44.    End
  45.    Begin VB.CommandButton QdCommand 
  46.       Caption         =   "确定(&O)"
  47.       Height          =   300
  48.       Left            =   2460
  49.       TabIndex        =   12
  50.       Top             =   4590
  51.       Width           =   1120
  52.    End
  53.    Begin VB.CommandButton QxCommand 
  54.       Caption         =   "取消(&C)"
  55.       Height          =   300
  56.       Left            =   3660
  57.       TabIndex        =   14
  58.       Top             =   4590
  59.       Width           =   1120
  60.    End
  61.    Begin VB.CommandButton Cmd_Clear 
  62.       Caption         =   "全清"
  63.       Height          =   300
  64.       Left            =   60
  65.       TabIndex        =   13
  66.       Top             =   4590
  67.       Width           =   1120
  68.    End
  69.    Begin TabDlg.SSTab SSTab1 
  70.       Height          =   4425
  71.       Left            =   60
  72.       TabIndex        =   16
  73.       Top             =   60
  74.       Width           =   4725
  75.       _ExtentX        =   8334
  76.       _ExtentY        =   7805
  77.       _Version        =   393216
  78.       Style           =   1
  79.       Tabs            =   2
  80.       TabsPerRow      =   2
  81.       TabHeight       =   520
  82.       TabCaption(0)   =   "基本条件"
  83.       TabPicture(0)   =   "采购系统_发票查询条件.frx":1042
  84.       Tab(0).ControlEnabled=   -1  'True
  85.       Tab(0).Control(0)=   "Frame1"
  86.       Tab(0).Control(0).Enabled=   0   'False
  87.       Tab(0).ControlCount=   1
  88.       TabCaption(1)   =   "辅助条件"
  89.       TabPicture(1)   =   "采购系统_发票查询条件.frx":105E
  90.       Tab(1).ControlEnabled=   0   'False
  91.       Tab(1).Control(0)=   "Frame5"
  92.       Tab(1).Control(0).Enabled=   0   'False
  93.       Tab(1).ControlCount=   1
  94.       Begin VB.Frame Frame1 
  95.          Height          =   3915
  96.          Left            =   60
  97.          TabIndex        =   24
  98.          Top             =   390
  99.          Width           =   4575
  100.          Begin VB.CommandButton Ydcommand1 
  101.             Height          =   300
  102.             Index           =   7
  103.             Left            =   4155
  104.             Picture         =   "采购系统_发票查询条件.frx":107A
  105.             Style           =   1  'Graphical
  106.             TabIndex        =   25
  107.             Top             =   2100
  108.             Visible         =   0   'False
  109.             Width           =   300
  110.          End
  111.          Begin VB.Frame Frame3 
  112.             Height          =   465
  113.             Left            =   1320
  114.             TabIndex        =   42
  115.             Top             =   2430
  116.             Width           =   3135
  117.             Begin VB.OptionButton Option1 
  118.                Caption         =   "全部"
  119.                Height          =   285
  120.                Index           =   0
  121.                Left            =   150
  122.                TabIndex        =   45
  123.                Top             =   120
  124.                Value           =   -1  'True
  125.                Width           =   735
  126.             End
  127.             Begin VB.OptionButton Option1 
  128.                Caption         =   "蓝字"
  129.                Height          =   285
  130.                Index           =   1
  131.                Left            =   1080
  132.                TabIndex        =   44
  133.                Tag             =   " and  a.InvoiceKind=0 "
  134.                Top             =   120
  135.                Width           =   735
  136.             End
  137.             Begin VB.OptionButton Option1 
  138.                Caption         =   "红字"
  139.                Height          =   285
  140.                Index           =   2
  141.                Left            =   1980
  142.                TabIndex        =   43
  143.                Tag             =   " and  a.InvoiceKind=1"
  144.                Top             =   120
  145.                Width           =   735
  146.             End
  147.          End
  148.          Begin VB.CommandButton Ydcommand1 
  149.             Height          =   300
  150.             Index           =   5
  151.             Left            =   4155
  152.             Picture         =   "采购系统_发票查询条件.frx":1404
  153.             Style           =   1  'Graphical
  154.             TabIndex        =   35
  155.             Top             =   1365
  156.             Visible         =   0   'False
  157.             Width           =   300
  158.          End
  159.          Begin VB.TextBox LrText 
  160.             Height          =   300
  161.             Index           =   5
  162.             Left            =   1320
  163.             TabIndex        =   5
  164.             Text            =   "5"
  165.             Top             =   1365
  166.             Width           =   2835
  167.          End
  168.          Begin VB.CommandButton Ydcommand1 
  169.             Height          =   300
  170.             Index           =   3
  171.             Left            =   4155
  172.             Picture         =   "采购系统_发票查询条件.frx":178E
  173.             Style           =   1  'Graphical
  174.             TabIndex        =   28
  175.             Top             =   630
  176.             Visible         =   0   'False
  177.             Width           =   300
  178.          End
  179.          Begin VB.TextBox LrText 
  180.             Height          =   300
  181.             Index           =   4
  182.             Left            =   1320
  183.             TabIndex        =   4
  184.             Text            =   "4"
  185.             Top             =   1005
  186.             Width           =   3135
  187.          End
  188.          Begin VB.TextBox LrText 
  189.             Height          =   300
  190.             Index           =   3
  191.             Left            =   2970
  192.             TabIndex        =   3
  193.             Text            =   "3"
  194.             Top             =   630
  195.             Width           =   1185
  196.          End
  197.          Begin VB.TextBox LrText 
  198.             Height          =   300
  199.             Index           =   1
  200.             Left            =   3690
  201.             TabIndex        =   1
  202.             Text            =   "1"
  203.             Top             =   240
  204.             Width           =   765
  205.          End
  206.          Begin VB.TextBox LrText 
  207.             Height          =   300
  208.             Index           =   0
  209.             Left            =   1320
  210.             TabIndex        =   0
  211.             Text            =   "0"
  212.             Top             =   240
  213.             Width           =   1365
  214.          End
  215.          Begin VB.TextBox LrText 
  216.             Height          =   300
  217.             Index           =   2
  218.             Left            =   1320
  219.             TabIndex        =   2
  220.             Text            =   "2"
  221.             Top             =   630
  222.             Width           =   1065
  223.          End
  224.          Begin VB.CommandButton Ydcommand1 
  225.             Height          =   300
  226.             Index           =   2
  227.             Left            =   2385
  228.             Picture         =   "采购系统_发票查询条件.frx":1B18
  229.             Style           =   1  'Graphical
  230.             TabIndex        =   27
  231.             Top             =   630
  232.             Visible         =   0   'False
  233.             Width           =   300
  234.          End
  235.          Begin VB.TextBox LrText 
  236.             Height          =   300
  237.             Index           =   6
  238.             Left            =   1320
  239.             TabIndex        =   6
  240.             Text            =   "6"
  241.             Top             =   1740
  242.             Width           =   2835
  243.          End
  244.          Begin VB.TextBox LrText 
  245.             Height          =   300
  246.             Index           =   7
  247.             Left            =   1320
  248.             TabIndex        =   7
  249.             Text            =   "7"
  250.             Top             =   2100
  251.             Width           =   2835
  252.          End
  253.          Begin VB.CommandButton Ydcommand1 
  254.             Height          =   300
  255.             Index           =   6
  256.             Left            =   4155
  257.             Picture         =   "采购系统_发票查询条件.frx":1EA2
  258.             Style           =   1  'Graphical
  259.             TabIndex        =   26
  260.             Top             =   1740
  261.             Visible         =   0   'False
  262.             Width           =   300
  263.          End
  264.          Begin VB.Frame Frame6 
  265.             Height          =   465
  266.             Left            =   1320
  267.             TabIndex        =   50
  268.             Top             =   2880
  269.             Width           =   3135
  270.             Begin VB.OptionButton Option1 
  271.                Caption         =   "未审核"
  272.                Height          =   285
  273.                Index           =   3
  274.                Left            =   1980
  275.                TabIndex        =   53
  276.                Tag             =   " and ltrim(rtrim(isnull(a.Checker,'')))=''"
  277.                Top             =   120
  278.                Width           =   885
  279.             End
  280.             Begin VB.OptionButton Option1 
  281.                Caption         =   "已审核"
  282.                Height          =   285
  283.                Index           =   4
  284.                Left            =   1065
  285.                TabIndex        =   52
  286.                Tag             =   " and ltrim(rtrim(isnull(a.Checker,'')))<>'' "
  287.                Top             =   120
  288.                Width           =   915
  289.             End
  290.             Begin VB.OptionButton Option1 
  291.                Caption         =   "全部"
  292.                Height          =   285
  293.                Index           =   5
  294.                Left            =   150
  295.                TabIndex        =   51
  296.                Top             =   120
  297.                Value           =   -1  'True
  298.                Width           =   735
  299.             End
  300.          End
  301.          Begin VB.Frame Frame4 
  302.             Height          =   465
  303.             Left            =   1320
  304.             TabIndex        =   46
  305.             Top             =   3330
  306.             Width           =   3135
  307.             Begin VB.OptionButton Option1 
  308.                Caption         =   "未结算"
  309.                Height          =   285
  310.                Index           =   6
  311.                Left            =   1980
  312.                TabIndex        =   49
  313.                Tag             =   " and a.BanlanceDate  is null "
  314.                Top             =   150
  315.                Width           =   915
  316.             End
  317.             Begin VB.OptionButton Option1 
  318.                Caption         =   "已结算"
  319.                Height          =   285
  320.                Index           =   7
  321.                Left            =   1065
  322.                TabIndex        =   48
  323.                Tag             =   " and a.BanlanceDate is not null "
  324.                Top             =   150
  325.                Width           =   915
  326.             End
  327.             Begin VB.OptionButton Option1 
  328.                Caption         =   "全部"
  329.                Height          =   285
  330.                Index           =   8
  331.                Left            =   150
  332.                TabIndex        =   47
  333.                Top             =   150
  334.                Value           =   -1  'True
  335.                Width           =   735
  336.             End
  337.          End
  338.          Begin VB.Label Label1 
  339.             AutoSize        =   -1  'True
  340.             Caption         =   "结算状态:"
  341.             Height          =   180
  342.             Index           =   13
  343.             Left            =   150
  344.             TabIndex        =   41
  345.             Top             =   3480
  346.             Width           =   810
  347.          End
  348.          Begin VB.Label Label1 
  349.             AutoSize        =   -1  'True
  350.             Caption         =   "审核状态:"
  351.             Height          =   180
  352.             Index           =   12
  353.             Left            =   150
  354.             TabIndex        =   40
  355.             Top             =   3060
  356.             Width           =   810
  357.          End
  358.          Begin VB.Label Label1 
  359.             AutoSize        =   -1  'True
  360.             Caption         =   "发票性质:"
  361.             Height          =   180
  362.             Index           =   10
  363.             Left            =   150
  364.             TabIndex        =   39
  365.             Top             =   2640
  366.             Width           =   810
  367.          End
  368.          Begin VB.Label Label1 
  369.             AutoSize        =   -1  'True
  370.             Caption         =   "供应商:"
  371.             Height          =   180
  372.             Index           =   11
  373.             Left            =   150
  374.             TabIndex        =   36
  375.             Top             =   1425
  376.             Width           =   630
  377.          End
  378.          Begin VB.Label Label1 
  379.             AutoSize        =   -1  'True
  380.             Caption         =   "发票号:"
  381.             Height          =   180
  382.             Index           =   1
  383.             Left            =   150
  384.             TabIndex        =   34
  385.             Top             =   1065
  386.             Width           =   630
  387.          End
  388.          Begin VB.Label Label1 
  389.             AutoSize        =   -1  'True
  390.             Caption         =   "会计年度:"
  391.             Height          =   180
  392.             Index           =   2
  393.             Left            =   150
  394.             TabIndex        =   33
  395.             Top             =   300
  396.             Width           =   810
  397.          End
  398.          Begin VB.Label Label1 
  399.             AutoSize        =   -1  'True
  400.             Caption         =   "发票日期:"
  401.             Height          =   180
  402.             Index           =   0
  403.             Left            =   150
  404.             TabIndex        =   32
  405.             Top             =   690
  406.             Width           =   810
  407.          End
  408.          Begin VB.Label Label1 
  409.             AutoSize        =   -1  'True
  410.             Caption         =   "会计月份:"
  411.             Height          =   180
  412.             Index           =   3
  413.             Left            =   2820
  414.             TabIndex        =   31
  415.             Top             =   300
  416.             Width           =   810
  417.          End
  418.          Begin VB.Label Label1 
  419.             AutoSize        =   -1  'True
  420.             Caption         =   "采购物料分类:"
  421.             Height          =   180
  422.             Index           =   4
  423.             Left            =   150
  424.             TabIndex        =   30
  425.             Top             =   1800
  426.             Width           =   1170
  427.          End
  428.          Begin VB.Label Label1 
  429.             AutoSize        =   -1  'True
  430.             Caption         =   "物料编码:"
  431.             Height          =   180
  432.             Index           =   5
  433.             Left            =   150
  434.             TabIndex        =   29
  435.             Top             =   2160
  436.             Width           =   810
  437.          End
  438.          Begin VB.Line Line1 
  439.             X1              =   2760
  440.             X2              =   2910
  441.             Y1              =   765
  442.             Y2              =   765
  443.          End
  444.       End
  445.       Begin VB.Frame Frame5 
  446.          Height          =   3915
  447.          Left            =   -74940
  448.          TabIndex        =   17
  449.          Top             =   390
  450.          Width           =   4575
  451.          Begin VB.CommandButton Ydcommand1 
  452.             Height          =   300
  453.             Index           =   8
  454.             Left            =   4080
  455.             Picture         =   "采购系统_发票查询条件.frx":222C
  456.             Style           =   1  'Graphical
  457.             TabIndex        =   37
  458.             Top             =   240
  459.             Visible         =   0   'False
  460.             Width           =   330
  461.          End
  462.          Begin VB.CommandButton Ydcommand1 
  463.             Height          =   300
  464.             Index           =   9
  465.             Left            =   4080
  466.             Picture         =   "采购系统_发票查询条件.frx":25B6
  467.             Style           =   1  'Graphical
  468.             TabIndex        =   20
  469.             Top             =   630
  470.             Visible         =   0   'False
  471.             Width           =   330
  472.          End
  473.          Begin VB.CommandButton Ydcommand1 
  474.             Height          =   300
  475.             Index           =   10
  476.             Left            =   4080
  477.             Picture         =   "采购系统_发票查询条件.frx":2940
  478.             Style           =   1  'Graphical
  479.             TabIndex        =   19
  480.             Top             =   1035
  481.             Visible         =   0   'False
  482.             Width           =   330
  483.          End
  484.          Begin VB.CommandButton Ydcommand1 
  485.             Height          =   300
  486.             Index           =   11
  487.             Left            =   4080
  488.             Picture         =   "采购系统_发票查询条件.frx":2CCA
  489.             Style           =   1  'Graphical
  490.             TabIndex        =   18
  491.             Top             =   1425
  492.             Visible         =   0   'False
  493.             Width           =   330
  494.          End
  495.          Begin VB.TextBox LrText 
  496.             Height          =   300
  497.             Index           =   11
  498.             Left            =   1050
  499.             TabIndex        =   11
  500.             Text            =   "11"
  501.             Top             =   1425
  502.             Width           =   3045
  503.          End
  504.          Begin VB.TextBox LrText 
  505.             Height          =   300
  506.             Index           =   10
  507.             Left            =   1050
  508.             TabIndex        =   10
  509.             Text            =   "10"
  510.             Top             =   1035
  511.             Width           =   3045
  512.          End
  513.          Begin VB.TextBox LrText 
  514.             Height          =   300
  515.             Index           =   9
  516.             Left            =   1050
  517.             TabIndex        =   9
  518.             Text            =   "9"
  519.             Top             =   630
  520.             Width           =   3045
  521.          End
  522.          Begin VB.TextBox LrText 
  523.             BackColor       =   &H00FFFFFF&
  524.             Height          =   300
  525.             Index           =   8
  526.             Left            =   1050
  527.             TabIndex        =   8
  528.             Text            =   "8"
  529.             Top             =   240
  530.             Width           =   3045
  531.          End
  532.          Begin VB.Label Label1 
  533.             AutoSize        =   -1  'True
  534.             Caption         =   "订单号:"
  535.             Height          =   180
  536.             Index           =   9
  537.             Left            =   150
  538.             TabIndex        =   38
  539.             Top             =   270
  540.             Width           =   660
  541.          End
  542.          Begin VB.Label Label1 
  543.             AutoSize        =   -1  'True
  544.             Caption         =   "业务员:"
  545.             Height          =   180
  546.             Index           =   7
  547.             Left            =   150
  548.             TabIndex        =   23
  549.             Top             =   1050
  550.             Width           =   660
  551.          End
  552.          Begin VB.Label Label1 
  553.             AutoSize        =   -1  'True
  554.             Caption         =   "结算方式:"
  555.             Height          =   180
  556.             Index           =   8
  557.             Left            =   150
  558.             TabIndex        =   22
  559.             Top             =   1455
  560.             Width           =   840
  561.          End
  562.          Begin VB.Label Label1 
  563.             AutoSize        =   -1  'True
  564.             Caption         =   "部门:"
  565.             Height          =   180
  566.             Index           =   6
  567.             Left            =   150
  568.             TabIndex        =   21
  569.             Top             =   630
  570.             Width           =   480
  571.          End
  572.       End
  573.    End
  574. End
  575. Attribute VB_Name = "Cg_InvoiceQuery"
  576. Attribute VB_GlobalNameSpace = False
  577. Attribute VB_Creatable = False
  578. Attribute VB_PredeclaredId = True
  579. Attribute VB_Exposed = False
  580. '******************************************************************
  581. '*    模 块 名 称 :发票列表查询条件
  582. '*    功 能 描 述 :
  583. '*    程序员姓名  :周化江
  584. '*    最后修改人  :周化江
  585. '*    最后修改时间:2001/09/20
  586. '*    备        注:程序中所有依实际情况自定义部分均用[>>  <<]括起
  587. '******************************************************************
  588. Dim Tsxx As String                       '系统信息提示
  589. Private Int_InvoiceType As Integer              '发票类型
  590. Private Bln_Refresh As Boolean
  591. Private Int_OldInvoiceType As Integer
  592. Private Collect_TextValue() As New Collection
  593. Private Collect_TagValue() As New Collection
  594. '以下为固定使用变量(文本框)
  595. Dim Textvar() As Variant                 '存储变体型文本框信息
  596. Dim Textboolean() As Boolean             '存储布尔型文本框信息
  597. Dim Textint() As Integer                 '存储整型文本框信息
  598. Dim Textstr() As String                  '存储字符型文本框信息
  599. Dim Max_Text_Index As Integer            '最大录入文本框索引值
  600. Dim TextGroupCode As String              '文本框录入分组编码
  601. Dim TextValiLock As Boolean              '文本框失去焦点是否进行有效性控制判断
  602. Dim TextValiJudgeLock() As Boolean       '文本框录入有效性判断控制锁
  603. Dim CurTextIndex As Integer              '当前文本框索引值
  604. Dim TextChangeLock As Boolean            '文本框内容变换控制锁
  605. Dim Bln_Cancel As Boolean                '取消按钮信息传递
  606. Private Sub Form_Activate()
  607.    If Int_OldInvoiceType <> Me.InvoiceType Then
  608.         Int_OldInvoiceType = Me.InvoiceType
  609.         Timer1.Enabled = True
  610.    End If
  611. End Sub
  612. Private Sub Form_KeyPress(KeyAscii As Integer)   '控 制 焦 点 转 移(Fixed)
  613.     Dim jdzygs As Integer                         '控件焦点转移个数
  614.     jdzygs = 30
  615.     Select Case KeyAscii
  616.         Case vbKeyReturn
  617.             If Kjjdzy(jdzygs) Then
  618.                 KeyAscii = 0
  619.             End If
  620.         Case 39           '屏蔽"'"
  621.             KeyAscii = 0
  622.     End Select
  623. End Sub
  624. Private Sub Form_Load()
  625.    
  626.     '以下为文本框处理程序(Fixed)
  627.     TextGroupCode = "Cg_InvoiceQuery"
  628.     Call Drwbkxx(TextGroupCode, Textvar(), Textboolean(), Textint(), Textstr())  '读入文本框录入信息
  629.     Call Wbkcsh
  630.    
  631.     '[>>初始化查询条件默认值
  632.     LrText(2).Text = Format(Xtrq, "yyyy-mm-dd")
  633.     LrText(3).Text = Format(Xtrq, "yyyy-mm-dd")
  634.     '<<]
  635.     '[>>添加窗体帮助ID
  636.     Select Case Me.InvoiceType
  637.         Case 1
  638.             Cg_InvoiceQuery.HelpContextID = "1102002"
  639.         Case 2
  640.             Cg_InvoiceQuery.HelpContextID = "1102004"
  641.         Case 3
  642.             Cg_InvoiceQuery.HelpContextID = "1107003"
  643.         Case 4
  644.             Cg_InvoiceQuery.HelpContextID = "1107006"
  645.     End Select
  646.     
  647.     '<<]
  648.     ReDim Collect_TextValue(4) As New Collection
  649.     ReDim Collect_TagValue(4) As New Collection
  650.     Int_OldInvoiceType = 0
  651. End Sub
  652. Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)          '查询条件窗体卸载
  653.     Dim frm_temp As Form
  654.     Dim int_temp As Integer
  655.     '查询条件窗体卸载时判断是否因为结果窗体卸载,如是则卸载,否则隐藏
  656.     If UnloadCheck.Value <> 1 Then
  657.         Cancel = 1
  658.         Int_OldInvoiceType = Me.InvoiceType
  659.         Me.Hide
  660.     Else
  661.         int_temp = 0
  662.         For Each frm_temp In Forms
  663.            If frm_temp.Name = "Cg_InvoiceZy_List" Or frm_temp.Name = "Cg_InvoiceQCPT_List" Or frm_temp.Name = "Cg_InvoicePt_list" Or frm_temp.Name = "Cg_InvoiceQCZy_List" Then
  664.                int_temp = int_temp + 1
  665.            End If
  666.         Next frm_temp
  667.         If int_temp > 1 Then
  668.             Cancel = 1
  669.             Me.Hide
  670.         End If
  671.     End If
  672. End Sub
  673. Private Sub QdCommand_Click()                                   '确 定
  674.     '录入条件有效性判断(Fixed)
  675.     If Not Lrtjyxxpd Then
  676.         Exit Sub
  677.     End If
  678.     Int_OldInvoiceType = Me.InvoiceType
  679.     Me.Hide
  680.         
  681.     '[>>激活查询过程结果窗体
  682.     Timer2.Enabled = True
  683.    If Me.InvoiceType = 1 Then
  684.         Cg_InvoiceQCPT_List.Timer1.Enabled = True
  685.         Cg_InvoiceQCPT_List.SetFocus
  686.    ElseIf Me.InvoiceType = 2 Then
  687.         Cg_InvoiceQCZy_List.Timer1.Enabled = True
  688.         Cg_InvoiceQCZy_List.SetFocus
  689.    ElseIf Me.InvoiceType = 3 Then
  690.         Cg_InvoicePt_list.Timer1.Enabled = True
  691.         Cg_InvoicePt_list.SetFocus
  692.    ElseIf Me.InvoiceType = 4 Then
  693.         Cg_InvoiceZy_List.Timer1.Enabled = True
  694.         Cg_InvoiceZy_List.SetFocus
  695.    End If
  696.    
  697.    
  698.    
  699.    
  700.    
  701.     
  702.     '<<]
  703. End Sub
  704. Private Sub QxCommand_Click()                                    '取消(Fixed)
  705.     Me.Hide
  706. End Sub
  707. Private Function Lrtjyxxpd() As Boolean                          '用户录入条件有效性判断
  708.     Dim jsqte As Integer
  709.     Lrtjyxxpd = False
  710.  
  711.     '对需要进行事后判断的文本框录入内容进行有效性判断 (Fixed)
  712.     For jsqte = 0 To Max_Text_Index
  713.         If Textint(jsqte, 9) = 0 Or Textint(jsqte, 9) = 2 Then
  714.             If Not TextYxxpd(jsqte) Then
  715.                 Exit Function
  716.             End If
  717.         End If
  718.     Next jsqte
  719.    
  720.     '[>>以下为依据实际情况自定义部分
  721.  
  722.     '查询日期范围应由小到大
  723.     If LrText(2).Text > LrText(3).Text And Trim(LrText(3).Text) <> "" Then
  724.         Tsxx = "查询发票日期范围应由小到大!"
  725.         Call Xtxxts(Tsxx, 0, 4)
  726.         LrText(2).SetFocus
  727.         Exit Function
  728.     End If
  729.     '会计月份应在1到12之间
  730.     If Trim(LrText(1).Text) <> "" And (S2N(LrText(1).Text) > 12 Or S2N(LrText(1).Text) < 1) Then
  731.         Tsxx = "会计月份应该在1到12之间"
  732.         Call Xtxxts(Tsxx, 0, 4)
  733.         LrText(1).SetFocus
  734.         Exit Function
  735.     End If
  736.   
  737.     '<<]以上为依据实际情况自定义部分
  738.  
  739.     Lrtjyxxpd = True
  740. End Function
  741. Private Sub Cmd_Clear_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)    '将用户输入条件全部清除(可选)
  742.     '清除文本框(Fixed)
  743.     For jsqte = 0 To Max_Text_Index
  744.         LrText(jsqte).Tag = ""
  745.         LrText(jsqte).Text = ""
  746.     Next jsqte
  747.     Option1(0).Value = True
  748.     Option1(5).Value = True
  749.     Option1(8).Value = True
  750.     
  751.     '[>>
  752.     '此处可以写入其他清除条件程序
  753.     '<<]
  754.   
  755. End Sub
  756. '*************以下为文本框录入处理程序(固定不变部分)*************'
  757. Private Sub Wbklrwbcl(Index As Integer)    '文本框录入事后处理程序
  758.   
  759.     '以下为依据实际情况自定义部分[
  760.     '在此填写文本框录入事后处理程序
  761.     ']以上为依据实际情况自定义部分
  762.   
  763. End Sub
  764. Private Sub LrText_Change(Index As Integer)
  765.    
  766.     '屏蔽程序改变控制
  767.     If TextChangeLock Then
  768.         Exit Sub
  769.     End If
  770.     
  771.     TextValiJudgeLock(Index) = False    '打开有效性判断锁
  772.     
  773.     '限制字段录入长度
  774.           
  775.     TextChangeLock = True  '加锁(防止执行Lrtext_Change)
  776.     Call TextChangeLimit(LrText(Index), Textint(Index, 1))  '去掉无效字符
  777.     Select Case Textint(Index, 1)
  778.         Case 8, 11      '金额型
  779.             Call Sjgskz(LrText(Index), Xtjezws - Xtjexsws - 1, Xtjexsws)
  780.         Case 9, 12      '数量型
  781.             Call Sjgskz(LrText(Index), Xtslzws - Xtslxsws - 1, Xtslxsws)
  782.         Case 10          '单价型
  783.             Call Sjgskz(LrText(Index), Xtdjzws - Xtdjxsws - 1, Xtdjxsws)
  784.         Case Else        '其他小数类型控制
  785.             If Textint(Index, 6) <> 0 Or Textint(Index, 7) <> 0 Then
  786.                 Call Sjgskz(LrText(Index), Textint(Index, 6), Textint(Index, 7))
  787.             End If
  788.     End Select
  789.         
  790.     TextChangeLock = False '解锁
  791. End Sub
  792. Private Sub LrText_GotFocus(Index As Integer)                                                 '文本框得到焦点,显示相应信息
  793.     Call TextShow(Index)
  794.     CurTextIndex = Index
  795.     LrText(Index).SelStart = Len(LrText(Index))
  796. End Sub
  797. Private Sub LrText_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer)            '字段按F2键提供帮助
  798.     
  799.     Select Case KeyCode
  800.         Case vbKeyF2
  801.             Call Text_Help(Index)
  802.     End Select
  803. End Sub
  804. Private Sub LrText_KeyPress(Index As Integer, KeyAscii As Integer)                            '文本框录入事中控制
  805.     Call InputFieldLimit(LrText(Index), Textint(Index, 1), KeyAscii)
  806. End Sub
  807. Private Sub LrText_LostFocus(Index As Integer)                                                '文本框失去焦点
  808.     '显示相应信息但不能进行有效性判断
  809.   
  810. End Sub
  811. Private Sub Timer1_Timer()
  812.     Timer1.Enabled = False
  813.     Dim int_temp As Integer
  814.      
  815.        '1期初普通发票
  816.        '2期初专用发票
  817.        '3普通发票
  818.        '4专用发票
  819.              If Collect_TextValue(Me.InvoiceType).count <> 15 Then
  820.                 TextChangeLock = True
  821.                 For jsqte = 0 To Max_Text_Index  '清空
  822.                     LrText(jsqte).Tag = ""
  823.                     LrText(jsqte).Text = ""
  824.                 Next jsqte
  825.                 Option1(0).Value = True
  826.                 Option1(5).Value = True
  827.                 Option1(8).Value = True
  828.                 LrText(2).Text = Format(Xtrq, "yyyy-mm-dd")
  829.                 LrText(3).Text = Format(Xtrq, "yyyy-mm-dd")
  830.                 TextChangeLock = False
  831.                 For int_temp = 0 To 11
  832.                     Collect_TextValue(Me.InvoiceType).Add LrText(int_temp).Text
  833.                 Next int_temp
  834.                     Collect_TextValue(Me.InvoiceType).Add "1"
  835.                     Collect_TextValue(Me.InvoiceType).Add "2"
  836.                     Collect_TextValue(Me.InvoiceType).Add "3"
  837.                     
  838.              Else
  839.                 TextChangeLock = True
  840.                 For int_temp = 0 To 11
  841.                     LrText(int_temp).Text = Collect_TextValue(Me.InvoiceType).Item(int_temp + 1)
  842.                 Next int_temp
  843.                 TextChangeLock = False
  844.                     If Collect_TextValue(Me.InvoiceType).Item(13) = "1" Then
  845.                         Option1(0).Value = True
  846.                     ElseIf Collect_TextValue(Me.InvoiceType).Item(13) = "2" Then
  847.                         Option1(1).Value = True
  848.                     ElseIf Collect_TextValue(Me.InvoiceType).Item(13) = "3" Then
  849.                         Option1(2).Value = True
  850.                     End If
  851.                     If Collect_TextValue(Me.InvoiceType).Item(14) = "1" Then
  852.                         Option1(5).Value = True
  853.                     ElseIf Collect_TextValue(Me.InvoiceType).Item(14) = "2" Then
  854.                         Option1(4).Value = True
  855.                     ElseIf Collect_TextValue(Me.InvoiceType).Item(14) = "3" Then
  856.                         Option1(3).Value = True
  857.                     End If
  858.                     If Collect_TextValue(Me.InvoiceType).Item(15) = "1" Then
  859.                         Option1(8).Value = True
  860.                     ElseIf Collect_TextValue(Me.InvoiceType).Item(15) = "2" Then
  861.                         Option1(7).Value = True
  862.                     ElseIf Collect_TextValue(Me.InvoiceType).Item(15) = "3" Then
  863.                         Option1(6).Value = True
  864.                     End If
  865.              End If
  866.              
  867.              If Collect_TagValue(Me.InvoiceType).count <> 12 Then
  868.                 For int_temp = 0 To 11
  869.                     Collect_TagValue(Me.InvoiceType).Add LrText(int_temp).Tag
  870.                 Next int_temp
  871.              Else
  872.                 TextChangeLock = True
  873.                 For int_temp = 0 To 11
  874.                     LrText(int_temp).Tag = Collect_TagValue(Me.InvoiceType).Item(int_temp + 1)
  875.                 Next int_temp
  876.              End If
  877. End Sub
  878. Private Sub Timer2_Timer()
  879. Timer2.Enabled = False
  880.     If Collect_TextValue(Me.InvoiceType).count = 15 Then
  881.        For int_temp = 15 To 1 Step -1
  882.         Collect_TextValue(Me.InvoiceType).Remove (int_temp)
  883.        Next int_temp
  884.     End If
  885.        For int_temp = 0 To 11
  886.            Collect_TextValue(Me.InvoiceType).Add LrText(int_temp).Text
  887.        Next int_temp
  888.            If Option1(0).Value = True Then
  889.                Collect_TextValue(Me.InvoiceType).Add "1"
  890.            ElseIf Option1(1).Value = True Then
  891.                Collect_TextValue(Me.InvoiceType).Add "2"
  892.            ElseIf Option1(2).Value = True Then
  893.                Collect_TextValue(Me.InvoiceType).Add "3"
  894.            End If
  895.            If Option1(5).Value = True Then
  896.                Collect_TextValue(Me.InvoiceType).Add "1"
  897.            ElseIf Option1(4).Value = True Then
  898.                Collect_TextValue(Me.InvoiceType).Add "2"
  899.            ElseIf Option1(3).Value = True Then
  900.                Collect_TextValue(Me.InvoiceType).Add "3"
  901.            End If
  902.            If Option1(8).Value = True Then
  903.                Collect_TextValue(Me.InvoiceType).Add "1"
  904.            ElseIf Option1(7).Value = True Then
  905.                Collect_TextValue(Me.InvoiceType).Add "2"
  906.            ElseIf Option1(6).Value = True Then
  907.                Collect_TextValue(Me.InvoiceType).Add "3"
  908.            End If
  909.     If Collect_TagValue(Me.InvoiceType).count = 12 Then
  910.        For int_temp = 12 To 1 Step -1
  911.            Collect_TagValue(Me.InvoiceType).Remove (int_temp)
  912.        Next int_temp
  913.     End If
  914.        For int_temp = 0 To 11
  915.            Collect_TagValue(Me.InvoiceType).Add LrText(int_temp).Tag
  916.        Next int_temp
  917. End Sub
  918. Private Sub Timer3_Timer()
  919. Dim int_temp As Integer
  920. Timer3.Enabled = False
  921.     If Collect_TextValue(Me.InvoiceType).count = 15 Then
  922.        For int_temp = 15 To 1 Step -1
  923.         Collect_TextValue(Me.InvoiceType).Remove (int_temp)
  924.        Next int_temp
  925.     End If
  926.     If Collect_TagValue(Me.InvoiceType).count = 12 Then
  927.        For int_temp = 12 To 1 Step -1
  928.            Collect_TagValue(Me.InvoiceType).Remove (int_temp)
  929.        Next int_temp
  930.     End If
  931. End Sub
  932. Private Sub Ydcommand1_MouseDown(Index As Integer, Button As Integer, Shift As Integer, x As Single, y As Single)     '按钮提供帮助
  933.     Call Text_Help(Index)
  934. End Sub
  935. Private Sub Text_Help(Index As Integer)                                                       '录入字段帮助
  936.     If Not Textboolean(Index, 1) Then
  937.         Exit Sub
  938.     End If
  939.      
  940.     '调用帮助
  941.     Call Drbmhelp(Textint(Index, 2), Textstr(Index, 4), Trim(LrText(Index).Text))
  942.   
  943.     '根据设置选择显示编码和名称,并进行存储
  944.     If Len(Xtfhcs) <> 0 Then
  945.         If Textint(Index, 3) = 1 Then
  946.             LrText(Index).Text = Xtfhcsfz
  947.             LrText(Index).Tag = Xtfhcs
  948.         Else
  949.             LrText(Index).Text = Xtfhcs
  950.             LrText(Index).Tag = Xtfhcsfz
  951.         End If
  952.     End If
  953.    
  954.     LrText(Index).SetFocus
  955. End Sub
  956. Private Sub TextShow(Index As Integer)        '文本框得到焦点,显示相应信息
  957.     '填写文本框得到焦点,进行相应信息处理程序
  958.    
  959. End Sub
  960. Private Sub Wbkcsh()                          '录入文本框初始化
  961.     
  962.     Dim jsqte As Integer
  963.   
  964.     '最大录入文本框索引值
  965.     Max_Text_Index = Textvar(1)
  966.   
  967.     ReDim TextValiJudgeLock(Max_Text_Index)
  968.     For jsqte = 0 To Max_Text_Index
  969.         If Len(Trim(Textstr(jsqte, 1))) <> 0 Then
  970.             If Textboolean(jsqte, 1) Then
  971.                 If jsqte <> 0 And Not Textboolean(jsqte, 3) Then
  972.                     Load Ydcommand1(jsqte)
  973.                 End If
  974.                 Ydcommand1(jsqte).Visible = True
  975.                 Ydcommand1(jsqte).Move LrText(jsqte).Left + LrText(jsqte).Width, LrText(jsqte).Top
  976.             End If
  977.             TextChangeLock = True
  978.             LrText(jsqte).Text = ""
  979.             LrText(jsqte).Tag = ""
  980.             If Textint(jsqte, 5) <> 0 Then
  981.                 LrText(jsqte).MaxLength = Textint(jsqte, 5)
  982.             End If
  983.             TextChangeLock = False
  984.         End If
  985.         TextValiJudgeLock(jsqte) = True
  986.     Next jsqte
  987. End Sub
  988. Private Function TextYxxpd(Index As Integer) As Boolean           '文本框有效性判断
  989.     
  990.     Dim Sqlstr As String
  991.     Dim Findrec As ADODB.Recordset
  992.   
  993.     '文本框内容未曾改变不进行有效性判断
  994.     If TextValiJudgeLock(Index) Then
  995.         TextYxxpd = True
  996.         Exit Function
  997.     End If
  998.   
  999.     '文本框内容为空认为有效,并清空其Tag值
  1000.     If Trim(LrText(Index)) = "" Then
  1001.         LrText(Index).Tag = ""
  1002.         Call Wbklrwbcl(Index)
  1003.         TextValiJudgeLock(Index) = True
  1004.         TextYxxpd = True
  1005.         Exit Function
  1006.     End If
  1007.   
  1008.     '可在此加入不做有效性判断的理由
  1009.   
  1010.     Select Case Textint(Index, 4)
  1011.         Case 1      '编码型
  1012.             Sqlstr = Trim(Textstr(Index, 5))
  1013.             Sqlstr = Replace(Sqlstr, "@", "'" + Trim(LrText(Index).Text) + "'")
  1014.             Set Findrec = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  1015.             If Findrec.EOF Then
  1016.                 Call Xtxxts(Trim(Textstr(Index, 6)), 0, 1)
  1017.                 LrText(Index).SetFocus
  1018.                 Exit Function
  1019.             Else
  1020.                 Select Case Textint(Index, 3)
  1021.                     Case 0
  1022.                         If Len(Trim(Textstr(Index, 2))) <> 0 Then
  1023.                             LrText(Index).Text = Trim(Findrec.Fields(Trim(Textstr(Index, 2))))
  1024.                         End If
  1025.                         If Len(Trim(Textstr(Index, 3) & "")) <> 0 Then
  1026.                             LrText(Index).Tag = Trim(Findrec.Fields(Trim(Textstr(Index, 3))))
  1027.                         End If
  1028.                     Case 1
  1029.                         If Len(Trim(Textstr(Index, 3) & "")) <> 0 Then
  1030.                             LrText(Index).Text = Trim(Findrec.Fields(Trim(Textstr(Index, 3))))
  1031.                         End If
  1032.                         If Len(Trim(Textstr(Index, 2))) <> 0 Then
  1033.                             LrText(Index).Tag = Trim(Findrec.Fields(Trim(Textstr(Index, 2))))
  1034.                         End If
  1035.                 End Select
  1036.             End If
  1037.         Case 2      '日期型
  1038.             If IsDate(LrText(Index).Text) Then
  1039.                 LrText(Index).Text = Format(LrText(Index).Text, "yyyy-mm-dd")
  1040.                 If S2N(Mid(LrText(Index), 1, 4)) < 1900 Then
  1041.                     LrText(Index).Text = "1900" + Mid(LrText(Index), 5, 6)
  1042.                 End If
  1043.             Else
  1044.                 Tsxx = "非法公历日期!(格式:" + Format(Date, "yyyy-mm-dd") + ")"
  1045.                 Call Xtxxts(Tsxx, 0, 1)
  1046.                 LrText(Index).SetFocus
  1047.                 Exit Function
  1048.             End If
  1049.         Case 3      '其他类型
  1050.     End Select
  1051.     
  1052.     '如果有效则加锁,用户不改变内容则不再进行有效性判断
  1053.     TextValiJudgeLock(Index) = True
  1054.     '调用文本框事后处理程序
  1055.     Call Wbklrwbcl(Index)
  1056.    
  1057.     '有效性判断通过则返回True
  1058.     TextYxxpd = True
  1059.    
  1060. End Function
  1061. Public Property Get InvoiceType() As Integer
  1062. ''''''以下为定义发票类型属性
  1063. '1.期初普通
  1064. '2 期初增值税
  1065. '3.普通蓝字
  1066. '4 增值税蓝字
  1067. '5.普通红字
  1068. '6 增值税红字
  1069.   InvoiceType = Int_InvoiceType
  1070. End Property
  1071. Public Property Let InvoiceType(ByVal vNewValue As Integer)
  1072.   Int_InvoiceType = vNewValue
  1073. End Property