• R/O
  • SSH
  • HTTPS

aoiro: Commit


Commit MetaInfo

Revisão11 (tree)
Hora2018-02-21 22:32:55
Autorhirukawa_ryo

Mensagem de Log

* aoiro 0.2.4
貸借合計が0のときに残高振替仕訳が作成されないバグを修正しました。勘定合計が0でも残高は作成します。

Mudança Sumário

Diff

--- aoiro/trunk/src/main/java/net/osdn/aoiro/AccountSettlement.java (revision 10)
+++ aoiro/trunk/src/main/java/net/osdn/aoiro/AccountSettlement.java (revision 11)
@@ -83,13 +83,15 @@
8383 }
8484 if(debtorTotal > creditorTotal) {
8585 double total = (debtorTotal - creditorTotal) * (1.0 - proportionalDivision.getBusinessRatio());
86- if(!(-1.0 < total && total < +1.0)) {
87- creditors.add(new Creditor(proportionalDivision.getAccountTitle(), (int)Math.floor(total)));
86+ int intTotal = (int)Math.floor(total);
87+ if(intTotal != 0) {
88+ creditors.add(new Creditor(proportionalDivision.getAccountTitle(), intTotal));
8889 }
8990 } else if(creditorTotal > debtorTotal) {
9091 double total = (creditorTotal - debtorTotal) * (1.0 - proportionalDivision.getBusinessRatio());
91- if(!(-1.0 < total && total < +1.0)) {
92- debtors.add(new Debtor(proportionalDivision.getAccountTitle(), (int)Math.floor(total)));
92+ int intTotal = (int)Math.floor(total);
93+ if(intTotal != 0) {
94+ debtors.add(new Debtor(proportionalDivision.getAccountTitle(), intTotal));
9395 }
9496 }
9597 }
@@ -351,7 +353,16 @@
351353 }
352354 }
353355 if(total == 0) {
354- //
356+ //残高は0でも振替仕訳を出力します。(ノーマルバランスの逆貸借で作成します。)
357+ if(accountTitle.getType().getNormalBalance() == Debtor.class) {
358+ //貸方
359+ Creditor creditor = new Creditor(accountTitle, +total);
360+ creditors.add(creditor);
361+ } else {
362+ //借方
363+ Debtor debtor = new Debtor(accountTitle, -total);
364+ debtors.add(debtor);
365+ }
355366 } else if(total > 0) {
356367 //貸方
357368 Creditor creditor = new Creditor(accountTitle, +total);
Show on old repository browser