Author: tchemit Date: 2011-09-22 17:24:35 +0200 (Thu, 22 Sep 2011) New Revision: 3300 Url: http://chorem.org/repositories/revision/lima/3300 Log: fix request to obtain master account childs (no link with ledger account here) + fix lazy attribute Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.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 2011-09-22 15:23:12 UTC (rev 3299) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java 2011-09-22 15:24:35 UTC (rev 3300) @@ -277,7 +277,6 @@ return accountsList; } - /** * Permet de recuperer la liste des comptes fils d'un compte en particulier. * @@ -296,15 +295,18 @@ LimaCallaoDAOHelper.getAccountDAO(transaction); TopiaQuery query = accountDAO.createQuery(); - if (masterAccount == null) { - query.addEquals(Account.PROPERTY_MASTER_ACCOUNT, masterAccount); - query.addWhere(Account.PROPERTY_GENERAL_LEDGER, TopiaQuery.Op.EQ, null); - } else { - query.addWhere(Account.PROPERTY_MASTER_ACCOUNT + - " = :value or " + - Account.PROPERTY_GENERAL_LEDGER + " = :value") - .addParam("value", masterAccount); - } + //tchemit 2011-09-21 Only consider account childs from the master account + // link otherwise account can be found from different masterAccount + query.addEquals(Account.PROPERTY_MASTER_ACCOUNT, masterAccount); +// if (masterAccount == null) { +// query.addEquals(Account.PROPERTY_MASTER_ACCOUNT, masterAccount); +// query.addWhere(Account.PROPERTY_GENERAL_LEDGER, TopiaQuery.Op.EQ, null); +// } else { +// query.addWhere(Account.PROPERTY_MASTER_ACCOUNT + +// " = :value or " + +// Account.PROPERTY_GENERAL_LEDGER + " = :value") +// .addParam("value", masterAccount); +// } accountsList.addAll(accountDAO.findAllByQuery(query)); Collections.sort(accountsList, new AccountComparator()); @@ -317,6 +319,7 @@ } t.sizeSubAccounts(); t.sizeSubLedgers(); + t.getGeneralLedger(); } } catch (Exception ex) {