Author: jpepin Date: 2010-05-19 18:38:02 +0200 (Wed, 19 May 2010) New Revision: 2902 Url: http://chorem.org/repositories/revision/lima/2902 Log: Ajout r?\195?\168gle de v?\195?\169rification cloture journal d'une p?\195?\169riode financi?\195?\168re Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/AccountService.java trunk/lima-business/src/main/java/org/chorem/lima/business/AccountingRules.java trunk/lima-business/src/main/java/org/chorem/lima/business/FinancialTransactionService.java trunk/lima-business/src/main/java/org/chorem/lima/business/LimaConfig.java trunk/lima-business/src/main/java/org/chorem/lima/business/RecordService.java trunk/lima-business/src/main/java/org/chorem/lima/business/ReportService.java trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/DefaultAccountingRules.java trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/FranceAccountingRules.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-swing/src/main/java/org/chorem/lima/LimaMain.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainView.jaxx trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainViewHandler.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsTableModel.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialperiod/FinancialPeriodViewHandler.java trunk/lima-swing/src/main/resources/i18n/lima-swing-en_GB.properties trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties 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-05-19 10:52:43 UTC (rev 2901) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/AccountService.java 2010-05-19 16:38:02 UTC (rev 2902) @@ -19,10 +19,8 @@ package org.chorem.lima.business; -import java.util.Date; import java.util.List; -import org.chorem.lima.beans.BalanceTrial; import org.chorem.lima.entity.Account; /** Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/AccountingRules.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/AccountingRules.java 2010-05-19 10:52:43 UTC (rev 2901) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/AccountingRules.java 2010-05-19 16:38:02 UTC (rev 2902) @@ -19,6 +19,7 @@ package org.chorem.lima.business; import org.chorem.lima.entity.Account; +import org.chorem.lima.entity.ClosedPeriodicEntryBook; import org.chorem.lima.entity.Entry; import org.chorem.lima.entity.EntryBook; import org.chorem.lima.entity.FinancialTransaction; @@ -32,12 +33,49 @@ */ public interface AccountingRules { + public void register(Class clazz, Object object); + + /** + * Accounts rules + * @param masterAccount + * @param account + * @throws LimaException + */ public void createAccountRules(Account masterAccount, Account account) throws LimaException; public void createSubLedgerRules(Account masterAccount, Account account) throws LimaException; + public void removeAccountRules(Account account, TopiaContext transaction) throws LimaException; + + /** + * Entrybook rules + * @param entryBook + * @param topiaTransaction + * @throws LimaException + */ + public void removeEntryBookRules(EntryBook entryBook, TopiaContext topiaTransaction) throws LimaException; + + /** + * Fiscal Period rules + * @param fiscalPeriod + * @param transaction + * @throws LimaException + */ public void createFiscalPeriodRules(FiscalPeriod fiscalPeriod, TopiaContext transaction) throws LimaException; + public void blockFiscalPeriodRules(FiscalPeriod fiscalPeriod, TopiaContext transaction) throws LimaException; + + /** + * Entry rules + * @param entry + * @param topiaTransaction + * @throws LimaException + */ public void updateEntryRules(Entry entry, TopiaContext topiaTransaction) throws LimaException; - public void blockFiscalPeriodRules(FiscalPeriod fiscalPeriod, TopiaContext transaction) throws LimaException; - public void removeAccountRules(Account account, TopiaContext transaction) throws LimaException; - public void removeEntryBookRules(EntryBook entryBook, TopiaContext topiaTransaction) throws LimaException; + + /** + * Financialperiod/entrybook rules + * @param financialTransaction + * @param topiaContext + * @throws LimaException + */ public void checkFinancialPeriodBlockedWithFinancialTransaction(FinancialTransaction financialTransaction, TopiaContext topiaContext) throws LimaException; + public void blockClosedPeriodicEntryBookRules(ClosedPeriodicEntryBook closedPeriodicEntryBook, TopiaContext topiaContext) throws LimaException; } Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/FinancialTransactionService.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/FinancialTransactionService.java 2010-05-19 10:52:43 UTC (rev 2901) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/FinancialTransactionService.java 2010-05-19 16:38:02 UTC (rev 2902) @@ -19,11 +19,8 @@ package org.chorem.lima.business; -import java.util.Date; import java.util.List; -import org.chorem.lima.beans.ReportsDatas; -import org.chorem.lima.entity.Account; import org.chorem.lima.entity.Entry; import org.chorem.lima.entity.EntryBook; import org.chorem.lima.entity.FinancialPeriod; Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/LimaConfig.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/LimaConfig.java 2010-05-19 10:52:43 UTC (rev 2901) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/LimaConfig.java 2010-05-19 16:38:02 UTC (rev 2902) @@ -54,14 +54,6 @@ for (Option o : Option.values()) { setDefaultOption(o.key, o.defaultValue); } - - /* // set action alias - for (Action a : Action.values()) { - for (String alias : a.aliases) { - addActionAlias(alias, a.action); - } - }*/ - } public static LimaConfig getInstance() { @@ -73,11 +65,11 @@ } /** + * instancie la bonne classe de nationalite en fonction du fichier de configuration * * @return */ public AccountingRules getAccountingRules(){ - //TODO PEPIN 20100503 instancier la bonne classe de nationalite en fonction du fichier de configuration if (accountingRules == null){ Class accountingRulesClass = getOptionAsClass(Option.RULES_NATIONALTY.key); Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/RecordService.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/RecordService.java 2010-05-19 10:52:43 UTC (rev 2901) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/RecordService.java 2010-05-19 16:38:02 UTC (rev 2902) @@ -19,8 +19,6 @@ package org.chorem.lima.business; -import java.util.List; - /** * Fiscal period service. * Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ReportService.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ReportService.java 2010-05-19 10:52:43 UTC (rev 2901) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ReportService.java 2010-05-19 16:38:02 UTC (rev 2902) @@ -25,8 +25,6 @@ import org.chorem.lima.beans.ReportsDatas; import org.chorem.lima.entity.Account; import org.chorem.lima.entity.EntryBook; -import org.chorem.lima.entity.FinancialPeriod; -import org.chorem.lima.entity.FiscalPeriod; /** * Service de generation des rapports. 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-05-19 10:52:43 UTC (rev 2901) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/DefaultAccountingRules.java 2010-05-19 16:38:02 UTC (rev 2902) @@ -20,19 +20,20 @@ package org.chorem.lima.business.accountingrules; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; import org.apache.commons.lang.StringUtils; 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.LimaBusinessException; import org.chorem.lima.business.LimaException; import org.chorem.lima.business.ejb.AccountServiceImpl; -import org.chorem.lima.business.ejb.FinancialPeriodServiceImpl; import org.chorem.lima.entity.Account; import org.chorem.lima.entity.ClosedPeriodicEntryBook; -import org.chorem.lima.entity.ClosedPeriodicEntryBookImpl; import org.chorem.lima.entity.Entry; import org.chorem.lima.entity.EntryBook; import org.chorem.lima.entity.EntryBookDAO; @@ -51,12 +52,19 @@ */ public class DefaultAccountingRules implements AccountingRules { + private Map<Class, Object> map; + protected static final Log log = LogFactory.getLog(DefaultAccountingRules.class); - - private FinancialPeriodServiceImpl financialPeriodService = - new FinancialPeriodServiceImpl(); + public DefaultAccountingRules() { + map = new HashMap<Class, Object>(); + } + + public void register(Class clazz, Object object){ + map.put(clazz, object); + } + /** * Rules to check before create accounts */ @@ -104,22 +112,25 @@ if (entry.getFinancialTransaction().getFinancialPeriod().getLocked()){ throw new LimaBusinessException("The financial period is blocked"); } - ClosedPeriodicEntryBook closedPeriodicEntryBook = new ClosedPeriodicEntryBookImpl(); + ClosedPeriodicEntryBook closedPeriodicEntryBook = null; try { EntryBook entryBook = entry.getEntryBook(); FinancialPeriod financialPeriod = entry.getFinancialTransaction().getFinancialPeriod(); + FinancialPeriodService financialPeriodService = (FinancialPeriodService) map.get(FinancialPeriodService.class); + closedPeriodicEntryBook = financialPeriodService.getClosedPeriodicEntryBook(entryBook, financialPeriod); + + // Check if closedperiodicentrybook is locked + if (closedPeriodicEntryBook.getLocked()){ + throw new LimaBusinessException("Can't update entry : financialperiod of this entrybook is closed"); + } } catch (LimaException eee) { doCatch(topiaTransaction, eee, log); } - // Check if closedperiodicentrybook is locked - if (closedPeriodicEntryBook.getLocked()){ - throw new LimaBusinessException("Can't update entry : financialperiod of this entrybook is closed"); - } } /** @@ -188,17 +199,20 @@ FinancialPeriod financialPeriod = financialTransaction.getFinancialPeriod(); entryBooks = entryBookDAO.findAll(); for (EntryBook entryBook : entryBooks) { + FinancialPeriodService financialPeriodService = + (FinancialPeriodService) map.get(FinancialPeriodService.class); + if(financialPeriodService.getClosedPeriodicEntryBook(entryBook, financialPeriod).getLocked()){ closedEntryBooks.add(entryBook); } } + if (entryBooks.size() == closedEntryBooks.size()){ + throw new LimaBusinessException("All EntryBook of this financialperiod are closed"); + } } catch (TopiaException eee) { doCatch(topiaContext, eee, log); } - if (entryBooks.size() == closedEntryBooks.size()){ - throw new LimaBusinessException("All EntryBook of this financialperiod are closed"); - } } /** @@ -222,5 +236,12 @@ } throw new LimaException("Exception during query", cause); } + + @Override + public void blockClosedPeriodicEntryBookRules(ClosedPeriodicEntryBook closedPeriodicEntryBook, TopiaContext topiaContext) + throws LimaException { + // TODO Auto-generated method stub + + } } Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/FranceAccountingRules.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/FranceAccountingRules.java 2010-05-19 10:52:43 UTC (rev 2901) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/FranceAccountingRules.java 2010-05-19 16:38:02 UTC (rev 2902) @@ -1,17 +1,29 @@ package org.chorem.lima.business.accountingrules; +import java.util.ArrayList; +import java.util.Calendar; import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.time.DateUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.chorem.lima.business.FinancialPeriodService; import org.chorem.lima.business.LimaBusinessException; import org.chorem.lima.business.LimaException; import org.chorem.lima.business.ejb.FinancialPeriodServiceImpl; import org.chorem.lima.entity.Account; +import org.chorem.lima.entity.ClosedPeriodicEntryBook; +import org.chorem.lima.entity.ClosedPeriodicEntryBookDAO; +import org.chorem.lima.entity.Entry; +import org.chorem.lima.entity.EntryBook; import org.chorem.lima.entity.FinancialPeriod; import org.chorem.lima.entity.FinancialPeriodImpl; +import org.chorem.lima.entity.FinancialTransaction; +import org.chorem.lima.entity.FinancialTransactionDAO; import org.chorem.lima.entity.FiscalPeriod; import org.chorem.lima.entity.FiscalPeriodDAO; import org.chorem.lima.entity.LimaCallaoDAOHelper; @@ -21,11 +33,21 @@ import org.nuiton.topia.framework.TopiaQuery.Op; public class FranceAccountingRules extends DefaultAccountingRules { - protected static final Log log = LogFactory.getLog(DefaultAccountingRules.class); + protected static final Log log = + LogFactory.getLog(DefaultAccountingRules.class); - private FinancialPeriodServiceImpl financialPeriodService = - new FinancialPeriodServiceImpl(); + private TopiaContext rootContext; + + private Map<Class, Object> map; + public FranceAccountingRules() { + map = new HashMap<Class, Object>(); + } + + public void register(Class clazz, Object object){ + map.put(clazz, object); + } + /** * Règles de vérification de la création du PCG, appliquées à la comptabilité française * @@ -110,6 +132,7 @@ Date beginDate = fiscalPeriod.getBeginDate(); Date endDate = fiscalPeriod.getEndDate(); + FinancialPeriodService financialPeriodService = (FinancialPeriodService) map.get(FinancialPeriodService.class); // FinancialPeriod of 1 month are created Date loopDate = beginDate; while (loopDate.compareTo(endDate) <= 0) { @@ -156,6 +179,71 @@ /** + * Check if old financialperiod for a an entrybook are closed before bock the asked closedperiodicentrybook + * + * get all closedperiodicentrybook between the first financial period of fiscalperiod + * and the last financial period of the closedperiodicentrybook in param + * return the number + * + * get all blocked closedperiodicentrybook while his same period, return the number + * + * compare there + */ + public void blockClosedPeriodicEntryBookRules(ClosedPeriodicEntryBook closedPeriodicEntryBook, TopiaContext topiaTransaction) + throws LimaException { + closedPeriodicEntryBook.getFinancialPeriod(); + List<ClosedPeriodicEntryBook> closedPeriodicEntryBooks = new ArrayList<ClosedPeriodicEntryBook>(); + + try { + + // Get all closedperiod between for the period and entrybook + Date endDate = closedPeriodicEntryBook.getFinancialPeriod().getBeginDate(); + endDate = DateUtils.addMonths(endDate, -1); + Date beginDate = closedPeriodicEntryBook.getFinancialPeriod().getFiscalPeriod().getBeginDate(); + EntryBook entryBook = closedPeriodicEntryBook.getEntryBook(); + + ClosedPeriodicEntryBookDAO closedPeriodicEntryBookDAO = + LimaCallaoDAOHelper.getClosedPeriodicEntryBookDAO(topiaTransaction); + TopiaQuery query = closedPeriodicEntryBookDAO.createQuery(); + String closedPeriodicEntryBookDateProperty = + TopiaQuery.getProperty(ClosedPeriodicEntryBook.FINANCIAL_PERIOD, + FinancialPeriod.BEGIN_DATE); + query.add(closedPeriodicEntryBookDateProperty+" BETWEEN :beginDate AND :endDate") + .add(ClosedPeriodicEntryBook.ENTRY_BOOK, entryBook) + .addParam("beginDate", beginDate) + .addParam("endDate", endDate); + + closedPeriodicEntryBooks.addAll(closedPeriodicEntryBookDAO.findAllByQuery(query)); + for (ClosedPeriodicEntryBook closedPeriodicEntryBook2 : closedPeriodicEntryBooks) { + log.debug(closedPeriodicEntryBook2.getEntryBook()+" "+closedPeriodicEntryBook2.getFinancialPeriod()); + } + + int nbClosedPeriodicEntryBooks = closedPeriodicEntryBooks.size(); + log.debug("nbBlockedClosedPeriodicEntryBooks "+nbClosedPeriodicEntryBooks); + + // Get all closed between for the period, entrybook and are blocked + query.add(ClosedPeriodicEntryBook.LOCKED, true); + closedPeriodicEntryBooks.clear(); + closedPeriodicEntryBooks.addAll(closedPeriodicEntryBookDAO.findAllByQuery(query)); + for (ClosedPeriodicEntryBook closedPeriodicEntryBook2 : closedPeriodicEntryBooks) { + log.debug(closedPeriodicEntryBook2.getEntryBook()+" "+closedPeriodicEntryBook2.getFinancialPeriod()); + } + int nbBlockedClosedPeriodicEntryBooks = closedPeriodicEntryBooks.size(); + log.debug("nbBlockedClosedPeriodicEntryBooks "+nbBlockedClosedPeriodicEntryBooks); + + //Check if the fiscal period to block is the oldest + if (nbClosedPeriodicEntryBooks != nbBlockedClosedPeriodicEntryBooks){ + throw new LimaBusinessException( + "The previous financial periods for this entrybook must be blocked before this."); + } + + } + catch (TopiaException ex) { + doCatch(topiaTransaction, ex, log); + } + } + + /** * Generic code used to rollback a transaction. * * TODO : replace this by JTA 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-05-19 10:52:43 UTC (rev 2901) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java 2010-05-19 16:38:02 UTC (rev 2902) @@ -54,7 +54,8 @@ @Stateless public class AccountServiceImpl extends AbstractLimaService implements AccountService { - private static final Log log = LogFactory.getLog(AccountServiceImpl.class); + private static final Log log = + LogFactory.getLog(AccountServiceImpl.class); private TopiaContext rootContext; 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-05-19 10:52:43 UTC (rev 2901) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/EntryBookServiceImpl.java 2010-05-19 16:38:02 UTC (rev 2902) @@ -36,18 +36,14 @@ import org.chorem.lima.entity.ClosedPeriodicEntryBook; import org.chorem.lima.entity.ClosedPeriodicEntryBookDAO; import org.chorem.lima.entity.ClosedPeriodicEntryBookImpl; -import org.chorem.lima.entity.Entry; import org.chorem.lima.entity.EntryBook; import org.chorem.lima.entity.EntryBookDAO; import org.chorem.lima.entity.FinancialPeriod; -import org.chorem.lima.entity.FinancialTransactionDAO; import org.chorem.lima.entity.LimaCallaoDAOHelper; -import org.chorem.lima.entity.FinancialTransaction; import org.nuiton.topia.TopiaContext; import org.nuiton.topia.TopiaContextFactory; import org.nuiton.topia.TopiaException; import org.nuiton.topia.TopiaNotFoundException; -import org.nuiton.topia.framework.TopiaQuery; /** * Implémente la fonction multi-EntryBook. Il est possible de créer ici le 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-05-19 10:52:43 UTC (rev 2901) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialPeriodServiceImpl.java 2010-05-19 16:38:02 UTC (rev 2902) @@ -25,6 +25,7 @@ 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.LimaConfig; import org.chorem.lima.business.LimaException; @@ -36,6 +37,7 @@ import org.chorem.lima.entity.FinancialPeriod; import org.chorem.lima.entity.FinancialPeriodDAO; import org.chorem.lima.entity.FinancialPeriodImpl; +import org.chorem.lima.entity.FinancialTransaction; import org.chorem.lima.entity.FiscalPeriod; import org.chorem.lima.entity.LimaCallaoDAOHelper; import org.nuiton.topia.TopiaContext; @@ -59,6 +61,8 @@ LogFactory.getLog(FinancialPeriodServiceImpl.class); private TopiaContext rootContext; + + protected AccountingRules accountingRules; public FinancialPeriodServiceImpl() { LimaConfig config = LimaConfig.getInstance(); @@ -69,6 +73,9 @@ log.error("Can't init topia context", ex); } } + + accountingRules = config.getAccountingRules(); + accountingRules.register(FinancialPeriodService.class, this); } /** @@ -246,12 +253,18 @@ try { topiaContext = rootContext.beginTransaction(); + //check rules before create the account + accountingRules.blockClosedPeriodicEntryBookRules(closedPeriodicEntryBook, topiaContext); + ClosedPeriodicEntryBookDAO closedPeriodicEntryBookDAO = LimaCallaoDAOHelper.getClosedPeriodicEntryBookDAO(topiaContext); - closedPeriodicEntryBook.setLocked(true); - closedPeriodicEntryBookDAO.update(closedPeriodicEntryBook); + ClosedPeriodicEntryBook closedPeriodicEntryBook2 = + closedPeriodicEntryBookDAO.findByTopiaId(closedPeriodicEntryBook.getTopiaId()); + closedPeriodicEntryBook2.setLocked(true); + closedPeriodicEntryBookDAO.update(closedPeriodicEntryBook2); + //commit topiaContext.commitTransaction(); } @@ -268,7 +281,7 @@ public List<ClosedPeriodicEntryBook> getAllClosedPeriodicEntryBooksFromUnblockedFiscalPeriod() throws LimaException { List<ClosedPeriodicEntryBook> result = new ArrayList<ClosedPeriodicEntryBook>(); - + TopiaContext transaction = null; try { // basic check done, make check in database @@ -286,6 +299,11 @@ query.addOrder(ClosedPeriodicEntryBook.FINANCIAL_PERIOD); result = closedPeriodicEntryBookDAO.findAllByQuery(query); + for (ClosedPeriodicEntryBook closedPeriodicEntryBook : result) { + closedPeriodicEntryBook.getFinancialPeriod().getBeginDate(); + closedPeriodicEntryBook.getFinancialPeriod().getFiscalPeriod().getBeginDate(); + } + // commit transaction.commitTransaction(); } Modified: trunk/lima-swing/src/main/java/org/chorem/lima/LimaMain.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/LimaMain.java 2010-05-19 10:52:43 UTC (rev 2901) +++ trunk/lima-swing/src/main/java/org/chorem/lima/LimaMain.java 2010-05-19 16:38:02 UTC (rev 2902) @@ -176,6 +176,7 @@ // TODO EC-20100409 load accounts and test if there is an account plan defined // if not, call #loadDefaultAccount() splash.updateProgression(0.5, _("Loading accounting...")); + AccountService accountService = LimaServiceFactory.getInstance().getAccountService(); List<Account> account = accountService.getChildrenAccounts(null); if (CollectionUtils.isEmpty(account)) { Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainView.jaxx =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainView.jaxx 2010-05-19 10:52:43 UTC (rev 2901) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainView.jaxx 2010-05-19 16:38:02 UTC (rev 2902) @@ -116,12 +116,12 @@ </JMenu> <JMenu text="lima.structure"> - <JMenuItem text="lima.chartofaccounts.management" onActionPerformed='getHandler().showAccountView(this)' + <JMenuItem text="lima.charts.account" onActionPerformed='getHandler().showAccountView(this)' actionIcon='account'/> - <JMenuItem text="lima.chartofaccounts.journal" onActionPerformed='getHandler().showEntryBookView(this)' + <JMenuItem text="lima.charts.entrybook" onActionPerformed='getHandler().showEntryBookView(this)' actionIcon='journal'/> - <JMenuItem text="lima.fiscalyear.management" onActionPerformed='getHandler().showFiscalPeriodView(this)'/> - <JMenuItem text="lima.financialperiod.management" onActionPerformed='getHandler().showFinancialPeriodView(this)'/> + <JMenuItem text="lima.charts.fiscalyear" onActionPerformed='getHandler().showFiscalPeriodView(this)'/> + <JMenuItem text="lima.charts.financialperiod" onActionPerformed='getHandler().showFinancialPeriodView(this)'/> </JMenu> <JMenu text="lima.entries"> @@ -140,8 +140,8 @@ </JMenu> --> <JMenu text="lima.reports"> - <JMenuItem text="lima.accounts" onActionPerformed='getHandler().showAccountReports(this)'/> - <JMenuItem text="lima.entrybooks" onActionPerformed='getHandler().showEntryBookReports(this)'/> + <JMenuItem text="lima.reports.accounts" onActionPerformed='getHandler().showAccountReports(this)'/> + <JMenuItem text="lima.reports.entrybooks" onActionPerformed='getHandler().showEntryBookReports(this)'/> <JMenuItem text="lima.balance" onActionPerformed='getHandler().showBalanceView(this)'/> <JMenuItem text="lima.reports" onActionPerformed='getHandler().showReportsView(this)' actionIcon='rapport'/> <JMenuItem text="lima.bilan" onActionPerformed='getHandler().showBilanView(this)'/> Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainViewHandler.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainViewHandler.java 2010-05-19 10:52:43 UTC (rev 2901) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainViewHandler.java 2010-05-19 16:38:02 UTC (rev 2902) @@ -323,7 +323,7 @@ public void showAccountReports(JAXXContext rootContext) { MainView mainView = getUI(rootContext); AccountsReportsView accountsReportsView = new AccountsReportsView(mainView); - mainView.showTab(_("lima.accounts"), accountsReportsView); + mainView.showTab(_("lima.reports.accounts"), accountsReportsView); } /** @@ -333,7 +333,7 @@ public void showEntryBookReports(JAXXContext rootContext) { MainView mainView = getUI(rootContext); EntryBooksReportsView entryBooksReportsView= new EntryBooksReportsView(mainView); - mainView.showTab(_("lima.entrybooks"), entryBooksReportsView); + mainView.showTab(_("lima.reports.entrybooks"), entryBooksReportsView); } Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsTableModel.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsTableModel.java 2010-05-19 10:52:43 UTC (rev 2901) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsTableModel.java 2010-05-19 16:38:02 UTC (rev 2902) @@ -132,7 +132,7 @@ if(selectedAccount != null) { Entry currentRow = cacheDataList.getListEntry().get(row); SimpleDateFormat simpleDateFormat - = new SimpleDateFormat("dd MMM yyyy"); + = new SimpleDateFormat("dd MMMMM yyyy"); switch (column) { case 0: Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialperiod/FinancialPeriodViewHandler.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialperiod/FinancialPeriodViewHandler.java 2010-05-19 10:52:43 UTC (rev 2901) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialperiod/FinancialPeriodViewHandler.java 2010-05-19 16:38:02 UTC (rev 2902) @@ -66,7 +66,8 @@ if (log.isErrorEnabled()) { log.error("Can't block financialperiod", ex); } - ErrorHelper.showErrorDialog("Can't block financialperiod", ex); + JOptionPane.showMessageDialog(view, + _("Can't block financialperiod")); } } Modified: trunk/lima-swing/src/main/resources/i18n/lima-swing-en_GB.properties =================================================================== --- trunk/lima-swing/src/main/resources/i18n/lima-swing-en_GB.properties 2010-05-19 10:52:43 UTC (rev 2901) +++ trunk/lima-swing/src/main/resources/i18n/lima-swing-en_GB.properties 2010-05-19 16:38:02 UTC (rev 2902) @@ -1,5 +1,6 @@ Bloqu\u00E9e= Can't\ add\ fiscal\ period= +Can't\ block\ financialperiod= Can't\ delete\ all\ fiscal\ period= Confirmation= DEBUG\ delete\ all= @@ -58,9 +59,10 @@ lima.block=block lima.cancel=Cancel lima.charge=Expense -lima.chartofaccounts.journal= -lima.chartofaccounts.management= -lima.chartofaccounts.subledgers= +lima.charts.account=Accounts chart +lima.charts.entrybook=EntryBooks chart +lima.charts.financialperiod=Financial Periods +lima.charts.fiscalyear=Fiscal Years lima.close=Closed lima.closure=Closure lima.closure.period.begin=Period from @@ -288,6 +290,8 @@ lima.remove.lettering=Remove a letter lima.remove.transaction=Remove a transaction lima.reports=Reports +lima.reports.accounts=Edit account +lima.reports.entrybooks=Edit entrybook lima.response.no=No lima.response.yes=Yes lima.result=Result Modified: trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties =================================================================== --- trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties 2010-05-19 10:52:43 UTC (rev 2901) +++ trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties 2010-05-19 16:38:02 UTC (rev 2902) @@ -1,5 +1,6 @@ Bloqu\u00E9e= Can't\ add\ fiscal\ period= +Can't\ block\ financialperiod= Can't\ delete\ all\ fiscal\ period= Confirmation= DEBUG\ delete\ all= @@ -56,9 +57,10 @@ lima.bilan.total=Total lima.block=Bloquer lima.charge=Charge -lima.chartofaccounts.journal=Journaux -lima.chartofaccounts.management=Plan comptable -lima.chartofaccounts.subledgers=Plan tiers +lima.charts.account=Plan comptable +lima.charts.entrybook=Journaux +lima.charts.financialperiod=P\u00E9riodes comptables +lima.charts.fiscalyear=Exercices lima.close=Ferm\u00E9 lima.closure=Cloture lima.closure.period.begin=P\u00E9riode de @@ -157,7 +159,7 @@ lima.filter.not.contains=Ne contient pas lima.filter.starts.with=Commence par lima.financialperiod.block=Cloturer une p\u00E9riode -lima.financialperiod.management=P\u00E9riodes comptables +lima.financialperiod.management= lima.find.transaction=Rechercher transaction lima.fiscalperiod.addFiscalPeriod=Nouvel exercice lima.fiscalperiod.block=Cloturer un exercice @@ -166,7 +168,7 @@ lima.fiscalyear.closefiscalyear=Cl\u00F4turer l'exercice lima.fiscalyear.closeperiod=Cl\u00F4turer une p\u00E9riode lima.fiscalyear.listclosed=Voir toutes les cl\u00F4tures -lima.fiscalyear.management=Exercices +lima.fiscalyear.management= lima.grand.livre=Grand-Livre lima.home=Page d'accueil - TODO lima.identity.address=Adresse @@ -272,6 +274,8 @@ lima.remove.lettering=Supprimer la lettre lima.remove.transaction=Supprimer une transaction lima.reports=Rapports +lima.reports.accounts=Edition compte +lima.reports.entrybooks=Edition journal lima.response.no=Non lima.response.yes=Oui lima.result=Compte de r\u00E9sultat