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

企业管理

开发平台:

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 Xs_A_WareAnalysis 
  5.    Caption         =   "货龄分析"
  6.    ClientHeight    =   8595
  7.    ClientLeft      =   315
  8.    ClientTop       =   390
  9.    ClientWidth     =   11820
  10.    HelpContextID   =   5001
  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            =   10110
  21.       TabIndex        =   3
  22.       Top             =   30
  23.       Width           =   1695
  24.       _ExtentX        =   2990
  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.             Object.Visible         =   0   'False
  46.             Caption         =   "显示项目"
  47.             Key             =   "szxsxm"
  48.             ImageKey        =   "xsxm"
  49.          EndProperty
  50.       EndProperty
  51.    End
  52.    Begin VB.PictureBox Pic_Title 
  53.       BackColor       =   &H00FFFFFF&
  54.       Height          =   825
  55.       Left            =   -45
  56.       Picture         =   "货龄分析查询结果.frx":1042
  57.       ScaleHeight     =   765
  58.       ScaleWidth      =   11715
  59.       TabIndex        =   1
  60.       Top             =   645
  61.       Width           =   11775
  62.       Begin VB.Label Lbl 
  63.          AutoSize        =   -1  'True
  64.          BackStyle       =   0  'Transparent
  65.          Caption         =   "货物编码:"
  66.          Height          =   180
  67.          Index           =   6
  68.          Left            =   7455
  69.          TabIndex        =   11
  70.          Top             =   390
  71.          Width           =   810
  72.       End
  73.       Begin VB.Label Lbl 
  74.          AutoSize        =   -1  'True
  75.          BackStyle       =   0  'Transparent
  76.          Caption         =   "地区:"
  77.          Height          =   180
  78.          Index           =   3
  79.          Left            =   5085
  80.          TabIndex        =   10
  81.          Top             =   390
  82.          Width           =   450
  83.       End
  84.       Begin VB.Label Lbl 
  85.          AutoSize        =   -1  'True
  86.          BackStyle       =   0  'Transparent
  87.          Caption         =   "部门:"
  88.          Height          =   180
  89.          Index           =   0
  90.          Left            =   5085
  91.          TabIndex        =   9
  92.          Top             =   135
  93.          Width           =   450
  94.       End
  95.       Begin VB.Label Lbl 
  96.          AutoSize        =   -1  'True
  97.          BackStyle       =   0  'Transparent
  98.          Caption         =   "行业:"
  99.          Height          =   180
  100.          Index           =   1
  101.          Left            =   2580
  102.          TabIndex        =   8
  103.          Top             =   390
  104.          Width           =   450
  105.       End
  106.       Begin VB.Label Lbl 
  107.          AutoSize        =   -1  'True
  108.          BackStyle       =   0  'Transparent
  109.          Caption         =   "销售员:"
  110.          Height          =   180
  111.          Index           =   2
  112.          Left            =   9450
  113.          TabIndex        =   7
  114.          Top             =   135
  115.          Width           =   630
  116.       End
  117.       Begin VB.Label Lbl 
  118.          AutoSize        =   -1  'True
  119.          BackStyle       =   0  'Transparent
  120.          Caption         =   "日期:"
  121.          Height          =   180
  122.          Index           =   4
  123.          Left            =   2580
  124.          TabIndex        =   6
  125.          Top             =   135
  126.          Width           =   450
  127.       End
  128.       Begin VB.Label Lbl 
  129.          AutoSize        =   -1  'True
  130.          BackStyle       =   0  'Transparent
  131.          Caption         =   "销售类型:"
  132.          Height          =   180
  133.          Index           =   5
  134.          Left            =   7455
  135.          TabIndex        =   5
  136.          Top             =   135
  137.          Width           =   810
  138.       End
  139.       Begin VB.Label Lab_Title 
  140.          AutoSize        =   -1  'True
  141.          BackColor       =   &H80000018&
  142.          BackStyle       =   0  'Transparent
  143.          Caption         =   "货龄分析"
  144.          BeginProperty Font 
  145.             Name            =   "宋体"
  146.             Size            =   12
  147.             Charset         =   134
  148.             Weight          =   700
  149.             Underline       =   0   'False
  150.             Italic          =   0   'False
  151.             Strikethrough   =   0   'False
  152.          EndProperty
  153.          ForeColor       =   &H00000000&
  154.          Height          =   240
  155.          Index           =   4
  156.          Left            =   480
  157.          TabIndex        =   2
  158.          Top             =   210
  159.          Width           =   1020
  160.       End
  161.    End
  162.    Begin VB.Timer Timer1 
  163.       Enabled         =   0   'False
  164.       Interval        =   1
  165.       Left            =   7620
  166.       Top             =   90
  167.    End
  168.    Begin VSFlex8Ctl.VSFlexGrid CxbbGrid 
  169.       Height          =   7545
  170.       Left            =   0
  171.       TabIndex        =   0
  172.       Top             =   1470
  173.       Width           =   11775
  174.       _cx             =   5080
  175.       _cy             =   5080
  176.       Appearance      =   1
  177.       BorderStyle     =   1
  178.       Enabled         =   -1  'True
  179.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  180.          Name            =   "宋体"
  181.          Size            =   9
  182.          Charset         =   134
  183.          Weight          =   400
  184.          Underline       =   0   'False
  185.          Italic          =   0   'False
  186.          Strikethrough   =   0   'False
  187.       EndProperty
  188.       MousePointer    =   0
  189.       BackColor       =   16777215
  190.       ForeColor       =   -2147483640
  191.       BackColorFixed  =   13826538
  192.       ForeColorFixed  =   -2147483630
  193.       BackColorSel    =   -2147483635
  194.       ForeColorSel    =   -2147483634
  195.       BackColorBkg    =   -2147483636
  196.       BackColorAlternate=   16777215
  197.       GridColor       =   -2147483633
  198.       GridColorFixed  =   -2147483632
  199.       TreeColor       =   -2147483632
  200.       FloodColor      =   192
  201.       SheetBorder     =   -2147483642
  202.       FocusRect       =   1
  203.       HighLight       =   1
  204.       AllowSelection  =   -1  'True
  205.       AllowBigSelection=   -1  'True
  206.       AllowUserResizing=   0
  207.       SelectionMode   =   0
  208.       GridLines       =   1
  209.       GridLinesFixed  =   2
  210.       GridLineWidth   =   1
  211.       Rows            =   50
  212.       Cols            =   10
  213.       FixedRows       =   1
  214.       FixedCols       =   1
  215.       RowHeightMin    =   0
  216.       RowHeightMax    =   0
  217.       ColWidthMin     =   0
  218.       ColWidthMax     =   0
  219.       ExtendLastCol   =   0   'False
  220.       FormatString    =   ""
  221.       ScrollTrack     =   0   'False
  222.       ScrollBars      =   3
  223.       ScrollTips      =   0   'False
  224.       MergeCells      =   0
  225.       MergeCompare    =   0
  226.       AutoResize      =   -1  'True
  227.       AutoSizeMode    =   0
  228.       AutoSearch      =   0
  229.       AutoSearchDelay =   2
  230.       MultiTotals     =   -1  'True
  231.       SubtotalPosition=   1
  232.       OutlineBar      =   0
  233.       OutlineCol      =   0
  234.       Ellipsis        =   0
  235.       ExplorerBar     =   0
  236.       PicturesOver    =   0   'False
  237.       FillStyle       =   0
  238.       RightToLeft     =   0   'False
  239.       PictureType     =   0
  240.       TabBehavior     =   0
  241.       OwnerDraw       =   0
  242.       Editable        =   0
  243.       ShowComboButton =   1
  244.       WordWrap        =   0   'False
  245.       TextStyle       =   0
  246.       TextStyleFixed  =   0
  247.       OleDragMode     =   0
  248.       OleDropMode     =   0
  249.       DataMode        =   0
  250.       VirtualData     =   -1  'True
  251.       DataMember      =   ""
  252.       ComboSearch     =   3
  253.       AutoSizeMouse   =   -1  'True
  254.       FrozenRows      =   0
  255.       FrozenCols      =   0
  256.       AllowUserFreezing=   0
  257.       BackColorFrozen =   0
  258.       ForeColorFrozen =   0
  259.       WallPaperAlignment=   9
  260.       AccessibleName  =   ""
  261.       AccessibleDescription=   ""
  262.       AccessibleValue =   ""
  263.       AccessibleRole  =   24
  264.       Begin MSComctlLib.ImageList ImageList2 
  265.          Left            =   0
  266.          Top             =   0
  267.          _ExtentX        =   1005
  268.          _ExtentY        =   1005
  269.          BackColor       =   -2147483643
  270.          ImageWidth      =   16
  271.          ImageHeight     =   16
  272.          MaskColor       =   12632256
  273.          _Version        =   393216
  274.          BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  275.             NumListImages   =   40
  276.             BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  277.                Picture         =   "货龄分析查询结果.frx":35106
  278.                Key             =   "sz"
  279.             EndProperty
  280.             BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  281.                Picture         =   "货龄分析查询结果.frx":354A0
  282.                Key             =   "dy"
  283.             EndProperty
  284.             BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  285.                Picture         =   "货龄分析查询结果.frx":3583A
  286.                Key             =   "yl"
  287.             EndProperty
  288.             BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  289.                Picture         =   "货龄分析查询结果.frx":35BD4
  290.                Key             =   "xg"
  291.             EndProperty
  292.             BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  293.                Picture         =   "货龄分析查询结果.frx":35F6E
  294.                Key             =   "zh"
  295.             EndProperty
  296.             BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  297.                Picture         =   "货龄分析查询结果.frx":36308
  298.                Key             =   "sh"
  299.             EndProperty
  300.             BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  301.                Picture         =   "货龄分析查询结果.frx":366A2
  302.                Key             =   "bc"
  303.             EndProperty
  304.             BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  305.                Picture         =   "货龄分析查询结果.frx":36A3C
  306.                Key             =   "fq"
  307.             EndProperty
  308.             BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  309.                Picture         =   "货龄分析查询结果.frx":36DD6
  310.                Key             =   "bz"
  311.             EndProperty
  312.             BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  313.                Picture         =   "货龄分析查询结果.frx":37170
  314.                Key             =   "tc"
  315.             EndProperty
  316.             BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  317.                Picture         =   "货龄分析查询结果.frx":3750A
  318.                Key             =   "bcgs"
  319.             EndProperty
  320.             BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  321.                Picture         =   "货龄分析查询结果.frx":378A4
  322.                Key             =   "mrlk"
  323.             EndProperty
  324.             BeginProperty ListImage13 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  325.                Picture         =   "货龄分析查询结果.frx":37C3E
  326.                Key             =   "xsxm"
  327.             EndProperty
  328.             BeginProperty ListImage14 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  329.                Picture         =   "货龄分析查询结果.frx":37FD8
  330.                Key             =   "first"
  331.             EndProperty
  332.             BeginProperty ListImage15 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  333.                Picture         =   "货龄分析查询结果.frx":38372
  334.                Key             =   "prev"
  335.             EndProperty
  336.             BeginProperty ListImage16 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  337.                Picture         =   "货龄分析查询结果.frx":3870C
  338.                Key             =   "next"
  339.             EndProperty
  340.             BeginProperty ListImage17 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  341.                Picture         =   "货龄分析查询结果.frx":38AA6
  342.                Key             =   "last"
  343.             EndProperty
  344.             BeginProperty ListImage18 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  345.                Picture         =   "货龄分析查询结果.frx":38E40
  346.                Key             =   "xx"
  347.             EndProperty
  348.             BeginProperty ListImage19 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  349.                Picture         =   "货龄分析查询结果.frx":391DA
  350.                Key             =   "define"
  351.             EndProperty
  352.             BeginProperty ListImage20 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  353.                Picture         =   "货龄分析查询结果.frx":39574
  354.                Key             =   "exec"
  355.             EndProperty
  356.             BeginProperty ListImage21 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  357.                Picture         =   "货龄分析查询结果.frx":3990E
  358.                Key             =   "xz"
  359.             EndProperty
  360.             BeginProperty ListImage22 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  361.                Picture         =   "货龄分析查询结果.frx":39CA8
  362.                Key             =   "sc"
  363.             EndProperty
  364.             BeginProperty ListImage23 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  365.                Picture         =   "货龄分析查询结果.frx":3A042
  366.                Key             =   "sx"
  367.             EndProperty
  368.             BeginProperty ListImage24 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  369.                Picture         =   "货龄分析查询结果.frx":3A3DC
  370.                Key             =   "cx"
  371.             EndProperty
  372.             BeginProperty ListImage25 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  373.                Picture         =   "货龄分析查询结果.frx":3A776
  374.                Key             =   "zd"
  375.             EndProperty
  376.             BeginProperty ListImage26 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  377.                Picture         =   "货龄分析查询结果.frx":3AB10
  378.                Key             =   "dz"
  379.             EndProperty
  380.             BeginProperty ListImage27 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  381.                Picture         =   "货龄分析查询结果.frx":3AEAA
  382.                Key             =   "ph"
  383.             EndProperty
  384.             BeginProperty ListImage28 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  385.                Picture         =   "货龄分析查询结果.frx":3B244
  386.                Key             =   "fz"
  387.             EndProperty
  388.             BeginProperty ListImage29 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  389.                Picture         =   "货龄分析查询结果.frx":3B5DE
  390.                Key             =   "dw"
  391.             EndProperty
  392.             BeginProperty ListImage30 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  393.                Picture         =   "货龄分析查询结果.frx":3B978
  394.                Key             =   "hf"
  395.             EndProperty
  396.             BeginProperty ListImage31 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  397.                Picture         =   "货龄分析查询结果.frx":3BD12
  398.                Key             =   "pz"
  399.             EndProperty
  400.             BeginProperty ListImage32 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  401.                Picture         =   "货龄分析查询结果.frx":3C0AC
  402.                Key             =   "check"
  403.             EndProperty
  404.             BeginProperty ListImage33 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  405.                Picture         =   "货龄分析查询结果.frx":3C446
  406.                Key             =   "qs"
  407.             EndProperty
  408.             BeginProperty ListImage34 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  409.                Picture         =   "货龄分析查询结果.frx":3C7E0
  410.                Key             =   "fullcheck"
  411.             EndProperty
  412.             BeginProperty ListImage35 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  413.                Picture         =   "货龄分析查询结果.frx":3CB7A
  414.                Key             =   "qq"
  415.             EndProperty
  416.             BeginProperty ListImage36 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  417.                Picture         =   "货龄分析查询结果.frx":3CF14
  418.                Key             =   "bcw"
  419.             EndProperty
  420.             BeginProperty ListImage37 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  421.                Picture         =   "货龄分析查询结果.frx":3D2AE
  422.                Key             =   "ye"
  423.             EndProperty
  424.             BeginProperty ListImage38 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  425.                Picture         =   "货龄分析查询结果.frx":3D648
  426.                Key             =   ""
  427.             EndProperty
  428.             BeginProperty ListImage39 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  429.                Picture         =   "货龄分析查询结果.frx":3D9E2
  430.                Key             =   "frist"
  431.             EndProperty
  432.             BeginProperty ListImage40 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  433.                Picture         =   "货龄分析查询结果.frx":3DD7C
  434.                Key             =   "dj"
  435.             EndProperty
  436.          EndProperty
  437.       End
  438.    End
  439.    Begin MSComctlLib.Toolbar SzToolbar 
  440.       Align           =   1  'Align Top
  441.       Height          =   555
  442.       Left            =   0
  443.       TabIndex        =   4
  444.       Top             =   0
  445.       Width           =   11820
  446.       _ExtentX        =   20849
  447.       _ExtentY        =   979
  448.       ButtonWidth     =   820
  449.       ButtonHeight    =   926
  450.       AllowCustomize  =   0   'False
  451.       Appearance      =   1
  452.       Style           =   1
  453.       ImageList       =   "ImageList1"
  454.       _Version        =   393216
  455.       BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  456.          NumButtons      =   12
  457.          BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  458.             Caption         =   "设置"
  459.             Key             =   "ymsz"
  460.             ImageKey        =   "sz"
  461.          EndProperty
  462.          BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  463.             Caption         =   "打印"
  464.             Key             =   "dy"
  465.             ImageKey        =   "dy"
  466.          EndProperty
  467.          BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  468.             Caption         =   "预览"
  469.             Key             =   "yl"
  470.             ImageKey        =   "yl"
  471.          EndProperty
  472.          BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  473.             Style           =   3
  474.          EndProperty
  475.          BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  476.             Caption         =   "查询"
  477.             Key             =   "cx"
  478.             ImageKey        =   "cx"
  479.          EndProperty
  480.          BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  481.             Object.Visible         =   0   'False
  482.             Caption         =   "单据"
  483.             Key             =   "Bill"
  484.             ImageKey        =   "pz"
  485.          EndProperty
  486.          BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  487.             Style           =   3
  488.          EndProperty
  489.          BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  490.             Object.Visible         =   0   'False
  491.             Caption         =   "新增"
  492.             Key             =   "xz"
  493.             ImageKey        =   "xz"
  494.          EndProperty
  495.          BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  496.             Object.Visible         =   0   'False
  497.             Caption         =   "删除"
  498.             Key             =   "sc"
  499.             ImageKey        =   "sc"
  500.          EndProperty
  501.          BeginProperty Button10 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  502.             Object.Visible         =   0   'False
  503.             Style           =   3
  504.          EndProperty
  505.          BeginProperty Button11 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  506.             Caption         =   "帮助"
  507.             Key             =   "bz"
  508.             ImageKey        =   "bz"
  509.          EndProperty
  510.          BeginProperty Button12 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  511.             Caption         =   "退出"
  512.             Key             =   "fh"
  513.             ImageKey        =   "tc"
  514.          EndProperty
  515.       EndProperty
  516.       BorderStyle     =   1
  517.       Begin MSComctlLib.ImageList ImageList1 
  518.          Left            =   6990
  519.          Top             =   30
  520.          _ExtentX        =   1005
  521.          _ExtentY        =   1005
  522.          BackColor       =   -2147483643
  523.          ImageWidth      =   16
  524.          ImageHeight     =   16
  525.          MaskColor       =   12632256
  526.          _Version        =   393216
  527.          BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  528.             NumListImages   =   32
  529.             BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  530.                Picture         =   "货龄分析查询结果.frx":3E116
  531.                Key             =   "sz"
  532.             EndProperty
  533.             BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  534.                Picture         =   "货龄分析查询结果.frx":3E4B0
  535.                Key             =   "dy"
  536.             EndProperty
  537.             BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  538.                Picture         =   "货龄分析查询结果.frx":3E84A
  539.                Key             =   "yl"
  540.             EndProperty
  541.             BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  542.                Picture         =   "货龄分析查询结果.frx":3EBE4
  543.                Key             =   "xg"
  544.             EndProperty
  545.             BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  546.                Picture         =   "货龄分析查询结果.frx":3EF7E
  547.                Key             =   "zh"
  548.             EndProperty
  549.             BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  550.                Picture         =   "货龄分析查询结果.frx":3F318
  551.                Key             =   "sh"
  552.             EndProperty
  553.             BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  554.                Picture         =   "货龄分析查询结果.frx":3F6B2
  555.                Key             =   "bc"
  556.             EndProperty
  557.             BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  558.                Picture         =   "货龄分析查询结果.frx":3FA4C
  559.                Key             =   "fq"
  560.             EndProperty
  561.             BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  562.                Picture         =   "货龄分析查询结果.frx":3FDE6
  563.                Key             =   "bz"
  564.             EndProperty
  565.             BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  566.                Picture         =   "货龄分析查询结果.frx":40180
  567.                Key             =   "tc"
  568.             EndProperty
  569.             BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  570.                Picture         =   "货龄分析查询结果.frx":4051A
  571.                Key             =   "bcgs"
  572.             EndProperty
  573.             BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  574.                Picture         =   "货龄分析查询结果.frx":408B4
  575.                Key             =   "mrlk"
  576.             EndProperty
  577.             BeginProperty ListImage13 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  578.                Picture         =   "货龄分析查询结果.frx":40C4E
  579.                Key             =   "xsxm"
  580.             EndProperty
  581.             BeginProperty ListImage14 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  582.                Picture         =   "货龄分析查询结果.frx":40FE8
  583.                Key             =   "first"
  584.             EndProperty
  585.             BeginProperty ListImage15 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  586.                Picture         =   "货龄分析查询结果.frx":41382
  587.                Key             =   "prev"
  588.             EndProperty
  589.             BeginProperty ListImage16 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  590.                Picture         =   "货龄分析查询结果.frx":4171C
  591.                Key             =   "next"
  592.             EndProperty
  593.             BeginProperty ListImage17 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  594.                Picture         =   "货龄分析查询结果.frx":41AB6
  595.                Key             =   "last"
  596.             EndProperty
  597.             BeginProperty ListImage18 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  598.                Picture         =   "货龄分析查询结果.frx":41E50
  599.                Key             =   "xx"
  600.             EndProperty
  601.             BeginProperty ListImage19 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  602.                Picture         =   "货龄分析查询结果.frx":421EA
  603.                Key             =   "define"
  604.             EndProperty
  605.             BeginProperty ListImage20 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  606.                Picture         =   "货龄分析查询结果.frx":42584
  607.                Key             =   "exec"
  608.             EndProperty
  609.             BeginProperty ListImage21 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  610.                Picture         =   "货龄分析查询结果.frx":4291E
  611.                Key             =   "xz"
  612.             EndProperty
  613.             BeginProperty ListImage22 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  614.                Picture         =   "货龄分析查询结果.frx":42CB8
  615.                Key             =   "sc"
  616.             EndProperty
  617.             BeginProperty ListImage23 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  618.                Picture         =   "货龄分析查询结果.frx":43052
  619.                Key             =   "sx"
  620.             EndProperty
  621.             BeginProperty ListImage24 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  622.                Picture         =   "货龄分析查询结果.frx":433EC
  623.                Key             =   "cx"
  624.             EndProperty
  625.             BeginProperty ListImage25 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  626.                Picture         =   "货龄分析查询结果.frx":43786
  627.                Key             =   "zd"
  628.             EndProperty
  629.             BeginProperty ListImage26 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  630.                Picture         =   "货龄分析查询结果.frx":43B20
  631.                Key             =   "dz"
  632.             EndProperty
  633.             BeginProperty ListImage27 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  634.                Picture         =   "货龄分析查询结果.frx":43EBA
  635.                Key             =   "ph"
  636.             EndProperty
  637.             BeginProperty ListImage28 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  638.                Picture         =   "货龄分析查询结果.frx":44254
  639.                Key             =   "fz"
  640.             EndProperty
  641.             BeginProperty ListImage29 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  642.                Picture         =   "货龄分析查询结果.frx":445EE
  643.                Key             =   "dw"
  644.             EndProperty
  645.             BeginProperty ListImage30 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  646.                Picture         =   "货龄分析查询结果.frx":44988
  647.                Key             =   "hf"
  648.             EndProperty
  649.             BeginProperty ListImage31 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  650.                Picture         =   "货龄分析查询结果.frx":44D22
  651.                Key             =   "pz"
  652.             EndProperty
  653.             BeginProperty ListImage32 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  654.                Picture         =   "货龄分析查询结果.frx":450BC
  655.                Key             =   "check"
  656.             EndProperty
  657.          EndProperty
  658.       End
  659.    End
  660. End
  661. Attribute VB_Name = "Xs_A_WareAnalysis"
  662. Attribute VB_GlobalNameSpace = False
  663. Attribute VB_Creatable = False
  664. Attribute VB_PredeclaredId = True
  665. Attribute VB_Exposed = False
  666. '**************************************************************************
  667. '*    模 块 名 称 :货龄分析
  668. '*    功 能 描 述 :
  669. '*    程序员姓名  :李建伟
  670. '*    最后修改人  :李建伟
  671. '*    最后修改时间:2001/10/06
  672. '*    备        注:程序中所有依实际情况自定义部分均用[>>  <<]括起
  673. '**************************************************************************
  674. Dim ReportTitle As String                '报表主标题
  675. Dim Str_QueryCondi As String             '用户录入查询条件
  676. Dim Rec_BillID As New ADODB.Recordset    '用户查询单据ID动态集
  677. Dim TempOrder As String                  '查询排序
  678. '以下为固定使用变量
  679. Dim Dyymctbl As New DY_Dyymsz            '打印页面窗体变量
  680. Dim GridCode As String                   '显示网格网格代码
  681. Dim GridInf() As Variant                 '整个网格设置信息
  682. Dim Tsxx As String                       '系统提示信息
  683. Dim Qslz As Long                         '网格隐藏(非操作显示)列数
  684. Dim Sjhgd As Double                      '网格数据行高度
  685. Dim Sfxshjwg As Boolean                  '是否显示合计网格
  686. Dim GridBoolean() As Boolean             '网格列信息(布尔型)
  687. Dim GridStr()  As String                 '网格列信息(字符型)
  688. Dim GridInt() As Integer                 '网格列信息(整型)
  689. Dim Szzls As Integer                     '数组总列数(网格列数-1)
  690. Private Sub Form_Resize()                '根据窗体大小来调整网格,标题栏大小(Fixed)
  691.     On Error Resume Next
  692.     With CxbbGrid
  693.         .Width = Me.Width - 160
  694.         .Height = Me.Height - .Top - 400
  695.     End With
  696.     With Pic_Title
  697.         .Width = Me.Width - 160
  698.     End With
  699.     
  700.     GsToolbar.Left = Me.Width - GsToolbar.Width - 140
  701. End Sub
  702. Private Sub Form_Load()                                                   '窗体装入
  703.   
  704.     '调入打印页面设置窗体
  705.     ReportTitle = "货龄分析"
  706.     XtReportCode = "Xs_A_WareAnalysis"
  707.     Load Dyymctbl
  708.       
  709.     '调整标题栏及网格、格式工具条位置(Fixed)
  710.     Pic_Title.Left = 40
  711.     Pic_Title.Top = SzToolbar.Top + SzToolbar.Height - 10
  712.     CxbbGrid.Left = Pic_Title.Left
  713.     CxbbGrid.Top = Pic_Title.Top + Pic_Title.Height + 20
  714.      
  715.     '调 入 网 格(Fixed)
  716.     GridCode = "Xs_A_WareAnalysis"
  717.     Call BzWgcsh(CxbbGrid, GridCode, GridInf(), GridBoolean(), GridInt(), GridStr())
  718.       
  719.     Qslz = GridInf(1)
  720.     Sjhgd = GridInf(2)
  721.     Sfxshjwg = GridInf(7)
  722.     Szzls = CxbbGrid.Cols - 1
  723. End Sub
  724. Private Sub Form_Unload(Cancel As Integer)                                  '窗体卸载
  725.     '卸载条件窗体
  726.     Xs_A_WareAnalysisQuery.UnloadCheck.Value = 1
  727.     Unload Xs_A_WareAnalysisQuery
  728.     
  729.     '卸载打印页面设置窗体
  730.     Unload Dyymctbl
  731. End Sub
  732. Private Sub CxbbGrid_BeforeMoveColumn(ByVal Col As Long, Position As Long)           '网格列发生移动时自动交换网格索引信息
  733.     Call FnBln_RefreshArray(Col, Position, GridStr(), GridInf())
  734. End Sub
  735. Private Sub GsToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)                '网格格式调整(Fixed)
  736.   
  737.     Select Case Button.Key
  738.         Case "bcgs"                                          '保存表格格式
  739.             Call Bcwggs(CxbbGrid, GridCode, GridStr())
  740.         Case "hfmrgs"                                        '恢复默认格式
  741.             Call Hfmrgs(CxbbGrid, GridCode, GridStr())
  742.         Case "szxsxm"                                        '设置显示项目
  743.             Call Szxsxm(CxbbGrid, GridCode)
  744.     End Select
  745. End Sub
  746. Private Sub SzToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)
  747.     
  748.     Select Case Button.Key
  749.         Case "ymsz"                                          '页面设置
  750.             Dyymctbl.Show 1
  751.         Case "yl"                                            '预 览
  752.             Call bbyl(True)
  753.         Case "dy"                                            '打 印
  754.             Call bbyl(False)
  755.         Case "cx"                                            '查 询
  756.             Xs_A_WareAnalysisQuery.Show 1
  757.         Case "Bill"                                          '单 据
  758.         Case "xz"                                            '新 增
  759.             Call Sub_AddBill
  760.         Case "sc"                                            '删 除
  761.             Call Sub_DeleteBill
  762.         Case "bz"                                            '帮 助
  763.             Call F1bz
  764.         Case "fh"                                            '退 出
  765.            Unload Me
  766.     End Select
  767. End Sub
  768. Private Sub Timer1_Timer()                                 '在窗体激活后调入查询程序
  769.     
  770.     Timer1.Enabled = False
  771. '    Xt_Wait.Show
  772. '    Xt_Wait.Refresh
  773.    
  774.     '加快显示速度
  775.     CxbbGrid.Redraw = False
  776.  
  777.     '生成查询结果
  778.     Call Sub_Query(0)
  779.    
  780.     CxbbGrid.Redraw = True
  781.     
  782. '    Xt_Wait.Hide
  783. End Sub
  784. Private Sub Sub_Query(Int_QueryType As Integer)                                     '生成查询结果(Define)
  785.     
  786.     '过程参数:Int_QueryType 0-"点确定按钮"查询  1-"刷新"查询
  787.     Dim Rec_Query As New ADODB.Recordset        '查询结果动态集
  788.     Dim Coljsq As Long                          '网格列计数器
  789.     Dim Jsqte As Long                           '临时动态计数器
  790.     
  791.     Dim TInvDiscount As Long                    '总的销售折扣
  792.     Dim TConDiscount As Long                    '总的发货折扣
  793.     Dim TInvMoney As Long                       '总的销售收入
  794.     Dim TConMoney As Long                       '总的发货额
  795.     Dim TRec_Query As New ADODB.Recordset
  796.     Dim TSqlStr As String
  797.     Dim TInvWholeMoney As Long                  '总的销售额
  798.     Dim TInvTax As Long                         '总的销售税金
  799.     Dim TTConMoney As Long                      '总的退货额
  800.     Dim TTConDiscount As Long                   '总的退货折扣
  801.     Dim TCost As Long                           '总的成本
  802.     Dim TUCost As Long                          '总的毛利
  803.     Dim WareYear As Integer
  804.     '以下为自定义部分[
  805.  
  806.     If Int_QueryType = 0 Then   '0-"点确定按钮"查询
  807.         With Xs_A_WareAnalysisQuery
  808.             Lbl(0).Caption = "部门:" & Trim(.LrText(1).Text)
  809.             Lbl(1).Caption = "客户:" & Trim(.LrText(2))
  810.             Lbl(2).Caption = "销售员:" & Trim(.LrText(4))
  811.             Lbl(3).Caption = "地区:" & Trim(.LrText(6))
  812.             Lbl(6).Caption = "货物编码:" & Trim(.LrText(3))
  813.             Lbl(4).Caption = "日期:" & Trim(.LrText(0))
  814.             Lbl(5).Caption = "销售类型:" & Trim(.LrText(5))
  815.             '生成查询条件
  816.             Str_QueryCondi = " where 1=1 "
  817.             For Jsqte = 1 To 8
  818.                 Select Case Jsqte
  819.                     Case 1  '查询日期范围(起始)
  820.                         If Trim(.LrText(0).Text) <> "" Then
  821.                             Str_QueryCondi = Str_QueryCondi & " And AnalysisDate<=' " & Trim(.LrText(0).Text) & "'"
  822.                         End If
  823.                     Case 2  '部门名称
  824.                         If Trim(.LrText(1).Text) <> "" Then
  825.                             Str_QueryCondi = Str_QueryCondi & " and DeptCode = '" & Trim(.LrText(1).Tag) & "'"
  826.                         End If
  827.                     Case 3  '客户
  828.                         If Trim(.LrText(2).Text) <> "" Then
  829.                             Str_QueryCondi = Str_QueryCondi & " and CusCode like  '" & Trim(.LrText(2).Tag) & "%'"
  830.                         End If
  831.                     Case 4  '存货编码
  832.                         If Trim(.LrText(3).Text) <> "" Then
  833.                             Str_QueryCondi = Str_QueryCondi & " and WareCode = '" & Trim(.LrText(3).Text) & "'"
  834.                         End If
  835.                     Case 5  '销售员
  836.                         If Trim(.LrText(4).Text) <> "" Then
  837.                             Str_QueryCondi = Str_QueryCondi & " and PersonCode = '" & Trim(.LrText(4).Tag) & "'"
  838.                         End If
  839.                     Case 6  '销售类型
  840.                         If Trim(.LrText(5).Text) <> "" Then
  841.                             Str_QueryCondi = Str_QueryCondi & " and SellTypeCode = '" & Trim(.LrText(5).Tag) & "'"
  842.                         End If
  843.                     Case 7  '地区
  844.                         If Trim(.LrText(6).Text) <> "" Then
  845.                             Str_QueryCondi = Str_QueryCondi & " and AreaCode like '" & Trim(.LrText(6).Tag) & "%'"
  846.                         End If
  847.                     Case 8   '分析项目
  848.                         CxbbGrid.ColHidden(Sydz("001", GridStr(), Szzls)) = True
  849.                         CxbbGrid.ColHidden(Sydz("002", GridStr(), Szzls)) = True
  850.                         CxbbGrid.ColHidden(Sydz("003", GridStr(), Szzls)) = True
  851.                         CxbbGrid.ColHidden(Sydz("004", GridStr(), Szzls)) = True
  852.                         CxbbGrid.ColHidden(Sydz("005", GridStr(), Szzls)) = True
  853.                         CxbbGrid.ColHidden(Sydz("006", GridStr(), Szzls)) = True
  854.                         CxbbGrid.ColHidden(Sydz("007", GridStr(), Szzls)) = True
  855.                         TempOrder = ""
  856.                         If .Opt_Check(0).Value Then
  857.                             CxbbGrid.ColHidden(Sydz("001", GridStr(), Szzls)) = False
  858.                             TempOrder = " DeptName"
  859.                         ElseIf .Opt_Check(1).Value Then
  860.                             CxbbGrid.ColHidden(Sydz("002", GridStr(), Szzls)) = False
  861.                             TempOrder = " CusName"
  862.                         ElseIf .Opt_Check(2).Value Then
  863.                             CxbbGrid.ColHidden(Sydz("003", GridStr(), Szzls)) = False
  864.                             TempOrder = " PersonName"
  865.                         ElseIf .Opt_Check(3).Value Then
  866.                             CxbbGrid.ColHidden(Sydz("005", GridStr(), Szzls)) = False
  867.                             CxbbGrid.ColHidden(Sydz("006", GridStr(), Szzls)) = False
  868.                             CxbbGrid.ColHidden(Sydz("007", GridStr(), Szzls)) = False
  869.                             TempOrder = " MName,Model,SaleUnitName"
  870.                         ElseIf .Opt_Check(4).Value Then
  871.                             CxbbGrid.ColHidden(Sydz("004", GridStr(), Szzls)) = False
  872.                             TempOrder = " AreaName"
  873.                         End If
  874.                         Sqlstr = "SELECT " & TempOrder & " ,Sum(ConMoney) ConMoney,Sum(InvMoney) InvMoney,Sum(UInvMoney1) UInvMoney1,Sum(UInvMoney2) UInvMoney2,Sum(UInvMoney3) UInvMoney3,Sum(UInvMoney4) UInvMoney4 from #Xs_TempWareAna  Group by " & TempOrder & " Order By " & TempOrder
  875.                 End Select
  876.             Next Jsqte
  877.             '货龄1
  878.             On Error Resume Next
  879.             Cw_DataEnvi.DataConnect.Execute "drop table [dbo].[#Xs_TempWareAna]"
  880.             Cw_DataEnvi.DataConnect.Execute " CREATE TABLE [dbo].[#Xs_TempWareAna] ( " & _
  881.             "[AutoID] [int] IDENTITY (1, 1) NOT NULL ," & _
  882.             "[DeptCode] [char] (12) COLLATE Chinese_PRC_CI_AS NULL ," & _
  883.             "[DeptName] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ," & _
  884.             "[CusCode] [char] (12) COLLATE Chinese_PRC_CI_AS NULL ," & _
  885.             "[CusName] [nvarchar] (40) COLLATE Chinese_PRC_CI_AS NULL ," & _
  886.             "[PersonCode] [char] (8) COLLATE Chinese_PRC_CI_AS NULL ," & _
  887.             "[PersonName] [nvarchar] (10) COLLATE Chinese_PRC_CI_AS NULL ," & _
  888.             "[WareCode] [char] (20) COLLATE Chinese_PRC_CI_AS NULL ," & _
  889.             "[MName] [nvarchar] (30) COLLATE Chinese_PRC_CI_AS NULL ," & _
  890.             "[model] [char] (40) COLLATE Chinese_PRC_CI_AS NULL ," & _
  891.             "[saleunitname] [char] (20) COLLATE Chinese_PRC_CI_AS NULL ," & _
  892.             "[AreaCode] [char] (10) COLLATE Chinese_PRC_CI_AS NULL ," & _
  893.             "[Areaname] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ," & _
  894.             "[AnalysisDate] [datetime] NULL ," & _
  895.             "[SellTypeCode] [char] (10) COLLATE Chinese_PRC_CI_AS NULL ," & _
  896.             "[ConMoney] [money] NULL ," & _
  897.             "[InvMoney] [money] NULL ," & _
  898.             "[UInvMoney1] [money] NULL ," & _
  899.             "[UInvMoney2] [money] NULL ," & _
  900.             "[UInvMoney3] [money] NULL ," & _
  901.             "[UInvMoney4] [money] NULL)"
  902.             CxbbGrid.ColHidden(Sydz("013", GridStr(), Szzls)) = False
  903.             CxbbGrid.ColHidden(Sydz("014", GridStr(), Szzls)) = False
  904.             CxbbGrid.ColHidden(Sydz("015", GridStr(), Szzls)) = False
  905.             CxbbGrid.ColHidden(Sydz("016", GridStr(), Szzls)) = False
  906.             If Trim(.LrText(7).Text) <> "" Then
  907.                 CxbbGrid.TextMatrix(0, Sydz("011", GridStr(), Szzls)) = "1—" & Trim(.LrText(7).Text) & "天"
  908.                 CxbbGrid.TextMatrix(0, Sydz("012", GridStr(), Szzls)) = "1—" & Trim(.LrText(7).Text) & "天"
  909.                 TSqlStr = "insert into #Xs_TempWareAna SELECT DeptCode,DeptName,CusCode,CusName,PersonCode,PersonName,WareCode,MName,Model,SaleUnitName,AreaCode,Areaname,AnalysisDate,SellTypeCode,ConMoney,InvMoney,ConMoney-InvMoney,0,0,0 from Xs_V_WareAnalysis " & Str_QueryCondi & " and datediff(day,AnalysisDate,'" & Trim(.LrText(0).Text) & "')< =" & Trim(.LrText(7).Text)
  910.                 Cw_DataEnvi.DataConnect.Execute TSqlStr
  911.                 If Trim(.LrText(8).Text) <> "" Then
  912.                     CxbbGrid.TextMatrix(0, Sydz("013", GridStr(), Szzls)) = Trim(.LrText(7).Text) & "—" & Trim(.LrText(8).Text) & "天"
  913.                     CxbbGrid.TextMatrix(0, Sydz("014", GridStr(), Szzls)) = Trim(.LrText(7).Text) & "—" & Trim(.LrText(8).Text) & "天"
  914.                     TSqlStr = "insert into #Xs_TempWareAna SELECT DeptCode,DeptName,CusCode,CusName,PersonCode,PersonName,WareCode,MName,Model,SaleUnitName,AreaCode,Areaname,AnalysisDate,SellTypeCode,ConMoney,InvMoney,0,ConMoney-InvMoney,0,0 from Xs_V_WareAnalysis " & Str_QueryCondi & " and " & Trim(.LrText(7).Text) & "< datediff(day,AnalysisDate,'" & Trim(.LrText(0).Text) & "') and datediff(day,AnalysisDate,'" & Trim(.LrText(0).Text) & "')< =" & Trim(.LrText(8).Text)
  915.                     Cw_DataEnvi.DataConnect.Execute TSqlStr
  916.                     If Trim(.LrText(9).Text) <> "" Then
  917.                         CxbbGrid.TextMatrix(0, Sydz("015", GridStr(), Szzls)) = Trim(.LrText(8).Text) & "—" & Trim(.LrText(9).Text) & "天"
  918.                         CxbbGrid.TextMatrix(0, Sydz("016", GridStr(), Szzls)) = Trim(.LrText(8).Text) & "—" & Trim(.LrText(9).Text) & "天"
  919.                         CxbbGrid.TextMatrix(0, Sydz("017", GridStr(), Szzls)) = Trim(.LrText(9).Text) & "天以上"
  920.                         CxbbGrid.TextMatrix(0, Sydz("018", GridStr(), Szzls)) = Trim(.LrText(9).Text) & "天以上"
  921.                         TSqlStr = "insert into #Xs_TempWareAna SELECT DeptCode,DeptName,CusCode,CusName,PersonCode,PersonName,WareCode,MName,Model,SaleUnitName,AreaCode,Areaname,AnalysisDate,SellTypeCode,ConMoney,InvMoney,0,0,ConMoney-InvMoney,0 from Xs_V_WareAnalysis " & Str_QueryCondi & " and " & Trim(.LrText(8).Text) & "<datediff(day,AnalysisDate,'" & Trim(.LrText(0).Text) & "') and datediff(day,AnalysisDate,'" & Trim(.LrText(0).Text) & "')< =" & Trim(.LrText(9).Text)
  922.                         Cw_DataEnvi.DataConnect.Execute TSqlStr
  923.                         TSqlStr = "insert into #Xs_TempWareAna SELECT DeptCode,DeptName,CusCode,CusName,PersonCode,PersonName,WareCode,MName,Model,SaleUnitName,AreaCode,Areaname,AnalysisDate,SellTypeCode,ConMoney,InvMoney,0,0,0,ConMoney-InvMoney from Xs_V_WareAnalysis " & Str_QueryCondi & " and datediff(day,AnalysisDate,'" & Trim(.LrText(0).Text) & "')>" & Trim(.LrText(9).Text)
  924.                         Cw_DataEnvi.DataConnect.Execute TSqlStr
  925.                     Else
  926.                         CxbbGrid.ColHidden(Sydz("015", GridStr(), Szzls)) = True
  927.                         CxbbGrid.ColHidden(Sydz("016", GridStr(), Szzls)) = True
  928.                         CxbbGrid.TextMatrix(0, Sydz("017", GridStr(), Szzls)) = Trim(.LrText(8).Text) & "天以上"
  929.                         CxbbGrid.TextMatrix(0, Sydz("018", GridStr(), Szzls)) = Trim(.LrText(8).Text) & "天以上"
  930.                         TSqlStr = "insert into #Xs_TempWareAna SELECT DeptCode,DeptName,CusCode,CusName,PersonCode,PersonName,WareCode,MName,Model,SaleUnitName,AreaCode,Areaname,AnalysisDate,SellTypeCode,ConMoney,InvMoney,0,0,0,ConMoney-InvMoney from Xs_V_WareAnalysis " & Str_QueryCondi & " and datediff(day,AnalysisDate,'" & Trim(.LrText(0).Text) & "')>" & Trim(.LrText(8).Text)
  931.                         Cw_DataEnvi.DataConnect.Execute TSqlStr
  932.                     End If
  933.                 Else
  934.                     CxbbGrid.ColHidden(Sydz("013", GridStr(), Szzls)) = True
  935.                     CxbbGrid.ColHidden(Sydz("014", GridStr(), Szzls)) = True
  936.                     CxbbGrid.ColHidden(Sydz("015", GridStr(), Szzls)) = True
  937.                     CxbbGrid.ColHidden(Sydz("016", GridStr(), Szzls)) = True
  938.                     CxbbGrid.TextMatrix(0, Sydz("017", GridStr(), Szzls)) = Trim(.LrText(7).Text) & "天以上"
  939.                     CxbbGrid.TextMatrix(0, Sydz("018", GridStr(), Szzls)) = Trim(.LrText(7).Text) & "天以上"
  940.                     TSqlStr = "insert into #Xs_TempWareAna SELECT DeptCode,DeptName,CusCode,CusName,PersonCode,PersonName,WareCode,MName,Model,SaleUnitName,AreaCode,Areaname,AnalysisDate,SellTypeCode,ConMoney,InvMoney,0,0,0,ConMoney-InvMoney from Xs_V_WareAnalysis " & Str_QueryCondi & " and datediff(day,AnalysisDate,'" & Trim(.LrText(0).Text) & "')>" & Trim(.LrText(7).Text)
  941.                     Cw_DataEnvi.DataConnect.Execute TSqlStr
  942.                 End If
  943.                 
  944.             End If
  945.         End With
  946.     Else
  947.         '1-"刷新"查询
  948.         If Str_QueryCondi = "" Then
  949.             Str_QueryCondi = " where 1=2 "
  950.         End If
  951.     End If
  952.     Set Rec_Query = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  953.     With Rec_Query
  954.         CxbbGrid.Rows = CxbbGrid.FixedRows
  955.         Jsqte = CxbbGrid.FixedRows
  956.        Do While Not .EOF
  957.         If Val(Trim(.Fields("Conmoney") & "")) - Val(Trim(.Fields("InvMoney") & "")) = 0 And Val(Trim(.Fields("Conmoney") & "")) = 0 And Val(Trim(.Fields("InvMoney") & "")) = 0 Then
  958.         Else
  959.            CxbbGrid.AddItem ""
  960.            '[>>自定义填充内容
  961.            If Xs_A_WareAnalysisQuery.Opt_Check(0) Then
  962.                CxbbGrid.TextMatrix(Jsqte, Sydz("001", GridStr(), Szzls)) = Trim(.Fields("DeptName") & "")                                                      '部门
  963.            ElseIf Xs_A_WareAnalysisQuery.Opt_Check(1) Then
  964.                CxbbGrid.TextMatrix(Jsqte, Sydz("002", GridStr(), Szzls)) = Trim(.Fields("CusName") & "")                                                       '客户
  965.            ElseIf Xs_A_WareAnalysisQuery.Opt_Check(2) Then
  966.                CxbbGrid.TextMatrix(Jsqte, Sydz("003", GridStr(), Szzls)) = Trim(.Fields("PersonName") & "")                                                    '销售员
  967.            ElseIf Xs_A_WareAnalysisQuery.Opt_Check(3) Then
  968.                CxbbGrid.TextMatrix(Jsqte, Sydz("005", GridStr(), Szzls)) = Trim(.Fields("MName") & "")                                                         '货物
  969.                CxbbGrid.TextMatrix(Jsqte, Sydz("006", GridStr(), Szzls)) = Trim(.Fields("Model") & "")                                                         '规格
  970.                CxbbGrid.TextMatrix(Jsqte, Sydz("007", GridStr(), Szzls)) = Trim(.Fields("SaleUnitName") & "")                                                  '销售单位
  971.            ElseIf Xs_A_WareAnalysisQuery.Opt_Check(4) Then
  972.                CxbbGrid.TextMatrix(Jsqte, Sydz("004", GridStr(), Szzls)) = Trim(.Fields("AreaName") & "")                                                      '地区
  973.            End If
  974.            If Val(Trim(.Fields("Conmoney") & "")) <> 0 Then
  975.                CxbbGrid.TextMatrix(Jsqte, Sydz("008", GridStr(), Szzls)) = Trim(.Fields("Conmoney") & "")                                                      '发货金额
  976.            End If
  977.            If Val(Trim(.Fields("InvMoney") & "")) <> 0 Then
  978.                CxbbGrid.TextMatrix(Jsqte, Sydz("009", GridStr(), Szzls)) = Trim(.Fields("InvMoney") & "")                                                       '开票金额
  979.            End If
  980.            If Val(Trim(.Fields("Conmoney") & "")) - Val(Trim(.Fields("InvMoney") & "")) <> 0 Then
  981.                CxbbGrid.TextMatrix(Jsqte, Sydz("010", GridStr(), Szzls)) = Val(Trim(.Fields("Conmoney") & "")) - Val(Trim(.Fields("InvMoney") & ""))            '未开票金额
  982.                If Val(Trim(.Fields("UInvMoney1") & "")) <> 0 Then
  983.                CxbbGrid.TextMatrix(Jsqte, Sydz("011", GridStr(), Szzls)) = Val(Trim(.Fields("UInvMoney1") & ""))
  984.                CxbbGrid.TextMatrix(Jsqte, Sydz("012", GridStr(), Szzls)) = Format(Val(Trim(.Fields("UInvMoney1") & "")) / (Val(Trim(.Fields("Conmoney") & "")) - Val(Trim(.Fields("InvMoney") & ""))) * 100, "0.00")  '货龄1%
  985.                End If
  986.                If Val(Trim(.Fields("UInvMoney2") & "")) <> 0 Then
  987.                CxbbGrid.TextMatrix(Jsqte, Sydz("013", GridStr(), Szzls)) = Val(Trim(.Fields("UInvMoney2") & ""))
  988.                CxbbGrid.TextMatrix(Jsqte, Sydz("014", GridStr(), Szzls)) = Format(Val(Trim(.Fields("UInvMoney2") & "")) / (Val(Trim(.Fields("Conmoney") & "")) - Val(Trim(.Fields("InvMoney") & ""))) * 100, "0.00")  '货龄2%
  989.                End If
  990.                If Val(Trim(.Fields("UInvMoney3") & "")) <> 0 Then
  991.                CxbbGrid.TextMatrix(Jsqte, Sydz("015", GridStr(), Szzls)) = Val(Trim(.Fields("UInvMoney3") & ""))
  992.                CxbbGrid.TextMatrix(Jsqte, Sydz("016", GridStr(), Szzls)) = Format(Val(Trim(.Fields("UInvMoney3") & "")) / (Val(Trim(.Fields("Conmoney") & "")) - Val(Trim(.Fields("InvMoney") & ""))) * 100, "0.00")  '货龄3%
  993.                End If
  994.                If Val(Trim(.Fields("UInvMoney4") & "")) <> 0 Then
  995.                CxbbGrid.TextMatrix(Jsqte, Sydz("017", GridStr(), Szzls)) = Val(Trim(.Fields("UInvMoney4") & ""))
  996.                CxbbGrid.TextMatrix(Jsqte, Sydz("018", GridStr(), Szzls)) = Format(Val(Trim(.Fields("UInvMoney4") & "")) / (Val(Trim(.Fields("Conmoney") & "")) - Val(Trim(.Fields("InvMoney") & ""))) * 100, "0.00")  '货龄4%
  997.                End If
  998.            End If
  999.            '<<]
  1000.            '设置数据行高度(Fixed)
  1001.            CxbbGrid.RowHeight(Jsqte) = Sjhgd
  1002.     
  1003.            '动态集指针加1,同时将计数器加1(Fixed)
  1004.            Jsqte = Jsqte + 1
  1005.             End If
  1006.             .MoveNext
  1007.         Loop
  1008.     End With
  1009.     '合计
  1010.     CxbbGrid.AddItem ""
  1011.     CxbbGrid.TextMatrix(CxbbGrid.Rows - 1, Sydz("001", GridStr(), Szzls)) = "合计"
  1012.     CxbbGrid.TextMatrix(CxbbGrid.Rows - 1, Sydz("002", GridStr(), Szzls)) = "合计"
  1013.     CxbbGrid.TextMatrix(CxbbGrid.Rows - 1, Sydz("003", GridStr(), Szzls)) = "合计"
  1014.     CxbbGrid.TextMatrix(CxbbGrid.Rows - 1, Sydz("004", GridStr(), Szzls)) = "合计"
  1015.     CxbbGrid.TextMatrix(CxbbGrid.Rows - 1, Sydz("005", GridStr(), Szzls)) = "合计"
  1016.     For Coljsq = Qslz To CxbbGrid.Cols - 1
  1017.         Call Sjhj(Coljsq)
  1018.     Next Coljsq
  1019.     If CxbbGrid.TextMatrix(Jsqte, Sydz("010", GridStr(), Szzls)) <> "" Then
  1020.         If Val(CxbbGrid.TextMatrix(Jsqte, Sydz("011", GridStr(), Szzls))) <> 0 Then
  1021.         CxbbGrid.TextMatrix(Jsqte, Sydz("012", GridStr(), Szzls)) = Format(Val(CxbbGrid.TextMatrix(Jsqte, Sydz("011", GridStr(), Szzls))) / Val(CxbbGrid.TextMatrix(Jsqte, Sydz("010", GridStr(), Szzls))) * 100, "0.00")                                                 '退货金额
  1022.         End If
  1023.         If Val(CxbbGrid.TextMatrix(Jsqte, Sydz("013", GridStr(), Szzls))) <> 0 Then
  1024.         CxbbGrid.TextMatrix(Jsqte, Sydz("014", GridStr(), Szzls)) = Format(Val(CxbbGrid.TextMatrix(Jsqte, Sydz("013", GridStr(), Szzls))) / Val(CxbbGrid.TextMatrix(Jsqte, Sydz("010", GridStr(), Szzls))) * 100, "0.00")                                                 '退货金额
  1025.         End If
  1026.         If Val(CxbbGrid.TextMatrix(Jsqte, Sydz("015", GridStr(), Szzls))) <> 0 Then
  1027.         CxbbGrid.TextMatrix(Jsqte, Sydz("016", GridStr(), Szzls)) = Format(Val(CxbbGrid.TextMatrix(Jsqte, Sydz("015", GridStr(), Szzls))) / Val(CxbbGrid.TextMatrix(Jsqte, Sydz("010", GridStr(), Szzls))) * 100, "0.00")                                                 '退货金额
  1028.         End If
  1029.         If Val(CxbbGrid.TextMatrix(Jsqte, Sydz("017", GridStr(), Szzls))) <> 0 Then
  1030.         CxbbGrid.TextMatrix(Jsqte, Sydz("018", GridStr(), Szzls)) = Format(Val(CxbbGrid.TextMatrix(Jsqte, Sydz("017", GridStr(), Szzls))) / Val(CxbbGrid.TextMatrix(Jsqte, Sydz("010", GridStr(), Szzls))) * 100, "0.00")                                                 '退货金额
  1031.         End If
  1032.     End If
  1033.     ']以上为用户自定义部分
  1034. End Sub
  1035. Private Sub Sjhj(Hjwgl As Long)                                         '网格列数据合计
  1036.     
  1037.     Dim Hjjg As Double
  1038.     If Not GridBoolean(Hjwgl, 4) Then
  1039.         Exit Sub
  1040.     End If
  1041.     With CxbbGrid
  1042.         Hjjg = 0
  1043.         For Jsqte = .FixedRows To .Rows - 2
  1044.                 If Trim(.TextMatrix(Jsqte, Hjwgl)) <> "" Then
  1045.                     Hjjg = Hjjg + Val(.TextMatrix(Jsqte, Hjwgl))
  1046.                 End If
  1047.         Next Jsqte
  1048.         If GridBoolean(Hjwgl, 5) And Hjjg = 0 Then
  1049.             CxbbGrid.TextMatrix(.Rows - 1, Hjwgl) = ""
  1050.         Else
  1051.             CxbbGrid.TextMatrix(.Rows - 1, Hjwgl) = Hjjg
  1052.         End If
  1053.     End With
  1054. End Sub
  1055. Private Sub Sub_AddBill()                                              '新增单据
  1056.    
  1057.     With Xs_O_OrderBill
  1058.    
  1059.         '设置单据处理为填制单据状态
  1060. ''        .Lab_Djclzt.Caption = "1"
  1061.          Xtcdcs = "1"
  1062.         .Show 1
  1063.     End With
  1064.        
  1065.     If Xtfhcs = "1" Then
  1066.         Tsxx = "销售订单发生变化,是否刷新销售订单列表?"
  1067.         Yhanswer = Xtxxts(Tsxx, 2, 2)
  1068.         If Yhanswer = 1 Then
  1069.             Xt_Wait.Show
  1070.             Xt_Wait.Refresh
  1071.    
  1072.             '加快显示速度
  1073.             CxbbGrid.Redraw = False
  1074.  
  1075.             '生成查询结果
  1076.             Call Sub_Query(1)
  1077.    
  1078.             CxbbGrid.Redraw = True
  1079.             Xt_Wait.Hide
  1080.         End If
  1081.     End If
  1082.    
  1083. End Sub
  1084. Private Sub Sub_DeleteBill()                                            '删除选中当前销售订单
  1085.     
  1086.     Dim YAnswer As Integer
  1087.     Dim Lng_BillID As Long           '单据标识
  1088.   
  1089.     '非数据行退出
  1090.     If CxbbGrid.Row < CxbbGrid.FixedRows Or Val(CxbbGrid.TextMatrix(CxbbGrid.Row, 0)) = 0 Then
  1091.         Exit Sub
  1092.     End If
  1093.   
  1094.     Tsxx = "请确认是否删除当前销售订单?"
  1095.     Yhanswer = Xtxxts(Tsxx, 2, 2)
  1096.   
  1097.     If Yhanswer = 1 Then
  1098.         '1.判断当前销售订单是否允许删除
  1099.         If Not Fun_AllowDelete Then
  1100.             Exit Sub
  1101.         End If
  1102.   
  1103.         '2.删除单据所有内容
  1104.         Lng_BillID = Val(CxbbGrid.TextMatrix(CxbbGrid.Row, 0))
  1105.         On Error GoTo Swcwcl
  1106.         Cw_DataEnvi.DataConnect.BeginTrans
  1107.         Cw_DataEnvi.DataConnect.Execute ("Delete XS_OrderBillMain Where OrderBillMainId=" & Lng_BillID)        '删除单据主表内容
  1108.         Cw_DataEnvi.DataConnect.Execute ("Delete XS_OrderBillSub Where OrderBillMainId=" & Lng_BillID)         '删除单据子表内容
  1109.         Cw_DataEnvi.DataConnect.CommitTrans
  1110.       
  1111.         '删除网格中单据数据
  1112.         Jsqte = CxbbGrid.FixedRows
  1113.         Do While Jsqte <= CxbbGrid.Rows - 1
  1114.             If Val(CxbbGrid.TextMatrix(Jsqte, 0)) = Lng_BillID Then
  1115.                 CxbbGrid.RemoveItem (CxbbGrid.Row)
  1116.             Else
  1117.                 Jsqte = Jsqte + 1
  1118.             End If
  1119.         Loop
  1120.     Else
  1121.         Exit Sub
  1122.     End If
  1123.     Exit Sub
  1124. Swcwcl:
  1125.     Cw_DataEnvi.DataConnect.RollbackTrans
  1126.     Tsxx = "删除销售订单过程中出现未知错误,程序自动恢复删除前状态!"
  1127.     Call Xtxxts(Tsxx, 0, 1)
  1128.     Exit Sub
  1129.   
  1130. End Sub
  1131. Private Function Fun_AllowDelete() As Boolean                                        '判断当前单据是否允许删除
  1132.   
  1133.     Dim RecTemp As New ADODB.Recordset     '临时使用动态集
  1134.     Dim Sqlstr As String                   '查询字符串
  1135.     Dim Lng_BillID As Long                 '单据ID
  1136.   
  1137.     Lng_BillID = Val(CxbbGrid.TextMatrix(CxbbGrid.Row, 0))
  1138.     Sqlstr = "Select Checker From XS_OrderBillMain Where OrderBillMainId=" & Lng_BillID
  1139.     Set RecTemp = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  1140.     With RecTemp
  1141.         If Not .EOF Then
  1142.             If Trim(.Fields("Checker") & "") <> "" Then
  1143.                 Tsxx = "该销售订单已审核确认,不能删除!"
  1144.                 Call Xtxxts(Tsxx, 0, 4)
  1145.                 Exit Function
  1146.             End If
  1147.             End If
  1148.     End With
  1149.     Fun_AllowDelete = True
  1150.   
  1151. End Function
  1152. Private Sub bbyl(bbylte As Boolean)                    '报表打印预览
  1153.     
  1154.     Dim Bbzbt$, Bbxbt() As String, bbxbtzzxs() As Integer, Bbxbtgs As Integer
  1155.     Dim Bbbwh() As String, Bbbwhzzxs() As Integer, Bbbwhgs As Integer
  1156.     Bbxbtgs = 2                                          '报 表 小 标 题 行 数
  1157.     Bbbwhgs = 0                                          '报 表 表 尾 行 数
  1158.     ReDim Bbxbt(1 To Bbxbtgs)
  1159.     ReDim bbxbtzzxs(1 To Bbxbtgs)
  1160.     If Bbbwhgs <> 0 Then
  1161.         ReDim Bbbwh(1 To Bbbwhgs)
  1162.         ReDim Bbbwhzzxs(1 To Bbbwhgs)
  1163.     End If
  1164.     Bbzbt = ReportTitle
  1165.     Bbxbt(1) = Space(2) + Fun_FormatOutPut(Trim(Lbl(4).Caption), 30)
  1166.     Bbxbt(1) = Bbxbt(1) + Fun_FormatOutPut(Trim(Lbl(0).Caption), 25)
  1167.     Bbxbt(1) = Bbxbt(1) + Fun_FormatOutPut(Trim(Lbl(5).Caption), 20)
  1168.     Bbxbt(1) = Bbxbt(1) + Fun_FormatOutPut(Trim(Lbl(2).Caption), 20)
  1169.     Bbxbt(2) = Space(2) + Fun_FormatOutPut(Trim(Lbl(1).Caption), 30)
  1170.     Bbxbt(2) = Bbxbt(2) + Fun_FormatOutPut(Trim(Lbl(3).Caption), 25)
  1171.     Bbxbt(2) = Bbxbt(2) + Fun_FormatOutPut(Trim(Lbl(6).Caption), 20)
  1172.     bbxbtzzxs(1) = 0                                     '报表行组织形式(0-居左 1-居中 2-居右)
  1173.     Call Scyxsjb(CxbbGrid)                               '生成报表数据
  1174.     Call Scdybb(Dyymctbl, Bbzbt, Bbxbt(), bbxbtzzxs(), Bbxbtgs, Bbbwh(), Bbbwhzzxs(), Bbbwhgs, bbylte)
  1175.     If Not bbylte Then
  1176.         Unload DY_Tybbyldy
  1177.     End If
  1178. End Sub