Author: dcosse Date: 2014-01-17 23:12:04 +0100 (Fri, 17 Jan 2014) New Revision: 3740 Url: http://chorem.org/projects/lima/repository/revisions/3740 Log: refactoring Added: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/ClosedPeriodicEntryBookService.java trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/EntryService.java trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ClosedPeriodicEntryBookServiceImpl.java trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/EntryServiceImpl.java Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/AccountService.java trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialPeriodService.java trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialStatementService.java trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/VatStatementService.java trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/DocumentServiceImpl.java trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/EntryBookServiceImpl.java trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialPeriodServiceImpl.java trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialStatementServiceImpl.java trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FiscalPeriodServiceImpl.java trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/HttpServerServiceImpl.java trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/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/main/java/org/chorem/lima/business/utils/LetteringComparator.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/TypeEntry.java Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java 2014-01-17 15:05:17 UTC (rev 3739) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java 2014-01-17 22:12:04 UTC (rev 3740) @@ -42,8 +42,6 @@ import org.chorem.lima.business.utils.AccountComparator; import org.chorem.lima.entity.Account; import org.chorem.lima.entity.AccountDAO; -import org.chorem.lima.entity.FiscalPeriod; -import org.chorem.lima.entity.FiscalPeriodDAO; import org.nuiton.topia.TopiaException; /** @@ -61,7 +59,7 @@ @Override public long getAccountCount() throws LimaException { - long result = 0; + long result; try { AccountDAO accountDAO = getDaoHelper().getAccountDAO(); @@ -72,6 +70,7 @@ return result; } + /** * Permet de créer un nouveau compte dans le PCG de l'application. * @@ -85,18 +84,16 @@ AccountingRules accountingRules = LimaConfig.getInstance().getAccountingRules(); accountingRules.createAccountRules(account); - Account result = null; + Account result; try { // force uppercase account number - account.setAccountNumber(account.getAccountNumber().toUpperCase()); + account.setAccountNumber(account.getAccountNumber().toUpperCase().trim()); // check if account number already exist AccountDAO accountDAO = getDaoHelper().getAccountDAO(); - Account existAccount = - accountDAO.findByAccountNumber(account.getAccountNumber()); - if (existAccount != null) { + if (accountDAO.existByNaturalId(account.getAccountNumber())) { throw new LimaBusinessException( _("lima-business.account.accountalreardyexist", account.getAccountNumber())); @@ -134,7 +131,7 @@ @Override public Account getAccountByNumber(String number) throws LimaException { - Account account = null; + Account account; try { AccountDAO accountDAO = getDaoHelper().getAccountDAO(); account = accountDAO.findByAccountNumber(number); @@ -169,7 +166,7 @@ @Override public List<Account> getAllLeafAccounts() throws LimaException { - List<Account> accountsList = null; + List<Account> accountsList; try { AccountDAO accountDAO = getDaoHelper().getAccountDAO(); @@ -187,7 +184,7 @@ @Override public List<Account> getAllSubAccounts(Account account) throws LimaException { - List<Account> accountsList = null; + List<Account> accountsList; try { AccountDAO accountDAO = getDaoHelper().getAccountDAO(); @@ -205,7 +202,7 @@ * Si il existe une entrée comptable associée au numéro de * compte ou a un de ses sous-compte, il est alors impossible de supprimer le compte. * - * @param account + * @param account Le compte à supprimer * @throws LimaException */ @Override @@ -242,7 +239,7 @@ AccountingRules accountingRules = LimaConfig.getInstance().getAccountingRules(); - Account result = null; + Account result; try { // DAO AccountDAO accountDAO = getDaoHelper().getAccountDAO(); Added: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ClosedPeriodicEntryBookServiceImpl.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ClosedPeriodicEntryBookServiceImpl.java (rev 0) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ClosedPeriodicEntryBookServiceImpl.java 2014-01-17 22:12:04 UTC (rev 3740) @@ -0,0 +1,33 @@ +package org.chorem.lima.business.ejb; + +import org.chorem.lima.business.LimaException; +import org.chorem.lima.business.api.ClosedPeriodicEntryBookService; +import org.chorem.lima.entity.ClosedPeriodicEntryBook; +import org.chorem.lima.entity.ClosedPeriodicEntryBookDAO; +import org.chorem.lima.entity.EntryBook; +import org.chorem.lima.entity.FinancialPeriod; +import org.nuiton.topia.TopiaException; + +import javax.ejb.Remote; +import javax.ejb.Stateless; +import javax.ejb.TransactionAttribute; + +/** + * Created by davidcosse on 17/01/14. + */ +@Stateless +@Remote(ClosedPeriodicEntryBookService.class) +@TransactionAttribute +public class ClosedPeriodicEntryBookServiceImpl extends AbstractLimaService implements ClosedPeriodicEntryBookService { + @Override + public ClosedPeriodicEntryBook getByEntryBookAndFinancialPeriod(EntryBook entryBook, FinancialPeriod financialPeriod) { + ClosedPeriodicEntryBook result; + try { + ClosedPeriodicEntryBookDAO accountDAO = getDaoHelper().getClosedPeriodicEntryBookDAO(); + result = accountDAO.findByEntryBookAndFinancialPeriod(entryBook, financialPeriod); + } catch (TopiaException e) { + throw new LimaException("Can't find closed period entry book", e); + } + return result; + } +} 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-01-17 15:05:17 UTC (rev 3739) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/DocumentServiceImpl.java 2014-01-17 22:12:04 UTC (rev 3740) @@ -77,6 +77,9 @@ import static org.nuiton.i18n.I18n._; +/** + * TODO david: 17/01/14, Ce service doit être entièrement revue, !!! + */ @Stateless @Remote(DocumentService.class) @TransactionAttribute @@ -98,21 +101,6 @@ protected String path; - private static final Font titleFont = - new Font(Font.HELVETICA, 14, Font.BOLD, Color.BLACK); - - private static final Font normalFont = - new Font(Font.HELVETICA, 9, Font.NORMAL, Color.BLACK); - - private static final Font boldFont = - new Font(Font.HELVETICA, 9, Font.BOLD, Color.BLACK); - - private static final Font italicFont = - new Font(Font.HELVETICA, 9, Font.ITALIC, Color.BLACK); - - private static final Font bolditalicFont = - new Font(Font.HELVETICA, 9, Font.BOLDITALIC, Color.BLACK); - public DocumentServiceImpl() { path = LimaConfig.getInstance().getReportsDir().getAbsolutePath(); 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-01-17 15:05:17 UTC (rev 3739) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/EntryBookServiceImpl.java 2014-01-17 22:12:04 UTC (rev 3740) @@ -62,7 +62,7 @@ public EntryBook createEntryBook(EntryBook entryBook) throws LimaException { - EntryBook result = null; + EntryBook result; try { // check if entrybook with is name already exist @@ -106,7 +106,7 @@ @Override public List<EntryBook> getAllEntryBooks() throws LimaException { - List<EntryBook> entryBooksList = null; + List<EntryBook> entryBooksList; try { // check if entrybook with is name already exist @@ -122,7 +122,7 @@ @Override public EntryBook updateEntryBook(EntryBook entryBook) throws LimaException { - EntryBook result = null; + EntryBook result; try { EntryBookDAO entryBookDAO = getDaoHelper().getEntryBookDAO(); @@ -181,7 +181,7 @@ @Override public EntryBook getEntryBookByCode(String code) throws LimaException { - EntryBook entryBook = null; + EntryBook entryBook; try { EntryBookDAO entryBookDAO = getDaoHelper().getEntryBookDAO(); Added: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/EntryServiceImpl.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/EntryServiceImpl.java (rev 0) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/EntryServiceImpl.java 2014-01-17 22:12:04 UTC (rev 3740) @@ -0,0 +1,32 @@ +package org.chorem.lima.business.ejb; + +import org.chorem.lima.business.LimaException; +import org.chorem.lima.business.api.EntryService; +import org.chorem.lima.entity.Entry; +import org.chorem.lima.entity.EntryDAO; +import org.nuiton.topia.TopiaException; + +import javax.ejb.Remote; +import javax.ejb.Stateless; +import javax.ejb.TransactionAttribute; + +/** + * Created by davidcosse on 17/01/14. + */ +@Stateless +@Remote(EntryService.class) +@TransactionAttribute +public class EntryServiceImpl extends AbstractLimaService implements EntryService { + + @Override + public Entry createEntry(Entry entry) { + + try { + EntryDAO entryDao = getDaoHelper().getEntryDAO(); + entryDao.create(entry); + } catch (TopiaException e) { + throw new LimaException("Can't create entry", e); + } + return null; + } +} Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialPeriodServiceImpl.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialPeriodServiceImpl.java 2014-01-17 15:05:17 UTC (rev 3739) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialPeriodServiceImpl.java 2014-01-17 22:12:04 UTC (rev 3740) @@ -108,7 +108,7 @@ @Override public List<FinancialPeriod> getAllFinancialPeriods() throws LimaException { - List<FinancialPeriod> result = null; + List<FinancialPeriod> result; try { FinancialPeriodDAO financialPeriodDAO = getDaoHelper().getFinancialPeriodDAO(); @@ -124,7 +124,7 @@ @Override public List<FinancialPeriod> getUnblockedFinancialPeriods() throws LimaException { - List<FinancialPeriod> result = null; + List<FinancialPeriod> result; try { FinancialPeriodDAO financialPeriodDAO = getDaoHelper().getFinancialPeriodDAO(); @@ -140,7 +140,7 @@ @Override public List<FinancialPeriod> getFinancialPeriods(Date beginDate, Date endDate) throws LimaException { - List<FinancialPeriod> result = null; + List<FinancialPeriod> result; try { FinancialPeriodDAO financialPeriodDAO = getDaoHelper().getFinancialPeriodDAO(); @@ -152,11 +152,25 @@ return result; } + public FinancialPeriod getFinancialPeriodByNaturalIds(Date beginDate, Date endDate) throws LimaException { + + FinancialPeriod result; + + try { + FinancialPeriodDAO financialPeriodDAO = getDaoHelper().getFinancialPeriodDAO(); + result = financialPeriodDAO.findByNaturalId(beginDate, endDate); + } catch (Exception ex) { + throw new LimaException("Can't get period", ex); + } + + return result; + } + @Override public ClosedPeriodicEntryBook blockClosedPeriodicEntryBook(ClosedPeriodicEntryBook closedPeriodicEntryBook) throws LimaException { AccountingRules accountingRules = LimaConfig.getInstance().getAccountingRules(); - ClosedPeriodicEntryBook result = null; + ClosedPeriodicEntryBook result; try { // check rules before create the account accountingRules.blockClosedPeriodicEntryBookRules(closedPeriodicEntryBook); @@ -181,7 +195,7 @@ @Override public ClosedPeriodicEntryBook getClosedPeriodicEntryBook(EntryBook entryBook, FinancialPeriod financialPeriod) throws LimaException { - ClosedPeriodicEntryBook closedPeriodicEntryBook = null; + ClosedPeriodicEntryBook closedPeriodicEntryBook; try { ClosedPeriodicEntryBookDAO closedPeriodicEntryBookDAO = getDaoHelper().getClosedPeriodicEntryBookDAO(); @@ -196,7 +210,7 @@ @Override public List<ClosedPeriodicEntryBook> getAllClosedPeriodicEntryBooksFromUnblockedFiscalPeriod() throws LimaException { - List<ClosedPeriodicEntryBook> result = null; + List<ClosedPeriodicEntryBook> result; try { ClosedPeriodicEntryBookDAO closedPeriodicEntryBookDAO = getDaoHelper().getClosedPeriodicEntryBookDAO(); 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-01-17 15:05:17 UTC (rev 3739) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialStatementServiceImpl.java 2014-01-17 22:12:04 UTC (rev 3740) @@ -136,7 +136,7 @@ @Override public List<FinancialStatement> getAllFinancialStatements() throws LimaException { - List<FinancialStatement> financialStatements = null; + List<FinancialStatement> financialStatements; try { FinancialStatementDAO financialStatementDAO = getDaoHelper().getFinancialStatementDAO(); @@ -161,7 +161,7 @@ @Override public List<FinancialStatement> getChildrenFinancialStatement(FinancialStatement masterFinancialStatement) throws LimaException { - List<FinancialStatement> financialStatements = null; + List<FinancialStatement> financialStatements; try { FinancialStatementDAO financialStatementDAO = getDaoHelper().getFinancialStatementDAO(); @@ -194,7 +194,7 @@ @Override public List<FinancialStatementAmounts> financialStatementReport(Date selectedBeginDate, Date selectedEndDate) throws LimaException { - List<FinancialStatementAmounts> result = null; + List<FinancialStatementAmounts> result; try { @@ -347,7 +347,7 @@ } // DEBIT & CREDIT ACCOUNTS LIST - Amounts amounts = new AmountsImpl(); + Amounts amounts; String accountsString = financialStatement.getAccounts(); if (accountsString != null && !accountsString.equals("")) { amounts = amountFromAccountList(accountsString, @@ -498,4 +498,28 @@ } return result.toString(); } + + @Override + public boolean checkFinancialStatementExist(String label) throws LimaException { + boolean result; + try { + FinancialStatementDAO financialStatementDAO = getDaoHelper().getFinancialStatementDAO(); + result = financialStatementDAO.existByProperties(FinancialStatement.PROPERTY_LABEL, label); + } catch (TopiaException e) { + throw new LimaException("Can't check financial statement", e); + } + return result; + } + + @Override + public FinancialStatement getFinancialStatementByLabel(String label) throws LimaException { + FinancialStatement result; + try { + FinancialStatementDAO financialStatementDAO = getDaoHelper().getFinancialStatementDAO(); + result = financialStatementDAO.findByLabel(label); + } catch (TopiaException e) { + throw new LimaException("Can't find financial statement", e); + } + return result; + } } 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-01-17 15:05:17 UTC (rev 3739) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java 2014-01-17 22:12:04 UTC (rev 3740) @@ -38,11 +38,7 @@ import org.chorem.lima.business.LimaConfig; import org.chorem.lima.business.LimaException; import org.chorem.lima.business.api.AccountService; -import org.chorem.lima.business.api.EntryBookService; -import org.chorem.lima.business.api.FinancialPeriodService; import org.chorem.lima.business.api.FinancialTransactionService; -import org.chorem.lima.business.api.OptionsService; -import org.chorem.lima.business.api.ReportService; import org.chorem.lima.business.utils.LetteringComparator; import org.chorem.lima.entity.Account; import org.chorem.lima.entity.Entry; @@ -82,20 +78,20 @@ @TransactionAttribute public class FinancialTransactionServiceImpl extends AbstractLimaService implements FinancialTransactionService { - @EJB - protected FinancialPeriodService financialPeriodService; +// @EJB +// protected FinancialPeriodService financialPeriodService; - @EJB - protected ReportService reportService; +// @EJB +// protected ReportService reportService; - @EJB - protected EntryBookService entryBookService; + //@EJB + //protected EntryBookService entryBookService; @EJB protected AccountService accountService; - @EJB - protected OptionsService optionsService; +// @EJB +// protected OptionsService optionsService; protected static final Log log = LogFactory.getLog(FinancialTransactionServiceImpl.class); 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-01-17 15:05:17 UTC (rev 3739) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FiscalPeriodServiceImpl.java 2014-01-17 22:12:04 UTC (rev 3740) @@ -98,7 +98,7 @@ @Override public FiscalPeriod createFiscalPeriod(FiscalPeriod fiscalPeriod) throws LimaException { - FiscalPeriod result = null; + FiscalPeriod result; try { @@ -144,7 +144,7 @@ @Override public List<FiscalPeriod> getAllFiscalPeriods() throws LimaException { - List<FiscalPeriod> result = null; + List<FiscalPeriod> result; try { @@ -163,7 +163,7 @@ @Override public List<FiscalPeriod> getAllBlockedFiscalPeriods() throws LimaException { - List<FiscalPeriod> result = null; + List<FiscalPeriod> result; try { FiscalPeriodDAO fiscalPeriodDAO = getDaoHelper().getFiscalPeriodDAO(); @@ -180,7 +180,7 @@ @Override public List<FiscalPeriod> getAllUnblockedFiscalPeriods() throws LimaException { - List<FiscalPeriod> result = null; + List<FiscalPeriod> result; try { @@ -195,7 +195,7 @@ @Override public FiscalPeriod getLastFiscalPeriod() throws LimaException { - FiscalPeriod result = null; + FiscalPeriod result; try { @@ -390,13 +390,13 @@ //holds entries of all opening transactions FinancialTransaction beginfinancialTransaction = new FinancialTransactionImpl(); - if (found) { - //Sets the endfinancialTransaction - beginfinancialTransaction.setEntryBook(entryBook); - beginfinancialTransaction.setTransactionDate(beginfinancialPeriod.getBeginDate()); - beginfinancialTransaction = financialTransactionService.createFinancialTransaction(beginfinancialTransaction); - } + //Sets the endfinancialTransaction + beginfinancialTransaction.setEntryBook(entryBook); + beginfinancialTransaction.setTransactionDate(beginfinancialPeriod.getBeginDate()); + beginfinancialTransaction = financialTransactionService.createFinancialTransaction(beginfinancialTransaction); + + //Sets date for description, e.g: Report à nouveau (DATE) Calendar calendar = Calendar.getInstance(); calendar.setTime(fiscalPeriod.getEndDate()); @@ -434,26 +434,24 @@ financialTransactionService.createEntry(beginEntry); //open new year accounts if new year exists and a date has been found for the transaction - if (found) { - //give back amounts from class 1 to 5 accounts - beginEntry = new EntryImpl(); - beginEntry.setDescription(_("lima-business.financialtransaction.retainedearnings.description") + " (" + calendar.get(Calendar.YEAR) + ")"); - beginEntry.setVoucher(_("lima-business.financialtransaction.retainedearnings.voucher")); - beginEntry.setFinancialTransaction(beginfinancialTransaction); - beginEntry.setAccount(report.getAccount()); - beginEntry.setAmount(report.getAmountSolde().abs()); - beginEntry.setDebit(report.getSoldeDebit()); - financialTransactionService.createEntry(beginEntry); - //close account by removing amount from account number 890 - beginEntry = new EntryImpl(); - beginEntry.setDescription(_("lima-business.financialtransaction.retainedearnings.description") + " (" + calendar.get(Calendar.YEAR) + ")"); - beginEntry.setVoucher(_("lima-business.financialtransaction.retainedearnings.voucher")); - beginEntry.setFinancialTransaction(beginfinancialTransaction); - beginEntry.setAccount(endRetainedAccount); - beginEntry.setAmount(report.getAmountSolde().abs()); - beginEntry.setDebit(!report.getSoldeDebit()); - financialTransactionService.createEntry(beginEntry); - } + //give back amounts from class 1 to 5 accounts + beginEntry = new EntryImpl(); + beginEntry.setDescription(_("lima-business.financialtransaction.retainedearnings.description") + " (" + calendar.get(Calendar.YEAR) + ")"); + beginEntry.setVoucher(_("lima-business.financialtransaction.retainedearnings.voucher")); + beginEntry.setFinancialTransaction(beginfinancialTransaction); + beginEntry.setAccount(report.getAccount()); + beginEntry.setAmount(report.getAmountSolde().abs()); + beginEntry.setDebit(report.getSoldeDebit()); + financialTransactionService.createEntry(beginEntry); + //close account by removing amount from account number 890 + beginEntry = new EntryImpl(); + beginEntry.setDescription(_("lima-business.financialtransaction.retainedearnings.description") + " (" + calendar.get(Calendar.YEAR) + ")"); + beginEntry.setVoucher(_("lima-business.financialtransaction.retainedearnings.voucher")); + beginEntry.setFinancialTransaction(beginfinancialTransaction); + beginEntry.setAccount(endRetainedAccount); + beginEntry.setAmount(report.getAmountSolde().abs()); + beginEntry.setDebit(!report.getSoldeDebit()); + financialTransactionService.createEntry(beginEntry); } } } Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/HttpServerServiceImpl.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/HttpServerServiceImpl.java 2014-01-17 15:05:17 UTC (rev 3739) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/HttpServerServiceImpl.java 2014-01-17 22:12:04 UTC (rev 3740) @@ -273,30 +273,16 @@ beginDatePicker = DateUtils.truncate(beginDatePicker, Calendar.YEAR); - pageContent.append("<!DOCTYPE html>\n" - + "<html lang=\"fr\">\n" - + "<head>\n" - + "<title>LIMA Documents Report</title>\n" - + "<style type=\"text/css\">" - + "body { font: 14px sans-serif; }" - + "h1 { font: 20px sans-serif; text-align: center; }" - + "table.padding td {padding-right:20px;}" - + ".tdright {text-align: right;}" - + "</style>" - + "</head>\n" - + "<body>\n" - + "<table class=\"padding\">\n" - + "<tr><td><img src=\"?img=puzzle_icon_mini.png\"/></td>\n" - + "<td><h1>LIMA Documents Report</h1></td></tr>\n" - + "<tr><td class=\"tdright\"><img src=\"?img=identity.png\"/></td>\n" - + "<td rowspan=3><form method=GET action=" - + serverAdress + ">\n" - + _("lima-business.document.date.begin") - + "<input value=\"" + DATEFORMAT.format(beginDatePicker) - + "\" type=\"date\" name=\"beginDate\">\n" - + _("lima-business.document.date.end") - + "<input value=\"" + DATEFORMAT.format(endDatePicker) - + "\" type=\"date\" name=\"endDate\">\n<br/><br/>"); + pageContent.append("<!DOCTYPE html>\n" + "<html lang=\"fr\">\n" + "<head>\n" + "<title>LIMA Documents Report</title>\n" + "<style type=\"text/css\">" + "body { font: 14px sans-serif; }" + "h1 { font: 20px sans-serif; text-align: center; }" + "table.padding td {padding-right:20px;}" + ".tdright {text-align: right;}" + "</style>" + "</head>\n" + "<body>\n" + "<table class=\"padding\">\n" + "<tr><td><img src=\"?img=puzzle_icon_mini.png\"/></td>\n" + "<td><h1>LIMA Documents Report</h1></td></tr>\n" + "<tr><td class=\"tdright\"><img src=\"?img=identity.png\"/></td>\n" + "<td rowspan=3><form method=GET action=") + .append(serverAdress).append(">\n") + .append(_("lima-business.document.date.begin")) + .append("<input value=\"") + .append(DATEFORMAT.format(beginDatePicker)) + .append("\" type=\"date\" name=\"beginDate\">\n") + .append(_("lima-business.document.date.end")) + .append("<input value=\"") + .append(DATEFORMAT.format(endDatePicker)) + .append("\" type=\"date\" name=\"endDate\">\n<br/><br/>"); //+ "Format : <select name=\"format\">"); /*TODO : voir pour générer des pdf avec éventuellement iReport*/ @@ -310,9 +296,11 @@ + */"Documents : <select name=\"model\">"); for (DocumentsEnum documentsEnum : DocumentsEnum.values()) { - pageContent.append("<option value=\"" - + documentsEnum.getFileName() + "\">" - + documentsEnum.getDescription() + "</option>\n"); + pageContent.append("<option value=\"") + .append(documentsEnum.getFileName()) + .append("\">") + .append(documentsEnum.getDescription()) + .append("</option>\n"); } pageContent.append("</select><input type=\"submit\">\n" 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-01-17 15:05:17 UTC (rev 3739) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java 2014-01-17 22:12:04 UTC (rev 3740) @@ -74,7 +74,9 @@ import org.chorem.lima.business.LimaConfig; import org.chorem.lima.business.LimaException; import org.chorem.lima.business.api.AccountService; +import org.chorem.lima.business.api.ClosedPeriodicEntryBookService; import org.chorem.lima.business.api.EntryBookService; +import org.chorem.lima.business.api.EntryService; import org.chorem.lima.business.api.FinancialPeriodService; import org.chorem.lima.business.api.FinancialStatementService; import org.chorem.lima.business.api.FinancialTransactionService; @@ -87,31 +89,22 @@ import org.chorem.lima.business.utils.FiscalPeriodComparator; import org.chorem.lima.business.utils.ImportExportEntityEnum; import org.chorem.lima.entity.Account; -import org.chorem.lima.entity.AccountDAO; import org.chorem.lima.entity.AccountImpl; import org.chorem.lima.entity.ClosedPeriodicEntryBook; -import org.chorem.lima.entity.ClosedPeriodicEntryBookDAO; import org.chorem.lima.entity.Entry; import org.chorem.lima.entity.EntryBook; -import org.chorem.lima.entity.EntryBookDAO; import org.chorem.lima.entity.EntryBookImpl; -import org.chorem.lima.entity.EntryDAO; import org.chorem.lima.entity.EntryImpl; import org.chorem.lima.entity.FinancialPeriod; -import org.chorem.lima.entity.FinancialPeriodDAO; import org.chorem.lima.entity.FinancialStatement; -import org.chorem.lima.entity.FinancialStatementDAO; import org.chorem.lima.entity.FinancialStatementImpl; import org.chorem.lima.entity.FinancialTransaction; -import org.chorem.lima.entity.FinancialTransactionDAO; import org.chorem.lima.entity.FinancialTransactionImpl; import org.chorem.lima.entity.FiscalPeriod; -import org.chorem.lima.entity.FiscalPeriodDAO; import org.chorem.lima.entity.FiscalPeriodImpl; import org.chorem.lima.entity.Identity; import org.chorem.lima.entity.IdentityImpl; import org.chorem.lima.entity.VatStatement; -import org.chorem.lima.entity.VatStatementDAO; import org.chorem.lima.entity.VatStatementImpl; import org.nuiton.topia.TopiaException; @@ -156,6 +149,12 @@ @EJB private IdentityService identityService; + @EJB + private ClosedPeriodicEntryBookService closedPeriodicEntryBookService; + + @EJB + private EntryService entryService; + private static final SimpleDateFormat SDATEFORMAT = new SimpleDateFormat( "dd,MM,yyyy HH:mm:ss"); @@ -202,10 +201,6 @@ List<EntryEBPImpl> list = csv.parse(strat, csvReader); Collections.sort(list, new EntryEBPComparator()); - // DAOs - AccountDAO accountDAO = getDaoHelper().getAccountDAO(); - EntryBookDAO entryBookDAO = getDaoHelper().getEntryBookDAO(); - // Get all the valid fiscalPeriods Ordered by date. List<FiscalPeriod> fiscalPeriods = fiscalPeriodService .getAllUnblockedFiscalPeriods(); @@ -236,8 +231,7 @@ dateEcr = epbDateFormat.parse(entryEBP.getDatEcr()); // account loading - account = accountDAO.findByAccountNumber(entryEBP - .getCompte()); + account = accountService.getAccountByNumber(entryEBP.getCompte()); // if entry date have fiscalperiod open if (dateEcr.compareTo(fiscalPeriods.get(0).getBeginDate()) < 0 @@ -287,7 +281,7 @@ entryBookCode = entryEBP.getJournal(); // entryBook loading - entryBook = entryBookDAO.findByCode(entryBookCode); + entryBook = entryBookService.getEntryBookByCode(entryBookCode); // if entrybook not exist create it ! if (entryBook == null) { @@ -372,21 +366,15 @@ CsvToBean<AccountEBPImpl> csv = new CsvToBean<AccountEBPImpl>(); List<AccountEBPImpl> list = csv.parse(strat, csvReader); - AccountDAO accountDAO = getDaoHelper().getAccountDAO(); for (AccountEBP accountEBP : list) { String accountNumber = accountEBP.getNumero(); - if (accountDAO.findByAccountNumber(accountNumber) != null) { - result.append(_("lima-business.import.accountalreadyexist", - accountNumber)); - } else { - String label = accountEBP.getIntitule(); - Account account = new AccountImpl(); - account.setAccountNumber(accountNumber); - account.setLabel(label); - accountService.createAccount(account); - result.append(_("lima-business.import.accountadded", - accountNumber, label)); - } + String label = accountEBP.getIntitule(); + Account account = new AccountImpl(); + account.setAccountNumber(accountNumber); + account.setLabel(label); + accountService.createAccount(account); + result.append(_("lima-business.import.accountadded", + accountNumber, label)); } if (log.isInfoEnabled()) { @@ -744,10 +732,9 @@ StringBuilder result = new StringBuilder(); - AccountDAO accountDAO = getDaoHelper().getAccountDAO(); String accountNumber = nextLine[1]; // if not exists, create it - if (accountDAO.findByAccountNumber(accountNumber) == null) { + if (accountService.getAccountByNumber(accountNumber) == null) { Account account = new AccountImpl(); account.setAccountNumber(accountNumber); @@ -758,7 +745,7 @@ account.setThirdParty(thirdParty); } - accountDAO.create(account); + accountService.createAccount(account); result.append(_("lima-business.import.accountadded", account.getAccountNumber(), account.getLabel())); @@ -784,8 +771,6 @@ throws ParseException, TopiaException { StringBuilder result = new StringBuilder(); - FiscalPeriodDAO fiscalPeriodDAO = getDaoHelper().getFiscalPeriodDAO(); - FiscalPeriod fiscalPeriod = new FiscalPeriodImpl(); Date beginDate = SDATEFORMAT.parse(nextLine[1]); fiscalPeriod.setBeginDate(beginDate); @@ -794,7 +779,7 @@ fiscalPeriod.setLocked(Boolean.parseBoolean(nextLine[3])); // if not exist, skip - if (fiscalPeriodDAO.findByNaturalId(beginDate, endDate) == null) { + if (financialPeriodService.getFinancialPeriods(beginDate, endDate) == null) { fiscalPeriods.add(fiscalPeriod); } else { result.append(_("lima-business.import.fiscalperiodalreadyexist", beginDate, endDate)); @@ -814,14 +799,12 @@ protected String importEntryBooksChartCSV(String[] nextLine) throws TopiaException, LimaException { StringBuilder result = new StringBuilder(); - EntryBookDAO entryBookDAO = getDaoHelper().getEntryBookDAO(); - EntryBook entryBook = new EntryBookImpl(); entryBook.setCode(nextLine[1]); entryBook.setLabel(nextLine[2]); // if exist, skip - if (entryBookDAO.findByCode(entryBook.getCode()) != null) { + if (entryBookService.getEntryBookByCode(entryBook.getCode()) != null) { result.append(_("lima-business.import.entrybookalreadyexist", entryBook.getLabel())); } else { // create it @@ -886,10 +869,8 @@ String masterFinancialStatement = nextLine[9]; String financialStatementWay = nextLine[10]; - FinancialStatementDAO financialStatementDAO = getDaoHelper().getFinancialStatementDAO(); - // if exist, skip - if (financialStatementDAO.findByLabel(label) == null) { + if (!financialStatementService.checkFinancialStatementExist(label)) { // create it FinancialStatementImport financialStatementImport = new FinancialStatementImportImpl(); financialStatementImport.setLabel(label); @@ -942,10 +923,8 @@ String accounts = nextLine[4]; String masterVatStatement = nextLine[5]; - VatStatementDAO vatStatementDAO = getDaoHelper().getVatStatementDAO(); - // if exist, skip - if (vatStatementDAO.findByLabel(label) == null) { + if (!vatStatementService.checkVatStatementExist(label)) { // create it VatStatementImport vatStatementImport = new VatStatementImportImpl(); vatStatementImport.setLabel(label); @@ -1032,8 +1011,6 @@ protected String createFinancialStatements(Map<String, List<FinancialStatementImport>> financialStatements) throws LimaException, TopiaException { StringBuilder result = new StringBuilder(); - FinancialStatementDAO financialStatementDAO = getDaoHelper().getFinancialStatementDAO(); - while (financialStatements.size() > 0) { for (Iterator<List<FinancialStatementImport>> itr = financialStatements .values().iterator(); itr.hasNext(); ) { @@ -1045,8 +1022,7 @@ itr2.next(); String masterFinancialStatementLabel = financialStatementImport .getMasterFinancialStatement(); - FinancialStatement masterFinancialStatement = financialStatementDAO - .findByLabel(masterFinancialStatementLabel); + FinancialStatement masterFinancialStatement = financialStatementService.getFinancialStatementByLabel(masterFinancialStatementLabel); if (masterFinancialStatementLabel.equals("") || masterFinancialStatement != null) { @@ -1116,8 +1092,6 @@ StringBuilder result = new StringBuilder(); - VatStatementDAO vatStatementDAO = getDaoHelper().getVatStatementDAO(); - while (vatStatements.size() > 0) { for (Iterator<List<VatStatementImport>> itr = vatStatements .values().iterator(); itr.hasNext(); ) { @@ -1129,8 +1103,7 @@ itr2.next(); String masterVatStatementLabel = vatStatementImport .getMasterVatStatement(); - VatStatement masterVatStatement = vatStatementDAO - .findByLabel(masterVatStatementLabel); + VatStatement masterVatStatement = vatStatementService.findVatStatementByLabel(masterVatStatementLabel); if (masterVatStatementLabel.equals("") || masterVatStatement != null) { @@ -1198,9 +1171,6 @@ List<ClosedPeriodicEntryBookImport> closedPeriodicEntryBooks) throws LimaException, ParseException, TopiaException { StringBuilder result = new StringBuilder(); - FinancialPeriodDAO financialPeriodDAO = getDaoHelper().getFinancialPeriodDAO(); - EntryBookDAO entryBookDAO = getDaoHelper().getEntryBookDAO(); - ClosedPeriodicEntryBookDAO closedPeriodicEntryBookDAO = getDaoHelper().getClosedPeriodicEntryBookDAO(); for (ClosedPeriodicEntryBookImport closedPeriodicEntryBookImport : closedPeriodicEntryBooks) { // update closedPeriodicEntryBook Date beginDateFinancialPeriod = SDATEFORMAT @@ -1209,15 +1179,13 @@ Date endDateFinancialPeriod = SDATEFORMAT .parse(closedPeriodicEntryBookImport .getEndDateFinancialPeriod()); - FinancialPeriod financialPeriod = financialPeriodDAO - .findByNaturalId(beginDateFinancialPeriod, - endDateFinancialPeriod); + FinancialPeriod financialPeriod = financialPeriodService.getFinancialPeriodByNaturalIds(beginDateFinancialPeriod, endDateFinancialPeriod); + String codeEntryBook = closedPeriodicEntryBookImport .getCodeEntryBook(); - EntryBook entryBook = entryBookDAO.findByCode(codeEntryBook); - ClosedPeriodicEntryBook closedPeriodicEntryBook = closedPeriodicEntryBookDAO - .findByEntryBookAndFinancialPeriod(entryBook, - financialPeriod); + EntryBook entryBook = entryBookService.getEntryBookByCode(codeEntryBook); + ClosedPeriodicEntryBook closedPeriodicEntryBook = closedPeriodicEntryBookService.getByEntryBookAndFinancialPeriod(entryBook, + financialPeriod); try { financialPeriodService .blockClosedPeriodicEntryBook(closedPeriodicEntryBook); @@ -1242,11 +1210,6 @@ Map<Integer, List<EntryImport>> entries) throws LimaException, ParseException, TopiaException { - EntryBookDAO entryBookDAO = getDaoHelper().getEntryBookDAO(); - EntryDAO entryDAO = getDaoHelper().getEntryDAO(); - FinancialTransactionDAO financialTransactionDAO = getDaoHelper().getFinancialTransactionDAO(); - AccountDAO accountDAO = getDaoHelper().getAccountDAO(); - for (Map.Entry<Integer, FinancialTransactionImport> map : financialTransactions .entrySet()) { FinancialTransactionImport financialTransactionImport = map @@ -1257,18 +1220,16 @@ financialTransaction .setTransactionDate(dateFinancialTransaction); - EntryBook entryBook = entryBookDAO - .findByCode(financialTransactionImport - .getCodeEntryBook()); + EntryBook entryBook = entryBookService.getEntryBookByCode(financialTransactionImport + .getCodeEntryBook()); financialTransaction.setEntryBook(entryBook); - financialTransactionDAO.create(financialTransaction); + financialTransactionService.createFinancialTransaction(financialTransaction); List<EntryImport> entryImports = entries.get(map.getKey()); for (EntryImport entryImport : entryImports) { Entry entry = new EntryImpl(); - Account account = accountDAO - .findByAccountNumber(entryImport.getAccount()); + Account account = accountService.getAccountByNumber(entryImport.getAccount()); entry.setAccount(account); entry.setDescription(entryImport.getDescription()); entry.setAmount(new BigDecimal(entryImport.getAmount())); @@ -1279,7 +1240,7 @@ entry.setDetail(entryImport.getDetail()); entry.setVoucher(entryImport.getVoucher()); entry.setPosition(entryImport.getPosition()); - entryDAO.create(entry); + entryService.createEntry(entry); financialTransaction.addEntry(entry); } } 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-01-17 15:05:17 UTC (rev 3739) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java 2014-01-17 22:12:04 UTC (rev 3740) @@ -80,7 +80,7 @@ @Override public ReportsDatas generateAccountsReports(Account account, Boolean thirdPartAccountsMode, Date beginDate, Date endDate) throws LimaException { - ReportsDatas reportsDatas = new ReportsDatasImpl(); + ReportsDatas reportsDatas; try { BigDecimal credit = new BigDecimal(0); @@ -337,8 +337,8 @@ amount = new BigDecimal(0); } if (movementedFilter) { - if (reportsDatas.getAmountCredit() != BigDecimal.ZERO - || reportsDatas.getAmountDebit() != BigDecimal.ZERO) { + if (!reportsDatas.getAmountCredit().equals(BigDecimal.ZERO) + || !reportsDatas.getAmountDebit().equals(BigDecimal.ZERO)) { // add balance sheet to balance trial balanceTrial.addReportsDatas(reportsDatas); } 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-01-17 15:05:17 UTC (rev 3739) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/VatStatementServiceImpl.java 2014-01-17 22:12:04 UTC (rev 3740) @@ -90,7 +90,7 @@ @Override public List<VatStatement> getAllVatStatements() throws LimaException { - List<VatStatement> vatStatements = null; + List<VatStatement> vatStatements; try { VatStatementDAO vatStatementDAO = getDaoHelper().getVatStatementDAO(); vatStatements = vatStatementDAO.findAll(); @@ -118,7 +118,7 @@ @Override public List<VatStatement> getChildrenVatStatement(VatStatement masterVatStatement) throws LimaException { - List<VatStatement> vatStatements = null; + List<VatStatement> vatStatements; try { VatStatementDAO vatStatementDAO = getDaoHelper().getVatStatementDAO(); @@ -251,9 +251,9 @@ } @Override - public VatStatement findVatStatementByString(String label) throws LimaException { + public VatStatement findVatStatementByLabel(String label) throws LimaException { - VatStatement vatStatement = null; + VatStatement vatStatement; try { @@ -280,7 +280,7 @@ /** * Créé la liste de postes contenant les calculs de comptes * - * @throws TopiaException + * @throws LimaException */ public VatStatementDatas vatStatementReport(VatStatement vatStatement, Date selectedBeginDate, @@ -378,6 +378,18 @@ } @Override + public boolean checkVatStatementExist(String label) throws LimaException { + boolean result; + try { + VatStatementDAO vatStatementDAO = getDaoHelper().getVatStatementDAO(); + result = vatStatementDAO.existByProperties(VatStatement.PROPERTY_LABEL, label); + } catch (TopiaException e) { + throw new LimaException("Can't check VAT statement", e); + } + return result; + } + + @Override public void removeAllVatStatement() throws LimaException { for (VatStatement vatStatement : getChildrenVatStatement(null)) { removeVatStatement(vatStatement); Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/utils/LetteringComparator.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/utils/LetteringComparator.java 2014-01-17 15:05:17 UTC (rev 3739) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/utils/LetteringComparator.java 2014-01-17 22:12:04 UTC (rev 3740) @@ -35,7 +35,7 @@ int lengthFirstString = firstString.length(); int lengthSecondString = secondString.length(); - int result = 0; + int result; if (lengthFirstString < lengthSecondString) { result = -1; Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/AccountService.java =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/AccountService.java 2014-01-17 15:05:17 UTC (rev 3739) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/AccountService.java 2014-01-17 22:12:04 UTC (rev 3740) @@ -27,6 +27,7 @@ import org.chorem.lima.business.LimaException; import org.chorem.lima.entity.Account; +import org.nuiton.topia.TopiaException; import java.util.List; Added: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/ClosedPeriodicEntryBookService.java =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/ClosedPeriodicEntryBookService.java (rev 0) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/ClosedPeriodicEntryBookService.java 2014-01-17 22:12:04 UTC (rev 3740) @@ -0,0 +1,13 @@ +package org.chorem.lima.business.api; + +import org.chorem.lima.entity.ClosedPeriodicEntryBook; +import org.chorem.lima.entity.EntryBook; +import org.chorem.lima.entity.FinancialPeriod; + +/** + * Created by davidcosse on 17/01/14. + */ +public interface ClosedPeriodicEntryBookService { + + ClosedPeriodicEntryBook getByEntryBookAndFinancialPeriod(EntryBook entryBook, FinancialPeriod financialPeriod); +} Added: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/EntryService.java =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/EntryService.java (rev 0) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/EntryService.java 2014-01-17 22:12:04 UTC (rev 3740) @@ -0,0 +1,11 @@ +package org.chorem.lima.business.api; + +import org.chorem.lima.entity.Entry; + +/** + * Created by davidcosse on 17/01/14. + */ +public interface EntryService { + + Entry createEntry(Entry entry); +} Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialPeriodService.java =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialPeriodService.java 2014-01-17 15:05:17 UTC (rev 3739) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialPeriodService.java 2014-01-17 22:12:04 UTC (rev 3740) @@ -61,4 +61,6 @@ List<FinancialPeriod> getFinancialPeriods(Date beginDate, Date endDate) throws LimaException; + + FinancialPeriod getFinancialPeriodByNaturalIds(Date beginDate, Date endDate) throws LimaException; } Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialStatementService.java =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialStatementService.java 2014-01-17 15:05:17 UTC (rev 3739) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialStatementService.java 2014-01-17 22:12:04 UTC (rev 3740) @@ -56,4 +56,13 @@ String checkFinancialStatementChart() throws LimaException; + /** + * Check if Financial Statement exist according the label given as parameter. + * @param label the Financial Statement's label + * @return true if a statement with same label exist otherwise false. + * @throws LimaException + */ + boolean checkFinancialStatementExist(String label) throws LimaException; + + FinancialStatement getFinancialStatementByLabel(String label) throws LimaException; } Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/VatStatementService.java =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/VatStatementService.java 2014-01-17 15:05:17 UTC (rev 3739) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/VatStatementService.java 2014-01-17 22:12:04 UTC (rev 3740) @@ -49,7 +49,7 @@ Date selectedBeginDate, Date selectedEndDate) throws LimaException; - VatStatement findVatStatementByString(String label) throws LimaException; + VatStatement findVatStatementByLabel(String label) throws LimaException; List<VatStatementAmounts> vatStatementReport(Date beginDate, Date endDate) throws LimaException; @@ -58,5 +58,13 @@ void removeVatStatement(VatStatement vatStatement) throws LimaException; + /** + * Check if VAT Statement exist according the label given as parameter. + * @param label the VAT Statement's label + * @return true if a VAT statement with same label exist otherwise false. + * @throws LimaException + */ + boolean checkVatStatementExist(String label) throws LimaException; + } \ No newline at end of file Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/TypeEntry.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/TypeEntry.java 2014-01-17 15:05:17 UTC (rev 3739) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/TypeEntry.java 2014-01-17 22:12:04 UTC (rev 3740) @@ -3,8 +3,8 @@ /* * #%L * Lima :: Swing - * $Id:$ - * $HeadURL:$ + * $Id$ + * $HeadURL$ * %% * Copyright (C) 2008 - 2013 CodeLutin * %%
participants (1)
-
dcosse@users.chorem.org