// 事業活動計算書の印刷用にRowのリストを作成して返す public List <JigyouSyuushiRow> GetRowsForJigyouKatsudouKeisansyoReport() { var result = new List <JigyouSyuushiRow>(); var dummyRow = new JigyouSyuushiRow(-1, -1); dummyRow.PrintGroupKubunId = -1; DaikubunRows.Add(dummyRow); int beforeKubunId = 0; foreach (var row in DaikubunRows) { row.PrintGroupKubunId = row.Id == -1 ? -1 : db.MTKamokuKubun.GetParentOf(row.Id).GetId(); if (beforeKubunId != 0 && beforeKubunId != row.PrintGroupKubunId) { var footerRows = new List <JigyouSyuushiRow>(); switch (beforeKubunId) { case (int)models.constants.MTKamokuKubun.ServiceKatsudouZougenSyuueki: footerRows.Add(SummaryRows[(int)SummaryItem.ServiceKatsudouSyuunyuu]); AddDummyRow(footerRows, beforeKubunId); AddDummyRow(footerRows, beforeKubunId); break; case (int)models.constants.MTKamokuKubun.ServiceKatsudouZougenHiyou: footerRows.Add(SummaryRows[(int)SummaryItem.ServiceKatsudouShisyutsu]); footerRows.Add(SummaryRows[(int)SummaryItem.ServiceKatsudouSagaku]); AddDummyRow(footerRows, beforeKubunId); break; case (int)models.constants.MTKamokuKubun.ServiceKatsudouGaiZougenSyuueki: footerRows.Add(SummaryRows[(int)SummaryItem.ServiceKatsudouGaiSyuunyuu]); AddDummyRow(footerRows, beforeKubunId); AddDummyRow(footerRows, beforeKubunId); break; case (int)models.constants.MTKamokuKubun.ServiceKatsudouGaiZougenHiyou: footerRows.Add(SummaryRows[(int)SummaryItem.ServiceKatsudouGaiShisyutsu]); footerRows.Add(SummaryRows[(int)SummaryItem.ServiceKatsudouGaiSagaku]); footerRows.Add(SummaryRows[(int)SummaryItem.KeijouZougenSagaku]); AddDummyRow(footerRows, beforeKubunId); break; case (int)models.constants.MTKamokuKubun.TokubetsuZougenSyuueki: footerRows.Add(SummaryRows[(int)SummaryItem.TokubetsuSyuunyuu]); AddDummyRow(footerRows, beforeKubunId); AddDummyRow(footerRows, beforeKubunId); break; case (int)models.constants.MTKamokuKubun.TokubetsuZougenHiyou: footerRows.Add(SummaryRows[(int)SummaryItem.TokubetsuShisyutsu]); footerRows.Add(SummaryRows[(int)SummaryItem.TokubetsuSagaku]); AddDummyRow(footerRows, beforeKubunId); break; } foreach (var footer in footerRows) { footer.PrintGroupKubunId = beforeKubunId; footer.IsSummaryRow = true; result.Add(footer); } if (beforeKubunId == (int)models.constants.MTKamokuKubun.TokubetsuZougenHiyou) { break; } } if (row != dummyRow) { if (OmitZeroRow == false || row.CurrentYearSum != 0 || row.LastYearSum != 0) { result.Add(row); AddChildRowsTo(result, row.Id, row.PrintGroupKubunId, (int)models.constants.MTKamokuKubunHierarchy.ChuuKubun); } } beforeKubunId = row.PrintGroupKubunId; } DaikubunRows.Remove(dummyRow); return(result); }
// 資金収支計算書の印刷用にRowのリストを作成して返す public List <ShikinSyuushiRow> GetRowsForShikinSyuushiKeisansyoReport() { var result = new List <ShikinSyuushiRow>(); var dummyRow = new ShikinSyuushiRow(-1, -1); dummyRow.PrintGroupKubunId = -1; DaikubunRows.Add(dummyRow); int beforeKubunId = 0; foreach (var row in DaikubunRows) { row.PrintGroupKubunId = row.Id == -1 ? -1 : db.MTKamokuKubun.GetParentOf(row.Id).GetId(); if (beforeKubunId != 0 && beforeKubunId != row.PrintGroupKubunId) { var footerRows = new List <ShikinSyuushiRow>(); switch (beforeKubunId) { case (int)models.constants.MTKamokuKubun.JigyouSyuunyuu: footerRows.Add(SummaryRows[(int)SummaryItem.JigyouSyuunyuu]); AddDummyRowTo(footerRows, beforeKubunId); break; case (int)models.constants.MTKamokuKubun.JigyouShisyutsu: footerRows.Add(SummaryRows[(int)SummaryItem.JigyouShisyutsu]); footerRows.Add(SummaryRows[(int)SummaryItem.JigyouSyuushi]); break; case (int)models.constants.MTKamokuKubun.ShisetsuSyuunyuu: footerRows.Add(SummaryRows[(int)SummaryItem.ShisetsuSyuunyuu]); AddDummyRowTo(footerRows, beforeKubunId); break; case (int)models.constants.MTKamokuKubun.ShisetsuShisyutsu: footerRows.Add(SummaryRows[(int)SummaryItem.ShisetsuShisyutsu]); footerRows.Add(SummaryRows[(int)SummaryItem.ShisetsuSyuushi]); break; case (int)models.constants.MTKamokuKubun.SonotaSyuunyuu: footerRows.Add(SummaryRows[(int)SummaryItem.SonotaSyuunyuu]); AddDummyRowTo(footerRows, beforeKubunId); break; case (int)models.constants.MTKamokuKubun.SonotaShisyutsu: footerRows.Add(SummaryRows[(int)SummaryItem.SonotaShisyutsu]); footerRows.Add(SummaryRows[(int)SummaryItem.SonotaSyuushi]); break; } AddDummyRowTo(footerRows, beforeKubunId); foreach (var footer in footerRows) { footer.PrintGroupKubunId = beforeKubunId; footer.IsSummaryRow = true; result.Add(footer); } } if (row != dummyRow) { if (OmitZeroRow == false || row.Yosan != 0 || row.Taisyaku != 0) { result.Add(row); AddChildRowsTo(result, row.Id, row.PrintGroupKubunId, (int)models.constants.MTKamokuKubunHierarchy.ChuuKubun); } } beforeKubunId = row.PrintGroupKubunId; } DaikubunRows.Remove(dummyRow); return(result); }