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

📄 frmcash.frm

📁 简单的餐厅POS收银软件
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmCash 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "收银"
   ClientHeight    =   4005
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   5910
   Icon            =   "frmCash.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   4005
   ScaleWidth      =   5910
   StartUpPosition =   2  '屏幕中心
   Begin VB.TextBox txtReturnCash 
      Alignment       =   1  'Right Justify
      Appearance      =   0  'Flat
      BackColor       =   &H00F7FEFF&
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   26.25
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H000000FF&
      Height          =   645
      Left            =   2280
      Locked          =   -1  'True
      TabIndex        =   4
      Text            =   "0.00"
      Top             =   2160
      Width           =   2655
   End
   Begin VB.TextBox txtRealMoney 
      Alignment       =   1  'Right Justify
      Appearance      =   0  'Flat
      BackColor       =   &H00F7FEFF&
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   26.25
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   645
      Left            =   2280
      TabIndex        =   0
      Text            =   "0.00"
      Top             =   1320
      Width           =   2655
   End
   Begin VB.TextBox txtConsumeMoney 
      Alignment       =   1  'Right Justify
      Appearance      =   0  'Flat
      BackColor       =   &H00F7FEFF&
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   26.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   645
      Left            =   2280
      Locked          =   -1  'True
      TabIndex        =   3
      Text            =   "0.00"
      Top             =   480
      Width           =   2655
   End
   Begin VB.CommandButton cmdOK 
      Caption         =   "确定(&O)"
      Height          =   375
      Left            =   1800
      TabIndex        =   2
      Top             =   3360
      Width           =   1095
   End
   Begin VB.CommandButton cmdCancel 
      Caption         =   "取消(&C)"
      Height          =   375
      Left            =   3240
      TabIndex        =   1
      Top             =   3360
      Width           =   1095
   End
   Begin VB.Label Label16 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "找赎:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   24
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   480
      Left            =   840
      TabIndex        =   7
      Top             =   2280
      Width           =   1485
   End
   Begin VB.Label Label15 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "实收:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   24
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   480
      Left            =   840
      TabIndex        =   6
      Top             =   1440
      Width           =   1485
   End
   Begin VB.Label Label14 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "应收:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   24
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   480
      Left            =   840
      TabIndex        =   5
      Top             =   600
      Width           =   1485
   End
End
Attribute VB_Name = "frmCash"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdCancel_Click()
Unload Me
End Sub

Private Sub cmdOK_Click()
Dim intC As Integer
Dim StrT As String

frm_Main.lblState = "已结帐"
frm_Main.lblRealMoney = Me.txtRealMoney
frm_Main.lblReturnCash = Me.txtReturnCash
frm_Main.lblMoney = " - " & Me.txtReturnCash

    If Rs.State <> 0 Then Rs.Close
    '提取销售单号
     Rs.Open "select max(bBillNo) from Bill where bBillNo like 'B" & Format(Date, "yyyymmdd") & "%'", Conn, adOpenDynamic, adLockReadOnly, adCmdText
     If Not Rs.EOF Then
     Rs.MoveFirst
         If Len(Trim(Rs.Fields(0).Value)) > 4 Then
          ' StrT = CStr(Int(Val(Mid(Trim(Rs.Fields(0).Value), Len(Trim(Rs.Fields(0).Value)) - 1, 3))) + 1)
           StrT = CStr(Int(Val(Right(Trim(Rs.Fields(0).Value), 3))) + 1)
           frm_Main.lblBillNo = "B" & Format(Date, "yyyymmdd") & Format(StrT, "000")    ' Mid(StrT, Len(StrT) - 1, 3)
        Else
           frm_Main.lblBillNo = "B" & Format(Date, "yyyymmdd") & "001"
        End If
     End If

sSQL = "insert into Bill("
sSQL = sSQL & "bBillNo" & ","
sSQL = sSQL & "bState" & ","
sSQL = sSQL & "bDate" & ","
sSQL = sSQL & "bTime" & ","
sSQL = sSQL & "bMoney" & ","
sSQL = sSQL & "bRealMoney" & ","
sSQL = sSQL & "bReturnCash" & ","
sSQL = sSQL & "bRemark" & ")"
sSQL = sSQL & "values('"
sSQL = sSQL & CheckEmpty(frm_Main.lblBillNo) & "','"
sSQL = sSQL & CheckEmpty(frm_Main.lblState) & "','"
sSQL = sSQL & CheckEmpty(frm_Main.lblBillDate) & "','"
sSQL = sSQL & CheckEmpty(frm_Main.lblBillTime) & "','"
sSQL = sSQL & CheckEmpty(frm_Main.lblConsumeMoney) & "','"
sSQL = sSQL & CheckEmpty(frm_Main.lblRealMoney) & "','"
sSQL = sSQL & CheckEmpty(frm_Main.lblReturnCash) & "','"
sSQL = sSQL & CheckEmpty(frm_Main.txtRemark) & "')"
Conn.Execute sSQL

For intC = 1 To frm_Main.mshfView.Rows - 1
    If frm_Main.mshfView.TextMatrix(intC, 1) <> "" Then
        sSQL = "insert into BillSub("
        sSQL = sSQL & "bBillNo" & ","
        sSQL = sSQL & "bGoodsCode" & ","
        sSQL = sSQL & "bGoodsName" & ","
        sSQL = sSQL & "bGoodsUnits" & ","
        sSQL = sSQL & "bGoodsNumber" & ","
        sSQL = sSQL & "bGoodsPrice" & ","
        sSQL = sSQL & "bGoodsMoney" & ","
        sSQL = sSQL & "bGoodsRemark" & ")"
        sSQL = sSQL & "values('"
        sSQL = sSQL & CheckEmpty(frm_Main.lblBillNo) & "','"
        sSQL = sSQL & CheckEmpty(frm_Main.mshfView.TextMatrix(intC, 1)) & "','"
        sSQL = sSQL & CheckEmpty(frm_Main.mshfView.TextMatrix(intC, 2)) & "','"
        sSQL = sSQL & CheckEmpty(frm_Main.mshfView.TextMatrix(intC, 3)) & "','"
        sSQL = sSQL & CheckEmpty(frm_Main.mshfView.TextMatrix(intC, 5)) & "','"
        sSQL = sSQL & CheckEmpty(frm_Main.mshfView.TextMatrix(intC, 4)) & "','"
        sSQL = sSQL & CheckEmpty(frm_Main.mshfView.TextMatrix(intC, 6)) & "','"
        sSQL = sSQL & CheckEmpty(frm_Main.mshfView.TextMatrix(intC, 7)) & "')"
        Conn.Execute sSQL
    End If
Next
Unload Me
End Sub

Private Sub Form_Load()
Me.txtRealMoney.SelStart = 0
Me.txtRealMoney.SelLength = Len(Trim(Me.txtRealMoney))
Me.txtConsumeMoney = frm_Main.lblConsumeMoney

End Sub

Private Sub txtRealMoney_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
    Me.txtRealMoney = Format(Me.txtRealMoney, "0.00")
    Me.txtReturnCash = Format(Round(Val(Format(Me.txtRealMoney, "0.00")) - Val(Format(Me.txtConsumeMoney, "0.00")), 1), "0.00")
    Me.cmdOK.SetFocus
End If
End Sub

⌨️ 快捷键说明

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