This is an automated email from the git hooks/post-receive script. New commit to branch feature/1174-Import_EBP_Transactions in repository lima. See https://gitlab.nuiton.org/chorem/lima.git commit e9e58f9c2a94d76091541a77b16aeb78fe29cb35 Author: David Cossé <cosse@codelutin.com> Date: Thu Sep 8 15:16:31 2016 +0200 refs #1174 l'exception sur la non existance d'un compte dont la suppression est demandée ne doit pas être levé au niveau des règles métier --- .../chorem/lima/business/accountingrules/DefaultAccountingRules.java | 3 --- .../main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java | 4 ++++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lima-business/src/main/java/org/chorem/lima/business/accountingrules/DefaultAccountingRules.java b/lima-business/src/main/java/org/chorem/lima/business/accountingrules/DefaultAccountingRules.java index 98a9a33..96e98d1 100644 --- a/lima-business/src/main/java/org/chorem/lima/business/accountingrules/DefaultAccountingRules.java +++ b/lima-business/src/main/java/org/chorem/lima/business/accountingrules/DefaultAccountingRules.java @@ -180,9 +180,6 @@ public class DefaultAccountingRules implements AccountingRules { EntryTopiaDao entryTopiaDao = getDaoHelper().getEntryDao(); // Check if account have entries - if (!account.isPersisted()) { - throw new UnexistingAccount(account.getAccountNumber(), "Unsaved Account, this account can not be removed"); - } if (entryTopiaDao.forAccountEquals(account).exists()) { throw new UsedAccountException(account.getAccountNumber()); } diff --git a/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java b/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java index df767a4..07c62ce 100644 --- a/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java +++ b/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java @@ -193,6 +193,10 @@ public class AccountServiceImpl extends AbstractLimaService implements AccountSe @Override public void removeAccount(Account account) throws UsedAccountException, UnexistingAccount { + if (!account.isPersisted()) { + throw new UnexistingAccount(account.getAccountNumber(), "Unsaved Account, this account can not be removed"); + } + AccountingRules accountingRules = LimaBusinessConfig.getInstance().getAccountingRules(); // Check rules for account if have entries -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.