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

📄 frmporeceiveoutoftownae.frm

📁 Inventory control system
💻 FRM
📖 第 1 页 / 共 5 页
字号:
      TabIndex        =   67
      Top             =   1620
      Width           =   1560
   End
   Begin VB.Label Label45 
      Alignment       =   1  'Right Justify
      Caption         =   "Class*"
      Height          =   255
      Left            =   270
      TabIndex        =   66
      Top             =   2340
      Width           =   1560
   End
   Begin VB.Label Label39 
      Alignment       =   1  'Right Justify
      Caption         =   "Van No."
      Height          =   255
      Left            =   10890
      TabIndex        =   65
      Top             =   2010
      Width           =   855
   End
   Begin VB.Label Label2 
      Caption         =   "Voyage No."
      Height          =   255
      Left            =   8580
      TabIndex        =   64
      Top             =   2010
      Width           =   1035
   End
   Begin VB.Label lblTitle 
      BackStyle       =   0  'Transparent
      Caption         =   "Receiving History"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   14.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   345
      Left            =   270
      TabIndex        =   63
      Top             =   150
      Width           =   4905
   End
   Begin VB.Label Labels 
      Alignment       =   1  'Right Justify
      Caption         =   "Shipping Company*"
      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            =   270
      TabIndex        =   62
      Top             =   1980
      Width           =   1560
   End
   Begin VB.Label Label6 
      Alignment       =   1  'Right Justify
      Caption         =   "PO No."
      Height          =   225
      Left            =   540
      TabIndex        =   61
      Top             =   690
      Width           =   1245
   End
   Begin VB.Line Line1 
      BorderColor     =   &H80000010&
      BorderWidth     =   2
      Index           =   0
      X1              =   210
      X2              =   15000
      Y1              =   1470
      Y2              =   1470
   End
   Begin VB.Line Line2 
      BorderColor     =   &H80000014&
      Index           =   0
      X1              =   210
      X2              =   15000
      Y1              =   1440
      Y2              =   1440
   End
   Begin VB.Label Label14 
      Alignment       =   1  'Right Justify
      Caption         =   "Ship"
      Height          =   255
      Left            =   8580
      TabIndex        =   60
      Top             =   1650
      Width           =   1035
   End
   Begin VB.Label Label13 
      Alignment       =   1  'Right Justify
      Caption         =   "B.L. No."
      Height          =   255
      Left            =   8580
      TabIndex        =   59
      Top             =   2370
      Width           =   1035
   End
   Begin VB.Label Label12 
      Alignment       =   1  'Right Justify
      Caption         =   "Date*"
      Height          =   225
      Left            =   5190
      TabIndex        =   58
      Top             =   2340
      Width           =   825
   End
   Begin VB.Label Label7 
      Alignment       =   1  'Right Justify
      Caption         =   "D.R. No.*"
      Height          =   225
      Left            =   5190
      TabIndex        =   57
      Top             =   1980
      Width           =   825
   End
   Begin VB.Label Label18 
      Alignment       =   1  'Right Justify
      Caption         =   "Supplier"
      Height          =   225
      Left            =   540
      TabIndex        =   56
      Top             =   1050
      Width           =   1245
   End
   Begin VB.Line Line1 
      BorderColor     =   &H80000010&
      BorderWidth     =   2
      Index           =   1
      X1              =   210
      X2              =   15000
      Y1              =   2790
      Y2              =   2790
   End
   Begin VB.Line Line2 
      BorderColor     =   &H80000014&
      Index           =   1
      X1              =   210
      X2              =   15000
      Y1              =   2760
      Y2              =   2760
   End
   Begin VB.Label lblStatus 
      Alignment       =   1  'Right Justify
      Caption         =   "Status"
      Height          =   255
      Left            =   8790
      TabIndex        =   55
      Top             =   660
      Width           =   1305
   End
   Begin VB.Shape Shape4 
      BorderColor     =   &H80000006&
      BorderWidth     =   2
      Height          =   8625
      Left            =   60
      Top             =   60
      Width           =   15135
   End
   Begin VB.Shape Shape1 
      Height          =   7995
      Left            =   150
      Top             =   600
      Width           =   14955
   End
   Begin VB.Shape Shape2 
      FillColor       =   &H00C0C0C0&
      FillStyle       =   0  'Solid
      Height          =   435
      Left            =   150
      Top             =   120
      Width           =   14955
   End
