r2860 - in trunk: lima-business/src/main/java/org/chorem/lima/business/ejb lima-swing/src/main/java/org/chorem/lima/ui/account/model
Author: jpepin Date: 2010-04-13 21:56:51 +0200 (Tue, 13 Apr 2010) New Revision: 2860 Log: resolution bug rafraichissement ui plan des comptes apres modification Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/model/AccountTreeTableModel.java Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java 2010-04-12 15:46:09 UTC (rev 2859) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java 2010-04-13 19:56:51 UTC (rev 2860) @@ -87,30 +87,34 @@ */ @Override public void createAccount(Account masterAccount, Account account) throws LimaException { - - - // test la validite du numero de compte if (StringUtils.isBlank(account.getAccountNumber())) { - throw new LimaBusinessException("Invalid AccountNumber : " + account.getAccountNumber()); + throw new LimaBusinessException("Invalid AccountNumber : " + + account.getAccountNumber()); } // test que le numero de compte est de type numeric if (!StringUtils.isNumeric(account.getAccountNumber())){ - throw new LimaBusinessException("AccountNumber is not numeric : " + account.getAccountNumber()); + throw new LimaBusinessException("AccountNumber is not numeric : " + + account.getAccountNumber()); } - // TODO verifier que le numero de compte du fils commence par celui du pere + // test que le numero de compte du fils commence par celui du pere // (peut etre trop specific à la compta francaise) - if (masterAccount!=null && !account.getAccountNumber().startsWith(masterAccount.getAccountNumber())){ + if (masterAccount!=null && !account.getAccountNumber().startsWith( + masterAccount.getAccountNumber())){ - throw new LimaBusinessException("Account Number not begin with the number account master :" + account.getAccountNumber()); + throw new LimaBusinessException("" + + "Account Number not begin with the number account master :" + + account.getAccountNumber()); } // Test que le compte master crée a un numéro entre 1 a 8 if (masterAccount==null && !account.getAccountNumber().matches("[1-8]")){ - throw new LimaBusinessException("Master account is not a digit between 1 to 8 :" + account.getAccountNumber()); + throw new LimaBusinessException( + "Master account is not a digit between 1 to 8 :" + + account.getAccountNumber()); } TopiaContext transaction = null; @@ -123,7 +127,8 @@ AccountDAO accountDAO = LimaCallaoDAOHelper.getAccountDAO(transaction); List<Account> existingAccounts = accountDAO.findAllByAccountNumber(account.getAccountNumber()); if (CollectionUtils.isNotEmpty(existingAccounts)) { - throw new LimaBusinessException(_("An account already exists with this number : %s", account.getAccountNumber())); + throw new LimaBusinessException(_( + "An account already exists with this number : %s", account.getAccountNumber())); } accountDAO.create(account); @@ -619,6 +624,8 @@ // FIXME !IMPORTANT! check that subaccounts are also deleted AccountDAO accountDAO = LimaCallaoDAOHelper.getAccountDAO(transaction); accountDAO.delete(account); + // commit + transaction.commitTransaction(); } catch (TopiaException ex) { doCatch(transaction, ex, log); @@ -701,6 +708,8 @@ // update account AccountDAO accountDAO = LimaCallaoDAOHelper.getAccountDAO(transaction); accountDAO.update(account); + // commit + transaction.commitTransaction(); } catch (TopiaException ex) { if (transaction != null) { Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/model/AccountTreeTableModel.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/model/AccountTreeTableModel.java 2010-04-12 15:46:09 UTC (rev 2859) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/model/AccountTreeTableModel.java 2010-04-13 19:56:51 UTC (rev 2860) @@ -221,7 +221,8 @@ accountService.updateAccount(account); int index = getIndexOfChild(path.getParentPath().getLastPathComponent(), account); // TODO maybe not working if order change - modelSupport.fireChildChanged(path.getParentPath(), index, account); + // modelSupport.fireChildChanged(path.getParentPath(), index, account); + modelSupport.fireTreeStructureChanged(path.getParentPath()); } /**
participants (1)
-
jpepin@users.chorem.org