リビジョン | 66 (tree) |
---|---|
日時 | 2020-10-11 10:53:23 |
作者 | ![]() |
* aoiro 0.7.2
GeneralJournal,GeneralLedger,ProfitAndLoss,BalanceSheet,StatementOfChangesInEquityに仕訳を参照するgetJournalEntriesメソッドを追加しました。
ProfitAndLossに集計結果の科目を参照するgetIncomeSummariesメソッドを追加しました。
BalanceSheetに期首と期末の集計結果の科目を参照するgetOpeningBalancesメソッド、getClosingBalancesメソッドを追加しました。
これらのメソッドは外部アプリ(GUI版)から集計結果を参照するために使用します。
@@ -221,6 +221,18 @@ | ||
221 | 221 | } |
222 | 222 | } |
223 | 223 | |
224 | + public List<JournalEntry> getJournalEntries() { | |
225 | + return journalEntries; | |
226 | + } | |
227 | + | |
228 | + public Map<AccountTitle, Amount> getOpeningBalances() { | |
229 | + return openingBalances; | |
230 | + } | |
231 | + | |
232 | + public Map<AccountTitle, Amount> getClosingBalances() { | |
233 | + return closingBalances; | |
234 | + } | |
235 | + | |
224 | 236 | // PDF出力に使用する資産のリストデータです。 |
225 | 237 | // 貸借対照表を画面に表示するなどPDF出力とは別の用途で使用するのに役立ちます。 |
226 | 238 | public List<Node<Entry<List<AccountTitle>, Amount[]>>> getAssetsList() { |
@@ -64,6 +64,10 @@ | ||
64 | 64 | //writeToを呼び出してPDFを作成する前にprepareを呼び出しておく必要があります。 |
65 | 65 | prepare(); |
66 | 66 | } |
67 | + | |
68 | + public List<JournalEntry> getJournalEntries() { | |
69 | + return entries; | |
70 | + } | |
67 | 71 | |
68 | 72 | protected void prepare() { |
69 | 73 | int pageNumber = 0; |
@@ -78,6 +78,10 @@ | ||
78 | 78 | //writeToを呼び出してPDFを作成する前にprepareを呼び出しておく必要があります。 |
79 | 79 | prepare(); |
80 | 80 | } |
81 | + | |
82 | + public List<JournalEntry> getJournalEntries() { | |
83 | + return entries; | |
84 | + } | |
81 | 85 | |
82 | 86 | protected void prepare() { |
83 | 87 | int pageNumber = 0; |
@@ -96,9 +96,9 @@ | ||
96 | 96 | } |
97 | 97 | } |
98 | 98 | } |
99 | - | |
99 | + | |
100 | 100 | //再帰集計 |
101 | - retrieve(plLayout.getRoot(), journalEntries); | |
101 | + retrieve(plLayout.getRoot()); | |
102 | 102 | |
103 | 103 | //リスト作成 |
104 | 104 | list = createList(plLayout.getRoot()); |
@@ -116,6 +116,14 @@ | ||
116 | 116 | r.close(); |
117 | 117 | } |
118 | 118 | |
119 | + public List<JournalEntry> getJournalEntries() { | |
120 | + return journalEntries; | |
121 | + } | |
122 | + | |
123 | + public Map<AccountTitle, Amount> getIncomeSummaries() { | |
124 | + return incomeSummaries; | |
125 | + } | |
126 | + | |
119 | 127 | // PDF出力に使用するリストデータです。 |
120 | 128 | // 損益計算書を画面に表示するなどPDF出力とは別の用途で使用するのに役立ちます。 |
121 | 129 | public List<Node<Entry<List<AccountTitle>, Amount>>> getList() { |
@@ -128,10 +136,10 @@ | ||
128 | 136 | return monthlyTotals; |
129 | 137 | } |
130 | 138 | |
131 | - private Amount retrieve(Node<Entry<List<AccountTitle>, Amount>> node, List<JournalEntry> journalEntries) { | |
139 | + private Amount retrieve(Node<Entry<List<AccountTitle>, Amount>> node) { | |
132 | 140 | Amount amount = null; |
133 | 141 | for(Node<Entry<List<AccountTitle>, Amount>> child : node.getChildren()) { |
134 | - Amount a = retrieve(child, journalEntries); | |
142 | + Amount a = retrieve(child); | |
135 | 143 | if(a != null) { |
136 | 144 | if(amount == null) { |
137 | 145 | amount = new Amount(a.getNormalBalance(), a.getValue()); |
@@ -51,6 +51,7 @@ | ||
51 | 51 | } |
52 | 52 | |
53 | 53 | private StatementOfChangesInEquityLayout sceLayout; |
54 | + private List<JournalEntry> journalEntries; | |
54 | 55 | |
55 | 56 | private LocalDate openingDate; |
56 | 57 | private LocalDate closingDate; |
@@ -70,6 +71,7 @@ | ||
70 | 71 | |
71 | 72 | public StatementOfChangesInEquity(StatementOfChangesInEquityLayout sceLayout, List<JournalEntry> journalEntries) throws IOException { |
72 | 73 | this.sceLayout = sceLayout; |
74 | + this.journalEntries = journalEntries; | |
73 | 75 | |
74 | 76 | this.openingDate = AccountSettlement.getOpeningDate(journalEntries, false); |
75 | 77 | this.closingDate = AccountSettlement.getClosingDate(journalEntries, false); |
@@ -270,6 +272,10 @@ | ||
270 | 272 | } |
271 | 273 | } |
272 | 274 | |
275 | + public List<JournalEntry> getJournalEntries() { | |
276 | + return journalEntries; | |
277 | + } | |
278 | + | |
273 | 279 | protected List<Integer> getColumnIndexes(AccountTitle accountTitle) { |
274 | 280 | List<Integer> columnIndexes = new ArrayList<>(); |
275 | 281 |