📄 frmcalccost.frm
字号:
VERSION 5.00
Object = "{D252F124-F62C-11D1-9ABD-444553540000}#1.0#0"; "GADATE.DLL"
Object = "{0D452EE1-E08F-101A-852E-02608C4D0BB4}#2.0#0"; "FM20.DLL"
Object = "{6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.3#0"; "COMCTL32.OCX"
Object = "{F6125AB1-8AB1-11CE-A77F-08002B2F4E98}#2.0#0"; "MSRDC20.OCX"
Begin VB.Form frmCalcCost
Caption = "成本计算"
ClientHeight = 3930
ClientLeft = 60
ClientTop = 345
ClientWidth = 7050
Icon = "frmCalcCost.frx":0000
KeyPreview = -1 'True
LinkTopic = "Form2"
MDIChild = -1 'True
ScaleHeight = 3930
ScaleWidth = 7050
ShowInTaskbar = 0 'False
Begin MSRDC.MSRDC datItem
Height = 330
Left = 3240
Top = 2280
Visible = 0 'False
Width = 1200
_ExtentX = 2117
_ExtentY = 582
_Version = 393216
Options = 0
CursorDriver = 0
BOFAction = 0
EOFAction = 0
RecordsetType = 1
LockType = 3
QueryType = 0
Prompt = 3
Appearance = 1
QueryTimeout = 30
RowsetSize = 100
LoginTimeout = 15
KeysetSize = 0
MaxRows = 0
ErrorThreshold = -1
BatchSize = 15
BackColor = -2147483643
ForeColor = -2147483640
Enabled = -1 'True
ReadOnly = 0 'False
Appearance = -1 'True
DataSourceName = ""
RecordSource = ""
UserName = ""
Password = ""
Connect = ""
LogMessages = ""
Caption = "MSRDC1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
End
Begin VB.CheckBox chkTax
Caption = "含税"
Height = 255
Left = 6000
TabIndex = 15
Top = 3480
Width = 735
End
Begin VB.CommandButton cmdAgain
BeginProperty Font
Name = "Arial"
Size = 9
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 300
Left = 9030
Style = 1 'Graphical
TabIndex = 14
Tag = "1017"
ToolTipText = "再找"
Top = 465
Width = 300
End
Begin VB.TextBox txtFind
Height = 300
Left = 4740
TabIndex = 13
Top = 465
Width = 4275
End
Begin VB.ComboBox cboCost
Height = 300
Index = 3
Left = 840
Style = 2 'Dropdown List
TabIndex = 11
Top = 465
Width = 2895
End
Begin VB.PictureBox picGrid
Height = 975
Left = 15
ScaleHeight = 915
ScaleWidth = 1785
TabIndex = 9
Top = 825
Width = 1845
End
Begin VB.ComboBox cboCost
Height = 300
Index = 1
Left = 5550
Style = 2 'Dropdown List
TabIndex = 8
Top = 75
Width = 1410
End
Begin VB.ComboBox cboCost
Height = 300
Index = 2
Left = 7845
Style = 2 'Dropdown List
TabIndex = 3
Top = 75
Width = 1500
End
Begin VB.ComboBox cboCost
Height = 300
Index = 0
Left = 840
Style = 2 'Dropdown List
TabIndex = 1
Top = 75
Width = 1605
End
Begin ComctlLib.ProgressBar prgLoad
Height = 255
Left = 45
TabIndex = 6
Top = 2760
Width = 5715
_ExtentX = 10081
_ExtentY = 450
_Version = 327682
Appearance = 1
End
Begin GACALENDARLibCtl.Calendar calDate
Height = 300
Left = 2475
OleObjectBlob = "frmCalcCost.frx":000C
TabIndex = 16
Top = 75
Width = 1260
End
Begin VB.Label lblNote
AutoSize = -1 'True
Caption = "内容"
Height = 180
Index = 4
Left = 4230
TabIndex = 12
Top = 525
Width = 360
End
Begin VB.Label lblNote
AutoSize = -1 'True
Caption = "查 找"
Height = 180
Index = 3
Left = 75
TabIndex = 10
Top = 510
Width = 720
End
Begin VB.Label lblNote
Caption = "计算方法"
Height = 225
Index = 1
Left = 4725
TabIndex = 7
Top = 150
Width = 810
End
Begin MSForms.CommandButton cmdReport
Height = 345
Left = 1275
TabIndex = 5
Tag = "1018"
Top = 3435
Width = 1215
Caption = "报表"
PicturePosition = 196613
Size = "2143;609"
FontName = "宋体"
FontHeight = 180
FontCharSet = 134
FontPitchAndFamily= 34
ParagraphAlign = 3
End
Begin MSForms.CommandButton cmdEdit
Height = 345
Left = 60
TabIndex = 4
Tag = "1018"
Top = 3435
Width = 1215
Caption = "编辑"
PicturePosition = 196613
Size = "2143;609"
FontName = "宋体"
FontHeight = 180
FontCharSet = 134
FontPitchAndFamily= 34
ParagraphAlign = 3
End
Begin VB.Label lblNote
Caption = "红字成本"
Height = 225
Index = 2
Left = 7080
TabIndex = 2
Top = 150
Width = 810
End
Begin VB.Label lblNote
Caption = "截止日期"
Height = 195
Index = 0
Left = 75
TabIndex = 0
Top = 135
Width = 810
End
End
Attribute VB_Name = "frmCalcCost"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' 成本计算
' 作者:唐维勇
' 日期:1998.7.17
'
' CalcAllCost 计算所有商品成本
' CloseItemCost 成本结转
' frmCalcScript 成本计算底稿
' frmCalcSingle 商品批次
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Option Explicit
Private WithEvents mclsMainControl As MainControl '主控对象
Attribute mclsMainControl.VB_VarHelpID = -1
Private WithEvents mclsGrid As TableGrid 'Grid对象
Attribute mclsGrid.VB_VarHelpID = -1
Private WithEvents mclsSubClassform As SubClass32.SubClass
Attribute mclsSubClassform.VB_VarHelpID = -1
Private Const PlanViewID = 86 '计划成本视图号
Private Const RealViewID = 87 '实际成本视图号
Private Const SaleViewID = 88 '实际差价视图号
Private Const HelpID = 50021 '13004(old)
Private Const mlngFormMinWidth = 600 '窗体最小尺寸
Private Const mlngFormMinHeight = 300
Private Const mlngLeft = 50
Private Const mlngTop = 900
Private Const mlngBottomHeight = 600
Private Const mlngColID = 0 'ID列号
Private Const mlngColCalcCost = 1 '已计算成本标志列号
Private Const mlngColCalcDate = 2 '计算日期列号
Private Const mlngColCalcStat = 3 '商品代码列号
Public mlngColItemCode As Long '商品代码列号
Public mlngColPlanRate As Long '计划价差异率列号
Public mlngColRealRate As Long '售价差异率列号
Private mblnRefresh As Boolean
Private mblnFind As Boolean
Private mblnSort As Boolean
Private mintYear As Integer '当前会计年度
Private mstrMethodCode As String '成本计算方法
Private mstrFirstPeriod As String '成本计算开始期间
Public Sub ShowMe()
Hide
InitGrid
Show
ZOrder 0
End Sub
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'
' 私有方法
'
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'生成指定方法的商品列表结果集
Private Function GetList(ByVal Method As String, Optional strCond As String) As rdoResultset
Dim strSelect As String
Dim strFrom As String
Dim strWhere As String
Dim strSql As String
Dim dtmFirst As Date, dtmStart As Date, dtmEnd As Date
Dim intPeriod As Integer
Dim errNo As Long
On Error GoTo ErrHandle
If mclsGrid.ListSet.ViewId = 0 Then
Set GetList = Nothing
Exit Function
End If
strSelect = mclsGrid.ListSet.SelectOfSql
strFrom = mclsGrid.ListSet.FromOfSql
strWhere = mclsGrid.ListSet.WhereOfSql
gclsBase.GetBeginAndEndDate "本年", , dtmFirst, , True
If IsDate(CalDate.Text) Then
dtmEnd = CDate(CalDate.Text)
Else
dtmEnd = gclsBase.BaseDate
End If
intPeriod = gclsBase.PeriodOfDate(dtmEnd, dtmStart, dtmEnd)
strFrom = Replace(strFrom, "[QITEMDAILY2]", "(" & GetQItemDaily2OraSql(Format(dtmStart, "yyyy-mm-dd"), Format(dtmEnd, "yyyy-mm-dd")) & ") QItemDaily2")
strFrom = Replace(strFrom, "[QITEMINIT2]", "(" & GetQItemInit2OraSql(Format(dtmStart, "yyyy-mm-dd")) & ") QItemInit2")
If Method = cmRealDiff Then
strSelect = Replace(strSelect, "[BLNTAX]", IIf(chkTax.Value, "1", "0"))
End If
strSelect = "" _
& "Select Item.lngItemID As ID,blnIsCalcCost As CalcCost,strReCalcCost As CalcDate," _
& "DECODE(LEAST(strReCalcCost,'" & Format(dtmEnd, "yyyy-mm-dd") & "'),'" & Format(dtmEnd, "yyyy-mm-dd") & "','√','?') as 状态," & strSelect
If strWhere = "" Then
strWhere = " WHERE strCostMethod='" & Method & "' AND strItemCategory='1' AND (Item.blnIsInActive=0)"
Else
strWhere = " WHERE " & strWhere & " AND strCostMethod='" & Method & "' AND strItemCategory='1' AND (Item.blnIsInActive=0)"
End If
strWhere = strWhere & " AND ItemNature.strCostMethod='" & Method & "'"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -