Author: dcosse Date: 2014-08-04 12:44:17 +0200 (Mon, 04 Aug 2014) New Revision: 3891 Url: http://forge.chorem.org/projects/lima/repository/revisions/3891 Log: refs #1032 import des ?\195?\169critures depuis EBP Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/EntryBookService.java trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialTransactionService.java trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FiscalPeriodService.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/EntryBookServiceImpl.java trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialStatementServiceImpl.java trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FiscalPeriodServiceImpl.java trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/VatStatementServiceImpl.java trunk/lima-business/src/test/java/org/chorem/lima/business/ImportExportServiceTest.java trunk/lima-business/src/test/resources/ebp/ecritures.txt trunk/lima-callao/src/main/java/org/chorem/lima/entity/EntryTopiaDao.java trunk/pom.xml 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 2014-08-01 15:52:09 UTC (rev 3890) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/DocumentServiceImpl.java 2014-08-04 10:44:17 UTC (rev 3891) @@ -129,7 +129,7 @@ for (int i = 0; i < size; i++) { FinancialStatementAmounts fStatementAmounts = financialStatementAmounts.get(i); - if (fStatementAmounts.getLevel() == 1 && !fStatementAmounts.getSubAmount()) { + if (fStatementAmounts.getLevel() == 1 && !fStatementAmounts.isSubAmount()) { if (first) { first = false; } else { @@ -200,7 +200,7 @@ } //Phrase phrase; String tabLabel = ""; - if (financialStatementAmount.getHeader()) { + if (financialStatementAmount.isHeader()) { tabLabel = boldBegin + tab + label + boldEnd; } else { tabLabel = tab + label; @@ -521,8 +521,8 @@ balanceReport += "\t\t<tbody>\n"; for (ReportsDatas reportsDatas : list) { - String soldeDebit = String.valueOf(reportsDatas.getSoldeDebit() ? reportsDatas.getAmountSolde() : 0); - String soldeCredit = String.valueOf(reportsDatas.getSoldeDebit() ? 0 : reportsDatas.getAmountSolde()); + String soldeDebit = String.valueOf(reportsDatas.isSoldeDebit() ? reportsDatas.getAmountSolde() : 0); + String soldeCredit = String.valueOf(reportsDatas.isSoldeDebit() ? 0 : reportsDatas.getAmountSolde()); String [] columnsBalanceAmount = {reportsDatas.getAccount().getAccountNumber(), reportsDatas.getAccount().getLabel(), reportsDatas.getAmountDebit().toString(), reportsDatas.getAmountCredit().toString(), @@ -532,7 +532,7 @@ currentAmountDebit = currentAmountDebit.add(reportsDatas.getAmountDebit()); currentAmountCredit = currentAmountCredit.add(reportsDatas.getAmountCredit()); - if (reportsDatas.getSoldeDebit()) { + if (reportsDatas.isSoldeDebit()) { currentSoldeDebit = currentSoldeDebit.add(reportsDatas.getAmountSolde()); } else { currentSoldeCredit = currentSoldeCredit.add(reportsDatas.getAmountSolde()); @@ -668,7 +668,7 @@ for (GeneralEntryBooksDatas generalEntryBooksDataInList : list) { if (!generalEntryBooksDataInList.getDebit().equals(BigDecimal.ZERO) && !generalEntryBooksDataInList.getCredit().equals(BigDecimal.ZERO)) { - if (!generalEntryBooksDataInList.getAmount() && !generalEntryBooksDataInList.getSubAmount()) { + if (!generalEntryBooksDataInList.isAmount() && !generalEntryBooksDataInList.isSubAmount()) { String code; String description; if (!entryBookCode.equals(generalEntryBooksDataInList.getCode())) { @@ -687,7 +687,7 @@ even = !even; } else { String amount; - if (generalEntryBooksDataInList.getAmount()) { + if (generalEntryBooksDataInList.isAmount()) { amount = t("lima-business.document.amounts"); } else { amount = t("lima-business.document.amountsperiod", generalEntryBooksDataInList.getPeriod()); Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/EntryBookServiceImpl.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/EntryBookServiceImpl.java 2014-08-01 15:52:09 UTC (rev 3890) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/EntryBookServiceImpl.java 2014-08-04 10:44:17 UTC (rev 3891) @@ -58,6 +58,13 @@ public class EntryBookServiceImpl extends AbstractLimaService implements EntryBookService { @Override + public EntryBook createNewEntryBook(){ + EntryBookTopiaDao entryBookTopiaDao = getDaoHelper().getEntryBookDao(); + EntryBook result = entryBookTopiaDao.newInstance(); + return result; + } + + @Override public boolean createOrUpdateEntryBook(EntryBook entryBook) { EntryBookTopiaDao entryBookTopiaDao = getDaoHelper().getEntryBookDao(); EntryBook existingEntryBook = entryBookTopiaDao.forCodeEquals(entryBook.getCode()).findUniqueOrNull(); 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 2014-08-01 15:52:09 UTC (rev 3890) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialStatementServiceImpl.java 2014-08-04 10:44:17 UTC (rev 3891) @@ -427,7 +427,7 @@ true, selectedBeginDate, selectedEndDate); - if (reportsDatas.getSoldeDebit()) { + if (reportsDatas.isSoldeDebit()) { debitTemp = debitTemp.add(reportsDatas.getAmountSolde()); } else { creditTemp = creditTemp.add(reportsDatas.getAmountSolde()); 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 2014-08-01 15:52:09 UTC (rev 3890) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java 2014-08-04 10:44:17 UTC (rev 3891) @@ -97,6 +97,13 @@ } @Override + public Entry createNewEntry(){ + EntryTopiaDao entryTopiaDao = getDaoHelper().getEntryDao(); + Entry result = entryTopiaDao.newInstance(); + return result; + } + + @Override public FinancialTransaction createFinancialTransaction(FinancialTransaction financialtransaction) throws LockedFinancialPeriodException, LockedEntryBookException { @@ -129,6 +136,14 @@ return financialTransactions; } + @Override + public List<FinancialTransaction> getAllFinancialTransactions(Date beginDate, Date endDate, EntryBook entryBook) { + FinancialTransactionTopiaDao transactionTopiaDao = getDaoHelper().getFinancialTransactionDao(); + List<FinancialTransaction> financialTransactions = transactionTopiaDao.findAllByDates(beginDate, endDate, entryBook); + + return financialTransactions; + } + /** Find the last three letters used * and increment them * */ 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 2014-08-01 15:52:09 UTC (rev 3890) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FiscalPeriodServiceImpl.java 2014-08-04 10:44:17 UTC (rev 3891) @@ -198,6 +198,14 @@ } @Override + public List<FiscalPeriod> getAllUnblockedFiscalPeriodsByBeginDate() { + + FiscalPeriodTopiaDao fiscalPeriodTopiaDao = getDaoHelper().getFiscalPeriodDao(); + List<FiscalPeriod> result = fiscalPeriodTopiaDao.forLockedEquals(false).setOrderByArguments(FiscalPeriod.PROPERTY_BEGIN_DATE).findAll(); + return result; + } + + @Override public FiscalPeriod getLastFiscalPeriod() { FiscalPeriodTopiaDao fiscalPeriodTopiaDao = getDaoHelper().getFiscalPeriodDao(); @@ -405,7 +413,7 @@ beginEntry.setFinancialTransaction(endfinancialTransaction); beginEntry.setAccount(report.getAccount()); beginEntry.setAmount(report.getAmountSolde().abs()); - beginEntry.setDebit(!report.getSoldeDebit()); + beginEntry.setDebit(!report.isSoldeDebit()); financialTransactionService.createEntry(beginEntry); //save amounts inside account number 891 @@ -415,7 +423,7 @@ beginEntry.setFinancialTransaction(endfinancialTransaction); beginEntry.setAccount(endRetainedAccount); beginEntry.setAmount(report.getAmountSolde().abs()); - beginEntry.setDebit(report.getSoldeDebit()); + beginEntry.setDebit(report.isSoldeDebit()); financialTransactionService.createEntry(beginEntry); //open new year accounts if new year exists and a date has been found for the transaction @@ -426,7 +434,7 @@ beginEntry.setFinancialTransaction(beginfinancialTransaction); beginEntry.setAccount(report.getAccount()); beginEntry.setAmount(report.getAmountSolde().abs()); - beginEntry.setDebit(report.getSoldeDebit()); + beginEntry.setDebit(report.isSoldeDebit()); financialTransactionService.createEntry(beginEntry); //close account by removing amount from account number 890 beginEntry = new EntryImpl(); @@ -435,7 +443,7 @@ beginEntry.setFinancialTransaction(beginfinancialTransaction); beginEntry.setAccount(endRetainedAccount); beginEntry.setAmount(report.getAmountSolde().abs()); - beginEntry.setDebit(!report.getSoldeDebit()); + beginEntry.setDebit(!report.isSoldeDebit()); financialTransactionService.createEntry(beginEntry); } } 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 2014-08-01 15:52:09 UTC (rev 3890) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java 2014-08-04 10:44:17 UTC (rev 3891) @@ -62,12 +62,9 @@ import org.chorem.lima.business.ejb.ebp.EntryBookEBPModel; import org.chorem.lima.business.ejb.ebp.EntryEBPModel; import org.chorem.lima.business.utils.EntryEBPComparator; -import org.chorem.lima.business.utils.FiscalPeriodComparator; import org.chorem.lima.entity.Account; import org.chorem.lima.entity.Entry; import org.chorem.lima.entity.EntryBook; -import org.chorem.lima.entity.EntryBookImpl; -import org.chorem.lima.entity.EntryImpl; import org.chorem.lima.entity.FinancialStatement; import org.chorem.lima.entity.FinancialTransaction; import org.chorem.lima.entity.FiscalPeriod; @@ -140,6 +137,13 @@ } }; + protected static final Function<FinancialTransaction, Date> GET_FINANCIAL_TRANSACTION_DATE_FUNCTION = new Function<FinancialTransaction, Date>() { + @Override + public Date apply(FinancialTransaction input) { + return input.getTransactionDate(); + } + }; + @Override public ImportResult importAccountAsCSV(String contents) { InputStream contentStream = IOUtils.toInputStream(contents); @@ -642,15 +646,15 @@ @Override public ImportResult importEntriesFromEbp(String datas) { + // use for logs + long before = System.currentTimeMillis(); + ImportResult result = new ImportResult(); if (datas.isEmpty()) { result.getException().addException(0, new ImportEbpException(t("lima-business.import.ebpnoentry"))); return result; } - // use for logs - long before = System.currentTimeMillis(); - List<Account> accounts = accountService.getAllAccounts(); if (accounts == null) { accounts = Lists.newArrayList(); @@ -665,22 +669,18 @@ InputStream contentStream = null; try { - contentStream = IOUtils.toInputStream(datas); + contentStream = IOUtils.toInputStream(datas); ImportModel<EntryEBP> model = new EntryEBPModel(); - Import<EntryEBP> importedEntryEBPs = Import.newImport(model, contentStream); List<EntryEBP> entryEBPs = new ArrayList<>(); for (EntryEBP entryEBP : importedEntryEBPs) { entryEBPs.add(entryEBP); } - Collections.sort(entryEBPs, new EntryEBPComparator()); // Get all the valid fiscalPeriods Ordered by date. - List<FiscalPeriod> fiscalPeriods = fiscalPeriodService - .getAllUnblockedFiscalPeriods(); - Collections.sort(fiscalPeriods, new FiscalPeriodComparator()); + List<FiscalPeriod> fiscalPeriods = fiscalPeriodService.getAllUnblockedFiscalPeriodsByBeginDate(); // There are no valid fiscalPeriods -> exception if (fiscalPeriods.isEmpty()) { @@ -731,34 +731,6 @@ // create entry else { - - // find financial transactions for entry period. - List<FinancialTransaction> financialTransactions = financialTransactionService.getAllFinancialTransactions(fiscalPeriodsBiginDate, fiscalPeriodsEndingDate); - Map<Date, FinancialTransaction> financialTransactionsByDate = new HashMap<>(); - for (FinancialTransaction transaction : financialTransactions) { - financialTransactionsByDate.put(transaction.getTransactionDate(), transaction); - } - - // creation of the entry - // initialisation of this attributs - - entry = new EntryImpl(); - - // the entry has one amount witch can be Debit or Credit - // regarding the value of the boolean:debit - debit = entryEBP.getDebit(); - if (debit == null || BigDecimal.ZERO.compareTo(debit)==0) { - entry.setDebit(false); - entry.setAmount(entryEBP.getCredit()); - } else { - entry.setDebit(true); - entry.setAmount(debit); - } - entry.setAccount(account); - entry.setDescription(entryEBP.getLibelle()); - entry.setVoucher(entryEBP.getPiece()); - entry.setLettering(entryEBP.getLettre()); - // Association of the entry with the financialTransaction // Each financialTransaction is associated with an entryBook // loading of the entryBook from the db according to the entryBookCode @@ -774,13 +746,37 @@ // if entrybook not exist create it ! if (entryBook == null) { - entryBook = new EntryBookImpl(); + entryBook = entryBookService.createNewEntryBook(); entryBook.setCode(entryBookCode); //financialTransaction = null; // create it entryBook = entryBookService.createEntryBook(entryBook); indexedEntryBooks.put(entryBook.getCode(), entryBook); } + + // find financial transactions for entry period. + List<FinancialTransaction> financialTransactions = financialTransactionService.getAllFinancialTransactions(fiscalPeriodsBiginDate, fiscalPeriodsEndingDate, entryBook); + Map<Date, FinancialTransaction> financialTransactionsByDate = Maps.newHashMap(Maps.uniqueIndex(financialTransactions, GET_FINANCIAL_TRANSACTION_DATE_FUNCTION)); + + // creation of the entry + // initialisation of this attributs + entry = financialTransactionService.createNewEntry(); + + // the entry has one amount witch can be Debit or Credit + // regarding the value of the boolean:debit + debit = entryEBP.getDebit(); + if (debit == null || BigDecimal.ZERO.compareTo(debit)==0) { + entry.setDebit(false); + entry.setAmount(entryEBP.getCredit()); + } else { + entry.setDebit(true); + entry.setAmount(debit); + } + entry.setAccount(account); + entry.setDescription(entryEBP.getLibelle()); + entry.setVoucher(entryEBP.getPiece()); + entry.setLettering(entryEBP.getLettre()); + try { // create transaction financialTransaction = financialTransactionsByDate.get(dateEcr); @@ -795,10 +791,12 @@ financialTransaction.setEntryBook(entryBook); financialTransaction.setTransactionDate(dateEcr); financialTransaction = financialTransactionService.createFinancialTransaction(financialTransaction); + financialTransactionsByDate.put(financialTransaction.getTransactionDate(), financialTransaction); } financialTransaction.addEntry(entry); financialTransactionService.createEntry(entry); + } catch (LockedFinancialPeriodException | LockedEntryBookException e) { result.getException().addException(lineIndex, e); lineIndex++; 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 2014-08-01 15:52:09 UTC (rev 3890) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java 2014-08-04 10:44:17 UTC (rev 3891) @@ -339,7 +339,7 @@ balanceTrial.addReportsDatas(reportsDatas); } - if (reportsDatas.getSoldeDebit()) { + if (reportsDatas.isSoldeDebit()) { debit = debit.add(amount); } else { credit = credit.add(amount); Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/VatStatementServiceImpl.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/VatStatementServiceImpl.java 2014-08-01 15:52:09 UTC (rev 3890) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/VatStatementServiceImpl.java 2014-08-04 10:44:17 UTC (rev 3891) @@ -216,7 +216,7 @@ ReportsDatas reportsDatas = reportService. generateAccountsReports(account, true, selectedBeginDate, selectedEndDate); - if (reportsDatas.getSoldeDebit()) { + if (reportsDatas.isSoldeDebit()) { debitTemp = debitTemp.add(reportsDatas.getAmountSolde()); } else { creditTemp = creditTemp.add(reportsDatas.getAmountSolde()); Modified: trunk/lima-business/src/test/java/org/chorem/lima/business/ImportExportServiceTest.java =================================================================== --- trunk/lima-business/src/test/java/org/chorem/lima/business/ImportExportServiceTest.java 2014-08-01 15:52:09 UTC (rev 3890) +++ trunk/lima-business/src/test/java/org/chorem/lima/business/ImportExportServiceTest.java 2014-08-04 10:44:17 UTC (rev 3891) @@ -47,6 +47,7 @@ import java.io.InputStream; import java.nio.charset.Charset; import java.text.ParseException; +import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.zip.ZipEntry; @@ -385,19 +386,45 @@ fiscalPeriod.setEndDate(df.parse("December 31, 2010")); fiscalPeriodService.createFiscalPeriod(fiscalPeriod); - String [] accountNumbers = {"62610000","44566000","40104200","62510000","40100000","401TEEMP","51200000","60630000","411TECLI"}; + String [] accountNumbers = {"62610000","40104200","62510000","40100000","401TEEMP","51200000","60630000","411TECLI"}; + for (String accountNumber : accountNumbers) { Account account = new AccountImpl(); account.setAccountNumber(accountNumber); accountService.createAccount(account); } + String [] _31JanuaryFTaccountNumbers = {"44566000","51210000", "40810000", "50300000", "411XAGAG", "65800000", "27180000", "27618000"}; + List<Account> _31JanuaryFTaccounts = new ArrayList<>(); + for (String accountNumber : _31JanuaryFTaccountNumbers) { + Account account = new AccountImpl(); + account.setAccountNumber(accountNumber); + _31JanuaryFTaccounts.add(accountService.createAccount(account)); + } + + String [] entyBookCodes = {"AC", "AN", "BQ", "VE"}; + for (String entryBookCode : entyBookCodes) { + EntryBook entryBook = entryBookService.createNewEntryBook(); + entryBook.setCode(entryBookCode); + entryBookService.createEntryBook(entryBook); + } + InputStream entriesStream = ImportExportServiceTest.class.getResourceAsStream("/ebp/ecritures.txt"); String entriesData = IOUtils.toString(entriesStream, "ISO-8859-1"); ImportResult result = importService.importEntriesFromEbp(entriesData); Assert.assertTrue(result.getException().getAllExceptionsByLine().isEmpty()); - Assert.assertEquals(19, result.getNbCreated()); + Assert.assertEquals(28, result.getNbCreated()); entriesStream.close(); + + EntryBook entryBook = entryBookService.getEntryBookByCode("AN"); + List<FinancialTransaction> _31JanuaryFinancialTransactions = financialTransactionService.getAllFinancialTransactions(df.parse("January 31, 2010"), df.parse("January 31, 2010"), entryBook); + + Assert.assertEquals(1, _31JanuaryFinancialTransactions.size()); + FinancialTransaction financialTransaction = _31JanuaryFinancialTransactions.get(0); + Collection<Entry> entries = financialTransaction.getEntry(); + for (Entry entry : entries) { + Assert.assertNotEquals(-1, _31JanuaryFTaccounts.indexOf(entry.getAccount())); + } } @Test Modified: trunk/lima-business/src/test/resources/ebp/ecritures.txt =================================================================== --- trunk/lima-business/src/test/resources/ebp/ecritures.txt 2014-08-01 15:52:09 UTC (rev 3890) +++ trunk/lima-business/src/test/resources/ebp/ecritures.txt 2014-08-04 10:44:17 UTC (rev 3891) @@ -18,3 +18,12 @@ BQ,51200000,15/02/2010,,16/02/2010,15/02/2010,,VIRT,,MonFournisseur,0,32.17,,0,0,0,0,0,,,,0,,,0x00000000,0,,,,,,,,Non BQ,411TECLI,20/04/2010,,19/04/2010,20/04/2010,,VIRT,,Test Client,0,5395.44,,0,0,0,0,0,AAV,,,0,,,0x00000000,0,,19/04/2010,,,,,,Non VE,411TECLI,15/03/2010,,26/03/2010,15/03/2010,,FA100315-01,,Test Client,5395.44,0,,0,0,0,0,0,AAV,,,0,,,0x00000000,0,,19/04/2010,,,,,,Non +AC,44566000,31/01/2010,,31/01/2010,31/01/2010,,298,,Forfait Adsl ovh 12,1.48,0,,0,0,0,0,0,,,,0,,,0x00000000,0,,21/01/2013,,,,,,Non +AN,27180000,31/01/2010,,31/01/2010,31/01/2010,,AN,,REPORT A NOUVEAU,1,0,,0,0,0,0,0,,,,0,,,0x00000000,0,,,,,,,,Non +AN,27618000,31/01/2010,,31/01/2010,31/01/2010,,AN,,REPORT A NOUVEAU,43756.22,0,,0,0,0,0,0,,,,0,,,0x00000000,0,,,,,,,,Non +AN,40810000,31/01/2010,,31/01/2010,31/01/2010,,AN,,REPORT A NOUVEAU,0,146.7,,0,0,0,0,0,,,,0,,,0x00000000,0,,,,,,,,Non +AN,51210000,31/01/2010,,31/01/2010,31/01/2010,,AN,,REPORT A NOUVEAU,307923.64,0,,0,0,0,0,0,,,,0,,,0x00000000,0,,,,,,,,Non +BQ,411XAGAG,31/01/2010,,31/01/2010,31/01/2010,,VIRT,,XAGA Group,0,1973.4,,0,0,0,0,0,AAA,,,0,,,0x00000000,0,,10/01/2012,,,,,,Non +BQ,50300000,31/01/2010,,31/01/2010,31/01/2010,,VIRT,,rachat FCP 11/07/2011 saisie � l'envers,0,31706.8,,0,0,0,0,0,,,,0,,,0x00000000,0,,,,,,,,Non +BQ,50300000,31/01/2010,,31/01/2010,31/01/2010,,VIRT,,rachat FCP 11/07/2011 sasie � l'envers,0,31706.8,,0,0,0,0,0,,,,0,,,0x00000000,0,,,,,,,,Non +BQ,65800000,31/01/2010,,31/01/2010,31/01/2010,,VIRT,,ecart bq 31/12/2011,0.83,0,,0,0,0,0,0,,,,0,,,0x00000000,0,,,,,,,,Non Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/EntryBookService.java =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/EntryBookService.java 2014-08-01 15:52:09 UTC (rev 3890) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/EntryBookService.java 2014-08-04 10:44:17 UTC (rev 3891) @@ -60,6 +60,12 @@ List<EntryBook> getAllEntryBooks(); /** + * Create new EntryBook not persisted yet. + * @return + */ + EntryBook createNewEntryBook(); + + /** * Create or update the given entry book * @param entryBook * @return true if updated, false if created Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialTransactionService.java =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialTransactionService.java 2014-08-01 15:52:09 UTC (rev 3890) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialTransactionService.java 2014-08-04 10:44:17 UTC (rev 3891) @@ -59,6 +59,12 @@ */ FinancialTransaction createNewFinancialTransaction(); + /** + * Create new Entry not persisted yet. + * @return + */ + Entry createNewEntry(); + FinancialTransaction createFinancialTransaction(FinancialTransaction financialtransaction) throws LockedFinancialPeriodException, LockedEntryBookException; @@ -74,6 +80,8 @@ List<FinancialTransaction> getAllFinancialTransactions(Date beginDate, Date endDate); + List<FinancialTransaction> getAllFinancialTransactions(Date beginDate, Date endDate, EntryBook entryBook); + List<FinancialTransaction> getAllFinancialTransactions(FinancialPeriod period, EntryBook entryBook); List<FinancialTransaction> getAllInexactFinancialTransactions(FiscalPeriod fiscalPeriod); Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FiscalPeriodService.java =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FiscalPeriodService.java 2014-08-01 15:52:09 UTC (rev 3890) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FiscalPeriodService.java 2014-08-04 10:44:17 UTC (rev 3891) @@ -58,6 +58,8 @@ List<FiscalPeriod> getAllUnblockedFiscalPeriods(); + List<FiscalPeriod> getAllUnblockedFiscalPeriodsByBeginDate(); + FiscalPeriod getLastFiscalPeriod(); FiscalPeriod createFiscalPeriod(FiscalPeriod fiscalPeriod) Modified: trunk/lima-callao/src/main/java/org/chorem/lima/entity/EntryTopiaDao.java =================================================================== --- trunk/lima-callao/src/main/java/org/chorem/lima/entity/EntryTopiaDao.java 2014-08-01 15:52:09 UTC (rev 3890) +++ trunk/lima-callao/src/main/java/org/chorem/lima/entity/EntryTopiaDao.java 2014-08-04 10:44:17 UTC (rev 3891) @@ -200,12 +200,12 @@ } String alias = builder.getAlias(); - if (!filter.getDisplayLettered() && filter.getDisplayUnlettred()){ + if (!filter.isDisplayLettered() && filter.isDisplayUnlettred()){ builder.addWhereClause( alias + "." + Entry.PROPERTY_LETTERING + " is null " + "OR " + alias + "." + Entry.PROPERTY_LETTERING + " = ''"); - } else if (filter.getDisplayLettered() && !filter.getDisplayUnlettred()){ + } else if (filter.isDisplayLettered() && !filter.isDisplayUnlettred()){ builder.addWhereClause( alias + "." + Entry.PROPERTY_LETTERING + " is not null " + "OR " + alias + "." + Entry.PROPERTY_LETTERING + " != ''"); Modified: trunk/pom.xml =================================================================== --- trunk/pom.xml 2014-08-01 15:52:09 UTC (rev 3890) +++ trunk/pom.xml 2014-08-04 10:44:17 UTC (rev 3891) @@ -177,7 +177,7 @@ <nuitonDecoratorVersion>3.0-alpha-3</nuitonDecoratorVersion> <nuitonProfilingVersion>2.7.1</nuitonProfilingVersion> <nuitonCsvVersion>3.0-rc-2</nuitonCsvVersion> - <eugeneVersion>2.12-SNAPSHOT</eugeneVersion> + <eugeneVersion>3.0-SNAPSHOT</eugeneVersion> <nuitonI18nVersion>3.1</nuitonI18nVersion> <topiaVersion>3.0-SNAPSHOT</topiaVersion>