📄 frmforwardersguideae1.frm
字号:
End
Begin VB.Label Label46
Caption = "Shipping Guide No."
Height = 255
Left = 210
TabIndex = 57
Top = 1560
Width = 1575
End
Begin VB.Label Label45
Caption = "Class"
Height = 255
Left = 180
TabIndex = 54
Top = 2280
Width = 1485
End
Begin VB.Label Label39
Alignment = 1 'Right Justify
Caption = "Van No."
Height = 255
Left = 9510
TabIndex = 42
Top = 1950
Width = 1365
End
Begin VB.Label Label1
Caption = "Voyage No."
Height = 225
Left = 8010
TabIndex = 37
Top = 1950
Width = 885
End
Begin VB.Line Line2
BorderColor = &H80000014&
Index = 1
X1 = 180
X2 = 12240
Y1 = 2700
Y2 = 2700
End
Begin VB.Line Line1
BorderColor = &H80000010&
BorderWidth = 2
Index = 1
X1 = 180
X2 = 12240
Y1 = 2730
Y2 = 2730
End
Begin VB.Label Label10
Caption = "Label10"
Height = 525
Left = 5070
TabIndex = 34
Top = 4260
Width = 1245
End
Begin VB.Label lblTitle
BackStyle = 0 'Transparent
Caption = "Forwarders Guide"
BeginProperty Font
Name = "Arial"
Size = 14.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 345
Left = 210
TabIndex = 33
Top = 120
Width = 4905
End
Begin VB.Label Labels
Alignment = 1 'Right Justify
Caption = " Date"
Height = 225
Index = 1
Left = 4920
TabIndex = 32
Top = 990
Width = 1275
End
Begin VB.Label Labels
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 = 225
Index = 0
Left = 210
TabIndex = 31
Top = 1890
Width = 1515
End
Begin VB.Label Label15
Alignment = 1 'Right Justify
Caption = "Address"
Height = 225
Left = 4920
TabIndex = 30
Top = 645
Width = 1275
End
Begin VB.Label Label2
Caption = "PO No."
Height = 225
Left = 210
TabIndex = 29
Top = 660
Width = 1215
End
Begin VB.Line Line1
BorderColor = &H80000010&
BorderWidth = 2
Index = 0
X1 = 150
X2 = 12270
Y1 = 1440
Y2 = 1440
End
Begin VB.Line Line2
BorderColor = &H80000014&
Index = 0
X1 = 150
X2 = 12270
Y1 = 1410
Y2 = 1410
End
Begin VB.Label Label14
Alignment = 1 'Right Justify
Caption = "Ship"
Height = 255
Left = 7410
TabIndex = 28
Top = 1560
Width = 1365
End
Begin VB.Label Label13
Alignment = 1 'Right Justify
Caption = "B.L. No."
Height = 255
Left = 7470
TabIndex = 27
Top = 2310
Width = 1365
End
Begin VB.Label Label12
Alignment = 1 'Right Justify
Caption = "Date"
Height = 225
Left = 5040
TabIndex = 26
Top = 2310
Width = 795
End
Begin VB.Label Label7
Alignment = 1 'Right Justify
Caption = "D.R. No."
Height = 225
Left = 4470
TabIndex = 25
Top = 1950
Width = 1425
End
Begin VB.Label Label18
Caption = "Supplier"
Height = 225
Left = 210
TabIndex = 24
Top = 1020
Width = 1245
End
Begin VB.Label Label11
BackStyle = 0 'Transparent
Caption = "Items"
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 = 270
TabIndex = 23
Top = 2820
Width = 915
End
Begin VB.Shape Shape2
FillColor = &H00C0C0C0&
FillStyle = 0 'Solid
Height = 435
Left = 90
Top = 90
Width = 12285
End
Begin VB.Shape Shape3
BackColor = &H80000010&
BackStyle = 1 'Opaque
BorderColor = &H80000010&
Height = 240
Left = 210
Top = 2820
Width = 12030
End
End
Attribute VB_Name = "frmForwardersGuideAE1"
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 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 cCostPerPackage As Double
Dim cTotalAmount As Double
Dim cTotalTranspoCost As Double
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 dblLoose As Double 'sum of all loose cargos
Private Sub btnUpdate_Click()
Dim CurrRow As Integer
CurrRow = getFlexPos(Grid, 10, Grid.TextMatrix(Grid.RowSel, 10))
'validate the entry
If txtRQty.Text = "0" Or txtValue.Text = "0.00" Or (cboClass.Text = "" And dcClass.Text = "Loose Cargo") Then Exit Sub
If toNumber(txtOQty.Text) < toNumber(txtRQty.Text) Then
MsgBox "Shipped Qty is greater than Ordered Qty.", vbExclamation
Exit Sub
End If
'Add to grid
With Grid
.Row = CurrRow
'If dcClass.Text = "Loose Cargo" Then
' dblLoose = dblLoose + GetFreight(nsdShippingCo.Text, cboClass.Text)
' txtAmount4.Text = toMoney(dblLoose)
'Else
'
'End If
.TextMatrix(CurrRow, 3) = txtRQty.Text
.TextMatrix(CurrRow, 4) = dcUnit.Text
.TextMatrix(CurrRow, 5) = toMoney(txtValue.Text)
.TextMatrix(CurrRow, 6) = cboClass.Text
.TextMatrix(CurrRow, 7) = toMoney(txtGross(0).Text)
.TextMatrix(CurrRow, 8) = txtDisc.Text
.TextMatrix(CurrRow, 9) = toMoney(txtNetAmount.Text)
.TextMatrix(CurrRow, 10) = toNumber(txtFreight.Text)
'compute total amount
Dim i As Integer
txtTotal.Text = 0
For i = 1 To .Rows - 1
txtTotal.Text = toMoney(txtTotal.Text) + toNumber(.TextMatrix(1, 9))
Next
'sum-up freight of loose cargo
Dim cFreight As Double
cFreight = 0
'txtAmount4.Text = "0.00"
For i = 1 To .Rows - 1
cFreight = cFreight + toNumber(.TextMatrix(i, 10))
Next
txtAmount4.Text = toMoney(cFreight)
'if item is alone
If Grid.Rows = 2 And Grid.TextMatrix(1, 1) <> "" Then Grid.TextMatrix(1, 10) = 100
'clear boxes
txtOQty.Text = ""
txtRQty.Text = ""
dcUnit.Text = ""
txtValue.Text = ""
cboFindList cboClass, ""
txtGross(0).Text = ""
txtDisc.Text = ""
txtNetAmount.Text = ""
txtFreight.Text = ""
' 'Add the amount to current load amount
' cIGross = cIGross + toNumber(txtGross(0).Text)
' txtGross(2).Text = Format$(cIGross, "#,##0.00")
' cIAmount = cIAmount + toNumber(txtNetAmount.Text)
' cDAmount = cDAmount + toNumber(toNumber(txtDisc.Text) / 100) * (toNumber(toNumber(txtRQty.Text) * toNumber(txtValue.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)
'
' txtAmount1_Change
'Highlight the current row's column
.ColSel = 10
'Display a remove button
'Grid_Click
'Reset the entry fields
ResetEntry
End With
btnUpdate.Enabled = False
End Sub
Private Sub btnRemove_Click()
'Remove selected load product
With Grid
'Update grooss to current purchase amount
cIGross = cIGross - toNumber(Grid.TextMatrix(.RowSel, 7))
txtGross(2).Text = Format$(cIGross, "#,##0.00")
'Update amount to current invoice amount
cIAmount = cIAmount - toNumber(Grid.TextMatrix(.RowSel, 9))
txtNet.Text = Format$(cIAmount, "#,##0.00")
'Update discount to current invoice disc
cDAmount = cDAmount - toNumber(toNumber(txtDisc.Text) / 100) * (toNumber(toNumber(Grid.TextMatrix(.RowSel, 4)) * toNumber(Grid.TextMatrix(.RowSel, 6))))
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 Function GetFreightOfLooseCargo(ByVal Supplier As String, ByVal Class As String) As Double
Dim sql As String
Dim rstemp As New ADODB.Recordset
sql = "SELECT Cargo_Class.Freight " _
& "FROM Shipping_Company LEFT JOIN Cargo_Class ON Shipping_Company.ShippingCompanyID = Cargo_Class.ShippingCompanyID " _
& "WHERE (((Shipping_Company.ShippingCompany)='" & Replace(Supplier, "'", "''") & "') AND " _
& "((Cargo_Class.Class)='" & Replace(Class, "'", "''") & "'))"
rstemp.Open sql, CN, adOpenDynamic, adLockOptimistic
If Not rstemp.EOF Then
GetFreightOfLooseCargo = rstemp!Freight
Else
GetFreightOfLooseCargo = 0
End If
rstemp.Close
Set rstemp = Nothing
End Function
Private Sub cboClass_Click()
txtFreight.Text = toMoney(GetFreightOfLooseCargo(nsdShippingCo.Text, cboClass.Text))
End Sub
Private Sub CmdReturn_Click()
Dim RSDetails As New Recordset
RSDetails.CursorLocation = adUseClient
RSDetails.Open "SELECT * FROM qry_Forwarders_Detail WHERE ForwarderID=" & PK & " AND QtyOnDock > 0 ORDER BY Stock ASC", CN, adOpenStatic, adLockOptimistic
If RSDetails.RecordCount > 0 Then
With frmPOReceiveLocalAE
.State = adStateAddMode
.PK = PK
.show vbModal
End With
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -