Author: jpepin Date: 2010-06-17 12:03:23 +0200 (Thu, 17 Jun 2010) New Revision: 2941 Url: http://chorem.org/repositories/revision/lima/2941 Log: Modification mod?\195?\168le : transaction financi?\195?\168re qui appartient ?\195?\160 un journal et non une entr?\195?\169e (sinon journal pas forc?\195?\169ment ?\195?\169quilibr?\195?\169 donc partie double biais?\195?\169, v?\195?\169rification faite aupr?\195?\168s d'un comptable) Ajout d'une m?\195?\169thode getLevel sur financialStatementHeader afin de r?\195?\169cup?\195?\169rer la profondeur dans l'arbre. Added: trunk/lima-callao/src/main/java/org/chorem/lima/entity/FinancialStatementHeaderImpl.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportTable.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportTableCellRenderer.java Removed: trunk/lima-business/src/test/java/org/chorem/lima/business/TransactionServiceImplTest.java 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/FranceAccountingRules.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/ReportServiceImpl.java trunk/lima-business/src/main/java/org/chorem/lima/business/utils/EntryComparator.java trunk/lima-callao/src/main/xmi/accounting.properties trunk/lima-callao/src/main/xmi/accounting.zargo trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsTableModel.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialperiod/FinancialPeriodView.jaxx trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartViewHandler.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementHeaderForm.jaxx trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportTableModel.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportView.jaxx trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportViewHandler.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTableModel.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedTableModel.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerTableModel.java trunk/lima-swing/src/main/resources/i18n/lima-swing-en_GB.properties trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/DefaultAccountingRules.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/DefaultAccountingRules.java 2010-06-15 17:35:55 UTC (rev 2940) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/DefaultAccountingRules.java 2010-06-17 10:03:23 UTC (rev 2941) @@ -37,11 +37,13 @@ import org.chorem.lima.entity.EntryDAO; import org.chorem.lima.entity.FinancialPeriod; import org.chorem.lima.entity.FinancialTransaction; +import org.chorem.lima.entity.FinancialTransactionDAO; import org.chorem.lima.entity.FiscalPeriod; import org.chorem.lima.entity.FiscalPeriodDAO; import org.chorem.lima.entity.LimaCallaoDAOHelper; import org.nuiton.topia.TopiaContext; import org.nuiton.topia.TopiaException; +import org.nuiton.topia.framework.TopiaQuery; /** * Defaults rules, if no localized rules classes is instantiated * this default class contain the strict minimum rules to check the data integrity @@ -97,51 +99,7 @@ return null; } - /** - * Rules on update entry : - * - * Two case : - * - first, the entry belong to a blocked financialperiod - * - second, the actual entry belong to a blocked closedPeriodicEntryBook - * - third, the new choice entrybook belong to a blocked closedPeriodicEntryBook - */ - @Override - public void updateEntryRules(Entry entry, Entry entryOld, TopiaContext topiaTransaction) throws LimaException { - //first case - if (entry.getFinancialTransaction().getFinancialPeriod().getLocked()){ - throw new LimaBusinessException("1 - Can't update entry : The financial period is blocked"); - } - try { - - FinancialPeriod financialPeriod = - entry.getFinancialTransaction().getFinancialPeriod(); - - ClosedPeriodicEntryBookDAO closedPeriodicEntryBookDAO = - LimaCallaoDAOHelper.getClosedPeriodicEntryBookDAO(topiaTransaction); - - //second case - ClosedPeriodicEntryBook closedPeriodicEntryBook = - closedPeriodicEntryBookDAO.findbyEntryBookAndFinancialPeriod( - entryOld.getEntryBook(), financialPeriod); - if (closedPeriodicEntryBook.getLocked()){ - throw new LimaBusinessException("2 - Can't update entry : financialperiod of this entrybook is closed"); - } - - //third case - ClosedPeriodicEntryBook closedPeriodicEntryBook2 = - closedPeriodicEntryBookDAO.findbyEntryBookAndFinancialPeriod( - entry.getEntryBook(), financialPeriod); - - // Check 2 & 3 cases - if (closedPeriodicEntryBook2.getLocked()){ - throw new LimaBusinessException("3 - Can't update entry : financialperiod of this entrybook is closed"); - } - - } - catch (TopiaException eee) { - doCatch(topiaTransaction, eee, log); - } - } + /** * Rules to check before block fiscals periods @@ -170,15 +128,17 @@ } } + /** + * Check if entrybook have financial transaction + */ @Override public void removeEntryBookRules(EntryBook entryBook, TopiaContext topiaTransaction) throws LimaException { try { - EntryDAO entryDAO = LimaCallaoDAOHelper.getEntryDAO(topiaTransaction); + FinancialTransactionDAO financialTransactionDAO = LimaCallaoDAOHelper.getFinancialTransactionDAO(topiaTransaction); // Check if entrybook have entries - int nbentries = entryDAO.findAllByEntryBook(entryBook).size(); - log.debug(entryDAO.findAllByEntryBook(entryBook).size()); - if (nbentries != 0) { - throw new LimaBusinessException("Can't delete entryBook with entries"); + int nbfinancialtransaction = financialTransactionDAO.findAllByEntryBook(entryBook).size(); + if (nbfinancialtransaction != 0) { + throw new LimaBusinessException("Can't delete entryBook with financialtransaction"); } } catch (TopiaException ex) { @@ -228,37 +188,143 @@ } } + /** + * Check if all financial transactions of closedperiodicentrybook are equilibrate + */ @Override public void blockClosedPeriodicEntryBookRules(ClosedPeriodicEntryBook closedPeriodicEntryBook, TopiaContext topiaContext) throws LimaException { - // TODO Auto-generated method stub - + List<FinancialTransaction> result = null; + + try { + FinancialTransactionDAO financialTransactionDAO = + 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()); + result = financialTransactionDAO.findAllByQuery(query); + + if (result.size()>0){ + throw new LimaBusinessException("Can't block financialperiod/entrybook contain financialtransaction not equilibrate"); + } + } + catch (TopiaException ex) { + doCatch(topiaContext, ex, log); + } } /** + * Rules on update entry : + * + * Two case : + * - second, the actual entry belong to a blocked closedPeriodicEntryBook + * - third, the new choice entrybook belong to a blocked closedPeriodicEntryBook + */ + @Override + public void updateEntryRules(Entry entry, Entry entryOld, TopiaContext topiaTransaction) throws LimaException { + + try { + + FinancialPeriod financialPeriod = + entry.getFinancialTransaction().getFinancialPeriod(); + + ClosedPeriodicEntryBookDAO closedPeriodicEntryBookDAO = + LimaCallaoDAOHelper.getClosedPeriodicEntryBookDAO(topiaTransaction); + + //second case + ClosedPeriodicEntryBook closedPeriodicEntryBook = + closedPeriodicEntryBookDAO.findbyEntryBookAndFinancialPeriod( + entryOld.getFinancialTransaction().getEntryBook(), financialPeriod); + if (closedPeriodicEntryBook.getLocked()){ + throw new LimaBusinessException("2 - Can't update entry : financialperiod of this entrybook is closed"); + } + + //third case + ClosedPeriodicEntryBook closedPeriodicEntryBook2 = + closedPeriodicEntryBookDAO.findbyEntryBookAndFinancialPeriod( + entry.getFinancialTransaction().getEntryBook(), financialPeriod); + + // Check 2 & 3 cases + if (closedPeriodicEntryBook2.getLocked()){ + throw new LimaBusinessException("3 - Can't update entry : financialperiod of this entrybook is closed"); + } + + } + catch (TopiaException eee) { + doCatch(topiaTransaction, eee, log); + } + } + + + /** * Check : - * - if old financialtransaction date are on periodblocked - * - if new date are on fiscalperiod - * - new financialtransaction date are on periodunblocked - * - if all closedperiod are open + * 1. if old financialtransaction date are on periodblocked + * 2. if new financialtransaction date are on periodblocked + * 3. if the actual entrybook belong to a blocked closedPeriodicEntryBook + * 4. if the new entrybook belong to a blocked closedPeriodicEntryBook + * 5. if date are on fiscal period + * 6. if all closedperiod are open */ @Override public void updateFinancialTransactionDateRules( FinancialTransaction financialTransaction, FinancialTransaction financialTransactionOld, TopiaContext topiaContext) throws LimaException { - //check old financial period locked - if (financialTransactionOld.getFinancialPeriod().getLocked()){ + FinancialPeriod financialPeriod = financialTransaction.getFinancialPeriod(); + FinancialPeriod financialPeriodOld = financialTransactionOld.getFinancialPeriod(); + + //1. check old financial period locked + if (financialPeriodOld.getLocked()){ throw new LimaBusinessException("The financial period of this transaction is blocked"); } - //check new financial period locked - if (financialTransaction.getFinancialPeriod().getLocked()){ + //2. check new financial period locked + if (financialPeriod.getLocked()){ throw new LimaBusinessException("The financial period of the new date is blocked"); } try { - //check if date are on fiscal period + ClosedPeriodicEntryBookDAO closedPeriodicEntryBookDAO = + LimaCallaoDAOHelper.getClosedPeriodicEntryBookDAO(topiaContext); + + //3. the actual entrybook belong to a blocked closedPeriodicEntryBook + ClosedPeriodicEntryBook closedPeriodicEntryBookOld = + closedPeriodicEntryBookDAO.findbyEntryBookAndFinancialPeriod( + financialTransactionOld.getEntryBook(), financialPeriod); + if (closedPeriodicEntryBookOld.getLocked()){ + throw new LimaBusinessException("Can't update financialtransaction : financialperiod of this entrybook is closed"); + } + + //4. the new entrybook belong to a blocked closedPeriodicEntryBook + ClosedPeriodicEntryBook closedPeriodicEntryBook = + closedPeriodicEntryBookDAO.findbyEntryBookAndFinancialPeriod( + financialTransaction.getEntryBook(), financialPeriod); + if (closedPeriodicEntryBook.getLocked()){ + throw new LimaBusinessException("Can't update financialtransaction : financialperiod of new entrybook is closed"); + } + + //5. the actual entrybook belong to a blocked closedPeriodicEntryBook + ClosedPeriodicEntryBook closedPeriodicEntryBookOld2 = + closedPeriodicEntryBookDAO.findbyEntryBookAndFinancialPeriod( + financialTransactionOld.getEntryBook(), financialPeriodOld); + if (closedPeriodicEntryBookOld2.getLocked()){ + throw new LimaBusinessException("Can't update financialtransaction : the new financialperiod of this entrybook is closed"); + } + + //6. the new entrybook belong to a blocked closedPeriodicEntryBook + ClosedPeriodicEntryBook closedPeriodicEntryBook2 = + closedPeriodicEntryBookDAO.findbyEntryBookAndFinancialPeriod( + financialTransaction.getEntryBook(), financialPeriodOld); + if (closedPeriodicEntryBook2.getLocked()){ + throw new LimaBusinessException("Can't update financialtransaction : this financialperiod of new entrybook is closed"); + } + + + //7. check if date are on fiscal period FiscalPeriodDAO fiscalPeriodDAO = LimaCallaoDAOHelper.getFiscalPeriodDAO(topiaContext); FiscalPeriod fiscalPeriod = @@ -275,32 +341,27 @@ throw new LimaBusinessException("The date is after the fiscal period"); } - //check all entrybook of old and new financial period are blocked + /* + //6. check all entrybook of old and new financial period are blocked //FIXME Make this check by topia query ? List<EntryBook> entryBooks = new ArrayList<EntryBook>(); - List<EntryBook> closedEntryBooks = new ArrayList<EntryBook>(); + List<EntryBook> newClosedEntryBooks = new ArrayList<EntryBook>(); List<EntryBook> oldClosedEntryBooks = new ArrayList<EntryBook>(); EntryBookDAO entryBookDAO = LimaCallaoDAOHelper.getEntryBookDAO(topiaContext); - ClosedPeriodicEntryBookDAO closedPeriodicEntryBookDAO = - LimaCallaoDAOHelper.getClosedPeriodicEntryBookDAO(topiaContext); - FinancialPeriod financialPeriod = - financialTransaction.getFinancialPeriod(); - FinancialPeriod oldFinancialPeriod = - financialTransactionOld.getFinancialPeriod(); entryBooks = entryBookDAO.findAll(); for (EntryBook entryBook : entryBooks) { - ClosedPeriodicEntryBook closedPeriodicEntryBook = + ClosedPeriodicEntryBook newClosedPeriodicEntryBook = closedPeriodicEntryBookDAO.findbyEntryBookAndFinancialPeriod( entryBook, financialPeriod); ClosedPeriodicEntryBook oldClosedPeriodicEntryBook = closedPeriodicEntryBookDAO.findbyEntryBookAndFinancialPeriod( - entryBook, oldFinancialPeriod); - if(closedPeriodicEntryBook.getLocked()){ - closedEntryBooks.add(entryBook); + entryBook, financialPeriodOld); + if(newClosedPeriodicEntryBook.getLocked()){ + newClosedEntryBooks.add(entryBook); } if(oldClosedPeriodicEntryBook.getLocked()){ oldClosedEntryBooks.add(entryBook); @@ -310,9 +371,9 @@ if (oldClosedEntryBooks.size() >0){ throw new LimaBusinessException("All EntryBook of this financialperiod are not open"); } - if (closedEntryBooks.size() >0){ + if (newClosedEntryBooks.size() >0){ throw new LimaBusinessException("All EntryBook of old financialperiod are not open"); - } + }*/ } Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/FranceAccountingRules.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/FranceAccountingRules.java 2010-06-15 17:35:55 UTC (rev 2940) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/FranceAccountingRules.java 2010-06-17 10:03:23 UTC (rev 2941) @@ -175,7 +175,7 @@ * 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); @@ -209,20 +209,28 @@ * * compare there */ - public void blockClosedPeriodicEntryBookRules(ClosedPeriodicEntryBook closedPeriodicEntryBook, TopiaContext topiaTransaction) - throws LimaException { + public void blockClosedPeriodicEntryBookRules(ClosedPeriodicEntryBook closedPeriodicEntryBook, TopiaContext topiaTransaction) throws LimaException { + super.blockClosedPeriodicEntryBookRules( + closedPeriodicEntryBook, topiaTransaction); + closedPeriodicEntryBook.getFinancialPeriod(); - List<ClosedPeriodicEntryBook> closedPeriodicEntryBooks = new ArrayList<ClosedPeriodicEntryBook>(); + List<ClosedPeriodicEntryBook> closedPeriodicEntryBooks = + new ArrayList<ClosedPeriodicEntryBook>(); try { + log.debug("france check"); + // Get all closedperiod between for the period and entrybook Date endDate = closedPeriodicEntryBook. getFinancialPeriod().getBeginDate(); endDate = DateUtils.addMonths(endDate, -1); - FiscalPeriodDAO fiscalPeriodDAO = LimaCallaoDAOHelper.getFiscalPeriodDAO(topiaTransaction); - FiscalPeriod fiscalPeriod = fiscalPeriodDAO.findContainsFinancialPeriod(closedPeriodicEntryBook.getFinancialPeriod()); + FiscalPeriodDAO fiscalPeriodDAO = + LimaCallaoDAOHelper.getFiscalPeriodDAO(topiaTransaction); + FiscalPeriod fiscalPeriod = + fiscalPeriodDAO.findContainsFinancialPeriod( + closedPeriodicEntryBook.getFinancialPeriod()); Date beginDate = fiscalPeriod.getBeginDate(); EntryBook entryBook = closedPeriodicEntryBook.getEntryBook(); @@ -233,9 +241,9 @@ String closedPeriodicEntryBookDateProperty = TopiaQuery.getProperty(ClosedPeriodicEntryBook.FINANCIAL_PERIOD, FinancialPeriod.BEGIN_DATE); - query.add(closedPeriodicEntryBookDateProperty + query.addWhere(closedPeriodicEntryBookDateProperty +" BETWEEN :beginDate AND :endDate") - .add(ClosedPeriodicEntryBook.ENTRY_BOOK, entryBook) + .addEquals(ClosedPeriodicEntryBook.ENTRY_BOOK, entryBook) .addParam("beginDate", beginDate) .addParam("endDate", endDate); @@ -245,7 +253,7 @@ int nbClosedPeriodicEntryBooks = closedPeriodicEntryBooks.size(); // Get all closed between for the period, entrybook and are blocked - query.add(ClosedPeriodicEntryBook.LOCKED, true); + query.addEquals(ClosedPeriodicEntryBook.LOCKED, true); closedPeriodicEntryBooks.clear(); closedPeriodicEntryBooks. addAll(closedPeriodicEntryBookDAO.findAllByQuery(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 2010-06-15 17:35:55 UTC (rev 2940) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialStatementServiceImpl.java 2010-06-17 10:03:23 UTC (rev 2941) @@ -236,7 +236,8 @@ getAllChildrenFinancialStatement((FinancialStatementHeader) child, objects); } } - return objects; } + return objects; + } @Override public List<Object> getChildrenFinancialStatement(FinancialStatementHeader masterFinancialStatementHeader) throws LimaException { Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java 2010-06-15 17:35:55 UTC (rev 2940) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java 2010-06-17 10:03:23 UTC (rev 2941) @@ -146,9 +146,9 @@ //IMPORTANT : LOADING ENTRIES AND IS COLUMN FOR NO LAZY EXCEPTION for (FinancialTransaction financialTransaction : financialTransactions) { + financialTransaction.getEntryBook(); for (Entry entry : financialTransaction.getEntry()) { - entry.getEntryBook(); entry.getAccount(); entry.getFinancialTransaction(); entry.getFinancialTransaction().getFinancialPeriod(); @@ -196,9 +196,9 @@ for (FinancialTransaction financialTransaction : result) { for (Entry entry : financialTransaction.getEntry()) { - entry.getEntryBook(); entry.getAccount(); entry.getFinancialTransaction(); + entry.getFinancialTransaction().getEntryBook(); entry.getFinancialTransaction().getFinancialPeriod(); } } @@ -264,14 +264,16 @@ if (financialPeriod != null){ financialTransactionOld.setFinancialPeriod(financialPeriod); } - accountingRules.updateFinancialTransactionDateRules( - financialtransaction, financialTransactionOld, topiaContext); } + accountingRules.updateFinancialTransactionDateRules( + financialtransaction, financialTransactionOld, topiaContext); financialTransactionOld.setAmountDebit( financialtransaction.getAmountDebit()); financialTransactionOld.setAmountCredit( financialtransaction.getAmountCredit()); + financialTransactionOld.setEntryBook( + financialtransaction.getEntryBook()); transactionDAO.update(financialTransactionOld); } catch (TopiaException ex) { @@ -380,7 +382,6 @@ entryOld.setAmount(entryAmount); entryOld.setDebit(entryAmountBool); entryOld.setDescription(entry.getDescription()); - entryOld.setEntryBook(entry.getEntryBook()); entryOld.setFinancialTransaction(entry.getFinancialTransaction()); entryOld.setVoucher(entry.getVoucher()); entryOld.setPosition(entry.getPosition()); Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java 2010-06-15 17:35:55 UTC (rev 2940) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java 2010-06-17 10:03:23 UTC (rev 2941) @@ -179,7 +179,11 @@ TopiaQuery entriesQuery = createEntryQuery(account, beginDate, endDate, entryDAO, queryAlias); //IMPORTANT : LOADING ENTRIES AND IS COLUMN FOR NO LAZY EXCEPTION - entriesQuery.addLoad(Entry.ENTRY_BOOK, Entry.FINANCIAL_TRANSACTION); + entriesQuery.addLoad(Entry.FINANCIAL_TRANSACTION); + String loadEntryBookProperty = + TopiaQuery.getProperty(Entry.FINANCIAL_TRANSACTION, + FinancialTransaction.ENTRY_BOOK); + entriesQuery.addLoad(loadEntryBookProperty); reportsDatas.setListEntry(entryDAO.findAllByQuery(entriesQuery)); TopiaQuery amountsQuery = @@ -241,7 +245,11 @@ TopiaQuery entriesQuery = createEntryQuery(account, beginDate, endDate, entryDAO, queryAlias); //IMPORTANT : LOADING ENTRIES AND IS COLUMN FOR NO LAZY EXCEPTION - entriesQuery.addLoad(Entry.ENTRY_BOOK, Entry.FINANCIAL_TRANSACTION); + entriesQuery.addLoad(Entry.FINANCIAL_TRANSACTION); + String loadEntryBookProperty = + TopiaQuery.getProperty(Entry.FINANCIAL_TRANSACTION, + FinancialTransaction.ENTRY_BOOK); + entriesQuery.addLoad(loadEntryBookProperty); reportsDatas.setListEntry(entryDAO.findAllByQuery(entriesQuery)); } @@ -381,9 +389,13 @@ String amountDebitProperty = TopiaQuery.getProperty(Entry.FINANCIAL_TRANSACTION, FinancialTransaction.AMOUNT_DEBIT); + String entryBookProperty = + TopiaQuery.getProperty(Entry.FINANCIAL_TRANSACTION, + FinancialTransaction.ENTRY_BOOK); query .addWhere(amountCreditProperty+" = "+amountDebitProperty) - .addEquals(Entry.ENTRY_BOOK, entryBook) + //TODO check this + .addEquals(entryBookProperty, entryBook) .addWhere(transactionDateProperty+" BETWEEN :beginDate AND :endDate") .addParam("beginDate", beginDate) .addParam("endDate", endDate); 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 2010-06-15 17:35:55 UTC (rev 2940) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/utils/EntryComparator.java 2010-06-17 10:03:23 UTC (rev 2941) @@ -19,7 +19,6 @@ package org.chorem.lima.business.utils; import java.util.Comparator; - import org.chorem.lima.entity.Entry; public class EntryComparator implements Comparator<Entry>{ Deleted: trunk/lima-business/src/test/java/org/chorem/lima/business/TransactionServiceImplTest.java =================================================================== --- trunk/lima-business/src/test/java/org/chorem/lima/business/TransactionServiceImplTest.java 2010-06-15 17:35:55 UTC (rev 2940) +++ trunk/lima-business/src/test/java/org/chorem/lima/business/TransactionServiceImplTest.java 2010-06-17 10:03:23 UTC (rev 2941) @@ -1,619 +0,0 @@ -package org.chorem.lima.business; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Test; - -/** - * Tests pour la gestion des transactions - * - * Cette classe de test est principale au bon fonctionnement de l'application. - * Elle centralise au maximum l'ensemble des règles de la couche métier. En effet - * elle possède le plus de liens avec les autres classes. - * A partir de la classe de test, nous allons créer plusieurs transactions pour - * vérifier le bon fonctionnement des classes réunies ensemble. - * - * @author Rémi Chapelet - */ -public class TransactionServiceImplTest { - - /** log. */ - private static final Log log = LogFactory - .getLog(TransactionServiceImplTest.class); - - @BeforeClass - public static void setUpClass() throws Exception { - LimaConfigTest.getInstance(); - } - - /** - * On nettoie la base de données - * @throws java.lang.Exception - */ - @AfterClass - public static void tearDownClass() throws Exception { - /*LogServiceImpl serviceLog = new LogServiceImpl(); - // Supprime Log - List<LogDTO> listLog = serviceLog.listeAllLogDTO(); - for (LogDTO logDTO : listLog) - { - serviceLog.removeLog(logDTO); - }*/ - - } - - /** - * Permet de tester l'ajout d'un timspan - */ - @Test - public void createTransactionTest() { - /*log.info("BEGIN createTransactionTest()"); - - PeriodServiceImpl servicePeriod = new PeriodServiceImpl(); - TransactionServiceImpl serviceTransaction = new TransactionServiceImpl(); - JournalServiceImpl serviceJournal = new JournalServiceImpl(); - - // Creation Period & TimeSpan (default period 01/01/2010 -> 31/12/2010) - TimeSpan timespan = createPeriod(servicePeriod); - - // Creation Journal - Journal journal = createJournal(serviceJournal,"Journal transaction", "jt","description"); - - // Test creationTransaction avec Journal et TimeSpan - String transactionId = createTransaction(serviceTransaction, "Facture 6", "description transaction", timespan, journal); - - // NETTOYAGE TEST - removeTransaction(serviceTransaction, transactionId); - removeJournals(serviceJournal); - removePeriod(servicePeriod); - // FIN NETTOYAGE TEST - */ - } - - /** - * Recherche des transactions. - */ - @Test - public void searchTransactionTest() { - /*log.info("BEGIN searchTransactionTest()"); - PeriodServiceImpl servicePeriod = new PeriodServiceImpl(); - TransactionServiceImpl serviceTransaction = new TransactionServiceImpl(); - JournalServiceImpl serviceJournal = new JournalServiceImpl(); - - // PREPARATION TEST - // Default period 01/01/2010 -> 31/12/2010 - TimeSpan timespan = createPeriod(servicePeriod); - Journal journal = createJournal(serviceJournal,"Journal transaction", "jt","description"); - String transactionId = createTransaction(serviceTransaction, "Facture 6", "description transaction", timespan, journal); - // FIN PREPARATION TEST - - // Recherche de la transaction suivant ce timeSpan. - List<Transaction> listTransaction = serviceTransaction.searchListTransactionWithTimeSpan(timespan); - Assert.assertEquals(1,listTransaction.size()); - // On prend le premier élément de la liste de transactions - Transaction transaction = listTransaction.get(0); - // Si c'est la bonne transaction - Assert.assertEquals("Facture 6",transaction.getVoucherRef()); - - // NETTOYAGE TEST - removeTransaction(serviceTransaction, transactionId); - removeJournals(serviceJournal); - removePeriod(servicePeriod); - // FIN NETTOYAGE TEST */ - } - - /** - * Permet de tester la recherche d'une transaction avec son identifiant. - * Ce dernier est une chaine de caractère. Elle a été inscrite dans la variable - * topiaIdTransaction dans les tests auparavant afin d'éviter les mêmes recherches - * pour chaque test. - */ - @Test - public void searchWithTopiaIdTest() { - /*log.info("BEGIN searchWithTopiaIdTest()"); - PeriodServiceImpl servicePeriod = new PeriodServiceImpl(); - TransactionServiceImpl serviceTransaction = new TransactionServiceImpl(); - JournalServiceImpl serviceJournal = new JournalServiceImpl(); - - // PREPARATION TEST - // Default period 01/01/2010 -> 31/12/2010 - TimeSpan timespan = createPeriod(servicePeriod); - Journal journal = createJournal(serviceJournal,"Journal transaction", "jt","description"); - String transactionId = createTransaction(serviceTransaction, "Facture 6", "description transaction", timespan, journal); - // FIN PREPARATION TEST - - // Recherche de la transaction avec son identifiant. - Transaction transaction = serviceTransaction.searchTransactionWithTopiaId(transactionId); - // Si c'est la bonne transaction - Assert.assertEquals("Facture 6",transaction.getVoucherRef()); - - // NETTOYAGE TEST - removeTransaction(serviceTransaction, transactionId); - removeJournals(serviceJournal); - removePeriod(servicePeriod); - // FIN NETTOYAGE TEST */ - } - - /** - * Recherche d'une transaction, retourner sous format DTO. - */ - @Test - public void searchTransactionDTOTest() { - /*log.info("BEGIN searchTransactionDTOTest()"); - PeriodServiceImpl servicePeriod = new PeriodServiceImpl(); - TransactionServiceImpl serviceTransaction = new TransactionServiceImpl(); - JournalServiceImpl serviceJournal = new JournalServiceImpl(); - - // PREPARATION TEST - // Default period 01/01/2010 -> 31/12/2010 - TimeSpan timespan = createPeriod(servicePeriod); - Journal journal = createJournal(serviceJournal,"Journal transaction", "jt","description"); - String transactionId = createTransaction(serviceTransaction, "Facture 6", "description transaction", timespan, journal); - // FIN PREPARATION TEST - - // Recherche de la transaction à l'aide de son identifiant. - TransactionDTO transactionDTO = serviceTransaction.searchTransactionDTO(transactionId); - // Vérifie si la transaction DTO est correcte. - Assert.assertEquals("Facture 6",transactionDTO.getVoucherRef()); - // Charge le journalDTO à partir de la transactionDTO - JournalDTO journalDTO = transactionDTO.getJournalDTO(); - Assert.assertEquals("jt",journalDTO.getPrefix()); // Si c'est le bon journal - // Charge le timespanDTO à partir de la transactionDTO - TimeSpanDTO timeSpanDTO = transactionDTO.getTimeSpanDTO(); - // debut 1 janvier 2010 - vérifie si c'est la même période - Date beginTimeSpan = new Date(110,0,1); - Assert.assertEquals(beginTimeSpan,timeSpanDTO.getBeginTimeSpan()); - - // NETTOYAGE TEST - removeTransaction(serviceTransaction, transactionId); - removeJournals(serviceJournal); - removePeriod(servicePeriod); - // FIN NETTOYAGE TEST */ - } - - /** - * Test la modification d'une transaction. - */ - @Test - public void modifyTransactionTest() { - /*log.info("BEGIN modifyTransactionTest()"); - PeriodServiceImpl servicePeriod = new PeriodServiceImpl(); - TransactionServiceImpl serviceTransaction = new TransactionServiceImpl(); - JournalServiceImpl serviceJournal = new JournalServiceImpl(); - - // PREPARATION TEST - // Default period 01/01/2010 -> 31/12/2010 - TimeSpan timespan = createPeriod(servicePeriod); - Journal journal = createJournal(serviceJournal,"Journal transaction", "jt","description"); - String transactionId = createTransaction(serviceTransaction, "Facture 6", "description transaction", timespan, journal); - TransactionDTO transactionDTO = serviceTransaction.searchTransactionDTO(transactionId); - // FIN PREPARATION TEST - - // On modifie la référence du fichier. - transactionDTO.setVoucherRef("Nouvelle facture"); - String result = serviceTransaction.modifyTransaction(transactionDTO); - Assert.assertEquals(ServiceHelper.RESPOND_SUCCESS,result); - // On recherche la transaction dans la base de données. - Transaction transaction = serviceTransaction.searchTransactionWithTopiaId(transactionId); - Assert.assertEquals("Nouvelle facture",transaction.getVoucherRef()); - - // NETTOYAGE TEST - removeTransaction(serviceTransaction, transactionId); - removeJournals(serviceJournal); - removePeriod(servicePeriod); - // FIN NETTOYAGE TEST */ - } - - /** - * Permet de tester l'ajout d'une transaction au format DTO. - */ - @Test - public void createTransactionDTOTest() { - /*log.info("BEGIN createTransactionDTOTest()"); - PeriodServiceImpl servicePeriod = new PeriodServiceImpl(); - TimeSpanServiceImpl serviceTimespan = new TimeSpanServiceImpl(); - TransactionServiceImpl serviceTransaction = new TransactionServiceImpl(); - JournalServiceImpl serviceJournal = new JournalServiceImpl(); - - // PREPARATION TEST - // Default period 01/01/2010 -> 31/12/2010 - TimeSpan timespan = createPeriod(servicePeriod); - Journal journal = createJournal(serviceJournal, "Journal transaction", - "jt", "description"); - String transactionId = createTransaction(serviceTransaction, - "Facture 6", "description transaction", timespan, journal); - // FIN PREPARATION TEST - - TransactionDTO transactionDTO = new TransactionDTO(); - Date dateTransaction = new Date(); - transactionDTO.setEntryDate(dateTransaction); - transactionDTO.setVoucherRef("Commande"); - transactionDTO.setDescription("No comment"); - // Il n'y a pas de timeSpan et journal attachés à la transaction - // ce qui créé une erreur lors de la création - String result = serviceTransaction.createTransaction(transactionDTO); - Assert.assertEquals(ServiceHelper.TRANSACTION_NOT_JOURNAL, result); - // On fournit à transactionDTO un timeSpan valide - // debut 1 janvier 2010 - Date dateSearch = timespan.getBeginTimeSpan(); - TimeSpanDTO timeSpanDTO = serviceTimespan - .searchTimeSpanDTOByDate(dateSearch); - transactionDTO.setTimeSpanDTO(timeSpanDTO); - // On fournit à transactionDTO un journal NON valide (non présent dans la BDD) - JournalDTO journalDTO = new JournalDTO(); - journalDTO.setLabel("existe pas"); - transactionDTO.setJournalDTO(journalDTO); - // Ajout de la transaction avec erreur avec le journalDTO - result = serviceTransaction.createTransaction(transactionDTO); - Assert.assertEquals(ServiceHelper.TRANSACTION_NOT_JOURNAL, result); - - // Ajout d'un journalDTO valide - journalDTO = serviceJournal - .searchJournalDTOWithLabel("Journal transaction"); - transactionDTO.setJournalDTO(journalDTO); - result = serviceTransaction.createTransaction(transactionDTO); - - // Si il renvoie succes et non l'identifiant (à commenter dans la classe correspondante) - - //Assert.assertEquals(ServiceHelper.RESPOND_SUCCESS,result); - // Vérifie le nombre de transactions (égal à deux) - TimeSpan timeSpan = serviceTimespan.searchTimeSpanByDate(dateSearch); - List<TransactionDTO> listTransactionDTO = serviceTransaction - .searchListTransactionDTOWithTimeSpan(timeSpan); - Assert.assertEquals(2, listTransactionDTO.size()); - - // pour effacer par la suite les transactions à la fin des tests - // Vérifie si la 1ière transaction est celle deja inscrite - transactionDTO = listTransactionDTO.get(0); - String transactionId2; - if (transactionDTO.getId().equals(transactionId)) { - transactionId2 = listTransactionDTO.get(1).getId(); - } else // ?????? - { - transactionId2 = transactionDTO.getId(); - } - - // NETTOYAGE TEST - removeTransaction(serviceTransaction, transactionId); - removeTransaction(serviceTransaction, transactionId2); - removeJournals(serviceJournal); - removePeriod(servicePeriod); - // FIN NETTOYAGE TEST */ - } - - /** - * Permet de tester l'ajout d'entrées sur une transaction. - */ - @Test - public void addEntryTest() { - /*log.info("BEGIN addEntryTest()"); - PeriodServiceImpl servicePeriod = new PeriodServiceImpl(); - TransactionServiceImpl serviceTransaction = new TransactionServiceImpl(); - JournalServiceImpl serviceJournal = new JournalServiceImpl(); - AccountServiceImpl serviceAccount = new AccountServiceImpl(); - - // PREPARATION TEST - // Default period 01/01/2010 -> 31/12/2010 - TimeSpan timespan = createPeriod(servicePeriod); - Journal journal = createJournal(serviceJournal, "Journal transaction", - "jt", "description"); - String transactionId = createTransaction(serviceTransaction, - "Facture 6", "description transaction", timespan, journal); - // FIN PREPARATION TEST - - // On recherche la transaction dans la base de données. - Transaction transaction = serviceTransaction - .searchTransactionWithTopiaId(transactionId); - // On créé le compte 8 et recherche cet account dans la base de données - Account account = createAccount(serviceAccount, "8", "Compte essai", - "0", "actif"); - createAccount(serviceAccount, "81", "Compte essai 81", "8", "actif"); - // Ajout entrée : 300 euros en crédit - String result = serviceTransaction.addEntry("entree1", "300", false, - "lettering", "detail", transaction, account); - - // Si il renvoie succes et non l'identifiant (à commenter dans la classe correspondante) - - //Assert.assertEquals(ServiceHelper.RESPOND_SUCCESS,result); - // Ajout entrée : 300 euros en débit - result = serviceTransaction.addEntry("entree2", "300", true, - "lettering", "detail", transaction, account); - - // Si il renvoie succes et non l'identifiant (à commenter dans la classe correspondante) - - //Assert.assertEquals(ServiceHelper.RESPOND_SUCCESS,result); - - // NETTOYAGE TEST - // Les entrees sont supprimees avec la transaction (composition) - removeTransaction(serviceTransaction, transactionId); - serviceAccount.removeAccount("8"); - serviceAccount.removeAccount("81"); - removeJournals(serviceJournal); - removePeriod(servicePeriod); - // N NETTOYAGE TEST */ - } - - /** - * Recherche les entrées suivant la transaction. - */ - @Test - public void searchEntryTest() { - /*log.info("BEGIN searchEntryTest()"); - PeriodServiceImpl servicePeriod = new PeriodServiceImpl(); - TransactionServiceImpl serviceTransaction = new TransactionServiceImpl(); - JournalServiceImpl serviceJournal = new JournalServiceImpl(); - AccountServiceImpl serviceAccount = new AccountServiceImpl(); - EntryServiceImpl serviceEntry = new EntryServiceImpl(); - - // PREPARATION TEST - // Default period 01/01/2010 -> 31/12/2010 - TimeSpan timespan = createPeriod(servicePeriod); - Journal journal = createJournal(serviceJournal, "Journal transaction", - "jt", "description"); - String transactionId = createTransaction(serviceTransaction, - "Facture 6", "description transaction", timespan, journal); - Transaction transaction = serviceTransaction - .searchTransactionWithTopiaId(transactionId); - Account account = createAccount(serviceAccount, "8", "Compte essai", - "0", "actif"); - createAccount(serviceAccount, "81", "Compte essai 81", "8", "actif"); - serviceTransaction.addEntry("entree1", "300", false, "lettering", - "detail", transaction, account); - serviceTransaction.addEntry("entree2", "300", true, "lettering", - "detail", transaction, account); - // FIN PREPARATION TEST - - List<EntryDTO> listEntryDTO = serviceEntry - .searchEntryDTOWithTransaction(transaction); - // On doit trouver deux entrées. - Assert.assertEquals(2, listEntryDTO.size()); - - // Vérifie pour le DTO si tout est complet - - // Prend le premier entry - AccountDTO accountDTO = listEntryDTO.get(0).getAccountDTO(); - // Trouve le compte 8 - Assert.assertEquals("8", accountDTO.getAccountNumber()); - // Trouve le compte 81 - accountDTO = accountDTO.getAccountChildDTO().get(0); - Assert.assertEquals("81", accountDTO.getAccountNumber()); - - // NETTOYAGE TEST - removeTransaction(serviceTransaction, transactionId); - serviceAccount.removeAccount("8"); - serviceAccount.removeAccount("81"); - removeJournals(serviceJournal); - removePeriod(servicePeriod); - // FIN NETTOYAGE TEST */ - } - - /** - * Permet de tester la modification d'une entrée comptable. - */ - @Test - public void modifyEntry() { - /*log.info("BEGIN modifyEntry()"); - PeriodServiceImpl servicePeriod = new PeriodServiceImpl(); - TransactionServiceImpl serviceTransaction = new TransactionServiceImpl(); - JournalServiceImpl serviceJournal = new JournalServiceImpl(); - AccountServiceImpl serviceAccount = new AccountServiceImpl(); - EntryServiceImpl serviceEntry = new EntryServiceImpl(); - - // PREPARATION TEST - // Default period 01/01/2010 -> 31/12/2010 - TimeSpan timespan = createPeriod(servicePeriod); - Journal journal = createJournal(serviceJournal, "Journal transaction", - "jt", "description"); - String transactionId = createTransaction(serviceTransaction, - "Facture 6", "description transaction", timespan, journal); - Transaction transaction = serviceTransaction - .searchTransactionWithTopiaId(transactionId); - Account account = createAccount(serviceAccount, "8", "Compte essai", - "0", "actif"); - serviceTransaction.addEntry("entree1", "300", false, "lettering", - "detail", transaction, account); - serviceTransaction.addEntry("entree2", "300", true, "lettering", - "detail", transaction, account); - // FIN PREPARATION TEST - - // Recherche les deux entry en format DTO - List<EntryDTO> listEntryDTO = serviceEntry - .searchEntryDTOWithTransaction(transaction); - Assert.assertEquals(2, listEntryDTO.size()); - Assert.assertTrue(listEntryDTO.size() > 0); - // Premier DTO - EntryDTO entryDTO = listEntryDTO.get(0); - entryDTO.setAmount("800"); - String result = serviceTransaction.modifyEntry(entryDTO); - Assert.assertEquals(ServiceHelper.RESPOND_SUCCESS, result); - // Second DTO - entryDTO = listEntryDTO.get(1); - entryDTO.setAmount("800"); - - // Modification de l'entrée dans la bdd. - result = serviceTransaction.modifyEntry(entryDTO); - Assert.assertEquals(ServiceHelper.RESPOND_SUCCESS, result); - // Vérifie que les deux DTO ont bien été modifiés. - listEntryDTO = serviceEntry.searchEntryDTOWithTransaction(transaction); - entryDTO = listEntryDTO.get(0); - Assert.assertEquals("800,00", entryDTO.getAmount()); - - // NETTOYAGE TEST - removeTransaction(serviceTransaction, transactionId); - serviceAccount.removeAccount("8"); - removeJournals(serviceJournal); - removePeriod(servicePeriod); - // FIN NETTOYAGE TEST */ - } - - /** - * Test la suppression d'une entry. - */ - @Test - public void removeEntryTest() { - /*log.info("BEGIN removeEntryTest()"); - PeriodServiceImpl servicePeriod = new PeriodServiceImpl(); - TransactionServiceImpl serviceTransaction = new TransactionServiceImpl(); - JournalServiceImpl serviceJournal = new JournalServiceImpl(); - AccountServiceImpl serviceAccount = new AccountServiceImpl(); - EntryServiceImpl serviceEntry = new EntryServiceImpl(); - - // PREPARATION TEST - // Default period 01/01/2010 -> 31/12/2010 - TimeSpan timespan = createPeriod(servicePeriod); - Journal journal = createJournal(serviceJournal, "Journal transaction", - "jt", "description"); - String transactionId = createTransaction(serviceTransaction, - "Facture 6", "description transaction", timespan, journal); - Transaction transaction = serviceTransaction - .searchTransactionWithTopiaId(transactionId); - Account account = createAccount(serviceAccount, "8", "Compte essai", - "0", "actif"); - serviceTransaction.addEntry("entree1", "300", false, "lettering", - "detail", transaction, account); - serviceTransaction.addEntry("entree2", "300", true, "lettering", - "detail", transaction, account); - // FIN PREPARATION TEST - - List<EntryDTO> listEntryDTO = serviceEntry - .searchEntryDTOWithTransaction(transaction); - // Prend le premier DTO - EntryDTO entryDTO = listEntryDTO.get(0); - // Supprime cette entrée - String result = serviceTransaction.removeEntry(entryDTO.getId()); - Assert.assertEquals(ServiceHelper.RESPOND_SUCCESS, result); - // Recherche dans la base de données les entrys - listEntryDTO = serviceEntry.searchEntryDTOWithTransaction(transaction); - // Trouve un seul entry DTO - Assert.assertEquals(1, listEntryDTO.size()); - - // NETTOYAGE TEST - removeTransaction(serviceTransaction, transactionId); - serviceAccount.removeAccount("8"); - removeJournals(serviceJournal); - removePeriod(servicePeriod); - // FIN NETTOYAGE TEST */ - } - - /** - * Test la suppression d'une transaction et ses entrées. - */ - @Test - public void removeTransactionTest() { - /*log.info("BEGIN removeEntryTest()"); - PeriodServiceImpl servicePeriod = new PeriodServiceImpl(); - TransactionServiceImpl serviceTransaction = new TransactionServiceImpl(); - JournalServiceImpl serviceJournal = new JournalServiceImpl(); - AccountServiceImpl serviceAccount = new AccountServiceImpl(); - EntryServiceImpl serviceEntry = new EntryServiceImpl(); - - // PREPARATION TEST - // Default period 01/01/2010 -> 31/12/2010 - TimeSpan timespan = createPeriod(servicePeriod); - Journal journal = createJournal(serviceJournal, "Journal transaction", - "jt", "description"); - String transactionId = createTransaction(serviceTransaction, - "Facture 6", "description transaction", timespan, journal); - Transaction transaction = serviceTransaction - .searchTransactionWithTopiaId(transactionId); - Account account = createAccount(serviceAccount, "8", "Compte essai", - "0", "actif"); - serviceTransaction.addEntry("entree1", "300", false, "lettering", - "detail", transaction, account); - // FIN PREPARATION TEST - - // Supprime cette transaction - String result = serviceTransaction.removeTransaction(transactionId); - Assert.assertEquals(ServiceHelper.RESPOND_SUCCESS, result); - // Recherche dans la base de données les entrys - transaction = serviceTransaction - .searchTransactionWithTopiaId(transactionId); - List<EntryDTO> listEntryDTO = serviceEntry - .searchEntryDTOWithTransaction(transaction); - Assert.assertEquals(0, listEntryDTO.size()); - - // NETTOYAGE TEST - serviceAccount.removeAccount("8"); - removeJournals(serviceJournal); - removePeriod(servicePeriod); - // FIN NETTOYAGE TEST */ - } - - /* - private TimeSpan createPeriod(PeriodServiceImpl servicePeriod) { - /*TimeSpanServiceImpl serviceTimespan = new TimeSpanServiceImpl(); - // debut 1 janvier 2010 - Date beginTimeSpan = new Date(110, 0, 1); - // fin 31 décembre 2010 - Date endTimeSpan = new Date(110, 11, 31); - // Création période avec son découpage sur 12 mois - String result = servicePeriod.createPeriod(beginTimeSpan, endTimeSpan, - false); - Assert.assertEquals(ServiceHelper.RESPOND_SUCCESS, result); - // Recherche du timespan 1 janv au 31 janv 2010 - //Date dateSearch = new Date(110,0,1); - TimeSpan timespan = serviceTimespan.searchTimeSpanByDate(beginTimeSpan); - return timespan; - } - - private void removePeriod(PeriodServiceImpl servicePeriod) { - // Supprime Period & TimeSpan - Date d = new Date(110, 0, 1); - PeriodDTO periodDTO = servicePeriod.searchPeriodDTOWithDate(d); - servicePeriod.removePeriod(periodDTO); - } - - private Journal createJournal(JournalServiceImpl serviceJournal, - String label, String prefix, String description) { - // Création Journal - String result = serviceJournal - .createJournal(label, prefix, description); - Assert.assertEquals(ServiceHelper.RESPOND_SUCCESS, result); - // Recherche du journal pour l'ajouter dans la transaction - Journal journal = serviceJournal.searchJournalWithLabel(label); - Assert.assertNotNull(journal); - return journal; - } - - private void removeJournals(JournalServiceImpl serviceJournal) { - // Supprime Journal - List<JournalDTO> listJournal = serviceJournal.getAllJournal(); - for (JournalDTO journalDTO : listJournal) { - serviceJournal.removeJournal(journalDTO); - } - } - - private String createTransaction(TransactionServiceImpl serviceTransaction, - String voucherRef, String description, TimeSpan timespan, - Journal journal) { - // Création d'une transaction - String transactionId = serviceTransaction - .createTransaction(timespan.getBeginTimeSpan(), voucherRef, - description, timespan, journal); - - // Si il renvoie succes et non l'identifiant (à commenter dans la classe correspondante) - - //Assert.assertEquals(ServiceHelper.RESPOND_SUCCESS,result); - Assert.assertFalse(transactionId.equals(ServiceHelper.RESPOND_ERROR)); - log.debug("RESULT createTransaction : " + transactionId); - return transactionId; - } - - private void removeTransaction(TransactionServiceImpl serviceTransaction, - String transactionId) { - String result = serviceTransaction.removeTransaction(transactionId); - Assert.assertEquals(ServiceHelper.RESPOND_SUCCESS, result); - } - - private Account createAccount(AccountServiceImpl serviceAccount, - String accountNumber, String label, String masterAccountNumber, - String type) { - serviceAccount.createAccount(accountNumber, label, masterAccountNumber, - type); - Account account = serviceAccount.searchAccount(accountNumber); - Assert.assertEquals(accountNumber, account.getAccountNumber()); - return account; - }*/ -} Added: trunk/lima-callao/src/main/java/org/chorem/lima/entity/FinancialStatementHeaderImpl.java =================================================================== --- trunk/lima-callao/src/main/java/org/chorem/lima/entity/FinancialStatementHeaderImpl.java (rev 0) +++ trunk/lima-callao/src/main/java/org/chorem/lima/entity/FinancialStatementHeaderImpl.java 2010-06-17 10:03:23 UTC (rev 2941) @@ -0,0 +1,16 @@ +package org.chorem.lima.entity; + +public class FinancialStatementHeaderImpl extends FinancialStatementHeaderAbstract{ + + protected Integer result; + + @Override + public int getLevel() { + result = 1; + if (masterFinancialStatementHeader != null){ + result = masterFinancialStatementHeader.getLevel()+1; + } + + return result; + } +} Modified: trunk/lima-callao/src/main/xmi/accounting.properties =================================================================== --- trunk/lima-callao/src/main/xmi/accounting.properties 2010-06-15 17:35:55 UTC (rev 2940) +++ trunk/lima-callao/src/main/xmi/accounting.properties 2010-06-17 10:03:23 UTC (rev 2941) @@ -6,6 +6,7 @@ org.chorem.lima.entity.FiscalPeriod.attribute.financialPeriod.tagvalue.lazy=false org.chorem.lima.entity.FinancialStatementHeader.attribute.subFinancialStatementHeaders.tagvalue.lazy=false org.chorem.lima.entity.FinancialStatementHeader.attribute.financialStatementMovement.tagvalue.lazy=false +org.chorem.lima.entity.FinancialStatementHeader.attribute.masterFinancialStatementHeader.tagvalue.lazy=false #model.tagvalue.dbSchema=Callao Modified: trunk/lima-callao/src/main/xmi/accounting.zargo =================================================================== (Binary files differ) Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsTableModel.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsTableModel.java 2010-06-15 17:35:55 UTC (rev 2940) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsTableModel.java 2010-06-17 10:03:23 UTC (rev 2941) @@ -138,8 +138,8 @@ format(currentRow.getFinancialTransaction().getTransactionDate()); break; case 1: - if (currentRow.getEntryBook() != null){ - result = currentRow.getEntryBook().getCode(); + if (currentRow.getFinancialTransaction().getEntryBook() != null){ + result = currentRow.getFinancialTransaction().getEntryBook().getCode(); } else { result = null; Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialperiod/FinancialPeriodView.jaxx =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialperiod/FinancialPeriodView.jaxx 2010-06-15 17:35:55 UTC (rev 2940) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialperiod/FinancialPeriodView.jaxx 2010-06-17 10:03:23 UTC (rev 2941) @@ -16,7 +16,6 @@ ##% --> <Table> - <FinancialPeriodViewHandler id="handler" javaBean="new FinancialPeriodViewHandler(this)" /> <org.chorem.lima.ui.financialperiod.FinancialPeriodTableModel id="modelFinancialPeriodTable"/> Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartViewHandler.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartViewHandler.java 2010-06-15 17:35:55 UTC (rev 2940) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartViewHandler.java 2010-06-17 10:03:23 UTC (rev 2941) @@ -67,7 +67,7 @@ treeTableModel = (FinancialStatementChartTreeTableModel) treeTable.getTreeTableModel(); - FinancialStatementHeader newFinancialStatementHeader = new FinancialStatementHeaderImpl(); + FinancialStatementHeader newFinancialStatementHeader = (FinancialStatementHeader) new FinancialStatementHeaderImpl(); FinancialStatementHeaderForm financialStatementHeaderForm = new FinancialStatementHeaderForm(view); financialStatementHeaderForm.setHeader(newFinancialStatementHeader); // jaxx constructor don't call super() ? Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementHeaderForm.jaxx =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementHeaderForm.jaxx 2010-06-15 17:35:55 UTC (rev 2940) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementHeaderForm.jaxx 2010-06-17 10:03:23 UTC (rev 2941) @@ -21,7 +21,7 @@ <Boolean id="addState" javaBean='true'/> <script> - <![CDATA[ + <![CDATA[ protected void performCancel() { setHeader(null); dispose(); @@ -41,17 +41,6 @@ onRemoveUpdate='getHeader().setLabel(getDescriptionTextField().getText())' /> </cell> </row> - <row> - <cell fill="horizontal"> - <JLabel text="lima.financialstatement.style"/> - </cell> - <cell fill="horizontal"> - <JTextField id="styleTextField" text="{getHeader().getStyle()}"/> - <javax.swing.text.Document javaBean="getStyleTextField().getDocument()" - onInsertUpdate='getHeader().setStyle(getStyleTextField().getText())' - onRemoveUpdate='getHeader().setStyle(getStyleTextField().getText())' /> - </cell> - </row> <row> <cell fill="none"> <JButton text="lima.common.ok" onActionPerformed="dispose()"/> Added: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportTable.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportTable.java (rev 0) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportTable.java 2010-06-17 10:03:23 UTC (rev 2941) @@ -0,0 +1,132 @@ +/* *##% Lima Swing + * Copyright (C) 2008 - 2010 CodeLutin + * + * 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 2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * ##%*/ + +package org.chorem.lima.ui.financialstatementreport; + +import java.awt.Color; +import java.awt.Component; +import java.text.SimpleDateFormat; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.chorem.lima.business.FinancialPeriodService; +import org.chorem.lima.business.LimaException; +import org.chorem.lima.entity.ClosedPeriodicEntryBook; +import org.chorem.lima.entity.ClosedPeriodicEntryBookImpl; +import org.chorem.lima.service.LimaServiceFactory; +import org.jdesktop.swingx.JXTable; +import org.jdesktop.swingx.decorator.ColorHighlighter; +import org.jdesktop.swingx.decorator.ComponentAdapter; +import org.jdesktop.swingx.decorator.HighlightPredicate; +import org.jdesktop.swingx.decorator.Highlighter; + +public class FinancialStatementReportTable extends JXTable { + + private static final Log log = + LogFactory.getLog(FinancialStatementReportTableModel.class); + + protected FinancialStatementReportViewHandler handler; + + protected FinancialStatementReportTableModel model; + + protected FinancialPeriodService financialPeriodService; + + private Highlighter colorTransaction; + + /* + * Constructor, call highlighter + */ + public FinancialStatementReportTable(FinancialStatementReportViewHandler handler) { + + this.handler = handler; + model = this.handler.getView().modelTable; + financialPeriodService = + LimaServiceFactory.getInstance().getFinancialPeriodService(); + + //highlight financial financial transactions + // addTitle1(); + // addTitle2(); + + //Renderer for font + + log.debug(getColumnCount()); + /* + FinancialStatementReportTableCellRenderer renderer = new FinancialStatementReportTableCellRenderer(); + for (int i = 1; i <= model.getColumnCount(); i++) { + + getColumn(-1).setCellRenderer(renderer); + //getColumnModel().getColumn(i).setCellRenderer(renderer); + }*/ + + } + + /* + * Color the background row in grey if the month number is even (pair in french) + */ + protected void addTitle1() { +/* + + + HighlightPredicate predicate = new HighlightPredicate() { + @Override + public boolean isHighlighted(Component renderer, + ComponentAdapter adapter) { + ClosedPeriodicEntryBook closedPeriodicEntryBook + = (ClosedPeriodicEntryBook) model.getElementAt(adapter.row); + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("MM"); + int month = Integer.parseInt(simpleDateFormat.format( + closedPeriodicEntryBook.getFinancialPeriod().getBeginDate())); + // true if month is even + return ((month % 2)==0); + } + }; + colorTransaction = + new ColorHighlighter(predicate, new Color(222,222,222), null); + addHighlighter(colorTransaction);*/ + } + + /* + * Color the font in red if period are closed + */ + protected void addTitle2() { + /* HighlightPredicate predicate = new HighlightPredicate() { + @Override + public boolean isHighlighted(Component renderer, + ComponentAdapter adapter) { + ClosedPeriodicEntryBook closedPeriodicEntryBook = + new ClosedPeriodicEntryBookImpl(); + ClosedPeriodicEntryBook selectedClosedPeriodicEntryBook = + (ClosedPeriodicEntryBook) model.getElementAt(adapter.row); + // true if locked + try { + closedPeriodicEntryBook = + financialPeriodService.getClosedPeriodicEntryBook( + selectedClosedPeriodicEntryBook.getEntryBook(), + selectedClosedPeriodicEntryBook.getFinancialPeriod()); + } catch (LimaException eee) { + log.debug("Can't get closePeriodicEntryBook",eee); + } + return (closedPeriodicEntryBook.getLocked()); + } + }; + colorTransaction = + new ColorHighlighter(predicate, null, new Color(222,0,0)); + addHighlighter(colorTransaction);*/ + } + +} Property changes on: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportTable.java ___________________________________________________________________ Added: svn:executable + * Added: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportTableCellRenderer.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportTableCellRenderer.java (rev 0) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportTableCellRenderer.java 2010-06-17 10:03:23 UTC (rev 2941) @@ -0,0 +1,86 @@ +/* *##% Lima Swing + * Copyright (C) 2008 - 2010 CodeLutin + * + * 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 2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * ##%*/ + +package org.chorem.lima.ui.financialstatementreport; + +import javax.swing.table.*; +import javax.swing.*; + +import org.chorem.lima.entity.FinancialStatementHeader; + +import java.awt.*; + + +/** + * Permet de modifier l'apparence du tableau pour le bilan à l'actif + * @author Rémi Chapelet + */ + +public class FinancialStatementReportTableCellRenderer extends DefaultTableCellRenderer { + + @Override + public Component getTableCellRendererComponent(JTable table, Object value, + boolean isSelected, boolean hasFocus, int row, int column) + { + super.getTableCellRendererComponent(table, value, isSelected, hasFocus, + row, column); + + // Get table + FinancialStatementReportTable financialStatementReportTable = (FinancialStatementReportTable) table; + FinancialStatementReportTableModel financialStatementReportTableModel = (FinancialStatementReportTableModel) table.getModel(); + + // Récupère le bilan de la ligne + Object object = financialStatementReportTableModel.getElementAt(row); + // Si le bilan est un soustotal, alors la ligne est en gras + if (object instanceof FinancialStatementHeader){ + FinancialStatementHeader financialStatementHeader = (FinancialStatementHeader) object; + + if (financialStatementHeader.getLevel() == 1) + { + setFont(new Font("Verdana", Font.BOLD, 14)); + } + + if (financialStatementHeader.getLevel() == 2) + { + setFont(new Font("Verdana", Font.BOLD, 12)); + } + } + + // Alignement des cellules + switch (column) { + case 0: + this.setHorizontalAlignment(JLabel.LEFT); + break; + case 1: + this.setHorizontalAlignment(JLabel.RIGHT); + break; + case 2: + this.setHorizontalAlignment(JLabel.RIGHT); + break; + case 3: + this.setHorizontalAlignment(JLabel.RIGHT); + break; + case 4: + this.setHorizontalAlignment(JLabel.RIGHT); + break; + } + + return this; + } + +} Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportTableModel.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportTableModel.java 2010-06-15 17:35:55 UTC (rev 2940) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportTableModel.java 2010-06-17 10:03:23 UTC (rev 2941) @@ -113,6 +113,12 @@ return res; } + public Object getElementAt(int row){ + + Object currentRow = cacheDataList.get(row); + return currentRow; + } + @Override public Object getValueAt(int row, int column) { Object result = cacheDataList.get(row); Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportView.jaxx =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportView.jaxx 2010-06-15 17:35:55 UTC (rev 2940) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportView.jaxx 2010-06-17 10:03:23 UTC (rev 2941) @@ -80,11 +80,11 @@ <row> <cell fill="both" weightx="1" weighty="1" columns="7"> <JScrollPane> - <org.jdesktop.swingx.JXTable id="table" rowHeight="24" - model="{getModelTable()}" - highlighters="{org.jdesktop.swingx.decorator.HighlighterFactory.createSimpleStriping(new java.awt.Color(222,222,222))}" - selectionMode="{ListSelectionModel.SINGLE_SELECTION}" - columnControlVisible="true"/> + <org.chorem.lima.ui.financialstatementreport.FinancialStatementReportTable + id="table" rowHeight="24" + constructorParams="getHandler()" model="{getModelTable()}" + selectionMode="{ListSelectionModel.SINGLE_INTERVAL_SELECTION}" + columnControlVisible="true" /> <javax.swing.ListSelectionModel javaBean="getTable().getSelectionModel()"/> </JScrollPane> </cell> Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportViewHandler.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportViewHandler.java 2010-06-15 17:35:55 UTC (rev 2940) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportViewHandler.java 2010-06-17 10:03:23 UTC (rev 2941) @@ -24,6 +24,7 @@ import org.chorem.lima.beans.BalanceTrial; import org.chorem.lima.business.FinancialTransactionService; import org.chorem.lima.service.LimaServiceFactory; +import org.chorem.lima.ui.financialperiod.FinancialPeriodView; /** @@ -87,4 +88,8 @@ }*/ } + public FinancialStatementReportView getView() { + return view; + } + } Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTableModel.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTableModel.java 2010-06-15 17:35:55 UTC (rev 2940) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTableModel.java 2010-06-17 10:03:23 UTC (rev 2941) @@ -252,10 +252,15 @@ result = currentRow.getTransactionDate(); break; case 1: - result = null; // voucher + if (currentRow.getEntryBook() != null){ + result = currentRow.getEntryBook().getCode(); + } + else { + result = null; + } break; case 2: - result = null; //entrybook + result = null; //voucher break; case 3: result = null; // account @@ -284,12 +289,7 @@ result = null; // date break; case 1 : // entry book - if (currentEntry.getEntryBook() != null){ - result = currentEntry.getEntryBook().getCode(); - } - else { - result = null; - } + result = null; break; case 2: result = currentEntry.getVoucher(); @@ -344,11 +344,11 @@ boolean editableCell=false; Object currentRow = cacheDataList.get(rowIndex); // cells editable for the entry row, all cells exclude the date - if ((currentRow instanceof Entry) && !(columnIndex==0)) { + if ((currentRow instanceof Entry) && !((columnIndex==0) || (columnIndex==1))) { editableCell=true; } // cells editable for the financialtransaction row, no cells exclude the date - if ((currentRow instanceof FinancialTransaction) && (columnIndex==0)){ + if ((currentRow instanceof FinancialTransaction) && ((columnIndex==0) || (columnIndex==1))){ editableCell=true; } return editableCell; @@ -429,6 +429,9 @@ //update currentFinancialTransaction.setTransactionDate((Date)value); break; + case 1 : + currentFinancialTransaction.setEntryBook((EntryBook)value); + break; } // notify service for modification try { @@ -447,9 +450,6 @@ else if (currentRow instanceof Entry) { Entry currentEntry = (Entry)currentRow; switch (column) { - case 1 : - currentEntry.setEntryBook((EntryBook)value); - break; case 2 : currentEntry.setVoucher((String)value); break; Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedTableModel.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedTableModel.java 2010-06-15 17:35:55 UTC (rev 2940) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedTableModel.java 2010-06-17 10:03:23 UTC (rev 2941) @@ -234,7 +234,12 @@ result = currentRow.getTransactionDate(); break; case 1: - result = null; // voucher + if (currentRow.getEntryBook() != null){ + result = currentRow.getEntryBook().getCode(); + } + else { + result = null; + } break; case 2: result = null; //entrybook @@ -266,12 +271,7 @@ result = null; // date break; case 1 : // entry book - if (currentEntry.getEntryBook() != null){ - result = currentEntry.getEntryBook().getCode(); - } - else { - result = null; - } + result = null; break; case 2: result = currentEntry.getVoucher(); @@ -325,11 +325,11 @@ boolean editableCell=false; Object currentRow = cacheDataList.get(rowIndex); // cells editable for the entry row, all cells exclude the date - if ((currentRow instanceof Entry) && !(columnIndex==0)) { + if ((currentRow instanceof Entry) && !((columnIndex==0) || (columnIndex==1))) { editableCell=true; } // cells editable for the financialtransaction row, no cells exclude the date - if ((currentRow instanceof FinancialTransaction) && (columnIndex==0)){ + if ((currentRow instanceof FinancialTransaction) && ((columnIndex==0) || (columnIndex==1))){ editableCell=true; } return editableCell; @@ -376,6 +376,9 @@ //update currentFinancialTransaction.setTransactionDate((Date)value); break; + case 1 : + currentFinancialTransaction.setEntryBook((EntryBook)value); + break; } // notify service for modification try { @@ -394,9 +397,6 @@ else if (currentRow instanceof Entry) { Entry currentEntry = (Entry)currentRow; switch (column) { - case 1 : - currentEntry.setEntryBook((EntryBook)value); - break; case 2 : currentEntry.setVoucher((String)value); break; Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerTableModel.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerTableModel.java 2010-06-15 17:35:55 UTC (rev 2940) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerTableModel.java 2010-06-17 10:03:23 UTC (rev 2941) @@ -195,8 +195,8 @@ format(currentRow.getFinancialTransaction().getTransactionDate()); break; case 2: - if (currentRow.getEntryBook() != null){ - result = currentRow.getEntryBook().getCode(); + if (currentRow.getFinancialTransaction().getEntryBook() != null){ + result = currentRow.getFinancialTransaction().getEntryBook().getCode(); } else { //entrybook result = null; @@ -264,7 +264,6 @@ for (ReportsDatas reportsDatas : balanceTrialCache.getReportsDatas()) { results.add(reportsDatas); List<Entry> entries = (List<Entry>) reportsDatas.getListEntry(); - log.debug(reportsDatas); if (entries != null){ Collections.sort(entries, new EntryComparator()); results.addAll(entries); Modified: trunk/lima-swing/src/main/resources/i18n/lima-swing-en_GB.properties =================================================================== --- trunk/lima-swing/src/main/resources/i18n/lima-swing-en_GB.properties 2010-06-15 17:35:55 UTC (rev 2940) +++ trunk/lima-swing/src/main/resources/i18n/lima-swing-en_GB.properties 2010-06-17 10:03:23 UTC (rev 2941) @@ -328,6 +328,7 @@ lima.status.tr.finalized=Finalized lima.status.tr.wip=Work in progress lima.structure=Structure +lima.style.1= lima.subledger.accountnumber= lima.subledger.code=Code lima.subledger.label= Modified: trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties =================================================================== --- trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties 2010-06-15 17:35:55 UTC (rev 2940) +++ trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties 2010-06-17 10:03:23 UTC (rev 2941) @@ -312,6 +312,7 @@ lima.status.tr.finalized=Valid\u00E9e lima.status.tr.wip=En cours lima.structure=Structure +lima.style.1= lima.subledger.accountnumber= lima.subledger.code=Code lima.subledger.label=