Author: mallon Date: 2012-07-09 11:28:37 +0200 (Mon, 09 Jul 2012) New Revision: 3505 Url: http://chorem.org/repositories/revision/lima/3505 Log: Correction concernant la suppression de classes inutilis?\195?\169es, le renommage et retypage de variables, et la coh?\195?\169rence de pr?\195?\169sentation (Indentation et mots-clefs hql.). Removed: trunk/lima-callao/src/main/java/org/chorem/lima/beans/FiscalPeriodOpenClose.java Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialTransactionService.java trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java trunk/lima-callao/src/main/java/org/chorem/lima/entity/EntryDAOImpl.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringModelUI.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringViewHandler.java 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 2012-07-07 19:46:50 UTC (rev 3504) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java 2012-07-09 09:28:37 UTC (rev 3505) @@ -121,7 +121,7 @@ * and increment them * */ @Override - public String getNewLetters() throws LimaException { + public String getNextLetters() throws LimaException { String lastActualLetters; try { @@ -135,6 +135,8 @@ String nextSecondLetter = "A"; String nextFirstLetter = "A"; + //TODO:permettre de lettrer avec plus de trois lettres + if (lastActualLetters != null){ if (lastActualLetters.length() > 2 && lastActualLetters.charAt(2) != 'Z'){ nextThirdLetter = incrementLetter(2, lastActualLetters); @@ -145,7 +147,9 @@ } } - return nextFirstLetter + nextSecondLetter + nextThirdLetter; + String nextLetters = String.valueOf(nextFirstLetter + nextSecondLetter + nextThirdLetter); + + return nextLetters; } /**Increment letter alphabetically*/ @@ -259,20 +263,13 @@ return result; } - /** - * Get all entries by dates, account and lettering - * @param beginDate begin date - * @param endDate end date - * @param account acount - * @param filtreLettre lettering - * */ @Override - public List<Entry> getAllEntrieByDatesAndAccountAndLettering(Date beginDate, Date endDate, Account account, Boolean filtreLettre) throws LimaException { + public List<Entry> getAllEntrieByDatesAndAccountAndLettering(Date beginDate, Date endDate, Account account, Boolean letterFilter) throws LimaException { List<Entry> entries; try { EntryDAO entryDAO = getDaoHelper().getEntryDAO(); - entries = entryDAO.findAllEntryByAccountAndLettering(beginDate, endDate, account, filtreLettre); + entries = entryDAO.findAllEntryByAccountAndLettering(beginDate, endDate, account, letterFilter); } catch (Exception ex) { throw new LimaException("Can't get entries", ex); } Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialTransactionService.java =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialTransactionService.java 2012-07-07 19:46:50 UTC (rev 3504) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialTransactionService.java 2012-07-09 09:28:37 UTC (rev 3505) @@ -76,7 +76,14 @@ void removeEntry(Entry entry) throws LimaException; - String getNewLetters() throws LimaException; + String getNextLetters() throws LimaException; - List<Entry> getAllEntrieByDatesAndAccountAndLettering(Date beginDate, Date endDate, Account account, Boolean filtreLettre) throws LimaException; + /** + * Get all entries by dates, account and lettering + * @param beginDate begin date + * @param endDate end date + * @param account acount + * @param letterFilter lettering + * */ + List<Entry> getAllEntrieByDatesAndAccountAndLettering(Date beginDate, Date endDate, Account account, Boolean letterFilter) throws LimaException; } Deleted: trunk/lima-callao/src/main/java/org/chorem/lima/beans/FiscalPeriodOpenClose.java =================================================================== --- trunk/lima-callao/src/main/java/org/chorem/lima/beans/FiscalPeriodOpenClose.java 2012-07-07 19:46:50 UTC (rev 3504) +++ trunk/lima-callao/src/main/java/org/chorem/lima/beans/FiscalPeriodOpenClose.java 2012-07-09 09:28:37 UTC (rev 3505) @@ -1,26 +0,0 @@ -package org.chorem.lima.beans; - -import org.apache.commons.lang3.tuple.Pair; - -public class FiscalPeriodOpenClose extends Pair<Object, Object>{ - - @Override - public Object setValue(Object value) { - // TODO Auto-generated method stub - return null; - } - - @Override - public Object getLeft() { - // TODO Auto-generated method stub - return null; - } - - @Override - public Object getRight() { - // TODO Auto-generated method stub - return null; - } - - -} Modified: trunk/lima-callao/src/main/java/org/chorem/lima/entity/EntryDAOImpl.java =================================================================== --- trunk/lima-callao/src/main/java/org/chorem/lima/entity/EntryDAOImpl.java 2012-07-07 19:46:50 UTC (rev 3504) +++ trunk/lima-callao/src/main/java/org/chorem/lima/entity/EntryDAOImpl.java 2012-07-09 09:28:37 UTC (rev 3505) @@ -185,7 +185,7 @@ * @throws TopiaException * */ public List<Entry> findAllEntryByAccountAndLettering(Date beginDate, Date endDate, Account account, Boolean filtreLettre) throws TopiaException { - List<Entry> entries = null; + List<Entry> entries; String query = "Select E from " + Entry.class.getName() + " E, " + FinancialTransaction.class.getName() + " F" + " where E.financialTransaction = F" + @@ -194,14 +194,14 @@ if (filtreLettre != null){ if (filtreLettre){ query += " and E.lettering is null"; - }else if (!filtreLettre){ + }else { query += " and E.lettering is not null"; } } query += " and :beginDate <= F.transactionDate" + - " AND F.transactionDate <= :endDate"+ - " ORDER BY F.transactionDate, F." + FinancialTransaction.TOPIA_CREATE_DATE; + " and F.transactionDate <= :endDate"+ + " order by F.transactionDate, F." + FinancialTransaction.TOPIA_CREATE_DATE; entries = context.findAll(query, "account", account, "beginDate", beginDate, "endDate", endDate); return entries; Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringModelUI.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringModelUI.java 2012-07-07 19:46:50 UTC (rev 3504) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringModelUI.java 2012-07-09 09:28:37 UTC (rev 3505) @@ -177,7 +177,7 @@ //select entries with the same letter of the selected entry for(Entry entry : modelEntries){ if (entry.getLettering() != null && !entry.getLettering().isEmpty()){ - if (entry.getLettering().equals(lastEntrySelected.getLettering())){ + if (entry.getLettering().equals(currentLettring)){ int entryToSelect = model.getIndexOfEntry(entry); //Save current entry before changing it to add // debit / credit / solde with current entry later (Case : multiple selection Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringViewHandler.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringViewHandler.java 2012-07-07 19:46:50 UTC (rev 3504) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringViewHandler.java 2012-07-09 09:28:37 UTC (rev 3505) @@ -212,7 +212,7 @@ /**Add a group of three letters to n entries*/ public void addLetter() { - String newLetters = financialTransactionService.getNewLetters(); + String newLetters = financialTransactionService.getNextLetters(); changeLetter(newLetters); view.getModelUi().setLettrer(false); }