r3408 - in trunk: lima-business/src/main/java/org/chorem/lima/business lima-business/src/main/java/org/chorem/lima/business/accountingrules lima-business/src/main/java/org/chorem/lima/business/ejb lima-business/src/test/java/org/chorem/lima/business lima-callao/src/main/java/org/chorem/lima/entity lima-callao/src/main/xmi lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch
Author: echatellier Date: 2012-05-09 17:37:59 +0200 (Wed, 09 May 2012) New Revision: 3408 Url: http://chorem.org/repositories/revision/lima/3408 Log: Remove FinancialTransaction link to FinancialPeriod. Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/AccountingRules.java trunk/lima-business/src/main/java/org/chorem/lima/business/LimaDaoHelper.java trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/DefaultAccountingRules.java trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/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/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/ImportServiceImpl.java trunk/lima-business/src/test/java/org/chorem/lima/business/AbstractLimaTest.java trunk/lima-business/src/test/java/org/chorem/lima/business/FinancialTransactionServiceImplTest.java trunk/lima-business/src/test/java/org/chorem/lima/business/ReportServiceImplTest.java trunk/lima-callao/src/main/java/org/chorem/lima/entity/EntryDAOImpl.java trunk/lima-callao/src/main/java/org/chorem/lima/entity/FinancialPeriodDAOImpl.java trunk/lima-callao/src/main/java/org/chorem/lima/entity/FinancialTransactionDAOImpl.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/financialtransaction/FinancialTransactionViewHandler.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchTableModel.java 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 2012-05-09 13:09:24 UTC (rev 3407) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/AccountingRules.java 2012-05-09 15:37:59 UTC (rev 3408) @@ -84,7 +84,7 @@ */ void updateEntryRules(Entry entry, Entry entryOld, TopiaContext topiaTransaction) throws LimaException; - void updateFinancialTransactionDateRules(FinancialTransaction financialTransaction, FinancialTransaction financialTransactionOld, TopiaContext topiaContext) throws LimaException; + void updateFinancialTransactionDateRules(FinancialTransaction financialTransaction, FinancialTransaction financialTransactionOld) throws LimaException; /** * Financialperiod/entrybook rules Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/LimaDaoHelper.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/LimaDaoHelper.java 2012-05-09 13:09:24 UTC (rev 3407) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/LimaDaoHelper.java 2012-05-09 15:37:59 UTC (rev 3408) @@ -26,8 +26,14 @@ package org.chorem.lima.business; import org.chorem.lima.entity.AccountDAO; +import org.chorem.lima.entity.ClosedPeriodicEntryBookDAO; +import org.chorem.lima.entity.EntryBookDAO; import org.chorem.lima.entity.EntryDAO; +import org.chorem.lima.entity.FinancialPeriodDAO; +import org.chorem.lima.entity.FiscalPeriodDAO; +import org.chorem.lima.entity.IdentityDAO; import org.chorem.lima.entity.LimaCallaoDAOHelper; +import org.chorem.lima.entity.VatStatementDAO; import org.nuiton.topia.TopiaContext; import org.nuiton.topia.TopiaException; @@ -67,5 +73,27 @@ return LimaCallaoDAOHelper.getEntryDAO(context); } + public FinancialPeriodDAO getFinancialPeriodDAO() throws TopiaException { + return LimaCallaoDAOHelper.getFinancialPeriodDAO(context); + } + + public FiscalPeriodDAO getFiscalPeriodDAO() throws TopiaException { + return LimaCallaoDAOHelper.getFiscalPeriodDAO(context); + } + public ClosedPeriodicEntryBookDAO getClosedPeriodicEntryBookDAO() throws TopiaException { + return LimaCallaoDAOHelper.getClosedPeriodicEntryBookDAO(context); + } + + public EntryBookDAO getEntryBookDAO() throws TopiaException { + return LimaCallaoDAOHelper.getEntryBookDAO(context); + } + + public VatStatementDAO getVatStatementDAO() throws TopiaException { + return LimaCallaoDAOHelper.getVatStatementDAO(context); + } + + public IdentityDAO getIdentityDAO() throws TopiaException { + return LimaCallaoDAOHelper.getIdentityDAO(context); + } } 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 2012-05-09 13:09:24 UTC (rev 3407) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/DefaultAccountingRules.java 2012-05-09 15:37:59 UTC (rev 3408) @@ -47,6 +47,7 @@ import org.chorem.lima.entity.EntryBookDAO; import org.chorem.lima.entity.EntryDAO; import org.chorem.lima.entity.FinancialPeriod; +import org.chorem.lima.entity.FinancialPeriodDAO; import org.chorem.lima.entity.FinancialTransaction; import org.chorem.lima.entity.FinancialTransactionDAO; import org.chorem.lima.entity.FiscalPeriod; @@ -157,24 +158,25 @@ */ @Override public void checkFinancialPeriodBlockedWithFinancialTransaction(FinancialTransaction financialTransaction, TopiaContext topiaContext) throws LimaException { - //check financial period locked - if (financialTransaction.getFinancialPeriod().getLocked()) { - throw new LimaBusinessException(_("lima-business.defaultaccountingrules.financialperiodblocked")); - } + + try { + //check financial period locked + FinancialPeriodDAO financialPeriodDAO = getDaoHelper().getFinancialPeriodDAO(); + FinancialPeriod financialPeriod = financialPeriodDAO.findByDate(financialTransaction.getTransactionDate()); + if (financialPeriod.isLocked()) { + throw new LimaBusinessException(_("lima-business.defaultaccountingrules.financialperiodblocked")); + } + + //check all entrybook of his financial period are blocked + //FIXME echatellier 20120509 il doit y avoir moyen de faire plus + //simple que de recuperer 2 listes et de comparer leur nombres + List<EntryBook> entryBooks = new ArrayList<EntryBook>(); + List<EntryBook> closedEntryBooks = new ArrayList<EntryBook>(); - //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); - ClosedPeriodicEntryBookDAO closedPeriodicEntryBookDAO = - LimaCallaoDAOHelper.getClosedPeriodicEntryBookDAO(topiaContext); - FinancialPeriod financialPeriod = - financialTransaction.getFinancialPeriod(); + EntryBookDAO entryBookDAO = getDaoHelper().getEntryBookDAO(); + ClosedPeriodicEntryBookDAO closedPeriodicEntryBookDAO = getDaoHelper().getClosedPeriodicEntryBookDAO(); + entryBooks = entryBookDAO.findAll(); - for (EntryBook entryBook : entryBooks) { ClosedPeriodicEntryBook closedPeriodicEntryBook = closedPeriodicEntryBookDAO.findByEntryBookAndFinancialPeriod( @@ -247,8 +249,8 @@ try { - FinancialPeriod financialPeriod = - entry.getFinancialTransaction().getFinancialPeriod(); + FinancialPeriodDAO financialPeriodDAO = getDaoHelper().getFinancialPeriodDAO(); + FinancialPeriod financialPeriod = financialPeriodDAO.findByDate(entry.getFinancialTransaction().getTransactionDate()); ClosedPeriodicEntryBookDAO closedPeriodicEntryBookDAO = LimaCallaoDAOHelper.getClosedPeriodicEntryBookDAO(topiaTransaction); @@ -288,25 +290,24 @@ */ @Override public void updateFinancialTransactionDateRules( - FinancialTransaction financialTransaction, FinancialTransaction financialTransactionOld, TopiaContext topiaContext) throws LimaException { + FinancialTransaction financialTransaction, FinancialTransaction financialTransactionOld) throws LimaException { - FinancialPeriod financialPeriod = financialTransaction.getFinancialPeriod(); - FinancialPeriod financialPeriodOld = financialTransactionOld.getFinancialPeriod(); - - //1. check old financial period locked - if (financialPeriodOld.getLocked()) { - throw new LimaBusinessException(_("lima-business.defaultaccountingrules.financialtransactionblocked")); - } - - //2. check new financial period locked - if (financialPeriod.getLocked()) { - throw new LimaBusinessException(_("lima-business.defaultaccountingrules.financialnewdateblocked")); - } - try { + FinancialPeriodDAO financialPeriodDAO = getDaoHelper().getFinancialPeriodDAO(); + FinancialPeriod financialPeriod = financialPeriodDAO.findByDate(financialTransaction.getTransactionDate()); + FinancialPeriod financialPeriodOld = financialPeriodDAO.findByDate(financialTransactionOld.getTransactionDate()); + + //1. check old financial period locked + if (financialPeriodOld.getLocked()) { + throw new LimaBusinessException(_("lima-business.defaultaccountingrules.financialtransactionblocked")); + } + + //2. check new financial period locked + if (financialPeriod.getLocked()) { + throw new LimaBusinessException(_("lima-business.defaultaccountingrules.financialnewdateblocked")); + } - ClosedPeriodicEntryBookDAO closedPeriodicEntryBookDAO = - LimaCallaoDAOHelper.getClosedPeriodicEntryBookDAO(topiaContext); + ClosedPeriodicEntryBookDAO closedPeriodicEntryBookDAO = getDaoHelper().getClosedPeriodicEntryBookDAO(); //3. the actual entrybook belong to a blocked closedPeriodicEntryBook ClosedPeriodicEntryBook closedPeriodicEntryBookOld = @@ -342,8 +343,7 @@ //7. check if date are on fiscal period - FiscalPeriodDAO fiscalPeriodDAO = - LimaCallaoDAOHelper.getFiscalPeriodDAO(topiaContext); + FiscalPeriodDAO fiscalPeriodDAO = getDaoHelper().getFiscalPeriodDAO(); //search fiscalperiod have financialperiod in params FiscalPeriod fiscalPeriod = fiscalPeriodDAO.findByFinancialPeriod(financialPeriod); @@ -394,8 +394,8 @@ }*/ - } catch (TopiaException eee) { - doCatch(topiaContext, eee, log); + } catch (TopiaException ex) { + throw new LimaException("Can't check financial transaction", ex); } } 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 2012-05-09 13:09:24 UTC (rev 3407) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/DocumentServiceImpl.java 2012-05-09 15:37:59 UTC (rev 3408) @@ -744,8 +744,8 @@ FormatsEnum format) throws LimaException { Document document = new Document(PageSize.A4, 8, 8, 8, 8); TopiaContext transaction = beginTransaction(rootContext); - ; + try { Date newDate = new Date(); String dateS = dateFormat.format(newDate); @@ -774,26 +774,17 @@ closedPeriodicEntryBookDAO.findAllByDates(beginDate, endDate); for (ClosedPeriodicEntryBook closedPeriodicEntryBook : closedPeriodicEntryBookList) { - TopiaQuery query = entryDAO.createQuery(); - String financialPeriodProperty = - TopiaQuery.getProperty(Entry.PROPERTY_FINANCIAL_TRANSACTION, - FinancialTransaction.PROPERTY_FINANCIAL_PERIOD); - String entryBookProperty = - TopiaQuery.getProperty(Entry.PROPERTY_FINANCIAL_TRANSACTION, - FinancialTransaction.PROPERTY_ENTRY_BOOK); - query.addWhere(financialPeriodProperty, Op.EQ, - closedPeriodicEntryBook.getFinancialPeriod()) - .addWhere(entryBookProperty, Op.EQ, - closedPeriodicEntryBook.getEntryBook()); + // TODO echatellier 20120509, was not about only + // balanced transaction here, normal ? + List<Entry> entries = entryDAO.findAllEntryOfTransaction(closedPeriodicEntryBook.getEntryBook(), + closedPeriodicEntryBook.getFinancialPeriod().getBeginDate(), + closedPeriodicEntryBook.getFinancialPeriod().getEndDate()); - List<Entry> entries = entryDAO.findAllByQuery(query); - - List<Object[]> results; - BigDecimal debit = new BigDecimal(0); - BigDecimal credit = new BigDecimal(0); - query.setSelect(Entry.PROPERTY_DEBIT, "SUM(" + Entry.PROPERTY_AMOUNT + ")"); - query.addGroup(Entry.PROPERTY_DEBIT); - results = query.execute(transaction); + List<Object[]> results = entryDAO.getDebitCreditOfTransaction(closedPeriodicEntryBook.getEntryBook(), + closedPeriodicEntryBook.getFinancialPeriod().getBeginDate(), + closedPeriodicEntryBook.getFinancialPeriod().getEndDate()); + BigDecimal debit = null; + BigDecimal credit = null; int nbAmount = results.size(); if (nbAmount == 2) { debit = (BigDecimal) results.get(0)[1]; @@ -1185,7 +1176,6 @@ Date endDate, FormatsEnum format) throws LimaException { TopiaContext transaction = beginTransaction(rootContext); - ; Document document = new Document(PageSize.A4, 8, 8, 8, 8); try { @@ -1215,15 +1205,8 @@ LimaCallaoDAOHelper.getClosedPeriodicEntryBookDAO(transaction); EntryDAO entryDAO = LimaCallaoDAOHelper.getEntryDAO(transaction); - - TopiaQuery financialPeriodsQuery = financialPeriodDAO.createQuery(); - 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); List<FinancialPeriod> financialPeriods = - financialPeriodDAO.findAllByQuery(financialPeriodsQuery); + financialPeriodDAO.findByDates(beginDate, endDate); List<GeneralEntryBooksDatas> list = new ArrayList<GeneralEntryBooksDatas>(); BigDecimal amountDebit = new BigDecimal(0); @@ -1237,24 +1220,12 @@ BigDecimal subAmountCredit = new BigDecimal(0); for (ClosedPeriodicEntryBook closedPeriodicEntryBook : closedPeriodicEntryBookList) { - List<Object[]> results; - TopiaQuery query = entryDAO.createQuery(); - BigDecimal debit = new BigDecimal(0); - BigDecimal credit = new BigDecimal(0); + BigDecimal debit = null; + BigDecimal credit = null; - String financialPeriodProperty = TopiaQuery.getProperty( - Entry.PROPERTY_FINANCIAL_TRANSACTION, - FinancialTransaction.PROPERTY_FINANCIAL_PERIOD); - String entryBookProperty = TopiaQuery.getProperty( - Entry.PROPERTY_FINANCIAL_TRANSACTION, - FinancialTransaction.PROPERTY_ENTRY_BOOK); - query.addWhere(financialPeriodProperty, Op.EQ, - closedPeriodicEntryBook.getFinancialPeriod()) - .addWhere(entryBookProperty, Op.EQ, - closedPeriodicEntryBook.getEntryBook()) - .setSelect(Entry.PROPERTY_DEBIT, "SUM(" + Entry.PROPERTY_AMOUNT + ")") - .addGroup(Entry.PROPERTY_DEBIT); - results = query.execute(transaction); + List<Object[]> results = entryDAO.getDebitCreditOfTransaction(closedPeriodicEntryBook.getEntryBook(), + closedPeriodicEntryBook.getFinancialPeriod().getBeginDate(), + closedPeriodicEntryBook.getFinancialPeriod().getEndDate()); int nbAmount = results.size(); if (nbAmount == 2) { 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 2012-05-09 13:09:24 UTC (rev 3407) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ExportServiceImpl.java 2012-05-09 15:37:59 UTC (rev 3408) @@ -521,19 +521,12 @@ String[] nextLine = new String[8]; nextLine[0] = ImportExportEntityEnum.FINANCIALTRANSACTION.getLabel(); nextLine[1] = String.valueOf(numTransaction); - nextLine[2] = - SDATEFORMAT.format(financialTransaction.getTransactionDate()); + nextLine[2] = SDATEFORMAT.format(financialTransaction.getTransactionDate()); nextLine[3] = financialTransaction.getAmountDebit().toString(); nextLine[4] = financialTransaction.getAmountCredit().toString(); - nextLine[5] = - SDATEFORMAT.format(financialTransaction.getFinancialPeriod(). - getBeginDate()); - nextLine[6] = - SDATEFORMAT.format(financialTransaction.getFinancialPeriod(). - getEndDate()); EntryBook entryBook = financialTransaction.getEntryBook(); if (entryBook != null) { - nextLine[7] = entryBook.getCode(); + nextLine[5] = entryBook.getCode(); } // Ajoute la ligne au fichier csvWriter.writeNext(nextLine); Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java 2012-05-09 13:09:24 UTC (rev 3407) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java 2012-05-09 15:37:59 UTC (rev 3408) @@ -134,13 +134,6 @@ return null; } - /** Return the list of all financial transaction of a financial period */ - @Override - public List<FinancialTransaction> getAllFinancialTransactions( - FinancialPeriod period) throws LimaException { - return getAllFinancialTransactions(period, null); - } - /** Return the list of all financial transaction from two dates */ @Override public List<FinancialTransaction> getAllFinancialTransactions( @@ -148,26 +141,8 @@ List<FinancialTransaction> financialTransactions = null; TopiaContext topiaTransaction = beginTransaction(rootContext); try { - FinancialTransactionDAO transactionDAO = - LimaCallaoDAOHelper.getFinancialTransactionDAO(topiaTransaction); - - 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.PROPERTY_TRANSACTION_DATE, beginDate, endDate) - - .addDistinct() - .addOrder("T." + FinancialTransaction.PROPERTY_TRANSACTION_DATE) - .addOrder("T." + FinancialTransaction.TOPIA_CREATE_DATE) - //load for lazy - .addLoad(financialPeriodProperty) - .addLoad(entryBookLabelProperty) - .addLeftJoin("T." + FinancialTransaction.PROPERTY_ENTRY, "E", true) - .addFetch("E." + Entry.PROPERTY_ACCOUNT); - financialTransactions = transactionDAO.findAllByQuery(query); + FinancialTransactionDAO transactionDAO = LimaCallaoDAOHelper.getFinancialTransactionDAO(topiaTransaction); + financialTransactions = transactionDAO.findAllByDates(beginDate, endDate); } catch (Exception ex) { doCatch(topiaTransaction, ex); } finally { @@ -176,6 +151,13 @@ return financialTransactions; } + /** Return the list of all financial transaction of a financial period */ + @Override + public List<FinancialTransaction> getAllFinancialTransactions( + FinancialPeriod period) throws LimaException { + return getAllFinancialTransactions(period, null); + } + /** Return the list of all financial transaction of a financial period and an entrybook */ @Override public List<FinancialTransaction> getAllFinancialTransactions(FinancialPeriod financialPeriod, EntryBook entryBook) throws LimaException { @@ -185,29 +167,15 @@ try { FinancialTransactionDAO transactionDAO = LimaCallaoDAOHelper.getFinancialTransactionDAO(topiaTransaction); - - 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.PROPERTY_ENTRY_BOOK, entryBook); + financialTransactions = transactionDAO.findAllByDates(financialPeriod.getBeginDate(), + financialPeriod.getEndDate(), entryBook); + } else { + financialTransactions = transactionDAO.findAllByDates(financialPeriod.getBeginDate(), + financialPeriod.getEndDate()); } - if (financialPeriod != null) { - query.addEquals(FinancialTransaction.PROPERTY_FINANCIAL_PERIOD, financialPeriod); - } - query.addDistinct() - .addOrder("T." + FinancialTransaction.PROPERTY_TRANSACTION_DATE) - .addOrder("T." + FinancialTransaction.TOPIA_CREATE_DATE) - //load for lazy - .addLoad(financialPeriodProperty) - .addLoad(entryBookLabelProperty) - .addLeftJoin("T." + FinancialTransaction.PROPERTY_ENTRY, "E", true) - .addFetch("E." + Entry.PROPERTY_ACCOUNT); - financialTransactions = transactionDAO.findAllByQuery(query); } catch (Exception ex) { doCatch(topiaTransaction, ex); } finally { @@ -217,7 +185,9 @@ } - /** Get unbalanced financialtransaction from selected fiscalperiod */ + /** + * Get unbalanced financialtransaction from selected fiscalperiod. + */ @Override public List<FinancialTransaction> getAllInexactFinancialTransactions(FiscalPeriod fiscalPeriod) throws LimaException { TopiaContext topiaContext = beginTransaction(rootContext); @@ -228,40 +198,8 @@ FinancialTransactionDAO financialTransactionDAO = LimaCallaoDAOHelper.getFinancialTransactionDAO(topiaContext); - // SELECT DISTINCT T - // FROM org.chorem.lima.entity.FinancialTransaction T, org.chorem.lima.entity.FiscalPeriod F - // LEFT JOIN FETCH T.entry E LEFT JOIN FETCH E.account - // LEFT JOIN FETCH E.letter - // WHERE (T.entryBook = null OR E.voucher = null OR E.voucher = '' OR E.description = null - // OR E.description = '') AND T.financialPeriod IN elements(F.financialPeriod) AND F = :F - // ORDER BY T.transactionDate, T.topiaCreateDate; - - TopiaQuery query = financialTransactionDAO.createQuery("T"); - String financialPeriodProperty = TopiaQuery.getProperty("T", FinancialTransaction.PROPERTY_FINANCIAL_PERIOD); - String entryBookLabelProperty = TopiaQuery.getProperty("T", FinancialTransaction.PROPERTY_ENTRY_BOOK); - query.addDistinct() - .addOrder("T." + FinancialTransaction.PROPERTY_TRANSACTION_DATE) - .addOrder("T." + FinancialTransaction.TOPIA_CREATE_DATE) - .addFrom(FiscalPeriod.class, "F") - .addLeftJoin("T." + FinancialTransaction.PROPERTY_ENTRY, "E", true) - .addWhere("(select sum(amount) from " + Entry.class.getName() + " where debit = false and financialTransaction = T) <> " + - "(select sum(amount) from " + Entry.class.getName() + " where debit = true and financialTransaction = T) OR " + - "(select sum(amount) from " + Entry.class.getName() + " where debit = true and financialTransaction = T) = null OR " + - "(select sum(amount) from " + Entry.class.getName() + " where debit = false and financialTransaction = T) = null 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.PROPERTY_ACCOUNT) - .addLoad(financialPeriodProperty) - .addLoad(entryBookLabelProperty); - - if (log.isDebugEnabled()) { - log.debug("Query = " + query.toString()); - } - - result = financialTransactionDAO.findAllByQuery(query); + result = financialTransactionDAO.getAllIncorrectTransaction(fiscalPeriod.getBeginDate(), + fiscalPeriod.getEndDate(), null); for (FinancialTransaction fTransaction : result) { BigDecimal credit = fTransaction.getAmountCredit(); BigDecimal debit = fTransaction.getAmountDebit(); @@ -312,19 +250,9 @@ FinancialTransactionDAO financialTransactionDAO = LimaCallaoDAOHelper.getFinancialTransactionDAO(topiaContext); - // 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.PROPERTY_ENTRY, "E", false) - .addWhere("(select sum(amount) from " + Entry.class.getName() + " where debit = false and financialTransaction = T) <> " + - "(select sum(amount) from " + Entry.class.getName() + " where debit = true and financialTransaction = T)") - .addNotNull("E.account") - .addNotNull("T.entryBook") - .addInElements("T.financialPeriod", "F.financialPeriod") - .addEquals("F", fiscalPeriod); + result = financialTransactionDAO.getAllBalancedTransaction(fiscalPeriod.getBeginDate(), + fiscalPeriod.getEndDate(), null); - result = financialTransactionDAO.findAllByQuery(query); - } catch (TopiaException ex) { doCatch(topiaContext, ex); } @@ -352,7 +280,9 @@ } - /** Method used by update entry and remove entry for update amounts */ + /** + * Method used by update entry and remove entry for update amounts. + */ @Override public void updateFinancialTransactionWithTransaction(FinancialTransaction financialtransaction, TopiaContext topiaContext) throws LimaException { @@ -365,26 +295,11 @@ FinancialTransaction financialTransactionOld = transactionDAO.findByTopiaId(financialtransaction.getTopiaId()); - /* if update date change - 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 - */ - Date oldDate = financialTransactionOld.getTransactionDate(); - Date newDate = financialtransaction.getTransactionDate(); - if (newDate.compareTo(oldDate) != 0) { - financialTransactionOld.setTransactionDate(newDate); - //change financial period - FinancialPeriodDAO financialPeriodDAO = - LimaCallaoDAOHelper.getFinancialPeriodDAO(topiaContext); - FinancialPeriod financialPeriod = financialPeriodDAO.findByDate(newDate); - if (financialPeriod != null) { - financialTransactionOld.setFinancialPeriod(financialPeriod); - } - } + // FIXME echatellier 20120509, plusieurs chose à verifier ici: + // changement de date induisant en changement de période, verifier + // la permission (periode close/non close à l'arrivée) accountingRules.updateFinancialTransactionDateRules( - financialtransaction, financialTransactionOld, topiaContext); + financialtransaction, financialTransactionOld); financialTransactionOld.setEntryBook( financialtransaction.getEntryBook()); @@ -553,8 +468,8 @@ query.addDistinct(); query.addLeftJoin("T." + FinancialTransaction.PROPERTY_ENTRY, "E", true); //Load for lazy - query.addLoad(FinancialTransaction.PROPERTY_ENTRY_BOOK) - .addLoad(FinancialTransaction.PROPERTY_FINANCIAL_PERIOD); + query.addLoad(FinancialTransaction.PROPERTY_ENTRY_BOOK); + // .addLoad(FinancialTransaction.PROPERTY_FINANCIAL_PERIOD); Date beginDate = financialTransactionSearch.getBeginDate(); Date endDate = financialTransactionSearch.getEndDate(); 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 2012-05-09 13:09:24 UTC (rev 3407) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FiscalPeriodServiceImpl.java 2012-05-09 15:37:59 UTC (rev 3408) @@ -421,7 +421,6 @@ if (lastFPeriod != null) { //Sets the endfinancialTransaction endfinancialTransaction.setEntryBook(entryBook); - endfinancialTransaction.setFinancialPeriod(lastFPeriod); endfinancialTransaction.setTransactionDate(fiscalPeriod.getEndDate()); financialTransactionService.createFinancialTransaction(endfinancialTransaction); } @@ -432,7 +431,6 @@ if (found) { //Sets the endfinancialTransaction beginfinancialTransaction.setEntryBook(entryBook); - beginfinancialTransaction.setFinancialPeriod(beginfinancialPeriod); beginfinancialTransaction.setTransactionDate(beginfinancialPeriod.getBeginDate()); financialTransactionService.createFinancialTransaction(beginfinancialTransaction); } Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java 2012-05-09 13:09:24 UTC (rev 3407) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java 2012-05-09 15:37:59 UTC (rev 3408) @@ -282,10 +282,6 @@ financialTransaction = new FinancialTransactionImpl(); financialTransaction.setEntryBook(entryBook); financialTransaction.setTransactionDate(date); - FinancialPeriod financialPeriod = financialPeriodDAO - .findByDate(date); - financialTransaction - .setFinancialPeriod(financialPeriod); financialTransactionService .createFinancialTransactionWithTransaction( financialTransaction, topiaContext); @@ -927,9 +923,7 @@ financialTransactionImport.setDate(nextLine[2]); financialTransactionImport.setAmountDebit(nextLine[3]); financialTransactionImport.setAmountCredit(nextLine[4]); - financialTransactionImport.setBeginDateFinancialPeriod(nextLine[5]); - financialTransactionImport.setEndDateFinancialPeriod(nextLine[6]); - financialTransactionImport.setCodeEntryBook(nextLine[7]); + financialTransactionImport.setCodeEntryBook(nextLine[5]); financialTransactions.put(num, financialTransactionImport); } @@ -1233,11 +1227,7 @@ .getCodeEntryBook()); financialTransaction.setEntryBook(entryBook); - FinancialPeriod financialPeriod = financialPeriodDAO - .findByDate(dateFinancialTransaction); - financialTransactionDAO.create(financialTransaction); - financialTransaction.setFinancialPeriod(financialPeriod); List<EntryImport> entryImports = entries.get(map.getKey()); for (EntryImport entryImport : entryImports) { 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 2012-05-09 13:09:24 UTC (rev 3407) +++ trunk/lima-business/src/test/java/org/chorem/lima/business/AbstractLimaTest.java 2012-05-09 15:37:59 UTC (rev 3408) @@ -52,7 +52,6 @@ import org.chorem.lima.entity.EntryBook; import org.chorem.lima.entity.EntryBookImpl; import org.chorem.lima.entity.EntryImpl; -import org.chorem.lima.entity.FinancialPeriod; import org.chorem.lima.entity.FinancialTransaction; import org.chorem.lima.entity.FinancialTransactionImpl; import org.chorem.lima.entity.FiscalPeriod; @@ -280,13 +279,9 @@ EntryBook journalDesVentes = entryBookService.getEntryBookByCode("jdv"); Account accountVmpVae = accountService.getAccountByNumber("511"); - // TODO echatellier 20120116 improve period choice - FinancialPeriod financialPeriod = financialPeriodService.getAllFinancialPeriods().get(0); - FinancialTransaction transaction1 = new FinancialTransactionImpl(); transaction1.setTransactionDate(df.parse("April 4, 2012")); transaction1.setEntryBook(journalDesVentes); - transaction1.setFinancialPeriod(financialPeriod); transaction1 = financialTransactionService.createFinancialTransaction(transaction1); Entry tr1Entry1 = new EntryImpl(); Modified: trunk/lima-business/src/test/java/org/chorem/lima/business/FinancialTransactionServiceImplTest.java =================================================================== --- trunk/lima-business/src/test/java/org/chorem/lima/business/FinancialTransactionServiceImplTest.java 2012-05-09 13:09:24 UTC (rev 3407) +++ trunk/lima-business/src/test/java/org/chorem/lima/business/FinancialTransactionServiceImplTest.java 2012-05-09 15:37:59 UTC (rev 3408) @@ -27,7 +27,6 @@ import org.chorem.lima.entity.Entry; import org.chorem.lima.entity.EntryBook; import org.chorem.lima.entity.EntryImpl; -import org.chorem.lima.entity.FinancialPeriod; import org.chorem.lima.entity.FinancialTransaction; import org.chorem.lima.entity.FinancialTransactionImpl; import org.chorem.lima.entity.FiscalPeriod; @@ -83,13 +82,9 @@ EntryBook journalDesVentes = entryBookService.getEntryBookByCode("jdv"); Account accountVmpVae = accountService.getAccountByNumber("511"); - // TODO echatellier 20120116 improve period choice - FinancialPeriod financialPeriod = financialPeriodService.getAllFinancialPeriods().get(0); - FinancialTransaction transaction1 = new FinancialTransactionImpl(); transaction1.setTransactionDate(df.parse("April 5, 2012")); transaction1.setEntryBook(journalDesVentes); - transaction1.setFinancialPeriod(financialPeriod); transaction1 = financialTransactionService.createFinancialTransaction(transaction1); Entry tr1Entry1 = new EntryImpl(); @@ -129,13 +124,9 @@ EntryBook journalDesVentes = entryBookService.getEntryBookByCode("jdv"); Account accountVmpVae = accountService.getAccountByNumber("511"); - // TODO echatellier 20120116 improve period choice - FinancialPeriod financialPeriod = financialPeriodService.getAllFinancialPeriods().get(0); - FinancialTransaction transaction1 = new FinancialTransactionImpl(); transaction1.setTransactionDate(df.parse("April 5, 2012")); transaction1.setEntryBook(journalDesVentes); - transaction1.setFinancialPeriod(financialPeriod); transaction1 = financialTransactionService.createFinancialTransaction(transaction1); Entry tr1Entry1 = new EntryImpl(); Modified: trunk/lima-business/src/test/java/org/chorem/lima/business/ReportServiceImplTest.java =================================================================== --- trunk/lima-business/src/test/java/org/chorem/lima/business/ReportServiceImplTest.java 2012-05-09 13:09:24 UTC (rev 3407) +++ trunk/lima-business/src/test/java/org/chorem/lima/business/ReportServiceImplTest.java 2012-05-09 15:37:59 UTC (rev 3408) @@ -30,7 +30,6 @@ import org.chorem.lima.entity.Entry; import org.chorem.lima.entity.EntryBook; import org.chorem.lima.entity.EntryImpl; -import org.chorem.lima.entity.FinancialPeriod; import org.chorem.lima.entity.FinancialTransaction; import org.chorem.lima.entity.FinancialTransactionImpl; import org.junit.Assert; @@ -89,13 +88,9 @@ EntryBook journalDesVentes = entryBookService.getEntryBookByCode("jdv"); Account accountVmpVae = accountService.getAccountByNumber("511"); - // TODO echatellier 20120116 improve period choice - FinancialPeriod financialPeriod = financialPeriodService.getAllFinancialPeriods().get(0); - FinancialTransaction transaction1 = new FinancialTransactionImpl(); transaction1.setTransactionDate(df.parse("April 5, 2012")); transaction1.setEntryBook(journalDesVentes); - transaction1.setFinancialPeriod(financialPeriod); transaction1 = financialTransactionService.createFinancialTransaction(transaction1); Entry tr1Entry1 = new EntryImpl(); Modified: trunk/lima-callao/src/main/java/org/chorem/lima/entity/EntryDAOImpl.java =================================================================== --- trunk/lima-callao/src/main/java/org/chorem/lima/entity/EntryDAOImpl.java 2012-05-09 13:09:24 UTC (rev 3407) +++ trunk/lima-callao/src/main/java/org/chorem/lima/entity/EntryDAOImpl.java 2012-05-09 15:37:59 UTC (rev 3408) @@ -140,4 +140,53 @@ "endDate", endDate, "entryBook", entryBook); return result; } + + /** + * Retourne les entrees des transaction entre deux dates pour + * un journal. + * + * @param entryBook entry book + * @param beginDate begin date + * @param endDate end date + * @throws TopiaException + */ + public List<Entry> findAllEntryOfTransaction(EntryBook entryBook, Date beginDate, + Date endDate) throws TopiaException { + String query = "FROM " + Entry.class.getName() + " E" + + // entre les 2 dates + " WHERE :beginDate <= E.financialTransaction.transactionDate" + + " AND E.financialTransaction.transactionDate <= :endDate" + + // concerne le compte + " AND E.entryBook = :entryBook"; + + List<Entry> entries = context.find(query, "beginDate", beginDate, + "endDate", endDate, "entryBook", entryBook); + return entries; + } + + /** + * Retourne la somme des entrées des transaction entre + * deux dates pour un journal donné. + * + * @param entryBook entry book + * @param beginDate bebin date + * @param endDate end date + * @return list boolean,int (une ligne pour le debit true, une ligne pour le credit) + * @throws TopiaException + */ + public List<Object[]> getDebitCreditOfTransaction(EntryBook entryBook, + Date beginDate, Date endDate) throws TopiaException { + String query = "SELECT E.debit, sum(E.amount) " + + "FROM " + Entry.class.getName() + " E" + + // entre les 2 dates + " WHERE :beginDate <= E.financialTransaction.transactionDate" + + " AND E.financialTransaction.transactionDate <= :endDate" + + // concerne le compte + " AND E.entryBook = :entryBook" + + " GROUP BY E.debit"; + + List<Object[]> result = context.find(query, "beginDate", beginDate, + "endDate", endDate, "entryBook", entryBook); + return result; + } } Modified: trunk/lima-callao/src/main/java/org/chorem/lima/entity/FinancialPeriodDAOImpl.java =================================================================== --- trunk/lima-callao/src/main/java/org/chorem/lima/entity/FinancialPeriodDAOImpl.java 2012-05-09 13:09:24 UTC (rev 3407) +++ trunk/lima-callao/src/main/java/org/chorem/lima/entity/FinancialPeriodDAOImpl.java 2012-05-09 15:37:59 UTC (rev 3408) @@ -54,5 +54,24 @@ } return result; } + + /** + * Return all FinancialPeriod with begin date between two given dates. + * + * @param beginDate period begin date + * @param endDate period end date + * @return FinancialPeriod for {@code date} + * @throws TopiaException + */ + public List<FinancialPeriod> findByDates(Date beginDate, Date endDate) throws TopiaException { + String query = "FROM " + FinancialPeriod.class.getName() + + " WHERE :beginDate <= beginDate" + + " AND beginDate <= :endDate"; + + // add unique result here + List<FinancialPeriod> financialPeriod = context.find(query, "beginDate", beginDate, "endDate", endDate); + return financialPeriod; + } + } Modified: trunk/lima-callao/src/main/java/org/chorem/lima/entity/FinancialTransactionDAOImpl.java =================================================================== --- trunk/lima-callao/src/main/java/org/chorem/lima/entity/FinancialTransactionDAOImpl.java 2012-05-09 13:09:24 UTC (rev 3407) +++ trunk/lima-callao/src/main/java/org/chorem/lima/entity/FinancialTransactionDAOImpl.java 2012-05-09 15:37:59 UTC (rev 3408) @@ -25,6 +25,7 @@ package org.chorem.lima.entity; +import java.util.Date; import java.util.List; import org.nuiton.topia.TopiaException; @@ -54,6 +55,44 @@ } /** + * Find all transactions between two dates. + * + * @param beginDate begin date + * @param endDate end date + * @return unbalanced transactions + * @throws TopiaException + */ + public List<FinancialTransaction> findAllByDates(Date beginDate, Date endDate) throws TopiaException { + String query = "FROM " + FinancialTransaction.class.getName() + " T"+ + " WHERE :beginDate <= T.transactionDate" + + " AND T.transactionDate <= :endDate" + + " ORDER BY T.transactionDate, T." + FinancialTransaction.TOPIA_CREATE_DATE; + List<FinancialTransaction> result = context.find(query, "beginDate", + beginDate, "endDate", endDate); + return result; + } + + /** + * Find all transactions between two dates in an entry book. + * + * @param beginDate begin date + * @param endDate end date + * @param entryBook entry book + * @return unbalanced transactions + * @throws TopiaException + */ + public List<FinancialTransaction> findAllByDates(Date beginDate, Date endDate, EntryBook entryBook) throws TopiaException { + String query = "FROM " + FinancialTransaction.class.getName() + " T"+ + " WHERE :beginDate <= T.transactionDate" + + " AND T.transactionDate <= :endDate" + + " AND T.entryBook = :entryBook" + + " ORDER BY T.transactionDate, T." + FinancialTransaction.TOPIA_CREATE_DATE; + List<FinancialTransaction> result = context.find(query, "beginDate", + beginDate, "endDate", endDate, "entryBook", entryBook); + return result; + } + + /** * Find all unbalanced transactions. * * @param financialPeriod period @@ -61,6 +100,7 @@ * @return unbalanced transactions * @throws TopiaException */ + @Deprecated public List<FinancialTransaction> getAllUnbalancedTransaction(FinancialPeriod financialPeriod, EntryBook entryBook) throws TopiaException { String query = "FROM " + FinancialTransaction.class.getName() + " T"+ @@ -74,8 +114,101 @@ financialPeriod, "entryBook", entryBook); return result; } + + /** + * Find all unbalanced transactions. + * + * @param beginDate beginDate + * @param endDate endDate + * @param entryBook entry book (can be null) + * @return unbalanced transactions + * @throws TopiaException + */ + public List<FinancialTransaction> getAllUnbalancedTransaction(Date beginDate, Date endDate, + EntryBook entryBook) throws TopiaException { + String query = "FROM " + FinancialTransaction.class.getName() + " T"+ + " WHERE (SELECT sum(amount) FROM " + Entry.class.getName() + + " WHERE debit = true AND financialTransaction = T) != " + + " (SELECT sum(amount) FROM " + Entry.class.getName() + + " WHERE debit = false AND financialTransaction = T)" + + " AND :beginDate <= T.transactionDate" + + " AND T.transactionDate <= :endDate"; + List<FinancialTransaction> result = null; + if (entryBook != null) { + query += " AND T.entryBook = :entryBook"; + result = context.find(query, "beginDate", beginDate, "endDate", endDate, "entryBook", entryBook); + } else { + result = context.find(query, "beginDate", beginDate, "endDate", endDate); + } + return result; + } + /** + * Find all unbalanced transactions. + * + * @param beginDate beginDate + * @param endDate endDate + * @param entryBook entry book (can be null) + * @return unbalanced transactions + * @throws TopiaException + */ + public List<FinancialTransaction> getAllBalancedTransaction(Date beginDate, Date endDate, + EntryBook entryBook) throws TopiaException { + String query = "FROM " + FinancialTransaction.class.getName() + " T"+ + " WHERE (SELECT sum(amount) FROM " + Entry.class.getName() + + " WHERE debit = true AND financialTransaction = T) = " + + " (SELECT sum(amount) FROM " + Entry.class.getName() + + " WHERE debit = false AND financialTransaction = T)" + + " AND :beginDate <= T.transactionDate" + + " AND T.transactionDate <= :endDate"; + List<FinancialTransaction> result = null; + if (entryBook != null) { + query += " AND T.entryBook = :entryBook"; + result = context.find(query, "beginDate", beginDate, "endDate", endDate, "entryBook", entryBook); + } else { + result = context.find(query, "beginDate", beginDate, "endDate", endDate); + } + + return result; + } + + /** + * Find all unbalanced transactions. + * + * @param beginDate beginDate + * @param endDate endDate + * @param entryBook entry book (can be null) + * @return unbalanced transactions + * @throws TopiaException + */ + public List<FinancialTransaction> getAllIncorrectTransaction(Date beginDate, Date endDate, + EntryBook entryBook) throws TopiaException { + String query = "FROM " + FinancialTransaction.class.getName() + " T"+ + " LEFT JOIN T.entry AS E" + + " WHERE ((SELECT sum(amount) FROM " + Entry.class.getName() + + " WHERE debit = true AND financialTransaction = T) != " + + " (SELECT sum(amount) FROM " + Entry.class.getName() + + " WHERE debit = false AND financialTransaction = T)" + + " OR E.account = null" + + " OR E.voucher = null" + + " OR E.voucher = ''" + + " OR E.description = null" + + " OR E.description = '')" + + " AND :beginDate <= T.transactionDate" + + " AND T.transactionDate <= :endDate"; + List<FinancialTransaction> result = null; + if (entryBook != null) { + query += " AND T.entryBook = :entryBook"; + result = context.find(query, "beginDate", beginDate, "endDate", endDate, "entryBook", entryBook); + } else { + result = context.find(query, "beginDate", beginDate, "endDate", endDate); + } + + return result; + } + + /** * Find all transaction where some field are not filled in. * * @param financialPeriod period @@ -83,6 +216,7 @@ * @return unfilled transaction * @throws TopiaException */ + @Deprecated public List<FinancialTransaction> getAllUnfilledTransaction(FinancialPeriod financialPeriod, EntryBook entryBook) throws TopiaException { String query = "FROM " + FinancialTransaction.class.getName() + " T"+ @@ -108,14 +242,6 @@ * @throws TopiaException */ public List<FinancialTransaction> getAllTransactionWithoutEntryBook() throws TopiaException { - /*TopiaQuery query = createQuery("T"); - query.addDistinct() - .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); - List<FinancialTransaction> result = findAllByQuery(query);*/ String query = "FROM " + FinancialTransaction.class.getName() + " T"+ " LEFT JOIN T.entry AS E" + Modified: trunk/lima-callao/src/main/xmi/accounting.properties =================================================================== --- trunk/lima-callao/src/main/xmi/accounting.properties 2012-05-09 13:09:24 UTC (rev 3407) +++ trunk/lima-callao/src/main/xmi/accounting.properties 2012-05-09 15:37:59 UTC (rev 3408) @@ -48,6 +48,8 @@ # lazy org.chorem.lima.entity.FiscalPeriod.attribute.financialPeriod.tagvalue.lazy=false +org.chorem.lima.entity.FinancialTransaction.attribute.entry.tagvalue.lazy=false +org.chorem.lima.entity.Entry.attribute.account.tagvalue.lazy=false org.chorem.lima.entity.FinancialStatement.attribute.subFinancialStatements.tagvalue.lazy=false org.chorem.lima.entity.FinancialStatement.attribute.masterFinancialStatement.tagvalue.lazy=false org.chorem.lima.entity.VatStatement.attribute.subVatStatements.tagvalue.lazy=false Modified: trunk/lima-callao/src/main/xmi/accounting.zargo =================================================================== (Binary files differ) Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionViewHandler.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionViewHandler.java 2012-05-09 13:09:24 UTC (rev 3407) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionViewHandler.java 2012-05-09 15:37:59 UTC (rev 3408) @@ -310,7 +310,6 @@ FinancialTransactionTableModel tableModel = view.getFinancialTransactionTableModel(); FinancialTransaction financialTransaction = new FinancialTransactionImpl(); - financialTransaction.setFinancialPeriod(financialPeriod); // can be defined later by user if (entryBook != null) { financialTransaction.setEntryBook(entryBook); Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchTableModel.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchTableModel.java 2012-05-09 13:09:24 UTC (rev 3407) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchTableModel.java 2012-05-09 15:37:59 UTC (rev 3408) @@ -364,7 +364,7 @@ } else { throw new LimaException("Can't set new transaction"); } - financialTransaction.setFinancialPeriod(financialPeriod); + //financialTransaction.setSelectedFinancialPeriod(selectedFiscalPeriod); // get today Calendar actualCalendar = Calendar.getInstance();
participants (1)
-
echatellier@users.chorem.org