Author: jpepin Date: 2010-06-01 18:36:05 +0200 (Tue, 01 Jun 2010) New Revision: 2922 Url: http://chorem.org/repositories/revision/lima/2922 Log: D?\195?\169bogage suite ?\195?\160 passage en notation EJB. Correction de la rules cr?\195?\169ation de p?\195?\169riode fiscal, n'utilise plus le service de cr?\195?\169ation de p?\195?\169riode financi?\195?\168re en parral?\195?\168le Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/AccountService.java trunk/lima-business/src/main/java/org/chorem/lima/business/FinancialPeriodService.java trunk/lima-business/src/main/java/org/chorem/lima/business/FinancialPeriodServiceLocal.java trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/DefaultAccountingRules.java trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/EntryBookServiceImpl.java trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialPeriodServiceImpl.java trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FiscalPeriodServiceImpl.java trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java trunk/lima-callao/src/main/xmi/accounting.zargo trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/model/AccountTreeTableModel.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/AccountComboBoxModel.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/SubAccountComboBoxModel.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialperiod/FinancialPeriodTableModel.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/table/FinancialTransactionTableModel.java Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/AccountService.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/AccountService.java 2010-06-01 10:37:35 UTC (rev 2921) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/AccountService.java 2010-06-01 16:36:05 UTC (rev 2922) @@ -50,6 +50,7 @@ * @param account account * @throws LimaException */ + //EJB Remote void createAccount(Account masterAccount, Account account) throws LimaException, LimaBusinessException; void createSubLedger(Account masterAccount, Account account) throws LimaException; @@ -57,8 +58,9 @@ void updateAccount(Account account) throws LimaException; void removeAccount(Account account) throws LimaException; - - void removeAccountwithSubAccounts(Account account) throws LimaException; - + + List<Account> getAllChildrenAccounts(Account masterAccount, List<Account> accounts) throws LimaException; + + //EJB Remote et local List<Account> getChildrenAccounts(Account masterAccount) throws LimaException; } Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/FinancialPeriodService.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/FinancialPeriodService.java 2010-06-01 10:37:35 UTC (rev 2921) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/FinancialPeriodService.java 2010-06-01 16:36:05 UTC (rev 2922) @@ -46,10 +46,9 @@ List<FinancialPeriod> getUnblockedFinancialPeriods() throws LimaException; - void createFinancialPeriods(List<FinancialPeriod> financialPeriods) throws LimaException; - void createFinancialPeriodsWithTransaction(List<FinancialPeriod> financialPeriods, TopiaContext topiaContext) throws LimaException; - + void createFinancialPeriods(List<FinancialPeriod> financialPeriods) throws LimaException; + FinancialPeriod getFinancialPeriodWithDate(Date date) throws LimaException; /** Methodes for closedperiodicentrybook */ @@ -58,7 +57,7 @@ List<ClosedPeriodicEntryBook> getAllClosedPeriodicEntryBooksFromUnblockedFiscalPeriod() throws LimaException; - List<ClosedPeriodicEntryBook> getAllClosedPeriodicEntryBooks() throws LimaException; + List<ClosedPeriodicEntryBook> getAllClosedPeriodicEntryBooks() throws LimaException; void blockClosedPeriodicEntryBook(ClosedPeriodicEntryBook closedPeriodicEntryBook) throws LimaException; } Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/FinancialPeriodServiceLocal.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/FinancialPeriodServiceLocal.java 2010-06-01 10:37:35 UTC (rev 2921) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/FinancialPeriodServiceLocal.java 2010-06-01 16:36:05 UTC (rev 2922) @@ -19,9 +19,14 @@ package org.chorem.lima.business; +import java.util.List; + import javax.ejb.Local; +import org.chorem.lima.entity.FinancialPeriod; +import org.nuiton.topia.TopiaContext; + /** * Financial period service. * @@ -35,4 +40,7 @@ @Local public interface FinancialPeriodServiceLocal extends FinancialPeriodService { + void createFinancialPeriodsWithTransaction(List<FinancialPeriod> financialPeriods, TopiaContext topiaContext) throws LimaException; + + } Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/DefaultAccountingRules.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/DefaultAccountingRules.java 2010-06-01 10:37:35 UTC (rev 2921) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/DefaultAccountingRules.java 2010-06-01 16:36:05 UTC (rev 2922) @@ -28,7 +28,6 @@ import org.chorem.lima.business.AccountingRules; import org.chorem.lima.business.LimaBusinessException; import org.chorem.lima.business.LimaException; -import org.chorem.lima.business.ejb.AccountServiceImpl; import org.chorem.lima.entity.Account; import org.chorem.lima.entity.ClosedPeriodicEntryBook; import org.chorem.lima.entity.ClosedPeriodicEntryBookDAO; @@ -59,6 +58,7 @@ */ @Override public void createAccountRules(Account masterAccount, Account account) throws LimaException { + // Check if the numberaccount is not blank if (StringUtils.isBlank(account.getAccountNumber())) { throw new LimaBusinessException("Invalid AccountNumber : " @@ -164,11 +164,6 @@ if (nbentries != 0) { throw new LimaBusinessException("Can't delete Account with entries"); } - //check if subaccount have entries - AccountServiceImpl accountService = new AccountServiceImpl(); - for (Account childrenAccounts : accountService.getChildrenAccounts(account)) { - removeAccountRules(childrenAccounts, transaction); - } } catch (TopiaException ex) { doCatch(transaction, ex, log); 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-06-01 10:37:35 UTC (rev 2921) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java 2010-06-01 16:36:05 UTC (rev 2922) @@ -20,21 +20,15 @@ package org.chorem.lima.business.ejb; import static org.nuiton.i18n.I18n._; - import java.util.ArrayList; import java.util.Collections; import java.util.List; -import java.util.ListIterator; - -import javax.ejb.EJB; import javax.ejb.Stateless; - import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.chorem.lima.business.AccountService; import org.chorem.lima.business.AccountServiceLocal; import org.chorem.lima.business.AccountingRules; -import org.chorem.lima.business.FinancialTransactionService; import org.chorem.lima.business.LimaBusinessException; import org.chorem.lima.business.LimaConfig; import org.chorem.lima.business.LimaException; @@ -85,7 +79,7 @@ * mettre masterAccount à null. * * @param account account to create - * @throws LimaException + * @throws LimaException */ @Override public void createAccount(Account masterAccount, Account account) throws LimaException { @@ -154,6 +148,7 @@ accountDAO.create(account); + log.debug(masterAccount+" "+account); // check if the masteraccount exist; if (masterAccount != null) { masterAccount.addSubLedgers(account); @@ -173,10 +168,7 @@ /** - * Permet de convertir tous les comptes. - * - * @return - * @throws LimaException + * Permet d'obtenir tous les comptes. */ @Override public List<Account> getAllAccounts() throws LimaException { @@ -205,6 +197,9 @@ } + /** Permet d'obtenir tout les comptes feuilles + * TODO PEPIN 20100601 Move on a DAO for use this methode on report service + */ @Override public List<Account> getAllSubAccounts() throws LimaException { @@ -216,12 +211,13 @@ AccountDAO accountDAO = LimaCallaoDAOHelper.getAccountDAO(transaction); + //FIXME use topia query List<Account> accounts = accountDAO.findAll(); for (Account account : accounts) { - //check if parentaccount have no subaccount - if (account.getSubAccounts().size() == 0){ + //check if parentaccount have no subaccount and no subledgers + if (account.getSubAccounts().size() == 0 && account.getSubLedgers().size() == 0){ accountsList.add(account); - } + } } Collections.sort(accountsList, new AccountComparator()); } @@ -278,13 +274,22 @@ return accountsList; } - + @Override + public List<Account> getAllChildrenAccounts(Account masterAccount, List<Account> accounts) throws LimaException { + + List<Account> childAccounts = getChildrenAccounts(masterAccount); + accounts.addAll(childAccounts); + for (Account account : childAccounts) { + getAllChildrenAccounts(account, accounts); + } + return accounts; + } + /** * Permet d'effacer un compte dans la base de données. * - * Il est vérifié dans un premier temps si le compte existe bien. - * ATTENTION : si il existe une entrée comptable associée au numéro de - * compte, il est alors impossible de supprimer le compte. + * Si il existe une entrée comptable associée au numéro de + * compte ou a un de ses sous-compte, il est alors impossible de supprimer le compte. * * @param account * @throws LimaException @@ -294,21 +299,31 @@ TopiaContext transaction = null; try { transaction = beginTransaction(); + AccountDAO accountDAO = + LimaCallaoDAOHelper.getAccountDAO(transaction); - // Check rules + // Check rules for account if have entries accountingRules.removeAccountRules(account, transaction); + + //get all subaccounts + List<Account> accounts = getAllChildrenAccounts(account, new ArrayList<Account>()); - //Check if the account have subaccount - if (account.getSubAccounts().size() > 0){ - removeAccountwithSubAccounts(account); + //if account have sub accounts + if (accounts.size() > 0){ + for (Account subAccount : accounts) { + // Check rules for subaccount if have entries + accountingRules.removeAccountRules(account, transaction); + accountDAO.delete(subAccount); + log.debug(subAccount); + } } - else { // remove account - AccountDAO accountDAO = - LimaCallaoDAOHelper.getAccountDAO(transaction); accountDAO.delete(account); - commitTransaction(transaction); - } + log.debug(account); + + //commit + //commitTransaction(transaction); + } catch (TopiaException ex) { doCatch(transaction, ex, log); @@ -317,35 +332,6 @@ doFinally(transaction, log); } } - - /** - * Delete an account and all his subaccounts - * @param account - * @throws LimaException - */ - public void removeAccountwithSubAccounts(Account account) throws LimaException{ - TopiaContext transaction = null; - try{ - transaction = beginTransaction(); - AccountDAO accountDAO = - LimaCallaoDAOHelper.getAccountDAO(transaction); - List<Account> existingSubAccounts = getChildrenAccounts(account); - ListIterator itr = existingSubAccounts.listIterator(); - while(itr.hasNext()){ - Account subaccount = (Account) itr.next(); - removeAccountwithSubAccounts(subaccount); - } - // remove account - accountDAO.delete(account); - commitTransaction(transaction); - } - catch (TopiaException ex) { - doCatch(transaction, ex, log); - } - finally { - doFinally(transaction, log); - } - } /** * Permet de modifier un compte sur son label et son compte père. Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/EntryBookServiceImpl.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/EntryBookServiceImpl.java 2010-06-01 10:37:35 UTC (rev 2921) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/EntryBookServiceImpl.java 2010-06-01 16:36:05 UTC (rev 2922) @@ -43,6 +43,7 @@ import org.chorem.lima.entity.EntryBook; import org.chorem.lima.entity.EntryBookDAO; import org.chorem.lima.entity.FinancialPeriod; +import org.chorem.lima.entity.FinancialPeriodDAO; import org.chorem.lima.entity.LimaCallaoDAOHelper; import org.nuiton.topia.TopiaContext; import org.nuiton.topia.TopiaContextFactory; @@ -61,16 +62,9 @@ private static final Log log = LogFactory.getLog(EntryBookServiceImpl.class); private TopiaContext rootContext; - - @EJB - FinancialTransactionService financialTransactionService; - - @EJB - FinancialPeriodService financialPeriodService; protected AccountingRules accountingRules; - public EntryBookServiceImpl() { LimaConfig config = LimaConfig.getInstance(); try { @@ -112,7 +106,10 @@ //create ClosedPeriodicEntryBook for all unblocked financial period ClosedPeriodicEntryBookDAO closedPeriodicEntryBookDAO = LimaCallaoDAOHelper.getClosedPeriodicEntryBookDAO(transaction); - for (FinancialPeriod financialPeriod : financialPeriodService.getUnblockedFinancialPeriods()) { + FinancialPeriodDAO financialPeriodDAO = + LimaCallaoDAOHelper.getFinancialPeriodDAO(transaction); + // for all unblocked financialperiod + for (FinancialPeriod financialPeriod : financialPeriodDAO.findAllByLocked(false)) { //new closed periodic entrybook ClosedPeriodicEntryBook closedPeriodicEntryBook = Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialPeriodServiceImpl.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialPeriodServiceImpl.java 2010-06-01 10:37:35 UTC (rev 2921) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialPeriodServiceImpl.java 2010-06-01 16:36:05 UTC (rev 2922) @@ -109,14 +109,15 @@ FinancialPeriodDAO financialPeriodDAO = LimaCallaoDAOHelper.getFinancialPeriodDAO(topiaContext); - ClosedPeriodicEntryBookDAO closedPeriodicEntryBookDAO = LimaCallaoDAOHelper.getClosedPeriodicEntryBookDAO(topiaContext); EntryBookDAO entryBookDAO = LimaCallaoDAOHelper.getEntryBookDAO(topiaContext); - //create all financial period + log.debug(financialPeriods); for (FinancialPeriod financialPeriod : financialPeriods) { + log.debug(financialPeriod); + //create ClosedPeriodicEntryBook for all entrybook for (EntryBook entryBook : entryBookDAO.findAll()) { //new closed periodic entrybook @@ -166,7 +167,7 @@ return result; } - + /** * Return all unblocked financial period */ @@ -194,7 +195,7 @@ return result; } - + @Override public FinancialPeriod getFinancialPeriodWithDate(Date date) throws LimaException { @@ -315,7 +316,6 @@ //call query result = closedPeriodicEntryBookDAO.findAllByQuery(query); - log.debug(result); commitTransaction(transaction); } Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java 2010-06-01 10:37:35 UTC (rev 2921) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java 2010-06-01 16:36:05 UTC (rev 2922) @@ -286,8 +286,6 @@ public void updateFinancialTransactionWithTransaction(FinancialTransaction financialtransaction, TopiaContext topiaContext) throws LimaException{ try { - log.debug("updat"); - log.debug(financialtransaction); FinancialTransactionDAO transactionDAO = LimaCallaoDAOHelper.getFinancialTransactionDAO(topiaContext); FinancialTransaction financialTransactionOld = @@ -386,7 +384,6 @@ EntryDAO entryDAO = LimaCallaoDAOHelper.getEntryDAO(topiaContext); //delete entryDAO.delete(entry); - // updateFinancialTransactionWithTransaction(entry.getFinancialTransaction(), topiaContext) //commit commitTransaction(topiaContext); } @@ -396,8 +393,6 @@ finally { doFinally(topiaContext, log); } - //update financial transaction - updateFinancialTransaction(entry.getFinancialTransaction()); } @Override Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FiscalPeriodServiceImpl.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FiscalPeriodServiceImpl.java 2010-06-01 10:37:35 UTC (rev 2921) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FiscalPeriodServiceImpl.java 2010-06-01 16:36:05 UTC (rev 2922) @@ -23,12 +23,14 @@ import java.util.List; +import javax.ejb.EJB; import javax.ejb.Stateless; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.chorem.lima.business.AccountingRules; import org.chorem.lima.business.FinancialPeriodService; +import org.chorem.lima.business.FinancialPeriodServiceLocal; import org.chorem.lima.business.FiscalPeriodService; import org.chorem.lima.business.FiscalPeriodServiceLocal; import org.chorem.lima.business.LimaBusinessException; @@ -61,7 +63,8 @@ protected AccountingRules accountingRules; - FinancialPeriodService financialPeriodService; + @EJB + FinancialPeriodServiceLocal financialPeriodService; public FiscalPeriodServiceImpl() { LimaConfig config = LimaConfig.getInstance(); @@ -87,10 +90,12 @@ transaction = beginTransaction(); //check rules before create the account - List<FinancialPeriod> financialPeriods = accountingRules.createFiscalPeriodRules(fiscalPeriod, transaction); + List<FinancialPeriod> financialPeriods = + accountingRules.createFiscalPeriodRules(fiscalPeriod, transaction); + log.debug("financialPeriods : "+financialPeriods); + financialPeriodService. + createFinancialPeriodsWithTransaction(financialPeriods, transaction); - financialPeriodService.createFinancialPeriodsWithTransaction(financialPeriods, transaction); - FiscalPeriodDAO fiscalPeriodDAO = LimaCallaoDAOHelper.getFiscalPeriodDAO(transaction); Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java 2010-06-01 10:37:35 UTC (rev 2921) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java 2010-06-01 16:36:05 UTC (rev 2922) @@ -103,11 +103,11 @@ protected ReportsDatas generateAccountReportsWithTransaction (Account account, Date beginDate, Date endDate, TopiaContext topiaContext) throws LimaException{ ReportsDatas reportsDatas = new ReportsDatasImpl(); double credit = 0, debit = 0, solde = 0; - List<Object[]> results = new ArrayList<Object[]>(); - String queryAlias = "E"; if (account != null){ // First subaccount List<Account> accounts = account.getSubAccounts(); + accounts.addAll(account.getSubLedgers()); + log.debug(accounts); if (accounts.size() == 0){ reportsDatas = generateSubAccountReportsWithTransaction(account, beginDate, endDate, topiaContext); Modified: trunk/lima-callao/src/main/xmi/accounting.zargo =================================================================== (Binary files differ) 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-06-01 10:37:35 UTC (rev 2921) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/model/AccountTreeTableModel.java 2010-06-01 16:36:05 UTC (rev 2922) @@ -217,6 +217,7 @@ accountService.createAccount(parentAccount, account); int index = getIndexOfChild(path.getLastPathComponent(), account); + modelSupport.fireTreeStructureChanged(path); modelSupport.fireChildAdded(path, index, account); } @@ -235,6 +236,7 @@ } accountService.createSubLedger(parentAccount, account); int index = getIndexOfChild(path.getLastPathComponent(), account); + modelSupport.fireTreeStructureChanged(path); modelSupport.fireChildAdded(path, index, account); } @@ -267,10 +269,4 @@ modelSupport.fireChildRemoved(path.getParentPath(), index, account); } - public void removeAccountwithSubAccounts(TreePath path, Account account) throws LimaException { - int index = getIndexOfChild( - path.getParentPath().getLastPathComponent(), account); - accountService.removeAccountwithSubAccounts(account); - modelSupport.fireChildRemoved(path.getParentPath(), index, account); - } } Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/AccountComboBoxModel.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/AccountComboBoxModel.java 2010-06-01 10:37:35 UTC (rev 2921) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/AccountComboBoxModel.java 2010-06-01 16:36:05 UTC (rev 2922) @@ -88,7 +88,6 @@ result = accountService.getAllAccounts(); } catch (LimaException eee) { - // TODO Auto-generated catch block if (log.isDebugEnabled()){ log.debug("Can't get list accounts", eee); } Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/SubAccountComboBoxModel.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/SubAccountComboBoxModel.java 2010-06-01 10:37:35 UTC (rev 2921) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/SubAccountComboBoxModel.java 2010-06-01 16:36:05 UTC (rev 2922) @@ -42,10 +42,13 @@ protected Object selectedAccount; + protected List<Account> datasCache; + protected AccountService accountService; public SubAccountComboBoxModel() { accountService = LimaServiceFactory.getInstance().getAccountService(); + datasCache = getDataList(); } @Override @@ -66,12 +69,12 @@ @Override public Object getElementAt(int index) { - return getDataList().get(index); + return datasCache.get(index); } @Override public int getSize() { - return getDataList().size(); + return datasCache.size(); } @Override @@ -86,7 +89,6 @@ result = accountService.getAllSubAccounts(); } catch (LimaException eee) { - // TODO Auto-generated catch block if (log.isDebugEnabled()){ log.debug("Can't get list subaccounts", eee); } Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialperiod/FinancialPeriodTableModel.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialperiod/FinancialPeriodTableModel.java 2010-06-01 10:37:35 UTC (rev 2921) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialperiod/FinancialPeriodTableModel.java 2010-06-01 16:36:05 UTC (rev 2922) @@ -145,7 +145,8 @@ switch (columnIndex) { case 0: - result = simpleDateFormat.format(financialPeriod.getBeginDate())+" - "+simpleDateFormat.format(financialPeriod.getEndDate()); + result = simpleDateFormat.format(financialPeriod.getBeginDate()) + +" - "+simpleDateFormat.format(financialPeriod.getEndDate()); break; case 1: result = entryBook.getCode()+" - "+entryBook.getLabel(); Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/table/FinancialTransactionTableModel.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/table/FinancialTransactionTableModel.java 2010-06-01 10:37:35 UTC (rev 2921) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/table/FinancialTransactionTableModel.java 2010-06-01 16:36:05 UTC (rev 2922) @@ -428,49 +428,6 @@ //update currentFinancialTransaction. setTransactionDate((Date)value); - - /*// Truncate the date - format 01-MM-YYYY - Date dateCurrentFinancialTransaction = ((Date)value); - dateCurrentFinancialTransaction = - DateUtils.truncate( - dateCurrentFinancialTransaction, Calendar.MONTH); - - //TODO add on rules - // Return the begin date of the current financial period - Date dateCurrentFinancialPeriod = - selectedFinancialPeriod.getBeginDate(); - - // Compare to the begindate of the current financial period - if (!dateCurrentFinancialPeriod.equals(dateCurrentFinancialTransaction)){ - //methode get financialperiod dans le service - FinancialPeriod newFinancialPeriod = - new FinancialPeriodImpl(); - try { - newFinancialPeriod = - financialPeriodService.getFinancialPeriodWithDate( - dateCurrentFinancialTransaction); - } catch (LimaException e) { - if (log.isDebugEnabled()){ - log.debug("Can't get new financialPeriodService"); - } - } - //if the changed financial period is unlocked - if (newFinancialPeriod != null){ - if (newFinancialPeriod.getLocked() == false){ - //update - currentFinancialTransaction. - setTransactionDate((Date)value); - currentFinancialTransaction. - setFinancialPeriod(newFinancialPeriod); - } - } - else { - if (log.isDebugEnabled()){ - log.debug("Can't update on the new date"); - } - } - }*/ - break; } // notify service for modification