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
July 2014
- 3 participants
- 53 discussions
r3887 - in trunk: lima-business/src/main/java/org/chorem/lima/business/ejb lima-business/src/main/java/org/chorem/lima/business/ejb/csv lima-business/src/test/java/org/chorem/lima/business lima-business-api/src/main/java/org/chorem/lima/business/api lima-swing/src/main/java/org/chorem/lima/ui/importexport
by dcosse@users.chorem.org 31 Jul '14
by dcosse@users.chorem.org 31 Jul '14
31 Jul '14
Author: dcosse
Date: 2014-07-31 21:50:37 +0200 (Thu, 31 Jul 2014)
New Revision: 3887
Url: http://forge.chorem.org/projects/lima/repository/revisions/3887
Log:
refs #1032 import export de l'identit?\195?\169
Added:
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/csv/IdentityModel.java
Modified:
trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/NewImportService.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/NewExportServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/NewImportServiceImpl.java
trunk/lima-business/src/test/java/org/chorem/lima/business/AbstractLimaTest.java
trunk/lima-business/src/test/java/org/chorem/lima/business/NewImportExportServiceTest.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/NewExportServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/NewExportServiceImpl.java 2014-07-31 16:45:29 UTC (rev 3886)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/NewExportServiceImpl.java 2014-07-31 19:50:37 UTC (rev 3887)
@@ -34,6 +34,7 @@
import org.chorem.lima.business.api.EntryBookService;
import org.chorem.lima.business.api.FinancialStatementService;
import org.chorem.lima.business.api.FinancialTransactionService;
+import org.chorem.lima.business.api.IdentityService;
import org.chorem.lima.business.api.NewExportService;
import org.chorem.lima.business.api.VatStatementService;
import org.chorem.lima.business.ejb.csv.AccountModel;
@@ -42,6 +43,7 @@
import org.chorem.lima.business.ejb.csv.FinancialStatementModel;
import org.chorem.lima.business.ejb.csv.FinancialTransactionModel;
import org.chorem.lima.business.ejb.csv.FiscalPeriodModel;
+import org.chorem.lima.business.ejb.csv.IdentityModel;
import org.chorem.lima.business.ejb.csv.VatStatementModel;
import org.chorem.lima.entity.Account;
import org.chorem.lima.entity.AccountTopiaDao;
@@ -54,6 +56,7 @@
import org.chorem.lima.entity.FinancialTransactionTopiaDao;
import org.chorem.lima.entity.FiscalPeriod;
import org.chorem.lima.entity.FiscalPeriodTopiaDao;
+import org.chorem.lima.entity.Identity;
import org.chorem.lima.entity.VatStatement;
import org.nuiton.csv.Export;
@@ -99,6 +102,9 @@
@EJB
protected VatStatementService vatStatementService;
+ @EJB
+ protected IdentityService identityService;
+
public static final String JAVA_IO_TMPDIR = "java.io.tmpdir";
@Override
@@ -112,20 +118,23 @@
files.add(exportFiscalPeriodFile(charset));
files.add(exportFinancialTransactionsFile(charset));
files.add(exportEntriesFile(charset, false));
+ files.add(exportIdentity(charset));
export = new ZipOutputStream(rstBao);
for (File file : files) {
- 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);
+ 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);
}
- stream.close();
- FileUtils.forceDelete(file);
}
export.flush();
@@ -141,22 +150,26 @@
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) {
+ AccountModel model = new AccountModel();
+ String tmpDir = System.getProperty(JAVA_IO_TMPDIR)+"/";
- AccountModel model = new AccountModel();
- String tmpDir = System.getProperty(JAVA_IO_TMPDIR)+"/";
-
- File result = new File(tmpDir + "accounts.csv");
- Export.exportToFile(model, entities, result, Charset.forName(charset));
+ result = new File(tmpDir + "accounts.csv");
+ Export.exportToFile(model, entities, result, Charset.forName(charset));
+ }
return result;
}
@Override
public String exportAccountsAsCSV(String charset) {
- String result;
+ String result = null;
try {
File file = exportAccountsFile(charset);
- FileInputStream inputStream = new FileInputStream(file);
- result = IOUtils.toString(inputStream);
+ if (file != null) {
+ FileInputStream inputStream = new FileInputStream(file);
+ result = IOUtils.toString(inputStream);
+ }
} catch (Exception e) {
throw new LimaTechnicalException(e);
}
@@ -166,23 +179,27 @@
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 = System.getProperty(JAVA_IO_TMPDIR)+"/";
+ result = new File(tmpDir + "entryBooks.csv");
+ EntryBookModel model = new EntryBookModel();
+ Export.exportToFile(model, entities, result, Charset.forName(charset));
+ }
- String tmpDir = System.getProperty(JAVA_IO_TMPDIR)+"/";
- File result = new File(tmpDir + "entryBooks.csv");
- EntryBookModel model = new EntryBookModel();
- Export.exportToFile(model, entities, result, Charset.forName(charset));
-
return result;
}
@Override
public String exportEntryBooksAsCSV(String charset) {
- String result;
+ String result = null;
try {
File file = exportEntryBooksFile(charset);
- FileInputStream inputStream = new FileInputStream(file);
- result = IOUtils.toString(inputStream);
+ if (file != null) {
+ FileInputStream inputStream = new FileInputStream(file);
+ result = IOUtils.toString(inputStream);
+ }
} catch (Exception e) {
throw new LimaTechnicalException(e);
}
@@ -194,21 +211,27 @@
FiscalPeriodTopiaDao dao = getDaoHelper().getFiscalPeriodDao();
List<FiscalPeriod> entities = dao.findAll();
- String tmpDir = System.getProperty(JAVA_IO_TMPDIR)+"/";
- File result = new File(tmpDir + "fiscalPeriod.csv");
- FiscalPeriodModel model = new FiscalPeriodModel();
- Export.exportToFile(model, entities, result, Charset.forName(charset));
+ File result = null;
+ if (entities != null && !entities.isEmpty()) {
+ String tmpDir = System.getProperty(JAVA_IO_TMPDIR)+"/";
+ result = new File(tmpDir + "fiscalPeriod.csv");
+ FiscalPeriodModel model = new FiscalPeriodModel();
+ Export.exportToFile(model, entities, result, Charset.forName(charset));
+ }
+
return result;
}
@Override
public String exportFiscalPeriodsAsCSV(String charset) {
- String result;
+ String result = null;
try {
File file = exportFiscalPeriodFile(charset);
- FileInputStream inputStream = new FileInputStream(file);
- result = IOUtils.toString(inputStream);
+ if (file != null) {
+ FileInputStream inputStream = new FileInputStream(file);
+ result = IOUtils.toString(inputStream);
+ }
} catch (Exception e) {
throw new LimaTechnicalException(e);
}
@@ -216,17 +239,19 @@
}
protected File exportFinancialTransactionsFile(String charset) throws Exception {
- File result;
+ File result = null;
FinancialTransactionTopiaDao financialTransactionTopiaDao =
getDaoHelper().getFinancialTransactionDao();
List<FinancialTransaction> entities = financialTransactionTopiaDao.findAll();
- String tmpDir = System.getProperty(JAVA_IO_TMPDIR)+"/";
- result = new File(tmpDir + "financialTransactions.csv");
- FinancialTransactionModel model = new FinancialTransactionModel(entryBookService);
- Export.exportToFile(model, entities, result, Charset.forName(charset));
- Export.exportToFile(model, entities, result, Charset.forName(charset));
+ if (entities != null && !entities.isEmpty()) {
+ String tmpDir = System.getProperty(JAVA_IO_TMPDIR)+"/";
+ result = new File(tmpDir + "financialTransactions.csv");
+ FinancialTransactionModel model = new FinancialTransactionModel(entryBookService);
+ Export.exportToFile(model, entities, result, Charset.forName(charset));
+ }
+
return result;
}
@@ -234,20 +259,42 @@
EntryTopiaDao dao = getDaoHelper().getEntryDao();
List<Entry> entities = dao.findAll();
- String tmpDir = System.getProperty(JAVA_IO_TMPDIR)+"/";
- File result = new File(tmpDir + "entries.csv");
- EntryModel model = new EntryModel(accountService, financialTransactionService , humanReadable);
- Export.exportToFile(model, entities, result, Charset.forName(charset));
+ File result = null;
+ if (entities != null && !entities.isEmpty()) {
+ String tmpDir = System.getProperty(JAVA_IO_TMPDIR)+"/";
+ result = new File(tmpDir + "entries.csv");
+ EntryModel model = new EntryModel(accountService, financialTransactionService , humanReadable);
+ Export.exportToFile(model, entities, result, Charset.forName(charset));
+ }
+
return result;
}
+ protected File exportIdentity(String charset) throws Exception {
+ File result = null;
+
+ Identity identity = identityService.getIdentity();
+ if (identity != null) {
+ List<Identity> identities = new ArrayList<>();
+ identities.add(identity);
+
+ String tmpDir = System.getProperty(JAVA_IO_TMPDIR)+"/";
+ result = new File(tmpDir + "identity.csv");
+ IdentityModel model = new IdentityModel();
+ Export.exportToFile(model, identities, result, Charset.forName(charset));
+ }
+ return result;
+ }
+
@Override
public String exportEntriesAsCSV(String charset, Boolean humanReadable) {
- String result;
+ String result = null;
try {
File file = exportEntriesFile(charset, humanReadable);
- FileInputStream inputStream = new FileInputStream(file);
- result = IOUtils.toString(inputStream);
+ if (file != null) {
+ FileInputStream inputStream = new FileInputStream(file);
+ result = IOUtils.toString(inputStream);
+ }
} catch (Exception e) {
throw new LimaTechnicalException(e);
}
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/NewImportServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/NewImportServiceImpl.java 2014-07-31 16:45:29 UTC (rev 3886)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/NewImportServiceImpl.java 2014-07-31 19:50:37 UTC (rev 3887)
@@ -47,6 +47,7 @@
import org.chorem.lima.business.api.FinancialStatementService;
import org.chorem.lima.business.api.FinancialTransactionService;
import org.chorem.lima.business.api.FiscalPeriodService;
+import org.chorem.lima.business.api.IdentityService;
import org.chorem.lima.business.api.NewImportService;
import org.chorem.lima.business.api.VatStatementService;
import org.chorem.lima.business.ejb.csv.AccountModel;
@@ -55,6 +56,7 @@
import org.chorem.lima.business.ejb.csv.FinancialStatementModel;
import org.chorem.lima.business.ejb.csv.FinancialTransactionModel;
import org.chorem.lima.business.ejb.csv.FiscalPeriodModel;
+import org.chorem.lima.business.ejb.csv.IdentityModel;
import org.chorem.lima.business.ejb.csv.VatStatementModel;
import org.chorem.lima.business.ejb.ebp.EntryBookEBPModel;
import org.chorem.lima.business.ejb.ebp.EntryEBPModel;
@@ -69,6 +71,7 @@
import org.chorem.lima.entity.FinancialTransaction;
import org.chorem.lima.entity.FinancialTransactionImpl;
import org.chorem.lima.entity.FiscalPeriod;
+import org.chorem.lima.entity.Identity;
import org.chorem.lima.entity.VatStatement;
import org.nuiton.csv.Import;
import org.nuiton.csv.ImportModel;
@@ -120,6 +123,9 @@
@EJB
protected VatStatementService vatStatementService;
+ @EJB
+ protected IdentityService identityService;
+
protected static final Function<Account, String> GET_ACCOUNT_NUMBER = new Function<Account, String>() {
@Override
public String apply(Account input) {
@@ -260,6 +266,27 @@
return result;
}
+ public ImportResult importIdentityAsCSV(String contents) {
+ ImportResult result = new ImportResult();
+ // 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);
+ for (Identity identity : identities) {
+ identityService.updateIdentity(identity);
+ result.increaseCreated();
+ }
+ } finally {
+ IOUtils.closeQuietly(contentStream);
+ }
+ }
+
+ return result;
+ }
+
protected FinancialStatement returnFinancialStatement (FinancialStatement rootFinancialStatement, String subFinancialStatementLabel) throws AlreadyExistFinancialStatement, NotAllowedLabel {
Collection<FinancialStatement> subFinancialStatements = rootFinancialStatement.getSubFinancialStatements();
FinancialStatement targetedFinancialStatement = null;
@@ -553,13 +580,14 @@
}
@Override
- public List<ImportResult> importBackup(String entryBooks, String financialTransactions, String fiscalPeriods, String accounts, String entries) throws AlreadyExistAccountException, InvalidAccountNumberException {
+ public List<ImportResult> importBackup(String entryBooks, String financialTransactions, String fiscalPeriods, String accounts, String entries, String identity) throws AlreadyExistAccountException, InvalidAccountNumberException {
List<ImportResult> results = new ArrayList<>();
- importAccountAsCSV(accounts);
- importEntryBooksAsCSV(entryBooks);
- importFiscalPeriodsAsCSV(fiscalPeriods);
- importFinancialTransactionsAsCSV(financialTransactions);
- importEntriesAsCSV(entries);
+ results.add(importAccountAsCSV(accounts));
+ results.add(importEntryBooksAsCSV(entryBooks));
+ results.add(importFiscalPeriodsAsCSV(fiscalPeriods));
+ results.add(importFinancialTransactionsAsCSV(financialTransactions));
+ results.add(importEntriesAsCSV(entries));
+ results.add(importIdentityAsCSV(identity));
return results;
}
@@ -607,8 +635,7 @@
Collections.sort(fiscalPeriods, new FiscalPeriodComparator());
// There are no valid fiscalPeriods -> exception
- int nbFiscalPeriods = fiscalPeriods.size();
- if (nbFiscalPeriods == 0) {
+ if (fiscalPeriods.isEmpty()) {
result.getException().addException(0, new ImportEbpException(
t("lima-business.import.nofiscalperiodopen")));
// whe don't want to go further.
@@ -638,7 +665,7 @@
// if entry date have fiscalperiod open
if (dateEcr.compareTo(fiscalPeriods.get(0).getBeginDate()) < 0
- || dateEcr.compareTo(fiscalPeriods.get(nbFiscalPeriods - 1).getEndDate()) > 0) {
+ || dateEcr.compareTo(fiscalPeriods.get(fiscalPeriods.size() - 1).getEndDate()) > 0) {
result.getException().addException(lineIndex, new ImportEbpException(t("lima-business.import.entriesoutofdatesrange", dateEcr)));
lineIndex++;
continue;
Copied: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/csv/IdentityModel.java (from rev 3884, trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/csv/AccountModel.java)
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/csv/IdentityModel.java (rev 0)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/csv/IdentityModel.java 2014-07-31 19:50:37 UTC (rev 3887)
@@ -0,0 +1,72 @@
+package org.chorem.lima.business.ejb.csv;
+
+/*
+ * #%L
+ * Lima :: business
+ * %%
+ * 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.Identity;
+import org.chorem.lima.entity.IdentityImpl;
+import org.nuiton.csv.ExportModel;
+import org.nuiton.csv.ExportableColumn;
+import org.nuiton.csv.ModelBuilder;
+
+/**
+ * Created by davidcosse on 03/06/14.
+ */
+public class IdentityModel extends AbstractLimaModel<Identity> implements ExportModel<Identity> {
+
+ public IdentityModel() {
+ super(';');
+ newOptionalColumn("name", Identity.PROPERTY_NAME);
+ newOptionalColumn("description", Identity.PROPERTY_DESCRIPTION);
+ newOptionalColumn("address", Identity.PROPERTY_ADDRESS);
+ newOptionalColumn("address2", Identity.PROPERTY_ADDRESS2);
+ newOptionalColumn("city", Identity.PROPERTY_CITY);
+ newOptionalColumn("phoneNumber", Identity.PROPERTY_PHONE_NUMBER);
+ newOptionalColumn("email", Identity.PROPERTY_EMAIL);
+ newOptionalColumn("zipCode", Identity.PROPERTY_ZIP_CODE);
+ newOptionalColumn("vatNumber", Identity.PROPERTY_VAT_NUMBER);
+ newOptionalColumn("classificationCode", Identity.PROPERTY_CLASSIFICATION_CODE);
+ newOptionalColumn("buisinessNumber", Identity.PROPERTY_BUSINESS_NUMBER);
+ }
+
+ @Override
+ public Iterable<ExportableColumn<Identity, Object>> getColumnsForExport() {
+ ModelBuilder<Identity> modelBuilder = new ModelBuilder<>();
+ modelBuilder.newColumnForExport("name", Identity.PROPERTY_NAME);
+ modelBuilder.newColumnForExport("description", Identity.PROPERTY_DESCRIPTION);
+ modelBuilder.newColumnForExport("address", Identity.PROPERTY_ADDRESS);
+ modelBuilder.newColumnForExport("address2", Identity.PROPERTY_ADDRESS2);
+ modelBuilder.newColumnForExport("city", Identity.PROPERTY_CITY);
+ modelBuilder.newColumnForExport("phoneNumber", Identity.PROPERTY_PHONE_NUMBER);
+ modelBuilder.newColumnForExport("email", Identity.PROPERTY_EMAIL);
+ modelBuilder.newColumnForExport("zipCode", Identity.PROPERTY_ZIP_CODE);
+ modelBuilder.newColumnForExport("vatNumber", Identity.PROPERTY_VAT_NUMBER);
+ modelBuilder.newColumnForExport("classificationCode", Identity.PROPERTY_CLASSIFICATION_CODE);
+ modelBuilder.newColumnForExport("buisinessNumber", Identity.PROPERTY_BUSINESS_NUMBER);
+ return (Iterable) modelBuilder.getColumnsForExport();
+ }
+
+ @Override
+ public Identity newEmptyInstance() {
+ return new IdentityImpl();
+ }
+}
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-07-31 16:45:29 UTC (rev 3886)
+++ trunk/lima-business/src/test/java/org/chorem/lima/business/AbstractLimaTest.java 2014-07-31 19:50:37 UTC (rev 3887)
@@ -35,6 +35,7 @@
import org.chorem.lima.business.api.FinancialStatementService;
import org.chorem.lima.business.api.FinancialTransactionService;
import org.chorem.lima.business.api.FiscalPeriodService;
+import org.chorem.lima.business.api.IdentityService;
import org.chorem.lima.business.api.ImportService;
import org.chorem.lima.business.api.NewExportService;
import org.chorem.lima.business.api.NewImportService;
@@ -101,6 +102,7 @@
protected NewExportService newExportService;
protected FinancialStatementService financialStatementService;
protected VatStatementService vatStatementService;
+ protected IdentityService identityService;
protected LimaCallaoTopiaApplicationContext context;
@@ -143,6 +145,7 @@
newImportService = LimaServiceFactory.getService(NewImportService.class);
newExportService = LimaServiceFactory.getService(NewExportService.class);
+ identityService = LimaServiceFactory.getService(IdentityService.class);
}
}
Modified: trunk/lima-business/src/test/java/org/chorem/lima/business/NewImportExportServiceTest.java
===================================================================
--- trunk/lima-business/src/test/java/org/chorem/lima/business/NewImportExportServiceTest.java 2014-07-31 16:45:29 UTC (rev 3886)
+++ trunk/lima-business/src/test/java/org/chorem/lima/business/NewImportExportServiceTest.java 2014-07-31 19:50:37 UTC (rev 3887)
@@ -35,6 +35,8 @@
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;
@@ -221,21 +223,30 @@
@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 = newExportService.exportBackup("UTF-8");
- initAbstractTest();
+
String tmpDir = System.getProperty("java.io.tmpdir")+"/TMP_BACKUP.zip";
createZipFile(tmpDir, export);
+
initAbstractTest();
- FileInputStream contentStream = null;
List<ImportResult> importResults;
- try {
- importResults = importAllFromZipFile(tmpDir);
- } finally {
- IOUtils.closeQuietly(contentStream);
- }
- for (ImportResult 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.getException().getAllExceptionsByLine().isEmpty());
}
}
@@ -270,6 +281,8 @@
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;
@@ -288,7 +301,7 @@
IOUtils.closeQuietly(zipInputStream);
IOUtils.closeQuietly(inputStream);
}
- InputStream transactionsStream, entryBooksStream, fiscalPeriodsStream, entriesStream, accountsStream;
+ InputStream transactionsStream, entryBooksStream, fiscalPeriodsStream, entriesStream, accountsStream, identityStream;
List<ImportResult> results;
try {
entryBooksStream = new FileInputStream(tmpDir + "entryBooks.csv");
@@ -312,8 +325,12 @@
String accountsStreamString = IOUtils.toString(accountsStream);
IOUtils.closeQuietly(accountsStream);
- results = newImportService.importBackup(entryBooksStreamString, transactionsStreamString, fiscalPeriodsStreamString, accountsStreamString, entriesStreamString);
+ identityStream = new FileInputStream(tmpDir + "identity.csv");
+ String identityStreamString = IOUtils.toString(identityStream);
+ IOUtils.closeQuietly(identityStream);
+ results = newImportService.importBackup(entryBooksStreamString, transactionsStreamString, fiscalPeriodsStreamString, accountsStreamString, entriesStreamString, identityStreamString);
+
} catch (Exception ex) {
if(log.isInfoEnabled()) {
log.info(ex);
Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/NewImportService.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/NewImportService.java 2014-07-31 16:45:29 UTC (rev 3886)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/NewImportService.java 2014-07-31 19:50:37 UTC (rev 3887)
@@ -45,7 +45,7 @@
ImportResult importVATStatementsAsCSV(String contents);
- List<ImportResult> importBackup(String entryBooks, String transactions, String fiscalPeriods, String accounts, String entries) throws AlreadyExistAccountException, InvalidAccountNumberException;
+ List<ImportResult> importBackup(String entryBooks, String transactions, String fiscalPeriods, String accounts, String entries, String identity) throws AlreadyExistAccountException, InvalidAccountNumberException;
ImportResult importEntriesFromEbp(String datas);
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-07-31 16:45:29 UTC (rev 3886)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java 2014-07-31 19:50:37 UTC (rev 3887)
@@ -186,7 +186,8 @@
createFile(filePath, EncodingEnum.ISOLATIN1.getEncoding(), datas);
break;
case CSV_ALL_IMPORT:
- List<ImportResult> results = importAllFromZipFile(filePath);
+ List<ImportResult> allResults = importAllFromZipFile(filePath);
+ // TODO DCossé 24/07/14 change result
result = "SUCCESS";
break;
case CSV_ACCOUNTCHARTS_IMPORT:
@@ -462,6 +463,8 @@
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;
@@ -480,7 +483,7 @@
IOUtils.closeQuietly(zipInputStream);
IOUtils.closeQuietly(inputStream);
}
- InputStream transactionsStream, entryBooksStream, fiscalPeriodsStream, entriesStream, accountsStream;
+ InputStream transactionsStream, entryBooksStream, fiscalPeriodsStream, entriesStream, accountsStream, identityStream;
List<ImportResult> results;
try {
entryBooksStream = new FileInputStream(tmpDir + "entryBooks.csv");
@@ -504,8 +507,12 @@
String entriesStreamString = IOUtils.toString(entriesStream);
IOUtils.closeQuietly(entriesStream);
- results = newImportService.importBackup(entryBooksStreamString, transactionsStreamString, fiscalPeriodsStreamString, accountsStreamString, entriesStreamString);
+ identityStream = new FileInputStream(tmpDir + "identity.csv");
+ String identityStreamString = IOUtils.toString(identityStream);
+ IOUtils.closeQuietly(identityStream);
+ results = newImportService.importBackup(entryBooksStreamString, transactionsStreamString, fiscalPeriodsStreamString, accountsStreamString, entriesStreamString, identityStreamString);
+
} catch (Exception ex) {
if(log.isInfoEnabled()) {
log.info(ex);
1
0
r3886 - in trunk: lima-business/src/main/java/org/chorem/lima/business/ejb lima-business-api/src/main/java/org/chorem/lima/business/api lima-swing/src/main/java/org/chorem/lima/ui/importexport
by dcosse@users.chorem.org 31 Jul '14
by dcosse@users.chorem.org 31 Jul '14
31 Jul '14
Author: dcosse
Date: 2014-07-31 18:45:29 +0200 (Thu, 31 Jul 2014)
New Revision: 3886
Url: http://forge.chorem.org/projects/lima/repository/revisions/3886
Log:
refs #1032 corrections sur import journaux
Modified:
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/ImportServiceImpl.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java
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-07-31 16:36:13 UTC (rev 3885)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java 2014-07-31 16:45:29 UTC (rev 3886)
@@ -34,8 +34,6 @@
import org.apache.pdfbox.exceptions.COSVisitorException;
import org.apache.pdfbox.pdmodel.PDDocument;
import org.apache.pdfbox.pdmodel.interactive.form.PDField;
-import org.chorem.lima.beans.EntryImport;
-import org.chorem.lima.beans.FinancialTransactionImport;
import org.chorem.lima.business.AlreadyExistAccountException;
import org.chorem.lima.business.ImportEbpException;
import org.chorem.lima.business.InvalidAccountNumberException;
@@ -210,59 +208,7 @@
// ################ IMPORT ################
- /**
- * Remote methode to call entity import from UI
- * This methode let import just on type of entity
- */
@Override
- public String importAsCSV(String datas,
- ImportExportEntityEnum importExportEntityEnum) throws ImportEbpException {
- StringBuilder result = new StringBuilder();
-
- // Transactions and entries
- Map<Integer, FinancialTransactionImport> financialTransactions = null;
- Map<Integer, List<EntryImport>> entries = null;
-
-
- switch (importExportEntityEnum) {
- case FINANCIALTRANSACTION:
- }
- CSVReader csvReader = null;
- try {
-
- String[] nextLine;
- csvReader = new CSVReader(new StringReader(datas), ';');
-
- while ((nextLine = csvReader.readNext()) != null) {
- if (ImportExportEntityEnum.valueOfLabel(nextLine[0]) == importExportEntityEnum
- || importExportEntityEnum == ImportExportEntityEnum.FINANCIALTRANSACTION
- || importExportEntityEnum == ImportExportEntityEnum.ENTRY) {
- switch (importExportEntityEnum) {
- case FINANCIALTRANSACTION:
- }
- }
- }
-
- //create entity
- switch (importExportEntityEnum) {
- case FINANCIALTRANSACTION:
- }
-
- } catch (IOException e) {
- throw new ImportEbpException("Can't import", e);
- } finally {
- if (csvReader != null) {
- try {
- csvReader.close();
- } catch (IOException e) {
- // on fait rien
- }
- }
- }
- return result.toString();
- }
-
- @Override
public String importAsPDF(String datas,
ImportExportEntityEnum importExportEntityEnum,
boolean setMode) {
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-07-31 16:36:13 UTC (rev 3885)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/ImportService.java 2014-07-31 16:45:29 UTC (rev 3886)
@@ -45,17 +45,6 @@
String importAccountsChartFromEbp(String data) throws ImportEbpException;
/**
- * Import content as CSV depending on import type.
- *
- * @param data import file content as string (remote service can't take File)
- * @param importExportEntityEnum import type
- * @return result log
- * @throws LimaException
- */
- String importAsCSV(String data,
- ImportExportEntityEnum importExportEntityEnum) throws ImportEbpException;
-
- /**
* @deprecated import file (local, can't be used in remote mode)
* and wrong place for this method
*/
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-07-31 16:36:13 UTC (rev 3885)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java 2014-07-31 16:45:29 UTC (rev 3886)
@@ -240,7 +240,9 @@
break;
case EBP_ENTRYBOOKS_IMPORT:
datas = extractFile(filePath, EncodingEnum.ISOLATIN1.getEncoding());
- result = importService.importEntryBookFromEbp(datas);
+ importResult = newImportService.importEntryBookFromEbp(datas);
+ // TODO DCossé 24/07/14 change result
+ result = "SUCCESS";
break;
case EBP_ENTRYBOOKS_EXPORT:
datas = exportService.exportEntryBooksAsEBP();
1
0
r3885 - in trunk: lima-business/src/main/java/org/chorem/lima/business/ejb lima-business/src/main/java/org/chorem/lima/business/ejb/csv lima-business/src/main/java/org/chorem/lima/business/ejb/ebp lima-business/src/test/java/org/chorem/lima/business lima-business-api/src/main/java/org/chorem/lima/business/api
by dcosse@users.chorem.org 31 Jul '14
by dcosse@users.chorem.org 31 Jul '14
31 Jul '14
Author: dcosse
Date: 2014-07-31 18:36:13 +0200 (Thu, 31 Jul 2014)
New Revision: 3885
Url: http://forge.chorem.org/projects/lima/repository/revisions/3885
Log:
refs #1032 import des journaux depuis EBP
Added:
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ebp/EntryBookEBPModel.java
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/NewImportService.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/ImportServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/NewImportServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/csv/EntryModel.java
trunk/lima-business/src/test/java/org/chorem/lima/business/ImportServiceImplTest.java
trunk/lima-business/src/test/java/org/chorem/lima/business/NewImportExportServiceTest.java
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-07-31 15:40:32 UTC (rev 3884)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/EntryBookServiceImpl.java 2014-07-31 16:36:13 UTC (rev 3885)
@@ -36,6 +36,8 @@
import org.chorem.lima.entity.EntryBookTopiaDao;
import org.chorem.lima.entity.FinancialPeriod;
import org.chorem.lima.entity.FinancialPeriodTopiaDao;
+import org.nuiton.util.beans.Binder;
+import org.nuiton.util.beans.BinderFactory;
import javax.ejb.Remote;
import javax.ejb.Stateless;
@@ -62,7 +64,9 @@
boolean result;
if (existingEntryBook != null) {
result = true;
- updateEntryBook(entryBook);
+ Binder binder = BinderFactory.newBinder(EntryBook.class, EntryBook.class);
+ binder.copy(entryBook, existingEntryBook, EntryBook.PROPERTY_LABEL);
+ updateEntryBook(existingEntryBook);
} else {
result = false;
createNewEntryBook(entryBook);
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-07-31 15:40:32 UTC (rev 3884)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java 2014-07-31 16:36:13 UTC (rev 3885)
@@ -29,7 +29,6 @@
import com.google.common.base.Function;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
-import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.pdfbox.exceptions.COSVisitorException;
@@ -55,7 +54,6 @@
import org.chorem.lima.entity.Account;
import org.chorem.lima.entity.AccountImpl;
import org.chorem.lima.entity.EntryBook;
-import org.chorem.lima.entity.EntryBookImpl;
import org.chorem.lima.entity.Identity;
import org.chorem.lima.entity.IdentityImpl;
@@ -210,81 +208,6 @@
return result.toString();
}
- @Override
- public String importEntryBookFromEbp(String datas) throws ImportEbpException{
- long before = System.currentTimeMillis();
-
- List<EntryBook> entryBooks = entryBookService.getAllEntryBooks();
- if (entryBooks == null) {
- entryBooks = Lists.newArrayList();
- }
- Map<String, EntryBook> indexedEntryBooks = Maps.newHashMap(Maps.uniqueIndex(entryBooks, GET_ENTRY_BOOK_CODE));
-
- StringBuilder result = new StringBuilder();
- CSVReader csvReader = null;
-
- try {
- csvReader = new CSVReader(new StringReader(datas));
-
- String[] headers = csvReader.readNext();
- String columnName;
- Integer entryBookCodeIndex = null;
- Integer entryBookLabelIndex = null;
- for (int i = 0; i < headers.length; i++) {
- columnName = headers[i];
- if (columnName.equalsIgnoreCase("Code")) {
- entryBookCodeIndex = i;
- } else if (columnName.equalsIgnoreCase("Libelle")) {
- entryBookLabelIndex = i;
- }
- }
-
- // check if file have a good header
-
- if (entryBookCodeIndex == null || entryBookLabelIndex == null) {
- throw new ImportEbpException(
- t("lima-business.import.noaccount"));
- }
-
- // create entry book for each line
- int count = 0;
- String[] line = csvReader.readNext();
- while (line != null) {
- String entryBookCode = line[entryBookCodeIndex];
- EntryBook entryBook = indexedEntryBooks.get(entryBookCode);
- if (entryBook == null) {
- entryBook = new EntryBookImpl();
- entryBook.setCode(StringUtils.trimToNull(line[entryBookCodeIndex]));
- entryBook.setLabel(StringUtils.trimToNull(line[entryBookLabelIndex]));
- entryBookService.createEntryBook(entryBook);
- result.append(t("lima-business.import.accountadded", entryBook.getCode(), entryBook.getLabel()));
- count++;
- }
-
- line = csvReader.readNext();
- }
-
- if (log.isInfoEnabled()) {
- long after = System.currentTimeMillis();
- log.info("Imported form EBP : " + count + " accounts in " + (after-before) + " ms");
- }
-
- } catch (IOException e) {
- throw new ImportEbpException("Can't import", e);
- } finally {
- if (csvReader != null) {
- try {
- csvReader.close();
- } catch (IOException e) {
- // on fait rien
- }
- }
- }
-
- return result.toString();
- }
-
-
// ################ IMPORT ################
/**
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/NewImportServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/NewImportServiceImpl.java 2014-07-31 15:40:32 UTC (rev 3884)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/NewImportServiceImpl.java 2014-07-31 16:36:13 UTC (rev 3885)
@@ -56,6 +56,7 @@
import org.chorem.lima.business.ejb.csv.FinancialTransactionModel;
import org.chorem.lima.business.ejb.csv.FiscalPeriodModel;
import org.chorem.lima.business.ejb.csv.VatStatementModel;
+import org.chorem.lima.business.ejb.ebp.EntryBookEBPModel;
import org.chorem.lima.business.ejb.ebp.EntryEBPModel;
import org.chorem.lima.business.utils.EntryEBPComparator;
import org.chorem.lima.business.utils.FiscalPeriodComparator;
@@ -563,7 +564,7 @@
}
@Override
- public ImportResult importEntriesFromEbp(String datas) throws ImportEbpException {
+ public ImportResult importEntriesFromEbp(String datas) {
ImportResult result = new ImportResult();
if (datas.isEmpty()) {
@@ -736,4 +737,24 @@
}
return result;
}
+
+ @Override
+ public ImportResult importEntryBookFromEbp(String datas) {
+ ImportResult result = new ImportResult();
+
+ ImportModel<EntryBook> model = new EntryBookEBPModel();
+
+ 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();
+ }
+ }
+ return result;
+ }
}
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/csv/EntryModel.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/csv/EntryModel.java 2014-07-31 15:40:32 UTC (rev 3884)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/csv/EntryModel.java 2014-07-31 16:36:13 UTC (rev 3885)
@@ -49,7 +49,7 @@
newOptionalColumn("voucher", Entry.PROPERTY_VOUCHER);
newOptionalColumn("description", Entry.PROPERTY_DESCRIPTION);
newOptionalColumn("lettering", Entry.PROPERTY_LETTERING);
- newOptionalColumn("financialTransaction", Entry.PROPERTY_FINANCIAL_TRANSACTION, FINANCIAL_TRANSACTION_ID_TO_FINANCIAL_TRANSACTION_PARSER);
+ newMandatoryColumn("financialTransaction", Entry.PROPERTY_FINANCIAL_TRANSACTION, FINANCIAL_TRANSACTION_ID_TO_FINANCIAL_TRANSACTION_PARSER);
}
@Override
Copied: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ebp/EntryBookEBPModel.java (from rev 3883, trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/csv/EntryBookModel.java)
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ebp/EntryBookEBPModel.java (rev 0)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ebp/EntryBookEBPModel.java 2014-07-31 16:36:13 UTC (rev 3885)
@@ -0,0 +1,76 @@
+package org.chorem.lima.business.ejb.ebp;
+
+/*
+ * #%L
+ * Lima :: business
+ * %%
+ * 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.business.ejb.csv.AbstractLimaModel;
+import org.chorem.lima.entity.EntryBook;
+import org.chorem.lima.entity.EntryBookImpl;
+import org.nuiton.csv.ExportModel;
+import org.nuiton.csv.ExportableColumn;
+import org.nuiton.csv.ModelBuilder;
+
+/**
+ * Created by davidcosse on 03/06/14.
+ */
+public class EntryBookEBPModel extends AbstractLimaModel<EntryBook> implements ExportModel<EntryBook> {
+
+ public EntryBookEBPModel() {
+ super(',');
+ newMandatoryColumn("Code", EntryBook.PROPERTY_CODE);
+ newOptionalColumn("Libelle", EntryBook.PROPERTY_LABEL);
+ newIgnoredColumn("Type");
+ newIgnoredColumn("TypePiece");
+ newIgnoredColumn("NextPiece");
+ newIgnoredColumn("CpteType");
+ newIgnoredColumn("CpteCompte");
+ newIgnoredColumn("Contact");
+ newIgnoredColumn("RIBNomBanque");
+ newIgnoredColumn("RIBAdrBanque");
+ newIgnoredColumn("RIBAgence");
+ newIgnoredColumn("RIBGuichet");
+ newIgnoredColumn("RIBCompte");
+ newIgnoredColumn("RIBCleRIB");
+ newIgnoredColumn("Lcr");
+ newIgnoredColumn("Preleve");
+ newIgnoredColumn("MemoDateCreat");
+ newIgnoredColumn("MemoDateModif");
+ newIgnoredColumn("Devise");
+ newIgnoredColumn("CompteTP");
+ newIgnoredColumn("NumCptBqCH");
+ newIgnoredColumn("NumClearing");
+ newIgnoredColumn("bSaisieKM");
+ }
+
+ @Override
+ public Iterable<ExportableColumn<EntryBook, Object>> getColumnsForExport() {
+ ModelBuilder<EntryBook> modelBuilder = new ModelBuilder<EntryBook>();
+ modelBuilder.newColumnForExport("Code", EntryBook.PROPERTY_CODE);
+ modelBuilder.newColumnForExport("Libelle", EntryBook.PROPERTY_LABEL);
+ return (Iterable) modelBuilder.getColumnsForExport();
+ }
+
+ @Override
+ public EntryBook newEmptyInstance() {
+ return new EntryBookImpl();
+ }
+}
Modified: trunk/lima-business/src/test/java/org/chorem/lima/business/ImportServiceImplTest.java
===================================================================
--- trunk/lima-business/src/test/java/org/chorem/lima/business/ImportServiceImplTest.java 2014-07-31 15:40:32 UTC (rev 3884)
+++ trunk/lima-business/src/test/java/org/chorem/lima/business/ImportServiceImplTest.java 2014-07-31 16:36:13 UTC (rev 3885)
@@ -66,28 +66,14 @@
// import files
InputStream accountStream = null;
- InputStream entryBookStream = null;
- InputStream entriesStream = null;
try {
accountStream = ImportServiceImplTest.class.getResourceAsStream("/ebp/comptes.txt");
String accountData = IOUtils.toString(accountStream, "ISO-8859-1");
importService.importAccountsChartFromEbp(accountData);
accountStream.close();
-
- entryBookStream = ImportServiceImplTest.class.getResourceAsStream("/ebp/journaux.txt");
- String entryBookData = IOUtils.toString(entryBookStream, "ISO-8859-1");
- importService.importEntryBookFromEbp(entryBookData);
- entryBookStream.close();
-
-// entriesStream = ImportServiceImplTest.class.getResourceAsStream("/ebp/ecritures.txt");
-// String entriesData = IOUtils.toString(entriesStream, "ISO-8859-1");
-// importService.importEntriesFromEbp(entriesData);
-// entriesStream.close();
}
finally {
IOUtils.closeQuietly(accountStream);
- IOUtils.closeQuietly(entryBookStream);
- IOUtils.closeQuietly(entriesStream);
}
}
Modified: trunk/lima-business/src/test/java/org/chorem/lima/business/NewImportExportServiceTest.java
===================================================================
--- trunk/lima-business/src/test/java/org/chorem/lima/business/NewImportExportServiceTest.java 2014-07-31 15:40:32 UTC (rev 3884)
+++ trunk/lima-business/src/test/java/org/chorem/lima/business/NewImportExportServiceTest.java 2014-07-31 16:36:13 UTC (rev 3885)
@@ -30,6 +30,7 @@
import org.chorem.lima.entity.AccountImpl;
import org.chorem.lima.entity.Entry;
import org.chorem.lima.entity.EntryBook;
+import org.chorem.lima.entity.EntryBookImpl;
import org.chorem.lima.entity.FinancialStatement;
import org.chorem.lima.entity.FinancialTransaction;
import org.chorem.lima.entity.FiscalPeriod;
@@ -40,6 +41,7 @@
import java.io.ByteArrayInputStream;
import java.io.FileInputStream;
import java.io.FileOutputStream;
+import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.Charset;
import java.util.Collection;
@@ -379,4 +381,25 @@
Assert.assertEquals(19, result.getNbCreated());
entriesStream.close();
}
+
+ @Test
+ public void testImportEntryBooksFromEBP() throws IOException {
+ InputStream entryBookStream = NewImportExportServiceTest.class.getResourceAsStream("/ebp/journaux.txt");
+ String entryBookData = IOUtils.toString(entryBookStream, "ISO-8859-1");
+ entryBookStream.close();
+
+ // set somme already existing entryBooks
+ String [] entryBookCodes = {"AC","AN"};
+ for (String entryBookCode : entryBookCodes) {
+ EntryBook entryBook = new EntryBookImpl();
+ entryBook.setCode(entryBookCode);
+ entryBookService.createEntryBook(entryBook);
+ }
+
+ ImportResult result = newImportService.importEntryBookFromEbp(entryBookData);
+ Assert.assertEquals(7, result.getNbCreated());
+ Assert.assertEquals(2, result.getNbUpdated());
+ EntryBook updatedEntryBook = entryBookService.getEntryBookByCode("AC");
+ Assert.assertEquals("Achats de marchandises", updatedEntryBook.getLabel());
+ }
}
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-07-31 15:40:32 UTC (rev 3884)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/ImportService.java 2014-07-31 16:36:13 UTC (rev 3885)
@@ -45,15 +45,6 @@
String importAccountsChartFromEbp(String data) throws ImportEbpException;
/**
- * Import entry books as EBP import.
- *
- * @param datas
- * @return
- * @throws LimaException
- */
- String importEntryBookFromEbp(String datas) throws ImportEbpException;
-
- /**
* Import content as CSV depending on import type.
*
* @param data import file content as string (remote service can't take File)
Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/NewImportService.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/NewImportService.java 2014-07-31 15:40:32 UTC (rev 3884)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/NewImportService.java 2014-07-31 16:36:13 UTC (rev 3885)
@@ -23,7 +23,6 @@
*/
import org.chorem.lima.business.AlreadyExistAccountException;
-import org.chorem.lima.business.ImportEbpException;
import org.chorem.lima.business.ImportResult;
import org.chorem.lima.business.InvalidAccountNumberException;
@@ -48,5 +47,7 @@
List<ImportResult> importBackup(String entryBooks, String transactions, String fiscalPeriods, String accounts, String entries) throws AlreadyExistAccountException, InvalidAccountNumberException;
- ImportResult importEntriesFromEbp(String datas) throws ImportEbpException;
+ ImportResult importEntriesFromEbp(String datas);
+
+ ImportResult importEntryBookFromEbp(String datas);
}
1
0
r3884 - in trunk/lima-business/src: main/java/org/chorem/lima/business/ejb main/resources/i18n test/java/org/chorem/lima/business
by dcosse@users.chorem.org 31 Jul '14
by dcosse@users.chorem.org 31 Jul '14
31 Jul '14
Author: dcosse
Date: 2014-07-31 17:40:32 +0200 (Thu, 31 Jul 2014)
New Revision: 3884
Url: http://forge.chorem.org/projects/lima/repository/revisions/3884
Log:
refs #1032 correction sur l'import des ?\195?\169critures depuis EBP
Modified:
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/NewImportServiceImpl.java
trunk/lima-business/src/main/resources/i18n/lima-business_en_GB.properties
trunk/lima-business/src/main/resources/i18n/lima-business_fr_FR.properties
trunk/lima-business/src/test/java/org/chorem/lima/business/NewImportExportServiceTest.java
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/NewImportServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/NewImportServiceImpl.java 2014-07-31 15:10:21 UTC (rev 3883)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/NewImportServiceImpl.java 2014-07-31 15:40:32 UTC (rev 3884)
@@ -693,6 +693,7 @@
//financialTransaction = null;
// create it
entryBook = entryBookService.createEntryBook(entryBook);
+ indexedEntryBooks.put(entryBook.getCode(), entryBook);
}
try {
Modified: trunk/lima-business/src/main/resources/i18n/lima-business_en_GB.properties
===================================================================
--- trunk/lima-business/src/main/resources/i18n/lima-business_en_GB.properties 2014-07-31 15:10:21 UTC (rev 3883)
+++ trunk/lima-business/src/main/resources/i18n/lima-business_en_GB.properties 2014-07-31 15:40:32 UTC (rev 3884)
@@ -98,7 +98,7 @@
lima-business.import.accountadded=SUCCES \: Account %s - %s added\n
lima-business.import.accountalreadyexist=FAILED \: Account %s already exist \n
lima-business.import.closedperiodicentrybookupdated=SUCCESS \: The blockClosedPeriodicEntryBook %s - %s - %s is updated \! \n
-lima-business.import.ebpmissingaccount=FAILED \: Account %s already exist, import aborted. \nCreate all accounts before import entries.
+lima-business.import.ebpmissingaccount=FAILED \: Account %s doesn't exist.\nCreate all accounts before import entries.
lima-business.import.ebpnoentry=FAILED \: This file contains no entries.
lima-business.import.ebpnoheader=FAILED \: This file has no header datas.
lima-business.import.entries.error.FinancialPeriod=
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-07-31 15:10:21 UTC (rev 3883)
+++ trunk/lima-business/src/main/resources/i18n/lima-business_fr_FR.properties 2014-07-31 15:40:32 UTC (rev 3884)
@@ -96,7 +96,7 @@
lima-business.import.closedPeriodicEntryBook.error.unfilled=Impossible de bloquer la période financière / il manque des éléments dans des transactions
lima-business.import.closedPeriodicEntryBook.error.withoutEntryBook=Impossible de bloquer la période financière / il manque un journal dans une transaction (%1$te/%1$tm/%1$tY)
lima-business.import.closedperiodicentrybookupdated=Succès \: La période financière %s - %s - %s est ajoutée \! \n
-lima-business.import.ebpmissingaccount=Échec \: Compte %s inexistant. \nImportation annulée. \nCréer tous les comptes avant d'importer les écritures.
+lima-business.import.ebpmissingaccount=Échec \: Compte %s inexistant. \nCréer tous les comptes avant d'importer les écritures.
lima-business.import.ebpnoentry=Échec \: Ce fichier ne contient aucune entrée.
lima-business.import.ebpnoheader=Échec \: Ce fichier ne contient aucun entête.
lima-business.import.entries.error.lockedEntryBook=
Modified: trunk/lima-business/src/test/java/org/chorem/lima/business/NewImportExportServiceTest.java
===================================================================
--- trunk/lima-business/src/test/java/org/chorem/lima/business/NewImportExportServiceTest.java 2014-07-31 15:10:21 UTC (rev 3883)
+++ trunk/lima-business/src/test/java/org/chorem/lima/business/NewImportExportServiceTest.java 2014-07-31 15:40:32 UTC (rev 3884)
@@ -27,6 +27,7 @@
import org.apache.commons.io.IOUtils;
import org.chorem.lima.LimaTechnicalException;
import org.chorem.lima.entity.Account;
+import org.chorem.lima.entity.AccountImpl;
import org.chorem.lima.entity.Entry;
import org.chorem.lima.entity.EntryBook;
import org.chorem.lima.entity.FinancialStatement;
@@ -360,13 +361,22 @@
public void testImportEntriesFromEBP() throws Exception {
// create fiscal period (mandatory for import)
FiscalPeriod fiscalPeriod = new FiscalPeriodImpl();
- fiscalPeriod.setBeginDate(df.parse("January 1, 2012"));
- fiscalPeriod.setEndDate(df.parse("December 31, 2012"));
+ fiscalPeriod.setBeginDate(df.parse("January 1, 2010"));
+ fiscalPeriod.setEndDate(df.parse("December 31, 2010"));
fiscalPeriodService.createFiscalPeriod(fiscalPeriod);
+ String [] accountNumbers = {"62610000","44566000","40104200","62510000","40100000","401TEEMP","51200000","60630000","411TECLI"};
+ for (String accountNumber : accountNumbers) {
+ Account account = new AccountImpl();
+ account.setAccountNumber(accountNumber);
+ accountService.createAccount(account);
+ }
+
InputStream entriesStream = NewImportExportServiceTest.class.getResourceAsStream("/ebp/ecritures.txt");
String entriesData = IOUtils.toString(entriesStream, "ISO-8859-1");
ImportResult result = newImportService.importEntriesFromEbp(entriesData);
+ Assert.assertTrue(result.getException().getAllExceptionsByLine().isEmpty());
+ Assert.assertEquals(19, result.getNbCreated());
entriesStream.close();
}
}
1
0
Author: dcosse
Date: 2014-07-31 17:10:21 +0200 (Thu, 31 Jul 2014)
New Revision: 3883
Url: http://forge.chorem.org/projects/lima/repository/revisions/3883
Log:
refs #1032 import EBP des entries
Added:
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ebp/
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ebp/EntryEBPModel.java
Modified:
trunk/lima-business-api/src/main/java/org/chorem/lima/LimaTechnicalException.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/ImportException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/ImportResult.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/NoEmptyFiscalPeriodException.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/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
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/NewImportService.java
trunk/lima-business/src/main/java/org/chorem/lima/LimaServer.java
trunk/lima-business/src/main/java/org/chorem/lima/LimaXAResource.java
trunk/lima-business/src/main/java/org/chorem/lima/business/AccountingRules.java
trunk/lima-business/src/main/java/org/chorem/lima/business/LimaConfig.java
trunk/lima-business/src/main/java/org/chorem/lima/business/LimaInterceptor.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ServiceListener.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ServiceMonitorable.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/AbstractLimaService.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/ClosedPeriodicEntryBookServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/DocumentServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/EntryBookServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/EntryServiceImpl.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/FinancialPeriodServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialStatementServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FiscalPeriodServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/HttpServerServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/IdentityServiceImpl.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/NewExportServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/NewImportServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/OptionsServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/VatStatementServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/csv/AbstractLimaModel.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/csv/AccountModel.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/csv/EntryBookModel.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/csv/EntryModel.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/csv/FinancialStatementModel.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/csv/FinancialTransactionModel.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/csv/FiscalPeriodModel.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/csv/VatStatementModel.java
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
trunk/lima-business/src/main/java/org/chorem/lima/business/utils/AccountComparator.java
trunk/lima-business/src/main/java/org/chorem/lima/business/utils/AccountEBPComparator.java
trunk/lima-business/src/main/java/org/chorem/lima/business/utils/DocumentsEnum.java
trunk/lima-business/src/main/java/org/chorem/lima/business/utils/EntryComparator.java
trunk/lima-business/src/main/java/org/chorem/lima/business/utils/EntryEBPComparator.java
trunk/lima-business/src/main/java/org/chorem/lima/business/utils/FinancialPeriodComparator.java
trunk/lima-business/src/main/java/org/chorem/lima/business/utils/FinancialTransactionComparator.java
trunk/lima-business/src/main/java/org/chorem/lima/business/utils/FiscalPeriodComparator.java
trunk/lima-business/src/main/java/org/chorem/lima/business/utils/LetteringComparator.java
trunk/lima-business/src/main/java/org/chorem/lima/service/LimaServiceFactory.java
trunk/lima-business/src/main/java/org/chorem/lima/service/ServiceMonitorableHandler.java
trunk/lima-business/src/main/java/org/chorem/lima/service/package-info.java
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/FinancialPeriodServiceImplTest.java
trunk/lima-business/src/test/java/org/chorem/lima/business/FinancialTransactionServiceImplTest.java
trunk/lima-business/src/test/java/org/chorem/lima/business/FiscalPeriodServiceImplTest.java
trunk/lima-business/src/test/java/org/chorem/lima/business/ImportServiceImplTest.java
trunk/lima-business/src/test/java/org/chorem/lima/business/LetteringComparatorTest.java
trunk/lima-business/src/test/java/org/chorem/lima/business/LimaMiscTest.java
trunk/lima-business/src/test/java/org/chorem/lima/business/LimaTestsConfig.java
trunk/lima-business/src/test/java/org/chorem/lima/business/NewImportExportServiceTest.java
trunk/lima-business/src/test/java/org/chorem/lima/business/ReportServiceImplTest.java
trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/AccountServiceRuleFrTest.java
trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/EntryBookServiceRuleFrTest.java
trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/FinancialPeriodServiceRuleFrTest.java
trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/FinancialTransactionServiceRuleFrTest.java
trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/FiscalPeriodServiceRuleFrTest.java
trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/ImportServiceRuleFrTest.java
trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/ReportServiceRuleFrTest.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-business/src/test/resources/import/bcr_developed.csv
trunk/lima-business/src/test/resources/import/vat_shortened.csv
trunk/lima-callao/src/main/java/org/chorem/lima/DefaultServiceContext.java
trunk/lima-callao/src/main/java/org/chorem/lima/ServiceContext.java
trunk/lima-callao/src/main/java/org/chorem/lima/entity/AccountTopiaDao.java
trunk/lima-callao/src/main/java/org/chorem/lima/entity/ClosedPeriodicEntryBookTopiaDao.java
trunk/lima-callao/src/main/java/org/chorem/lima/entity/EntryTopiaDao.java
trunk/lima-callao/src/main/java/org/chorem/lima/entity/FinancialPeriodTopiaDao.java
trunk/lima-callao/src/main/java/org/chorem/lima/entity/FinancialStatementTopiaDao.java
trunk/lima-callao/src/main/java/org/chorem/lima/entity/FinancialTransactionTopiaDao.java
trunk/lima-callao/src/main/java/org/chorem/lima/entity/FiscalPeriodTopiaDao.java
trunk/lima-callao/src/main/java/org/chorem/lima/entity/LimaCallaoTopiaPersistenceContext.java
trunk/lima-callao/src/main/java/org/chorem/lima/entity/VatStatementTopiaDao.java
trunk/lima-callao/src/main/xmi/accounting-model.zargo
trunk/lima-swing/src/main/assembly/lima.bat
trunk/lima-swing/src/main/java/org/chorem/lima/ui/ClosableTabHeader.css
trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainView.css
trunk/lima-swing/src/main/java/org/chorem/lima/ui/celleditor/AutoCompleteTableCellEditor.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/HomeView.css
trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java
Modified: trunk/lima-business/src/main/java/org/chorem/lima/LimaServer.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/LimaServer.java 2014-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business/src/main/java/org/chorem/lima/LimaServer.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -1,7 +1,7 @@
/*
* #%L
- * $Id: LimaServer.java 3350 2012-04-04 09:03:41Z echatellier $
- * $HeadURL: http://svn.chorem.org/svn/lima/trunk/lima-business/src/main/java/org/chorem… $
+ * $Id$
+ * $HeadURL$
* %%
* Copyright (C) 2011 Codelutin, Chatellier Eric
* %%
@@ -36,10 +36,10 @@
* Starts openejb server.
*
* @author chatellier
- * @version $Revision: 3350 $
+ * @version $Revision$
* <p/>
- * Last update : $Date: 2012-04-04 11:03:41 +0200 (mer. 04 avril 2012) $
- * By : $Author: echatellier $
+ * Last update : $Date$
+ * By : $Author$
*/
public class LimaServer {
Property changes on: trunk/lima-business/src/main/java/org/chorem/lima/LimaServer.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/lima-business/src/main/java/org/chorem/lima/LimaXAResource.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/LimaXAResource.java 2014-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business/src/main/java/org/chorem/lima/LimaXAResource.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -1,7 +1,7 @@
/*
* #%L
- * $Id: LimaXAResource.java 3585 2012-08-08 14:52:14Z tchemit $
- * $HeadURL: http://svn.chorem.org/svn/lima/trunk/lima-business/src/main/java/org/chorem… $
+ * $Id$
+ * $HeadURL$
* %%
* Copyright (C) 2012 Codelutin, Chatellier Eric
* %%
@@ -23,23 +23,23 @@
package org.chorem.lima;
-import javax.transaction.xa.XAException;
-import javax.transaction.xa.XAResource;
-import javax.transaction.xa.Xid;
-
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.nuiton.topia.persistence.TopiaException;
import org.nuiton.topia.persistence.TopiaTransaction;
+import javax.transaction.xa.XAException;
+import javax.transaction.xa.XAResource;
+import javax.transaction.xa.Xid;
+
/**
* Topia XA ressource containing TopiaContext to commit or rollback.
*
* @author chatellier
- * @version $Revision: 3585 $
+ * @version $Revision$
*
- * Last update : $Date: 2012-08-08 16:52:14 +0200 (mer. 08 août 2012) $
- * By : $Author: tchemit $
+ * Last update : $Date$
+ * By : $Author$
*/
public class LimaXAResource implements XAResource {
Property changes on: trunk/lima-business/src/main/java/org/chorem/lima/LimaXAResource.java
___________________________________________________________________
Added: svn:eol-style
+ native
Added: svn:keywords
+ Author Date Id Revision HeadURL
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-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/AccountingRules.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -2,8 +2,8 @@
* #%L
* Lima business
*
- * $Id: AccountingRules.java 3519 2012-07-12 10:27:43Z echatellier $
- * $HeadURL: http://svn.chorem.org/svn/lima/trunk/lima-business/src/main/java/org/chorem… $
+ * $Id$
+ * $HeadURL$
* %%
* Copyright (C) 2008 - 2012 CodeLutin, Chatellier Eric
* %%
Property changes on: trunk/lima-business/src/main/java/org/chorem/lima/business/AccountingRules.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/LimaConfig.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/LimaConfig.java 2014-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/LimaConfig.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -2,8 +2,8 @@
* #%L
* Lima business
*
- * $Id: LimaConfig.java 3796 2014-05-13 14:52:18Z echatellier $
- * $HeadURL: http://svn.chorem.org/lima/trunk/lima-business/src/main/java/org/chorem/lim… $
+ * $Id$
+ * $HeadURL$
* %%
* Copyright (C) 2008 - 2012 CodeLutin, Chatellier Eric
* %%
@@ -31,17 +31,17 @@
import org.chorem.lima.business.accountingrules.FranceAccountingRules;
import org.chorem.lima.business.migration.DatabaseMigrationClass;
import org.chorem.lima.entity.LimaCallaoEntityEnum;
+import org.nuiton.config.ApplicationConfig;
+import org.nuiton.config.ArgumentsParserException;
+import org.nuiton.config.ConfigOptionDef;
import org.nuiton.topia.migration.TopiaMigrationEngine;
+import org.nuiton.topia.migration.TopiaMigrationService;
import org.nuiton.topia.persistence.TopiaConfigurationConstants;
-import org.nuiton.topia.migration.TopiaMigrationService;
-import org.nuiton.config.ApplicationConfig;
-import org.nuiton.config.ConfigOptionDef;
-import org.nuiton.config.ArgumentsParserException;
import java.io.File;
+import static org.nuiton.i18n.I18n.n;
import static org.nuiton.i18n.I18n.t;
-import static org.nuiton.i18n.I18n.n;
/**
* Configuration pour le business.
@@ -49,10 +49,10 @@
* A voir comment le lier avec celui de lima swing.
*
* @author chatellier
- * @version $Revision: 3796 $
+ * @version $Revision$
* <p/>
- * Last update : $Date: 2014-05-13 16:52:18 +0200 (mar. 13 mai 2014) $
- * By : $Author: echatellier $
+ * Last update : $Date$
+ * By : $Author$
*/
public class LimaConfig extends ApplicationConfig {
Property changes on: trunk/lima-business/src/main/java/org/chorem/lima/business/LimaConfig.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/LimaInterceptor.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/LimaInterceptor.java 2014-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/LimaInterceptor.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -1,7 +1,7 @@
/*
* #%L
- * $Id: LimaInterceptor.java 3585 2012-08-08 14:52:14Z tchemit $
- * $HeadURL: http://svn.chorem.org/lima/trunk/lima-business/src/main/java/org/chorem/lim… $
+ * $Id$
+ * $HeadURL$
* %%
* Copyright (C) 2012 Codelutin, Chatellier Eric
* %%
@@ -23,16 +23,7 @@
package org.chorem.lima.business;
-import java.util.Properties;
-
-import javax.annotation.Resource;
-import javax.ejb.Stateless;
-import javax.ejb.TransactionAttribute;
-import javax.interceptor.AroundInvoke;
-import javax.interceptor.InvocationContext;
-import javax.transaction.Transaction;
-import javax.transaction.TransactionManager;
-
+import com.google.common.base.Function;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.LimaXAResource;
@@ -42,21 +33,28 @@
import org.chorem.lima.entity.LimaCallaoTopiaPersistenceContext;
import org.nuiton.config.ApplicationConfig;
import org.nuiton.topia.persistence.TopiaApplicationContextCache;
-
-import com.google.common.base.Function;
import org.nuiton.topia.persistence.TopiaException;
import org.nuiton.topia.persistence.util.TopiaUtil;
+import javax.annotation.Resource;
+import javax.ejb.Stateless;
+import javax.ejb.TransactionAttribute;
+import javax.interceptor.AroundInvoke;
+import javax.interceptor.InvocationContext;
+import javax.transaction.Transaction;
+import javax.transaction.TransactionManager;
+import java.util.Properties;
+
/**
* Interceptor for topia context transaction.
*
* http://stackoverflow.com/questions/8608349
*
* @author chatellier
- * @version $Revision: 3585 $
+ * @version $Revision$
*
- * Last update : $Date: 2012-08-08 16:52:14 +0200 (mer. 08 août 2012) $
- * By : $Author: tchemit $
+ * Last update : $Date$
+ * By : $Author$
*/
@Stateless
public class LimaInterceptor {
Property changes on: trunk/lima-business/src/main/java/org/chorem/lima/business/LimaInterceptor.java
___________________________________________________________________
Added: svn:eol-style
+ native
Added: svn:keywords
+ Author Date Id Revision HeadURL
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ServiceListener.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ServiceListener.java 2014-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ServiceListener.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -2,8 +2,8 @@
* #%L
* Lima business
*
- * $Id: ServiceListener.java 3278 2011-08-16 14:09:44Z tchemit $
- * $HeadURL: http://svn.chorem.org/svn/lima/trunk/lima-business/src/main/java/org/chorem… $
+ * $Id$
+ * $HeadURL$
* %%
* Copyright (C) 2008 - 2010 CodeLutin
* %%
Property changes on: trunk/lima-business/src/main/java/org/chorem/lima/business/ServiceListener.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ServiceMonitorable.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ServiceMonitorable.java 2014-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ServiceMonitorable.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -2,8 +2,8 @@
* #%L
* Lima business
*
- * $Id: ServiceMonitorable.java 3366 2012-04-13 13:46:24Z echatellier $
- * $HeadURL: http://svn.chorem.org/svn/lima/trunk/lima-business/src/main/java/org/chorem… $
+ * $Id$
+ * $HeadURL$
* %%
* Copyright (C) 2008 - 2010 CodeLutin
* %%
Property changes on: trunk/lima-business/src/main/java/org/chorem/lima/business/ServiceMonitorable.java
___________________________________________________________________
Added: svn:eol-style
+ native
Added: svn:keywords
+ Author Date Id Revision HeadURL
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-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/DefaultAccountingRules.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -2,8 +2,8 @@
* #%L
* Lima business
*
- * $Id: DefaultAccountingRules.java 3777 2014-04-14 07:29:08Z sbavencoff $
- * $HeadURL: http://svn.chorem.org/lima/trunk/lima-business/src/main/java/org/chorem/lim… $
+ * $Id$
+ * $HeadURL$
* %%
* Copyright (C) 2008 - 2012 CodeLutin, Chatellier Eric
* %%
Property changes on: trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/DefaultAccountingRules.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
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-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/FranceAccountingRules.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -2,8 +2,8 @@
* #%L
* Lima business
*
- * $Id: FranceAccountingRules.java 3777 2014-04-14 07:29:08Z sbavencoff $
- * $HeadURL: http://svn.chorem.org/lima/trunk/lima-business/src/main/java/org/chorem/lim… $
+ * $Id$
+ * $HeadURL$
* %%
* Copyright (C) 2008 - 2012 CodeLutin, Chatellier Eric
* %%
Property changes on: trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/FranceAccountingRules.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AbstractLimaService.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AbstractLimaService.java 2014-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AbstractLimaService.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -2,8 +2,8 @@
* #%L
* Lima business
*
- * $Id: AbstractLimaService.java 3409 2012-05-11 10:19:53Z echatellier $
- * $HeadURL: http://svn.chorem.org/svn/lima/trunk/lima-business/src/main/java/org/chorem… $
+ * $Id$
+ * $HeadURL$
* %%
* Copyright (C) 2008 - 2012 CodeLutin, Chatellier Eric
* %%
@@ -34,7 +34,7 @@
* Abstract code for all ejb services (get context, catch, finally...).
*
* @author chatellier
- * @version $Revision: 3409 $
+ * @version $Revision$
*/
public abstract class AbstractLimaService {
Property changes on: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AbstractLimaService.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
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-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -2,8 +2,8 @@
* #%L
* Lima business
*
- * $Id: AccountServiceImpl.java 3777 2014-04-14 07:29:08Z sbavencoff $
- * $HeadURL: http://svn.chorem.org/lima/trunk/lima-business/src/main/java/org/chorem/lim… $
+ * $Id$
+ * $HeadURL$
* %%
* Copyright (C) 2008 - 2010 CodeLutin
* %%
Property changes on: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java
___________________________________________________________________
Added: svn:eol-style
+ native
Added: svn:keywords
+ Author Date Id Revision HeadURL
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ClosedPeriodicEntryBookServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ClosedPeriodicEntryBookServiceImpl.java 2014-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ClosedPeriodicEntryBookServiceImpl.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -3,8 +3,8 @@
/*
* #%L
* Lima :: business
- * $Id: ClosedPeriodicEntryBookServiceImpl.java 3768 2014-04-11 13:38:02Z dcosse $
- * $HeadURL: http://svn.chorem.org/lima/trunk/lima-business/src/main/java/org/chorem/lim… $
+ * $Id$
+ * $HeadURL$
* %%
* Copyright (C) 2008 - 2014 CodeLutin
* %%
Property changes on: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ClosedPeriodicEntryBookServiceImpl.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/DocumentServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/DocumentServiceImpl.java 2014-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/DocumentServiceImpl.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -2,8 +2,8 @@
* #%L
* Lima business
*
- * $Id: DocumentServiceImpl.java 3778 2014-04-15 16:09:41Z dcosse $
- * $HeadURL: http://svn.chorem.org/lima/trunk/lima-business/src/main/java/org/chorem/lim… $
+ * $Id$
+ * $HeadURL$
* %%
* Copyright (C) 2008 - 2012 CodeLutin, Chatellier Eric
* %%
Property changes on: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/DocumentServiceImpl.java
___________________________________________________________________
Added: svn:eol-style
+ native
Added: svn:keywords
+ Author Date Id Revision HeadURL
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-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/EntryBookServiceImpl.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -2,8 +2,8 @@
* #%L
* Lima business
*
- * $Id: EntryBookServiceImpl.java 3780 2014-05-05 16:28:39Z dcosse $
- * $HeadURL: http://svn.chorem.org/lima/trunk/lima-business/src/main/java/org/chorem/lim… $
+ * $Id$
+ * $HeadURL$
* %%
* Copyright (C) 2008 - 2012 CodeLutin, Chatellier Eric
* %%
Property changes on: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/EntryBookServiceImpl.java
___________________________________________________________________
Added: svn:eol-style
+ native
Added: svn:keywords
+ Author Date Id Revision HeadURL
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/EntryServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/EntryServiceImpl.java 2014-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/EntryServiceImpl.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -3,8 +3,8 @@
/*
* #%L
* Lima :: business
- * $Id: EntryServiceImpl.java 3768 2014-04-11 13:38:02Z dcosse $
- * $HeadURL: http://svn.chorem.org/lima/trunk/lima-business/src/main/java/org/chorem/lim… $
+ * $Id$
+ * $HeadURL$
* %%
* Copyright (C) 2008 - 2014 CodeLutin
* %%
Property changes on: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/EntryServiceImpl.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
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-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ExportServiceImpl.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -2,8 +2,8 @@
* #%L
* Lima business
*
- * $Id: ExportServiceImpl.java 3781 2014-05-06 09:22:03Z dcosse $
- * $HeadURL: http://svn.chorem.org/lima/trunk/lima-business/src/main/java/org/chorem/lim… $
+ * $Id$
+ * $HeadURL$
* %%
* Copyright (C) 2008 - 2012 CodeLutin, Chatellier Eric
* %%
@@ -65,10 +65,10 @@
/**
* CSV import export service.
*
- * @version $Revision: 3781 $
+ * @version $Revision$
* <p/>
- * Last update : $Date: 2014-05-06 11:22:03 +0200 (mar. 06 mai 2014) $
- * By : $Author: dcosse $
+ * Last update : $Date$
+ * By : $Author$
*/
@Stateless
@Remote(ExportService.class)
Property changes on: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ExportServiceImpl.java
___________________________________________________________________
Added: svn:eol-style
+ native
Added: svn:keywords
+ Author Date Id Revision HeadURL
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-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialPeriodServiceImpl.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -2,8 +2,8 @@
* #%L
* Lima business
*
- * $Id: FinancialPeriodServiceImpl.java 3740 2014-01-17 22:12:04Z dcosse $
- * $HeadURL: http://svn.chorem.org/svn/lima/trunk/lima-business/src/main/java/org/chorem… $
+ * $Id$
+ * $HeadURL$
* %%
* Copyright (C) 2008 - 2010 CodeLutin
* %%
Property changes on: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialPeriodServiceImpl.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
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-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialStatementServiceImpl.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -2,8 +2,8 @@
* #%L
* Lima business
*
- * $Id: FinancialStatementServiceImpl.java 3777 2014-04-14 07:29:08Z sbavencoff $
- * $HeadURL: http://svn.chorem.org/lima/trunk/lima-business/src/main/java/org/chorem/lim… $
+ * $Id$
+ * $HeadURL$
* %%
* Copyright (C) 2008 - 2012 CodeLutin, Chatellier Eric
* %%
Property changes on: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialStatementServiceImpl.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
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-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -2,8 +2,8 @@
* #%L
* Lima business
* *
- * $Id: FinancialTransactionServiceImpl.java 3783 2014-05-06 16:47:18Z dcosse $
- * $HeadURL: http://svn.chorem.org/lima/trunk/lima-business/src/main/java/org/chorem/lim… $
+ * $Id$
+ * $HeadURL$
* %%
* Copyright (C) 2008 - 2012 CodeLutin, Chatellier Eric
* %%
Property changes on: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java
___________________________________________________________________
Added: svn:eol-style
+ native
Added: svn:keywords
+ Author Date Id Revision HeadURL
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-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FiscalPeriodServiceImpl.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -2,8 +2,8 @@
* #%L
* Lima business
* *
- * $Id: FiscalPeriodServiceImpl.java 3777 2014-04-14 07:29:08Z sbavencoff $
- * $HeadURL: http://svn.chorem.org/lima/trunk/lima-business/src/main/java/org/chorem/lim… $
+ * $Id$
+ * $HeadURL$
* %%
* Copyright (C) 2008 - 2012 CodeLutin, Chatellier Eric
* %%
Property changes on: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FiscalPeriodServiceImpl.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/HttpServerServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/HttpServerServiceImpl.java 2014-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/HttpServerServiceImpl.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -2,8 +2,8 @@
* #%L
* Lima business
*
- * $Id: HttpServerServiceImpl.java 3777 2014-04-14 07:29:08Z sbavencoff $
- * $HeadURL: http://svn.chorem.org/lima/trunk/lima-business/src/main/java/org/chorem/lim… $
+ * $Id$
+ * $HeadURL$
* %%
* Copyright (C) 2008 - 2012 CodeLutin, Chatellier Eric
* %%
Property changes on: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/HttpServerServiceImpl.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/IdentityServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/IdentityServiceImpl.java 2014-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/IdentityServiceImpl.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -2,8 +2,8 @@
* #%L
* Lima business
*
- * $Id: IdentityServiceImpl.java 3410 2012-05-11 10:26:46Z echatellier $
- * $HeadURL: http://svn.chorem.org/svn/lima/trunk/lima-business/src/main/java/org/chorem… $
+ * $Id$
+ * $HeadURL$
* %%
* Copyright (C) 2008 - 2012 CodeLutin, Chatellier Eric
* %%
Property changes on: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/IdentityServiceImpl.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
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-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -2,8 +2,8 @@
* #%L
* Lima business
*
- * $Id: ImportServiceImpl.java 3782 2014-05-06 15:41:32Z dcosse $
- * $HeadURL: http://svn.chorem.org/lima/trunk/lima-business/src/main/java/org/chorem/lim… $
+ * $Id$
+ * $HeadURL$
* %%
* Copyright (C) 2008 - 2012 CodeLutin, Chatellier Eric
* %%
@@ -26,8 +26,6 @@
package org.chorem.lima.business.ejb;
import au.com.bytecode.opencsv.CSVReader;
-import au.com.bytecode.opencsv.bean.ColumnPositionMappingStrategy;
-import au.com.bytecode.opencsv.bean.CsvToBean;
import com.google.common.base.Function;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
@@ -37,16 +35,12 @@
import org.apache.pdfbox.exceptions.COSVisitorException;
import org.apache.pdfbox.pdmodel.PDDocument;
import org.apache.pdfbox.pdmodel.interactive.form.PDField;
-import org.chorem.lima.beans.EntryEBP;
-import org.chorem.lima.beans.EntryEBPImpl;
import org.chorem.lima.beans.EntryImport;
import org.chorem.lima.beans.FinancialTransactionImport;
import org.chorem.lima.business.AlreadyExistAccountException;
import org.chorem.lima.business.ImportEbpException;
import org.chorem.lima.business.InvalidAccountNumberException;
import org.chorem.lima.business.LimaConfig;
-import org.chorem.lima.business.LockedEntryBookException;
-import org.chorem.lima.business.LockedFinancialPeriodException;
import org.chorem.lima.business.api.AccountService;
import org.chorem.lima.business.api.ClosedPeriodicEntryBookService;
import org.chorem.lima.business.api.EntryBookService;
@@ -57,18 +51,11 @@
import org.chorem.lima.business.api.IdentityService;
import org.chorem.lima.business.api.ImportService;
import org.chorem.lima.business.utils.DocumentsEnum;
-import org.chorem.lima.business.utils.EntryEBPComparator;
-import org.chorem.lima.business.utils.FiscalPeriodComparator;
import org.chorem.lima.business.utils.ImportExportEntityEnum;
import org.chorem.lima.entity.Account;
import org.chorem.lima.entity.AccountImpl;
-import org.chorem.lima.entity.Entry;
import org.chorem.lima.entity.EntryBook;
import org.chorem.lima.entity.EntryBookImpl;
-import org.chorem.lima.entity.EntryImpl;
-import org.chorem.lima.entity.FinancialTransaction;
-import org.chorem.lima.entity.FinancialTransactionImpl;
-import org.chorem.lima.entity.FiscalPeriod;
import org.chorem.lima.entity.Identity;
import org.chorem.lima.entity.IdentityImpl;
@@ -81,13 +68,7 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.StringReader;
-import java.math.BigDecimal;
-import java.text.ParseException;
import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Date;
import java.util.List;
import java.util.Map;
@@ -149,215 +130,6 @@
// ################ IMPORT THIRD PART ACCOUNTING SOFTWARE ################
@Override
- public String importEntriesFromEbp(String datas) throws ImportEbpException{
-
- if (datas.isEmpty()) {
- throw new ImportEbpException(t("lima-business.import.ebpnoentry"));
- }
-
- // use for logs
- long before = System.currentTimeMillis();
-
- List<Account> accounts = accountService.getAllAccounts();
- if (accounts == null) {
- accounts = Lists.newArrayList();
- }
- Map<String, Account> indexedAccounts = Maps.newHashMap(Maps.uniqueIndex(accounts, GET_ACCOUNT_NUMBER));
-
- List<EntryBook> entryBooks = entryBookService.getAllEntryBooks();
- if (entryBooks == null) {
- entryBooks = Lists.newArrayList();
- }
- Map<String, EntryBook> indexedEntryBooks = Maps.newHashMap(Maps.uniqueIndex(entryBooks, GET_ENTRY_BOOK_CODE));
-
- SimpleDateFormat epbDateFormat = new SimpleDateFormat(DATE_PATTERN);
- StringBuilder result = new StringBuilder();
- CSVReader csvReader = null;
-
- try {
- csvReader = new CSVReader(new StringReader(datas));
- ColumnPositionMappingStrategy<EntryEBPImpl> strat = new ColumnPositionMappingStrategy<EntryEBPImpl>();
- strat.setType(EntryEBPImpl.class);
- // read header to set strategy mapping
- strat.setColumnMapping(csvReader.readNext());
-
- // check if file have a good header
- List<String> headEntry = new ArrayList<String>();
- headEntry.add(EntryEBP.PROPERTY_DAT_ECR);
- headEntry.add(EntryEBP.PROPERTY_JOURNAL);
- headEntry.add(EntryEBP.PROPERTY_COMPTE);
- headEntry.add(EntryEBP.PROPERTY_LIBELLE);
- headEntry.add(EntryEBP.PROPERTY_PIECE);
- headEntry.add(EntryEBP.PROPERTY_DEBIT);
- headEntry.add(EntryEBP.PROPERTY_CREDIT);
- headEntry.add(EntryEBP.PROPERTY_LETTRE);
- if (!Arrays.asList(strat.getColumnMapping()).containsAll(headEntry)) {
- throw new ImportEbpException(
- t("lima-business.import.ebpnoheader"));
- }
-
- // Sorts the list according to the entry date
- CsvToBean<EntryEBPImpl> csv = new CsvToBean<EntryEBPImpl>();
- List<EntryEBPImpl> list = csv.parse(strat, csvReader);
- Collections.sort(list, new EntryEBPComparator());
-
- // Get all the valid fiscalPeriods Ordered by date.
- List<FiscalPeriod> fiscalPeriods = fiscalPeriodService
- .getAllUnblockedFiscalPeriods();
- Collections.sort(fiscalPeriods, new FiscalPeriodComparator());
-
- // There are no valid fiscalPeriods -> exception
- int nbFiscalPeriods = fiscalPeriods.size();
- if (nbFiscalPeriods == 0) {
- throw new ImportEbpException(
- t("lima-business.import.nofiscalperiodopen"));
- }
-
- // attributes declaration
- FinancialTransaction financialTransaction = null;
- Date dateEcr;
- Account account;
- Entry entry;
- BigDecimal debit;
- String entryBookCode;
- EntryBook entryBook;
-
- // 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
-
- for (EntryEBP entryEBP : list) {
- dateEcr = epbDateFormat.parse(entryEBP.getDatEcr());
-
- // account loading
- account = indexedAccounts.get(entryEBP.getCompte());
-
- // if entry date have fiscalperiod open
- if (dateEcr.compareTo(fiscalPeriods.get(0).getBeginDate()) < 0
- || dateEcr.compareTo(fiscalPeriods.get(nbFiscalPeriods - 1).getEndDate()) > 0) {
- result.append(t(
- "lima-business.import.entriesoutofdatesrange", dateEcr));
- }
-
- // if account not exist not export -> exception
- else if (account == null) {
- // TODO DCossé 28/05/14 this message is not displayed on user's error window.
- throw new ImportEbpException(t(
- "lima-business.import.ebpmissingaccount",
- entryEBP.getCompte()));
- }
-
- // create entry
- else {
-
- // creation of the entry
- // initialisation of this attributs
-
- entry = new EntryImpl();
-
- // the entry has one amount witch can be Debit or Credit
- // regarding the value of the boolean:debit
- debit = new BigDecimal(entryEBP.getDebit());
- if (BigDecimal.ZERO.compareTo(debit)==0) {
- entry.setDebit(false);
- entry.setAmount(new BigDecimal(entryEBP.getCredit()));
- } else {
- entry.setDebit(true);
- entry.setAmount(debit);
- }
- entry.setAccount(account);
- entry.setDescription(StringUtils.trimToNull(entryEBP.getLibelle()));
- entry.setVoucher(StringUtils.trimToNull(entryEBP.getPiece()));
- entry.setLettering(StringUtils.trimToNull(entryEBP.getLettre()));
-
- // Association of the entry with the financialTransaction
- // Each financialTransaction is associated with an entryBook
- // loading of the entryBook from the db according to the entryBookCode
- // if the entryBook doesn't exist it's entity is created
- // if any financialTransaction exist for the entry
- // a financialTransaction entity is created associated with the entryBook
- // creation of the entry entity
- // association between the entry and the financialTransaction is done.
-
- entryBookCode = entryEBP.getJournal();
- // entryBook loading
- entryBook = indexedEntryBooks.get(entryBookCode);
-
- // if entrybook not exist create it !
- if (entryBook == null) {
- entryBook = new EntryBookImpl();
- entryBook.setCode(entryBookCode);
- //financialTransaction = null;
- // create it
- entryBook = entryBookService.createEntryBook(entryBook);
- result.append(t(
- "lima-business.import.entrybooknotexist",
- entryBook));
- }
- try {
-
- // create transaction
- if (financialTransaction == null
- || !(dateEcr.equals(financialTransaction
- .getTransactionDate()) && entryBook
- .getCode().equals(
- financialTransaction.getEntryBook()
- .getCode()))) {
- // create financial transaction
- financialTransaction = new FinancialTransactionImpl();
- financialTransaction.setEntryBook(entryBook);
- financialTransaction.setTransactionDate(dateEcr);
- financialTransaction = financialTransactionService.createFinancialTransaction(financialTransaction);
- result.append(t(
- "lima-business.import.transactionadded", dateEcr,
- entryBook.getCode()));
- }
- financialTransaction.getEntry().add(entry);
- // Inside the db, the entries reference the financialTransaction
- entry.setFinancialTransaction(financialTransaction);
- entry = financialTransactionService.createEntry(entry);
- result.append(t("lima-business.import.entryadded",
- entry.getDescription(), entry.getAmount()));
-
- } catch (LockedFinancialPeriodException e) {
- result.append(t("lima-business.import.entries.error.lockedFinancialPeriod",
- e.getFinancialPeriod().getBeginDate(),
- e.getFinancialPeriod().getEndDate()));
- } catch (LockedEntryBookException e) {
- result.append(t("lima-business.import.entries.error.lockedEntryBook",
- e.getClosedPeriodicEntryBook().getEntryBook().getCode(),
- e.getClosedPeriodicEntryBook().getEntryBook().getLabel(),
- e.getClosedPeriodicEntryBook().getFinancialPeriod().getBeginDate(),
- e.getClosedPeriodicEntryBook().getFinancialPeriod().getEndDate()));
- }
-
- }
- }
-
- if (log.isInfoEnabled()) {
-
- long after = System.currentTimeMillis();
- log.info("Imported form EBP : " + list.size() + " entries in "
- + (after - before) + " ms");
- }
- } catch (ParseException e) {
- throw new ImportEbpException("Can't import ", e);
- } catch (IOException e) {
- throw new ImportEbpException("Can't import ", e);
- } finally {
- if (csvReader != null) {
- try {
- csvReader.close();
- } catch (IOException e) {
- // on fait rien
- }
- }
- }
- return result.toString();
- }
-
- @Override
public String importAccountsChartFromEbp(String datas) throws ImportEbpException{
long before = System.currentTimeMillis();
List<Account> accounts = accountService.getAllAccounts();
Property changes on: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/NewExportServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/NewExportServiceImpl.java 2014-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/NewExportServiceImpl.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -2,8 +2,8 @@
* #%L
* Lima business
*
- * $Id: ExportServiceImpl.java 3781 2014-05-06 09:22:03Z dcosse $
- * $HeadURL: http://svn.chorem.org/lima/trunk/lima-business/src/main/java/org/chorem/lim… $
+ * $Id$
+ * $HeadURL$
* %%
* Copyright (C) 2008 - 2012 CodeLutin, Chatellier Eric
* %%
@@ -74,10 +74,10 @@
/**
* CSV import export service.
*
- * @version $Revision: 3781 $
+ * @version $Revision$
* <p/>
- * Last update : $Date: 2014-05-06 11:22:03 +0200 (mar. 06 mai 2014) $
- * By : $Author: dcosse $
+ * Last update : $Date$
+ * By : $Author$
*/
@Stateless
@Remote(NewExportService.class)
Property changes on: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/NewExportServiceImpl.java
___________________________________________________________________
Added: svn:eol-style
+ native
Added: svn:keywords
+ Author Date Id Revision HeadURL
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/NewImportServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/NewImportServiceImpl.java 2014-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/NewImportServiceImpl.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -22,15 +22,19 @@
* #L%
*/
-import com.google.common.base.Predicate;
+import com.google.common.base.Function;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
+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.FiscalPeriodException;
+import org.chorem.lima.business.ImportEbpException;
import org.chorem.lima.business.ImportResult;
import org.chorem.lima.business.InvalidAccountNumberException;
import org.chorem.lima.business.LockedEntryBookException;
@@ -52,11 +56,17 @@
import org.chorem.lima.business.ejb.csv.FinancialTransactionModel;
import org.chorem.lima.business.ejb.csv.FiscalPeriodModel;
import org.chorem.lima.business.ejb.csv.VatStatementModel;
+import org.chorem.lima.business.ejb.ebp.EntryEBPModel;
+import org.chorem.lima.business.utils.EntryEBPComparator;
+import org.chorem.lima.business.utils.FiscalPeriodComparator;
import org.chorem.lima.entity.Account;
import org.chorem.lima.entity.Entry;
import org.chorem.lima.entity.EntryBook;
+import org.chorem.lima.entity.EntryBookImpl;
+import org.chorem.lima.entity.EntryImpl;
import org.chorem.lima.entity.FinancialStatement;
import org.chorem.lima.entity.FinancialTransaction;
+import org.chorem.lima.entity.FinancialTransactionImpl;
import org.chorem.lima.entity.FiscalPeriod;
import org.chorem.lima.entity.VatStatement;
import org.nuiton.csv.Import;
@@ -69,11 +79,17 @@
import javax.ejb.Stateless;
import javax.ejb.TransactionAttribute;
import java.io.InputStream;
+import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Collection;
+import java.util.Collections;
+import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+
+import static org.nuiton.i18n.I18n.t;
+
/**
* Created by davidcosse on 03/06/14.
*/
@@ -103,11 +119,17 @@
@EJB
protected VatStatementService vatStatementService;
- protected static final Predicate<FinancialStatement> IS_ROOT_FINANCIAL_STATEMENT = new Predicate<FinancialStatement>() {
+ protected static final Function<Account, String> GET_ACCOUNT_NUMBER = new Function<Account, String>() {
+ @Override
+ public String apply(Account input) {
+ return input.getAccountNumber();
+ }
+ };
+ protected static final Function<EntryBook, String> GET_ENTRY_BOOK_CODE = new Function<EntryBook, String>() {
@Override
- public boolean apply(FinancialStatement financialStatement) {
- return financialStatement.getMasterFinancialStatement()==null;
+ public String apply(EntryBook input) {
+ return input.getCode();
}
};
@@ -531,7 +553,7 @@
@Override
public List<ImportResult> importBackup(String entryBooks, String financialTransactions, String fiscalPeriods, String accounts, String entries) throws AlreadyExistAccountException, InvalidAccountNumberException {
- List<ImportResult> results = new ArrayList<ImportResult>();
+ List<ImportResult> results = new ArrayList<>();
importAccountAsCSV(accounts);
importEntryBooksAsCSV(entryBooks);
importFiscalPeriodsAsCSV(fiscalPeriods);
@@ -539,4 +561,178 @@
importEntriesAsCSV(entries);
return results;
}
+
+ @Override
+ public ImportResult importEntriesFromEbp(String datas) throws ImportEbpException {
+
+ ImportResult result = new ImportResult();
+ if (datas.isEmpty()) {
+ result.getException().addException(0, new ImportEbpException(t("lima-business.import.ebpnoentry")));
+ return result;
+ }
+
+ // use for logs
+ long before = System.currentTimeMillis();
+
+ List<Account> accounts = accountService.getAllAccounts();
+ if (accounts == null) {
+ accounts = Lists.newArrayList();
+ }
+ Map<String, Account> indexedAccounts = Maps.newHashMap(Maps.uniqueIndex(accounts, GET_ACCOUNT_NUMBER));
+
+ List<EntryBook> entryBooks = entryBookService.getAllEntryBooks();
+ if (entryBooks == null) {
+ entryBooks = Lists.newArrayList();
+ }
+ Map<String, EntryBook> indexedEntryBooks = Maps.newHashMap(Maps.uniqueIndex(entryBooks, GET_ENTRY_BOOK_CODE));
+
+ InputStream contentStream = null;
+ try {
+ contentStream = IOUtils.toInputStream(datas);
+
+ ImportModel<EntryEBP> model = new EntryEBPModel();
+
+ Import<EntryEBP> entryEBPs = Import.newImport(model, contentStream);
+ List<EntryEBP> list = new ArrayList<>();
+ for (EntryEBP entryEBP : entryEBPs) {
+ list.add(entryEBP);
+ }
+
+ Collections.sort(list, new EntryEBPComparator());
+
+ // Get all the valid fiscalPeriods Ordered by date.
+ List<FiscalPeriod> fiscalPeriods = fiscalPeriodService
+ .getAllUnblockedFiscalPeriods();
+ Collections.sort(fiscalPeriods, new FiscalPeriodComparator());
+
+ // There are no valid fiscalPeriods -> exception
+ int nbFiscalPeriods = fiscalPeriods.size();
+ if (nbFiscalPeriods == 0) {
+ result.getException().addException(0, new ImportEbpException(
+ t("lima-business.import.nofiscalperiodopen")));
+ // whe don't want to go further.
+ return result;
+ }
+
+ // attributes declaration
+ FinancialTransaction financialTransaction = null;
+ Date dateEcr;
+ Account account;
+ Entry entry;
+ BigDecimal debit;
+ String entryBookCode;
+ EntryBook entryBook;
+
+ // 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
+
+ int lineIndex = 0;
+ for (EntryEBP entryEBP : list) {
+ dateEcr = entryEBP.getDatEcr();
+
+ // account loading
+ account = indexedAccounts.get(entryEBP.getCompte());
+
+ // if entry date have fiscalperiod open
+ if (dateEcr.compareTo(fiscalPeriods.get(0).getBeginDate()) < 0
+ || dateEcr.compareTo(fiscalPeriods.get(nbFiscalPeriods - 1).getEndDate()) > 0) {
+ result.getException().addException(lineIndex, new ImportEbpException(t("lima-business.import.entriesoutofdatesrange", dateEcr)));
+ lineIndex++;
+ continue;
+ }
+
+ // if account not exist not export -> exception
+ else if (account == null) {
+ result.getException().addException(lineIndex, new ImportEbpException(t("lima-business.import.ebpmissingaccount", entryEBP.getCompte())));
+ lineIndex++;
+ continue;
+ }
+
+ // create entry
+ else {
+
+ // creation of the entry
+ // initialisation of this attributs
+
+ entry = new EntryImpl();
+
+ // the entry has one amount witch can be Debit or Credit
+ // regarding the value of the boolean:debit
+ debit = entryEBP.getDebit();
+ if (BigDecimal.ZERO.compareTo(debit)==0) {
+ entry.setDebit(false);
+ entry.setAmount(entryEBP.getCredit());
+ } else {
+ entry.setDebit(true);
+ entry.setAmount(debit);
+ }
+ entry.setAccount(account);
+ entry.setDescription(entryEBP.getLibelle());
+ entry.setVoucher(entryEBP.getPiece());
+ entry.setLettering(entryEBP.getLettre());
+
+ // Association of the entry with the financialTransaction
+ // Each financialTransaction is associated with an entryBook
+ // loading of the entryBook from the db according to the entryBookCode
+ // if the entryBook doesn't exist it's entity is created
+ // if any financialTransaction exist for the entry
+ // a financialTransaction entity is created associated with the entryBook
+ // creation of the entry entity
+ // association between the entry and the financialTransaction is done.
+
+ entryBookCode = entryEBP.getJournal();
+ // entryBook loading
+ entryBook = indexedEntryBooks.get(entryBookCode);
+
+ // if entrybook not exist create it !
+ if (entryBook == null) {
+ entryBook = new EntryBookImpl();
+ entryBook.setCode(entryBookCode);
+ //financialTransaction = null;
+ // create it
+ entryBook = entryBookService.createEntryBook(entryBook);
+ }
+ try {
+
+ // create transaction
+ if (financialTransaction == null
+ || !(dateEcr.equals(financialTransaction
+ .getTransactionDate()) && entryBook
+ .getCode().equals(
+ financialTransaction.getEntryBook()
+ .getCode()))) {
+ // create financial transaction
+ financialTransaction = new FinancialTransactionImpl();
+ financialTransaction.setEntryBook(entryBook);
+ financialTransaction.setTransactionDate(dateEcr);
+ financialTransaction = financialTransactionService.createFinancialTransaction(financialTransaction);
+ }
+ financialTransaction.getEntry().add(entry);
+ // Inside the db, the entries reference the financialTransaction
+ entry.setFinancialTransaction(financialTransaction);
+ financialTransactionService.createEntry(entry);
+
+ } catch (LockedFinancialPeriodException | LockedEntryBookException e) {
+ result.getException().addException(lineIndex, e);
+ lineIndex++;
+ continue;
+ }
+
+ }
+ result.increaseCreated();
+ lineIndex++;
+ }
+
+ if (log.isInfoEnabled()) {
+ long after = System.currentTimeMillis();
+ log.info("Imported form EBP : " + list.size() + " entries in "
+ + (after - before) + " ms");
+ }
+ } finally {
+ IOUtils.closeQuietly(contentStream);
+ }
+ return result;
+ }
}
Property changes on: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/NewImportServiceImpl.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/OptionsServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/OptionsServiceImpl.java 2014-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/OptionsServiceImpl.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -2,8 +2,8 @@
* #%L
* Lima :: business
*
- * $Id: OptionsServiceImpl.java 3410 2012-05-11 10:26:46Z echatellier $
- * $HeadURL: http://svn.chorem.org/svn/lima/trunk/lima-business/src/main/java/org/chorem… $
+ * $Id$
+ * $HeadURL$
* %%
* Copyright (C) 2008 - 2012 CodeLutin, Chatellier Eric
* %%
@@ -24,12 +24,12 @@
*/
package org.chorem.lima.business.ejb;
+import org.chorem.lima.business.LimaConfig;
+import org.chorem.lima.business.api.OptionsService;
+
import javax.ejb.Remote;
import javax.ejb.Stateless;
-import org.chorem.lima.business.LimaConfig;
-import org.chorem.lima.business.api.OptionsService;
-
@Stateless
@Remote(OptionsService.class)
public class OptionsServiceImpl extends AbstractLimaService implements OptionsService {
Property changes on: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/OptionsServiceImpl.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
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-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -2,8 +2,8 @@
* #%L
* Lima business
*
- * $Id: ReportServiceImpl.java 3742 2014-01-31 14:17:41Z sbavencoff $
- * $HeadURL: http://svn.chorem.org/svn/lima/trunk/lima-business/src/main/java/org/chorem… $
+ * $Id$
+ * $HeadURL$
* %%
* Copyright (C) 2008 - 2012 CodeLutin, Chatellier Eric
* %%
Property changes on: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
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-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/VatStatementServiceImpl.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -2,8 +2,8 @@
* #%L
* Lima :: business
*
- * $Id: VatStatementServiceImpl.java 3740 2014-01-17 22:12:04Z dcosse $
- * $HeadURL: http://svn.chorem.org/svn/lima/trunk/lima-business/src/main/java/org/chorem… $
+ * $Id$
+ * $HeadURL$
* %%
* Copyright (C) 2008 - 2012 CodeLutin, Chatellier Eric
* %%
Property changes on: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/VatStatementServiceImpl.java
___________________________________________________________________
Added: svn:eol-style
+ native
Added: svn:keywords
+ Author Date Id Revision HeadURL
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/csv/AbstractLimaModel.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/csv/AbstractLimaModel.java 2014-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/csv/AbstractLimaModel.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -139,21 +139,6 @@
};
/**
- * Date converter converter.
- */
- protected static final ValueParser<Date> DATE_PARSER = new ValueParser<Date>() {
- @Override
- public Date parse(String value) throws ParseException {
- Date result = null;
- if (!Strings.isNullOrEmpty(value)) {
- SimpleDateFormat format = new SimpleDateFormat("dd/MM/yyyy");
- result = format.parse(value);
- }
- return result;
- }
- };
-
- /**
* O/N boolean parser.
*/
protected static final ValueParser<Boolean> O_N_PARSER = new ValueParser<Boolean>() {
@@ -217,6 +202,21 @@
}
};
+ /**
+ * Date converter converter.
+ */
+ protected static final ValueParser<Date> DATE_PARSER = new ValueParser<Date>() {
+ @Override
+ public Date parse(String value) throws ParseException {
+ Date result = null;
+ if (!Strings.isNullOrEmpty(value)) {
+ SimpleDateFormat format = new SimpleDateFormat("dd/MM/yyyy");
+ result = format.parse(value);
+ }
+ return result;
+ }
+ };
+
protected static final ValueFormatter<EntryBook> ENTRY_BOOK_TO_ENTRY_BOOK_CODE_FORMATTER = new ValueFormatter<EntryBook>() {
@Override
public String format(EntryBook value) {
Property changes on: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/csv/AbstractLimaModel.java
___________________________________________________________________
Added: svn:eol-style
+ native
Added: svn:keywords
+ Author Date Id Revision HeadURL
Property changes on: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/csv/AccountModel.java
___________________________________________________________________
Added: svn:eol-style
+ native
Added: svn:keywords
+ Author Date Id Revision HeadURL
Property changes on: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/csv/EntryBookModel.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Property changes on: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/csv/EntryModel.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/csv/FinancialStatementModel.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/csv/FinancialStatementModel.java 2014-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/csv/FinancialStatementModel.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -1,5 +1,27 @@
package org.chorem.lima.business.ejb.csv;
+/*
+ * #%L
+ * Lima :: business
+ * %%
+ * 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.beans.FinancialStatementImport;
import org.chorem.lima.beans.FinancialStatementImportImpl;
import org.chorem.lima.entity.FinancialStatement;
Property changes on: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/csv/FinancialStatementModel.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Property changes on: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/csv/FinancialTransactionModel.java
___________________________________________________________________
Added: svn:eol-style
+ native
Added: svn:keywords
+ Author Date Id Revision HeadURL
Property changes on: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/csv/FiscalPeriodModel.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/csv/VatStatementModel.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/csv/VatStatementModel.java 2014-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/csv/VatStatementModel.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -1,5 +1,27 @@
package org.chorem.lima.business.ejb.csv;
+/*
+ * #%L
+ * Lima :: business
+ * %%
+ * 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.beans.VatStatementImport;
import org.chorem.lima.beans.VatStatementImportImpl;
import org.chorem.lima.entity.VatStatement;
Property changes on: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/csv/VatStatementModel.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Copied: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ebp/EntryEBPModel.java (from rev 3879, trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/csv/EntryModel.java)
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ebp/EntryEBPModel.java (rev 0)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ebp/EntryEBPModel.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -0,0 +1,94 @@
+package org.chorem.lima.business.ejb.ebp;
+
+/*
+ * #%L
+ * Lima :: business
+ * %%
+ * 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.beans.EntryEBP;
+import org.chorem.lima.beans.EntryEBPImpl;
+import org.chorem.lima.business.ejb.csv.AbstractLimaModel;
+import org.nuiton.csv.ExportModel;
+import org.nuiton.csv.ExportableColumn;
+import org.nuiton.csv.ModelBuilder;
+
+/**
+ * Created by davidcosse on 03/06/14.
+ */
+public class EntryEBPModel extends AbstractLimaModel<EntryEBP> implements ExportModel<EntryEBP> {
+
+ public EntryEBPModel() {
+ super(',');
+ newMandatoryColumn("Journal", EntryEBP.PROPERTY_JOURNAL);
+ newMandatoryColumn("Compte", EntryEBP.PROPERTY_COMPTE);
+ newMandatoryColumn("DatEcr", EntryEBP.PROPERTY_DAT_ECR, DATE_PARSER);
+ newIgnoredColumn("DatVal");
+ newIgnoredColumn("DatSai");
+ newIgnoredColumn("DatEch");
+ newIgnoredColumn("Poste");
+ newMandatoryColumn("Piece", EntryEBP.PROPERTY_PIECE);
+ newIgnoredColumn("NumDoc");
+ newOptionalColumn("Libelle", EntryEBP.PROPERTY_LIBELLE);
+ newOptionalColumn("Debit", EntryEBP.PROPERTY_DEBIT, BIG_DECIMAL_WITH_NULL_PARSER);
+ newOptionalColumn("Credit", EntryEBP.PROPERTY_CREDIT, BIG_DECIMAL_WITH_NULL_PARSER);
+ newIgnoredColumn("Devise");
+ newIgnoredColumn("TauxDevise");
+ newIgnoredColumn("DevDebit");
+ newIgnoredColumn("DevCredit");
+ newIgnoredColumn("CDebit");
+ newIgnoredColumn("CCredit");
+ newOptionalColumn("Lettre", EntryEBP.PROPERTY_LETTRE);
+ newIgnoredColumn("Rapp");
+ newIgnoredColumn("CodReg");
+ newIgnoredColumn("Cheque");
+ newIgnoredColumn("CptTVA");
+ newIgnoredColumn("MoisTVA");
+ newIgnoredColumn("GTypEcr");
+ newIgnoredColumn("GNumEcr");
+ newIgnoredColumn("DateReleve");
+ newIgnoredColumn("DatLet");
+ newIgnoredColumn("SoftImport");
+ newIgnoredColumn("RefBVR");
+ newIgnoredColumn("NumAdhBVR");
+ newIgnoredColumn("DatderGen");
+ newIgnoredColumn("LetPart");
+ newIgnoredColumn("bSaisieKM");
+ }
+
+ @Override
+ public Iterable<ExportableColumn<EntryEBP, Object>> getColumnsForExport() {
+ ModelBuilder<EntryEBP> modelBuilder = new ModelBuilder<>();
+ modelBuilder.newColumnForExport("Journal", EntryEBP.PROPERTY_JOURNAL);
+ modelBuilder.newColumnForExport("Compte", EntryEBP.PROPERTY_COMPTE, ACCOUNT_TO_ACCOUNT_NUMBER_FORMATTER);
+ modelBuilder.newColumnForExport("DatEcr", EntryEBP.PROPERTY_DAT_ECR, DATE_FORMATTER);
+ modelBuilder.newColumnForExport("Piece", EntryEBP.PROPERTY_PIECE);
+ modelBuilder.newColumnForExport("Libelle", EntryEBP.PROPERTY_LIBELLE);
+ modelBuilder.newColumnForExport("Debit", EntryEBP.PROPERTY_DEBIT, BIG_DECIMAL_FORMATTER);
+ modelBuilder.newColumnForExport("Credit", EntryEBP.PROPERTY_CREDIT, BIG_DECIMAL_FORMATTER);
+ modelBuilder.newColumnForExport("Lettre", EntryEBP.PROPERTY_LETTRE);
+
+ return (Iterable) modelBuilder.getColumnsForExport();
+ }
+
+ @Override
+ public EntryEBP newEmptyInstance() {
+ return new EntryEBPImpl();
+ }
+}
Property changes on: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ebp/EntryEBPModel.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
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-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/migration/DatabaseMigrationClass.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -2,8 +2,8 @@
* #%L
* Lima :: business
*
- * $Id: DatabaseMigrationClass.java 3322 2012-01-17 09:35:25Z echatellier $
- * $HeadURL: http://svn.chorem.org/svn/lima/trunk/lima-business/src/main/java/org/chorem… $
+ * $Id$
+ * $HeadURL$
* %%
* Copyright (C) 2011 CodeLutin, Victor Salaun
* %%
Property changes on: trunk/lima-business/src/main/java/org/chorem/lima/business/migration/DatabaseMigrationClass.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
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-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/migration/MigrationV0V0_5.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -2,8 +2,8 @@
* #%L
* Lima :: business
*
- * $Id: MigrationV0V0_5.java 3296 2011-09-20 17:49:06Z tchemit $
- * $HeadURL: http://svn.chorem.org/svn/lima/trunk/lima-business/src/main/java/org/chorem… $
+ * $Id$
+ * $HeadURL$
* %%
* Copyright (C) 2011 CodeLutin, Victor Salaun
* %%
@@ -28,6 +28,7 @@
import org.nuiton.topia.persistence.TopiaException;
import org.nuiton.topia.persistence.support.TopiaSqlSupport;
import org.nuiton.util.Version;
+
import java.util.List;
public class MigrationV0V0_5 extends MigrationCallBackForVersion {
Property changes on: trunk/lima-business/src/main/java/org/chorem/lima/business/migration/MigrationV0V0_5.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
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-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/migration/MigrationV0_6.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -2,8 +2,8 @@
* #%L
* Lima :: business
*
- * $Id: MigrationV0_6.java 3421 2012-05-15 09:53:13Z echatellier $
- * $HeadURL: http://svn.chorem.org/svn/lima/trunk/lima-business/src/main/java/org/chorem… $
+ * $Id$
+ * $HeadURL$
* %%
* Copyright (C) 2011 - 2012 CodeLutin, Chatellier Eric
* %%
@@ -32,7 +32,6 @@
import org.nuiton.topia.persistence.support.TopiaSqlSupport;
import org.nuiton.util.Version;
-
import java.util.List;
/**
Property changes on: trunk/lima-business/src/main/java/org/chorem/lima/business/migration/MigrationV0_6.java
___________________________________________________________________
Added: svn:eol-style
+ native
Added: svn:keywords
+ Author Date Id Revision HeadURL
Property changes on: trunk/lima-business/src/main/java/org/chorem/lima/business/migration/MigrationV0_8.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/utils/AccountComparator.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/utils/AccountComparator.java 2014-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/utils/AccountComparator.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -2,8 +2,8 @@
* #%L
* Lima business
*
- * $Id: AccountComparator.java 3290 2011-09-17 12:55:34Z tchemit $
- * $HeadURL: http://svn.chorem.org/svn/lima/trunk/lima-business/src/main/java/org/chorem… $
+ * $Id$
+ * $HeadURL$
* %%
* Copyright (C) 2008 - 2010 CodeLutin
* %%
Property changes on: trunk/lima-business/src/main/java/org/chorem/lima/business/utils/AccountComparator.java
___________________________________________________________________
Added: svn:eol-style
+ native
Added: svn:keywords
+ Author Date Id Revision HeadURL
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/utils/AccountEBPComparator.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/utils/AccountEBPComparator.java 2014-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/utils/AccountEBPComparator.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -2,8 +2,8 @@
* #%L
* Lima business
*
- * $Id: AccountEBPComparator.java 3290 2011-09-17 12:55:34Z tchemit $
- * $HeadURL: http://svn.chorem.org/svn/lima/trunk/lima-business/src/main/java/org/chorem… $
+ * $Id$
+ * $HeadURL$
* %%
* Copyright (C) 2008 - 2010 CodeLutin
* %%
Property changes on: trunk/lima-business/src/main/java/org/chorem/lima/business/utils/AccountEBPComparator.java
___________________________________________________________________
Added: svn:eol-style
+ native
Added: svn:keywords
+ Author Date Id Revision HeadURL
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/utils/DocumentsEnum.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/utils/DocumentsEnum.java 2014-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/utils/DocumentsEnum.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -2,8 +2,8 @@
* #%L
* Lima business
*
- * $Id: DocumentsEnum.java 3777 2014-04-14 07:29:08Z sbavencoff $
- * $HeadURL: http://svn.chorem.org/lima/trunk/lima-business/src/main/java/org/chorem/lim… $
+ * $Id$
+ * $HeadURL$
* %%
* Copyright (C) 2008 - 2010 CodeLutin
* %%
Property changes on: trunk/lima-business/src/main/java/org/chorem/lima/business/utils/DocumentsEnum.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/utils/EntryComparator.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/utils/EntryComparator.java 2014-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/utils/EntryComparator.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -2,8 +2,8 @@
* #%L
* Lima business
*
- * $Id: EntryComparator.java 3721 2013-12-31 15:03:48Z sbavencoff $
- * $HeadURL: http://svn.chorem.org/svn/lima/trunk/lima-business/src/main/java/org/chorem… $
+ * $Id$
+ * $HeadURL$
* %%
* Copyright (C) 2008 - 2012 CodeLutin, Chatellier Eric
* %%
Property changes on: trunk/lima-business/src/main/java/org/chorem/lima/business/utils/EntryComparator.java
___________________________________________________________________
Added: svn:eol-style
+ native
Added: svn:keywords
+ Author Date Id Revision HeadURL
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/utils/EntryEBPComparator.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/utils/EntryEBPComparator.java 2014-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/utils/EntryEBPComparator.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -2,8 +2,8 @@
* #%L
* Lima business
*
- * $Id: EntryEBPComparator.java 3290 2011-09-17 12:55:34Z tchemit $
- * $HeadURL: http://svn.chorem.org/svn/lima/trunk/lima-business/src/main/java/org/chorem… $
+ * $Id$
+ * $HeadURL$
* %%
* Copyright (C) 2008 - 2010 CodeLutin
* %%
@@ -30,8 +30,6 @@
import org.chorem.lima.beans.EntryEBP;
import java.io.Serializable;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
import java.util.Comparator;
import java.util.Date;
@@ -45,19 +43,12 @@
@Override
public int compare(EntryEBP o1, EntryEBP o2) {
int result = 0;
- SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
- try {
- Date date1 = sdf.parse(o1.getDatEcr());
- Date date2 = sdf.parse(o2.getDatEcr());
- result = date1.compareTo(date2);
- if (result == 0) {
- result = o1.getJournal().compareTo(o2.getJournal());
- }
- } catch (ParseException eee) {
- log.error("Can't parse date", eee);
+ Date date1 = o1.getDatEcr();
+ Date date2 = o2.getDatEcr();
+ result = date1.compareTo(date2);
+ if (result == 0) {
+ result = o1.getJournal().compareTo(o2.getJournal());
}
-
-
return result;
}
Property changes on: trunk/lima-business/src/main/java/org/chorem/lima/business/utils/EntryEBPComparator.java
___________________________________________________________________
Added: svn:eol-style
+ native
Added: svn:keywords
+ Author Date Id Revision HeadURL
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/utils/FinancialPeriodComparator.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/utils/FinancialPeriodComparator.java 2014-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/utils/FinancialPeriodComparator.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -2,8 +2,8 @@
* #%L
* Lima :: business
*
- * $Id: FinancialPeriodComparator.java 3442 2012-06-05 14:51:55Z echatellier $
- * $HeadURL: http://svn.chorem.org/svn/lima/trunk/lima-business/src/main/java/org/chorem… $
+ * $Id$
+ * $HeadURL$
* %%
* Copyright (C) 2011 CodeLutin, Victor Salaun
* %%
Property changes on: trunk/lima-business/src/main/java/org/chorem/lima/business/utils/FinancialPeriodComparator.java
___________________________________________________________________
Added: svn:eol-style
+ native
Added: svn:keywords
+ Author Date Id Revision HeadURL
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/utils/FinancialTransactionComparator.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/utils/FinancialTransactionComparator.java 2014-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/utils/FinancialTransactionComparator.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -3,8 +3,8 @@
/*
* #%L
* Lima :: business
- * $Id: FinancialTransactionComparator.java 3695 2013-07-10 09:11:39Z athimel $
- * $HeadURL: http://svn.chorem.org/svn/lima/trunk/lima-business/src/main/java/org/chorem… $
+ * $Id$
+ * $HeadURL$
* %%
* Copyright (C) 2008 - 2013 CodeLutin
* %%
Property changes on: trunk/lima-business/src/main/java/org/chorem/lima/business/utils/FinancialTransactionComparator.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/utils/FiscalPeriodComparator.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/utils/FiscalPeriodComparator.java 2014-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/utils/FiscalPeriodComparator.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -2,8 +2,8 @@
* #%L
* Lima business
*
- * $Id: FiscalPeriodComparator.java 3290 2011-09-17 12:55:34Z tchemit $
- * $HeadURL: http://svn.chorem.org/svn/lima/trunk/lima-business/src/main/java/org/chorem… $
+ * $Id$
+ * $HeadURL$
* %%
* Copyright (C) 2008 - 2010 CodeLutin
* %%
Property changes on: trunk/lima-business/src/main/java/org/chorem/lima/business/utils/FiscalPeriodComparator.java
___________________________________________________________________
Added: svn:eol-style
+ native
Added: svn:keywords
+ Author Date Id Revision HeadURL
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/utils/LetteringComparator.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/utils/LetteringComparator.java 2014-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/utils/LetteringComparator.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -2,8 +2,8 @@
/*
* #%L
* Lima :: business
- * $Id: LetteringComparator.java 3740 2014-01-17 22:12:04Z dcosse $
- * $HeadURL: http://svn.chorem.org/svn/lima/trunk/lima-business/src/main/java/org/chorem… $
+ * $Id$
+ * $HeadURL$
* %%
* Copyright (C) 2012 CodeLutin
* %%
Property changes on: trunk/lima-business/src/main/java/org/chorem/lima/business/utils/LetteringComparator.java
___________________________________________________________________
Added: svn:eol-style
+ native
Added: svn:keywords
+ Author Date Id Revision HeadURL
Modified: trunk/lima-business/src/main/java/org/chorem/lima/service/LimaServiceFactory.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/service/LimaServiceFactory.java 2014-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business/src/main/java/org/chorem/lima/service/LimaServiceFactory.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -2,8 +2,8 @@
* #%L
* Lima business
*
- * $Id: LimaServiceFactory.java 3797 2014-05-14 11:51:21Z echatellier $
- * $HeadURL: http://svn.chorem.org/lima/trunk/lima-business/src/main/java/org/chorem/lim… $
+ * $Id$
+ * $HeadURL$
* %%
* Copyright (C) 2008 - 2012 CodeLutin, Chatellier Eric
* %%
Property changes on: trunk/lima-business/src/main/java/org/chorem/lima/service/LimaServiceFactory.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/lima-business/src/main/java/org/chorem/lima/service/ServiceMonitorableHandler.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/service/ServiceMonitorableHandler.java 2014-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business/src/main/java/org/chorem/lima/service/ServiceMonitorableHandler.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -2,8 +2,8 @@
* #%L
* Lima Swing
*
- * $Id: ServiceMonitorableHandler.java 3322 2012-01-17 09:35:25Z echatellier $
- * $HeadURL: http://svn.chorem.org/svn/lima/trunk/lima-business/src/main/java/org/chorem… $
+ * $Id$
+ * $HeadURL$
* %%
* Copyright (C) 2008 - 2012 CodeLutin, Chatellier Eric
* %%
@@ -43,10 +43,10 @@
* All other call are forwarded on notified to registered listeners.
*
* @author chatellier
- * @version $Revision: 3322 $
+ * @version $Revision$
*
- * Last update : $Date: 2012-01-17 10:35:25 +0100 (mar. 17 janv. 2012) $
- * By : $Author: echatellier $
+ * Last update : $Date$
+ * By : $Author$
*/
public class ServiceMonitorableHandler implements InvocationHandler {
Property changes on: trunk/lima-business/src/main/java/org/chorem/lima/service/ServiceMonitorableHandler.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/lima-business/src/main/java/org/chorem/lima/service/package-info.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/service/package-info.java 2014-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business/src/main/java/org/chorem/lima/service/package-info.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -2,8 +2,8 @@
* #%L
* Lima Business
*
- * $Id: package-info.java 3585 2012-08-08 14:52:14Z tchemit $
- * $HeadURL: http://svn.chorem.org/svn/lima/trunk/lima-business/src/main/java/org/chorem… $
+ * $Id$
+ * $HeadURL$
* %%
* Copyright (C) 2012 CodeLutin, Chatellier Eric
* %%
Property changes on: trunk/lima-business/src/main/java/org/chorem/lima/service/package-info.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
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-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business/src/test/java/org/chorem/lima/business/AbstractLimaTest.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -1,7 +1,7 @@
/*
* #%L
- * $Id: AbstractLimaTest.java 3408 2012-05-09 15:37:59Z echatellier $
- * $HeadURL: http://svn.chorem.org/svn/lima/trunk/lima-business/src/test/java/org/chorem… $
+ * $Id$
+ * $HeadURL$
* %%
* Copyright (C) 2011 - 2012 Codelutin, Chatellier Eric
* %%
@@ -72,10 +72,10 @@
* Common initialization code for all lima tests.
*
* @author chatellier
- * @version $Revision: 3408 $
+ * @version $Revision$
* <p/>
- * Last update : $Date: 2012-05-09 17:37:59 +0200 (mer. 09 mai 2012) $
- * By : $Author: echatellier $
+ * Last update : $Date$
+ * By : $Author$
*/
public abstract class AbstractLimaTest {
Property changes on: trunk/lima-business/src/test/java/org/chorem/lima/business/AbstractLimaTest.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
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-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business/src/test/java/org/chorem/lima/business/AccountServiceImplTest.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -2,8 +2,8 @@
* #%L
* Lima business
*
- * $Id: AccountServiceImplTest.java 3400 2012-05-04 09:43:18Z echatellier $
- * $HeadURL: http://svn.chorem.org/svn/lima/trunk/lima-business/src/test/java/org/chorem… $
+ * $Id$
+ * $HeadURL$
* %%
* Copyright (C) 2008 - 2012 CodeLutin, Chatellier Eric
* %%
Property changes on: trunk/lima-business/src/test/java/org/chorem/lima/business/AccountServiceImplTest.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
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-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business/src/test/java/org/chorem/lima/business/EntryBookServiceImplTest.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -2,8 +2,8 @@
* #%L
* Lima business
*
- * $Id: EntryBookServiceImplTest.java 3391 2012-04-25 08:28:20Z echatellier $
- * $HeadURL: http://svn.chorem.org/svn/lima/trunk/lima-business/src/test/java/org/chorem… $
+ * $Id$
+ * $HeadURL$
* %%
* Copyright (C) 2008 - 2012 CodeLutin, Chatellier Eric
* %%
Property changes on: trunk/lima-business/src/test/java/org/chorem/lima/business/EntryBookServiceImplTest.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/lima-business/src/test/java/org/chorem/lima/business/FinancialPeriodServiceImplTest.java
===================================================================
--- trunk/lima-business/src/test/java/org/chorem/lima/business/FinancialPeriodServiceImplTest.java 2014-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business/src/test/java/org/chorem/lima/business/FinancialPeriodServiceImplTest.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -2,8 +2,8 @@
* #%L
* Lima business
*
- * $Id: FinancialPeriodServiceImplTest.java 3614 2012-08-20 11:59:56Z echatellier $
- * $HeadURL: http://svn.chorem.org/svn/lima/trunk/lima-business/src/test/java/org/chorem… $
+ * $Id$
+ * $HeadURL$
* %%
* Copyright (C) 2008 - 2012 CodeLutin, Chatellier Eric
* %%
Property changes on: trunk/lima-business/src/test/java/org/chorem/lima/business/FinancialPeriodServiceImplTest.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
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-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business/src/test/java/org/chorem/lima/business/FinancialTransactionServiceImplTest.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -1,7 +1,7 @@
/*
* #%L
- * $Id: FinancialTransactionServiceImplTest.java 3710 2013-10-11 13:56:17Z Bavencoff $
- * $HeadURL: http://svn.chorem.org/svn/lima/trunk/lima-business/src/test/java/org/chorem… $
+ * $Id$
+ * $HeadURL$
* %%
* Copyright (C) 2012 Codelutin, Chatellier Eric
* %%
@@ -45,10 +45,10 @@
* Test on financial transaction service.
*
* @author chatellier
- * @version $Revision: 3710 $
+ * @version $Revision$
*
- * Last update : $Date: 2013-10-11 15:56:17 +0200 (ven. 11 oct. 2013) $
- * By : $Author: Bavencoff $
+ * Last update : $Date$
+ * By : $Author$
*/
public class FinancialTransactionServiceImplTest extends AbstractLimaTest {
Property changes on: trunk/lima-business/src/test/java/org/chorem/lima/business/FinancialTransactionServiceImplTest.java
___________________________________________________________________
Added: svn:eol-style
+ native
Added: svn:keywords
+ Author Date Id Revision HeadURL
Modified: trunk/lima-business/src/test/java/org/chorem/lima/business/FiscalPeriodServiceImplTest.java
===================================================================
--- trunk/lima-business/src/test/java/org/chorem/lima/business/FiscalPeriodServiceImplTest.java 2014-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business/src/test/java/org/chorem/lima/business/FiscalPeriodServiceImplTest.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -2,8 +2,8 @@
* #%L
* Lima business
*
- * $Id: FiscalPeriodServiceImplTest.java 3391 2012-04-25 08:28:20Z echatellier $
- * $HeadURL: http://svn.chorem.org/svn/lima/trunk/lima-business/src/test/java/org/chorem… $
+ * $Id$
+ * $HeadURL$
* %%
* Copyright (C) 2008 - 2012 CodeLutin, Chatellier Eric
* %%
Property changes on: trunk/lima-business/src/test/java/org/chorem/lima/business/FiscalPeriodServiceImplTest.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/lima-business/src/test/java/org/chorem/lima/business/ImportServiceImplTest.java
===================================================================
--- trunk/lima-business/src/test/java/org/chorem/lima/business/ImportServiceImplTest.java 2014-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business/src/test/java/org/chorem/lima/business/ImportServiceImplTest.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -1,7 +1,7 @@
/*
* #%L
- * $Id: ImportServiceImplTest.java 3585 2012-08-08 14:52:14Z tchemit $
- * $HeadURL: http://svn.chorem.org/svn/lima/trunk/lima-business/src/test/java/org/chorem… $
+ * $Id$
+ * $HeadURL$
* %%
* Copyright (C) 2012 Codelutin, Chatellier Eric
* %%
@@ -38,10 +38,10 @@
* Test du service d'import en faisant des import/export EBP et xml.
*
* @author chatellier
- * @version $Revision: 3585 $
+ * @version $Revision$
*
- * Last update : $Date: 2012-08-08 16:52:14 +0200 (mer. 08 août 2012) $
- * By : $Author: tchemit $
+ * Last update : $Date$
+ * By : $Author$
*/
public class ImportServiceImplTest extends AbstractLimaTest {
@@ -79,10 +79,10 @@
importService.importEntryBookFromEbp(entryBookData);
entryBookStream.close();
- entriesStream = ImportServiceImplTest.class.getResourceAsStream("/ebp/ecritures.txt");
- String entriesData = IOUtils.toString(entriesStream, "ISO-8859-1");
- importService.importEntriesFromEbp(entriesData);
- entriesStream.close();
+// entriesStream = ImportServiceImplTest.class.getResourceAsStream("/ebp/ecritures.txt");
+// String entriesData = IOUtils.toString(entriesStream, "ISO-8859-1");
+// importService.importEntriesFromEbp(entriesData);
+// entriesStream.close();
}
finally {
IOUtils.closeQuietly(accountStream);
Property changes on: trunk/lima-business/src/test/java/org/chorem/lima/business/ImportServiceImplTest.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/lima-business/src/test/java/org/chorem/lima/business/LetteringComparatorTest.java
===================================================================
--- trunk/lima-business/src/test/java/org/chorem/lima/business/LetteringComparatorTest.java 2014-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business/src/test/java/org/chorem/lima/business/LetteringComparatorTest.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -2,8 +2,8 @@
/*
* #%L
* Lima :: business
- * $Id: LetteringComparatorTest.java 3585 2012-08-08 14:52:14Z tchemit $
- * $HeadURL: http://svn.chorem.org/svn/lima/trunk/lima-business/src/test/java/org/chorem… $
+ * $Id$
+ * $HeadURL$
* %%
* Copyright (C) 2012 CodeLutin
* %%
Property changes on: trunk/lima-business/src/test/java/org/chorem/lima/business/LetteringComparatorTest.java
___________________________________________________________________
Added: svn:eol-style
+ native
Added: svn:keywords
+ Author Date Id Revision HeadURL
Modified: trunk/lima-business/src/test/java/org/chorem/lima/business/LimaMiscTest.java
===================================================================
--- trunk/lima-business/src/test/java/org/chorem/lima/business/LimaMiscTest.java 2014-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business/src/test/java/org/chorem/lima/business/LimaMiscTest.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -1,7 +1,7 @@
/*
* #%L
- * $Id: LimaMiscTest.java 3585 2012-08-08 14:52:14Z tchemit $
- * $HeadURL: http://svn.chorem.org/svn/lima/trunk/lima-business/src/test/java/org/chorem… $
+ * $Id$
+ * $HeadURL$
* %%
* Copyright (C) 2012 Codelutin, Chatellier Eric
* %%
@@ -31,10 +31,10 @@
* Lima misc tests.
*
* @author chatellier
- * @version $Revision: 3585 $
+ * @version $Revision$
*
- * Last update : $Date: 2012-08-08 16:52:14 +0200 (mer. 08 août 2012) $
- * By : $Author: tchemit $
+ * Last update : $Date$
+ * By : $Author$
*/
public class LimaMiscTest extends AbstractLimaTest {
Property changes on: trunk/lima-business/src/test/java/org/chorem/lima/business/LimaMiscTest.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Property changes on: trunk/lima-business/src/test/java/org/chorem/lima/business/LimaTestsConfig.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/lima-business/src/test/java/org/chorem/lima/business/NewImportExportServiceTest.java
===================================================================
--- trunk/lima-business/src/test/java/org/chorem/lima/business/NewImportExportServiceTest.java 2014-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business/src/test/java/org/chorem/lima/business/NewImportExportServiceTest.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -1,5 +1,27 @@
package org.chorem.lima.business;
+/*
+ * #%L
+ * Lima :: business
+ * %%
+ * 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 com.google.common.collect.Lists;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.io.IOUtils;
@@ -10,6 +32,7 @@
import org.chorem.lima.entity.FinancialStatement;
import org.chorem.lima.entity.FinancialTransaction;
import org.chorem.lima.entity.FiscalPeriod;
+import org.chorem.lima.entity.FiscalPeriodImpl;
import org.junit.Assert;
import org.junit.Test;
@@ -332,4 +355,18 @@
Assert.assertEquals(55, result.getNbCreated());
Assert.assertEquals(55, vatStatementService.getAllVatStatements().size());
}
+
+ @Test
+ public void testImportEntriesFromEBP() throws Exception {
+ // create fiscal period (mandatory for import)
+ FiscalPeriod fiscalPeriod = new FiscalPeriodImpl();
+ fiscalPeriod.setBeginDate(df.parse("January 1, 2012"));
+ fiscalPeriod.setEndDate(df.parse("December 31, 2012"));
+ fiscalPeriodService.createFiscalPeriod(fiscalPeriod);
+
+ InputStream entriesStream = NewImportExportServiceTest.class.getResourceAsStream("/ebp/ecritures.txt");
+ String entriesData = IOUtils.toString(entriesStream, "ISO-8859-1");
+ ImportResult result = newImportService.importEntriesFromEbp(entriesData);
+ entriesStream.close();
+ }
}
Property changes on: trunk/lima-business/src/test/java/org/chorem/lima/business/NewImportExportServiceTest.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/lima-business/src/test/java/org/chorem/lima/business/ReportServiceImplTest.java
===================================================================
--- trunk/lima-business/src/test/java/org/chorem/lima/business/ReportServiceImplTest.java 2014-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business/src/test/java/org/chorem/lima/business/ReportServiceImplTest.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -2,8 +2,8 @@
* #%L
* Lima business
*
- * $Id: ReportServiceImplTest.java 3585 2012-08-08 14:52:14Z tchemit $
- * $HeadURL: http://svn.chorem.org/svn/lima/trunk/lima-business/src/test/java/org/chorem… $
+ * $Id$
+ * $HeadURL$
* %%
* Copyright (C) 2012 CodeLutin, Chatellier Eric
* %%
@@ -38,9 +38,7 @@
import org.junit.Test;
import java.math.BigDecimal;
-import java.util.ArrayList;
import java.util.Date;
-import java.util.List;
/**
* Test le service de génération des reports.
Property changes on: trunk/lima-business/src/test/java/org/chorem/lima/business/ReportServiceImplTest.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/AccountServiceRuleFrTest.java
===================================================================
--- trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/AccountServiceRuleFrTest.java 2014-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/AccountServiceRuleFrTest.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -1,7 +1,7 @@
/*
* #%L
- * $Id: AccountServiceRuleFrTest.java 3747 2014-02-17 08:41:35Z dcosse $
- * $HeadURL: http://svn.chorem.org/svn/lima/trunk/lima-business/src/test/java/org/chorem… $
+ * $Id$
+ * $HeadURL$
* %%
* Copyright (C) 2012 Codelutin, Chatellier Eric
* %%
@@ -25,13 +25,8 @@
import org.chorem.lima.business.AccountServiceImplTest;
import org.chorem.lima.business.LimaConfig;
-import org.chorem.lima.business.LimaException;
-import org.chorem.lima.entity.Account;
-import org.chorem.lima.entity.AccountImpl;
import org.junit.Assert;
import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Ignore;
import org.junit.Test;
/**
@@ -42,10 +37,10 @@
* Plus ajout de test specific à la locale FR.
*
* @author chatellier
- * @version $Revision: 3747 $
+ * @version $Revision$
*
- * Last update : $Date: 2014-02-17 09:41:35 +0100 (lun. 17 févr. 2014) $
- * By : $Author: dcosse $
+ * Last update : $Date$
+ * By : $Author$
*/
public class AccountServiceRuleFrTest extends AccountServiceImplTest {
Property changes on: trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/AccountServiceRuleFrTest.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/EntryBookServiceRuleFrTest.java
===================================================================
--- trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/EntryBookServiceRuleFrTest.java 2014-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/EntryBookServiceRuleFrTest.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -1,7 +1,7 @@
/*
* #%L
- * $Id: EntryBookServiceRuleFrTest.java 3585 2012-08-08 14:52:14Z tchemit $
- * $HeadURL: http://svn.chorem.org/svn/lima/trunk/lima-business/src/test/java/org/chorem… $
+ * $Id$
+ * $HeadURL$
* %%
* Copyright (C) 2012 Codelutin, Chatellier Eric
* %%
@@ -27,7 +27,6 @@
import org.chorem.lima.business.LimaConfig;
import org.junit.Assert;
import org.junit.Before;
-import org.junit.BeforeClass;
import org.junit.Test;
/**
@@ -38,10 +37,10 @@
* Plus ajout de test specific à la locale FR.
*
* @author chatellier
- * @version $Revision: 3585 $
+ * @version $Revision$
*
- * Last update : $Date: 2012-08-08 16:52:14 +0200 (mer. 08 août 2012) $
- * By : $Author: tchemit $
+ * Last update : $Date$
+ * By : $Author$
*/
public class EntryBookServiceRuleFrTest extends EntryBookServiceImplTest {
Property changes on: trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/EntryBookServiceRuleFrTest.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/FinancialPeriodServiceRuleFrTest.java
===================================================================
--- trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/FinancialPeriodServiceRuleFrTest.java 2014-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/FinancialPeriodServiceRuleFrTest.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -1,7 +1,7 @@
/*
* #%L
- * $Id: FinancialPeriodServiceRuleFrTest.java 3585 2012-08-08 14:52:14Z tchemit $
- * $HeadURL: http://svn.chorem.org/svn/lima/trunk/lima-business/src/test/java/org/chorem… $
+ * $Id$
+ * $HeadURL$
* %%
* Copyright (C) 2012 Codelutin, Chatellier Eric
* %%
@@ -27,7 +27,6 @@
import org.chorem.lima.business.LimaConfig;
import org.junit.Assert;
import org.junit.Before;
-import org.junit.BeforeClass;
import org.junit.Test;
/**
@@ -38,10 +37,10 @@
* Plus ajout de test specific à la locale FR.
*
* @author chatellier
- * @version $Revision: 3585 $
+ * @version $Revision$
*
- * Last update : $Date: 2012-08-08 16:52:14 +0200 (mer. 08 août 2012) $
- * By : $Author: tchemit $
+ * Last update : $Date$
+ * By : $Author$
*/
public class FinancialPeriodServiceRuleFrTest extends EntryBookServiceImplTest {
Property changes on: trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/FinancialPeriodServiceRuleFrTest.java
___________________________________________________________________
Added: svn:eol-style
+ native
Added: svn:keywords
+ Author Date Id Revision HeadURL
Modified: trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/FinancialTransactionServiceRuleFrTest.java
===================================================================
--- trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/FinancialTransactionServiceRuleFrTest.java 2014-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/FinancialTransactionServiceRuleFrTest.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -1,7 +1,7 @@
/*
* #%L
- * $Id: FinancialTransactionServiceRuleFrTest.java 3585 2012-08-08 14:52:14Z tchemit $
- * $HeadURL: http://svn.chorem.org/svn/lima/trunk/lima-business/src/test/java/org/chorem… $
+ * $Id$
+ * $HeadURL$
* %%
* Copyright (C) 2012 Codelutin, Chatellier Eric
* %%
@@ -27,7 +27,6 @@
import org.chorem.lima.business.LimaConfig;
import org.junit.Assert;
import org.junit.Before;
-import org.junit.BeforeClass;
import org.junit.Test;
/**
@@ -38,10 +37,10 @@
* Plus ajout de test specific à la locale FR.
*
* @author chatellier
- * @version $Revision: 3585 $
+ * @version $Revision$
*
- * Last update : $Date: 2012-08-08 16:52:14 +0200 (mer. 08 août 2012) $
- * By : $Author: tchemit $
+ * Last update : $Date$
+ * By : $Author$
*/
public class FinancialTransactionServiceRuleFrTest extends FinancialTransactionServiceImplTest {
Property changes on: trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/FinancialTransactionServiceRuleFrTest.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/FiscalPeriodServiceRuleFrTest.java
===================================================================
--- trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/FiscalPeriodServiceRuleFrTest.java 2014-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/FiscalPeriodServiceRuleFrTest.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -1,7 +1,7 @@
/*
* #%L
- * $Id: FiscalPeriodServiceRuleFrTest.java 3585 2012-08-08 14:52:14Z tchemit $
- * $HeadURL: http://svn.chorem.org/svn/lima/trunk/lima-business/src/test/java/org/chorem… $
+ * $Id$
+ * $HeadURL$
* %%
* Copyright (C) 2012 Codelutin, Chatellier Eric
* %%
@@ -27,7 +27,6 @@
import org.chorem.lima.business.LimaConfig;
import org.junit.Assert;
import org.junit.Before;
-import org.junit.BeforeClass;
import org.junit.Test;
/**
@@ -38,10 +37,10 @@
* Plus ajout de test specific à la locale FR.
*
* @author chatellier
- * @version $Revision: 3585 $
+ * @version $Revision$
*
- * Last update : $Date: 2012-08-08 16:52:14 +0200 (mer. 08 août 2012) $
- * By : $Author: tchemit $
+ * Last update : $Date$
+ * By : $Author$
*/
public class FiscalPeriodServiceRuleFrTest extends FiscalPeriodServiceImplTest {
Property changes on: trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/FiscalPeriodServiceRuleFrTest.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/ImportServiceRuleFrTest.java
===================================================================
--- trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/ImportServiceRuleFrTest.java 2014-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/ImportServiceRuleFrTest.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -1,7 +1,7 @@
/*
* #%L
- * $Id: ImportServiceRuleFrTest.java 3585 2012-08-08 14:52:14Z tchemit $
- * $HeadURL: http://svn.chorem.org/svn/lima/trunk/lima-business/src/test/java/org/chorem… $
+ * $Id$
+ * $HeadURL$
* %%
* Copyright (C) 2012 Codelutin, Chatellier Eric
* %%
@@ -39,10 +39,10 @@
* Plus ajout de test specific à la locale FR.
*
* @author chatellier
- * @version $Revision: 3585 $
+ * @version $Revision$
*
- * Last update : $Date: 2012-08-08 16:52:14 +0200 (mer. 08 août 2012) $
- * By : $Author: tchemit $
+ * Last update : $Date$
+ * By : $Author$
*/
public class ImportServiceRuleFrTest extends ImportServiceImplTest {
Property changes on: trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/ImportServiceRuleFrTest.java
___________________________________________________________________
Added: svn:eol-style
+ native
Added: svn:keywords
+ Author Date Id Revision HeadURL
Modified: trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/ReportServiceRuleFrTest.java
===================================================================
--- trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/ReportServiceRuleFrTest.java 2014-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/ReportServiceRuleFrTest.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -1,7 +1,7 @@
/*
* #%L
- * $Id: ReportServiceRuleFrTest.java 3585 2012-08-08 14:52:14Z tchemit $
- * $HeadURL: http://svn.chorem.org/svn/lima/trunk/lima-business/src/test/java/org/chorem… $
+ * $Id$
+ * $HeadURL$
* %%
* Copyright (C) 2012 Codelutin, Chatellier Eric
* %%
@@ -38,10 +38,10 @@
* Plus ajout de test specific à la locale FR.
*
* @author chatellier
- * @version $Revision: 3585 $
+ * @version $Revision$
*
- * Last update : $Date: 2012-08-08 16:52:14 +0200 (mer. 08 août 2012) $
- * By : $Author: tchemit $
+ * Last update : $Date$
+ * By : $Author$
*
* FIXME echatellier 20120424 fix parent test first
*/
Property changes on: trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/ReportServiceRuleFrTest.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
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-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/TestAccountingRules.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -1,7 +1,7 @@
/*
* #%L
- * $Id: TestAccountingRules.java 3777 2014-04-14 07:29:08Z sbavencoff $
- * $HeadURL: http://svn.chorem.org/lima/trunk/lima-business/src/test/java/org/chorem/lim… $
+ * $Id$
+ * $HeadURL$
* %%
* Copyright (C) 2012 Codelutin, Chatellier Eric
* %%
@@ -49,10 +49,10 @@
* et FranceAccountingRules une autre fois.
*
* @author chatellier
- * @version $Revision: 3777 $
+ * @version $Revision$
*
- * Last update : $Date: 2014-04-14 09:29:08 +0200 (lun. 14 avril 2014) $
- * By : $Author: sbavencoff $
+ * Last update : $Date$
+ * By : $Author$
*/
@Ignore
public class TestAccountingRules extends DefaultAccountingRules {
Property changes on: trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/TestAccountingRules.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
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-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business/src/test/java/org/chorem/lima/entity/FinancialTransactionDAOTest.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -1,7 +1,7 @@
/*
* #%L
- * $Id: FinancialTransactionDAOTest.java 3585 2012-08-08 14:52:14Z tchemit $
- * $HeadURL: http://svn.chorem.org/svn/lima/trunk/lima-business/src/test/java/org/chorem… $
+ * $Id$
+ * $HeadURL$
* %%
* Copyright (C) 2012 Codelutin, Chatellier Eric
* %%
@@ -34,10 +34,10 @@
* Test for {@link FinancialTransactionTopiaDao}.
*
* @author chatellier
- * @version $Revision: 3585 $
+ * @version $Revision$
*
- * Last update : $Date: 2012-08-08 16:52:14 +0200 (mer. 08 août 2012) $
- * By : $Author: tchemit $
+ * Last update : $Date$
+ * By : $Author$
*/
public class FinancialTransactionDAOTest extends AbstractLimaTest {
Property changes on: trunk/lima-business/src/test/java/org/chorem/lima/entity/FinancialTransactionDAOTest.java
___________________________________________________________________
Added: svn:eol-style
+ native
Added: svn:keywords
+ Author Date Id Revision HeadURL
Property changes on: trunk/lima-business/src/test/resources/import/bcr_developed.csv
___________________________________________________________________
Added: svn:eol-style
+ native
Added: svn:keywords
+ Author Date Id Revision HeadURL
Property changes on: trunk/lima-business/src/test/resources/import/vat_shortened.csv
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Property changes on: trunk/lima-business-api/src/main/java/org/chorem/lima/LimaTechnicalException.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Property changes on: trunk/lima-business-api/src/main/java/org/chorem/lima/business/AccountException.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: 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-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/AfterLastFiscalPeriodException.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -1,5 +1,27 @@
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;
/**
Property changes on: trunk/lima-business-api/src/main/java/org/chorem/lima/business/AfterLastFiscalPeriodException.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Property changes on: trunk/lima-business-api/src/main/java/org/chorem/lima/business/AlreadyExistAccountException.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: 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-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/AlreadyExistFinancialStatement.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -1,5 +1,27 @@
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.
*/
Property changes on: trunk/lima-business-api/src/main/java/org/chorem/lima/business/AlreadyExistFinancialStatement.java
___________________________________________________________________
Added: svn:eol-style
+ native
Added: svn:keywords
+ Author Date Id Revision HeadURL
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-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/AlreadyExistVatStatement.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -1,5 +1,27 @@
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.
*/
Property changes on: trunk/lima-business-api/src/main/java/org/chorem/lima/business/AlreadyExistVatStatement.java
___________________________________________________________________
Added: svn:eol-style
+ native
Added: svn:keywords
+ Author Date Id Revision HeadURL
Modified: 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-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/AlreadyLockedFiscalPeriodException.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -1,5 +1,27 @@
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;
/**
Property changes on: trunk/lima-business-api/src/main/java/org/chorem/lima/business/AlreadyLockedFiscalPeriodException.java
___________________________________________________________________
Added: svn:eol-style
+ native
Added: svn:keywords
+ Author Date Id Revision HeadURL
Modified: 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-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/BeforeFirstFiscalPeriodException.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -1,5 +1,27 @@
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;
/**
Property changes on: trunk/lima-business-api/src/main/java/org/chorem/lima/business/BeforeFirstFiscalPeriodException.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: 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-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/BeginAfterEndFiscalPeriodException.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -1,5 +1,27 @@
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;
/**
Property changes on: trunk/lima-business-api/src/main/java/org/chorem/lima/business/BeginAfterEndFiscalPeriodException.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Property changes on: trunk/lima-business-api/src/main/java/org/chorem/lima/business/ClosedPeriodicEntryBookException.java
___________________________________________________________________
Added: svn:eol-style
+ native
Added: svn:keywords
+ Author Date Id Revision HeadURL
Modified: 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-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/ClosedPeriodicEntryBooksException.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -1,5 +1,27 @@
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;
Property changes on: trunk/lima-business-api/src/main/java/org/chorem/lima/business/ClosedPeriodicEntryBooksException.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: 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-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/DateException.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -1,5 +1,27 @@
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;
/**
Property changes on: trunk/lima-business-api/src/main/java/org/chorem/lima/business/DateException.java
___________________________________________________________________
Added: svn:eol-style
+ native
Added: svn:keywords
+ Author Date Id Revision HeadURL
Modified: 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-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/EntriesException.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -1,5 +1,27 @@
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;
Property changes on: trunk/lima-business-api/src/main/java/org/chorem/lima/business/EntriesException.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Property changes on: trunk/lima-business-api/src/main/java/org/chorem/lima/business/EntryBookException.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
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-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/FinancialPeriodException.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -1,5 +1,27 @@
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;
/**
Property changes on: trunk/lima-business-api/src/main/java/org/chorem/lima/business/FinancialPeriodException.java
___________________________________________________________________
Added: svn:eol-style
+ native
Added: svn:keywords
+ Author Date Id Revision HeadURL
Modified: 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-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/FinancialTransactionsException.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -1,5 +1,27 @@
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;
Property changes on: trunk/lima-business-api/src/main/java/org/chorem/lima/business/FinancialTransactionsException.java
___________________________________________________________________
Added: svn:eol-style
+ native
Added: svn:keywords
+ Author Date Id Revision HeadURL
Property changes on: trunk/lima-business-api/src/main/java/org/chorem/lima/business/FiscalPeriodException.java
___________________________________________________________________
Added: svn:eol-style
+ native
Added: svn:keywords
+ Author Date Id Revision HeadURL
Modified: 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-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/ImportEbpException.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -25,7 +25,7 @@
/**
* @author Sylvain Bavencoff <bavencoff(a)codelutin.com>
*/
-public class ImportEbpException extends Exception {
+public class ImportEbpException extends LimaException {
public ImportEbpException(String message) {
super(message);
Property changes on: trunk/lima-business-api/src/main/java/org/chorem/lima/business/ImportEbpException.java
___________________________________________________________________
Added: svn:eol-style
+ native
Added: svn:keywords
+ Author Date Id Revision HeadURL
Modified: 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-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/ImportException.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -1,5 +1,27 @@
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;
/**
Property changes on: trunk/lima-business-api/src/main/java/org/chorem/lima/business/ImportException.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
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-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/ImportResult.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -1,5 +1,27 @@
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.io.Serializable;
/**
Property changes on: trunk/lima-business-api/src/main/java/org/chorem/lima/business/ImportResult.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Property changes on: trunk/lima-business-api/src/main/java/org/chorem/lima/business/InvalidAccountNumberException.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: 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-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/LastUnlockedFiscalPeriodException.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -1,5 +1,27 @@
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;
/**
Property changes on: trunk/lima-business-api/src/main/java/org/chorem/lima/business/LastUnlockedFiscalPeriodException.java
___________________________________________________________________
Added: svn:eol-style
+ native
Added: svn:keywords
+ Author Date Id Revision HeadURL
Modified: 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-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/LimaException.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -53,6 +53,23 @@
}
/**
+ * 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
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-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/LockedEntryBookException.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -1,5 +1,27 @@
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;
/**
Property changes on: trunk/lima-business-api/src/main/java/org/chorem/lima/business/LockedEntryBookException.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
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-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/LockedFinancialPeriodException.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -1,5 +1,27 @@
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;
/**
Property changes on: trunk/lima-business-api/src/main/java/org/chorem/lima/business/LockedFinancialPeriodException.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
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-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/MoreOneUnlockFiscalPeriodException.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -1,5 +1,27 @@
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>
*/
Property changes on: trunk/lima-business-api/src/main/java/org/chorem/lima/business/MoreOneUnlockFiscalPeriodException.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: 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-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/NoEmptyFiscalPeriodException.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -1,5 +1,27 @@
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;
Property changes on: trunk/lima-business-api/src/main/java/org/chorem/lima/business/NoEmptyFiscalPeriodException.java
___________________________________________________________________
Added: svn:eol-style
+ native
Added: svn:keywords
+ Author Date Id Revision HeadURL
Modified: 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-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/NoFoundFinancialPeriodException.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -1,5 +1,27 @@
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;
/**
Property changes on: trunk/lima-business-api/src/main/java/org/chorem/lima/business/NoFoundFinancialPeriodException.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
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-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/NotAllowedLabel.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -1,5 +1,27 @@
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 31/07/14.
*/
Property changes on: trunk/lima-business-api/src/main/java/org/chorem/lima/business/NotAllowedLabel.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: 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-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/NotBeginNextDayOfLastFiscalPeriodException.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -1,5 +1,27 @@
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;
/**
Property changes on: trunk/lima-business-api/src/main/java/org/chorem/lima/business/NotBeginNextDayOfLastFiscalPeriodException.java
___________________________________________________________________
Added: svn:eol-style
+ native
Added: svn:keywords
+ Author Date Id Revision HeadURL
Modified: 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-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/NotLockedClosedPeriodicEntryBooksException.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -1,5 +1,27 @@
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;
Property changes on: trunk/lima-business-api/src/main/java/org/chorem/lima/business/NotLockedClosedPeriodicEntryBooksException.java
___________________________________________________________________
Added: svn:eol-style
+ native
Added: svn:keywords
+ Author Date Id Revision HeadURL
Modified: 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-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/UnbalancedEntriesException.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -1,5 +1,27 @@
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;
Property changes on: trunk/lima-business-api/src/main/java/org/chorem/lima/business/UnbalancedEntriesException.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: 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-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/UnbalancedFinancialTransactionsException.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -1,5 +1,27 @@
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;
Property changes on: trunk/lima-business-api/src/main/java/org/chorem/lima/business/UnbalancedFinancialTransactionsException.java
___________________________________________________________________
Added: svn:eol-style
+ native
Added: svn:keywords
+ Author Date Id Revision HeadURL
Modified: 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-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/UnfilledEntriesException.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -1,5 +1,27 @@
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;
Property changes on: trunk/lima-business-api/src/main/java/org/chorem/lima/business/UnfilledEntriesException.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Property changes on: trunk/lima-business-api/src/main/java/org/chorem/lima/business/UsedAccountException.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Property changes on: trunk/lima-business-api/src/main/java/org/chorem/lima/business/UsedEntryBookException.java
___________________________________________________________________
Added: svn:eol-style
+ native
Added: svn:keywords
+ Author Date Id Revision HeadURL
Modified: 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-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/WithoutEntryBookFinancialTransactionsException.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -1,5 +1,27 @@
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;
Property changes on: trunk/lima-business-api/src/main/java/org/chorem/lima/business/WithoutEntryBookFinancialTransactionsException.java
___________________________________________________________________
Added: svn:eol-style
+ native
Added: svn:keywords
+ Author Date Id Revision HeadURL
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-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/ImportService.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -54,15 +54,6 @@
String importEntryBookFromEbp(String datas) throws ImportEbpException;
/**
- * Import entries as EBP import.
- *
- * @param data import file content as string (remote service can't take File)
- * @return result log
- * @throws LimaException
- */
- String importEntriesFromEbp(String data) throws ImportEbpException;
-
- /**
* Import content as CSV depending on import type.
*
* @param data import file content as string (remote service can't take File)
Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/NewImportService.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/NewImportService.java 2014-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/NewImportService.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -23,6 +23,7 @@
*/
import org.chorem.lima.business.AlreadyExistAccountException;
+import org.chorem.lima.business.ImportEbpException;
import org.chorem.lima.business.ImportResult;
import org.chorem.lima.business.InvalidAccountNumberException;
@@ -46,4 +47,6 @@
ImportResult importVATStatementsAsCSV(String contents);
List<ImportResult> importBackup(String entryBooks, String transactions, String fiscalPeriods, String accounts, String entries) throws AlreadyExistAccountException, InvalidAccountNumberException;
+
+ ImportResult importEntriesFromEbp(String datas) throws ImportEbpException;
}
Property changes on: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/NewImportService.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Property changes on: trunk/lima-callao/src/main/java/org/chorem/lima/DefaultServiceContext.java
___________________________________________________________________
Added: svn:eol-style
+ native
Added: svn:keywords
+ Author Date Id Revision HeadURL
Property changes on: trunk/lima-callao/src/main/java/org/chorem/lima/ServiceContext.java
___________________________________________________________________
Added: svn:eol-style
+ native
Added: svn:keywords
+ Author Date Id Revision HeadURL
Modified: trunk/lima-callao/src/main/java/org/chorem/lima/entity/AccountTopiaDao.java
===================================================================
--- trunk/lima-callao/src/main/java/org/chorem/lima/entity/AccountTopiaDao.java 2014-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-callao/src/main/java/org/chorem/lima/entity/AccountTopiaDao.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -2,8 +2,8 @@
* #%L
* Lima callao
*
- * $Id: AccountDAOImpl.java 3613 2012-08-20 11:38:22Z mallon $
- * $HeadURL: http://svn.chorem.org/svn/lima/trunk/lima-callao/src/main/java/org/chorem/l… $
+ * $Id$
+ * $HeadURL$
* %%
* Copyright (C) 2008 - 2012 CodeLutin, Chatellier Eric
* %%
Property changes on: trunk/lima-callao/src/main/java/org/chorem/lima/entity/AccountTopiaDao.java
___________________________________________________________________
Added: svn:eol-style
+ native
Added: svn:keywords
+ Author Date Id Revision HeadURL
Modified: trunk/lima-callao/src/main/java/org/chorem/lima/entity/ClosedPeriodicEntryBookTopiaDao.java
===================================================================
--- trunk/lima-callao/src/main/java/org/chorem/lima/entity/ClosedPeriodicEntryBookTopiaDao.java 2014-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-callao/src/main/java/org/chorem/lima/entity/ClosedPeriodicEntryBookTopiaDao.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -2,8 +2,8 @@
* #%L
* Lima callao
*
- * $Id: ClosedPeriodicEntryBookDAOImpl.java 3476 2012-06-26 15:48:13Z echatellier $
- * $HeadURL: http://svn.chorem.org/lima/trunk/lima-callao/src/main/java/org/chorem/lima/… $
+ * $Id$
+ * $HeadURL$
* %%
* Copyright (C) 2008 - 2012 CodeLutin, Chatellier Eric
* %%
Property changes on: trunk/lima-callao/src/main/java/org/chorem/lima/entity/ClosedPeriodicEntryBookTopiaDao.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/lima-callao/src/main/java/org/chorem/lima/entity/EntryTopiaDao.java
===================================================================
--- trunk/lima-callao/src/main/java/org/chorem/lima/entity/EntryTopiaDao.java 2014-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-callao/src/main/java/org/chorem/lima/entity/EntryTopiaDao.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -2,8 +2,8 @@
* #%L
* Lima callao
* *
- * $Id: EntryDAOImpl.java 3783 2014-05-06 16:47:18Z dcosse $
- * $HeadURL: http://svn.chorem.org/lima/trunk/lima-callao/src/main/java/org/chorem/lima/… $
+ * $Id$
+ * $HeadURL$
* %%
* Copyright (C) 2008 - 2012 CodeLutin, Chatellier Eric
* %%
Property changes on: trunk/lima-callao/src/main/java/org/chorem/lima/entity/EntryTopiaDao.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/lima-callao/src/main/java/org/chorem/lima/entity/FinancialPeriodTopiaDao.java
===================================================================
--- trunk/lima-callao/src/main/java/org/chorem/lima/entity/FinancialPeriodTopiaDao.java 2014-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-callao/src/main/java/org/chorem/lima/entity/FinancialPeriodTopiaDao.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -2,8 +2,8 @@
* #%L
* Lima callao
*
- * $Id: FinancialPeriodDAOImpl.java 3476 2012-06-26 15:48:13Z echatellier $
- * $HeadURL: http://svn.chorem.org/svn/lima/trunk/lima-callao/src/main/java/org/chorem/l… $
+ * $Id$
+ * $HeadURL$
* %%
* Copyright (C) 2008 - 2012 CodeLutin, Chatellier Eric
* %%
Property changes on: trunk/lima-callao/src/main/java/org/chorem/lima/entity/FinancialPeriodTopiaDao.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/lima-callao/src/main/java/org/chorem/lima/entity/FinancialStatementTopiaDao.java
===================================================================
--- trunk/lima-callao/src/main/java/org/chorem/lima/entity/FinancialStatementTopiaDao.java 2014-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-callao/src/main/java/org/chorem/lima/entity/FinancialStatementTopiaDao.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -2,8 +2,8 @@
* #%L
* Lima callao
*
- * $Id: FinancialStatementDAOImpl.java 3585 2012-08-08 14:52:14Z tchemit $
- * $HeadURL: http://svn.chorem.org/svn/lima/trunk/lima-callao/src/main/java/org/chorem/l… $
+ * $Id$
+ * $HeadURL$
* %%
* Copyright (C) 2012 CodeLutin, Chatellier Eric
* %%
@@ -32,10 +32,10 @@
* Ajout de requetes specifiques aux {@link FinancialStatement} sur le DAO.
*
* @author chatellier
- * @version $Revision: 3585 $
+ * @version $Revision$
*
- * Last update : $Date: 2012-08-08 16:52:14 +0200 (mer. 08 août 2012) $
- * By : $Author: tchemit $
+ * Last update : $Date$
+ * By : $Author$
*/
public class FinancialStatementTopiaDao extends AbstractFinancialStatementTopiaDao<FinancialStatement> {
Property changes on: trunk/lima-callao/src/main/java/org/chorem/lima/entity/FinancialStatementTopiaDao.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/lima-callao/src/main/java/org/chorem/lima/entity/FinancialTransactionTopiaDao.java
===================================================================
--- trunk/lima-callao/src/main/java/org/chorem/lima/entity/FinancialTransactionTopiaDao.java 2014-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-callao/src/main/java/org/chorem/lima/entity/FinancialTransactionTopiaDao.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -2,8 +2,8 @@
* #%L
* Lima callao
*
- * $Id: FinancialTransactionDAOImpl.java 3688 2013-06-27 13:12:22Z Bavencoff $
- * $HeadURL: http://svn.chorem.org/svn/lima/trunk/lima-callao/src/main/java/org/chorem/l… $
+ * $Id$
+ * $HeadURL$
* %%
* Copyright (C) 2012 CodeLutin, Chatellier Eric
* %%
@@ -40,10 +40,10 @@
* Ajout de requetes specifiques aux financial transaction sur le DAO.
*
* @author chatellier
- * @version $Revision: 3688 $
+ * @version $Revision$
*
- * Last update : $Date: 2013-06-27 15:12:22 +0200 (jeu. 27 juin 2013) $
- * By : $Author: Bavencoff $
+ * Last update : $Date$
+ * By : $Author$
*/
public class FinancialTransactionTopiaDao extends AbstractFinancialTransactionTopiaDao<FinancialTransaction> {
Property changes on: trunk/lima-callao/src/main/java/org/chorem/lima/entity/FinancialTransactionTopiaDao.java
___________________________________________________________________
Added: svn:eol-style
+ native
Added: svn:keywords
+ Author Date Id Revision HeadURL
Modified: trunk/lima-callao/src/main/java/org/chorem/lima/entity/FiscalPeriodTopiaDao.java
===================================================================
--- trunk/lima-callao/src/main/java/org/chorem/lima/entity/FiscalPeriodTopiaDao.java 2014-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-callao/src/main/java/org/chorem/lima/entity/FiscalPeriodTopiaDao.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -2,8 +2,8 @@
* #%L
* Lima callao
*
- * $Id: FiscalPeriodDAOImpl.java 3598 2012-08-10 16:31:26Z mallon $
- * $HeadURL: http://svn.chorem.org/svn/lima/trunk/lima-callao/src/main/java/org/chorem/l… $
+ * $Id$
+ * $HeadURL$
* %%
* Copyright (C) 2012 CodeLutin, Chatellier Eric
* %%
@@ -29,10 +29,10 @@
* Fiscal period entity DAO.
*
* @author chatellier
- * @version $Revision: 3598 $
+ * @version $Revision$
*
- * Last update : $Date: 2012-08-10 18:31:26 +0200 (ven. 10 août 2012) $
- * By : $Author: mallon $
+ * Last update : $Date$
+ * By : $Author$
*/
public class FiscalPeriodTopiaDao extends AbstractFiscalPeriodTopiaDao<FiscalPeriod> {
Property changes on: trunk/lima-callao/src/main/java/org/chorem/lima/entity/FiscalPeriodTopiaDao.java
___________________________________________________________________
Added: svn:eol-style
+ native
Added: svn:keywords
+ Author Date Id Revision HeadURL
Property changes on: trunk/lima-callao/src/main/java/org/chorem/lima/entity/LimaCallaoTopiaPersistenceContext.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/lima-callao/src/main/java/org/chorem/lima/entity/VatStatementTopiaDao.java
===================================================================
--- trunk/lima-callao/src/main/java/org/chorem/lima/entity/VatStatementTopiaDao.java 2014-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-callao/src/main/java/org/chorem/lima/entity/VatStatementTopiaDao.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -2,8 +2,8 @@
* #%L
* Lima callao
*
- * $Id: VatStatementDAOImpl.java 3585 2012-08-08 14:52:14Z tchemit $
- * $HeadURL: http://svn.chorem.org/svn/lima/trunk/lima-callao/src/main/java/org/chorem/l… $
+ * $Id$
+ * $HeadURL$
* %%
* Copyright (C) 2012 CodeLutin, Chatellier Eric
* %%
@@ -34,10 +34,10 @@
* Ajout de requetes specifiques aux {@code VatStatement} sur le DAO.
*
* @author chatellier
- * @version $Revision: 3585 $
+ * @version $Revision$
*
- * Last update : $Date: 2012-08-08 16:52:14 +0200 (mer. 08 août 2012) $
- * By : $Author: tchemit $
+ * Last update : $Date$
+ * By : $Author$
*/
public class VatStatementTopiaDao extends AbstractVatStatementTopiaDao<VatStatement> {
Property changes on: trunk/lima-callao/src/main/java/org/chorem/lima/entity/VatStatementTopiaDao.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/lima-callao/src/main/xmi/accounting-model.zargo
===================================================================
(Binary files differ)
Property changes on: trunk/lima-swing/src/main/assembly/lima.bat
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/ClosableTabHeader.css
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/ClosableTabHeader.css 2014-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/ClosableTabHeader.css 2014-07-31 15:10:21 UTC (rev 3883)
@@ -1,3 +1,24 @@
+/*
+ * #%L
+ * Lima :: Swing
+ * %%
+ * 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%
+ */
#tab {
opaque : false;
}
Property changes on: trunk/lima-swing/src/main/java/org/chorem/lima/ui/ClosableTabHeader.css
___________________________________________________________________
Added: svn:eol-style
+ native
Added: svn:keywords
+ Author Date Id Revision HeadURL
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-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainView.css 2014-07-31 15:10:21 UTC (rev 3883)
@@ -1,3 +1,24 @@
+/*
+ * #%L
+ * Lima :: Swing
+ * %%
+ * 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%
+ */
#mainView {
title : "lima.ui.mainview.title";
Property changes on: trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainView.css
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/celleditor/AutoCompleteTableCellEditor.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/celleditor/AutoCompleteTableCellEditor.java 2014-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/celleditor/AutoCompleteTableCellEditor.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -1,5 +1,27 @@
package org.chorem.lima.ui.celleditor;
+/*
+ * #%L
+ * Lima :: Swing
+ * %%
+ * 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 com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import org.jdesktop.swingx.autocomplete.AutoCompleteDecorator;
Property changes on: trunk/lima-swing/src/main/java/org/chorem/lima/ui/celleditor/AutoCompleteTableCellEditor.java
___________________________________________________________________
Added: svn:eol-style
+ native
Added: svn:keywords
+ Author Date Id Revision HeadURL
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/HomeView.css
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/HomeView.css 2014-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/HomeView.css 2014-07-31 15:10:21 UTC (rev 3883)
@@ -1,3 +1,24 @@
+/*
+ * #%L
+ * Lima :: Swing
+ * %%
+ * 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%
+ */
.infoPanel {
Property changes on: trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/HomeView.css
___________________________________________________________________
Added: svn:eol-style
+ native
Added: svn:keywords
+ Author Date Id Revision HeadURL
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-07-31 15:04:52 UTC (rev 3882)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java 2014-07-31 15:10:21 UTC (rev 3883)
@@ -230,11 +230,13 @@
//For windows ebp
datas = extractFile(filePath, EncodingEnum.ISOLATIN1.getEncoding());
result = importService.importAccountsChartFromEbp(datas);
+ // TODO DCossé 24/07/14 change result
+ result = "SUCCESS";
break;
case EBP_ENTRIES_IMPORT:
//For windows ebp
datas = extractFile(filePath, EncodingEnum.ISOLATIN1.getEncoding());
- result = importService.importEntriesFromEbp(datas);
+ importResult = newImportService.importEntriesFromEbp(datas);
break;
case EBP_ENTRYBOOKS_IMPORT:
datas = extractFile(filePath, EncodingEnum.ISOLATIN1.getEncoding());
1
0
r3882 - in trunk/lima-swing/src/main: java/org/chorem/lima/ui/account java/org/chorem/lima/ui/financialstatementchart java/org/chorem/lima/ui/fiscalperiod java/org/chorem/lima/ui/identity java/org/chorem/lima/ui/opening java/org/chorem/lima/ui/vatchart java/org/chorem/lima/util resources/i18n
by sbavencoff@users.chorem.org 31 Jul '14
by sbavencoff@users.chorem.org 31 Jul '14
31 Jul '14
Author: sbavencoff
Date: 2014-07-31 17:04:52 +0200 (Thu, 31 Jul 2014)
New Revision: 3882
Url: http://forge.chorem.org/projects/lima/repository/revisions/3882
Log:
refs #875 #1043 : identity
Added:
trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/CreateIdentityPanel.css
trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/CreateIdentityPanelHandler.java
Modified:
trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountForm.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementHeaderForm.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementImportForm.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementMovementForm.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/AddPeriod.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/RetainedEarningsEntryBookForm.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/identity/IdentityForm.css
trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/CreateIdentityPanel.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/VatChartImportForm.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatchart/VatChartMovementForm.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/util/ReportDialogView.jaxx
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-swing/src/main/java/org/chorem/lima/ui/account/AccountForm.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountForm.jaxx 2014-07-31 13:05:12 UTC (rev 3881)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountForm.jaxx 2014-07-31 15:04:52 UTC (rev 3882)
@@ -69,8 +69,8 @@
<row>
<cell columns="2">
<JPanel layout='{new GridLayout(1,0)}'>
- <JButton text="lima.common.cancel" onActionPerformed="dispose()"/>
- <JButton id="ok" text="lima.common.ok"
+ <JButton text="lima.cancel" onActionPerformed="dispose()"/>
+ <JButton id="ok" text="lima.ok"
onActionPerformed="handler.addAccount(this)"/>
</JPanel>
</cell>
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementHeaderForm.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementHeaderForm.jaxx 2014-07-31 13:05:12 UTC (rev 3881)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementHeaderForm.jaxx 2014-07-31 15:04:52 UTC (rev 3882)
@@ -97,10 +97,10 @@
</row>
<row>
<cell fill="none">
- <JButton text="lima.common.cancel" onActionPerformed="performCancel()"/>
+ <JButton text="lima.cancel" onActionPerformed="performCancel()"/>
</cell>
<cell fill="none">
- <JButton id="ok" text="lima.common.ok" onActionPerformed="dispose()"/>
+ <JButton id="ok" text="lima.ok" onActionPerformed="dispose()"/>
</cell>
</row>
</Table>
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementImportForm.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementImportForm.jaxx 2014-07-31 13:05:12 UTC (rev 3881)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementImportForm.jaxx 2014-07-31 15:04:52 UTC (rev 3882)
@@ -95,11 +95,11 @@
<Table>
<row>
<cell fill="none">
- <JButton text="lima.common.cancel"
+ <JButton text="lima.cancel"
onActionPerformed="performCancel()"/>
</cell>
<cell fill="none">
- <JButton id="ok" text="lima.common.ok"
+ <JButton id="ok" text="lima.ok"
onActionPerformed="dispose()"/>
</cell>
</row>
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementMovementForm.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementMovementForm.jaxx 2014-07-31 13:05:12 UTC (rev 3881)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementMovementForm.jaxx 2014-07-31 15:04:52 UTC (rev 3882)
@@ -110,10 +110,10 @@
</row>
<row>
<cell fill="none">
- <JButton text="lima.common.cancel" onActionPerformed="performCancel()"/>
+ <JButton text="lima.cancel" onActionPerformed="performCancel()"/>
</cell>
<cell fill="none">
- <JButton id="ok" text="lima.common.ok" onActionPerformed="dispose()"/>
+ <JButton id="ok" text="lima.ok" onActionPerformed="dispose()"/>
</cell>
</row>
</Table>
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/AddPeriod.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/AddPeriod.jaxx 2014-07-31 13:05:12 UTC (rev 3881)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/AddPeriod.jaxx 2014-07-31 15:04:52 UTC (rev 3882)
@@ -68,11 +68,11 @@
<Table fill="none" anchor="center" weighty="1">
<row>
<cell>
- <JButton id="cancelButton" text="lima.common.cancel"
+ <JButton id="cancelButton" text="lima.cancel"
onActionPerformed="performCancel()"/>
</cell>
<cell>
- <JButton id="okButton" text="lima.common.ok"
+ <JButton id="okButton" text="lima.ok"
onActionPerformed="performOk()"/>
</cell>
</row>
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/RetainedEarningsEntryBookForm.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/RetainedEarningsEntryBookForm.jaxx 2014-07-31 13:05:12 UTC (rev 3881)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/RetainedEarningsEntryBookForm.jaxx 2014-07-31 15:04:52 UTC (rev 3882)
@@ -135,11 +135,11 @@
</row>
<row>
<cell>
- <JButton id="cancelButton" text="lima.common.cancel"
+ <JButton id="cancelButton" text="lima.cancel"
onActionPerformed="performCancel()"/>
</cell>
<cell>
- <JButton id="okButton" text="lima.common.ok"
+ <JButton id="okButton" text="lima.ok"
onActionPerformed="dispose()"/>
</cell>
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/identity/IdentityForm.css
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/identity/IdentityForm.css 2014-07-31 13:05:12 UTC (rev 3881)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/identity/IdentityForm.css 2014-07-31 15:04:52 UTC (rev 3882)
@@ -92,9 +92,9 @@
}
#cancel {
- text : "lima.common.cancel";
+ text : "lima.cancel";
}
#ok {
- text : "lima.common.ok";
+ text : "lima.ok";
}
\ No newline at end of file
Added: trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/CreateIdentityPanel.css
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/CreateIdentityPanel.css (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/CreateIdentityPanel.css 2014-07-31 15:04:52 UTC (rev 3882)
@@ -0,0 +1,87 @@
+#nameLabel {
+ text : "lima.identity.name";
+}
+
+#nameTextField {
+ text : {handler.getIdentity().getName()};
+}
+
+#descriptionLabel {
+ text : "lima.identity.description";
+}
+
+#descriptionTextField {
+ text : {handler.getIdentity().getDescription()};
+}
+
+#addressLabel {
+ text : "lima.identity.address";
+}
+
+#addressTextField {
+ text : {handler.getIdentity().getAddress()};
+}
+
+#address2Label {
+ text : "lima.identity.address2";
+}
+
+#address2TextField {
+ text : {handler.getIdentity().getAddress2()};
+}
+
+#zipCodeLabel {
+ text : "lima.identity.zipCode";
+}
+
+#zipCodeTextField {
+ text : {handler.getIdentity().getZipCode()};
+}
+
+#cityLabel {
+ text : "lima.identity.city";
+}
+
+#cityTextField {
+ text : {handler.getIdentity().getCity()};
+}
+
+#businessNumberLabel {
+ text : "lima.identity.businessNumber";
+}
+
+#businessNumberTextField {
+ text : {handler.getIdentity().getBusinessNumber()};
+}
+
+#vatNumberLabel {
+ text : "lima.identity.vatNumber";
+}
+
+#vatNumberTextField {
+ text : {handler.getIdentity().getVatNumber()};
+}
+
+#classificationCodeLabel {
+ text : "lima.identity.classificationCode";
+}
+
+#classificationCodeTextField {
+ text : {handler.getIdentity().getClassificationCode()};
+}
+
+#phoneNumberLabel {
+ text : "lima.identity.phoneNumber";
+}
+
+#phoneNumberTextField {
+ text : {handler.getIdentity().getPhoneNumber()};
+}
+
+#emailLabel {
+ text : "lima.identity.email";
+}
+
+#emailTextField {
+ text : {handler.getIdentity().getEmail()};
+}
\ No newline at end of file
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/CreateIdentityPanel.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/CreateIdentityPanel.jaxx 2014-07-31 13:05:12 UTC (rev 3881)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/CreateIdentityPanel.jaxx 2014-07-31 15:04:52 UTC (rev 3882)
@@ -24,130 +24,98 @@
-->
<JPanel>
<import>
- javax.swing.text.Document
- org.chorem.lima.entity.Identity
- org.chorem.lima.ui.identity.IdentityHandler
+ org.chorem.lima.ui.opening.CreateIdentityPanelHandler
</import>
- <IdentityHandler id="handler" javaBean="new IdentityHandler()"/>
- <Identity id="identity" javaBean='handler.getIdentity()'/>
+ <CreateIdentityPanelHandler id="handler" javaBean="new CreateIdentityPanelHandler(this)"/>
<Table>
<row>
<cell fill="horizontal">
- <JLabel text="lima.identity.name"/>
+ <JLabel id="nameLabel" />
</cell>
<cell fill="horizontal">
- <JTextField id="nameTextField" text="{getIdentity().getName()}"/>
- <Document javaBean="getNameTextField().getDocument()"
- onInsertUpdate='getIdentity().setName(getNameTextField().getText())'
- onRemoveUpdate='getIdentity().setName(getNameTextField().getText())'/>
+ <JTextField id="nameTextField" />
</cell>
+ </row>
+ <row>
<cell fill="horizontal">
- <JLabel text="lima.identity.description"/>
+ <JLabel id="descriptionLabel"/>
</cell>
<cell fill="horizontal">
- <JTextField id="descriptionTextField"
- text="{getIdentity().getDescription()}"/>
- <Document javaBean="getDescriptionTextField().getDocument()"
- onInsertUpdate='getIdentity().setDescription(getDescriptionTextField().getText())'
- onRemoveUpdate='getIdentity().setDescription(getDescriptionTextField().getText())'/>
+ <JTextField id="descriptionTextField"/>
</cell>
</row>
<row>
<cell fill="horizontal">
- <JLabel text="lima.identity.address"/>
+ <JLabel id="addressLabel"/>
</cell>
<cell fill="horizontal">
- <JTextField id="addressTextField" text="{getIdentity().getAddress()}"/>
- <Document javaBean="getAddressTextField().getDocument()"
- onInsertUpdate='getIdentity().setAddress(getAddressTextField().getText())'
- onRemoveUpdate='getIdentity().setAddress(getAddressTextField().getText())'/>
+ <JTextField id="addressTextField" />
</cell>
+ </row>
+ <row>
<cell fill="horizontal">
- <JLabel text="lima.identity.address2"/>
+ <JLabel id="address2Label"/>
</cell>
<cell fill="horizontal">
- <JTextField id="address2TextField"
- text="{getIdentity().getAddress2()}"/>
- <Document javaBean="getAddress2TextField().getDocument()"
- onInsertUpdate='getIdentity().setAddress2(getAddress2TextField().getText())'
- onRemoveUpdate='getIdentity().setAddress2(getAddress2TextField().getText())'/>
+ <JTextField id="address2TextField"/>
</cell>
</row>
<row>
<cell fill="horizontal">
- <JLabel text="lima.identity.zipCode"/>
+ <JLabel id="zipCodeLabel"/>
</cell>
<cell fill="horizontal">
- <JTextField id="zipCodeTextField" text="{getIdentity().getZipCode()}"/>
- <Document javaBean="getZipCodeTextField().getDocument()"
- onInsertUpdate='getIdentity().setZipCode(getZipCodeTextField().getText())'
- onRemoveUpdate='getIdentity().setZipCode(getZipCodeTextField().getText())'/>
+ <JTextField id="zipCodeTextField"/>
</cell>
+ </row>
+ <row>
<cell fill="horizontal">
<JLabel text="lima.identity.city"/>
</cell>
<cell fill="horizontal">
- <JTextField id="cityTextField" text="{getIdentity().getCity()}"/>
- <Document javaBean="getCityTextField().getDocument()"
- onInsertUpdate='getIdentity().setCity(getCityTextField().getText())'
- onRemoveUpdate='getIdentity().setCity(getCityTextField().getText())'/>
+ <JTextField id="cityTextField" />
</cell>
</row>
<row>
<cell fill="horizontal">
- <JLabel text="lima.identity.businessNumber"/>
+ <JLabel id="businessNumberLabel"/>
</cell>
<cell fill="horizontal">
- <JTextField id="businessNumberTextField"
- text="{getIdentity().getBusinessNumber()}"/>
- <Document javaBean="getBusinessNumberTextField().getDocument()"
- onInsertUpdate='getIdentity().setBusinessNumber(getBusinessNumberTextField().getText())'
- onRemoveUpdate='getIdentity().setBusinessNumber(getBusinessNumberTextField().getText())'/>
+ <JTextField id="businessNumberTextField"/>
</cell>
+ </row>
+ <row>
<cell fill="horizontal">
- <JLabel text="lima.identity.vatNumber"/>
+ <JLabel id="vatNumberLabel"/>
</cell>
<cell fill="horizontal">
- <JTextField id="vatNumberTextField"
- text="{getIdentity().getVatNumber()}"/>
- <Document javaBean="getVatNumberTextField().getDocument()"
- onInsertUpdate='getIdentity().setVatNumber(getVatNumberTextField().getText())'
- onRemoveUpdate='getIdentity().setVatNumber(getVatNumberTextField().getText())'/>
+ <JTextField id="vatNumberTextField"/>
</cell>
</row>
<row>
<cell fill="horizontal">
- <JLabel text="lima.identity.classificationCode"/>
+ <JLabel id="classificationCodeLabel"/>
</cell>
<cell fill="horizontal">
- <JTextField id="classificationCodeTextField"
- text="{getIdentity().getClassificationCode()}"/>
- <Document javaBean="getClassificationCodeTextField().getDocument()"
- onInsertUpdate='getIdentity().setClassificationCode(getClassificationCodeTextField().getText())'
- onRemoveUpdate='getIdentity().setClassificationCode(getClassificationCodeTextField().getText())'/>
+ <JTextField id="classificationCodeTextField"/>
</cell>
</row>
<row>
<cell fill="horizontal">
- <JLabel text="lima.identity.phoneNumber"/>
+ <JLabel id="phoneNumberLabel"/>
</cell>
<cell fill="horizontal">
- <JTextField id="phoneNumberTextField"
- text="{getIdentity().getPhoneNumber()}"/>
- <Document javaBean="getPhoneNumberTextField().getDocument()"
- onInsertUpdate='getIdentity().setPhoneNumber(getPhoneNumberTextField().getText())'
- onRemoveUpdate='getIdentity().setPhoneNumber(getPhoneNumberTextField().getText())'/>
+ <JTextField id="phoneNumberTextField"/>
</cell>
+ </row>
+ <row>
<cell fill="horizontal">
- <JLabel text="lima.identity.email"/>
+ <JLabel id="emailLabel"/>
</cell>
<cell fill="horizontal">
- <JTextField id="emailTextField" text="{getIdentity().getEmail()}"/>
- <Document javaBean="getEmailTextField().getDocument()"
- onInsertUpdate='getIdentity().setEmail(getEmailTextField().getText())'
- onRemoveUpdate='getIdentity().setEmail(getEmailTextField().getText())'/>
+ <JTextField id="emailTextField" />
</cell>
</row>
</Table>
Added: trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/CreateIdentityPanelHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/CreateIdentityPanelHandler.java (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/CreateIdentityPanelHandler.java 2014-07-31 15:04:52 UTC (rev 3882)
@@ -0,0 +1,56 @@
+package org.chorem.lima.ui.opening;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.chorem.lima.business.api.IdentityService;
+import org.chorem.lima.entity.Identity;
+import org.chorem.lima.entity.IdentityImpl;
+import org.chorem.lima.service.LimaServiceFactory;
+import org.chorem.lima.ui.identity.IdentityHandler;
+
+/**
+ * @author Sylvain Bavencoff <bavencoff(a)codelutin.com>
+ */
+public class CreateIdentityPanelHandler {
+
+ protected IdentityService identityService;
+
+ protected CreateIdentityPanel view;
+
+ private static final Log log = LogFactory.getLog(IdentityHandler.class);
+
+
+ public CreateIdentityPanelHandler(CreateIdentityPanel view) {
+ this.view = view;
+ identityService =
+ LimaServiceFactory.getService(
+ IdentityService.class);
+ }
+
+ public Identity getIdentity() {
+ Identity identity = identityService.getIdentity();
+ if (identity == null) {
+ identity = new IdentityImpl();
+ }
+ return identity;
+ }
+
+ public void updateIdentity(){
+ Identity identity = getIdentity();
+
+ identity.setName(view.getNameTextField().getText());
+ identity.setDescription(view.getDescriptionTextField().getText());
+ identity.setAddress(view.getAddressTextField().getText());
+ identity.setAddress2(view.getAddress2TextField().getText());
+ identity.setZipCode(view.getZipCodeTextField().getText());
+ identity.setCity(view.getCityTextField().getText());
+ identity.setBusinessNumber(view.getBusinessNumberTextField().getText());
+ identity.setVatNumber(view.getVatNumberTextField().getText());
+ identity.setClassificationCode(view.getClassificationCodeTextField().getText());
+ identity.setPhoneNumber(view.getPhoneNumberTextField().getText());
+ identity.setEmail(view.getEmailTextField().getText());
+
+ identityService.updateIdentity(identity);
+ }
+
+}
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-07-31 13:05:12 UTC (rev 3881)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/OpeningViewHandler.java 2014-07-31 15:04:52 UTC (rev 3882)
@@ -37,13 +37,13 @@
import org.chorem.lima.enums.ImportExportEnum;
import org.chorem.lima.enums.VatStatementsChartEnum;
import org.chorem.lima.service.LimaServiceFactory;
-import org.chorem.lima.ui.identity.IdentityHandler;
import org.chorem.lima.ui.importexport.ImportExport;
-import javax.swing.*;
+import javax.swing.BorderFactory;
+import javax.swing.JPanel;
import javax.swing.border.Border;
import javax.swing.border.EmptyBorder;
-import java.awt.*;
+import java.awt.Color;
import static org.nuiton.i18n.I18n.t;
@@ -98,8 +98,7 @@
step++;
break;
case 1:
- IdentityHandler identityHandler = new IdentityHandler();
- identityHandler.updateIdentity(idPanel.getIdentity());
+ idPanel.getHandler().updateIdentity();
//refresh UI
view.getIdentityIcon().setBorder(noBorder);
view.getAccountsIcon().setBorder(BorderFactory.createLineBorder(green, 2));
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatchart/VatChartImportForm.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatchart/VatChartImportForm.jaxx 2014-07-31 13:05:12 UTC (rev 3881)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatchart/VatChartImportForm.jaxx 2014-07-31 15:04:52 UTC (rev 3882)
@@ -94,11 +94,11 @@
<Table>
<row>
<cell fill="none">
- <JButton text="lima.common.cancel"
+ <JButton text="lima.cancel"
onActionPerformed="performCancel()"/>
</cell>
<cell fill="none">
- <JButton id="ok" text="lima.common.ok"
+ <JButton id="ok" text="lima.ok"
onActionPerformed="dispose()"/>
</cell>
</row>
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatchart/VatChartMovementForm.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatchart/VatChartMovementForm.jaxx 2014-07-31 13:05:12 UTC (rev 3881)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatchart/VatChartMovementForm.jaxx 2014-07-31 15:04:52 UTC (rev 3882)
@@ -96,10 +96,10 @@
</row>
<row>
<cell fill="none">
- <JButton text="lima.common.cancel" onActionPerformed="performCancel()"/>
+ <JButton text="lima.cancel" onActionPerformed="performCancel()"/>
</cell>
<cell fill="none">
- <JButton id="ok" text="lima.common.ok" onActionPerformed="dispose()"/>
+ <JButton id="ok" text="lima.ok" onActionPerformed="dispose()"/>
</cell>
</row>
</Table>
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/util/ReportDialogView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/util/ReportDialogView.jaxx 2014-07-31 13:05:12 UTC (rev 3881)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/util/ReportDialogView.jaxx 2014-07-31 15:04:52 UTC (rev 3882)
@@ -42,7 +42,7 @@
</row>
<row anchor="east">
<cell>
- <JButton id="okButton" text="lima.common.ok"
+ <JButton id="okButton" text="lima.ok"
onActionPerformed="performOk()"/>
</cell>
</row>
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-07-31 13:05:12 UTC (rev 3881)
+++ trunk/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties 2014-07-31 15:04:52 UTC (rev 3882)
@@ -20,6 +20,7 @@
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
+lima.cancel=Cancel
lima.charts.account=Accounts chart
lima.charts.account.base=Base accountchart
lima.charts.account.developed=Developped accountchart
@@ -57,7 +58,6 @@
lima.common.begindate=Begin
lima.common.buttonback=←
lima.common.buttonnext=→
-lima.common.cancel=Cancel
lima.common.closed=Closed
lima.common.code=Code
lima.common.confirmation=Confirmation
@@ -74,7 +74,6 @@
lima.common.label=Label
lima.common.movmentedfilter=Accounts filtered
lima.common.new=New
-lima.common.ok=OK
lima.common.open=Open
lima.common.paste=Paste
lima.common.quit=Exit
@@ -369,6 +368,7 @@
lima.message.help.usage=Options (set with --option <key> <value>\:
lima.misc.supportemail.description=Support email
lima.misc.supportemail.label=
+lima.ok=OK
lima.openejb.remotemode.description=
lima.openejb.remotemode.label=
lima.opening.accounts=Import accounts from\:
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-07-31 13:05:12 UTC (rev 3881)
+++ trunk/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties 2014-07-31 15:04:52 UTC (rev 3882)
@@ -9,6 +9,7 @@
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
+lima.cancel=Annuler
lima.charts.account=Plan comptable
lima.charts.account.base=Plan comptable de base
lima.charts.account.developed=Plan comptable développé
@@ -46,7 +47,6 @@
lima.common.begindate=Début
lima.common.buttonback=←
lima.common.buttonnext=→
-lima.common.cancel=Annuler
lima.common.closed=Fermé
lima.common.code=Code
lima.common.confirmation=Confirmation
@@ -62,7 +62,6 @@
lima.common.label=Libellé
lima.common.movmentedfilter=Comptes mouvementés
lima.common.new=Nouveau
-lima.common.ok=OK
lima.common.open=Ouvert
lima.common.paste=Coller
lima.common.quit=Quitter
@@ -320,6 +319,7 @@
lima.message.help.usage=Options (set with --option <key> <value>\:
lima.misc.supportemail.description=Adresse email de support
lima.misc.supportemail.label=support
+lima.ok=OK
lima.openejb.remotemode.description=
lima.openejb.remotemode.label=
lima.opening.accounts=Importer le plan de comptes depuis \:
1
0
r3881 - trunk/lima-swing/src/main/java/org/chorem/lima/ui/identity
by sbavencoff@users.chorem.org 31 Jul '14
by sbavencoff@users.chorem.org 31 Jul '14
31 Jul '14
Author: sbavencoff
Date: 2014-07-31 15:05:12 +0200 (Thu, 31 Jul 2014)
New Revision: 3881
Url: http://forge.chorem.org/projects/lima/repository/revisions/3881
Log:
refs #875 #1043 : identity
Added:
trunk/lima-swing/src/main/java/org/chorem/lima/ui/identity/IdentityForm.css
Modified:
trunk/lima-swing/src/main/java/org/chorem/lima/ui/identity/IdentityForm.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/identity/IdentityHandler.java
Added: trunk/lima-swing/src/main/java/org/chorem/lima/ui/identity/IdentityForm.css
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/identity/IdentityForm.css (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/identity/IdentityForm.css 2014-07-31 13:05:12 UTC (rev 3881)
@@ -0,0 +1,100 @@
+#dialog {
+ modal : true;
+ defaultCloseOperation : {JDialog.DO_NOTHING_ON_CLOSE};
+}
+
+#nameLabel {
+ text : "lima.identity.name";
+}
+
+#nameTextField {
+ text : {handler.getIdentity().getName()};
+}
+
+#descriptionLabel {
+ text : "lima.identity.description";
+}
+
+#descriptionTextField {
+ text : {handler.getIdentity().getDescription()};
+}
+
+#addressLabel {
+ text : "lima.identity.address";
+}
+
+#addressTextField {
+ text : {handler.getIdentity().getAddress()};
+}
+
+#address2Label {
+ text : "lima.identity.address2";
+}
+
+#address2TextField {
+ text : {handler.getIdentity().getAddress2()};
+}
+
+#zipCodeLabel {
+ text : "lima.identity.zipCode";
+}
+
+#zipCodeTextField {
+ text : {handler.getIdentity().getZipCode()};
+}
+
+#cityLabel {
+ text : "lima.identity.city";
+}
+
+#cityTextField {
+ text : {handler.getIdentity().getCity()};
+}
+
+#businessNumberLabel {
+ text : "lima.identity.businessNumber";
+}
+
+#businessNumberTextField {
+ text : {handler.getIdentity().getBusinessNumber()};
+}
+
+#vatNumberLabel {
+ text : "lima.identity.vatNumber";
+}
+
+#vatNumberTextField {
+ text : {handler.getIdentity().getVatNumber()};
+}
+
+#classificationCodeLabel {
+ text : "lima.identity.classificationCode";
+}
+
+#classificationCodeTextField {
+ text : {handler.getIdentity().getClassificationCode()};
+}
+
+#phoneNumberLabel {
+ text : "lima.identity.phoneNumber";
+}
+
+#phoneNumberTextField {
+ text : {handler.getIdentity().getPhoneNumber()};
+}
+
+#emailLabel {
+ text : "lima.identity.email";
+}
+
+#emailTextField {
+ text : {handler.getIdentity().getEmail()};
+}
+
+#cancel {
+ text : "lima.common.cancel";
+}
+
+#ok {
+ text : "lima.common.ok";
+}
\ No newline at end of file
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/identity/IdentityForm.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/identity/IdentityForm.jaxx 2014-07-31 12:01:23 UTC (rev 3880)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/identity/IdentityForm.jaxx 2014-07-31 13:05:12 UTC (rev 3881)
@@ -23,84 +23,58 @@
#L%
-->
-<JDialog modal="true"
- defaultCloseOperation="{JDialog.DO_NOTHING_ON_CLOSE}"
- onWindowClosing="performCancel();">
+<JDialog id="dialog"
+ onWindowClosing="dispose();">
- <IdentityHandler id="handler" javaBean="new IdentityHandler()"/>
+ <IdentityHandler id="handler" javaBean="new IdentityHandler(this)"/>
<org.chorem.lima.entity.Identity id="identity"
javaBean='handler.getIdentity()'/>
<script>
<![CDATA[
getRootPane().setDefaultButton(ok);
- protected void performCancel() {
- setIdentity(null);
- dispose();
- }
]]>
</script>
<Table>
<row>
<cell fill="horizontal">
- <JLabel text="lima.identity.name"/>
+ <JLabel id="nameLabel" />
</cell>
<cell fill="horizontal">
- <JTextField id="nameTextField" text="{getIdentity().getName()}"/>
- <javax.swing.text.Document javaBean="getNameTextField().getDocument()"
- onInsertUpdate='getIdentity().setName(getNameTextField().getText())'
- onRemoveUpdate='getIdentity().setName(getNameTextField().getText())'/>
+ <JTextField id="nameTextField" />
</cell>
</row>
<row>
<cell fill="horizontal">
- <JLabel text="lima.identity.description"/>
+ <JLabel id="descriptionLabel"/>
</cell>
<cell fill="horizontal">
- <JTextField id="descriptionTextField"
- text="{getIdentity().getDescription()}"/>
- <javax.swing.text.Document
- javaBean="getDescriptionTextField().getDocument()"
- onInsertUpdate='getIdentity().setDescription(getDescriptionTextField().getText())'
- onRemoveUpdate='getIdentity().setDescription(getDescriptionTextField().getText())'/>
+ <JTextField id="descriptionTextField"/>
</cell>
</row>
<row>
<cell fill="horizontal">
- <JLabel text="lima.identity.address"/>
+ <JLabel id="addressLabel"/>
</cell>
<cell fill="horizontal">
- <JTextField id="addressTextField" text="{getIdentity().getAddress()}"/>
- <javax.swing.text.Document
- javaBean="getAddressTextField().getDocument()"
- onInsertUpdate='getIdentity().setAddress(getAddressTextField().getText())'
- onRemoveUpdate='getIdentity().setAddress(getAddressTextField().getText())'/>
+ <JTextField id="addressTextField" />
</cell>
</row>
<row>
<cell fill="horizontal">
- <JLabel text="lima.identity.address2"/>
+ <JLabel id="address2Label"/>
</cell>
<cell fill="horizontal">
- <JTextField id="address2TextField"
- text="{getIdentity().getAddress2()}"/>
- <javax.swing.text.Document
- javaBean="getAddress2TextField().getDocument()"
- onInsertUpdate='getIdentity().setAddress2(getAddress2TextField().getText())'
- onRemoveUpdate='getIdentity().setAddress2(getAddress2TextField().getText())'/>
+ <JTextField id="address2TextField"/>
</cell>
</row>
<row>
<cell fill="horizontal">
- <JLabel text="lima.identity.zipCode"/>
+ <JLabel id="zipCodeLabel"/>
</cell>
<cell fill="horizontal">
- <JTextField id="zipCodeTextField" text="{getIdentity().getZipCode()}"/>
- <javax.swing.text.Document
- javaBean="getZipCodeTextField().getDocument()"
- onInsertUpdate='getIdentity().setZipCode(getZipCodeTextField().getText())'
- onRemoveUpdate='getIdentity().setZipCode(getZipCodeTextField().getText())'/>
+ <JTextField id="zipCodeTextField"/>
</cell>
</row>
<row>
@@ -108,82 +82,57 @@
<JLabel text="lima.identity.city"/>
</cell>
<cell fill="horizontal">
- <JTextField id="cityTextField" text="{getIdentity().getCity()}"/>
- <javax.swing.text.Document javaBean="getCityTextField().getDocument()"
- onInsertUpdate='getIdentity().setCity(getCityTextField().getText())'
- onRemoveUpdate='getIdentity().setCity(getCityTextField().getText())'/>
+ <JTextField id="cityTextField" />
</cell>
</row>
<row>
<cell fill="horizontal">
- <JLabel text="lima.identity.businessNumber"/>
+ <JLabel id="businessNumberLabel"/>
</cell>
<cell fill="horizontal">
- <JTextField id="businessNumberTextField"
- text="{getIdentity().getBusinessNumber()}"/>
- <javax.swing.text.Document
- javaBean="getBusinessNumberTextField().getDocument()"
- onInsertUpdate='getIdentity().setBusinessNumber(getBusinessNumberTextField().getText())'
- onRemoveUpdate='getIdentity().setBusinessNumber(getBusinessNumberTextField().getText())'/>
+ <JTextField id="businessNumberTextField"/>
</cell>
</row>
<row>
<cell fill="horizontal">
- <JLabel text="lima.identity.vatNumber"/>
+ <JLabel id="vatNumberLabel"/>
</cell>
<cell fill="horizontal">
- <JTextField id="vatNumberTextField"
- text="{getIdentity().getVatNumber()}"/>
- <javax.swing.text.Document
- javaBean="getVatNumberTextField().getDocument()"
- onInsertUpdate='getIdentity().setVatNumber(getVatNumberTextField().getText())'
- onRemoveUpdate='getIdentity().setVatNumber(getVatNumberTextField().getText())'/>
+ <JTextField id="vatNumberTextField"/>
</cell>
</row>
<row>
<cell fill="horizontal">
- <JLabel text="lima.identity.classificationCode"/>
+ <JLabel id="classificationCodeLabel"/>
</cell>
<cell fill="horizontal">
- <JTextField id="classificationCodeTextField"
- text="{getIdentity().getClassificationCode()}"/>
- <javax.swing.text.Document
- javaBean="getClassificationCodeTextField().getDocument()"
- onInsertUpdate='getIdentity().setClassificationCode(getClassificationCodeTextField().getText())'
- onRemoveUpdate='getIdentity().setClassificationCode(getClassificationCodeTextField().getText())'/>
+ <JTextField id="classificationCodeTextField"/>
</cell>
</row>
<row>
<cell fill="horizontal">
- <JLabel text="lima.identity.phoneNumber"/>
+ <JLabel id="phoneNumberLabel"/>
</cell>
<cell fill="horizontal">
- <JTextField id="phoneNumberTextField"
- text="{getIdentity().getPhoneNumber()}"/>
- <javax.swing.text.Document
- javaBean="getPhoneNumberTextField().getDocument()"
- onInsertUpdate='getIdentity().setPhoneNumber(getPhoneNumberTextField().getText())'
- onRemoveUpdate='getIdentity().setPhoneNumber(getPhoneNumberTextField().getText())'/>
+ <JTextField id="phoneNumberTextField"/>
</cell>
</row>
<row>
<cell fill="horizontal">
- <JLabel text="lima.identity.email"/>
+ <JLabel id="emailLabel"/>
</cell>
<cell fill="horizontal">
- <JTextField id="emailTextField" text="{getIdentity().getEmail()}"/>
- <javax.swing.text.Document javaBean="getEmailTextField().getDocument()"
- onInsertUpdate='getIdentity().setEmail(getEmailTextField().getText())'
- onRemoveUpdate='getIdentity().setEmail(getEmailTextField().getText())'/>
+ <JTextField id="emailTextField" />
</cell>
</row>
<row>
<cell fill="none">
- <JButton text="lima.common.cancel" onActionPerformed="performCancel()"/>
+ <JButton id="cancel"
+ onActionPerformed="dispose();"/>
</cell>
<cell fill="none">
- <JButton id="ok" text="lima.common.ok" onActionPerformed="handler.updateIdentity(getIdentity());
- dispose()"/>
+ <JButton id="ok"
+ onActionPerformed="handler.updateIdentity(); dispose();" />
</cell>
</row>
</Table>
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/identity/IdentityHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/identity/IdentityHandler.java 2014-07-31 12:01:23 UTC (rev 3880)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/identity/IdentityHandler.java 2014-07-31 13:05:12 UTC (rev 3881)
@@ -36,10 +36,13 @@
protected IdentityService identityService;
+ protected IdentityForm view;
+
private static final Log log = LogFactory.getLog(IdentityHandler.class);
- public IdentityHandler() {
+ public IdentityHandler(IdentityForm view) {
+ this.view = view;
identityService =
LimaServiceFactory.getService(
IdentityService.class);
@@ -53,7 +56,21 @@
return identity;
}
- public void updateIdentity(Identity identity) {
+ public void updateIdentity(){
+ Identity identity = getIdentity();
+
+ identity.setName(view.getNameTextField().getText());
+ identity.setDescription(view.getDescriptionTextField().getText());
+ identity.setAddress(view.getAddressTextField().getText());
+ identity.setAddress2(view.getAddress2TextField().getText());
+ identity.setZipCode(view.getZipCodeTextField().getText());
+ identity.setCity(view.getCityTextField().getText());
+ identity.setBusinessNumber(view.getBusinessNumberTextField().getText());
+ identity.setVatNumber(view.getVatNumberTextField().getText());
+ identity.setClassificationCode(view.getClassificationCodeTextField().getText());
+ identity.setPhoneNumber(view.getPhoneNumberTextField().getText());
+ identity.setEmail(view.getEmailTextField().getText());
+
identityService.updateIdentity(identity);
}
}
1
0
Author: dcosse
Date: 2014-07-31 14:01:23 +0200 (Thu, 31 Jul 2014)
New Revision: 3880
Url: http://forge.chorem.org/projects/lima/repository/revisions/3880
Log:
refs #1032 import export des VATStatements
Added:
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/src/main/java/org/chorem/lima/business/ejb/csv/VatStatementModel.java
trunk/lima-business/src/test/resources/import/vat_shortened.csv
Removed:
trunk/lima-business-api/src/main/java/org/chorem/lima/business/AlreadyExistFinancialTransaction.java
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/NewExportService.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/NewImportService.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/VatStatementService.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialStatementServiceImpl.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/NewExportServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/NewImportServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/VatStatementServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/csv/AbstractLimaModel.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/csv/FinancialStatementModel.java
trunk/lima-business/src/test/java/org/chorem/lima/business/AbstractLimaTest.java
trunk/lima-business/src/test/java/org/chorem/lima/business/ImportServiceImplTest.java
trunk/lima-business/src/test/java/org/chorem/lima/business/NewImportExportServiceTest.java
trunk/lima-callao/src/main/xmi/accounting-model.zargo
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartTreeTableModel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java
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_fr_FR.properties
trunk/lima-swing/src/main/resources/import/vat_base.csv
trunk/lima-swing/src/main/resources/import/vat_default.csv
trunk/lima-swing/src/main/resources/import/vat_developed.csv
trunk/lima-swing/src/main/resources/import/vat_shortened.csv
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-07-31 08:38:23 UTC (rev 3879)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialStatementServiceImpl.java 2014-07-31 12:01:23 UTC (rev 3880)
@@ -39,7 +39,7 @@
import org.chorem.lima.beans.FinancialStatementDatas;
import org.chorem.lima.beans.FinancialStatementDatasImpl;
import org.chorem.lima.beans.ReportsDatas;
-import org.chorem.lima.business.AlreadyExistFinancialTransaction;
+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;
@@ -84,7 +84,7 @@
}
};
- protected void validateNewFinancialStatement(FinancialStatement masterFinancialStatement, FinancialStatement financialStatement) throws AlreadyExistFinancialTransaction, NotAllowedLabel {
+ protected void validateNewFinancialStatement(FinancialStatement masterFinancialStatement, FinancialStatement financialStatement) throws AlreadyExistFinancialStatement, NotAllowedLabel {
if (financialStatement.getLabel().contains("/")) {
throw new NotAllowedLabel(financialStatement.getLabel());
}
@@ -95,7 +95,7 @@
}
Map indexedSubFinancialStatements = Maps.uniqueIndex(masterSubFinancialStatements, GET_LABEL);
if (indexedSubFinancialStatements.get(financialStatement.getLabel()) != null){
- throw new AlreadyExistFinancialTransaction(financialStatement.getLabel(), masterFinancialStatement.getLabel());
+ throw new AlreadyExistFinancialStatement(financialStatement.getLabel(), masterFinancialStatement.getLabel());
}
}
}
@@ -134,7 +134,7 @@
@Override
public FinancialStatement createFinancialStatement(FinancialStatement masterFinancialStatement,
- FinancialStatement financialStatement) throws AlreadyExistFinancialTransaction, NotAllowedLabel {
+ FinancialStatement financialStatement) throws AlreadyExistFinancialStatement, NotAllowedLabel {
validateNewFinancialStatement(masterFinancialStatement, financialStatement);
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-07-31 08:38:23 UTC (rev 3879)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java 2014-07-31 12:01:23 UTC (rev 3880)
@@ -37,62 +37,40 @@
import org.apache.pdfbox.exceptions.COSVisitorException;
import org.apache.pdfbox.pdmodel.PDDocument;
import org.apache.pdfbox.pdmodel.interactive.form.PDField;
-import org.chorem.lima.beans.ClosedPeriodicEntryBookImport;
-import org.chorem.lima.beans.ClosedPeriodicEntryBookImportImpl;
import org.chorem.lima.beans.EntryEBP;
import org.chorem.lima.beans.EntryEBPImpl;
import org.chorem.lima.beans.EntryImport;
-import org.chorem.lima.beans.EntryImportImpl;
-import org.chorem.lima.beans.FinancialStatementImport;
import org.chorem.lima.beans.FinancialTransactionImport;
-import org.chorem.lima.beans.FinancialTransactionImportImpl;
-import org.chorem.lima.beans.VatStatementImport;
-import org.chorem.lima.beans.VatStatementImportImpl;
import org.chorem.lima.business.AlreadyExistAccountException;
-import org.chorem.lima.business.BeginAfterEndFiscalPeriodException;
import org.chorem.lima.business.ImportEbpException;
import org.chorem.lima.business.InvalidAccountNumberException;
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.NotBeginNextDayOfLastFiscalPeriodException;
-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.AccountService;
import org.chorem.lima.business.api.ClosedPeriodicEntryBookService;
import org.chorem.lima.business.api.EntryBookService;
import org.chorem.lima.business.api.EntryService;
import org.chorem.lima.business.api.FinancialPeriodService;
-import org.chorem.lima.business.api.FinancialStatementService;
import org.chorem.lima.business.api.FinancialTransactionService;
import org.chorem.lima.business.api.FiscalPeriodService;
import org.chorem.lima.business.api.IdentityService;
import org.chorem.lima.business.api.ImportService;
-import org.chorem.lima.business.api.VatStatementService;
import org.chorem.lima.business.utils.DocumentsEnum;
import org.chorem.lima.business.utils.EntryEBPComparator;
import org.chorem.lima.business.utils.FiscalPeriodComparator;
import org.chorem.lima.business.utils.ImportExportEntityEnum;
import org.chorem.lima.entity.Account;
import org.chorem.lima.entity.AccountImpl;
-import org.chorem.lima.entity.ClosedPeriodicEntryBook;
import org.chorem.lima.entity.Entry;
import org.chorem.lima.entity.EntryBook;
import org.chorem.lima.entity.EntryBookImpl;
import org.chorem.lima.entity.EntryImpl;
-import org.chorem.lima.entity.FinancialPeriod;
import org.chorem.lima.entity.FinancialTransaction;
import org.chorem.lima.entity.FinancialTransactionImpl;
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.chorem.lima.entity.VatStatement;
-import org.chorem.lima.entity.VatStatementImpl;
-import org.nuiton.topia.persistence.TopiaException;
import javax.ejb.EJB;
import javax.ejb.Remote;
@@ -110,9 +88,6 @@
import java.util.Arrays;
import java.util.Collections;
import java.util.Date;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
@@ -157,12 +132,6 @@
private FinancialTransactionService financialTransactionService;
@EJB
- private FinancialStatementService financialStatementService;
-
- @EJB
- private VatStatementService vatStatementService;
-
- @EJB
private EntryBookService entryBookService;
@EJB
@@ -555,24 +524,13 @@
ImportExportEntityEnum importExportEntityEnum) throws ImportEbpException {
StringBuilder result = new StringBuilder();
- // FinancialStatements
- Map<String, List<FinancialStatementImport>> financialStatements = null;
- // VatStatement
- Map<String, List<VatStatementImport>> vatStatements = null;
// Transactions and entries
Map<Integer, FinancialTransactionImport> financialTransactions = null;
Map<Integer, List<EntryImport>> entries = null;
switch (importExportEntityEnum) {
- case VATSTATEMENT:
- vatStatements = new LinkedHashMap<String, List<VatStatementImport>>();
- break;
case FINANCIALTRANSACTION:
- case ENTRY:
- financialTransactions = new HashMap<Integer, FinancialTransactionImport>();
- entries = new HashMap<Integer, List<EntryImport>>();
- break;
}
CSVReader csvReader = null;
try {
@@ -585,47 +543,14 @@
|| importExportEntityEnum == ImportExportEntityEnum.FINANCIALTRANSACTION
|| importExportEntityEnum == ImportExportEntityEnum.ENTRY) {
switch (importExportEntityEnum) {
- case ENTRYBOOK:
- result.append(importEntryBooksChartCSV(nextLine));
- break;
- case ACCOUNT:
- result.append(importAccountsChartsCSV(nextLine));
- break;
- case VATSTATEMENT:
- result.append(importVatStatementChartCSV(nextLine,
- vatStatements));
- break;
case FINANCIALTRANSACTION:
- case ENTRY:
- // Entries and transactions always go along
- ImportExportEntityEnum type =
- ImportExportEntityEnum.valueOfLabel(nextLine[0]);
- if (type != null) {
- switch (type) {
- case FINANCIALTRANSACTION:
- importFinancialTransactionsCSV(nextLine,
- financialTransactions);
- break;
- case ENTRY:
- importEntriesCSV(nextLine, entries);
- break;
- }
- }
- break;
}
}
}
//create entity
switch (importExportEntityEnum) {
- case VATSTATEMENT:
- result.append(createVatStatements(vatStatements));
- break;
case FINANCIALTRANSACTION:
- case ENTRY:
- result.append(createFinancialTransactionsAndEntries(
- financialTransactions, entries));
- break;
}
} catch (IOException e) {
@@ -701,418 +626,6 @@
return result.toString();
}
- /**
- * Import and create accounts Structure : TYPE | accountNumber | label
- * | [thirdparty]
- *
- * @param nextLine The line to import
- * @return Success or error message
- * @throws ImportEbpException If the line format is invalid
- */
- protected String importAccountsChartsCSV(String[] nextLine) throws ImportEbpException{
- // Check line format
- if (nextLine.length < 3
- || ! nextLine[0].equals(ImportExportEntityEnum.ACCOUNT.getLabel())) {
- throw new ImportEbpException(t("lima-business.import.lineformatmismatch"));
- }
-
- StringBuilder result = new StringBuilder();
-
- String accountNumber = nextLine[1];
- // if not exists, create it
- if (accountService.getAccountByNumber(accountNumber) == null) {
-
- Account account = new AccountImpl();
- account.setAccountNumber(accountNumber);
- String label = nextLine[2];
- account.setLabel(label);
- if (nextLine.length > 3) {
- String thirdParty = nextLine[3];
- account.setThirdParty(thirdParty);
- }
-
- try {
- accountService.createAccount(account);
- } catch (AlreadyExistAccountException e) {
- result.append(t("lima-business.import.account.alreadyexist", accountNumber));
- } catch (InvalidAccountNumberException e) {
- result.append(t("lima-business.import.account.InvalidAccountNumber", accountNumber));
- }
- result.append(t("lima-business.import.accountadded",
- account.getAccountNumber(),
- account.getLabel()));
- } else {
- result.append(t("lima-business.import.accountalreadyexist", accountNumber));
- }
-
- return result.toString();
- }
-
- /**
- * Import and create fiscal period Structure : TYPE | BeginDate | EndDate
- * | Locked
- *
- * @param nextLine
- * @param fiscalPeriods
- * @return
- * @throws ParseException
- */
- protected String importFiscalPeriodCSV(String[] nextLine,
- List<FiscalPeriod> fiscalPeriods) {
- StringBuilder result = new StringBuilder();
-
- try {
- FiscalPeriod fiscalPeriod = new FiscalPeriodImpl();
- Date beginDate = SDATEFORMAT.parse(nextLine[1]);
- fiscalPeriod.setBeginDate(beginDate);
- Date endDate = SDATEFORMAT.parse(nextLine[2]);
- fiscalPeriod.setEndDate(endDate);
- fiscalPeriod.setLocked(Boolean.parseBoolean(nextLine[3]));
-
- // if not exist, skip
- if (financialPeriodService.getFinancialPeriods(beginDate, endDate) == null) {
- fiscalPeriods.add(fiscalPeriod);
- } else {
- result.append(t("lima-business.import.fiscalperiodalreadyexist", beginDate, endDate));
- }
- } catch (ParseException e) {
- result.append(t("lima-business.common.failed", e.getMessage()));
- }
-
- return result.toString();
- }
-
- /**
- * Import and create entrybooks Structure : TYPE | Code | Label | Type
- *
- * @param nextLine
- * @return
- */
- protected String importEntryBooksChartCSV(String[] nextLine) {
- StringBuilder result = new StringBuilder();
-
- EntryBook entryBook = new EntryBookImpl();
- entryBook.setCode(StringUtils.trimToNull(nextLine[1]));
- entryBook.setLabel(StringUtils.trimToNull(nextLine[2]));
-
- // if exist, skip
- if (entryBookService.getEntryBookByCode(entryBook.getCode()) != null) {
- result.append(t("lima-business.import.entrybookalreadyexist", entryBook.getLabel()));
- } else {
- // create it
- entryBookService.createEntryBook(entryBook);
- result.append(t("lima-business.import.financialstatementadded", entryBook.getLabel()));
- }
-
- return result.toString();
- }
-
- /**
- * Import and create closedperiodicentrybook import Structure : TYPE |
- * BeginDate | EndDate | Locked
- *
- * @param nextLine
- * @param closedPeriodicEntryBooks
- */
- protected void importClosedPeriodicEntryBookCSV(String[] nextLine,
- List<ClosedPeriodicEntryBookImport> closedPeriodicEntryBooks) {
- String locked = nextLine[1];
- String beginDate = nextLine[2];
- String endDate = nextLine[3];
- String entryBookCode = nextLine[4];
-
- if (Boolean.parseBoolean(locked)) {
- ClosedPeriodicEntryBookImport closedPeriodicEntryBookImport = new ClosedPeriodicEntryBookImportImpl();
- closedPeriodicEntryBookImport.setLocked(locked);
- closedPeriodicEntryBookImport
- .setBeginDateFinancialPeriod(beginDate);
- closedPeriodicEntryBookImport.setEndDateFinancialPeriod(endDate);
- closedPeriodicEntryBookImport.setCodeEntryBook(entryBookCode);
-
- closedPeriodicEntryBooks.add(closedPeriodicEntryBookImport);
- }
- }
-
- /**
- * Import and create vatstatement Structure : TYPE | boxName | label
- * | header | accounts | masterVatStatement
- *
- * @param nextLine
- * @param vatStatements
- * @return
- */
- protected String importVatStatementChartCSV(String[] nextLine,
- Map<String, List<VatStatementImport>> vatStatements) {
-
- StringBuilder result = new StringBuilder();
-
- String boxName = nextLine[1];
- String label = StringUtils.trimToNull(nextLine[2]);
- String header = nextLine[3];
- String accounts = StringUtils.trimToNull(nextLine[4]);
- String masterVatStatement = nextLine[5];
-
- // if exist, skip
- if (!vatStatementService.checkVatStatementExist(label)) {
- // create it
- VatStatementImport vatStatementImport = new VatStatementImportImpl();
- vatStatementImport.setLabel(label);
- vatStatementImport.setBoxName(boxName);
- vatStatementImport.setHeader(header);
- vatStatementImport.setAccounts(accounts);
- vatStatementImport.setMasterVatStatement(masterVatStatement);
-
- // put it in hashlinkedlist
- if (vatStatements.containsKey(label)) {
- vatStatements.get(label).add(vatStatementImport);
- } else {
- List<VatStatementImport> list = new ArrayList<VatStatementImport>();
- list.add(vatStatementImport);
- vatStatements.put(label, list);
- }
- } else {
- result.append(t("lima-business.import.vatstatementalreadyexist", label));
- }
-
- return result.toString();
- }
-
-
- /**
- * Import and create financialtransactions Structure : TYPE | NumTransac |
- * TransactionDate | AmountDebit | AmountCredit | EntryBook Code
- *
- * @param nextLine
- * @param financialTransactions
- */
- protected void importFinancialTransactionsCSV(String[] nextLine,
- Map<Integer, FinancialTransactionImport> financialTransactions) {
- int num = new Integer(nextLine[1]);
- FinancialTransactionImport financialTransactionImport = new FinancialTransactionImportImpl();
- financialTransactionImport.setDate(nextLine[2]);
- financialTransactionImport.setAmountDebit(nextLine[3]);
- financialTransactionImport.setAmountCredit(nextLine[4]);
- financialTransactionImport.setCodeEntryBook(nextLine[5]);
-
- financialTransactions.put(num, financialTransactionImport);
- }
-
- /**
- * Import and create entries Structure : TYPE | NumTransac | Description |
- * Amount | Debit | Lettering | Detail | Voucher | Position | Account
- *
- * @param nextLine
- * @param entries
- */
- protected void importEntriesCSV(String[] nextLine,
- Map<Integer, List<EntryImport>> entries) {
- int num = new Integer(nextLine[1]);
-
- EntryImport entryImport = new EntryImportImpl();
- entryImport.setDescription(StringUtils.trimToNull(nextLine[2]));
- entryImport.setAmount(nextLine[3]);
- entryImport.setDebit(nextLine[4]);
- entryImport.setLettering(StringUtils.trimToNull(nextLine[5]));
- entryImport.setDetail(StringUtils.trimToNull(nextLine[6]));
- entryImport.setVoucher(StringUtils.trimToNull(nextLine[7]));
- entryImport.setPosition(StringUtils.trimToNull(nextLine[8]));
- entryImport.setAccount(nextLine[9]);
-
- if (entries.containsKey(num)) {
- List<EntryImport> entryImports = entries.get(num);
- entryImports.add(entryImport);
- } else {
- List<EntryImport> entryImports = new ArrayList<EntryImport>();
- entryImports.add(entryImport);
- entries.put(num, entryImports);
- }
- }
-
- /**
- * @throws TopiaException
- * @deprecated do only one method import without bean use (and remove beans)
- */
- @Deprecated
- protected String createVatStatements(Map<String, List<VatStatementImport>> vatStatements) {
-
- StringBuilder result = new StringBuilder();
-
- while (vatStatements.size() > 0) {
- for (Iterator<List<VatStatementImport>> itr = vatStatements
- .values().iterator(); itr.hasNext(); ) {
- List<VatStatementImport> vatStatementImports =
- itr.next();
-
- for (Iterator<VatStatementImport> itr2 = vatStatementImports.iterator(); itr2.hasNext(); ) {
- VatStatementImport vatStatementImport =
- itr2.next();
- String masterVatStatementLabel = vatStatementImport
- .getMasterVatStatement();
- VatStatement masterVatStatement = vatStatementService.findVatStatementByLabel(masterVatStatementLabel);
-
- if (masterVatStatementLabel.equals("")
- || masterVatStatement != null) {
- // create it
- VatStatement vatStatement = new VatStatementImpl();
- vatStatement.setBoxName(vatStatementImport
- .getBoxName());
- vatStatement.setLabel(vatStatementImport
- .getLabel());
- vatStatement.setAccounts(vatStatementImport
- .getAccounts());
- vatStatement.setHeader(Boolean
- .parseBoolean(vatStatementImport
- .getHeader()));
-
- vatStatementService
- .createVatStatement(
- masterVatStatement,
- vatStatement);
-
- result.append(t("lima-business.import.vatstatementadded",
- vatStatementImport.getLabel()));
-
- itr2.remove();
- } else if (!vatStatements
- .containsKey(masterVatStatementLabel)) {
- result.append(t("lima-business.import.vatstatementalnomaster",
- vatStatementImport.getLabel(),
- masterVatStatementLabel));
- itr2.remove();
- }
- }
- if (vatStatementImports.isEmpty()) {
- itr.remove();
- }
- }
- }
-
- return result.toString();
- }
-
- protected String createFiscalPeriod(List<FiscalPeriod> fiscalPeriods) {
- StringBuilder result = new StringBuilder();
- for (FiscalPeriod fiscalPeriod : fiscalPeriods) {
- // create fiscalPeriod
- try {
- fiscalPeriodService.createFiscalPeriod(fiscalPeriod);
- result.append(t("lima-business.import.fiscalperiodadded",
- fiscalPeriod.getBeginDate(),
- fiscalPeriod.getEndDate()));
- } catch (BeginAfterEndFiscalPeriodException e) {
- result.append("Can't import " + t("lima-business.import.FiscalPeriod.error.beginAfterEndFiscalPeriod"));
- } catch (MoreOneUnlockFiscalPeriodException e) {
- result.append("Can't import " + t("lima-business.import.FiscalPeriod.error.moreOneUnlockFiscalPeriod"));
- } catch (NotBeginNextDayOfLastFiscalPeriodException e) {
- result.append("Can't import " + t("lima-business.import.FiscalPeriod.error.notBeginNextDayOfLastFiscalPeriod"));
- }
- }
- return result.toString();
- }
-
- /**
- * @throws ParseException
- * @throws TopiaException
- * @deprecated do only one method import without bean use (and remove beans)
- */
- @Deprecated
- protected String updateClosedPeriodicEntryBooks(
- List<ClosedPeriodicEntryBookImport> closedPeriodicEntryBooks) {
- StringBuilder result = new StringBuilder();
-
- for (ClosedPeriodicEntryBookImport closedPeriodicEntryBookImport : closedPeriodicEntryBooks) {
- // update closedPeriodicEntryBook
- try {
- Date beginDateFinancialPeriod = SDATEFORMAT
- .parse(closedPeriodicEntryBookImport
- .getBeginDateFinancialPeriod());
- Date endDateFinancialPeriod = SDATEFORMAT
- .parse(closedPeriodicEntryBookImport
- .getEndDateFinancialPeriod());
- FinancialPeriod financialPeriod = financialPeriodService.getFinancialPeriodByNaturalIds(beginDateFinancialPeriod, endDateFinancialPeriod);
-
- String codeEntryBook = closedPeriodicEntryBookImport
- .getCodeEntryBook();
- EntryBook entryBook = entryBookService.getEntryBookByCode(codeEntryBook);
- ClosedPeriodicEntryBook closedPeriodicEntryBook = closedPeriodicEntryBookService.getByEntryBookAndFinancialPeriod(entryBook,
- financialPeriod);
-
- financialPeriodService
- .blockClosedPeriodicEntryBook(closedPeriodicEntryBook);
- result.append(t("lima-business.import.closedperiodicentrybookupdated",
- beginDateFinancialPeriod, endDateFinancialPeriod, codeEntryBook));
- } catch (ParseException e) {
- result.append(t("lima-business.common.failed", e.getMessage()));
- } catch (UnbalancedFinancialTransactionsException e) {
- result.append(t("lima-business.common.failed", t("lima-business.import.closedPeriodicEntryBook.error.unbalanced")));
- } catch (UnfilledEntriesException e) {
- result.append(t("lima-business.common.failed", t("lima-business.import.closedPeriodicEntryBook.error.unfilled")));
- } catch (WithoutEntryBookFinancialTransactionsException e) {
- result.append(t("lima-business.common.failed", t("lima-business.import.closedPeriodicEntryBook.error.withoutEntryBook")));
- } catch (NotLockedClosedPeriodicEntryBooksException e) {
- result.append(t("lima-business.common.failed", t("lima-business.import.closedPeriodicEntryBook.error.NotLockedPreviousEntryBook")));
- }
- }
-
- return result.toString();
- }
-
- /**
- * @deprecated do only one method import without bean use (and remove beans)
- */
- @Deprecated
- protected String createFinancialTransactionsAndEntries(
- Map<Integer, FinancialTransactionImport> financialTransactions,
- Map<Integer, List<EntryImport>> entries) {
-
- StringBuilder result = new StringBuilder();
-
- for (Map.Entry<Integer, FinancialTransactionImport> map : financialTransactions
- .entrySet()) {
- try {
- FinancialTransactionImport financialTransactionImport = map
- .getValue();
- FinancialTransaction financialTransaction = new FinancialTransactionImpl();
- Date dateFinancialTransaction = null;
-
- dateFinancialTransaction = SDATEFORMAT
- .parse(financialTransactionImport.getDate());
- financialTransaction
- .setTransactionDate(dateFinancialTransaction);
-
- EntryBook entryBook = entryBookService.getEntryBookByCode(financialTransactionImport
- .getCodeEntryBook());
- financialTransaction.setEntryBook(entryBook);
-
- financialTransactionService.createFinancialTransaction(financialTransaction);
-
- List<EntryImport> entryImports = entries.get(map.getKey());
- for (EntryImport entryImport : entryImports) {
- Entry entry = new EntryImpl();
- Account account = accountService.getAccountByNumber(entryImport.getAccount());
- entry.setAccount(account);
- entry.setDescription(StringUtils.trimToNull(entryImport.getDescription()));
- entry.setAmount(new BigDecimal(entryImport.getAmount()));
- entry.setDebit(Boolean.parseBoolean(entryImport.getDebit()));
- entry.setLettering(StringUtils.trimToNull(entryImport.getLettering()));
- entry.setDetail(StringUtils.trimToNull(entryImport.getDetail()));
- entry.setVoucher(StringUtils.trimToNull(entryImport.getVoucher()));
- entry.setPosition(StringUtils.trimToNull(entryImport.getPosition()));
- entryService.createEntry(entry);
- financialTransaction.addEntry(entry);
- }
- } catch (ParseException e) {
- result.append(t("lima-business.common.failed", e.getMessage()));
- } catch (LockedFinancialPeriodException e) {
- result.append(t("lima-business.common.failed", t("lima-business.import.FinancialTransaction.error.LockedFinancialPeriod")));
- } catch (LockedEntryBookException e) {
- result.append(t("lima-business.common.failed", t("lima-business.import.FinancialTransaction.error.LockedEntryBook")));
- }
-
- }
- return result.toString();
- }
-
protected String importIdentity(String[] nextLine) {
StringBuilder result = new StringBuilder();
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/NewExportServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/NewExportServiceImpl.java 2014-07-31 08:38:23 UTC (rev 3879)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/NewExportServiceImpl.java 2014-07-31 12:01:23 UTC (rev 3880)
@@ -35,12 +35,14 @@
import org.chorem.lima.business.api.FinancialStatementService;
import org.chorem.lima.business.api.FinancialTransactionService;
import org.chorem.lima.business.api.NewExportService;
+import org.chorem.lima.business.api.VatStatementService;
import org.chorem.lima.business.ejb.csv.AccountModel;
import org.chorem.lima.business.ejb.csv.EntryBookModel;
import org.chorem.lima.business.ejb.csv.EntryModel;
import org.chorem.lima.business.ejb.csv.FinancialStatementModel;
import org.chorem.lima.business.ejb.csv.FinancialTransactionModel;
import org.chorem.lima.business.ejb.csv.FiscalPeriodModel;
+import org.chorem.lima.business.ejb.csv.VatStatementModel;
import org.chorem.lima.entity.Account;
import org.chorem.lima.entity.AccountTopiaDao;
import org.chorem.lima.entity.Entry;
@@ -52,6 +54,7 @@
import org.chorem.lima.entity.FinancialTransactionTopiaDao;
import org.chorem.lima.entity.FiscalPeriod;
import org.chorem.lima.entity.FiscalPeriodTopiaDao;
+import org.chorem.lima.entity.VatStatement;
import org.nuiton.csv.Export;
import javax.ejb.EJB;
@@ -93,6 +96,9 @@
@EJB
protected FinancialStatementService financialStatementService;
+ @EJB
+ protected VatStatementService vatStatementService;
+
public static final String JAVA_IO_TMPDIR = "java.io.tmpdir";
@Override
@@ -249,10 +255,10 @@
}
@Override
- public String exportFinancialStatement(String charset) throws Exception {
+ public String exportFinancialStatements(String charset) throws Exception {
String stResult = null;
String tmpDir = System.getProperty(JAVA_IO_TMPDIR)+"/";
- File fileResult = new File(tmpDir + "masterFinancialStatements.csv");
+ File fileResult = new File(tmpDir + "financialStatements.csv");
List<FinancialStatement> rootFinancialStatements = financialStatementService.getRootFinancialStatements();
if (rootFinancialStatements != null) {
@@ -277,4 +283,32 @@
return result;
}
+ @Override
+ public String exportVatStatements(String charset) throws Exception {
+ String stResult = null;
+ String tmpDir = System.getProperty(JAVA_IO_TMPDIR)+"/";
+ File fileResult = new File(tmpDir + "vatStatements.csv");
+
+ 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);
+
+ }
+ return stResult;
+ }
+
+ public List<VatStatement> getAllSubVATStatements(List<VatStatement> result, Collection<VatStatement> subVATStatements) {
+ if (subVATStatements != null) {
+ for (VatStatement subVATStatement : subVATStatements) {
+ result.add(subVATStatement);
+ getAllSubVATStatements(result, subVATStatement.getSubVatStatements());
+ }
+ }
+ return result;
+ }
}
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/NewImportServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/NewImportServiceImpl.java 2014-07-31 08:38:23 UTC (rev 3879)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/NewImportServiceImpl.java 2014-07-31 12:01:23 UTC (rev 3880)
@@ -26,8 +26,10 @@
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
import org.chorem.lima.beans.FinancialStatementImport;
+import org.chorem.lima.beans.VatStatementImport;
import org.chorem.lima.business.AlreadyExistAccountException;
-import org.chorem.lima.business.AlreadyExistFinancialTransaction;
+import org.chorem.lima.business.AlreadyExistFinancialStatement;
+import org.chorem.lima.business.AlreadyExistVatStatement;
import org.chorem.lima.business.FiscalPeriodException;
import org.chorem.lima.business.ImportResult;
import org.chorem.lima.business.InvalidAccountNumberException;
@@ -42,18 +44,21 @@
import org.chorem.lima.business.api.FinancialTransactionService;
import org.chorem.lima.business.api.FiscalPeriodService;
import org.chorem.lima.business.api.NewImportService;
+import org.chorem.lima.business.api.VatStatementService;
import org.chorem.lima.business.ejb.csv.AccountModel;
import org.chorem.lima.business.ejb.csv.EntryBookModel;
import org.chorem.lima.business.ejb.csv.EntryModel;
import org.chorem.lima.business.ejb.csv.FinancialStatementModel;
import org.chorem.lima.business.ejb.csv.FinancialTransactionModel;
import org.chorem.lima.business.ejb.csv.FiscalPeriodModel;
+import org.chorem.lima.business.ejb.csv.VatStatementModel;
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.VatStatement;
import org.nuiton.csv.Import;
import org.nuiton.csv.ImportModel;
import org.nuiton.util.beans.Binder;
@@ -95,6 +100,9 @@
@EJB
protected FinancialStatementService financialStatementService;
+ @EJB
+ protected VatStatementService vatStatementService;
+
protected static final Predicate<FinancialStatement> IS_ROOT_FINANCIAL_STATEMENT = new Predicate<FinancialStatement>() {
@Override
@@ -229,7 +237,7 @@
return result;
}
- protected FinancialStatement returnFinancialStatement (FinancialStatement rootFinancialStatement, String subFinancialStatementLabel) throws AlreadyExistFinancialTransaction, NotAllowedLabel {
+ protected FinancialStatement returnFinancialStatement (FinancialStatement rootFinancialStatement, String subFinancialStatementLabel) throws AlreadyExistFinancialStatement, NotAllowedLabel {
Collection<FinancialStatement> subFinancialStatements = rootFinancialStatement.getSubFinancialStatements();
FinancialStatement targetedFinancialStatement = null;
@@ -342,6 +350,7 @@
Binder<FinancialStatement, FinancialStatement> rootBinder = BinderFactory.newBinder(FinancialStatement.class, FinancialStatement.class);
rootBinder.copyExcluding(bfs, financialStatement, FinancialStatement.PROPERTY_SUB_FINANCIAL_STATEMENTS);
alreadyCreated = true;
+ break;
}
}
}
@@ -361,7 +370,7 @@
}
result.increaseCreated();
lineIndex++;
- } catch (AlreadyExistFinancialTransaction e) {
+ } catch (AlreadyExistFinancialStatement e) {
result.getException().addException(lineIndex, e);
} catch (NotAllowedLabel e) {
result.getException().addException(lineIndex, e);
@@ -374,7 +383,153 @@
return result;
}
+ protected VatStatement returnVATStatement (VatStatement rootVATStatement, String subVATStatementLabel) throws AlreadyExistVatStatement, NotAllowedLabel {
+ Collection<VatStatement> subVatStatements = rootVATStatement.getSubVatStatements();
+ VatStatement targetedVATStatement = null;
+
+ // look for vatStatement from tree range
+ if (subVatStatements != null) {
+ for (VatStatement subVatStatement : subVatStatements) {
+ if(subVatStatement.getLabel().equals(subVATStatementLabel)){
+ targetedVATStatement = subVatStatement;
+ break;
+ }
+ }
+ }
+
+ //
+ if (targetedVATStatement == null) {
+ // not found, we need to create it
+ targetedVATStatement = vatStatementService.newVatStatement();
+ targetedVATStatement.setLabel(subVATStatementLabel);
+ // create targetedVATStatement and rootVATStatement if needed
+ targetedVATStatement = vatStatementService.createVatStatement(rootVATStatement, targetedVATStatement);
+ targetedVATStatement.getMasterVatStatement();
+ }
+ return targetedVATStatement;
+ }
+
+ protected VatStatement returnRootVATStatement(VatStatement vatStatement) {
+ VatStatement rootVatStatement = null;
+ while (rootVatStatement == null) {
+ if (vatStatement.getMasterVatStatement() == null){
+ rootVatStatement = vatStatement;
+ } else {
+ vatStatement = vatStatement.getMasterVatStatement();
+ }
+ }
+ return rootVatStatement;
+ }
+
@Override
+ public ImportResult importVATStatementsAsCSV(String contents) {
+ ImportResult result = new ImportResult();
+
+ // import and save VATStatements
+ InputStream contentStream = IOUtils.toInputStream(contents);
+ try {
+ ImportModel<VatStatementImport> model = new VatStatementModel();
+
+ Import<VatStatementImport> vatStatementImports = Import.newImport(model, contentStream);
+
+ // path, vatStatement
+ Map<String, VatStatement> orderedVATStatements = new HashMap<>();
+
+ List<VatStatement> rootVatStatements = vatStatementService.getRootVatStatements();
+ for (VatStatement vatStatement : rootVatStatements) {
+ orderedVATStatements.put(vatStatement.getLabel(), vatStatement);
+ }
+
+ int lineIndex = 0;
+ 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();
+
+ 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);
+ } 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];
+
+ 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);
+ }
+
+ // 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;
+ }
+ }
+ }
+
+ // 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);
+ }
+ }
+
+ }
+ result.increaseCreated();
+ lineIndex++;
+ } catch (AlreadyExistVatStatement e) {
+ result.getException().addException(lineIndex, e);
+ } catch (NotAllowedLabel e) {
+ result.getException().addException(lineIndex, e);
+ }
+ }
+
+ } finally {
+ IOUtils.closeQuietly(contentStream);
+ }
+ return result;
+ }
+
+ @Override
public List<ImportResult> importBackup(String entryBooks, String financialTransactions, String fiscalPeriods, String accounts, String entries) throws AlreadyExistAccountException, InvalidAccountNumberException {
List<ImportResult> results = new ArrayList<ImportResult>();
importAccountAsCSV(accounts);
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-07-31 08:38:23 UTC (rev 3879)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/VatStatementServiceImpl.java 2014-07-31 12:01:23 UTC (rev 3880)
@@ -24,18 +24,25 @@
*/
package org.chorem.lima.business.ejb;
+import com.google.common.base.Function;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
import org.chorem.lima.beans.ReportsDatas;
import org.chorem.lima.beans.VatStatementAmounts;
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.entity.Account;
import org.chorem.lima.entity.VatStatement;
import org.chorem.lima.entity.VatStatementTopiaDao;
+import org.nuiton.util.beans.Binder;
+import org.nuiton.util.beans.BinderFactory;
import javax.ejb.EJB;
import javax.ejb.Remote;
@@ -43,8 +50,10 @@
import javax.ejb.TransactionAttribute;
import java.math.BigDecimal;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.Date;
import java.util.List;
+import java.util.Map;
/**
* Permet d'implémenter le plan de la déclaration de TVA
@@ -62,25 +71,68 @@
@EJB
private AccountService accountService;
- @Override
- public void createVatStatement(VatStatement masterVatStatement,
- VatStatement vatStatement) {
+ protected static final Function<VatStatement, String> GET_LABEL = new Function<VatStatement, String>() {
+ @Override
+ public String apply(VatStatement input) {
+ return input == null ? null : input.getLabel();
+ }
+ };
- VatStatementTopiaDao vatStatementTopiaDao = getDaoHelper().getVatStatementDao();
+ protected void validateNewVATStatement(VatStatement masterVatStatement, VatStatement vatStatement) throws AlreadyExistVatStatement, NotAllowedLabel {
+ if (vatStatement.getLabel().contains("/")) {
+ throw new NotAllowedLabel(vatStatement.getLabel());
+ }
+ if (masterVatStatement != null) {
+ Collection<VatStatement> masterSubVatStatements = masterVatStatement.getSubVatStatements();
+ if (masterSubVatStatements == null) {
+ masterSubVatStatements = Lists.newArrayList();
+ }
+ Map indexedSubVatStatements = Maps.uniqueIndex(masterSubVatStatements, GET_LABEL);
+ if (indexedSubVatStatements.get(vatStatement.getLabel()) != null){
+ throw new AlreadyExistVatStatement(vatStatement.getLabel(), masterVatStatement.getLabel());
+ }
+ }
+ }
- vatStatementTopiaDao.create(vatStatement);
- VatStatement mastervatStatementUpdate = null;
+ protected void addVatStatementToMaster(VatStatement masterVatStatement,
+ VatStatement vatStatement) {
if (masterVatStatement != null) {
- mastervatStatementUpdate = vatStatementTopiaDao.forLabelEquals(masterVatStatement.getLabel()).findUniqueOrNull();
+ VatStatementTopiaDao vatStatementTopiaDao = getDaoHelper().getVatStatementDao();
+
+ masterVatStatement.addSubVatStatements(vatStatement);
+
+ if (masterVatStatement.isPersisted()) {
+ // update the persisted entity to avoid NonUniqueObjectException: A different object with the same identifier value was already associated with the session
+ VatStatement vatStatementToUpdate = vatStatementTopiaDao.forTopiaIdEquals(masterVatStatement.getTopiaId()).findUnique();
+ Binder<VatStatement, VatStatement> binder = BinderFactory.newBinder(VatStatement.class, VatStatement.class);
+ binder.copy(masterVatStatement, vatStatementToUpdate);
+ vatStatementTopiaDao.update(vatStatementToUpdate);
+ } else {
+ vatStatementTopiaDao.create(masterVatStatement);
+ }
}
+ }
- // check if parent account exist;
- if (mastervatStatementUpdate != null) {
- mastervatStatementUpdate.addSubVatStatements(vatStatement);
- vatStatementTopiaDao.update(mastervatStatementUpdate);
+
+ @Override
+ public VatStatement createVatStatement(VatStatement masterVatStatement,
+ VatStatement vatStatement) throws AlreadyExistVatStatement, NotAllowedLabel {
+
+ validateNewVATStatement(masterVatStatement, vatStatement);
+
+ VatStatementTopiaDao vatStatementTopiaDao = getDaoHelper().getVatStatementDao();
+
+ VatStatement result;
+ if (!vatStatement.isPersisted()) {
+ result = vatStatementTopiaDao.create(vatStatement);
+ } else {
+ result = vatStatement;
}
+ addVatStatementToMaster(masterVatStatement, result);
+
+ return result;
}
@Override
@@ -271,8 +323,8 @@
// remove vatstatement
VatStatement vatStatementToDelete =
- vatStatementTopiaDao.findByTopiaId(
- vatStatement.getTopiaId());
+ vatStatementTopiaDao.forTopiaIdEquals(
+ vatStatement.getTopiaId()).findUnique();
vatStatementTopiaDao.delete(vatStatementToDelete);
//get all subVatStatement
@@ -284,8 +336,8 @@
if (vatStatements.size() > 0) {
for (VatStatement subVatStatement : vatStatements) {
VatStatement subVatStatementToDelete =
- vatStatementTopiaDao.findByTopiaId(
- subVatStatement.getTopiaId());
+ vatStatementTopiaDao.forTopiaIdEquals(
+ subVatStatement.getTopiaId()).findUnique();
vatStatementTopiaDao.delete(subVatStatementToDelete);
}
}
@@ -306,4 +358,22 @@
removeVatStatement(vatStatement);
}
}
+
+ @Override
+ public List<VatStatement> getRootVatStatements() {
+ VatStatementTopiaDao vatStatementTopiaDao = getDaoHelper().getVatStatementDao();
+
+ List<VatStatement> result = vatStatementTopiaDao
+ .forMasterVatStatementEquals(null)
+ .setOrderByArguments(VatStatement.PROPERTY_TOPIA_CREATE_DATE)
+ .findAll();
+ return result;
+ }
+
+ @Override
+ public VatStatement newVatStatement() {
+ VatStatementTopiaDao vatStatementTopiaDao = getDaoHelper().getVatStatementDao();
+ VatStatement result = vatStatementTopiaDao.newInstance();
+ return result;
+ }
}
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/csv/AbstractLimaModel.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/csv/AbstractLimaModel.java 2014-07-31 08:38:23 UTC (rev 3879)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/csv/AbstractLimaModel.java 2014-07-31 12:01:23 UTC (rev 3880)
@@ -33,6 +33,7 @@
import org.chorem.lima.entity.EntryBook;
import org.chorem.lima.entity.FinancialStatement;
import org.chorem.lima.entity.FinancialTransaction;
+import org.chorem.lima.entity.VatStatement;
import org.nuiton.csv.ValueFormatter;
import org.nuiton.csv.ValueParser;
import org.nuiton.csv.ext.AbstractImportModel;
@@ -355,17 +356,31 @@
}
};
- protected static final ValueFormatter<FinancialStatement> MASTER_FINANCIAL_STATEMENT_TO_MASTER_FINANCIAL_STATEMENT_LABEL_FORMATTER = new ValueFormatter<FinancialStatement>() {
+ protected static final ValueFormatter<FinancialStatement> MASTER_FINANCIAL_STATEMENT_PATH_FORMATTER = new ValueFormatter<FinancialStatement>() {
@Override
public String format(FinancialStatement value) {
- String result = value == null ? "" : getFullPath(value);
+ String result = value == null ? "" : getFinancialStatementFullPath(value);
return result;
}
};
- protected static final String getFullPath(FinancialStatement value) {
- String result = value.getMasterFinancialStatement() != null ? getFullPath(value.getMasterFinancialStatement()) + "/" + value.getLabel() : value.getLabel();
+ protected static final String getFinancialStatementFullPath(FinancialStatement value) {
+ String result = value.getMasterFinancialStatement() != null ? getFinancialStatementFullPath(value.getMasterFinancialStatement()) + "/" + value.getLabel() : value.getLabel();
return result;
}
+
+ protected static final String getVatFullPath(VatStatement value) {
+ String result = value.getMasterVatStatement() != null ? getVatFullPath(value.getMasterVatStatement()) + "/" + value.getLabel() : value.getLabel();
+ return result;
+ }
+
+ protected static final ValueFormatter<VatStatement> MASTER_VAT_PATH_FORMATTER = new ValueFormatter<VatStatement>() {
+
+ @Override
+ public String format(VatStatement value) {
+ String result = value == null ? "" : getVatFullPath(value);
+ return result;
+ }
+ };
}
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/csv/FinancialStatementModel.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/csv/FinancialStatementModel.java 2014-07-31 08:38:23 UTC (rev 3879)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/csv/FinancialStatementModel.java 2014-07-31 12:01:23 UTC (rev 3880)
@@ -3,7 +3,6 @@
import org.chorem.lima.beans.FinancialStatementImport;
import org.chorem.lima.beans.FinancialStatementImportImpl;
import org.chorem.lima.entity.FinancialStatement;
-import org.chorem.lima.entity.FinancialStatementImpl;
import org.nuiton.csv.ExportModel;
import org.nuiton.csv.ExportableColumn;
import org.nuiton.csv.ModelBuilder;
@@ -39,15 +38,13 @@
modelBuilder.newColumnForExport("provisionDeprecationAccounts", FinancialStatement.PROPERTY_PROVISION_DEPRECATION_ACCOUNTS);
modelBuilder.newColumnForExport("subAmount", FinancialStatement.PROPERTY_SUB_AMOUNT, O_N_FORMATTER);
modelBuilder.newColumnForExport("headerAmount", FinancialStatement.PROPERTY_HEADER_AMOUNT,O_N_FORMATTER);
- modelBuilder.newColumnForExport("masterFinancialStatement", FinancialStatement.PROPERTY_MASTER_FINANCIAL_STATEMENT, MASTER_FINANCIAL_STATEMENT_TO_MASTER_FINANCIAL_STATEMENT_LABEL_FORMATTER);
+ modelBuilder.newColumnForExport("masterFinancialStatement", FinancialStatement.PROPERTY_MASTER_FINANCIAL_STATEMENT, MASTER_FINANCIAL_STATEMENT_PATH_FORMATTER);
modelBuilder.newColumnForExport("financialStatementWay", FinancialStatement.PROPERTY_WAY, FINANCIAL_STATEMENT_WAY_ENUM_VALUE_FORMATTER);
return (Iterable) modelBuilder.getColumnsForExport();
}
@Override
public FinancialStatementImport newEmptyInstance() {
- FinancialStatementImpl financialStatement = new FinancialStatementImpl();
-// allFinancialStatements.add(financialStatement);
return new FinancialStatementImportImpl();
}
}
Copied: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/csv/VatStatementModel.java (from rev 3875, trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/csv/FinancialStatementModel.java)
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/csv/VatStatementModel.java (rev 0)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/csv/VatStatementModel.java 2014-07-31 12:01:23 UTC (rev 3880)
@@ -0,0 +1,41 @@
+package org.chorem.lima.business.ejb.csv;
+
+import org.chorem.lima.beans.VatStatementImport;
+import org.chorem.lima.beans.VatStatementImportImpl;
+import org.chorem.lima.entity.VatStatement;
+import org.nuiton.csv.ExportModel;
+import org.nuiton.csv.ExportableColumn;
+import org.nuiton.csv.ModelBuilder;
+
+/**
+ * Created by davidcosse on 28/07/14.
+ */
+public class VatStatementModel extends AbstractLimaModel<VatStatementImport> implements ExportModel<VatStatement> {
+
+ public VatStatementModel() {
+ super(';');
+ newMandatoryColumn("label", VatStatement.PROPERTY_LABEL);
+ newOptionalColumn("header", VatStatement.PROPERTY_HEADER, O_N_PARSER);
+ newOptionalColumn("accounts", VatStatement.PROPERTY_ACCOUNTS);
+ newOptionalColumn("boxName", VatStatement.PROPERTY_BOX_NAME);
+ newOptionalColumn("masterVATStatement", VatStatement.PROPERTY_MASTER_VAT_STATEMENT);
+ }
+
+ @Override
+ public Iterable<ExportableColumn<VatStatement, Object>> getColumnsForExport() {
+ ModelBuilder<VatStatement> modelBuilder = new ModelBuilder<>();
+
+ modelBuilder.newColumnForExport("label", VatStatement.PROPERTY_LABEL);
+ modelBuilder.newColumnForExport("header", VatStatement.PROPERTY_HEADER, O_N_FORMATTER);
+ modelBuilder.newColumnForExport("accounts", VatStatement.PROPERTY_ACCOUNTS);
+ modelBuilder.newColumnForExport("boxName", VatStatement.PROPERTY_BOX_NAME);
+ modelBuilder.newColumnForExport("masterVATStatement", VatStatement.PROPERTY_MASTER_VAT_STATEMENT, MASTER_VAT_PATH_FORMATTER);
+ return (Iterable) modelBuilder.getColumnsForExport();
+ }
+
+ @Override
+ public VatStatementImport newEmptyInstance() {
+ VatStatementImport vatStatementImport = new VatStatementImportImpl();
+ return vatStatementImport;
+ }
+}
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-07-31 08:38:23 UTC (rev 3879)
+++ trunk/lima-business/src/test/java/org/chorem/lima/business/AbstractLimaTest.java 2014-07-31 12:01:23 UTC (rev 3880)
@@ -39,6 +39,7 @@
import org.chorem.lima.business.api.NewExportService;
import org.chorem.lima.business.api.NewImportService;
import org.chorem.lima.business.api.ReportService;
+import org.chorem.lima.business.api.VatStatementService;
import org.chorem.lima.entity.Account;
import org.chorem.lima.entity.AccountImpl;
import org.chorem.lima.entity.Entry;
@@ -99,6 +100,7 @@
protected NewImportService newImportService;
protected NewExportService newExportService;
protected FinancialStatementService financialStatementService;
+ protected VatStatementService vatStatementService;
protected LimaCallaoTopiaApplicationContext context;
@@ -137,6 +139,7 @@
importService = LimaServiceFactory.getService(ImportService.class);
entryService = LimaServiceFactory.getService(EntryService.class);
financialStatementService = LimaServiceFactory.getService(FinancialStatementService.class);
+ vatStatementService = LimaServiceFactory.getService(VatStatementService.class);
newImportService = LimaServiceFactory.getService(NewImportService.class);
newExportService = LimaServiceFactory.getService(NewExportService.class);
Modified: trunk/lima-business/src/test/java/org/chorem/lima/business/ImportServiceImplTest.java
===================================================================
--- trunk/lima-business/src/test/java/org/chorem/lima/business/ImportServiceImplTest.java 2014-07-31 08:38:23 UTC (rev 3879)
+++ trunk/lima-business/src/test/java/org/chorem/lima/business/ImportServiceImplTest.java 2014-07-31 12:01:23 UTC (rev 3880)
@@ -24,7 +24,6 @@
package org.chorem.lima.business;
import org.apache.commons.io.IOUtils;
-import org.chorem.lima.business.utils.ImportExportEntityEnum;
import org.chorem.lima.entity.Account;
import org.chorem.lima.entity.FiscalPeriod;
import org.chorem.lima.entity.FiscalPeriodImpl;
@@ -125,42 +124,4 @@
Assert.assertNotNull(employeAccount);
}
- /**
- * Do some test on imported accounts.
- *
- * @throws Exception
- */
- @Test
- public void testImportEntryBookEBP() throws Exception {
- importEBPData();
-
- Assert.assertNotNull(entryBookService.getEntryBookByCode("AN"));
- Assert.assertNotNull(entryBookService.getEntryBookByCode("BQ"));
- }
-
- /**
- * Test que les import csv fourni avec lima s'import bien.
- * @throws Exception
- */
- @Test
- public void testImportCSVPCG() throws Exception {
- createNewTestContext().createSchema();
-
- String pcg = IOUtils.toString(ImportServiceImplTest.class.getResourceAsStream("/import/pcg_base.csv"));
- importService.importAsCSV(pcg, ImportExportEntityEnum.ACCOUNT);
- Assert.assertEquals(461, accountService.getAccountCount());
- }
-
- /**
- * Test que les import csv fourni avec lima s'import bien.
- * @throws Exception
- */
- @Test
- public void testImportCSVEb() throws Exception {
- createNewTestContext().createSchema();
-
- String pcg = IOUtils.toString(ImportServiceImplTest.class.getResourceAsStream("/import/eb_default.csv"));
- importService.importAsCSV(pcg, ImportExportEntityEnum.ENTRYBOOK);
- Assert.assertEquals(5, entryBookService.getAllEntryBooks().size());
- }
}
Modified: trunk/lima-business/src/test/java/org/chorem/lima/business/NewImportExportServiceTest.java
===================================================================
--- trunk/lima-business/src/test/java/org/chorem/lima/business/NewImportExportServiceTest.java 2014-07-31 08:38:23 UTC (rev 3879)
+++ trunk/lima-business/src/test/java/org/chorem/lima/business/NewImportExportServiceTest.java 2014-07-31 12:01:23 UTC (rev 3880)
@@ -317,4 +317,19 @@
subFinancialStatements = bilanActifStatement.getSubFinancialStatements();
Assert.assertEquals(6, subFinancialStatements.size());
}
+
+ //vat_shortened.csv
+ @Test
+ public void testImportVATStatementsAsCSV() throws Exception {
+ // not ordered csv import file
+ String bcr_developed = IOUtils.toString(ImportServiceImplTest.class.getResourceAsStream("/import/vat_shortened.csv"));
+
+ ImportResult result;
+
+ result = newImportService.importVATStatementsAsCSV(bcr_developed);
+
+ Assert.assertTrue(result.getException().getAllExceptionsByLine().isEmpty());
+ Assert.assertEquals(55, result.getNbCreated());
+ Assert.assertEquals(55, vatStatementService.getAllVatStatements().size());
+ }
}
Added: trunk/lima-business/src/test/resources/import/vat_shortened.csv
===================================================================
--- trunk/lima-business/src/test/resources/import/vat_shortened.csv (rev 0)
+++ trunk/lima-business/src/test/resources/import/vat_shortened.csv 2014-07-31 12:01:23 UTC (rev 3880)
@@ -0,0 +1,56 @@
+label;header;accounts;boxName;masterVATStatement
+OPERATIONS IMPOSABLES (H.T.);O;;;A. MONTANT DES OPERATIONS REALISEES
+Acquisitions intracommunautaires;N;;b4.b4;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)
+Livraisons de gaz naturel ou d'électricité imposables en France;N;;b5.b5;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)
+Achats de biens ou de prestations de services réalisées auprès d'un assujetti non établi en France;N;;b6.b6;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)
+Régularisations (imposables);N;;b7.b7;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)
+"Ventes, prestations de services";N;;b1.b1;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)
+B. DECOMPTE DE LA TVA A PAYER;O;;;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services"
+TVA BRUTE;O;;;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER"
+Opérations réalisées en France métropolitaine;O;;;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE"
+"Taux normal 19,6% (Base hors taxe)";N;;b15.b15;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE/Opérations réalisées en France métropolitaine"
+"Taux normal 19,6% (Taxe due)";N;;b23.b23;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE/Opérations réalisées en France métropolitaine"
+"Taux réduit 5,5% (Base hors taxe)";N;;b16.b16;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE/Opérations réalisées en France métropolitaine"
+"Taux réduit 5,5% (Taxe due)";N;;b24.b24;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE/Opérations réalisées en France métropolitaine"
+Opérations réalisées dans les DOM;O;;;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE"
+"Taux normal 8,5% (Base hors taxe)";N;;b18.b18;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE/Opérations réalisées dans les DOM"
+"Taux normal 8,5% (Taxe due)";N;;b26.b26;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE/Opérations réalisées dans les DOM"
+"Taux réduit 2,1% (Base hors taxe)";N;;b19.b19;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE/Opérations réalisées dans les DOM"
+"Taux réduit 2,1% (Taxe due)";N;;b27.b27;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE/Opérations réalisées dans les DOM"
+Opérations imposables à un autre taux (France métropolitaine ou DOM);O;;;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE"
+Ancien taux (Base hors taxe);N;;b21.b21;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE/Opérations imposables à un autre taux (France métropolitaine ou DOM)"
+Ancien taux (Taxe due);N;;b29.b29;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE/Opérations imposables à un autre taux (France métropolitaine ou DOM)"
+Opérations imposables à un taux particulier (Base hors taxe);N;;b22.b22;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE/Opérations imposables à un autre taux (France métropolitaine ou DOM)"
+Opérations imposables à un taux particulier (Taxe due);N;;b30.b30;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE/Opérations imposables à un autre taux (France métropolitaine ou DOM)"
+TVA antérieurement déduite à reverser;N;;b31.b31;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE"
+Total de le TVA brute due;N;;b32.b32;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE"
+Dont TVA sur acquisitions intracommunautaires;N;;b33.b33;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE"
+Dont TVA sur opérations à destination de Monaco;N;;b34.b34;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE"
+TVA DEDUCTIBLE;O;;;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER"
+Biens constituant des immobilisations;N;;b35.b35;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA DEDUCTIBLE"
+Autres biens et services;N;;b36.b36;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA DEDUCTIBLE"
+Autre TVA à déduire;N;;b37.b37;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA DEDUCTIBLE"
+Report du crédit apparaissant ligne 27 de la précédente déclaration;N;;b38.b38;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA DEDUCTIBLE"
+Total TVA déductible;N;;total1.total1;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA DEDUCTIBLE"
+Dont TVA non perçue récupérable par les assujettis disposant d'un établissement stable dans les DOM;N;;b39.b39;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA DEDUCTIBLE"
+Autres opérations imposables;N;;b2.b2;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)
+CREDIT;O;;;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Autres opérations imposables
+Crédit de TVA;N;;b40.b40;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Autres opérations imposables/CREDIT
+Remboursement demandé sur formulaire n°3519;N;;b41.b41;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Autres opérations imposables/CREDIT
+Crédit à reporter;N;;b42.b42;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Autres opérations imposables/CREDIT
+Achats de prestations de services intracommunautaires;N;;b3.b3;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)
+TAXE A PAYER;O;;;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Achats de prestations de services intracommunautaires
+TVA nette due;N;;b43.b43;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Achats de prestations de services intracommunautaires/TAXE A PAYER
+Taxes assimilées calculées sur annexe n°3310 A;N;;b44.b44;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Achats de prestations de services intracommunautaires/TAXE A PAYER
+"Sommes à imputer, exprimées en euros, y compris acompte congés";N;;b45.b45;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Achats de prestations de services intracommunautaires/TAXE A PAYER
+"Sommes à ajouter, exprimées en euros, y compris acompte congés";N;;b46.b46;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Achats de prestations de services intracommunautaires/TAXE A PAYER
+Total à payer;N;;b47.b47;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Achats de prestations de services intracommunautaires/TAXE A PAYER
+OPERATIONS NON IMPOSABLES;O;;;A. MONTANT DES OPERATIONS REALISEES
+Exportations hors CE;N;;b8.b8;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS NON IMPOSABLES
+Autres opérations non imposables;N;;b9.b9;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS NON IMPOSABLES
+Livraisons intracommunautaires;N;;b10.b10;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS NON IMPOSABLES
+Livraisons de gaz naturel ou d'électricité non imposables en France;N;;b11.b11;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS NON IMPOSABLES
+Achats de franchise;N;;b12.b12;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS NON IMPOSABLES
+Ventes de biens ou prestations de services réalisées aurpès d'un assujetti non établi en France;N;;b13.b13;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS NON IMPOSABLES
+Régularisations (non imposables);N;;b14.b14;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS NON IMPOSABLES
+A. MONTANT DES OPERATIONS REALISEES;O;;;
Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/AlreadyExistFinancialStatement.java (from rev 3879, trunk/lima-business-api/src/main/java/org/chorem/lima/business/AlreadyExistFinancialTransaction.java)
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/AlreadyExistFinancialStatement.java (rev 0)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/AlreadyExistFinancialStatement.java 2014-07-31 12:01:23 UTC (rev 3880)
@@ -0,0 +1,24 @@
+package org.chorem.lima.business;
+
+/**
+ * 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/AlreadyExistFinancialTransaction.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/AlreadyExistFinancialTransaction.java 2014-07-31 08:38:23 UTC (rev 3879)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/AlreadyExistFinancialTransaction.java 2014-07-31 12:01:23 UTC (rev 3880)
@@ -1,24 +0,0 @@
-package org.chorem.lima.business;
-
-/**
- * Created by davidcosse on 28/07/14.
- */
-public class AlreadyExistFinancialTransaction extends LimaException {
- private static final long serialVersionUID = 4816249386192290272L;
-
- protected String financialTransactionLabel;
- protected String masterLabel;
-
- public AlreadyExistFinancialTransaction(String label, String masterLabel) {
- this.financialTransactionLabel = label;
- this.masterLabel = masterLabel;
- }
-
- public String getFinancialTransactionLabel() {
- return financialTransactionLabel;
- }
-
- public String getMasterLabel() {
- return masterLabel;
- }
-}
Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/AlreadyExistVatStatement.java (from rev 3879, trunk/lima-business-api/src/main/java/org/chorem/lima/business/AlreadyExistFinancialTransaction.java)
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/AlreadyExistVatStatement.java (rev 0)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/AlreadyExistVatStatement.java 2014-07-31 12:01:23 UTC (rev 3880)
@@ -0,0 +1,24 @@
+package org.chorem.lima.business;
+
+/**
+ * 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) {
+ this.vatStatementLabel = label;
+ this.masterLabel = masterLabel;
+ }
+
+ public String getVatStatementLabel() {
+ return vatStatementLabel;
+ }
+
+ public String getMasterLabel() {
+ return masterLabel;
+ }
+}
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-07-31 08:38:23 UTC (rev 3879)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialStatementService.java 2014-07-31 12:01:23 UTC (rev 3880)
@@ -26,7 +26,7 @@
package org.chorem.lima.business.api;
import org.chorem.lima.beans.FinancialStatementAmounts;
-import org.chorem.lima.business.AlreadyExistFinancialTransaction;
+import org.chorem.lima.business.AlreadyExistFinancialStatement;
import org.chorem.lima.business.LimaException;
import org.chorem.lima.business.NotAllowedLabel;
import org.chorem.lima.entity.Account;
@@ -46,7 +46,7 @@
void createMasterFinacialStatements(FinancialStatement masterFinancialStatements);
FinancialStatement createFinancialStatement(FinancialStatement masterFinancialStatement,
- FinancialStatement financialStatement) throws AlreadyExistFinancialTransaction, NotAllowedLabel;
+ FinancialStatement financialStatement) throws AlreadyExistFinancialStatement, NotAllowedLabel;
void updateFinancialStatement(FinancialStatement financialStatement);
Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/NewExportService.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/NewExportService.java 2014-07-31 08:38:23 UTC (rev 3879)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/NewExportService.java 2014-07-31 12:01:23 UTC (rev 3880)
@@ -48,5 +48,7 @@
String exportEntriesAsCSV(String charset, Boolean humanReadable);
- String exportFinancialStatement(String charset) throws Exception;
+ String exportFinancialStatements(String charset) throws Exception;
+
+ String exportVatStatements(String charset) throws Exception;
}
Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/NewImportService.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/NewImportService.java 2014-07-31 08:38:23 UTC (rev 3879)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/NewImportService.java 2014-07-31 12:01:23 UTC (rev 3880)
@@ -43,5 +43,7 @@
ImportResult importFinancialStatementsAsCSV(String contents);
+ ImportResult importVATStatementsAsCSV(String contents);
+
List<ImportResult> importBackup(String entryBooks, String transactions, String fiscalPeriods, String accounts, String entries) throws AlreadyExistAccountException, InvalidAccountNumberException;
}
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-07-31 08:38:23 UTC (rev 3879)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/VatStatementService.java 2014-07-31 12:01:23 UTC (rev 3880)
@@ -25,7 +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.entity.VatStatement;
import java.util.Date;
@@ -33,8 +35,8 @@
public interface VatStatementService {
- void createVatStatement(VatStatement masterVatStatement,
- VatStatement vatStatement);
+ VatStatement createVatStatement(VatStatement masterVatStatement,
+ VatStatement vatStatement) throws AlreadyExistVatStatement, NotAllowedLabel;
List<VatStatement> getAllVatStatements();
@@ -66,5 +68,7 @@
*/
boolean checkVatStatementExist(String label);
+ List<VatStatement> getRootVatStatements();
+ VatStatement newVatStatement();
}
\ No newline at end of file
Modified: trunk/lima-callao/src/main/xmi/accounting-model.zargo
===================================================================
(Binary files differ)
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-07-31 08:38:23 UTC (rev 3879)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartTreeTableModel.java 2014-07-31 12:01:23 UTC (rev 3880)
@@ -29,7 +29,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.LimaConfig;
-import org.chorem.lima.business.AlreadyExistFinancialTransaction;
+import org.chorem.lima.business.AlreadyExistFinancialStatement;
import org.chorem.lima.business.NotAllowedLabel;
import org.chorem.lima.business.api.FinancialStatementService;
import org.chorem.lima.entity.FinancialStatement;
@@ -213,11 +213,11 @@
try {
financialStatementService.createFinancialStatement(
parentFinancialStatementHeader, financialStatement);
- } catch (AlreadyExistFinancialTransaction alreadyExistFinancialTransaction) {
+ } catch (AlreadyExistFinancialStatement alreadyExistFinancialStatement) {
errorHelper.showErrorMessage(t("lima.importexport.import.alreadyExistFinancialStatement",
- alreadyExistFinancialTransaction.getFinancialTransactionLabel(), alreadyExistFinancialTransaction.getMasterLabel()));
+ alreadyExistFinancialStatement.getFinancialStatementLabel(), alreadyExistFinancialStatement.getMasterLabel()));
} catch (NotAllowedLabel notAllowedLabel) {
- errorHelper.showErrorMessage(t("lima.importexport.import.alreadyExistFinancialStatement",
+ errorHelper.showErrorMessage(t("lima.financialstatement.notAllowedLabel",
notAllowedLabel.getLabel()));
}
modelSupport.fireTreeStructureChanged(path);
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-07-31 08:38:23 UTC (rev 3879)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java 2014-07-31 12:01:23 UTC (rev 3880)
@@ -46,16 +46,8 @@
import org.chorem.lima.util.ErrorHelper;
import org.jdesktop.swingx.painter.BusyPainter;
-import javax.swing.JComboBox;
-import javax.swing.JFileChooser;
-import javax.swing.JLabel;
-import javax.swing.JOptionPane;
-import javax.swing.JPanel;
-import javax.swing.SwingWorker;
-import java.awt.BorderLayout;
-import java.awt.Color;
-import java.awt.Component;
-import java.awt.Container;
+import javax.swing.*;
+import java.awt.*;
import java.io.BufferedWriter;
import java.io.ByteArrayInputStream;
import java.io.File;
@@ -169,15 +161,19 @@
break;
case CSV_FINANCIALSTATEMENTS_EXPORT:
try {
- datas = newExportService.exportFinancialStatement(charset.name());
+ datas = newExportService.exportFinancialStatements(charset.name());
createFile(filePath, charset.name(), datas);
} catch (Exception e) {
e.printStackTrace();
}
break;
case CSV_VAT_EXPORT:
- datas = exportService.exportVatStatementChartAsCSV();
- createFile(filePath, charset.name(), datas);
+ try {
+ datas = newExportService.exportVatStatements(charset.name());
+ createFile(filePath, charset.name(), datas);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
break;
case EBP_ACCOUNTCHARTS_EXPORT:
//For windows ebp
@@ -219,7 +215,9 @@
break;
case CSV_VAT_IMPORT:
datas = extractFile(filePath, charset.name());
- result = importService.importAsCSV(datas, ImportExportEntityEnum.VATSTATEMENT);
+ importResult = newImportService.importVATStatementsAsCSV(datas);
+ // TODO DCossé 24/07/14 change result
+ result = "SUCCESS";
break;
case PDF_VAT_IMPORT:
int response = JOptionPane.showConfirmDialog(waitView,
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-07-31 08:38:23 UTC (rev 3879)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/OpeningViewHandler.java 2014-07-31 12:01:23 UTC (rev 3880)
@@ -25,15 +25,6 @@
package org.chorem.lima.ui.opening;
-import static org.nuiton.i18n.I18n.t;
-
-import java.awt.Color;
-
-import javax.swing.BorderFactory;
-import javax.swing.JPanel;
-import javax.swing.border.Border;
-import javax.swing.border.EmptyBorder;
-
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.business.LimaException;
@@ -49,6 +40,13 @@
import org.chorem.lima.ui.identity.IdentityHandler;
import org.chorem.lima.ui.importexport.ImportExport;
+import javax.swing.*;
+import javax.swing.border.Border;
+import javax.swing.border.EmptyBorder;
+import java.awt.*;
+
+import static org.nuiton.i18n.I18n.t;
+
public class OpeningViewHandler {
private static final Log log = LogFactory.getLog(OpeningViewHandler.class);
@@ -147,6 +145,7 @@
//Import vatstatement
switch (defaultAccountsChartEnum) {
case SHORTENED:
+ // TODO DCossé 31/07/14 why vat_base, default developped and shortened file have got same contents ?
importExport.importExport(ImportExportEnum.CSV_VAT_IMPORT,
VatStatementsChartEnum.SHORTENED.getFilePath(), false);
break;
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-07-31 08:38:23 UTC (rev 3879)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatchart/VatChartTreeTableModel.java 2014-07-31 12:01:23 UTC (rev 3880)
@@ -26,10 +26,13 @@
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.entity.VatStatement;
import org.chorem.lima.entity.VatStatementImpl;
import org.chorem.lima.service.LimaServiceFactory;
+import org.chorem.lima.util.ErrorHelper;
import org.jdesktop.swingx.treetable.AbstractTreeTableModel;
import javax.swing.tree.TreePath;
@@ -45,6 +48,8 @@
/** Services. */
protected final VatStatementService vatStatementService;
+ protected ErrorHelper errorHelper;
+
/** Model constructor. Initiate account service used here. */
public VatChartTreeTableModel() {
//create root for the tree
@@ -172,8 +177,16 @@
parentVatStatementHeader =
(VatStatement) path.getLastPathComponent();
}
- vatStatementService.createVatStatement(
- parentVatStatementHeader, vatStatement);
+ try {
+ vatStatementService.createVatStatement(
+ parentVatStatementHeader, vatStatement);
+ } catch (AlreadyExistVatStatement alreadyExistVatStatement) {
+ errorHelper.showErrorMessage(t("lima.importexport.import.alreadyExistFinancialStatement",
+ alreadyExistVatStatement.getVatStatementLabel(), alreadyExistVatStatement.getMasterLabel()));
+ } catch (NotAllowedLabel notAllowedLabel) {
+ errorHelper.showErrorMessage(t("lima.importexport.import.alreadyExistFinancialStatement",
+ notAllowedLabel.getLabel()));
+ }
modelSupport.fireTreeStructureChanged(path);
}
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-07-31 08:38:23 UTC (rev 3879)
+++ trunk/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties 2014-07-31 12:01:23 UTC (rev 3880)
@@ -311,6 +311,7 @@
lima.importexport.export=
lima.importexport.export.terminated=
lima.importexport.import.alreadyExistFinancialStatement=
+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
lima.init.errorclosing=Erreur lors de la fermeture
Modified: trunk/lima-swing/src/main/resources/import/vat_base.csv
===================================================================
--- trunk/lima-swing/src/main/resources/import/vat_base.csv 2014-07-31 08:38:23 UTC (rev 3879)
+++ trunk/lima-swing/src/main/resources/import/vat_base.csv 2014-07-31 12:01:23 UTC (rev 3880)
@@ -1,71 +1,56 @@
-/**
- * vatstatement Structure : TYPE | boxName | label | header | accounts | masterVatStatement
- *
- * boxName: name used to identify the box inside a pdf (String, can be empty)
- * label: description (String)
- * header: (true if it is a masterVatStatement, false otherwise)
- * accounts: list of accounts amounts to find the amount (account numbers separate by a comma, can be empty)
- * masterVatStatement: copy of the master label (String, can be empty)
- *
- * boxName : identifiant de la cellule dans un pdf (chaîne de caractères, vide si inexistant)
- * label : libellé descriptif (chaîne de caractères)
- * header : indique si la ligne contient des sous-ensembles (vrai si c'est un compte de TVA parent --> true, sinon faux --> false)
- * accounts : liste des comptes utilisés pour calculer la somme (numéro des comptes séparés par des virgules, peut être vide)
- * masterVatStatement : copie du label de la ligne parent (chaîne de caractères, peut être vide)
- *
- **/
-"VAT";"";"A. MONTANT DES OPERATIONS REALISEES";"true";"";""
-"VAT";"";"OPERATIONS IMPOSABLES (H.T.)";"true";"";"A. MONTANT DES OPERATIONS REALISEES"
-"VAT";"b1.b1";"Ventes, prestations de services";"false";"";"OPERATIONS IMPOSABLES (H.T.)"
-"VAT";"b2.b2";"Autres opérations imposables";"false";"";"OPERATIONS IMPOSABLES (H.T.)"
-"VAT";"b3.b3";"Achats de prestations de services intracommunautaires";"false";"";"OPERATIONS IMPOSABLES (H.T.)"
-"VAT";"b4.b4";"Acquisitions intracommunautaires";"false";"";"OPERATIONS IMPOSABLES (H.T.)"
-"VAT";"b5.b5";"Livraisons de gaz naturel ou d'électricité imposables en France";"false";"";"OPERATIONS IMPOSABLES (H.T.)"
-"VAT";"b6.b6";"Achats de biens ou de prestations de services réalisées auprès d'un assujetti non établi en France";"false";"";"OPERATIONS IMPOSABLES (H.T.)"
-"VAT";"b7.b7";"Régularisations (imposables)";"false";"";"OPERATIONS IMPOSABLES (H.T.)"
-"VAT";"";"OPERATIONS NON IMPOSABLES";"true";"";"A. MONTANT DES OPERATIONS REALISEES"
-"VAT";"b8.b8";"Exportations hors CE";"false";"";"OPERATIONS NON IMPOSABLES"
-"VAT";"b9.b9";"Autres opérations non imposables";"false";"";"OPERATIONS NON IMPOSABLES"
-"VAT";"b10.b10";"Livraisons intracommunautaires";"false";"";"OPERATIONS NON IMPOSABLES"
-"VAT";"b11.b11";"Livraisons de gaz naturel ou d'électricité non imposables en France";"false";"";"OPERATIONS NON IMPOSABLES"
-"VAT";"b12.b12";"Achats de franchise";"false";"";"OPERATIONS NON IMPOSABLES"
-"VAT";"b13.b13";"Ventes de biens ou prestations de services réalisées aurpès d'un assujetti non établi en France";"false";"";"OPERATIONS NON IMPOSABLES"
-"VAT";"b14.b14";"Régularisations (non imposables)";"false";"";"OPERATIONS NON IMPOSABLES"
-"VAT";"";"B. DECOMPTE DE LA TVA A PAYER";"true";"";""
-"VAT";"";"TVA BRUTE";"true";"";"B. DECOMPTE DE LA TVA A PAYER"
-"VAT";"";"Opérations réalisées en France métropolitaine";"true";"";"TVA BRUTE"
-"VAT";"b15.b15";"Taux normal 19,6% (Base hors taxe)";"false";"";"Opérations réalisées en France métropolitaine"
-"VAT";"b23.b23";"Taux normal 19,6% (Taxe due)";"false";"";"Opérations réalisées en France métropolitaine"
-"VAT";"b16.b16";"Taux réduit 5,5% (Base hors taxe)";"false";"";"Opérations réalisées en France métropolitaine"
-"VAT";"b24.b24";"Taux réduit 5,5% (Taxe due)";"false";"";"Opérations réalisées en France métropolitaine"
-"VAT";"";"Opérations réalisées dans les DOM";"true";"";"TVA BRUTE"
-"VAT";"b18.b18";"Taux normal 8,5% (Base hors taxe)";"false";"";"Opérations réalisées dans les DOM"
-"VAT";"b26.b26";"Taux normal 8,5% (Taxe due)";"false";"";"Opérations réalisées dans les DOM"
-"VAT";"b19.b19";"Taux réduit 2,1% (Base hors taxe)";"false";"";"Opérations réalisées dans les DOM"
-"VAT";"b27.b27";"Taux réduit 2,1% (Taxe due)";"false";"";"Opérations réalisées dans les DOM"
-"VAT";"";"Opérations imposables à un autre taux (France métropolitaine ou DOM)";"true";"";"TVA BRUTE"
-"VAT";"b21.b21";"Ancien taux (Base hors taxe)";"false";"";"Opérations imposables à un autre taux (France métropolitaine ou DOM)"
-"VAT";"b29.b29";"Ancien taux (Taxe due)";"false";"";"Opérations imposables à un autre taux (France métropolitaine ou DOM)"
-"VAT";"b22.b22";"Opérations imposables à un taux particulier (Base hors taxe)";"false";"";"Opérations imposables à un autre taux (France métropolitaine ou DOM)"
-"VAT";"b30.b30";"Opérations imposables à un taux particulier (Taxe due)";"false";"";"Opérations imposables à un autre taux (France métropolitaine ou DOM)"
-"VAT";"b31.b31";"TVA antérieurement déduite à reverser";"false";"";"TVA BRUTE"
-"VAT";"b32.b32";"Total de le TVA brute due";"false";"";"TVA BRUTE"
-"VAT";"b33.b33";"Dont TVA sur acquisitions intracommunautaires";"false";"";"TVA BRUTE"
-"VAT";"b34.b34";"Dont TVA sur opérations à destination de Monaco";"false";"";"TVA BRUTE"
-"VAT";"";"TVA DEDUCTIBLE";"true";"";"B. DECOMPTE DE LA TVA A PAYER"
-"VAT";"b35.b35";"Biens constituant des immobilisations";"false";"";"TVA DEDUCTIBLE"
-"VAT";"b36.b36";"Autres biens et services";"false";"";"TVA DEDUCTIBLE"
-"VAT";"b37.b37";"Autre TVA à déduire";"false";"";"TVA DEDUCTIBLE"
-"VAT";"b38.b38";"Report du crédit apparaissant ligne 27 de la précédente déclaration";"false";"";"TVA DEDUCTIBLE"
-"VAT";"total1.total1";"Total TVA déductible";"false";"";"TVA DEDUCTIBLE"
-"VAT";"b39.b39";"Dont TVA non perçue récupérable par les assujettis disposant d'un établissement stable dans les DOM";"false";"";"TVA DEDUCTIBLE"
-"VAT";"";"CREDIT";"true";"";""
-"VAT";"b40.b40";"Crédit de TVA";"false";"";"CREDIT"
-"VAT";"b41.b41";"Remboursement demandé sur formulaire n°3519";"false";"";"CREDIT"
-"VAT";"b42.b42";"Crédit à reporter";"false";"";"CREDIT"
-"VAT";"";"TAXE A PAYER";"true";"";""
-"VAT";"b43.b43";"TVA nette due";"false";"";"TAXE A PAYER"
-"VAT";"b44.b44";"Taxes assimilées calculées sur annexe n°3310 A";"false";"";"TAXE A PAYER"
-"VAT";"b45.b45";"Sommes à imputer, exprimées en euros, y compris acompte congés";"false";"";"TAXE A PAYER"
-"VAT";"b46.b46";"Sommes à ajouter, exprimées en euros, y compris acompte congés";"false";"";"TAXE A PAYER"
-"VAT";"b47.b47";"Total à payer";"false";"";"TAXE A PAYER"
+label;header;accounts;boxName;masterVATStatement
+A. MONTANT DES OPERATIONS REALISEES;O;;;
+OPERATIONS IMPOSABLES (H.T.);O;;;A. MONTANT DES OPERATIONS REALISEES
+Acquisitions intracommunautaires;N;;b4.b4;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)
+Livraisons de gaz naturel ou d'électricité imposables en France;N;;b5.b5;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)
+Achats de biens ou de prestations de services réalisées auprès d'un assujetti non établi en France;N;;b6.b6;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)
+Régularisations (imposables);N;;b7.b7;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)
+"Ventes, prestations de services";N;;b1.b1;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)
+B. DECOMPTE DE LA TVA A PAYER;O;;;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services"
+TVA BRUTE;O;;;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER"
+Opérations réalisées en France métropolitaine;O;;;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE"
+"Taux normal 19,6% (Base hors taxe)";N;;b15.b15;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE/Opérations réalisées en France métropolitaine"
+"Taux normal 19,6% (Taxe due)";N;;b23.b23;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE/Opérations réalisées en France métropolitaine"
+"Taux réduit 5,5% (Base hors taxe)";N;;b16.b16;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE/Opérations réalisées en France métropolitaine"
+"Taux réduit 5,5% (Taxe due)";N;;b24.b24;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE/Opérations réalisées en France métropolitaine"
+Opérations réalisées dans les DOM;O;;;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE"
+"Taux normal 8,5% (Base hors taxe)";N;;b18.b18;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE/Opérations réalisées dans les DOM"
+"Taux normal 8,5% (Taxe due)";N;;b26.b26;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE/Opérations réalisées dans les DOM"
+"Taux réduit 2,1% (Base hors taxe)";N;;b19.b19;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE/Opérations réalisées dans les DOM"
+"Taux réduit 2,1% (Taxe due)";N;;b27.b27;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE/Opérations réalisées dans les DOM"
+Opérations imposables à un autre taux (France métropolitaine ou DOM);O;;;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE"
+Ancien taux (Base hors taxe);N;;b21.b21;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE/Opérations imposables à un autre taux (France métropolitaine ou DOM)"
+Ancien taux (Taxe due);N;;b29.b29;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE/Opérations imposables à un autre taux (France métropolitaine ou DOM)"
+Opérations imposables à un taux particulier (Base hors taxe);N;;b22.b22;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE/Opérations imposables à un autre taux (France métropolitaine ou DOM)"
+Opérations imposables à un taux particulier (Taxe due);N;;b30.b30;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE/Opérations imposables à un autre taux (France métropolitaine ou DOM)"
+TVA antérieurement déduite à reverser;N;;b31.b31;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE"
+Total de le TVA brute due;N;;b32.b32;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE"
+Dont TVA sur acquisitions intracommunautaires;N;;b33.b33;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE"
+Dont TVA sur opérations à destination de Monaco;N;;b34.b34;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE"
+TVA DEDUCTIBLE;O;;;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER"
+Biens constituant des immobilisations;N;;b35.b35;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA DEDUCTIBLE"
+Autres biens et services;N;;b36.b36;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA DEDUCTIBLE"
+Autre TVA à déduire;N;;b37.b37;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA DEDUCTIBLE"
+Report du crédit apparaissant ligne 27 de la précédente déclaration;N;;b38.b38;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA DEDUCTIBLE"
+Total TVA déductible;N;;total1.total1;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA DEDUCTIBLE"
+Dont TVA non perçue récupérable par les assujettis disposant d'un établissement stable dans les DOM;N;;b39.b39;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA DEDUCTIBLE"
+Autres opérations imposables;N;;b2.b2;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)
+CREDIT;O;;;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Autres opérations imposables
+Crédit de TVA;N;;b40.b40;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Autres opérations imposables/CREDIT
+Remboursement demandé sur formulaire n°3519;N;;b41.b41;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Autres opérations imposables/CREDIT
+Crédit à reporter;N;;b42.b42;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Autres opérations imposables/CREDIT
+Achats de prestations de services intracommunautaires;N;;b3.b3;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)
+TAXE A PAYER;O;;;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Achats de prestations de services intracommunautaires
+TVA nette due;N;;b43.b43;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Achats de prestations de services intracommunautaires/TAXE A PAYER
+Taxes assimilées calculées sur annexe n°3310 A;N;;b44.b44;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Achats de prestations de services intracommunautaires/TAXE A PAYER
+"Sommes à imputer, exprimées en euros, y compris acompte congés";N;;b45.b45;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Achats de prestations de services intracommunautaires/TAXE A PAYER
+"Sommes à ajouter, exprimées en euros, y compris acompte congés";N;;b46.b46;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Achats de prestations de services intracommunautaires/TAXE A PAYER
+Total à payer;N;;b47.b47;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Achats de prestations de services intracommunautaires/TAXE A PAYER
+OPERATIONS NON IMPOSABLES;O;;;A. MONTANT DES OPERATIONS REALISEES
+Exportations hors CE;N;;b8.b8;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS NON IMPOSABLES
+Autres opérations non imposables;N;;b9.b9;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS NON IMPOSABLES
+Livraisons intracommunautaires;N;;b10.b10;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS NON IMPOSABLES
+Livraisons de gaz naturel ou d'électricité non imposables en France;N;;b11.b11;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS NON IMPOSABLES
+Achats de franchise;N;;b12.b12;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS NON IMPOSABLES
+Ventes de biens ou prestations de services réalisées aurpès d'un assujetti non établi en France;N;;b13.b13;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS NON IMPOSABLES
+Régularisations (non imposables);N;;b14.b14;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS NON IMPOSABLES
Modified: trunk/lima-swing/src/main/resources/import/vat_default.csv
===================================================================
--- trunk/lima-swing/src/main/resources/import/vat_default.csv 2014-07-31 08:38:23 UTC (rev 3879)
+++ trunk/lima-swing/src/main/resources/import/vat_default.csv 2014-07-31 12:01:23 UTC (rev 3880)
@@ -1,71 +1,56 @@
-/**
- * vatstatement Structure : TYPE | boxName | label | header | accounts | masterVatStatement
- *
- * boxName: name used to identify the box inside a pdf (String, can be empty)
- * label: description (String)
- * header: (true if it is a masterVatStatement, false otherwise)
- * accounts: list of accounts amounts to find the amount (account numbers separate by a comma, can be empty)
- * masterVatStatement: copy of the master label (String, can be empty)
- *
- * boxName : identifiant de la cellule dans un pdf (chaîne de caractères, vide si inexistant)
- * label : libellé descriptif (chaîne de caractères)
- * header : indique si la ligne contient des sous-ensembles (vrai si c'est un compte de TVA parent --> true, sinon faux --> false)
- * accounts : liste des comptes utilisés pour calculer la somme (numéro des comptes séparés par des virgules, peut être vide)
- * masterVatStatement : copie du label de la ligne parent (chaîne de caractères, peut être vide)
- *
- **/
-"VAT";"";"A. MONTANT DES OPERATIONS REALISEES";"true";"";""
-"VAT";"";"OPERATIONS IMPOSABLES (H.T.)";"true";"";"A. MONTANT DES OPERATIONS REALISEES"
-"VAT";"b1.b1";"Ventes, prestations de services";"false";"";"OPERATIONS IMPOSABLES (H.T.)"
-"VAT";"b2.b2";"Autres opérations imposables";"false";"";"OPERATIONS IMPOSABLES (H.T.)"
-"VAT";"b3.b3";"Achats de prestations de services intracommunautaires";"false";"";"OPERATIONS IMPOSABLES (H.T.)"
-"VAT";"b4.b4";"Acquisitions intracommunautaires";"false";"";"OPERATIONS IMPOSABLES (H.T.)"
-"VAT";"b5.b5";"Livraisons de gaz naturel ou d'électricité imposables en France";"false";"";"OPERATIONS IMPOSABLES (H.T.)"
-"VAT";"b6.b6";"Achats de biens ou de prestations de services réalisées auprès d'un assujetti non établi en France";"false";"";"OPERATIONS IMPOSABLES (H.T.)"
-"VAT";"b7.b7";"Régularisations (imposables)";"false";"";"OPERATIONS IMPOSABLES (H.T.)"
-"VAT";"";"OPERATIONS NON IMPOSABLES";"true";"";"A. MONTANT DES OPERATIONS REALISEES"
-"VAT";"b8.b8";"Exportations hors CE";"false";"";"OPERATIONS NON IMPOSABLES"
-"VAT";"b9.b9";"Autres opérations non imposables";"false";"";"OPERATIONS NON IMPOSABLES"
-"VAT";"b10.b10";"Livraisons intracommunautaires";"false";"";"OPERATIONS NON IMPOSABLES"
-"VAT";"b11.b11";"Livraisons de gaz naturel ou d'électricité non imposables en France";"false";"";"OPERATIONS NON IMPOSABLES"
-"VAT";"b12.b12";"Achats de franchise";"false";"";"OPERATIONS NON IMPOSABLES"
-"VAT";"b13.b13";"Ventes de biens ou prestations de services réalisées aurpès d'un assujetti non établi en France";"false";"";"OPERATIONS NON IMPOSABLES"
-"VAT";"b14.b14";"Régularisations (non imposables)";"false";"";"OPERATIONS NON IMPOSABLES"
-"VAT";"";"B. DECOMPTE DE LA TVA A PAYER";"true";"";""
-"VAT";"";"TVA BRUTE";"true";"";"B. DECOMPTE DE LA TVA A PAYER"
-"VAT";"";"Opérations réalisées en France métropolitaine";"true";"";"TVA BRUTE"
-"VAT";"b15.b15";"Taux normal 19,6% (Base hors taxe)";"false";"";"Opérations réalisées en France métropolitaine"
-"VAT";"b23.b23";"Taux normal 19,6% (Taxe due)";"false";"";"Opérations réalisées en France métropolitaine"
-"VAT";"b16.b16";"Taux réduit 5,5% (Base hors taxe)";"false";"";"Opérations réalisées en France métropolitaine"
-"VAT";"b24.b24";"Taux réduit 5,5% (Taxe due)";"false";"";"Opérations réalisées en France métropolitaine"
-"VAT";"";"Opérations réalisées dans les DOM";"true";"";"TVA BRUTE"
-"VAT";"b18.b18";"Taux normal 8,5% (Base hors taxe)";"false";"";"Opérations réalisées dans les DOM"
-"VAT";"b26.b26";"Taux normal 8,5% (Taxe due)";"false";"";"Opérations réalisées dans les DOM"
-"VAT";"b19.b19";"Taux réduit 2,1% (Base hors taxe)";"false";"";"Opérations réalisées dans les DOM"
-"VAT";"b27.b27";"Taux réduit 2,1% (Taxe due)";"false";"";"Opérations réalisées dans les DOM"
-"VAT";"";"Opérations imposables à un autre taux (France métropolitaine ou DOM)";"true";"";"TVA BRUTE"
-"VAT";"b21.b21";"Ancien taux (Base hors taxe)";"false";"";"Opérations imposables à un autre taux (France métropolitaine ou DOM)"
-"VAT";"b29.b29";"Ancien taux (Taxe due)";"false";"";"Opérations imposables à un autre taux (France métropolitaine ou DOM)"
-"VAT";"b22.b22";"Opérations imposables à un taux particulier (Base hors taxe)";"false";"";"Opérations imposables à un autre taux (France métropolitaine ou DOM)"
-"VAT";"b30.b30";"Opérations imposables à un taux particulier (Taxe due)";"false";"";"Opérations imposables à un autre taux (France métropolitaine ou DOM)"
-"VAT";"b31.b31";"TVA antérieurement déduite à reverser";"false";"";"TVA BRUTE"
-"VAT";"b32.b32";"Total de le TVA brute due";"false";"";"TVA BRUTE"
-"VAT";"b33.b33";"Dont TVA sur acquisitions intracommunautaires";"false";"";"TVA BRUTE"
-"VAT";"b34.b34";"Dont TVA sur opérations à destination de Monaco";"false";"";"TVA BRUTE"
-"VAT";"";"TVA DEDUCTIBLE";"true";"";"B. DECOMPTE DE LA TVA A PAYER"
-"VAT";"b35.b35";"Biens constituant des immobilisations";"false";"";"TVA DEDUCTIBLE"
-"VAT";"b36.b36";"Autres biens et services";"false";"";"TVA DEDUCTIBLE"
-"VAT";"b37.b37";"Autre TVA à déduire";"false";"";"TVA DEDUCTIBLE"
-"VAT";"b38.b38";"Report du crédit apparaissant ligne 27 de la précédente déclaration";"false";"";"TVA DEDUCTIBLE"
-"VAT";"total1.total1";"Total TVA déductible";"false";"";"TVA DEDUCTIBLE"
-"VAT";"b39.b39";"Dont TVA non perçue récupérable par les assujettis disposant d'un établissement stable dans les DOM";"false";"";"TVA DEDUCTIBLE"
-"VAT";"";"CREDIT";"true";"";""
-"VAT";"b40.b40";"Crédit de TVA";"false";"";"CREDIT"
-"VAT";"b41.b41";"Remboursement demandé sur formulaire n°3519";"false";"";"CREDIT"
-"VAT";"b42.b42";"Crédit à reporter";"false";"";"CREDIT"
-"VAT";"";"TAXE A PAYER";"true";"";""
-"VAT";"b43.b43";"TVA nette due";"false";"";"TAXE A PAYER"
-"VAT";"b44.b44";"Taxes assimilées calculées sur annexe n°3310 A";"false";"";"TAXE A PAYER"
-"VAT";"b45.b45";"Sommes à imputer, exprimées en euros, y compris acompte congés";"false";"";"TAXE A PAYER"
-"VAT";"b46.b46";"Sommes à ajouter, exprimées en euros, y compris acompte congés";"false";"";"TAXE A PAYER"
-"VAT";"b47.b47";"Total à payer";"false";"";"TAXE A PAYER"
+label;header;accounts;boxName;masterVATStatement
+A. MONTANT DES OPERATIONS REALISEES;O;;;
+OPERATIONS IMPOSABLES (H.T.);O;;;A. MONTANT DES OPERATIONS REALISEES
+Acquisitions intracommunautaires;N;;b4.b4;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)
+Livraisons de gaz naturel ou d'électricité imposables en France;N;;b5.b5;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)
+Achats de biens ou de prestations de services réalisées auprès d'un assujetti non établi en France;N;;b6.b6;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)
+Régularisations (imposables);N;;b7.b7;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)
+"Ventes, prestations de services";N;;b1.b1;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)
+B. DECOMPTE DE LA TVA A PAYER;O;;;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services"
+TVA BRUTE;O;;;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER"
+Opérations réalisées en France métropolitaine;O;;;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE"
+"Taux normal 19,6% (Base hors taxe)";N;;b15.b15;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE/Opérations réalisées en France métropolitaine"
+"Taux normal 19,6% (Taxe due)";N;;b23.b23;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE/Opérations réalisées en France métropolitaine"
+"Taux réduit 5,5% (Base hors taxe)";N;;b16.b16;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE/Opérations réalisées en France métropolitaine"
+"Taux réduit 5,5% (Taxe due)";N;;b24.b24;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE/Opérations réalisées en France métropolitaine"
+Opérations réalisées dans les DOM;O;;;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE"
+"Taux normal 8,5% (Base hors taxe)";N;;b18.b18;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE/Opérations réalisées dans les DOM"
+"Taux normal 8,5% (Taxe due)";N;;b26.b26;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE/Opérations réalisées dans les DOM"
+"Taux réduit 2,1% (Base hors taxe)";N;;b19.b19;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE/Opérations réalisées dans les DOM"
+"Taux réduit 2,1% (Taxe due)";N;;b27.b27;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE/Opérations réalisées dans les DOM"
+Opérations imposables à un autre taux (France métropolitaine ou DOM);O;;;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE"
+Ancien taux (Base hors taxe);N;;b21.b21;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE/Opérations imposables à un autre taux (France métropolitaine ou DOM)"
+Ancien taux (Taxe due);N;;b29.b29;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE/Opérations imposables à un autre taux (France métropolitaine ou DOM)"
+Opérations imposables à un taux particulier (Base hors taxe);N;;b22.b22;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE/Opérations imposables à un autre taux (France métropolitaine ou DOM)"
+Opérations imposables à un taux particulier (Taxe due);N;;b30.b30;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE/Opérations imposables à un autre taux (France métropolitaine ou DOM)"
+TVA antérieurement déduite à reverser;N;;b31.b31;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE"
+Total de le TVA brute due;N;;b32.b32;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE"
+Dont TVA sur acquisitions intracommunautaires;N;;b33.b33;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE"
+Dont TVA sur opérations à destination de Monaco;N;;b34.b34;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE"
+TVA DEDUCTIBLE;O;;;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER"
+Biens constituant des immobilisations;N;;b35.b35;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA DEDUCTIBLE"
+Autres biens et services;N;;b36.b36;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA DEDUCTIBLE"
+Autre TVA à déduire;N;;b37.b37;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA DEDUCTIBLE"
+Report du crédit apparaissant ligne 27 de la précédente déclaration;N;;b38.b38;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA DEDUCTIBLE"
+Total TVA déductible;N;;total1.total1;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA DEDUCTIBLE"
+Dont TVA non perçue récupérable par les assujettis disposant d'un établissement stable dans les DOM;N;;b39.b39;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA DEDUCTIBLE"
+Autres opérations imposables;N;;b2.b2;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)
+CREDIT;O;;;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Autres opérations imposables
+Crédit de TVA;N;;b40.b40;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Autres opérations imposables/CREDIT
+Remboursement demandé sur formulaire n°3519;N;;b41.b41;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Autres opérations imposables/CREDIT
+Crédit à reporter;N;;b42.b42;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Autres opérations imposables/CREDIT
+Achats de prestations de services intracommunautaires;N;;b3.b3;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)
+TAXE A PAYER;O;;;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Achats de prestations de services intracommunautaires
+TVA nette due;N;;b43.b43;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Achats de prestations de services intracommunautaires/TAXE A PAYER
+Taxes assimilées calculées sur annexe n°3310 A;N;;b44.b44;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Achats de prestations de services intracommunautaires/TAXE A PAYER
+"Sommes à imputer, exprimées en euros, y compris acompte congés";N;;b45.b45;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Achats de prestations de services intracommunautaires/TAXE A PAYER
+"Sommes à ajouter, exprimées en euros, y compris acompte congés";N;;b46.b46;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Achats de prestations de services intracommunautaires/TAXE A PAYER
+Total à payer;N;;b47.b47;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Achats de prestations de services intracommunautaires/TAXE A PAYER
+OPERATIONS NON IMPOSABLES;O;;;A. MONTANT DES OPERATIONS REALISEES
+Exportations hors CE;N;;b8.b8;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS NON IMPOSABLES
+Autres opérations non imposables;N;;b9.b9;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS NON IMPOSABLES
+Livraisons intracommunautaires;N;;b10.b10;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS NON IMPOSABLES
+Livraisons de gaz naturel ou d'électricité non imposables en France;N;;b11.b11;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS NON IMPOSABLES
+Achats de franchise;N;;b12.b12;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS NON IMPOSABLES
+Ventes de biens ou prestations de services réalisées aurpès d'un assujetti non établi en France;N;;b13.b13;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS NON IMPOSABLES
+Régularisations (non imposables);N;;b14.b14;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS NON IMPOSABLES
\ No newline at end of file
Modified: trunk/lima-swing/src/main/resources/import/vat_developed.csv
===================================================================
--- trunk/lima-swing/src/main/resources/import/vat_developed.csv 2014-07-31 08:38:23 UTC (rev 3879)
+++ trunk/lima-swing/src/main/resources/import/vat_developed.csv 2014-07-31 12:01:23 UTC (rev 3880)
@@ -1,71 +1,56 @@
-/**
- * vatstatement Structure : TYPE | boxName | label | header | accounts | masterVatStatement
- *
- * boxName: name used to identify the box inside a pdf (String, can be empty)
- * label: description (String)
- * header: (true if it is a masterVatStatement, false otherwise)
- * accounts: list of accounts amounts to find the amount (account numbers separate by a comma, can be empty)
- * masterVatStatement: copy of the master label (String, can be empty)
- *
- * boxName : identifiant de la cellule dans un pdf (chaîne de caractères, vide si inexistant)
- * label : libellé descriptif (chaîne de caractères)
- * header : indique si la ligne contient des sous-ensembles (vrai si c'est un compte de TVA parent --> true, sinon faux --> false)
- * accounts : liste des comptes utilisés pour calculer la somme (numéro des comptes séparés par des virgules, peut être vide)
- * masterVatStatement : copie du label de la ligne parent (chaîne de caractères, peut être vide)
- *
- **/
-"VAT";"";"A. MONTANT DES OPERATIONS REALISEES";"true";"";""
-"VAT";"";"OPERATIONS IMPOSABLES (H.T.)";"true";"";"A. MONTANT DES OPERATIONS REALISEES"
-"VAT";"b1.b1";"Ventes, prestations de services";"false";"";"OPERATIONS IMPOSABLES (H.T.)"
-"VAT";"b2.b2";"Autres opérations imposables";"false";"";"OPERATIONS IMPOSABLES (H.T.)"
-"VAT";"b3.b3";"Achats de prestations de services intracommunautaires";"false";"";"OPERATIONS IMPOSABLES (H.T.)"
-"VAT";"b4.b4";"Acquisitions intracommunautaires";"false";"";"OPERATIONS IMPOSABLES (H.T.)"
-"VAT";"b5.b5";"Livraisons de gaz naturel ou d'électricité imposables en France";"false";"";"OPERATIONS IMPOSABLES (H.T.)"
-"VAT";"b6.b6";"Achats de biens ou de prestations de services réalisées auprès d'un assujetti non établi en France";"false";"";"OPERATIONS IMPOSABLES (H.T.)"
-"VAT";"b7.b7";"Régularisations (imposables)";"false";"";"OPERATIONS IMPOSABLES (H.T.)"
-"VAT";"";"OPERATIONS NON IMPOSABLES";"true";"";"A. MONTANT DES OPERATIONS REALISEES"
-"VAT";"b8.b8";"Exportations hors CE";"false";"";"OPERATIONS NON IMPOSABLES"
-"VAT";"b9.b9";"Autres opérations non imposables";"false";"";"OPERATIONS NON IMPOSABLES"
-"VAT";"b10.b10";"Livraisons intracommunautaires";"false";"";"OPERATIONS NON IMPOSABLES"
-"VAT";"b11.b11";"Livraisons de gaz naturel ou d'électricité non imposables en France";"false";"";"OPERATIONS NON IMPOSABLES"
-"VAT";"b12.b12";"Achats de franchise";"false";"";"OPERATIONS NON IMPOSABLES"
-"VAT";"b13.b13";"Ventes de biens ou prestations de services réalisées aurpès d'un assujetti non établi en France";"false";"";"OPERATIONS NON IMPOSABLES"
-"VAT";"b14.b14";"Régularisations (non imposables)";"false";"";"OPERATIONS NON IMPOSABLES"
-"VAT";"";"B. DECOMPTE DE LA TVA A PAYER";"true";"";""
-"VAT";"";"TVA BRUTE";"true";"";"B. DECOMPTE DE LA TVA A PAYER"
-"VAT";"";"Opérations réalisées en France métropolitaine";"true";"";"TVA BRUTE"
-"VAT";"b15.b15";"Taux normal 19,6% (Base hors taxe)";"false";"";"Opérations réalisées en France métropolitaine"
-"VAT";"b23.b23";"Taux normal 19,6% (Taxe due)";"false";"";"Opérations réalisées en France métropolitaine"
-"VAT";"b16.b16";"Taux réduit 5,5% (Base hors taxe)";"false";"";"Opérations réalisées en France métropolitaine"
-"VAT";"b24.b24";"Taux réduit 5,5% (Taxe due)";"false";"";"Opérations réalisées en France métropolitaine"
-"VAT";"";"Opérations réalisées dans les DOM";"true";"";"TVA BRUTE"
-"VAT";"b18.b18";"Taux normal 8,5% (Base hors taxe)";"false";"";"Opérations réalisées dans les DOM"
-"VAT";"b26.b26";"Taux normal 8,5% (Taxe due)";"false";"";"Opérations réalisées dans les DOM"
-"VAT";"b19.b19";"Taux réduit 2,1% (Base hors taxe)";"false";"";"Opérations réalisées dans les DOM"
-"VAT";"b27.b27";"Taux réduit 2,1% (Taxe due)";"false";"";"Opérations réalisées dans les DOM"
-"VAT";"";"Opérations imposables à un autre taux (France métropolitaine ou DOM)";"true";"";"TVA BRUTE"
-"VAT";"b21.b21";"Ancien taux (Base hors taxe)";"false";"";"Opérations imposables à un autre taux (France métropolitaine ou DOM)"
-"VAT";"b29.b29";"Ancien taux (Taxe due)";"false";"";"Opérations imposables à un autre taux (France métropolitaine ou DOM)"
-"VAT";"b22.b22";"Opérations imposables à un taux particulier (Base hors taxe)";"false";"";"Opérations imposables à un autre taux (France métropolitaine ou DOM)"
-"VAT";"b30.b30";"Opérations imposables à un taux particulier (Taxe due)";"false";"";"Opérations imposables à un autre taux (France métropolitaine ou DOM)"
-"VAT";"b31.b31";"TVA antérieurement déduite à reverser";"false";"";"TVA BRUTE"
-"VAT";"b32.b32";"Total de le TVA brute due";"false";"";"TVA BRUTE"
-"VAT";"b33.b33";"Dont TVA sur acquisitions intracommunautaires";"false";"";"TVA BRUTE"
-"VAT";"b34.b34";"Dont TVA sur opérations à destination de Monaco";"false";"";"TVA BRUTE"
-"VAT";"";"TVA DEDUCTIBLE";"true";"";"B. DECOMPTE DE LA TVA A PAYER"
-"VAT";"b35.b35";"Biens constituant des immobilisations";"false";"";"TVA DEDUCTIBLE"
-"VAT";"b36.b36";"Autres biens et services";"false";"";"TVA DEDUCTIBLE"
-"VAT";"b37.b37";"Autre TVA à déduire";"false";"";"TVA DEDUCTIBLE"
-"VAT";"b38.b38";"Report du crédit apparaissant ligne 27 de la précédente déclaration";"false";"";"TVA DEDUCTIBLE"
-"VAT";"total1.total1";"Total TVA déductible";"false";"";"TVA DEDUCTIBLE"
-"VAT";"b39.b39";"Dont TVA non perçue récupérable par les assujettis disposant d'un établissement stable dans les DOM";"false";"";"TVA DEDUCTIBLE"
-"VAT";"";"CREDIT";"true";"";""
-"VAT";"b40.b40";"Crédit de TVA";"false";"";"CREDIT"
-"VAT";"b41.b41";"Remboursement demandé sur formulaire n°3519";"false";"";"CREDIT"
-"VAT";"b42.b42";"Crédit à reporter";"false";"";"CREDIT"
-"VAT";"";"TAXE A PAYER";"true";"";""
-"VAT";"b43.b43";"TVA nette due";"false";"";"TAXE A PAYER"
-"VAT";"b44.b44";"Taxes assimilées calculées sur annexe n°3310 A";"false";"";"TAXE A PAYER"
-"VAT";"b45.b45";"Sommes à imputer, exprimées en euros, y compris acompte congés";"false";"";"TAXE A PAYER"
-"VAT";"b46.b46";"Sommes à ajouter, exprimées en euros, y compris acompte congés";"false";"";"TAXE A PAYER"
-"VAT";"b47.b47";"Total à payer";"false";"";"TAXE A PAYER"
+label;header;accounts;boxName;masterVATStatement
+A. MONTANT DES OPERATIONS REALISEES;O;;;
+OPERATIONS IMPOSABLES (H.T.);O;;;A. MONTANT DES OPERATIONS REALISEES
+Acquisitions intracommunautaires;N;;b4.b4;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)
+Livraisons de gaz naturel ou d'électricité imposables en France;N;;b5.b5;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)
+Achats de biens ou de prestations de services réalisées auprès d'un assujetti non établi en France;N;;b6.b6;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)
+Régularisations (imposables);N;;b7.b7;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)
+"Ventes, prestations de services";N;;b1.b1;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)
+B. DECOMPTE DE LA TVA A PAYER;O;;;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services"
+TVA BRUTE;O;;;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER"
+Opérations réalisées en France métropolitaine;O;;;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE"
+"Taux normal 19,6% (Base hors taxe)";N;;b15.b15;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE/Opérations réalisées en France métropolitaine"
+"Taux normal 19,6% (Taxe due)";N;;b23.b23;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE/Opérations réalisées en France métropolitaine"
+"Taux réduit 5,5% (Base hors taxe)";N;;b16.b16;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE/Opérations réalisées en France métropolitaine"
+"Taux réduit 5,5% (Taxe due)";N;;b24.b24;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE/Opérations réalisées en France métropolitaine"
+Opérations réalisées dans les DOM;O;;;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE"
+"Taux normal 8,5% (Base hors taxe)";N;;b18.b18;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE/Opérations réalisées dans les DOM"
+"Taux normal 8,5% (Taxe due)";N;;b26.b26;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE/Opérations réalisées dans les DOM"
+"Taux réduit 2,1% (Base hors taxe)";N;;b19.b19;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE/Opérations réalisées dans les DOM"
+"Taux réduit 2,1% (Taxe due)";N;;b27.b27;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE/Opérations réalisées dans les DOM"
+Opérations imposables à un autre taux (France métropolitaine ou DOM);O;;;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE"
+Ancien taux (Base hors taxe);N;;b21.b21;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE/Opérations imposables à un autre taux (France métropolitaine ou DOM)"
+Ancien taux (Taxe due);N;;b29.b29;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE/Opérations imposables à un autre taux (France métropolitaine ou DOM)"
+Opérations imposables à un taux particulier (Base hors taxe);N;;b22.b22;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE/Opérations imposables à un autre taux (France métropolitaine ou DOM)"
+Opérations imposables à un taux particulier (Taxe due);N;;b30.b30;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE/Opérations imposables à un autre taux (France métropolitaine ou DOM)"
+TVA antérieurement déduite à reverser;N;;b31.b31;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE"
+Total de le TVA brute due;N;;b32.b32;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE"
+Dont TVA sur acquisitions intracommunautaires;N;;b33.b33;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE"
+Dont TVA sur opérations à destination de Monaco;N;;b34.b34;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE"
+TVA DEDUCTIBLE;O;;;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER"
+Biens constituant des immobilisations;N;;b35.b35;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA DEDUCTIBLE"
+Autres biens et services;N;;b36.b36;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA DEDUCTIBLE"
+Autre TVA à déduire;N;;b37.b37;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA DEDUCTIBLE"
+Report du crédit apparaissant ligne 27 de la précédente déclaration;N;;b38.b38;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA DEDUCTIBLE"
+Total TVA déductible;N;;total1.total1;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA DEDUCTIBLE"
+Dont TVA non perçue récupérable par les assujettis disposant d'un établissement stable dans les DOM;N;;b39.b39;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA DEDUCTIBLE"
+Autres opérations imposables;N;;b2.b2;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)
+CREDIT;O;;;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Autres opérations imposables
+Crédit de TVA;N;;b40.b40;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Autres opérations imposables/CREDIT
+Remboursement demandé sur formulaire n°3519;N;;b41.b41;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Autres opérations imposables/CREDIT
+Crédit à reporter;N;;b42.b42;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Autres opérations imposables/CREDIT
+Achats de prestations de services intracommunautaires;N;;b3.b3;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)
+TAXE A PAYER;O;;;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Achats de prestations de services intracommunautaires
+TVA nette due;N;;b43.b43;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Achats de prestations de services intracommunautaires/TAXE A PAYER
+Taxes assimilées calculées sur annexe n°3310 A;N;;b44.b44;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Achats de prestations de services intracommunautaires/TAXE A PAYER
+"Sommes à imputer, exprimées en euros, y compris acompte congés";N;;b45.b45;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Achats de prestations de services intracommunautaires/TAXE A PAYER
+"Sommes à ajouter, exprimées en euros, y compris acompte congés";N;;b46.b46;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Achats de prestations de services intracommunautaires/TAXE A PAYER
+Total à payer;N;;b47.b47;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Achats de prestations de services intracommunautaires/TAXE A PAYER
+OPERATIONS NON IMPOSABLES;O;;;A. MONTANT DES OPERATIONS REALISEES
+Exportations hors CE;N;;b8.b8;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS NON IMPOSABLES
+Autres opérations non imposables;N;;b9.b9;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS NON IMPOSABLES
+Livraisons intracommunautaires;N;;b10.b10;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS NON IMPOSABLES
+Livraisons de gaz naturel ou d'électricité non imposables en France;N;;b11.b11;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS NON IMPOSABLES
+Achats de franchise;N;;b12.b12;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS NON IMPOSABLES
+Ventes de biens ou prestations de services réalisées aurpès d'un assujetti non établi en France;N;;b13.b13;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS NON IMPOSABLES
+Régularisations (non imposables);N;;b14.b14;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS NON IMPOSABLES
Modified: trunk/lima-swing/src/main/resources/import/vat_shortened.csv
===================================================================
--- trunk/lima-swing/src/main/resources/import/vat_shortened.csv 2014-07-31 08:38:23 UTC (rev 3879)
+++ trunk/lima-swing/src/main/resources/import/vat_shortened.csv 2014-07-31 12:01:23 UTC (rev 3880)
@@ -1,71 +1,56 @@
-/**
- * vatstatement Structure : TYPE | boxName | label | header | accounts | masterVatStatement
- *
- * boxName: name used to identify the box inside a pdf (String, can be empty)
- * label: description (String)
- * header: (true if it is a masterVatStatement, false otherwise)
- * accounts: list of accounts amounts to find the amount (account numbers separate by a comma, can be empty)
- * masterVatStatement: copy of the master label (String, can be empty)
- *
- * boxName : identifiant de la cellule dans un pdf (chaîne de caractères, vide si inexistant)
- * label : libellé descriptif (chaîne de caractères)
- * header : indique si la ligne contient des sous-ensembles (vrai si c'est un compte de TVA parent --> true, sinon faux --> false)
- * accounts : liste des comptes utilisés pour calculer la somme (numéro des comptes séparés par des virgules, peut être vide)
- * masterVatStatement : copie du label de la ligne parent (chaîne de caractères, peut être vide)
- *
- **/
-"VAT";"";"A. MONTANT DES OPERATIONS REALISEES";"true";"";""
-"VAT";"";"OPERATIONS IMPOSABLES (H.T.)";"true";"";"A. MONTANT DES OPERATIONS REALISEES"
-"VAT";"b1.b1";"Ventes, prestations de services";"false";"";"OPERATIONS IMPOSABLES (H.T.)"
-"VAT";"b2.b2";"Autres opérations imposables";"false";"";"OPERATIONS IMPOSABLES (H.T.)"
-"VAT";"b3.b3";"Achats de prestations de services intracommunautaires";"false";"";"OPERATIONS IMPOSABLES (H.T.)"
-"VAT";"b4.b4";"Acquisitions intracommunautaires";"false";"";"OPERATIONS IMPOSABLES (H.T.)"
-"VAT";"b5.b5";"Livraisons de gaz naturel ou d'électricité imposables en France";"false";"";"OPERATIONS IMPOSABLES (H.T.)"
-"VAT";"b6.b6";"Achats de biens ou de prestations de services réalisées auprès d'un assujetti non établi en France";"false";"";"OPERATIONS IMPOSABLES (H.T.)"
-"VAT";"b7.b7";"Régularisations (imposables)";"false";"";"OPERATIONS IMPOSABLES (H.T.)"
-"VAT";"";"OPERATIONS NON IMPOSABLES";"true";"";"A. MONTANT DES OPERATIONS REALISEES"
-"VAT";"b8.b8";"Exportations hors CE";"false";"";"OPERATIONS NON IMPOSABLES"
-"VAT";"b9.b9";"Autres opérations non imposables";"false";"";"OPERATIONS NON IMPOSABLES"
-"VAT";"b10.b10";"Livraisons intracommunautaires";"false";"";"OPERATIONS NON IMPOSABLES"
-"VAT";"b11.b11";"Livraisons de gaz naturel ou d'électricité non imposables en France";"false";"";"OPERATIONS NON IMPOSABLES"
-"VAT";"b12.b12";"Achats de franchise";"false";"";"OPERATIONS NON IMPOSABLES"
-"VAT";"b13.b13";"Ventes de biens ou prestations de services réalisées aurpès d'un assujetti non établi en France";"false";"";"OPERATIONS NON IMPOSABLES"
-"VAT";"b14.b14";"Régularisations (non imposables)";"false";"";"OPERATIONS NON IMPOSABLES"
-"VAT";"";"B. DECOMPTE DE LA TVA A PAYER";"true";"";""
-"VAT";"";"TVA BRUTE";"true";"";"B. DECOMPTE DE LA TVA A PAYER"
-"VAT";"";"Opérations réalisées en France métropolitaine";"true";"";"TVA BRUTE"
-"VAT";"b15.b15";"Taux normal 19,6% (Base hors taxe)";"false";"";"Opérations réalisées en France métropolitaine"
-"VAT";"b23.b23";"Taux normal 19,6% (Taxe due)";"false";"";"Opérations réalisées en France métropolitaine"
-"VAT";"b16.b16";"Taux réduit 5,5% (Base hors taxe)";"false";"";"Opérations réalisées en France métropolitaine"
-"VAT";"b24.b24";"Taux réduit 5,5% (Taxe due)";"false";"";"Opérations réalisées en France métropolitaine"
-"VAT";"";"Opérations réalisées dans les DOM";"true";"";"TVA BRUTE"
-"VAT";"b18.b18";"Taux normal 8,5% (Base hors taxe)";"false";"";"Opérations réalisées dans les DOM"
-"VAT";"b26.b26";"Taux normal 8,5% (Taxe due)";"false";"";"Opérations réalisées dans les DOM"
-"VAT";"b19.b19";"Taux réduit 2,1% (Base hors taxe)";"false";"";"Opérations réalisées dans les DOM"
-"VAT";"b27.b27";"Taux réduit 2,1% (Taxe due)";"false";"";"Opérations réalisées dans les DOM"
-"VAT";"";"Opérations imposables à un autre taux (France métropolitaine ou DOM)";"true";"";"TVA BRUTE"
-"VAT";"b21.b21";"Ancien taux (Base hors taxe)";"false";"";"Opérations imposables à un autre taux (France métropolitaine ou DOM)"
-"VAT";"b29.b29";"Ancien taux (Taxe due)";"false";"";"Opérations imposables à un autre taux (France métropolitaine ou DOM)"
-"VAT";"b22.b22";"Opérations imposables à un taux particulier (Base hors taxe)";"false";"";"Opérations imposables à un autre taux (France métropolitaine ou DOM)"
-"VAT";"b30.b30";"Opérations imposables à un taux particulier (Taxe due)";"false";"";"Opérations imposables à un autre taux (France métropolitaine ou DOM)"
-"VAT";"b31.b31";"TVA antérieurement déduite à reverser";"false";"";"TVA BRUTE"
-"VAT";"b32.b32";"Total de le TVA brute due";"false";"";"TVA BRUTE"
-"VAT";"b33.b33";"Dont TVA sur acquisitions intracommunautaires";"false";"";"TVA BRUTE"
-"VAT";"b34.b34";"Dont TVA sur opérations à destination de Monaco";"false";"";"TVA BRUTE"
-"VAT";"";"TVA DEDUCTIBLE";"true";"";"B. DECOMPTE DE LA TVA A PAYER"
-"VAT";"b35.b35";"Biens constituant des immobilisations";"false";"";"TVA DEDUCTIBLE"
-"VAT";"b36.b36";"Autres biens et services";"false";"";"TVA DEDUCTIBLE"
-"VAT";"b37.b37";"Autre TVA à déduire";"false";"";"TVA DEDUCTIBLE"
-"VAT";"b38.b38";"Report du crédit apparaissant ligne 27 de la précédente déclaration";"false";"";"TVA DEDUCTIBLE"
-"VAT";"total1.total1";"Total TVA déductible";"false";"";"TVA DEDUCTIBLE"
-"VAT";"b39.b39";"Dont TVA non perçue récupérable par les assujettis disposant d'un établissement stable dans les DOM";"false";"";"TVA DEDUCTIBLE"
-"VAT";"";"CREDIT";"true";"";""
-"VAT";"b40.b40";"Crédit de TVA";"false";"";"CREDIT"
-"VAT";"b41.b41";"Remboursement demandé sur formulaire n°3519";"false";"";"CREDIT"
-"VAT";"b42.b42";"Crédit à reporter";"false";"";"CREDIT"
-"VAT";"";"TAXE A PAYER";"true";"";""
-"VAT";"b43.b43";"TVA nette due";"false";"";"TAXE A PAYER"
-"VAT";"b44.b44";"Taxes assimilées calculées sur annexe n°3310 A";"false";"";"TAXE A PAYER"
-"VAT";"b45.b45";"Sommes à imputer, exprimées en euros, y compris acompte congés";"false";"";"TAXE A PAYER"
-"VAT";"b46.b46";"Sommes à ajouter, exprimées en euros, y compris acompte congés";"false";"";"TAXE A PAYER"
-"VAT";"b47.b47";"Total à payer";"false";"";"TAXE A PAYER"
+label;header;accounts;boxName;masterVATStatement
+A. MONTANT DES OPERATIONS REALISEES;O;;;
+OPERATIONS IMPOSABLES (H.T.);O;;;A. MONTANT DES OPERATIONS REALISEES
+Acquisitions intracommunautaires;N;;b4.b4;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)
+Livraisons de gaz naturel ou d'électricité imposables en France;N;;b5.b5;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)
+Achats de biens ou de prestations de services réalisées auprès d'un assujetti non établi en France;N;;b6.b6;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)
+Régularisations (imposables);N;;b7.b7;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)
+"Ventes, prestations de services";N;;b1.b1;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)
+B. DECOMPTE DE LA TVA A PAYER;O;;;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services"
+TVA BRUTE;O;;;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER"
+Opérations réalisées en France métropolitaine;O;;;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE"
+"Taux normal 19,6% (Base hors taxe)";N;;b15.b15;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE/Opérations réalisées en France métropolitaine"
+"Taux normal 19,6% (Taxe due)";N;;b23.b23;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE/Opérations réalisées en France métropolitaine"
+"Taux réduit 5,5% (Base hors taxe)";N;;b16.b16;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE/Opérations réalisées en France métropolitaine"
+"Taux réduit 5,5% (Taxe due)";N;;b24.b24;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE/Opérations réalisées en France métropolitaine"
+Opérations réalisées dans les DOM;O;;;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE"
+"Taux normal 8,5% (Base hors taxe)";N;;b18.b18;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE/Opérations réalisées dans les DOM"
+"Taux normal 8,5% (Taxe due)";N;;b26.b26;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE/Opérations réalisées dans les DOM"
+"Taux réduit 2,1% (Base hors taxe)";N;;b19.b19;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE/Opérations réalisées dans les DOM"
+"Taux réduit 2,1% (Taxe due)";N;;b27.b27;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE/Opérations réalisées dans les DOM"
+Opérations imposables à un autre taux (France métropolitaine ou DOM);O;;;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE"
+Ancien taux (Base hors taxe);N;;b21.b21;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE/Opérations imposables à un autre taux (France métropolitaine ou DOM)"
+Ancien taux (Taxe due);N;;b29.b29;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE/Opérations imposables à un autre taux (France métropolitaine ou DOM)"
+Opérations imposables à un taux particulier (Base hors taxe);N;;b22.b22;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE/Opérations imposables à un autre taux (France métropolitaine ou DOM)"
+Opérations imposables à un taux particulier (Taxe due);N;;b30.b30;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE/Opérations imposables à un autre taux (France métropolitaine ou DOM)"
+TVA antérieurement déduite à reverser;N;;b31.b31;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE"
+Total de le TVA brute due;N;;b32.b32;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE"
+Dont TVA sur acquisitions intracommunautaires;N;;b33.b33;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE"
+Dont TVA sur opérations à destination de Monaco;N;;b34.b34;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE"
+TVA DEDUCTIBLE;O;;;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER"
+Biens constituant des immobilisations;N;;b35.b35;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA DEDUCTIBLE"
+Autres biens et services;N;;b36.b36;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA DEDUCTIBLE"
+Autre TVA à déduire;N;;b37.b37;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA DEDUCTIBLE"
+Report du crédit apparaissant ligne 27 de la précédente déclaration;N;;b38.b38;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA DEDUCTIBLE"
+Total TVA déductible;N;;total1.total1;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA DEDUCTIBLE"
+Dont TVA non perçue récupérable par les assujettis disposant d'un établissement stable dans les DOM;N;;b39.b39;"A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Ventes, prestations de services/B. DECOMPTE DE LA TVA A PAYER/TVA DEDUCTIBLE"
+Autres opérations imposables;N;;b2.b2;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)
+CREDIT;O;;;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Autres opérations imposables
+Crédit de TVA;N;;b40.b40;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Autres opérations imposables/CREDIT
+Remboursement demandé sur formulaire n°3519;N;;b41.b41;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Autres opérations imposables/CREDIT
+Crédit à reporter;N;;b42.b42;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Autres opérations imposables/CREDIT
+Achats de prestations de services intracommunautaires;N;;b3.b3;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)
+TAXE A PAYER;O;;;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Achats de prestations de services intracommunautaires
+TVA nette due;N;;b43.b43;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Achats de prestations de services intracommunautaires/TAXE A PAYER
+Taxes assimilées calculées sur annexe n°3310 A;N;;b44.b44;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Achats de prestations de services intracommunautaires/TAXE A PAYER
+"Sommes à imputer, exprimées en euros, y compris acompte congés";N;;b45.b45;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Achats de prestations de services intracommunautaires/TAXE A PAYER
+"Sommes à ajouter, exprimées en euros, y compris acompte congés";N;;b46.b46;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Achats de prestations de services intracommunautaires/TAXE A PAYER
+Total à payer;N;;b47.b47;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.)/Achats de prestations de services intracommunautaires/TAXE A PAYER
+OPERATIONS NON IMPOSABLES;O;;;A. MONTANT DES OPERATIONS REALISEES
+Exportations hors CE;N;;b8.b8;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS NON IMPOSABLES
+Autres opérations non imposables;N;;b9.b9;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS NON IMPOSABLES
+Livraisons intracommunautaires;N;;b10.b10;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS NON IMPOSABLES
+Livraisons de gaz naturel ou d'électricité non imposables en France;N;;b11.b11;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS NON IMPOSABLES
+Achats de franchise;N;;b12.b12;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS NON IMPOSABLES
+Ventes de biens ou prestations de services réalisées aurpès d'un assujetti non établi en France;N;;b13.b13;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS NON IMPOSABLES
+Régularisations (non imposables);N;;b14.b14;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS NON IMPOSABLES
1
0
r3879 - in trunk/lima-swing/src/main: java/org/chorem/lima/ui/financialstatementchart resources/i18n
by dcosse@users.chorem.org 31 Jul '14
by dcosse@users.chorem.org 31 Jul '14
31 Jul '14
Author: dcosse
Date: 2014-07-31 10:38:23 +0200 (Thu, 31 Jul 2014)
New Revision: 3879
Url: http://forge.chorem.org/projects/lima/repository/revisions/3879
Log:
refs #1032 ajout d'un contr?\195?\180le sur les caract?\195?\168res authoris?\195?\169 d'un label de financial statement
Modified:
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartTreeTableModel.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-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-07-31 08:26:29 UTC (rev 3878)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartTreeTableModel.java 2014-07-31 08:38:23 UTC (rev 3879)
@@ -30,6 +30,7 @@
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.LimaConfig;
import org.chorem.lima.business.AlreadyExistFinancialTransaction;
+import org.chorem.lima.business.NotAllowedLabel;
import org.chorem.lima.business.api.FinancialStatementService;
import org.chorem.lima.entity.FinancialStatement;
import org.chorem.lima.entity.FinancialStatementImpl;
@@ -215,6 +216,9 @@
} catch (AlreadyExistFinancialTransaction alreadyExistFinancialTransaction) {
errorHelper.showErrorMessage(t("lima.importexport.import.alreadyExistFinancialStatement",
alreadyExistFinancialTransaction.getFinancialTransactionLabel(), alreadyExistFinancialTransaction.getMasterLabel()));
+ } catch (NotAllowedLabel notAllowedLabel) {
+ errorHelper.showErrorMessage(t("lima.importexport.import.alreadyExistFinancialStatement",
+ notAllowedLabel.getLabel()));
}
modelSupport.fireTreeStructureChanged(path);
}
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-07-31 08:26:29 UTC (rev 3878)
+++ trunk/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties 2014-07-31 08:38:23 UTC (rev 3879)
@@ -265,6 +265,7 @@
lima.financialstatement.headeramount=Calculate amount on header
lima.financialstatement.label=Label
lima.financialstatement.movement.add=Add movement
+lima.financialstatement.notAllowedLabel=Not allowed label\: %s
lima.financialstatement.provisiondeprecationaccounts=Provisions and deprecations accounts list
lima.financialstatement.subamount=Calculate a subamount
lima.financialstatementreport.listerror=Can't get entries list
@@ -355,7 +356,7 @@
lima.importexport.usevatpdf=
lima.init.closed=Lima closed at %1$s
lima.init.errorclosing=Error during Lima close
-lima.ledger.documentcreationerror=Enable to create document
+lima.ledger.documentcreationerror=Enable to create document
lima.lettering.listerror=Can't get entries list
lima.menu.file=File
lima.menu.help=Help
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-07-31 08:26:29 UTC (rev 3878)
+++ trunk/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties 2014-07-31 08:38:23 UTC (rev 3879)
@@ -248,6 +248,7 @@
lima.financialstatement.headeramount=Calculer le total en en-tete
lima.financialstatement.label=Libellé
lima.financialstatement.movement.add=Ajouter un regrouprement
+lima.financialstatement.notAllowedLabel=Label non authorisé\: %s
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
1
0
31 Jul '14
Author: dcosse
Date: 2014-07-31 10:26:29 +0200 (Thu, 31 Jul 2014)
New Revision: 3878
Url: http://forge.chorem.org/projects/lima/repository/revisions/3878
Log:
refs #1032 gestion des imports des financial statement non ordonn?\195?\169s
Added:
trunk/lima-business-api/src/main/java/org/chorem/lima/business/NotAllowedLabel.java
Modified:
trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialStatementService.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/NewImportServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/csv/AbstractLimaModel.java
trunk/lima-business/src/test/java/org/chorem/lima/business/NewImportExportServiceTest.java
trunk/lima-business/src/test/resources/import/bcr_developed.csv
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-07-30 22:18:28 UTC (rev 3877)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialStatementServiceImpl.java 2014-07-31 08:26:29 UTC (rev 3878)
@@ -41,6 +41,7 @@
import org.chorem.lima.beans.ReportsDatas;
import org.chorem.lima.business.AlreadyExistFinancialTransaction;
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;
@@ -83,7 +84,10 @@
}
};
- protected void validateNewFinancialStatement(FinancialStatement masterFinancialStatement, FinancialStatement financialStatement) throws AlreadyExistFinancialTransaction {
+ protected void validateNewFinancialStatement(FinancialStatement masterFinancialStatement, FinancialStatement financialStatement) throws AlreadyExistFinancialTransaction, NotAllowedLabel {
+ if (financialStatement.getLabel().contains("/")) {
+ throw new NotAllowedLabel(financialStatement.getLabel());
+ }
if (masterFinancialStatement != null) {
Collection<FinancialStatement> masterSubFinancialStatements = masterFinancialStatement.getSubFinancialStatements();
if (masterSubFinancialStatements == null) {
@@ -130,7 +134,7 @@
@Override
public FinancialStatement createFinancialStatement(FinancialStatement masterFinancialStatement,
- FinancialStatement financialStatement) throws AlreadyExistFinancialTransaction {
+ FinancialStatement financialStatement) throws AlreadyExistFinancialTransaction, NotAllowedLabel {
validateNewFinancialStatement(masterFinancialStatement, financialStatement);
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/NewImportServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/NewImportServiceImpl.java 2014-07-30 22:18:28 UTC (rev 3877)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/NewImportServiceImpl.java 2014-07-31 08:26:29 UTC (rev 3878)
@@ -34,6 +34,7 @@
import org.chorem.lima.business.LockedEntryBookException;
import org.chorem.lima.business.LockedFinancialPeriodException;
import org.chorem.lima.business.MoreOneUnlockFiscalPeriodException;
+import org.chorem.lima.business.NotAllowedLabel;
import org.chorem.lima.business.api.AccountService;
import org.chorem.lima.business.api.EntryBookService;
import org.chorem.lima.business.api.EntryService;
@@ -228,7 +229,7 @@
return result;
}
- protected FinancialStatement returnFinancialStatement (FinancialStatement rootFinancialStatement, String subFinancialStatementLabel) throws AlreadyExistFinancialTransaction {
+ protected FinancialStatement returnFinancialStatement (FinancialStatement rootFinancialStatement, String subFinancialStatementLabel) throws AlreadyExistFinancialTransaction, NotAllowedLabel {
Collection<FinancialStatement> subFinancialStatements = rootFinancialStatement.getSubFinancialStatements();
FinancialStatement targetedFinancialStatement = null;
@@ -304,6 +305,11 @@
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 {
@@ -312,6 +318,7 @@
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);
@@ -319,27 +326,45 @@
orderedFinancialStatements.put(rootMasterName, rootFinancialStatement);
}
- // 0 is root
- // explore branches
+ // explore branches to find the financialStatement's master one
FinancialStatement branchesFinancialStatement = rootFinancialStatement;
- for (int i = 1; i < masterNames.length; i++) {
+ for (int i = 1; i < masterNames.length; i++) {// 0 is root
String masterName = masterNames[i];
branchesFinancialStatement = returnFinancialStatement(branchesFinancialStatement, masterName);
}
- // 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);
+ // 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;
+ }
+ }
+ }
- // replace modified root financial statement with new one
- if (orderedFinancialStatements.get(targetedRootFinancialStatement.getLabel()) != null) {
- orderedFinancialStatements.put(targetedRootFinancialStatement.getLabel(), targetedRootFinancialStatement);
+ // 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);
+ }
}
+
}
result.increaseCreated();
lineIndex++;
} catch (AlreadyExistFinancialTransaction e) {
result.getException().addException(lineIndex, e);
+ } catch (NotAllowedLabel e) {
+ result.getException().addException(lineIndex, e);
}
}
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/csv/AbstractLimaModel.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/csv/AbstractLimaModel.java 2014-07-30 22:18:28 UTC (rev 3877)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/csv/AbstractLimaModel.java 2014-07-31 08:26:29 UTC (rev 3878)
@@ -355,29 +355,6 @@
}
};
- // TODO DCossé 29/07/14 is there a way to do sothing like that ?
-// protected static final ValueParser<FinancialStatement> MASTER_FINANCIAL_STATEMENT_LABEL_TO_MASTER_FINANCIAL_STATEMENT_PARSER = new ValueParser<FinancialStatement>() {
-//
-// @Override
-// public FinancialStatement parse(String value) {
-// FinancialStatement result = null;
-// if (StringUtils.isNotBlank(value)){
-// // look for master financial statement
-// // the last financialStatement is the current one.
-// int index = allFinancialStatements.size() - 2;
-// while (index > 0) {
-// FinancialStatement masterFinancialStatement = allFinancialStatements.get(index);
-// if (StringUtils.isNotBlank(masterFinancialStatement.getLabel()) && masterFinancialStatement.getLabel().equals(value)) {
-// result = masterFinancialStatement;
-// break;
-// }
-// index --;
-// }
-// }
-// return result;
-// }
-// };
-
protected static final ValueFormatter<FinancialStatement> MASTER_FINANCIAL_STATEMENT_TO_MASTER_FINANCIAL_STATEMENT_LABEL_FORMATTER = new ValueFormatter<FinancialStatement>() {
@Override
Modified: trunk/lima-business/src/test/java/org/chorem/lima/business/NewImportExportServiceTest.java
===================================================================
--- trunk/lima-business/src/test/java/org/chorem/lima/business/NewImportExportServiceTest.java 2014-07-30 22:18:28 UTC (rev 3877)
+++ trunk/lima-business/src/test/java/org/chorem/lima/business/NewImportExportServiceTest.java 2014-07-31 08:26:29 UTC (rev 3878)
@@ -7,6 +7,7 @@
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.junit.Assert;
@@ -17,6 +18,7 @@
import java.io.FileOutputStream;
import java.io.InputStream;
import java.nio.charset.Charset;
+import java.util.Collection;
import java.util.List;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
@@ -298,6 +300,7 @@
@Test
public void testImportFiscalStatementsAsCSV() throws Exception {
+ // not ordered csv import file
String bcr_developed = IOUtils.toString(ImportServiceImplTest.class.getResourceAsStream("/import/bcr_developed.csv"));
ImportResult result;
@@ -307,5 +310,11 @@
Assert.assertTrue(result.getException().getAllExceptionsByLine().isEmpty());
Assert.assertEquals(162, result.getNbCreated());
Assert.assertEquals(162, financialStatementService.getAllFinancialStatements().size());
+ FinancialStatement actifImmobiliseStatement = financialStatementService.getFinancialStatementByLabel("ACTIF IMMOBILISÉ");
+ Collection<FinancialStatement> subFinancialStatements = actifImmobiliseStatement.getSubFinancialStatements();
+ Assert.assertEquals(3, subFinancialStatements.size());
+ FinancialStatement bilanActifStatement = financialStatementService.getFinancialStatementByLabel("BILAN ACTIF");
+ subFinancialStatements = bilanActifStatement.getSubFinancialStatements();
+ Assert.assertEquals(6, subFinancialStatements.size());
}
}
Modified: trunk/lima-business/src/test/resources/import/bcr_developed.csv
===================================================================
--- trunk/lima-business/src/test/resources/import/bcr_developed.csv 2014-07-30 22:18:28 UTC (rev 3877)
+++ trunk/lima-business/src/test/resources/import/bcr_developed.csv 2014-07-31 08:26:29 UTC (rev 3878)
@@ -1,7 +1,5 @@
label;header;accounts;debitAccounts;creditAccounts;provisionDeprecationAccounts;subAmount;headerAmount;masterFinancialStatement;financialStatementWay
-BILAN ACTIF;O;;;;;O;N;;BOTH
Capital Souscrit non appelé;N;109; ; ; ;N;N;BILAN ACTIF;
-ACTIF IMMOBILISÉ;O; ; ; ; ;O;N;BILAN ACTIF;BOTH
Immobilisations incorporelles;O;;;;;N;N;BILAN ACTIF/ACTIF IMMOBILISÉ;BOTH
Frais d'établissement;N;201;;;2801;N;N;BILAN ACTIF/ACTIF IMMOBILISÉ/Immobilisations incorporelles;
Frais de recherche et développement;N;203;;;2803;N;N;BILAN ACTIF/ACTIF IMMOBILISÉ/Immobilisations incorporelles;
@@ -161,3 +159,5 @@
Reprises sur provisions et transferts de charges;N;"787, 797";;;;N;N;COMPTE DE RESULTAT/PRODUITS/Produits exceptionnels;
Sur opérations en capital;N;"775, 777, 778";;;;N;N;COMPTE DE RESULTAT/PRODUITS/Produits exceptionnels;
Sur opérations de gestion;N;771;;;;N;N;COMPTE DE RESULTAT/PRODUITS/Produits exceptionnels;
+ACTIF IMMOBILISÉ;O; ; ; ; ;O;N;BILAN ACTIF;BOTH
+BILAN ACTIF;O;;;;"2808, 2908";;N;;BOTH
Added: 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 (rev 0)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/NotAllowedLabel.java 2014-07-31 08:26:29 UTC (rev 3878)
@@ -0,0 +1,17 @@
+package org.chorem.lima.business;
+
+/**
+ * Created by davidcosse on 31/07/14.
+ */
+public class NotAllowedLabel extends LimaException {
+
+ protected String label;
+
+ public NotAllowedLabel(String label) {
+ this.label = label;
+ }
+
+ public String getLabel() {
+ return label;
+ }
+}
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-07-30 22:18:28 UTC (rev 3877)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialStatementService.java 2014-07-31 08:26:29 UTC (rev 3878)
@@ -28,6 +28,7 @@
import org.chorem.lima.beans.FinancialStatementAmounts;
import org.chorem.lima.business.AlreadyExistFinancialTransaction;
import org.chorem.lima.business.LimaException;
+import org.chorem.lima.business.NotAllowedLabel;
import org.chorem.lima.entity.Account;
import org.chorem.lima.entity.FinancialStatement;
@@ -45,7 +46,7 @@
void createMasterFinacialStatements(FinancialStatement masterFinancialStatements);
FinancialStatement createFinancialStatement(FinancialStatement masterFinancialStatement,
- FinancialStatement financialStatement) throws AlreadyExistFinancialTransaction;
+ FinancialStatement financialStatement) throws AlreadyExistFinancialTransaction, NotAllowedLabel;
void updateFinancialStatement(FinancialStatement financialStatement);
1
0