branch feature/1180-NPE_raport_journaux created (now cb7fe5e)
This is an automated email from the git hooks/post-receive script. New change to branch feature/1180-NPE_raport_journaux in repository lima. See http://git.chorem.org/lima.git at cb7fe5e fixes #1180 correction de potentiels npe sur entry.getAccount() This branch includes the following new commits: new cb7fe5e fixes #1180 correction de potentiels npe sur entry.getAccount() The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Detailed log of new commits: commit cb7fe5e989136501cf654cf82f637639c397dc44 Author: dcosse <cosse@codelutin.com> Date: Fri Feb 27 18:01:25 2015 +0100 fixes #1180 correction de potentiels npe sur entry.getAccount() -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch feature/1180-NPE_raport_journaux in repository lima. See http://git.chorem.org/lima.git commit cb7fe5e989136501cf654cf82f637639c397dc44 Author: dcosse <cosse@codelutin.com> Date: Fri Feb 27 18:01:25 2015 +0100 fixes #1180 correction de potentiels npe sur entry.getAccount() --- .../java/org/chorem/lima/business/ejb/FiscalPeriodServiceImpl.java | 3 ++- .../business/ejb/report/ProvisionalEntryBookReportServiceImpl.java | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lima-business/src/main/java/org/chorem/lima/business/ejb/FiscalPeriodServiceImpl.java b/lima-business/src/main/java/org/chorem/lima/business/ejb/FiscalPeriodServiceImpl.java index b2dcb10..5699b98 100644 --- a/lima-business/src/main/java/org/chorem/lima/business/ejb/FiscalPeriodServiceImpl.java +++ b/lima-business/src/main/java/org/chorem/lima/business/ejb/FiscalPeriodServiceImpl.java @@ -267,7 +267,8 @@ public class FiscalPeriodServiceImpl extends AbstractLimaService implements Fisc //check if they are at least one transaction to be report for (FinancialTransaction financialTransaction : financialTransactionsList) { for (Entry entry : financialTransaction.getEntry()) { - if (Integer.valueOf(entry.getAccount().getAccountNumber().substring(0, 1)) < 6 + // TODO DCossé 27/02/15 not sure of what to do if entry.getAccount() == null ? + if (entry.getAccount() != null && Integer.valueOf(entry.getAccount().getAccountNumber().substring(0, 1)) < 6 && !entry.getAmount().equals(BigDecimal.ZERO)) { return true; } diff --git a/lima-business/src/main/java/org/chorem/lima/business/ejb/report/ProvisionalEntryBookReportServiceImpl.java b/lima-business/src/main/java/org/chorem/lima/business/ejb/report/ProvisionalEntryBookReportServiceImpl.java index b396105..9e42ed0 100644 --- a/lima-business/src/main/java/org/chorem/lima/business/ejb/report/ProvisionalEntryBookReportServiceImpl.java +++ b/lima-business/src/main/java/org/chorem/lima/business/ejb/report/ProvisionalEntryBookReportServiceImpl.java @@ -18,6 +18,7 @@ import org.chorem.lima.business.api.FinancialPeriodService; import org.chorem.lima.business.api.FinancialTransactionService; import org.chorem.lima.business.api.IdentityService; import org.chorem.lima.business.api.report.ProvisionalEntryBookReportService; +import org.chorem.lima.entity.Account; import org.chorem.lima.entity.Entry; import org.chorem.lima.entity.EntryBook; import org.chorem.lima.entity.FinancialPeriod; @@ -138,9 +139,11 @@ public class ProvisionalEntryBookReportServiceImpl implements ProvisionalEntryBo credit = entry.getAmount(); } if (debit.compareTo(BigDecimal.ZERO) != 0 || credit.compareTo(BigDecimal.ZERO) != 0) { + Account account = entry.getAccount(); + String accountLabel = account != null ? entry.getAccount().getAccountNumber() + " - " + entry.getAccount().getLabel() : ""; Transaction transaction = new TransactionImpl(); transaction.setTransactionDate(entry.getFinancialTransaction().getTransactionDate()); - transaction.setAccount(entry.getAccount().getAccountNumber() + " - " + entry.getAccount().getLabel()); + transaction.setAccount(accountLabel); transaction.setLibelle(entry.getDescription()); transaction.setVoucher(entry.getVoucher()); transaction.setDebit(debit); -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
participants (1)
-
chorem.org scm