<% ' %> <% Function TyoboCashFlowStatement(EnshuCD, KaisyaCD, AutoFlg, PrintFlg, Kaishibi, Syuryobi, Param1, Param2, Param3) Dim Query Dim Content Dim Content2 If Kaishibi = "" Then Kaishibi = GB_KaikeiKaishibi End If IF Syuryobi = "" Then Syuryobi = GB_KaikeiSyuryobi End If Dim PageType PageType = "キャッシュフロー計算書" Dim RouteType RouteType = Request("RouteType") Dim RowBreakNum, RowCount Dim Page RowCount = 0 If PrintFlg = 1 Then RowBreakNum = 35 Else RowBreakNum = MaxRowBreakNum MaxPage = 1 End If Dim KishuZandaka Dim KimatsuZandaka KishuZandaka = 0 KimatsuZandaka = 0 Dim ii, jj, kk ii = 0 '報告書書式を配列に取得 Dim RowCD Dim RowMeisho Dim RowTaishaku Dim RowSUMCD Dim RowSUMKubun Dim RowDspScore Dim RowDspLR Dim RowDspKosei Dim RowKingaku Dim RowZandaka ReDim RowCD(0) ReDim RowMeisho(0) ReDim RowTaishaku(0) ReDim RowSUMCD(0) ReDim RowSUMKubun(0) ReDim RowDspScore(0) ReDim RowDspLR(0) ReDim RowDspKosei(0) ReDim RowKingaku(0) ReDim RowZandaka(0) Query = "exec SPM報告書書式一覧 '" & GB_SystemCD & "','" & EnshuCD & "','C'" Set Content = OpenQuery(Query) Do While Not(Content.BOF Or Content.EOF) If "" & Content.Fields("集計CD") <> "" Then ReDim PreServe RowCD(UBound(RowCD) + 1) '配列+1 'ラインコントロールの値の分の空配列を増やす If "" & Content.Fields("ラインコントロール") <> "" Then If IsNumeric(Content.Fields("ラインコントロール")) Then ReDim PreServe RowCD(UBound(RowCD) + Int(Content.Fields("ラインコントロール"))) '配列+ラインコントロール End If End If ReDim PreServe RowMeisho(UBound(RowCD)) ReDim PreServe RowTaishaku(UBound(RowCD)) ReDim PreServe RowSUMCD(UBound(RowCD)) ReDim PreServe RowSUMKubun(UBound(RowCD)) ReDim PreServe RowDspScore(UBound(RowCD)) ReDim PreServe RowDspLR(UBound(RowCD)) ReDim PreServe RowDspKosei(UBound(RowCD)) ReDim PreServe RowKingaku(UBound(RowCD)) ReDim PreServe RowZandaka(UBound(RowCD)) RowCD(UBound(RowCD)) = "" & Content.Fields("集計CD") RowMeisho(UBound(RowCD)) = "" & Content.Fields("集計名称") RowTaishaku(UBound(RowCD)) = "" & Content.Fields("貸借") RowSUMCD(UBound(RowCD)) = "" & Content.Fields("集計先") RowSUMKubun(UBound(RowCD)) = "" & Content.Fields("加減区分") RowDspScore(UBound(RowCD)) = "" & Content.Fields("アンダーライン") RowDspLR(UBound(RowCD)) = "" & Content.Fields("右方表示") RowDspKosei(UBound(RowCD)) = "" & Content.Fields("構成表示") End If Content.MoveNext Loop For ii = 1 To UBound(RowCD) RowKingaku(ii) = 0 RowZandaka(ii) = 0 Next 'デバッグ用 If 0=1 Then For ii = 1 To UBound(RowCD) Response.Write(RowCD(ii) & "
" & vbCrLf) Response.Write(RowMeisho(ii) & "
" & vbCrLf) Response.Write(RowTaishaku(ii) & "
" & vbCrLf) Response.Write(RowSUMCD(ii) & "
" & vbCrLf) Response.Write(RowSUMKubun(ii) & "
" & vbCrLf) Response.Write(RowDspScore(ii) & "
" & vbCrLf) Response.Write(RowDspLR(ii) & "
" & vbCrLf) Response.Write(RowDspKosei(ii) & "
" & vbCrLf) Response.Write(RowKingaku(ii) & "
" & vbCrLf) Response.Write(RowZandaka(ii) & "
" & vbCrLf) Response.Write("
" & vbCrLf) Next Exit Function End If Dim TmpKingaku 'BS期首残高を取得 Query = "exec SPK自動転記帳簿_財務諸表 '" & GB_SystemCD & "', '" & EnshuCD & "', '" & KaisyaCD & "', '" & Kaishibi & "', '" & Syuryobi & "','B', 0, 0" '期首残高のみ Set Content = OpenQuery(Query) Do While Not(Content.BOF Or Content.EOF) '報告書書式配列ループ For ii = 0 To UBound(RowCD) If "" & Content.Fields("キャッシュフロー計算書集計CD") = "" & RowCD(ii) Then '科目貸借に従い金額を算出 If "" & Content.Fields("貸借区分") = "D" Then TmpKingaku = Content.Fields("借方金額") - Content.Fields("貸方金額") Else TmpKingaku = Content.Fields("貸方金額") - Content.Fields("借方金額") End If '貸借区分に従い集計 If "" & RowTaishaku(ii) <> "" & Content.Fields("貸借区分") Then RowZandaka(ii) = RowZandaka(ii) - TmpKingaku Else RowZandaka(ii) = RowZandaka(ii) + TmpKingaku End If Exit For End If Next Content.MoveNext Loop 'PL期首残高を取得 Query = "exec SPK自動転記帳簿_財務諸表 '" & GB_SystemCD & "', '" & EnshuCD & "', '" & KaisyaCD & "', '" & Kaishibi & "', '" & Syuryobi & "','P', 0, 0" '期首残高のみ Set Content = OpenQuery(Query) Do While Not(Content.BOF Or Content.EOF) '報告書書式配列ループ For ii = 0 To UBound(RowCD) If "" & Content.Fields("キャッシュフロー計算書集計CD") = "" & RowCD(ii) Then '科目貸借に従い金額を算出 If "" & Content.Fields("貸借区分") = "D" Then TmpKingaku = Content.Fields("借方金額") - Content.Fields("貸方金額") Else TmpKingaku = Content.Fields("貸方金額") - Content.Fields("借方金額") End If '貸借区分に従い集計 If "" & RowTaishaku(ii) <> "" & Content.Fields("貸借区分") Then RowZandaka(ii) = RowZandaka(ii) - TmpKingaku Else RowZandaka(ii) = RowZandaka(ii) + TmpKingaku End If Exit For End If Next Content.MoveNext Loop 'BS期末残高を取得 Query = "exec SPK自動転記帳簿_財務諸表 '" & GB_SystemCD & "', '" & EnshuCD & "', '" & KaisyaCD & "', '" & Kaishibi & "', '" & Syuryobi & "','B', 0, 9" '整理記入まで Set Content = OpenQuery(Query) Do While Not(Content.BOF Or Content.EOF) '報告書書式配列ループ For ii = 0 To UBound(RowCD) If "" & Content.Fields("キャッシュフロー計算書集計CD") = "" & RowCD(ii) Then '科目貸借に従い金額を算出 If "" & Content.Fields("貸借区分") = "D" Then TmpKingaku = Content.Fields("借方金額") - Content.Fields("貸方金額") Else TmpKingaku = Content.Fields("貸方金額") - Content.Fields("借方金額") End If '貸借区分に従い集計 If "" & RowTaishaku(ii) <> "" & Content.Fields("貸借区分") Then RowKingaku(ii) = RowKingaku(ii) - TmpKingaku Else RowKingaku(ii) = RowKingaku(ii) + TmpKingaku End If Exit For End If Next Content.MoveNext Loop 'PL期末残高を取得 Query = "exec SPK自動転記帳簿_財務諸表 '" & GB_SystemCD & "', '" & EnshuCD & "', '" & KaisyaCD & "', '" & Kaishibi & "', '" & Syuryobi & "','P', 0, 9" '整理記入まで Set Content = OpenQuery(Query) Do While Not(Content.BOF Or Content.EOF) '報告書書式配列ループ For ii = 0 To UBound(RowCD) If "" & Content.Fields("キャッシュフロー計算書集計CD") = "" & RowCD(ii) Then '科目貸借に従い金額を算出 If "" & Content.Fields("貸借区分") = "D" Then TmpKingaku = Content.Fields("借方金額") - Content.Fields("貸方金額") Else TmpKingaku = Content.Fields("貸方金額") - Content.Fields("借方金額") End If '貸借区分に従い集計 If "" & RowTaishaku(ii) <> "" & Content.Fields("貸借区分") Then RowKingaku(ii) = RowKingaku(ii) - TmpKingaku Else RowKingaku(ii) = RowKingaku(ii) + TmpKingaku End If Exit For End If Next Content.MoveNext Loop For ii = 1 To UBound(RowCD) '当期増減額を算出 RowKingaku(ii) = RowKingaku(ii) - RowZandaka(ii) 'マイナスなら正負反転 If RowSUMKubun(ii) <> "+" Then RowKingaku(ii) = RowKingaku(ii) * -1 RowZandaka(ii) = RowZandaka(ii) * -1 End If Next 'デバッグ用 If 0=1 Then For ii = 1 To UBound(RowCD) Response.Write(RowCD(ii) & "
" & vbCrLf) Response.Write(RowMeisho(ii) & "
" & vbCrLf) Response.Write(RowTaishaku(ii) & "
" & vbCrLf) Response.Write(RowSUMCD(ii) & "
" & vbCrLf) Response.Write(RowSUMKubun(ii) & "
" & vbCrLf) Response.Write(RowDspScore(ii) & "
" & vbCrLf) Response.Write(RowDspLR(ii) & "
" & vbCrLf) Response.Write(RowDspKosei(ii) & "
" & vbCrLf) Response.Write(RowKingaku(ii) & "
" & vbCrLf) Response.Write(RowZandaka(ii) & "
" & vbCrLf) Response.Write("
" & vbCrLf) Response.Write("" & vbCrLf) Next Exit Function End If '書式内集計 For ii = 1 To UBound(RowCD) If "" & RowSUMCD(ii) <> "" Then For jj = 1 To UBound(RowCD) If "" & RowCD(jj) = "" & RowSUMCD(ii) Then RowKingaku(jj) = RowKingaku(jj) + RowKingaku(ii) RowZandaka(jj) = RowZandaka(jj) + RowZandaka(ii) Exit For End If Next End If Next 'デバッグ用 If 0=1 Then For ii = 1 To UBound(RowCD) Response.Write(RowCD(ii) & "
" & vbCrLf) Response.Write(RowMeisho(ii) & "
" & vbCrLf) Response.Write(RowTaishaku(ii) & "
" & vbCrLf) Response.Write(RowSUMCD(ii) & "
" & vbCrLf) Response.Write(RowSUMKubun(ii) & "
" & vbCrLf) Response.Write(RowDspScore(ii) & "
" & vbCrLf) Response.Write(RowDspLR(ii) & "
" & vbCrLf) Response.Write(RowDspKosei(ii) & "
" & vbCrLf) Response.Write(RowKingaku(ii) & "
" & vbCrLf) Response.Write(RowZandaka(ii) & "
" & vbCrLf) Response.Write("
" & vbCrLf) Response.Write("" & vbCrLf) Next Exit Function End If If PrintFlg = 0 Then %>
<% End If ' For Page = 1 To MaxPage ' If Page <> 1 Then ' Response.Write(PageBreakBefore) '印刷改ページ ' End If %>
<% = Spacer(1, 7) %>
<% If PrintFlg = 1 Then Response.Write(PrintHeader1(AutoFlg)) End if %>
<% = PageType %>
<% = SetDate(Syuryobi, 2) %>
<% If PrintFlg = 0 Then %>
<% End If %> <% If UBound(RowCD) > 0 Then %> <% For ii = 1 To UBound(RowCD) Dim ZeroNullFlg ZeroNullFlg = true If ii = UBound(RowCD) Then ZeroNullFlg = false End If Response.Write("" & vbCrLf) Response.Write("" & vbCrLf) If "" & RowDspLR(ii) <> "R" Then Response.Write("" & vbCrLf) Response.Write("" & vbCrLf) Else Response.Write("" & vbCrLf) Response.Write("" & vbCrLf) End If Response.Write("" & vbCrLf) Next '現金及び現金同等物期首残高・期末残高(期首・期中のそれぞれの集計先を個別に設定出来ないのでマスター外処理) Response.Write("" & vbCrLf) Response.Write("" & vbCrLf) Response.Write("" & vbCrLf) Response.Write("" & vbCrLf) '最終行の残高 Response.Write("" & vbCrLf) Response.Write("" & vbCrLf) Response.Write("" & vbCrLf) Response.Write("" & vbCrLf) Response.Write("" & vbCrLf) '最終行の残高+変動額 Response.Write("" & vbCrLf) %>
" & RowMeisho(ii) & " " & ConvIntToMoney(RowKingaku(ii), false, ZeroNullFlg) & "    " & ConvIntToMoney(RowKingaku(ii), false, ZeroNullFlg) & " 
X 現金及び現金同等物期首残高  " & ConvIntToMoney(RowZandaka(UBound(RowCD)), false, false) & " 
Y 現金及び現金同等物期末残高  " & ConvIntToMoney(RowZandaka(UBound(RowCD)) + RowKingaku(UBound(RowCD)), false, false) & " 
<% End If %> <% If PrintFlg = 0 Then %>
<% End If %>
<% ' Next If PrintFlg = 0 Then %>
<% End If End Function %>