📄 accountequation.frm
字号:
End
Begin VB.Label lblEquation
Caption = "权益:"
Height = 180
Index = 20
Left = 4680
TabIndex = 23
Top = 2760
Width = 720
End
Begin VB.Label lblEquation
Caption = "负债:"
Height = 180
Index = 19
Left = 4680
TabIndex = 22
Top = 2220
Width = 720
End
Begin VB.Label lblEquation
Caption = "合计:"
Height = 180
Index = 21
Left = 240
TabIndex = 21
Top = 3120
Width = 720
End
Begin VB.Label lblEquation
Caption = "损益:"
Height = 180
Index = 18
Left = 240
TabIndex = 20
Top = 2760
Width = 720
End
Begin VB.Label lblEquation
Caption = "成本:"
Height = 180
Index = 17
Left = 240
TabIndex = 19
Top = 2490
Width = 720
End
Begin VB.Label lblEquation
Caption = "资产:"
Height = 180
Index = 16
Left = 240
TabIndex = 18
Top = 2220
Width = 720
End
Begin VB.Label lblEquation
Caption = "期初余额"
Height = 180
Index = 30
Left = 360
TabIndex = 16
Top = 3720
Width = 720
End
Begin VB.Label lblEquation
Caption = "期初发生"
Height = 180
Index = 15
Left = 360
TabIndex = 15
Top = 1920
Width = 720
End
Begin VB.Label lblEquation
Alignment = 1 'Right Justify
Height = 180
Index = 14
Left = 5580
TabIndex = 14
Top = 1320
Width = 2100
End
Begin VB.Label lblEquation
Alignment = 1 'Right Justify
Height = 180
Index = 12
Left = 5580
TabIndex = 13
Top = 960
Width = 2100
End
Begin VB.Label lblEquation
Alignment = 1 'Right Justify
Height = 180
Index = 11
Left = 5580
TabIndex = 12
Top = 420
Width = 2100
End
Begin VB.Label lblEquation
Alignment = 1 'Right Justify
Height = 180
Index = 13
Left = 1140
TabIndex = 11
Top = 1320
Width = 2100
End
Begin VB.Label lblEquation
Alignment = 1 'Right Justify
Height = 180
Index = 10
Left = 1140
TabIndex = 10
Top = 960
Width = 2100
End
Begin VB.Label lblEquation
Alignment = 1 'Right Justify
Height = 180
Index = 9
Left = 1140
TabIndex = 9
Top = 720
Width = 2100
End
Begin VB.Label lblEquation
Alignment = 1 'Right Justify
Height = 180
Index = 8
Left = 1140
TabIndex = 8
Top = 420
Width = 2100
End
Begin VB.Label lblEquation
Caption = "合计:"
Height = 180
Index = 7
Left = 4680
TabIndex = 7
Top = 1320
Width = 720
End
Begin VB.Label lblEquation
Caption = "合计:"
Height = 180
Index = 6
Left = 240
TabIndex = 6
Top = 1320
Width = 720
End
Begin VB.Label lblEquation
Caption = "净权益:"
Height = 180
Index = 5
Left = 4680
TabIndex = 5
Top = 960
Width = 720
End
Begin VB.Label lblEquation
Caption = "负债:"
Height = 180
Index = 4
Left = 4680
TabIndex = 4
Top = 420
Width = 720
End
Begin VB.Label lblEquation
Caption = "损益:"
Height = 180
Index = 3
Left = 240
TabIndex = 3
Top = 960
Width = 720
End
Begin VB.Label lblEquation
Caption = "资产:"
Height = 180
Index = 1
Left = 240
TabIndex = 2
Top = 420
Width = 720
End
Begin VB.Label lblEquation
Caption = "成本:"
Height = 180
Index = 2
Left = 240
TabIndex = 1
Top = 690
Width = 720
End
Begin VB.Label lblEquation
Caption = "年初余额"
Height = 180
Index = 0
Left = 360
TabIndex = 0
Top = 120
Width = 720
End
End
Attribute VB_Name = "frmAccountEquation"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private mintAccountSystem As Integer
Private Sub cmdEquation_Click()
Unload Me
End Sub
Private Sub Form_Load()
Utility.SetHelpID 30004
Set Me.Icon = GetFormResPicture(139, vbResIcon)
Set cmdEquation.Picture = GetFormResPicture(1022, vbResBitmap)
End Sub
Private Sub Form_Paint()
FrameBox Me.hwnd, 90, 180, 7800, 1800
FrameBox Me.hwnd, 90, 1980, 7800, 3600
FrameBox Me.hwnd, 90, 3780, 7800, 5400
DrawInSertLine Me.hwnd, 210, 1200, 3270, 1200
DrawInSertLine Me.hwnd, 4680, 1200, 7680, 1200
DrawInSertLine Me.hwnd, 210, 4800, 3270, 4800
DrawInSertLine Me.hwnd, 4680, 4800, 7680, 4800
DrawInSertLine Me.hwnd, 210, 3000, 3270, 3000
DrawInSertLine Me.hwnd, 4680, 3000, 7680, 3000
End Sub
Public Sub ShowCard(ByVal strDec As String, ByVal strDate As String, ByVal intYear As Integer)
Dim intCount As Integer
Dim intCnt As Integer
Dim recTemp As rdoResultset, strSql As String
Dim curTotal As Currency
Dim dblSum(2) As Double
Dim dblDailySum(2) As Double
Dim dblInitSum(2) As Double
Dim intLeft(3) As Integer
Dim intTop(2) As Integer
Dim intHeight As Integer
Dim intLNum(2) As Integer
Dim intRNum(2) As Integer
Dim intLMid(2) As Integer
Dim intRMid(2) As Integer
intLeft(0) = 240
intLeft(1) = 1140
intLeft(2) = 4680
intLeft(3) = 5580
intTop(0) = 420
intTop(1) = 2220
intTop(2) = 4020
intHeight = 270
If gclsBase.FirstDate = gclsBase.BeginDate Then
strSql = "SELECT AccountType.lngAccountTypeID, strAccountTypeName,AccountType.intDirection," & _
"Sum(Decode(Sign(To_Date(strDate,'yyyy-mm-dd')-To_Date('" & gclsBase.FirstDate & "','yyyy-mm-dd')),-1,dblPostedDebit-dblPostedCredit,0)) AS Balance1," & _
"0 AS Daily1," & _
"Sum(dblPostedDebit-dblPostedCredit) AS Balance2" & _
" From AccountType,WrAcntBalance" & _
" Where AccountType.lngAccountTypeID=WrAcntBalance.lngAccountTypeID(+)" & _
" And (strDate<'" & gclsBase.BeginDate & "' Or strDate Is Null)" & _
" Group By AccountType.lngAccountTypeID,AccountType.intDirection,strAccountTypeName"
Else
strSql = "SELECT AccountType.lngAccountTypeID, strAccountTypeName, AccountType.intDirection," & _
"Sum(Decode(Sign(To_Date(strDate,'yyyy-mm-dd')-To_Date('" & gclsBase.FirstDate & "','yyyy-mm-dd')),-1,dblPostedDebit-dblPostedCredit,0)) AS Balance1," & _
"Sum(Decode(Sign(To_Date(strDate,'yyyy-mm-dd')-To_Date('" & gclsBase.FirstDate & "','yyyy-mm-dd')),-1,0,dblPostedDebit-dblPostedCredit)) AS Daily1," & _
"Sum(dblPostedDebit-dblPostedCredit) AS Balance2" & _
" From AccountType,WrAcntBalance" & _
" Where AccountType.lngAccountTypeID=WrAcntBalance.lngAccountTypeID(+)" & _
" And (strDate<'" & gclsBase.BeginDate & "' Or strDate Is Null)" & _
" Group By AccountType.lngAccountTypeID,AccountType.intDirection,strAccountTypeName"
End If
Set recTemp = gclsBase.BaseDB.OpenResultset(strSql, rdOpenStatic)
For intCount = 0 To 4
If Not recTemp.EOF Then
If recTemp!intDirection = 1 Then
For intCnt = 0 To 2
lblEquation(1 + intCount + intCnt * 15).Left = intLeft(0)
lblEquation(1 + intCount + intCnt * 15).top = intTop(intCnt) + intLNum(intCnt) * intHeight
lblEquation(1 + intCount + intCnt * 15).Caption = recTemp!strAccountTypeName & ":"
lblEquation(8 + intCount + intCnt * 15).Left = intLeft(1)
lblEquation(8 + intCount + intCnt * 15).top = intTop(intCnt) + intLNum(intCnt) * intHeight
intLNum(intCnt) = intLNum(intCnt) + 1
If intLNum(intCnt) = 2 Then
intLMid(intCnt) = intCount
End If
Next
If recTemp!balance1 <> 0 Then
lblEquation(8 + intCount).Caption = Format(recTemp("balance1"), strDec)
dblSum(0) = dblSum(0) + recTemp!balance1
End If
If recTemp!daily1 <> 0 Then
lblEquation(23 + intCount).Caption = Format(recTemp("daily1"), strDec)
dblDailySum(0) = dblDailySum(0) + recTemp!daily1
End If
If recTemp!balance2 <> 0 Then
lblEquation(38 + intCount).Caption = Format(recTemp("balance2"), strDec)
dblInitSum(0) = dblInitSum(0) + recTemp!balance2
End If
Else
For intCnt = 0 To 2
lblEquation(1 + intCount + intCnt * 15).Left = intLeft(2)
lblEquation(1 + intCount + intCnt * 15).top = intTop(intCnt) + intRNum(intCnt) * intHeight
lblEquation(1 + intCount + intCnt * 15).Caption = recTemp!strAccountTypeName & ":"
lblEquation(8 + intCount + intCnt * 15).Left = intLeft(3)
lblEquation(8 + intCount + intCnt * 15).top = intTop(intCnt) + intRNum(intCnt) * intHeight
intRNum(intCnt) = intRNum(intCnt) + 1
If intRNum(intCnt) = 2 Then
intRMid(intCnt) = intCount
End If
Next
If recTemp!balance1 <> 0 Then
lblEquation(8 + intCount).Caption = Format(-recTemp("balance1"), strDec)
dblSum(1) = dblSum(1) - recTemp!balance1
End If
If recTemp!daily1 <> 0 Then
lblEquation(23 + intCount).Caption = Format(-recTemp("daily1"), strDec)
dblDailySum(1) = dblDailySum(1) - recTemp!daily1
End If
If recTemp!balance2 <> 0 Then
lblEquation(38 + intCount).Caption = Format(-recTemp("balance2"), strDec)
dblInitSum(1) = dblInitSum(1) - recTemp!balance2
End If
End If
recTemp.MoveNext
Else
For intCnt = 0 To 2
lblEquation(1 + intCount + intCnt * 15).Visible = False
lblEquation(8 + intCount + intCnt * 15).Visible = False
Next
End If
Next
For intCnt = 0 To 2
If intLNum(intCnt) = 2 Then
lblEquation(1 + intLMid(intCnt) + intCnt * 15).top = intTop(intCnt) + 2 * intHeight
lblEquation(8 + intLMid(intCnt) + intCnt * 15).top = intTop(intCnt) + 2 * intHeight
End If
If intRNum(intCnt) = 2 Then
lblEquation(1 + intLMid(intCnt) + intCnt * 15).top = intTop(intCnt) + 2 * intHeight
lblEquation(8 + intRMid(intCnt) + intCnt * 15).top = intTop(intCnt) + 2 * intHeight
End If
Next
For intCount = 0 To 1
If dblSum(intCount) <> 0 Then
lblEquation(intCount + 13).Caption = Format(dblSum(intCount), strDec)
End If
If dblDailySum(intCount) <> 0 Then
lblEquation(intCount + 28).Caption = Format(dblDailySum(intCount), strDec)
End If
If dblInitSum(intCount) <> 0 Then
lblEquation(intCount + 43).Caption = Format(dblInitSum(intCount), strDec)
End If
Next
If lblEquation(13).Caption = lblEquation(14).Caption Then
Label6(0).Visible = False
Label6(3).Visible = True
Else
Label6(0).Visible = True
Label6(3).Visible = False
lblBalance(0).Visible = True
lblBalance(3).Visible = True
lblBalance(3).Caption = Format(dblSum(0) - dblSum(1), strDec)
End If
If lblEquation(28).Caption = lblEquation(29).Caption Then
Label6(1).Visible = False
Label6(4).Visible = True
Else
Label6(1).Visible = True
Label6(4).Visible = False
lblBalance(1).Visible = True
lblBalance(4).Visible = True
lblBalance(4).Caption = Format(dblDailySum(0) - dblDailySum(1), strDec)
End If
If lblEquation(43).Caption = lblEquation(44).Caption Then
Label6(2).Visible = False
Label6(5).Visible = True
Else
Label6(2).Visible = True
Label6(5).Visible = False
lblBalance(2).Visible = True
lblBalance(5).Visible = True
lblBalance(5).Caption = Format(dblInitSum(0) - dblInitSum(1), strDec)
End If
recTemp.Close
Me.Show vbModal
End Sub
Private Sub Form_Unload(Cancel As Integer)
Utility.RemoveFormResPicture 139
Utility.RemoveFormResPicture 1022
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -