📄 frmac_balanceresult.frm
字号:
.SetCellAlign COL_HAPPEN_CREDIT_AMOUNT, i, PageNo - 1, 32 + 2
.SetCellNumType COL_HAPPEN_CREDIT_FOREIGN, i, PageNo - 1, 1
.SetCellSeparator COL_HAPPEN_CREDIT_FOREIGN, i, PageNo - 1, 2
.SetCellDigital COL_HAPPEN_CREDIT_FOREIGN, i, PageNo - 1, 2
.SetCellAlign COL_HAPPEN_CREDIT_FOREIGN, i, PageNo - 1, 32 + 2
.SetCellNumType COL_HAPPEN_CREDIT_MONEY, i, PageNo - 1, 1
.SetCellSeparator COL_HAPPEN_CREDIT_MONEY, i, PageNo - 1, 2
.SetCellDigital COL_HAPPEN_CREDIT_MONEY, i, PageNo - 1, 2
.SetCellAlign COL_HAPPEN_CREDIT_MONEY, i, PageNo - 1, 32 + 2
.SetCellNumType COL_TOTAL_DEBIT_AMOUNT, i, PageNo - 1, 1
.SetCellSeparator COL_TOTAL_DEBIT_AMOUNT, i, PageNo - 1, 2
.SetCellDigital COL_TOTAL_DEBIT_AMOUNT, i, PageNo - 1, 2
.SetCellAlign COL_TOTAL_DEBIT_AMOUNT, i, PageNo - 1, 32 + 2
.SetCellNumType COL_TOTAL_DEBIT_FOREIGN, i, PageNo - 1, 1
.SetCellSeparator COL_TOTAL_DEBIT_FOREIGN, i, PageNo - 1, 2
.SetCellDigital COL_TOTAL_DEBIT_FOREIGN, i, PageNo - 1, 2
.SetCellAlign COL_TOTAL_DEBIT_FOREIGN, i, PageNo - 1, 32 + 2
.SetCellNumType COL_TOTAL_DEBIT_MONEY, i, PageNo - 1, 1
.SetCellSeparator COL_TOTAL_DEBIT_MONEY, i, PageNo - 1, 2
.SetCellDigital COL_TOTAL_DEBIT_MONEY, i, PageNo - 1, 2
.SetCellAlign COL_TOTAL_DEBIT_MONEY, i, PageNo - 1, 32 + 2
.SetCellNumType COL_TOTAL_CREDIT_AMOUNT, i, PageNo - 1, 1
.SetCellSeparator COL_TOTAL_CREDIT_AMOUNT, i, PageNo - 1, 2
.SetCellDigital COL_TOTAL_CREDIT_AMOUNT, i, PageNo - 1, 2
.SetCellAlign COL_TOTAL_CREDIT_AMOUNT, i, PageNo - 1, 32 + 2
.SetCellNumType COL_TOTAL_CREDIT_FOREIGN, i, PageNo - 1, 1
.SetCellSeparator COL_TOTAL_CREDIT_FOREIGN, i, PageNo - 1, 2
.SetCellDigital COL_TOTAL_CREDIT_FOREIGN, i, PageNo - 1, 2
.SetCellAlign COL_TOTAL_CREDIT_FOREIGN, i, PageNo - 1, 32 + 2
.SetCellNumType COL_TOTAL_CREDIT_MONEY, i, PageNo - 1, 1
.SetCellSeparator COL_TOTAL_CREDIT_MONEY, i, PageNo - 1, 2
.SetCellDigital COL_TOTAL_CREDIT_MONEY, i, PageNo - 1, 2
.SetCellAlign COL_TOTAL_CREDIT_MONEY, i, PageNo - 1, 32 + 2
.SetCellNumType COL_END_DEBIT_MONEY, i, PageNo - 1, 1
.SetCellSeparator COL_END_DEBIT_MONEY, i, PageNo - 1, 2
.SetCellDigital COL_END_DEBIT_MONEY, i, PageNo - 1, 2
.SetCellAlign COL_END_DEBIT_MONEY, i, PageNo - 1, 32 + 2
.SetCellNumType COL_END_CREDIT_MONEY, i, PageNo - 1, 1
.SetCellSeparator COL_END_CREDIT_MONEY, i, PageNo - 1, 2
.SetCellDigital COL_END_CREDIT_MONEY, i, PageNo - 1, 2
.SetCellAlign COL_END_CREDIT_MONEY, i, PageNo - 1, 32 + 2
.SetCellAlign COL_END_DIRECTION, i, PageNo - 1, 36
.SetCellNumType COL_END_BALANCE_AMOUNT, i, PageNo - 1, 1
.SetCellSeparator COL_END_BALANCE_AMOUNT, i, PageNo - 1, 2
.SetCellDigital COL_END_BALANCE_AMOUNT, i, PageNo - 1, 2
.SetCellAlign COL_END_BALANCE_AMOUNT, i, PageNo - 1, 32 + 2
.SetCellNumType COL_END_BALANCE_FOREIGN, i, PageNo - 1, 1
.SetCellSeparator COL_END_BALANCE_FOREIGN, i, PageNo - 1, 2
.SetCellDigital COL_END_BALANCE_FOREIGN, i, PageNo - 1, 2
.SetCellAlign COL_END_BALANCE_FOREIGN, i, PageNo - 1, 32 + 2
.SetCellNumType COL_END_BALANCE_MONEY, i, PageNo - 1, 1
.SetCellSeparator COL_END_BALANCE_MONEY, i, PageNo - 1, 2
.SetCellDigital COL_END_BALANCE_MONEY, i, PageNo - 1, 2
.SetCellAlign COL_END_BALANCE_MONEY, i, PageNo - 1, 32 + 2
Next i
'合并右边框线
.MergeCells .GetCols(PageNo - 1) - 1, ROW_HEAD1, .GetCols(PageNo - 1) - 1, .GetRows(PageNo - 1) - 1
'Draw Line
.DrawGridLine COL_END_CREDIT_MONEY, ROW_HEAD1, COL_END_CREDIT_MONEY, .GetRows(.GetCurSheet) - 1, 2, 3, .FindColorIndex(RGB(0, 0, 0), 1)
.DrawGridLine COL_START, ROW_HEAD1, COL_END, .GetRows(PageNo - 1) - 1, 1, 3, .FindColorIndex(RGB(0, 0, 0), 1)
.DrawGridLine COL_SUBJECTCODE, ROW_HEAD1, COL_END, .GetRows(PageNo - 1) - 2, 5, 2, .FindColorIndex(RGB(0, 0, 0), 1)
.DrawGridLine COL_SUBJECTNAME, ROW_HEAD1, COL_END, .GetRows(PageNo - 1) - 1, 2, 2, .FindColorIndex(RGB(0, 0, 0), 1)
.DrawGridLine COL_END_CREDIT_MONEY, ROW_HEAD1, COL_END_CREDIT_MONEY, .GetRows(PageNo - 1) - 1, 3, 3, .FindColorIndex(RGB(0, 0, 0), 1)
'Print Corp & Date & Time
.SetRows .GetRows(PageNo - 1) + 1, PageNo - 1
i = .GetRows(PageNo - 1) - 1
.MergeCells COL_START, i, COL_HAPPEN_DEBIT_FOREIGN, i
.MergeCells COL_HAPPEN_DEBIT_MONEY, i, COL_END, i
.SetCellAlign COL_START, i, PageNo - 1, 33
.SetCellAlign COL_HAPPEN_DEBIT_MONEY, i, PageNo - 1, 34
.SetCellFont COL_START, i, PageNo - 1, .FindFontIndex("宋体", 1)
.SetCellFontSize COL_START, i, PageNo - 1, 10
.SetCellFontStyle COL_START, i, PageNo - 1, 0
.SetCellFont COL_HAPPEN_DEBIT_MONEY, i, PageNo - 1, .FindFontIndex("宋体", 1)
.SetCellFontSize COL_HAPPEN_DEBIT_MONEY, i, PageNo - 1, 10
.SetCellFontStyle COL_HAPPEN_DEBIT_MONEY, i, PageNo - 1, 0
.SetCellString COL_START, i, PageNo - 1, "核算单位:" & m_sEnterName
.SetCellString COL_HAPPEN_DEBIT_MONEY, i, PageNo - 1, "( 打印日期:" & Format(Date, "yyyy-mm-dd") & _
" 时间:" & Format(Time, "hh:MM:ss") & " )"
.ShowPageBreak False
End With
End Sub
Public Sub ShowResult()
Dim pzzl() As String
Dim QueryStr As String '存放查询条件
Dim OrderStr As String '存放排序条件
Dim i As Long
Dim lCount As Long
Dim lPage As Long
Dim bFristKmjc As Boolean
Dim bTemp As Boolean
Dim BeginMonth As String
Dim HappenMonthTo As String
Dim sBegin_Direction As String '期初余额方向
Dim sEnd_Direction As String '期末余额方向
Dim dBegin_Balance_Amount As Double '期初数量余额
Dim dBegin_Balance_Foreign As Double '期初外币余额
Dim dBegin_Balance_Money As Double '期初金额余额
Dim dBegin_Debit_Money As Double '期初借方金额
Dim dBegin_Credit_Money As Double '期初贷方金额
Dim dHappen_Debit_Amount As Double '本期借方数量
Dim dHappen_Debit_Foreign As Double '本期借方外币
Dim dHappen_Debit_Money As Double '本期借方金额
Dim dHappen_Credit_Amount As Double '本期贷方数量
Dim dHappen_Credit_Foreign As Double '本期贷方外币
Dim dHappen_Credit_Money As Double '本期贷方金额
Dim dTotal_Debit_Amount As Double '本期借方数量
Dim dTotal_Debit_Foreign As Double '本期借方外币
Dim dTotal_Debit_Money As Double '本期借方金额
Dim dTotal_Credit_Amount As Double '本期贷方数量
Dim dTotal_Credit_Foreign As Double '本期贷方外币
Dim dTotal_Credit_Money As Double '本期贷方金额
Dim dEnd_Balance_Amount As Double '期末数量余额
Dim dEnd_Balance_Foreign As Double '期末外币余额
Dim dEnd_Balance_Money As Double '期末金额余额
Dim dEnd_Debit_Money As Double '期末借方金额
Dim dEnd_Credit_Money As Double '期末贷方金额
Dim sBegin_Direction_Total As String '期初余额合计方向
Dim sEnd_Direction_Total As String '期末余额方向
Dim dBegin_Balance_Amount_Total As Double '期初数量余额
Dim dBegin_Balance_Foreign_Total As Double '期初外币余额
Dim dBegin_Balance_Money_Total As Double '期初金额余额
Dim dBegin_Debit_Money_Total As Double '期初借方金额
Dim dBegin_Credit_Money_Total As Double '期初贷方金额
Dim dBegin_Debit_Moneys As Double '期初借方余额
Dim dBegin_Credit_Moneys As Double '期初贷方余额
Dim dHappen_Debit_Amount_Total As Double '本期借方数量
Dim dHappen_Debit_Foreign_Total As Double '本期借方外币
Dim dHappen_Debit_Money_Total As Double '本期借方金额
Dim dHappen_Credit_Amount_Total As Double '本期贷方数量
Dim dHappen_Credit_Foreign_Total As Double '本期贷方外币
Dim dHappen_Credit_Money_Total As Double '本期贷方金额
Dim dTotal_Debit_Amount_Total As Double '累计借方数量
Dim dTotal_Debit_Foreign_Total As Double '累计借方外币
Dim dTotal_Debit_Money_Total As Double '累计借方金额
Dim dTotal_Credit_Amount_Total As Double '累计贷方数量
Dim dTotal_Credit_Foreign_Total As Double '累计贷方外币
Dim dTotal_Credit_Money_Total As Double '累计贷方金额
Dim dEnd_Balance_Amount_Total As Double '期末数量余额
Dim dEnd_Balance_Foreign_Total As Double '期末外币余额
Dim dEnd_Balance_Money_Total As Double '期末金额余额
Dim dEnd_Debit_Money_Total As Double '期末借方金额
Dim dEnd_Credit_Money_Total As Double '期末贷方金额
Dim dEnd_Debit_Moneys As Double '期末借方余额
Dim dEnd_Credit_Moneys As Double '期末贷方余额
'未记账凭证的数量(外币、金额)的借方金额和、贷方金额和及余额和
Dim NotRecord_Debit_Amount As Double, NotRecord_Debit_Foreign As Double, NotRecord_Debit_Money As Double
Dim NotRecord_Credit_Amount As Double, NotRecord_Credit_Foreign As Double, NotRecord_Credit_Money As Double
Dim NotRecord_Balance_Amount As Double, NotRecord_Balance_Foreign As Double, NotRecord_Balance_Money As Double
Dim BNotRecord_Debit_Amount As Double, BNotRecord_Debit_Foreign As Double, BNotRecord_Debit_Money As Double
Dim BNotRecord_Credit_Amount As Double, BNotRecord_Credit_Foreign As Double, BNotRecord_Credit_Money As Double
Dim BNotRecord_Balance_Amount As Double, BNotRecord_Balance_Foreign As Double, BNotRecord_Balance_Money As Double
Dim bFound As Boolean '是否存在未记账凭证
Dim bFoundBeforeBegin As Boolean '是否存在期初未记账凭证
Dim sSQL As String
Dim iMaxColWidth As Integer
'得到当前账套的单位名称
m_sEnterName = GetDWMC
If m_sEnterName = "" Then
Exit Sub
End If
fMainForm.MousePointer = vbHourglass
BeginMonth = Format(Val(m_sMonthFrom) - 1, "00")
HappenMonthTo = Format(m_sMonthTo, "00")
''''''''
'取最小的科目级次修改起始级次
Dim rSt As New ADODB.Recordset
Dim QuerySQL As String
If m_sSubjectCodeFrom <> "" Then
QuerySQL = " kmdm >= '" & m_sSubjectCodeFrom & "' AND "
End If
If m_sSubjectCodeTo <> "" Then
If IsEndSubject(m_sSubjectCodeTo) Then
QuerySQL = QuerySQL & " (kmdm <= '" & m_sSubjectCodeTo & "' or kmdm = '" & Trim(m_sSubjectCodeTo) & "' ) AND "
Else
QuerySQL = QuerySQL & " (kmdm <= '" & m_sSubjectCodeTo & "' or kmdm like '" & Trim(m_sSubjectCodeTo) & "-%' ) AND "
End If
End If
If QuerySQL <> "" Then
QuerySQL = " where " + Mid(QuerySQL, 1, Len(QuerySQL) - 4)
End If
rSt.Open "Select Min(kmjc) from tZW_Km" + glo.sOperateYear + QuerySQL, glo.cnnMain
If rSt.EOF = False Then
If IsNull(rSt.Fields(0)) = False Then
m_iSubjectLevelFrom = CInt(rSt.Fields(0).value)
End If
End If
'''''''''''''
sSQL = "SELECT a.kmdm kmdm,a.kmmc kmmc,a.yefx yefx,b.kmlx kmlx,b.isendkm isEndkm ,a.ljjsl" & BeginMonth & "- a.ljdsl" & BeginMonth & " Begin_Balance_Amount," & _
"a.ljjwb" & BeginMonth & "- a.ljdwb" & BeginMonth & " Begin_Balance_Foreign," & _
"a.ljj" & BeginMonth & " Begin_Debit_Money,a.ljd" & BeginMonth & " Begin_Credit_Money," & _
"a.ljjsl" & HappenMonthTo & "- a.ljjsl" & BeginMonth & " Happen_Debit_Amount," & _
"a.ljjwb" & HappenMonthTo & "- a.ljjwb" & BeginMonth & " Happen_Debit_Foreign," & _
"a.ljj" & HappenMonthTo & "- a.ljj" & BeginMonth & " Happen_Debit_Money," & _
"a.ljdsl" & HappenMonthTo & "- a.ljdsl" & BeginMonth & " Happen_Credit_Amount," & _
"a.ljdwb" & HappenMonthTo & "- a.ljdwb" & BeginMonth & " Happen_Credit_Foreign," & _
"a.ljd" & HappenMonthTo & "- a.ljd" & BeginMonth & " Happen_Credit_Money," & _
"a.ljjsl" & HappenMonthTo & "- a.ljjsl00 Total_Debit_Amount," & _
"a.ljjwb" & HappenMonthTo & "- a.ljjwb00 Total_Debit_Foreign," & _
"a.ljj" & HappenMonthTo & "- a.ljj00 Total_Debit_Money," & _
"a.ljdsl" & HappenMonthTo & "- a.ljdsl00 Total_Credit_Amount," & _
"a.ljdwb" & HappenMonthTo & "- a.ljdwb00 Total_Credit_Foreign," & _
"a.ljd" & HappenMonthTo & "- a.ljd00 Total_Credit_Money," & _
"a.ljjsl" & HappenMonthTo & "- a.ljdsl" & HappenMonthTo & " End_Balance_Amount," & _
"a.ljjwb" & HappenMonthTo & "- a.ljdwb" & HappenMonthTo & " End_Balance_Foreign," & _
"a.ljj" & HappenMonthTo & " End_Debit_Money,a.ljd" & HappenMonthTo & " End_Credit_Money," & _
"a.ljj" & HappenMonthTo & " -a.ljd" & HappenMonthTo & " End_Balance_Money" & _
" FROM tZW_balance" & glo.sOperateYear & " a , tzw_km" & glo.sOperateYear & " b WHERE a.kmdm=b.kmdm and "
'brb add ********
If m_sSubjectCodeFrom <> "" Then
QueryStr = " a.kmdm >= '" & m_sSubjectCodeFrom & "' AND "
End If
If m_sSubjectCodeTo <> "" Then
If IsEndSubject(m_sSubjectCodeTo) Then
QueryStr = QueryStr & " (a.kmdm <= '" & m_sSubjectCodeTo & "' or a.kmdm = '" & Trim(m_sSubjectCodeTo) & "' ) AND "
Else
QueryStr = QueryStr & " (a.kmdm <= '" & m_sSubjectCodeTo & "' or a.kmdm like '" & Trim(m_sSubjectCodeTo) & "-%' ) AND "
End If
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -