⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmminus.frm

📁 < 飞鸿商品>>零售是基于VB+SQL2000开的商品零售管理系统. 开发的很好.可以一看
💻 FRM
字号:
VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "msflxgrd.ocx"
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Begin VB.Form frmMinus 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "冲减应付账款"
   ClientHeight    =   6105
   ClientLeft      =   45
   ClientTop       =   435
   ClientWidth     =   8760
   BeginProperty Font 
      Name            =   "宋体"
      Size            =   10.5
      Charset         =   134
      Weight          =   400
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   Icon            =   "frmMinus.frx":0000
   LinkTopic       =   "Form1"
   MDIChild        =   -1  'True
   ScaleHeight     =   6105
   ScaleWidth      =   8760
   Begin VB.ComboBox cobOpr 
      BackColor       =   &H00FFFFFF&
      Height          =   330
      Left            =   1230
      Style           =   2  'Dropdown List
      TabIndex        =   3
      Top             =   780
      Width           =   1215
   End
   Begin VB.PictureBox pic 
      Height          =   1245
      Left            =   60
      ScaleHeight     =   1185
      ScaleWidth      =   8565
      TabIndex        =   12
      Top             =   4770
      Width           =   8625
      Begin VB.TextBox txt 
         Height          =   345
         Left            =   960
         TabIndex        =   20
         Top             =   690
         Width           =   1935
      End
      Begin Manage.xpcmdbutton cmdCancel 
         Height          =   435
         Left            =   6540
         TabIndex        =   21
         Top             =   630
         Width           =   1425
         _ExtentX        =   2514
         _ExtentY        =   767
         Caption         =   "取  消"
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
      End
      Begin Manage.xpcmdbutton cmdSave 
         Height          =   435
         Left            =   4170
         TabIndex        =   22
         Top             =   660
         Width           =   1425
         _ExtentX        =   2514
         _ExtentY        =   767
         Caption         =   "保  存"
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
      End
      Begin VB.Label Label11 
         Caption         =   "付  款:"
         Height          =   210
         Left            =   180
         TabIndex        =   19
         Top             =   750
         Width           =   840
      End
      Begin VB.Label lblCash 
         BorderStyle     =   1  'Fixed Single
         Height          =   285
         Left            =   6690
         TabIndex        =   18
         Top             =   150
         Width           =   1725
      End
      Begin VB.Label Label9 
         Caption         =   "欠款额:"
         Height          =   210
         Left            =   5910
         TabIndex        =   17
         Top             =   180
         Width           =   840
      End
      Begin VB.Label lblClient 
         BorderStyle     =   1  'Fixed Single
         Height          =   285
         Left            =   3930
         TabIndex        =   16
         Top             =   180
         Width           =   1755
      End
      Begin VB.Label Label7 
         Caption         =   "客商:"
         Height          =   210
         Left            =   3330
         TabIndex        =   15
         Top             =   240
         Width           =   630
      End
      Begin VB.Label lblID 
         BorderStyle     =   1  'Fixed Single
         Height          =   285
         Left            =   960
         TabIndex        =   14
         Top             =   180
         Width           =   1935
      End
      Begin VB.Label Label4 
         Caption         =   "单据号:"
         Height          =   210
         Left            =   180
         TabIndex        =   13
         Top             =   240
         Width           =   840
      End
   End
   Begin Manage.xpcmdbutton cmdMinus 
      Height          =   405
      Left            =   7110
      TabIndex        =   11
      Top             =   690
      Width           =   1365
      _ExtentX        =   2408
      _ExtentY        =   714
      Caption         =   "冲  减"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
   End
   Begin VB.CheckBox chk 
      Caption         =   "数额"
      Height          =   285
      Left            =   420
      TabIndex        =   4
      Top             =   810
      Width           =   795
   End
   Begin VB.TextBox txtValue 
      Height          =   315
      Left            =   2970
      TabIndex        =   2
      Top             =   780
      Width           =   2625
   End
   Begin MSFlexGridLib.MSFlexGrid Grid 
      Height          =   3435
      Left            =   60
      TabIndex        =   0
      Top             =   1290
      Width           =   8625
      _ExtentX        =   15214
      _ExtentY        =   6059
      _Version        =   393216
      Cols            =   6
      FixedCols       =   0
      SelectionMode   =   1
      FormatString    =   "入库单据号  |^ 入库日期  |^ 客商名称      |^ 入库总额  |^ 应付金额  |^ 已付金额  "
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
   End
   Begin Manage.xpcmdbutton cmdExec 
      Height          =   405
      Left            =   7110
      TabIndex        =   1
      Top             =   180
      Width           =   1365
      _ExtentX        =   2408
      _ExtentY        =   714
      Caption         =   "查  询"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
   End
   Begin MSComCtl2.DTPicker dtp2 
      Height          =   315
      Left            =   3390
      TabIndex        =   5
      Top             =   270
      Width           =   2235
      _ExtentX        =   3942
      _ExtentY        =   556
      _Version        =   393216
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Format          =   49610753
      CurrentDate     =   37700
   End
   Begin MSComCtl2.DTPicker dtp1 
      Height          =   315
      Left            =   690
      TabIndex        =   6
      Top             =   270
      Width           =   2235
      _ExtentX        =   3942
      _ExtentY        =   556
      _Version        =   393216
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Format          =   49610753
      CurrentDate     =   37700
   End
   Begin VB.Line Line2 
      BorderColor     =   &H00C0C0C0&
      Index           =   0
      X1              =   90
      X2              =   90
      Y1              =   90
      Y2              =   1230
   End
   Begin VB.Line Line1 
      BorderColor     =   &H00FFFFFF&
      Index           =   1
      X1              =   90
      X2              =   8700
      Y1              =   1200
      Y2              =   1200
   End
   Begin VB.Line Line1 
      BorderColor     =   &H00C0C0C0&
      Index           =   0
      X1              =   120
      X2              =   8700
      Y1              =   90
      Y2              =   90
   End
   Begin VB.Line Line2 
      BorderColor     =   &H00FFFFFF&
      Index           =   1
      X1              =   8670
      X2              =   8670
      Y1              =   90
      Y2              =   1230
   End
   Begin VB.Label Label3 
      Caption         =   "期间"
      Height          =   210
      Left            =   5760
      TabIndex        =   10
      Top             =   330
      Width           =   420
   End
   Begin VB.Label Label2 
      Caption         =   "至"
      Height          =   255
      Left            =   3030
      TabIndex        =   9
      Top             =   330
      Width           =   225
   End
   Begin VB.Label Label1 
      Caption         =   "由"
      Height          =   255
      Left            =   420
      TabIndex        =   8
      Top             =   330
      Width           =   285
   End
   Begin VB.Label Label5 
      Caption         =   "¥"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   210
      Left            =   2730
      TabIndex        =   7
      Top             =   840
      Width           =   225
   End
