<% Dim RowCount RowCount = 0 Dim PageBreakMode PageBreakMode = 0 Function StatementOfStockholdersEquityJido(EnshuCD, KaisyaCD, SakuseiKaisyaCD, BunsyoSyuruiCD, BunsyoNaiyoCD, AutoFlg, PrintFlg, Param1, Param2, Param3) Dim bExistSyuseiKinyu bExistSyuseiKinyu = 0 Query = "exec SPK伝票集計取得 '" & GB_SystemCD & "','" & EnshuCD & "', '" & KaisyaCD & "', '', -1, -1, 9" Set Content = OpenQuery(Query) If Not(Content.BOF Or Content.EOF) Then bExistSyuseiKinyu = 1 End If Dim HiNikubun, TanaorosiKubun, Kaishibi, Syuryobi, tmp, tmp2 Kaishibi = Param1 Syuryobi = Param2 tmp = Param3 If tmp <> "" Then tmp2 = split(tmp, "-") HiNikubun = tmp2(0) TanaorosiKubun = tmp2(1) End If Dim KanjyoCDShiire, KanjyoCDKurikoshiSyohin Dim KanjyoCDKisyuSyohinTanaoroshidaka, KanjyoCDKimatsuSyohinTanaoroshidaka Dim KanjyoCDKurikoshiSoneki Query = "exec SPM勘定科目取得特別勘定 '" & GB_SystemCD & "','" & EnshuCD & "', ''" Set Content = OpenQuery(Query) Do While Not(Content.BOF OR Content.EOF) If Content.Fields("特別勘定区分") = "DL" Then KanjyoCDShiire = Content.Fields("勘定CD") ElseIf Content.Fields("特別勘定区分") = "DG" Then KanjyoCDKisyuSyohinTanaoroshidaka = Content.Fields("勘定CD") ElseIf Content.Fields("特別勘定区分") = "DH" Then KanjyoCDKimatsuSyohinTanaoroshidaka = Content.Fields("勘定CD") ElseIf Content.Fields("特別勘定区分") = "DJ" Then KanjyoCDKurikoshiSyohin = Content.Fields("勘定CD") ElseIf Content.Fields("特別勘定区分") = "DY" Then KanjyoCDKurikoshiSoneki = Content.Fields("勘定CD") End If Content.MoveNext Loop Dim PageType PageType = "株主資本等変動計算書" Dim Kubun1ZenkimatsuZandaka Dim Kubun1ToukiHendougaku Dim Kubun1ToukimatsuZandaka Kubun1ZenkimatsuZandaka = 0 Kubun1ToukiHendougaku = 0 Kubun1ToukimatsuZandaka = 0 Dim Kubun2ZenkimatsuZandaka Dim Kubun2ToukiHendougaku Dim Kubun2ToukimatsuZandaka Kubun2ZenkimatsuZandaka = 0 Kubun2ToukiHendougaku = 0 Kubun2ToukimatsuZandaka = 0 Dim ZenkimatsuZandakaGoukei Dim ToukiHendougakuGoukei Dim ToukimatsuZandakaGoukei ZenkimatsuZandakaGoukei = 0 ToukiHendougakuGoukei = 0 ToukimatsuZandakaGoukei = 0 Dim RowBreakNum Dim Page If PrintFlg = 1 Then RowBreakNum = 41 Else RowBreakNum = MaxRowBreakNum MaxPage = 1 End If Dim Query Dim Content Dim KaikeiKaishibi, KaikeiSyuryobi Query = "exec SPM演習取得 '" & GB_SystemCD & "','" & EnshuCD & "'" Set Content = OpenQuery(Query) If Not(Content.BOF Or Content.EOF) Then KaikeiKaishibi = Content.Fields("会計開始日") KaikeiSyuryobi = Content.Fields("会計終了日") End If Dim RouteType RouteType = Request("RouteType") '書式を配列化 Dim TBLSyukeiCD() Dim TBLName1() Dim TBLName2() Dim TBLName3() Dim TBLKubun() Dim TBLSaimoku() Dim TBLSumCD() Dim TBLSumPM() Dim TBLDispUL() Dim TBLKingaku() Dim ii Dim jj Dim kk Dim ll ii = 0 Query = "exec SPM株主資本等変動計算書書式一覧 '" & GB_SystemCD & "', '" & EnshuCD & "'" Set Content = OpenQuery(Query) Do While Not(Content.BOF Or Content.EOF) If IsNumeric(Content.Fields("ラインコントロール")) Then For ll = 1 To Int(Content.Fields("ラインコントロール")) ii = ii + 1 ReDim PreServe TBLSyukeiCD(ii) ReDim PreServe TBLName1(ii) ReDim PreServe TBLName2(ii) ReDim PreServe TBLName3(ii) ReDim PreServe TBLKubun(ii) ReDim PreServe TBLSaimoku(ii) ReDim PreServe TBLSumCD(ii) ReDim PreServe TBLSumPM(ii) ReDim PreServe TBLDispUL(ii) ReDim PreServe TBLKingaku(ii) Next End If ii = ii + 1 ReDim PreServe TBLSyukeiCD(ii) ReDim PreServe TBLName1(ii) ReDim PreServe TBLName2(ii) ReDim PreServe TBLName3(ii) ReDim PreServe TBLKubun(ii) ReDim PreServe TBLSaimoku(ii) ReDim PreServe TBLSumCD(ii) ReDim PreServe TBLSumPM(ii) ReDim PreServe TBLDispUL(ii) ReDim PreServe TBLKingaku(ii) TBLSyukeiCD(ii) = "" & Content.Fields("集計CD") TBLName1(ii) = "" & Content.Fields("集計分類1") TBLName2(ii) = "" & Content.Fields("集計分類2") TBLName3(ii) = "" & Content.Fields("集計分類3") TBLKubun(ii) = "" & Content.Fields("集計区分") TBLSaimoku(ii) = "" & Content.Fields("変動額細目") TBLSumCD(ii) = "" & Content.Fields("集計先") TBLSumPM(ii) = "" & Content.Fields("加減区分") Content.MoveNext Loop Dim HokokusyoLines HokokusyoLines = ii '伝票集計を配列化 ii = 0 Query = "exec SPK自動転記帳簿_株主資本等変動計算書照会 '" & GB_SystemCD & "', '" & EnshuCD & "', '" & KaisyaCD & "', '" & Kaishibi & "', '" & Syuryobi & "'" Set Content = OpenQuery(Query) Do While Not(Content.BOF Or Content.EOF) ii = ii + 1 ReDim PreServe WK_Zandaka_KanjyoCD(ii) ReDim PreServe WK_Zandaka_KanjyoName(ii) ReDim PreServe WK_Zandaka_KariKingaku(ii) ReDim PreServe WK_Zandaka_KashiKingaku(ii) ReDim PreServe WK_Zandaka_KanjyoKubun(ii) ReDim PreServe WK_Zandaka_TaisyakuKubun(ii) ReDim PreServe WK_Zandaka_SyukeiCD(ii) ReDim PreServe WK_Zandaka_Kishu(ii) WK_Zandaka_KanjyoCD(ii) = "" & Content.Fields("勘定CD") WK_Zandaka_KanjyoName(ii) = "" & Content.Fields("勘定名称") WK_Zandaka_KanjyoKubun(ii) = "" & Content.Fields("勘定区分") WK_Zandaka_TaisyakuKubun(ii) = "" & Content.Fields("貸借区分") WK_Zandaka_SyukeiCD(ii) = "" & Content.Fields("株主資本等変動計算書集計CD") WK_Zandaka_KariKingaku(ii) = Content.Fields("借方金額") WK_Zandaka_KashiKingaku(ii) = Content.Fields("貸方金額") WK_Zandaka_Kishu(ii) = "" & Content.Fields("伝票処理区分") '繰越損益は除外 If WK_Zandaka_KanjyoCD(ii) = KanjyoCDKurikoshiSoneki Then WK_Zandaka_SyukeiCD(ii) = "" End If Content.MoveNext Loop Dim WKCount WKCount = ii 'チェック用 ' For jj = 1 To UBound(WK_Zandaka_KanjyoCD) ' Response.Write(WK_Zandaka_KanjyoCD(jj) & "-") ' Response.Write(WK_Zandaka_KanjyoName(jj) & "-") ' Response.Write(WK_Zandaka_KariKingaku(jj) & "-") ' Response.Write(WK_Zandaka_KashiKingaku(jj) & "-") ' Response.Write(WK_Zandaka_TaisyakuKubun(jj) & "-") ' Response.Write(WK_Zandaka_SyukeiCD(jj) & "-") ' Response.Write("
") ' Next ' Exit Function '棚卸の調整(廃止) If 0=1 Then If (bExistSyuseiKinyu = 0 And TanaorosiKubun = "1") Or (bExistSyuseiKinyu = 1 And HiNikubun <> "1") Then '在庫数を取得する Dim KimatsuSyohinTanaoroshidaka, KisyuSyohinTanaoroshidaka KisyuSyohinTanaoroshidaka = KisyuTanaoroshiKingaku(Syuryobi) KimatsuSyohinTanaoroshidaka = KimatsuTanaoroshiKingaku(Syuryobi) '繰越商品を削除 For jj = 1 To UBound(WK_Zandaka_KanjyoCD) '繰越商品が見付かったら If WK_Zandaka_KanjyoCD(jj) = KanjyoCDKurikoshiSyohin Then '配列を前方にシフト For ii = jj To UBound(WK_Zandaka_KanjyoCD) - 1 WK_Zandaka_KanjyoCD(ii) = WK_Zandaka_KanjyoCD(ii + 1) WK_Zandaka_KanjyoName(ii) = WK_Zandaka_KanjyoName(ii + 1) WK_Zandaka_KariKingaku(ii) = WK_Zandaka_KariKingaku(ii + 1) WK_Zandaka_KashiKingaku(ii) = WK_Zandaka_KashiKingaku(ii + 1) WK_Zandaka_TaisyakuKubun(ii) = WK_Zandaka_TaisyakuKubun(ii + 1) WK_Zandaka_SyukeiCD(ii) = WK_Zandaka_SyukeiCD(ii + 1) Next '最終配列を空にする WK_Zandaka_KanjyoCD(ii) = "" WK_Zandaka_KanjyoName(ii) = "" WK_Zandaka_KariKingaku(ii) = null WK_Zandaka_KashiKingaku(ii) = null WK_Zandaka_TaisyakuKubun(ii) = "" WK_Zandaka_SyukeiCD(ii) = "" Exit For End If Next '期首商品棚卸高 ReplaceKanjyo KanjyoCDKisyuSyohinTanaoroshidaka, KisyuSyohinTanaoroshidaka, 0 Query = "exec SPK伝票集計取得 '" & GB_SystemCD & "','" & EnshuCD & "', '" & KaisyaCD & "', '" & KanjyoCDKisyuSyohinTanaoroshidaka & "', 0, 1, 9" Set Content = OpenQuery(Query) If Not(Content.BOF Or Content.EOF) Then ReplaceKanjyo KanjyoCDKisyuSyohinTanaoroshidaka, Content.Fields("借方金額"), Content.Fields("貸方金額") End If '期末商品棚卸高 ReplaceKanjyo KanjyoCDKimatsuSyohinTanaoroshidaka, 0, KimatsuSyohinTanaoroshidaka Query = "exec SPK伝票集計取得 '" & GB_SystemCD & "','" & EnshuCD & "', '" & KaisyaCD & "', '" & KanjyoCDKimatsuSyohinTanaoroshidaka & "', 0, 1, 9" Set Content = OpenQuery(Query) If Not(Content.BOF Or Content.EOF) Then ReplaceKanjyo KanjyoCDKimatsuSyohinTanaoroshidaka, Content.Fields("借方金額"), Content.Fields("貸方金額") End If '精算表修正記入 If bExistSyuseiKinyu = 1 Then ReplaceKanjyo KanjyoCDShiire, KityuShiireKingaku(Syuryobi), 0 End If End If End If 'チェック用 ' For jj = 1 To UBound(WK_Zandaka_KanjyoCD) ' Response.Write(WK_Zandaka_KanjyoCD(jj) & ":") ' Response.Write(WK_Zandaka_KanjyoName(jj) & ":") ' Response.Write(WK_Zandaka_KariKingaku(jj) & ":") ' Response.Write(WK_Zandaka_KashiKingaku(jj) & ":") ' Response.Write(WK_Zandaka_TaisyakuKubun(jj) & ":") ' Response.Write(WK_Zandaka_SyukeiCD(jj) & ":") ' Response.Write("
") ' Next ' Exit Function '伝票集計配列から書式配列に振り分ける(「貸−借」で固定) Dim TmpKingaku Dim KarikataKingaku Dim KashikataKingaku For ii = 1 To UBound(WK_Zandaka_KanjyoCD) If WK_Zandaka_KashiKingaku(ii) <> 0 Then '伝票集計金額を集計CDに該当する行に加算する For jj = 1 To HokokusyoLines If TBLSyukeiCD(jj) = WK_Zandaka_SyukeiCD(ii) And WK_Zandaka_SyukeiCD(ii) <> "" Then '空白行(集計CD="")と集計CD=""が合致してしまうので集計CD=""は除外 '伝票集計区分が前期繰越且つ加算行が前期末残高でない場合は直前の前期末残高行に加算する If WK_Zandaka_Kishu(ii) = "0" And TBLKubun(jj) <> "前期末残高" Then For kk = jj - 1 To 1 Step -1 If TBLKubun(kk) = "前期末残高" Then TBLKingaku(kk) = TBLKingaku(kk) + WK_Zandaka_KashiKingaku(ii) Exit For End If Next '通常処理 Else TBLKingaku(jj) = TBLKingaku(jj) + WK_Zandaka_KashiKingaku(ii) End If End If Next End If If WK_Zandaka_KariKingaku(ii) <> 0 Then '伝票集計金額を集計CDに該当する行に加算する For jj = 1 To HokokusyoLines If TBLSyukeiCD(jj) = WK_Zandaka_SyukeiCD(ii) And WK_Zandaka_SyukeiCD(ii) <> "" Then '空白行(集計CD="")と集計CD=""が合致してしまうので集計CD=""は除外 '伝票集計区分が前期繰越且つ加算行が前期末残高でない場合は直前の前期末残高行に加算する If WK_Zandaka_Kishu(ii) = "0" And TBLKubun(jj) <> "前期末残高" Then For kk = jj - 1 To 1 Step -1 If TBLKubun(kk) = "前期末残高" Then TBLKingaku(kk) = TBLKingaku(kk) - WK_Zandaka_KariKingaku(ii) Exit For End If Next '通常処理 Else TBLKingaku(jj) = TBLKingaku(jj) - WK_Zandaka_KariKingaku(ii) End If End If Next End If Next '全ての集計先行に加減算する(マスタ内での相関集計は行わないので廃止) ' For jj = 1 To HokokusyoLines ' If TBLKingaku(jj) <> "" Then ' For kk = jj + 1 To HokokusyoLines ' If TBLSyukeiCD(kk) = TBLSumCD(jj) Then ' If TBLSumPM(jj) <> "-" Then ' TBLKingaku(kk) = TBLKingaku(kk) + TBLKingaku(jj) ' Else ' TBLKingaku(kk) = TBLKingaku(kk) - TBLKingaku(jj) ' End If ' End If ' Next ' End If ' Next 'チェック用 ' For jj = 1 To HokokusyoLines ' Response.Write(TBLSyukeiCD(jj) & "-") ' Response.Write(TBLName1(jj) & "-") ' Response.Write(TBLName2(jj) & "-") ' Response.Write(TBLName3(jj) & "-") ' Response.Write(TBLKubun(jj) & "-") ' Response.Write(TBLSaimoku(jj) & "-") ' Response.Write(TBLSumCD(jj) & "-") ' Response.Write(TBLSumPM(jj) & "-") ' Response.Write(TBLDispUL(jj) & "-") ' Response.Write(TBLKingaku(jj) & "-") ' Response.Write("
") ' Next ' Exit Function If PrintFlg = 0 Then %>
<% End If jj = 0 For Page = 1 To MaxPage If Page <> 1 Then Response.Write(PageBreakBefore) End If %>
<% If PrintFlg = 1 Then Response.Write(PrintHeader1(AutoFlg)) End if %> <% If PrintFlg <> 1 Then %> <% End If %> <% If jj > HokokusyoLines Then %> <% End If %>
<% = SetStringInsertSpaceH(PageType) %> <% If AutoFlg <> -1 And PrintFlg = 1 Then %><% = Page %>ページ<% End If %>
<% Response.Write("自 ") Response.Write(SetDate(Kaishibi, 2)) Response.Write("  至 ") Response.Write(SetDate(Syuryobi, 2)) %>
<% = ConvKaisyaMeisyo(KaisyaCD) %>
<% If PrintFlg <> 1 Then %>
<% End If %> <% ' Dim Query ' Dim Content Dim PreShukeiMeisho1 Dim PreShukeiMeisho2 Dim PreShukeiMeisho3 PreShukeiMeisho1 = "systemfuture_erutufmetsys_systemfuture_erutufmetsys_systemfuture" PreShukeiMeisho2 = "systemfuture_erutufmetsys_systemfuture_erutufmetsys_systemfuture" PreShukeiMeisho3 = "systemfuture_erutufmetsys_systemfuture_erutufmetsys_systemfuture" Dim ShukeiMeisho1 Dim ShukeiMeisho2 Dim ShukeiMeisho3 Dim ShukeiKubun Dim ShukeiKubunMeisho Dim ToukiHendougakuSaimoku Dim PlusMinus Dim PlusMinusHyouji Dim Kingaku Dim HantenKingaku Dim ToukimatsuZandaka ToukimatsuZandaka = 0 Dim SentouFlg SentouFlg = 1 Dim ToukimatsuZandakaHyouji ToukimatsuZandakaHyouji = 0 Dim Kubun1ZandakaHyouji Kubun1ZandakaHyouji = 0 Dim PrePreShukeiMeisho1 PrePreShukeiMeisho1 = "" Dim Kubun2ZandakaHyoujiUmu Kubun2ZandakaHyoujiUmu = 0 Dim Kubun2ZandakaHyouji Kubun2ZandakaHyouji = 0 Dim PrePreShukeiMeisho2 PrePreShukeiMeisho2 = "" For ii = jj + 1 To HokokusyoLines ShukeiMeisho2 = "" & TBLName2(ii) If ShukeiMeisho2 = PreShukeiMeisho2 Or ShukeiMeisho2 = "" Or ShukeiMeisho2 = " " Then ShukeiMeisho2 = "" Else PreShukeiMeisho2 = ShukeiMeisho2 '先頭行以外で集計分類2が変わったら If ToukimatsuZandakaHyouji = 1 Then Kubun2ZandakaHyouji = 1 '分類2集計フラグを1に End If '先頭行以外で集計分類2が変わったら当期末残高行を表示 If ToukimatsuZandakaHyouji = 1 Then Call ResponseToukimatsuZandaka(ToukimatsuZandaka) ToukimatsuZandaka = 0 'リセット ToukimatsuZandakaHyouji = 0 End If End If ShukeiMeisho3 = "" & TBLName3(ii) If ShukeiMeisho3 = PreShukeiMeisho3 Or ShukeiMeisho3 = "" Or ShukeiMeisho3 = " " Then ShukeiMeisho3 = "" Else PreShukeiMeisho3 = ShukeiMeisho3 '先頭行以外で集計分類3が変わったら当期末残高行を表示 If ToukimatsuZandakaHyouji = 1 Then Call ResponseToukimatsuZandaka(ToukimatsuZandaka) ToukimatsuZandaka = 0 'リセット ToukimatsuZandakaHyouji = 0 End If End If ShukeiMeisho1 = "" & TBLName1(ii) If ShukeiMeisho1 = PreShukeiMeisho1 Or ShukeiMeisho1 = "" Or ShukeiMeisho1 = " " Then ShukeiMeisho1 = "" Else PreShukeiMeisho1 = ShukeiMeisho1 '先頭行以外で集計分類1が変わったら If SentouFlg = 0 Then '当期末残高行を表示 If ToukimatsuZandakaHyouji = 1 Then Call ResponseToukimatsuZandaka(ToukimatsuZandaka) ToukimatsuZandaka = 0 'リセット ToukimatsuZandakaHyouji = 0 End If '分類1の合計を表示 Call ResponseKubunZandaka(PrePreShukeiMeisho1,Kubun1ZenkimatsuZandaka,Kubun1ToukiHendougaku,Kubun1ToukimatsuZandaka) ' Kubun1ZandakaHyoujiUmu = 0 Kubun1ZandakaHyouji = 0 Kubun1ZenkimatsuZandaka = 0 Kubun1ToukiHendougaku = 0 Kubun1ToukimatsuZandaka = 0 '改ページ If RowCount >= RowBreakNum Then RowCount = 0 jj = ii - 1 Exit For End If End If '集計分類1が変わったら見出し行を表示 Response.Write("" & vbCrLf) Response.Write("" & vbCrLf) Response.Write("" & vbCrLf) Response.Write("" & vbCrLf) Response.Write("") RowCount = RowCount + 1 End If '分類2の合計を表示 If Kubun2ZandakaHyouji = 1 And Kubun2ZandakaHyoujiUmu = 1 Then Call ResponseKubunZandaka(PrePreShukeiMeisho2,Kubun2ZenkimatsuZandaka,Kubun2ToukiHendougaku,Kubun2ToukimatsuZandaka) Kubun2ZandakaHyoujiUmu = 0 ' Kubun2ZandakaHyouji = 0 ' Kubun2ZenkimatsuZandaka = 0 ' Kubun2ToukiHendougaku = 0 ' Kubun2ToukimatsuZandaka = 0 '改ページ If RowCount >= RowBreakNum Then RowCount = 0 jj = ii - 1 Exit For End If End If If Kubun2ZandakaHyouji = 1 Then ' Kubun2ZandakaHyoujiUmu = 0 Kubun2ZandakaHyouji = 0 Kubun2ZenkimatsuZandaka = 0 Kubun2ToukiHendougaku = 0 Kubun2ToukimatsuZandaka = 0 End If ShukeiKubun = "" & TBLKubun(ii) ToukiHendougakuSaimoku = "" & TBLSaimoku(ii) PlusMinus = "" & TBLSumPM(ii) If PlusMinus = "+" Or PlusMinus = "" Or PlusMinus = " " Then PlusMinus = "+" End If If PlusMinus = "+" Then PlusMinusHyouji = "" ElseIf PlusMinus = "-" Then PlusMinusHyouji = "△" End If Kingaku = TBLKingaku(ii) If ShukeiKubun = "前期末残高" And PlusMinus = "+" Then Kubun1ZenkimatsuZandaka = Kubun1ZenkimatsuZandaka + Kingaku Kubun2ZenkimatsuZandaka = Kubun2ZenkimatsuZandaka + Kingaku Kubun1ToukimatsuZandaka = Kubun1ToukimatsuZandaka + Kingaku Kubun2ToukimatsuZandaka = Kubun2ToukimatsuZandaka + Kingaku ZenkimatsuZandakaGoukei = ZenkimatsuZandakaGoukei + Kingaku ToukimatsuZandaka = ToukimatsuZandaka + Kingaku ToukimatsuZandakaGoukei = ToukimatsuZandakaGoukei + Kingaku ElseIf ShukeiKubun = "前期末残高" And PlusMinus = "-" Then Kubun1ZenkimatsuZandaka = Kubun1ZenkimatsuZandaka - Kingaku Kubun2ZenkimatsuZandaka = Kubun2ZenkimatsuZandaka - Kingaku Kubun1ToukimatsuZandaka = Kubun1ToukimatsuZandaka - Kingaku Kubun2ToukimatsuZandaka = Kubun2ToukimatsuZandaka - Kingaku ZenkimatsuZandakaGoukei = ZenkimatsuZandakaGoukei - Kingaku ToukimatsuZandaka = ToukimatsuZandaka - Kingaku ToukimatsuZandakaGoukei = ToukimatsuZandakaGoukei - Kingaku ElseIf ShukeiKubun = "当期変動額" And PlusMinus = "+" Then Kubun1ToukiHendougaku = Kubun1ToukiHendougaku + Kingaku Kubun2ToukiHendougaku = Kubun2ToukiHendougaku + Kingaku Kubun1ToukimatsuZandaka = Kubun1ToukimatsuZandaka + Kingaku Kubun2ToukimatsuZandaka = Kubun2ToukimatsuZandaka + Kingaku ToukiHendougakuGoukei = ToukiHendougakuGoukei + Kingaku ToukimatsuZandaka = ToukimatsuZandaka + Kingaku ToukimatsuZandakaGoukei = ToukimatsuZandakaGoukei + Kingaku ElseIf ShukeiKubun = "当期変動額" And PlusMinus = "-" Then Kubun1ToukiHendougaku = Kubun1ToukiHendougaku - Kingaku Kubun2ToukiHendougaku = Kubun2ToukiHendougaku - Kingaku Kubun1ToukimatsuZandaka = Kubun1ToukimatsuZandaka - Kingaku Kubun2ToukimatsuZandaka = Kubun2ToukimatsuZandaka - Kingaku ToukiHendougakuGoukei = ToukiHendougakuGoukei - Kingaku ToukimatsuZandaka = ToukimatsuZandaka - Kingaku ToukimatsuZandakaGoukei = ToukimatsuZandakaGoukei - Kingaku End If Response.Write("" & vbCrLf) Response.Write("" & vbCrLf) Response.Write("" & vbCrLf) Response.Write("" & vbCrLf) Response.Write("" & vbCrLf) Response.Write("" & vbCrLf) Response.Write("" & vbCrLf) Response.Write("") RowCount = RowCount + 1 ' ii = ii + 1 ToukimatsuZandakaHyouji = 1 '当期末残高表示フラグを立てる SentouFlg = 0 '先頭フラグを降ろす If ShukeiMeisho1 <> "" Then PrePreShukeiMeisho1 = ShukeiMeisho1 End If If ShukeiMeisho2 <> "" Then PrePreShukeiMeisho2 = ShukeiMeisho2 End If If ShukeiMeisho3 <> "" Then Kubun2ZandakaHyoujiUmu = 1 End If jj = ii Next '最後の当期末残高を表示 If jj = HokokusyoLines Then ResponseToukimatsuZandaka(ToukimatsuZandaka) jj = jj + 1 End If %>
【" & ShukeiMeisho1 & "】   " & vbCrLf) Response.Write("
 " & ShukeiMeisho2 & "" & ShukeiMeisho3 & "" & ShukeiKubunMeisho & "" & ToukiHendougakuSaimoku & "" & PlusMinusHyouji & ConvIntToMoney(Kingaku, false, true) & "
<% If PrintFlg <> 1 Then %>
<% End If %>
<% '純資産合計を表示 Call ResponseKubunZandaka("純資産",ZenkimatsuZandakaGoukei,ToukiHendougakuGoukei,ToukimatsuZandakaGoukei) %>
<% If PrintFlg = 1 Then Response.Write(PrintFooter()) End If %>
<% If jj > HokokusyoLines Then Exit For End If Next If PrintFlg = 0 Then %>
<% End if End Function Function ResponseToukimatsuZandaka(ToukimatsuZandaka) Response.Write("" & vbCrLf) Response.Write("  " & vbCrLf) Response.Write("  " & vbCrLf) Response.Write("  " & vbCrLf) Response.Write(" 当期末残高" & vbCrLf) Response.Write("  " & vbCrLf) Response.Write(" " & ConvIntToMoneySankaku(ToukimatsuZandaka, false, true) & "" & vbCrLf) Response.Write("") RowCount = RowCount + 1 End Function Function ResponseKubunZandaka(KubunShukeiMeisho,ZenkimatsuZandaka,ToukiHendougaku,ToukimatsuZandaka) Response.Write("" & vbCrLf) Response.Write("  " & vbCrLf) Response.Write(" (" & KubunShukeiMeisho & "合計)" & vbCrLf) Response.Write("  " & vbCrLf) Response.Write(" 前期末残高" & vbCrLf) Response.Write("  " & vbCrLf) Response.Write(" " & ConvIntToMoneySankaku(ZenkimatsuZandaka, false, true) & "" & vbCrLf) Response.Write("") Response.Write("" & vbCrLf) Response.Write("  " & vbCrLf) Response.Write("  " & vbCrLf) Response.Write("  " & vbCrLf) Response.Write(" 当期変動額" & vbCrLf) Response.Write("  " & vbCrLf) Response.Write(" " & ConvIntToMoneySankaku(ToukiHendougaku, false, true) & "" & vbCrLf) Response.Write("") Response.Write("" & vbCrLf) Response.Write("  " & vbCrLf) Response.Write("  " & vbCrLf) Response.Write("  " & vbCrLf) Response.Write(" 当期末残高" & vbCrLf) Response.Write("  " & vbCrLf) Response.Write(" " & ConvIntToMoneySankaku(ToukimatsuZandaka, false, true) & "" & vbCrLf) Response.Write("") RowCount = RowCount + 3 End Function Function ReplaceKanjyo(F_KanjyoCD, F_KarikataKingaku, F_KashikataKingaku) If IsNull(F_KarikataKingaku) Then F_KarikataKingaku = 0 End If If IsNull(F_KashikataKingaku) Then F_KashikataKingaku = 0 End If Dim InsertNo, KurikosiFLG Dim ii, jj Dim Query, Content InsertNo = -1 KurikosiFLG = 0 If F_KarikataKingaku <> 0 OR F_KashikataKingaku <> 0 Then For jj = 1 To UBound(WK_Zandaka_KanjyoCD) If WK_Zandaka_KanjyoCD(jj) = "" Then Exit For End If If WK_Zandaka_KanjyoCD(jj) > F_KanjyoCD Then If KurikosiFLG = 0 Then For ii = UBound(WK_Zandaka_KanjyoCD) - 1 To jj Step -1 WK_Zandaka_KanjyoCD(ii + 1) = WK_Zandaka_KanjyoCD(ii) WK_Zandaka_KanjyoName(ii + 1) = WK_Zandaka_KanjyoName(ii) WK_Zandaka_KariKingaku(ii + 1) = WK_Zandaka_KariKingaku(ii) WK_Zandaka_KashiKingaku(ii + 1) = WK_Zandaka_KashiKingaku(ii) WK_Zandaka_TaisyakuKubun(ii + 1) = WK_Zandaka_TaisyakuKubun(ii) WK_Zandaka_SyukeiCD(ii + 1) = WK_Zandaka_SyukeiCD(ii) Next InsertNo = jj KurikosiFLG = 1 ShowCount = ShowCount + 1 Exit For End If ElseIf WK_Zandaka_KanjyoCD(jj) = F_KanjyoCD Then 'すでに残高に「期末商品棚卸高」がある場合 KurikosiFLG = 1 InsertNo = jj End If Next If KurikosiFLG = 0 Then InsertNo = jj ShowCount = ShowCount + 1 End If End If If InsertNo <> -1 Then Query = "exec SPM勘定科目取得 '" & GB_SystemCD & "','" & EnshuCD & "', '" & F_KanjyoCD & "'" Set Content = OpenQuery(Query) If Not(Content.BOF Or Content.EOF) Then WK_Zandaka_TaisyakuKubun(InsertNo) = Content.Fields("貸借区分") WK_Zandaka_KanjyoName(InsertNo) = Content.Fields("勘定名称") WK_Zandaka_SyukeiCD(InsertNo) = Content.Fields("株主資本等変動計算書集計CD") End If WK_Zandaka_KanjyoCD(InsertNo) = F_KanjyoCD If WK_Zandaka_TaisyakuKubun(InsertNo) = "C" Then WK_Zandaka_KariKingaku(InsertNo) = 0 WK_Zandaka_KashiKingaku(InsertNo) = F_KashikataKingaku - F_KarikataKingaku Else WK_Zandaka_KariKingaku(InsertNo) = F_KarikataKingaku - F_KashikataKingaku WK_Zandaka_KashiKingaku(InsertNo) = 0 End If End If End Function %>