End
Attribute VB_Name = "frmForwardersReceiveAE"
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 (PO)
Public ForwarderPK          As Long 'Variable used to get what record is going to edit (Invoice)
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 receive qty
Dim cLocalTrucking          As Currency
Dim cSidewalkHandling       As Currency

Private Sub btnUpdate_Click()
    Dim CurrRow As Integer
    Dim curDiscPerc As Currency
    Dim curExtDiscPerc As Currency

    If cboClass.Text = "" Or nsdLocal.Text = "" Then
        MsgBox "Class & Local Forwarder Fields needs input", vbInformation
        Exit Sub
    End If
    
    CurrRow = getFlexPos(Grid, 15, txtStock.Tag)

    'Add to grid
    With Grid
        .Row = CurrRow
        
        'Restore back the invoice amount and discount
        cIGross = cIGross - toNumber(Grid.TextMatrix(.RowSel, 8))
        txtGross(2).Text = Format$(cIGross, "#,##0.00")
        cIAmount = cIAmount - toNumber(Grid.TextMatrix(.RowSel, 12))
        txtNet.Text = Format$(cIAmount, "#,##0.00")
        
        'Compute discount
        curDiscPerc = .TextMatrix(1, 6) * .TextMatrix(1, 7) / 100
        curExtDiscPerc = .TextMatrix(1, 6) * .TextMatrix(1, 8) / 100
        
        cDAmount = cDAmount - (curDiscPerc + curExtDiscPerc + txtExtDiscAmt.Text)
        
        txtDesc.Text = Format$(cDAmount, "#,##0.00")
        
        .TextMatrix(CurrRow, 3) = txtQty.Text
        .TextMatrix(CurrRow, 4) = dcUnit.Text
        .TextMatrix(CurrRow, 5) = txtLooseCargo.Text
        .TextMatrix(CurrRow, 6) = txtLocalArrastre.Text
        .TextMatrix(CurrRow, 7) = toMoney(txtPrice.Text)
        .TextMatrix(CurrRow, 8) = toMoney(txtGross(1).Text)
        .TextMatrix(CurrRow, 9) = toMoney(txtDiscPercent.Text)
        .TextMatrix(CurrRow, 10) = toNumber(txtExtDiscPerc.Text)
        .TextMatrix(CurrRow, 11) = toMoney(txtExtDiscAmt.Text)
        .TextMatrix(CurrRow, 12) = toMoney(toNumber(txtNetAmount.Text))
        .TextMatrix(CurrRow, 13) = txtFreight.Text
        .TextMatrix(CurrRow, 14) = toMoney(ComputeCostPerPackage(txtQty.Text, _
                                    txtLooseCargo.Text, _
                                    txtLocalArrastre.Text, _
                                    txtFreight.Text, _
                                    CurrRow))
                
        'Add the amount to current load amount
        cIGross = cIGross + toNumber(txtGross(1).Text)
        txtGross(2).Text = Format$(cIGross, "#,##0.00")
        
        'Compute discount
        curDiscPerc = txtGross(1).Text * txtDiscPercent.Text / 100
        curExtDiscPerc = txtGross(1).Text * txtExtDiscPerc.Text / 100
        
        cDAmount = curDiscPerc + curExtDiscPerc + txtExtDiscAmt.Text
        
        cIAmount = cIAmount + toNumber(txtNetAmount.Text)
        
        txtDesc.Text = Format$(cDAmount, "#,##0.00")
        txtNet.Text = Format$(cIAmount, "#,##0.00")
        txtTaxBase.Text = toMoney(txtNet.Text / 1.12)
        txtVat.Text = toMoney(txtNet.Text - txtTaxBase.Text)
        
        'Highlight the current row's column
        .ColSel = 15
        'Display a remove button
        Grid_Click
        'Reset the entry fields
        ResetEntry
    End With
End Sub

