• R/O
  • SSH
  • HTTPS

aoiro: Commit


Commit MetaInfo

Révision55 (tree)
l'heure2020-09-14 23:50:30
Auteurhirukawa_ryo

Message de Log

* aoiro 0.7.1
依存ライブラリをアップデートしました。

pdf-brewer 0.4.3 → 0.4.4
pdfbox/fontbox 2.0.20 → 2.0.21
jna 5.5.0 → 5.6.0
yamlbeans 1.14 → 1.15

pdf-brewerのアップデートによりフォントのロード処理が改善されます。これでOutOfMemoryErrorが解消するといいのだけど…。
総勘定元帳で元入金・控除前の所得金額の相手勘定科目「残高」が「諸口」と表示されるバグを修正しました。

Change Summary

Modification

--- aoiro/trunk/src/main/java/net/osdn/aoiro/cui/Main.java (revision 54)
+++ aoiro/trunk/src/main/java/net/osdn/aoiro/cui/Main.java (revision 55)
@@ -4,6 +4,7 @@
44 import java.nio.file.Files;
55 import java.nio.file.Path;
66 import java.nio.file.Paths;
7+import java.util.HashSet;
78 import java.util.List;
89 import java.util.Set;
910
@@ -24,11 +25,14 @@
2425 import net.osdn.aoiro.report.layout.BalanceSheetLayout;
2526 import net.osdn.aoiro.report.layout.ProfitAndLossLayout;
2627 import net.osdn.aoiro.report.layout.StatementOfChangesInEquityLayout;
28+import net.osdn.pdf_brewer.FontLoader;
2729 import net.osdn.util.io.AutoDetectReader;
2830
2931 import static net.osdn.aoiro.ErrorMessage.error;
3032
3133 public class Main {
34+
35+ public static FontLoader fontLoader;
3236
3337 public static void main(String[] args) {
3438
@@ -149,6 +153,12 @@
149153 // 総勘定元帳
150154 GeneralLedger generalLedger = new GeneralLedger(accountTitles, journalEntries, isSoloProprietorship, showMonthlyTotal);
151155
156+ Set<String> fontFileNames = new HashSet<String>();
157+ fontFileNames.addAll(FontLoader.FILENAMES_YUGOTHIC);
158+ fontFileNames.addAll(FontLoader.FILENAMES_YUMINCHO);
159+ fontLoader = new FontLoader(FontLoader.getDefaultFontDir(), fontFileNames, null);
160+
161+
152162 // 仕訳帳をファイルに出力します。
153163 // この処理は総勘定元帳(GeneralLedger)を作成してから呼び出す必要があります。GeneralLedgerによって仕訳帳の「元丁」が設定されるからです。
154164 generalJournal.writeTo(outputDir.resolve("仕訳帳.pdf"));
--- aoiro/trunk/src/main/java/net/osdn/aoiro/report/BalanceSheet.java (revision 54)
+++ aoiro/trunk/src/main/java/net/osdn/aoiro/report/BalanceSheet.java (revision 55)
@@ -20,6 +20,7 @@
2020
2121 import net.osdn.aoiro.AccountSettlement;
2222 import net.osdn.aoiro.Util;
23+import net.osdn.aoiro.cui.Main;
2324 import net.osdn.aoiro.model.AccountTitle;
2425 import net.osdn.aoiro.model.AccountType;
2526 import net.osdn.aoiro.model.Amount;
@@ -689,12 +690,13 @@
689690 public void writeTo(Path path) throws IOException {
690691 prepare();
691692
692- PdfBrewer brewer = new PdfBrewer();
693+ PdfBrewer brewer = new PdfBrewer(Main.fontLoader);
693694 brewer.setCreator(Util.getPdfCreator());
694695 BrewerData pb = new BrewerData(printData, brewer.getFontLoader());
695696 brewer.setTitle("貸借対照表");
696697 brewer.process(pb);
697698 brewer.save(path);
699+ brewer.close();
698700 }
699701
700702 /** 次期開始仕訳を作成します。
--- aoiro/trunk/src/main/java/net/osdn/aoiro/report/GeneralJournal.java (revision 54)
+++ aoiro/trunk/src/main/java/net/osdn/aoiro/report/GeneralJournal.java (revision 55)
@@ -12,6 +12,7 @@
1212
1313 import net.osdn.aoiro.AccountSettlement;
1414 import net.osdn.aoiro.Util;
15+import net.osdn.aoiro.cui.Main;
1516 import net.osdn.aoiro.model.Creditor;
1617 import net.osdn.aoiro.model.Debtor;
1718 import net.osdn.aoiro.model.JournalEntry;
@@ -348,11 +349,12 @@
348349 public void writeTo(Path path) throws IOException {
349350 prepare();
350351
351- PdfBrewer brewer = new PdfBrewer();
352+ PdfBrewer brewer = new PdfBrewer(Main.fontLoader);
352353 brewer.setCreator(Util.getPdfCreator());
353354 BrewerData pb = new BrewerData(printData, brewer.getFontLoader());
354355 brewer.setTitle("仕訳帳");
355356 brewer.process(pb);
356357 brewer.save(path);
358+ brewer.close();
357359 }
358360 }
--- aoiro/trunk/src/main/java/net/osdn/aoiro/report/GeneralLedger.java (revision 54)
+++ aoiro/trunk/src/main/java/net/osdn/aoiro/report/GeneralLedger.java (revision 55)
@@ -14,6 +14,7 @@
1414
1515 import net.osdn.aoiro.AccountSettlement;
1616 import net.osdn.aoiro.Util;
17+import net.osdn.aoiro.cui.Main;
1718 import net.osdn.aoiro.model.Account;
1819 import net.osdn.aoiro.model.AccountTitle;
1920 import net.osdn.aoiro.model.AccountType;
@@ -500,7 +501,24 @@
500501 public List<Account> getCounterpartAccounts(JournalEntry entry, Account account) {
501502 List<Account> counterpartAccounts = new ArrayList<>(); //相手勘定科目
502503
503- if(account.getAccountTitle().getDisplayName().equals("元入金")) {
504+ // 相手勘定が1件で決算勘定の場合は必ず相手勘定科目を出力します。
505+ boolean isCounterpartClosingAccount = false;
506+ if(account instanceof Debtor) {
507+ if(entry.getCreditors().size() == 1 && entry.getCreditors().get(0).getAccountTitle().isClosing()) {
508+ isCounterpartClosingAccount = true;
509+ }
510+ } else if(account instanceof Creditor) {
511+ if(entry.getDebtors().size() == 1 && entry.getDebtors().get(0).getAccountTitle().isClosing()) {
512+ isCounterpartClosingAccount = true;
513+ }
514+ }
515+ if(isCounterpartClosingAccount) {
516+ if(account instanceof Debtor) {
517+ counterpartAccounts.add(new Creditor(entry.getCreditors().get(0).getAccountTitle(), account.getAmount()));
518+ } else if(account instanceof Creditor) {
519+ counterpartAccounts.add(new Debtor(entry.getDebtors().get(0).getAccountTitle(), account.getAmount()));
520+ }
521+ } else if(account.getAccountTitle().getDisplayName().equals("元入金")) {
504522 // 元入金の場合は相手勘定科目を「諸口」とせずに、相手勘定科目を個別に出力します。
505523 // ただし、元入金側の勘定科目が2件以上ある場合は金額を算出できないので「諸口」とします。
506524 // 元入金側の勘定科目が1件の場合は、元入金の金額と相手勘定科目の合計金額が一致しますが、
@@ -558,12 +576,13 @@
558576 public void writeTo(Path path) throws IOException {
559577 prepare();
560578
561- PdfBrewer brewer = new PdfBrewer();
579+ PdfBrewer brewer = new PdfBrewer(Main.fontLoader);
562580 brewer.setCreator(Util.getPdfCreator());
563581 BrewerData pb = new BrewerData(printData, brewer.getFontLoader());
564582 brewer.setTitle("総勘定元帳");
565583 brewer.process(pb);
566584 brewer.save(path);
585+ brewer.close();
567586 }
568587
569588 /** 指定した勘定科目を含む仕訳データを取得します。
--- aoiro/trunk/src/main/java/net/osdn/aoiro/report/ProfitAndLoss.java (revision 54)
+++ aoiro/trunk/src/main/java/net/osdn/aoiro/report/ProfitAndLoss.java (revision 55)
@@ -21,6 +21,7 @@
2121
2222 import net.osdn.aoiro.AccountSettlement;
2323 import net.osdn.aoiro.Util;
24+import net.osdn.aoiro.cui.Main;
2425 import net.osdn.aoiro.model.AccountTitle;
2526 import net.osdn.aoiro.model.Amount;
2627 import net.osdn.aoiro.model.Creditor;
@@ -497,12 +498,13 @@
497498 public void writeTo(Path path) throws IOException {
498499 prepare();
499500
500- PdfBrewer brewer = new PdfBrewer();
501+ PdfBrewer brewer = new PdfBrewer(Main.fontLoader);
501502 brewer.setCreator(Util.getPdfCreator());
502503 BrewerData pb = new BrewerData(printData, brewer.getFontLoader());
503504 brewer.setTitle("損益計算書");
504505 brewer.process(pb);
505506 brewer.save(path);
507+ brewer.close();
506508 }
507509
508510 private static String formatMoney(long amount) {
--- aoiro/trunk/src/main/java/net/osdn/aoiro/report/StatementOfChangesInEquity.java (revision 54)
+++ aoiro/trunk/src/main/java/net/osdn/aoiro/report/StatementOfChangesInEquity.java (revision 55)
@@ -23,6 +23,7 @@
2323
2424 import net.osdn.aoiro.AccountSettlement;
2525 import net.osdn.aoiro.Util;
26+import net.osdn.aoiro.cui.Main;
2627 import net.osdn.aoiro.model.AccountTitle;
2728 import net.osdn.aoiro.model.AccountType;
2829 import net.osdn.aoiro.model.Amount;
@@ -459,12 +460,13 @@
459460 public void writeTo(Path path) throws IOException {
460461 prepare();
461462
462- PdfBrewer brewer = new PdfBrewer();
463+ PdfBrewer brewer = new PdfBrewer(Main.fontLoader);
463464 brewer.setCreator(Util.getPdfCreator());
464465 BrewerData pb = new BrewerData(printData, brewer.getFontLoader());
465466 brewer.setTitle("社員資本等変動計算書");
466467 brewer.process(pb);
467468 brewer.save(path);
469+ brewer.close();
468470 }
469471
470472 private static String formatMoney(long amount) {
Afficher sur ancien navigateur de dépôt.