Author: tchemit Date: 2011-09-17 14:55:34 +0200 (Sat, 17 Sep 2011) New Revision: 3290 Url: http://chorem.org/repositories/revision/lima/3290 Log: utilisation du prefixe sur les constantes g?\195?\169n?\195?\169r?\195?\169es + reformat du code Modified: trunk/lima-business/src/main/java/org/chorem/lima/LimaServer.java trunk/lima-business/src/main/java/org/chorem/lima/business/AccountingRules.java trunk/lima-business/src/main/java/org/chorem/lima/business/LimaBusinessException.java trunk/lima-business/src/main/java/org/chorem/lima/business/LimaConfig.java trunk/lima-business/src/main/java/org/chorem/lima/business/LimaException.java trunk/lima-business/src/main/java/org/chorem/lima/business/ServiceMonitorable.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/AbstractLimaService.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/DocumentServiceImpl.java trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ExportServiceImpl.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/FinancialStatementServiceImpl.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/HttpServerServiceImpl.java trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/VatStatementServiceImpl.java trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/EntryBookService.java trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialTransactionServiceLocal.java trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ReportService.java trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/VatStatementServiceLocal.java trunk/lima-business/src/main/java/org/chorem/lima/business/migration/DatabaseMigrationClass.java trunk/lima-business/src/main/java/org/chorem/lima/business/migration/MigrationV0V0_5.java trunk/lima-business/src/main/java/org/chorem/lima/business/utils/AccountComparator.java trunk/lima-business/src/main/java/org/chorem/lima/business/utils/AccountEBPComparator.java trunk/lima-business/src/main/java/org/chorem/lima/business/utils/DocumentsEnum.java trunk/lima-business/src/main/java/org/chorem/lima/business/utils/EntryComparator.java trunk/lima-business/src/main/java/org/chorem/lima/business/utils/EntryEBPComparator.java trunk/lima-business/src/main/java/org/chorem/lima/business/utils/FinancialPeriodComparator.java trunk/lima-business/src/main/java/org/chorem/lima/business/utils/FiscalPeriodComparator.java trunk/lima-business/src/main/java/org/chorem/lima/business/utils/FormatsEnum.java trunk/lima-business/src/test/java/org/chorem/lima/business/AbstractLimaTest.java trunk/lima-business/src/test/java/org/chorem/lima/business/AccountServiceImplTest.java trunk/lima-business/src/test/java/org/chorem/lima/business/EntryBookServiceImplTest.java trunk/lima-business/src/test/java/org/chorem/lima/business/FinancialPeriodServiceImplTest.java trunk/lima-business/src/test/java/org/chorem/lima/business/FiscalPeriodServiceImplTest.java trunk/lima-business/src/test/java/org/chorem/lima/business/GeneratorTest.java trunk/lima-business/src/test/java/org/chorem/lima/business/LimaTestConfig.java Modified: trunk/lima-business/src/main/java/org/chorem/lima/LimaServer.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/LimaServer.java 2011-09-17 12:55:16 UTC (rev 3289) +++ trunk/lima-business/src/main/java/org/chorem/lima/LimaServer.java 2011-09-17 12:55:34 UTC (rev 3290) @@ -23,30 +23,29 @@ package org.chorem.lima; -import java.util.Properties; +import org.apache.openejb.client.LocalInitialContextFactory; import javax.naming.Context; import javax.naming.InitialContext; import javax.naming.NamingException; +import java.util.Properties; -import org.apache.openejb.client.LocalInitialContextFactory; - /** * Lima server class. - * + * <p/> * Starts openejb server. - * + * * @author chatellier * @version $Revision$ - * - * Last update : $Date$ - * By : $Author$ + * <p/> + * Last update : $Date$ + * By : $Author$ */ public class LimaServer { /** * Lima server. - * + * * @param args * @throws NamingException */ @@ -69,7 +68,7 @@ properties.wait(); } catch (InterruptedException e) { e.printStackTrace(); - } + } } System.out.println("Server shutdown"); 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 2011-09-17 12:55:16 UTC (rev 3289) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/AccountingRules.java 2011-09-17 12:55:34 UTC (rev 3290) @@ -25,7 +25,6 @@ package org.chorem.lima.business; -import java.util.List; import org.chorem.lima.entity.Account; import org.chorem.lima.entity.ClosedPeriodicEntryBook; import org.chorem.lima.entity.Entry; @@ -35,56 +34,71 @@ import org.chorem.lima.entity.FiscalPeriod; import org.nuiton.topia.TopiaContext; +import java.util.List; + /** * Service for localized rules + * * @author joe - * */ public interface AccountingRules { - + /** * Accounts rules + * * @param masterAccount * @param account * @throws LimaException */ void createAccountRules(Account masterAccount, Account account) throws LimaException; + void createSubLedgerRules(Account masterAccount, Account account) throws LimaException; + void updateAccountRules(Account masterAccount, Account account) throws LimaException; + void updateSubLedgerRules(Account account) throws LimaException; + void removeAccountRules(Account account, TopiaContext transaction) throws LimaException; - /** + /** * Entrybook rules + * * @param entryBook * @param topiaTransaction * @throws LimaException */ void removeEntryBookRules(EntryBook entryBook, TopiaContext topiaTransaction) throws LimaException; - + /** * Fiscal Period rules + * * @param fiscalPeriod * @param transaction * @throws LimaException */ List<FinancialPeriod> createFiscalPeriodRules(FiscalPeriod fiscalPeriod, TopiaContext transaction) throws LimaException; + void blockFiscalPeriodRules(FiscalPeriod fiscalPeriod, TopiaContext transaction) throws LimaException; - + /** * Entry rules + * * @param entry * @param topiaTransaction * @throws LimaException */ - void updateEntryRules(Entry entry, Entry entryOld, TopiaContext topiaTransaction) throws LimaException; + void updateEntryRules(Entry entry, Entry entryOld, TopiaContext topiaTransaction) throws LimaException; + void updateFinancialTransactionDateRules(FinancialTransaction financialTransaction, FinancialTransaction financialTransactionOld, TopiaContext topiaContext) throws LimaException; + /** * Financialperiod/entrybook rules + * * @param financialTransaction * @param topiaContext * @throws LimaException */ void checkFinancialPeriodBlockedWithFinancialTransaction(FinancialTransaction financialTransaction, TopiaContext topiaContext) throws LimaException; + void blockClosedPeriodicEntryBookRules(ClosedPeriodicEntryBook closedPeriodicEntryBook, TopiaContext topiaContext) throws LimaException; } Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/LimaBusinessException.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/LimaBusinessException.java 2011-09-17 12:55:16 UTC (rev 3289) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/LimaBusinessException.java 2011-09-17 12:55:34 UTC (rev 3290) @@ -28,12 +28,12 @@ /** * Lima business exception throw by a business service method * that cannot execute successfully. - * + * * @author chatellier * @version $Revision$ - * - * Last update : $Date$ - * By : $Author$ + * <p/> + * Last update : $Date$ + * By : $Author$ */ public class LimaBusinessException extends LimaException { @@ -42,18 +42,18 @@ /** * Constructs a new exception with the specified detail message. - * + * * @param message message */ public LimaBusinessException(String message) { super(message); } - + /** * Constructs a new exception with the specified detail message and cause. - * + * * @param message message - * @param cause cause + * @param cause cause */ public LimaBusinessException(String message, Throwable cause) { super(message, cause); 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 2011-09-17 12:55:16 UTC (rev 3289) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/LimaConfig.java 2011-09-17 12:55:34 UTC (rev 3290) @@ -43,26 +43,26 @@ /** * Configuration pour le business. - * + * <p/> * A voir comment le lier avec celui de lima swing. - * + * * @author chatellier * @version $Revision$ - * - * Last update : $Date$ - * By : $Author$ + * <p/> + * Last update : $Date$ + * By : $Author$ */ public class LimaConfig extends ApplicationConfig { private static final Log log = LogFactory.getLog(LimaConfig.class); protected static LimaConfig instance; - + protected static final String CONFIGFILE = "lima.properties"; - + protected AccountingRules accountingRules; - - public LimaConfig(){ + + public LimaConfig() { // set defaut option (included configuration file name : important) for (Option o : Option.values()) { setDefaultOption(o.key, o.defaultValue); @@ -73,7 +73,7 @@ setOption(TopiaMigrationService.MIGRATION_SHOW_SQL, Boolean.TRUE.toString()); setOption(TopiaMigrationService.MIGRATION_SHOW_PROGRESSION, Boolean.TRUE.toString()); } - + public static LimaConfig getInstance() { if (instance == null) { instance = new LimaConfig(); @@ -81,14 +81,14 @@ } return instance; } - + /** * instancie la bonne classe de nationalite en fonction du fichier de configuration - * + * * @return */ public AccountingRules getAccountingRules() { - + if (accountingRules == null) { Class<?> accountingRulesClass = getOptionAsClass(Option.RULES_NATIONALTY.key); if (accountingRulesClass == null) { @@ -101,7 +101,7 @@ } } } - + return accountingRules; } @@ -109,38 +109,38 @@ File datadir = getOptionAsFile(Option.DATA_DIR.getKey()); return datadir; } - - public File getReportsDir(){ + + public File getReportsDir() { File reportsDir = getOptionAsFile(Option.REPORTS_DIR.getKey()); return reportsDir; } - public String getAddressServer(){ + public String getAddressServer() { String serverAddress = getOption(Option.SERVER_ADRESS.getKey()); return serverAddress; } - - public int getHttpPort(){ + + public int getHttpPort() { String httpPort = getOption(Option.HTTP_PORT.getKey()); Integer port = Integer.valueOf(httpPort); return port; } - + public String getScale() { String scale = getOption(Option.SCALE.getKey()); return scale; } - + public void setScale(String locale) { setOption(Option.SCALE.key, locale); saveForUser(); } - + public String getVatPDFUrl() { String vatPDFUrl = getOption(Option.VAT_PDF_URL.getKey()); return vatPDFUrl; } - + public void setVatPDFUrl(String url) { setOption(Option.VAT_PDF_URL.key, url); saveForUser(); @@ -148,7 +148,7 @@ /** * Load configuration with custom file name. - * + * * @param configFileName file name to read */ protected void loadConfiguration(String configFileName) { @@ -163,10 +163,10 @@ instance.setOption(TopiaContextFactory.CONFIG_PERSISTENCE_CLASSES, LimaCallaoDAOHelper.getImplementationClassesAsString()); } - + /** * Lima option definition. - * + * <p/> * Contains all lima configuration key, with defaut value and * information for jaxx configuration frame ({@link #type}, * {@link #transientBoolean}, {@link #finalBoolean}...) @@ -183,14 +183,19 @@ VAT_PDF_URL("lima.report.vatpdfurl", _("lima.config.reportvatpdfurl.description"), "default", String.class, false, false); private final String key; + private final String description; + private String defaultValue; + private final Class<?> type; + private boolean transientBoolean; + private boolean finalBoolean; Option(String key, String description, String defaultValue, - Class<?> type, boolean transientBoolean, boolean finalBoolean) { + Class<?> type, boolean transientBoolean, boolean finalBoolean) { this.key = key; this.description = description; this.defaultValue = defaultValue; @@ -203,27 +208,27 @@ public boolean isFinal() { return finalBoolean; } - + @Override - public void setFinal(boolean finalBoolean){ - this.finalBoolean=finalBoolean; + public void setFinal(boolean finalBoolean) { + this.finalBoolean = finalBoolean; } @Override public boolean isTransient() { return transientBoolean; } - + @Override public void setTransient(boolean transientBoolean) { - this.transientBoolean = transientBoolean; + this.transientBoolean = transientBoolean; } @Override public String getDefaultValue() { return defaultValue; } - + @Override public void setDefaultValue(String defaultValue) { this.defaultValue = defaultValue; @@ -244,5 +249,5 @@ return type; } } - + } Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/LimaException.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/LimaException.java 2011-09-17 12:55:16 UTC (rev 3289) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/LimaException.java 2011-09-17 12:55:34 UTC (rev 3290) @@ -27,12 +27,12 @@ /** * Lima exception. - * + * * @author chatellier * @version $Revision$ - * - * Last update : $Date$ - * By : $Author$ + * <p/> + * Last update : $Date$ + * By : $Author$ */ public class LimaException extends Exception { @@ -41,18 +41,18 @@ /** * Constructs a new exception with the specified detail message. - * + * * @param message message */ public LimaException(String message) { super(message); } - + /** * Constructs a new exception with the specified detail message and cause. - * + * * @param message message - * @param cause cause + * @param cause cause */ public LimaException(String message, Throwable cause) { super(message, cause); Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ServiceMonitorable.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ServiceMonitorable.java 2011-09-17 12:55:16 UTC (rev 3289) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ServiceMonitorable.java 2011-09-17 12:55:34 UTC (rev 3290) @@ -26,6 +26,7 @@ package org.chorem.lima.business; public interface ServiceMonitorable { - void addListener(ServiceListener l); - void removeListener(ServiceListener l); + void addServiceListener(ServiceListener l); + + void removeServiceListener(ServiceListener l); } 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 2011-09-17 12:55:16 UTC (rev 3289) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/DefaultAccountingRules.java 2011-09-17 12:55:34 UTC (rev 3290) @@ -25,11 +25,6 @@ package org.chorem.lima.business.accountingrules; -import static org.nuiton.i18n.I18n._; - -import java.util.ArrayList; -import java.util.Date; -import java.util.List; import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -52,67 +47,65 @@ import org.nuiton.topia.TopiaContext; import org.nuiton.topia.TopiaException; import org.nuiton.topia.framework.TopiaQuery; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import static org.nuiton.i18n.I18n._; + /** * Defaults rules, if no localized rules classes is instantiated * this default class contain the strict minimum rules to check the data integrity - * @author joe * + * @author joe */ public class DefaultAccountingRules implements AccountingRules { - + protected static final Log log = - LogFactory.getLog(DefaultAccountingRules.class); + LogFactory.getLog(DefaultAccountingRules.class); - /** - * Rules to check before create accounts - */ + /** Rules to check before create accounts */ @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(_("lima-business.defaultaccountingrules.invalidaccountnumber", - account.getAccountNumber())); + account.getAccountNumber())); } } - /** - * Rules to check before create subledger - */ + /** Rules to check before create subledger */ @Override public void createSubLedgerRules(Account masterAccount, Account account) throws LimaException { // check the number account is not empty if (StringUtils.isBlank(account.getAccountNumber())) { throw new LimaBusinessException(_("lima-business.defaultaccountingrules.invalidaccountnumber", - account.getAccountNumber())); + account.getAccountNumber())); } //check if parentaccount have no subaccount - if (masterAccount.getSubAccounts().size() > 0){ + if (masterAccount.getSubAccounts().size() > 0) { throw new LimaBusinessException(_("lima-business.defaultaccountingrules.subledgererror")); - } + } } - - /** - * Rules to check before create fiscals periods - */ + + /** Rules to check before create fiscals periods */ @Override public List<FinancialPeriod> createFiscalPeriodRules(FiscalPeriod fiscalPeriod, TopiaContext transaction) throws LimaException { //check if the enddate period is after the begindate period - if (fiscalPeriod.getEndDate().before(fiscalPeriod.getBeginDate())){ + if (fiscalPeriod.getEndDate().before(fiscalPeriod.getBeginDate())) { throw new LimaBusinessException(_("lima-business.defaultaccountingrules.enddateerror")); } return null; } - - - /** - * Rules to check before block fiscals periods - */ + + /** Rules to check before block fiscals periods */ @Override public void blockFiscalPeriodRules(FiscalPeriod fiscalPeriod, TopiaContext transaction) throws LimaException { - + } /** @@ -120,23 +113,20 @@ * Recursive function */ @Override - public void removeAccountRules(Account account, TopiaContext transaction) throws LimaException { - try{ + public void removeAccountRules(Account account, TopiaContext transaction) throws LimaException { + try { EntryDAO entryDAO = LimaCallaoDAOHelper.getEntryDAO(transaction); // Check if account have entries int nbentries = entryDAO.findAllByAccount(account).size(); if (nbentries != 0) { throw new LimaBusinessException(_("lima-business.defaultaccountingrules.deleteaccounterror")); } - } - catch (TopiaException ex) { + } catch (TopiaException ex) { doCatch(transaction, ex, log); } } - /** - * Check if entrybook have financial transaction - */ + /** Check if entrybook have financial transaction */ @Override public void removeEntryBookRules(EntryBook entryBook, TopiaContext topiaTransaction) throws LimaException { try { @@ -146,54 +136,52 @@ if (nbfinancialtransaction != 0) { throw new LimaBusinessException(_("lima-business.defaultaccountingrules.deleteentrybookerror")); } - } - catch (TopiaException ex) { + } catch (TopiaException ex) { doCatch(topiaTransaction, ex, log); } - + } /** - * check if financial period of a financial transaction is blocked - * check if all entrybook of his financial period are blocked + * check if financial period of a financial transaction is blocked + * check if all entrybook of his financial period are blocked */ @Override public void checkFinancialPeriodBlockedWithFinancialTransaction(FinancialTransaction financialTransaction, TopiaContext topiaContext) throws LimaException { //check financial period locked - if (financialTransaction.getFinancialPeriod().getLocked()){ + if (financialTransaction.getFinancialPeriod().getLocked()) { throw new LimaBusinessException(_("lima-business.defaultaccountingrules.financialperiodblocked")); } - + //check all entrybook of his financial period are blocked //FIXME Make this check by topia query ? List<EntryBook> entryBooks = new ArrayList<EntryBook>(); List<EntryBook> closedEntryBooks = new ArrayList<EntryBook>(); try { EntryBookDAO entryBookDAO = - LimaCallaoDAOHelper.getEntryBookDAO(topiaContext); + LimaCallaoDAOHelper.getEntryBookDAO(topiaContext); ClosedPeriodicEntryBookDAO closedPeriodicEntryBookDAO = - LimaCallaoDAOHelper.getClosedPeriodicEntryBookDAO(topiaContext); + LimaCallaoDAOHelper.getClosedPeriodicEntryBookDAO(topiaContext); FinancialPeriod financialPeriod = - financialTransaction.getFinancialPeriod(); + financialTransaction.getFinancialPeriod(); entryBooks = entryBookDAO.findAll(); - + for (EntryBook entryBook : entryBooks) { ClosedPeriodicEntryBook closedPeriodicEntryBook = - closedPeriodicEntryBookDAO.findByEntryBookAndFinancialPeriod( - entryBook, financialPeriod); - if(closedPeriodicEntryBook.getLocked()){ + closedPeriodicEntryBookDAO.findByEntryBookAndFinancialPeriod( + entryBook, financialPeriod); + if (closedPeriodicEntryBook.getLocked()) { closedEntryBooks.add(entryBook); } } - if (entryBooks.size() == closedEntryBooks.size()){ + if (entryBooks.size() == closedEntryBooks.size()) { throw new LimaBusinessException(_("lima-business.defaultaccountingrules.allentrybookclosed")); } - } - catch (TopiaException eee) { + } catch (TopiaException eee) { doCatch(topiaContext, eee, log); } } - + /** * Check if all financial transactions of closedperiodicentrybook are equilibrate * Check if all financial transactions of this closedperiodicentrybook/financialPeriod are well filled in @@ -207,21 +195,20 @@ // Check if all financial transactions of closedperiodicentrybook are equilibrate try { FinancialTransactionDAO financialTransactionDAO = - LimaCallaoDAOHelper.getFinancialTransactionDAO(topiaContext); - + LimaCallaoDAOHelper.getFinancialTransactionDAO(topiaContext); + TopiaQuery query = financialTransactionDAO.createQuery("E"); query.addWhere("E.amountCredit != E.amountDebit") - .addEquals(FinancialTransaction.ENTRY_BOOK, - closedPeriodicEntryBook.getEntryBook()) - .addEquals(FinancialTransaction.FINANCIAL_PERIOD, - closedPeriodicEntryBook.getFinancialPeriod()); + .addEquals(FinancialTransaction.PROPERTY_ENTRY_BOOK, + closedPeriodicEntryBook.getEntryBook()) + .addEquals(FinancialTransaction.PROPERTY_FINANCIAL_PERIOD, + closedPeriodicEntryBook.getFinancialPeriod()); result = financialTransactionDAO.findAllByQuery(query); - if (result.size()>0){ + if (result.size() > 0) { throw new LimaBusinessException(_("lima-business.defaultaccountingrules.blockerrorequillibrate")); } - } - catch (TopiaException ex) { + } catch (TopiaException ex) { doCatch(topiaContext, ex, log); } result = null; @@ -229,56 +216,54 @@ // Check if all financial transactions of this closedperiodicentrybook/financialPeriod are well filled in try { FinancialTransactionDAO financialTransactionDAO = - LimaCallaoDAOHelper.getFinancialTransactionDAO(topiaContext); - + LimaCallaoDAOHelper.getFinancialTransactionDAO(topiaContext); + TopiaQuery query = financialTransactionDAO.createQuery("T"); query.addDistinct() - .addOrder("T."+FinancialTransaction.TOPIA_CREATE_DATE) - .addFrom(FiscalPeriod.class, "F") - .addLeftJoin("T."+FinancialTransaction.ENTRY, "E", true) - .addWhere("T.amountCredit != T.amountDebit OR E.account = null OR E.voucher = null OR E.voucher = '' OR E.description = null OR E.description = ''") - .addEquals(FinancialTransaction.ENTRY_BOOK, - closedPeriodicEntryBook.getEntryBook()) - .addEquals(FinancialTransaction.FINANCIAL_PERIOD, - closedPeriodicEntryBook.getFinancialPeriod()); + .addOrder("T." + FinancialTransaction.TOPIA_CREATE_DATE) + .addFrom(FiscalPeriod.class, "F") + .addLeftJoin("T." + FinancialTransaction.PROPERTY_ENTRY, "E", true) + .addWhere("T.amountCredit != T.amountDebit OR E.account = null OR E.voucher = null OR E.voucher = '' OR E.description = null OR E.description = ''") + .addEquals(FinancialTransaction.PROPERTY_ENTRY_BOOK, + closedPeriodicEntryBook.getEntryBook()) + .addEquals(FinancialTransaction.PROPERTY_FINANCIAL_PERIOD, + closedPeriodicEntryBook.getFinancialPeriod()); result = financialTransactionDAO.findAllByQuery(query); - if (result.size()>0){ + if (result.size() > 0) { throw new LimaBusinessException(_("lima-business.defaultaccountingrules.missingelements")); } - } - catch (TopiaException ex) { + } catch (TopiaException ex) { doCatch(topiaContext, ex, log); } - + result = null; // Check if all financial transactions have EntryBooks try { FinancialTransactionDAO financialTransactionDAO = - LimaCallaoDAOHelper.getFinancialTransactionDAO(topiaContext); - + LimaCallaoDAOHelper.getFinancialTransactionDAO(topiaContext); + TopiaQuery query = financialTransactionDAO.createQuery("T"); query.addDistinct() - .addOrder("T."+FinancialTransaction.TOPIA_CREATE_DATE) - .addFrom(FiscalPeriod.class, "F") - .addLeftJoin("T."+FinancialTransaction.ENTRY, "E", true) - .addWhere("T.amountCredit != T.amountDebit OR E.account = null OR E.voucher = null OR E.voucher = '' OR E.description = null OR E.description = ''") - .addNull(FinancialTransaction.ENTRY_BOOK); + .addOrder("T." + FinancialTransaction.TOPIA_CREATE_DATE) + .addFrom(FiscalPeriod.class, "F") + .addLeftJoin("T." + FinancialTransaction.PROPERTY_ENTRY, "E", true) + .addWhere("T.amountCredit != T.amountDebit OR E.account = null OR E.voucher = null OR E.voucher = '' OR E.description = null OR E.description = ''") + .addNull(FinancialTransaction.PROPERTY_ENTRY_BOOK); result = financialTransactionDAO.findAllByQuery(query); - if (result.size()>0){ + if (result.size() > 0) { throw new LimaBusinessException(_("lima-business.defaultaccountingrules.missingentrybook")); } - } - catch (TopiaException ex) { + } catch (TopiaException ex) { doCatch(topiaContext, ex, log); } } /** * Rules on update entry : - * + * <p/> * Two case : * - second, the actual entry belong to a blocked closedPeriodicEntryBook * - third, the new choice entrybook belong to a blocked closedPeriodicEntryBook @@ -287,38 +272,37 @@ public void updateEntryRules(Entry entry, Entry entryOld, TopiaContext topiaTransaction) throws LimaException { try { - + FinancialPeriod financialPeriod = - entry.getFinancialTransaction().getFinancialPeriod(); - + entry.getFinancialTransaction().getFinancialPeriod(); + ClosedPeriodicEntryBookDAO closedPeriodicEntryBookDAO = - LimaCallaoDAOHelper.getClosedPeriodicEntryBookDAO(topiaTransaction); - + LimaCallaoDAOHelper.getClosedPeriodicEntryBookDAO(topiaTransaction); + //second case ClosedPeriodicEntryBook closedPeriodicEntryBook = - closedPeriodicEntryBookDAO.findByEntryBookAndFinancialPeriod( - entryOld.getFinancialTransaction().getEntryBook(), financialPeriod); - if (closedPeriodicEntryBook.getLocked()){ + closedPeriodicEntryBookDAO.findByEntryBookAndFinancialPeriod( + entryOld.getFinancialTransaction().getEntryBook(), financialPeriod); + if (closedPeriodicEntryBook.getLocked()) { throw new LimaBusinessException(_("lima-Business.defaultaccountingrules.updateentryerror")); } - + //third case ClosedPeriodicEntryBook closedPeriodicEntryBook2 = - closedPeriodicEntryBookDAO.findByEntryBookAndFinancialPeriod( - entry.getFinancialTransaction().getEntryBook(), financialPeriod); - + closedPeriodicEntryBookDAO.findByEntryBookAndFinancialPeriod( + entry.getFinancialTransaction().getEntryBook(), financialPeriod); + // Check 2 & 3 cases - if (closedPeriodicEntryBook2.getLocked()){ + if (closedPeriodicEntryBook2.getLocked()) { throw new LimaBusinessException(_("lima-Business.defaultaccountingrules.updateentryerror")); } - - } - catch (TopiaException eee) { + + } catch (TopiaException eee) { doCatch(topiaTransaction, eee, log); } } - - + + /** * Check : * 1. if old financialtransaction date are on periodblocked @@ -331,79 +315,79 @@ @Override public void updateFinancialTransactionDateRules( FinancialTransaction financialTransaction, FinancialTransaction financialTransactionOld, TopiaContext topiaContext) throws LimaException { - + FinancialPeriod financialPeriod = financialTransaction.getFinancialPeriod(); FinancialPeriod financialPeriodOld = financialTransactionOld.getFinancialPeriod(); - + //1. check old financial period locked - if (financialPeriodOld.getLocked()){ + if (financialPeriodOld.getLocked()) { throw new LimaBusinessException(_("lima-business.defaultaccountingrules.financialtransactionblocked")); } - + //2. check new financial period locked - if (financialPeriod.getLocked()){ + if (financialPeriod.getLocked()) { throw new LimaBusinessException(_("lima-business.defaultaccountingrules.financialnewdateblocked")); } - + try { - + ClosedPeriodicEntryBookDAO closedPeriodicEntryBookDAO = - LimaCallaoDAOHelper.getClosedPeriodicEntryBookDAO(topiaContext); - + LimaCallaoDAOHelper.getClosedPeriodicEntryBookDAO(topiaContext); + //3. the actual entrybook belong to a blocked closedPeriodicEntryBook ClosedPeriodicEntryBook closedPeriodicEntryBookOld = - closedPeriodicEntryBookDAO.findByEntryBookAndFinancialPeriod( - financialTransactionOld.getEntryBook(), financialPeriod); - if (closedPeriodicEntryBookOld.getLocked()){ + closedPeriodicEntryBookDAO.findByEntryBookAndFinancialPeriod( + financialTransactionOld.getEntryBook(), financialPeriod); + if (closedPeriodicEntryBookOld.getLocked()) { throw new LimaBusinessException(_("lima-Business.defaultaccountingrules.updateentryerror")); } - + //4. the new entrybook belong to a blocked closedPeriodicEntryBook ClosedPeriodicEntryBook closedPeriodicEntryBook = - closedPeriodicEntryBookDAO.findByEntryBookAndFinancialPeriod( - financialTransaction.getEntryBook(), financialPeriod); - if (closedPeriodicEntryBook.getLocked()){ + closedPeriodicEntryBookDAO.findByEntryBookAndFinancialPeriod( + financialTransaction.getEntryBook(), financialPeriod); + if (closedPeriodicEntryBook.getLocked()) { throw new LimaBusinessException(_("lima-Business.defaultaccountingrules.updatenewentryerror")); } - + //5. the actual entrybook belong to a blocked closedPeriodicEntryBook ClosedPeriodicEntryBook closedPeriodicEntryBookOld2 = - closedPeriodicEntryBookDAO.findByEntryBookAndFinancialPeriod( - financialTransactionOld.getEntryBook(), financialPeriodOld); - if (closedPeriodicEntryBookOld2.getLocked()){ + closedPeriodicEntryBookDAO.findByEntryBookAndFinancialPeriod( + financialTransactionOld.getEntryBook(), financialPeriodOld); + if (closedPeriodicEntryBookOld2.getLocked()) { throw new LimaBusinessException(_("lima-Business.defaultaccountingrules.updatefinancialtransactionperioderror")); } - + //6. the new entrybook belong to a blocked closedPeriodicEntryBook ClosedPeriodicEntryBook closedPeriodicEntryBook2 = - closedPeriodicEntryBookDAO.findByEntryBookAndFinancialPeriod( - financialTransaction.getEntryBook(), financialPeriodOld); - if (closedPeriodicEntryBook2.getLocked()){ + closedPeriodicEntryBookDAO.findByEntryBookAndFinancialPeriod( + financialTransaction.getEntryBook(), financialPeriodOld); + if (closedPeriodicEntryBook2.getLocked()) { throw new LimaBusinessException(_("lima-Business.defaultaccountingrules.updatefinancialtransactionnewperioderror")); } - - + + //7. check if date are on fiscal period FiscalPeriodDAO fiscalPeriodDAO = - LimaCallaoDAOHelper.getFiscalPeriodDAO(topiaContext); - + LimaCallaoDAOHelper.getFiscalPeriodDAO(topiaContext); + //search fiscalperiod have financialperiod in params TopiaQuery query = fiscalPeriodDAO.createQuery() - .addInElements(":financialPeriod", "financialPeriod") - .addParam("financialPeriod", financialPeriod); + .addInElements(":financialPeriod", "financialPeriod") + .addParam("financialPeriod", financialPeriod); FiscalPeriod fiscalPeriod = fiscalPeriodDAO.findByQuery(query); - + Date beginDateFiscalPeriod = fiscalPeriod.getBeginDate(); Date endDateFiscalPeriod = fiscalPeriod.getEndDate(); Date financialTransactionDate = - financialTransaction.getTransactionDate(); - if (financialTransactionDate.before(beginDateFiscalPeriod)){ + financialTransaction.getTransactionDate(); + if (financialTransactionDate.before(beginDateFiscalPeriod)) { throw new LimaBusinessException(_("lima-business.defaultaccountingrules.datebeforeerror")); } - if (financialTransactionDate.after(endDateFiscalPeriod)){ + if (financialTransactionDate.after(endDateFiscalPeriod)) { throw new LimaBusinessException(_("lima-business.defaultaccountingrules.dateaftererror")); } - + /* //6. check all entrybook of old and new financial period are blocked //FIXME Make this check by topia query ? @@ -437,20 +421,19 @@ if (newClosedEntryBooks.size() >0){ throw new LimaBusinessException("All EntryBook of old financialperiod are not open"); }*/ - - - } - catch (TopiaException eee) { + + + } catch (TopiaException eee) { doCatch(topiaContext, eee, log); } } - - - + + /** * Generic code used to rollback a transaction. - * + * <p/> * TODO : replace this by JTA + * * @throws LimaException */ protected void doCatch(TopiaContext transaction, Exception cause, Log log) throws LimaException { @@ -474,8 +457,8 @@ // Check if the numberaccount is not blank if (StringUtils.isBlank(account.getAccountNumber())) { throw new LimaBusinessException(_("lima-business.defaultaccountingrules.invalidaccountnumber", - account.getAccountNumber())); - } + account.getAccountNumber())); + } } @Override @@ -483,8 +466,8 @@ // check the number account is not empty if (StringUtils.isBlank(account.getAccountNumber())) { throw new LimaBusinessException(_("lima-business.defaultaccountingrules.invalidaccountnumber", - account.getAccountNumber())); - } + account.getAccountNumber())); + } } } 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 2011-09-17 12:55:16 UTC (rev 3289) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/FranceAccountingRules.java 2011-09-17 12:55:34 UTC (rev 3290) @@ -25,12 +25,6 @@ package org.chorem.lima.business.accountingrules; -import static org.nuiton.i18n.I18n._; - -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Date; -import java.util.List; import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.time.DateUtils; import org.apache.commons.logging.Log; @@ -51,131 +45,132 @@ import org.nuiton.topia.framework.TopiaQuery; import org.nuiton.topia.framework.TopiaQuery.Op; -public class FranceAccountingRules extends DefaultAccountingRules { +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import static org.nuiton.i18n.I18n._; + +public class FranceAccountingRules extends DefaultAccountingRules { + protected static final Log log = - LogFactory.getLog(DefaultAccountingRules.class); + LogFactory.getLog(DefaultAccountingRules.class); - /** - * Règles de vérification de la création du PCG, appliquées à la comptabilité française - * - */ + /** Règles de vérification de la création du PCG, appliquées à la comptabilité française */ public void createAccountRules(Account masterAccount, Account account) throws LimaException { - super.createAccountRules(masterAccount, account); + super.createAccountRules(masterAccount, account); - // Check if the number account is type numeric - if (!StringUtils.isNumeric(account.getAccountNumber())){ - throw new LimaBusinessException(_("lima-business.franceaccountingrules.accountnumbernotnumeric", - account.getAccountNumber())); - } - - // Check if the number account start with the number of the master account - if (masterAccount!=null && !account.getAccountNumber().startsWith( - masterAccount.getAccountNumber())){ - throw new LimaBusinessException(_("lima-business.franceaccountingrules.accountnumbernotmaster", - account.getAccountNumber())); - } - - // Check if master account have a number between 1 to 8 - if (masterAccount==null && !account.getAccountNumber().matches("[1-8]")){ - throw new LimaBusinessException(_("lima-business.franceaccountingrules.accountstartnumbererror", - account.getAccountNumber())); - } - + // Check if the number account is type numeric + if (!StringUtils.isNumeric(account.getAccountNumber())) { + throw new LimaBusinessException(_("lima-business.franceaccountingrules.accountnumbernotnumeric", + account.getAccountNumber())); + } + + // Check if the number account start with the number of the master account + if (masterAccount != null && !account.getAccountNumber().startsWith( + masterAccount.getAccountNumber())) { + throw new LimaBusinessException(_("lima-business.franceaccountingrules.accountnumbernotmaster", + account.getAccountNumber())); + } + + // Check if master account have a number between 1 to 8 + if (masterAccount == null && !account.getAccountNumber().matches("[1-8]")) { + throw new LimaBusinessException(_("lima-business.franceaccountingrules.accountstartnumbererror", + account.getAccountNumber())); + } + } public void updateAccountRules(Account masterAccount, Account account) throws LimaException { super.updateAccountRules(masterAccount, account); - + // Check if the number account is type numeric - if (!StringUtils.isNumeric(account.getAccountNumber())){ + if (!StringUtils.isNumeric(account.getAccountNumber())) { throw new LimaBusinessException(_("lima-business.franceaccountingrules.accountnumbernotnumeric", - account.getAccountNumber())); + account.getAccountNumber())); } - + // Check if the number account start with the number of the master account - if (masterAccount!=null && !account.getAccountNumber().startsWith( - masterAccount.getAccountNumber())){ + if (masterAccount != null && !account.getAccountNumber().startsWith( + masterAccount.getAccountNumber())) { throw new LimaBusinessException(_("lima-business.franceaccountingrules.accountnumbernotmaster", - account.getAccountNumber())); + account.getAccountNumber())); } - + // Check if master account have a number between 1 to 8 - if (masterAccount==null && !account.getAccountNumber().matches("[1-8]")){ + if (masterAccount == null && !account.getAccountNumber().matches("[1-8]")) { throw new LimaBusinessException(_("lima-business.franceaccountingrules.accountstartnumbererror", - account.getAccountNumber())); + account.getAccountNumber())); } } - /** - * Rules to check before create subledger - */ + /** Rules to check before create subledger */ public void createSubLedgerRules(Account masterAccount, Account account) throws LimaException { super.createSubLedgerRules(masterAccount, account); - + // check if the master account number is begin with 4 - if (!masterAccount.getAccountNumber().startsWith("4")){ + if (!masterAccount.getAccountNumber().startsWith("4")) { throw new LimaBusinessException(_("lima-business.franceaccountingrules.masteraccountnumbererror", - account.getAccountNumber())); + account.getAccountNumber())); } } - + public void updateSubLedgerRules(Account account) throws LimaException { super.updateSubLedgerRules(account); } /** * Règles de vérification d'ouverture d'un exercice, appliquées à la comptabilité française - * + * <p/> * Permet de créer un exercice. - * + * <p/> * Elle a une durée de un an, composées de 12 périodes mensuelles. * Elle peut aussi être plus courte ou plus longue si l'entreprise * se constitu ou entre en liquidation ou que l'entreprise decide * de changer - * + * <p/> * Elle correspond à l'exercice comptable. * Pas plus de deux exercices fiscaux ne peuvent-être ouvert en même temps - * */ public List<FinancialPeriod> createFiscalPeriodRules(FiscalPeriod fiscalPeriod, TopiaContext transaction) throws LimaException { super.createFiscalPeriodRules(fiscalPeriod, transaction); List<FinancialPeriod> financialPeriods = new ArrayList<FinancialPeriod>(); try { - FiscalPeriodDAO fiscalPeriodDAO = - LimaCallaoDAOHelper.getFiscalPeriodDAO(transaction); - + FiscalPeriodDAO fiscalPeriodDAO = + LimaCallaoDAOHelper.getFiscalPeriodDAO(transaction); + //Checks if is not the first fiscalperiod to create - if (fiscalPeriodDAO.findAll().size()!=0){ - + if (fiscalPeriodDAO.findAll().size() != 0) { + TopiaQuery query = fiscalPeriodDAO.createQuery(); - query.addOrderDesc(FiscalPeriod.END_DATE); + query.addOrderDesc(FiscalPeriod.PROPERTY_END_DATE); //get the last fiscal period FiscalPeriod lastFiscalPeriod = fiscalPeriodDAO.findByQuery(query); - + //check the new fiscal period adjoining the last Date dateLastFiscalPeriod = lastFiscalPeriod.getEndDate(); dateLastFiscalPeriod = DateUtils. - addDays(dateLastFiscalPeriod, 1); + addDays(dateLastFiscalPeriod, 1); dateLastFiscalPeriod = DateUtils.truncate(dateLastFiscalPeriod, Calendar.DATE); - Date dateFiscalPeriod=fiscalPeriod.getBeginDate(); - if(dateLastFiscalPeriod.compareTo(dateFiscalPeriod)!=0){ + Date dateFiscalPeriod = fiscalPeriod.getBeginDate(); + if (dateLastFiscalPeriod.compareTo(dateFiscalPeriod) != 0) { throw new LimaBusinessException(_("lima-business.franceaccountingrules.newfiscalperiodadjoiningerror")); } - + //We can create a new fiscal period meantime the last fiscal period was not locked //But not the ante periodfiscal int unblockedFiscalPeriod = - fiscalPeriodDAO.findAllByLocked(false).size(); - if (unblockedFiscalPeriod>1){ + fiscalPeriodDAO.findAllByLocked(false).size(); + if (unblockedFiscalPeriod > 1) { throw new LimaBusinessException(_("lima-business.franceaccountingrules.antefiscalperiodnotblocked")); } } - + // FinancialPeriods of 1 month are created Date endDate = fiscalPeriod.getEndDate(); Date loopDate = fiscalPeriod.getBeginDate(); - while(loopDate.before(endDate)){ + while (loopDate.before(endDate)) { FinancialPeriod financialPeriod = new FinancialPeriodImpl(); //important for fiscalperiod created from import, it can be locked, so financialperiods must be locked financialPeriod.setLocked(fiscalPeriod.getLocked()); @@ -183,10 +178,9 @@ loopDate = DateUtils.addMonths(loopDate, 1); loopDate = DateUtils.truncate(loopDate, Calendar.MONTH); loopDate = DateUtils.addMilliseconds(loopDate, -1); - if (loopDate.after(endDate)){ + if (loopDate.after(endDate)) { financialPeriod.setEndDate(endDate); - } - else { + } else { financialPeriod.setEndDate(loopDate); } //create it @@ -196,48 +190,45 @@ //loop incremente loopDate = DateUtils.addMilliseconds(loopDate, 1); } - } - catch (TopiaException ex) { + } catch (TopiaException ex) { doCatch(transaction, ex, log); } return financialPeriods; } - /** - * Règles de vérification de fermeture d'un exercice, appliquées à la comptabilité française - */ + /** Règles de vérification de fermeture d'un exercice, appliquées à la comptabilité française */ public void blockFiscalPeriodRules(FiscalPeriod fiscalPeriod, TopiaContext transaction) throws LimaException { - try{ + try { FiscalPeriodDAO fiscalPeriodDAO = - LimaCallaoDAOHelper.getFiscalPeriodDAO(transaction); - + LimaCallaoDAOHelper.getFiscalPeriodDAO(transaction); + TopiaQuery query = fiscalPeriodDAO.createQuery(); fiscalPeriodDAO.findAllByQuery(query); - query.addWhere(FiscalPeriod.LOCKED, Op.EQ, false); - query.addOrder(FiscalPeriod.END_DATE); - + query.addWhere(FiscalPeriod.PROPERTY_LOCKED, Op.EQ, false); + query.addOrder(FiscalPeriod.PROPERTY_END_DATE); + FiscalPeriod oldestUnBlockedFiscalPeriod = - fiscalPeriodDAO.findByQuery(query); + fiscalPeriodDAO.findByQuery(query); //Check if the fiscal period to block is the oldest - if (!oldestUnBlockedFiscalPeriod.equals(fiscalPeriod)){ + if (!oldestUnBlockedFiscalPeriod.equals(fiscalPeriod)) { throw new LimaBusinessException(_("lima-business.franceaccountingrules.antefiscalperiodnotblocked")); } } catch (TopiaException ex) { doCatch(transaction, ex, log); } } - - + + /** * Check if old financialperiod for a an entrybook are closed before bock the asked closedperiodicentrybook - * + * <p/> * get all closedperiodicentrybook between the first financial period of fiscalperiod * and the last financial period of the closedperiodicentrybook in param * return the number - * + * <p/> * get all blocked closedperiodicentrybook while his same period, return the number - * + * <p/> * compare there */ public void blockClosedPeriodicEntryBookRules(ClosedPeriodicEntryBook closedPeriodicEntryBook, TopiaContext topiaTransaction) throws LimaException { @@ -246,67 +237,66 @@ FinancialPeriod financialPeriod = closedPeriodicEntryBook.getFinancialPeriod(); List<ClosedPeriodicEntryBook> closedPeriodicEntryBooks = - new ArrayList<ClosedPeriodicEntryBook>(); + new ArrayList<ClosedPeriodicEntryBook>(); try { - + // Get all closedperiod between for the period and entrybook Date endDate = closedPeriodicEntryBook. - getFinancialPeriod().getBeginDate(); + getFinancialPeriod().getBeginDate(); endDate = DateUtils.addMonths(endDate, -1); - + FiscalPeriodDAO fiscalPeriodDAO = - LimaCallaoDAOHelper.getFiscalPeriodDAO(topiaTransaction); - + LimaCallaoDAOHelper.getFiscalPeriodDAO(topiaTransaction); + //search fiscalperiod have financialperiod in params TopiaQuery query1 = fiscalPeriodDAO.createQuery() - .addInElements(":financialPeriod", "financialPeriod") - .addParam("financialPeriod", financialPeriod); + .addInElements(":financialPeriod", "financialPeriod") + .addParam("financialPeriod", financialPeriod); FiscalPeriod fiscalPeriod = fiscalPeriodDAO.findByQuery(query1); Date beginDate = fiscalPeriod.getBeginDate(); - + EntryBook entryBook = closedPeriodicEntryBook.getEntryBook(); - + ClosedPeriodicEntryBookDAO closedPeriodicEntryBookDAO = - LimaCallaoDAOHelper.getClosedPeriodicEntryBookDAO(topiaTransaction); - TopiaQuery query = closedPeriodicEntryBookDAO.createQuery(); + LimaCallaoDAOHelper.getClosedPeriodicEntryBookDAO(topiaTransaction); + TopiaQuery query = closedPeriodicEntryBookDAO.createQuery(); String closedPeriodicEntryBookDateProperty = - TopiaQuery.getProperty(ClosedPeriodicEntryBook.FINANCIAL_PERIOD, - FinancialPeriod.BEGIN_DATE); + TopiaQuery.getProperty(ClosedPeriodicEntryBook.PROPERTY_FINANCIAL_PERIOD, + FinancialPeriod.PROPERTY_BEGIN_DATE); query.addWhere(closedPeriodicEntryBookDateProperty - +" BETWEEN :beginDate AND :endDate") - .addEquals(ClosedPeriodicEntryBook.ENTRY_BOOK, entryBook) - .addParam("beginDate", beginDate) - .addParam("endDate", endDate); - + + " BETWEEN :beginDate AND :endDate") + .addEquals(ClosedPeriodicEntryBook.PROPERTY_ENTRY_BOOK, entryBook) + .addParam("beginDate", beginDate) + .addParam("endDate", endDate); + closedPeriodicEntryBooks. - addAll(closedPeriodicEntryBookDAO.findAllByQuery(query)); - + addAll(closedPeriodicEntryBookDAO.findAllByQuery(query)); + int nbClosedPeriodicEntryBooks = closedPeriodicEntryBooks.size(); - + // Get all closed between for the period, entrybook and are blocked - query.addEquals(ClosedPeriodicEntryBook.LOCKED, true); + query.addEquals(ClosedPeriodicEntryBook.PROPERTY_LOCKED, true); closedPeriodicEntryBooks.clear(); closedPeriodicEntryBooks. - addAll(closedPeriodicEntryBookDAO.findAllByQuery(query)); + addAll(closedPeriodicEntryBookDAO.findAllByQuery(query)); int nbBlockedClosedPeriodicEntryBooks = - closedPeriodicEntryBooks.size(); - + closedPeriodicEntryBooks.size(); + //Check if the fiscal period to block is the oldest - if (nbClosedPeriodicEntryBooks != nbBlockedClosedPeriodicEntryBooks){ + if (nbClosedPeriodicEntryBooks != nbBlockedClosedPeriodicEntryBooks) { throw new LimaBusinessException(_("lima-business.franceaccountingrules.antefinancialperiodnotblockedentrybook")); } - - } - catch (TopiaException ex) { + + } catch (TopiaException ex) { doCatch(topiaTransaction, ex, log); } } - + /** * Generic code used to rollback a transaction. - * + * * @throws LimaException */ protected void doCatch(TopiaContext transaction, Exception cause, Log log) throws LimaException { Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AbstractLimaService.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AbstractLimaService.java 2011-09-17 12:55:16 UTC (rev 3289) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AbstractLimaService.java 2011-09-17 12:55:34 UTC (rev 3290) @@ -44,9 +44,6 @@ * * @author chatellier * @version $Revision$ - * <p/> - * Last update : $Date$ - * By : $Author$ */ public abstract class AbstractLimaService { @@ -104,7 +101,8 @@ if (log.isErrorEnabled()) { log.error("Can't close transaction", ex); } - throw new LimaException(_("lima-business.common.close.transactionerror", ex)); + throw new LimaException( + _("lima-business.common.close.transactionerror", ex)); } } } @@ -120,7 +118,8 @@ log.trace("beginTransaction" + topiaContext); return topiaContext; } catch (TopiaException e) { - throw new LimaException(_("lima-business.common.open.transactionerror", e)); + throw new LimaException( + _("lima-business.common.open.transactionerror", e)); } } @@ -131,7 +130,8 @@ if (log.isErrorEnabled()) { log.error("Error during commit context", eee); } - throw new LimaException(_("lima-business.common.commit.transactionerror", eee)); + throw new LimaException( + _("lima-business.common.commit.transactionerror", eee)); } } } 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-17 12:55:16 UTC (rev 3289) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java 2011-09-17 12:55:34 UTC (rev 3290) @@ -82,7 +82,9 @@ Account existAccount = accountDAO.findByAccountNumber(account.getAccountNumber()); if (existAccount != null) { - throw new LimaBusinessException(_("lima-business.account.accountalreardyexist", account.getAccountNumber())); + throw new LimaBusinessException( + _("lima-business.account.accountalreardyexist", + account.getAccountNumber())); } //create it @@ -90,7 +92,8 @@ Account masterAccountUpdate = null; if (masterAccount != null) { - masterAccountUpdate = accountDAO.findByAccountNumber(masterAccount.getAccountNumber()); + masterAccountUpdate = accountDAO.findByAccountNumber( + masterAccount.getAccountNumber()); } // check if parent account exist; @@ -160,7 +163,8 @@ Account masterAccountUpdate = null; if (masterAccount != null) { - masterAccountUpdate = accountDAO.findByAccountNumber(masterAccount.getAccountNumber()); + masterAccountUpdate = accountDAO.findByAccountNumber( + masterAccount.getAccountNumber()); } // check if the masteraccount exist; @@ -220,7 +224,7 @@ public Account getAccountByNumber(String number) throws LimaException { List<Account> accountsList = getAllAccountByProperty( - Account.ACCOUNT_NUMBER, number); + Account.PROPERTY_ACCOUNT_NUMBER, number); Account account = null; if (accountsList.size() > 0) { @@ -293,10 +297,12 @@ TopiaQuery query = accountDAO.createQuery(); if (masterAccount == null) { - query.addEquals("masterAccount", masterAccount); - query.addWhere("generalLedger", TopiaQuery.Op.EQ, null); + query.addEquals(Account.PROPERTY_MASTER_ACCOUNT, masterAccount); + query.addWhere(Account.PROPERTY_GENERAL_LEDGER, TopiaQuery.Op.EQ, null); } else { - query.addWhere("masterAccount = :value or generalLedger = :value") + query.addWhere(Account.PROPERTY_MASTER_ACCOUNT + + " = :value or " + + Account.PROPERTY_GENERAL_LEDGER + " = :value") .addParam("value", masterAccount); } accountsList.addAll(accountDAO.findAllByQuery(query)); Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/DocumentServiceImpl.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/DocumentServiceImpl.java 2011-09-17 12:55:16 UTC (rev 3289) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/DocumentServiceImpl.java 2011-09-17 12:55:34 UTC (rev 3290) @@ -775,11 +775,11 @@ TopiaQuery query = entryDAO.createQuery(); String financialPeriodProperty = - TopiaQuery.getProperty(Entry.FINANCIAL_TRANSACTION, - FinancialTransaction.FINANCIAL_PERIOD); + TopiaQuery.getProperty(Entry.PROPERTY_FINANCIAL_TRANSACTION, + FinancialTransaction.PROPERTY_FINANCIAL_PERIOD); String entryBookProperty = - TopiaQuery.getProperty(Entry.FINANCIAL_TRANSACTION, - FinancialTransaction.ENTRY_BOOK); + TopiaQuery.getProperty(Entry.PROPERTY_FINANCIAL_TRANSACTION, + FinancialTransaction.PROPERTY_ENTRY_BOOK); query.addWhere(financialPeriodProperty, Op.EQ, closedPeriodicEntryBook.getFinancialPeriod()) .addWhere(entryBookProperty, Op.EQ, @@ -790,8 +790,8 @@ List<Object[]> results; BigDecimal debit = new BigDecimal(0); BigDecimal credit = new BigDecimal(0); - query.setSelect(Entry.DEBIT, "SUM(" + Entry.AMOUNT + ")"); - query.addGroup(Entry.DEBIT); + query.setSelect(Entry.PROPERTY_DEBIT, "SUM(" + Entry.PROPERTY_AMOUNT + ")"); + query.addGroup(Entry.PROPERTY_DEBIT); results = query.execute(transaction); int nbAmount = results.size(); if (nbAmount == 2) { @@ -1216,8 +1216,8 @@ TopiaQuery financialPeriodsQuery = financialPeriodDAO.createQuery(); - String beginDateProperty = TopiaQuery.getProperty(FinancialPeriod.BEGIN_DATE); - String endDateProperty = TopiaQuery.getProperty(FinancialPeriod.BEGIN_DATE); + String beginDateProperty = TopiaQuery.getProperty(FinancialPeriod.PROPERTY_BEGIN_DATE); + String endDateProperty = TopiaQuery.getProperty(FinancialPeriod.PROPERTY_BEGIN_DATE); financialPeriodsQuery.addWhere(beginDateProperty, Op.GE, beginDate) .addWhere(endDateProperty, Op.LE, endDate) .addOrder(beginDateProperty); @@ -1242,17 +1242,17 @@ BigDecimal credit = new BigDecimal(0); String financialPeriodProperty = TopiaQuery.getProperty( - Entry.FINANCIAL_TRANSACTION, - FinancialTransaction.FINANCIAL_PERIOD); + Entry.PROPERTY_FINANCIAL_TRANSACTION, + FinancialTransaction.PROPERTY_FINANCIAL_PERIOD); String entryBookProperty = TopiaQuery.getProperty( - Entry.FINANCIAL_TRANSACTION, - FinancialTransaction.ENTRY_BOOK); + Entry.PROPERTY_FINANCIAL_TRANSACTION, + FinancialTransaction.PROPERTY_ENTRY_BOOK); query.addWhere(financialPeriodProperty, Op.EQ, closedPeriodicEntryBook.getFinancialPeriod()) .addWhere(entryBookProperty, Op.EQ, closedPeriodicEntryBook.getEntryBook()) - .setSelect(Entry.DEBIT, "SUM(" + Entry.AMOUNT + ")") - .addGroup(Entry.DEBIT); + .setSelect(Entry.PROPERTY_DEBIT, "SUM(" + Entry.PROPERTY_AMOUNT + ")") + .addGroup(Entry.PROPERTY_DEBIT); results = query.execute(transaction); int nbAmount = results.size(); Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ExportServiceImpl.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ExportServiceImpl.java 2011-09-17 12:55:16 UTC (rev 3289) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ExportServiceImpl.java 2011-09-17 12:55:34 UTC (rev 3290) @@ -172,7 +172,9 @@ TopiaContext topiaContext = beginTransaction(rootContext); try { - csvWriter = new CSVWriter(out, CSVWriter.DEFAULT_SEPARATOR, CSVWriter.NO_QUOTE_CHARACTER); + csvWriter = new CSVWriter(out, + CSVWriter.DEFAULT_SEPARATOR, + CSVWriter.NO_QUOTE_CHARACTER); //export accounts String[] nextLine = new String[10]; // Récupère tous les comptes 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 2011-09-17 12:55:16 UTC (rev 3289) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialPeriodServiceImpl.java 2011-09-17 12:55:34 UTC (rev 3290) @@ -138,7 +138,7 @@ getFinancialPeriodDAO(transaction); TopiaQuery query = financialPeriodDAO.createQuery() - .addOrder(FinancialPeriod.BEGIN_DATE); + .addOrder(FinancialPeriod.PROPERTY_BEGIN_DATE); result = financialPeriodDAO.findAllByQuery(query); } catch (Exception ex) { @@ -163,8 +163,8 @@ getFinancialPeriodDAO(transaction); TopiaQuery query = financialPeriodDAO.createQuery() - .addEquals(FinancialPeriod.LOCKED, Boolean.FALSE) - .addOrder(FinancialPeriod.BEGIN_DATE); + .addEquals(FinancialPeriod.PROPERTY_LOCKED, Boolean.FALSE) + .addOrder(FinancialPeriod.PROPERTY_BEGIN_DATE); result = financialPeriodDAO.findAllByQuery(query); } catch (Exception ex) { @@ -188,8 +188,8 @@ getFinancialPeriodDAO(transaction); TopiaQuery query = financialPeriodDAO.createQuery() - .addBetween(FinancialPeriod.BEGIN_DATE, beginDate, endDate) - .addOrder(FinancialPeriod.BEGIN_DATE); + .addBetween(FinancialPeriod.PROPERTY_BEGIN_DATE, beginDate, endDate) + .addOrder(FinancialPeriod.PROPERTY_BEGIN_DATE); result = financialPeriodDAO.findAllByQuery(query); } catch (Exception ex) { @@ -280,22 +280,22 @@ //Get closedperiodicentrybook from unlocked fiscalperiod TopiaQuery query = closedPeriodicEntryBookDAO.createQuery("E"); query.addFrom(FiscalPeriod.class, "F") - .addInElements("E." + ClosedPeriodicEntryBook.FINANCIAL_PERIOD, - "F." + FiscalPeriod.FINANCIAL_PERIOD) - .addEquals("F." + FiscalPeriod.LOCKED, Boolean.FALSE); + .addInElements("E." + ClosedPeriodicEntryBook.PROPERTY_FINANCIAL_PERIOD, + "F." + FiscalPeriod.PROPERTY_FINANCIAL_PERIOD) + .addEquals("F." + FiscalPeriod.PROPERTY_LOCKED, Boolean.FALSE); String orderProperty = - TopiaQuery.getProperty("E", ClosedPeriodicEntryBook.FINANCIAL_PERIOD, - FinancialPeriod.BEGIN_DATE); + TopiaQuery.getProperty("E", ClosedPeriodicEntryBook.PROPERTY_FINANCIAL_PERIOD, + FinancialPeriod.PROPERTY_BEGIN_DATE); query.addOrder(orderProperty); //IMPORTANT : LOADING ClosedPeriodicEntryBook AND IS COLUMN FOR NO LAZY EXCEPTION String loadEntryBookProperty = - TopiaQuery.getProperty(ClosedPeriodicEntryBook.ENTRY_BOOK, - EntryBook.LABEL); + TopiaQuery.getProperty(ClosedPeriodicEntryBook.PROPERTY_ENTRY_BOOK, + EntryBook.PROPERTY_LABEL); query.addLoad(loadEntryBookProperty); String loadFinancialPeriodProperty = - TopiaQuery.getProperty(ClosedPeriodicEntryBook.FINANCIAL_PERIOD, - FinancialPeriod.BEGIN_DATE); + TopiaQuery.getProperty(ClosedPeriodicEntryBook.PROPERTY_FINANCIAL_PERIOD, + FinancialPeriod.PROPERTY_BEGIN_DATE); query.addLoad(loadFinancialPeriodProperty); //call query Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialStatementServiceImpl.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialStatementServiceImpl.java 2011-09-17 12:55:16 UTC (rev 3289) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialStatementServiceImpl.java 2011-09-17 12:55:34 UTC (rev 3290) @@ -208,7 +208,7 @@ LimaCallaoDAOHelper.getFinancialStatementDAO(transaction); TopiaQuery query = financialStatementDAO.createQuery(); - query.addEquals(FinancialStatement.MASTER_FINANCIAL_STATEMENT, masterFinancialStatement) + query.addEquals(FinancialStatement.PROPERTY_MASTER_FINANCIAL_STATEMENT, masterFinancialStatement) .addOrder(FinancialStatement.TOPIA_CREATE_DATE); financialStatements = financialStatementDAO.findAllByQuery(query); } catch (Exception ex) { @@ -260,14 +260,17 @@ return result; } - /** Créé la liste de postes contenant les calculs de comptes + /** + * Créé la liste de postes contenant les calculs de comptes + * * @param financialStatement * @param selectedBeginDate * @param selectedEndDate * @param result * @param topiaContext * @return - * @throws LimaException*/ + * @throws LimaException + */ public FinancialStatementDatas financialStatementReport(FinancialStatement financialStatement, Date selectedBeginDate, Date selectedEndDate, @@ -373,13 +376,16 @@ } - /** Permet de calculer le montant de tous les comptes contenu dans un mouvement + /** + * Permet de calculer le montant de tous les comptes contenu dans un mouvement + * * @param financialStatement * @param selectedBeginDate * @param selectedEndDate * @param topiaContext * @return - * @throws LimaException*/ + * @throws LimaException + */ public FinancialStatementAmounts financialStatementAmounts(FinancialStatement financialStatement, Date selectedBeginDate, Date selectedEndDate, @@ -567,13 +573,13 @@ TopiaQuery query = financialStatementDAO.createQuery(); String accountProperty = - TopiaQuery.getProperty(FinancialStatement.ACCOUNTS); + TopiaQuery.getProperty(FinancialStatement.PROPERTY_ACCOUNTS); String creditAccountProperty = - TopiaQuery.getProperty(FinancialStatement.CREDIT_ACCOUNTS); + TopiaQuery.getProperty(FinancialStatement.PROPERTY_CREDIT_ACCOUNTS); String debitAccountProperty = - TopiaQuery.getProperty(FinancialStatement.DEBIT_ACCOUNTS); + TopiaQuery.getProperty(FinancialStatement.PROPERTY_DEBIT_ACCOUNTS); String provisionDeprecationProperty = - TopiaQuery.getProperty(FinancialStatement.PROVISION_DEPRECATION_ACCOUNTS); + TopiaQuery.getProperty(FinancialStatement.PROPERTY_PROVISION_DEPRECATION_ACCOUNTS); String likeCondition = " " + Op.LIKE + " '%" + accountNumber + "%'"; query.addWhere(accountProperty + likeCondition 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 2011-09-17 12:55:16 UTC (rev 3289) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java 2011-09-17 12:55:34 UTC (rev 3290) @@ -151,23 +151,23 @@ FinancialTransactionDAO transactionDAO = LimaCallaoDAOHelper.getFinancialTransactionDAO(topiaTransaction); - String financialPeriodProperty = TopiaQuery.getProperty(FinancialTransaction.FINANCIAL_PERIOD); - String entryBookLabelProperty = TopiaQuery.getProperty(FinancialTransaction.ENTRY_BOOK); + String financialPeriodProperty = TopiaQuery.getProperty(FinancialTransaction.PROPERTY_FINANCIAL_PERIOD); + String entryBookLabelProperty = TopiaQuery.getProperty(FinancialTransaction.PROPERTY_ENTRY_BOOK); // filter with topia query TopiaQuery query = transactionDAO.createQuery("T") - .addBetween(FinancialTransaction.TRANSACTION_DATE, beginDate, endDate) + .addBetween(FinancialTransaction.PROPERTY_TRANSACTION_DATE, beginDate, endDate) .addDistinct() - .addOrder("T." + FinancialTransaction.TRANSACTION_DATE) + .addOrder("T." + FinancialTransaction.PROPERTY_TRANSACTION_DATE) .addOrder("T." + FinancialTransaction.TOPIA_CREATE_DATE) //load for lazy .addLoad(financialPeriodProperty) .addLoad(entryBookLabelProperty) - .addLeftJoin("T." + FinancialTransaction.ENTRY, "E", true) - .addFetch("E." + Entry.ACCOUNT) - .addFetch("E." + Entry.LETTER); + .addLeftJoin("T." + FinancialTransaction.PROPERTY_ENTRY, "E", true) + .addFetch("E." + Entry.PROPERTY_ACCOUNT) + .addFetch("E." + Entry.PROPERTY_LETTER); financialTransactions = transactionDAO.findAllByQuery(query); } catch (Exception ex) { doCatch(topiaTransaction, ex); @@ -187,28 +187,28 @@ FinancialTransactionDAO transactionDAO = LimaCallaoDAOHelper.getFinancialTransactionDAO(topiaTransaction); - String financialPeriodProperty = TopiaQuery.getProperty(FinancialTransaction.FINANCIAL_PERIOD); - String entryBookLabelProperty = TopiaQuery.getProperty(FinancialTransaction.ENTRY_BOOK); + String financialPeriodProperty = TopiaQuery.getProperty(FinancialTransaction.PROPERTY_FINANCIAL_PERIOD); + String entryBookLabelProperty = TopiaQuery.getProperty(FinancialTransaction.PROPERTY_ENTRY_BOOK); // filter with topia query TopiaQuery query = transactionDAO.createQuery("T"); if (entryBook != null) { - query.addEquals(FinancialTransaction.ENTRY_BOOK, entryBook); + query.addEquals(FinancialTransaction.PROPERTY_ENTRY_BOOK, entryBook); } if (financialPeriod != null) { - query.addEquals(FinancialTransaction.FINANCIAL_PERIOD, financialPeriod); + query.addEquals(FinancialTransaction.PROPERTY_FINANCIAL_PERIOD, financialPeriod); } query.addDistinct() - .addOrder("T." + FinancialTransaction.TRANSACTION_DATE) + .addOrder("T." + FinancialTransaction.PROPERTY_TRANSACTION_DATE) .addOrder("T." + FinancialTransaction.TOPIA_CREATE_DATE) //load for lazy .addLoad(financialPeriodProperty) .addLoad(entryBookLabelProperty) - .addLeftJoin("T." + FinancialTransaction.ENTRY, "E", true) - .addFetch("E." + Entry.ACCOUNT) - .addFetch("E." + Entry.LETTER); + .addLeftJoin("T." + FinancialTransaction.PROPERTY_ENTRY, "E", true) + .addFetch("E." + Entry.PROPERTY_ACCOUNT) + .addFetch("E." + Entry.PROPERTY_LETTER); financialTransactions = transactionDAO.findAllByQuery(query); } catch (Exception ex) { doCatch(topiaTransaction, ex); @@ -230,22 +230,22 @@ FinancialTransactionDAO financialTransactionDAO = LimaCallaoDAOHelper.getFinancialTransactionDAO(topiaContext); - String financialPeriodProperty = TopiaQuery.getProperty(FinancialTransaction.FINANCIAL_PERIOD); - String entryBookLabelProperty = TopiaQuery.getProperty(FinancialTransaction.ENTRY_BOOK); + String financialPeriodProperty = TopiaQuery.getProperty(FinancialTransaction.PROPERTY_FINANCIAL_PERIOD); + String entryBookLabelProperty = TopiaQuery.getProperty(FinancialTransaction.PROPERTY_ENTRY_BOOK); TopiaQuery query = financialTransactionDAO.createQuery("T"); query.addDistinct() - .addOrder("T." + FinancialTransaction.TRANSACTION_DATE) + .addOrder("T." + FinancialTransaction.PROPERTY_TRANSACTION_DATE) .addOrder("T." + FinancialTransaction.TOPIA_CREATE_DATE) .addFrom(FiscalPeriod.class, "F") - .addLeftJoin("T." + FinancialTransaction.ENTRY, "E", true) + .addLeftJoin("T." + FinancialTransaction.PROPERTY_ENTRY, "E", true) .addWhere("T.amountCredit != T.amountDebit OR E.account = null OR T.entryBook = null OR E.voucher = null OR E.voucher = '' OR E.description = null OR E.description = ''") .addInElements("T.financialPeriod", "F.financialPeriod") .addEquals("F", fiscalPeriod) // load lazy - .addFetch("E." + Entry.ACCOUNT) - .addFetch("E." + Entry.LETTER) + .addFetch("E." + Entry.PROPERTY_ACCOUNT) + .addFetch("E." + Entry.PROPERTY_LETTER) .addLoad(financialPeriodProperty) .addLoad(entryBookLabelProperty); @@ -303,7 +303,7 @@ // WARN No load lazy, modify query with addLoad or addFetch if loading is necessary TopiaQuery query = financialTransactionDAO.createQuery("T"); query.addFrom(FiscalPeriod.class, "F") - .addLeftJoin("T." + FinancialTransaction.ENTRY, "E", false) + .addLeftJoin("T." + FinancialTransaction.PROPERTY_ENTRY, "E", false) .addWhere("T.amountCredit = T.amountDebit") .addNotNull("E.account") .addNotNull("T.entryBook") @@ -751,14 +751,14 @@ LimaCallaoDAOHelper.getFinancialTransactionDAO(topiaContext); TopiaQuery query = financialTransactionDAO.createQuery("T"); - String dateProperty = TopiaQuery.getProperty(FinancialTransaction.TRANSACTION_DATE); - String accountNumberProperty = TopiaQuery.getProperty(Entry.ACCOUNT, Account.ACCOUNT_NUMBER); + String dateProperty = TopiaQuery.getProperty(FinancialTransaction.PROPERTY_TRANSACTION_DATE); + String accountNumberProperty = TopiaQuery.getProperty(Entry.PROPERTY_ACCOUNT, Account.PROPERTY_ACCOUNT_NUMBER); query.addDistinct(); - query.addLeftJoin("T." + FinancialTransaction.ENTRY, "E", true); + query.addLeftJoin("T." + FinancialTransaction.PROPERTY_ENTRY, "E", true); //Load for lazy - query.addLoad(FinancialTransaction.ENTRY_BOOK) - .addLoad(FinancialTransaction.FINANCIAL_PERIOD); + query.addLoad(FinancialTransaction.PROPERTY_ENTRY_BOOK) + .addLoad(FinancialTransaction.PROPERTY_FINANCIAL_PERIOD); Date beginDate = financialTransactionSearch.getBeginDate(); Date endDate = financialTransactionSearch.getEndDate(); @@ -806,7 +806,7 @@ String operator = financialTransactionSearch.getOperator(); FinancialStatementWayEnum fStWayEnum = financialTransactionSearch.getAmountWayEnum(); if (entryBook != null) { - query.addEquals("T." + FinancialTransaction.ENTRY_BOOK, entryBook); + query.addEquals("T." + FinancialTransaction.PROPERTY_ENTRY_BOOK, entryBook); } if (amount != null) { if (amount2 != null) { @@ -832,9 +832,9 @@ result.add(financialTransaction); TopiaQuery query2 = entryDAO.createQuery(); - query2.addEquals(Entry.FINANCIAL_TRANSACTION, financialTransaction); + query2.addEquals(Entry.PROPERTY_FINANCIAL_TRANSACTION, financialTransaction); //Load for lazy - query2.addLoad(Entry.ACCOUNT, Entry.LETTER); + query2.addLoad(Entry.PROPERTY_ACCOUNT, Entry.PROPERTY_LETTER); List<Entry> entries = entryDAO.findAllByQuery(query2); result.addAll(entries); } 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 2011-09-17 12:55:16 UTC (rev 3289) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FiscalPeriodServiceImpl.java 2011-09-17 12:55:34 UTC (rev 3290) @@ -229,7 +229,7 @@ FiscalPeriodDAO fiscalPeriodDAO = LimaCallaoDAOHelper.getFiscalPeriodDAO(transaction); TopiaQuery query = fiscalPeriodDAO.createQuery(); - query.addOrderDesc(FiscalPeriod.END_DATE); + query.addOrderDesc(FiscalPeriod.PROPERTY_END_DATE); //get the last fiscal period result = fiscalPeriodDAO.findByQuery(query); Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/HttpServerServiceImpl.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/HttpServerServiceImpl.java 2011-09-17 12:55:16 UTC (rev 3289) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/HttpServerServiceImpl.java 2011-09-17 12:55:34 UTC (rev 3290) @@ -179,7 +179,7 @@ log.error("Can't call document service for create html document", eeeLE); } catch (ParseException eeePE) { log.error("Can't parse date", eeePE); - } + } resp.setContentType(formatsEnum.getMimeType()); InputStream in = doc.openStream(); OutputStream out = resp.getOutputStream(); 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 2011-09-17 12:55:16 UTC (rev 3289) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java 2011-09-17 12:55:34 UTC (rev 3290) @@ -180,13 +180,13 @@ TopiaQuery query = entryDAO.createQuery(queryAlias); String transactionDateProperty = TopiaQuery.getProperty( - Entry.FINANCIAL_TRANSACTION, FinancialTransaction.TRANSACTION_DATE); + Entry.PROPERTY_FINANCIAL_TRANSACTION, FinancialTransaction.PROPERTY_TRANSACTION_DATE); String amountCreditProperty = TopiaQuery.getProperty( - Entry.FINANCIAL_TRANSACTION, FinancialTransaction.AMOUNT_CREDIT); + Entry.PROPERTY_FINANCIAL_TRANSACTION, FinancialTransaction.PROPERTY_AMOUNT_CREDIT); String amountDebitProperty = TopiaQuery.getProperty( - Entry.FINANCIAL_TRANSACTION, FinancialTransaction.AMOUNT_DEBIT); + Entry.PROPERTY_FINANCIAL_TRANSACTION, FinancialTransaction.PROPERTY_AMOUNT_DEBIT); String entryBookProperty = TopiaQuery.getProperty( - Entry.FINANCIAL_TRANSACTION, FinancialTransaction.ENTRY_BOOK); + Entry.PROPERTY_FINANCIAL_TRANSACTION, FinancialTransaction.PROPERTY_ENTRY_BOOK); query .addWhere(amountCreditProperty + " = " + amountDebitProperty) @@ -194,7 +194,7 @@ .addNotNull(entryBookProperty) .addParam("beginDate", beginDate) .addParam("endDate", endDate) - .addEquals(Entry.ACCOUNT, account); + .addEquals(Entry.PROPERTY_ACCOUNT, account); return query; } @@ -228,16 +228,16 @@ createEntryQuery(account, beginDate, endDate, entryDAO, queryAlias); //IMPORTANT : LOADING ENTRIES AND IS COLUMN FOR NO LAZY EXCEPTION String loadEntryBookProperty = - TopiaQuery.getProperty(Entry.FINANCIAL_TRANSACTION, - FinancialTransaction.ENTRY_BOOK); - entriesQuery.addLoad(Entry.ACCOUNT, Entry.FINANCIAL_TRANSACTION, Entry.LETTER) + TopiaQuery.getProperty(Entry.PROPERTY_FINANCIAL_TRANSACTION, + FinancialTransaction.PROPERTY_ENTRY_BOOK); + entriesQuery.addLoad(Entry.PROPERTY_ACCOUNT, Entry.PROPERTY_FINANCIAL_TRANSACTION, Entry.PROPERTY_LETTER) .addLoad(loadEntryBookProperty); reportsDatas.setListEntry(entryDAO.findAllByQuery(entriesQuery)); TopiaQuery amountsQuery = createEntryQuery(account, beginDate, endDate, entryDAO, queryAlias); - amountsQuery.setSelect("E." + Entry.DEBIT, "SUM(E." + Entry.AMOUNT + ")"); - amountsQuery.addGroup("E." + Entry.DEBIT); + amountsQuery.setSelect("E." + Entry.PROPERTY_DEBIT, "SUM(E." + Entry.PROPERTY_AMOUNT + ")"); + amountsQuery.addGroup("E." + Entry.PROPERTY_DEBIT); results = amountsQuery.execute(topiaContext); int nbAmount = results.size(); if (nbAmount == 2) { @@ -301,18 +301,18 @@ TopiaQuery entriesQuery = createEntryQuery(account, beginDate, endDate, entryDAO, queryAlias); //IMPORTANT : LOADING ENTRIES AND IS COLUMN FOR NO LAZY EXCEPTION - entriesQuery.addLoad(Entry.FINANCIAL_TRANSACTION); + entriesQuery.addLoad(Entry.PROPERTY_FINANCIAL_TRANSACTION); String loadEntryBookProperty = - TopiaQuery.getProperty(Entry.FINANCIAL_TRANSACTION, - FinancialTransaction.ENTRY_BOOK); + TopiaQuery.getProperty(Entry.PROPERTY_FINANCIAL_TRANSACTION, + FinancialTransaction.PROPERTY_ENTRY_BOOK); entriesQuery.addLoad(loadEntryBookProperty); reportsDatas.setListEntry(entryDAO.findAllByQuery(entriesQuery)); } TopiaQuery amountsQuery = createEntryQuery(account, beginDate, endDate, entryDAO, queryAlias); - amountsQuery.setSelect("E." + Entry.DEBIT, "SUM(E." + Entry.AMOUNT + ")"); - amountsQuery.addGroup("E." + Entry.DEBIT); + amountsQuery.setSelect("E." + Entry.PROPERTY_DEBIT, "SUM(E." + Entry.PROPERTY_AMOUNT + ")"); + amountsQuery.addGroup("E." + Entry.PROPERTY_DEBIT); results = amountsQuery.execute(topiaContext); int nbAmount = results.size(); if (nbAmount == 2) { @@ -376,19 +376,19 @@ TopiaQuery entriesQuery = createEntryBookReportsQuery( entryBook, beginDate, endDate, entryDAO, "E"); //IMPORTANT : LOADING ENTRIES AND IS COLUMN FOR NO LAZY EXCEPTION - entriesQuery.addLoad(Entry.ACCOUNT, Entry.FINANCIAL_TRANSACTION, Entry.LETTER); + entriesQuery.addLoad(Entry.PROPERTY_ACCOUNT, Entry.PROPERTY_FINANCIAL_TRANSACTION, Entry.PROPERTY_LETTER); String orderDateProperty = - TopiaQuery.getProperty("E", Entry.FINANCIAL_TRANSACTION, FinancialTransaction.TRANSACTION_DATE); + TopiaQuery.getProperty("E", Entry.PROPERTY_FINANCIAL_TRANSACTION, FinancialTransaction.PROPERTY_TRANSACTION_DATE); String orderIdProperty = - TopiaQuery.getProperty("E", Entry.FINANCIAL_TRANSACTION, FinancialTransaction.TOPIA_ID); + TopiaQuery.getProperty("E", Entry.PROPERTY_FINANCIAL_TRANSACTION, FinancialTransaction.TOPIA_ID); entriesQuery.addOrder(orderDateProperty) .addOrder(orderIdProperty); reportsDatas.setListEntry(entryDAO.findAllByQuery(entriesQuery)); TopiaQuery amountsQuery = createEntryBookReportsQuery(entryBook, beginDate, endDate, entryDAO, "E"); - amountsQuery.setSelect("E." + Entry.DEBIT, "SUM(E." + Entry.AMOUNT + ")"); - amountsQuery.addGroup("E." + Entry.DEBIT); + amountsQuery.setSelect("E." + Entry.PROPERTY_DEBIT, "SUM(E." + Entry.PROPERTY_AMOUNT + ")"); + amountsQuery.addGroup("E." + Entry.PROPERTY_DEBIT); results = amountsQuery.execute(topiaTransaction); int nbAmount = results.size(); if (nbAmount == 2) { @@ -446,17 +446,17 @@ String queryAlias) throws LimaException { TopiaQuery query = entryDAO.createQuery(queryAlias); String transactionDateProperty = - TopiaQuery.getProperty(Entry.FINANCIAL_TRANSACTION, - FinancialTransaction.TRANSACTION_DATE); + TopiaQuery.getProperty(Entry.PROPERTY_FINANCIAL_TRANSACTION, + FinancialTransaction.PROPERTY_TRANSACTION_DATE); String amountCreditProperty = - TopiaQuery.getProperty(Entry.FINANCIAL_TRANSACTION, - FinancialTransaction.AMOUNT_CREDIT); + TopiaQuery.getProperty(Entry.PROPERTY_FINANCIAL_TRANSACTION, + FinancialTransaction.PROPERTY_AMOUNT_CREDIT); String amountDebitProperty = - TopiaQuery.getProperty(Entry.FINANCIAL_TRANSACTION, - FinancialTransaction.AMOUNT_DEBIT); + TopiaQuery.getProperty(Entry.PROPERTY_FINANCIAL_TRANSACTION, + FinancialTransaction.PROPERTY_AMOUNT_DEBIT); String entryBookProperty = - TopiaQuery.getProperty(Entry.FINANCIAL_TRANSACTION, - FinancialTransaction.ENTRY_BOOK); + TopiaQuery.getProperty(Entry.PROPERTY_FINANCIAL_TRANSACTION, + FinancialTransaction.PROPERTY_ENTRY_BOOK); query .addWhere(amountCreditProperty + " = " + amountDebitProperty) .addEquals(entryBookProperty, entryBook) Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/VatStatementServiceImpl.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/VatStatementServiceImpl.java 2011-09-17 12:55:16 UTC (rev 3289) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/VatStatementServiceImpl.java 2011-09-17 12:55:34 UTC (rev 3290) @@ -266,7 +266,7 @@ TopiaQuery query = vatStatementDAO.createQuery(); String labelProperty = - TopiaQuery.getProperty(VatStatement.LABEL); + TopiaQuery.getProperty(VatStatement.PROPERTY_LABEL); //not to be used causing query exception with ' character //query.addWhere(labelProperty + " " + Op.LIKE + " '%" + @@ -357,7 +357,7 @@ TopiaQuery query = vatStatementDAO.createQuery(); String labelProperty = - TopiaQuery.getProperty(VatStatement.LABEL); + TopiaQuery.getProperty(VatStatement.PROPERTY_LABEL); //not to be used causing query exception with ' character //query.addWhere(labelProperty + " " + Op.LIKE + " '%" + Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/EntryBookService.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/EntryBookService.java 2011-09-17 12:55:16 UTC (rev 3289) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/EntryBookService.java 2011-09-17 12:55:34 UTC (rev 3290) @@ -45,8 +45,10 @@ public interface EntryBookService { - /** @return all entrybook - * @throws LimaException*/ + /** + * @return all entrybook + * @throws LimaException + */ List<EntryBook> getAllEntryBooks() throws LimaException; List<EntryBook> getAllEntryByProperty(String propertyName, String value) throws LimaException; Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialTransactionServiceLocal.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialTransactionServiceLocal.java 2011-09-17 12:55:16 UTC (rev 3289) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialTransactionServiceLocal.java 2011-09-17 12:55:34 UTC (rev 3290) @@ -29,7 +29,6 @@ import org.chorem.lima.entity.Entry; import org.chorem.lima.entity.FinancialTransaction; import org.nuiton.topia.TopiaContext; -import org.nuiton.topia.TopiaException; import javax.ejb.Local; Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ReportService.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ReportService.java 2011-09-17 12:55:16 UTC (rev 3289) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ReportService.java 2011-09-17 12:55:34 UTC (rev 3290) @@ -90,8 +90,8 @@ * @param endDate * @param selectedAccounts * @param movementedFilter + * @return * @throws LimaException - * @return */ BalanceTrial generateLedger(Date beginDate, Date endDate, @@ -99,13 +99,16 @@ Boolean movementedFilter) throws LimaException; - /** Generation du rapports des comptes + /** + * Generation du rapports des comptes + * * @param account * @param thirdPartAccountsMode * @param beginDate * @param endDate + * @return * @throws LimaException - * @return*/ + */ ReportsDatas generateAccountsReports(Account account, Boolean thirdPartAccountsMode, Date beginDate, @@ -116,6 +119,7 @@ * Calculate all credit, debit and solde amounts for the balance * <p/> * Get all entries if true + * * @param account * @param beginDate * @param endDate @@ -130,20 +134,26 @@ Boolean getEntries, TopiaContext topiaContext) throws LimaException; - /** Generation du rapports des journaux + /** + * Generation du rapports des journaux + * * @param entryBook * @param beginDate * @param endDate + * @return * @throws LimaException - * @return*/ + */ ReportsDatas generateEntryBooksReports(EntryBook entryBook, Date beginDate, Date endDate) throws LimaException; - /** Generate VAT + /** + * Generate VAT + * * @param fiscalPeriod * @return - * @throws LimaException*/ + * @throws LimaException + */ List<Object> generateVat(FiscalPeriod fiscalPeriod) throws LimaException; } Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/VatStatementServiceLocal.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/VatStatementServiceLocal.java 2011-09-17 12:55:16 UTC (rev 3289) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/VatStatementServiceLocal.java 2011-09-17 12:55:34 UTC (rev 3290) @@ -40,15 +40,15 @@ VatStatement masterVatStatement, VatStatement vatStatement, TopiaContext transaction) throws LimaException; - public VatStatementAmounts vatStatementAmounts(VatStatement vatStatement, - Date selectedBeginDate, - Date selectedEndDate, - TopiaContext topiacontext) throws LimaException; + VatStatementAmounts vatStatementAmounts(VatStatement vatStatement, + Date selectedBeginDate, + Date selectedEndDate, + TopiaContext topiacontext) throws LimaException; - public VatStatementDatas vatStatementReport(VatStatement vatStatement, - Date selectedBeginDate, - Date selectedEndDate, - VatStatementDatas result, - TopiaContext topiaContext) throws LimaException; + VatStatementDatas vatStatementReport(VatStatement vatStatement, + Date selectedBeginDate, + Date selectedEndDate, + VatStatementDatas result, + TopiaContext topiaContext) throws LimaException; } Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/migration/DatabaseMigrationClass.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/migration/DatabaseMigrationClass.java 2011-09-17 12:55:16 UTC (rev 3289) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/migration/DatabaseMigrationClass.java 2011-09-17 12:55:34 UTC (rev 3290) @@ -1,73 +1,72 @@ -/* - * #%L - * Lima :: business - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2011 CodeLutin, Victor Salaun - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/gpl-3.0.html>. - * #L% - */ +/* + * #%L + * Lima :: business + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2011 CodeLutin, Victor Salaun + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ package org.chorem.lima.business.migration; -import java.util.List; - import org.chorem.lima.entity.LimaCallaoDAOHelper; import org.nuiton.topia.migration.TopiaMigrationCallbackByClass; import org.nuiton.util.Version; +import java.util.List; + public class DatabaseMigrationClass extends TopiaMigrationCallbackByClass { - protected static final Version VERSION_0_5 = new Version("0.5"); + protected static final Version VERSION_0_5 = new Version("0.5"); - public DatabaseMigrationClass() { - super(new MigrationResolver()); - } + public DatabaseMigrationClass() { + super(new MigrationResolver()); + } - protected static class MigrationResolver implements MigrationCallBackForVersionResolver { + protected static class MigrationResolver implements MigrationCallBackForVersionResolver { - @Override - public Class<? extends MigrationCallBackForVersion> getCallBack(Version version) { - Class<? extends MigrationCallBackForVersion> result = null; + @Override + public Class<? extends MigrationCallBackForVersion> getCallBack(Version version) { + Class<? extends MigrationCallBackForVersion> result = null; - if (version.equals(VERSION_0_5)) { - result = MigrationV0V0_5.class; - } - return result; - } + if (version.equals(VERSION_0_5)) { + result = MigrationV0V0_5.class; + } + return result; + } - } + } - @Override - public Version[] getAvailableVersions() { - Version[] result = new Version[] { VERSION_0_5 }; - return result; - } + @Override + public Version[] getAvailableVersions() { + Version[] result = new Version[]{VERSION_0_5}; + return result; + } - @Override - public Version getApplicationVersion() { - Version appVersion = new Version(LimaCallaoDAOHelper.getModelVersion()); - return appVersion; - } + @Override + public Version getApplicationVersion() { + Version appVersion = new Version(LimaCallaoDAOHelper.getModelVersion()); + return appVersion; + } - @Override - public boolean askUser(Version dbVersion, List<Version> versions) { - return true; - } - - } + @Override + public boolean askUser(Version dbVersion, List<Version> versions) { + return true; + } +} Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/migration/MigrationV0V0_5.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/migration/MigrationV0V0_5.java 2011-09-17 12:55:16 UTC (rev 3289) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/migration/MigrationV0V0_5.java 2011-09-17 12:55:34 UTC (rev 3290) @@ -22,27 +22,28 @@ * <http://www.gnu.org/licenses/gpl-3.0.html>. * #L% */ -package org.chorem.lima.business.migration; - -import java.util.List; - -import org.nuiton.topia.TopiaException; -import org.nuiton.topia.framework.TopiaContextImplementor; -import org.nuiton.topia.migration.TopiaMigrationCallbackByClass; -import org.nuiton.topia.migration.TopiaMigrationCallbackByClass.MigrationCallBackForVersion; -import org.nuiton.util.Version; - -public class MigrationV0V0_5 extends MigrationCallBackForVersion { - - public MigrationV0V0_5(Version version, TopiaMigrationCallbackByClass callBack) { - super(version, callBack); - // TODO Auto-generated constructor stub - } - - @Override - protected void prepareMigrationScript(TopiaContextImplementor tx, - List<String> queries, boolean showSql, boolean showProgression) - throws TopiaException { - queries.add("Alter table record alter AMOUNT clob;"); - } -} +package org.chorem.lima.business.migration; + +import org.nuiton.topia.TopiaException; +import org.nuiton.topia.framework.TopiaContextImplementor; +import org.nuiton.topia.migration.TopiaMigrationCallbackByClass; +import org.nuiton.topia.migration.TopiaMigrationCallbackByClass.MigrationCallBackForVersion; +import org.nuiton.util.Version; + +import java.util.List; + +public class MigrationV0V0_5 extends MigrationCallBackForVersion { + + public MigrationV0V0_5(Version version, TopiaMigrationCallbackByClass callBack) { + super(version, callBack); + } + + @Override + protected void prepareMigrationScript(TopiaContextImplementor tx, + List<String> queries, + boolean showSql, + boolean showProgression) + throws TopiaException { + queries.add("Alter table record alter AMOUNT clob;"); + } +} Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/utils/AccountComparator.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/utils/AccountComparator.java 2011-09-17 12:55:16 UTC (rev 3289) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/utils/AccountComparator.java 2011-09-17 12:55:34 UTC (rev 3290) @@ -25,17 +25,16 @@ package org.chorem.lima.business.utils; +import org.chorem.lima.entity.Account; + import java.io.Serializable; import java.util.Comparator; -import org.chorem.lima.entity.Account; -public class AccountComparator implements Serializable, Comparator<Account>{ +public class AccountComparator implements Serializable, Comparator<Account> { private static final long serialVersionUID = 1L; - /** - * sort by accout number in lexicographical order - */ + /** sort by accout number in lexicographical order */ @Override public int compare(Account o1, Account o2) { return o1.getAccountNumber().compareTo(o2.getAccountNumber()); Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/utils/AccountEBPComparator.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/utils/AccountEBPComparator.java 2011-09-17 12:55:16 UTC (rev 3289) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/utils/AccountEBPComparator.java 2011-09-17 12:55:34 UTC (rev 3290) @@ -25,15 +25,15 @@ package org.chorem.lima.business.utils; +import org.chorem.lima.beans.AccountEBP; + import java.io.Serializable; import java.util.Comparator; -import org.chorem.lima.beans.AccountEBP; - public class AccountEBPComparator implements Serializable, Comparator<AccountEBP> { private static final long serialVersionUID = 1L; - + @Override public int compare(AccountEBP o1, AccountEBP o2) { return o1.getNumero().compareTo(o2.getNumero()); Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/utils/DocumentsEnum.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/utils/DocumentsEnum.java 2011-09-17 12:55:16 UTC (rev 3289) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/utils/DocumentsEnum.java 2011-09-17 12:55:34 UTC (rev 3290) @@ -29,41 +29,41 @@ public enum DocumentsEnum { - - GENERAL_ENTRYBOOK(_("lima-business.document.generalentrybook"),"lima_general_entybook"), - ENTRYBOOKS(_("lima-business.document.entrybook"),"lima_entrybooks"), - BALANCE(_("lima-business.document.balance"),"lima_balance"), - LEDGER(_("lima-business.document.ledger"),"lima_ledger"), - FINANCIALSTATEMENT(_("lima-business.document.financialstatement"),"lima_financialstatements"), - VAT(_("lima-business.document.vat"),"lima_vat"); - + + GENERAL_ENTRYBOOK(_("lima-business.document.generalentrybook"), "lima_general_entybook"), + ENTRYBOOKS(_("lima-business.document.entrybook"), "lima_entrybooks"), + BALANCE(_("lima-business.document.balance"), "lima_balance"), + LEDGER(_("lima-business.document.ledger"), "lima_ledger"), + FINANCIALSTATEMENT(_("lima-business.document.financialstatement"), "lima_financialstatements"), + VAT(_("lima-business.document.vat"), "lima_vat"); + private final String fileName; - + private final String description; - + private DocumentsEnum(String description, String fileName) { this.description = description; this.fileName = fileName; } - + public String getFileName() { return fileName; } - + public String getDescription() { return description; } - - public static DocumentsEnum valueOfLink(String label){ + + public static DocumentsEnum valueOfLink(String label) { DocumentsEnum value = null; - + for (DocumentsEnum documentsEnum : DocumentsEnum.values()) { - if (label.equals(documentsEnum.fileName)){ + if (label.equals(documentsEnum.fileName)) { value = documentsEnum; break; } } return value; } - + } Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/utils/EntryComparator.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/utils/EntryComparator.java 2011-09-17 12:55:16 UTC (rev 3289) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/utils/EntryComparator.java 2011-09-17 12:55:34 UTC (rev 3290) @@ -25,11 +25,12 @@ package org.chorem.lima.business.utils; +import org.chorem.lima.entity.Entry; + import java.io.Serializable; import java.util.Comparator; -import org.chorem.lima.entity.Entry; -public class EntryComparator implements Serializable, Comparator<Entry>{ +public class EntryComparator implements Serializable, Comparator<Entry> { private static final long serialVersionUID = 1L; Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/utils/EntryEBPComparator.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/utils/EntryEBPComparator.java 2011-09-17 12:55:16 UTC (rev 3289) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/utils/EntryEBPComparator.java 2011-09-17 12:55:34 UTC (rev 3290) @@ -25,22 +25,23 @@ package org.chorem.lima.business.utils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.chorem.lima.beans.EntryEBP; + import java.io.Serializable; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Comparator; import java.util.Date; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.chorem.lima.beans.EntryEBP; -public class EntryEBPComparator implements Serializable, Comparator<EntryEBP>{ +public class EntryEBPComparator implements Serializable, Comparator<EntryEBP> { - private static final Log log = + private static final Log log = LogFactory.getLog(EntryEBPComparator.class); private static final long serialVersionUID = 1L; - + @Override public int compare(EntryEBP o1, EntryEBP o2) { int result = 0; @@ -49,17 +50,15 @@ Date date1 = sdf.parse(o1.getDatEcr()); Date date2 = sdf.parse(o2.getDatEcr()); result = date1.compareTo(date2); - if(result==0){ + if (result == 0) { result = o1.getJournal().compareTo(o2.getJournal()); } } catch (ParseException eee) { log.error("Can't parse date", eee); } - - - - return result; + + return result; } } Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/utils/FinancialPeriodComparator.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/utils/FinancialPeriodComparator.java 2011-09-17 12:55:16 UTC (rev 3289) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/utils/FinancialPeriodComparator.java 2011-09-17 12:55:34 UTC (rev 3290) @@ -1,42 +1,42 @@ -/* - * #%L - * Lima :: business - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2011 CodeLutin, Victor Salaun - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/gpl-3.0.html>. - * #L% - */ +/* + * #%L + * Lima :: business + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2011 CodeLutin, Victor Salaun + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ package org.chorem.lima.business.utils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.chorem.lima.entity.ClosedPeriodicEntryBook; + import java.io.Serializable; import java.util.Comparator; -import org.apache.commons.logging.LogFactory; -import org.chorem.lima.entity.ClosedPeriodicEntryBook; -import org.apache.commons.logging.Log; +public class FinancialPeriodComparator implements Serializable, Comparator<ClosedPeriodicEntryBook> { -public class FinancialPeriodComparator implements Serializable, Comparator<ClosedPeriodicEntryBook> { - private static final long serialVersionUID = 1L; - + private static final Log log = - LogFactory.getLog(FinancialPeriodComparator.class); + LogFactory.getLog(FinancialPeriodComparator.class); @Override public int compare(ClosedPeriodicEntryBook o1, ClosedPeriodicEntryBook o2) { Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/utils/FiscalPeriodComparator.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/utils/FiscalPeriodComparator.java 2011-09-17 12:55:16 UTC (rev 3289) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/utils/FiscalPeriodComparator.java 2011-09-17 12:55:34 UTC (rev 3290) @@ -25,17 +25,16 @@ package org.chorem.lima.business.utils; +import org.chorem.lima.entity.FiscalPeriod; + import java.io.Serializable; import java.util.Comparator; -import org.chorem.lima.entity.FiscalPeriod; -public class FiscalPeriodComparator implements Serializable, Comparator<FiscalPeriod>{ +public class FiscalPeriodComparator implements Serializable, Comparator<FiscalPeriod> { private static final long serialVersionUID = 1L; - - /** - * sort by fiscal begin date - */ + + /** sort by fiscal begin date */ @Override public int compare(FiscalPeriod o1, FiscalPeriod o2) { return o1.getBeginDate().compareTo(o2.getBeginDate()); Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/utils/FormatsEnum.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/utils/FormatsEnum.java 2011-09-17 12:55:16 UTC (rev 3289) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/utils/FormatsEnum.java 2011-09-17 12:55:34 UTC (rev 3290) @@ -27,42 +27,44 @@ public enum FormatsEnum { - HTML(".html","text/html", "Page Html"), - PDF(".pdf","application/pdf", "Document PDF"); - + HTML(".html", "text/html", "Page Html"), + PDF(".pdf", "application/pdf", "Document PDF"); + private final String extension; + private final String mimeType; + private final String description; - + private FormatsEnum(String extension, String mimeType, String description) { this.extension = extension; this.mimeType = mimeType; this.description = description; } - + public String getExtension() { return extension; } - + public String getMimeType() { return mimeType; } - - public String getDescription(){ + + public String getDescription() { return description; } - - public static FormatsEnum valueOfExtension(String extension){ + + public static FormatsEnum valueOfExtension(String extension) { FormatsEnum value = null; - + for (FormatsEnum formatsEnum : FormatsEnum.values()) { - if (extension.equals(formatsEnum.getExtension())){ + if (extension.equals(formatsEnum.getExtension())) { value = formatsEnum; break; } } return value; } - - + + } Modified: trunk/lima-business/src/test/java/org/chorem/lima/business/AbstractLimaTest.java =================================================================== --- trunk/lima-business/src/test/java/org/chorem/lima/business/AbstractLimaTest.java 2011-09-17 12:55:16 UTC (rev 3289) +++ trunk/lima-business/src/test/java/org/chorem/lima/business/AbstractLimaTest.java 2011-09-17 12:55:34 UTC (rev 3290) @@ -23,20 +23,20 @@ package org.chorem.lima.business; -import java.util.Locale; - import org.junit.BeforeClass; import org.nuiton.i18n.I18n; import org.nuiton.i18n.init.ClassPathI18nInitializer; +import java.util.Locale; + /** * Common initialization code for all lima tests. - * + * * @author chatellier * @version $Revision$ - * - * Last update : $Date$ - * By : $Author$ + * <p/> + * Last update : $Date$ + * By : $Author$ */ public abstract class AbstractLimaTest { Modified: trunk/lima-business/src/test/java/org/chorem/lima/business/AccountServiceImplTest.java =================================================================== --- trunk/lima-business/src/test/java/org/chorem/lima/business/AccountServiceImplTest.java 2011-09-17 12:55:16 UTC (rev 3289) +++ trunk/lima-business/src/test/java/org/chorem/lima/business/AccountServiceImplTest.java 2011-09-17 12:55:34 UTC (rev 3290) @@ -27,9 +27,10 @@ // tchemit-2011-08-11 This test must be redone thinks it does not respect // See http://chorem.org/issues/428 + /** * Tests pour la gestion des comptes dans le plan comptable - * + * <p/> * Vérification sur l'ajout, la modification et suppression d'un compte. * Il existe également des tests sur des actions à partir de DTO. La classe * AccountServiceImplTest possède une méthode upload qui, à partir d'un DTO, Modified: trunk/lima-business/src/test/java/org/chorem/lima/business/EntryBookServiceImplTest.java =================================================================== --- trunk/lima-business/src/test/java/org/chorem/lima/business/EntryBookServiceImplTest.java 2011-09-17 12:55:16 UTC (rev 3289) +++ trunk/lima-business/src/test/java/org/chorem/lima/business/EntryBookServiceImplTest.java 2011-09-17 12:55:34 UTC (rev 3290) @@ -120,7 +120,7 @@ */ @Test public void searchJournalWithLabelTest() throws LimaException { - List<EntryBook> result = instance.getAllEntryByProperty(EntryBook.LABEL, JOURNAL_DES_VENTES); + List<EntryBook> result = instance.getAllEntryByProperty(EntryBook.PROPERTY_LABEL, JOURNAL_DES_VENTES); Assert.assertNotNull(result); Assert.assertEquals(1, result.size()); @@ -129,7 +129,7 @@ Assert.assertEquals("Journal des ventes", entryBook.getLabel()); // On ne sait pas ici si ça existe ?! - result = instance.getAllEntryByProperty(EntryBook.LABEL, "Journal des achats"); + result = instance.getAllEntryByProperty(EntryBook.PROPERTY_LABEL, "Journal des achats"); Assert.assertNotNull(result); Assert.assertTrue(result.isEmpty()); // TODO Il faut que ca soit vide : cette entree n'existe pas (pas créée dans le test) @@ -147,7 +147,7 @@ EntryBook entryBook; List<EntryBook> entryBooksList; - entryBooksList = instance.getAllEntryByProperty(EntryBook.LABEL, JOURNAL_DES_VENTES); + entryBooksList = instance.getAllEntryByProperty(EntryBook.PROPERTY_LABEL, JOURNAL_DES_VENTES); Assert.assertNotNull(entryBooksList); Assert.assertEquals(1, entryBooksList.size()); entryBook = entryBooksList.get(0); @@ -157,7 +157,7 @@ instance.updateEntryBook(entryBook); // Recherche du journal dans la bdd - entryBooksList = instance.getAllEntryByProperty(EntryBook.LABEL, JOURNAL_DES_VENTES); + entryBooksList = instance.getAllEntryByProperty(EntryBook.PROPERTY_LABEL, JOURNAL_DES_VENTES); Assert.assertNotNull(entryBooksList); Assert.assertEquals(1, entryBooksList.size()); entryBook = entryBooksList.get(0); Modified: trunk/lima-business/src/test/java/org/chorem/lima/business/FinancialPeriodServiceImplTest.java =================================================================== --- trunk/lima-business/src/test/java/org/chorem/lima/business/FinancialPeriodServiceImplTest.java 2011-09-17 12:55:16 UTC (rev 3289) +++ trunk/lima-business/src/test/java/org/chorem/lima/business/FinancialPeriodServiceImplTest.java 2011-09-17 12:55:34 UTC (rev 3290) @@ -30,18 +30,17 @@ import org.chorem.lima.business.ejb.FinancialPeriodServiceImpl; import org.junit.AfterClass; import org.junit.Before; -import org.junit.BeforeClass; import org.junit.Test; /** * Tests pour la gestion des timespans - * + * <p/> * Fonctions : - * _ création d'un timespan - * _ bloquer un timespan - * _ débloquer un timespan - * _ rechercher un timespan - * _ rechercher une période à partir d'un timespan + * _ création d'un timespan + * _ bloquer un timespan + * _ débloquer un timespan + * _ rechercher un timespan + * _ rechercher une période à partir d'un timespan * * @author Rémi Chapelet */ @@ -54,7 +53,8 @@ /** * On nettoie la base de données - * @throws java.lang.Exception + * + * @throws Exception */ @AfterClass public static void tearDownClass() throws Exception { @@ -71,9 +71,7 @@ public FinancialPeriodServiceImplTest() { } - /** - * Permet de tester l'ajout d'un timspan - */ + /** Permet de tester l'ajout d'un timspan */ @Test public void createTimeSpanTest() { /*// debut 1 janvier 2011 Modified: trunk/lima-business/src/test/java/org/chorem/lima/business/FiscalPeriodServiceImplTest.java =================================================================== --- trunk/lima-business/src/test/java/org/chorem/lima/business/FiscalPeriodServiceImplTest.java 2011-09-17 12:55:16 UTC (rev 3289) +++ trunk/lima-business/src/test/java/org/chorem/lima/business/FiscalPeriodServiceImplTest.java 2011-09-17 12:55:34 UTC (rev 3290) @@ -25,23 +25,10 @@ package org.chorem.lima.business; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.List; - import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.chorem.lima.business.ejb.FinancialPeriodServiceImpl; import org.chorem.lima.business.ejb.FiscalPeriodServiceImpl; -import org.chorem.lima.business.ejbinterface.FiscalPeriodService; -import org.chorem.lima.entity.FinancialPeriod; -import org.chorem.lima.entity.FinancialPeriodImpl; -import org.chorem.lima.entity.FiscalPeriod; -import org.chorem.lima.entity.FiscalPeriodDAO; -import org.chorem.lima.entity.FiscalPeriodImpl; -import org.chorem.lima.entity.LimaCallaoDAOHelper; import org.junit.AfterClass; -import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; import org.nuiton.topia.TopiaContext; @@ -51,13 +38,13 @@ /** * Tests pour la gestion des périodes - * + * <p/> * Fonctions : - * _ création d'une période - * _ valider une période (si elle est correcte) - * _ bloquer une période (ATTENTION : on ne peut débloquer une période !) - * _ rechercher une période - * + * _ création d'une période + * _ valider une période (si elle est correcte) + * _ bloquer une période (ATTENTION : on ne peut débloquer une période !) + * _ rechercher une période + * * @author Rémi Chapelet */ public class FiscalPeriodServiceImplTest extends AbstractLimaTest { @@ -67,9 +54,9 @@ .getLog(FiscalPeriodServiceImplTest.class); private static FiscalPeriodServiceImpl instance; - + private TopiaContext rootContext; - + public FiscalPeriodServiceImplTest() { LimaConfig config = LimaTestConfig.getInstance(); try { @@ -88,7 +75,8 @@ /** * On nettoie la base de données - * @throws java.lang.Exception + * + * @throws Exception */ @AfterClass public static void tearDownClass() throws Exception { @@ -100,11 +88,10 @@ instance.removePeriod(periodDTO);*/ } - - + @Test public void blockFiscalPeriodTest() throws Exception { - + /*TopiaContext transaction = null; FiscalPeriod recentFiscalPeriod = new FiscalPeriodImpl(); FiscalPeriod oldestFiscalPeriod = new FiscalPeriodImpl(); @@ -169,11 +156,9 @@ Assert.assertEquals(LimaBusinessException.class, ex.getClass()); }*/ } - - - /** - * Permet de tester l'ajout d'une période. - */ + + + /** Permet de tester l'ajout d'une période. */ @Test public void createPeriodTest() { /*String result; @@ -310,7 +295,7 @@ // Nombre 12 timeSpans mensuels Assert.assertEquals(12, listTimeSpanDTO.size());*/ } - + protected TopiaContext beginTransaction() throws TopiaException { // basic check done, make check in database // TODO move it into JTA Modified: trunk/lima-business/src/test/java/org/chorem/lima/business/GeneratorTest.java =================================================================== --- trunk/lima-business/src/test/java/org/chorem/lima/business/GeneratorTest.java 2011-09-17 12:55:16 UTC (rev 3289) +++ trunk/lima-business/src/test/java/org/chorem/lima/business/GeneratorTest.java 2011-09-17 12:55:34 UTC (rev 3290) @@ -25,14 +25,6 @@ package org.chorem.lima.business; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Date; -import java.util.List; - -import javax.transaction.Transaction; - -import org.apache.activeio.journal.Journal; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.chorem.lima.business.ejb.AccountServiceImpl; @@ -42,31 +34,34 @@ import org.chorem.lima.business.ejb.FiscalPeriodServiceImpl; import org.chorem.lima.entity.Account; import org.chorem.lima.entity.AccountImpl; -import org.chorem.lima.entity.Entry; import org.chorem.lima.entity.EntryBook; import org.chorem.lima.entity.EntryBookImpl; -import org.chorem.lima.entity.EntryImpl; -import org.chorem.lima.entity.FinancialTransaction; -import org.chorem.lima.entity.FinancialTransactionImpl; import org.chorem.lima.entity.FiscalPeriod; import org.chorem.lima.entity.FiscalPeriodImpl; import org.junit.Before; import org.junit.Test; -/** - * - * @author Rémi Chapelet - */ +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.List; + +/** @author Rémi Chapelet */ public class GeneratorTest extends AbstractLimaTest { /** log. */ private static final Log log = LogFactory.getLog(FinancialTransactionServiceImpl.class); private static FinancialTransactionServiceImpl instanceTransaction; + private static FiscalPeriodServiceImpl instanceFiscalPeriod; + private static FinancialPeriodServiceImpl instanceFinancialPeriod; + private static EntryBookServiceImpl instanceJournal; + private static AccountServiceImpl instanceAccount; + private static String topiaIDTransaction; @Before @@ -77,15 +72,16 @@ instanceJournal = new EntryBookServiceImpl(); instanceAccount = new AccountServiceImpl(); } - + /** * Permet de tester l'ajout d'un timspan - * @throws LimaException + * + * @throws LimaException */ @Test - public void generate () throws LimaException { - + public void generate() throws LimaException { + // Création Journal EntryBook entryBook1 = new EntryBookImpl(); entryBook1.setLabel("Journal des ventes"); @@ -149,7 +145,7 @@ instanceAccount.createAccount(201, "Frais d'établissement", 20); instanceAccount.createAccount(207, "Fonds commercial", 20); instanceAccount.createAccount(21, "Immobilisations corporelles", 2);*/ - + Date beginDate; Date endDate; Date dateSearch; @@ -157,16 +153,16 @@ Calendar cal2 = Calendar.getInstance(); Calendar cal3 = Calendar.getInstance(); List<EntryBook> entryBooksList = new ArrayList<EntryBook>(); - + // create 5 fiscal years - for (int annee = 2009 ; annee < 2015 ; annee++) { - + for (int annee = 2009; annee < 2015; annee++) { + cal1.set(annee, 0, 1); beginDate = cal1.getTime(); - + cal2.set(annee, 11, 31); endDate = cal2.getTime(); - + FiscalPeriod fiscalPeriod = new FiscalPeriodImpl(); fiscalPeriod.setBeginDate(beginDate); fiscalPeriod.setEndDate(endDate); @@ -220,6 +216,6 @@ //instanceFiscalPeriod.blockPeriod(period); } } - - + + } Modified: trunk/lima-business/src/test/java/org/chorem/lima/business/LimaTestConfig.java =================================================================== --- trunk/lima-business/src/test/java/org/chorem/lima/business/LimaTestConfig.java 2011-09-17 12:55:16 UTC (rev 3289) +++ trunk/lima-business/src/test/java/org/chorem/lima/business/LimaTestConfig.java 2011-09-17 12:55:34 UTC (rev 3290) @@ -25,23 +25,23 @@ package org.chorem.lima.business; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.chorem.lima.entity.LimaCallaoDAOHelper; + import java.io.File; import java.io.IOException; import java.io.InputStream; import java.util.Properties; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.chorem.lima.entity.LimaCallaoDAOHelper; - /** * Application config instance used it tests. (load custom test configuration) - * + * * @author chatellier * @version $Revision$ - * - * Last update : $Date$ - * By : $Author$ + * <p/> + * Last update : $Date$ + * By : $Author$ */ public class LimaTestConfig extends LimaConfig {