Private Sub btnRemove_Click()
    Dim curDiscPerc As Currency
    Dim curExtDiscPerc As Currency
    
    'Remove selected load product
    With Grid
        'Update grooss to current purchase amount
        cIGross = cIGross - toNumber(Grid.TextMatrix(.RowSel, 6))
        txtGross(2).Text = Format$(cIGross, "#,##0.00")
        'Update amount to current invoice amount
        cIAmount = cIAmount - toNumber(Grid.TextMatrix(.RowSel, 10))
        txtNet.Text = Format$(cIAmount, "#,##0.00")
        'Update discount to current invoice disc
        curDiscPerc = .TextMatrix(1, 6) * .TextMatrix(1, 7) / 100
        curExtDiscPerc = .TextMatrix(1, 6) * .TextMatrix(1, 8) / 100
        
        cDAmount = cDAmount - (curDiscPerc + curExtDiscPerc + txtExtDiscAmt.Text)
        
        txtDesc.Text = Format$(cDAmount, "#,##0.00")
        txtTaxBase.Text = toMoney(txtNet.Text / 1.12)
        txtVat.Text = toMoney(txtNet.Text - txtTaxBase.Text)
        
        'Update the record count
        cIRowCount = cIRowCount - 1
        
        If .Rows = 2 Then Grid.Rows = Grid.Rows + 1
        .RemoveItem (.RowSel)
    End With

    btnRemove.Visible = False
    Grid_Click
End Sub

Private Sub cboClass_Click()
    If cboClass.Text = "Van/Truck" Then
        txtLooseCargo.Locked = True
        txtLooseCargo.BackColor = &HE6FFFF
        txtFreight.Enabled = True
        txtFreight.BackColor = &H80000005
        txtAmount(5).Locked = False
        txtAmount(5).BackColor = &H80000005
        txtAmount(6).Locked = False
        txtAmount(6).BackColor = &H80000005
        txtAmount(7).Locked = False
        txtAmount(7).BackColor = &H80000005
    Else
        txtLooseCargo.Enabled = True
        txtLooseCargo.BackColor = &H80000005
        txtFreight.Enabled = False
        txtFreight.BackColor = &HE6FFFF
        txtAmount(5).Locked = True
        txtAmount(5).BackColor = &HE6FFFF
        txtAmount(6).Locked = True
        txtAmount(6).BackColor = &HE6FFFF
        txtAmount(7).Locked = True
        txtAmount(7).BackColor = &HE6FFFF
    End If
End Sub

Private Sub CmdCancel_Click()
    Unload Me
End Sub

Private Sub cmdPH_Click()
    'frmInvoiceViewerPH.INV_PK = PK
    'frmInvoiceViewerPH.Caption = "Payment History Viewer"
    'frmInvoiceViewerPH.lblTitle.Caption = "Payment History Viewer"
    'frmInvoiceViewerPH.show vbModal
End Sub

Private Sub CmdReceive_Click()
    Dim RSDetails As New Recordset
    
    RSDetails.CursorLocation = adUseClient
    
    RSDetails.Open "SELECT * FROM qry_Forwarders_Detail WHERE POID=" & PK & " AND QtyDue > 0 ORDER BY Stock ASC", CN, adOpenStatic, adLockOptimistic
    
    If RSDetails.RecordCount > 0 Then
        With frmPOReceiveOutofTownAE
            .State = adStateAddMode
            .PK = PK
            .show vbModal
        End With
    Else
        MsgBox "All items are already forwarded.", vbInformation
    End If
End Sub

Private Sub cmdSave_Click()
    'Verify the entries
    If txtShippingGuideNo.Text = "" Or nsdShippingCo.Text = "" Or _
        cboClass.Text = "" Or nsdLocal.Text = "" Or txtDRNo.Text = "" Then
        MsgBox "Please don't leave Field with asterisk (*) blank", vbInformation
        txtShippingGuideNo.SetFocus
        Exit Sub
    End If
   
    If cIRowCount < 1 Then
        MsgBox "Please enter item to return before saving this record.", vbExclamation
        Exit Sub
    End If
   
    If MsgBox("This save the record. Do you want to proceed?", vbQuestion + vbYesNo) = vbNo Then Exit Sub

⌨️ 快捷键说明

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