End
Attribute VB_Name = "frmMinus"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Sub chk_Click()
  If chk.Value = 1 Then
    cobOpr.Enabled = True
    txtValue.Enabled = True
    cobOpr.BackColor = &HFFFFFF
    txtValue.BackColor = &HFFFFFF
  Else
    cobOpr.ListIndex = -1
    txtValue.Text = ""
    cobOpr.Enabled = False
    txtValue.Enabled = False
    cobOpr.BackColor = &H8000000F
    txtValue.BackColor = &H8000000F
  End If
End Sub

Private Sub cmdCancel_Click()
  
  Grid.Height = 4755
  cmdMinus.Enabled = True
  cmdExec.Enabled = True
  Grid.Enabled = True
  pic.Visible = False
  
End Sub

Private Sub cmdExec_Click()
Dim SQL As String

SQL = "select a.id,b.indate,clientname,b.[sum],yingfu,yifu from yingfu_list as a," & _
      "ruku_index as b where a.id=b.id and (b.indate between '" & _
      Format(dtp1.Value, "yyyy-mm-dd") & "' and '" & Format(dtp2.Value, "yyyy-mm-dd") & "') "
If chk.Value = 1 Then
  If txtValue.Text = "" Then MsgBox "请输入要查询的数值!", 64: txtValue.SetFocus: Exit Sub
  Select Case cobOpr.ListIndex
    Case 0
      SQL = SQL & " and yingfu=" & txtValue.Text
    Case 1
      SQL = SQL & " and yingfu>" & txtValue.Text
    Case 2
      SQL = SQL & " and yingfu<" & txtValue.Text
  End Select
End If

FillGrid "入库单据号  |^ 入库日期  |^ 客商名称      |^ 入库总额  |^ 应付金额  |^ 已付金额  ", SQL, Grid, 6

End Sub

Private Sub cmdMinus_Click()
If Grid.Text = "" Then Exit Sub

If Grid.RowSel < 1 Then Exit Sub
  
  lblID.Caption = Grid.TextMatrix(Grid.RowSel, 0)
  lblClient.Caption = Grid.TextMatrix(Grid.RowSel, 1)
  lblCash.Caption = Grid.TextMatrix(Grid.RowSel, 4)
  
  cmdMinus.Enabled = False
  cmdExec.Enabled = False
  Grid.Enabled = False
  pic.Visible = True
  Grid.Height = 3435
  
  txt.Text = Grid.TextMatrix(Grid.RowSel, 4)
  txt.SelStart = 0
  txt.SelLength = Len(txt.Text)
  
End Sub

Private Sub cmdSave_Click()
Dim Cmd As ADODB.Command
Dim SQL As String

If IsNumeric(txt.Text) = False Then MsgBox "您填写的付款金额不是有效的数字!", 64: Exit Sub

Set Cmd = New ADODB.Command
Cmd.ActiveConnection = Conn
SQL = "execute minusyifu  '" & lblID.Caption & "'," & txt.Text & ",'" & Format(Date$, "yyyy-mm-dd") & "'"
Cmd.CommandText = SQL
Cmd.CommandType = adCmdText
Cmd.Execute

If Val(Grid.TextMatrix(Grid.RowSel, 4)) = txt.Text Then
  If Grid.Rows = 2 Then
    Grid.Clear
    Grid.FormatString = "入库单据号  |^ 入库日期  |^ 客商名称      |^ 入库总额  |^ 应付金额  |^ 已付金额  "
  Else
    Grid.RemoveItem Grid.RowSel
  End If
Else
  Grid.TextMatrix(Grid.RowSel, 4) = CStr(Val(Grid.TextMatrix(Grid.RowSel, 4)) - Val(txt.Text))
  Grid.TextMatrix(Grid.RowSel, 5) = CStr(Val(Grid.TextMatrix(Grid.RowSel, 5)) + Val(txt.Text))
End If

cmdCancel_Click

End Sub

Private Sub Form_Load()
  dtp1.Value = Date$
  dtp2.Value = Date$
  cobOpr.Enabled = False
  txtValue.Enabled = False
  cobOpr.BackColor = &H8000000F
  txtValue.BackColor = &H8000000F
  
  cobOpr.AddItem "等于"
  cobOpr.AddItem "大于"
  cobOpr.AddItem "小于"
  
  Grid.Width = 8625
  Grid.Height = 4755
  
  pic.Visible = False
  
End Sub

Private Sub txt_KeyPress(KeyAscii As Integer)
  If (KeyAscii < 48 Or KeyAscii > 57) And KeyAscii <> 46 And KeyAscii <> 8 Then KeyAscii = 0
End Sub

Private Sub txtValue_KeyPress(KeyAscii As Integer)
  If (KeyAscii < 48 Or KeyAscii > 57) And KeyAscii <> 46 And KeyAscii <> 8 Then KeyAscii = 0
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -