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

📄 frmv_selltoday.frm

📁 < 飞鸿商品>>零售是基于VB+SQL2000开的商品零售管理系统. 开发的很好.可以一看
💻 FRM
📖 第 1 页 / 共 2 页
字号:
      Index           =   4
      Left            =   6750
      TabIndex        =   13
      Top             =   3840
      Width           =   255
   End
   Begin VB.Label Label2 
      Caption         =   "¥"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H000000FF&
      Height          =   240
      Index           =   2
      Left            =   6750
      TabIndex        =   12
      Top             =   2640
      Width           =   255
   End
   Begin VB.Label Label2 
      Caption         =   "¥"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H000000FF&
      Height          =   240
      Index           =   1
      Left            =   6750
      TabIndex        =   11
      Top             =   2145
      Width           =   255
   End
   Begin VB.Label Label2 
      Caption         =   "¥"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H000000FF&
      Height          =   240
      Index           =   0
      Left            =   6750
      TabIndex        =   10
      Top             =   660
      Width           =   255
   End
   Begin VB.Label lblSumZ 
      Caption         =   "0.00"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H000000FF&
      Height          =   315
      Left            =   7170
      TabIndex        =   9
      Top             =   3840
      Width           =   1725
   End
   Begin VB.Label Label9 
      Caption         =   "金    额:"
      Height          =   210
      Left            =   5640
      TabIndex        =   8
      Top             =   3870
      Width           =   1050
   End
   Begin VB.Label lblNum 
      Caption         =   "0"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H000000FF&
      Height          =   315
      Left            =   7170
      TabIndex        =   7
      Top             =   3360
      Width           =   1725
   End
   Begin VB.Label Label7 
      Caption         =   "单项折扣:"
      Height          =   210
      Left            =   5640
      TabIndex        =   6
      Top             =   3390
      Width           =   1050
   End
   Begin VB.Label lblGain 
      Caption         =   "0.00"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H000000FF&
      Height          =   315
      Left            =   7170
      TabIndex        =   5
      Top             =   2640
      Width           =   1515
   End
   Begin VB.Label Label5 
      Caption         =   "毛    利:"
      Height          =   210
      Left            =   5640
      TabIndex        =   4
      Top             =   2670
      Width           =   1050
   End
   Begin VB.Label lblPrice 
      Caption         =   "0.00"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H000000FF&
      Height          =   315
      Left            =   7170
      TabIndex        =   3
      Top             =   660
      Width           =   1515
   End
   Begin VB.Label Label3 
      Caption         =   "销售成本:"
      Height          =   210
      Left            =   5640
      TabIndex        =   2
      Top             =   2160
      Width           =   1050
   End
   Begin VB.Label lblCost 
      Caption         =   "0.00"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H000000FF&
      Height          =   315
      Left            =   7170
      TabIndex        =   1
      Top             =   2160
      Width           =   1515
   End
   Begin VB.Label Label1 
      Caption         =   "营业总额:"
      Height          =   210
      Index           =   0
      Left            =   5640
      TabIndex        =   0
      Top             =   660
      Width           =   1050
   End
End
Attribute VB_Name = "frmV_SellToday"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Sub cmdClose_Click()
  Unload Me
End Sub

Private Sub Form_Load()
Dim Rst As ADODB.Recordset
Dim SQL As String
Dim I As Integer
Dim Cost As Currency
Dim Price As Currency
Dim Gain As Currency
Dim Back As Currency

FillGrid " 商品编码 |^ 商 品 名 称|^ 平均成本|^ 平均售价|^ 销售数量|^ 销售额|^ 总成本|^ 毛    利", _
    "select * from v_plu_sell_today", Grid, 8
DoEvents

For I = 1 To Grid.Rows - 1
  Price = Price + Val(Grid.TextMatrix(I, 5))
  Cost = Cost + Val(Grid.TextMatrix(I, 6))
Next

lblPrice.Caption = Format(CStr(Price), ".00")

Set Rst = New ADODB.Recordset
Rst.CursorLocation = adUseClient
Rst.Open "select sum(num*backprice) from backsell_list where date='" & _
  Format(Date$, "yyyy-mm-dd") & "'", Conn, adOpenDynamic, adLockReadOnly, adCmdText
If IsNull(Rst.Fields(0)) Then
  Back = 0
Else
  Back = Rst.Fields(0)
End If

lblBack.Caption = Format(Back, "0.00")
lblNow.Caption = Format(Price - Back, "0.00")

Set Rst = New ADODB.Recordset
Rst.CursorLocation = adUseClient
SQL = "select sum(num*cost) from backsell_list where  date='" & Format(Date$, "yyyy-mm-dd") & "'"
Rst.Open SQL, Conn, adOpenStatic, adLockReadOnly, adCmdText
If IsNull(Rst.Fields(0)) Then
  Back = 0
Else
  Back = Rst.Fields(0)
End If

Cost = Cost - Back
lblCost.Caption = Format(CStr(Cost), "0.00")
lblGain.Caption = Format(CStr(Val(lblNow.Caption) - Cost), "0.00")
  
Set Rst = New ADODB.Recordset
Rst.CursorLocation = adUseClient
Rst.Open "select * from v_zhekou_today", Conn, adOpenDynamic, adLockReadOnly, adCmdText
If Not IsNull(Rst.Fields(0)) Then lblNums.Caption = Rst.Fields(0) & "   笔"
If Not IsNull(Rst.Fields(1)) Then lblSumZs.Caption = _
  Format(Val(Rst.Fields(1) & ""), "0.00")

Set Rst = New ADODB.Recordset
Rst.CursorLocation = adUseClient
Rst.Open "select * from v_zhekou_list_today", Conn, adOpenDynamic, adLockReadOnly, adCmdText
If Not IsNull(Rst.Fields(0)) Then lblNum.Caption = Rst.Fields(0) & "   笔"
If Not IsNull(Rst.Fields(1)) Then lblSumZ.Caption = Format(Val(Rst.Fields(1) & ""), "0.00")

Set Rst = Nothing

End Sub

Private Sub Form_Unload(Cancel As Integer)
  Set frmV_SellToday = Nothing
End Sub

Private Sub tabReport_Click()
Select Case tabReport.SelectedItem.Index
  Case 1
    FillGrid " 商品编码 |^ 商 品 名 称|^ 平均成本|^ 平均售价|^ 销售数量|^ 销售额|^ 总成本|^ 毛    利", _
    "select * from v_plu_sell_today", Grid, 8
  Case 2
    FillGrid " 收款员|^ 交易次数|^ 销售金额", "select * from v_user_sells", Grid, 3
  Case 3
    FillGrid " 类别码|^ 类别名称|^ 销售数量|^ 销售金额", "select * from v_types_sells", Grid, 4
  Case 4
    FillGrid "商品编码|^ 商 品 名 称|^ 退货数量|^ 价  格|^ 合  计|^ 收款员", _
      "select a.id,name,num,backprice,num*backprice,username from " & _
        "backsell_list as a,yaopin_list as b where a.id=b.id and date='" & _
        Format(Date$, "yyyy-mm-dd") & "'", Grid, 6
End Select
  
End Sub

⌨️ 快捷键说明

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