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

📄 frmsalesreturnae.frm

📁 Inventory control system
💻 FRM
📖 第 1 页 / 共 4 页
字号:
      _Band(0).TextStyleBand=   0
      _Band(0).TextStyleHeader=   0
   End
   Begin MSComCtl2.DTPicker dtpDate 
      Height          =   315
      Left            =   1710
      TabIndex        =   29
      Top             =   1590
      Width           =   1935
      _ExtentX        =   3413
      _ExtentY        =   556
      _Version        =   393216
      CustomFormat    =   "dd MMM, yyyy"
      Format          =   44630019
      CurrentDate     =   38989
   End
   Begin ctrlNSDataCombo.NSDataCombo nsdClient 
      Height          =   315
      Left            =   1710
      TabIndex        =   43
      Top             =   840
      Width           =   3300
      _ExtentX        =   5821
      _ExtentY        =   556
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
   End
   Begin VB.TextBox txtDate 
      Height          =   314
      Left            =   1710
      TabIndex        =   30
      Top             =   1590
      Width           =   1935
   End
   Begin VB.Label Labels 
      Alignment       =   1  'Right Justify
      Caption         =   "Customer"
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Index           =   0
      Left            =   390
      TabIndex        =   42
      Top             =   840
      Width           =   1275
   End
   Begin VB.Label Label10 
      Caption         =   "Label10"
      Height          =   525
      Left            =   5100
      TabIndex        =   41
      Top             =   4290
      Width           =   1245
   End
   Begin VB.Line Line3 
      BorderColor     =   &H80000000&
      BorderWidth     =   2
      X1              =   10350
      X2              =   12060
      Y1              =   7890
      Y2              =   7890
   End
   Begin VB.Shape Shape3 
      BackColor       =   &H80000010&
      BackStyle       =   1  'Opaque
      BorderColor     =   &H80000010&
      Height          =   240
      Left            =   210
      Top             =   3150
      Width           =   11910
   End
   Begin VB.Label Label9 
      Alignment       =   1  'Right Justify
      Caption         =   "Net"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H0000011D&
      Height          =   240
      Left            =   8580
      TabIndex        =   40
      Top             =   7980
      Width           =   2040
   End
   Begin VB.Line Line1 
      BorderColor     =   &H80000010&
      BorderWidth     =   2
      Index           =   1
      X1              =   210
      X2              =   12090
      Y1              =   3090
      Y2              =   3090
   End
   Begin VB.Line Line2 
      BorderColor     =   &H80000014&
      Index           =   1
      X1              =   210
      X2              =   12060
      Y1              =   3060
      Y2              =   3060
   End
   Begin VB.Label Label3 
      Alignment       =   1  'Right Justify
      Caption         =   "Gross"
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H0000011D&
      Height          =   240
      Left            =   8580
      TabIndex        =   39
      Top             =   6630
      Width           =   2040
   End
   Begin VB.Label Labels 
      Caption         =   "Notes"
      Height          =   240
      Index           =   4
      Left            =   240
      TabIndex        =   38
      Top             =   6600
      Width           =   990
   End
   Begin VB.Shape Shape4 
      BorderColor     =   &H80000006&
      BorderWidth     =   2
      Height          =   8895
      Left            =   60
      Top             =   30
      Width           =   12225
   End
   Begin VB.Label Label4 
      Alignment       =   1  'Right Justify
      Caption         =   "Discount"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H0000011D&
      Height          =   240
      Left            =   8580
      TabIndex        =   37
      Top             =   6930
      Width           =   2040
   End
   Begin VB.Label lblTitle 
      BackStyle       =   0  'Transparent
      Caption         =   "Sales Return"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   14.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   345
      Left            =   240
      TabIndex        =   36
      Top             =   150
      Width           =   4905
   End
   Begin VB.Label Label11 
      BackStyle       =   0  'Transparent
      Caption         =   "Purchase Order Return Details"
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H80000014&
      Height          =   210
      Left            =   210
      TabIndex        =   35
      Top             =   3150
      Width           =   4365
   End
   Begin VB.Label Label13 
      Alignment       =   1  'Right Justify
      Caption         =   "Date"
      Height          =   255
      Left            =   930
      TabIndex        =   34
      Top             =   1590
      Width           =   705
   End
   Begin VB.Shape Shape1 
      Height          =   8235
      Left            =   150
      Top             =   600
      Width           =   12045
   End
   Begin VB.Label Label15 
      Alignment       =   1  'Right Justify
      Caption         =   "City"
      Height          =   285
      Left            =   390
      TabIndex        =   33
      Top             =   1200
      Width           =   1245
   End
   Begin VB.Label Label12 
      Alignment       =   1  'Right Justify
      Caption         =   "Status"
      Height          =   255
      Left            =   6180
      TabIndex        =   32
      Top             =   930
      Width           =   1305
   End
   Begin VB.Label Label2 
      Alignment       =   1  'Right Justify
      Caption         =   "Return Slip No"
      Height          =   255
      Left            =   390
      TabIndex        =   31
      Top             =   2010
      Width           =   1245
   End
   Begin VB.Shape Shape2 
      FillColor       =   &H00C0C0C0&
      FillStyle       =   0  'Solid
      Height          =   435
      Left            =   120
      Top             =   120
      Width           =   12075
   End
End
Attribute VB_Name = "frmSalesReturnAE"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Public State                As FormState 'Variable used to determine on how the form used
Public PK                   As Long 'Variable used to get what record is going to edit
Public ReceiptPK            As Long 'Variable used to save the reference from SeceiptID
Public CloseMe              As Boolean
Public ForCusAcc            As Boolean

Dim cIGross                 As Currency 'Gross Amount
Dim cIAmount                As Currency 'Current Invoice Amount
Dim cDAmount                As Currency 'Current Invoice Discount Amount
Dim cIRowCount              As Integer

Dim HaveAction              As Boolean 'Variable used to detect if the user perform some action
Dim rs                      As New Recordset 'Main recordset for Invoice
Dim intQtyOld               As Integer 'Allowed value for return qty
Dim blnSave                 As Boolean

Private Sub btnAdd_Click()
    Dim curDiscPerc As Currency
    Dim curExtDiscPerc As Currency

    If nsdStock.Text = "" Then nsdStock.SetFocus: Exit Sub

    If dcUnit.Text = "" Then
        MsgBox "Please select unit", vbInformation
        dcUnit.SetFocus
        Exit Sub
    End If

    If toNumber(txtPrice.Text) <= 0 Then
        MsgBox "Please enter a valid sales price.", vbExclamation
        txtPrice.SetFocus
        Exit Sub
    End If

    Dim CurrRow As Integer
    Dim intStockID As Integer
    
    CurrRow = getFlexPos(Grid, 10, nsdStock.Tag)
    intStockID = nsdStock.Tag

    'Add to grid
    With Grid
        If CurrRow < 0 Then
            'Perform if the record is not exist
            If .Rows = 2 And .TextMatrix(1, 10) = "" Then
                .TextMatrix(1, 1) = nsdStock.getSelValueAt(1)
                .TextMatrix(1, 2) = nsdStock.Text
                .TextMatrix(1, 3) = txtQty.Text
                .TextMatrix(1, 4) = dcUnit.Text
                .TextMatrix(1, 5) = toMoney(txtPrice.Text)
                .TextMatrix(1, 6) = toMoney(txtGross(1).Text)
                .TextMatrix(1, 7) = toMoney(txtDisc.Text)
                .TextMatrix(1, 8) = toMoney(toNumber(txtNetAmount.Text))
                .TextMatrix(1, 9) = cboReturnType.Text
                .TextMatrix(1, 10) = intStockID
            Else
                .Rows = .Rows + 1
                .TextMatrix(.Rows - 1, 1) = nsdStock.getSelValueAt(1)
                .TextMatrix(.Rows - 1, 2) = nsdStock.Text
                .TextMatrix(.Rows - 1, 3) = txtQty.Text
                .TextMatrix(.Rows - 1, 4) = dcUnit.Text
                .TextMatrix(.Rows - 1, 5) = toMoney(txtPrice.Text)
                .TextMatrix(.Rows - 1, 6) = toMoney(txtGross(1).Text)
                .TextMatrix(.Rows - 1, 7) = toMoney(txtDisc.Text)
                .TextMatrix(.Rows - 1, 8) = toMoney(toNumber(txtNetAmount.Text))
                .TextMatrix(.Rows - 1, 9) = cboReturnType.Text
                .TextMatrix(.Rows - 1, 10) = intStockID
                
                .Row = .Rows - 1
            End If
            'Increase the record count
            cIRowCount = cIRowCount + 1
        Else
            If MsgBox("Item already added. Do you want to replace it?", vbQuestion + vbYesNo) = vbYes Then
                .Row = CurrRow
                
                'Restore back the invoice amount and discount
                cIGross = cIGross - toNumber(Grid.TextMatrix(.RowSel, 6))
                txtGross(2).Text = Format$(cIGross, "#,##0.00")
                cIAmount = cIAmount - toNumber(Grid.TextMatrix(.RowSel, 8))
                txtNet.Text = Format$(cIAmount, "#,##0.00")
                               
                cDAmount = cDAmount - toNumber(toNumber(txtDisc.Text) / 100) * (toNumber(toNumber(Grid.TextMatrix(.RowSel, 3)) * toNumber(txtPrice.Text)))
                
                txtDesc.Text = Format$(cDAmount, "#,##0.00")
                
                .TextMatrix(CurrRow, 1) = nsdStock.getSelValueAt(1)
                .TextMatrix(CurrRow, 2) = nsdStock.Text
                .TextMatrix(CurrRow, 3) = txtQty.Text
                .TextMatrix(CurrRow, 4) = dcUnit.Text
                .TextMatrix(CurrRow, 5) = toMoney(txtPrice.Text)
                .TextMatrix(CurrRow, 6) = toMoney(txtGross(1).Text)
                .TextMatrix(CurrRow, 7) = toMoney(txtDisc.Text)
                .TextMatrix(CurrRow, 8) = toMoney(toNumber(txtNetAmount.Text))
                .TextMatrix(CurrRow, 9) = cboReturnType.Text
                .TextMatrix(CurrRow, 10) = intStockID

            Else
                Exit Sub

⌨️ 快捷键说明

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