📄 frmin.frm
字号:
Appearance = 0 'Flat
BackColor = &H80000005&
BorderStyle = 1 'Fixed Single
ForeColor = &H80000008&
Height = 300
Left = 720
TabIndex = 24
Top = 0
Width = 3360
End
End
Begin MSDataGridLib.DataGrid grdDataGrid
Height = 3195
Left = 0
TabIndex = 5
Top = 1440
Width = 9480
_ExtentX = 16722
_ExtentY = 5636
_Version = 393216
AllowUpdate = -1 'True
HeadLines = 1.5
RowHeight = 15
TabAction = 2
WrapCellPointer = -1 'True
AllowAddNew = -1 'True
AllowDelete = -1 'True
BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ColumnCount = 2
BeginProperty Column00
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column01
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
SplitCount = 1
BeginProperty Split0
BeginProperty Column00
EndProperty
BeginProperty Column01
EndProperty
EndProperty
End
Begin MSComctlLib.ImageList imlToolbarIcons
Left = 4170
Top = 2700
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483643
ImageWidth = 16
ImageHeight = 16
MaskColor = 12632256
_Version = 393216
BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
NumListImages = 2
BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmIn.frx":0D08
Key = "Save"
EndProperty
BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmIn.frx":0E1A
Key = "Undo"
EndProperty
EndProperty
End
Begin VB.Label lblTitle
Alignment = 2 'Center
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "入 库 单"
BeginProperty Font
Name = "隶书"
Size = 26.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 525
Index = 0
Left = 3600
TabIndex = 34
Top = 0
Width = 2685
End
Begin VB.Label lblTitle
Alignment = 2 'Center
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "入 库 单"
BeginProperty Font
Name = "隶书"
Size = 26.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 525
Index = 1
Left = 3630
TabIndex = 35
Top = 30
Width = 2685
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "注:日期不绑定"
ForeColor = &H000000FF&
Height = 180
Left = 240
TabIndex = 33
Top = 120
Visible = 0 'False
Width = 1170
End
End
Attribute VB_Name = "frmIn"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim WithEvents adoPrimaryRs As ADODB.Recordset
Attribute adoPrimaryRs.VB_VarHelpID = -1
Dim WithEvents adoSecondaryRs As ADODB.Recordset
Attribute adoSecondaryRs.VB_VarHelpID = -1
Dim m_HouseRs As ADODB.Recordset
Dim m_EntryTypeRs As ADODB.Recordset
Dim m_byType As Byte
Dim m_sWaresCode As String, m_bIsSelectWares As Boolean
Dim m_bEdit As Boolean, m_bAuditer As Boolean, m_bKeeper As Boolean
Dim YearCol As Integer, MonthCol As Integer, TypeCol As Integer, NoCol As Integer, IndexCol As Integer
Dim CodeCol As Integer, NameCol As Integer, SpecCol As Integer, MeasCol As Integer
Dim StockQuantityCol As Integer, QuantityCol As Integer, PriceCol As Integer, MoneyCol As Integer
Dim ShortQuantityCol As Integer, ShortMoneyCol As Integer
Dim WearQuantityCol As Integer, WearMoneyCol As Integer, WearWhysCol As Integer
Dim AccountQuantityCol As Integer, TrueQuantityCol As Integer
Property Let InvoiceType(bEdit As Boolean, bAuditer As Boolean, bKeeper As Boolean, byType As Byte)
m_bEdit = bEdit
m_bAuditer = bAuditer
m_bKeeper = bKeeper
m_byType = byType
End Property
Private Sub InitScreenObject()
If m_byType = IN_INVOICE Then
Me.Caption = "验收入库单"
lblTitle(0).Caption = "验收入库单"
ElseIf m_byType = SURROGATE_INVOICE Then
Me.Caption = "代管入库单"
lblTitle(0).Caption = "代管入库单"
ElseIf m_byType = WASTAGE_INVOICE Then
Me.Caption = "商品升耗报告单"
lblTitle(0).Caption = "商品升耗报告单"
lblTitle(0).ForeColor = QBColor(3)
ElseIf m_byType = BACK_INVOICE Then
Me.Caption = "商品退还单"
lblTitle(0).Caption = "商品退还单"
lblTitle(0).ForeColor = QBColor(3)
End If
lblTitle(1).Caption = lblTitle(0).Caption
Set m_HouseRs = New ADODB.Recordset
m_HouseRs.Open "Select FHouseCode, FHouseName From Warehouse Order by FHouseCode", m_gDBCnn
With DACHouse
Set .RowSource = m_HouseRs
.ListField = "FHouseName"
.BoundColumn = "FHouseCode"
End With
Set m_EntryTypeRs = New ADODB.Recordset
m_EntryTypeRs.Open "Select FEntryTypeCode,FentryTypeName From EntryType order by FentryTypeCode", m_gDBCnn
With DacEntryType
Set .RowSource = m_EntryTypeRs
.ListField = "FEntryTypeName"
.BoundColumn = "FentryTypeCode"
End With
End Sub
'////////////////////////////////////////////////
'//日期不绑定
Private Sub BoundingScreenObject()
Dim ctl As Control
For Each ctl In Me.Controls
If TypeOf ctl Is TextBox Then
If UCase(ctl.Name) <> "TXTFINDNO" Then
Set ctl.DataSource = adoPrimaryRs
End If
End If
Next
Set DACHouse.DataSource = adoPrimaryRs
Set DacEntryType.DataSource = adoPrimaryRs
End Sub
Private Sub RefreshDataGrid(nYear As Integer, byMonth As Byte, byType As Byte, sNo As String)
Dim sSqlStr As String, sJoin As String
Dim sGrdWidth As String, i As Integer, j As Integer
Set adoSecondaryRs = Nothing
Set adoSecondaryRs = New ADODB.Recordset
With adoSecondaryRs
sSqlStr = "Select InDetail.FWaresCode, WaresList.FName, WaresList.FSpecName, WaresList.FMeasurement, "
Select Case byType
Case IN_INVOICE, BACK_INVOICE '验收入库、商品退还
sSqlStr = sSqlStr & "StockUpDetail.FQuantity AS SUQuantity, InDetail.FPrice, InDetail.FQuantity, InDetail.FMoney, FShortQuantity, FShortMoney, FWearQuantity, FWearMoney, FWearWhys, "
sJoin = " Inner Join StockUpDetail On InDetail.FIdentifyId = StockUpDetail.FIdentifyId "
Case SURROGATE_INVOICE '代管入库
sSqlStr = sSqlStr & " InDetail.FQuantity, "
sJoin = ""
Case WASTAGE_INVOICE '盘点单
sSqlStr = sSqlStr & " InDetail.FPrice, FQuantity,FShortQuantity, FWearQuantity, FWearMoney, FWearWhys, "
sJoin = ""
End Select
sSqlStr = sSqlStr & " InDetail.FYear, InDetail.FMonth, InDetail.FType, InDetail.FNo, InDetail.FIndex " & _
" From (InDetail Inner Join WaresList On InDetail.FWaresCode = WaresList.FWaresCode) " & sJoin & _
" Where InDetail.FYear = " & nYear & " And InDetail.FMonth = " & byMonth & " And InDetail.FType = " & byType & " And InDetail.FNo = '" & sNo & "' Order by InDetail.FWaresCode"
.Open sSqlStr, m_gDBCnn, adOpenDynamic, adLockOptimistic, adCmdUnknown
.Properties("Unique Table") = "InDetail"
.Properties("Resync Command") = "Select * FROM (" & sSqlStr & ") WHERE FYear = ? And FMonth = ? And FType = ? And FNo = ? And FIndex = ?"
.Properties("Update Resync") = adResyncAll Or adResyncUpdates Or adResyncInserts Or adResyncConflicts
End With
With grdDataGrid
Set .DataSource = adoSecondaryRs
sGrdWidth = GetPrivateSetting(Me.Caption, "GrdWidth", "")
.RowHeight = GetPrivateSetting(Me.Caption, "GrdHeight", "275")
i = 0
.Columns(i).Caption = "商品编码"
SetColumnWidth sGrdWidth, .Columns(i), 1200
.Columns(i).Locked = IIf(byType = IN_INVOICE Or byType = BACK_INVOICE, True, False)
.Columns(i).Button = IIf(byType = IN_INVOICE Or byType = BACK_INVOICE, False, True)
CodeCol = i
i = i + 1
.Columns(i).Caption = "名称"
SetColumnWidth sGrdWidth, .Columns(i), 1500
.Columns(i).Locked = True
NameCol = i
i = i + 1
.Columns(i).Caption = "规格"
SetColumnWidth sGrdWidth, .Columns(i), 1200
.Columns(i).Locked = True
SpecCol = i
i = i + 1
.Columns(i).Caption = "计量单位"
SetColumnWidth sGrdWidth, .Columns(i), 1000
.Columns(i).Locked = True
MeasCol = i
If byType = IN_INVOICE Or byType = BACK_INVOICE Then
i = i + 1
.Columns(i).Caption = "发票数量"
SetColumnWidth sGrdWidth, .Columns(i), 1000
.Columns(i).Locked = True
StockQuantityCol = i
Else
StockQuantityCol = -1
End If
If byType = IN_INVOICE Or byType = WASTAGE_INVOICE Or byType = BACK_INVOICE Then
i = i + 1
.Columns(i).Caption = "购进单价"
SetColumnWidth sGrdWidth, .Columns(i), 1000
.Columns(i).NumberFormat = "########0.00"
.Columns(i).Locked = IIf(byType = WASTAGE_INVOICE, False, True)
PriceCol = i
Else
PriceCol = -1
End If
If byType = IN_INVOICE Or byType = SURROGATE_INVOICE Or byType = BACK_INVOICE Then
i = i + 1
.Columns(i).Caption = "实收数量"
SetColumnWidth sGrdWidth, .Columns(i), 1000
.Columns(i).NumberFormat = "########0.00"
QuantityCol = i
Else
QuantityCol = -1
End If
If byType = IN_INVOICE Or byType = BACK_INVOICE Then
i = i + 1
.Columns(i).Caption = "实收金额"
SetColumnWidth sGrdWidth, .Columns(i), 1000
.Columns(i).NumberFormat = "########0.00"
MoneyCol = i
Else
MoneyCol = -1
End If
If byType = IN_INVOICE Or byType = BACK_INVOICE Then
i = i + 1
.Columns(i).Caption = "长短数量"
SetColumnWidth sGrdWidth, .Columns(i), 1000
.Columns(i).NumberFormat = "########0.00"
ShortQuantityCol = i
i = i + 1
.Columns(i).Caption = "长短金额"
SetColumnWidth sGrdWidth, .Columns(i), 1000
.Columns(i).NumberFormat = "########0.00"
ShortMoneyCol = i
i = i + 1
.Columns(i).Caption = "溢损数量"
SetColumnWidth sGrdWidth, .Columns(i), 1000
.Columns(i).NumberFormat = "########0.00"
WearQuantityCol = i
i = i + 1
.Columns(i).Caption = "溢损金额"
SetColumnWidth sGrdWidth, .Columns(i), 1000
.Columns(i).NumberFormat = "########0.00"
WearMoneyCol = i
i = i + 1
.Columns(i).Caption = "长短及溢损原因"
SetColumnWidth sGrdWidth, .Columns(i), 1800
WearWhysCol = i
ElseIf byType = WASTAGE_INVOICE Then
i = i + 1
.Columns(i).Caption = "帐面数量"
SetColumnWidth sGrdWidth, .Columns(i), 1000
.Columns(i).NumberFormat = "########0.00"
ShortQuantityCol = i
i = i + 1
.Columns(i).Caption = "实盘数量"
SetColumnWidth sGrdWidth, .Columns(i), 1000
.Columns(i).NumberFormat = "########0.00"
ShortMoneyCol = i
i = i + 1
.Columns(i).Caption = "升耗数量"
SetColumnWidth sGrdWidth, .Columns(i), 1000
.Columns(i).NumberFormat = "########0.00"
WearQuantityCol = i
i = i + 1
.Columns(i).Caption = "升耗金额"
SetColumnWidth sGrdWidth, .Columns(i), 1000
.Columns(i).NumberFormat = "########0.00"
WearMoneyCol = i
i = i + 1
.Columns(i).Caption = "升耗原因说明"
SetColumnWidth sGrdWidth, .Columns(i), 1800
WearWhysCol = i
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -