Lima-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
August 2014
- 1 participants
- 25 discussions
Author: dcosse
Date: 2014-08-06 16:27:15 +0200 (Wed, 06 Aug 2014)
New Revision: 3902
Url: http://forge.chorem.org/projects/lima/repository/revisions/3902
Log:
refs #1054 d?\195?\169placement + correction du build
Added:
trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/
trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/AccountException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/AfterLastFiscalPeriodException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/AlreadyExistAccountException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/AlreadyExistEntryBookException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/AlreadyExistFinancialStatement.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/AlreadyExistVatStatementException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/AlreadyLockedFiscalPeriodException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/BeforeFirstFiscalPeriodException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/BeginAfterEndFiscalPeriodException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/ClosedPeriodicEntryBookException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/ClosedPeriodicEntryBooksException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/DateException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/EntriesException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/EntryBookException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/FinancialPeriodException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/FinancialTransactionsException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/FiscalPeriodException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/ImportBackupException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/ImportEbpException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/ImportFileException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/InvalidAccountNumberException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/LastUnlockedFiscalPeriodException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/LimaException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/LockedEntryBookException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/LockedFinancialPeriodException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/MoreOneUnlockFiscalPeriodException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/NoDataToImportException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/NoEmptyFiscalPeriodException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/NoFiscalPeriodFoundException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/NoFoundFinancialPeriodException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/NotAllowedLabelException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/NotBeginNextDayOfLastFiscalPeriodException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/NotLockedClosedPeriodicEntryBooksException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/NotNumberAccountNumberException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/UnbalancedEntriesException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/UnbalancedFinancialTransactionsException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/UnfilledEntriesException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/UsedAccountException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/UsedEntryBookException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/WithoutEntryBookFinancialTransactionsException.java
Removed:
trunk/lima-business-api/src/main/java/org/chorem/lima/ImportBackupException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/AccountException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/AfterLastFiscalPeriodException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/AlreadyExistAccountException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/AlreadyExistFinancialStatement.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/AlreadyExistVatStatement.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/AlreadyLockedFiscalPeriodException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/BeforeFirstFiscalPeriodException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/BeginAfterEndFiscalPeriodException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/ClosedPeriodicEntryBookException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/ClosedPeriodicEntryBooksException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/DateException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/EntriesException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/EntryBookException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/FinancialPeriodException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/FinancialTransactionsException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/FiscalPeriodException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/ImportEbpException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/InvalidAccountNumberException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/LastUnlockedFiscalPeriodException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/LimaException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/LockedEntryBookException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/LockedFinancialPeriodException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/MoreOneUnlockFiscalPeriodException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/NoDataToImportException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/NoEmptyFiscalPeriodException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/NoFiscalPeriodFoundException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/NoFoundFinancialPeriodException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/NotAllowedLabel.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/NotBeginNextDayOfLastFiscalPeriodException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/NotLockedClosedPeriodicEntryBooksException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/NotNumberAccountNumberException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/UnbalancedEntriesException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/UnbalancedFinancialTransactionsException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/UnfilledEntriesException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/UsedAccountException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/UsedEntryBookException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/WithoutEntryBookFinancialTransactionsException.java
Modified:
trunk/lima-business-api/src/main/java/org/chorem/lima/business/ImportResult.java
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/EntryBookService.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/FinancialTransactionService.java
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/ImportService.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/ReportService.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/VatStatementService.java
trunk/lima-business/pom.xml
trunk/lima-business/src/main/java/org/chorem/lima/business/AccountingRules.java
trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/DefaultAccountingRules.java
trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/FranceAccountingRules.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.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/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/resources/i18n/lima-business_fr_FR.properties
trunk/lima-business/src/test/java/org/chorem/lima/business/AbstractLimaTest.java
trunk/lima-business/src/test/java/org/chorem/lima/business/AccountServiceImplTest.java
trunk/lima-business/src/test/java/org/chorem/lima/business/EntryBookServiceImplTest.java
trunk/lima-business/src/test/java/org/chorem/lima/business/FinancialTransactionServiceImplTest.java
trunk/lima-business/src/test/java/org/chorem/lima/business/ImportExportServiceTest.java
trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/TestAccountingRules.java
trunk/lima-business/src/test/java/org/chorem/lima/entity/FinancialTransactionDAOTest.java
trunk/lima-swing/pom.xml
trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountViewHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/common/FinancialTransactionTableModel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookViewHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialperiod/FinancialPeriodViewHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartTreeTableModel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionViewHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedViewHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/FiscalPeriodViewHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringViewHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/CreateFiscalPeriodPanel.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/OpeningViewHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatchart/VatChartTreeTableModel.java
trunk/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties
trunk/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties
trunk/pom.xml
Modified: trunk/lima-business/pom.xml
===================================================================
--- trunk/lima-business/pom.xml 2014-08-06 12:04:19 UTC (rev 3901)
+++ trunk/lima-business/pom.xml 2014-08-06 14:27:15 UTC (rev 3902)
@@ -34,10 +34,6 @@
<version>${project.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.opencsv</groupId>
- <artifactId>opencsv</artifactId>
- </dependency>
- <dependency>
<groupId>org.apache.pdfbox</groupId>
<artifactId>pdfbox</artifactId>
</dependency>
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 2014-08-06 12:04:19 UTC (rev 3901)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/AccountingRules.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -25,6 +25,25 @@
package org.chorem.lima.business;
+import org.chorem.lima.business.exceptions.AfterLastFiscalPeriodException;
+import org.chorem.lima.business.exceptions.BeforeFirstFiscalPeriodException;
+import org.chorem.lima.business.exceptions.BeginAfterEndFiscalPeriodException;
+import org.chorem.lima.business.exceptions.InvalidAccountNumberException;
+import org.chorem.lima.business.exceptions.LastUnlockedFiscalPeriodException;
+import org.chorem.lima.business.exceptions.LockedEntryBookException;
+import org.chorem.lima.business.exceptions.LockedFinancialPeriodException;
+import org.chorem.lima.business.exceptions.MoreOneUnlockFiscalPeriodException;
+import org.chorem.lima.business.exceptions.NoEmptyFiscalPeriodException;
+import org.chorem.lima.business.exceptions.NotAllowedLabelException;
+import org.chorem.lima.business.exceptions.NotBeginNextDayOfLastFiscalPeriodException;
+import org.chorem.lima.business.exceptions.NotLockedClosedPeriodicEntryBooksException;
+import org.chorem.lima.business.exceptions.NotNumberAccountNumberException;
+import org.chorem.lima.business.exceptions.UnbalancedEntriesException;
+import org.chorem.lima.business.exceptions.UnbalancedFinancialTransactionsException;
+import org.chorem.lima.business.exceptions.UnfilledEntriesException;
+import org.chorem.lima.business.exceptions.UsedAccountException;
+import org.chorem.lima.business.exceptions.UsedEntryBookException;
+import org.chorem.lima.business.exceptions.WithoutEntryBookFinancialTransactionsException;
import org.chorem.lima.entity.Account;
import org.chorem.lima.entity.ClosedPeriodicEntryBook;
import org.chorem.lima.entity.Entry;
@@ -46,9 +65,9 @@
* Account rule : check create account.
*
* @param account new account
- * @throws LimaException if rule validation fails
+ * @throws org.chorem.lima.business.exceptions.LimaException if rule validation fails
*/
- void createAccountRules(Account account) throws InvalidAccountNumberException, NotNumberAccountNumberException, NotAllowedLabel;
+ void createAccountRules(Account account) throws InvalidAccountNumberException, NotNumberAccountNumberException, NotAllowedLabelException;
void updateAccountRules(Account account) throws InvalidAccountNumberException, NotNumberAccountNumberException;
@@ -58,7 +77,7 @@
* Entrybook rules.
*
* @param entryBook
- * @throws LimaException
+ * @throws org.chorem.lima.business.exceptions.LimaException
*/
void removeEntryBookRules(EntryBook entryBook) throws UsedEntryBookException;
@@ -66,7 +85,7 @@
* Fiscal Period rules
*
* @param fiscalPeriod
- * @throws LimaException
+ * @throws org.chorem.lima.business.exceptions.LimaException
*/
List<FinancialPeriod> createFiscalPeriodRules(FiscalPeriod fiscalPeriod)
throws BeginAfterEndFiscalPeriodException,
@@ -81,7 +100,7 @@
* Entry rules
*
* @param entry
- * @throws LockedEntryBookException
+ * @throws org.chorem.lima.business.exceptions.LockedEntryBookException
*/
void updateEntryRules(Entry entry, Entry entryOld) throws LockedEntryBookException;
@@ -100,7 +119,7 @@
* Check if a financial period can be closed.
*
* @param closedPeriodicEntryBook
- * @throws UnfilledEntriesException, WithoutEntryBookFinancialTransactionsException, UnbalancedFinancialTransactionsException, NotLockedClosedPeriodicEntryBooksException
+ * @throws org.chorem.lima.business.exceptions.UnfilledEntriesException, WithoutEntryBookFinancialTransactionsException, UnbalancedFinancialTransactionsException, NotLockedClosedPeriodicEntryBooksException
*/
void blockClosedPeriodicEntryBookRules(ClosedPeriodicEntryBook closedPeriodicEntryBook)
throws UnfilledEntriesException,
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 2014-08-06 12:04:19 UTC (rev 3901)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/DefaultAccountingRules.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -29,26 +29,26 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.business.AccountingRules;
-import org.chorem.lima.business.AfterLastFiscalPeriodException;
-import org.chorem.lima.business.BeforeFirstFiscalPeriodException;
-import org.chorem.lima.business.BeginAfterEndFiscalPeriodException;
-import org.chorem.lima.business.InvalidAccountNumberException;
-import org.chorem.lima.business.LastUnlockedFiscalPeriodException;
import org.chorem.lima.business.LimaInterceptor;
-import org.chorem.lima.business.LockedEntryBookException;
-import org.chorem.lima.business.LockedFinancialPeriodException;
-import org.chorem.lima.business.MoreOneUnlockFiscalPeriodException;
-import org.chorem.lima.business.NoEmptyFiscalPeriodException;
-import org.chorem.lima.business.NotAllowedLabel;
-import org.chorem.lima.business.NotBeginNextDayOfLastFiscalPeriodException;
-import org.chorem.lima.business.NotLockedClosedPeriodicEntryBooksException;
-import org.chorem.lima.business.NotNumberAccountNumberException;
-import org.chorem.lima.business.UnbalancedEntriesException;
-import org.chorem.lima.business.UnbalancedFinancialTransactionsException;
-import org.chorem.lima.business.UnfilledEntriesException;
-import org.chorem.lima.business.UsedAccountException;
-import org.chorem.lima.business.UsedEntryBookException;
-import org.chorem.lima.business.WithoutEntryBookFinancialTransactionsException;
+import org.chorem.lima.business.exceptions.AfterLastFiscalPeriodException;
+import org.chorem.lima.business.exceptions.BeforeFirstFiscalPeriodException;
+import org.chorem.lima.business.exceptions.BeginAfterEndFiscalPeriodException;
+import org.chorem.lima.business.exceptions.InvalidAccountNumberException;
+import org.chorem.lima.business.exceptions.LastUnlockedFiscalPeriodException;
+import org.chorem.lima.business.exceptions.LockedEntryBookException;
+import org.chorem.lima.business.exceptions.LockedFinancialPeriodException;
+import org.chorem.lima.business.exceptions.MoreOneUnlockFiscalPeriodException;
+import org.chorem.lima.business.exceptions.NoEmptyFiscalPeriodException;
+import org.chorem.lima.business.exceptions.NotAllowedLabelException;
+import org.chorem.lima.business.exceptions.NotBeginNextDayOfLastFiscalPeriodException;
+import org.chorem.lima.business.exceptions.NotLockedClosedPeriodicEntryBooksException;
+import org.chorem.lima.business.exceptions.NotNumberAccountNumberException;
+import org.chorem.lima.business.exceptions.UnbalancedEntriesException;
+import org.chorem.lima.business.exceptions.UnbalancedFinancialTransactionsException;
+import org.chorem.lima.business.exceptions.UnfilledEntriesException;
+import org.chorem.lima.business.exceptions.UsedAccountException;
+import org.chorem.lima.business.exceptions.UsedEntryBookException;
+import org.chorem.lima.business.exceptions.WithoutEntryBookFinancialTransactionsException;
import org.chorem.lima.entity.Account;
import org.chorem.lima.entity.ClosedPeriodicEntryBook;
import org.chorem.lima.entity.ClosedPeriodicEntryBookTopiaDao;
@@ -96,13 +96,13 @@
* Rules to check before create accounts.
*/
@Override
- public void createAccountRules(Account account) throws InvalidAccountNumberException, NotNumberAccountNumberException, NotAllowedLabel {
+ public void createAccountRules(Account account) throws InvalidAccountNumberException, NotNumberAccountNumberException, NotAllowedLabelException {
// Check if the numberaccount is not blank
if (StringUtils.isBlank(account.getAccountNumber())) {
throw new InvalidAccountNumberException(account.getAccountNumber());
}
if (account.getAccountNumber().contains("\\")){
- throw new NotAllowedLabel(account.getAccountNumber());
+ throw new NotAllowedLabelException(account.getAccountNumber());
}
}
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/FranceAccountingRules.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/FranceAccountingRules.java 2014-08-06 12:04:19 UTC (rev 3901)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/FranceAccountingRules.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -29,18 +29,18 @@
import org.apache.commons.lang3.time.DateUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.chorem.lima.business.BeginAfterEndFiscalPeriodException;
-import org.chorem.lima.business.InvalidAccountNumberException;
-import org.chorem.lima.business.LastUnlockedFiscalPeriodException;
-import org.chorem.lima.business.MoreOneUnlockFiscalPeriodException;
-import org.chorem.lima.business.NoEmptyFiscalPeriodException;
-import org.chorem.lima.business.NotAllowedLabel;
-import org.chorem.lima.business.NotBeginNextDayOfLastFiscalPeriodException;
-import org.chorem.lima.business.NotLockedClosedPeriodicEntryBooksException;
-import org.chorem.lima.business.NotNumberAccountNumberException;
-import org.chorem.lima.business.UnbalancedFinancialTransactionsException;
-import org.chorem.lima.business.UnfilledEntriesException;
-import org.chorem.lima.business.WithoutEntryBookFinancialTransactionsException;
+import org.chorem.lima.business.exceptions.BeginAfterEndFiscalPeriodException;
+import org.chorem.lima.business.exceptions.InvalidAccountNumberException;
+import org.chorem.lima.business.exceptions.LastUnlockedFiscalPeriodException;
+import org.chorem.lima.business.exceptions.MoreOneUnlockFiscalPeriodException;
+import org.chorem.lima.business.exceptions.NoEmptyFiscalPeriodException;
+import org.chorem.lima.business.exceptions.NotAllowedLabelException;
+import org.chorem.lima.business.exceptions.NotBeginNextDayOfLastFiscalPeriodException;
+import org.chorem.lima.business.exceptions.NotLockedClosedPeriodicEntryBooksException;
+import org.chorem.lima.business.exceptions.NotNumberAccountNumberException;
+import org.chorem.lima.business.exceptions.UnbalancedFinancialTransactionsException;
+import org.chorem.lima.business.exceptions.UnfilledEntriesException;
+import org.chorem.lima.business.exceptions.WithoutEntryBookFinancialTransactionsException;
import org.chorem.lima.entity.Account;
import org.chorem.lima.entity.ClosedPeriodicEntryBook;
import org.chorem.lima.entity.ClosedPeriodicEntryBookTopiaDao;
@@ -69,7 +69,7 @@
* Règles de vérification de la création du PCG, appliquées à la comptabilité française.
*/
@Override
- public void createAccountRules(Account account) throws InvalidAccountNumberException, NotNumberAccountNumberException, NotAllowedLabel {
+ public void createAccountRules(Account account) throws InvalidAccountNumberException, NotNumberAccountNumberException, NotAllowedLabelException {
super.createAccountRules(account);
validFranceAccountingRules(account);
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-08-06 12:04:19 UTC (rev 3901)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -27,14 +27,14 @@
import org.apache.commons.lang.StringUtils;
import org.chorem.lima.business.AccountingRules;
-import org.chorem.lima.business.AlreadyExistAccountException;
-import org.chorem.lima.business.InvalidAccountNumberException;
import org.chorem.lima.business.LimaConfig;
-import org.chorem.lima.business.LimaException;
-import org.chorem.lima.business.NotAllowedLabel;
-import org.chorem.lima.business.NotNumberAccountNumberException;
-import org.chorem.lima.business.UsedAccountException;
import org.chorem.lima.business.api.AccountService;
+import org.chorem.lima.business.exceptions.AlreadyExistAccountException;
+import org.chorem.lima.business.exceptions.InvalidAccountNumberException;
+import org.chorem.lima.business.exceptions.LimaException;
+import org.chorem.lima.business.exceptions.NotAllowedLabelException;
+import org.chorem.lima.business.exceptions.NotNumberAccountNumberException;
+import org.chorem.lima.business.exceptions.UsedAccountException;
import org.chorem.lima.business.utils.AccountComparator;
import org.chorem.lima.entity.Account;
import org.chorem.lima.entity.AccountTopiaDao;
@@ -72,7 +72,7 @@
}
@Override
- public boolean createOrUbdateAccount(Account account) throws InvalidAccountNumberException, NotNumberAccountNumberException, NotAllowedLabel {
+ public boolean createOrUbdateAccount(Account account) throws InvalidAccountNumberException, NotNumberAccountNumberException, NotAllowedLabelException {
// check if account number already exist
AccountTopiaDao accountDao = getDaoHelper().getAccountDao();
@@ -94,7 +94,7 @@
* @throws LimaException
*/
@Override
- public Account createAccount(Account account) throws AlreadyExistAccountException, InvalidAccountNumberException, NotNumberAccountNumberException, NotAllowedLabel {
+ public Account createAccount(Account account) throws AlreadyExistAccountException, InvalidAccountNumberException, NotNumberAccountNumberException, NotAllowedLabelException {
// check if account number already exist
AccountTopiaDao accountDao = getDaoHelper().getAccountDao();
@@ -108,7 +108,7 @@
return result;
}
- protected Account createNewAccount(Account account) throws InvalidAccountNumberException, NotNumberAccountNumberException, NotAllowedLabel {
+ protected Account createNewAccount(Account account) throws InvalidAccountNumberException, NotNumberAccountNumberException, NotAllowedLabelException {
// check rules before create the account
AccountingRules accountingRules = LimaConfig.getInstance().getAccountingRules();
accountingRules.createAccountRules(account);
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-06 12:04:19 UTC (rev 3901)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/EntryBookServiceImpl.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -27,8 +27,9 @@
import org.chorem.lima.business.AccountingRules;
import org.chorem.lima.business.LimaConfig;
-import org.chorem.lima.business.UsedEntryBookException;
import org.chorem.lima.business.api.EntryBookService;
+import org.chorem.lima.business.exceptions.AlreadyExistEntryBookException;
+import org.chorem.lima.business.exceptions.UsedEntryBookException;
import org.chorem.lima.entity.ClosedPeriodicEntryBook;
import org.chorem.lima.entity.ClosedPeriodicEntryBookImpl;
import org.chorem.lima.entity.ClosedPeriodicEntryBookTopiaDao;
@@ -44,8 +45,6 @@
import javax.ejb.TransactionAttribute;
import java.util.List;
-import static org.nuiton.i18n.I18n.t;
-
/**
* Implémente la fonction multi-EntryBook. Il est possible de créer ici le
* EntryBook des ventes, le EntryBook des achats, etc.
@@ -82,15 +81,13 @@
}
@Override
- public EntryBook createEntryBook(EntryBook entryBook) {
- EntryBook result = null;
+ public EntryBook createEntryBook(EntryBook entryBook) throws AlreadyExistEntryBookException {
+ EntryBook result;
// check if entrybook with is name already exist
EntryBookTopiaDao entryBookTopiaDao = getDaoHelper().getEntryBookDao();
EntryBook alreadyExistingEntryBook = entryBookTopiaDao.forCodeEquals(entryBook.getCode()).findUniqueOrNull();
if (alreadyExistingEntryBook != null) {
- log.error(
- t("lima-business.entrybook.entrybookalreadyexist",
- entryBook.getCode()));
+ throw new AlreadyExistEntryBookException(entryBook);
} else {
// creation du EntryBook
result = createNewEntryBook(entryBook);
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-08-06 12:04:19 UTC (rev 3901)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialPeriodServiceImpl.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -27,11 +27,11 @@
import org.chorem.lima.business.AccountingRules;
import org.chorem.lima.business.LimaConfig;
-import org.chorem.lima.business.NotLockedClosedPeriodicEntryBooksException;
-import org.chorem.lima.business.UnbalancedFinancialTransactionsException;
-import org.chorem.lima.business.UnfilledEntriesException;
-import org.chorem.lima.business.WithoutEntryBookFinancialTransactionsException;
import org.chorem.lima.business.api.FinancialPeriodService;
+import org.chorem.lima.business.exceptions.NotLockedClosedPeriodicEntryBooksException;
+import org.chorem.lima.business.exceptions.UnbalancedFinancialTransactionsException;
+import org.chorem.lima.business.exceptions.UnfilledEntriesException;
+import org.chorem.lima.business.exceptions.WithoutEntryBookFinancialTransactionsException;
import org.chorem.lima.entity.ClosedPeriodicEntryBook;
import org.chorem.lima.entity.ClosedPeriodicEntryBookTopiaDao;
import org.chorem.lima.entity.EntryBook;
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-06 12:04:19 UTC (rev 3901)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialStatementServiceImpl.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -39,12 +39,12 @@
import org.chorem.lima.beans.FinancialStatementDatas;
import org.chorem.lima.beans.FinancialStatementDatasImpl;
import org.chorem.lima.beans.ReportsDatas;
-import org.chorem.lima.business.AlreadyExistFinancialStatement;
-import org.chorem.lima.business.LimaException;
-import org.chorem.lima.business.NotAllowedLabel;
import org.chorem.lima.business.api.AccountService;
import org.chorem.lima.business.api.FinancialStatementService;
import org.chorem.lima.business.api.ReportService;
+import org.chorem.lima.business.exceptions.AlreadyExistFinancialStatement;
+import org.chorem.lima.business.exceptions.LimaException;
+import org.chorem.lima.business.exceptions.NotAllowedLabelException;
import org.chorem.lima.entity.Account;
import org.chorem.lima.entity.AccountTopiaDao;
import org.chorem.lima.entity.FinancialStatement;
@@ -84,9 +84,9 @@
}
};
- protected void validateNewFinancialStatement(FinancialStatement masterFinancialStatement, FinancialStatement financialStatement) throws AlreadyExistFinancialStatement, NotAllowedLabel {
+ protected void validateNewFinancialStatement(FinancialStatement masterFinancialStatement, FinancialStatement financialStatement) throws AlreadyExistFinancialStatement, NotAllowedLabelException {
if (financialStatement.getLabel().contains("/")) {
- throw new NotAllowedLabel(financialStatement.getLabel());
+ throw new NotAllowedLabelException(financialStatement.getLabel());
}
if (masterFinancialStatement != null) {
Collection<FinancialStatement> masterSubFinancialStatements = masterFinancialStatement.getSubFinancialStatements();
@@ -134,7 +134,7 @@
@Override
public FinancialStatement createFinancialStatement(FinancialStatement masterFinancialStatement,
- FinancialStatement financialStatement) throws AlreadyExistFinancialStatement, NotAllowedLabel {
+ FinancialStatement financialStatement) throws AlreadyExistFinancialStatement, NotAllowedLabelException {
validateNewFinancialStatement(masterFinancialStatement, financialStatement);
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-06 12:04:19 UTC (rev 3901)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -34,15 +34,15 @@
import org.chorem.lima.beans.FinancialTransactionCondition;
import org.chorem.lima.beans.LetteringFilter;
import org.chorem.lima.business.AccountingRules;
-import org.chorem.lima.business.AfterLastFiscalPeriodException;
-import org.chorem.lima.business.BeforeFirstFiscalPeriodException;
import org.chorem.lima.business.LimaConfig;
-import org.chorem.lima.business.LimaException;
-import org.chorem.lima.business.LockedEntryBookException;
-import org.chorem.lima.business.LockedFinancialPeriodException;
-import org.chorem.lima.business.UnbalancedEntriesException;
import org.chorem.lima.business.api.AccountService;
import org.chorem.lima.business.api.FinancialTransactionService;
+import org.chorem.lima.business.exceptions.AfterLastFiscalPeriodException;
+import org.chorem.lima.business.exceptions.BeforeFirstFiscalPeriodException;
+import org.chorem.lima.business.exceptions.LimaException;
+import org.chorem.lima.business.exceptions.LockedEntryBookException;
+import org.chorem.lima.business.exceptions.LockedFinancialPeriodException;
+import org.chorem.lima.business.exceptions.UnbalancedEntriesException;
import org.chorem.lima.business.utils.LetteringComparator;
import org.chorem.lima.entity.Entry;
import org.chorem.lima.entity.EntryBook;
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-06 12:04:19 UTC (rev 3901)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FiscalPeriodServiceImpl.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -30,26 +30,23 @@
import org.chorem.lima.beans.BalanceTrial;
import org.chorem.lima.beans.ReportsDatas;
import org.chorem.lima.business.AccountingRules;
-import org.chorem.lima.business.AlreadyExistAccountException;
-import org.chorem.lima.business.AlreadyLockedFiscalPeriodException;
-import org.chorem.lima.business.BeginAfterEndFiscalPeriodException;
-import org.chorem.lima.business.InvalidAccountNumberException;
-import org.chorem.lima.business.LastUnlockedFiscalPeriodException;
import org.chorem.lima.business.LimaConfig;
-import org.chorem.lima.business.LockedEntryBookException;
-import org.chorem.lima.business.LockedFinancialPeriodException;
-import org.chorem.lima.business.MoreOneUnlockFiscalPeriodException;
-import org.chorem.lima.business.NoEmptyFiscalPeriodException;
-import org.chorem.lima.business.NoFoundFinancialPeriodException;
-import org.chorem.lima.business.NotAllowedLabel;
-import org.chorem.lima.business.NotBeginNextDayOfLastFiscalPeriodException;
-import org.chorem.lima.business.NotNumberAccountNumberException;
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.FiscalPeriodService;
import org.chorem.lima.business.api.ReportService;
+import org.chorem.lima.business.exceptions.AlreadyLockedFiscalPeriodException;
+import org.chorem.lima.business.exceptions.BeginAfterEndFiscalPeriodException;
+import org.chorem.lima.business.exceptions.LastUnlockedFiscalPeriodException;
+import org.chorem.lima.business.exceptions.LimaException;
+import org.chorem.lima.business.exceptions.LockedEntryBookException;
+import org.chorem.lima.business.exceptions.LockedFinancialPeriodException;
+import org.chorem.lima.business.exceptions.MoreOneUnlockFiscalPeriodException;
+import org.chorem.lima.business.exceptions.NoEmptyFiscalPeriodException;
+import org.chorem.lima.business.exceptions.NoFoundFinancialPeriodException;
+import org.chorem.lima.business.exceptions.NotBeginNextDayOfLastFiscalPeriodException;
import org.chorem.lima.entity.Account;
import org.chorem.lima.entity.AccountImpl;
import org.chorem.lima.entity.ClosedPeriodicEntryBook;
@@ -290,13 +287,7 @@
@Override
public FiscalPeriod retainedEarningsAndBlockFiscalPeriod(FiscalPeriod fiscalPeriod, EntryBook entryBook,
boolean retainedEarnings)
- throws LockedFinancialPeriodException,
- LockedEntryBookException,
- NoFoundFinancialPeriodException,
- LastUnlockedFiscalPeriodException,
- AlreadyLockedFiscalPeriodException,
- AlreadyExistAccountException,
- InvalidAccountNumberException, NotNumberAccountNumberException, NotAllowedLabel {
+ throws LimaException {
if (entryBook != null && retainedEarnings) {
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-06 12:04:19 UTC (rev 3901)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -29,22 +29,8 @@
import org.chorem.lima.beans.EntryEBP;
import org.chorem.lima.beans.FinancialStatementImport;
import org.chorem.lima.beans.VatStatementImport;
-import org.chorem.lima.business.AlreadyExistAccountException;
-import org.chorem.lima.business.AlreadyExistFinancialStatement;
-import org.chorem.lima.business.AlreadyExistVatStatement;
-import org.chorem.lima.business.BeginAfterEndFiscalPeriodException;
-import org.chorem.lima.business.ImportEbpException;
import org.chorem.lima.business.ImportExportResults;
import org.chorem.lima.business.ImportResult;
-import org.chorem.lima.business.InvalidAccountNumberException;
-import org.chorem.lima.business.LockedEntryBookException;
-import org.chorem.lima.business.LockedFinancialPeriodException;
-import org.chorem.lima.business.MoreOneUnlockFiscalPeriodException;
-import org.chorem.lima.business.NoDataToImportException;
-import org.chorem.lima.business.NoFiscalPeriodFoundException;
-import org.chorem.lima.business.NotAllowedLabel;
-import org.chorem.lima.business.NotBeginNextDayOfLastFiscalPeriodException;
-import org.chorem.lima.business.NotNumberAccountNumberException;
import org.chorem.lima.business.api.AccountService;
import org.chorem.lima.business.api.EntryBookService;
import org.chorem.lima.business.api.EntryService;
@@ -65,6 +51,22 @@
import org.chorem.lima.business.ejb.ebp.AccountEBPModel;
import org.chorem.lima.business.ejb.ebp.EntryBookEBPModel;
import org.chorem.lima.business.ejb.ebp.EntryEBPModel;
+import org.chorem.lima.business.exceptions.AlreadyExistAccountException;
+import org.chorem.lima.business.exceptions.AlreadyExistEntryBookException;
+import org.chorem.lima.business.exceptions.AlreadyExistFinancialStatement;
+import org.chorem.lima.business.exceptions.AlreadyExistVatStatementException;
+import org.chorem.lima.business.exceptions.BeginAfterEndFiscalPeriodException;
+import org.chorem.lima.business.exceptions.ImportEbpException;
+import org.chorem.lima.business.exceptions.ImportFileException;
+import org.chorem.lima.business.exceptions.InvalidAccountNumberException;
+import org.chorem.lima.business.exceptions.LockedEntryBookException;
+import org.chorem.lima.business.exceptions.LockedFinancialPeriodException;
+import org.chorem.lima.business.exceptions.MoreOneUnlockFiscalPeriodException;
+import org.chorem.lima.business.exceptions.NoDataToImportException;
+import org.chorem.lima.business.exceptions.NoFiscalPeriodFoundException;
+import org.chorem.lima.business.exceptions.NotAllowedLabelException;
+import org.chorem.lima.business.exceptions.NotBeginNextDayOfLastFiscalPeriodException;
+import org.chorem.lima.business.exceptions.NotNumberAccountNumberException;
import org.chorem.lima.business.utils.EntryEBPComparator;
import org.chorem.lima.entity.Account;
import org.chorem.lima.entity.Entry;
@@ -76,6 +78,7 @@
import org.chorem.lima.entity.VatStatement;
import org.nuiton.csv.Import;
import org.nuiton.csv.ImportModel;
+import org.nuiton.csv.ImportRuntimeException;
import org.nuiton.util.beans.Binder;
import org.nuiton.util.beans.BinderFactory;
@@ -144,13 +147,13 @@
@Override
public ImportExportResults importAccountAsCSV(String contents) {
- ImportExportResults result = new ImportExportResults();
- ImportResult importResult = result.createAddAndGetImportResult(Account.class);
+ ImportExportResults results = new ImportExportResults();
+ ImportResult result = results.createAddAndGetImportResult(Account.class);
+ InputStream contentStream = IOUtils.toInputStream(contents);
if (StringUtils.isBlank(contents)) {
- importResult.addException(new NoDataToImportException());
+ result.addException(new NoDataToImportException());
} else {
- InputStream contentStream = IOUtils.toInputStream(contents);
try {
ImportModel<Account> model = new AccountModel();
Import<Account> accounts = Import.newImport(model, contentStream);
@@ -160,20 +163,21 @@
try {
updated = accountService.createOrUbdateAccount(account);
if (updated) {
- importResult.increaseUpdated();
+ result.increaseUpdated();
} else {
- importResult.increaseCreated();
+ result.increaseCreated();
}
- } catch (InvalidAccountNumberException | NotNumberAccountNumberException | NotAllowedLabel e) {
- importResult.addException(e);
+ } catch (InvalidAccountNumberException | NotNumberAccountNumberException | NotAllowedLabelException e) {
+ result.addException(e);
}
}
+ } catch (ImportRuntimeException e) {
+ result.addInitException(new ImportFileException(e.getMessage()));
} finally {
IOUtils.closeQuietly(contentStream);
}
}
-
- return result;
+ return results;
}
@Override
@@ -186,19 +190,22 @@
} else {
InputStream contentStream = IOUtils.toInputStream(contents);
- ImportModel<EntryBook> model = new EntryBookModel();
-
- Import<EntryBook> entryBooks = Import.newImport(model, contentStream);
- for (EntryBook entryBook : entryBooks) {
- boolean updated = entryBookService.createOrUpdateEntryBook(entryBook);
- if(updated) {
- result.increaseUpdated();
- } else {
- result.increaseCreated();
+ try {
+ ImportModel<EntryBook> model = new EntryBookModel();
+ Import<EntryBook> entryBooks = Import.newImport(model, contentStream);
+ for (EntryBook entryBook : entryBooks) {
+ boolean updated = entryBookService.createOrUpdateEntryBook(entryBook);
+ if(updated) {
+ result.increaseUpdated();
+ } else {
+ result.increaseCreated();
+ }
}
+ } catch (ImportRuntimeException e) {
+ result.addInitException(new ImportFileException(e.getMessage()));
+ } finally {
+ IOUtils.closeQuietly(contentStream);
}
-
- IOUtils.closeQuietly(contentStream);
}
return results;
}
@@ -225,6 +232,8 @@
} catch (MoreOneUnlockFiscalPeriodException | BeginAfterEndFiscalPeriodException | NotBeginNextDayOfLastFiscalPeriodException e) {
result.addException(e);
}
+ } catch (ImportRuntimeException e) {
+ result.addInitException(new ImportFileException(e.getMessage()));
} finally {
IOUtils.closeQuietly(contentStream);
}
@@ -256,6 +265,8 @@
}
}
+ } catch (ImportRuntimeException e) {
+ result.addInitException(new ImportFileException(e.getMessage()));
} finally {
IOUtils.closeQuietly(contentStream);
}
@@ -273,13 +284,19 @@
} else {
// import and save entries
InputStream contentStream = IOUtils.toInputStream(contents);
- ImportModel<Entry> model = new EntryModel(accountService, financialTransactionService, false);
- Import<Entry> entries = Import.newImport(model, contentStream);
- for (Entry entry : entries) {
- entryService.createEntry(entry);
- result.increaseCreated();
+ try {
+ ImportModel<Entry> model = new EntryModel(accountService, financialTransactionService, false);
+ Import<Entry> entries = Import.newImport(model, contentStream);
+ for (Entry entry : entries) {
+ entryService.createEntry(entry);
+ result.increaseCreated();
+ }
+ } catch (ImportRuntimeException e) {
+ result.addInitException(new ImportFileException(e.getMessage()));
+ } finally {
+ IOUtils.closeQuietly(contentStream);
}
- IOUtils.closeQuietly(contentStream);
+
}
return results;
}
@@ -291,9 +308,9 @@
if (StringUtils.isBlank(contents)) {
result.addException(new NoDataToImportException());
} else {
+ InputStream contentStream = null;
// import and save identity
- if (StringUtils.isNotBlank(contents)){
- InputStream contentStream = null;
+ try {
contentStream = IOUtils.toInputStream(contents);
ImportModel<Identity> model = new IdentityModel();
Import<Identity> identities = Import.newImport(model, contentStream);
@@ -302,12 +319,16 @@
result.increaseCreated();
}
IOUtils.closeQuietly(contentStream);
+ } catch (ImportRuntimeException e) {
+ result.addInitException(new ImportFileException(e.getMessage()));
+ } finally {
+ IOUtils.closeQuietly(contentStream);
}
}
return results;
}
- protected FinancialStatement returnFinancialStatement (FinancialStatement rootFinancialStatement, String subFinancialStatementLabel) throws AlreadyExistFinancialStatement, NotAllowedLabel {
+ protected FinancialStatement returnFinancialStatement (FinancialStatement rootFinancialStatement, String subFinancialStatementLabel) throws AlreadyExistFinancialStatement, NotAllowedLabelException {
Collection<FinancialStatement> subFinancialStatements = rootFinancialStatement.getSubFinancialStatements();
FinancialStatement targetedFinancialStatement = null;
@@ -443,11 +464,13 @@
}
result.increaseCreated();
- } catch (AlreadyExistFinancialStatement | NotAllowedLabel e) {
+ } catch (AlreadyExistFinancialStatement | NotAllowedLabelException e) {
result.addException(e);
}
}
+ } catch (ImportRuntimeException e) {
+ result.addInitException(new ImportFileException(e.getMessage()));
} finally {
IOUtils.closeQuietly(contentStream);
}
@@ -456,7 +479,7 @@
return results;
}
- protected VatStatement returnVATStatement (VatStatement rootVATStatement, String subVATStatementLabel) throws AlreadyExistVatStatement, NotAllowedLabel {
+ protected VatStatement returnVATStatement (VatStatement rootVATStatement, String subVATStatementLabel) throws AlreadyExistVatStatementException, NotAllowedLabelException {
Collection<VatStatement> subVatStatements = rootVATStatement.getSubVatStatements();
VatStatement targetedVATStatement = null;
@@ -591,11 +614,13 @@
}
result.increaseCreated();
- } catch (AlreadyExistVatStatement | NotAllowedLabel e) {
+ } catch (AlreadyExistVatStatementException | NotAllowedLabelException e) {
result.addException(e);
}
}
+ } catch (ImportRuntimeException e) {
+ result.addInitException(new ImportFileException(e.getMessage()));
} finally {
IOUtils.closeQuietly(contentStream);
}
@@ -626,22 +651,29 @@
if (StringUtils.isBlank(contents)) {
result.addException(new NoDataToImportException());
} else {
- ImportModel<Account> model = new AccountEBPModel();
InputStream contentStream = IOUtils.toInputStream(contents);
- Import<Account> accounts = Import.newImport(model, contentStream);
+ try {
+ ImportModel<Account> model = new AccountEBPModel();
+ contentStream = IOUtils.toInputStream(contents);
+ Import<Account> accounts = Import.newImport(model, contentStream);
- for (Account account : accounts) {
- boolean updated = false;
- try {
- updated = accountService.createOrUbdateAccount(account);
- } catch (InvalidAccountNumberException | NotNumberAccountNumberException | NotAllowedLabel e) {
- result.addException(e);
+ for (Account account : accounts) {
+ boolean updated = false;
+ try {
+ updated = accountService.createOrUbdateAccount(account);
+ } catch (InvalidAccountNumberException | NotNumberAccountNumberException | NotAllowedLabelException e) {
+ result.addException(e);
+ }
+ if (updated) {
+ result.increaseUpdated();
+ } else {
+ result.increaseCreated();
+ }
}
- if (updated) {
- result.increaseUpdated();
- } else {
- result.increaseCreated();
- }
+ } catch (ImportRuntimeException e) {
+ result.addInitException(new ImportFileException(e.getMessage()));
+ } finally {
+ IOUtils.closeQuietly(contentStream);
}
}
return results;
@@ -656,16 +688,22 @@
result.addException(new NoDataToImportException());
} else {
InputStream contentStream = IOUtils.toInputStream(contents);
- ImportModel<EntryBook> model = new EntryBookEBPModel();
- Import<EntryBook> entryBooks = Import.newImport(model, contentStream);
+ try {
+ ImportModel<EntryBook> model = new EntryBookEBPModel();
+ Import<EntryBook> entryBooks = Import.newImport(model, contentStream);
- for (EntryBook entryEBP : entryBooks) {
- boolean updated = entryBookService.createOrUpdateEntryBook(entryEBP);
- if (updated) {
- result.increaseUpdated();
- } else {
- result.increaseCreated();
+ for (EntryBook entryEBP : entryBooks) {
+ boolean updated = entryBookService.createOrUpdateEntryBook(entryEBP);
+ if (updated) {
+ result.increaseUpdated();
+ } else {
+ result.increaseCreated();
+ }
}
+ } catch (ImportRuntimeException e) {
+ result.addInitException(new ImportFileException(e.getMessage()));
+ } finally {
+ IOUtils.closeQuietly(contentStream);
}
}
@@ -682,20 +720,24 @@
}
}
- protected List<EntryEBP> loadDateOrderedEntryEBPbeans(String datas) {
+ protected List<EntryEBP> loadDateOrderedEntryEBPbeans(String datas) throws ImportFileException {
List<EntryEBP> result = new ArrayList<>();
InputStream contentStream = null;
// convert file to bean
- contentStream = IOUtils.toInputStream(datas);
- ImportModel<EntryEBP> model = new EntryEBPModel();
- Import<EntryEBP> importedEntryEBPs = Import.newImport(model, contentStream);
- for (EntryEBP entryEBP : importedEntryEBPs) {
- result.add(entryEBP);
+ try {
+ contentStream = IOUtils.toInputStream(datas);
+ ImportModel<EntryEBP> model = new EntryEBPModel();
+ Import<EntryEBP> importedEntryEBPs = Import.newImport(model, contentStream);
+ for (EntryEBP entryEBP : importedEntryEBPs) {
+ result.add(entryEBP);
+ }
+ // sort been by date
+ Collections.sort(result, new EntryEBPComparator());
+ } catch (RuntimeException e) {
+ throw new ImportFileException(e.getMessage());
+ } finally {
+ IOUtils.closeQuietly(contentStream);
}
- // sort been by date
- Collections.sort(result, new EntryEBPComparator());
- IOUtils.closeQuietly(contentStream);
-
return result;
}
@@ -734,59 +776,61 @@
result.addException(e);
}
- List<Account> accounts = accountService.getAllAccounts();
- accounts = accounts == null ? new ArrayList<Account>() : accounts;
- Map<String, Account> indexedAccounts = Maps.newHashMap(Maps.uniqueIndex(accounts, GET_ACCOUNT_NUMBER));
+ try {
+ List<Account> accounts = accountService.getAllAccounts();
+ accounts = accounts == null ? new ArrayList<Account>() : accounts;
+ Map<String, Account> indexedAccounts = Maps.newHashMap(Maps.uniqueIndex(accounts, GET_ACCOUNT_NUMBER));
- List<EntryBook> entryBooks = entryBookService.getAllEntryBooks();
- entryBooks = entryBooks == null ? new ArrayList<EntryBook>() : entryBooks;
- Map<String, EntryBook> indexedEntryBooks = Maps.newHashMap(Maps.uniqueIndex(entryBooks, GET_ENTRY_BOOK_CODE));
+ List<EntryBook> entryBooks = entryBookService.getAllEntryBooks();
+ entryBooks = entryBooks == null ? new ArrayList<EntryBook>() : entryBooks;
+ Map<String, EntryBook> indexedEntryBooks = Maps.newHashMap(Maps.uniqueIndex(entryBooks, GET_ENTRY_BOOK_CODE));
- List<EntryEBP> entryEBPs = loadDateOrderedEntryEBPbeans(contents);
+ List<EntryEBP> entryEBPs = loadDateOrderedEntryEBPbeans(contents);
- // For all entries loaded from the file
- // the entry is validate (checking for valide FiscalPeriod and existing Account associated to it)
- // if valid entry
- // the entry entity is created and the association with it's dependant entites (Account are FinancialTransaction) are created
- Date fiscalPeriodsBiginDate = fiscalPeriods.get(0).getBeginDate();
- Date fiscalPeriodsEndingDate = fiscalPeriods.get(fiscalPeriods.size() - 1).getEndDate();
- Map<EntryBook, Map<Date, FinancialTransaction>> entryBookFinancialTransactionByDate = getEntryBookFinancialTransactionOrderedByDate(fiscalPeriodsBiginDate, fiscalPeriodsEndingDate);
+ // For all entries loaded from the file
+ // the entry is validate (checking for valide FiscalPeriod and existing Account associated to it)
+ // if valid entry
+ // the entry entity is created and the association with it's dependant entites (Account are FinancialTransaction) are created
+ Date fiscalPeriodsBiginDate = fiscalPeriods.get(0).getBeginDate();
+ Date fiscalPeriodsEndingDate = fiscalPeriods.get(fiscalPeriods.size() - 1).getEndDate();
+ Map<EntryBook, Map<Date, FinancialTransaction>> entryBookFinancialTransactionByDate = getEntryBookFinancialTransactionOrderedByDate(fiscalPeriodsBiginDate, fiscalPeriodsEndingDate);
- for (EntryEBP entryEBP : entryEBPs) {
- Date dateEcr = entryEBP.getDatEcr();
+ for (EntryEBP entryEBP : entryEBPs) {
+ Date dateEcr = entryEBP.getDatEcr();
- // account loading
- Account account = indexedAccounts.get(entryEBP.getCompte());
+ // account loading
+ Account account = indexedAccounts.get(entryEBP.getCompte());
- if (!validEntry(result, dateEcr, fiscalPeriodsBiginDate, fiscalPeriodsEndingDate, account, entryEBP.getCompte())) {
- continue;
- }
- // create entry
- else {
- // creation of the entry
- // initialisation of this attributs
- Entry entry = createEntry(entryEBP, account);
+ if (!validEntry(result, dateEcr, fiscalPeriodsBiginDate, fiscalPeriodsEndingDate, account, entryEBP.getCompte())) {
+ continue;
+ }
+ // create entry
+ else {
+ // creation of the entry
+ // initialisation of this attributs
+ Entry entry = createEntry(entryEBP, account);
- try {
- // find financial transactions for entry period and entrybook
- addEntryToFinancialTransaction(entry, entryEBP.getJournal(), indexedEntryBooks, entryBookFinancialTransactionByDate, dateEcr);
+ try {
+ // find financial transactions for entry period and entrybook
+ addEntryToFinancialTransaction(entry, entryEBP.getJournal(), indexedEntryBooks, entryBookFinancialTransactionByDate, dateEcr);
- } catch (LockedFinancialPeriodException | LockedEntryBookException e) {
- result.addException(e);
- continue;
+ } catch (LockedFinancialPeriodException | LockedEntryBookException | AlreadyExistEntryBookException e) {
+ result.addException(e);
+ continue;
+ }
+
}
-
+ result.increaseCreated();
}
- result.increaseCreated();
+ if (log.isInfoEnabled()) {
+ long after = System.currentTimeMillis();
+ log.info("Imported form EBP : " + entryEBPs.size() + " entries in "
+ + (after - before) + " ms");
+ }
+ } catch(ImportFileException e) {
+ result.addException(e);
}
-
- if (log.isInfoEnabled()) {
- long after = System.currentTimeMillis();
- log.info("Imported form EBP : " + entryEBPs.size() + " entries in "
- + (after - before) + " ms");
- }
}
-
return results;
}
@@ -812,7 +856,7 @@
return entry;
}
- protected void addEntryToFinancialTransaction(Entry entry, String entryBookCode, Map<String, EntryBook> indexedEntryBooks, Map<EntryBook, Map<Date, FinancialTransaction>> entryBookFinancialTransactionByDate, Date dateEcr) throws LockedFinancialPeriodException, LockedEntryBookException {
+ protected void addEntryToFinancialTransaction(Entry entry, String entryBookCode, Map<String, EntryBook> indexedEntryBooks, Map<EntryBook, Map<Date, FinancialTransaction>> entryBookFinancialTransactionByDate, Date dateEcr) throws LockedFinancialPeriodException, LockedEntryBookException, AlreadyExistEntryBookException {
EntryBook entryBook = getEntryBook(indexedEntryBooks, entryBookCode);
Map<Date, FinancialTransaction> financialTransactionsByDate = entryBookFinancialTransactionByDate.get(entryBook);
@@ -840,7 +884,7 @@
financialTransactionService.createEntry(entry);
}
- protected EntryBook getEntryBook(Map<String, EntryBook> indexedEntryBooks, String entryBookCode) {
+ protected EntryBook getEntryBook(Map<String, EntryBook> indexedEntryBooks, String entryBookCode) throws AlreadyExistEntryBookException {
EntryBook entryBook;
// entryBook loading
entryBook = indexedEntryBooks.get(entryBookCode);
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-06 12:04:19 UTC (rev 3901)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -32,10 +32,10 @@
import org.chorem.lima.beans.BalanceTrialImpl;
import org.chorem.lima.beans.ReportsDatas;
import org.chorem.lima.beans.ReportsDatasImpl;
-import org.chorem.lima.business.LimaException;
import org.chorem.lima.business.api.AccountService;
import org.chorem.lima.business.api.FinancialPeriodService;
import org.chorem.lima.business.api.ReportService;
+import org.chorem.lima.business.exceptions.LimaException;
import org.chorem.lima.business.utils.AccountComparator;
import org.chorem.lima.entity.Account;
import org.chorem.lima.entity.AccountTopiaDao;
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-06 12:04:19 UTC (rev 3901)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/VatStatementServiceImpl.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -32,12 +32,12 @@
import org.chorem.lima.beans.VatStatementAmountsImpl;
import org.chorem.lima.beans.VatStatementDatas;
import org.chorem.lima.beans.VatStatementDatasImpl;
-import org.chorem.lima.business.AlreadyExistVatStatement;
-import org.chorem.lima.business.LimaException;
-import org.chorem.lima.business.NotAllowedLabel;
import org.chorem.lima.business.api.AccountService;
import org.chorem.lima.business.api.ReportService;
import org.chorem.lima.business.api.VatStatementService;
+import org.chorem.lima.business.exceptions.AlreadyExistVatStatementException;
+import org.chorem.lima.business.exceptions.LimaException;
+import org.chorem.lima.business.exceptions.NotAllowedLabelException;
import org.chorem.lima.entity.Account;
import org.chorem.lima.entity.VatStatement;
import org.chorem.lima.entity.VatStatementTopiaDao;
@@ -78,9 +78,9 @@
}
};
- protected void validateNewVATStatement(VatStatement masterVatStatement, VatStatement vatStatement) throws AlreadyExistVatStatement, NotAllowedLabel {
+ protected void validateNewVATStatement(VatStatement masterVatStatement, VatStatement vatStatement) throws AlreadyExistVatStatementException, NotAllowedLabelException {
if (vatStatement.getLabel().contains("/")) {
- throw new NotAllowedLabel(vatStatement.getLabel());
+ throw new NotAllowedLabelException(vatStatement.getLabel());
}
if (masterVatStatement != null) {
Collection<VatStatement> masterSubVatStatements = masterVatStatement.getSubVatStatements();
@@ -89,7 +89,7 @@
}
Map indexedSubVatStatements = Maps.uniqueIndex(masterSubVatStatements, GET_LABEL);
if (indexedSubVatStatements.get(vatStatement.getLabel()) != null){
- throw new AlreadyExistVatStatement(vatStatement.getLabel(), masterVatStatement.getLabel());
+ throw new AlreadyExistVatStatementException(vatStatement.getLabel(), masterVatStatement.getLabel());
}
}
}
@@ -117,7 +117,7 @@
@Override
public VatStatement createVatStatement(VatStatement masterVatStatement,
- VatStatement vatStatement) throws AlreadyExistVatStatement, NotAllowedLabel {
+ VatStatement vatStatement) throws AlreadyExistVatStatementException, NotAllowedLabelException {
validateNewVATStatement(masterVatStatement, vatStatement);
Modified: trunk/lima-business/src/main/resources/i18n/lima-business_fr_FR.properties
===================================================================
--- trunk/lima-business/src/main/resources/i18n/lima-business_fr_FR.properties 2014-08-06 12:04:19 UTC (rev 3901)
+++ trunk/lima-business/src/main/resources/i18n/lima-business_fr_FR.properties 2014-08-06 14:27:15 UTC (rev 3902)
@@ -88,7 +88,6 @@
lima-business.import.account.InvalidAccountNumber=Le numéro de compt %1$s n'est pas valide\n
lima-business.import.account.added=Succès \: Compte %s - %s ajouté\n
lima-business.import.account.alreadyExist=Le compte %1$s - existe déjà \n
-lima-business.import.account.alreadyexist=
lima-business.import.accountadded=Succès \: Compte %s - %s ajouté\n
lima-business.import.accountalreadyexist=Échec \: Le compte %s existe déjà \n
lima-business.import.closedPeriodicEntryBook.error.NotLockedPreviousEntryBook=Les périodes financières précédentes pour ce journal doivent être bloquées avant
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 2014-08-06 12:04:19 UTC (rev 3901)
+++ trunk/lima-business/src/test/java/org/chorem/lima/business/AbstractLimaTest.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -206,7 +206,7 @@
* Not called by default (<code>@Before</code>) to allow init test with
* CSV or EBP import.
*
- * @throws org.chorem.lima.business.LimaException
+ * @throws org.chorem.lima.business.exceptions.LimaException
* @throws java.text.ParseException
*/
protected void initTestDatabase() throws Exception {
@@ -218,7 +218,7 @@
/**
* Create a basic account plan.
*
- * @throws LimaException
+ * @throws org.chorem.lima.business.exceptions.LimaException
* @throws java.text.ParseException
*/
protected void initTestWithAccounts() throws Exception {
@@ -263,7 +263,7 @@
/**
* Create some EntryBooks.
*
- * @throws org.chorem.lima.business.LimaException
+ * @throws org.chorem.lima.business.exceptions.LimaException
* @throws java.text.ParseException
*/
protected void initTestWithEntryBooks() throws Exception {
@@ -288,7 +288,7 @@
/**
* Create a FiscalPeriod with an EntryBook.
*
- * @throws org.chorem.lima.business.LimaException
+ * @throws org.chorem.lima.business.exceptions.LimaException
* @throws java.text.ParseException
*/
protected void initTestWithFiscalPeriod() throws Exception {
Modified: trunk/lima-business/src/test/java/org/chorem/lima/business/AccountServiceImplTest.java
===================================================================
--- trunk/lima-business/src/test/java/org/chorem/lima/business/AccountServiceImplTest.java 2014-08-06 12:04:19 UTC (rev 3901)
+++ trunk/lima-business/src/test/java/org/chorem/lima/business/AccountServiceImplTest.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -25,6 +25,8 @@
package org.chorem.lima.business;
+import org.chorem.lima.business.exceptions.LimaException;
+import org.chorem.lima.business.exceptions.UsedAccountException;
import org.chorem.lima.entity.Account;
import org.chorem.lima.entity.AccountImpl;
import org.junit.Assert;
@@ -52,7 +54,7 @@
/**
* Création d'un compte dans le plan comptable.
- * @throws LimaException
+ * @throws org.chorem.lima.business.exceptions.LimaException
*/
@Test
public void createAccountTest() throws LimaException {
Modified: trunk/lima-business/src/test/java/org/chorem/lima/business/EntryBookServiceImplTest.java
===================================================================
--- trunk/lima-business/src/test/java/org/chorem/lima/business/EntryBookServiceImplTest.java 2014-08-06 12:04:19 UTC (rev 3901)
+++ trunk/lima-business/src/test/java/org/chorem/lima/business/EntryBookServiceImplTest.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -25,6 +25,8 @@
package org.chorem.lima.business;
+import org.chorem.lima.business.exceptions.LimaException;
+import org.chorem.lima.business.exceptions.UsedEntryBookException;
import org.chorem.lima.entity.EntryBook;
import org.chorem.lima.entity.EntryBookImpl;
import org.chorem.lima.entity.FinancialTransaction;
@@ -57,7 +59,7 @@
/**
* Permet de tester la modification d'un journal suivant son préfixe.
*
- * @throws LimaException
+ * @throws org.chorem.lima.business.exceptions.LimaException
*/
@Test
public void modifyJournalTest() throws LimaException {
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 2014-08-06 12:04:19 UTC (rev 3901)
+++ trunk/lima-business/src/test/java/org/chorem/lima/business/FinancialTransactionServiceImplTest.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -24,6 +24,7 @@
package org.chorem.lima.business;
import org.chorem.lima.business.ejb.FinancialTransactionServiceImpl;
+import org.chorem.lima.business.exceptions.LimaException;
import org.chorem.lima.entity.Account;
import org.chorem.lima.entity.Entry;
import org.chorem.lima.entity.EntryBook;
@@ -62,7 +63,7 @@
* Nothing wrong here.
*
* @throws ParseException
- * @throws LimaException
+ * @throws org.chorem.lima.business.exceptions.LimaException
*/
@Test
public void testGetInexactTransactionAllGood() throws ParseException, LimaException {
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-06 12:04:19 UTC (rev 3901)
+++ trunk/lima-business/src/test/java/org/chorem/lima/business/ImportExportServiceTest.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -26,6 +26,13 @@
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.io.IOUtils;
import org.chorem.lima.LimaTechnicalException;
+import org.chorem.lima.business.exceptions.AlreadyExistEntryBookException;
+import org.chorem.lima.business.exceptions.BeginAfterEndFiscalPeriodException;
+import org.chorem.lima.business.exceptions.ImportEbpException;
+import org.chorem.lima.business.exceptions.ImportFileException;
+import org.chorem.lima.business.exceptions.LimaException;
+import org.chorem.lima.business.exceptions.MoreOneUnlockFiscalPeriodException;
+import org.chorem.lima.business.exceptions.NotBeginNextDayOfLastFiscalPeriodException;
import org.chorem.lima.entity.Account;
import org.chorem.lima.entity.AccountImpl;
import org.chorem.lima.entity.Entry;
@@ -48,6 +55,7 @@
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
+import java.util.Map;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
@@ -96,6 +104,19 @@
}
@Test
+ public void testExportImportAccountsException() throws Exception {
+ String inportStream = IOUtils.toString(ImportExportServiceTest.class.getResourceAsStream("/import/bcr_developed.csv"));
+ ImportExportResults result = importService.importAccountAsCSV(inportStream);
+ Assert.assertNotNull(result);
+ Map<Integer, LimaException> exceptionMap = result.getImportResults().get(0).getAllExceptionsByLine();
+ Assert.assertNotNull(exceptionMap);
+ Collection<LimaException> exceptions = exceptionMap.values();
+ Assert.assertEquals(1, exceptions.size());
+ ImportFileException exception = (ImportFileException) exceptions.iterator().next();
+ Assert.assertNotNull(exception);
+ }
+
+ @Test
public void testExportImportEntryBooks() throws Exception {
initTestWithEntryBooks();
@@ -435,7 +456,7 @@
}
@Test
- public void testImportEntryBooksFromEBP() throws IOException {
+ public void testImportEntryBooksFromEBP() throws IOException, AlreadyExistEntryBookException {
InputStream entryBookStream = ImportExportServiceTest.class.getResourceAsStream("/ebp/journaux.txt");
String entryBookData = IOUtils.toString(entryBookStream, "ISO-8859-1");
entryBookStream.close();
Modified: trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/TestAccountingRules.java
===================================================================
--- trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/TestAccountingRules.java 2014-08-06 12:04:19 UTC (rev 3901)
+++ trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/TestAccountingRules.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -24,9 +24,9 @@
package org.chorem.lima.business.accountingrules;
import org.apache.commons.lang3.time.DateUtils;
-import org.chorem.lima.business.BeginAfterEndFiscalPeriodException;
-import org.chorem.lima.business.MoreOneUnlockFiscalPeriodException;
-import org.chorem.lima.business.NotBeginNextDayOfLastFiscalPeriodException;
+import org.chorem.lima.business.exceptions.BeginAfterEndFiscalPeriodException;
+import org.chorem.lima.business.exceptions.MoreOneUnlockFiscalPeriodException;
+import org.chorem.lima.business.exceptions.NotBeginNextDayOfLastFiscalPeriodException;
import org.chorem.lima.entity.FinancialPeriod;
import org.chorem.lima.entity.FinancialPeriodImpl;
import org.chorem.lima.entity.FiscalPeriod;
Modified: trunk/lima-business/src/test/java/org/chorem/lima/entity/FinancialTransactionDAOTest.java
===================================================================
--- trunk/lima-business/src/test/java/org/chorem/lima/entity/FinancialTransactionDAOTest.java 2014-08-06 12:04:19 UTC (rev 3901)
+++ trunk/lima-business/src/test/java/org/chorem/lima/entity/FinancialTransactionDAOTest.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -24,7 +24,7 @@
package org.chorem.lima.entity;
import org.chorem.lima.business.AbstractLimaTest;
-import org.chorem.lima.business.LimaException;
+import org.chorem.lima.business.exceptions.LimaException;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
Deleted: trunk/lima-business-api/src/main/java/org/chorem/lima/ImportBackupException.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/ImportBackupException.java 2014-08-06 12:04:19 UTC (rev 3901)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/ImportBackupException.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -1,13 +0,0 @@
-package org.chorem.lima;
-
-import org.chorem.lima.business.LimaException;
-
-/**
- * Created by davidcosse on 31/07/14.
- */
-public class ImportBackupException extends LimaException {
-
- public ImportBackupException(String message, Throwable cause) {
- super(message, cause);
- }
-}
Deleted: trunk/lima-business-api/src/main/java/org/chorem/lima/business/AccountException.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/AccountException.java 2014-08-06 12:04:19 UTC (rev 3901)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/AccountException.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -1,54 +0,0 @@
-package org.chorem.lima.business;
-
-/*
- * #%L
- * Lima :: business API
- * %%
- * Copyright (C) 2008 - 2014 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-/**
- * @author Sylvain Bavencoff <bavencoff(a)codelutin.com>
- */
-public abstract class AccountException extends LimaException {
-
- protected String accountNumber;
-
- public AccountException(String accountNumber) {
- this.accountNumber = accountNumber;
- }
-
- public AccountException(String accountNumber, Throwable cause) {
- super(cause);
- this.accountNumber = accountNumber;
- }
-
- public AccountException(String accountNumber, String message) {
- super(message);
- this.accountNumber = accountNumber;
- }
-
- public AccountException(String accountNumber, String message, Throwable cause) {
- super(message, cause);
- this.accountNumber = accountNumber;
- }
-
- public String getAccountNumber() {
- return accountNumber;
- }
-}
Deleted: trunk/lima-business-api/src/main/java/org/chorem/lima/business/AfterLastFiscalPeriodException.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/AfterLastFiscalPeriodException.java 2014-08-06 12:04:19 UTC (rev 3901)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/AfterLastFiscalPeriodException.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -1,39 +0,0 @@
-package org.chorem.lima.business;
-
-/*
- * #%L
- * Lima :: business API
- * %%
- * Copyright (C) 2008 - 2014 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-import java.util.Date;
-
-/**
- * @author Sylvain Bavencoff <bavencoff(a)codelutin.com>
- */
-public class AfterLastFiscalPeriodException extends DateException {
-
- public AfterLastFiscalPeriodException(Date date) {
- super(date);
- }
-
- public AfterLastFiscalPeriodException(Date date, Throwable cause) {
- super(date, cause);
- }
-}
Deleted: trunk/lima-business-api/src/main/java/org/chorem/lima/business/AlreadyExistAccountException.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/AlreadyExistAccountException.java 2014-08-06 12:04:19 UTC (rev 3901)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/AlreadyExistAccountException.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -1,37 +0,0 @@
-package org.chorem.lima.business;
-
-/*
- * #%L
- * Lima :: business API
- * %%
- * Copyright (C) 2008 - 2014 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-/**
- * @author Sylvain Bavencoff <bavencoff(a)codelutin.com>
- */
-public class AlreadyExistAccountException extends AccountException {
-
- public AlreadyExistAccountException(String accountNumber) {
- super(accountNumber);
- }
-
- public AlreadyExistAccountException(String accountNumber, Throwable cause) {
- super(accountNumber, cause);
- }
-}
Deleted: trunk/lima-business-api/src/main/java/org/chorem/lima/business/AlreadyExistFinancialStatement.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/AlreadyExistFinancialStatement.java 2014-08-06 12:04:19 UTC (rev 3901)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/AlreadyExistFinancialStatement.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -1,46 +0,0 @@
-package org.chorem.lima.business;
-
-/*
- * #%L
- * Lima :: business API
- * %%
- * Copyright (C) 2008 - 2014 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-/**
- * Created by davidcosse on 28/07/14.
- */
-public class AlreadyExistFinancialStatement extends LimaException {
- private static final long serialVersionUID = 4816249386192290272L;
-
- protected String financialStatementLabel;
- protected String masterLabel;
-
- public AlreadyExistFinancialStatement(String label, String masterLabel) {
- this.financialStatementLabel = label;
- this.masterLabel = masterLabel;
- }
-
- public String getFinancialStatementLabel() {
- return financialStatementLabel;
- }
-
- public String getMasterLabel() {
- return masterLabel;
- }
-}
Deleted: trunk/lima-business-api/src/main/java/org/chorem/lima/business/AlreadyExistVatStatement.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/AlreadyExistVatStatement.java 2014-08-06 12:04:19 UTC (rev 3901)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/AlreadyExistVatStatement.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -1,49 +0,0 @@
-package org.chorem.lima.business;
-
-/*
- * #%L
- * Lima :: business API
- * %%
- * Copyright (C) 2008 - 2014 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-import static org.nuiton.i18n.I18n.t;
-
-/**
- * Created by davidcosse on 28/07/14.
- */
-public class AlreadyExistVatStatement extends LimaException {
- private static final long serialVersionUID = 4816249386192290272L;
-
- protected String vatStatementLabel;
- protected String masterLabel;
-
- public AlreadyExistVatStatement(String label, String masterLabel) {
- super(t("lima.importexport.import.alreadyExistFinancialStatement",label, masterLabel));
- this.vatStatementLabel = label;
- this.masterLabel = masterLabel;
- }
-
- public String getVatStatementLabel() {
- return vatStatementLabel;
- }
-
- public String getMasterLabel() {
- return masterLabel;
- }
-}
Deleted: trunk/lima-business-api/src/main/java/org/chorem/lima/business/AlreadyLockedFiscalPeriodException.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/AlreadyLockedFiscalPeriodException.java 2014-08-06 12:04:19 UTC (rev 3901)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/AlreadyLockedFiscalPeriodException.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -1,39 +0,0 @@
-package org.chorem.lima.business;
-
-/*
- * #%L
- * Lima :: business API
- * %%
- * Copyright (C) 2008 - 2014 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-import org.chorem.lima.entity.FiscalPeriod;
-
-/**
- * @author Sylvain Bavencoff <bavencoff(a)codelutin.com>
- */
-public class AlreadyLockedFiscalPeriodException extends FiscalPeriodException {
-
- public AlreadyLockedFiscalPeriodException(FiscalPeriod fiscalPeriod) {
- super(fiscalPeriod);
- }
-
- public AlreadyLockedFiscalPeriodException(FiscalPeriod fiscalPeriod, Throwable cause) {
- super(fiscalPeriod, cause);
- }
-}
Deleted: trunk/lima-business-api/src/main/java/org/chorem/lima/business/BeforeFirstFiscalPeriodException.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/BeforeFirstFiscalPeriodException.java 2014-08-06 12:04:19 UTC (rev 3901)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/BeforeFirstFiscalPeriodException.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -1,39 +0,0 @@
-package org.chorem.lima.business;
-
-/*
- * #%L
- * Lima :: business API
- * %%
- * Copyright (C) 2008 - 2014 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-import java.util.Date;
-
-/**
- * @author Sylvain Bavencoff <bavencoff(a)codelutin.com>
- */
-public class BeforeFirstFiscalPeriodException extends DateException {
-
- public BeforeFirstFiscalPeriodException(Date date) {
- super(date);
- }
-
- public BeforeFirstFiscalPeriodException(Date date, Throwable cause) {
- super(date, cause);
- }
-}
Deleted: trunk/lima-business-api/src/main/java/org/chorem/lima/business/BeginAfterEndFiscalPeriodException.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/BeginAfterEndFiscalPeriodException.java 2014-08-06 12:04:19 UTC (rev 3901)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/BeginAfterEndFiscalPeriodException.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -1,39 +0,0 @@
-package org.chorem.lima.business;
-
-/*
- * #%L
- * Lima :: business API
- * %%
- * Copyright (C) 2008 - 2014 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-import org.chorem.lima.entity.FiscalPeriod;
-
-/**
- * @author Sylvain Bavencoff <bavencoff(a)codelutin.com>
- */
-public class BeginAfterEndFiscalPeriodException extends FiscalPeriodException {
-
- public BeginAfterEndFiscalPeriodException(FiscalPeriod fiscalPeriod) {
- super(fiscalPeriod);
- }
-
- public BeginAfterEndFiscalPeriodException(FiscalPeriod fiscalPeriod, Throwable cause) {
- super(fiscalPeriod, cause);
- }
-}
Deleted: trunk/lima-business-api/src/main/java/org/chorem/lima/business/ClosedPeriodicEntryBookException.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/ClosedPeriodicEntryBookException.java 2014-08-06 12:04:19 UTC (rev 3901)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/ClosedPeriodicEntryBookException.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -1,56 +0,0 @@
-package org.chorem.lima.business;
-
-/*
- * #%L
- * Lima :: business API
- * %%
- * Copyright (C) 2008 - 2014 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-import org.chorem.lima.entity.ClosedPeriodicEntryBook;
-
-/**
- * @author Sylvain Bavencoff <bavencoff(a)codelutin.com>
- */
-public abstract class ClosedPeriodicEntryBookException extends LimaException {
-
- protected ClosedPeriodicEntryBook closedPeriodicEntryBook;
-
- public ClosedPeriodicEntryBookException(ClosedPeriodicEntryBook closedPeriodicEntryBook) {
- this.closedPeriodicEntryBook = closedPeriodicEntryBook;
- }
-
- public ClosedPeriodicEntryBookException(ClosedPeriodicEntryBook closedPeriodicEntryBook, String message) {
- super(message);
- this.closedPeriodicEntryBook = closedPeriodicEntryBook;
- }
-
- public ClosedPeriodicEntryBookException(ClosedPeriodicEntryBook closedPeriodicEntryBook, Throwable cause) {
- super(cause);
- this.closedPeriodicEntryBook = closedPeriodicEntryBook;
- }
-
- public ClosedPeriodicEntryBookException(ClosedPeriodicEntryBook closedPeriodicEntryBook, String message, Throwable cause) {
- super(message, cause);
- this.closedPeriodicEntryBook = closedPeriodicEntryBook;
- }
-
- public ClosedPeriodicEntryBook getClosedPeriodicEntryBook() {
- return closedPeriodicEntryBook;
- }
-}
Deleted: trunk/lima-business-api/src/main/java/org/chorem/lima/business/ClosedPeriodicEntryBooksException.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/ClosedPeriodicEntryBooksException.java 2014-08-06 12:04:19 UTC (rev 3901)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/ClosedPeriodicEntryBooksException.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -1,48 +0,0 @@
-package org.chorem.lima.business;
-
-/*
- * #%L
- * Lima :: business API
- * %%
- * Copyright (C) 2008 - 2014 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-import org.chorem.lima.entity.ClosedPeriodicEntryBook;
-
-import java.util.Collection;
-
-/**
- * @author Sylvain Bavencoff <bavencoff(a)codelutin.com>
- */
-public abstract class ClosedPeriodicEntryBooksException extends LimaException {
-
- protected Collection<ClosedPeriodicEntryBook> closedPeriodicEntryBooks;
-
- public ClosedPeriodicEntryBooksException(Collection<ClosedPeriodicEntryBook> closedPeriodicEntryBooks) {
- this.closedPeriodicEntryBooks = closedPeriodicEntryBooks;
- }
-
- public ClosedPeriodicEntryBooksException(Collection<ClosedPeriodicEntryBook> closedPeriodicEntryBooks, Throwable cause) {
- super(cause);
- this.closedPeriodicEntryBooks = closedPeriodicEntryBooks;
- }
-
- public Collection<ClosedPeriodicEntryBook> getClosedPeriodicEntryBooks() {
- return closedPeriodicEntryBooks;
- }
-}
Deleted: trunk/lima-business-api/src/main/java/org/chorem/lima/business/DateException.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/DateException.java 2014-08-06 12:04:19 UTC (rev 3901)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/DateException.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -1,46 +0,0 @@
-package org.chorem.lima.business;
-
-/*
- * #%L
- * Lima :: business API
- * %%
- * Copyright (C) 2008 - 2014 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-import java.util.Date;
-
-/**
- * @author Sylvain Bavencoff <bavencoff(a)codelutin.com>
- */
-public abstract class DateException extends LimaException {
-
- protected Date date;
-
- public DateException(Date date) {
- this.date = date;
- }
-
- public DateException(Date date, Throwable cause) {
- super(cause);
- this.date = date;
- }
-
- public Date getDate() {
- return date;
- }
-}
Deleted: trunk/lima-business-api/src/main/java/org/chorem/lima/business/EntriesException.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/EntriesException.java 2014-08-06 12:04:19 UTC (rev 3901)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/EntriesException.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -1,48 +0,0 @@
-package org.chorem.lima.business;
-
-/*
- * #%L
- * Lima :: business API
- * %%
- * Copyright (C) 2008 - 2014 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-import org.chorem.lima.entity.Entry;
-
-import java.util.Collection;
-
-/**
- * @author Sylvain Bavencoff <bavencoff(a)codelutin.com>
- */
-public abstract class EntriesException extends LimaException {
-
- protected Collection<Entry> entries;
-
- public EntriesException(Collection<Entry> entries) {
- this.entries = entries;
- }
-
- public EntriesException(Collection<Entry> entries, Throwable cause) {
- super(cause);
- this.entries = entries;
- }
-
- public Collection<Entry> getEntries() {
- return entries;
- }
-}
Deleted: trunk/lima-business-api/src/main/java/org/chorem/lima/business/EntryBookException.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/EntryBookException.java 2014-08-06 12:04:19 UTC (rev 3901)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/EntryBookException.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -1,46 +0,0 @@
-package org.chorem.lima.business;
-
-/*
- * #%L
- * Lima :: business API
- * %%
- * Copyright (C) 2008 - 2014 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-import org.chorem.lima.entity.EntryBook;
-
-/**
- * @author Sylvain Bavencoff <bavencoff(a)codelutin.com>
- */
-public abstract class EntryBookException extends LimaException {
-
- protected EntryBook entryBook;
-
- public EntryBookException(EntryBook entryBook) {
- this.entryBook = entryBook;
- }
-
- public EntryBookException(EntryBook entryBook, Throwable cause) {
- super(cause);
- this.entryBook = entryBook;
- }
-
- public EntryBook getEntryBook() {
- return entryBook;
- }
-}
Deleted: trunk/lima-business-api/src/main/java/org/chorem/lima/business/FinancialPeriodException.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/FinancialPeriodException.java 2014-08-06 12:04:19 UTC (rev 3901)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/FinancialPeriodException.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -1,51 +0,0 @@
-package org.chorem.lima.business;
-
-/*
- * #%L
- * Lima :: business API
- * %%
- * Copyright (C) 2008 - 2014 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-import org.chorem.lima.entity.FinancialPeriod;
-
-/**
- * @author Sylvain Bavencoff <bavencoff(a)codelutin.com>
- */
-public abstract class FinancialPeriodException extends LimaException {
-
- protected FinancialPeriod financialPeriod;
-
- public FinancialPeriodException(FinancialPeriod financialPeriod) {
- this.financialPeriod = financialPeriod;
- }
-
- public FinancialPeriodException(FinancialPeriod financialPeriod, String message) {
- super(message);
- this.financialPeriod = financialPeriod;
- }
-
- public FinancialPeriodException(FinancialPeriod financialPeriod, Throwable cause) {
- super(cause);
- this.financialPeriod = financialPeriod;
- }
-
- public FinancialPeriod getFinancialPeriod() {
- return financialPeriod;
- }
-}
Deleted: trunk/lima-business-api/src/main/java/org/chorem/lima/business/FinancialTransactionsException.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/FinancialTransactionsException.java 2014-08-06 12:04:19 UTC (rev 3901)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/FinancialTransactionsException.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -1,48 +0,0 @@
-package org.chorem.lima.business;
-
-/*
- * #%L
- * Lima :: business API
- * %%
- * Copyright (C) 2008 - 2014 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-import org.chorem.lima.entity.FinancialTransaction;
-
-import java.util.Collection;
-
-/**
- * @author Sylvain Bavencoff <bavencoff(a)codelutin.com>
- */
-public abstract class FinancialTransactionsException extends LimaException {
-
- protected Collection<FinancialTransaction> financialTransactions;
-
- public FinancialTransactionsException(Collection<FinancialTransaction> financialTransactions) {
- this.financialTransactions = financialTransactions;
- }
-
- public FinancialTransactionsException(Collection<FinancialTransaction> financialTransactions, Throwable cause) {
- super(cause);
- this.financialTransactions = financialTransactions;
- }
-
- public Collection<FinancialTransaction> getFinancialTransactions() {
- return financialTransactions;
- }
-}
Deleted: trunk/lima-business-api/src/main/java/org/chorem/lima/business/FiscalPeriodException.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/FiscalPeriodException.java 2014-08-06 12:04:19 UTC (rev 3901)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/FiscalPeriodException.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -1,46 +0,0 @@
-package org.chorem.lima.business;
-
-/*
- * #%L
- * Lima :: business API
- * %%
- * Copyright (C) 2008 - 2014 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-import org.chorem.lima.entity.FiscalPeriod;
-
-/**
- * @author Sylvain Bavencoff <bavencoff(a)codelutin.com>
- */
-public abstract class FiscalPeriodException extends LimaException {
-
- protected FiscalPeriod fiscalPeriod;
-
- public FiscalPeriodException(FiscalPeriod fiscalPeriod) {
- this.fiscalPeriod = fiscalPeriod;
- }
-
- public FiscalPeriodException(FiscalPeriod fiscalPeriod, Throwable cause) {
- super(cause);
- this.fiscalPeriod = fiscalPeriod;
- }
-
- public FiscalPeriod getFiscalPeriod() {
- return fiscalPeriod;
- }
-}
Deleted: trunk/lima-business-api/src/main/java/org/chorem/lima/business/ImportEbpException.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/ImportEbpException.java 2014-08-06 12:04:19 UTC (rev 3901)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/ImportEbpException.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -1,37 +0,0 @@
-package org.chorem.lima.business;
-
-/*
- * #%L
- * Lima :: business API
- * %%
- * Copyright (C) 2008 - 2014 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-/**
- * @author Sylvain Bavencoff <bavencoff(a)codelutin.com>
- */
-public class ImportEbpException extends LimaException {
-
- public ImportEbpException(String message) {
- super(message);
- }
-
- public ImportEbpException(String message, Throwable cause) {
- super(message, cause);
- }
-}
Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/ImportResult.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/ImportResult.java 2014-08-06 12:04:19 UTC (rev 3901)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/ImportResult.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -22,6 +22,8 @@
* #L%
*/
+import org.chorem.lima.business.exceptions.LimaException;
+
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
@@ -84,6 +86,12 @@
lineIndex++;
}
+ public void addInitException(LimaException e) {
+ allExceptions = allExceptions == null ? new HashMap<Integer, LimaException>() : allExceptions;
+ allExceptions.put(1, e);
+ lineIndex++;
+ }
+
public Map<Integer, LimaException> getAllExceptionsByLine() {
return allExceptions;
}
Deleted: trunk/lima-business-api/src/main/java/org/chorem/lima/business/InvalidAccountNumberException.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/InvalidAccountNumberException.java 2014-08-06 12:04:19 UTC (rev 3901)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/InvalidAccountNumberException.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -1,41 +0,0 @@
-package org.chorem.lima.business;
-
-/*
- * #%L
- * Lima :: business API
- * %%
- * Copyright (C) 2008 - 2014 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-/**
- * @author Sylvain Bavencoff <bavencoff(a)codelutin.com>
- */
-public class InvalidAccountNumberException extends AccountException {
-
- public InvalidAccountNumberException(String accountNumber) {
- super(accountNumber);
- }
-
- public InvalidAccountNumberException(String accountNumber, String message) {
- super(accountNumber, message);
- }
-
- public InvalidAccountNumberException(String accountNumber, Throwable cause) {
- super(accountNumber, cause);
- }
-}
Deleted: trunk/lima-business-api/src/main/java/org/chorem/lima/business/LastUnlockedFiscalPeriodException.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/LastUnlockedFiscalPeriodException.java 2014-08-06 12:04:19 UTC (rev 3901)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/LastUnlockedFiscalPeriodException.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -1,39 +0,0 @@
-package org.chorem.lima.business;
-
-/*
- * #%L
- * Lima :: business API
- * %%
- * Copyright (C) 2008 - 2014 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-import org.chorem.lima.entity.FiscalPeriod;
-
-/**
- * @author Sylvain Bavencoff <bavencoff(a)codelutin.com>
- */
-public class LastUnlockedFiscalPeriodException extends FiscalPeriodException {
-
- public LastUnlockedFiscalPeriodException(FiscalPeriod fiscalPeriod) {
- super(fiscalPeriod);
- }
-
- public LastUnlockedFiscalPeriodException(FiscalPeriod fiscalPeriod, Throwable cause) {
- super(fiscalPeriod, cause);
- }
-}
Deleted: trunk/lima-business-api/src/main/java/org/chorem/lima/business/LimaException.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/LimaException.java 2014-08-06 12:04:19 UTC (rev 3901)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/LimaException.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -1,80 +0,0 @@
-/*
- * #%L
- * Lima business
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2008 - 2010 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-package org.chorem.lima.business;
-
-import javax.ejb.ApplicationException;
-
-/**
- * Lima exception.
- *
- * @author chatellier
- * @version $Revision$
- * <p/>
- * Last update : $Date$
- * By : $Author$
- */
-@ApplicationException
-public abstract class LimaException extends Exception {
-
- /**
- * serialVersionUID.
- */
- private static final long serialVersionUID = -6876236663940184462L;
-
- /**
- * Constructs a new exception
- *
- */
- public LimaException() {
- super();
- }
-
- /**
- * Constructs a new exception with specified message.
- *
- */
- public LimaException(String message) {
- super(message);
- }
-
- /**
- * Constructs a new exception with specified message and cause.
- * @param message
- * @param cause
- */
- public LimaException(String message, Throwable cause) {
- super(message, cause);
- }
-
- /**
- * Constructs a new exception with the specified cause.
- *
- * @param cause cause
- */
- public LimaException(Throwable cause) {
- super(cause);
- }
-}
Deleted: trunk/lima-business-api/src/main/java/org/chorem/lima/business/LockedEntryBookException.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/LockedEntryBookException.java 2014-08-06 12:04:19 UTC (rev 3901)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/LockedEntryBookException.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -1,49 +0,0 @@
-package org.chorem.lima.business;
-
-/*
- * #%L
- * Lima :: business API
- * %%
- * Copyright (C) 2008 - 2014 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-import org.chorem.lima.entity.ClosedPeriodicEntryBook;
-
-import static org.nuiton.i18n.I18n.t;
-
-/**
- * @author Sylvain Bavencoff <bavencoff(a)codelutin.com>
- */
-public class LockedEntryBookException extends ClosedPeriodicEntryBookException {
-
- public LockedEntryBookException(ClosedPeriodicEntryBook closedPeriodicEntryBook) {
- super(closedPeriodicEntryBook, t("lima.ui.lettering.roundAndCreateEntry.error.lockedEntryBook",
- closedPeriodicEntryBook.getEntryBook().getCode(),
- closedPeriodicEntryBook.getEntryBook().getLabel(),
- closedPeriodicEntryBook.getFinancialPeriod().getBeginDate(),
- closedPeriodicEntryBook.getFinancialPeriod().getEndDate()));
- }
-
- public LockedEntryBookException(ClosedPeriodicEntryBook closedPeriodicEntryBook, String message) {
- super(closedPeriodicEntryBook, message);
- }
-
- public LockedEntryBookException(ClosedPeriodicEntryBook closedPeriodicEntryBook, Throwable cause) {
- super(closedPeriodicEntryBook, cause);
- }
-}
Deleted: trunk/lima-business-api/src/main/java/org/chorem/lima/business/LockedFinancialPeriodException.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/LockedFinancialPeriodException.java 2014-08-06 12:04:19 UTC (rev 3901)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/LockedFinancialPeriodException.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -1,45 +0,0 @@
-package org.chorem.lima.business;
-
-/*
- * #%L
- * Lima :: business API
- * %%
- * Copyright (C) 2008 - 2014 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-import org.chorem.lima.entity.FinancialPeriod;
-
-import static org.nuiton.i18n.I18n.t;
-
-/**
- * @author Sylvain Bavencoff <bavencoff(a)codelutin.com>
- */
-public class LockedFinancialPeriodException extends FinancialPeriodException{
-
- public LockedFinancialPeriodException(FinancialPeriod financialPeriod) {
- super(financialPeriod, t("lima.ui.fiscalPeriod.block.error.lockedFinancialPeriod",financialPeriod.getBeginDate(), financialPeriod.getEndDate()));
- }
-
- public LockedFinancialPeriodException(FinancialPeriod financialPeriod, String message) {
- super(financialPeriod, message);
- }
-
- public LockedFinancialPeriodException(FinancialPeriod financialPeriod, Throwable cause) {
- super(financialPeriod, cause);
- }
-}
Deleted: trunk/lima-business-api/src/main/java/org/chorem/lima/business/MoreOneUnlockFiscalPeriodException.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/MoreOneUnlockFiscalPeriodException.java 2014-08-06 12:04:19 UTC (rev 3901)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/MoreOneUnlockFiscalPeriodException.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -1,60 +0,0 @@
-package org.chorem.lima.business;
-
-/*
- * #%L
- * Lima :: business API
- * %%
- * Copyright (C) 2008 - 2014 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-import java.util.Date;
-
-/**
- * @author Sylvain Bavencoff <bavencoff(a)codelutin.com>
- */
-public class MoreOneUnlockFiscalPeriodException extends LimaException {
-
- Date beginDate;
- Date endDate;
- Boolean isLocked;
- long countUnlockFiscalPeriod;
-
- public MoreOneUnlockFiscalPeriodException(Date beginDate, Date endDate, Boolean isLocked, long countUnlockFiscalPeriod) {
- this.beginDate = beginDate;
- this.endDate = endDate;
- this.isLocked = isLocked;
- this.countUnlockFiscalPeriod = countUnlockFiscalPeriod;
-
- }
-
- public Date getBeginDate() {
- return beginDate;
- }
-
- public Date getEndDate() {
- return endDate;
- }
-
- public Boolean getIsLocked() {
- return isLocked;
- }
-
- public long getCountUnlockFiscalPeriod() {
- return countUnlockFiscalPeriod;
- }
-}
Deleted: trunk/lima-business-api/src/main/java/org/chorem/lima/business/NoDataToImportException.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/NoDataToImportException.java 2014-08-06 12:04:19 UTC (rev 3901)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/NoDataToImportException.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -1,7 +0,0 @@
-package org.chorem.lima.business;
-
-/**
- * Created by davidcosse on 06/08/14.
- */
-public class NoDataToImportException extends LimaException {
-}
Deleted: trunk/lima-business-api/src/main/java/org/chorem/lima/business/NoEmptyFiscalPeriodException.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/NoEmptyFiscalPeriodException.java 2014-08-06 12:04:19 UTC (rev 3901)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/NoEmptyFiscalPeriodException.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -1,41 +0,0 @@
-package org.chorem.lima.business;
-
-/*
- * #%L
- * Lima :: business API
- * %%
- * Copyright (C) 2008 - 2014 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-import org.chorem.lima.entity.FinancialTransaction;
-
-import java.util.Collection;
-
-/**
- * @author Sylvain Bavencoff <bavencoff(a)codelutin.com>
- */
-public class NoEmptyFiscalPeriodException extends FinancialTransactionsException {
-
- public NoEmptyFiscalPeriodException(Collection<FinancialTransaction> financialTransactions) {
- super(financialTransactions);
- }
-
- public NoEmptyFiscalPeriodException(Collection<FinancialTransaction> financialTransactions, Throwable cause) {
- super(financialTransactions, cause);
- }
-}
Deleted: trunk/lima-business-api/src/main/java/org/chorem/lima/business/NoFiscalPeriodFoundException.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/NoFiscalPeriodFoundException.java 2014-08-06 12:04:19 UTC (rev 3901)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/NoFiscalPeriodFoundException.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -1,7 +0,0 @@
-package org.chorem.lima.business;
-
-/**
- * Created by davidcosse on 06/08/14.
- */
-public class NoFiscalPeriodFoundException extends LimaException {
-}
Deleted: trunk/lima-business-api/src/main/java/org/chorem/lima/business/NoFoundFinancialPeriodException.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/NoFoundFinancialPeriodException.java 2014-08-06 12:04:19 UTC (rev 3901)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/NoFoundFinancialPeriodException.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -1,39 +0,0 @@
-package org.chorem.lima.business;
-
-/*
- * #%L
- * Lima :: business API
- * %%
- * Copyright (C) 2008 - 2014 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-import java.util.Date;
-
-/**
- * @author Sylvain Bavencoff <bavencoff(a)codelutin.com>
- */
-public class NoFoundFinancialPeriodException extends DateException {
-
- public NoFoundFinancialPeriodException(Date date) {
- super(date);
- }
-
- public NoFoundFinancialPeriodException(Date date, Throwable cause) {
- super(date, cause);
- }
-}
Deleted: trunk/lima-business-api/src/main/java/org/chorem/lima/business/NotAllowedLabel.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/NotAllowedLabel.java 2014-08-06 12:04:19 UTC (rev 3901)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/NotAllowedLabel.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -1,42 +0,0 @@
-package org.chorem.lima.business;
-
-/*
- * #%L
- * Lima :: business API
- * %%
- * Copyright (C) 2008 - 2014 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-import static org.nuiton.i18n.I18n.t;
-
-/**
- * Created by davidcosse on 31/07/14.
- */
-public class NotAllowedLabel extends LimaException {
-
- protected String label;
-
- public NotAllowedLabel(String label) {
- super(t("lima.importexport.import.notAllowedLabel",label));
- this.label = label;
- }
-
- public String getLabel() {
- return label;
- }
-}
Deleted: trunk/lima-business-api/src/main/java/org/chorem/lima/business/NotBeginNextDayOfLastFiscalPeriodException.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/NotBeginNextDayOfLastFiscalPeriodException.java 2014-08-06 12:04:19 UTC (rev 3901)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/NotBeginNextDayOfLastFiscalPeriodException.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -1,39 +0,0 @@
-package org.chorem.lima.business;
-
-/*
- * #%L
- * Lima :: business API
- * %%
- * Copyright (C) 2008 - 2014 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-import org.chorem.lima.entity.FiscalPeriod;
-
-/**
- * @author Sylvain Bavencoff <bavencoff(a)codelutin.com>
- */
-public class NotBeginNextDayOfLastFiscalPeriodException extends FiscalPeriodException {
-
- public NotBeginNextDayOfLastFiscalPeriodException(FiscalPeriod fiscalPeriod) {
- super(fiscalPeriod);
- }
-
- public NotBeginNextDayOfLastFiscalPeriodException(FiscalPeriod fiscalPeriod, Throwable cause) {
- super(fiscalPeriod, cause);
- }
-}
Deleted: trunk/lima-business-api/src/main/java/org/chorem/lima/business/NotLockedClosedPeriodicEntryBooksException.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/NotLockedClosedPeriodicEntryBooksException.java 2014-08-06 12:04:19 UTC (rev 3901)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/NotLockedClosedPeriodicEntryBooksException.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -1,41 +0,0 @@
-package org.chorem.lima.business;
-
-/*
- * #%L
- * Lima :: business API
- * %%
- * Copyright (C) 2008 - 2014 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-import org.chorem.lima.entity.ClosedPeriodicEntryBook;
-
-import java.util.Collection;
-
-/**
- * @author Sylvain Bavencoff <bavencoff(a)codelutin.com>
- */
-public class NotLockedClosedPeriodicEntryBooksException extends ClosedPeriodicEntryBooksException {
-
- public NotLockedClosedPeriodicEntryBooksException(Collection<ClosedPeriodicEntryBook> closedPeriodicEntryBooks) {
- super(closedPeriodicEntryBooks);
- }
-
- public NotLockedClosedPeriodicEntryBooksException(Collection<ClosedPeriodicEntryBook> closedPeriodicEntryBooks, Throwable cause) {
- super(closedPeriodicEntryBooks, cause);
- }
-}
Deleted: trunk/lima-business-api/src/main/java/org/chorem/lima/business/NotNumberAccountNumberException.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/NotNumberAccountNumberException.java 2014-08-06 12:04:19 UTC (rev 3901)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/NotNumberAccountNumberException.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -1,19 +0,0 @@
-package org.chorem.lima.business;
-
-/**
- * @author Sylvain Bavencoff <bavencoff(a)codelutin.com>
- */
-public class NotNumberAccountNumberException extends AccountException {
-
- public NotNumberAccountNumberException(String accountNumber) {
- super(accountNumber);
- }
-
- public NotNumberAccountNumberException(String accountNumber, String message) {
- super(accountNumber, message);
- }
-
- public NotNumberAccountNumberException(String accountNumber, Throwable cause) {
- super(accountNumber, cause);
- }
-}
Deleted: trunk/lima-business-api/src/main/java/org/chorem/lima/business/UnbalancedEntriesException.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/UnbalancedEntriesException.java 2014-08-06 12:04:19 UTC (rev 3901)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/UnbalancedEntriesException.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -1,41 +0,0 @@
-package org.chorem.lima.business;
-
-/*
- * #%L
- * Lima :: business API
- * %%
- * Copyright (C) 2008 - 2014 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-import org.chorem.lima.entity.Entry;
-
-import java.util.Collection;
-
-/**
- * @author Sylvain Bavencoff <bavencoff(a)codelutin.com>
- */
-public class UnbalancedEntriesException extends EntriesException {
-
- public UnbalancedEntriesException(Collection<Entry> entries) {
- super(entries);
- }
-
- public UnbalancedEntriesException(Collection<Entry> entries, Throwable cause) {
- super(entries, cause);
- }
-}
Deleted: trunk/lima-business-api/src/main/java/org/chorem/lima/business/UnbalancedFinancialTransactionsException.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/UnbalancedFinancialTransactionsException.java 2014-08-06 12:04:19 UTC (rev 3901)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/UnbalancedFinancialTransactionsException.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -1,41 +0,0 @@
-package org.chorem.lima.business;
-
-/*
- * #%L
- * Lima :: business API
- * %%
- * Copyright (C) 2008 - 2014 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-import org.chorem.lima.entity.FinancialTransaction;
-
-import java.util.Collection;
-
-/**
- * @author Sylvain Bavencoff <bavencoff(a)codelutin.com>
- */
-public class UnbalancedFinancialTransactionsException extends FinancialTransactionsException {
-
- public UnbalancedFinancialTransactionsException(Collection<FinancialTransaction> financialTransactions) {
- super(financialTransactions);
- }
-
- public UnbalancedFinancialTransactionsException(Collection<FinancialTransaction> financialTransactions, Throwable cause) {
- super(financialTransactions, cause);
- }
-}
Deleted: trunk/lima-business-api/src/main/java/org/chorem/lima/business/UnfilledEntriesException.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/UnfilledEntriesException.java 2014-08-06 12:04:19 UTC (rev 3901)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/UnfilledEntriesException.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -1,41 +0,0 @@
-package org.chorem.lima.business;
-
-/*
- * #%L
- * Lima :: business API
- * %%
- * Copyright (C) 2008 - 2014 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-import org.chorem.lima.entity.Entry;
-
-import java.util.Collection;
-
-/**
- * @author Sylvain Bavencoff <bavencoff(a)codelutin.com>
- */
-public class UnfilledEntriesException extends EntriesException {
-
- public UnfilledEntriesException(Collection<Entry> entries) {
- super(entries);
- }
-
- public UnfilledEntriesException(Collection<Entry> entries, Throwable cause) {
- super(entries, cause);
- }
-}
Deleted: trunk/lima-business-api/src/main/java/org/chorem/lima/business/UsedAccountException.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/UsedAccountException.java 2014-08-06 12:04:19 UTC (rev 3901)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/UsedAccountException.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -1,37 +0,0 @@
-package org.chorem.lima.business;
-
-/*
- * #%L
- * Lima :: business API
- * %%
- * Copyright (C) 2008 - 2014 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-/**
- * @author Sylvain Bavencoff <bavencoff(a)codelutin.com>
- */
-public class UsedAccountException extends AccountException {
-
- public UsedAccountException(String accountNumber) {
- super(accountNumber);
- }
-
- public UsedAccountException(String accountNumber, Throwable cause) {
- super(accountNumber, cause);
- }
-}
Deleted: trunk/lima-business-api/src/main/java/org/chorem/lima/business/UsedEntryBookException.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/UsedEntryBookException.java 2014-08-06 12:04:19 UTC (rev 3901)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/UsedEntryBookException.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -1,39 +0,0 @@
-package org.chorem.lima.business;
-
-/*
- * #%L
- * Lima :: business API
- * %%
- * Copyright (C) 2008 - 2014 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-import org.chorem.lima.entity.EntryBook;
-
-/**
- * @author Sylvain Bavencoff <bavencoff(a)codelutin.com>
- */
-public class UsedEntryBookException extends EntryBookException {
-
- public UsedEntryBookException(EntryBook entryBook) {
- super(entryBook);
- }
-
- public UsedEntryBookException(EntryBook entryBook, Throwable cause) {
- super(entryBook, cause);
- }
-}
Deleted: trunk/lima-business-api/src/main/java/org/chorem/lima/business/WithoutEntryBookFinancialTransactionsException.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/WithoutEntryBookFinancialTransactionsException.java 2014-08-06 12:04:19 UTC (rev 3901)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/WithoutEntryBookFinancialTransactionsException.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -1,41 +0,0 @@
-package org.chorem.lima.business;
-
-/*
- * #%L
- * Lima :: business API
- * %%
- * Copyright (C) 2008 - 2014 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-import org.chorem.lima.entity.FinancialTransaction;
-
-import java.util.Collection;
-
-/**
- * @author Sylvain Bavencoff <bavencoff(a)codelutin.com>
- */
-public class WithoutEntryBookFinancialTransactionsException extends FinancialTransactionsException {
-
- public WithoutEntryBookFinancialTransactionsException(Collection<FinancialTransaction> financialTransactions) {
- super(financialTransactions);
- }
-
- public WithoutEntryBookFinancialTransactionsException(Collection<FinancialTransaction> financialTransactions, Throwable cause) {
- super(financialTransactions, cause);
- }
-}
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-08-06 12:04:19 UTC (rev 3901)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/AccountService.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -25,12 +25,12 @@
package org.chorem.lima.business.api;
-import org.chorem.lima.business.AlreadyExistAccountException;
-import org.chorem.lima.business.InvalidAccountNumberException;
-import org.chorem.lima.business.LimaException;
-import org.chorem.lima.business.NotAllowedLabel;
-import org.chorem.lima.business.NotNumberAccountNumberException;
-import org.chorem.lima.business.UsedAccountException;
+import org.chorem.lima.business.exceptions.AlreadyExistAccountException;
+import org.chorem.lima.business.exceptions.InvalidAccountNumberException;
+import org.chorem.lima.business.exceptions.LimaException;
+import org.chorem.lima.business.exceptions.NotAllowedLabelException;
+import org.chorem.lima.business.exceptions.NotNumberAccountNumberException;
+import org.chorem.lima.business.exceptions.UsedAccountException;
import org.chorem.lima.entity.Account;
import java.util.List;
@@ -94,7 +94,7 @@
* @return true if updated or false if created
* @throws InvalidAccountNumberException
*/
- boolean createOrUbdateAccount(Account account) throws InvalidAccountNumberException, NotNumberAccountNumberException, NotAllowedLabel;
+ boolean createOrUbdateAccount(Account account) throws InvalidAccountNumberException, NotNumberAccountNumberException, NotAllowedLabelException;
/**
* Create new account. If {@code masterAccount} is not null, {@code account}
@@ -103,7 +103,7 @@
* @param account account
* @throws LimaException
*/
- Account createAccount(Account account) throws AlreadyExistAccountException, InvalidAccountNumberException, NotNumberAccountNumberException, NotAllowedLabel;
+ Account createAccount(Account account) throws AlreadyExistAccountException, InvalidAccountNumberException, NotNumberAccountNumberException, NotAllowedLabelException;
Account updateAccount(Account account) throws InvalidAccountNumberException, NotNumberAccountNumberException;
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-06 12:04:19 UTC (rev 3901)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/EntryBookService.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -25,8 +25,9 @@
package org.chorem.lima.business.api;
-import org.chorem.lima.business.LimaException;
-import org.chorem.lima.business.UsedEntryBookException;
+import org.chorem.lima.business.exceptions.AlreadyExistEntryBookException;
+import org.chorem.lima.business.exceptions.LimaException;
+import org.chorem.lima.business.exceptions.UsedEntryBookException;
import org.chorem.lima.entity.EntryBook;
import java.util.List;
@@ -78,7 +79,7 @@
* @param entryBook
* @throws LimaException
*/
- EntryBook createEntryBook(EntryBook entryBook);
+ EntryBook createEntryBook(EntryBook entryBook) throws AlreadyExistEntryBookException;
/**
* Permet de modifier un journal.
@@ -95,7 +96,7 @@
* impossible de supprimer celui-ci.
*
* @param entryBook
- * @throws org.chorem.lima.business.UsedEntryBookException
+ * @throws org.chorem.lima.business.exceptions.UsedEntryBookException
*/
void removeEntryBook(EntryBook entryBook) throws UsedEntryBookException;
}
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-08-06 12:04:19 UTC (rev 3901)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialPeriodService.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -25,10 +25,10 @@
package org.chorem.lima.business.api;
-import org.chorem.lima.business.NotLockedClosedPeriodicEntryBooksException;
-import org.chorem.lima.business.UnbalancedFinancialTransactionsException;
-import org.chorem.lima.business.UnfilledEntriesException;
-import org.chorem.lima.business.WithoutEntryBookFinancialTransactionsException;
+import org.chorem.lima.business.exceptions.NotLockedClosedPeriodicEntryBooksException;
+import org.chorem.lima.business.exceptions.UnbalancedFinancialTransactionsException;
+import org.chorem.lima.business.exceptions.UnfilledEntriesException;
+import org.chorem.lima.business.exceptions.WithoutEntryBookFinancialTransactionsException;
import org.chorem.lima.entity.ClosedPeriodicEntryBook;
import org.chorem.lima.entity.EntryBook;
import org.chorem.lima.entity.FinancialPeriod;
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-08-06 12:04:19 UTC (rev 3901)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialStatementService.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -26,9 +26,9 @@
package org.chorem.lima.business.api;
import org.chorem.lima.beans.FinancialStatementAmounts;
-import org.chorem.lima.business.AlreadyExistFinancialStatement;
-import org.chorem.lima.business.LimaException;
-import org.chorem.lima.business.NotAllowedLabel;
+import org.chorem.lima.business.exceptions.AlreadyExistFinancialStatement;
+import org.chorem.lima.business.exceptions.LimaException;
+import org.chorem.lima.business.exceptions.NotAllowedLabelException;
import org.chorem.lima.entity.Account;
import org.chorem.lima.entity.FinancialStatement;
@@ -46,7 +46,7 @@
void createMasterFinacialStatements(FinancialStatement masterFinancialStatements);
FinancialStatement createFinancialStatement(FinancialStatement masterFinancialStatement,
- FinancialStatement financialStatement) throws AlreadyExistFinancialStatement, NotAllowedLabel;
+ FinancialStatement financialStatement) throws AlreadyExistFinancialStatement, NotAllowedLabelException;
void updateFinancialStatement(FinancialStatement financialStatement);
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-06 12:04:19 UTC (rev 3901)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialTransactionService.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -27,11 +27,11 @@
import org.chorem.lima.beans.FinancialTransactionCondition;
import org.chorem.lima.beans.LetteringFilter;
-import org.chorem.lima.business.AfterLastFiscalPeriodException;
-import org.chorem.lima.business.BeforeFirstFiscalPeriodException;
-import org.chorem.lima.business.LockedEntryBookException;
-import org.chorem.lima.business.LockedFinancialPeriodException;
-import org.chorem.lima.business.UnbalancedEntriesException;
+import org.chorem.lima.business.exceptions.AfterLastFiscalPeriodException;
+import org.chorem.lima.business.exceptions.BeforeFirstFiscalPeriodException;
+import org.chorem.lima.business.exceptions.LockedEntryBookException;
+import org.chorem.lima.business.exceptions.LockedFinancialPeriodException;
+import org.chorem.lima.business.exceptions.UnbalancedEntriesException;
import org.chorem.lima.entity.Entry;
import org.chorem.lima.entity.EntryBook;
import org.chorem.lima.entity.FinancialPeriod;
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-06 12:04:19 UTC (rev 3901)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FiscalPeriodService.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -25,19 +25,21 @@
package org.chorem.lima.business.api;
-import org.chorem.lima.business.AlreadyExistAccountException;
-import org.chorem.lima.business.AlreadyLockedFiscalPeriodException;
-import org.chorem.lima.business.BeginAfterEndFiscalPeriodException;
-import org.chorem.lima.business.InvalidAccountNumberException;
-import org.chorem.lima.business.LastUnlockedFiscalPeriodException;
-import org.chorem.lima.business.LockedEntryBookException;
-import org.chorem.lima.business.LockedFinancialPeriodException;
-import org.chorem.lima.business.MoreOneUnlockFiscalPeriodException;
-import org.chorem.lima.business.NoEmptyFiscalPeriodException;
-import org.chorem.lima.business.NoFoundFinancialPeriodException;
-import org.chorem.lima.business.NotAllowedLabel;
-import org.chorem.lima.business.NotBeginNextDayOfLastFiscalPeriodException;
-import org.chorem.lima.business.NotNumberAccountNumberException;
+import org.chorem.lima.business.exceptions.AlreadyExistAccountException;
+import org.chorem.lima.business.exceptions.AlreadyExistEntryBookException;
+import org.chorem.lima.business.exceptions.AlreadyLockedFiscalPeriodException;
+import org.chorem.lima.business.exceptions.BeginAfterEndFiscalPeriodException;
+import org.chorem.lima.business.exceptions.InvalidAccountNumberException;
+import org.chorem.lima.business.exceptions.LastUnlockedFiscalPeriodException;
+import org.chorem.lima.business.exceptions.LimaException;
+import org.chorem.lima.business.exceptions.LockedEntryBookException;
+import org.chorem.lima.business.exceptions.LockedFinancialPeriodException;
+import org.chorem.lima.business.exceptions.MoreOneUnlockFiscalPeriodException;
+import org.chorem.lima.business.exceptions.NoEmptyFiscalPeriodException;
+import org.chorem.lima.business.exceptions.NoFoundFinancialPeriodException;
+import org.chorem.lima.business.exceptions.NotAllowedLabelException;
+import org.chorem.lima.business.exceptions.NotBeginNextDayOfLastFiscalPeriodException;
+import org.chorem.lima.business.exceptions.NotNumberAccountNumberException;
import org.chorem.lima.entity.EntryBook;
import org.chorem.lima.entity.FiscalPeriod;
@@ -90,7 +92,7 @@
LastUnlockedFiscalPeriodException,
AlreadyLockedFiscalPeriodException,
AlreadyExistAccountException,
- InvalidAccountNumberException, NotNumberAccountNumberException, NotAllowedLabel;
+ InvalidAccountNumberException, NotNumberAccountNumberException, NotAllowedLabelException, AlreadyExistEntryBookException, LimaException;
/**
* Test if we have retained earnings on a fiscal period
Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/ImportService.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/ImportService.java 2014-08-06 12:04:19 UTC (rev 3901)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/ImportService.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -22,9 +22,9 @@
* #L%
*/
-import org.chorem.lima.business.AlreadyExistAccountException;
import org.chorem.lima.business.ImportExportResults;
-import org.chorem.lima.business.InvalidAccountNumberException;
+import org.chorem.lima.business.exceptions.AlreadyExistAccountException;
+import org.chorem.lima.business.exceptions.InvalidAccountNumberException;
/**
* Created by davidcosse on 03/06/14.
Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/ReportService.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/ReportService.java 2014-08-06 12:04:19 UTC (rev 3901)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/ReportService.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -27,7 +27,7 @@
import org.chorem.lima.beans.BalanceTrial;
import org.chorem.lima.beans.ReportsDatas;
-import org.chorem.lima.business.LimaException;
+import org.chorem.lima.business.exceptions.LimaException;
import org.chorem.lima.entity.Account;
import org.chorem.lima.entity.EntryBook;
import org.chorem.lima.entity.FiscalPeriod;
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-08-06 12:04:19 UTC (rev 3901)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/VatStatementService.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -25,9 +25,9 @@
package org.chorem.lima.business.api;
import org.chorem.lima.beans.VatStatementAmounts;
-import org.chorem.lima.business.AlreadyExistVatStatement;
-import org.chorem.lima.business.LimaException;
-import org.chorem.lima.business.NotAllowedLabel;
+import org.chorem.lima.business.exceptions.AlreadyExistVatStatementException;
+import org.chorem.lima.business.exceptions.LimaException;
+import org.chorem.lima.business.exceptions.NotAllowedLabelException;
import org.chorem.lima.entity.VatStatement;
import java.util.Date;
@@ -36,7 +36,7 @@
public interface VatStatementService {
VatStatement createVatStatement(VatStatement masterVatStatement,
- VatStatement vatStatement) throws AlreadyExistVatStatement, NotAllowedLabel;
+ VatStatement vatStatement) throws AlreadyExistVatStatementException, NotAllowedLabelException;
List<VatStatement> getAllVatStatements();
Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/AccountException.java (from rev 3897, trunk/lima-business-api/src/main/java/org/chorem/lima/business/AccountException.java)
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/AccountException.java (rev 0)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/AccountException.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -0,0 +1,54 @@
+package org.chorem.lima.business.exceptions;
+
+/*
+ * #%L
+ * Lima :: business API
+ * %%
+ * Copyright (C) 2008 - 2014 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+/**
+ * @author Sylvain Bavencoff <bavencoff(a)codelutin.com>
+ */
+public abstract class AccountException extends LimaException {
+
+ protected String accountNumber;
+
+ public AccountException(String accountNumber) {
+ this.accountNumber = accountNumber;
+ }
+
+ public AccountException(String accountNumber, Throwable cause) {
+ super(cause);
+ this.accountNumber = accountNumber;
+ }
+
+ public AccountException(String accountNumber, String message) {
+ super(message);
+ this.accountNumber = accountNumber;
+ }
+
+ public AccountException(String accountNumber, String message, Throwable cause) {
+ super(message, cause);
+ this.accountNumber = accountNumber;
+ }
+
+ public String getAccountNumber() {
+ return accountNumber;
+ }
+}
Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/AfterLastFiscalPeriodException.java (from rev 3894, trunk/lima-business-api/src/main/java/org/chorem/lima/business/AfterLastFiscalPeriodException.java)
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/AfterLastFiscalPeriodException.java (rev 0)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/AfterLastFiscalPeriodException.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -0,0 +1,38 @@
+package org.chorem.lima.business.exceptions;
+
+/*
+ * #%L
+ * Lima :: business API
+ * %%
+ * Copyright (C) 2008 - 2014 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+import java.util.Date;
+
+/**
+ * @author Sylvain Bavencoff <bavencoff(a)codelutin.com>
+ */
+public class AfterLastFiscalPeriodException extends DateException {
+
+ private static final long serialVersionUID = -5954308076408483211L;
+
+ public AfterLastFiscalPeriodException(Date date) {
+ super(date);
+ }
+
+}
Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/AlreadyExistAccountException.java (from rev 3894, trunk/lima-business-api/src/main/java/org/chorem/lima/business/AlreadyExistAccountException.java)
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/AlreadyExistAccountException.java (rev 0)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/AlreadyExistAccountException.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -0,0 +1,36 @@
+package org.chorem.lima.business.exceptions;
+
+/*
+ * #%L
+ * Lima :: business API
+ * %%
+ * Copyright (C) 2008 - 2014 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+/**
+ * @author Sylvain Bavencoff <bavencoff(a)codelutin.com>
+ */
+public class AlreadyExistAccountException extends AccountException {
+
+ private static final long serialVersionUID = 1638306756613187054L;
+
+ public AlreadyExistAccountException(String accountNumber) {
+ super(accountNumber);
+ }
+
+}
Added: trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/AlreadyExistEntryBookException.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/AlreadyExistEntryBookException.java (rev 0)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/AlreadyExistEntryBookException.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -0,0 +1,16 @@
+package org.chorem.lima.business.exceptions;
+
+import org.chorem.lima.entity.EntryBook;
+
+/**
+ * Created by davidcosse on 06/08/14.
+ */
+public class AlreadyExistEntryBookException extends EntryBookException{
+
+ private static final long serialVersionUID = 4214476295563684773L;
+
+ public AlreadyExistEntryBookException(EntryBook entryBook) {
+ super(entryBook);
+ }
+
+}
Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/AlreadyExistFinancialStatement.java (from rev 3894, trunk/lima-business-api/src/main/java/org/chorem/lima/business/AlreadyExistFinancialStatement.java)
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/AlreadyExistFinancialStatement.java (rev 0)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/AlreadyExistFinancialStatement.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -0,0 +1,46 @@
+package org.chorem.lima.business.exceptions;
+
+/*
+ * #%L
+ * Lima :: business API
+ * %%
+ * Copyright (C) 2008 - 2014 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+/**
+ * Created by davidcosse on 28/07/14.
+ */
+public class AlreadyExistFinancialStatement extends LimaException {
+ private static final long serialVersionUID = 4816249386192290272L;
+
+ protected String financialStatementLabel;
+ protected String masterLabel;
+
+ public AlreadyExistFinancialStatement(String label, String masterLabel) {
+ this.financialStatementLabel = label;
+ this.masterLabel = masterLabel;
+ }
+
+ public String getFinancialStatementLabel() {
+ return financialStatementLabel;
+ }
+
+ public String getMasterLabel() {
+ return masterLabel;
+ }
+}
Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/AlreadyExistVatStatementException.java (from rev 3897, trunk/lima-business-api/src/main/java/org/chorem/lima/business/AlreadyExistVatStatement.java)
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/AlreadyExistVatStatementException.java (rev 0)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/AlreadyExistVatStatementException.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -0,0 +1,46 @@
+package org.chorem.lima.business.exceptions;
+
+/*
+ * #%L
+ * Lima :: business API
+ * %%
+ * Copyright (C) 2008 - 2014 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+/**
+ * Created by davidcosse on 28/07/14.
+ */
+public class AlreadyExistVatStatementException extends LimaException {
+ private static final long serialVersionUID = 4816249386192290272L;
+
+ protected String vatStatementLabel;
+ protected String masterLabel;
+
+ public AlreadyExistVatStatementException(String label, String masterLabel) {
+ this.vatStatementLabel = label;
+ this.masterLabel = masterLabel;
+ }
+
+ public String getVatStatementLabel() {
+ return vatStatementLabel;
+ }
+
+ public String getMasterLabel() {
+ return masterLabel;
+ }
+}
Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/AlreadyLockedFiscalPeriodException.java (from rev 3894, trunk/lima-business-api/src/main/java/org/chorem/lima/business/AlreadyLockedFiscalPeriodException.java)
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/AlreadyLockedFiscalPeriodException.java (rev 0)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/AlreadyLockedFiscalPeriodException.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -0,0 +1,38 @@
+package org.chorem.lima.business.exceptions;
+
+/*
+ * #%L
+ * Lima :: business API
+ * %%
+ * Copyright (C) 2008 - 2014 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+import org.chorem.lima.entity.FiscalPeriod;
+
+/**
+ * @author Sylvain Bavencoff <bavencoff(a)codelutin.com>
+ */
+public class AlreadyLockedFiscalPeriodException extends FiscalPeriodException {
+
+ private static final long serialVersionUID = -5813400095403966650L;
+
+ public AlreadyLockedFiscalPeriodException(FiscalPeriod fiscalPeriod) {
+ super(fiscalPeriod);
+ }
+
+}
Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/BeforeFirstFiscalPeriodException.java (from rev 3894, trunk/lima-business-api/src/main/java/org/chorem/lima/business/BeforeFirstFiscalPeriodException.java)
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/BeforeFirstFiscalPeriodException.java (rev 0)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/BeforeFirstFiscalPeriodException.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -0,0 +1,37 @@
+package org.chorem.lima.business.exceptions;
+
+/*
+ * #%L
+ * Lima :: business API
+ * %%
+ * Copyright (C) 2008 - 2014 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+import java.util.Date;
+
+/**
+ * @author Sylvain Bavencoff <bavencoff(a)codelutin.com>
+ */
+public class BeforeFirstFiscalPeriodException extends DateException {
+
+ private static final long serialVersionUID = 2489087570900540310L;
+
+ public BeforeFirstFiscalPeriodException(Date date) {
+ super(date);
+ }
+}
Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/BeginAfterEndFiscalPeriodException.java (from rev 3894, trunk/lima-business-api/src/main/java/org/chorem/lima/business/BeginAfterEndFiscalPeriodException.java)
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/BeginAfterEndFiscalPeriodException.java (rev 0)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/BeginAfterEndFiscalPeriodException.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -0,0 +1,41 @@
+package org.chorem.lima.business.exceptions;
+
+/*
+ * #%L
+ * Lima :: business API
+ * %%
+ * Copyright (C) 2008 - 2014 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+import org.chorem.lima.entity.FiscalPeriod;
+
+/**
+ * @author Sylvain Bavencoff <bavencoff(a)codelutin.com>
+ */
+public class BeginAfterEndFiscalPeriodException extends FiscalPeriodException {
+
+ private static final long serialVersionUID = 2264156150001260558L;
+
+ public BeginAfterEndFiscalPeriodException(FiscalPeriod fiscalPeriod) {
+ super(fiscalPeriod);
+ }
+
+ public BeginAfterEndFiscalPeriodException(FiscalPeriod fiscalPeriod, Throwable cause) {
+ super(fiscalPeriod, cause);
+ }
+}
Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/ClosedPeriodicEntryBookException.java (from rev 3897, trunk/lima-business-api/src/main/java/org/chorem/lima/business/ClosedPeriodicEntryBookException.java)
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/ClosedPeriodicEntryBookException.java (rev 0)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/ClosedPeriodicEntryBookException.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -0,0 +1,46 @@
+package org.chorem.lima.business.exceptions;
+
+/*
+ * #%L
+ * Lima :: business API
+ * %%
+ * Copyright (C) 2008 - 2014 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+import org.chorem.lima.entity.ClosedPeriodicEntryBook;
+
+/**
+ * @author Sylvain Bavencoff <bavencoff(a)codelutin.com>
+ */
+public abstract class ClosedPeriodicEntryBookException extends LimaException {
+
+ protected ClosedPeriodicEntryBook closedPeriodicEntryBook;
+
+ public ClosedPeriodicEntryBookException(ClosedPeriodicEntryBook closedPeriodicEntryBook) {
+ this.closedPeriodicEntryBook = closedPeriodicEntryBook;
+ }
+
+ public ClosedPeriodicEntryBookException(ClosedPeriodicEntryBook closedPeriodicEntryBook, Throwable cause) {
+ super(cause);
+ this.closedPeriodicEntryBook = closedPeriodicEntryBook;
+ }
+
+ public ClosedPeriodicEntryBook getClosedPeriodicEntryBook() {
+ return closedPeriodicEntryBook;
+ }
+}
Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/ClosedPeriodicEntryBooksException.java (from rev 3894, trunk/lima-business-api/src/main/java/org/chorem/lima/business/ClosedPeriodicEntryBooksException.java)
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/ClosedPeriodicEntryBooksException.java (rev 0)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/ClosedPeriodicEntryBooksException.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -0,0 +1,48 @@
+package org.chorem.lima.business.exceptions;
+
+/*
+ * #%L
+ * Lima :: business API
+ * %%
+ * Copyright (C) 2008 - 2014 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+import org.chorem.lima.entity.ClosedPeriodicEntryBook;
+
+import java.util.Collection;
+
+/**
+ * @author Sylvain Bavencoff <bavencoff(a)codelutin.com>
+ */
+public abstract class ClosedPeriodicEntryBooksException extends LimaException {
+
+ protected Collection<ClosedPeriodicEntryBook> closedPeriodicEntryBooks;
+
+ public ClosedPeriodicEntryBooksException(Collection<ClosedPeriodicEntryBook> closedPeriodicEntryBooks) {
+ this.closedPeriodicEntryBooks = closedPeriodicEntryBooks;
+ }
+
+ public ClosedPeriodicEntryBooksException(Collection<ClosedPeriodicEntryBook> closedPeriodicEntryBooks, Throwable cause) {
+ super(cause);
+ this.closedPeriodicEntryBooks = closedPeriodicEntryBooks;
+ }
+
+ public Collection<ClosedPeriodicEntryBook> getClosedPeriodicEntryBooks() {
+ return closedPeriodicEntryBooks;
+ }
+}
Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/DateException.java (from rev 3894, trunk/lima-business-api/src/main/java/org/chorem/lima/business/DateException.java)
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/DateException.java (rev 0)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/DateException.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -0,0 +1,46 @@
+package org.chorem.lima.business.exceptions;
+
+/*
+ * #%L
+ * Lima :: business API
+ * %%
+ * Copyright (C) 2008 - 2014 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+import java.util.Date;
+
+/**
+ * @author Sylvain Bavencoff <bavencoff(a)codelutin.com>
+ */
+public abstract class DateException extends LimaException {
+
+ protected Date date;
+
+ public DateException(Date date) {
+ this.date = date;
+ }
+
+ public DateException(Date date, Throwable cause) {
+ super(cause);
+ this.date = date;
+ }
+
+ public Date getDate() {
+ return date;
+ }
+}
Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/EntriesException.java (from rev 3894, trunk/lima-business-api/src/main/java/org/chorem/lima/business/EntriesException.java)
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/EntriesException.java (rev 0)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/EntriesException.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -0,0 +1,48 @@
+package org.chorem.lima.business.exceptions;
+
+/*
+ * #%L
+ * Lima :: business API
+ * %%
+ * Copyright (C) 2008 - 2014 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+import org.chorem.lima.entity.Entry;
+
+import java.util.Collection;
+
+/**
+ * @author Sylvain Bavencoff <bavencoff(a)codelutin.com>
+ */
+public abstract class EntriesException extends LimaException {
+
+ protected Collection<Entry> entries;
+
+ public EntriesException(Collection<Entry> entries) {
+ this.entries = entries;
+ }
+
+ public EntriesException(Collection<Entry> entries, Throwable cause) {
+ super(cause);
+ this.entries = entries;
+ }
+
+ public Collection<Entry> getEntries() {
+ return entries;
+ }
+}
Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/EntryBookException.java (from rev 3894, trunk/lima-business-api/src/main/java/org/chorem/lima/business/EntryBookException.java)
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/EntryBookException.java (rev 0)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/EntryBookException.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -0,0 +1,47 @@
+package org.chorem.lima.business.exceptions;
+
+/*
+ * #%L
+ * Lima :: business API
+ * %%
+ * Copyright (C) 2008 - 2014 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+import org.chorem.lima.entity.EntryBook;
+
+/**
+ * @author Sylvain Bavencoff <bavencoff(a)codelutin.com>
+ */
+public abstract class EntryBookException extends LimaException {
+
+ private static final long serialVersionUID = 7340316212015035903L;
+ protected EntryBook entryBook;
+
+ public EntryBookException(EntryBook entryBook) {
+ this.entryBook = entryBook;
+ }
+
+ public EntryBookException(EntryBook entryBook, Throwable cause) {
+ super(cause);
+ this.entryBook = entryBook;
+ }
+
+ public EntryBook getEntryBook() {
+ return entryBook;
+ }
+}
Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/FinancialPeriodException.java (from rev 3897, trunk/lima-business-api/src/main/java/org/chorem/lima/business/FinancialPeriodException.java)
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/FinancialPeriodException.java (rev 0)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/FinancialPeriodException.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -0,0 +1,47 @@
+package org.chorem.lima.business.exceptions;
+
+/*
+ * #%L
+ * Lima :: business API
+ * %%
+ * Copyright (C) 2008 - 2014 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+import org.chorem.lima.entity.FinancialPeriod;
+
+/**
+ * @author Sylvain Bavencoff <bavencoff(a)codelutin.com>
+ */
+public abstract class FinancialPeriodException extends LimaException {
+
+ private static final long serialVersionUID = 1641125531069733891L;
+ protected FinancialPeriod financialPeriod;
+
+ public FinancialPeriodException(FinancialPeriod financialPeriod) {
+ this.financialPeriod = financialPeriod;
+ }
+
+ public FinancialPeriodException(FinancialPeriod financialPeriod, Throwable cause) {
+ super(cause);
+ this.financialPeriod = financialPeriod;
+ }
+
+ public FinancialPeriod getFinancialPeriod() {
+ return financialPeriod;
+ }
+}
Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/FinancialTransactionsException.java (from rev 3894, trunk/lima-business-api/src/main/java/org/chorem/lima/business/FinancialTransactionsException.java)
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/FinancialTransactionsException.java (rev 0)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/FinancialTransactionsException.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -0,0 +1,48 @@
+package org.chorem.lima.business.exceptions;
+
+/*
+ * #%L
+ * Lima :: business API
+ * %%
+ * Copyright (C) 2008 - 2014 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+import org.chorem.lima.entity.FinancialTransaction;
+
+import java.util.Collection;
+
+/**
+ * @author Sylvain Bavencoff <bavencoff(a)codelutin.com>
+ */
+public abstract class FinancialTransactionsException extends LimaException {
+
+ protected Collection<FinancialTransaction> financialTransactions;
+
+ public FinancialTransactionsException(Collection<FinancialTransaction> financialTransactions) {
+ this.financialTransactions = financialTransactions;
+ }
+
+ public FinancialTransactionsException(Collection<FinancialTransaction> financialTransactions, Throwable cause) {
+ super(cause);
+ this.financialTransactions = financialTransactions;
+ }
+
+ public Collection<FinancialTransaction> getFinancialTransactions() {
+ return financialTransactions;
+ }
+}
Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/FiscalPeriodException.java (from rev 3894, trunk/lima-business-api/src/main/java/org/chorem/lima/business/FiscalPeriodException.java)
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/FiscalPeriodException.java (rev 0)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/FiscalPeriodException.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -0,0 +1,46 @@
+package org.chorem.lima.business.exceptions;
+
+/*
+ * #%L
+ * Lima :: business API
+ * %%
+ * Copyright (C) 2008 - 2014 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+import org.chorem.lima.entity.FiscalPeriod;
+
+/**
+ * @author Sylvain Bavencoff <bavencoff(a)codelutin.com>
+ */
+public abstract class FiscalPeriodException extends LimaException {
+
+ protected FiscalPeriod fiscalPeriod;
+
+ public FiscalPeriodException(FiscalPeriod fiscalPeriod) {
+ this.fiscalPeriod = fiscalPeriod;
+ }
+
+ public FiscalPeriodException(FiscalPeriod fiscalPeriod, Throwable cause) {
+ super(cause);
+ this.fiscalPeriod = fiscalPeriod;
+ }
+
+ public FiscalPeriod getFiscalPeriod() {
+ return fiscalPeriod;
+ }
+}
Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/ImportBackupException.java (from rev 3895, trunk/lima-business-api/src/main/java/org/chorem/lima/ImportBackupException.java)
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/ImportBackupException.java (rev 0)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/ImportBackupException.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -0,0 +1,13 @@
+package org.chorem.lima.business.exceptions;
+
+/**
+ * Created by davidcosse on 31/07/14.
+ */
+public class ImportBackupException extends LimaException {
+
+ private static final long serialVersionUID = -2513856570463105751L;
+
+ public ImportBackupException(String message, Throwable cause) {
+ super(message, cause);
+ }
+}
Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/ImportEbpException.java (from rev 3894, trunk/lima-business-api/src/main/java/org/chorem/lima/business/ImportEbpException.java)
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/ImportEbpException.java (rev 0)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/ImportEbpException.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -0,0 +1,33 @@
+package org.chorem.lima.business.exceptions;
+
+/*
+ * #%L
+ * Lima :: business API
+ * %%
+ * Copyright (C) 2008 - 2014 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+/**
+ * @author Sylvain Bavencoff <bavencoff(a)codelutin.com>
+ */
+public class ImportEbpException extends LimaException {
+
+ public ImportEbpException(String message) {
+ super(message);
+ }
+}
Added: trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/ImportFileException.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/ImportFileException.java (rev 0)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/ImportFileException.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -0,0 +1,18 @@
+package org.chorem.lima.business.exceptions;
+
+/**
+ * Created by davidcosse on 06/08/14.
+ */
+public class ImportFileException extends LimaException {
+
+ private static final long serialVersionUID = 3498049458931759768L;
+ protected String detailMessage;
+
+ public ImportFileException(String detailMessage) {
+ this.detailMessage = detailMessage;
+ }
+
+ public String getDetailMessage() {
+ return detailMessage;
+ }
+}
Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/InvalidAccountNumberException.java (from rev 3897, trunk/lima-business-api/src/main/java/org/chorem/lima/business/InvalidAccountNumberException.java)
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/InvalidAccountNumberException.java (rev 0)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/InvalidAccountNumberException.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -0,0 +1,43 @@
+package org.chorem.lima.business.exceptions;
+
+/*
+ * #%L
+ * Lima :: business API
+ * %%
+ * Copyright (C) 2008 - 2014 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+/**
+ * @author Sylvain Bavencoff <bavencoff(a)codelutin.com>
+ */
+public class InvalidAccountNumberException extends AccountException {
+
+ private static final long serialVersionUID = 3561173000370832538L;
+
+ public InvalidAccountNumberException(String accountNumber) {
+ super(accountNumber);
+ }
+
+ public InvalidAccountNumberException(String accountNumber, String message) {
+ super(accountNumber, message);
+ }
+
+ public InvalidAccountNumberException(String accountNumber, Throwable cause) {
+ super(accountNumber, cause);
+ }
+}
Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/LastUnlockedFiscalPeriodException.java (from rev 3894, trunk/lima-business-api/src/main/java/org/chorem/lima/business/LastUnlockedFiscalPeriodException.java)
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/LastUnlockedFiscalPeriodException.java (rev 0)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/LastUnlockedFiscalPeriodException.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -0,0 +1,35 @@
+package org.chorem.lima.business.exceptions;
+
+/*
+ * #%L
+ * Lima :: business API
+ * %%
+ * Copyright (C) 2008 - 2014 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+import org.chorem.lima.entity.FiscalPeriod;
+
+/**
+ * @author Sylvain Bavencoff <bavencoff(a)codelutin.com>
+ */
+public class LastUnlockedFiscalPeriodException extends FiscalPeriodException {
+
+ public LastUnlockedFiscalPeriodException(FiscalPeriod fiscalPeriod) {
+ super(fiscalPeriod);
+ }
+}
Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/LimaException.java (from rev 3894, trunk/lima-business-api/src/main/java/org/chorem/lima/business/LimaException.java)
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/LimaException.java (rev 0)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/LimaException.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -0,0 +1,80 @@
+/*
+ * #%L
+ * Lima business
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2008 - 2010 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+package org.chorem.lima.business.exceptions;
+
+import javax.ejb.ApplicationException;
+
+/**
+ * Lima exception.
+ *
+ * @author chatellier
+ * @version $Revision$
+ * <p/>
+ * Last update : $Date$
+ * By : $Author$
+ */
+@ApplicationException
+public abstract class LimaException extends Exception {
+
+ /**
+ * serialVersionUID.
+ */
+ private static final long serialVersionUID = -6876236663940184462L;
+
+ /**
+ * Constructs a new exception
+ *
+ */
+ public LimaException() {
+ super();
+ }
+
+ /**
+ * Constructs a new exception with specified message.
+ *
+ */
+ public LimaException(String message) {
+ super(message);
+ }
+
+ /**
+ * Constructs a new exception with specified message and cause.
+ * @param message
+ * @param cause
+ */
+ public LimaException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ /**
+ * Constructs a new exception with the specified cause.
+ *
+ * @param cause cause
+ */
+ public LimaException(Throwable cause) {
+ super(cause);
+ }
+}
Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/LockedEntryBookException.java (from rev 3897, trunk/lima-business-api/src/main/java/org/chorem/lima/business/LockedEntryBookException.java)
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/LockedEntryBookException.java (rev 0)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/LockedEntryBookException.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -0,0 +1,41 @@
+package org.chorem.lima.business.exceptions;
+
+/*
+ * #%L
+ * Lima :: business API
+ * %%
+ * Copyright (C) 2008 - 2014 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+import org.chorem.lima.entity.ClosedPeriodicEntryBook;
+
+/**
+ * @author Sylvain Bavencoff <bavencoff(a)codelutin.com>
+ */
+public class LockedEntryBookException extends ClosedPeriodicEntryBookException {
+
+ private static final long serialVersionUID = -1215196268732515909L;
+
+ public LockedEntryBookException(ClosedPeriodicEntryBook closedPeriodicEntryBook) {
+ super(closedPeriodicEntryBook);
+ }
+
+ public LockedEntryBookException(ClosedPeriodicEntryBook closedPeriodicEntryBook, Throwable cause) {
+ super(closedPeriodicEntryBook, cause);
+ }
+}
Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/LockedFinancialPeriodException.java (from rev 3897, trunk/lima-business-api/src/main/java/org/chorem/lima/business/LockedFinancialPeriodException.java)
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/LockedFinancialPeriodException.java (rev 0)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/LockedFinancialPeriodException.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -0,0 +1,41 @@
+package org.chorem.lima.business.exceptions;
+
+/*
+ * #%L
+ * Lima :: business API
+ * %%
+ * Copyright (C) 2008 - 2014 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+import org.chorem.lima.entity.FinancialPeriod;
+
+/**
+ * @author Sylvain Bavencoff <bavencoff(a)codelutin.com>
+ */
+public class LockedFinancialPeriodException extends FinancialPeriodException {
+
+ private static final long serialVersionUID = -4319832479131451016L;
+
+ public LockedFinancialPeriodException(FinancialPeriod financialPeriod) {
+ super(financialPeriod);
+ }
+
+ public LockedFinancialPeriodException(FinancialPeriod financialPeriod, Throwable cause) {
+ super(financialPeriod, cause);
+ }
+}
Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/MoreOneUnlockFiscalPeriodException.java (from rev 3900, trunk/lima-business-api/src/main/java/org/chorem/lima/business/MoreOneUnlockFiscalPeriodException.java)
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/MoreOneUnlockFiscalPeriodException.java (rev 0)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/MoreOneUnlockFiscalPeriodException.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -0,0 +1,61 @@
+package org.chorem.lima.business.exceptions;
+
+/*
+ * #%L
+ * Lima :: business API
+ * %%
+ * Copyright (C) 2008 - 2014 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+import java.util.Date;
+
+/**
+ * @author Sylvain Bavencoff <bavencoff(a)codelutin.com>
+ */
+public class MoreOneUnlockFiscalPeriodException extends LimaException {
+
+ private static final long serialVersionUID = -9215191603583397411L;
+ Date beginDate;
+ Date endDate;
+ Boolean isLocked;
+ long countUnlockFiscalPeriod;
+
+ public MoreOneUnlockFiscalPeriodException(Date beginDate, Date endDate, Boolean isLocked, long countUnlockFiscalPeriod) {
+ this.beginDate = beginDate;
+ this.endDate = endDate;
+ this.isLocked = isLocked;
+ this.countUnlockFiscalPeriod = countUnlockFiscalPeriod;
+
+ }
+
+ public Date getBeginDate() {
+ return beginDate;
+ }
+
+ public Date getEndDate() {
+ return endDate;
+ }
+
+ public Boolean getIsLocked() {
+ return isLocked;
+ }
+
+ public long getCountUnlockFiscalPeriod() {
+ return countUnlockFiscalPeriod;
+ }
+}
Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/NoDataToImportException.java (from rev 3900, trunk/lima-business-api/src/main/java/org/chorem/lima/business/NoDataToImportException.java)
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/NoDataToImportException.java (rev 0)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/NoDataToImportException.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -0,0 +1,8 @@
+package org.chorem.lima.business.exceptions;
+
+/**
+ * Created by davidcosse on 06/08/14.
+ */
+public class NoDataToImportException extends LimaException {
+ private static final long serialVersionUID = -2919766360401345410L;
+}
Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/NoEmptyFiscalPeriodException.java (from rev 3894, trunk/lima-business-api/src/main/java/org/chorem/lima/business/NoEmptyFiscalPeriodException.java)
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/NoEmptyFiscalPeriodException.java (rev 0)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/NoEmptyFiscalPeriodException.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -0,0 +1,39 @@
+package org.chorem.lima.business.exceptions;
+
+/*
+ * #%L
+ * Lima :: business API
+ * %%
+ * Copyright (C) 2008 - 2014 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+import org.chorem.lima.entity.FinancialTransaction;
+
+import java.util.Collection;
+
+/**
+ * @author Sylvain Bavencoff <bavencoff(a)codelutin.com>
+ */
+public class NoEmptyFiscalPeriodException extends FinancialTransactionsException {
+
+ private static final long serialVersionUID = -7254330675145732125L;
+
+ public NoEmptyFiscalPeriodException(Collection<FinancialTransaction> financialTransactions) {
+ super(financialTransactions);
+ }
+}
Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/NoFiscalPeriodFoundException.java (from rev 3900, trunk/lima-business-api/src/main/java/org/chorem/lima/business/NoFiscalPeriodFoundException.java)
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/NoFiscalPeriodFoundException.java (rev 0)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/NoFiscalPeriodFoundException.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -0,0 +1,8 @@
+package org.chorem.lima.business.exceptions;
+
+/**
+ * Created by davidcosse on 06/08/14.
+ */
+public class NoFiscalPeriodFoundException extends LimaException {
+ private static final long serialVersionUID = 8983518025656738319L;
+}
Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/NoFoundFinancialPeriodException.java (from rev 3894, trunk/lima-business-api/src/main/java/org/chorem/lima/business/NoFoundFinancialPeriodException.java)
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/NoFoundFinancialPeriodException.java (rev 0)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/NoFoundFinancialPeriodException.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -0,0 +1,38 @@
+package org.chorem.lima.business.exceptions;
+
+/*
+ * #%L
+ * Lima :: business API
+ * %%
+ * Copyright (C) 2008 - 2014 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+
+import java.util.Date;
+
+/**
+ * @author Sylvain Bavencoff <bavencoff(a)codelutin.com>
+ */
+public class NoFoundFinancialPeriodException extends DateException {
+
+ private static final long serialVersionUID = 18792078050537481L;
+
+ public NoFoundFinancialPeriodException(Date date, Throwable cause) {
+ super(date, cause);
+ }
+}
Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/NotAllowedLabelException.java (from rev 3897, trunk/lima-business-api/src/main/java/org/chorem/lima/business/NotAllowedLabel.java)
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/NotAllowedLabelException.java (rev 0)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/NotAllowedLabelException.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -0,0 +1,40 @@
+package org.chorem.lima.business.exceptions;
+
+/*
+ * #%L
+ * Lima :: business API
+ * %%
+ * Copyright (C) 2008 - 2014 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+/**
+ * Created by davidcosse on 31/07/14.
+ */
+public class NotAllowedLabelException extends LimaException {
+
+ private static final long serialVersionUID = -4092985460788892883L;
+ protected String label;
+
+ public NotAllowedLabelException(String label) {
+ this.label = label;
+ }
+
+ public String getLabel() {
+ return label;
+ }
+}
Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/NotBeginNextDayOfLastFiscalPeriodException.java (from rev 3894, trunk/lima-business-api/src/main/java/org/chorem/lima/business/NotBeginNextDayOfLastFiscalPeriodException.java)
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/NotBeginNextDayOfLastFiscalPeriodException.java (rev 0)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/NotBeginNextDayOfLastFiscalPeriodException.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -0,0 +1,41 @@
+package org.chorem.lima.business.exceptions;
+
+/*
+ * #%L
+ * Lima :: business API
+ * %%
+ * Copyright (C) 2008 - 2014 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+import org.chorem.lima.entity.FiscalPeriod;
+
+/**
+ * @author Sylvain Bavencoff <bavencoff(a)codelutin.com>
+ */
+public class NotBeginNextDayOfLastFiscalPeriodException extends FiscalPeriodException {
+
+ private static final long serialVersionUID = 8176413878471871539L;
+
+ public NotBeginNextDayOfLastFiscalPeriodException(FiscalPeriod fiscalPeriod) {
+ super(fiscalPeriod);
+ }
+
+ public NotBeginNextDayOfLastFiscalPeriodException(FiscalPeriod fiscalPeriod, Throwable cause) {
+ super(fiscalPeriod, cause);
+ }
+}
Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/NotLockedClosedPeriodicEntryBooksException.java (from rev 3894, trunk/lima-business-api/src/main/java/org/chorem/lima/business/NotLockedClosedPeriodicEntryBooksException.java)
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/NotLockedClosedPeriodicEntryBooksException.java (rev 0)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/NotLockedClosedPeriodicEntryBooksException.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -0,0 +1,37 @@
+package org.chorem.lima.business.exceptions;
+
+/*
+ * #%L
+ * Lima :: business API
+ * %%
+ * Copyright (C) 2008 - 2014 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+import org.chorem.lima.entity.ClosedPeriodicEntryBook;
+
+import java.util.Collection;
+
+/**
+ * @author Sylvain Bavencoff <bavencoff(a)codelutin.com>
+ */
+public class NotLockedClosedPeriodicEntryBooksException extends ClosedPeriodicEntryBooksException {
+
+ public NotLockedClosedPeriodicEntryBooksException(Collection<ClosedPeriodicEntryBook> closedPeriodicEntryBooks) {
+ super(closedPeriodicEntryBooks);
+ }
+}
Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/NotNumberAccountNumberException.java (from rev 3900, trunk/lima-business-api/src/main/java/org/chorem/lima/business/NotNumberAccountNumberException.java)
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/NotNumberAccountNumberException.java (rev 0)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/NotNumberAccountNumberException.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -0,0 +1,21 @@
+package org.chorem.lima.business.exceptions;
+
+/**
+ * @author Sylvain Bavencoff <bavencoff(a)codelutin.com>
+ */
+public class NotNumberAccountNumberException extends AccountException {
+
+ private static final long serialVersionUID = 8846998707851534785L;
+
+ public NotNumberAccountNumberException(String accountNumber) {
+ super(accountNumber);
+ }
+
+ public NotNumberAccountNumberException(String accountNumber, String message) {
+ super(accountNumber, message);
+ }
+
+ public NotNumberAccountNumberException(String accountNumber, Throwable cause) {
+ super(accountNumber, cause);
+ }
+}
Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/UnbalancedEntriesException.java (from rev 3894, trunk/lima-business-api/src/main/java/org/chorem/lima/business/UnbalancedEntriesException.java)
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/UnbalancedEntriesException.java (rev 0)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/UnbalancedEntriesException.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -0,0 +1,37 @@
+package org.chorem.lima.business.exceptions;
+
+/*
+ * #%L
+ * Lima :: business API
+ * %%
+ * Copyright (C) 2008 - 2014 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+import org.chorem.lima.entity.Entry;
+
+import java.util.Collection;
+
+/**
+ * @author Sylvain Bavencoff <bavencoff(a)codelutin.com>
+ */
+public class UnbalancedEntriesException extends EntriesException {
+
+ public UnbalancedEntriesException(Collection<Entry> entries) {
+ super(entries);
+ }
+}
Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/UnbalancedFinancialTransactionsException.java (from rev 3894, trunk/lima-business-api/src/main/java/org/chorem/lima/business/UnbalancedFinancialTransactionsException.java)
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/UnbalancedFinancialTransactionsException.java (rev 0)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/UnbalancedFinancialTransactionsException.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -0,0 +1,43 @@
+package org.chorem.lima.business.exceptions;
+
+/*
+ * #%L
+ * Lima :: business API
+ * %%
+ * Copyright (C) 2008 - 2014 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+import org.chorem.lima.entity.FinancialTransaction;
+
+import java.util.Collection;
+
+/**
+ * @author Sylvain Bavencoff <bavencoff(a)codelutin.com>
+ */
+public class UnbalancedFinancialTransactionsException extends FinancialTransactionsException {
+
+ private static final long serialVersionUID = -5798716883893821461L;
+
+ public UnbalancedFinancialTransactionsException(Collection<FinancialTransaction> financialTransactions) {
+ super(financialTransactions);
+ }
+
+ public UnbalancedFinancialTransactionsException(Collection<FinancialTransaction> financialTransactions, Throwable cause) {
+ super(financialTransactions, cause);
+ }
+}
Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/UnfilledEntriesException.java (from rev 3894, trunk/lima-business-api/src/main/java/org/chorem/lima/business/UnfilledEntriesException.java)
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/UnfilledEntriesException.java (rev 0)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/UnfilledEntriesException.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -0,0 +1,37 @@
+package org.chorem.lima.business.exceptions;
+
+/*
+ * #%L
+ * Lima :: business API
+ * %%
+ * Copyright (C) 2008 - 2014 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+import org.chorem.lima.entity.Entry;
+
+import java.util.Collection;
+
+/**
+ * @author Sylvain Bavencoff <bavencoff(a)codelutin.com>
+ */
+public class UnfilledEntriesException extends EntriesException {
+
+ public UnfilledEntriesException(Collection<Entry> entries) {
+ super(entries);
+ }
+}
Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/UsedAccountException.java (from rev 3894, trunk/lima-business-api/src/main/java/org/chorem/lima/business/UsedAccountException.java)
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/UsedAccountException.java (rev 0)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/UsedAccountException.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -0,0 +1,35 @@
+package org.chorem.lima.business.exceptions;
+
+/*
+ * #%L
+ * Lima :: business API
+ * %%
+ * Copyright (C) 2008 - 2014 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+/**
+ * @author Sylvain Bavencoff <bavencoff(a)codelutin.com>
+ */
+public class UsedAccountException extends AccountException {
+
+ private static final long serialVersionUID = 6259523100387108392L;
+
+ public UsedAccountException(String accountNumber) {
+ super(accountNumber);
+ }
+}
Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/UsedEntryBookException.java (from rev 3894, trunk/lima-business-api/src/main/java/org/chorem/lima/business/UsedEntryBookException.java)
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/UsedEntryBookException.java (rev 0)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/UsedEntryBookException.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -0,0 +1,36 @@
+package org.chorem.lima.business.exceptions;
+
+/*
+ * #%L
+ * Lima :: business API
+ * %%
+ * Copyright (C) 2008 - 2014 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+import org.chorem.lima.entity.EntryBook;
+
+/**
+ * @author Sylvain Bavencoff <bavencoff(a)codelutin.com>
+ */
+public class UsedEntryBookException extends EntryBookException {
+
+ public UsedEntryBookException(EntryBook entryBook) {
+ super(entryBook);
+ }
+
+}
Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/WithoutEntryBookFinancialTransactionsException.java (from rev 3894, trunk/lima-business-api/src/main/java/org/chorem/lima/business/WithoutEntryBookFinancialTransactionsException.java)
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/WithoutEntryBookFinancialTransactionsException.java (rev 0)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/WithoutEntryBookFinancialTransactionsException.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -0,0 +1,40 @@
+package org.chorem.lima.business.exceptions;
+
+/*
+ * #%L
+ * Lima :: business API
+ * %%
+ * Copyright (C) 2008 - 2014 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+import org.chorem.lima.entity.FinancialTransaction;
+
+import java.util.Collection;
+
+/**
+ * @author Sylvain Bavencoff <bavencoff(a)codelutin.com>
+ */
+public class WithoutEntryBookFinancialTransactionsException extends FinancialTransactionsException {
+
+ private static final long serialVersionUID = -7367418086461765300L;
+
+ public WithoutEntryBookFinancialTransactionsException(Collection<FinancialTransaction> financialTransactions) {
+ super(financialTransactions);
+ }
+
+}
Modified: trunk/lima-swing/pom.xml
===================================================================
--- trunk/lima-swing/pom.xml 2014-08-06 12:04:19 UTC (rev 3901)
+++ trunk/lima-swing/pom.xml 2014-08-06 14:27:15 UTC (rev 3902)
@@ -169,11 +169,6 @@
<artifactId>commons-lang</artifactId>
</dependency>
- <dependency>
- <groupId>commons-codec</groupId>
- <artifactId>commons-codec</artifactId>
- </dependency>
-
</dependencies>
<build>
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountViewHandler.java 2014-08-06 12:04:19 UTC (rev 3901)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountViewHandler.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -28,14 +28,14 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.LimaConfig;
-import org.chorem.lima.business.AlreadyExistAccountException;
-import org.chorem.lima.business.InvalidAccountNumberException;
-import org.chorem.lima.business.NotAllowedLabel;
-import org.chorem.lima.business.NotNumberAccountNumberException;
import org.chorem.lima.business.ServiceListener;
-import org.chorem.lima.business.UsedAccountException;
import org.chorem.lima.business.api.AccountService;
import org.chorem.lima.business.api.ImportService;
+import org.chorem.lima.business.exceptions.AlreadyExistAccountException;
+import org.chorem.lima.business.exceptions.InvalidAccountNumberException;
+import org.chorem.lima.business.exceptions.NotAllowedLabelException;
+import org.chorem.lima.business.exceptions.NotNumberAccountNumberException;
+import org.chorem.lima.business.exceptions.UsedAccountException;
import org.chorem.lima.entity.Account;
import org.chorem.lima.enums.AccountsChartEnum;
import org.chorem.lima.enums.ImportExportEnum;
@@ -279,7 +279,7 @@
errorHelper.showErrorMessage(t("lima.ui.account.add.error.InvalidAccountNumber", e.getAccountNumber()));
} catch (NotNumberAccountNumberException e) {
errorHelper.showErrorMessage(t("lima.fiscalPeriod.franceAccountingRules.notNumberAccountNumberException", e.getAccountNumber()));
- } catch (NotAllowedLabel e) {
+ } catch (NotAllowedLabelException e) {
errorHelper.showErrorMessage(t("lima.all.notAllowedLabel", e.getLabel()));
} finally {
dialog.dispose();
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/common/FinancialTransactionTableModel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/common/FinancialTransactionTableModel.java 2014-08-06 12:04:19 UTC (rev 3901)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/common/FinancialTransactionTableModel.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -26,11 +26,11 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.chorem.lima.business.AfterLastFiscalPeriodException;
-import org.chorem.lima.business.BeforeFirstFiscalPeriodException;
-import org.chorem.lima.business.LockedEntryBookException;
-import org.chorem.lima.business.LockedFinancialPeriodException;
import org.chorem.lima.business.api.FinancialTransactionService;
+import org.chorem.lima.business.exceptions.AfterLastFiscalPeriodException;
+import org.chorem.lima.business.exceptions.BeforeFirstFiscalPeriodException;
+import org.chorem.lima.business.exceptions.LockedEntryBookException;
+import org.chorem.lima.business.exceptions.LockedFinancialPeriodException;
import org.chorem.lima.business.utils.EntryComparator;
import org.chorem.lima.entity.Entry;
import org.chorem.lima.entity.EntryImpl;
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookViewHandler.java 2014-08-06 12:04:19 UTC (rev 3901)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookViewHandler.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -29,9 +29,10 @@
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.LimaConfig;
import org.chorem.lima.business.ServiceListener;
-import org.chorem.lima.business.UsedEntryBookException;
import org.chorem.lima.business.api.EntryBookService;
import org.chorem.lima.business.api.ImportService;
+import org.chorem.lima.business.exceptions.AlreadyExistEntryBookException;
+import org.chorem.lima.business.exceptions.UsedEntryBookException;
import org.chorem.lima.entity.EntryBook;
import org.chorem.lima.entity.EntryBookImpl;
import org.chorem.lima.enums.EntryBooksChartEnum;
@@ -167,8 +168,12 @@
if (newEntryBook != null) {
// service call
- newEntryBook = entryBookService.createEntryBook(newEntryBook);
-
+ try {
+ newEntryBook = entryBookService.createEntryBook(newEntryBook);
+ } catch (AlreadyExistEntryBookException e) {
+ errorHelper.showErrorMessage(t("lima.entryBook.alreadyExistEntryBookException", e.getEntryBook().getCode()));
+ }
+
// ui refresh
EntryBookTableModel model = view.getEntryBookTableModel();
model.addValue(newEntryBook);
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialperiod/FinancialPeriodViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialperiod/FinancialPeriodViewHandler.java 2014-08-06 12:04:19 UTC (rev 3901)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialperiod/FinancialPeriodViewHandler.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -29,14 +29,14 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.LimaConfig;
-import org.chorem.lima.business.NotLockedClosedPeriodicEntryBooksException;
import org.chorem.lima.business.ServiceListener;
-import org.chorem.lima.business.UnbalancedFinancialTransactionsException;
-import org.chorem.lima.business.UnfilledEntriesException;
-import org.chorem.lima.business.WithoutEntryBookFinancialTransactionsException;
import org.chorem.lima.business.api.FinancialPeriodService;
import org.chorem.lima.business.api.FiscalPeriodService;
import org.chorem.lima.business.api.ImportService;
+import org.chorem.lima.business.exceptions.NotLockedClosedPeriodicEntryBooksException;
+import org.chorem.lima.business.exceptions.UnbalancedFinancialTransactionsException;
+import org.chorem.lima.business.exceptions.UnfilledEntriesException;
+import org.chorem.lima.business.exceptions.WithoutEntryBookFinancialTransactionsException;
import org.chorem.lima.business.utils.FinancialPeriodComparator;
import org.chorem.lima.entity.ClosedPeriodicEntryBook;
import org.chorem.lima.entity.Entry;
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartTreeTableModel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartTreeTableModel.java 2014-08-06 12:04:19 UTC (rev 3901)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartTreeTableModel.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -29,9 +29,9 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.LimaConfig;
-import org.chorem.lima.business.AlreadyExistFinancialStatement;
-import org.chorem.lima.business.NotAllowedLabel;
import org.chorem.lima.business.api.FinancialStatementService;
+import org.chorem.lima.business.exceptions.AlreadyExistFinancialStatement;
+import org.chorem.lima.business.exceptions.NotAllowedLabelException;
import org.chorem.lima.entity.FinancialStatement;
import org.chorem.lima.entity.FinancialStatementImpl;
import org.chorem.lima.service.LimaServiceFactory;
@@ -216,7 +216,7 @@
} catch (AlreadyExistFinancialStatement alreadyExistFinancialStatement) {
errorHelper.showErrorMessage(t("lima.importexport.import.alreadyExistFinancialStatement",
alreadyExistFinancialStatement.getFinancialStatementLabel(), alreadyExistFinancialStatement.getMasterLabel()));
- } catch (NotAllowedLabel notAllowedLabel) {
+ } catch (NotAllowedLabelException notAllowedLabel) {
errorHelper.showErrorMessage(t("lima.financialstatement.notAllowedLabel",
notAllowedLabel.getLabel()));
}
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 2014-08-06 12:04:19 UTC (rev 3901)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionViewHandler.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -30,16 +30,16 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.LimaConfig;
-import org.chorem.lima.business.AfterLastFiscalPeriodException;
-import org.chorem.lima.business.BeforeFirstFiscalPeriodException;
-import org.chorem.lima.business.LockedEntryBookException;
-import org.chorem.lima.business.LockedFinancialPeriodException;
import org.chorem.lima.business.ServiceListener;
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.FiscalPeriodService;
import org.chorem.lima.business.api.ImportService;
+import org.chorem.lima.business.exceptions.AfterLastFiscalPeriodException;
+import org.chorem.lima.business.exceptions.BeforeFirstFiscalPeriodException;
+import org.chorem.lima.business.exceptions.LockedEntryBookException;
+import org.chorem.lima.business.exceptions.LockedFinancialPeriodException;
import org.chorem.lima.entity.Entry;
import org.chorem.lima.entity.EntryBook;
import org.chorem.lima.entity.EntryImpl;
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedViewHandler.java 2014-08-06 12:04:19 UTC (rev 3901)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedViewHandler.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -28,10 +28,10 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.LimaConfig;
-import org.chorem.lima.business.AfterLastFiscalPeriodException;
-import org.chorem.lima.business.BeforeFirstFiscalPeriodException;
-import org.chorem.lima.business.LockedEntryBookException;
-import org.chorem.lima.business.LockedFinancialPeriodException;
+import org.chorem.lima.business.exceptions.AfterLastFiscalPeriodException;
+import org.chorem.lima.business.exceptions.BeforeFirstFiscalPeriodException;
+import org.chorem.lima.business.exceptions.LockedEntryBookException;
+import org.chorem.lima.business.exceptions.LockedFinancialPeriodException;
import org.chorem.lima.entity.Entry;
import org.chorem.lima.entity.EntryImpl;
import org.chorem.lima.entity.FinancialTransaction;
@@ -39,13 +39,7 @@
import org.chorem.lima.ui.financialtransaction.FinancialTransactionDefaultTable;
import org.chorem.lima.util.ErrorHelper;
-import javax.swing.AbstractAction;
-import javax.swing.ActionMap;
-import javax.swing.InputMap;
-import javax.swing.JComponent;
-import javax.swing.JOptionPane;
-import javax.swing.KeyStroke;
-import javax.swing.ListSelectionModel;
+import javax.swing.*;
import javax.swing.table.TableCellEditor;
import java.awt.event.ActionEvent;
import java.awt.event.KeyEvent;
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/FiscalPeriodViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/FiscalPeriodViewHandler.java 2014-08-06 12:04:19 UTC (rev 3901)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/FiscalPeriodViewHandler.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -30,15 +30,15 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.LimaConfig;
-import org.chorem.lima.business.AlreadyLockedFiscalPeriodException;
-import org.chorem.lima.business.BeginAfterEndFiscalPeriodException;
-import org.chorem.lima.business.LastUnlockedFiscalPeriodException;
-import org.chorem.lima.business.MoreOneUnlockFiscalPeriodException;
-import org.chorem.lima.business.NoEmptyFiscalPeriodException;
-import org.chorem.lima.business.NotBeginNextDayOfLastFiscalPeriodException;
import org.chorem.lima.business.ServiceListener;
import org.chorem.lima.business.api.FinancialTransactionService;
import org.chorem.lima.business.api.FiscalPeriodService;
+import org.chorem.lima.business.exceptions.AlreadyLockedFiscalPeriodException;
+import org.chorem.lima.business.exceptions.BeginAfterEndFiscalPeriodException;
+import org.chorem.lima.business.exceptions.LastUnlockedFiscalPeriodException;
+import org.chorem.lima.business.exceptions.MoreOneUnlockFiscalPeriodException;
+import org.chorem.lima.business.exceptions.NoEmptyFiscalPeriodException;
+import org.chorem.lima.business.exceptions.NotBeginNextDayOfLastFiscalPeriodException;
import org.chorem.lima.entity.EntryBook;
import org.chorem.lima.entity.EntryBookImpl;
import org.chorem.lima.entity.FinancialTransaction;
@@ -48,14 +48,7 @@
import org.chorem.lima.util.ErrorHelper;
import org.nuiton.util.DateUtil;
-import javax.swing.AbstractAction;
-import javax.swing.ActionMap;
-import javax.swing.DefaultListSelectionModel;
-import javax.swing.InputMap;
-import javax.swing.JComponent;
-import javax.swing.JOptionPane;
-import javax.swing.KeyStroke;
-import javax.swing.SwingWorker;
+import javax.swing.*;
import javax.swing.event.ListSelectionEvent;
import java.awt.event.ActionEvent;
import java.awt.event.KeyEvent;
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java 2014-08-06 12:04:19 UTC (rev 3901)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -31,26 +31,27 @@
import org.apache.commons.io.IOUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.chorem.lima.ImportBackupException;
import org.chorem.lima.LimaTechnicalException;
-import org.chorem.lima.business.AlreadyExistFinancialStatement;
-import org.chorem.lima.business.AlreadyExistVatStatement;
-import org.chorem.lima.business.BeginAfterEndFiscalPeriodException;
import org.chorem.lima.business.ExportResult;
import org.chorem.lima.business.ImportExportResults;
import org.chorem.lima.business.ImportResult;
-import org.chorem.lima.business.InvalidAccountNumberException;
-import org.chorem.lima.business.LimaException;
-import org.chorem.lima.business.LockedEntryBookException;
-import org.chorem.lima.business.LockedFinancialPeriodException;
-import org.chorem.lima.business.MoreOneUnlockFiscalPeriodException;
-import org.chorem.lima.business.NoDataToImportException;
-import org.chorem.lima.business.NoFiscalPeriodFoundException;
-import org.chorem.lima.business.NotAllowedLabel;
-import org.chorem.lima.business.NotBeginNextDayOfLastFiscalPeriodException;
-import org.chorem.lima.business.NotNumberAccountNumberException;
import org.chorem.lima.business.api.ExportService;
import org.chorem.lima.business.api.ImportService;
+import org.chorem.lima.business.exceptions.AlreadyExistFinancialStatement;
+import org.chorem.lima.business.exceptions.AlreadyExistVatStatementException;
+import org.chorem.lima.business.exceptions.BeginAfterEndFiscalPeriodException;
+import org.chorem.lima.business.exceptions.ImportBackupException;
+import org.chorem.lima.business.exceptions.ImportFileException;
+import org.chorem.lima.business.exceptions.InvalidAccountNumberException;
+import org.chorem.lima.business.exceptions.LimaException;
+import org.chorem.lima.business.exceptions.LockedEntryBookException;
+import org.chorem.lima.business.exceptions.LockedFinancialPeriodException;
+import org.chorem.lima.business.exceptions.MoreOneUnlockFiscalPeriodException;
+import org.chorem.lima.business.exceptions.NoDataToImportException;
+import org.chorem.lima.business.exceptions.NoFiscalPeriodFoundException;
+import org.chorem.lima.business.exceptions.NotAllowedLabelException;
+import org.chorem.lima.business.exceptions.NotBeginNextDayOfLastFiscalPeriodException;
+import org.chorem.lima.business.exceptions.NotNumberAccountNumberException;
import org.chorem.lima.entity.Account;
import org.chorem.lima.entity.Entry;
import org.chorem.lima.entity.EntryBook;
@@ -102,11 +103,6 @@
/** Parent view. */
protected Component viewComponent;
- /**
- * @deprecated etat de la classe, non multi thread, gerer ca différement.
- */
- protected EncodingEnum encodingEnum;
-
protected ImportService importService;
protected ExportService exportService;
@@ -358,13 +354,13 @@
Set<Integer> lines = exceptionsByLine.keySet();
for (Integer line : lines) {
LimaException importException = exceptionsByLine.get(line);
- message += t("lima.ui.importexport.import.ligne", line);
+ message += t("lima.ui.importexport.import.line", line);
if (importException instanceof InvalidAccountNumberException) {
message += t("lima.fiscalPeriod.franceAccountingRules.invalidAccountNumberException", ((InvalidAccountNumberException) importException).getAccountNumber())+"\n";
} else if (importException instanceof NotNumberAccountNumberException) {
message += t("lima.fiscalPeriod.franceAccountingRules.notNumberAccountNumberException", ((NotNumberAccountNumberException) importException).getAccountNumber())+"\n";
- } else if (importException instanceof NotAllowedLabel) {
- message += t("lima.all.NotAllowedLabel", ((NotAllowedLabel) importException).getLabel())+"\n";
+ } else if (importException instanceof NotAllowedLabelException) {
+ message += t("lima.all.NotAllowedLabel", ((NotAllowedLabelException) importException).getLabel())+"\n";
} else if (importException instanceof MoreOneUnlockFiscalPeriodException) {
message += t("lima.fiscalPeriod.franceAccountingRules.moreOneUnlockFiscalPeriodException", ((MoreOneUnlockFiscalPeriodException) importException).getBeginDate(), ((MoreOneUnlockFiscalPeriodException) importException).getEndDate())+"\n";
} else if (importException instanceof BeginAfterEndFiscalPeriodException) {
@@ -377,14 +373,16 @@
message += t("lima.financialTransaction.lockedEntryBookException", ((LockedEntryBookException) importException).getClosedPeriodicEntryBook().getFinancialPeriod().getBeginDate(), ((LockedEntryBookException) importException).getClosedPeriodicEntryBook().getFinancialPeriod().getEndDate())+"\n";
} else if (importException instanceof AlreadyExistFinancialStatement) {
message += t("lima.financialStatement.alreadyExistFinancialStatement", ((AlreadyExistFinancialStatement) importException).getFinancialStatementLabel())+"\n";
- } else if (importException instanceof AlreadyExistVatStatement) {
- message += t("lima.vatStatement.alreadyExistVatStatement", ((AlreadyExistVatStatement) importException).getVatStatementLabel())+"\n";
+ } else if (importException instanceof AlreadyExistVatStatementException) {
+ message += t("lima.vatStatement.alreadyExistVatStatement", ((AlreadyExistVatStatementException) importException).getVatStatementLabel())+"\n";
} else if (importException instanceof NoFiscalPeriodFoundException) {
message += t("lima.import.entries.noFiscalPeriodFoundException")+"\n";
} else if (importException instanceof NoDataToImportException) {
message += t("lima.import.noDataToImportException")+"\n";
+ } else if (importException instanceof ImportFileException){
+ message += ((ImportFileException) importException).getDetailMessage();
} else {
-
+ message +=t("lima.import.unknownError");
}
//message += t("lima.ui.importexport.import.exceptions", (line))+"\n";
if (log.isErrorEnabled()) {
@@ -397,7 +395,9 @@
private String getFromSourceMessage(Class fromSource) {
String message;
- if (fromSource.equals(Account.class)){
+ if (fromSource == null) {
+ message = "";
+ } else if (fromSource.equals(Account.class)){
message = t("lima.ui.importexport.account")+"\n";
} else if (fromSource.equals(EntryBook.class)) {
message = t("lima.ui.importexport.entrybook")+"\n";
@@ -462,10 +462,6 @@
}
if (chooser.showOpenDialog(viewComponent) == JFileChooser.APPROVE_OPTION) {
filePath = chooser.getSelectedFile().getAbsolutePath();
-
- if (importExportMethode.getEncodingOption()) {
- encodingEnum = EncodingEnum.valueOfDescription((String) comboBox.getSelectedItem());
- }
}
return filePath;
@@ -555,6 +551,9 @@
}
protected ImportExportResults importAllFromZipFile(String filePath) {
+ ImportExportResults results = new ImportExportResults();
+ ImportResult result = results.createAddAndGetImportResult(null);
+
ZipInputStream zipInputStream = null;
String tmpDir = System.getProperty("java.io.tmpdir")+"/";
FileInputStream inputStream = null;
@@ -578,48 +577,47 @@
zipInputStream.closeEntry();
}
} catch (Exception e) {
- throw new LimaTechnicalException("could not extract zip file", e);
+ result.addInitException(new ImportFileException(t("lima.ui.importexport.import.extractFileError")));
} finally {
IOUtils.closeQuietly(zipInputStream);
IOUtils.closeQuietly(inputStream);
}
InputStream transactionsStream, entryBooksStream, fiscalPeriodsStream, entriesStream, accountsStream, identityStream;
- ImportExportResults results = null;
- try {
- entryBooksStream = new FileInputStream(tmpDir + EntryBook.class.getSimpleName() +".csv");
- String entryBooksStreamString = IOUtils.toString(entryBooksStream);
- IOUtils.closeQuietly(entryBooksStream);
- // import
- transactionsStream = new FileInputStream(tmpDir + FinancialTransaction.class.getSimpleName() +".csv");
- String transactionsStreamString = IOUtils.toString(transactionsStream);
- IOUtils.closeQuietly(transactionsStream);
+ if (result.getAllExceptionsByLine().isEmpty()) {
+ try {
+ entryBooksStream = new FileInputStream(tmpDir + EntryBook.class.getSimpleName() +".csv");
+ String entryBooksStreamString = IOUtils.toString(entryBooksStream);
+ IOUtils.closeQuietly(entryBooksStream);
- fiscalPeriodsStream = new FileInputStream(tmpDir + FiscalPeriod.class.getSimpleName() +".csv");
- String fiscalPeriodsStreamString = IOUtils.toString(fiscalPeriodsStream);
- IOUtils.closeQuietly(fiscalPeriodsStream);
+ // import
+ transactionsStream = new FileInputStream(tmpDir + FinancialTransaction.class.getSimpleName() +".csv");
+ String transactionsStreamString = IOUtils.toString(transactionsStream);
+ IOUtils.closeQuietly(transactionsStream);
- accountsStream = new FileInputStream(tmpDir + Account.class.getSimpleName() +".csv");
- String accountsStreamString = IOUtils.toString(accountsStream);
- IOUtils.closeQuietly(accountsStream);
+ fiscalPeriodsStream = new FileInputStream(tmpDir + FiscalPeriod.class.getSimpleName() +".csv");
+ String fiscalPeriodsStreamString = IOUtils.toString(fiscalPeriodsStream);
+ IOUtils.closeQuietly(fiscalPeriodsStream);
- entriesStream = new FileInputStream(tmpDir + Entry.class.getSimpleName() +".csv");
- String entriesStreamString = IOUtils.toString(entriesStream);
- IOUtils.closeQuietly(entriesStream);
+ accountsStream = new FileInputStream(tmpDir + Account.class.getSimpleName() +".csv");
+ String accountsStreamString = IOUtils.toString(accountsStream);
+ IOUtils.closeQuietly(accountsStream);
- identityStream = new FileInputStream(tmpDir + Identity.class.getSimpleName() + ".csv");
- String identityStreamString = IOUtils.toString(identityStream);
- IOUtils.closeQuietly(identityStream);
+ entriesStream = new FileInputStream(tmpDir + Entry.class.getSimpleName() +".csv");
+ String entriesStreamString = IOUtils.toString(entriesStream);
+ IOUtils.closeQuietly(entriesStream);
- results = importService.importBackup(entryBooksStreamString, transactionsStreamString, fiscalPeriodsStreamString, accountsStreamString, entriesStreamString, identityStreamString);
+ identityStream = new FileInputStream(tmpDir + Identity.class.getSimpleName() + ".csv");
+ String identityStreamString = IOUtils.toString(identityStream);
+ IOUtils.closeQuietly(identityStream);
- } catch (Exception ex) {
- if(log.isInfoEnabled()) {
- log.info(ex);
+ results= importService.importBackup(entryBooksStreamString, transactionsStreamString, fiscalPeriodsStreamString, accountsStreamString, entriesStreamString, identityStreamString);
+ } catch (Exception ex) {
+ if(log.isInfoEnabled()) {
+ log.info(ex);
+ }
+ result.addException(new ImportBackupException(t("lima.ui.importexport.import.backupException"),ex));
}
- results = new ImportExportResults();
- ImportResult result = results.createAddAndGetImportResult(Account.class);
- result.addException(new ImportBackupException("could not import files", ex));
}
return results;
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringViewHandler.java 2014-08-06 12:04:19 UTC (rev 3901)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringViewHandler.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -33,14 +33,14 @@
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.LimaConfig;
import org.chorem.lima.beans.LetteringFilterImpl;
-import org.chorem.lima.business.LockedEntryBookException;
-import org.chorem.lima.business.LockedFinancialPeriodException;
-import org.chorem.lima.business.UnbalancedEntriesException;
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.FiscalPeriodService;
+import org.chorem.lima.business.exceptions.LockedEntryBookException;
+import org.chorem.lima.business.exceptions.LockedFinancialPeriodException;
+import org.chorem.lima.business.exceptions.UnbalancedEntriesException;
import org.chorem.lima.entity.Account;
import org.chorem.lima.entity.AccountImpl;
import org.chorem.lima.entity.Entry;
@@ -48,12 +48,7 @@
import org.chorem.lima.service.LimaServiceFactory;
import org.chorem.lima.util.ErrorHelper;
-import javax.swing.AbstractAction;
-import javax.swing.ActionMap;
-import javax.swing.InputMap;
-import javax.swing.JComboBox;
-import javax.swing.JComponent;
-import javax.swing.KeyStroke;
+import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.InputEvent;
import java.awt.event.KeyEvent;
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/CreateFiscalPeriodPanel.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/CreateFiscalPeriodPanel.jaxx 2014-08-06 12:04:19 UTC (rev 3901)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/CreateFiscalPeriodPanel.jaxx 2014-08-06 14:27:15 UTC (rev 3902)
@@ -30,7 +30,7 @@
org.jdesktop.swingx.JXDatePicker
org.chorem.lima.entity.FiscalPeriod
org.chorem.lima.business.api.FiscalPeriodService
- org.chorem.lima.business.LimaException
+ org.chorem.lima.business.exceptions.LimaException
org.chorem.lima.service.LimaServiceFactory
</import>
<script>
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/OpeningViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/OpeningViewHandler.java 2014-08-06 12:04:19 UTC (rev 3901)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/OpeningViewHandler.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -27,8 +27,8 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.chorem.lima.business.LimaException;
import org.chorem.lima.business.api.FiscalPeriodService;
+import org.chorem.lima.business.exceptions.LimaException;
import org.chorem.lima.entity.FiscalPeriod;
import org.chorem.lima.entity.FiscalPeriodImpl;
import org.chorem.lima.enums.AccountsChartEnum;
@@ -39,11 +39,10 @@
import org.chorem.lima.service.LimaServiceFactory;
import org.chorem.lima.ui.importexport.ImportExport;
-import javax.swing.BorderFactory;
-import javax.swing.JPanel;
+import javax.swing.*;
import javax.swing.border.Border;
import javax.swing.border.EmptyBorder;
-import java.awt.Color;
+import java.awt.*;
import static org.nuiton.i18n.I18n.t;
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatchart/VatChartTreeTableModel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatchart/VatChartTreeTableModel.java 2014-08-06 12:04:19 UTC (rev 3901)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatchart/VatChartTreeTableModel.java 2014-08-06 14:27:15 UTC (rev 3902)
@@ -26,9 +26,9 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.chorem.lima.business.AlreadyExistVatStatement;
-import org.chorem.lima.business.NotAllowedLabel;
import org.chorem.lima.business.api.VatStatementService;
+import org.chorem.lima.business.exceptions.AlreadyExistVatStatementException;
+import org.chorem.lima.business.exceptions.NotAllowedLabelException;
import org.chorem.lima.entity.VatStatement;
import org.chorem.lima.entity.VatStatementImpl;
import org.chorem.lima.service.LimaServiceFactory;
@@ -180,10 +180,10 @@
try {
vatStatementService.createVatStatement(
parentVatStatementHeader, vatStatement);
- } catch (AlreadyExistVatStatement alreadyExistVatStatement) {
+ } catch (AlreadyExistVatStatementException alreadyExistVatStatement) {
errorHelper.showErrorMessage(t("lima.importexport.import.alreadyExistFinancialStatement",
alreadyExistVatStatement.getVatStatementLabel(), alreadyExistVatStatement.getMasterLabel()));
- } catch (NotAllowedLabel notAllowedLabel) {
+ } catch (NotAllowedLabelException notAllowedLabel) {
errorHelper.showErrorMessage(t("lima.importexport.import.alreadyExistFinancialStatement",
notAllowedLabel.getLabel()));
}
Modified: trunk/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties
===================================================================
--- trunk/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties 2014-08-06 12:04:19 UTC (rev 3901)
+++ trunk/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties 2014-08-06 14:27:15 UTC (rev 3902)
@@ -208,6 +208,7 @@
lima.entries.searchunbalancedtransaction=Incorrect transactions
lima.entries.unbalanced=
lima.entries.writetransaction=Write entries
+lima.entryBook.alreadyExistEntryBookException=An entry book with code %s already exists.
lima.entryBooks=
lima.entrybooksreports.documentcreationerror=Enable to create document
lima.entrybooksreports.documentcreationfiscalerror=Can't create document on an open fiscal year
@@ -615,7 +616,9 @@
lima.ui.importexport.fiscalPeriod=Fiscal periods import completed.
lima.ui.importexport.identity=Identity import completed.
lima.ui.importexport.import=
-lima.ui.importexport.import.ligne=Line %d
+lima.ui.importexport.import.backupException=could not import backup.
+lima.ui.importexport.import.extractFileError=Could not extract file.
+lima.ui.importexport.import.line=Line %d\:
lima.ui.importexport.import.nbCreated=%d created
lima.ui.importexport.import.nbIgnored=%d ignored
lima.ui.importexport.import.nbUpdated=%d updated
Modified: trunk/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties
===================================================================
--- trunk/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties 2014-08-06 12:04:19 UTC (rev 3901)
+++ trunk/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties 2014-08-06 14:27:15 UTC (rev 3902)
@@ -189,6 +189,7 @@
lima.entries.searchunbalancedtransaction=
lima.entries.unbalanced=Entrées incorrectes
lima.entries.writetransaction=
+lima.entryBook.alreadyExistEntryBookException=Un journal avec comme code % existe déjà.
lima.entryBooks=Journaux
lima.entrybooksreports.documentcreationerror=Erreur lors de la création du document
lima.entrybooksreports.documentcreationfiscalerror=Impossible de créer un document quand la période fiscale est ouverte
@@ -534,7 +535,9 @@
lima.ui.importexport.identity=de l'identité terminé.
lima.ui.importexport.import=Importer
lima.ui.importexport.import.action=Import
-lima.ui.importexport.import.ligne=Ligne %d
+lima.ui.importexport.import.backupException=Echec de l'import du backup.
+lima.ui.importexport.import.extractFileError=Le fichier n'est correct
+lima.ui.importexport.import.line=Ligne %d\:
lima.ui.importexport.import.nbCreated=%d créés
lima.ui.importexport.import.nbIgnored=%d ignorés
lima.ui.importexport.import.nbUpdated=%d mis à jours
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2014-08-06 12:04:19 UTC (rev 3901)
+++ trunk/pom.xml 2014-08-06 14:27:15 UTC (rev 3902)
@@ -188,11 +188,10 @@
<openejbJavaeeApiVersion>6.0-6</openejbJavaeeApiVersion>
<dom4jVersion>1.6.1</dom4jVersion>
<jdomVersion>2.0.5</jdomVersion>
- <openCsvVersion>2.3</openCsvVersion>
<itextVersion>4.2.1</itextVersion>
<nuitonWidgetsVersion>1.1.1</nuitonWidgetsVersion>
- <jaxxVersion>2.8.8-SNAPSHOT</jaxxVersion>
+ <jaxxVersion>2.9</jaxxVersion>
<openEjbVersion>4.6.0.2</openEjbVersion>
<slf4jVersion>1.7.7</slf4jVersion>
<swingxVersion>1.6.5-1</swingxVersion>
@@ -432,13 +431,6 @@
<scope>compile</scope>
</dependency>
- <dependency>
- <groupId>net.sf.opencsv</groupId>
- <artifactId>opencsv</artifactId>
- <version>${openCsvVersion}</version>
- <scope>compile</scope>
- </dependency>
-
<!-- itext pdf to create document -->
<dependency>
1
0
r3901 - trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport
by dcosse@users.chorem.org 06 Aug '14
by dcosse@users.chorem.org 06 Aug '14
06 Aug '14
Author: dcosse
Date: 2014-08-06 14:04:19 +0200 (Wed, 06 Aug 2014)
New Revision: 3901
Url: http://forge.chorem.org/projects/lima/repository/revisions/3901
Log:
refs #1032 correction d'une NPE
Modified:
trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java 2014-08-06 11:53:01 UTC (rev 3900)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java 2014-08-06 12:04:19 UTC (rev 3901)
@@ -77,7 +77,6 @@
import java.nio.charset.Charset;
import java.rmi.server.ExportException;
import java.text.SimpleDateFormat;
-import java.util.Collection;
import java.util.Date;
import java.util.List;
import java.util.Map;
@@ -275,10 +274,12 @@
log.debug(importedEntity + " nbCreated: " + result.getNbCreated());
log.debug(importedEntity + " nbUpdated: " + result.getNbUpdated());
log.debug(importedEntity + " nbIgnored: " + result.getNbIgnored());
- Collection<LimaException> exceptions = result.getAllExceptionsByLine().values();
- for (LimaException exception : exceptions) {
- log.warn(exception.getCause());
- log.warn(exception.getStackTrace());
+ Map<Integer, LimaException> exceptions = result.getAllExceptionsByLine();
+ if (exceptions != null) {
+ for (LimaException exception : exceptions.values()) {
+ log.warn(exception.getCause());
+ log.warn(exception.getStackTrace());
+ }
}
}
}
1
0
Author: dcosse
Date: 2014-08-06 13:53:01 +0200 (Wed, 06 Aug 2014)
New Revision: 3900
Url: http://forge.chorem.org/projects/lima/repository/revisions/3900
Log:
refs #1032 gestion des exceptions d'import
Added:
trunk/lima-business-api/src/main/java/org/chorem/lima/business/NoDataToImportException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/NoFiscalPeriodFoundException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/NotNumberAccountNumberException.java
Modified:
trunk/lima-business-api/src/main/java/org/chorem/lima/business/ImportResult.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/MoreOneUnlockFiscalPeriodException.java
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/FiscalPeriodService.java
trunk/lima-business/src/main/java/org/chorem/lima/business/AccountingRules.java
trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/DefaultAccountingRules.java
trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/FranceAccountingRules.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.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/accountingrules/TestAccountingRules.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountViewHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java
trunk/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties
trunk/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/AccountingRules.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/AccountingRules.java 2014-08-06 11:52:03 UTC (rev 3899)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/AccountingRules.java 2014-08-06 11:53:01 UTC (rev 3900)
@@ -48,9 +48,9 @@
* @param account new account
* @throws LimaException if rule validation fails
*/
- void createAccountRules(Account account) throws InvalidAccountNumberException;
+ void createAccountRules(Account account) throws InvalidAccountNumberException, NotNumberAccountNumberException, NotAllowedLabel;
- void updateAccountRules(Account account) throws InvalidAccountNumberException;
+ void updateAccountRules(Account account) throws InvalidAccountNumberException, NotNumberAccountNumberException;
void removeAccountRules(Account account) throws UsedAccountException;
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 2014-08-06 11:52:03 UTC (rev 3899)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/DefaultAccountingRules.java 2014-08-06 11:53:01 UTC (rev 3900)
@@ -39,8 +39,10 @@
import org.chorem.lima.business.LockedFinancialPeriodException;
import org.chorem.lima.business.MoreOneUnlockFiscalPeriodException;
import org.chorem.lima.business.NoEmptyFiscalPeriodException;
+import org.chorem.lima.business.NotAllowedLabel;
import org.chorem.lima.business.NotBeginNextDayOfLastFiscalPeriodException;
import org.chorem.lima.business.NotLockedClosedPeriodicEntryBooksException;
+import org.chorem.lima.business.NotNumberAccountNumberException;
import org.chorem.lima.business.UnbalancedEntriesException;
import org.chorem.lima.business.UnbalancedFinancialTransactionsException;
import org.chorem.lima.business.UnfilledEntriesException;
@@ -94,16 +96,19 @@
* Rules to check before create accounts.
*/
@Override
- public void createAccountRules(Account account) throws InvalidAccountNumberException {
-
+ public void createAccountRules(Account account) throws InvalidAccountNumberException, NotNumberAccountNumberException, NotAllowedLabel {
// Check if the numberaccount is not blank
if (StringUtils.isBlank(account.getAccountNumber())) {
throw new InvalidAccountNumberException(account.getAccountNumber());
}
+ if (account.getAccountNumber().contains("\\")){
+ throw new NotAllowedLabel(account.getAccountNumber());
+ }
+
}
@Override
- public void updateAccountRules(Account account) throws InvalidAccountNumberException {
+ public void updateAccountRules(Account account) throws InvalidAccountNumberException, NotNumberAccountNumberException {
// Check if the numberaccount is not blank
if (StringUtils.isBlank(account.getAccountNumber())) {
throw new InvalidAccountNumberException(account.getAccountNumber());
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/FranceAccountingRules.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/FranceAccountingRules.java 2014-08-06 11:52:03 UTC (rev 3899)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/FranceAccountingRules.java 2014-08-06 11:53:01 UTC (rev 3900)
@@ -34,8 +34,10 @@
import org.chorem.lima.business.LastUnlockedFiscalPeriodException;
import org.chorem.lima.business.MoreOneUnlockFiscalPeriodException;
import org.chorem.lima.business.NoEmptyFiscalPeriodException;
+import org.chorem.lima.business.NotAllowedLabel;
import org.chorem.lima.business.NotBeginNextDayOfLastFiscalPeriodException;
import org.chorem.lima.business.NotLockedClosedPeriodicEntryBooksException;
+import org.chorem.lima.business.NotNumberAccountNumberException;
import org.chorem.lima.business.UnbalancedFinancialTransactionsException;
import org.chorem.lima.business.UnfilledEntriesException;
import org.chorem.lima.business.WithoutEntryBookFinancialTransactionsException;
@@ -54,8 +56,6 @@
import java.util.Date;
import java.util.List;
-import static org.nuiton.i18n.I18n.t;
-
/**
* Surcharge des regles par defaut pour application à la comptabilité française.
*
@@ -69,43 +69,30 @@
* Règles de vérification de la création du PCG, appliquées à la comptabilité française.
*/
@Override
- public void createAccountRules(Account account) throws InvalidAccountNumberException {
- super.createAccountRules(account);
+ public void createAccountRules(Account account) throws InvalidAccountNumberException, NotNumberAccountNumberException, NotAllowedLabel {
- String accountNumber = account.getAccountNumber();
-
- // ledger account must be located in 411 account
- if (!StringUtils.isNumeric(accountNumber) && !accountNumber.startsWith("4")) {
- log.warn(t("lima-business.franceaccountingrules.accountnumbernotnumeric",
- account.getAccountNumber()));
- throw new InvalidAccountNumberException(t("lima-business.franceaccountingrules.accountnumbernotnumeric",
- account.getAccountNumber()), account.getAccountNumber());
- }
-
- // Check root account starts with 1 to 8
- if (accountNumber.length() >= 1 && !accountNumber.substring(0, 1).matches("[1-8]")) {
- log.warn(t("lima-business.franceaccountingrules.accountstartnumbererror",
- account.getAccountNumber()));
- throw new InvalidAccountNumberException(t("lima-business.franceaccountingrules.accountstartnumbererror",
- account.getAccountNumber()), account.getAccountNumber());
- }
-
+ super.createAccountRules(account);
+ validFranceAccountingRules(account);
}
@Override
- public void updateAccountRules(Account account) throws InvalidAccountNumberException {
+ public void updateAccountRules(Account account) throws InvalidAccountNumberException, NotNumberAccountNumberException {
+
super.updateAccountRules(account);
+ validFranceAccountingRules(account);
+ }
+ protected void validFranceAccountingRules(Account account) throws NotNumberAccountNumberException, InvalidAccountNumberException {
String accountNumber = account.getAccountNumber();
- // Check if the number account is type numeric
- if (!StringUtils.isNumeric(account.getAccountNumber())) {
- throw new InvalidAccountNumberException(account.getAccountNumber());
+ // ledger account must be located in 411 account
+ if (!StringUtils.isNumeric(accountNumber) && !accountNumber.startsWith("4")) {
+ throw new NotNumberAccountNumberException(account.getAccountNumber(), account.getAccountNumber());
}
// Check root account starts with 1 to 8
if (accountNumber.length() >= 1 && !accountNumber.substring(0, 1).matches("[1-8]")) {
- throw new InvalidAccountNumberException(account.getAccountNumber());
+ throw new InvalidAccountNumberException(account.getAccountNumber(), account.getAccountNumber());
}
}
@@ -133,27 +120,24 @@
FiscalPeriodTopiaDao fiscalPeriodTopiaDao = getDaoHelper().getFiscalPeriodDao();
- //Checks if is not the first fiscalperiod to create
+ // Checks if is not the first fiscal period to create
if (fiscalPeriodTopiaDao.count() != 0) {
FiscalPeriod lastFiscalPeriod = fiscalPeriodTopiaDao.getLastFiscalPeriod();
//check the new fiscal period adjoining the last
Date dateLastFiscalPeriod = lastFiscalPeriod.getEndDate();
- dateLastFiscalPeriod = DateUtils.
- addDays(dateLastFiscalPeriod, 1);
- dateLastFiscalPeriod = DateUtils.truncate(dateLastFiscalPeriod, Calendar.DATE);
- Date dateFiscalPeriod = fiscalPeriod.getBeginDate();
+ Date newFiscalPeriodStartingDate = DateUtils.addDays(dateLastFiscalPeriod, 1);
+ newFiscalPeriodStartingDate = DateUtils.truncate(newFiscalPeriodStartingDate, Calendar.DATE);
- if (dateLastFiscalPeriod.compareTo(dateFiscalPeriod) != 0) {
+ if (newFiscalPeriodStartingDate.compareTo(fiscalPeriod.getBeginDate()) != 0) {
throw new NotBeginNextDayOfLastFiscalPeriodException(lastFiscalPeriod);
}
- //We can create a new fiscal period meantime the last fiscal period was not locked
- //But not the ante periodfiscal
- int unblockedFiscalPeriod = (int) fiscalPeriodTopiaDao.forLockedEquals(false).count();
- if (unblockedFiscalPeriod > 1) {
- throw new MoreOneUnlockFiscalPeriodException(unblockedFiscalPeriod);
+ // No more than one unlocked fiscal period is allowed
+ long unblockedFiscalPeriod = fiscalPeriodTopiaDao.forLockedEquals(false).count();
+ if (unblockedFiscalPeriod > 1L) {
+ throw new MoreOneUnlockFiscalPeriodException(fiscalPeriod.getBeginDate(), fiscalPeriod.getEndDate(), fiscalPeriod.isLocked(), unblockedFiscalPeriod);
}
}
@@ -191,11 +175,11 @@
public void blockFiscalPeriodRules(FiscalPeriod fiscalPeriod) throws LastUnlockedFiscalPeriodException {
FiscalPeriodTopiaDao fiscalPeriodTopiaDao = getDaoHelper().getFiscalPeriodDao();
- FiscalPeriod oldestUnBlockedFiscalPeriod =
+ FiscalPeriod lastUnlockedFiscalPeriod =
fiscalPeriodTopiaDao.getLastUnlockedFiscalPeriod();
//Check if the fiscal period to block is the oldest
- if (oldestUnBlockedFiscalPeriod.equals(fiscalPeriod)) {
+ if (lastUnlockedFiscalPeriod.equals(fiscalPeriod)) {
throw new LastUnlockedFiscalPeriodException(fiscalPeriod);
}
}
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-08-06 11:52:03 UTC (rev 3899)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java 2014-08-06 11:53:01 UTC (rev 3900)
@@ -31,6 +31,8 @@
import org.chorem.lima.business.InvalidAccountNumberException;
import org.chorem.lima.business.LimaConfig;
import org.chorem.lima.business.LimaException;
+import org.chorem.lima.business.NotAllowedLabel;
+import org.chorem.lima.business.NotNumberAccountNumberException;
import org.chorem.lima.business.UsedAccountException;
import org.chorem.lima.business.api.AccountService;
import org.chorem.lima.business.utils.AccountComparator;
@@ -70,7 +72,7 @@
}
@Override
- public boolean createOrUbdateAccount(Account account) throws InvalidAccountNumberException {
+ public boolean createOrUbdateAccount(Account account) throws InvalidAccountNumberException, NotNumberAccountNumberException, NotAllowedLabel {
// check if account number already exist
AccountTopiaDao accountDao = getDaoHelper().getAccountDao();
@@ -92,7 +94,7 @@
* @throws LimaException
*/
@Override
- public Account createAccount(Account account) throws AlreadyExistAccountException, InvalidAccountNumberException {
+ public Account createAccount(Account account) throws AlreadyExistAccountException, InvalidAccountNumberException, NotNumberAccountNumberException, NotAllowedLabel {
// check if account number already exist
AccountTopiaDao accountDao = getDaoHelper().getAccountDao();
@@ -106,7 +108,7 @@
return result;
}
- protected Account createNewAccount(Account account) throws InvalidAccountNumberException {
+ protected Account createNewAccount(Account account) throws InvalidAccountNumberException, NotNumberAccountNumberException, NotAllowedLabel {
// check rules before create the account
AccountingRules accountingRules = LimaConfig.getInstance().getAccountingRules();
accountingRules.createAccountRules(account);
@@ -215,7 +217,7 @@
* @throws InvalidAccountNumberException
*/
@Override
- public Account updateAccount(Account account) throws InvalidAccountNumberException {
+ public Account updateAccount(Account account) throws InvalidAccountNumberException, NotNumberAccountNumberException {
AccountingRules accountingRules = LimaConfig.getInstance().getAccountingRules();
@@ -224,7 +226,6 @@
Account originalAccount = accountDao.forAccountNumberEquals(account.getAccountNumber()).findUnique();
Binder<Account, Account> binder = BinderFactory.newBinder(Account.class, Account.class);
binder.copy(account, originalAccount, Account.PROPERTY_LABEL, Account.PROPERTY_THIRD_PARTY);
- //binder.copyExcluding(account, originalAccount, Account.PROPERTY_TOPIA_ID);
accountingRules.updateAccountRules(originalAccount);
Account result = accountDao.update(originalAccount);
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-06 11:52:03 UTC (rev 3899)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FiscalPeriodServiceImpl.java 2014-08-06 11:53:01 UTC (rev 3900)
@@ -41,7 +41,9 @@
import org.chorem.lima.business.MoreOneUnlockFiscalPeriodException;
import org.chorem.lima.business.NoEmptyFiscalPeriodException;
import org.chorem.lima.business.NoFoundFinancialPeriodException;
+import org.chorem.lima.business.NotAllowedLabel;
import org.chorem.lima.business.NotBeginNextDayOfLastFiscalPeriodException;
+import org.chorem.lima.business.NotNumberAccountNumberException;
import org.chorem.lima.business.api.AccountService;
import org.chorem.lima.business.api.EntryBookService;
import org.chorem.lima.business.api.FinancialPeriodService;
@@ -294,14 +296,14 @@
LastUnlockedFiscalPeriodException,
AlreadyLockedFiscalPeriodException,
AlreadyExistAccountException,
- InvalidAccountNumberException {
+ InvalidAccountNumberException, NotNumberAccountNumberException, NotAllowedLabel {
if (entryBook != null && retainedEarnings) {
// re-attach entities to current session
FiscalPeriodTopiaDao fiscalPeriodTopiaDao = getDaoHelper().getFiscalPeriodDao();
- FiscalPeriod localFiscalPeriod = fiscalPeriodTopiaDao.findByTopiaId(fiscalPeriod.getTopiaId());
+ FiscalPeriod localFiscalPeriod = fiscalPeriodTopiaDao.forTopiaIdEquals(fiscalPeriod.getTopiaId()).findUnique();
//if entrybook isn't found
//then create it
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-06 11:52:03 UTC (rev 3899)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java 2014-08-06 11:53:01 UTC (rev 3900)
@@ -32,7 +32,7 @@
import org.chorem.lima.business.AlreadyExistAccountException;
import org.chorem.lima.business.AlreadyExistFinancialStatement;
import org.chorem.lima.business.AlreadyExistVatStatement;
-import org.chorem.lima.business.FiscalPeriodException;
+import org.chorem.lima.business.BeginAfterEndFiscalPeriodException;
import org.chorem.lima.business.ImportEbpException;
import org.chorem.lima.business.ImportExportResults;
import org.chorem.lima.business.ImportResult;
@@ -40,7 +40,11 @@
import org.chorem.lima.business.LockedEntryBookException;
import org.chorem.lima.business.LockedFinancialPeriodException;
import org.chorem.lima.business.MoreOneUnlockFiscalPeriodException;
+import org.chorem.lima.business.NoDataToImportException;
+import org.chorem.lima.business.NoFiscalPeriodFoundException;
import org.chorem.lima.business.NotAllowedLabel;
+import org.chorem.lima.business.NotBeginNextDayOfLastFiscalPeriodException;
+import org.chorem.lima.business.NotNumberAccountNumberException;
import org.chorem.lima.business.api.AccountService;
import org.chorem.lima.business.api.EntryBookService;
import org.chorem.lima.business.api.EntryService;
@@ -143,27 +147,32 @@
ImportExportResults result = new ImportExportResults();
ImportResult importResult = result.createAddAndGetImportResult(Account.class);
- InputStream contentStream = IOUtils.toInputStream(contents);
- try {
- ImportModel<Account> model = new AccountModel();
- Import<Account> accounts = Import.newImport(model, contentStream);
- // csv line index
- boolean updated;
- for (Account account : accounts) {
- try {
- updated = accountService.createOrUbdateAccount(account);
- if (updated) {
- importResult.increaseUpdated();
- } else {
- importResult.increaseCreated();
+ if (StringUtils.isBlank(contents)) {
+ importResult.addException(new NoDataToImportException());
+ } else {
+ InputStream contentStream = IOUtils.toInputStream(contents);
+ try {
+ ImportModel<Account> model = new AccountModel();
+ Import<Account> accounts = Import.newImport(model, contentStream);
+ // csv line index
+ boolean updated;
+ for (Account account : accounts) {
+ try {
+ updated = accountService.createOrUbdateAccount(account);
+ if (updated) {
+ importResult.increaseUpdated();
+ } else {
+ importResult.increaseCreated();
+ }
+ } catch (InvalidAccountNumberException | NotNumberAccountNumberException | NotAllowedLabel e) {
+ importResult.addException(e);
}
- } catch (InvalidAccountNumberException e) {
- importResult.addException(e);
}
+ } finally {
+ IOUtils.closeQuietly(contentStream);
}
- } finally {
- IOUtils.closeQuietly(contentStream);
}
+
return result;
}
@@ -172,9 +181,11 @@
ImportExportResults results = new ImportExportResults();
ImportResult result = results.createAddAndGetImportResult(EntryBook.class);
- InputStream contentStream = IOUtils.toInputStream(contents);
+ if (StringUtils.isBlank(contents)) {
+ result.addException(new NoDataToImportException());
+ } else {
+ InputStream contentStream = IOUtils.toInputStream(contents);
- try {
ImportModel<EntryBook> model = new EntryBookModel();
Import<EntryBook> entryBooks = Import.newImport(model, contentStream);
@@ -186,7 +197,7 @@
result.increaseCreated();
}
}
- } finally {
+
IOUtils.closeQuietly(contentStream);
}
return results;
@@ -197,25 +208,28 @@
ImportExportResults results = new ImportExportResults();
ImportResult result = results.createAddAndGetImportResult(FiscalPeriod.class);
- InputStream contentStream = IOUtils.toInputStream(contents);
- try {
- ImportModel<FiscalPeriod> model = new FiscalPeriodModel();
+ if (StringUtils.isBlank(contents)) {
+ result.addException(new NoDataToImportException());
+ } else {
+ InputStream contentStream = IOUtils.toInputStream(contents);
+ try {
+ ImportModel<FiscalPeriod> model = new FiscalPeriodModel();
- Import<FiscalPeriod> fiscalPeriods = Import.newImport(model, contentStream);
+ Import<FiscalPeriod> fiscalPeriods = Import.newImport(model, contentStream);
- try {
- for (FiscalPeriod fiscalPeriod : fiscalPeriods) {
- fiscalPeriodService.createFiscalPeriod(fiscalPeriod);
- result.increaseCreated();
+ try {
+ for (FiscalPeriod fiscalPeriod : fiscalPeriods) {
+ fiscalPeriodService.createFiscalPeriod(fiscalPeriod);
+ result.increaseCreated();
+ }
+ } catch (MoreOneUnlockFiscalPeriodException | BeginAfterEndFiscalPeriodException | NotBeginNextDayOfLastFiscalPeriodException e) {
+ result.addException(e);
}
- } catch (FiscalPeriodException e) {
- result.addException(e);
- } catch (MoreOneUnlockFiscalPeriodException e) {
- result.increaseIgnored();
+ } finally {
+ IOUtils.closeQuietly(contentStream);
}
- } finally {
- IOUtils.closeQuietly(contentStream);
}
+
return results;
}
@@ -223,24 +237,28 @@
ImportExportResults results = new ImportExportResults();
ImportResult result = results.createAddAndGetImportResult(FinancialTransaction.class);
- // import and save FinancialTransactions
- InputStream contentStream = IOUtils.toInputStream(contents);
- try {
- ImportModel<FinancialTransaction> model = new FinancialTransactionModel(entryBookService);
+ if (StringUtils.isBlank(contents)) {
+ result.addException(new NoDataToImportException());
+ } else {
+ // import and save FinancialTransactions
+ InputStream contentStream = IOUtils.toInputStream(contents);
+ try {
+ ImportModel<FinancialTransaction> model = new FinancialTransactionModel(entryBookService);
- Import<FinancialTransaction> financialTransactions = Import.newImport(model, contentStream);
+ Import<FinancialTransaction> financialTransactions = Import.newImport(model, contentStream);
- for (FinancialTransaction financialTransaction : financialTransactions) {
- try {
- financialTransactionService.createFinancialTransaction(financialTransaction);
- result.increaseCreated();
- } catch (LockedFinancialPeriodException | LockedEntryBookException e) {
- result.addException(e);
+ for (FinancialTransaction financialTransaction : financialTransactions) {
+ try {
+ financialTransactionService.createFinancialTransaction(financialTransaction);
+ result.increaseCreated();
+ } catch (LockedFinancialPeriodException | LockedEntryBookException e) {
+ result.addException(e);
+ }
}
+
+ } finally {
+ IOUtils.closeQuietly(contentStream);
}
-
- } finally {
- IOUtils.closeQuietly(contentStream);
}
return results;
}
@@ -250,16 +268,17 @@
ImportExportResults results = new ImportExportResults();
ImportResult result = results.createAddAndGetImportResult(Entry.class);
- // import and save entries
- InputStream contentStream = IOUtils.toInputStream(contents);
- try {
+ if (StringUtils.isBlank(contents)) {
+ result.addException(new NoDataToImportException());
+ } else {
+ // import and save entries
+ InputStream contentStream = IOUtils.toInputStream(contents);
ImportModel<Entry> model = new EntryModel(accountService, financialTransactionService, false);
Import<Entry> entries = Import.newImport(model, contentStream);
for (Entry entry : entries) {
entryService.createEntry(entry);
result.increaseCreated();
}
- } finally {
IOUtils.closeQuietly(contentStream);
}
return results;
@@ -269,10 +288,12 @@
ImportExportResults results = new ImportExportResults();
ImportResult result = results.createAddAndGetImportResult(Identity.class);
- // import and save identity
- if (StringUtils.isNotBlank(contents)){
- InputStream contentStream = null;
- try {
+ if (StringUtils.isBlank(contents)) {
+ result.addException(new NoDataToImportException());
+ } else {
+ // import and save identity
+ if (StringUtils.isNotBlank(contents)){
+ InputStream contentStream = null;
contentStream = IOUtils.toInputStream(contents);
ImportModel<Identity> model = new IdentityModel();
Import<Identity> identities = Import.newImport(model, contentStream);
@@ -280,11 +301,9 @@
identityService.updateIdentity(identity);
result.increaseCreated();
}
- } finally {
IOUtils.closeQuietly(contentStream);
}
}
-
return results;
}
@@ -331,103 +350,109 @@
ImportExportResults results = new ImportExportResults();
ImportResult result = results.createAddAndGetImportResult(FinancialStatement.class);
- // import and save FinancialTransactions
- InputStream contentStream = IOUtils.toInputStream(contents);
- try {
- ImportModel<FinancialStatementImport> model = new FinancialStatementModel();
+ if (StringUtils.isBlank(contents)) {
+ result.addException(new NoDataToImportException());
+ } else {
- Import<FinancialStatementImport> financialStatementImports = Import.newImport(model, contentStream);
+ // import and save FinancialTransactions
+ InputStream contentStream = IOUtils.toInputStream(contents);
+ try {
+ ImportModel<FinancialStatementImport> model = new FinancialStatementModel();
- // path, FinancialStatement
- Map<String, FinancialStatement> orderedFinancialStatements = new HashMap<>();
+ Import<FinancialStatementImport> financialStatementImports = Import.newImport(model, contentStream);
- List<FinancialStatement> rootFinancialStatements = financialStatementService.getRootFinancialStatements();
- for (FinancialStatement rootFinancialStatement : rootFinancialStatements) {
- orderedFinancialStatements.put(rootFinancialStatement.getLabel(), rootFinancialStatement);
- }
+ // path, FinancialStatement
+ Map<String, FinancialStatement> orderedFinancialStatements = new HashMap<>();
- for (FinancialStatementImport financialStatementBean : financialStatementImports) {
- Binder<FinancialStatementImport, FinancialStatement> binder = BinderFactory.newBinder(FinancialStatementImport.class, FinancialStatement.class);
- FinancialStatement financialStatement = financialStatementService.newFinancialStatement();
- binder.copyExcluding(financialStatementBean, financialStatement, FinancialStatement.PROPERTY_MASTER_FINANCIAL_STATEMENT);
+ List<FinancialStatement> rootFinancialStatements = financialStatementService.getRootFinancialStatements();
+ for (FinancialStatement rootFinancialStatement : rootFinancialStatements) {
+ orderedFinancialStatements.put(rootFinancialStatement.getLabel(), rootFinancialStatement);
+ }
- try{
- // full path to master
- String masterPath = financialStatementBean.getMasterFinancialStatement();
+ for (FinancialStatementImport financialStatementBean : financialStatementImports) {
+ Binder<FinancialStatementImport, FinancialStatement> binder = BinderFactory.newBinder(FinancialStatementImport.class, FinancialStatement.class);
+ FinancialStatement financialStatement = financialStatementService.newFinancialStatement();
+ binder.copyExcluding(financialStatementBean, financialStatement, FinancialStatement.PROPERTY_MASTER_FINANCIAL_STATEMENT);
- if (StringUtils.isBlank(masterPath)) {
- // case of financialStatement is root
- // look if root exists
- // It can not have several FinancialStatement with the same from same path
- FinancialStatement rootFinancialStatement = orderedFinancialStatements.get(financialStatementBean.getLabel());
+ try{
+ // full path to master
+ String masterPath = financialStatementBean.getMasterFinancialStatement();
- if (rootFinancialStatement == null) {
- rootFinancialStatement = financialStatement;
- rootFinancialStatement = financialStatementService.createFinancialStatement(null, rootFinancialStatement);
+ if (StringUtils.isBlank(masterPath)) {
+ // case of financialStatement is root
+ // look if root exists
+ // It can not have several FinancialStatement with the same from same path
+ FinancialStatement rootFinancialStatement = orderedFinancialStatements.get(financialStatementBean.getLabel());
+
+ if (rootFinancialStatement == null) {
+ rootFinancialStatement = financialStatement;
+ rootFinancialStatement = financialStatementService.createFinancialStatement(null, rootFinancialStatement);
+ } else {
+ // in case it exist (not ordered import and previously created) values are bind to the previously created one excepted
+ // the sub financial statements
+ Binder<FinancialStatement, FinancialStatement> rootBinder = BinderFactory.newBinder(FinancialStatement.class, FinancialStatement.class);
+ rootBinder.copyExcluding(financialStatement, rootFinancialStatement, FinancialStatement.PROPERTY_SUB_FINANCIAL_STATEMENTS);
+ }
+ orderedFinancialStatements.put(rootFinancialStatement.getLabel(), rootFinancialStatement);
} else {
- // in case it exist (not ordered import and previously created) values are bind to the previously created one excepted
- // the sub financial statements
- Binder<FinancialStatement, FinancialStatement> rootBinder = BinderFactory.newBinder(FinancialStatement.class, FinancialStatement.class);
- rootBinder.copyExcluding(financialStatement, rootFinancialStatement, FinancialStatement.PROPERTY_SUB_FINANCIAL_STATEMENTS);
- }
- orderedFinancialStatements.put(rootFinancialStatement.getLabel(), rootFinancialStatement);
- } else {
- String[] masterNames = masterPath.split("/");
- String rootMasterName = masterNames[0];
+ String[] masterNames = masterPath.split("/");
+ String rootMasterName = masterNames[0];
- FinancialStatement rootFinancialStatement = orderedFinancialStatements.get(rootMasterName);
+ FinancialStatement rootFinancialStatement = orderedFinancialStatements.get(rootMasterName);
- // case of not ordered import and subFinancialStatement is looking for it's master that has not been created yet
- if (rootFinancialStatement == null) {
- rootFinancialStatement = financialStatementService.newFinancialStatement();
- rootFinancialStatement.setLabel(rootMasterName);
- rootFinancialStatement = financialStatementService.createFinancialStatement(null, rootFinancialStatement);
- orderedFinancialStatements.put(rootMasterName, rootFinancialStatement);
- }
+ // case of not ordered import and subFinancialStatement is looking for it's master that has not been created yet
+ if (rootFinancialStatement == null) {
+ rootFinancialStatement = financialStatementService.newFinancialStatement();
+ rootFinancialStatement.setLabel(rootMasterName);
+ rootFinancialStatement = financialStatementService.createFinancialStatement(null, rootFinancialStatement);
+ orderedFinancialStatements.put(rootMasterName, rootFinancialStatement);
+ }
- // explore branches to find the financialStatement's master one
- FinancialStatement branchesFinancialStatement = rootFinancialStatement;
- for (int i = 1; i < masterNames.length; i++) {// 0 is root
- String masterName = masterNames[i];
- branchesFinancialStatement = returnFinancialStatement(branchesFinancialStatement, masterName);
- }
+ // explore branches to find the financialStatement's master one
+ FinancialStatement branchesFinancialStatement = rootFinancialStatement;
+ for (int i = 1; i < masterNames.length; i++) {// 0 is root
+ String masterName = masterNames[i];
+ branchesFinancialStatement = returnFinancialStatement(branchesFinancialStatement, masterName);
+ }
- // in case it exist (not ordered import and previously created) values are bind to the previously created one excepted
- // the sub financial statements
- boolean alreadyCreated = false;
- if (branchesFinancialStatement != null && branchesFinancialStatement.getSubFinancialStatements() != null) {
- for (FinancialStatement bfs : branchesFinancialStatement.getSubFinancialStatements()) {
- if (bfs.getLabel().equals(financialStatement.getLabel())){
- Binder<FinancialStatement, FinancialStatement> rootBinder = BinderFactory.newBinder(FinancialStatement.class, FinancialStatement.class);
- rootBinder.copyExcluding(bfs, financialStatement, FinancialStatement.PROPERTY_SUB_FINANCIAL_STATEMENTS);
- alreadyCreated = true;
- break;
+ // in case it exist (not ordered import and previously created) values are bind to the previously created one excepted
+ // the sub financial statements
+ boolean alreadyCreated = false;
+ if (branchesFinancialStatement != null && branchesFinancialStatement.getSubFinancialStatements() != null) {
+ for (FinancialStatement bfs : branchesFinancialStatement.getSubFinancialStatements()) {
+ if (bfs.getLabel().equals(financialStatement.getLabel())){
+ Binder<FinancialStatement, FinancialStatement> rootBinder = BinderFactory.newBinder(FinancialStatement.class, FinancialStatement.class);
+ rootBinder.copyExcluding(bfs, financialStatement, FinancialStatement.PROPERTY_SUB_FINANCIAL_STATEMENTS);
+ alreadyCreated = true;
+ break;
+ }
}
}
- }
- // if necessary financial statement is created
- if (!alreadyCreated) {
- // if the master finacial statement has been modified then the current one is replace by the new one.
- financialStatement = financialStatementService.createFinancialStatement(branchesFinancialStatement, financialStatement);
- FinancialStatement targetedRootFinancialStatement = returnRootFinancialStatement(financialStatement);
+ // if necessary financial statement is created
+ if (!alreadyCreated) {
+ // if the master finacial statement has been modified then the current one is replace by the new one.
+ financialStatement = financialStatementService.createFinancialStatement(branchesFinancialStatement, financialStatement);
+ FinancialStatement targetedRootFinancialStatement = returnRootFinancialStatement(financialStatement);
- // replace modified root financial statement with new one
- if (orderedFinancialStatements.get(targetedRootFinancialStatement.getLabel()) != null) {
- orderedFinancialStatements.put(targetedRootFinancialStatement.getLabel(), targetedRootFinancialStatement);
+ // replace modified root financial statement with new one
+ if (orderedFinancialStatements.get(targetedRootFinancialStatement.getLabel()) != null) {
+ orderedFinancialStatements.put(targetedRootFinancialStatement.getLabel(), targetedRootFinancialStatement);
+ }
}
+
}
-
+ result.increaseCreated();
+ } catch (AlreadyExistFinancialStatement | NotAllowedLabel e) {
+ result.addException(e);
}
- result.increaseCreated();
- } catch (AlreadyExistFinancialStatement | NotAllowedLabel e) {
- result.addException(e);
}
+
+ } finally {
+ IOUtils.closeQuietly(contentStream);
}
+ }
- } finally {
- IOUtils.closeQuietly(contentStream);
- }
return results;
}
@@ -474,102 +499,106 @@
ImportExportResults results = new ImportExportResults();
ImportResult result = results.createAddAndGetImportResult(VatStatement.class);
- // import and save VATStatements
- InputStream contentStream = IOUtils.toInputStream(contents);
- try {
- ImportModel<VatStatementImport> model = new VatStatementModel();
+ if (StringUtils.isBlank(contents)) {
+ result.addException(new NoDataToImportException());
+ } else {
+ // import and save VATStatements
+ InputStream contentStream = IOUtils.toInputStream(contents);
+ try {
+ ImportModel<VatStatementImport> model = new VatStatementModel();
- Import<VatStatementImport> vatStatementImports = Import.newImport(model, contentStream);
+ Import<VatStatementImport> vatStatementImports = Import.newImport(model, contentStream);
- // path, vatStatement
- Map<String, VatStatement> orderedVATStatements = new HashMap<>();
+ // path, vatStatement
+ Map<String, VatStatement> orderedVATStatements = new HashMap<>();
- List<VatStatement> rootVatStatements = vatStatementService.getRootVatStatements();
- for (VatStatement vatStatement : rootVatStatements) {
- orderedVATStatements.put(vatStatement.getLabel(), vatStatement);
- }
+ List<VatStatement> rootVatStatements = vatStatementService.getRootVatStatements();
+ for (VatStatement vatStatement : rootVatStatements) {
+ orderedVATStatements.put(vatStatement.getLabel(), vatStatement);
+ }
- for (VatStatementImport vatStatementBean : vatStatementImports) {
- Binder<VatStatementImport, VatStatement> binder = BinderFactory.newBinder(VatStatementImport.class, VatStatement.class);
- VatStatement vatStatement = vatStatementService.newVatStatement();
- binder.copyExcluding(vatStatementBean, vatStatement, VatStatement.PROPERTY_MASTER_VAT_STATEMENT);
+ for (VatStatementImport vatStatementBean : vatStatementImports) {
+ Binder<VatStatementImport, VatStatement> binder = BinderFactory.newBinder(VatStatementImport.class, VatStatement.class);
+ VatStatement vatStatement = vatStatementService.newVatStatement();
+ binder.copyExcluding(vatStatementBean, vatStatement, VatStatement.PROPERTY_MASTER_VAT_STATEMENT);
- try{
- // full path to master
- String masterPath = vatStatementBean.getMasterVatStatement();
+ try{
+ // full path to master
+ String masterPath = vatStatementBean.getMasterVatStatement();
- if (StringUtils.isBlank(masterPath)) {
- // case of vatStatement is root
- // look if root exists
- // It can not have several vatStatement with the same from same path
- VatStatement rootVATStatement = orderedVATStatements.get(vatStatementBean.getLabel());
+ if (StringUtils.isBlank(masterPath)) {
+ // case of vatStatement is root
+ // look if root exists
+ // It can not have several vatStatement with the same from same path
+ VatStatement rootVATStatement = orderedVATStatements.get(vatStatementBean.getLabel());
- if (rootVATStatement == null) {
- rootVATStatement = vatStatement;
- rootVATStatement = vatStatementService.createVatStatement(null, rootVATStatement);
+ if (rootVATStatement == null) {
+ rootVATStatement = vatStatement;
+ rootVATStatement = vatStatementService.createVatStatement(null, rootVATStatement);
+ } else {
+ // in case it exist (not ordered import and previously created) values are bind to the previously created one excepted
+ // the sub vatStatements
+ Binder<VatStatement, VatStatement> rootBinder = BinderFactory.newBinder(VatStatement.class, VatStatement.class);
+ rootBinder.copyExcluding(vatStatement, rootVATStatement, VatStatement.PROPERTY_SUB_VAT_STATEMENTS);
+ }
+ orderedVATStatements.put(rootVATStatement.getLabel(), rootVATStatement);
} else {
- // in case it exist (not ordered import and previously created) values are bind to the previously created one excepted
- // the sub vatStatements
- Binder<VatStatement, VatStatement> rootBinder = BinderFactory.newBinder(VatStatement.class, VatStatement.class);
- rootBinder.copyExcluding(vatStatement, rootVATStatement, VatStatement.PROPERTY_SUB_VAT_STATEMENTS);
- }
- orderedVATStatements.put(rootVATStatement.getLabel(), rootVATStatement);
- } else {
- String[] masterNames = masterPath.split("/");
- String rootMasterName = masterNames[0];
+ String[] masterNames = masterPath.split("/");
+ String rootMasterName = masterNames[0];
- VatStatement rootVATStatement = orderedVATStatements.get(rootMasterName);
+ VatStatement rootVATStatement = orderedVATStatements.get(rootMasterName);
- // case of not ordered import and subVATStatement is looking for it's master that has not been created yet
- if (rootVATStatement == null) {
- rootVATStatement = vatStatementService.newVatStatement();
- rootVATStatement.setLabel(rootMasterName);
- rootVATStatement = vatStatementService.createVatStatement(null, rootVATStatement);
- orderedVATStatements.put(rootMasterName, rootVATStatement);
- }
+ // case of not ordered import and subVATStatement is looking for it's master that has not been created yet
+ if (rootVATStatement == null) {
+ rootVATStatement = vatStatementService.newVatStatement();
+ rootVATStatement.setLabel(rootMasterName);
+ rootVATStatement = vatStatementService.createVatStatement(null, rootVATStatement);
+ orderedVATStatements.put(rootMasterName, rootVATStatement);
+ }
- // explore branches to find the vatStatement's master one
- VatStatement branchesVATStatement = rootVATStatement;
- for (int i = 1; i < masterNames.length; i++) {// 0 is root
- String masterName = masterNames[i];
- branchesVATStatement = returnVATStatement(branchesVATStatement, masterName);
- }
+ // explore branches to find the vatStatement's master one
+ VatStatement branchesVATStatement = rootVATStatement;
+ for (int i = 1; i < masterNames.length; i++) {// 0 is root
+ String masterName = masterNames[i];
+ branchesVATStatement = returnVATStatement(branchesVATStatement, masterName);
+ }
- // in case it exist (not ordered import and previously created) values are bind to the previously created one excepted
- // the sub vatStatements
- boolean alreadyCreated = false;
- if (branchesVATStatement != null && branchesVATStatement.getSubVatStatements() != null) {
- for (VatStatement bfs : branchesVATStatement.getSubVatStatements()) {
- if (bfs.getLabel().equals(vatStatement.getLabel())){
- Binder<VatStatement, VatStatement> rootBinder = BinderFactory.newBinder(VatStatement.class, VatStatement.class);
- rootBinder.copyExcluding(bfs, vatStatement, VatStatement.PROPERTY_SUB_VAT_STATEMENTS);
- alreadyCreated = true;
- break;
+ // in case it exist (not ordered import and previously created) values are bind to the previously created one excepted
+ // the sub vatStatements
+ boolean alreadyCreated = false;
+ if (branchesVATStatement != null && branchesVATStatement.getSubVatStatements() != null) {
+ for (VatStatement bfs : branchesVATStatement.getSubVatStatements()) {
+ if (bfs.getLabel().equals(vatStatement.getLabel())){
+ Binder<VatStatement, VatStatement> rootBinder = BinderFactory.newBinder(VatStatement.class, VatStatement.class);
+ rootBinder.copyExcluding(bfs, vatStatement, VatStatement.PROPERTY_SUB_VAT_STATEMENTS);
+ alreadyCreated = true;
+ break;
+ }
}
}
- }
- // if necessary vatStatement is created
- if (!alreadyCreated) {
- // if the master vatStatement has been modified then the current one is replace by the new one.
- vatStatement = vatStatementService.createVatStatement(branchesVATStatement, vatStatement);
- VatStatement targetedRootVATStatement = returnRootVATStatement(vatStatement);
+ // if necessary vatStatement is created
+ if (!alreadyCreated) {
+ // if the master vatStatement has been modified then the current one is replace by the new one.
+ vatStatement = vatStatementService.createVatStatement(branchesVATStatement, vatStatement);
+ VatStatement targetedRootVATStatement = returnRootVATStatement(vatStatement);
- // replace modified root vatStatement with new one
- if (orderedVATStatements.get(targetedRootVATStatement.getLabel()) != null) {
- orderedVATStatements.put(targetedRootVATStatement.getLabel(), targetedRootVATStatement);
+ // replace modified root vatStatement with new one
+ if (orderedVATStatements.get(targetedRootVATStatement.getLabel()) != null) {
+ orderedVATStatements.put(targetedRootVATStatement.getLabel(), targetedRootVATStatement);
+ }
}
+
}
-
+ result.increaseCreated();
+ } catch (AlreadyExistVatStatement | NotAllowedLabel e) {
+ result.addException(e);
}
- result.increaseCreated();
- } catch (AlreadyExistVatStatement | NotAllowedLabel e) {
- result.addException(e);
}
+
+ } finally {
+ IOUtils.closeQuietly(contentStream);
}
-
- } finally {
- IOUtils.closeQuietly(contentStream);
}
return results;
}
@@ -590,60 +619,66 @@
@Override
- public ImportExportResults importAccountFromEbp(String datas) {
+ public ImportExportResults importAccountFromEbp(String contents) {
ImportExportResults results = new ImportExportResults();
ImportResult result = results.createAddAndGetImportResult(Account.class);
- ImportModel<Account> model = new AccountEBPModel();
+ if (StringUtils.isBlank(contents)) {
+ result.addException(new NoDataToImportException());
+ } else {
+ ImportModel<Account> model = new AccountEBPModel();
+ InputStream contentStream = IOUtils.toInputStream(contents);
+ Import<Account> accounts = Import.newImport(model, contentStream);
- InputStream contentStream = IOUtils.toInputStream(datas);
- Import<Account> accounts = Import.newImport(model, contentStream);
-
- for (Account account : accounts) {
- boolean updated = false;
- try {
- updated = accountService.createOrUbdateAccount(account);
- } catch (InvalidAccountNumberException e) {
- result.addException(e);
+ for (Account account : accounts) {
+ boolean updated = false;
+ try {
+ updated = accountService.createOrUbdateAccount(account);
+ } catch (InvalidAccountNumberException | NotNumberAccountNumberException | NotAllowedLabel e) {
+ result.addException(e);
+ }
+ if (updated) {
+ result.increaseUpdated();
+ } else {
+ result.increaseCreated();
+ }
}
- if (updated) {
- result.increaseUpdated();
- } else {
- result.increaseCreated();
- }
}
return results;
}
@Override
- public ImportExportResults importEntryBookFromEbp(String datas) {
+ public ImportExportResults importEntryBookFromEbp(String contents) {
ImportExportResults results = new ImportExportResults();
ImportResult result = results.createAddAndGetImportResult(Account.class);
- ImportModel<EntryBook> model = new EntryBookEBPModel();
+ if (StringUtils.isBlank(contents)) {
+ result.addException(new NoDataToImportException());
+ } else {
+ InputStream contentStream = IOUtils.toInputStream(contents);
+ ImportModel<EntryBook> model = new EntryBookEBPModel();
+ Import<EntryBook> entryBooks = Import.newImport(model, contentStream);
- InputStream contentStream = IOUtils.toInputStream(datas);
- Import<EntryBook> entryBooks = Import.newImport(model, contentStream);
-
- for (EntryBook entryEBP : entryBooks) {
- boolean updated = entryBookService.createOrUpdateEntryBook(entryEBP);
- if (updated) {
- result.increaseUpdated();
- } else {
- result.increaseCreated();
+ for (EntryBook entryEBP : entryBooks) {
+ boolean updated = entryBookService.createOrUpdateEntryBook(entryEBP);
+ if (updated) {
+ result.increaseUpdated();
+ } else {
+ result.increaseCreated();
+ }
}
}
+
return results;
}
- protected void basicEntriesFromEBPValidation(String datas, List<FiscalPeriod> fiscalPeriods) throws ImportEbpException {
+ protected void basicEntriesFromEBPValidation(String datas, List<FiscalPeriod> fiscalPeriods) throws NoDataToImportException, NoFiscalPeriodFoundException {
if (datas.isEmpty()) {
- throw new ImportEbpException(t("lima-business.import.ebpnoentry"));
+ throw new NoDataToImportException();
}
// There are no valid fiscalPeriods -> exception
if (fiscalPeriods.isEmpty()) {
- throw new ImportEbpException(
- t("lima-business.import.nofiscalperiodopen"));
+ throw new NoFiscalPeriodFoundException();
}
}
@@ -651,18 +686,15 @@
List<EntryEBP> result = new ArrayList<>();
InputStream contentStream = null;
// convert file to bean
- try {
- contentStream = IOUtils.toInputStream(datas);
- ImportModel<EntryEBP> model = new EntryEBPModel();
- Import<EntryEBP> importedEntryEBPs = Import.newImport(model, contentStream);
- for (EntryEBP entryEBP : importedEntryEBPs) {
- result.add(entryEBP);
- }
- // sort been by date
- Collections.sort(result, new EntryEBPComparator());
- } finally {
- IOUtils.closeQuietly(contentStream);
+ contentStream = IOUtils.toInputStream(datas);
+ ImportModel<EntryEBP> model = new EntryEBPModel();
+ Import<EntryEBP> importedEntryEBPs = Import.newImport(model, contentStream);
+ for (EntryEBP entryEBP : importedEntryEBPs) {
+ result.add(entryEBP);
}
+ // sort been by date
+ Collections.sort(result, new EntryEBPComparator());
+ IOUtils.closeQuietly(contentStream);
return result;
}
@@ -684,73 +716,77 @@
}
@Override
- public ImportExportResults importEntriesFromEbp(String datas) {
+ public ImportExportResults importEntriesFromEbp(String contents) {
ImportExportResults results = new ImportExportResults();
ImportResult result = results.createAddAndGetImportResult(Account.class);
// use for logs
long before = System.currentTimeMillis();
- // Get all the valid fiscalPeriods Ordered by date.
- List<FiscalPeriod> fiscalPeriods = fiscalPeriodService.getAllUnblockedFiscalPeriodsByBeginDate();
- try {
- basicEntriesFromEBPValidation(datas, fiscalPeriods);
- } catch (ImportEbpException e) {
- result.addException(e);
- return results;
- }
+ if (StringUtils.isBlank(contents)) {
+ result.addException(new NoDataToImportException());
+ } else {
+ // Get all the valid fiscalPeriods Ordered by date.
+ List<FiscalPeriod> fiscalPeriods = fiscalPeriodService.getAllUnblockedFiscalPeriodsByBeginDate();
+ try {
+ basicEntriesFromEBPValidation(contents, fiscalPeriods);
+ } catch (NoFiscalPeriodFoundException | NoDataToImportException e) {
+ result.addException(e);
+ }
- List<Account> accounts = accountService.getAllAccounts();
- accounts = accounts == null ? new ArrayList<Account>() : accounts;
- Map<String, Account> indexedAccounts = Maps.newHashMap(Maps.uniqueIndex(accounts, GET_ACCOUNT_NUMBER));
+ List<Account> accounts = accountService.getAllAccounts();
+ accounts = accounts == null ? new ArrayList<Account>() : accounts;
+ Map<String, Account> indexedAccounts = Maps.newHashMap(Maps.uniqueIndex(accounts, GET_ACCOUNT_NUMBER));
- List<EntryBook> entryBooks = entryBookService.getAllEntryBooks();
- entryBooks = entryBooks == null ? new ArrayList<EntryBook>() : entryBooks;
- Map<String, EntryBook> indexedEntryBooks = Maps.newHashMap(Maps.uniqueIndex(entryBooks, GET_ENTRY_BOOK_CODE));
+ List<EntryBook> entryBooks = entryBookService.getAllEntryBooks();
+ entryBooks = entryBooks == null ? new ArrayList<EntryBook>() : entryBooks;
+ Map<String, EntryBook> indexedEntryBooks = Maps.newHashMap(Maps.uniqueIndex(entryBooks, GET_ENTRY_BOOK_CODE));
- List<EntryEBP> entryEBPs = loadDateOrderedEntryEBPbeans(datas);
+ List<EntryEBP> entryEBPs = loadDateOrderedEntryEBPbeans(contents);
- // For all entries loaded from the file
- // the entry is validate (checking for valide FiscalPeriod and existing Account associated to it)
- // if valid entry
- // the entry entity is created and the association with it's dependant entites (Account are FinancialTransaction) are created
- Date fiscalPeriodsBiginDate = fiscalPeriods.get(0).getBeginDate();
- Date fiscalPeriodsEndingDate = fiscalPeriods.get(fiscalPeriods.size() - 1).getEndDate();
- Map<EntryBook, Map<Date, FinancialTransaction>> entryBookFinancialTransactionByDate = getEntryBookFinancialTransactionOrderedByDate(fiscalPeriodsBiginDate, fiscalPeriodsEndingDate);
+ // For all entries loaded from the file
+ // the entry is validate (checking for valide FiscalPeriod and existing Account associated to it)
+ // if valid entry
+ // the entry entity is created and the association with it's dependant entites (Account are FinancialTransaction) are created
+ Date fiscalPeriodsBiginDate = fiscalPeriods.get(0).getBeginDate();
+ Date fiscalPeriodsEndingDate = fiscalPeriods.get(fiscalPeriods.size() - 1).getEndDate();
+ Map<EntryBook, Map<Date, FinancialTransaction>> entryBookFinancialTransactionByDate = getEntryBookFinancialTransactionOrderedByDate(fiscalPeriodsBiginDate, fiscalPeriodsEndingDate);
- for (EntryEBP entryEBP : entryEBPs) {
- Date dateEcr = entryEBP.getDatEcr();
+ for (EntryEBP entryEBP : entryEBPs) {
+ Date dateEcr = entryEBP.getDatEcr();
- // account loading
- Account account = indexedAccounts.get(entryEBP.getCompte());
+ // account loading
+ Account account = indexedAccounts.get(entryEBP.getCompte());
- if (!validEntry(result, dateEcr, fiscalPeriodsBiginDate, fiscalPeriodsEndingDate, account, entryEBP.getCompte())) {
- continue;
- }
- // create entry
- else {
- // creation of the entry
- // initialisation of this attributs
- Entry entry = createEntry(entryEBP, account);
+ if (!validEntry(result, dateEcr, fiscalPeriodsBiginDate, fiscalPeriodsEndingDate, account, entryEBP.getCompte())) {
+ continue;
+ }
+ // create entry
+ else {
+ // creation of the entry
+ // initialisation of this attributs
+ Entry entry = createEntry(entryEBP, account);
- try {
- // find financial transactions for entry period and entrybook
- addEntryToFinancialTransaction(entry, entryEBP.getJournal(), indexedEntryBooks, entryBookFinancialTransactionByDate, dateEcr);
+ try {
+ // find financial transactions for entry period and entrybook
+ addEntryToFinancialTransaction(entry, entryEBP.getJournal(), indexedEntryBooks, entryBookFinancialTransactionByDate, dateEcr);
- } catch (LockedFinancialPeriodException | LockedEntryBookException e) {
- result.addException(e);
- continue;
+ } catch (LockedFinancialPeriodException | LockedEntryBookException e) {
+ result.addException(e);
+ continue;
+ }
+
}
+ result.increaseCreated();
+ }
+ if (log.isInfoEnabled()) {
+ long after = System.currentTimeMillis();
+ log.info("Imported form EBP : " + entryEBPs.size() + " entries in "
+ + (after - before) + " ms");
}
- result.increaseCreated();
}
- if (log.isInfoEnabled()) {
- long after = System.currentTimeMillis();
- log.info("Imported form EBP : " + entryEBPs.size() + " entries in "
- + (after - before) + " ms");
- }
return results;
}
Modified: trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/TestAccountingRules.java
===================================================================
--- trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/TestAccountingRules.java 2014-08-06 11:52:03 UTC (rev 3899)
+++ trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/TestAccountingRules.java 2014-08-06 11:53:01 UTC (rev 3900)
@@ -87,7 +87,7 @@
//But not the ante periodfiscal
int unblockedFiscalPeriod = fiscalPeriodDAO.forLockedEquals(false).findAll().size();
if (unblockedFiscalPeriod > 1) {
- throw new MoreOneUnlockFiscalPeriodException(unblockedFiscalPeriod);
+ throw new MoreOneUnlockFiscalPeriodException(fiscalPeriod.getBeginDate(), fiscalPeriod.getEndDate(), fiscalPeriod.isLocked(), unblockedFiscalPeriod);
}
}
Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/ImportResult.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/ImportResult.java 2014-08-06 11:52:03 UTC (rev 3899)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/ImportResult.java 2014-08-06 11:53:01 UTC (rev 3900)
@@ -47,7 +47,7 @@
nbCreated = 0;
nbUpdated = 0;
nbIgnored = 0;
- lineIndex = 0;
+ lineIndex = 2;// line 1 s header
this.fromSource = fromSource;
}
Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/MoreOneUnlockFiscalPeriodException.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/MoreOneUnlockFiscalPeriodException.java 2014-08-06 11:52:03 UTC (rev 3899)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/MoreOneUnlockFiscalPeriodException.java 2014-08-06 11:53:01 UTC (rev 3900)
@@ -22,23 +22,39 @@
* #L%
*/
+import java.util.Date;
+
/**
* @author Sylvain Bavencoff <bavencoff(a)codelutin.com>
*/
public class MoreOneUnlockFiscalPeriodException extends LimaException {
- int countUnlockFiscalPeriod;
+ Date beginDate;
+ Date endDate;
+ Boolean isLocked;
+ long countUnlockFiscalPeriod;
- public MoreOneUnlockFiscalPeriodException(int countUnlockFiscalPeriod) {
+ public MoreOneUnlockFiscalPeriodException(Date beginDate, Date endDate, Boolean isLocked, long countUnlockFiscalPeriod) {
+ this.beginDate = beginDate;
+ this.endDate = endDate;
+ this.isLocked = isLocked;
this.countUnlockFiscalPeriod = countUnlockFiscalPeriod;
+
}
- public MoreOneUnlockFiscalPeriodException(int countUnlockFiscalPeriod, Throwable cause) {
- super(cause);
- this.countUnlockFiscalPeriod = countUnlockFiscalPeriod;
+ public Date getBeginDate() {
+ return beginDate;
}
- public int getCountUnlockFiscalPeriod() {
+ public Date getEndDate() {
+ return endDate;
+ }
+
+ public Boolean getIsLocked() {
+ return isLocked;
+ }
+
+ public long getCountUnlockFiscalPeriod() {
return countUnlockFiscalPeriod;
}
}
Added: trunk/lima-business-api/src/main/java/org/chorem/lima/business/NoDataToImportException.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/NoDataToImportException.java (rev 0)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/NoDataToImportException.java 2014-08-06 11:53:01 UTC (rev 3900)
@@ -0,0 +1,7 @@
+package org.chorem.lima.business;
+
+/**
+ * Created by davidcosse on 06/08/14.
+ */
+public class NoDataToImportException extends LimaException {
+}
Added: trunk/lima-business-api/src/main/java/org/chorem/lima/business/NoFiscalPeriodFoundException.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/NoFiscalPeriodFoundException.java (rev 0)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/NoFiscalPeriodFoundException.java 2014-08-06 11:53:01 UTC (rev 3900)
@@ -0,0 +1,7 @@
+package org.chorem.lima.business;
+
+/**
+ * Created by davidcosse on 06/08/14.
+ */
+public class NoFiscalPeriodFoundException extends LimaException {
+}
Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/NotNumberAccountNumberException.java (from rev 3897, trunk/lima-business-api/src/main/java/org/chorem/lima/business/InvalidAccountNumberException.java)
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/NotNumberAccountNumberException.java (rev 0)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/NotNumberAccountNumberException.java 2014-08-06 11:53:01 UTC (rev 3900)
@@ -0,0 +1,19 @@
+package org.chorem.lima.business;
+
+/**
+ * @author Sylvain Bavencoff <bavencoff(a)codelutin.com>
+ */
+public class NotNumberAccountNumberException extends AccountException {
+
+ public NotNumberAccountNumberException(String accountNumber) {
+ super(accountNumber);
+ }
+
+ public NotNumberAccountNumberException(String accountNumber, String message) {
+ super(accountNumber, message);
+ }
+
+ public NotNumberAccountNumberException(String accountNumber, Throwable cause) {
+ super(accountNumber, cause);
+ }
+}
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-08-06 11:52:03 UTC (rev 3899)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/AccountService.java 2014-08-06 11:53:01 UTC (rev 3900)
@@ -28,6 +28,8 @@
import org.chorem.lima.business.AlreadyExistAccountException;
import org.chorem.lima.business.InvalidAccountNumberException;
import org.chorem.lima.business.LimaException;
+import org.chorem.lima.business.NotAllowedLabel;
+import org.chorem.lima.business.NotNumberAccountNumberException;
import org.chorem.lima.business.UsedAccountException;
import org.chorem.lima.entity.Account;
@@ -92,7 +94,7 @@
* @return true if updated or false if created
* @throws InvalidAccountNumberException
*/
- boolean createOrUbdateAccount(Account account) throws InvalidAccountNumberException;
+ boolean createOrUbdateAccount(Account account) throws InvalidAccountNumberException, NotNumberAccountNumberException, NotAllowedLabel;
/**
* Create new account. If {@code masterAccount} is not null, {@code account}
@@ -101,9 +103,9 @@
* @param account account
* @throws LimaException
*/
- Account createAccount(Account account) throws AlreadyExistAccountException, InvalidAccountNumberException;
+ Account createAccount(Account account) throws AlreadyExistAccountException, InvalidAccountNumberException, NotNumberAccountNumberException, NotAllowedLabel;
- Account updateAccount(Account account) throws InvalidAccountNumberException;
+ Account updateAccount(Account account) throws InvalidAccountNumberException, NotNumberAccountNumberException;
void removeAccount(Account account) throws UsedAccountException;
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-06 11:52:03 UTC (rev 3899)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FiscalPeriodService.java 2014-08-06 11:53:01 UTC (rev 3900)
@@ -35,7 +35,9 @@
import org.chorem.lima.business.MoreOneUnlockFiscalPeriodException;
import org.chorem.lima.business.NoEmptyFiscalPeriodException;
import org.chorem.lima.business.NoFoundFinancialPeriodException;
+import org.chorem.lima.business.NotAllowedLabel;
import org.chorem.lima.business.NotBeginNextDayOfLastFiscalPeriodException;
+import org.chorem.lima.business.NotNumberAccountNumberException;
import org.chorem.lima.entity.EntryBook;
import org.chorem.lima.entity.FiscalPeriod;
@@ -88,7 +90,7 @@
LastUnlockedFiscalPeriodException,
AlreadyLockedFiscalPeriodException,
AlreadyExistAccountException,
- InvalidAccountNumberException;
+ InvalidAccountNumberException, NotNumberAccountNumberException, NotAllowedLabel;
/**
* Test if we have retained earnings on a fiscal period
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountViewHandler.java 2014-08-06 11:52:03 UTC (rev 3899)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountViewHandler.java 2014-08-06 11:53:01 UTC (rev 3900)
@@ -30,6 +30,8 @@
import org.chorem.lima.LimaConfig;
import org.chorem.lima.business.AlreadyExistAccountException;
import org.chorem.lima.business.InvalidAccountNumberException;
+import org.chorem.lima.business.NotAllowedLabel;
+import org.chorem.lima.business.NotNumberAccountNumberException;
import org.chorem.lima.business.ServiceListener;
import org.chorem.lima.business.UsedAccountException;
import org.chorem.lima.business.api.AccountService;
@@ -275,6 +277,10 @@
errorHelper.showErrorMessage(t("lima.ui.account.add.error.alreadyExist", e.getAccountNumber()));
} catch (InvalidAccountNumberException e) {
errorHelper.showErrorMessage(t("lima.ui.account.add.error.InvalidAccountNumber", e.getAccountNumber()));
+ } catch (NotNumberAccountNumberException e) {
+ errorHelper.showErrorMessage(t("lima.fiscalPeriod.franceAccountingRules.notNumberAccountNumberException", e.getAccountNumber()));
+ } catch (NotAllowedLabel e) {
+ errorHelper.showErrorMessage(t("lima.all.notAllowedLabel", e.getLabel()));
} finally {
dialog.dispose();
}
@@ -381,6 +387,8 @@
} catch (InvalidAccountNumberException e) {
errorHelper.showErrorMessage(t("lima.ui.account.update.error.invalidAccountNumber", e.getAccountNumber()));
+ } catch (NotNumberAccountNumberException e) {
+ errorHelper.showErrorMessage(t("lima.fiscalPeriod.franceAccountingRules.notNumberAccountNumberException", e.getAccountNumber()));
} finally {
// close dialog
dialog.dispose();
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java 2014-08-06 11:52:03 UTC (rev 3899)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java 2014-08-06 11:53:01 UTC (rev 3900)
@@ -33,10 +33,22 @@
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.ImportBackupException;
import org.chorem.lima.LimaTechnicalException;
+import org.chorem.lima.business.AlreadyExistFinancialStatement;
+import org.chorem.lima.business.AlreadyExistVatStatement;
+import org.chorem.lima.business.BeginAfterEndFiscalPeriodException;
import org.chorem.lima.business.ExportResult;
import org.chorem.lima.business.ImportExportResults;
import org.chorem.lima.business.ImportResult;
+import org.chorem.lima.business.InvalidAccountNumberException;
import org.chorem.lima.business.LimaException;
+import org.chorem.lima.business.LockedEntryBookException;
+import org.chorem.lima.business.LockedFinancialPeriodException;
+import org.chorem.lima.business.MoreOneUnlockFiscalPeriodException;
+import org.chorem.lima.business.NoDataToImportException;
+import org.chorem.lima.business.NoFiscalPeriodFoundException;
+import org.chorem.lima.business.NotAllowedLabel;
+import org.chorem.lima.business.NotBeginNextDayOfLastFiscalPeriodException;
+import org.chorem.lima.business.NotNumberAccountNumberException;
import org.chorem.lima.business.api.ExportService;
import org.chorem.lima.business.api.ImportService;
import org.chorem.lima.entity.Account;
@@ -65,6 +77,7 @@
import java.nio.charset.Charset;
import java.rmi.server.ExportException;
import java.text.SimpleDateFormat;
+import java.util.Collection;
import java.util.Date;
import java.util.List;
import java.util.Map;
@@ -262,13 +275,18 @@
log.debug(importedEntity + " nbCreated: " + result.getNbCreated());
log.debug(importedEntity + " nbUpdated: " + result.getNbUpdated());
log.debug(importedEntity + " nbIgnored: " + result.getNbIgnored());
+ Collection<LimaException> exceptions = result.getAllExceptionsByLine().values();
+ for (LimaException exception : exceptions) {
+ log.warn(exception.getCause());
+ log.warn(exception.getStackTrace());
+ }
}
}
if (log.isDebugEnabled()) {
log.debug("import.terminated");
}
- String message = "";
+ String message = t("lima.ui.importexport.import.terminated")+"\n";
for (ImportResult result : resultList) {
Class fromSource = result.getFromSource();
message += "Import " + getFromSourceMessage(fromSource);
@@ -276,18 +294,7 @@
message += t("lima.ui.importexport.import.nbUpdated", result.getNbUpdated())+"\n";
message += t("lima.ui.importexport.import.nbIgnored", result.getNbIgnored())+"\n";
Map<Integer, LimaException> exceptionsByLine = result.getAllExceptionsByLine();
- if (exceptionsByLine != null) {
- Set<Integer> lines = exceptionsByLine.keySet();
- for (Integer line : lines) {
- LimaException importException = exceptionsByLine.get(line);
- message += t("lima.ui.importexport.import.exceptions", (line +1))+"\n";
- // TODO DCossé 05/08/14 display reason
- //message += t("lima.ui.importexport.import.exceptions.reason", importException.getMessage()) +"\n";
- if (log.isErrorEnabled()) {
- log.error(importException.getMessage());
- }
- }
- }
+ message = displayErrorMessage(message, exceptionsByLine);
message +="\n";
}
@@ -345,6 +352,48 @@
}
}
+ private String displayErrorMessage(String message, Map<Integer, LimaException> exceptionsByLine) {
+ if (exceptionsByLine != null) {
+ Set<Integer> lines = exceptionsByLine.keySet();
+ for (Integer line : lines) {
+ LimaException importException = exceptionsByLine.get(line);
+ message += t("lima.ui.importexport.import.ligne", line);
+ if (importException instanceof InvalidAccountNumberException) {
+ message += t("lima.fiscalPeriod.franceAccountingRules.invalidAccountNumberException", ((InvalidAccountNumberException) importException).getAccountNumber())+"\n";
+ } else if (importException instanceof NotNumberAccountNumberException) {
+ message += t("lima.fiscalPeriod.franceAccountingRules.notNumberAccountNumberException", ((NotNumberAccountNumberException) importException).getAccountNumber())+"\n";
+ } else if (importException instanceof NotAllowedLabel) {
+ message += t("lima.all.NotAllowedLabel", ((NotAllowedLabel) importException).getLabel())+"\n";
+ } else if (importException instanceof MoreOneUnlockFiscalPeriodException) {
+ message += t("lima.fiscalPeriod.franceAccountingRules.moreOneUnlockFiscalPeriodException", ((MoreOneUnlockFiscalPeriodException) importException).getBeginDate(), ((MoreOneUnlockFiscalPeriodException) importException).getEndDate())+"\n";
+ } else if (importException instanceof BeginAfterEndFiscalPeriodException) {
+ message += t("lima.fiscalPeriod.defaultAccountingRules.beginAfterEndFiscalPeriodException", ((BeginAfterEndFiscalPeriodException) importException).getFiscalPeriod().getBeginDate(), ((BeginAfterEndFiscalPeriodException) importException).getFiscalPeriod().getEndDate())+"\n";
+ } else if (importException instanceof NotBeginNextDayOfLastFiscalPeriodException) {
+ message += t("lima.fiscalPeriod.franceAccountingRules.notBeginNextDayOfLastFiscalPeriodException", ((NotBeginNextDayOfLastFiscalPeriodException) importException).getFiscalPeriod().getBeginDate(), ((NotBeginNextDayOfLastFiscalPeriodException) importException).getFiscalPeriod().getEndDate())+"\n";
+ } else if (importException instanceof LockedFinancialPeriodException) {
+ message += t("lima.financialTransaction.lockedFinancialPeriodException")+"\n";
+ } else if (importException instanceof LockedEntryBookException) {
+ message += t("lima.financialTransaction.lockedEntryBookException", ((LockedEntryBookException) importException).getClosedPeriodicEntryBook().getFinancialPeriod().getBeginDate(), ((LockedEntryBookException) importException).getClosedPeriodicEntryBook().getFinancialPeriod().getEndDate())+"\n";
+ } else if (importException instanceof AlreadyExistFinancialStatement) {
+ message += t("lima.financialStatement.alreadyExistFinancialStatement", ((AlreadyExistFinancialStatement) importException).getFinancialStatementLabel())+"\n";
+ } else if (importException instanceof AlreadyExistVatStatement) {
+ message += t("lima.vatStatement.alreadyExistVatStatement", ((AlreadyExistVatStatement) importException).getVatStatementLabel())+"\n";
+ } else if (importException instanceof NoFiscalPeriodFoundException) {
+ message += t("lima.import.entries.noFiscalPeriodFoundException")+"\n";
+ } else if (importException instanceof NoDataToImportException) {
+ message += t("lima.import.noDataToImportException")+"\n";
+ } else {
+
+ }
+ //message += t("lima.ui.importexport.import.exceptions", (line))+"\n";
+ if (log.isErrorEnabled()) {
+ log.error(importException.getMessage());
+ }
+ }
+ }
+ return message;
+ }
+
private String getFromSourceMessage(Class fromSource) {
String message;
if (fromSource.equals(Account.class)){
Modified: trunk/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties
===================================================================
--- trunk/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties 2014-08-06 11:52:03 UTC (rev 3899)
+++ trunk/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties 2014-08-06 11:53:01 UTC (rev 3900)
@@ -17,6 +17,8 @@
lima.accounts.plan=
lima.accountsreports.listerror=Can't get entries list
lima.action.commandline.help=Show help in console
+lima.all.NotAllowedLabel=
+lima.all.notAllowedLabel=Not allowed char "\\" found in account name %s.
lima.balance.documentcreationerror=Enable to create document
lima.balance.documentcreationfiscalerror=Can't create document on an open fiscal year
lima.balance.listerror=Can't get entries list
@@ -49,6 +51,8 @@
lima.charts.vatstatement.nothing=No vat statement chart
lima.charts.vatstatement.question.remove=Do you really want to delete this line ?
lima.charts.vatstatement.shortened=Shortened vat statement chart
+lima.closedPeriodicEntryBook.franceAccountingRules.unbalancedFinancialTransactionsException=Fiscal Period has unbalanced transactions.
+lima.closedPeriodicEntryBook.franceAccountingRules.withoutEntryBookFinancialTransactionsException=Can't block financialperiod / missing EntryBook in transactions
lima.common.account=Account
lima.common.amount=Amount
lima.common.amountcredit=Credit amount
@@ -250,10 +254,13 @@
lima.filter.letter=
lima.filter.voucher=
lima.financialPeriods=
+lima.financialStatement.alreadyExistFinancialStatement=FAILED \: The financial statement %s already exists \!
lima.financialStatements=
lima.financialStatements.check=
lima.financialStatements.check.nothing=
lima.financialStatements.check.warn=
+lima.financialTransaction.lockedEntryBookException=Entry can not be added as entry book is locked for period from %1$tm/%1$te/%1$tY to %1$tm/%1$te/%1$tY.
+lima.financialTransaction.lockedFinancialPeriodException=locked financial transaction
lima.financialstatement.accounts=Account list on debit and on credit
lima.financialstatement.addfinancialStatementHeadererror=Can't add financialStatementHeader
lima.financialstatement.check=Check accounts passing to movement
@@ -268,6 +275,13 @@
lima.financialstatement.provisiondeprecationaccounts=Provisions and deprecations accounts list
lima.financialstatement.subamount=Calculate a subamount
lima.financialstatementreport.listerror=Can't get entries list
+lima.fiscalPeriod.defaultAccountingRules.beginAfterEndFiscalPeriodException=Fiscal period ending date must be after the begining one, begin\: %1$tm/%1$te/%1$tY end\: %1$tm/%1$te/%1$tY.
+lima.fiscalPeriod.franceAccountingRules.invalidAccountNumberException=Master account is not a digit between 1 to 8 \: %s" + account.getAccountNumber()
+lima.fiscalPeriod.franceAccountingRules.lastUnlockedFiscalPeriodException=Current fiscal period must not be closed.
+lima.fiscalPeriod.franceAccountingRules.moreOneUnlockFiscalPeriodException=The ante fiscal period is not locked\: concerned fiscal period from %1$tm/%1$te/%1$tY to %1$tm/%1$te/%1$tY.
+lima.fiscalPeriod.franceAccountingRules.noEmptyFiscalPeriodException=The fiscal period is not empty \!
+lima.fiscalPeriod.franceAccountingRules.notBeginNextDayOfLastFiscalPeriodException=The new fiscal period must adjoining the last\: concerned fiscal period from %1$tm/%1$te/%1$tY to %1$tm/%1$te/%1$tY.
+lima.fiscalPeriod.franceAccountingRules.notNumberAccountNumberException=Account Number that doesn't start with 4 have to be numeric\: %s" + account.getAccountNumber()
lima.fiscalYears=
lima.fiscalperiod.unbalancedtransactions=Fiscal Period has unbalanced transactions
lima.help=
@@ -343,6 +357,9 @@
lima.identity.phoneNumber=Phone number
lima.identity.vatNumber=VAT number
lima.identity.zipCode=Zip code
+lima.import.entries.noFiscalPeriodFoundException=No fiscal period found.
+lima.import.noDataToImportException=No data to import.
+lima.import.unknownError=Unknown error.
lima.importexport.all=
lima.importexport.choiceencoding=
lima.importexport.csv=
@@ -598,9 +615,7 @@
lima.ui.importexport.fiscalPeriod=Fiscal periods import completed.
lima.ui.importexport.identity=Identity import completed.
lima.ui.importexport.import=
-lima.ui.importexport.import.exception=
-lima.ui.importexport.import.exceptions=The line %d could not be imported.
-lima.ui.importexport.import.exceptions.reason=Reason\:%
+lima.ui.importexport.import.ligne=Line %d
lima.ui.importexport.import.nbCreated=%d created
lima.ui.importexport.import.nbIgnored=%d ignored
lima.ui.importexport.import.nbUpdated=%d updated
@@ -655,6 +670,7 @@
lima.ui.table.cell.comportmentEditingCell=
lima.ui.table.cell.selectAllEditingCell=
lima.ui.vatStatements=
+lima.vatStatement.alreadyExistVatStatement=FAILED \: The vatStatement %s already exists \!
lima.vatStatements=
lima.vatreport.listerror=Can't get entries list
lima.vatstatement.accounts=List of accounts
Modified: trunk/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties
===================================================================
--- trunk/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties 2014-08-06 11:52:03 UTC (rev 3899)
+++ trunk/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties 2014-08-06 11:53:01 UTC (rev 3900)
@@ -6,6 +6,8 @@
lima.accounts.plan=Plan comptable
lima.accountsreports.listerror=Erreur lors de la récupération des données de la liste
lima.action.commandline.help=Afficher l'aide en console
+lima.all.NotAllowedLabel=
+lima.all.notAllowedLabel=Le caractère "\\" n'est pas authorisé, trouvé sur le compte %s.
lima.balance.documentcreationerror=Erreur lors de la création du document
lima.balance.documentcreationfiscalerror=Impossible de créer le document quand la période fiscale est ouverte
lima.balance.listerror=Erreur lors de la récupération des données de la liste
@@ -38,6 +40,8 @@
lima.charts.vatstatement.nothing=<html><center>Aucun plan TVA chargé<br/>Veuillez sélectionner un plan par défaut, <br/>importer un plan personnalisé<br/> ou annuler pour créer votre propre plan.</center></html>
lima.charts.vatstatement.question.remove=Etes vous sur de vouloir supprimer cette ligne ?
lima.charts.vatstatement.shortened=Plan TVA abrégé
+lima.closedPeriodicEntryBook.franceAccountingRules.unbalancedFinancialTransactionsException=Impossible de bloquer la période financière / le journal, il contient des transactions non équilibrées.
+lima.closedPeriodicEntryBook.franceAccountingRules.withoutEntryBookFinancialTransactionsException=Impossible de bloquer la période financière / il manque un journal dans une transaction (%1$te/%1$tm/%1$tY)
lima.common.account=Compte
lima.common.amount=Montant
lima.common.amountcredit=Total Crédit
@@ -233,10 +237,13 @@
lima.filter.letter=Ajouter un filtre sur les lettres
lima.filter.voucher=Ajouter un filtre sur les pièces comptables
lima.financialPeriods=Périodes comptables
+lima.financialStatement.alreadyExistFinancialStatement=u00C9chec \: Le mouvement %s exist déjà \!
lima.financialStatements=Plan BCR
lima.financialStatements.check=Vérification des comptes aux postes
lima.financialStatements.check.nothing=Introuvable \: %s - %s \n
lima.financialStatements.check.warn=Attention cette fonctionnalité n'est qu'une aide utilisateur.\n Certains comptes ne doivent pas être présent au bilan et compte de résultat.\n Il est donc normal que des comptes sont marqués comme introuvable.\n\n
+lima.financialTransaction.lockedEntryBookException=Impossible d'ajouter une entré car le jounal %2$s (%1$s) est cloturé pour la période du %3$te %3$tB %3$tY au %4$te %4$tB %4$tY.
+lima.financialTransaction.lockedFinancialPeriodException=La période financière est bloquée
lima.financialstatement.accounts=Liste de comptes au crédit et au débit
lima.financialstatement.addfinancialStatementHeadererror=Erreur lors de l'ajout de l'entête sur la déclaration financière
lima.financialstatement.check=
@@ -251,6 +258,13 @@
lima.financialstatement.provisiondeprecationaccounts=Liste de comptes d'amortissement et provisions
lima.financialstatement.subamount=Calculer un sous-total
lima.financialstatementreport.listerror=Erreur lors de la récupération des données de la liste
+lima.fiscalPeriod.defaultAccountingRules.beginAfterEndFiscalPeriodException=La date de début doit être avant la date de fin, debut\: %1$te/%1$tm/%1$tY fin\: %1$te/%1$tm/%1$tY.
+lima.fiscalPeriod.franceAccountingRules.invalidAccountNumberException=Le numéro du compte général n'est pas compris entre 1 et 8 \: %s
+lima.fiscalPeriod.franceAccountingRules.lastUnlockedFiscalPeriodException=Impossible de clore la dernière période fiscale ouverte.
+lima.fiscalPeriod.franceAccountingRules.moreOneUnlockFiscalPeriodException=Le nombre maximal d'exercices ouverts est déjà ateint\: periode fiscale concernée du %1$te/%1$tm/%1$tY au %1$te/%1$tm/%1$tY.
+lima.fiscalPeriod.franceAccountingRules.noEmptyFiscalPeriodException=La période fiscale à supprimer n'est pas vide \!
+lima.fiscalPeriod.franceAccountingRules.notBeginNextDayOfLastFiscalPeriodException=La nouvelle période fiscale doit suivre la précédente\: periode fiscale concernée du %1$te/%1$tm/%1$tY au %1$te/%1$tm/%1$tY.
+lima.fiscalPeriod.franceAccountingRules.notNumberAccountNumberException=Un numéro de compte ne commençant pas par 4 doit être numérique \: %s
lima.fiscalYears=Exercices
lima.fiscalperiod.unbalancedtransactions=La période fiscale contient des transactions non équilibrées
lima.help=Aide
@@ -301,6 +315,9 @@
lima.identity.phoneNumber=n° Tel
lima.identity.vatNumber=n° TVA
lima.identity.zipCode=Code Postal
+lima.import.entries.noFiscalPeriodFoundException=Aucune periode fiscale trouvée.
+lima.import.noDataToImportException=Aucune donnée à importer.
+lima.import.unknownError=Erreur inconnue.
lima.importexport.all=Tout
lima.importexport.choiceencoding=Choix de l'encodage
lima.importexport.csv=Import/Export CSV
@@ -517,8 +534,7 @@
lima.ui.importexport.identity=de l'identité terminé.
lima.ui.importexport.import=Importer
lima.ui.importexport.import.action=Import
-lima.ui.importexport.import.exceptions=La ligne %d n'a pu être impotée.
-lima.ui.importexport.import.exceptions.reason=Raison\:
+lima.ui.importexport.import.ligne=Ligne %d
lima.ui.importexport.import.nbCreated=%d créés
lima.ui.importexport.import.nbIgnored=%d ignorés
lima.ui.importexport.import.nbUpdated=%d mis à jours
@@ -567,6 +583,7 @@
lima.ui.opening.title=Initialisation
lima.ui.opening.welcome=<html><center>Bienvenue dans Lima<br/>Laissez vous guider par cet assistant pour démarrer votre comptabilité en quelques instants
<br/>Ou bien importer directement une ancienne sauvegarde de LIMA au format CSV<br/><br/><br/><br/></center></html>
lima.ui.retainedEarnings.wait=Report à nouveaux...
+lima.vatStatement.alreadyExistVatStatement=u00C9chec \: Le plan %s exist déjà \!
lima.vatStatements=Plan TVA
lima.vatreport.listerror=Erreur lors de la récupération des données de la liste
lima.vatstatement.accounts=Liste des comptes
1
0
r3899 - trunk/lima-business/src/main/java/org/chorem/lima/business/migration
by dcosse@users.chorem.org 06 Aug '14
by dcosse@users.chorem.org 06 Aug '14
06 Aug '14
Author: dcosse
Date: 2014-08-06 13:52:03 +0200 (Wed, 06 Aug 2014)
New Revision: 3899
Url: http://forge.chorem.org/projects/lima/repository/revisions/3899
Log:
refs #1033 Le service de migration est ?\195?\160 mettre ?\195?\160 jour
Modified:
trunk/lima-business/src/main/java/org/chorem/lima/business/migration/DatabaseMigrationClass.java
trunk/lima-business/src/main/java/org/chorem/lima/business/migration/MigrationV0V0_5.java
trunk/lima-business/src/main/java/org/chorem/lima/business/migration/MigrationV0_6.java
trunk/lima-business/src/main/java/org/chorem/lima/business/migration/MigrationV0_8.java
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/migration/DatabaseMigrationClass.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/migration/DatabaseMigrationClass.java 2014-08-05 16:06:37 UTC (rev 3898)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/migration/DatabaseMigrationClass.java 2014-08-06 11:52:03 UTC (rev 3899)
@@ -25,16 +25,17 @@
package org.chorem.lima.business.migration;
import org.nuiton.topia.migration.TopiaMigrationCallbackByClassNG;
-import org.nuiton.util.Version;
+import org.nuiton.util.version.Version;
import java.util.List;
import java.util.Set;
+// TODO DCossé 06/08/14 revoire le service de migration
public class DatabaseMigrationClass extends TopiaMigrationCallbackByClassNG {
- protected static final Version VERSION_0_5 = new Version("0.5");
- protected static final Version VERSION_0_6 = new Version("0.6");
- protected static final Version VERSION_0_8 = new Version("0.8");
+// protected static final Version VERSION_0_5 = new Version("0.5");
+// protected static final Version VERSION_0_6 = new Version("0.6");
+// protected static final Version VERSION_0_8 = new Version("0.8");
public DatabaseMigrationClass() {
super(new MigrationResolver());
@@ -57,13 +58,14 @@
public MigrationCallBackForVersion getCallBack(Version version) {
MigrationCallBackForVersion result = null;
- if (version.equals(VERSION_0_5)) {
- result = new MigrationV0V0_5();
- } else if (version.equals(VERSION_0_6)) {
- result = new MigrationV0_6();
- } else if (version.equals(VERSION_0_8)) {
- result = new MigrationV0_8();
- }
+ // TODO DCossé 06/08/14 revoire le service de migration
+// if (version.equals(VERSION_0_5)) {
+// result = new MigrationV0V0_5();
+// } else if (version.equals(VERSION_0_6)) {
+// result = new MigrationV0_6();
+// } else if (version.equals(VERSION_0_8)) {
+// result = new MigrationV0_8();
+// }
return result;
}
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/migration/MigrationV0V0_5.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/migration/MigrationV0V0_5.java 2014-08-05 16:06:37 UTC (rev 3898)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/migration/MigrationV0V0_5.java 2014-08-06 11:52:03 UTC (rev 3899)
@@ -27,7 +27,7 @@
import org.nuiton.topia.migration.TopiaMigrationCallbackByClassNG.MigrationCallBackForVersion;
import org.nuiton.topia.persistence.TopiaException;
import org.nuiton.topia.persistence.support.TopiaSqlSupport;
-import org.nuiton.util.Version;
+import org.nuiton.util.version.Version;
import java.util.List;
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/migration/MigrationV0_6.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/migration/MigrationV0_6.java 2014-08-05 16:06:37 UTC (rev 3898)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/migration/MigrationV0_6.java 2014-08-06 11:52:03 UTC (rev 3899)
@@ -30,7 +30,7 @@
import org.nuiton.topia.migration.TopiaMigrationCallbackByClassNG;
import org.nuiton.topia.persistence.TopiaException;
import org.nuiton.topia.persistence.support.TopiaSqlSupport;
-import org.nuiton.util.Version;
+import org.nuiton.util.version.Version;
import java.util.List;
@@ -86,4 +86,5 @@
public Version getVersion() {
return null;
}
+
}
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/migration/MigrationV0_8.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/migration/MigrationV0_8.java 2014-08-05 16:06:37 UTC (rev 3898)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/migration/MigrationV0_8.java 2014-08-06 11:52:03 UTC (rev 3899)
@@ -27,7 +27,7 @@
import org.nuiton.topia.migration.TopiaMigrationCallbackByClassNG;
import org.nuiton.topia.persistence.TopiaException;
import org.nuiton.topia.persistence.support.TopiaSqlSupport;
-import org.nuiton.util.Version;
+import org.nuiton.util.version.Version;
import java.util.List;
1
0
r3898 - trunk/lima-business/src/test/java/org/chorem/lima/business
by dcosse@users.chorem.org 05 Aug '14
by dcosse@users.chorem.org 05 Aug '14
05 Aug '14
Author: dcosse
Date: 2014-08-05 18:06:37 +0200 (Tue, 05 Aug 2014)
New Revision: 3898
Url: http://forge.chorem.org/projects/lima/repository/revisions/3898
Log:
refs #1032 correction des tests
Modified:
trunk/lima-business/src/test/java/org/chorem/lima/business/ImportExportServiceTest.java
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-05 15:56:52 UTC (rev 3897)
+++ trunk/lima-business/src/test/java/org/chorem/lima/business/ImportExportServiceTest.java 2014-08-05 16:06:37 UTC (rev 3898)
@@ -89,7 +89,7 @@
// make sure all account have been created
Assert.assertEquals(nbEntities, accountService.getAllAccounts().size());
Assert.assertEquals(nbEntities, result.getImportResults().get(0).getNbCreated());
- Assert.assertTrue(result.getImportResults().get(0).getAllExceptionsByLine().isEmpty());
+ Assert.assertNull(result.getImportResults().get(0).getAllExceptionsByLine());
} finally {
IOUtils.closeQuietly(contentStream);
}
@@ -127,7 +127,7 @@
Assert.assertEquals(nbEntities, entryBookService.getAllEntryBooks().size());
Assert.assertEquals(nbEntities, result.getNbCreated());
- Assert.assertTrue(result.getAllExceptionsByLine().isEmpty());
+ Assert.assertNull(result.getAllExceptionsByLine());
}
@Test
@@ -185,7 +185,7 @@
Assert.assertEquals(nbEntities, entries.size());
Assert.assertEquals(nbEntities, result.getNbCreated());
- Assert.assertTrue(result.getAllExceptionsByLine().isEmpty());
+ Assert.assertNull(result.getAllExceptionsByLine());
}
@Test
@@ -218,7 +218,7 @@
Assert.assertEquals(nbFiscalPeriods, fiscalPeriodService.getAllFiscalPeriods().size());
Assert.assertEquals(nbFiscalPeriods, result.getNbCreated());
- Assert.assertTrue(result.getAllExceptionsByLine().isEmpty());
+ Assert.assertNull(result.getAllExceptionsByLine());
}
// @Test
@@ -248,7 +248,7 @@
// ImportResult importResult = importResults.get(i);
// log.info(imported[i] +": created:"+importResult.getNbCreated() + " updated:" + importResult.getNbUpdated() + " ignoded:" + importResult.getNbIgnored());
// Assert.assertTrue(importResult.getNbCreated()>0);
-// Assert.assertTrue(importResult.getAllExceptionsByLine().isEmpty());
+// Assert.assertNull(importResult.getAllExceptionsByLine());
// }
// }
@@ -351,7 +351,7 @@
result = importService.importFinancialStatementsAsCSV(bcr_developed).getImportResults().get(0);
- Assert.assertTrue(result.getAllExceptionsByLine().isEmpty());
+ Assert.assertNull(result.getAllExceptionsByLine());
Assert.assertEquals(162, result.getNbCreated());
Assert.assertEquals(162, financialStatementService.getAllFinancialStatements().size());
FinancialStatement actifImmobiliseStatement = financialStatementService.getFinancialStatementByLabel("ACTIF IMMOBILISÉ");
@@ -372,7 +372,7 @@
result = importService.importVATStatementsAsCSV(bcr_developed).getImportResults().get(0);
- Assert.assertTrue(result.getAllExceptionsByLine().isEmpty());
+ Assert.assertNull(result.getAllExceptionsByLine());
Assert.assertEquals(55, result.getNbCreated());
Assert.assertEquals(55, vatStatementService.getAllVatStatements().size());
}
@@ -411,7 +411,7 @@
InputStream entriesStream = ImportExportServiceTest.class.getResourceAsStream("/ebp/ecritures.txt");
String entriesData = IOUtils.toString(entriesStream, "ISO-8859-1");
ImportResult result = importService.importEntriesFromEbp(entriesData).getImportResults().get(0);
- Assert.assertTrue(result.getAllExceptionsByLine().isEmpty());
+ Assert.assertNull(result.getAllExceptionsByLine());
Assert.assertEquals(28, result.getNbCreated());
entriesStream.close();
@@ -510,7 +510,7 @@
Assert.assertEquals(nbEntities, entries.size());
Assert.assertEquals(nbEntities, result.getNbCreated());
- Assert.assertTrue(result.getAllExceptionsByLine().isEmpty());
+ Assert.assertNull(result.getAllExceptionsByLine());
for (Entry entry : entries) {
Assert.assertTrue(42.0 == entry.getAmount().doubleValue());
}
1
0
r3897 - in trunk: lima-business/src/main/java/org/chorem/lima/business/accountingrules lima-business/src/main/resources/i18n lima-business-api/src/main/java/org/chorem/lima/business lima-swing/src/main/java/org/chorem/lima/ui/importexport lima-swing/src/main/resources/i18n
by dcosse@users.chorem.org 05 Aug '14
by dcosse@users.chorem.org 05 Aug '14
05 Aug '14
Author: dcosse
Date: 2014-08-05 17:56:52 +0200 (Tue, 05 Aug 2014)
New Revision: 3897
Url: http://forge.chorem.org/projects/lima/repository/revisions/3897
Log:
refs #1032 ajout de descriptions d'erreur
Modified:
trunk/lima-business-api/src/main/java/org/chorem/lima/business/AccountException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/AlreadyExistVatStatement.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/ClosedPeriodicEntryBookException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/FinancialPeriodException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/InvalidAccountNumberException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/LockedEntryBookException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/LockedFinancialPeriodException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/NotAllowedLabel.java
trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/FranceAccountingRules.java
trunk/lima-business/src/main/resources/i18n/lima-business_fr_FR.properties
trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java
trunk/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties
trunk/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/FranceAccountingRules.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/FranceAccountingRules.java 2014-08-05 14:49:54 UTC (rev 3896)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/FranceAccountingRules.java 2014-08-05 15:56:52 UTC (rev 3897)
@@ -78,11 +78,16 @@
if (!StringUtils.isNumeric(accountNumber) && !accountNumber.startsWith("4")) {
log.warn(t("lima-business.franceaccountingrules.accountnumbernotnumeric",
account.getAccountNumber()));
+ throw new InvalidAccountNumberException(t("lima-business.franceaccountingrules.accountnumbernotnumeric",
+ account.getAccountNumber()), account.getAccountNumber());
}
// Check root account starts with 1 to 8
if (accountNumber.length() >= 1 && !accountNumber.substring(0, 1).matches("[1-8]")) {
- throw new InvalidAccountNumberException(account.getAccountNumber());
+ log.warn(t("lima-business.franceaccountingrules.accountstartnumbererror",
+ account.getAccountNumber()));
+ throw new InvalidAccountNumberException(t("lima-business.franceaccountingrules.accountstartnumbererror",
+ account.getAccountNumber()), account.getAccountNumber());
}
}
Modified: trunk/lima-business/src/main/resources/i18n/lima-business_fr_FR.properties
===================================================================
--- trunk/lima-business/src/main/resources/i18n/lima-business_fr_FR.properties 2014-08-05 14:49:54 UTC (rev 3896)
+++ trunk/lima-business/src/main/resources/i18n/lima-business_fr_FR.properties 2014-08-05 15:56:52 UTC (rev 3897)
@@ -143,5 +143,6 @@
lima.table.voucher=
lima.ui.financialtransaction.account=
lima.ui.fiscalperiod.fiscalperiod=
+lima.ui.importexport.import.exceptions.reason=Reason\:%
lima.ui.lettering.accountRegularization=
llima.importexport.import.alreadyExistFinancialStatement=
Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/AccountException.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/AccountException.java 2014-08-05 14:49:54 UTC (rev 3896)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/AccountException.java 2014-08-05 15:56:52 UTC (rev 3897)
@@ -38,6 +38,16 @@
this.accountNumber = accountNumber;
}
+ public AccountException(String accountNumber, String message) {
+ super(message);
+ this.accountNumber = accountNumber;
+ }
+
+ public AccountException(String accountNumber, String message, Throwable cause) {
+ super(message, cause);
+ this.accountNumber = accountNumber;
+ }
+
public String getAccountNumber() {
return accountNumber;
}
Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/AlreadyExistVatStatement.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/AlreadyExistVatStatement.java 2014-08-05 14:49:54 UTC (rev 3896)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/AlreadyExistVatStatement.java 2014-08-05 15:56:52 UTC (rev 3897)
@@ -22,6 +22,8 @@
* #L%
*/
+import static org.nuiton.i18n.I18n.t;
+
/**
* Created by davidcosse on 28/07/14.
*/
@@ -32,6 +34,7 @@
protected String masterLabel;
public AlreadyExistVatStatement(String label, String masterLabel) {
+ super(t("lima.importexport.import.alreadyExistFinancialStatement",label, masterLabel));
this.vatStatementLabel = label;
this.masterLabel = masterLabel;
}
Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/ClosedPeriodicEntryBookException.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/ClosedPeriodicEntryBookException.java 2014-08-05 14:49:54 UTC (rev 3896)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/ClosedPeriodicEntryBookException.java 2014-08-05 15:56:52 UTC (rev 3897)
@@ -35,11 +35,21 @@
this.closedPeriodicEntryBook = closedPeriodicEntryBook;
}
+ public ClosedPeriodicEntryBookException(ClosedPeriodicEntryBook closedPeriodicEntryBook, String message) {
+ super(message);
+ this.closedPeriodicEntryBook = closedPeriodicEntryBook;
+ }
+
public ClosedPeriodicEntryBookException(ClosedPeriodicEntryBook closedPeriodicEntryBook, Throwable cause) {
super(cause);
this.closedPeriodicEntryBook = closedPeriodicEntryBook;
}
+ public ClosedPeriodicEntryBookException(ClosedPeriodicEntryBook closedPeriodicEntryBook, String message, Throwable cause) {
+ super(message, cause);
+ this.closedPeriodicEntryBook = closedPeriodicEntryBook;
+ }
+
public ClosedPeriodicEntryBook getClosedPeriodicEntryBook() {
return closedPeriodicEntryBook;
}
Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/FinancialPeriodException.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/FinancialPeriodException.java 2014-08-05 14:49:54 UTC (rev 3896)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/FinancialPeriodException.java 2014-08-05 15:56:52 UTC (rev 3897)
@@ -35,6 +35,11 @@
this.financialPeriod = financialPeriod;
}
+ public FinancialPeriodException(FinancialPeriod financialPeriod, String message) {
+ super(message);
+ this.financialPeriod = financialPeriod;
+ }
+
public FinancialPeriodException(FinancialPeriod financialPeriod, Throwable cause) {
super(cause);
this.financialPeriod = financialPeriod;
Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/InvalidAccountNumberException.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/InvalidAccountNumberException.java 2014-08-05 14:49:54 UTC (rev 3896)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/InvalidAccountNumberException.java 2014-08-05 15:56:52 UTC (rev 3897)
@@ -31,6 +31,10 @@
super(accountNumber);
}
+ public InvalidAccountNumberException(String accountNumber, String message) {
+ super(accountNumber, message);
+ }
+
public InvalidAccountNumberException(String accountNumber, Throwable cause) {
super(accountNumber, cause);
}
Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/LockedEntryBookException.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/LockedEntryBookException.java 2014-08-05 14:49:54 UTC (rev 3896)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/LockedEntryBookException.java 2014-08-05 15:56:52 UTC (rev 3897)
@@ -24,15 +24,25 @@
import org.chorem.lima.entity.ClosedPeriodicEntryBook;
+import static org.nuiton.i18n.I18n.t;
+
/**
* @author Sylvain Bavencoff <bavencoff(a)codelutin.com>
*/
public class LockedEntryBookException extends ClosedPeriodicEntryBookException {
public LockedEntryBookException(ClosedPeriodicEntryBook closedPeriodicEntryBook) {
- super(closedPeriodicEntryBook);
+ super(closedPeriodicEntryBook, t("lima.ui.lettering.roundAndCreateEntry.error.lockedEntryBook",
+ closedPeriodicEntryBook.getEntryBook().getCode(),
+ closedPeriodicEntryBook.getEntryBook().getLabel(),
+ closedPeriodicEntryBook.getFinancialPeriod().getBeginDate(),
+ closedPeriodicEntryBook.getFinancialPeriod().getEndDate()));
}
+ public LockedEntryBookException(ClosedPeriodicEntryBook closedPeriodicEntryBook, String message) {
+ super(closedPeriodicEntryBook, message);
+ }
+
public LockedEntryBookException(ClosedPeriodicEntryBook closedPeriodicEntryBook, Throwable cause) {
super(closedPeriodicEntryBook, cause);
}
Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/LockedFinancialPeriodException.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/LockedFinancialPeriodException.java 2014-08-05 14:49:54 UTC (rev 3896)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/LockedFinancialPeriodException.java 2014-08-05 15:56:52 UTC (rev 3897)
@@ -24,15 +24,21 @@
import org.chorem.lima.entity.FinancialPeriod;
+import static org.nuiton.i18n.I18n.t;
+
/**
* @author Sylvain Bavencoff <bavencoff(a)codelutin.com>
*/
public class LockedFinancialPeriodException extends FinancialPeriodException{
public LockedFinancialPeriodException(FinancialPeriod financialPeriod) {
- super(financialPeriod);
+ super(financialPeriod, t("lima.ui.fiscalPeriod.block.error.lockedFinancialPeriod",financialPeriod.getBeginDate(), financialPeriod.getEndDate()));
}
+ public LockedFinancialPeriodException(FinancialPeriod financialPeriod, String message) {
+ super(financialPeriod, message);
+ }
+
public LockedFinancialPeriodException(FinancialPeriod financialPeriod, Throwable cause) {
super(financialPeriod, cause);
}
Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/NotAllowedLabel.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/NotAllowedLabel.java 2014-08-05 14:49:54 UTC (rev 3896)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/NotAllowedLabel.java 2014-08-05 15:56:52 UTC (rev 3897)
@@ -22,6 +22,8 @@
* #L%
*/
+import static org.nuiton.i18n.I18n.t;
+
/**
* Created by davidcosse on 31/07/14.
*/
@@ -30,6 +32,7 @@
protected String label;
public NotAllowedLabel(String label) {
+ super(t("lima.importexport.import.notAllowedLabel",label));
this.label = label;
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java 2014-08-05 14:49:54 UTC (rev 3896)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java 2014-08-05 15:56:52 UTC (rev 3897)
@@ -145,93 +145,89 @@
@Override
protected ImportExportResults doInBackground() {
ImportExportResults results = new ImportExportResults();
- try {
- switch (importExportMethodeF) {
- //####################################### CSV ##############################################
+ switch (importExportMethodeF) {
+ //####################################### CSV ##############################################
- case CSV_ACCOUNTCHARTS_EXPORT:
- results.pushExportResults(exportService.exportAccountsAsCSV(defaultCharset.name()));
- createFile(filePath, defaultCharset.name(), results.getExportResults().get(0).getExportData());
- break;
+ case CSV_ACCOUNTCHARTS_EXPORT:
+ results.pushExportResults(exportService.exportAccountsAsCSV(defaultCharset.name()));
+ createFile(filePath, defaultCharset.name(), results.getExportResults().get(0).getExportData());
+ break;
- case CSV_ACCOUNTCHARTS_IMPORT:
- String content = loadFile(filePath, defaultCharset.name());
- results.pushImportResults(importService.importAccountAsCSV(content));
- break;
- case CSV_ENTRYBOOKS_EXPORT:
- results.pushExportResults(exportService.exportEntryBooksAsCSV(defaultCharset.name()));
- createFile(filePath, defaultCharset.name(), results.getExportResults().get(0).getExportData());
- break;
- case CSV_ENTRYBOOKS_IMPORT:
- content = loadFile(filePath, defaultCharset.name());
- results.pushImportResults(importService.importEntryBooksAsCSV(content));
- break;
- case CSV_ENTRIES_EXPORT:
- results.pushExportResults(exportService.exportEntriesAsCSV(defaultCharset.name(), true));
- createFile(filePath, defaultCharset.name(), results.getExportResults().get(0).getExportData());
- break;
- case CSV_ENTRIES_IMPORT:
- content = loadFile(filePath, defaultCharset.name());
- results.pushImportResults(importService.importEntriesAsCSV(content));
- break;
+ case CSV_ACCOUNTCHARTS_IMPORT:
+ String content = loadFile(filePath, defaultCharset.name());
+ results.pushImportResults(importService.importAccountAsCSV(content));
+ break;
+ case CSV_ENTRYBOOKS_EXPORT:
+ results.pushExportResults(exportService.exportEntryBooksAsCSV(defaultCharset.name()));
+ createFile(filePath, defaultCharset.name(), results.getExportResults().get(0).getExportData());
+ break;
+ case CSV_ENTRYBOOKS_IMPORT:
+ content = loadFile(filePath, defaultCharset.name());
+ results.pushImportResults(importService.importEntryBooksAsCSV(content));
+ break;
+ case CSV_ENTRIES_EXPORT:
+ results.pushExportResults(exportService.exportEntriesAsCSV(defaultCharset.name(), true));
+ createFile(filePath, defaultCharset.name(), results.getExportResults().get(0).getExportData());
+ break;
+ case CSV_ENTRIES_IMPORT:
+ content = loadFile(filePath, defaultCharset.name());
+ results.pushImportResults(importService.importEntriesAsCSV(content));
+ break;
- case CSV_ALL_EXPORT:
- exportBackup(filePath, defaultCharset.name());
- break;
- case CSV_ALL_IMPORT:
- results = importAllFromZipFile(filePath);
- break;
+ case CSV_ALL_EXPORT:
+ results = exportBackup(filePath, defaultCharset.name());
+ break;
+ case CSV_ALL_IMPORT:
+ results = importAllFromZipFile(filePath);
+ break;
- case CSV_VAT_EXPORT:
- results.pushExportResults(exportService.exportVatStatements(defaultCharset.name()));
- createFile(filePath, defaultCharset.name(), results.getExportResults().get(0).getExportData());
- break;
- case CSV_VAT_IMPORT:
- content = loadFile(filePath, defaultCharset.name());
- results.pushImportResults(importService.importVATStatementsAsCSV(content));
- break;
+ case CSV_VAT_EXPORT:
+ results.pushExportResults(exportService.exportVatStatements(defaultCharset.name()));
+ createFile(filePath, defaultCharset.name(), results.getExportResults().get(0).getExportData());
+ break;
+ case CSV_VAT_IMPORT:
+ content = loadFile(filePath, defaultCharset.name());
+ results.pushImportResults(importService.importVATStatementsAsCSV(content));
+ break;
- case CSV_FINANCIALSTATEMENTS_EXPORT:
- results.pushExportResults(exportService.exportFinancialStatements(defaultCharset.name()));
- createFile(filePath, defaultCharset.name(), results.getExportResults().get(0).getExportData());
- break;
- case CSV_FINANCIALSTATEMENTS_IMPORT:
- content = loadFile(filePath, defaultCharset.name());
- results.pushImportResults(importService.importFinancialStatementsAsCSV(content));
- break;
+ case CSV_FINANCIALSTATEMENTS_EXPORT:
+ results.pushExportResults(exportService.exportFinancialStatements(defaultCharset.name()));
+ createFile(filePath, defaultCharset.name(), results.getExportResults().get(0).getExportData());
+ break;
+ case CSV_FINANCIALSTATEMENTS_IMPORT:
+ content = loadFile(filePath, defaultCharset.name());
+ results.pushImportResults(importService.importFinancialStatementsAsCSV(content));
+ break;
- //####################################### EBP ##############################################
- //For windows ebp so using encoding ISOLATIN1
+ //####################################### EBP ##############################################
+ //For windows ebp so using encoding ISOLATIN1
- case EBP_ACCOUNTCHARTS_EXPORT:
- results.pushExportResults(exportService.exportAccountAsEbp(defaultCharset.name()));
- createFile(filePath, EncodingEnum.ISOLATIN1.getEncoding(), results.getExportResults().get(0).getExportData());
- break;
- case EBP_ACCOUNTCHARTS_IMPORT:
- content = loadFile(filePath, EncodingEnum.ISOLATIN1.getEncoding());
- results.pushImportResults(importService.importAccountFromEbp(content));
- break;
+ case EBP_ACCOUNTCHARTS_EXPORT:
+ results.pushExportResults(exportService.exportAccountAsEbp(defaultCharset.name()));
+ createFile(filePath, EncodingEnum.ISOLATIN1.getEncoding(), results.getExportResults().get(0).getExportData());
+ break;
+ case EBP_ACCOUNTCHARTS_IMPORT:
+ content = loadFile(filePath, EncodingEnum.ISOLATIN1.getEncoding());
+ results.pushImportResults(importService.importAccountFromEbp(content));
+ break;
- case EBP_ENTRYBOOKS_EXPORT:
- results.pushExportResults(exportService.exportEntryBookAsEbp(defaultCharset.name()));
- createFile(filePath, EncodingEnum.ISOLATIN1.getEncoding(), results.getExportResults().get(0).getExportData());
- break;
- case EBP_ENTRYBOOKS_IMPORT:
- content = loadFile(filePath, EncodingEnum.ISOLATIN1.getEncoding());
- results.pushImportResults(importService.importEntryBookFromEbp(content));
- break;
+ case EBP_ENTRYBOOKS_EXPORT:
+ results.pushExportResults(exportService.exportEntryBookAsEbp(defaultCharset.name()));
+ createFile(filePath, EncodingEnum.ISOLATIN1.getEncoding(), results.getExportResults().get(0).getExportData());
+ break;
+ case EBP_ENTRYBOOKS_IMPORT:
+ content = loadFile(filePath, EncodingEnum.ISOLATIN1.getEncoding());
+ results.pushImportResults(importService.importEntryBookFromEbp(content));
+ break;
- case EBP_ENTRIES_EXPORT:
- results.pushExportResults(exportService.exportEntriesAsEbp(defaultCharset.name()));
- createFile(filePath, EncodingEnum.ISOLATIN1.getEncoding(), results.getExportResults().get(0).getExportData());
- break;
- case EBP_ENTRIES_IMPORT:
- content = loadFile(filePath, EncodingEnum.ISOLATIN1.getEncoding());
- results.pushImportResults(importService.importEntriesFromEbp(content));
- break;
- }
- } catch (ExportException e) {
- e.printStackTrace();
+ case EBP_ENTRIES_EXPORT:
+ results.pushExportResults(exportService.exportEntriesAsEbp(defaultCharset.name()));
+ createFile(filePath, EncodingEnum.ISOLATIN1.getEncoding(), results.getExportResults().get(0).getExportData());
+ break;
+ case EBP_ENTRIES_IMPORT:
+ content = loadFile(filePath, EncodingEnum.ISOLATIN1.getEncoding());
+ results.pushImportResults(importService.importEntriesFromEbp(content));
+ break;
}
return results;
}
@@ -275,7 +271,7 @@
String message = "";
for (ImportResult result : resultList) {
Class fromSource = result.getFromSource();
- message += "Import " + getFromSourceMessage(fromSource)+"\n";
+ message += "Import " + getFromSourceMessage(fromSource);
message += t("lima.ui.importexport.import.nbCreated", result.getNbCreated())+"\n";
message += t("lima.ui.importexport.import.nbUpdated", result.getNbUpdated())+"\n";
message += t("lima.ui.importexport.import.nbIgnored", result.getNbIgnored())+"\n";
@@ -283,13 +279,16 @@
if (exceptionsByLine != null) {
Set<Integer> lines = exceptionsByLine.keySet();
for (Integer line : lines) {
- message += t("lima.ui.importexport.import.exceptions", line)+"\n";
+ LimaException importException = exceptionsByLine.get(line);
+ message += t("lima.ui.importexport.import.exceptions", (line +1))+"\n";
+ // TODO DCossé 05/08/14 display reason
+ //message += t("lima.ui.importexport.import.exceptions.reason", importException.getMessage()) +"\n";
if (log.isErrorEnabled()) {
- LimaException importException = exceptionsByLine.get(line);
log.error(importException.getMessage());
}
}
}
+ message +="\n";
}
JOptionPane.showMessageDialog(
@@ -473,7 +472,7 @@
return result;
}
- protected void exportBackup(String path, String charset) throws ExportException {
+ protected ImportExportResults exportBackup(String path, String charset){
ImportExportResults results = exportService.exportBackup(charset);
ZipOutputStream export = null;
@@ -502,6 +501,7 @@
} finally {
IOUtils.closeQuietly(export);
}
+ return results;
}
protected ImportExportResults importAllFromZipFile(String filePath) {
Modified: trunk/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties
===================================================================
--- trunk/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties 2014-08-05 14:49:54 UTC (rev 3896)
+++ trunk/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties 2014-08-05 15:56:52 UTC (rev 3897)
@@ -351,6 +351,8 @@
lima.importexport.export.terminated=
lima.importexport.import=
lima.importexport.import.alreadyExistFinancialStatement=Category with name %s exists for parent %s.
+lima.importexport.import.alreadyExistVatStatement=VAT statement with name %s exists for parents %s.
+lima.importexport.import.notAllowedLabel=Not allowed char in label\: %s.
lima.importexport.usevatpdf=
lima.init.closed=Lima closed at %1$s
lima.init.errorclosing=Error during Lima close
@@ -536,6 +538,8 @@
lima.ui.fiscalPeriod.add.notBeginNextDayOfLastFiscalPeriod=
lima.ui.fiscalPeriod.block.error.AlreadyLockedFiscalPeriod=
lima.ui.fiscalPeriod.block.error.lastUnlockedFiscalPeriod=
+lima.ui.fiscalPeriod.block.error.lockedFinancialPeriod=Fiscal period from %3$te %3$tB %3$tY to %4$te %4$tB %4$tY is closed.
+lima.ui.fiscalPeriod.block.error.lockedFiscalPeriod=Fiscal period closed %s
lima.ui.fiscalPeriod.buttonback=
lima.ui.fiscalPeriod.buttonnext=
lima.ui.fiscalPeriod.delete.error.noEmptyFiscalPeriod=
@@ -596,6 +600,7 @@
lima.ui.importexport.import=
lima.ui.importexport.import.exception=
lima.ui.importexport.import.exceptions=The line %d could not be imported.
+lima.ui.importexport.import.exceptions.reason=Reason\:%
lima.ui.importexport.import.nbCreated=%d created
lima.ui.importexport.import.nbIgnored=%d ignored
lima.ui.importexport.import.nbUpdated=%d updated
@@ -661,6 +666,3 @@
lima.warning.nimbus.landf=Could not find Numbus Look&Feel
limma.config.thousandseparator.description=
limma.config.thousandseparator.label=
-org.chorem.lima.LimaConfig.NumberSeparator.COMMA=
-org.chorem.lima.LimaConfig.NumberSeparator.DOT=
-org.chorem.lima.LimaConfig.NumberSeparator.SPACE=
Modified: trunk/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties
===================================================================
--- trunk/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties 2014-08-05 14:49:54 UTC (rev 3896)
+++ trunk/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties 2014-08-05 15:56:52 UTC (rev 3897)
@@ -309,7 +309,8 @@
lima.importexport.export.terminated=Export terminé
lima.importexport.import=Importer
lima.importexport.import.alreadyExistFinancialStatement=La transaction financière %s existe déjà sur le parent %s.
-lima.importexport.import.alreadyExistVatStatement=
+lima.importexport.import.alreadyExistVatStatement=La transaction de TVA %s existe déjà sur le parent %s.
+lima.importexport.import.notAllowedLabel=Label non contenant un caractère interdit %s.
lima.importexport.usevatpdf=Êtes-vous sûr de vouloir utiliser ce pdf pour la déclaration de TVA ?
lima.init.closed=Lima fermé à %1$s
lima.init.errorclosing=Erreur lors de la fermeture
@@ -472,6 +473,8 @@
lima.ui.fiscalPeriod.add.error.notBeginNextDayOfLastFiscalPeriod=La date de début de l'exercice doit suivre la date de fin de l'exercice précédent le %1$te/%1$tm/%1$tY
lima.ui.fiscalPeriod.block.error.AlreadyLockedFiscalPeriod=L'exercice est déjà clôturés
lima.ui.fiscalPeriod.block.error.lastUnlockedFiscalPeriod=L'exercice prédent doit être clôturé
+lima.ui.fiscalPeriod.block.error.lockedFinancialPeriod=La période fiscale du %3$te %3$tB %3$tY au %4$te %4$tB %4$tY est cloturée.
+lima.ui.fiscalPeriod.block.error.lockedFiscalPeriod=L'exercice ést clôturé %s
lima.ui.fiscalPeriod.buttonback=←
lima.ui.fiscalPeriod.buttonnext=→
lima.ui.fiscalPeriod.delete.error.noEmptyFiscalPeriod=Impossible de supprimer un exercice avec des transactions (%1$s).
@@ -515,6 +518,7 @@
lima.ui.importexport.import=Importer
lima.ui.importexport.import.action=Import
lima.ui.importexport.import.exceptions=La ligne %d n'a pu être impotée.
+lima.ui.importexport.import.exceptions.reason=Raison\:
lima.ui.importexport.import.nbCreated=%d créés
lima.ui.importexport.import.nbIgnored=%d ignorés
lima.ui.importexport.import.nbUpdated=%d mis à jours
1
0
r3896 - in trunk: lima-business/src/main/java/org/chorem/lima/business/ejb lima-business-api/src/main/java/org/chorem/lima/business lima-swing/src/main/java/org/chorem/lima/ui/importexport lima-swing/src/main/resources/i18n
by dcosse@users.chorem.org 05 Aug '14
by dcosse@users.chorem.org 05 Aug '14
05 Aug '14
Author: dcosse
Date: 2014-08-05 16:49:54 +0200 (Tue, 05 Aug 2014)
New Revision: 3896
Url: http://forge.chorem.org/projects/lima/repository/revisions/3896
Log:
refs #1032 correction des traductions
Modified:
trunk/lima-business-api/src/main/java/org/chorem/lima/business/ImportResult.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java
trunk/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties
trunk/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java 2014-08-05 14:07:42 UTC (rev 3895)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java 2014-08-05 14:49:54 UTC (rev 3896)
@@ -170,7 +170,7 @@
@Override
public ImportExportResults importEntryBooksAsCSV(String contents) {
ImportExportResults results = new ImportExportResults();
- ImportResult result = results.createAddAndGetImportResult(Account.class);
+ ImportResult result = results.createAddAndGetImportResult(EntryBook.class);
InputStream contentStream = IOUtils.toInputStream(contents);
@@ -195,7 +195,7 @@
@Override
public ImportExportResults importFiscalPeriodsAsCSV(String contents) {
ImportExportResults results = new ImportExportResults();
- ImportResult result = results.createAddAndGetImportResult(Account.class);
+ ImportResult result = results.createAddAndGetImportResult(FiscalPeriod.class);
InputStream contentStream = IOUtils.toInputStream(contents);
try {
@@ -221,7 +221,7 @@
protected ImportExportResults importFinancialTransactionsAsCSV(String contents) {
ImportExportResults results = new ImportExportResults();
- ImportResult result = results.createAddAndGetImportResult(Account.class);
+ ImportResult result = results.createAddAndGetImportResult(FinancialTransaction.class);
// import and save FinancialTransactions
InputStream contentStream = IOUtils.toInputStream(contents);
@@ -248,7 +248,7 @@
@Override
public ImportExportResults importEntriesAsCSV(String contents) {
ImportExportResults results = new ImportExportResults();
- ImportResult result = results.createAddAndGetImportResult(Account.class);
+ ImportResult result = results.createAddAndGetImportResult(Entry.class);
// import and save entries
InputStream contentStream = IOUtils.toInputStream(contents);
@@ -267,7 +267,7 @@
public ImportExportResults importIdentityAsCSV(String contents) {
ImportExportResults results = new ImportExportResults();
- ImportResult result = results.createAddAndGetImportResult(Account.class);
+ ImportResult result = results.createAddAndGetImportResult(Identity.class);
// import and save identity
if (StringUtils.isNotBlank(contents)){
@@ -329,7 +329,7 @@
@Override
public ImportExportResults importFinancialStatementsAsCSV(String contents) {
ImportExportResults results = new ImportExportResults();
- ImportResult result = results.createAddAndGetImportResult(Account.class);
+ ImportResult result = results.createAddAndGetImportResult(FinancialStatement.class);
// import and save FinancialTransactions
InputStream contentStream = IOUtils.toInputStream(contents);
@@ -472,7 +472,7 @@
@Override
public ImportExportResults importVATStatementsAsCSV(String contents) {
ImportExportResults results = new ImportExportResults();
- ImportResult result = results.createAddAndGetImportResult(Account.class);
+ ImportResult result = results.createAddAndGetImportResult(VatStatement.class);
// import and save VATStatements
InputStream contentStream = IOUtils.toInputStream(contents);
Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/ImportResult.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/ImportResult.java 2014-08-05 14:07:42 UTC (rev 3895)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/ImportResult.java 2014-08-05 14:49:54 UTC (rev 3896)
@@ -41,7 +41,7 @@
protected Class fromSource;
- protected Map<Integer, LimaException> allExceptions = new HashMap<>();
+ protected Map<Integer, LimaException> allExceptions;
public ImportResult(Class fromSource) {
nbCreated = 0;
@@ -79,6 +79,7 @@
}
public void addException(LimaException e) {
+ allExceptions = allExceptions == null ? new HashMap<Integer, LimaException>() : allExceptions;
allExceptions.put(this.lineIndex, e);
lineIndex++;
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java 2014-08-05 14:07:42 UTC (rev 3895)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java 2014-08-05 14:49:54 UTC (rev 3896)
@@ -272,10 +272,10 @@
log.debug("import.terminated");
}
- String message = "Import";
+ String message = "";
for (ImportResult result : resultList) {
Class fromSource = result.getFromSource();
- message += getFromSourceMessage(fromSource)+"\n";
+ message += "Import " + getFromSourceMessage(fromSource)+"\n";
message += t("lima.ui.importexport.import.nbCreated", result.getNbCreated())+"\n";
message += t("lima.ui.importexport.import.nbUpdated", result.getNbUpdated())+"\n";
message += t("lima.ui.importexport.import.nbIgnored", result.getNbIgnored())+"\n";
@@ -305,10 +305,10 @@
log.debug("export.terminated");
}
- String message = "Export";
+ String message ="";
for (ExportResult result : exportResults) {
Class fromSource = result.getFromSource();
- message += getFromSourceMessage(fromSource);
+ message += "Export " + getFromSourceMessage(fromSource);
List<ExportException> exportExceptions = result.getExportExceptions();
if (exportExceptions != null && !exportExceptions.isEmpty()) {
message += t("lima.ui.importexport.export.exception")+"\n";
@@ -350,9 +350,11 @@
String message;
if (fromSource.equals(Account.class)){
message = t("lima.ui.importexport.account")+"\n";
+ } else if (fromSource.equals(EntryBook.class)) {
+ message = t("lima.ui.importexport.entrybook")+"\n";
} else if (fromSource.equals(Entry.class)) {
message = t("lima.ui.importexport.entry")+"\n";
- }else if (fromSource.equals(FinancialStatement.class)) {
+ } else if (fromSource.equals(FinancialStatement.class)) {
message = t("lima.ui.importexport.financialStatement")+"\n";
} else if (fromSource.equals(FinancialTransaction.class)) {
message = t("lima.ui.importexport.financialTransaction")+"\n";
Modified: trunk/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties
===================================================================
--- trunk/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties 2014-08-05 14:07:42 UTC (rev 3895)
+++ trunk/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties 2014-08-05 14:49:54 UTC (rev 3896)
@@ -39,7 +39,7 @@
lima.charts.fiscalperiod.block=Block fiscalperiod
lima.charts.fiscalperiod.create=Create fiscalperiod
lima.charts.fiscalperiod.delete=Delete fiscalperiod
-lima.charts.fiscalperiod.update=
+lima.charts.fiscalperiod.update=Updated fiscal
lima.charts.fiscalyear=Fiscal Years
lima.charts.vatpdf=PDF structure
lima.charts.vatstatement=VAT statement chart
@@ -579,6 +579,8 @@
lima.ui.importexport.ebp=Import/Export EBP
lima.ui.importexport.entries=Entries
lima.ui.importexport.entry=Entries import completed.
+lima.ui.importexport.entryBook=
+lima.ui.importexport.entrybook=Entry books import completed.
lima.ui.importexport.entrybooks=Entry books
lima.ui.importexport.export=Export
lima.ui.importexport.export.exception=
Modified: trunk/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties
===================================================================
--- trunk/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties 2014-08-05 14:07:42 UTC (rev 3895)
+++ trunk/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties 2014-08-05 14:49:54 UTC (rev 3896)
@@ -501,14 +501,15 @@
lima.ui.importexport.account=des comptes terminé.
lima.ui.importexport.defaultentrybooks=Journaux par défaut
lima.ui.importexport.entry=des entrées terminé.
+lima.ui.importexport.entrybook=des journaux terminé.
lima.ui.importexport.entrybooks=Journaux
lima.ui.importexport.export=Exporter
lima.ui.importexport.export.action=Export
lima.ui.importexport.export.exception=
lima.ui.importexport.export.exceptions=Echec de l'export.
lima.ui.importexport.export.terminated=Export terminé
-lima.ui.importexport.financialStatement=des transaction financière terminé.
-lima.ui.importexport.financialTransaction=
+lima.ui.importexport.financialStatement=des déclaration financière terminé.
+lima.ui.importexport.financialTransaction=des transaction financière terminé.
lima.ui.importexport.fiscalPeriod=des periodes fiscales terminé.
lima.ui.importexport.identity=de l'identité terminé.
lima.ui.importexport.import=Importer
@@ -573,6 +574,3 @@
lima.warning.nimbus.landf=Le look and feel nymbus n'a pas été trouvé
limma.config.thousandseparator.description=Caractère de séparation entre les blocs de milliers
limma.config.thousandseparator.label=Séparateur de milliers
-org.chorem.lima.LimaConfig.NumberSeparator.COMMA=
-org.chorem.lima.LimaConfig.NumberSeparator.DOT=
-org.chorem.lima.LimaConfig.NumberSeparator.SPACE=
1
0
05 Aug '14
Author: dcosse
Date: 2014-08-05 16:07:42 +0200 (Tue, 05 Aug 2014)
New Revision: 3895
Url: http://forge.chorem.org/projects/lima/repository/revisions/3895
Log:
refs #1032 gestion des retours d'import export
Added:
trunk/lima-business-api/src/main/java/org/chorem/lima/ImportBackupException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/ExportResult.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/ImportExportResults.java
Removed:
trunk/lima-business-api/src/main/java/org/chorem/lima/business/ImportException.java
Modified:
trunk/lima-business-api/src/main/java/org/chorem/lima/business/ImportResult.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/ExportService.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/ImportService.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/ImportServiceImpl.java
trunk/lima-business/src/test/java/org/chorem/lima/business/ImportExportServiceTest.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainView.css
trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java
trunk/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties
trunk/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ExportServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ExportServiceImpl.java 2014-08-04 15:06:04 UTC (rev 3894)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ExportServiceImpl.java 2014-08-05 14:07:42 UTC (rev 3895)
@@ -25,11 +25,8 @@
package org.chorem.lima.business.ejb;
-import com.google.common.collect.Lists;
-import org.apache.commons.codec.binary.Base64;
-import org.apache.commons.io.FileUtils;
-import org.apache.commons.io.IOUtils;
-import org.chorem.lima.LimaTechnicalException;
+import org.chorem.lima.business.ExportResult;
+import org.chorem.lima.business.ImportExportResults;
import org.chorem.lima.business.api.AccountService;
import org.chorem.lima.business.api.EntryBookService;
import org.chorem.lima.business.api.ExportService;
@@ -66,15 +63,11 @@
import javax.ejb.Remote;
import javax.ejb.Stateless;
import javax.ejb.TransactionAttribute;
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.FileInputStream;
import java.nio.charset.Charset;
+import java.rmi.server.ExportException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipOutputStream;
/**
* CSV import export service.
@@ -107,146 +100,100 @@
@EJB
protected IdentityService identityService;
- public static final String JAVA_IO_TMPDIR = System.getProperty("java.io.tmpdir")+"/";
+ @Override
+ public ImportExportResults exportAccountsAsCSV(String charset) {
+ ImportExportResults results = new ImportExportResults();
+ ExportResult exportResult = results.createAddAndGetExportResult(Account.class);
- protected File exportAccountsFile(String charset) throws Exception {
AccountTopiaDao accountTopiaDao = getDaoHelper().getAccountDao();
List<Account> entities = accountTopiaDao.findAll();
- File result = null;
- if (entities != null && entities.size() > 0) {
+ if (entities != null && !entities.isEmpty()) {
AccountModel model = new AccountModel();
- String tmpDir = JAVA_IO_TMPDIR;
-
- result = new File(tmpDir + "accounts.csv");
- Export.exportToFile(model, entities, result, Charset.forName(charset));
+ try {
+ exportResult.setExportData(Export.exportToString(model, entities, java.nio.charset.Charset.forName(charset), true));
+ } catch (Exception e) {
+ exportResult.addException(new ExportException("TODO", e));
+ }
}
- return result;
+ return results;
}
@Override
- public String exportAccountsAsCSV(String charset) {
- String result = null;
- try {
- File file = exportAccountsFile(charset);
- if (file != null) {
- FileInputStream inputStream = new FileInputStream(file);
- result = IOUtils.toString(inputStream);
- }
- } catch (Exception e) {
- throw new LimaTechnicalException(e);
- }
- return result;
- }
+ public ImportExportResults exportEntryBooksAsCSV(String charset){
+ ImportExportResults results = new ImportExportResults();
+ ExportResult exportResult = results.createAddAndGetExportResult(EntryBook.class);
- protected File exportEntryBooksFile(String charset) throws Exception {
EntryBookTopiaDao entryBookTopiaDao = getDaoHelper().getEntryBookDao();
List<EntryBook> entities = entryBookTopiaDao.findAll();
- File result = null;
if (entities != null && !entities.isEmpty()) {
- String tmpDir = JAVA_IO_TMPDIR;
- result = new File(tmpDir + "entryBooks.csv");
EntryBookModel model = new EntryBookModel();
- Export.exportToFile(model, entities, result, Charset.forName(charset));
+ try {
+ exportResult.setExportData(Export.exportToString(model, entities, Charset.forName(charset), true));
+ } catch (Exception e) {
+ exportResult.addException(new ExportException("TODO", e));
+ }
}
-
- return result;
+ return results;
}
-
@Override
- public String exportEntryBooksAsCSV(String charset) {
- String result = null;
- try {
- File file = exportEntryBooksFile(charset);
- if (file != null) {
- FileInputStream inputStream = new FileInputStream(file);
- result = IOUtils.toString(inputStream);
- }
- } catch (Exception e) {
- throw new LimaTechnicalException(e);
- }
- return result;
- }
+ public ImportExportResults exportFiscalPeriodsAsCSV(String charset){
+ ImportExportResults results = new ImportExportResults();
+ ExportResult exportResult = results.createAddAndGetExportResult(FiscalPeriod.class);
- protected File exportFiscalPeriodFile(String charset) throws Exception {
-
FiscalPeriodTopiaDao dao = getDaoHelper().getFiscalPeriodDao();
List<FiscalPeriod> entities = dao.findAll();
-
- File result = null;
if (entities != null && !entities.isEmpty()) {
- String tmpDir = JAVA_IO_TMPDIR;
- result = new File(tmpDir + "fiscalPeriod.csv");
FiscalPeriodModel model = new FiscalPeriodModel();
- Export.exportToFile(model, entities, result, Charset.forName(charset));
+ try {
+ exportResult.setExportData(Export.exportToString(model, entities, Charset.forName(charset), true));
+ } catch (Exception e) {
+ exportResult.addException(new ExportException("TODO", e));
+ }
}
- return result;
+ return results;
}
- @Override
- public String exportFiscalPeriodsAsCSV(String charset) {
- String result = null;
- try {
- File file = exportFiscalPeriodFile(charset);
- if (file != null) {
- FileInputStream inputStream = new FileInputStream(file);
- result = IOUtils.toString(inputStream);
- }
- } catch (Exception e) {
- throw new LimaTechnicalException(e);
- }
- return result;
- }
+ protected ImportExportResults exportFinancialTransactionsFile(String charset){
+ ImportExportResults results = new ImportExportResults();
+ ExportResult exportResult = results.createAddAndGetExportResult(FinancialTransaction.class);
- protected File exportFinancialTransactionsFile(String charset) throws Exception {
- File result = null;
-
FinancialTransactionTopiaDao financialTransactionTopiaDao =
getDaoHelper().getFinancialTransactionDao();
List<FinancialTransaction> entities = financialTransactionTopiaDao.findAll();
-
if (entities != null && !entities.isEmpty()) {
- String tmpDir = JAVA_IO_TMPDIR;
- result = new File(tmpDir + "financialTransactions.csv");
FinancialTransactionModel model = new FinancialTransactionModel(entryBookService);
- Export.exportToFile(model, entities, result, Charset.forName(charset));
+ try {
+ exportResult.setExportData(Export.exportToString(model, entities, Charset.forName(charset), true));
+ } catch (Exception e) {
+ exportResult.addException(new ExportException("TODO", e));
+ }
}
- return result;
+ return results;
}
- protected File exportEntriesFile(String charset, Boolean humanReadable) throws Exception {
+ @Override
+ public ImportExportResults exportEntriesAsCSV(String charset, Boolean humanReadable){
+ ImportExportResults results = new ImportExportResults();
+ ExportResult exportResult = results.createAddAndGetExportResult(Entry.class);
+
EntryTopiaDao dao = getDaoHelper().getEntryDao();
List<Entry> entities = dao.findAll();
-
- File result = null;
if (entities != null && !entities.isEmpty()) {
- String tmpDir = JAVA_IO_TMPDIR;
- result = new File(tmpDir + "entries.csv");
EntryModel model = new EntryModel(accountService, financialTransactionService , humanReadable);
- Export.exportToFile(model, entities, result, Charset.forName(charset));
+ try {
+ exportResult.setExportData(Export.exportToString(model, entities, Charset.forName(charset), true));
+ } catch (Exception e) {
+ exportResult.addException(new ExportException("TODO", e));
+ }
}
- return result;
+ return results;
}
- @Override
- public String exportEntriesAsCSV(String charset, Boolean humanReadable) {
- String result = null;
- try {
- File file = exportEntriesFile(charset, humanReadable);
- if (file != null) {
- FileInputStream inputStream = new FileInputStream(file);
- result = IOUtils.toString(inputStream);
- }
- } catch (Exception e) {
- throw new LimaTechnicalException(e);
- }
- return result;
- }
-
protected List<FinancialStatement> getAllSubFinancialStatements(List<FinancialStatement> result, Collection<FinancialStatement> subFinancialStatements) {
if (subFinancialStatements != null) {
for (FinancialStatement subFinancialStatement : subFinancialStatements) {
@@ -258,22 +205,22 @@
}
@Override
- public String exportFinancialStatements(String charset) throws Exception {
- String stResult = null;
- String tmpDir = JAVA_IO_TMPDIR;
- File fileResult = new File(tmpDir + "financialStatements.csv");
+ public ImportExportResults exportFinancialStatements(String charset){
+ ImportExportResults results = new ImportExportResults();
+ ExportResult exportResult = results.createAddAndGetExportResult(FinancialStatement.class);
List<FinancialStatement> rootFinancialStatements = financialStatementService.getRootFinancialStatements();
if (rootFinancialStatements != null) {
FinancialStatementModel model = new FinancialStatementModel();
List<FinancialStatement> financialStatements = new ArrayList<>();
getAllSubFinancialStatements(financialStatements, rootFinancialStatements);
- Export.exportToFile(model, financialStatements, fileResult, Charset.forName(charset));
- FileInputStream inputStream = new FileInputStream(fileResult);
- stResult = IOUtils.toString(inputStream);
-
+ try {
+ exportResult.setExportData(Export.exportToString(model, financialStatements, Charset.forName(charset), true));
+ } catch (Exception e) {
+ exportResult.addException(new ExportException("TODO", e));
+ }
}
- return stResult;
+ return results;
}
protected List<VatStatement> getAllSubVATStatements(List<VatStatement> result, Collection<VatStatement> subVATStatements) {
@@ -287,138 +234,110 @@
}
@Override
- public String exportVatStatements(String charset) throws Exception {
- String stResult = null;
- String tmpDir = JAVA_IO_TMPDIR;
- File fileResult = new File(tmpDir + "vatStatements.csv");
+ public ImportExportResults exportVatStatements(String charset) {
+ ImportExportResults results = new ImportExportResults();
+ ExportResult exportResult = results.createAddAndGetExportResult(VatStatement.class);
List<VatStatement> rootVatStatements = vatStatementService.getRootVatStatements();
if (rootVatStatements != null) {
VatStatementModel model = new VatStatementModel();
List<VatStatement> vatStatements = new ArrayList<>();
getAllSubVATStatements(vatStatements, rootVatStatements);
- Export.exportToFile(model, vatStatements, fileResult, Charset.forName(charset));
- FileInputStream inputStream = new FileInputStream(fileResult);
- stResult = IOUtils.toString(inputStream);
-
+ try {
+ exportResult.setExportData(Export.exportToString(model, vatStatements, Charset.forName(charset), true));
+ } catch (Exception e) {
+ exportResult.addException(new ExportException("TODO", e));
+ }
}
- return stResult;
+ return results;
}
- protected File exportIdentity(String charset) throws Exception {
- File result = null;
+ protected ImportExportResults exportIdentity(String charset) {
+ ImportExportResults results = new ImportExportResults();
+ ExportResult exportResult = results.createAddAndGetExportResult(Identity.class);
Identity identity = identityService.getIdentity();
if (identity != null) {
List<Identity> identities = new ArrayList<>();
identities.add(identity);
- String tmpDir = JAVA_IO_TMPDIR;
- result = new File(tmpDir + "identity.csv");
IdentityModel model = new IdentityModel();
- Export.exportToFile(model, identities, result, Charset.forName(charset));
+ try {
+ exportResult.setExportData(Export.exportToString(model, identities, Charset.forName(charset), true));
+ } catch (Exception e) {
+ exportResult.addException(new ExportException("TODO", e));
+ }
}
- return result;
+ return results;
}
@Override
- public String exportBackup(String charset) {
- ByteArrayOutputStream rstBao = new ByteArrayOutputStream();
- ZipOutputStream export = null;
- try {
- List<File> files = Lists.newArrayList();
- files.add(exportAccountsFile(charset));
- files.add(exportEntryBooksFile(charset));
- files.add(exportFiscalPeriodFile(charset));
- files.add(exportFinancialTransactionsFile(charset));
- files.add(exportEntriesFile(charset, false));
- files.add(exportIdentity(charset));
+ public ImportExportResults exportBackup(String charset) {
- export = new ZipOutputStream(rstBao);
+ ImportExportResults results = exportAccountsAsCSV(charset);
- for (File file : files) {
- if (file != null) {
- ZipEntry ze= new ZipEntry(file.getName());
- export.putNextEntry(ze);
- int len;
- byte[] buffer = new byte[1024];
- FileInputStream stream = new FileInputStream(file);
- while ((len = stream.read(buffer)) > 0) {
- export.write(buffer, 0, len);
- }
- stream.close();
- FileUtils.forceDelete(file);
- }
- }
- export.flush();
-
- } catch (Exception e) {
- throw new LimaTechnicalException(e);
- } finally {
- IOUtils.closeQuietly(export);
- }
- byte[] bytes = rstBao.toByteArray();
- return Base64.encodeBase64String(bytes);
+ results.pushExportResults(exportEntryBooksAsCSV(charset));
+ results.pushExportResults(exportFiscalPeriodsAsCSV(charset));
+ results.pushExportResults(exportFinancialTransactionsFile(charset));
+ results.pushExportResults(exportEntriesAsCSV(charset, false));
+ results.pushExportResults(exportIdentity(charset));
+ return results;
}
//####################################### EBP ##############################################
@Override
- public String exportAccountAsEbp(String charset) throws Exception {
- String stResult = null;
- File result;
+ public ImportExportResults exportAccountAsEbp(String charset) {
+ ImportExportResults results = new ImportExportResults();
+ ExportResult exportResult = results.createAddAndGetExportResult(Account.class);
List<Account> accounts = accountService.getAllAccounts();
if (accounts != null && !accounts.isEmpty()) {
-
- String tmpDir = JAVA_IO_TMPDIR;
- result = new File(tmpDir + "accounts.csv");
AccountEBPModel model = new AccountEBPModel();
- Export.exportToFile(model, accounts, result, Charset.forName(charset));
- FileInputStream inputStream = new FileInputStream(result);
- stResult = IOUtils.toString(inputStream);
-
+ try {
+ exportResult.setExportData(Export.exportToString(model, accounts, Charset.forName(charset), true));
+ } catch (Exception e) {
+ exportResult.addException(new ExportException("TODO", e));
+ }
}
- return stResult;
+ return results;
}
@Override
- public String exportEntriesAsEbp(String charset) throws Exception {
- String stResult = null;
- File result;
+ public ImportExportResults exportEntriesAsEbp(String charset){
+ ImportExportResults results = new ImportExportResults();
+ ExportResult exportResult = results.createAddAndGetExportResult(Entry.class);
List<Entry> entries = getDaoHelper().getEntryDao().findAll();
-
if (entries != null && !entries.isEmpty()) {
-
- String tmpDir = JAVA_IO_TMPDIR;
- result = new File(tmpDir + "entries.csv");
EntryEBPModel model = new EntryEBPModel();
- Export.exportToFile(model, entries, result, Charset.forName(charset));
- FileInputStream inputStream = new FileInputStream(result);
- stResult = IOUtils.toString(inputStream);
+ try {
+ exportResult.setExportData(Export.exportToString(model, entries, Charset.forName(charset),true));
+ } catch (Exception e) {
+ exportResult.addException(new ExportException("TODO", e));
+ }
+
}
- return stResult;
+ return results;
}
@Override
- public String exportEntryBookAsEbp(String charset) throws Exception {
- String stResult = null;
- File result;
+ public ImportExportResults exportEntryBookAsEbp(String charset){
+ ImportExportResults results = new ImportExportResults();
+ ExportResult exportResult = results.createAddAndGetExportResult(EntryBook.class);
List<EntryBook> entryBooks = entryBookService.getAllEntryBooks();
-
if (entryBooks != null && !entryBooks.isEmpty()) {
- String tmpDir = JAVA_IO_TMPDIR;
- result = new File(tmpDir + "entryBooks.csv");
EntryBookModel model = new EntryBookModel();
- Export.exportToFile(model, entryBooks, result, Charset.forName(charset));
- FileInputStream inputStream = new FileInputStream(result);
- stResult = IOUtils.toString(inputStream);
+ try {
+ exportResult.setExportData(Export.exportToString(model, entryBooks, Charset.forName(charset)));
+ } catch (Exception e) {
+ exportResult.addException(new ExportException("TODO", e));
+ }
}
- return stResult;
+ return results;
}
}
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-04 15:06:04 UTC (rev 3894)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java 2014-08-05 14:07:42 UTC (rev 3895)
@@ -34,6 +34,7 @@
import org.chorem.lima.business.AlreadyExistVatStatement;
import org.chorem.lima.business.FiscalPeriodException;
import org.chorem.lima.business.ImportEbpException;
+import org.chorem.lima.business.ImportExportResults;
import org.chorem.lima.business.ImportResult;
import org.chorem.lima.business.InvalidAccountNumberException;
import org.chorem.lima.business.LockedEntryBookException;
@@ -137,10 +138,12 @@
};
@Override
- public ImportResult importAccountAsCSV(String contents) {
+ public ImportExportResults importAccountAsCSV(String contents) {
+
+ ImportExportResults result = new ImportExportResults();
+ ImportResult importResult = result.createAddAndGetImportResult(Account.class);
+
InputStream contentStream = IOUtils.toInputStream(contents);
-
- ImportResult result = new ImportResult();
try {
ImportModel<Account> model = new AccountModel();
Import<Account> accounts = Import.newImport(model, contentStream);
@@ -150,12 +153,12 @@
try {
updated = accountService.createOrUbdateAccount(account);
if (updated) {
- result.increaseUpdated();
+ importResult.increaseUpdated();
} else {
- result.increaseCreated();
+ importResult.increaseCreated();
}
} catch (InvalidAccountNumberException e) {
- result.addException(e);
+ importResult.addException(e);
}
}
} finally {
@@ -165,9 +168,12 @@
}
@Override
- public ImportResult importEntryBooksAsCSV(String contents) {
+ public ImportExportResults importEntryBooksAsCSV(String contents) {
+ ImportExportResults results = new ImportExportResults();
+ ImportResult result = results.createAddAndGetImportResult(Account.class);
+
InputStream contentStream = IOUtils.toInputStream(contents);
- ImportResult result = new ImportResult();
+
try {
ImportModel<EntryBook> model = new EntryBookModel();
@@ -183,13 +189,15 @@
} finally {
IOUtils.closeQuietly(contentStream);
}
- return result;
+ return results;
}
@Override
- public ImportResult importFiscalPeriodsAsCSV(String contents) {
+ public ImportExportResults importFiscalPeriodsAsCSV(String contents) {
+ ImportExportResults results = new ImportExportResults();
+ ImportResult result = results.createAddAndGetImportResult(Account.class);
+
InputStream contentStream = IOUtils.toInputStream(contents);
- ImportResult result = new ImportResult();
try {
ImportModel<FiscalPeriod> model = new FiscalPeriodModel();
@@ -208,11 +216,12 @@
} finally {
IOUtils.closeQuietly(contentStream);
}
- return result;
+ return results;
}
- protected ImportResult importFinancialTransactionsAsCSV(String contents) {
- ImportResult result = new ImportResult();
+ protected ImportExportResults importFinancialTransactionsAsCSV(String contents) {
+ ImportExportResults results = new ImportExportResults();
+ ImportResult result = results.createAddAndGetImportResult(Account.class);
// import and save FinancialTransactions
InputStream contentStream = IOUtils.toInputStream(contents);
@@ -233,14 +242,16 @@
} finally {
IOUtils.closeQuietly(contentStream);
}
- return result;
+ return results;
}
@Override
- public ImportResult importEntriesAsCSV(String contents) {
+ public ImportExportResults importEntriesAsCSV(String contents) {
+ ImportExportResults results = new ImportExportResults();
+ ImportResult result = results.createAddAndGetImportResult(Account.class);
+
// import and save entries
InputStream contentStream = IOUtils.toInputStream(contents);
- ImportResult result = new ImportResult();
try {
ImportModel<Entry> model = new EntryModel(accountService, financialTransactionService, false);
Import<Entry> entries = Import.newImport(model, contentStream);
@@ -251,11 +262,13 @@
} finally {
IOUtils.closeQuietly(contentStream);
}
- return result;
+ return results;
}
- public ImportResult importIdentityAsCSV(String contents) {
- ImportResult result = new ImportResult();
+ public ImportExportResults importIdentityAsCSV(String contents) {
+ ImportExportResults results = new ImportExportResults();
+ ImportResult result = results.createAddAndGetImportResult(Account.class);
+
// import and save identity
if (StringUtils.isNotBlank(contents)){
InputStream contentStream = null;
@@ -272,7 +285,7 @@
}
}
- return result;
+ return results;
}
protected FinancialStatement returnFinancialStatement (FinancialStatement rootFinancialStatement, String subFinancialStatementLabel) throws AlreadyExistFinancialStatement, NotAllowedLabel {
@@ -314,8 +327,9 @@
}
@Override
- public ImportResult importFinancialStatementsAsCSV(String contents) {
- ImportResult result = new ImportResult();
+ public ImportExportResults importFinancialStatementsAsCSV(String contents) {
+ ImportExportResults results = new ImportExportResults();
+ ImportResult result = results.createAddAndGetImportResult(Account.class);
// import and save FinancialTransactions
InputStream contentStream = IOUtils.toInputStream(contents);
@@ -414,7 +428,7 @@
} finally {
IOUtils.closeQuietly(contentStream);
}
- return result;
+ return results;
}
protected VatStatement returnVATStatement (VatStatement rootVATStatement, String subVATStatementLabel) throws AlreadyExistVatStatement, NotAllowedLabel {
@@ -456,8 +470,9 @@
}
@Override
- public ImportResult importVATStatementsAsCSV(String contents) {
- ImportResult result = new ImportResult();
+ public ImportExportResults importVATStatementsAsCSV(String contents) {
+ ImportExportResults results = new ImportExportResults();
+ ImportResult result = results.createAddAndGetImportResult(Account.class);
// import and save VATStatements
InputStream contentStream = IOUtils.toInputStream(contents);
@@ -556,18 +571,18 @@
} finally {
IOUtils.closeQuietly(contentStream);
}
- return result;
+ return results;
}
@Override
- public List<ImportResult> importBackup(String entryBooks, String financialTransactions, String fiscalPeriods, String accounts, String entries, String identity) throws AlreadyExistAccountException, InvalidAccountNumberException {
- List<ImportResult> results = new ArrayList<>();
- results.add(importAccountAsCSV(accounts));
- results.add(importEntryBooksAsCSV(entryBooks));
- results.add(importFiscalPeriodsAsCSV(fiscalPeriods));
- results.add(importFinancialTransactionsAsCSV(financialTransactions));
- results.add(importEntriesAsCSV(entries));
- results.add(importIdentityAsCSV(identity));
+ public ImportExportResults importBackup(String entryBooks, String financialTransactions, String fiscalPeriods, String accounts, String entries, String identity) throws AlreadyExistAccountException, InvalidAccountNumberException {
+
+ ImportExportResults results = importAccountAsCSV(accounts);
+ results.pushImportResults(importEntryBooksAsCSV(entryBooks));
+ results.pushImportResults(importFiscalPeriodsAsCSV(fiscalPeriods));
+ results.pushImportResults(importFinancialTransactionsAsCSV(financialTransactions));
+ results.pushImportResults(importEntriesAsCSV(entries));
+ results.pushImportResults(importIdentityAsCSV(identity));
return results;
}
@@ -575,8 +590,9 @@
@Override
- public ImportResult importAccountFromEbp(String datas) {
- ImportResult result = new ImportResult();
+ public ImportExportResults importAccountFromEbp(String datas) {
+ ImportExportResults results = new ImportExportResults();
+ ImportResult result = results.createAddAndGetImportResult(Account.class);
ImportModel<Account> model = new AccountEBPModel();
@@ -596,12 +612,13 @@
result.increaseCreated();
}
}
- return result;
+ return results;
}
@Override
- public ImportResult importEntryBookFromEbp(String datas) {
- ImportResult result = new ImportResult();
+ public ImportExportResults importEntryBookFromEbp(String datas) {
+ ImportExportResults results = new ImportExportResults();
+ ImportResult result = results.createAddAndGetImportResult(Account.class);
ImportModel<EntryBook> model = new EntryBookEBPModel();
@@ -616,7 +633,7 @@
result.increaseCreated();
}
}
- return result;
+ return results;
}
protected void basicEntriesFromEBPValidation(String datas, List<FiscalPeriod> fiscalPeriods) throws ImportEbpException {
@@ -667,20 +684,20 @@
}
@Override
- public ImportResult importEntriesFromEbp(String datas) {
+ public ImportExportResults importEntriesFromEbp(String datas) {
+ ImportExportResults results = new ImportExportResults();
+ ImportResult result = results.createAddAndGetImportResult(Account.class);
// use for logs
long before = System.currentTimeMillis();
- ImportResult result = new ImportResult();
-
// Get all the valid fiscalPeriods Ordered by date.
List<FiscalPeriod> fiscalPeriods = fiscalPeriodService.getAllUnblockedFiscalPeriodsByBeginDate();
try {
basicEntriesFromEBPValidation(datas, fiscalPeriods);
} catch (ImportEbpException e) {
result.addException(e);
- return result;
+ return results;
}
List<Account> accounts = accountService.getAllAccounts();
@@ -734,7 +751,7 @@
log.info("Imported form EBP : " + entryEBPs.size() + " entries in "
+ (after - before) + " ms");
}
- return result;
+ return results;
}
protected Entry createEntry(EntryEBP entryEBP, Account account) {
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-04 15:06:04 UTC (rev 3894)
+++ trunk/lima-business/src/test/java/org/chorem/lima/business/ImportExportServiceTest.java 2014-08-05 14:07:42 UTC (rev 3895)
@@ -35,8 +35,6 @@
import org.chorem.lima.entity.FinancialTransaction;
import org.chorem.lima.entity.FiscalPeriod;
import org.chorem.lima.entity.FiscalPeriodImpl;
-import org.chorem.lima.entity.Identity;
-import org.chorem.lima.entity.IdentityImpl;
import org.junit.Assert;
import org.junit.Test;
@@ -68,8 +66,9 @@
// export accounts
String tmpDir = System.getProperty("java.io.tmpdir")+"/";
- String export = exportService.exportAccountsAsCSV(Charset.defaultCharset().name());
- InputStream stream = IOUtils.toInputStream(export);
+ ImportExportResults export = exportService.exportAccountsAsCSV(Charset.defaultCharset().name());
+
+ InputStream stream = IOUtils.toInputStream(export.getExportResults().get(0).exportData);
FileOutputStream res = new FileOutputStream(tmpDir + "export-accounts.csv");
IOUtils.copy(stream, res);
@@ -85,12 +84,12 @@
try {
contentStream = new FileInputStream(tmpDir + "export-accounts.csv");
String inportStream = IOUtils.toString(contentStream);
- ImportResult result = importService.importAccountAsCSV(inportStream);
+ ImportExportResults result = importService.importAccountAsCSV(inportStream);
// make sure all account have been created
Assert.assertEquals(nbEntities, accountService.getAllAccounts().size());
- Assert.assertEquals(nbEntities, result.getNbCreated());
- Assert.assertTrue(result.getAllExceptionsByLine().isEmpty());
+ Assert.assertEquals(nbEntities, result.getImportResults().get(0).getNbCreated());
+ Assert.assertTrue(result.getImportResults().get(0).getAllExceptionsByLine().isEmpty());
} finally {
IOUtils.closeQuietly(contentStream);
}
@@ -101,8 +100,8 @@
initTestWithEntryBooks();
String tmpDir = System.getProperty("java.io.tmpdir")+"/";
- String export = exportService.exportEntryBooksAsCSV(Charset.defaultCharset().name());
- InputStream stream = IOUtils.toInputStream(export);
+ ImportExportResults export = exportService.exportEntryBooksAsCSV(Charset.defaultCharset().name());
+ InputStream stream = IOUtils.toInputStream(export.getExportResults().get(0).exportData);
FileOutputStream res = new FileOutputStream(tmpDir + "export-EntryBooks.csv");
IOUtils.copy(stream, res);
@@ -121,7 +120,7 @@
try {
contentStream = new FileInputStream(tmpDir + "export-EntryBooks.csv");
String inportStream = IOUtils.toString(contentStream);
- result = importService.importEntryBooksAsCSV(inportStream);
+ result = importService.importEntryBooksAsCSV(inportStream).getImportResults().get(0);
} finally {
IOUtils.closeQuietly(contentStream);
}
@@ -146,8 +145,8 @@
//test export
String tmpDir = System.getProperty("java.io.tmpdir")+"/";
- String export = exportService.exportEntriesAsCSV(Charset.defaultCharset().name(), false);
- InputStream stream = IOUtils.toInputStream(export);
+ ImportExportResults export = exportService.exportEntriesAsCSV(Charset.defaultCharset().name(), false);
+ InputStream stream = IOUtils.toInputStream(export.getExportResults().get(0).getExportData());
FileOutputStream res = new FileOutputStream(tmpDir + "export-entries.csv");
IOUtils.copy(stream, res);
@@ -172,7 +171,7 @@
try {
contentStream = new FileInputStream(tmpDir + "export-entries.csv");
String inputStream = IOUtils.toString(contentStream);
- result = importService.importEntriesAsCSV(inputStream);
+ result = importService.importEntriesAsCSV(inputStream).getImportResults().get(0);
} finally {
IOUtils.closeQuietly(contentStream);
}
@@ -194,7 +193,7 @@
initTestWithFiscalPeriod();
String tmpDir = System.getProperty("java.io.tmpdir")+"/";
- String export = exportService.exportFiscalPeriodsAsCSV(Charset.defaultCharset().name());
+ String export = exportService.exportFiscalPeriodsAsCSV(Charset.defaultCharset().name()).getExportResults().get(0).getExportData();
InputStream stream = IOUtils.toInputStream(export);
FileOutputStream res = new FileOutputStream(tmpDir + "export-fiscal-periods.csv");
IOUtils.copy(stream, res);
@@ -212,7 +211,7 @@
try {
contentStream = new FileInputStream(tmpDir + "export-fiscal-periods.csv");
String inputStream = IOUtils.toString(contentStream);
- result = importService.importFiscalPeriodsAsCSV(inputStream);
+ result = importService.importFiscalPeriodsAsCSV(inputStream).getImportResults().get(0);
} finally {
IOUtils.closeQuietly(contentStream);
}
@@ -222,37 +221,37 @@
Assert.assertTrue(result.getAllExceptionsByLine().isEmpty());
}
- @Test
- public void exportImportAllAsCSVTest() throws Exception {
- initTestWithFinancialTransaction();
- Identity identity = new IdentityImpl();
- identity.setName("Code Lutin");
- identity.setAddress("12 Avenue Jules Verne");
- identity.setZipCode("44230");
- identity.setCity("Saint-Sébastien-sur-Loire");
- identityService.updateIdentity(identity);
+// @Test
+// public void exportImportAllAsCSVTest() throws Exception {
+// initTestWithFinancialTransaction();
+// Identity identity = new IdentityImpl();
+// identity.setName("Code Lutin");
+// identity.setAddress("12 Avenue Jules Verne");
+// identity.setZipCode("44230");
+// identity.setCity("Saint-Sébastien-sur-Loire");
+// identityService.updateIdentity(identity);
+//
+// String export = exportService.exportBackup("UTF-8");
+//
+// String tmpDir = System.getProperty("java.io.tmpdir")+"/TMP_BACKUP.zip";
+// createZipFile(tmpDir, export);
+//
+//
+// initAbstractTest();
+//
+// List<ImportResult> importResults;
+// importResults = importAllFromZipFile(tmpDir);
+//
+// String[] imported = {"accounts", "entryBooks", "fiscalPeriod", "financialTransactions", "entries", "identity"};
+// Assert.assertEquals(6, importResults.size());
+// for (int i = 0; i < importResults.size(); i++) {
+// ImportResult importResult = importResults.get(i);
+// log.info(imported[i] +": created:"+importResult.getNbCreated() + " updated:" + importResult.getNbUpdated() + " ignoded:" + importResult.getNbIgnored());
+// Assert.assertTrue(importResult.getNbCreated()>0);
+// Assert.assertTrue(importResult.getAllExceptionsByLine().isEmpty());
+// }
+// }
- String export = exportService.exportBackup("UTF-8");
-
- String tmpDir = System.getProperty("java.io.tmpdir")+"/TMP_BACKUP.zip";
- createZipFile(tmpDir, export);
-
-
- initAbstractTest();
-
- List<ImportResult> importResults;
- importResults = importAllFromZipFile(tmpDir);
-
- String[] imported = {"accounts", "entryBooks", "fiscalPeriod", "financialTransactions", "entries", "identity"};
- Assert.assertEquals(6, importResults.size());
- for (int i = 0; i < importResults.size(); i++) {
- ImportResult importResult = importResults.get(i);
- log.info(imported[i] +": created:"+importResult.getNbCreated() + " updated:" + importResult.getNbUpdated() + " ignoded:" + importResult.getNbIgnored());
- Assert.assertTrue(importResult.getNbCreated()>0);
- Assert.assertTrue(importResult.getAllExceptionsByLine().isEmpty());
- }
- }
-
protected void createZipFile(String path, String zippedBase64Str) throws Exception {
byte[] bytes = Base64.decodeBase64(zippedBase64Str);
ByteArrayInputStream inputStream = new ByteArrayInputStream(bytes);
@@ -331,7 +330,7 @@
String identityStreamString = IOUtils.toString(identityStream);
IOUtils.closeQuietly(identityStream);
- results = importService.importBackup(entryBooksStreamString, transactionsStreamString, fiscalPeriodsStreamString, accountsStreamString, entriesStreamString, identityStreamString);
+ results = importService.importBackup(entryBooksStreamString, transactionsStreamString, fiscalPeriodsStreamString, accountsStreamString, entriesStreamString, identityStreamString).getImportResults();
} catch (Exception ex) {
if(log.isInfoEnabled()) {
@@ -350,7 +349,7 @@
ImportResult result;
- result = importService.importFinancialStatementsAsCSV(bcr_developed);
+ result = importService.importFinancialStatementsAsCSV(bcr_developed).getImportResults().get(0);
Assert.assertTrue(result.getAllExceptionsByLine().isEmpty());
Assert.assertEquals(162, result.getNbCreated());
@@ -371,7 +370,7 @@
ImportResult result;
- result = importService.importVATStatementsAsCSV(bcr_developed);
+ result = importService.importVATStatementsAsCSV(bcr_developed).getImportResults().get(0);
Assert.assertTrue(result.getAllExceptionsByLine().isEmpty());
Assert.assertEquals(55, result.getNbCreated());
@@ -411,7 +410,7 @@
InputStream entriesStream = ImportExportServiceTest.class.getResourceAsStream("/ebp/ecritures.txt");
String entriesData = IOUtils.toString(entriesStream, "ISO-8859-1");
- ImportResult result = importService.importEntriesFromEbp(entriesData);
+ ImportResult result = importService.importEntriesFromEbp(entriesData).getImportResults().get(0);
Assert.assertTrue(result.getAllExceptionsByLine().isEmpty());
Assert.assertEquals(28, result.getNbCreated());
entriesStream.close();
@@ -449,7 +448,7 @@
entryBookService.createEntryBook(entryBook);
}
- ImportResult result = importService.importEntryBookFromEbp(entryBookData);
+ ImportResult result = importService.importEntryBookFromEbp(entryBookData).getImportResults().get(0);
Assert.assertEquals(7, result.getNbCreated());
Assert.assertEquals(2, result.getNbUpdated());
EntryBook updatedEntryBook = entryBookService.getEntryBookByCode("AC");
@@ -471,7 +470,7 @@
//test export
String tmpDir = System.getProperty("java.io.tmpdir")+"/";
- String export = exportService.exportEntriesAsEbp(Charset.defaultCharset().name());
+ String export = exportService.exportEntriesAsEbp(Charset.defaultCharset().name()).getExportResults().get(0).getExportData();
InputStream stream = IOUtils.toInputStream(export);
FileOutputStream res = new FileOutputStream(tmpDir + "export-entries-EBP.csv");
IOUtils.copy(stream, res);
@@ -497,7 +496,7 @@
try {
contentStream = new FileInputStream(tmpDir + "export-entries-EBP.csv");
String inputStream = IOUtils.toString(contentStream);
- result = importService.importEntriesFromEbp(inputStream);
+ result = importService.importEntriesFromEbp(inputStream).getImportResults().get(0);
} finally {
IOUtils.closeQuietly(contentStream);
}
Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/ImportBackupException.java (from rev 3894, trunk/lima-business-api/src/main/java/org/chorem/lima/business/NotAllowedLabel.java)
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/ImportBackupException.java (rev 0)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/ImportBackupException.java 2014-08-05 14:07:42 UTC (rev 3895)
@@ -0,0 +1,13 @@
+package org.chorem.lima;
+
+import org.chorem.lima.business.LimaException;
+
+/**
+ * Created by davidcosse on 31/07/14.
+ */
+public class ImportBackupException extends LimaException {
+
+ public ImportBackupException(String message, Throwable cause) {
+ super(message, cause);
+ }
+}
Added: trunk/lima-business-api/src/main/java/org/chorem/lima/business/ExportResult.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/ExportResult.java (rev 0)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/ExportResult.java 2014-08-05 14:07:42 UTC (rev 3895)
@@ -0,0 +1,51 @@
+package org.chorem.lima.business;
+
+import java.io.Serializable;
+import java.rmi.server.ExportException;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Created by davidcosse on 04/08/14.
+ */
+public class ExportResult implements Serializable {
+
+ private static final long serialVersionUID = -7708723957001648683L;
+
+ protected Class fromSource;
+
+ public ExportResult(Class fromSource) {
+ this.fromSource = fromSource;
+ }
+
+ /**
+ * all exception catch during export
+ */
+ protected List<ExportException> exportExceptions;
+
+ /**
+ * export result: data as String
+ */
+ protected String exportData;
+
+ public String getExportData() {
+ return exportData;
+ }
+
+ public void setExportData(String exportData) {
+ this.exportData = exportData;
+ }
+
+ public List<ExportException> getExportExceptions() {
+ return exportExceptions;
+ }
+
+ public void addException(ExportException e) {
+ exportExceptions = exportExceptions == null ? new ArrayList<ExportException>() : exportExceptions;
+ exportExceptions.add(e);
+ }
+
+ public Class getFromSource() {
+ return fromSource;
+ }
+}
Deleted: trunk/lima-business-api/src/main/java/org/chorem/lima/business/ImportException.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/ImportException.java 2014-08-04 15:06:04 UTC (rev 3894)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/ImportException.java 2014-08-05 14:07:42 UTC (rev 3895)
@@ -1,34 +0,0 @@
-package org.chorem.lima.business;
-
-/*
- * #%L
- * Lima :: business API
- * %%
- * Copyright (C) 2008 - 2014 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-import java.util.HashMap;
-import java.util.Map;
-/**
- * Created by davidcosse on 24/07/14.
- */
-public class ImportException extends LimaException {
-
- protected Map<Integer, LimaException> allExceptions = new HashMap<>();
-
-}
Added: trunk/lima-business-api/src/main/java/org/chorem/lima/business/ImportExportResults.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/ImportExportResults.java (rev 0)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/ImportExportResults.java 2014-08-05 14:07:42 UTC (rev 3895)
@@ -0,0 +1,73 @@
+package org.chorem.lima.business;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * Created by davidcosse on 04/08/14.
+ */
+public class ImportExportResults implements Serializable{
+
+ private static final long serialVersionUID = -5941835433984457107L;
+ List<ImportResult> importResults;
+
+ List<ExportResult> exportResults;
+
+ public List<ImportResult> getImportResults() {
+ return importResults;
+ }
+
+ public List<ExportResult> getExportResults() {
+ return exportResults;
+ }
+
+ public void addImportResult(ImportResult result) {
+ importResults = importResults == null ? new ArrayList<ImportResult>() : importResults;
+ importResults.add(result);
+ }
+
+ public void addAllImportResult(Collection<ImportResult> results) {
+ importResults = importResults == null ? new ArrayList<ImportResult>() : importResults;
+ importResults.addAll(results);
+ }
+
+ protected void addExportResult(ExportResult result) {
+ exportResults = exportResults == null ? new ArrayList<ExportResult>() : exportResults;
+ exportResults.add(result);
+ }
+
+ protected void addAllExportResult(Collection<ExportResult> results) {
+ exportResults = exportResults == null ? new ArrayList<ExportResult>() : exportResults;
+ exportResults.addAll(results);
+ }
+
+ public ImportResult createAddAndGetImportResult(Class fromSource) {
+ ImportResult result = new ImportResult(fromSource);
+ addImportResult(result);
+ return result;
+ }
+
+ public ExportResult createAddAndGetExportResult(Class fromSource) {
+ ExportResult result = new ExportResult(fromSource);
+ addExportResult(result);
+ return result;
+ }
+
+ /**
+ * add all ExportResults from the given ImportExportResults to the current ImportExportResults
+ * @param results
+ */
+ public void pushExportResults(ImportExportResults results) {
+ addAllExportResult(results.getExportResults());
+ }
+
+ /**
+ * add all ExportResults from the given ImportExportResults to the current ImportExportResults
+ * @param results
+ */
+ public void pushImportResults(ImportExportResults results) {
+ addAllImportResult(results.getImportResults());
+ }
+}
Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/ImportResult.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/ImportResult.java 2014-08-04 15:06:04 UTC (rev 3894)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/ImportResult.java 2014-08-05 14:07:42 UTC (rev 3895)
@@ -39,13 +39,16 @@
protected int lineIndex;
+ protected Class fromSource;
+
protected Map<Integer, LimaException> allExceptions = new HashMap<>();
- public ImportResult() {
+ public ImportResult(Class fromSource) {
nbCreated = 0;
nbUpdated = 0;
nbIgnored = 0;
lineIndex = 0;
+ this.fromSource = fromSource;
}
public int getNbCreated() {
@@ -83,4 +86,8 @@
public Map<Integer, LimaException> getAllExceptionsByLine() {
return allExceptions;
}
+
+ public Class getFromSource() {
+ return fromSource;
+ }
}
Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/ExportService.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/ExportService.java 2014-08-04 15:06:04 UTC (rev 3894)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/ExportService.java 2014-08-05 14:07:42 UTC (rev 3895)
@@ -25,6 +25,8 @@
package org.chorem.lima.business.api;
+import org.chorem.lima.business.ImportExportResults;
+
/**
* Import export service.
* <p/>
@@ -40,25 +42,25 @@
//####################################### CSV ##############################################
- String exportAccountsAsCSV(String charset);
+ ImportExportResults exportAccountsAsCSV(String charset);
- String exportEntryBooksAsCSV(String charset);
+ ImportExportResults exportEntryBooksAsCSV(String charset);
- String exportFiscalPeriodsAsCSV(String charset);
+ ImportExportResults exportFiscalPeriodsAsCSV(String charset);
- String exportEntriesAsCSV(String charset, Boolean humanReadable);
+ ImportExportResults exportEntriesAsCSV(String charset, Boolean humanReadable);
- String exportFinancialStatements(String charset) throws Exception;
+ ImportExportResults exportFinancialStatements(String charset);
- String exportVatStatements(String charset) throws Exception;
+ ImportExportResults exportVatStatements(String charset);
- String exportBackup(String charset);
+ ImportExportResults exportBackup(String charset);
//####################################### EBP ##############################################
- String exportAccountAsEbp(String charset) throws Exception;
+ ImportExportResults exportAccountAsEbp(String charset);
- String exportEntriesAsEbp(String charset) throws Exception;
+ ImportExportResults exportEntriesAsEbp(String charset);
- String exportEntryBookAsEbp(String charset) throws Exception;
+ ImportExportResults exportEntryBookAsEbp(String charset);
}
Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/ImportService.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/ImportService.java 2014-08-04 15:06:04 UTC (rev 3894)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/ImportService.java 2014-08-05 14:07:42 UTC (rev 3895)
@@ -23,11 +23,9 @@
*/
import org.chorem.lima.business.AlreadyExistAccountException;
-import org.chorem.lima.business.ImportResult;
+import org.chorem.lima.business.ImportExportResults;
import org.chorem.lima.business.InvalidAccountNumberException;
-import java.util.List;
-
/**
* Created by davidcosse on 03/06/14.
*/
@@ -35,27 +33,27 @@
//####################################### CSV ##############################################
- ImportResult importAccountAsCSV(String contents);
+ ImportExportResults importAccountAsCSV(String contents);
- ImportResult importEntryBooksAsCSV(String contents);
+ ImportExportResults importEntryBooksAsCSV(String contents);
- ImportResult importFiscalPeriodsAsCSV(String contents);
+ ImportExportResults importFiscalPeriodsAsCSV(String contents);
- ImportResult importEntriesAsCSV(String contents);
+ ImportExportResults importEntriesAsCSV(String contents);
- ImportResult importFinancialStatementsAsCSV(String contents);
+ ImportExportResults importFinancialStatementsAsCSV(String contents);
- ImportResult importVATStatementsAsCSV(String contents);
+ ImportExportResults importVATStatementsAsCSV(String contents);
- List<ImportResult> importBackup(String entryBooks, String transactions, String fiscalPeriods, String accounts, String entries, String identity) throws AlreadyExistAccountException, InvalidAccountNumberException;
+ ImportExportResults importBackup(String entryBooks, String transactions, String fiscalPeriods, String accounts, String entries, String identity) throws AlreadyExistAccountException, InvalidAccountNumberException;
//####################################### EBP ##############################################
- ImportResult importAccountFromEbp(String datas);
+ ImportExportResults importAccountFromEbp(String datas);
- ImportResult importEntryBookFromEbp(String datas);
+ ImportExportResults importEntryBookFromEbp(String datas);
- ImportResult importEntriesFromEbp(String datas);
+ ImportExportResults importEntriesFromEbp(String datas);
// String importAsPDF(String data,
// ImportExportEntityEnum importExportEntityEnum,
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainView.css
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainView.css 2014-08-04 15:06:04 UTC (rev 3894)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainView.css 2014-08-05 14:07:42 UTC (rev 3895)
@@ -31,18 +31,18 @@
#file{ text : "lima.file"; mnemonic : "F"; }
-#csv { text : "lima.importExport.csv"; }
+#csv { text : "lima.importexport.csv"; }
-#csvImport { text : "lima.importExport.import"; actionIcon : "import"; }
-#csvImportAll { text : "lima.importExport.all"; }
+#csvImport { text : "lima.importexport.import"; actionIcon : "import"; }
+#csvImportAll { text : "lima.importexport.all"; }
#csvImportAccounts { text : "lima.accounts.plan"; actionIcon : "accounts"; }
#csvImportEntryBooks { text : "lima.entryBooks"; actionIcon : "entryBooks"; }
#csvImportFinancialStatements { text : "lima.financialStatements"; actionIcon : "financialStatements"; }
#csvImportVatStatements { text : "lima.vatStatements"; actionIcon : "vatStatements"; }
#csvImportEntries { text : "lima.entries"; actionIcon : "entries" }
-#csvExport { text : "lima.importExport.export"; actionIcon : "export"; }
-#csvExportAll { text : "lima.importExport.all"; }
+#csvExport { text : "lima.importexport.export"; actionIcon : "export"; }
+#csvExportAll { text : "lima.importexport.all"; }
#csvExportAccounts { text : "lima.accounts.plan"; actionIcon : "accounts"; }
#csvExportEntryBooks { text : "lima.entryBooks"; actionIcon : "entryBooks"; }
#csvExportFinancialStatements { text : "lima.financialStatements"; actionIcon : "financialStatements"; }
@@ -50,14 +50,14 @@
#csvExportEntries { text : "lima.entries"; actionIcon : "entries" }
-#ebp { text : "lima.importExport.ebp"; }
+#ebp { text : "lima.importexport.ebp"; }
-#ebpImport { text : "lima.importExport.import"; actionIcon : "import"; }
+#ebpImport { text : "lima.importexport.import"; actionIcon : "import"; }
#ebpImportAccounts { text : "lima.accounts.plan"; actionIcon : "accounts"; }
#ebpImportEntryBooks { text : "lima.entryBooks"; actionIcon : "entryBooks"; }
#ebpImportEntries { text : "lima.entries"; actionIcon : "entries" }
-#ebpExport { text : "lima.importExport.export"; actionIcon : "export"; }
+#ebpExport { text : "lima.importexport.export"; actionIcon : "export"; }
#ebpExportAccounts { text : "lima.accounts.plan"; actionIcon : "accounts"; }
#ebpExportEntryBooks { text : "lima.entryBooks"; actionIcon : "entryBooks"; }
#ebpExportEntries { text : "lima.entries"; actionIcon : "entries" }
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java 2014-08-04 15:06:04 UTC (rev 3894)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java 2014-08-05 14:07:42 UTC (rev 3895)
@@ -27,16 +27,26 @@
import com.google.common.base.Charsets;
import com.google.common.base.Strings;
-import org.apache.commons.codec.binary.Base64;
+import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
-import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.chorem.lima.ImportBackupException;
import org.chorem.lima.LimaTechnicalException;
-import org.chorem.lima.business.ImportEbpException;
+import org.chorem.lima.business.ExportResult;
+import org.chorem.lima.business.ImportExportResults;
import org.chorem.lima.business.ImportResult;
+import org.chorem.lima.business.LimaException;
import org.chorem.lima.business.api.ExportService;
import org.chorem.lima.business.api.ImportService;
+import org.chorem.lima.entity.Account;
+import org.chorem.lima.entity.Entry;
+import org.chorem.lima.entity.EntryBook;
+import org.chorem.lima.entity.FinancialStatement;
+import org.chorem.lima.entity.FinancialTransaction;
+import org.chorem.lima.entity.FiscalPeriod;
+import org.chorem.lima.entity.Identity;
+import org.chorem.lima.entity.VatStatement;
import org.chorem.lima.enums.EncodingEnum;
import org.chorem.lima.enums.ImportExportEnum;
import org.chorem.lima.service.LimaServiceFactory;
@@ -46,7 +56,6 @@
import javax.swing.*;
import java.awt.*;
import java.io.BufferedWriter;
-import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
@@ -54,12 +63,16 @@
import java.io.InputStream;
import java.io.OutputStreamWriter;
import java.nio.charset.Charset;
+import java.rmi.server.ExportException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
+import java.util.Map;
+import java.util.Set;
import java.util.concurrent.ExecutionException;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
+import java.util.zip.ZipOutputStream;
import static org.nuiton.i18n.I18n.t;
@@ -90,6 +103,8 @@
protected ErrorHelper errorHelper;
+ public static final String JAVA_IO_TMPDIR = System.getProperty("java.io.tmpdir")+"/";
+
public ImportExport(Component view) {
viewComponent = view;
@@ -115,7 +130,7 @@
*/
public void importExport(ImportExportEnum importExportMethode, String file, boolean verbose) {
final ImportExportEnum importExportMethodeF = importExportMethode;
- final Charset charset = Charsets.UTF_8;
+ final Charset defaultCharset = Charsets.UTF_8;
if (Strings.isNullOrEmpty(file)) {
file = chooseFile(importExportMethode.getImportMode(), importExportMethode);
}
@@ -124,128 +139,101 @@
final String filePath = file;
final Boolean verboseMode = verbose;
final Boolean importMode = importExportMethode.getImportMode();
- new SwingWorker<String, Void>() {
+
+ new SwingWorker<ImportExportResults, Void>() {
+
@Override
- protected String doInBackground() {
- String datas;
- // TODO DCossé 24/07/14 remove it
- String result = "";
- ImportResult importResult;
+ protected ImportExportResults doInBackground() {
+ ImportExportResults results = new ImportExportResults();
try {
switch (importExportMethodeF) {
//####################################### CSV ##############################################
case CSV_ACCOUNTCHARTS_EXPORT:
- datas = exportService.exportAccountsAsCSV(charset.name());
- createFile(filePath, charset.name(), datas);
+ results.pushExportResults(exportService.exportAccountsAsCSV(defaultCharset.name()));
+ createFile(filePath, defaultCharset.name(), results.getExportResults().get(0).getExportData());
break;
case CSV_ACCOUNTCHARTS_IMPORT:
- datas = extractFile(filePath, charset.name());
- importResult = importService.importAccountAsCSV(datas);
- // TODO DCossé 24/07/14 change result
- result = "SUCCESS";
+ String content = loadFile(filePath, defaultCharset.name());
+ results.pushImportResults(importService.importAccountAsCSV(content));
break;
-
case CSV_ENTRYBOOKS_EXPORT:
- datas = exportService.exportEntryBooksAsCSV(charset.name());
- createFile(filePath, charset.name(), datas);
+ results.pushExportResults(exportService.exportEntryBooksAsCSV(defaultCharset.name()));
+ createFile(filePath, defaultCharset.name(), results.getExportResults().get(0).getExportData());
break;
case CSV_ENTRYBOOKS_IMPORT:
- datas = extractFile(filePath, charset.name());
- importResult = importService.importEntryBooksAsCSV(datas);
- // TODO DCossé 24/07/14 change result
- result = "SUCCESS";
+ content = loadFile(filePath, defaultCharset.name());
+ results.pushImportResults(importService.importEntryBooksAsCSV(content));
break;
case CSV_ENTRIES_EXPORT:
- datas = exportService.exportEntriesAsCSV(charset.name(), true);
- createFile(filePath, charset.name(), datas);
+ results.pushExportResults(exportService.exportEntriesAsCSV(defaultCharset.name(), true));
+ createFile(filePath, defaultCharset.name(), results.getExportResults().get(0).getExportData());
break;
case CSV_ENTRIES_IMPORT:
- datas = extractFile(filePath, charset.name());
- importResult = importService.importEntriesAsCSV(datas);
- // TODO DCossé 24/07/14 change result
- result = "SUCCESS";
+ content = loadFile(filePath, defaultCharset.name());
+ results.pushImportResults(importService.importEntriesAsCSV(content));
break;
case CSV_ALL_EXPORT:
- datas = exportService.exportBackup(charset.name());
- createZipFile(filePath, datas);
+ exportBackup(filePath, defaultCharset.name());
break;
case CSV_ALL_IMPORT:
- List<ImportResult> allResults = importAllFromZipFile(filePath);
- // TODO DCossé 24/07/14 change result
- result = "SUCCESS";
+ results = importAllFromZipFile(filePath);
break;
case CSV_VAT_EXPORT:
- datas = exportService.exportVatStatements(charset.name());
- createFile(filePath, charset.name(), datas);
+ results.pushExportResults(exportService.exportVatStatements(defaultCharset.name()));
+ createFile(filePath, defaultCharset.name(), results.getExportResults().get(0).getExportData());
break;
case CSV_VAT_IMPORT:
- datas = extractFile(filePath, charset.name());
- importResult = importService.importVATStatementsAsCSV(datas);
- // TODO DCossé 24/07/14 change result
- result = "SUCCESS";
+ content = loadFile(filePath, defaultCharset.name());
+ results.pushImportResults(importService.importVATStatementsAsCSV(content));
break;
case CSV_FINANCIALSTATEMENTS_EXPORT:
- datas = exportService.exportFinancialStatements(charset.name());
- createFile(filePath, charset.name(), datas);
+ results.pushExportResults(exportService.exportFinancialStatements(defaultCharset.name()));
+ createFile(filePath, defaultCharset.name(), results.getExportResults().get(0).getExportData());
break;
case CSV_FINANCIALSTATEMENTS_IMPORT:
- datas = extractFile(filePath, charset.name());
- importResult = importService.importFinancialStatementsAsCSV(datas);
- // TODO DCossé 24/07/14 change result
- result = "SUCCESS";
+ content = loadFile(filePath, defaultCharset.name());
+ results.pushImportResults(importService.importFinancialStatementsAsCSV(content));
break;
//####################################### EBP ##############################################
+ //For windows ebp so using encoding ISOLATIN1
case EBP_ACCOUNTCHARTS_EXPORT:
- //For windows ebp
- datas = exportService.exportAccountAsEbp(charset.name());
- createFile(filePath, EncodingEnum.ISOLATIN1.getEncoding(), datas);
+ results.pushExportResults(exportService.exportAccountAsEbp(defaultCharset.name()));
+ createFile(filePath, EncodingEnum.ISOLATIN1.getEncoding(), results.getExportResults().get(0).getExportData());
break;
case EBP_ACCOUNTCHARTS_IMPORT:
- //For windows ebp
- datas = extractFile(filePath, EncodingEnum.ISOLATIN1.getEncoding());
- importResult = importService.importAccountFromEbp(datas);
- // TODO DCossé 24/07/14 change result
- result = "SUCCESS";
+ content = loadFile(filePath, EncodingEnum.ISOLATIN1.getEncoding());
+ results.pushImportResults(importService.importAccountFromEbp(content));
break;
case EBP_ENTRYBOOKS_EXPORT:
- datas = exportService.exportEntryBookAsEbp(charset.name());
- createFile(filePath, EncodingEnum.ISOLATIN1.getEncoding(), datas);
+ results.pushExportResults(exportService.exportEntryBookAsEbp(defaultCharset.name()));
+ createFile(filePath, EncodingEnum.ISOLATIN1.getEncoding(), results.getExportResults().get(0).getExportData());
break;
case EBP_ENTRYBOOKS_IMPORT:
- datas = extractFile(filePath, EncodingEnum.ISOLATIN1.getEncoding());
- importResult = importService.importEntryBookFromEbp(datas);
- // TODO DCossé 24/07/14 change result
- result = "SUCCESS";
+ content = loadFile(filePath, EncodingEnum.ISOLATIN1.getEncoding());
+ results.pushImportResults(importService.importEntryBookFromEbp(content));
break;
case EBP_ENTRIES_EXPORT:
- //For windows ebp
- datas = exportService.exportEntriesAsEbp(charset.name());
- createFile(filePath, EncodingEnum.ISOLATIN1.getEncoding(), datas);
+ results.pushExportResults(exportService.exportEntriesAsEbp(defaultCharset.name()));
+ createFile(filePath, EncodingEnum.ISOLATIN1.getEncoding(), results.getExportResults().get(0).getExportData());
break;
case EBP_ENTRIES_IMPORT:
- //For windows ebp
- datas = extractFile(filePath, EncodingEnum.ISOLATIN1.getEncoding());
- importResult = importService.importEntriesFromEbp(datas);
- // TODO DCossé 24/07/14 change result
- result = "SUCCESS";
+ content = loadFile(filePath, EncodingEnum.ISOLATIN1.getEncoding());
+ results.pushImportResults(importService.importEntriesFromEbp(content));
break;
}
- } catch (ImportEbpException e) {
- errorHelper.showErrorMessage(t(e.getMessage()));
- } catch (Exception e) {
- // TODO DCossé 01/08/14 it should be an other exception
+ } catch (ExportException e) {
e.printStackTrace();
}
- return result;
+ return results;
}
@Override
@@ -261,46 +249,89 @@
// display result dialog
if (verboseMode) {
- String result = get();
- if (importMode && StringUtils.isBlank(result)) {
+ ImportExportResults results = get();
+ if (importMode && results == null) {
JOptionPane.showMessageDialog(viewComponent, t("lima.ui.importexport.importerror"),
t("lima.ui.importexport.importtitle"), JOptionPane.ERROR_MESSAGE);
} else {
if (importMode) {
- if (log.isDebugEnabled()) {
- log.debug("importMode");
- log.debug("importExportMethodeF : " + importExportMethodeF);
- }
- //special message when importing a VAT PDF
- if (importExportMethodeF.equals(ImportExportEnum.PDF_VAT_IMPORT)) {
+ List<ImportResult> resultList = results.getImportResults();
+ if (resultList != null) {
if (log.isDebugEnabled()) {
- log.debug("PDF_VAT_IMPORT");
+ log.debug("importMode");
+ log.debug("importExportMethodeF : " + importExportMethodeF);
+ for (ImportResult result : resultList) {
+ String importedEntity = result.getFromSource().getSimpleName();
+ log.debug(importedEntity + " nbCreated: " + result.getNbCreated());
+ log.debug(importedEntity + " nbUpdated: " + result.getNbUpdated());
+ log.debug(importedEntity + " nbIgnored: " + result.getNbIgnored());
+ }
}
+ if (log.isDebugEnabled()) {
+ log.debug("import.terminated");
+ }
+
+ String message = "Import";
+ for (ImportResult result : resultList) {
+ Class fromSource = result.getFromSource();
+ message += getFromSourceMessage(fromSource)+"\n";
+ message += t("lima.ui.importexport.import.nbCreated", result.getNbCreated())+"\n";
+ message += t("lima.ui.importexport.import.nbUpdated", result.getNbUpdated())+"\n";
+ message += t("lima.ui.importexport.import.nbIgnored", result.getNbIgnored())+"\n";
+ Map<Integer, LimaException> exceptionsByLine = result.getAllExceptionsByLine();
+ if (exceptionsByLine != null) {
+ Set<Integer> lines = exceptionsByLine.keySet();
+ for (Integer line : lines) {
+ message += t("lima.ui.importexport.import.exceptions", line)+"\n";
+ if (log.isErrorEnabled()) {
+ LimaException importException = exceptionsByLine.get(line);
+ log.error(importException.getMessage());
+ }
+ }
+ }
+ }
+
JOptionPane.showMessageDialog(
waitView,
- t("lima.ui.importexport.import.vatpdfimport"),
+ message,
t("lima.ui.importexport.import"),
JOptionPane.INFORMATION_MESSAGE);
- } else {
+ }
+ } else {
+ List<ExportResult> exportResults = results.getExportResults();
+ if (exportResults != null) {
if (log.isDebugEnabled()) {
- log.debug("import.terminated");
+ log.debug("export.terminated");
+
}
+ String message = "Export";
+ for (ExportResult result : exportResults) {
+ Class fromSource = result.getFromSource();
+ message += getFromSourceMessage(fromSource);
+ List<ExportException> exportExceptions = result.getExportExceptions();
+ if (exportExceptions != null && !exportExceptions.isEmpty()) {
+ message += t("lima.ui.importexport.export.exception")+"\n";
+ if (log.isErrorEnabled()) {
+ for (ExportException exportException : exportExceptions) {
+ log.error(exportException.getMessage());
+ }
+ }
+ }
+ }
+
JOptionPane.showMessageDialog(
waitView,
- t("lima.ui.importexport.import.terminated"),
- t("lima.ui.importexport.import"),
+ t("lima.ui.importexport.export.terminated"),
+ message,
JOptionPane.INFORMATION_MESSAGE);
+ } else {
+ if (log.isDebugEnabled()) {
+ log.debug("export.terminated");
+ log.debug(t("lima.ui.importexport.no.result"));
+ }
}
- } else {
- if (log.isDebugEnabled()) {
- log.debug("export.terminated");
- }
- JOptionPane.showMessageDialog(
- waitView,
- t("lima.ui.importexport.export.terminated"),
- t("lima.ui.importexport.export"),
- JOptionPane.INFORMATION_MESSAGE);
+
}
}
}
@@ -315,7 +346,29 @@
}
}
+ private String getFromSourceMessage(Class fromSource) {
+ String message;
+ if (fromSource.equals(Account.class)){
+ message = t("lima.ui.importexport.account")+"\n";
+ } else if (fromSource.equals(Entry.class)) {
+ message = t("lima.ui.importexport.entry")+"\n";
+ }else if (fromSource.equals(FinancialStatement.class)) {
+ message = t("lima.ui.importexport.financialStatement")+"\n";
+ } else if (fromSource.equals(FinancialTransaction.class)) {
+ message = t("lima.ui.importexport.financialTransaction")+"\n";
+ } else if (fromSource.equals(FiscalPeriod.class)) {
+ message = t("lima.ui.importexport.fiscalPeriod")+"\n";
+ } else if (fromSource.equals(Identity.class)) {
+ message = t("lima.ui.importexport.identity")+"\n";
+ } else if (fromSource.equals(VatStatement.class)) {
+ message = t("lima.ui.importexport.vatStatement")+"\n";
+ } else {
+ throw new LimaTechnicalException("Source not know");
+ }
+ return message;
+ }
+
/**
* open choose file dialog with appropriate file mode view
* folders for export or folders+files for import
@@ -364,8 +417,6 @@
}
}
-
-
return filePath;
}
@@ -377,7 +428,7 @@
* @param charset
* @param datas
*/
- public void createFile(String filePath, String charset, String datas) {
+ protected File createFile(String filePath, String charset, String datas) {
File file = new File(filePath);
BufferedWriter out = null;
try {
@@ -392,7 +443,7 @@
} finally {
IOUtils.closeQuietly(out);
}
-
+ return file;
}
/**
@@ -402,7 +453,7 @@
* @param charset
* @return
*/
- public String extractFile(String filePath, String charset) {
+ protected String loadFile(String filePath, String charset) {
String result = null;
InputStream is = null;
try {
@@ -420,18 +471,38 @@
return result;
}
- protected void createZipFile(String path, String zippedBase64Str) {
+ protected void exportBackup(String path, String charset) throws ExportException {
+ ImportExportResults results = exportService.exportBackup(charset);
+
+ ZipOutputStream export = null;
try {
- byte[] bytes = Base64.decodeBase64(zippedBase64Str);
- ByteArrayInputStream inputStream = new ByteArrayInputStream(bytes);
SimpleDateFormat dateFormat = new SimpleDateFormat("dd-MM-yyyy HH:mm:ss");
- IOUtils.copy(inputStream, new FileOutputStream(path+"/LIMA-BACKUP-"+ dateFormat.format(new Date())));
+ FileOutputStream fos = new FileOutputStream(path + "/LIMA-BACKUP-"+ dateFormat.format(new Date()));
+ export = new ZipOutputStream(fos);
+ for (ExportResult result : results.getExportResults()) {
+ File file = createFile(JAVA_IO_TMPDIR + result.getFromSource().getSimpleName(), charset, result.getExportData());
+ if (file != null) {
+ ZipEntry ze= new ZipEntry(file.getName());
+ export.putNextEntry(ze);
+ int len;
+ byte[] buffer = new byte[1024];
+ FileInputStream stream = new FileInputStream(file);
+ while ((len = stream.read(buffer)) > 0) {
+ export.write(buffer, 0, len);
+ }
+ stream.close();
+ FileUtils.forceDelete(file);
+ }
+ }
+ export.flush();
} catch (IOException e) {
- throw new LimaTechnicalException("could not zip file", e);
+ e.printStackTrace();
+ } finally {
+ IOUtils.closeQuietly(export);
}
}
- protected List<ImportResult> importAllFromZipFile(String filePath) {
+ protected ImportExportResults importAllFromZipFile(String filePath) {
ZipInputStream zipInputStream = null;
String tmpDir = System.getProperty("java.io.tmpdir")+"/";
FileInputStream inputStream = null;
@@ -441,31 +512,16 @@
zipInputStream = new ZipInputStream(inputStream);
ZipEntry entry;
+
while ((entry = zipInputStream.getNextEntry()) != null) {
byte[] buffer = new byte[2048];
- FileOutputStream fileoutputstream = null;
+ FileOutputStream fileoutputstream = new FileOutputStream(tmpDir + entry.getName() + ".csv");
- if (entry.getName().equalsIgnoreCase("accounts.csv")) {
- fileoutputstream = new FileOutputStream(tmpDir + "accounts.csv");
- } else if (entry.getName().equalsIgnoreCase("entryBooks.csv")) {
- fileoutputstream = new FileOutputStream(tmpDir + "entryBooks.csv");
- } else if (entry.getName().equalsIgnoreCase("fiscalPeriod.csv")) {
- fileoutputstream = new FileOutputStream(tmpDir + "fiscalPeriods.csv");
- } else if (entry.getName().equalsIgnoreCase("financialTransactions.csv")) {
- fileoutputstream = new FileOutputStream(tmpDir + "financialTransactions.csv");
- } else if (entry.getName().equalsIgnoreCase("entries.csv")) {
- fileoutputstream = new FileOutputStream(tmpDir + "entries.csv");
- } else if (entry.getName().equalsIgnoreCase("identity.csv")) {
- fileoutputstream = new FileOutputStream(tmpDir + "identity.csv");
- }
int n;
-
- if (fileoutputstream != null) {
- while ((n = zipInputStream.read(buffer, 0, 2048)) > -1) {
- fileoutputstream.write(buffer, 0, n);
- }
- fileoutputstream.close();
+ while ((n = zipInputStream.read(buffer, 0, 2048)) > -1) {
+ fileoutputstream.write(buffer, 0, n);
}
+ fileoutputstream.close();
zipInputStream.closeEntry();
}
@@ -476,30 +532,30 @@
IOUtils.closeQuietly(inputStream);
}
InputStream transactionsStream, entryBooksStream, fiscalPeriodsStream, entriesStream, accountsStream, identityStream;
- List<ImportResult> results;
+ ImportExportResults results = null;
try {
- entryBooksStream = new FileInputStream(tmpDir + "entryBooks.csv");
+ entryBooksStream = new FileInputStream(tmpDir + EntryBook.class.getSimpleName() +".csv");
String entryBooksStreamString = IOUtils.toString(entryBooksStream);
IOUtils.closeQuietly(entryBooksStream);
// import
- transactionsStream = new FileInputStream(tmpDir + "financialTransactions.csv");
+ transactionsStream = new FileInputStream(tmpDir + FinancialTransaction.class.getSimpleName() +".csv");
String transactionsStreamString = IOUtils.toString(transactionsStream);
IOUtils.closeQuietly(transactionsStream);
- fiscalPeriodsStream = new FileInputStream(tmpDir + "fiscalPeriods.csv");
+ fiscalPeriodsStream = new FileInputStream(tmpDir + FiscalPeriod.class.getSimpleName() +".csv");
String fiscalPeriodsStreamString = IOUtils.toString(fiscalPeriodsStream);
IOUtils.closeQuietly(fiscalPeriodsStream);
- accountsStream = new FileInputStream(tmpDir + "accounts.csv");
+ accountsStream = new FileInputStream(tmpDir + Account.class.getSimpleName() +".csv");
String accountsStreamString = IOUtils.toString(accountsStream);
IOUtils.closeQuietly(accountsStream);
- entriesStream = new FileInputStream(tmpDir + "entries.csv");
+ entriesStream = new FileInputStream(tmpDir + Entry.class.getSimpleName() +".csv");
String entriesStreamString = IOUtils.toString(entriesStream);
IOUtils.closeQuietly(entriesStream);
- identityStream = new FileInputStream(tmpDir + "identity.csv");
+ identityStream = new FileInputStream(tmpDir + Identity.class.getSimpleName() + ".csv");
String identityStreamString = IOUtils.toString(identityStream);
IOUtils.closeQuietly(identityStream);
@@ -509,7 +565,9 @@
if(log.isInfoEnabled()) {
log.info(ex);
}
- throw new LimaTechnicalException("could not import files", ex);
+ results = new ImportExportResults();
+ ImportResult result = results.createAddAndGetImportResult(Account.class);
+ result.addException(new ImportBackupException("could not import files", ex));
}
return results;
}
Modified: trunk/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties
===================================================================
--- trunk/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties 2014-08-04 15:06:04 UTC (rev 3894)
+++ trunk/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties 2014-08-05 14:07:42 UTC (rev 3895)
@@ -343,14 +343,13 @@
lima.identity.phoneNumber=Phone number
lima.identity.vatNumber=VAT number
lima.identity.zipCode=Zip code
-lima.importExport.all=
-lima.importExport.csv=
-lima.importExport.ebp=
-lima.importExport.export=
-lima.importExport.import=
+lima.importexport.all=
lima.importexport.choiceencoding=
+lima.importexport.csv=
+lima.importexport.ebp=
lima.importexport.export=
lima.importexport.export.terminated=
+lima.importexport.import=
lima.importexport.import.alreadyExistFinancialStatement=Category with name %s exists for parent %s.
lima.importexport.usevatpdf=
lima.init.closed=Lima closed at %1$s
@@ -572,29 +571,40 @@
lima.ui.fullscreen=
lima.ui.home.entryBooks.info=
lima.ui.home.entryBooks.info.one=
-lima.ui.importExport.all=
-lima.ui.importExport.csv=
-lima.ui.importExport.ebp=
-lima.ui.importExport.export=
-lima.ui.importExport.import=
+lima.ui.importexport.account=Accounts import completed.
lima.ui.importexport.accountcharts=Accounts chart
lima.ui.importexport.all=All
lima.ui.importexport.csv=Import/Export CSV
lima.ui.importexport.defaultentrybooks=Defaults entrybooks
lima.ui.importexport.ebp=Import/Export EBP
lima.ui.importexport.entries=Entries
+lima.ui.importexport.entry=Entries import completed.
lima.ui.importexport.entrybooks=Entry books
lima.ui.importexport.export=Export
+lima.ui.importexport.export.exception=
+lima.ui.importexport.export.exceptions=Export failed.
+lima.ui.importexport.export.import.exceptions=Export has failed.
lima.ui.importexport.export.terminated=Export terminated
+lima.ui.importexport.financialStatement=Financial transactions import completed.
+lima.ui.importexport.financialTransaction=
lima.ui.importexport.financialstatements=FinancialStatements chart
lima.ui.importexport.financialtransactions=Moves
+lima.ui.importexport.fiscalPeriod=Fiscal periods import completed.
+lima.ui.importexport.identity=Identity import completed.
lima.ui.importexport.import=
+lima.ui.importexport.import.exception=
+lima.ui.importexport.import.exceptions=The line %d could not be imported.
+lima.ui.importexport.import.nbCreated=%d created
+lima.ui.importexport.import.nbIgnored=%d ignored
+lima.ui.importexport.import.nbUpdated=%d updated
lima.ui.importexport.import.terminated=Import terminated
lima.ui.importexport.import.vatpdfimport=The PDF has been imported. It can be found inside the Lima resources directory
lima.ui.importexport.importcsv=
lima.ui.importexport.importebp=
lima.ui.importexport.importerror=An error has occured during import
lima.ui.importexport.importtitle=
+lima.ui.importexport.no.result=No result found.
+lima.ui.importexport.vatStatement=VTA transactions import completed.
lima.ui.importexport.vatstatements=VAT chart
lima.ui.importexport.wait=Job in progress…
lima.ui.importexport.waittitle=
Modified: trunk/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties
===================================================================
--- trunk/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties 2014-08-04 15:06:04 UTC (rev 3894)
+++ trunk/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties 2014-08-05 14:07:42 UTC (rev 3895)
@@ -301,15 +301,14 @@
lima.identity.phoneNumber=n° Tel
lima.identity.vatNumber=n° TVA
lima.identity.zipCode=Code Postal
-lima.importExport.all=Tout
-lima.importExport.csv=Import/Export CSV
-lima.importExport.ebp=Import/Export EBP
-lima.importExport.export=Exporter
-lima.importExport.import=Importer
+lima.importexport.all=Tout
lima.importexport.choiceencoding=Choix de l'encodage
-lima.importexport.export=
-lima.importexport.export.terminated=
-lima.importexport.import.alreadyExistFinancialStatement=
+lima.importexport.csv=Import/Export CSV
+lima.importexport.ebp=Import/Export EBP
+lima.importexport.export=Exporter
+lima.importexport.export.terminated=Export terminé
+lima.importexport.import=Importer
+lima.importexport.import.alreadyExistFinancialStatement=La transaction financière %s existe déjà sur le parent %s.
lima.importexport.import.alreadyExistVatStatement=
lima.importexport.usevatpdf=Êtes-vous sûr de vouloir utiliser ce pdf pour la déclaration de TVA ?
lima.init.closed=Lima fermé à %1$s
@@ -376,7 +375,7 @@
lima.ui.account.removeaccountconfirm=Voulez-vous supprimer le compte %s ?
lima.ui.account.removeaccounttitle=Suppression d'un compte
lima.ui.account.shortened=Plan comptable abrégé
-lima.ui.account.update.error.invalidAccountNumber=Le numéro du compt %1$s n'est pas valide
+lima.ui.account.update.error.invalidAccountNumber=Le numéro du compte %1$s n'est pas valide
lima.ui.account.updateaccounttitle=Modification d'un compte
lima.ui.common.amountcredit=Total Crédit
lima.ui.common.amountdebit=Total Débit
@@ -473,8 +472,8 @@
lima.ui.fiscalPeriod.add.error.notBeginNextDayOfLastFiscalPeriod=La date de début de l'exercice doit suivre la date de fin de l'exercice précédent le %1$te/%1$tm/%1$tY
lima.ui.fiscalPeriod.block.error.AlreadyLockedFiscalPeriod=L'exercice est déjà clôturés
lima.ui.fiscalPeriod.block.error.lastUnlockedFiscalPeriod=L'exercice prédent doit être clôturé
-lima.ui.fiscalPeriod.buttonback=
-lima.ui.fiscalPeriod.buttonnext=
+lima.ui.fiscalPeriod.buttonback=←
+lima.ui.fiscalPeriod.buttonnext=→
lima.ui.fiscalPeriod.delete.error.noEmptyFiscalPeriod=Impossible de supprimer un exercice avec des transactions (%1$s).
lima.ui.fiscalperiod.addfiscalperiod.morethan12=La période sélectionnée n'est pas de 12 mois, voulez-vous continuer ?
lima.ui.fiscalperiod.addfiscalperiodtitle=Nouvel exercice
@@ -499,17 +498,33 @@
lima.ui.fiscalperiod.modifyfiscalperiodtitle=Modification de l'exercice
lima.ui.fiscalperiod.open=Ouvert
lima.ui.fiscalperiod.status=Statut
+lima.ui.importexport.account=des comptes terminé.
lima.ui.importexport.defaultentrybooks=Journaux par défaut
+lima.ui.importexport.entry=des entrées terminé.
lima.ui.importexport.entrybooks=Journaux
lima.ui.importexport.export=Exporter
+lima.ui.importexport.export.action=Export
+lima.ui.importexport.export.exception=
+lima.ui.importexport.export.exceptions=Echec de l'export.
lima.ui.importexport.export.terminated=Export terminé
+lima.ui.importexport.financialStatement=des transaction financière terminé.
+lima.ui.importexport.financialTransaction=
+lima.ui.importexport.fiscalPeriod=des periodes fiscales terminé.
+lima.ui.importexport.identity=de l'identité terminé.
lima.ui.importexport.import=Importer
+lima.ui.importexport.import.action=Import
+lima.ui.importexport.import.exceptions=La ligne %d n'a pu être impotée.
+lima.ui.importexport.import.nbCreated=%d créés
+lima.ui.importexport.import.nbIgnored=%d ignorés
+lima.ui.importexport.import.nbUpdated=%d mis à jours
lima.ui.importexport.import.terminated=Import terminé
lima.ui.importexport.import.vatpdfimport=Le PDF a bien été importé dans le répertoire des ressources de Lima
lima.ui.importexport.importcsv=Import/Export CSV
lima.ui.importexport.importebp=Import/Export EBP
lima.ui.importexport.importerror=Une erreur est survenue lors de l'import
lima.ui.importexport.importtitle=Erreur d'import
+lima.ui.importexport.no.result=Aucun résultat trouvé.
+lima.ui.importexport.vatStatement=des transactions de tva terminé.
lima.ui.importexport.wait=Traitement en cours…
lima.ui.importexport.waittitle=Traitement en cours
lima.ui.lettering.account=Comptes
1
0
Author: dcosse
Date: 2014-08-04 17:06:04 +0200 (Mon, 04 Aug 2014)
New Revision: 3894
Url: http://forge.chorem.org/projects/lima/repository/revisions/3894
Log:
mont?\195?\169 de version de nuiton-csv
Modified:
trunk/pom.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2014-08-04 14:57:17 UTC (rev 3893)
+++ trunk/pom.xml 2014-08-04 15:06:04 UTC (rev 3894)
@@ -176,7 +176,7 @@
<nuitonConfigVersion>3.0-alpha-4</nuitonConfigVersion>
<nuitonDecoratorVersion>3.0-alpha-3</nuitonDecoratorVersion>
<nuitonProfilingVersion>3.0</nuitonProfilingVersion>
- <nuitonCsvVersion>3.0-rc-3</nuitonCsvVersion>
+ <nuitonCsvVersion>3.0-rc-4</nuitonCsvVersion>
<eugeneVersion>3.0-SNAPSHOT</eugeneVersion>
<topiaVersion>3.0-SNAPSHOT</topiaVersion>
<nuitonI18nVersion>3.3</nuitonI18nVersion>
1
0
Author: dcosse
Date: 2014-08-04 16:57:17 +0200 (Mon, 04 Aug 2014)
New Revision: 3893
Url: http://forge.chorem.org/projects/lima/repository/revisions/3893
Log:
mont?\195?\169 de version de jettyPluginVersion, nuitonConfigVersion, nuitonProfilingVersion, nuitonCsvVersion, nuitonI18nVersion, jdomVersion
Modified:
trunk/pom.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2014-08-04 14:18:32 UTC (rev 3892)
+++ trunk/pom.xml 2014-08-04 14:57:17 UTC (rev 3893)
@@ -171,22 +171,23 @@
<maven.compiler.target>${javaVersion}</maven.compiler.target>
<!-- customized libs version -->
- <jettyPluginVersion>9.1.5.v20140505</jettyPluginVersion>
+ <jettyPluginVersion>9.2.2.v20140723</jettyPluginVersion>
<nuitonUtilsVersion>3.0-SNAPSHOT</nuitonUtilsVersion>
- <nuitonConfigVersion>3.0-alpha-2</nuitonConfigVersion>
+ <nuitonConfigVersion>3.0-alpha-4</nuitonConfigVersion>
<nuitonDecoratorVersion>3.0-alpha-3</nuitonDecoratorVersion>
- <nuitonProfilingVersion>2.7.1</nuitonProfilingVersion>
- <nuitonCsvVersion>3.0-rc-2</nuitonCsvVersion>
+ <nuitonProfilingVersion>3.0</nuitonProfilingVersion>
+ <nuitonCsvVersion>3.0-rc-3</nuitonCsvVersion>
<eugeneVersion>3.0-SNAPSHOT</eugeneVersion>
- <nuitonI18nVersion>3.1</nuitonI18nVersion>
<topiaVersion>3.0-SNAPSHOT</topiaVersion>
+ <nuitonI18nVersion>3.3</nuitonI18nVersion>
<swinglabsVersion>3.0.4</swinglabsVersion>
+ <!-- h2Version 1.4.180 is beta, and db created with 1.3 are not compatible yet so don't use it for the moment-->
<h2Version>1.3.176</h2Version>
- <hibernateVersion>4.3.5.Final</hibernateVersion>
+ <hibernateVersion>4.3.6.Final</hibernateVersion>
<openejbJavaeeApiVersion>6.0-6</openejbJavaeeApiVersion>
<dom4jVersion>1.6.1</dom4jVersion>
- <jdomVersion>2.0.2</jdomVersion>
+ <jdomVersion>2.0.5</jdomVersion>
<openCsvVersion>2.3</openCsvVersion>
<itextVersion>4.2.1</itextVersion>
<nuitonWidgetsVersion>1.1.1</nuitonWidgetsVersion>
1
0