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
Author: dcosse
Date: 2014-07-23 15:46:03 +0200 (Wed, 23 Jul 2014)
New Revision: 3857
Url: http://forge.chorem.org/projects/lima/repository/revisions/3857
Log:
refs #1032 d?\195?\169but de mise en place du nouveau servcice d'import export
Added:
trunk/lima-business/src/test/java/org/chorem/lima/business/NewImportExportServiceTest.java
Removed:
trunk/lima-business/src/test/java/org/chorem/lima/business/NewExportServiceTest.java
Modified:
trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/AccountService.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/EntryBookService.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FiscalPeriodService.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/NewImportService.java
trunk/lima-business/src/main/java/org/chorem/lima/business/LimaInterceptor.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/EntryBookServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FiscalPeriodServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/NewExportServiceImpl.java
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/main/resources/lima.properties
trunk/lima-business/src/test/java/org/chorem/lima/business/AbstractLimaTest.java
trunk/lima-callao/src/main/xmi/accounting-model.zargo
trunk/lima-swing/src/main/java/org/chorem/lima/enums/ImportExportEnum.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialperiod/FinancialPeriodView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/FiscalPeriodView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/HomeView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatchart/VatChartView.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-business/src/main/java/org/chorem/lima/business/LimaInterceptor.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/LimaInterceptor.java 2014-07-23 08:52:27 UTC (rev 3856)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/LimaInterceptor.java 2014-07-23 13:46:03 UTC (rev 3857)
@@ -36,6 +36,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.LimaXAResource;
+import org.chorem.lima.entity.AccountImpl;
import org.chorem.lima.entity.LimaCallaoTopiaApplicationContext;
import org.chorem.lima.entity.LimaCallaoTopiaDaoSupplier;
import org.chorem.lima.entity.LimaCallaoTopiaPersistenceContext;
@@ -43,6 +44,8 @@
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;
/**
* Interceptor for topia context transaction.
@@ -101,6 +104,8 @@
LimaCallaoTopiaPersistenceContext tx = rootContext.newPersistenceContext();
+ createShemaIfNeeded(rootContext, tx);
+
DAO_HELPER.set(tx);
Transaction tr = transactionManager.getTransaction();
@@ -125,4 +130,26 @@
return result;
}
+ /**
+ * Test if schema do not already exists and create it if not found.
+ *
+ * @param applicationContext transaction
+ * @throws TopiaException
+ */
+ protected void createShemaIfNeeded(LimaCallaoTopiaApplicationContext applicationContext, LimaCallaoTopiaPersistenceContext tx) throws TopiaException {
+ //LimaCallaoTopiaPersistenceContext
+ if (!schemaExistChecked) {
+ boolean exist = TopiaUtil.isSchemaExist(tx, AccountImpl.class.getName());
+ if (!exist) {
+
+ if (log.isInfoEnabled()) {
+ log.info("Creating to schema in database");
+ }
+ applicationContext.createSchema();
+ }
+
+ schemaExistChecked = true;
+ }
+ }
+
}
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-23 08:52:27 UTC (rev 3856)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java 2014-07-23 13:46:03 UTC (rev 3857)
@@ -62,8 +62,8 @@
@Override
public long getAccountCount() {
- AccountTopiaDao AccountTopiaDao = getDaoHelper().getAccountDao();
- long result = AccountTopiaDao.count();
+ AccountTopiaDao accountTopiaDao = getDaoHelper().getAccountDao();
+ long result = accountTopiaDao.count();
return result;
}
@@ -85,14 +85,14 @@
account.setAccountNumber(account.getAccountNumber().toUpperCase().trim());
// check if account number already exist
- AccountTopiaDao AccountTopiaDao = getDaoHelper().getAccountDao();
+ AccountTopiaDao accountDao = getDaoHelper().getAccountDao();
- if (AccountTopiaDao.existByNaturalId(account.getAccountNumber())) {
+ if (accountDao.forNaturalId(account.getAccountNumber()).exists()) {
throw new AlreadyExistAccountException(account.getAccountNumber());
}
//create it
- Account result = AccountTopiaDao.create(account);
+ Account result = accountDao.create(account);
return result;
}
@@ -101,12 +101,12 @@
public Account getMasterAccount(String accountNumber) {
Account account = null;
- AccountTopiaDao AccountTopiaDao = getDaoHelper().getAccountDao();
+ AccountTopiaDao accountDao = getDaoHelper().getAccountDao();
while (account == null && accountNumber.length() > 1) {
accountNumber = accountNumber.substring(0);
- account = AccountTopiaDao.forAccountNumberEquals(accountNumber).findUniqueOrNull();
+ account = accountDao.forAccountNumberEquals(accountNumber).findUniqueOrNull();
}
return account;
}
@@ -115,8 +115,8 @@
@Override
public Account getAccountByNumber(String accountNumber) {
- AccountTopiaDao AccountTopiaDao = getDaoHelper().getAccountDao();
- Account account = AccountTopiaDao.forAccountNumberEquals(accountNumber).findUniqueOrNull();
+ AccountTopiaDao accountDao = getDaoHelper().getAccountDao();
+ Account account = accountDao.forAccountNumberEquals(accountNumber).findUniqueOrNull();
return account;
}
@@ -126,8 +126,8 @@
@Override
public List<Account> getAllAccounts() {
- AccountTopiaDao AccountTopiaDao = getDaoHelper().getAccountDao();
- List<Account> accountsList = AccountTopiaDao.findAll();
+ AccountTopiaDao accountDao = getDaoHelper().getAccountDao();
+ List<Account> accountsList = accountDao.findAll();
Collections.sort(accountsList, new AccountComparator());
return accountsList;
@@ -138,8 +138,8 @@
@Override
public List<Account> getAllLeafAccounts() {
- AccountTopiaDao AccountTopiaDao = getDaoHelper().getAccountDao();
- List<Account> accountsList = AccountTopiaDao.findAllLeafAccounts();
+ AccountTopiaDao accountDao = getDaoHelper().getAccountDao();
+ List<Account> accountsList = accountDao.findAllLeafAccounts();
return accountsList;
}
@@ -150,8 +150,8 @@
@Override
public List<Account> getAllSubAccounts(Account account) {
- AccountTopiaDao AccountTopiaDao = getDaoHelper().getAccountDao();
- List<Account> accountsList = AccountTopiaDao.findAllSubAccounts(account);
+ AccountTopiaDao accountDao = getDaoHelper().getAccountDao();
+ List<Account> accountsList = accountDao.findAllSubAccounts(account);
return accountsList;
}
@@ -174,9 +174,9 @@
accountingRules.removeAccountRules(account);
// remove account
- AccountTopiaDao AccountTopiaDao = getDaoHelper().getAccountDao();
- Account accountToDelete = AccountTopiaDao.findByTopiaId(account.getTopiaId());
- AccountTopiaDao.delete(accountToDelete);
+ AccountTopiaDao accountDao = getDaoHelper().getAccountDao();
+ Account accountToDelete = accountDao.findByTopiaId(account.getTopiaId());
+ accountDao.delete(accountToDelete);
}
/**
@@ -194,9 +194,9 @@
AccountingRules accountingRules = LimaConfig.getInstance().getAccountingRules();
// DAO
- AccountTopiaDao AccountTopiaDao = getDaoHelper().getAccountDao();
+ AccountTopiaDao accountDao = getDaoHelper().getAccountDao();
accountingRules.updateAccountRules(account);
- Account result = AccountTopiaDao.update(account);
+ Account result = accountDao.update(account);
return result;
}
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-23 08:52:27 UTC (rev 3856)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/EntryBookServiceImpl.java 2014-07-23 13:46:03 UTC (rev 3857)
@@ -69,30 +69,35 @@
// creation du EntryBook
result = entryBookTopiaDao.create(entryBook);
- //create ClosedPeriodicEntryBook for all unblocked financial period
- ClosedPeriodicEntryBookTopiaDao closedPeriodicEntryBookTopiaDao =
- getDaoHelper().getClosedPeriodicEntryBookDao();
- FinancialPeriodTopiaDao financialPeriodTopiaDao =
- getDaoHelper().getFinancialPeriodDao();
- // for all unblocked financialperiod
- List<FinancialPeriod> financialPeriods = financialPeriodTopiaDao.forProperties(FinancialPeriod.PROPERTY_LOCKED, true).findAll();
- for (FinancialPeriod financialPeriod : financialPeriods) {
-
- //new closed periodic entrybook
- ClosedPeriodicEntryBook closedPeriodicEntryBook =
- new ClosedPeriodicEntryBookImpl();
- // set entrybook
- closedPeriodicEntryBook.setEntryBook(entryBook);
- // set financial period
- closedPeriodicEntryBook.setFinancialPeriod(financialPeriod);
- // create it
- closedPeriodicEntryBookTopiaDao.create(closedPeriodicEntryBook);
- }
+ createClosedPeriodicEntryBook(result);
}
return result;
}
@Override
+ public void createClosedPeriodicEntryBook(EntryBook entryBook) {
+ //create ClosedPeriodicEntryBook for all unblocked financial period
+ ClosedPeriodicEntryBookTopiaDao closedPeriodicEntryBookTopiaDao =
+ getDaoHelper().getClosedPeriodicEntryBookDao();
+ FinancialPeriodTopiaDao financialPeriodTopiaDao =
+ getDaoHelper().getFinancialPeriodDao();
+ // for all unblocked financialperiod
+ List<FinancialPeriod> financialPeriods = financialPeriodTopiaDao.forProperties(FinancialPeriod.PROPERTY_LOCKED, true).findAll();
+ for (FinancialPeriod financialPeriod : financialPeriods) {
+
+ //new closed periodic entrybook
+ ClosedPeriodicEntryBook closedPeriodicEntryBook =
+ new ClosedPeriodicEntryBookImpl();
+ // set entrybook
+ closedPeriodicEntryBook.setEntryBook(entryBook);
+ // set financial period
+ closedPeriodicEntryBook.setFinancialPeriod(financialPeriod);
+ // create it
+ closedPeriodicEntryBookTopiaDao.create(closedPeriodicEntryBook);
+ }
+ }
+
+ @Override
public List<EntryBook> getAllEntryBooks() {
// check if entrybook with is name already exist
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-23 08:52:27 UTC (rev 3856)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FiscalPeriodServiceImpl.java 2014-07-23 13:46:03 UTC (rev 3857)
@@ -155,6 +155,47 @@
return result;
}
+ @Override
+ public void createFiscalPeriodsClosePeriodicEntryBooks(Collection<FiscalPeriod> fiscalPeriods) throws
+ BeginAfterEndFiscalPeriodException, NotBeginNextDayOfLastFiscalPeriodException, MoreOneUnlockFiscalPeriodException {
+ EntryBookTopiaDao entryBookTopiaDao = getDaoHelper().getEntryBookDao();
+ AccountingRules accountingRules = LimaConfig.getInstance().getAccountingRules();
+
+ for (FiscalPeriod fiscalPeriod : fiscalPeriods) {
+ createFiscalPeriodClosePeriodicEntryBooks(fiscalPeriod, accountingRules, entryBookTopiaDao);
+ }
+ }
+
+ protected void createFiscalPeriodClosePeriodicEntryBooks(FiscalPeriod fiscalPeriod, AccountingRules accountingRules, EntryBookTopiaDao entryBookTopiaDao) throws
+ BeginAfterEndFiscalPeriodException, NotBeginNextDayOfLastFiscalPeriodException, MoreOneUnlockFiscalPeriodException {
+
+ List<FinancialPeriod> financialPeriods;
+
+ financialPeriods = accountingRules.createFiscalPeriodRules(fiscalPeriod);
+
+ // create
+ fiscalPeriod.addAllFinancialPeriod(financialPeriods);
+
+ //create all financial period
+ for (FinancialPeriod financialPeriod : financialPeriods) {
+
+ List<ClosedPeriodicEntryBook> closedPeriodicEntryBooks = Lists.newArrayList();
+ //create ClosedPeriodicEntryBook for all entrybook
+ for (EntryBook entryBook : entryBookTopiaDao.findAll()) {
+ //new closed periodic entrybook
+ ClosedPeriodicEntryBook closedPeriodicEntryBook = new ClosedPeriodicEntryBookImpl();
+ // set entrybook
+ closedPeriodicEntryBook.setEntryBook(entryBook);
+ // set financial period
+ closedPeriodicEntryBook.setFinancialPeriod(financialPeriod);
+
+ closedPeriodicEntryBooks.add(closedPeriodicEntryBook);
+ }
+ financialPeriod.addAllEntryBookClosedPeriodicEntryBook(closedPeriodicEntryBooks);
+
+ }
+ }
+
/**
* return all fiscal period.
*/
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-23 08:52:27 UTC (rev 3856)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java 2014-07-23 13:46:03 UTC (rev 3857)
@@ -277,7 +277,7 @@
// 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.
+ // 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()));
@@ -335,8 +335,8 @@
// create transaction
if (financialTransaction == null
|| !(dateEcr.equals(financialTransaction
- .getTransactionDate()) && entryBook
- .getCode().equals(
+ .getTransactionDate()) && entryBook
+ .getCode().equals(
financialTransaction.getEntryBook()
.getCode()))) {
// create financial transaction
@@ -349,6 +349,7 @@
"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);
@@ -369,6 +370,7 @@
}
}
+
if (log.isInfoEnabled()) {
long after = System.currentTimeMillis();
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-23 08:52:27 UTC (rev 3856)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/NewExportServiceImpl.java 2014-07-23 13:46:03 UTC (rev 3857)
@@ -145,10 +145,6 @@
File file = exportAccountsFile(charset);
FileInputStream inputStream = new FileInputStream(file);
result = IOUtils.toString(inputStream);
- } catch (FileNotFoundException e) {
- throw new LimaTechnicalException(e);
- } catch (IOException e) {
- throw new LimaTechnicalException(e);
} catch (Exception e) {
throw new LimaTechnicalException(e);
}
@@ -175,10 +171,6 @@
File file = exportEntryBooksFile(charset);
FileInputStream inputStream = new FileInputStream(file);
result = IOUtils.toString(inputStream);
- } catch (FileNotFoundException e) {
- throw new LimaTechnicalException(e);
- } catch (IOException e) {
- throw new LimaTechnicalException(e);
} catch (Exception e) {
throw new LimaTechnicalException(e);
}
@@ -205,10 +197,6 @@
File file = exportFiscalPeriodFile(charset);
FileInputStream inputStream = new FileInputStream(file);
result = IOUtils.toString(inputStream);
- } catch (FileNotFoundException e) {
- throw new LimaTechnicalException(e);
- } catch (IOException e) {
- throw new LimaTechnicalException(e);
} catch (Exception e) {
throw new LimaTechnicalException(e);
}
@@ -237,10 +225,6 @@
File file = exportFinancialTransactionsFile(charset);
FileInputStream inputStream = new FileInputStream(file);
result = IOUtils.toString(inputStream);
- } catch (FileNotFoundException e) {
- throw new LimaTechnicalException(e);
- } catch (IOException e) {
- throw new LimaTechnicalException(e);
} catch (Exception e) {
throw new LimaTechnicalException(e);
}
@@ -265,10 +249,6 @@
File file = exportEntriesFile(charset);
FileInputStream inputStream = new FileInputStream(file);
result = IOUtils.toString(inputStream);
- } catch (FileNotFoundException e) {
- throw new LimaTechnicalException(e);
- } catch (IOException e) {
- throw new LimaTechnicalException(e);
} 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-23 08:52:27 UTC (rev 3856)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/NewImportServiceImpl.java 2014-07-23 13:46:03 UTC (rev 3857)
@@ -23,15 +23,16 @@
*/
import com.google.common.base.Function;
-import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
-import org.apache.commons.codec.binary.Base64;
import org.apache.commons.io.IOUtils;
-import org.chorem.lima.LimaTechnicalException;
+import org.chorem.lima.business.BeginAfterEndFiscalPeriodException;
+import org.chorem.lima.business.MoreOneUnlockFiscalPeriodException;
+import org.chorem.lima.business.NotBeginNextDayOfLastFiscalPeriodException;
import org.chorem.lima.business.api.AccountService;
import org.chorem.lima.business.api.EntryBookService;
+import org.chorem.lima.business.api.EntryService;
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.ejb.csv.AccountModel;
import org.chorem.lima.business.ejb.csv.EntryBookModel;
@@ -43,6 +44,7 @@
import org.chorem.lima.entity.Entry;
import org.chorem.lima.entity.EntryBook;
import org.chorem.lima.entity.EntryBookTopiaDao;
+import org.chorem.lima.entity.EntryTopiaDao;
import org.chorem.lima.entity.FinancialTransaction;
import org.chorem.lima.entity.FinancialTransactionTopiaDao;
import org.chorem.lima.entity.FiscalPeriod;
@@ -55,17 +57,11 @@
import javax.ejb.Remote;
import javax.ejb.Stateless;
import javax.ejb.TransactionAttribute;
-import java.io.ByteArrayInputStream;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
import java.io.InputStream;
-import java.util.Collection;
import java.util.List;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipInputStream;
+import static org.nuiton.i18n.I18n.t;
+
/**
* Created by davidcosse on 03/06/14.
*/
@@ -81,8 +77,14 @@
private AccountService accountService;
@EJB
+ private EntryService entryService;
+
+ @EJB
private FinancialTransactionService financialTransactionService;
+ @EJB
+ private FiscalPeriodService fiscalPeriodService;
+
@Override
public void importAccountAsCSV(String contents) {
InputStream contentStream = IOUtils.toInputStream(contents);
@@ -116,23 +118,40 @@
EntryBookTopiaDao dao = getDaoHelper().getEntryBookDao();
Import<EntryBook> result = Import.newImport(model, contentStream);
dao.createAll(result);
+
+ for (EntryBook entryBook : result) {
+ entryBookService.createClosedPeriodicEntryBook(entryBook);
+ }
} finally {
IOUtils.closeQuietly(contentStream);
}
}
@Override
- public void importFiscalPeriodsAsCSV(String contents) {
+ public String importFiscalPeriodsAsCSV(String contents) {
+ StringBuilder result = new StringBuilder();
InputStream contentStream = IOUtils.toInputStream(contents);
try {
ImportModel<FiscalPeriod> model = new FiscalPeriodModel();
FiscalPeriodTopiaDao dao = getDaoHelper().getFiscalPeriodDao();
- Import<FiscalPeriod> result = Import.newImport(model, contentStream);
- dao.createAll(result);
+ Import<FiscalPeriod> importedFPs = Import.newImport(model, contentStream);
+ List<FiscalPeriod> fiscalPeriods = Lists.newArrayList(importedFPs);
+ try {
+ fiscalPeriodService.createFiscalPeriodsClosePeriodicEntryBooks(fiscalPeriods);
+ result.append(t("lima-business.import.fiscalperiodscloseperiodicentrybooks"));
+ } 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"));
+ }
+ dao.createAll(fiscalPeriods);
} finally {
IOUtils.closeQuietly(contentStream);
}
+ return result.toString();
}
@Override
@@ -162,104 +181,23 @@
// import and save entries
InputStream contentStream = IOUtils.toInputStream(contents);
try {
- FinancialTransactionTopiaDao financialTransactionTopiaDao = getDaoHelper().getFinancialTransactionDao();
-
ImportModel<Entry> model = new EntryModel(accountService, financialTransactionService);
Import<Entry> result = Import.newImport(model, contentStream);
- Collection<FinancialTransaction> financialTransactions = financialTransactionTopiaDao.findAll();
- ImmutableMap<String, FinancialTransaction> indexedFinancialTransactions = Maps.uniqueIndex(financialTransactions, GET_TOPIA_ID);
+ EntryTopiaDao dao = getDaoHelper().getEntryDao();
+ dao.createAll(result);
- for (Entry entry : result) {
- FinancialTransaction financialTransaction = entry.getFinancialTransaction();
- financialTransaction = indexedFinancialTransactions.get(financialTransaction.getTopiaId());
- Collection<Entry> fEntries = financialTransaction.getEntry();
- if(fEntries == null) {
- fEntries = Lists.newArrayList();
- financialTransaction.setEntry(fEntries);
- }
- fEntries.add(entry);
- }
-
- financialTransactionTopiaDao.updateAll(indexedFinancialTransactions.values());
-
} finally {
IOUtils.closeQuietly(contentStream);
}
}
@Override
- public void importAllAsCSV(String zippedBase64Str) {
- ZipInputStream zipInputStream = null;
-
- InputStream transactionsStream = null, entryBooksStream = null, fiscalPeriodsStream = null, entriesStream = null, accountsStream = null;
- try {
- //contentStream = new FileInputStream(path);
- byte[] bytes = Base64.decodeBase64(zippedBase64Str);
- zipInputStream = new ZipInputStream(new ByteArrayInputStream(bytes));
-
- // unzip
- ZipEntry entry;
- String tmpDir = System.getProperty("java.io.tmpdir")+"/";
- while ((entry = zipInputStream.getNextEntry()) != null) {
- byte[] buffer = new byte[2048];
- FileOutputStream fileoutputstream = null;
-
- if (entry.getName().equalsIgnoreCase("accounts.csv")) {
- fileoutputstream = new FileOutputStream(tmpDir + "accounts.csv");
- } else if (entry.getName().equalsIgnoreCase("entryBooks.csv")) {
- fileoutputstream = new FileOutputStream(tmpDir + "entryBooks.csv");
- } else if (entry.getName().equalsIgnoreCase("fiscalPeriod.csv")) {
- fileoutputstream = new FileOutputStream(tmpDir + "fiscalPeriods.csv");
- } else if (entry.getName().equalsIgnoreCase("financialTransactions.csv")) {
- fileoutputstream = new FileOutputStream(tmpDir + "financialTransactions.csv");
- } else if (entry.getName().equalsIgnoreCase("entries.csv")) {
- fileoutputstream = new FileOutputStream(tmpDir + "entries.csv");
- }
- int n;
-
- if (fileoutputstream != null) {
- while ((n = zipInputStream.read(buffer, 0, 2048)) > -1) {
- fileoutputstream.write(buffer, 0, n);
- }
- fileoutputstream.close();
- }
-
- zipInputStream.closeEntry();
- }
-
- entryBooksStream = new FileInputStream(tmpDir + "entryBooks.csv");
- String entryBooksStreamString = IOUtils.toString(entryBooksStream);
- importEntryBooksAsCSV(entryBooksStreamString);
-
- // import
- transactionsStream = new FileInputStream(tmpDir + "financialTransactions.csv");
- String transactionsStreamString = IOUtils.toString(transactionsStream);
- importFinancialTransactionsAsCSV(transactionsStreamString);
-
- fiscalPeriodsStream = new FileInputStream(tmpDir + "fiscalPeriods.csv");
- String fiscalPeriodsStreamString = IOUtils.toString(fiscalPeriodsStream);
- importFiscalPeriodsAsCSV(fiscalPeriodsStreamString);
-
- entriesStream = new FileInputStream(tmpDir + "entries.csv");
- String entriesStreamString = IOUtils.toString(entriesStream);
- importEntriesAsCSV(entriesStreamString);
-
- accountsStream = new FileInputStream(tmpDir + "accounts.csv");
- String accountsStreamString = IOUtils.toString(accountsStream);
- importAccountAsCSV(accountsStreamString);
-
- } catch (FileNotFoundException e) {
- throw new LimaTechnicalException(e);
- } catch (IOException e) {
- throw new LimaTechnicalException(e);
- } finally {
- IOUtils.closeQuietly(zipInputStream);
- IOUtils.closeQuietly(transactionsStream);
- IOUtils.closeQuietly(entryBooksStream);
- IOUtils.closeQuietly(fiscalPeriodsStream);
- IOUtils.closeQuietly(entriesStream);
- IOUtils.closeQuietly(accountsStream);
- }
+ public void importAllAsCSV(String entryBooks, String financialTransactions, String fiscalPeriods, String entries, String accounts){
+ importEntryBooksAsCSV(entryBooks);
+ importFinancialTransactionsAsCSV(financialTransactions);
+ importFiscalPeriodsAsCSV(fiscalPeriods);
+ importEntriesAsCSV(entries);
+ importAccountAsCSV(accounts);
}
}
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-23 08:52:27 UTC (rev 3856)
+++ trunk/lima-business/src/main/resources/i18n/lima-business_en_GB.properties 2014-07-23 13:46:03 UTC (rev 3857)
@@ -114,6 +114,7 @@
lima-business.import.financialstatementalreadyexist=FAILED \: The financial statement %s already exists \!\n
lima-business.import.fiscalperiodadded=SUCCESS \: The fiscalPeriod %s - %s is created \! \n
lima-business.import.fiscalperiodalreadyexist=FAILED \: The fiscal period %s - %s already exists \!\n
+lima-business.import.fiscalperiodscloseperiodicentrybooks=
lima-business.import.identityadded=SUCCESS \: The identity %s is created \! \n
lima-business.import.lineformatmismatch=Line format is invalid.
lima-business.import.noaccount=ERROR \: This file contains no account
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-23 08:52:27 UTC (rev 3856)
+++ trunk/lima-business/src/main/resources/i18n/lima-business_fr_FR.properties 2014-07-23 13:46:03 UTC (rev 3857)
@@ -112,6 +112,7 @@
lima-business.import.financialstatementalreadyexist=u00C9chec \: Le mouvement %s exist déjà \!\n
lima-business.import.fiscalperiodadded=Succès \: Exercice %s - %s ajoutée \! \n
lima-business.import.fiscalperiodalreadyexist=u00C9chec \: L'exerice %s - %s existe déjà \!\n
+lima-business.import.fiscalperiodscloseperiodicentrybooks=
lima-business.import.identityadded=Succès \: Identité %s ajoutée \! \n
lima-business.import.lineformatmismatch=Le format de la ligne est incorrect.
lima-business.import.noaccount=Erreur \: Ce fichier ne contient aucun compte.
Modified: trunk/lima-business/src/main/resources/lima.properties
===================================================================
--- trunk/lima-business/src/main/resources/lima.properties 2014-07-23 08:52:27 UTC (rev 3856)
+++ trunk/lima-business/src/main/resources/lima.properties 2014-07-23 13:46:03 UTC (rev 3857)
@@ -28,3 +28,4 @@
hibernate.connection.password=
hibernate.connection.driver_class=org.h2.Driver
hibernate.connection.url=jdbc:h2:file:${lima.data.dir}/limadb
+hibernate.jdbc.batch_size=50
\ No newline at end of file
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-23 08:52:27 UTC (rev 3856)
+++ trunk/lima-business/src/test/java/org/chorem/lima/business/AbstractLimaTest.java 2014-07-23 13:46:03 UTC (rev 3857)
@@ -109,7 +109,7 @@
@Before
public void initAbstractTest() throws Exception {
setUpLocale();
-
+// LimaInterceptor.schemaExistChecked = false;
Properties options = getTestConfiguration();
LimaConfig config = new LimaTestsConfig("/lima-test.properties", options);
initServices(config);
Deleted: trunk/lima-business/src/test/java/org/chorem/lima/business/NewExportServiceTest.java
===================================================================
--- trunk/lima-business/src/test/java/org/chorem/lima/business/NewExportServiceTest.java 2014-07-23 08:52:27 UTC (rev 3856)
+++ trunk/lima-business/src/test/java/org/chorem/lima/business/NewExportServiceTest.java 2014-07-23 13:46:03 UTC (rev 3857)
@@ -1,250 +0,0 @@
-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;
-import org.chorem.lima.entity.Account;
-import org.chorem.lima.entity.Entry;
-import org.chorem.lima.entity.EntryBook;
-import org.chorem.lima.entity.FinancialTransaction;
-import org.chorem.lima.entity.FiscalPeriod;
-import org.junit.Assert;
-import org.junit.Test;
-
-import java.io.ByteArrayInputStream;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.InputStream;
-import java.nio.charset.Charset;
-import java.util.List;
-
-/**
- * Created by davidcosse on 03/06/14.
- */
-public class NewExportServiceTest extends AbstractLimaTest {
-
- @Test
- public void testExportImportAccounts() throws Exception {
- initTestWithFiscalPeriod();
- // make sure they are some accounts.
- List<Account> accounts = accountService.getAllAccounts();
- Assert.assertTrue(accountService.getAllAccounts().size() > 0);
-
-
- // export accounts
- String tmpDir = System.getProperty("java.io.tmpdir")+"/";
- String export = newExportService.exportAccountsStream(Charset.defaultCharset().name());
- InputStream stream = IOUtils.toInputStream(export);
- FileOutputStream res = new FileOutputStream(tmpDir + "export-accounts.csv");
- IOUtils.copy(stream, res);
-
- // remove accounts
- int nbEntities = accounts.size();
- for (Account account : accounts) {
- accountService.removeAccount(account);
- }
- Assert.assertEquals(0, accountService.getAllAccounts().size());
-
- // import accounts
- InputStream contentStream = null;
- try {
- contentStream = new FileInputStream(tmpDir + "export-accounts.csv");
- String inportStream = IOUtils.toString(contentStream);
- newImportService.importAccountAsCSV(inportStream);
-
- // make sure all account have been created
- Assert.assertEquals(nbEntities, accountService.getAllAccounts().size());
- } finally {
- IOUtils.closeQuietly(contentStream);
- }
- }
-
- @Test
- public void testExportImportEntryBooks() throws Exception {
- initTestWithEntryBooks();
-
- String tmpDir = System.getProperty("java.io.tmpdir")+"/";
- String export = newExportService.exportEntryBooksStream(Charset.defaultCharset().name());
- InputStream stream = IOUtils.toInputStream(export);
- FileOutputStream res = new FileOutputStream(tmpDir + "export-EntryBooks.csv");
- IOUtils.copy(stream, res);
-
- List<EntryBook> entryBooks = entryBookService.getAllEntryBooks();
- int nbEntities = entryBooks.size();
- Assert.assertEquals(3, nbEntities);
-
- for (EntryBook entryBook : entryBooks) {
- entryBookService.removeEntryBook(entryBook);
- }
-
- Assert.assertEquals(0, entryBookService.getAllEntryBooks().size());
-
- FileInputStream contentStream = null;
- try {
- contentStream = new FileInputStream(tmpDir + "export-EntryBooks.csv");
- String inportStream = IOUtils.toString(contentStream);
- newImportService.importEntryBooksAsCSV(inportStream);
- } finally {
- IOUtils.closeQuietly(contentStream);
- }
-
- Assert.assertEquals(nbEntities, entryBookService.getAllEntryBooks().size());
- }
-
- @Test
- public void testExportImportFinancialTransactions() throws Exception {
- initTestWithFinancialTransaction();
-
- String tmpDir = System.getProperty("java.io.tmpdir")+"/";
- String export = newExportService.exportFinancialTransactionsAsStream(Charset.defaultCharset().name());
- InputStream stream = IOUtils.toInputStream(export);
- FileOutputStream res = new FileOutputStream(tmpDir + "export-financial-transactions.csv");
- IOUtils.copy(stream, res);
-
- List<FinancialTransaction> financialTransactions = financialTransactionService.getAllFinancialTransactions(df.parse("January 1, 2012"),df.parse("December 31, 2012"));
- int nbEntities = financialTransactions.size();
- Assert.assertEquals(1, nbEntities);
-
- for (FinancialTransaction financialTransaction : financialTransactions) {
- financialTransactionService.removeFinancialTransaction(financialTransaction);
- }
-
- Assert.assertEquals(0, financialTransactionService.getAllFinancialTransactions(df.parse("January 1, 2012"), df.parse("December 31, 2012")).size());
-
- FileInputStream contentStream = null;
- try {
- contentStream = new FileInputStream(tmpDir + "export-financial-transactions.csv");
- String inportStream = IOUtils.toString(contentStream);
- newImportService.importFinancialTransactionsAsCSV(inportStream);
- } finally {
- IOUtils.closeQuietly(contentStream);
- }
-
- Assert.assertEquals(nbEntities, financialTransactionService.getAllFinancialTransactions(df.parse("January 1, 2012"),df.parse("December 31, 2012")).size());
- }
-
- @Test
- public void testExportImportEntries() throws Exception {
- initTestWithFinancialTransaction();
-
- List<FinancialTransaction> financialTransactions = financialTransactionService.getAllFinancialTransactions(df.parse("April 4, 2012"),df.parse("December 31, 2012"));
- List<Entry> entries = Lists.newArrayList();
- Assert.assertFalse(financialTransactions.isEmpty());
- for (FinancialTransaction financialTransaction : financialTransactions) {
- entries.addAll(financialTransaction.getEntry());
- }
- int nbEntities = entries.size();
- Assert.assertEquals(2,nbEntities);
-
- //test export
- String tmpDir = System.getProperty("java.io.tmpdir")+"/";
- String export = newExportService.exportEntriesAsCSV(Charset.defaultCharset().name());
- InputStream stream = IOUtils.toInputStream(export);
- FileOutputStream res = new FileOutputStream(tmpDir + "export-entries.csv");
- IOUtils.copy(stream, res);
-
- for (Entry entry : entries) {
- FinancialTransaction financialTransaction = entry.getFinancialTransaction();
- financialTransactionService.removeEntry(entry);
- financialTransactionService.updateFinancialTransaction(financialTransaction);
- }
-
- // check all entries have been cleared
- entries.clear();//
-
- financialTransactions = financialTransactionService.getAllFinancialTransactions(df.parse("April 4, 2012"),df.parse("December 31, 2012"));
- for (FinancialTransaction financialTransaction : financialTransactions) {
- entries.addAll(financialTransaction.getEntry());
- }
- Assert.assertTrue(entries.isEmpty());
-
- // test import
- FileInputStream contentStream = null;
- try {
- contentStream = new FileInputStream(tmpDir + "export-entries.csv");
- String inputStream = IOUtils.toString(contentStream);
- newImportService.importEntriesAsCSV(inputStream);
- } finally {
- IOUtils.closeQuietly(contentStream);
- }
-
- // valid import
- financialTransactions = financialTransactionService.getAllFinancialTransactions(df.parse("April 4, 2012"),df.parse("December 31, 2012"));
- Assert.assertEquals(1, financialTransactions.size());
- for (FinancialTransaction financialTransaction : financialTransactions) {
- entries.addAll(financialTransaction.getEntry());
- }
-
- Assert.assertEquals(nbEntities, entries.size());
- }
-
- @Test
- public void testExportImportFiscalPeriodsAsCSV() throws Exception {
- initTestWithFiscalPeriod();
-
- String tmpDir = System.getProperty("java.io.tmpdir")+"/";
- String export = newExportService.exportFiscalPeriodsStream(Charset.defaultCharset().name());
- InputStream stream = IOUtils.toInputStream(export);
- FileOutputStream res = new FileOutputStream(tmpDir + "export-fiscal-periods.csv");
- IOUtils.copy(stream, res);
-
- List<FiscalPeriod> fiscalPeriods = fiscalPeriodService.getAllFiscalPeriods();
- int nbEntities = fiscalPeriods.size();
- Assert.assertEquals(1, nbEntities);
-
- initAbstractTest();
-
- Assert.assertEquals(0, fiscalPeriodService.getAllFiscalPeriods().size());
-
- FileInputStream contentStream = null;
- try {
- contentStream = new FileInputStream(tmpDir + "export-fiscal-periods.csv");
- String inputStream = IOUtils.toString(contentStream);
- newImportService.importFiscalPeriodsAsCSV(inputStream);
- } finally {
- IOUtils.closeQuietly(contentStream);
- }
-
- Assert.assertEquals(nbEntities, fiscalPeriodService.getAllFiscalPeriods().size());
- }
-
- @Test
- public void exportAllAsCSVTest() throws Exception {
- initTestWithFinancialTransaction();
- String export = newExportService.exportAllAsCSV("UTF-8");
- initAbstractTest();
- String tmpDir = System.getProperty("java.io.tmpdir")+"/TMP_BACKUP.zip";
- createZipFile(tmpDir, export);
- newImportService.importAllAsCSV(export);
- }
-
- protected void createZipFile(String path, String zippedBase64Str) throws Exception {
- byte[] bytes = Base64.decodeBase64(zippedBase64Str);
- ByteArrayInputStream inputStream = new ByteArrayInputStream(bytes);
- IOUtils.copy(inputStream, new FileOutputStream(path));
- }
-
-
-}
Copied: trunk/lima-business/src/test/java/org/chorem/lima/business/NewImportExportServiceTest.java (from rev 3833, trunk/lima-business/src/test/java/org/chorem/lima/business/NewExportServiceTest.java)
===================================================================
--- trunk/lima-business/src/test/java/org/chorem/lima/business/NewImportExportServiceTest.java (rev 0)
+++ trunk/lima-business/src/test/java/org/chorem/lima/business/NewImportExportServiceTest.java 2014-07-23 13:46:03 UTC (rev 3857)
@@ -0,0 +1,337 @@
+package org.chorem.lima.business;
+
+import com.google.common.collect.Lists;
+import org.apache.commons.codec.binary.Base64;
+import org.apache.commons.io.IOUtils;
+import org.chorem.lima.LimaTechnicalException;
+import org.chorem.lima.entity.Account;
+import org.chorem.lima.entity.Entry;
+import org.chorem.lima.entity.EntryBook;
+import org.chorem.lima.entity.FinancialTransaction;
+import org.chorem.lima.entity.FiscalPeriod;
+import org.junit.Assert;
+import org.junit.Test;
+
+import java.io.ByteArrayInputStream;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.InputStream;
+import java.nio.charset.Charset;
+import java.util.List;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipInputStream;
+import java.util.zip.ZipOutputStream;
+
+/**
+ * Created by davidcosse on 03/06/14.
+ */
+public class NewImportExportServiceTest extends AbstractLimaTest {
+
+ @Test
+ public void testExportImportAccounts() throws Exception {
+ initTestWithFiscalPeriod();
+ // make sure they are some accounts.
+ List<Account> accounts = accountService.getAllAccounts();
+ Assert.assertTrue(accountService.getAllAccounts().size() > 0);
+
+
+ // export accounts
+ String tmpDir = System.getProperty("java.io.tmpdir")+"/";
+ String export = newExportService.exportAccountsStream(Charset.defaultCharset().name());
+ InputStream stream = IOUtils.toInputStream(export);
+ FileOutputStream res = new FileOutputStream(tmpDir + "export-accounts.csv");
+ IOUtils.copy(stream, res);
+
+ // remove accounts
+ int nbEntities = accounts.size();
+ for (Account account : accounts) {
+ accountService.removeAccount(account);
+ }
+ Assert.assertEquals(0, accountService.getAllAccounts().size());
+
+ // import accounts
+ InputStream contentStream = null;
+ try {
+ contentStream = new FileInputStream(tmpDir + "export-accounts.csv");
+ String inportStream = IOUtils.toString(contentStream);
+ newImportService.importAccountAsCSV(inportStream);
+
+ // make sure all account have been created
+ Assert.assertEquals(nbEntities, accountService.getAllAccounts().size());
+ } finally {
+ IOUtils.closeQuietly(contentStream);
+ }
+ }
+
+ @Test
+ public void testExportImportEntryBooks() throws Exception {
+ initTestWithEntryBooks();
+
+ String tmpDir = System.getProperty("java.io.tmpdir")+"/";
+ String export = newExportService.exportEntryBooksStream(Charset.defaultCharset().name());
+ InputStream stream = IOUtils.toInputStream(export);
+ FileOutputStream res = new FileOutputStream(tmpDir + "export-EntryBooks.csv");
+ IOUtils.copy(stream, res);
+
+ List<EntryBook> entryBooks = entryBookService.getAllEntryBooks();
+ int nbEntities = entryBooks.size();
+ Assert.assertEquals(3, nbEntities);
+
+ for (EntryBook entryBook : entryBooks) {
+ entryBookService.removeEntryBook(entryBook);
+ }
+
+ Assert.assertEquals(0, entryBookService.getAllEntryBooks().size());
+
+ FileInputStream contentStream = null;
+ try {
+ contentStream = new FileInputStream(tmpDir + "export-EntryBooks.csv");
+ String inportStream = IOUtils.toString(contentStream);
+ newImportService.importEntryBooksAsCSV(inportStream);
+ } finally {
+ IOUtils.closeQuietly(contentStream);
+ }
+
+ Assert.assertEquals(nbEntities, entryBookService.getAllEntryBooks().size());
+ }
+
+ @Test
+ public void testExportImportFinancialTransactions() throws Exception {
+ initTestWithFinancialTransaction();
+
+ String tmpDir = System.getProperty("java.io.tmpdir")+"/";
+ String export = newExportService.exportFinancialTransactionsAsStream(Charset.defaultCharset().name());
+ InputStream stream = IOUtils.toInputStream(export);
+ FileOutputStream res = new FileOutputStream(tmpDir + "export-financial-transactions.csv");
+ IOUtils.copy(stream, res);
+
+ List<FinancialTransaction> financialTransactions = financialTransactionService.getAllFinancialTransactions(df.parse("January 1, 2012"),df.parse("December 31, 2012"));
+ int nbEntities = financialTransactions.size();
+ Assert.assertEquals(1, nbEntities);
+
+ for (FinancialTransaction financialTransaction : financialTransactions) {
+ financialTransactionService.removeFinancialTransaction(financialTransaction);
+ }
+
+ Assert.assertEquals(0, financialTransactionService.getAllFinancialTransactions(df.parse("January 1, 2012"), df.parse("December 31, 2012")).size());
+
+ FileInputStream contentStream = null;
+ try {
+ contentStream = new FileInputStream(tmpDir + "export-financial-transactions.csv");
+ String inportStream = IOUtils.toString(contentStream);
+ newImportService.importFinancialTransactionsAsCSV(inportStream);
+ } finally {
+ IOUtils.closeQuietly(contentStream);
+ }
+
+ Assert.assertEquals(nbEntities, financialTransactionService.getAllFinancialTransactions(df.parse("January 1, 2012"),df.parse("December 31, 2012")).size());
+ }
+
+ @Test
+ public void testExportImportEntries() throws Exception {
+ initTestWithFinancialTransaction();
+
+ List<FinancialTransaction> financialTransactions = financialTransactionService.getAllFinancialTransactions(df.parse("April 4, 2012"),df.parse("December 31, 2012"));
+ List<Entry> entries = Lists.newArrayList();
+ Assert.assertFalse(financialTransactions.isEmpty());
+ for (FinancialTransaction financialTransaction : financialTransactions) {
+ entries.addAll(financialTransaction.getEntry());
+ }
+ int nbEntities = entries.size();
+ Assert.assertEquals(2,nbEntities);
+
+ //test export
+ String tmpDir = System.getProperty("java.io.tmpdir")+"/";
+ String export = newExportService.exportEntriesAsCSV(Charset.defaultCharset().name());
+ InputStream stream = IOUtils.toInputStream(export);
+ FileOutputStream res = new FileOutputStream(tmpDir + "export-entries.csv");
+ IOUtils.copy(stream, res);
+
+ for (Entry entry : entries) {
+ FinancialTransaction financialTransaction = entry.getFinancialTransaction();
+ financialTransactionService.removeEntry(entry);
+ financialTransactionService.updateFinancialTransaction(financialTransaction);
+ }
+
+ // ake sure all entries have been cleared
+ entries.clear();//
+
+ financialTransactions = financialTransactionService.getAllFinancialTransactions(df.parse("April 4, 2012"),df.parse("December 31, 2012"));
+ for (FinancialTransaction financialTransaction : financialTransactions) {
+ entries.addAll(financialTransaction.getEntry());
+ }
+ Assert.assertTrue(entries.isEmpty());
+
+ // test import
+ FileInputStream contentStream = null;
+ try {
+ contentStream = new FileInputStream(tmpDir + "export-entries.csv");
+ String inputStream = IOUtils.toString(contentStream);
+ newImportService.importEntriesAsCSV(inputStream);
+ } finally {
+ IOUtils.closeQuietly(contentStream);
+ }
+
+ // valid import
+ financialTransactions = financialTransactionService.getAllFinancialTransactions(df.parse("April 4, 2012"),df.parse("December 31, 2012"));
+ Assert.assertEquals(1, financialTransactions.size());
+ for (FinancialTransaction financialTransaction : financialTransactions) {
+ entries.addAll(financialTransaction.getEntry());
+ }
+
+ Assert.assertEquals(nbEntities, entries.size());
+ }
+
+ @Test
+ public void testExportImportFiscalPeriodsAsCSV() throws Exception {
+ initTestWithFiscalPeriod();
+
+ String tmpDir = System.getProperty("java.io.tmpdir")+"/";
+ String export = newExportService.exportFiscalPeriodsStream(Charset.defaultCharset().name());
+ InputStream stream = IOUtils.toInputStream(export);
+ FileOutputStream res = new FileOutputStream(tmpDir + "export-fiscal-periods.csv");
+ IOUtils.copy(stream, res);
+
+ List<FiscalPeriod> fiscalPeriods = fiscalPeriodService.getAllFiscalPeriods();
+ int nbEntities = fiscalPeriods.size();
+ Assert.assertEquals(1, nbEntities);
+
+ initAbstractTest();
+
+ Assert.assertEquals(0, fiscalPeriodService.getAllFiscalPeriods().size());
+
+ FileInputStream contentStream = null;
+ try {
+ contentStream = new FileInputStream(tmpDir + "export-fiscal-periods.csv");
+ String inputStream = IOUtils.toString(contentStream);
+ // TODO DCossé 22/07/14 traiter les messages de retour
+ newImportService.importFiscalPeriodsAsCSV(inputStream);
+ } finally {
+ IOUtils.closeQuietly(contentStream);
+ }
+
+ Assert.assertEquals(nbEntities, fiscalPeriodService.getAllFiscalPeriods().size());
+ }
+
+ @Test
+ public void exportImportAllAsCSVTest() throws Exception {
+ initTestWithFinancialTransaction();
+ String export = newExportService.exportAllAsCSV("UTF-8");
+ initAbstractTest();
+ String tmpDir = System.getProperty("java.io.tmpdir")+"/TMP_BACKUP.zip";
+ createZipFile(tmpDir, export);
+
+ initAbstractTest();
+
+ FileInputStream contentStream = null;
+ try {
+ importAllFromZipFile(tmpDir);
+ } finally {
+ IOUtils.closeQuietly(contentStream);
+ }
+ }
+
+ protected void createZipFile(String path, String zippedBase64Str) throws Exception {
+ byte[] bytes = Base64.decodeBase64(zippedBase64Str);
+ ByteArrayInputStream inputStream = new ByteArrayInputStream(bytes);
+ IOUtils.copy(inputStream, new FileOutputStream(path));
+ }
+
+ protected String importAllFromZipFile(String filePath) {
+ ZipInputStream zipInputStream = null;
+ String tmpDir = System.getProperty("java.io.tmpdir")+"/";
+ FileInputStream inputStream = null;
+ try {
+ inputStream = new FileInputStream(filePath);
+
+ zipInputStream = new ZipInputStream(inputStream);
+
+ ZipEntry entry;
+ while ((entry = zipInputStream.getNextEntry()) != null) {
+ byte[] buffer = new byte[2048];
+ FileOutputStream fileoutputstream = null;
+
+ if (entry.getName().equalsIgnoreCase("accounts.csv")) {
+ fileoutputstream = new FileOutputStream(tmpDir + "accounts.csv");
+ } else if (entry.getName().equalsIgnoreCase("entryBooks.csv")) {
+ fileoutputstream = new FileOutputStream(tmpDir + "entryBooks.csv");
+ } else if (entry.getName().equalsIgnoreCase("fiscalPeriod.csv")) {
+ fileoutputstream = new FileOutputStream(tmpDir + "fiscalPeriods.csv");
+ } else if (entry.getName().equalsIgnoreCase("financialTransactions.csv")) {
+ fileoutputstream = new FileOutputStream(tmpDir + "financialTransactions.csv");
+ } else if (entry.getName().equalsIgnoreCase("entries.csv")) {
+ fileoutputstream = new FileOutputStream(tmpDir + "entries.csv");
+ }
+ int n;
+
+ if (fileoutputstream != null) {
+ while ((n = zipInputStream.read(buffer, 0, 2048)) > -1) {
+ fileoutputstream.write(buffer, 0, n);
+ }
+ fileoutputstream.close();
+ }
+
+ zipInputStream.closeEntry();
+ }
+ } catch (Exception e) {
+ throw new LimaTechnicalException("could not extract zip file", e);
+ } finally {
+ IOUtils.closeQuietly(zipInputStream);
+ IOUtils.closeQuietly(inputStream);
+ }
+ InputStream transactionsStream, entryBooksStream, fiscalPeriodsStream, entriesStream, accountsStream;
+ try {
+ entryBooksStream = new FileInputStream(tmpDir + "entryBooks.csv");
+ String entryBooksStreamString = IOUtils.toString(entryBooksStream);
+ IOUtils.closeQuietly(entryBooksStream);
+
+ // import
+ transactionsStream = new FileInputStream(tmpDir + "financialTransactions.csv");
+ String transactionsStreamString = IOUtils.toString(transactionsStream);
+ IOUtils.closeQuietly(transactionsStream);
+
+ fiscalPeriodsStream = new FileInputStream(tmpDir + "fiscalPeriods.csv");
+ String fiscalPeriodsStreamString = IOUtils.toString(fiscalPeriodsStream);
+ IOUtils.closeQuietly(fiscalPeriodsStream);
+
+ entriesStream = new FileInputStream(tmpDir + "entries.csv");
+ String entriesStreamString = IOUtils.toString(entriesStream);
+ IOUtils.closeQuietly(entriesStream);
+
+ accountsStream = new FileInputStream(tmpDir + "accounts.csv");
+ String accountsStreamString = IOUtils.toString(accountsStream);
+ IOUtils.closeQuietly(accountsStream);
+
+ // TODO DCossé 23/07/14 should be done in one transaction on service side but it doesn't work now
+ newImportService.importAllAsCSV(entryBooksStreamString, transactionsStreamString, fiscalPeriodsStreamString, entriesStreamString, accountsStreamString);
+// newImportService.importEntryBooksAsCSV(entryBooksStreamString);
+// if(log.isInfoEnabled()) {
+// log.info("jouranux importés");
+// }
+// newImportService.importFinancialTransactionsAsCSV(transactionsStreamString);
+// if(log.isInfoEnabled()) {
+// log.info("transactions importés");
+// }
+// newImportService.importFiscalPeriodsAsCSV(fiscalPeriodsStreamString);
+// if(log.isInfoEnabled()) {
+// log.info("période ficales importés");
+// }
+// newImportService.importEntriesAsCSV(entriesStreamString);
+// if(log.isInfoEnabled()) {
+// log.info("entrées importés");
+// }
+// newImportService.importAccountAsCSV(accountsStreamString);
+// if(log.isInfoEnabled()) {
+// log.info("comptes importés");
+// }
+ } catch (Exception ex) {
+ if(log.isInfoEnabled()) {
+ log.info(ex);
+ }
+ throw new LimaTechnicalException("could not import files", ex);
+ }
+ return "SUCCES";
+ }
+}
Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/AccountService.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/AccountService.java 2014-07-23 08:52:27 UTC (rev 3856)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/AccountService.java 2014-07-23 13:46:03 UTC (rev 3857)
@@ -100,4 +100,5 @@
void removeAccount(Account account) throws UsedAccountException;
List<Account> stringToListAccounts(String selectedAccounts);
+
}
Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/EntryBookService.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/EntryBookService.java 2014-07-23 08:52:27 UTC (rev 3856)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/EntryBookService.java 2014-07-23 13:46:03 UTC (rev 3857)
@@ -85,4 +85,6 @@
* @throws org.chorem.lima.business.UsedEntryBookException
*/
void removeEntryBook(EntryBook entryBook) throws UsedEntryBookException;
+
+ void createClosedPeriodicEntryBook(EntryBook entryBook);
}
Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FiscalPeriodService.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FiscalPeriodService.java 2014-07-23 08:52:27 UTC (rev 3856)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FiscalPeriodService.java 2014-07-23 13:46:03 UTC (rev 3857)
@@ -39,6 +39,7 @@
import org.chorem.lima.entity.EntryBook;
import org.chorem.lima.entity.FiscalPeriod;
+import java.util.Collection;
import java.util.List;
/**
@@ -96,4 +97,9 @@
boolean isRetainedEarnings(FiscalPeriod fiscalPeriod);
FiscalPeriod updateEndDate(FiscalPeriod fiscalPeriod);
+
+ void createFiscalPeriodsClosePeriodicEntryBooks(Collection<FiscalPeriod> fiscalPeriods) throws
+ BeginAfterEndFiscalPeriodException,
+ NotBeginNextDayOfLastFiscalPeriodException,
+ MoreOneUnlockFiscalPeriodException;
}
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-23 08:52:27 UTC (rev 3856)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/NewImportService.java 2014-07-23 13:46:03 UTC (rev 3857)
@@ -31,11 +31,11 @@
void importEntryBooksAsCSV(String contents);
- void importFiscalPeriodsAsCSV(String contents);
+ String importFiscalPeriodsAsCSV(String contents);
void importFinancialTransactionsAsCSV(String contents);
void importEntriesAsCSV(String contents);
- void importAllAsCSV(String zippedBase64Str);
+ void importAllAsCSV(String entryBooks, String transactions, String fiscalPeriods, String entries, String accounts);
}
Modified: trunk/lima-callao/src/main/xmi/accounting-model.zargo
===================================================================
(Binary files differ)
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/enums/ImportExportEnum.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/enums/ImportExportEnum.java 2014-07-23 08:52:27 UTC (rev 3856)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/enums/ImportExportEnum.java 2014-07-23 13:46:03 UTC (rev 3857)
@@ -30,7 +30,7 @@
* second one to allow or not choce for encoding
* */
public enum ImportExportEnum {
- CSV_ALL_EXPORT(false, true), CSV_ALL_IMPORT(true, true),
+ CSV_ALL_EXPORT(false, false), CSV_ALL_IMPORT(true, true),
CSV_ACCOUNTCHARTS_EXPORT(false, true), CSV_ACCOUNTCHARTS_IMPORT(true, true),
CSV_ENTRYBOOKS_EXPORT(false, true), CSV_ENTRYBOOKS_IMPORT(true, true),
CSV_FINANCIALSTATEMENTS_EXPORT(false, true), CSV_FINANCIALSTATEMENTS_IMPORT(true, true),
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountView.jaxx 2014-07-23 08:52:27 UTC (rev 3856)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountView.jaxx 2014-07-23 13:46:03 UTC (rev 3857)
@@ -45,18 +45,18 @@
<JToolBar floatable="false">
<JButton id="addButton"
- toolTipText="{ t("lima.ui.account.addaccount") + " (Ctrl+N)"}"
+ toolTipText="{ "lima.ui.account.addaccount" + " (Ctrl+N)"}"
actionIcon='account-new'
onActionPerformed="handler.addAccount()"/>
<JButton id="updateButton"
- toolTipText="{ t("lima.ui.common.update") + " (Ctrl+M)"}"
+ toolTipText="{ "lima.ui.common.update" + " (Ctrl+M)"}"
actionIcon='account-edit'
onActionPerformed="handler.updateAccount()"
enabled="{isSelectedRow()}"/>
<JButton id="removeButton"
- toolTipText="{ t("lima.ui.common.remove") + " (Del)"}"
+ toolTipText="{ "lima.ui.common.remove" + " (Del)"}"
actionIcon='account-remove'
onActionPerformed="handler.removeAccount()"
enabled="{isSelectedRow()}"/>
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookView.jaxx 2014-07-23 08:52:27 UTC (rev 3856)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookView.jaxx 2014-07-23 13:46:03 UTC (rev 3857)
@@ -45,18 +45,18 @@
<JToolBar floatable="false">
<JButton id="addButton"
- toolTipText="{ t("lima.ui.entrybook.add") + " (Ctrl+N)"}"
+ toolTipText="{ "lima.ui.entrybook.add" + " (Ctrl+N)"}"
actionIcon='entryBook-new'
onActionPerformed="handler.addEntryBook()"/>
<JButton id="updateButton"
- toolTipText="{ t("lima.ui.entrybook.update") + " (Ctrl+M)"}"
+ toolTipText="{ "lima.ui.entrybook.update" + " (Ctrl+M)"}"
actionIcon='entryBook-edit'
onActionPerformed="handler.updateEntryBook()"
enabled="{isSelectedRow()}"/>
<JButton id="removeButton"
- toolTipText="{ t("lima.ui.entrybook.remove") + " (Del)"}"
+ toolTipText="{ "lima.ui.entrybook.remove" + " (Del)"}"
actionIcon='entryBook-remove'
onActionPerformed="handler.deleteEntryBook()"
enabled="{isSelectedRow()}"/>
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialperiod/FinancialPeriodView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialperiod/FinancialPeriodView.jaxx 2014-07-23 08:52:27 UTC (rev 3856)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialperiod/FinancialPeriodView.jaxx 2014-07-23 13:46:03 UTC (rev 3857)
@@ -30,7 +30,6 @@
org.chorem.lima.entity.FinancialPeriod
org.chorem.lima.ui.financialperiod.FinancialPeriodTable
org.chorem.lima.ui.financialperiod.FinancialPeriodTableModel
- static org.nuiton.i18n.I18n.t
</import>
<FinancialPeriodViewHandler id="handler" constructorParams="this"/>
@@ -47,7 +46,7 @@
<JToolBar floatable="false">
<JButton id="blockButton"
- toolTipText="{ t("lima.ui.financialperiod.block") + " (Ctrl+C)"}"
+ toolTipText="{ "lima.ui.financialperiod.block" + " (Ctrl+C)"}"
actionIcon='financialPeriod-close'
onActionPerformed="handler.blockFinancialPeriod()"
enabled="{isSelectedPeriod()}"/>
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartView.jaxx 2014-07-23 08:52:27 UTC (rev 3856)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartView.jaxx 2014-07-23 13:46:03 UTC (rev 3857)
@@ -28,7 +28,6 @@
<import>
javax.swing.ListSelectionModel
org.jdesktop.swingx.decorator.HighlighterFactory
- static org.nuiton.i18n.I18n.t
</import>
<FinancialStatementChartViewHandler id="handler"
@@ -40,37 +39,37 @@
<JToolBar floatable="false">
<JButton id="addFinancialStatementHeader"
- toolTipText="{ t("lima.financialstatement.header.add") + " (Ctrl+Maj+N)"}"
+ toolTipText="{ "lima.financialstatement.header.add" + " (Ctrl+Maj+N)"}"
actionIcon='financialstatement-add-header'
onActionPerformed="handler.addFinancialStatementHeader()"/>
<JButton id="addFinancialStatementMovement"
- toolTipText="{ t("lima.financialstatement.movement.add") + " (Ctrl+N)"}"
+ toolTipText="{ "lima.financialstatement.movement.add" + " (Ctrl+N)"}"
actionIcon='financialstatement-add-movement'
onActionPerformed="handler.addFinancialStatementMovement()"
enabled="{isSelectedRow()}"/>
<JButton id="updateButton"
- toolTipText="{ t("lima.common.update") + " (Ctrl+M)"}"
+ toolTipText="{ "lima.common.update" + " (Ctrl+M)"}"
actionIcon='financialstatement-edit'
onActionPerformed="handler.updateFinancialStatement()"
enabled="{isSelectedRow()}"/>
<JButton id="removeButton"
- toolTipText="{ t("lima.common.remove") + " (Del)"}"
+ toolTipText="{ "lima.common.remove" + " (Del)"}"
actionIcon='financialstatement-remove'
onActionPerformed="handler.removeFinancialStatement()"
enabled="{isSelectedRow()}"/>
<JButton id="importButton"
- toolTipText="{ t("lima.ui.importexport.import") + " (Ctrl+I)"}"
+ toolTipText="{ "lima.ui.importexport.import" + " (Ctrl+I)"}"
actionIcon='financialstatement-import'
onActionPerformed="handler.importFinancialStatementChart()"/>
<JToolBar.Separator/>
<JButton id="checkButton"
- toolTipText="{ t("lima.financialstatement.check") + " (Ctrl+F)"}"
+ toolTipText="{ "lima.financialstatement.check" + " (Ctrl+F)"}"
actionIcon='financialstatement-check'
onActionPerformed="handler.financialStatementChartCheck()"/>
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionView.jaxx 2014-07-23 08:52:27 UTC (rev 3856)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionView.jaxx 2014-07-23 13:46:03 UTC (rev 3857)
@@ -39,11 +39,11 @@
<FinancialTransactionViewHandler id="handler" constructorParams="this"/>
<ListSelectionModel
- id='selectionModel'
- initializer="new DefaultListSelectionModel()"
- selectionMode='{ListSelectionModel.SINGLE_SELECTION}'
- onValueChanged="handler.selectionChanged()"/>
-
+ id='selectionModel'
+ initializer="new DefaultListSelectionModel()"
+ selectionMode='{ListSelectionModel.SINGLE_SELECTION}'
+ onValueChanged="handler.selectionChanged()"/>
+
<Boolean id="selectedRow" javaBean="false"/>
<Boolean id="transactionInClipBoard" javaBean="false"/>
@@ -61,39 +61,39 @@
<row>
<cell fill="horizontal">
<JToolBar floatable="false">
- <JButton toolTipText="{ t("lima.entries.addTransaction") + " (Ctrl+Shift+N)"}"
+ <JButton toolTipText="{ "lima.entries.addTransaction" + " (Ctrl+Shift+N)"}"
actionIcon='add-financial-transaction'
onActionPerformed="handler.addFinancialTransaction()" />
- <JButton toolTipText="{ t("lima.entries.remove.transaction") + " (Ctrl+Shift+Del)"}"
+ <JButton toolTipText="{ "lima.entries.remove.transaction" + " (Ctrl+Shift+Del)"}"
actionIcon='delete-financial-transaction'
enabled="{isSelectedRow()}"
onActionPerformed="handler.deleteSelectedTransaction()" />
- <JButton toolTipText="{ t("lima.entries.copy.transaction") + " (Ctrl+Shift+C)"}" actionIcon='copy'
+ <JButton toolTipText="{ "lima.entries.copy.transaction" + " (Ctrl+Shift+C)"}" actionIcon='copy'
enabled="{isSelectedRow()}"
onActionPerformed="handler.copyTransaction()" />
- <JButton toolTipText="{ t("lima.entries.paste.transaction") + " (Ctrl+Shift+V)"}" actionIcon='paste'
+ <JButton toolTipText="{ "lima.entries.paste.transaction" + " (Ctrl+Shift+V)"}" actionIcon='paste'
enabled="{isTransactionInClipBoard()}"
onActionPerformed="handler.pasteTransaction()" />
<JToolBar.Separator/>
- <JButton toolTipText ="{ t("lima.entries.addEntry") + " (Ctrl+N)"}" actionIcon='add-entry'
+ <JButton toolTipText ="{ "lima.entries.addEntry" + " (Ctrl+N)"}" actionIcon='add-entry'
enabled="{isSelectedRow()}"
onActionPerformed="handler.addEntry()" />
- <JButton toolTipText="{ t("lima.entries.remove.entry") + " (Ctrl+Del)"}" actionIcon='delete-entry'
+ <JButton toolTipText="{ "lima.entries.remove.entry" + " (Ctrl+Del)"}" actionIcon='delete-entry'
enabled="{isSelectedRow()}"
onActionPerformed="handler.deleteSelectedEntry()" />
- <JButton toolTipText="{ t("lima.entries.copy.entry") + " (Ctrl+Alt+C)"}" actionIcon='copy'
+ <JButton toolTipText="{ "lima.entries.copy.entry" + " (Ctrl+Alt+C)"}" actionIcon='copy'
enabled="{isSelectedRow()}"
onActionPerformed="handler.copyEntry()" />
- <JButton toolTipText="{ t("lima.entries.paste.entry") + " (Ctrl+Alt+V)"}" actionIcon='paste'
+ <JButton toolTipText="{ "lima.entries.paste.entry" + " (Ctrl+Alt+V)"}" actionIcon='paste'
enabled="{isEntryInClipBoard() && isSelectedRow()}"
onActionPerformed="handler.pasteEntry()" />
- <JButton toolTipText="{ t("lima.entries.assign.entries") + " (Ctrl+Alt+A)"}" actionIcon='assign-all-entries-in-transaction'
+ <JButton toolTipText="{ "lima.entries.assign.entries" + " (Ctrl+Alt+A)"}" actionIcon='assign-all-entries-in-transaction'
enabled="{isAssignableInAllEntries() && isSelectedRow()}"
onActionPerformed="handler.assignAllEntries()" />
<JToolBar.Separator/>
- <JButton toolTipText="{ t("lima.entries.balance") + " (Ctrl+B)"}" actionIcon='balance'
+ <JButton toolTipText="{ "lima.entries.balance" + " (Ctrl+B)"}" actionIcon='balance'
enabled="{!isBalance()}"
onActionPerformed="handler.balanceTransaction()" />
@@ -139,10 +139,10 @@
<JScrollPane>
<FinancialTransactionTableModel id="financialTransactionTableModel"/>
<FinancialTransactionTable
- id="financialTransactionTable" rowHeight="22"
- constructorParams='handler'
- selectionModel='{selectionModel}'
- model='{financialTransactionTableModel}'/>
+ id="financialTransactionTable" rowHeight="22"
+ constructorParams='handler'
+ selectionModel='{selectionModel}'
+ model='{financialTransactionTableModel}'/>
</JScrollPane>
</cell>
</row>
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedView.jaxx 2014-07-23 08:52:27 UTC (rev 3856)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedView.jaxx 2014-07-23 13:46:03 UTC (rev 3857)
@@ -53,18 +53,18 @@
<row>
<cell fill="horizontal">
<JToolBar floatable="false">
- <JButton toolTipText="{ t("lima.entries.remove.transaction") + " (Ctrl+Shift+Del)"}"
+ <JButton toolTipText="{ "lima.entries.remove.transaction" + " (Ctrl+Shift+Del)"}"
actionIcon='delete-financial-transaction'
enabled="{isSelectedRow()}"
onActionPerformed="getHandler().deleteSelectedTransaction()" />
- <JButton toolTipText ="{ t("lima.entries.addEntry") + " (Ctrl+N)"}" actionIcon='add-entry'
+ <JButton toolTipText ="{ "lima.entries.addEntry" + " (Ctrl+N)"}" actionIcon='add-entry'
enabled="{isSelectedRow()}"
onActionPerformed="getHandler().addEntry()" />
- <JButton toolTipText="{ t("lima.entries.remove.entry") + " (Ctrl+Del)"}" actionIcon='delete-entry'
+ <JButton toolTipText="{ "lima.entries.remove.entry" + " (Ctrl+Del)"}" actionIcon='delete-entry'
enabled="{isSelectedRow()}"
onActionPerformed="getHandler().deleteSelectedEntry()" />
<JToolBar.Separator/>
- <JButton toolTipText="{ t("lima.entries.balance") + " (Ctrl+B)"}" actionIcon='balance'
+ <JButton toolTipText="{ "lima.entries.balance" + " (Ctrl+B)"}" actionIcon='balance'
enabled="{!isBalance()}"
onActionPerformed="handler.balanceTransaction()" />
<JToolBar.Separator/>
@@ -79,7 +79,7 @@
getHandler().refresh()"
editable="false"/>
<JToolBar.Separator/>
- <JButton toolTipText="{ t("lima.ui.common.refresh") + " (F5)"}" actionIcon='refresh'
+ <JButton toolTipText="{ "lima.ui.common.refresh" + " (F5)"}" actionIcon='refresh'
onActionPerformed="getHandler().refresh()"/>
</JToolBar>
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/FiscalPeriodView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/FiscalPeriodView.jaxx 2014-07-23 08:52:27 UTC (rev 3856)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/FiscalPeriodView.jaxx 2014-07-23 13:46:03 UTC (rev 3857)
@@ -28,7 +28,6 @@
<import>
javax.swing.ListSelectionModel
javax.swing.DefaultListSelectionModel
- static org.nuiton.i18n.I18n.t
</import>
<FiscalPeriodViewHandler id="handler" constructorParams="this"/>
@@ -47,24 +46,24 @@
<JToolBar floatable="false">
<JButton id="addButton"
- toolTipText="{ t("lima.charts.fiscalperiod.add") + " (Ctrl+N)"}"
+ toolTipText="{ "lima.charts.fiscalperiod.add" + " (Ctrl+N)"}"
actionIcon='fiscalPeriod-new'
onActionPerformed="handler.addFiscalPeriod()"/>
<JButton id="updateButton"
- toolTipText="{ t("lima.charts.fiscalperiod.update") + " (Ctrl+M)"}"
+ toolTipText="{ "lima.charts.fiscalperiod.update" + " (Ctrl+M)"}"
actionIcon='fiscalPeriod-edit'
onActionPerformed="handler.updateFiscalPeriod()"
enabled="{isDeleteEnabled()}" />
<JButton id="blockButton"
- toolTipText="{ t("lima.charts.fiscalperiod.block") + " (Ctrl+B)"}"
+ toolTipText="{ "lima.charts.fiscalperiod.block" + " (Ctrl+B)"}"
actionIcon='fiscalPeriod-close'
onActionPerformed="handler.blockFiscalPeriod()"
enabled="{isBlockEnabled()}"/>
<JButton id="deleteButton"
- toolTipText="{ t("lima.charts.fiscalperiod.delete") + " (Del)"}"
+ toolTipText="{ "lima.charts.fiscalperiod.delete" + " (Del)"}"
actionIcon='fiscalPeriod-remove'
onActionPerformed="handler.deleteFiscalPeriod()"
enabled="{isDeleteEnabled()}"/>
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/HomeView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/HomeView.jaxx 2014-07-23 08:52:27 UTC (rev 3856)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/HomeView.jaxx 2014-07-23 13:46:03 UTC (rev 3857)
@@ -29,7 +29,6 @@
javax.swing.BoxLayout
javax.swing.border.EtchedBorder
jaxx.runtime.SwingUtil
- static org.nuiton.i18n.I18n.t
</import>
<Dimension id="fixedSize" javaBean='new Dimension(500,200)'/>
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-23 08:52:27 UTC (rev 3856)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java 2014-07-23 13:46:03 UTC (rev 3857)
@@ -32,12 +32,12 @@
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.chorem.lima.LimaConfig;
import org.chorem.lima.LimaTechnicalException;
import org.chorem.lima.business.ImportEbpException;
import org.chorem.lima.business.api.ExportService;
import org.chorem.lima.business.api.ImportService;
import org.chorem.lima.business.api.NewExportService;
+import org.chorem.lima.business.api.NewImportService;
import org.chorem.lima.business.utils.ImportExportEntityEnum;
import org.chorem.lima.enums.EncodingEnum;
import org.chorem.lima.enums.ImportExportEnum;
@@ -64,14 +64,18 @@
import java.io.InputStream;
import java.io.OutputStreamWriter;
import java.nio.charset.Charset;
+import java.text.SimpleDateFormat;
+import java.util.Date;
import java.util.concurrent.ExecutionException;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipInputStream;
import static org.nuiton.i18n.I18n.t;
/**
* Import export helper.
* Calling service with specified file to import and displaying wait view to user.
- *
+ *
* @author echatellier
* Date : 24 avr. 2012
*/
@@ -89,8 +93,11 @@
protected ImportService importService;
+ @Deprecated
protected ExportService exportService;
+ protected NewImportService newImportService;
+
protected NewExportService newExportService;
private ImportExportWaitView waitView;
@@ -103,8 +110,8 @@
//services
importService = LimaServiceFactory.getService(ImportService.class);
exportService = LimaServiceFactory.getService(ExportService.class);
+ newImportService = LimaServiceFactory.getService(NewImportService.class);
newExportService = LimaServiceFactory.getService(NewExportService.class);
- errorHelper = new ErrorHelper(LimaConfig.getInstance());
//create the wait dialog panel
waitView = new ImportExportWaitView();
@@ -171,8 +178,7 @@
createFile(filePath, EncodingEnum.ISOLATIN1.getEncoding(), datas);
break;
case CSV_ALL_IMPORT:
- datas = extractFile(filePath, charset.name());
- result = importService.importAllAsCSV(datas);
+ result = importAllFromZipFile(filePath);
break;
case CSV_ACCOUNTCHARTS_IMPORT:
datas = extractFile(filePath, charset.name());
@@ -236,13 +242,18 @@
//hidde wait dialog panel
waitView.setVisible(false);
+
+ if(log.isInfoEnabled()) {
+ log.info(get());
+ }
+
// display result dialog
if (verboseMode) {
String result = get();
if (importMode && StringUtils.isBlank(result)) {
JOptionPane.showMessageDialog(viewComponent, t("lima.ui.importexport.importerror"),
t("lima.ui.importexport.importtitle"), JOptionPane.ERROR_MESSAGE);
-
+
} else {
if (importMode) {
if (log.isDebugEnabled()) {
@@ -281,14 +292,10 @@
}
}
}
- } catch (InterruptedException ex) {
+ } catch (InterruptedException | ExecutionException ex) {
if (log.isErrorEnabled()) {
log.error("Can't get result message", ex);
}
- } catch (ExecutionException ex) {
- if (log.isErrorEnabled()) {
- log.error("Can't get result message", ex);
- }
}
}
}.execute();
@@ -312,36 +319,37 @@
JComboBox comboBox = new JComboBox(EncodingEnum.descriptions());
- if(importExportMethode.equals(ImportExportEnum.CSV_ALL_EXPORT)){
+ if (importExportMethode.getEncodingOption()) {
+ JPanel panel = new JPanel();
+ panel.setLayout(new BorderLayout());
+ panel.add(new JLabel(t("lima.importexport.choiceencoding")), BorderLayout.WEST);
+ panel.add(comboBox, BorderLayout.CENTER);
+ ((Container) chooser.getComponent(2)).add(panel, BorderLayout.SOUTH);
+ }
+ String approveButtonText;
+ if (importMode) {
+ chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
+ approveButtonText = t("lima.ui.importexport.import");
+ chooser.setDialogTitle(approveButtonText);
+ chooser.setApproveButtonText(approveButtonText);
+ } else if (importExportMethode.equals(ImportExportEnum.CSV_ALL_EXPORT)) {
+ approveButtonText = t("lima.ui.importexport.export");
+ chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
+ chooser.setDialogTitle(approveButtonText);
+ chooser.setApproveButtonText(approveButtonText);
} else {
+ approveButtonText = t("lima.ui.importexport.export");
+ chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
+ chooser.setDialogTitle(approveButtonText);
+ chooser.setApproveButtonText(approveButtonText);
+ }
+ if (chooser.showOpenDialog(viewComponent) == JFileChooser.APPROVE_OPTION) {
+ filePath = chooser.getSelectedFile().getAbsolutePath();
+
if (importExportMethode.getEncodingOption()) {
- JPanel panel = new JPanel();
- panel.setLayout(new BorderLayout());
- panel.add(new JLabel(t("lima.importexport.choiceencoding")), BorderLayout.WEST);
- panel.add(comboBox, BorderLayout.CENTER);
- ((Container) chooser.getComponent(2)).add(panel, BorderLayout.SOUTH);
+ encodingEnum = EncodingEnum.valueOfDescription((String) comboBox.getSelectedItem());
}
-
- String approveButtonText;
- if (importMode) {
- chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
- approveButtonText = t("lima.ui.importexport.import");
- chooser.setDialogTitle(approveButtonText);
- chooser.setApproveButtonText(approveButtonText);
- } else {
- approveButtonText = t("lima.ui.importexport.export");
- chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
- chooser.setDialogTitle(approveButtonText);
- chooser.setApproveButtonText(approveButtonText);
- }
- if (chooser.showOpenDialog(viewComponent) == JFileChooser.APPROVE_OPTION) {
- filePath = chooser.getSelectedFile().getAbsolutePath();
-
- if (importExportMethode.getEncodingOption()) {
- encodingEnum = EncodingEnum.valueOfDescription((String) comboBox.getSelectedItem());
- }
- }
}
@@ -352,7 +360,7 @@
/**
* Get csv datas in string and write file.
- *
+ *
* @param filePath
* @param charset
* @param datas
@@ -372,12 +380,12 @@
} finally {
IOUtils.closeQuietly(out);
}
-
+
}
/**
* Open csv file and get his datas on a string.
- *
+ *
* @param filePath
* @param charset
* @return
@@ -404,9 +412,86 @@
try {
byte[] bytes = Base64.decodeBase64(zippedBase64Str);
ByteArrayInputStream inputStream = new ByteArrayInputStream(bytes);
- IOUtils.copy(inputStream, new FileOutputStream(path));
+ SimpleDateFormat dateFormat = new SimpleDateFormat("dd-MM-yyyy HH:mm:ss");
+ IOUtils.copy(inputStream, new FileOutputStream(path+"/LIMA-BACKUP-"+ dateFormat.format(new Date())));
} catch (IOException e) {
- throw new LimaTechnicalException(e);
+ throw new LimaTechnicalException("could not zip file", e);
}
}
+
+ protected String importAllFromZipFile(String filePath) {
+ ZipInputStream zipInputStream = null;
+ String tmpDir = System.getProperty("java.io.tmpdir")+"/";
+ FileInputStream inputStream = null;
+ try {
+ inputStream = new FileInputStream(filePath);
+
+ zipInputStream = new ZipInputStream(inputStream);
+
+ ZipEntry entry;
+ while ((entry = zipInputStream.getNextEntry()) != null) {
+ byte[] buffer = new byte[2048];
+ FileOutputStream fileoutputstream = null;
+
+ if (entry.getName().equalsIgnoreCase("accounts.csv")) {
+ fileoutputstream = new FileOutputStream(tmpDir + "accounts.csv");
+ } else if (entry.getName().equalsIgnoreCase("entryBooks.csv")) {
+ fileoutputstream = new FileOutputStream(tmpDir + "entryBooks.csv");
+ } else if (entry.getName().equalsIgnoreCase("fiscalPeriod.csv")) {
+ fileoutputstream = new FileOutputStream(tmpDir + "fiscalPeriods.csv");
+ } else if (entry.getName().equalsIgnoreCase("financialTransactions.csv")) {
+ fileoutputstream = new FileOutputStream(tmpDir + "financialTransactions.csv");
+ } else if (entry.getName().equalsIgnoreCase("entries.csv")) {
+ fileoutputstream = new FileOutputStream(tmpDir + "entries.csv");
+ }
+ int n;
+
+ if (fileoutputstream != null) {
+ while ((n = zipInputStream.read(buffer, 0, 2048)) > -1) {
+ fileoutputstream.write(buffer, 0, n);
+ }
+ fileoutputstream.close();
+ }
+
+ zipInputStream.closeEntry();
+ }
+ } catch (Exception e) {
+ throw new LimaTechnicalException("could not extract zip file", e);
+ } finally {
+ IOUtils.closeQuietly(zipInputStream);
+ IOUtils.closeQuietly(inputStream);
+ }
+ InputStream transactionsStream, entryBooksStream, fiscalPeriodsStream, entriesStream, accountsStream;
+ try {
+ entryBooksStream = new FileInputStream(tmpDir + "entryBooks.csv");
+ String entryBooksStreamString = IOUtils.toString(entryBooksStream);
+ IOUtils.closeQuietly(entryBooksStream);
+
+ // import
+ transactionsStream = new FileInputStream(tmpDir + "financialTransactions.csv");
+ String transactionsStreamString = IOUtils.toString(transactionsStream);
+ IOUtils.closeQuietly(transactionsStream);
+
+ fiscalPeriodsStream = new FileInputStream(tmpDir + "fiscalPeriods.csv");
+ String fiscalPeriodsStreamString = IOUtils.toString(fiscalPeriodsStream);
+ IOUtils.closeQuietly(fiscalPeriodsStream);
+
+ entriesStream = new FileInputStream(tmpDir + "entries.csv");
+ String entriesStreamString = IOUtils.toString(entriesStream);
+ IOUtils.closeQuietly(entriesStream);
+
+ accountsStream = new FileInputStream(tmpDir + "accounts.csv");
+ String accountsStreamString = IOUtils.toString(accountsStream);
+ IOUtils.closeQuietly(accountsStream);
+
+ newImportService.importAllAsCSV(entryBooksStreamString, transactionsStreamString, fiscalPeriodsStreamString, entriesStreamString, accountsStreamString);
+
+ } catch (Exception ex) {
+ if(log.isInfoEnabled()) {
+ log.info(ex);
+ }
+ throw new LimaTechnicalException("could not import files", ex);
+ }
+ return "SUCCES";
+ }
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringView.jaxx 2014-07-23 08:52:27 UTC (rev 3856)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringView.jaxx 2014-07-23 13:46:03 UTC (rev 3857)
@@ -54,19 +54,19 @@
<JToolBar floatable="false">
<JButton id="lettered"
- toolTipText="{ t("lima.ui.lettering.buttonLettered") + " (Ctrl+L)"}"
+ toolTipText="{ "lima.ui.lettering.buttonLettered" + " (Ctrl+L)"}"
enabled="{editModel.isLettred()}"
actionIcon='lettering'
onActionPerformed="handler.addLetter()"/>
<JButton id="noLettered"
- toolTipText="{ t("lima.ui.lettering.buttonNoLettered") + " (Del)"}"
+ toolTipText="{ "lima.ui.lettering.buttonNoLettered" + " (Del)"}"
enabled="{editModel.isUnLettred()}"
actionIcon='un-lettering'
onActionPerformed="handler.removeLetter()"/>
<JButton id="round"
- toolTipText="{ t("lima.ui.lettering.buttonEqualize") + " (Ctrl+B)"}"
+ toolTipText="{ "lima.ui.lettering.buttonEqualize" + " (Ctrl+B)"}"
enabled="{editModel.isEqualized()}"
actionIcon='balance'
onActionPerformed="handler.roundAndCreateEntry()"/>
@@ -113,7 +113,7 @@
<JToolBar.Separator/>
<JButton id="refresh"
- toolTipText="{ t("lima.ui.lettering.buttonRefresh") + " (F5)"}"
+ toolTipText="{ "lima.ui.lettering.buttonRefresh" + " (F5)"}"
actionIcon='refresh'
onActionPerformed="handler.updateAllEntries()"/>
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatchart/VatChartView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatchart/VatChartView.jaxx 2014-07-23 08:52:27 UTC (rev 3856)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatchart/VatChartView.jaxx 2014-07-23 13:46:03 UTC (rev 3857)
@@ -42,18 +42,18 @@
<JToolBar floatable="false">
<JButton id="addVatStatementMovement"
- toolTipText="{ t("lima.vatstatement.movement.add") + " (Ctrl+N)"}"
+ toolTipText="{ "lima.vatstatement.movement.add" + " (Ctrl+N)"}"
actionIcon='vatstatement-new'
onActionPerformed="handler.addVatStatementMovement()"/>
<JButton id="updateButton"
- toolTipText="{ t("lima.common.update") + " (Ctrl+M)"}"
+ toolTipText="{ "lima.common.update" + " (Ctrl+M)"}"
actionIcon='vatstatement-edit'
onActionPerformed="handler.updateVatStatement()"
enabled="{isSelectedRow()}"/>
<JButton id="removeButton"
- toolTipText="{ t("lima.common.remove") + " (Del)"}"
+ toolTipText="{ "lima.common.remove" + " (Del)"}"
actionIcon='vatstatement-remove'
onActionPerformed="handler.removeVatStatement()"
enabled="{isSelectedRow()}"/>
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-23 08:52:27 UTC (rev 3856)
+++ trunk/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties 2014-07-23 13:46:03 UTC (rev 3857)
@@ -366,6 +366,7 @@
lima.ui.entry.add.error.beforeFirstFiscalPeriod=
lima.ui.entry.add.error.lockedEntryBook=
lima.ui.entry.add.error.lockedFinancialPeriod=
+lima.ui.entry.add.error.noFinancialPeriod=Any fiscal period are difined.
lima.ui.entry.paste.error.afterLastFiscalPeriod=
lima.ui.entry.paste.error.beforeFirstFiscalPeriod=
lima.ui.entry.paste.error.lockedEntryBook=
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-23 08:52:27 UTC (rev 3856)
+++ trunk/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties 2014-07-23 13:46:03 UTC (rev 3857)
@@ -348,6 +348,7 @@
lima.ui.entry.add.error.beforeFirstFiscalPeriod=Impossible d'ajouter une entré car la date de la transaction est avant le %1$te %1$tB %1$tY début du premier exercice.
lima.ui.entry.add.error.lockedEntryBook=Impossible d'ajouter une entré car le jounal %2$s (%1$s) est cloturé pour la période du %3$te %3$tB %3$tY au %4$te %4$tB %4$tY.
lima.ui.entry.add.error.lockedFinancialPeriod=Impossible d'ajouter une entré car la période fiscale du %3$te %3$tB %3$tY au %4$te %4$tB %4$tY est cloturée.
+lima.ui.entry.add.error.noFinancialPeriod=Aucune période fiscale n'est définie.
lima.ui.entry.paste.error.afterLastFiscalPeriod=Impossible de copier une entré car la date de la transaction est après le %1$te %1$tB %1$tY fin du dernier exercice.
lima.ui.entry.paste.error.beforeFirstFiscalPeriod=Impossible de copier une entré car la date de la transaction est avant le %1$te %1$tB %1$tY début du premier exercice.
lima.ui.entry.paste.error.lockedEntryBook=Impossible de copier une entré car le jounal %2$s (%1$s) est cloturé pour la période du %3$te %3$tB %3$tY au %4$te %4$tB %4$tY.
1
0
Author: sbavencoff
Date: 2014-07-23 10:52:27 +0200 (Wed, 23 Jul 2014)
New Revision: 3856
Url: http://forge.chorem.org/projects/lima/repository/revisions/3856
Log:
refs #974 : change filter view
Modified:
trunk/lima-swing/src/main/java/org/chorem/lima/ui/Filter/AccountCondition/AccountConditionHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/Filter/AccountCondition/AccountConditionView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/Filter/BigDecimalCondition/BigDecimalConditionView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/Filter/BigDecimalCondition/CreditConditionView.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/Filter/BigDecimalCondition/DebitConditionView.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/Filter/ConditionHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/Filter/EntryBookCondition/EntryBookConditionHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/Filter/EntryBookCondition/EntryBookConditionView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/Filter/StringCondition/DescriptionConditionView.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/Filter/StringCondition/LetteringConditionView.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/Filter/StringCondition/StringConditionView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/Filter/StringCondition/VoucherConditionView.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/Filter/dateCondition/DateConditionView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/Filter/dateIntervalCondition/DateIntervalConditionHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/Filter/dateIntervalCondition/DateIntervalConditionView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/Filter/financialPeriodCondition/FinancialPeriodConditionHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/Filter/financialPeriodCondition/FinancialPeriodConditionView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/Filter/financialTransactionCondition/FinancialTransactionConditionHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/Filter/financialTransactionCondition/FinancialTransactionConditionView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/Filter/fiscalPeriodCondition/FiscalPeriodConditionHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/Filter/fiscalPeriodCondition/FiscalPeriodConditionView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchView.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/Filter/AccountCondition/AccountConditionHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/Filter/AccountCondition/AccountConditionHandler.java 2014-07-22 13:36:55 UTC (rev 3855)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/Filter/AccountCondition/AccountConditionHandler.java 2014-07-23 08:52:27 UTC (rev 3856)
@@ -31,7 +31,6 @@
import org.chorem.lima.ui.Filter.ConditionHandler;
import org.chorem.lima.ui.Filter.financialTransactionCondition.FinancialTransactionConditionHandler;
-import javax.swing.*;
import java.awt.event.ItemEvent;
/**
@@ -74,7 +73,7 @@
}
@Override
- public JComponent getView() {
+ public AccountConditionView getView() {
return view;
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/Filter/AccountCondition/AccountConditionView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/Filter/AccountCondition/AccountConditionView.jaxx 2014-07-22 13:36:55 UTC (rev 3855)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/Filter/AccountCondition/AccountConditionView.jaxx 2014-07-23 08:52:27 UTC (rev 3856)
@@ -22,10 +22,14 @@
<http://www.gnu.org/licenses/gpl-3.0.html>.
#L%
-->
+<JInternalFrame title="lima.ui.financialtransaction.account"
+ preferredSize="{new Dimension(400, 100)}"
+ onInternalFrameClosed="handler.delete()"
+ layout="{new FlowLayout()}">
-<Table>
<import>
java.awt.Dimension
+ java.awt.FlowLayout
javax.swing.ListSelectionModel
javax.swing.text.Document
javax.swing.DefaultComboBoxModel
@@ -38,21 +42,11 @@
<org.chorem.lima.ui.combobox.AccountComboBoxModel id="accountModel" />
- <row>
- <cell>
- <JButton toolTipText="lima.filter.condition.delete"
- actionIcon='remove-condition'
- onActionPerformed="handler.delete()" />
- </cell>
- <cell>
- <JLabel text="lima.ui.financialtransaction.account"/>
- </cell>
- <cell weightx="1" anchor="west">
- <JComboBox id="account"
- model="{accountModel}"
- renderer="{new AccountListRenderer()}"
- selectedItem="{handler.getAccount()}"
- onItemStateChanged="handler.accountSelected(event)"/>
- </cell>
- </row>
-</Table>
\ No newline at end of file
+ <JComboBox id="account"
+ preferredSize="{new Dimension(390, 30)}"
+ model="{accountModel}"
+ renderer="{new AccountListRenderer()}"
+ selectedItem="{handler.getAccount()}"
+ onItemStateChanged="handler.accountSelected(event)"/>
+
+</JInternalFrame>
\ No newline at end of file
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/Filter/BigDecimalCondition/BigDecimalConditionView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/Filter/BigDecimalCondition/BigDecimalConditionView.jaxx 2014-07-22 13:36:55 UTC (rev 3855)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/Filter/BigDecimalCondition/BigDecimalConditionView.jaxx 2014-07-23 08:52:27 UTC (rev 3856)
@@ -22,10 +22,14 @@
<http://www.gnu.org/licenses/gpl-3.0.html>.
#L%
-->
-
-<Table>
+<JInternalFrame title=""
+ preferredSize="{new Dimension(200, 100)}"
+ minimumSize="{new Dimension(200, 100)}"
+ onInternalFrameClosed="handler.delete()"
+ layout="{new FlowLayout()}">
<import>
java.awt.Dimension
+ java.awt.FlowLayout
javax.swing.ListSelectionModel
javax.swing.text.Document
javax.swing.DefaultComboBoxModel
@@ -38,35 +42,22 @@
<BigDecimalConditionHandler id="handler"
javaBean="new BigDecimalConditionHandler(this)"/>
- <row>
- <cell >
- <JButton toolTipText="lima.filter.condition.delete"
- actionIcon='remove-condition'
- onActionPerformed="handler.delete()" />
- </cell>
- <cell>
- <JLabel id="label" text=""/>
- </cell>
- <cell>
- <JComboBox id="operandComboBox"
- model="{new DefaultComboBoxModel(AbstractBigDecimalCondition.Operand.values())}"
- renderer="{new LabelListCellRenderer()}"
- selectedItem="{handler.getOperand()}"
- onItemStateChanged="handler.operandSelected(event)"/>
- </cell>
- <cell weightx="1" anchor="west">
- <NumberEditor id="bigDecimaleditor"
- constructorParams="this"
- bean="{handler}"
- model="{handler.getValue()}"
- property="value"
- modelType="{BigDecimal.class}"
- numberPattern="([1-9]\d*|0)(\.\d*)?"
- useFloat="true"
- useSign="false"
- autoPopup="false"
- showPopupButton="false"
- showReset="false"/>
- </cell>
- </row>
-</Table>
\ No newline at end of file
+
+ <JComboBox id="operandComboBox"
+ model="{new DefaultComboBoxModel(AbstractBigDecimalCondition.Operand.values())}"
+ renderer="{new LabelListCellRenderer()}"
+ selectedItem="{handler.getOperand()}"
+ onItemStateChanged="handler.operandSelected(event)"/>
+ <NumberEditor id="bigDecimaleditor"
+ constructorParams="this"
+ bean="{handler}"
+ model="{handler.getValue()}"
+ property="value"
+ modelType="{BigDecimal.class}"
+ numberPattern="([1-9]\d*|0)(\.\d*)?"
+ useFloat="true"
+ useSign="false"
+ autoPopup="false"
+ showPopupButton="false"
+ showReset="false"/>
+</JInternalFrame>
\ No newline at end of file
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/Filter/BigDecimalCondition/CreditConditionView.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/Filter/BigDecimalCondition/CreditConditionView.java 2014-07-22 13:36:55 UTC (rev 3855)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/Filter/BigDecimalCondition/CreditConditionView.java 2014-07-23 08:52:27 UTC (rev 3856)
@@ -34,7 +34,7 @@
public CreditConditionView() {
super();
setHandler(new CreditConditionHandler(this));
- getLabel().setText(t("lima.ui.financialtransaction.credit"));
+ setTitle(t("lima.ui.financialtransaction.credit"));
getBigDecimaleditor().setBean(handler);
getBigDecimaleditor().init();
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/Filter/BigDecimalCondition/DebitConditionView.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/Filter/BigDecimalCondition/DebitConditionView.java 2014-07-22 13:36:55 UTC (rev 3855)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/Filter/BigDecimalCondition/DebitConditionView.java 2014-07-23 08:52:27 UTC (rev 3856)
@@ -34,7 +34,7 @@
public DebitConditionView() {
super();
setHandler(new DebitConditionHandler(this));
- getLabel().setText(t("lima.ui.financialtransaction.debit"));
+ setTitle(t("lima.ui.financialtransaction.debit"));
getBigDecimaleditor().setBean(handler);
getBigDecimaleditor().init();
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/Filter/ConditionHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/Filter/ConditionHandler.java 2014-07-22 13:36:55 UTC (rev 3855)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/Filter/ConditionHandler.java 2014-07-23 08:52:27 UTC (rev 3856)
@@ -36,7 +36,7 @@
public Condition getCondition();
- public JComponent getView();
+ public JInternalFrame getView();
public void setFilterHandler(FinancialTransactionConditionHandler filterHandler);
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/Filter/EntryBookCondition/EntryBookConditionHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/Filter/EntryBookCondition/EntryBookConditionHandler.java 2014-07-22 13:36:55 UTC (rev 3855)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/Filter/EntryBookCondition/EntryBookConditionHandler.java 2014-07-23 08:52:27 UTC (rev 3856)
@@ -34,7 +34,6 @@
import org.chorem.lima.ui.Filter.ConditionHandler;
import org.chorem.lima.ui.Filter.financialTransactionCondition.FinancialTransactionConditionHandler;
-import javax.swing.JComponent;
import javax.swing.JList;
import javax.swing.event.ListSelectionEvent;
import java.util.List;
@@ -63,7 +62,7 @@
}
@Override
- public JComponent getView() {
+ public EntryBookConditionView getView() {
return view;
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/Filter/EntryBookCondition/EntryBookConditionView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/Filter/EntryBookCondition/EntryBookConditionView.jaxx 2014-07-22 13:36:55 UTC (rev 3855)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/Filter/EntryBookCondition/EntryBookConditionView.jaxx 2014-07-23 08:52:27 UTC (rev 3856)
@@ -22,8 +22,9 @@
<http://www.gnu.org/licenses/gpl-3.0.html>.
#L%
-->
-
-<Table>
+<JInternalFrame title="lima.enum.list.entryBook"
+ preferredSize="{new Dimension(400, 100)}"
+ onInternalFrameClosed="handler.delete()">
<import>
java.awt.Dimension
javax.swing.ListSelectionModel
@@ -32,25 +33,12 @@
</import>
<EntryBookConditionHandler id="handler"
javaBean="new EntryBookConditionHandler(this)"/>
-
- <row>
- <cell >
- <JButton toolTipText="lima.filter.condition.delete"
- actionIcon='remove-condition'
- onActionPerformed="handler.delete()" />
- </cell>
- <cell>
- <JLabel text="lima.enum.list.entryBook"/>
- </cell>
- <cell weightx="1" anchor="west">
- <JScrollPane preferredSize="{new Dimension(300, 60)}" minimumSize="{new Dimension(300, 60)}">
- <JList id="entryBookList"
- selectionMode="{ListSelectionModel.MULTIPLE_INTERVAL_SELECTION}"
- visibleRowCount="-1"
- listData="{handler.getEntryBookList()}"
- cellRenderer="{LimaRendererUtil.newDecoratorListCellRenderer(EntryBook.class)}"
- onValueChanged="handler.setEntryBook(event)"/>
- </JScrollPane>
- </cell>
- </row>
-</Table>
\ No newline at end of file
+ <JScrollPane >
+ <JList id="entryBookList"
+ selectionMode="{ListSelectionModel.MULTIPLE_INTERVAL_SELECTION}"
+ visibleRowCount="-1"
+ listData="{handler.getEntryBookList()}"
+ cellRenderer="{LimaRendererUtil.newDecoratorListCellRenderer(EntryBook.class)}"
+ onValueChanged="handler.setEntryBook(event)"/>
+ </JScrollPane>
+</JInternalFrame>
\ No newline at end of file
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/Filter/StringCondition/DescriptionConditionView.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/Filter/StringCondition/DescriptionConditionView.java 2014-07-22 13:36:55 UTC (rev 3855)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/Filter/StringCondition/DescriptionConditionView.java 2014-07-23 08:52:27 UTC (rev 3856)
@@ -34,6 +34,6 @@
public DescriptionConditionView() {
super();
setHandler(new DescriptionConditionHandler(this));
- getLabel().setText(t("lima.ui.financialtransaction.description"));
+ setTitle(t("lima.ui.financialtransaction.description"));
}
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/Filter/StringCondition/LetteringConditionView.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/Filter/StringCondition/LetteringConditionView.java 2014-07-22 13:36:55 UTC (rev 3855)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/Filter/StringCondition/LetteringConditionView.java 2014-07-23 08:52:27 UTC (rev 3856)
@@ -34,6 +34,6 @@
public LetteringConditionView() {
super();
setHandler(new LetteringConditionHandler(this));
- getLabel().setText(t("lima.ui.financialtransaction.letter"));
+ setTitle(t("lima.ui.financialtransaction.letter"));
}
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/Filter/StringCondition/StringConditionView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/Filter/StringCondition/StringConditionView.jaxx 2014-07-22 13:36:55 UTC (rev 3855)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/Filter/StringCondition/StringConditionView.jaxx 2014-07-23 08:52:27 UTC (rev 3856)
@@ -22,10 +22,14 @@
<http://www.gnu.org/licenses/gpl-3.0.html>.
#L%
-->
-
-<Table>
+<JInternalFrame title="lima.filter.date.window"
+ preferredSize="{new Dimension(200, 100)}"
+ minimumSize="{new Dimension(200, 100)}"
+ onInternalFrameClosed="handler.delete()"
+ layout="{new FlowLayout(FlowLayout.CENTER, 0, 0)}">
<import>
java.awt.Dimension
+ java.awt.FlowLayout
javax.swing.ListSelectionModel
javax.swing.text.Document
javax.swing.DefaultComboBoxModel
@@ -35,33 +39,16 @@
<StringConditionHandler id="handler"
javaBean="new StringConditionHandler(this)"/>
-
- <row>
- <cell >
- <JButton toolTipText="lima.filter.condition.delete"
- actionIcon='remove-condition'
- onActionPerformed="handler.delete()" />
- </cell>
- <cell>
- <JLabel id="label" text=""/>
- </cell>
- <cell>
- <JComboBox id="operandComboBox"
- model="{new DefaultComboBoxModel(AbstractStringCondition.Operand.values())}"
- renderer="{new LabelListCellRenderer()}"
- selectedItem="{handler.getOperand()}"
- onItemStateChanged="handler.operandSelected(event)"/>
- </cell>
- <cell>
- <JTextField id="textField"
- text="{handler.getText()}"
- onKeyReleased="handler.setText(event)" />
- </cell>
- <cell weightx="1" anchor="west">
- <JCheckBox id="sensitiveCaseCheckBox"
- text="lima.filer.condition.sensitive.case"
- selected="{handler.isSensitiveCase()}"
- onActionPerformed="handler.setSensitiveCase(event)" />
- </cell>
- </row>
-</Table>
\ No newline at end of file
+ <JComboBox id="operandComboBox"
+ model="{new DefaultComboBoxModel(AbstractStringCondition.Operand.values())}"
+ renderer="{new LabelListCellRenderer()}"
+ selectedItem="{handler.getOperand()}"
+ onItemStateChanged="handler.operandSelected(event)"/>
+ <JTextField id="textField"
+ text="{handler.getText()}"
+ onKeyReleased="handler.setText(event)" />
+ <JCheckBox id="sensitiveCaseCheckBox"
+ text="lima.filer.condition.sensitive.case"
+ selected="{handler.isSensitiveCase()}"
+ onActionPerformed="handler.setSensitiveCase(event)" />
+</JInternalFrame>
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/Filter/StringCondition/VoucherConditionView.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/Filter/StringCondition/VoucherConditionView.java 2014-07-22 13:36:55 UTC (rev 3855)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/Filter/StringCondition/VoucherConditionView.java 2014-07-23 08:52:27 UTC (rev 3856)
@@ -34,7 +34,7 @@
public VoucherConditionView() {
super();
setHandler(new VoucherConditionHandler(this));
- getLabel().setText(t("lima.ui.financialtransaction.voucher"));
+ setTitle(t("lima.ui.financialtransaction.voucher"));
}
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/Filter/dateCondition/DateConditionView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/Filter/dateCondition/DateConditionView.jaxx 2014-07-22 13:36:55 UTC (rev 3855)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/Filter/dateCondition/DateConditionView.jaxx 2014-07-23 08:52:27 UTC (rev 3856)
@@ -22,10 +22,14 @@
<http://www.gnu.org/licenses/gpl-3.0.html>.
#L%
-->
-
-<Table>
+<JInternalFrame title="lima.ui.financialtransaction.date"
+ preferredSize="{new Dimension(200, 100)}"
+ minimumSize="{new Dimension(200, 100)}"
+ onInternalFrameClosed="handler.delete()"
+ layout="{new FlowLayout()}">
<import>
java.awt.Dimension
+ java.awt.FlowLayout
javax.swing.ListSelectionModel
javax.swing.text.Document
javax.swing.DefaultComboBoxModel
@@ -35,27 +39,13 @@
<DateConditionHandler id="handler"
javaBean="new DateConditionHandler(this)"/>
- <row>
- <cell >
- <JButton toolTipText="lima.filter.condition.delete"
- actionIcon='remove-condition'
- onActionPerformed="handler.delete()" />
- </cell>
- <cell>
- <JLabel text="lima.ui.financialtransaction.date"/>
- </cell>
- <cell>
- <JComboBox id="operandComboBox"
- model="{new DefaultComboBoxModel(DateCondition.Operand.values())}"
- renderer="{new LabelListCellRenderer()}"
- selectedItem="{handler.getOperand()}"
- onItemStateChanged="handler.operandSelected(event)"/>
- </cell>
- <cell weightx="1" anchor="west">
- <JAXXDatePicker id='datePicker'
- date='{handler.getDate()}'
- formats='{handler.getFormats()}'
- onActionPerformed='handler.setDate(datePicker.getDate())'/>
- </cell>
- </row>
-</Table>
\ No newline at end of file
+ <JComboBox id="operandComboBox"
+ model="{new DefaultComboBoxModel(DateCondition.Operand.values())}"
+ renderer="{new LabelListCellRenderer()}"
+ selectedItem="{handler.getOperand()}"
+ onItemStateChanged="handler.operandSelected(event)"/>
+ <JAXXDatePicker id='datePicker'
+ date='{handler.getDate()}'
+ formats='{handler.getFormats()}'
+ onActionPerformed='handler.setDate(datePicker.getDate())'/>
+</JInternalFrame>
\ No newline at end of file
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/Filter/dateIntervalCondition/DateIntervalConditionHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/Filter/dateIntervalCondition/DateIntervalConditionHandler.java 2014-07-22 13:36:55 UTC (rev 3855)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/Filter/dateIntervalCondition/DateIntervalConditionHandler.java 2014-07-23 08:52:27 UTC (rev 3856)
@@ -32,7 +32,6 @@
import org.chorem.lima.ui.Filter.financialTransactionCondition.FinancialTransactionConditionHandler;
import org.chorem.lima.ui.financialtransactionsearch.FinancialTransactionSearchViewHandler;
-import javax.swing.*;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
@@ -63,7 +62,7 @@
}
@Override
- public JComponent getView() {
+ public DateIntervalConditionView getView() {
return view;
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/Filter/dateIntervalCondition/DateIntervalConditionView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/Filter/dateIntervalCondition/DateIntervalConditionView.jaxx 2014-07-22 13:36:55 UTC (rev 3855)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/Filter/dateIntervalCondition/DateIntervalConditionView.jaxx 2014-07-23 08:52:27 UTC (rev 3856)
@@ -23,7 +23,10 @@
#L%
-->
-<Table>
+<JInternalFrame title="lima.ui.financialtransaction.dateInterval"
+ preferredSize="{new Dimension(200, 100)}"
+ minimumSize="{new Dimension(200, 100)}"
+ onInternalFrameClosed="handler.delete()">
<import>
java.awt.Dimension
javax.swing.ListSelectionModel
@@ -33,30 +36,28 @@
</import>
<DateIntervalConditionHandler id="handler"
javaBean="new DateIntervalConditionHandler(this)"/>
-
- <row>
- <cell >
- <JButton toolTipText="lima.filter.condition.delete"
- actionIcon='remove-condition'
- onActionPerformed="handler.delete()" />
- </cell>
- <cell>
- <JLabel text="lima.ui.financialtransaction.date.in"/>
- </cell>
- <cell>
- <JAXXDatePicker id='beginDatePicker'
- date='{handler.getBeginDate()}'
- formats='{handler.getFormats()}'
- onActionPerformed='handler.setBeginDate(beginDatePicker.getDate())'/>
- </cell>
- <cell>
- <JLabel text="lima.ui.financialtransaction.date.to"/>
- </cell>
- <cell weightx="1" anchor="west">
- <JAXXDatePicker id='endDatePicker'
- date='{handler.getEndDate()}'
- formats='{handler.getFormats()}'
- onActionPerformed='handler.setEndDate(endDatePicker.getDate())'/>
- </cell>
- </row>
-</Table>
\ No newline at end of file
+ <Table>
+ <row>
+ <cell>
+ <JLabel text="lima.ui.financialtransaction.dateInterval.in"/>
+ </cell>
+ <cell>
+ <JAXXDatePicker id='beginDatePicker'
+ date='{handler.getBeginDate()}'
+ formats='{handler.getFormats()}'
+ onActionPerformed='handler.setBeginDate(beginDatePicker.getDate())'/>
+ </cell>
+ </row>
+ <row>
+ <cell>
+ <JLabel text="lima.ui.financialtransaction.dateInterval.to"/>
+ </cell>
+ <cell>
+ <JAXXDatePicker id='endDatePicker'
+ date='{handler.getEndDate()}'
+ formats='{handler.getFormats()}'
+ onActionPerformed='handler.setEndDate(endDatePicker.getDate())'/>
+ </cell>
+ </row>
+ </Table>
+</JInternalFrame>
\ No newline at end of file
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/Filter/financialPeriodCondition/FinancialPeriodConditionHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/Filter/financialPeriodCondition/FinancialPeriodConditionHandler.java 2014-07-22 13:36:55 UTC (rev 3855)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/Filter/financialPeriodCondition/FinancialPeriodConditionHandler.java 2014-07-23 08:52:27 UTC (rev 3856)
@@ -35,7 +35,6 @@
import org.chorem.lima.ui.Filter.financialTransactionCondition.FinancialTransactionConditionHandler;
import org.chorem.lima.ui.financialtransactionsearch.FinancialTransactionSearchViewHandler;
-import javax.swing.JComponent;
import javax.swing.JList;
import javax.swing.event.ListSelectionEvent;
import java.util.List;
@@ -66,7 +65,7 @@
}
@Override
- public JComponent getView() {
+ public FinancialPeriodConditionView getView() {
return view;
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/Filter/financialPeriodCondition/FinancialPeriodConditionView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/Filter/financialPeriodCondition/FinancialPeriodConditionView.jaxx 2014-07-22 13:36:55 UTC (rev 3855)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/Filter/financialPeriodCondition/FinancialPeriodConditionView.jaxx 2014-07-23 08:52:27 UTC (rev 3856)
@@ -22,8 +22,10 @@
<http://www.gnu.org/licenses/gpl-3.0.html>.
#L%
-->
-
-<Table>
+<JInternalFrame title="lima.enum.comboboxperiod.financialperiod"
+ preferredSize="{new Dimension(200, 100)}"
+ minimumSize="{new Dimension(200, 100)}"
+ onInternalFrameClosed="handler.delete()">
<import>
java.awt.Dimension
javax.swing.ListSelectionModel
@@ -33,24 +35,12 @@
<FinancialPeriodConditionHandler id="handler"
javaBean="new FinancialPeriodConditionHandler(this)"/>
- <row>
- <cell >
- <JButton toolTipText="lima.filter.condition.delete"
- actionIcon='remove-condition'
- onActionPerformed="handler.delete()" />
- </cell>
- <cell>
- <JLabel text="lima.enum.comboboxperiod.financialperiod"/>
- </cell>
- <cell weightx="1" anchor="west">
- <JScrollPane preferredSize="{new Dimension(250, 80)}" minimumSize="{new Dimension(250, 80)}">
- <JList id="financialPeriodList"
- selectionMode="{ListSelectionModel.MULTIPLE_INTERVAL_SELECTION}"
- visibleRowCount="-1"
- listData="{handler.getFinancialPeriodList()}"
- cellRenderer="{LimaRendererUtil.newDecoratorListCellRenderer(FinancialPeriod.class)}"
- onValueChanged="handler.setFinancialPeriod(event)"/>
- </JScrollPane>
- </cell>
- </row>
-</Table>
\ No newline at end of file
+ <JScrollPane>
+ <JList id="financialPeriodList"
+ selectionMode="{ListSelectionModel.MULTIPLE_INTERVAL_SELECTION}"
+ visibleRowCount="-1"
+ listData="{handler.getFinancialPeriodList()}"
+ cellRenderer="{LimaRendererUtil.newDecoratorListCellRenderer(FinancialPeriod.class)}"
+ onValueChanged="handler.setFinancialPeriod(event)"/>
+ </JScrollPane>
+</JInternalFrame>
\ No newline at end of file
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/Filter/financialTransactionCondition/FinancialTransactionConditionHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/Filter/financialTransactionCondition/FinancialTransactionConditionHandler.java 2014-07-22 13:36:55 UTC (rev 3855)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/Filter/financialTransactionCondition/FinancialTransactionConditionHandler.java 2014-07-23 08:52:27 UTC (rev 3856)
@@ -32,6 +32,7 @@
import org.chorem.lima.ui.financialtransactionsearch.FinancialTransactionSearchViewHandler;
import javax.swing.*;
+import java.beans.PropertyVetoException;
import java.util.List;
/**
@@ -73,8 +74,13 @@
// add view
if (add) {
JPanel conditionPanel = view.getConditionPanel();
- JComponent conditionView = conditionHandler.getView();
+ JInternalFrame conditionView = conditionHandler.getView();
conditionPanel.add(conditionView);
+ try {
+ conditionView.setSelected(true);
+ } catch (PropertyVetoException e) {
+
+ }
conditionPanel.validate();
conditionPanel.repaint();
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/Filter/financialTransactionCondition/FinancialTransactionConditionView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/Filter/financialTransactionCondition/FinancialTransactionConditionView.jaxx 2014-07-22 13:36:55 UTC (rev 3855)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/Filter/financialTransactionCondition/FinancialTransactionConditionView.jaxx 2014-07-23 08:52:27 UTC (rev 3856)
@@ -23,37 +23,27 @@
#L%
-->
-<Table>
+<JPanel layout="{new BorderLayout()}">
<import>
java.awt.Dimension
javax.swing.ListSelectionModel
javax.swing.text.Document
- javax.swing.BoxLayout
+ java.awt.FlowLayout
</import>
<FinancialTransactionConditionHandler id="handler"
javaBean="new FinancialTransactionConditionHandler(this)"/>
- <row>
- <cell weightx="1" anchor="east">
- <JRadioButton text="lima.filter.condition.one"
- id="AllRadioButton"
- onActionPerformed="handler.setAllConditions(false)"
- buttonGroup="radioButtons"
- selected="{!handler.isAllConditions()}"/>
- </cell>
- <cell weightx="0" >
- <JRadioButton text="lima.filter.condition.all"
- id="OneRadioButton"
- onActionPerformed="handler.setAllConditions(true)"
- buttonGroup="radioButtons"
- selected="{handler.isAllConditions()}"/>
- </cell>
- </row>
- <row>
- <cell fill="both" weightx="1" columns="2" anchor="west">
- <JPanel id="conditionPanel"
- layout="{new BoxLayout(conditionPanel, BoxLayout.PAGE_AXIS)}">
- </JPanel>
- </cell>
- </row>
-</Table>
\ No newline at end of file
+ <JPanel constraints="BorderLayout.NORTH">
+ <JRadioButton text="lima.filter.condition.one"
+ id="AllRadioButton"
+ onActionPerformed="handler.setAllConditions(false)"
+ buttonGroup="radioButtons"
+ selected="{!handler.isAllConditions()}"/>
+ <JRadioButton text="lima.filter.condition.all"
+ id="OneRadioButton"
+ onActionPerformed="handler.setAllConditions(true)"
+ buttonGroup="radioButtons"
+ selected="{handler.isAllConditions()}"/>
+ </JPanel>
+ <JPanel id="conditionPanel" constraints="BorderLayout.CENTER" layout="{new FlowLayout(FlowLayout.LEADING, 0, 0)}"/>
+</JPanel>
\ No newline at end of file
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/Filter/fiscalPeriodCondition/FiscalPeriodConditionHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/Filter/fiscalPeriodCondition/FiscalPeriodConditionHandler.java 2014-07-22 13:36:55 UTC (rev 3855)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/Filter/fiscalPeriodCondition/FiscalPeriodConditionHandler.java 2014-07-23 08:52:27 UTC (rev 3856)
@@ -34,7 +34,6 @@
import org.chorem.lima.ui.Filter.ConditionHandler;
import org.chorem.lima.ui.Filter.financialTransactionCondition.FinancialTransactionConditionHandler;
-import javax.swing.JComponent;
import javax.swing.JList;
import javax.swing.event.ListSelectionEvent;
import java.util.List;
@@ -64,7 +63,7 @@
}
@Override
- public JComponent getView() {
+ public FiscalPeriodConditionView getView() {
return view;
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/Filter/fiscalPeriodCondition/FiscalPeriodConditionView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/Filter/fiscalPeriodCondition/FiscalPeriodConditionView.jaxx 2014-07-22 13:36:55 UTC (rev 3855)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/Filter/fiscalPeriodCondition/FiscalPeriodConditionView.jaxx 2014-07-23 08:52:27 UTC (rev 3856)
@@ -22,8 +22,10 @@
<http://www.gnu.org/licenses/gpl-3.0.html>.
#L%
-->
-
-<Table>
+<JInternalFrame title="lima.enum.comboboxperiod.fiscalperiod"
+ preferredSize="{new Dimension(200, 100)}"
+ minimumSize="{new Dimension(200, 100)}"
+ onInternalFrameClosed="handler.delete()">
<import>
java.awt.Dimension
javax.swing.ListSelectionModel
@@ -33,24 +35,13 @@
<FiscalPeriodConditionHandler id="handler"
javaBean="new FiscalPeriodConditionHandler(this)"/>
- <row>
- <cell >
- <JButton toolTipText="lima.filter.condition.delete"
- actionIcon='remove-condition'
- onActionPerformed="handler.delete()" />
- </cell>
- <cell>
- <JLabel text="lima.enum.comboboxperiod.fiscalperiod"/>
- </cell>
- <cell weightx="1" anchor="west">
- <JScrollPane preferredSize="{new Dimension(250, 80)}" minimumSize="{new Dimension(250, 80)}">
- <JList id="fiscalPeriodList"
- selectionMode="{ListSelectionModel.MULTIPLE_INTERVAL_SELECTION}"
- visibleRowCount="-1"
- listData="{handler.getFiscalPeriodList()}"
- cellRenderer="{LimaRendererUtil.newDecoratorListCellRenderer(FiscalPeriod.class)}"
- onValueChanged="handler.setFiscalPeriod(event)"/>
- </JScrollPane>
- </cell>
- </row>
-</Table>
\ No newline at end of file
+
+ <JScrollPane >
+ <JList id="fiscalPeriodList"
+ selectionMode="{ListSelectionModel.MULTIPLE_INTERVAL_SELECTION}"
+ visibleRowCount="-1"
+ listData="{handler.getFiscalPeriodList()}"
+ cellRenderer="{LimaRendererUtil.newDecoratorListCellRenderer(FiscalPeriod.class)}"
+ onValueChanged="handler.setFiscalPeriod(event)"/>
+ </JScrollPane>
+</JInternalFrame>
\ No newline at end of file
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchView.jaxx 2014-07-22 13:36:55 UTC (rev 3855)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchView.jaxx 2014-07-23 08:52:27 UTC (rev 3856)
@@ -23,11 +23,12 @@
#L%
-->
-<Table>
+<JPanel layout="{new BorderLayout()}">
<import>
java.awt.Dimension
javax.swing.ListSelectionModel
javax.swing.text.Document
+ javax.swing.ScrollPaneConstants
org.chorem.lima.ui.Filter.financialTransactionCondition.FinancialTransactionConditionView
org.chorem.lima.enums.ComboBoxPeriodEnum
org.chorem.lima.enums.ComboBoxAccountsEnum
@@ -45,79 +46,71 @@
javaBean="new FinancialTransactionSearchViewHandler(this)"/>
<Boolean id="selectedRow" javaBean="false"/>
<Dimension id="fieldSize" javaBean="new java.awt.Dimension()"/>
- <row>
- <cell fill="both">
- <JToolBar floatable="false">
- <JButton toolTipText="lima.filter.date.one"
- actionIcon='filter-transaction-date'
- onActionPerformed="getHandler().addDateCondition()"/>
- <JButton toolTipText="lima.filter.date.interval"
- actionIcon='filter-transaction-interval'
- onActionPerformed="getHandler().addDateIntervalCondition()"/>
- <JButton toolTipText="lima.filter.date.financial.period"
- actionIcon='filter-transaction-financial-period'
- onActionPerformed="getHandler().addFinancialPeriodCondition()"/>
- <JButton toolTipText="lima.filter.date.fiscal.period"
- actionIcon='filter-transaction-fiscal-period'
- onActionPerformed="getHandler().addFiscalPeriodCondition()"/>
+ <JToolBar floatable="false" constraints="BorderLayout.NORTH">
+ <JButton toolTipText="lima.filter.date.one"
+ actionIcon='filter-transaction-date'
+ onActionPerformed="getHandler().addDateCondition()"/>
+ <JButton toolTipText="lima.filter.date.interval"
+ actionIcon='filter-transaction-interval'
+ onActionPerformed="getHandler().addDateIntervalCondition()"/>
+ <JButton toolTipText="lima.filter.date.financial.period"
+ actionIcon='filter-transaction-financial-period'
+ onActionPerformed="getHandler().addFinancialPeriodCondition()"/>
+ <JButton toolTipText="lima.filter.date.fiscal.period"
+ actionIcon='filter-transaction-fiscal-period'
+ onActionPerformed="getHandler().addFiscalPeriodCondition()"/>
- <JToolBar.Separator/>
+ <JToolBar.Separator/>
- <JButton toolTipText="lima.filter.entrybook"
- actionIcon='filter-transaction-entrybook'
- onActionPerformed="getHandler().addEntryBookCondition()"/>
+ <JButton toolTipText="lima.filter.entrybook"
+ actionIcon='filter-transaction-entrybook'
+ onActionPerformed="getHandler().addEntryBookCondition()"/>
- <JToolBar.Separator/>
+ <JToolBar.Separator/>
- <JButton toolTipText="lima.filter.voucher"
- actionIcon='filter-transaction-voucher'
- onActionPerformed="getHandler().addVoucherCondition()"/>
- <JButton toolTipText="lima.filter.account"
- actionIcon='filter-transaction-account'
- onActionPerformed="getHandler().addAccountCondition()"/>
- <JButton toolTipText="lima.filter.description"
- actionIcon='filter-transaction-description'
- onActionPerformed="getHandler().addDescriptionCondition()"/>
- <JButton toolTipText="lima.filter.letter"
- actionIcon='filter-transaction-letter'
- onActionPerformed="getHandler().addLetteringCondition()"/>
+ <JButton toolTipText="lima.filter.voucher"
+ actionIcon='filter-transaction-voucher'
+ onActionPerformed="getHandler().addVoucherCondition()"/>
+ <JButton toolTipText="lima.filter.account"
+ actionIcon='filter-transaction-account'
+ onActionPerformed="getHandler().addAccountCondition()"/>
+ <JButton toolTipText="lima.filter.description"
+ actionIcon='filter-transaction-description'
+ onActionPerformed="getHandler().addDescriptionCondition()"/>
+ <JButton toolTipText="lima.filter.letter"
+ actionIcon='filter-transaction-letter'
+ onActionPerformed="getHandler().addLetteringCondition()"/>
- <JToolBar.Separator/>
+ <JToolBar.Separator/>
- <JButton toolTipText="lima.filter.debit"
- actionIcon='filter-transaction-debit'
- onActionPerformed="getHandler().addDebitCondition()"/>
- <JButton toolTipText="lima.filter.credit"
- actionIcon='filter-transaction-credit'
- onActionPerformed="getHandler().addCreditCondition()"/>
- <JToolBar.Separator/>
- <JButton toolTipText="{ t("lima.ui.common.refresh") + " (F5)"}" actionIcon='refresh'
- onActionPerformed="getHandler().refresh()"/>
- </JToolBar>
- </cell>
- </row>
+ <JButton toolTipText="lima.filter.debit"
+ actionIcon='filter-transaction-debit'
+ onActionPerformed="getHandler().addDebitCondition()"/>
+ <JButton toolTipText="lima.filter.credit"
+ actionIcon='filter-transaction-credit'
+ onActionPerformed="getHandler().addCreditCondition()"/>
+ <JToolBar.Separator/>
+ <JButton toolTipText="{ t("lima.ui.common.refresh") + " (F5)"}" actionIcon='refresh'
+ onActionPerformed="getHandler().refresh()"/>
+ </JToolBar>
- <row>
- <cell fill='both' weightx="1">
+ <JSplitPane constraints="BorderLayout.CENTER"
+ orientation='{JSplitPane.VERTICAL_SPLIT}'>
+ <JScrollPane>
<FinancialTransactionConditionView id="financialTransactionConditionView" />
- </cell>
- </row>
-
- <row>
- <cell fill="both" weightx="1" weighty="1">
- <JScrollPane>
- <FinancialTransactionSearchTableModel
- id="financialTransactionSearchTableModel"/>
- <FinancialTransactionDefaultTable
- id="financialTransactionSearchTable"
- constructorParams='handler'
- rowHeight="22"
- model="{getFinancialTransactionSearchTableModel()}"
- selectionMode="{ListSelectionModel.SINGLE_SELECTION}"/>
- <ListSelectionModel
- javaBean="getFinancialTransactionSearchTable().getSelectionModel()"
- onValueChanged="setSelectedRow(financialTransactionSearchTable.getSelectedRow() != -1)"/>
- </JScrollPane>
- </cell>
- </row>
-</Table>
\ No newline at end of file
+ </JScrollPane>
+ <JScrollPane>
+ <FinancialTransactionSearchTableModel
+ id="financialTransactionSearchTableModel"/>
+ <FinancialTransactionDefaultTable
+ id="financialTransactionSearchTable"
+ constructorParams='handler'
+ rowHeight="22"
+ model="{getFinancialTransactionSearchTableModel()}"
+ selectionMode="{ListSelectionModel.SINGLE_SELECTION}"/>
+ <ListSelectionModel
+ javaBean="getFinancialTransactionSearchTable().getSelectionModel()"
+ onValueChanged="setSelectedRow(financialTransactionSearchTable.getSelectedRow() != -1)"/>
+ </JScrollPane>
+ </JSplitPane>
+</JPanel>
\ No newline at end of file
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-22 13:36:55 UTC (rev 3855)
+++ trunk/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties 2014-07-23 08:52:27 UTC (rev 3856)
@@ -236,6 +236,7 @@
lima.filter.date.fiscal.period=
lima.filter.date.interval=
lima.filter.date.one=
+lima.filter.date.window=
lima.filter.debit=
lima.filter.description=
lima.filter.entrybook=
@@ -427,6 +428,9 @@
lima.ui.financialtransaction.date=
lima.ui.financialtransaction.date.in=
lima.ui.financialtransaction.date.to=
+lima.ui.financialtransaction.dateInterval=
+lima.ui.financialtransaction.dateInterval.in=
+lima.ui.financialtransaction.dateInterval.to=
lima.ui.financialtransaction.debit=
lima.ui.financialtransaction.description=
lima.ui.financialtransaction.entrybook=
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-22 13:36:55 UTC (rev 3855)
+++ trunk/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties 2014-07-23 08:52:27 UTC (rev 3856)
@@ -220,6 +220,7 @@
lima.filter.date.fiscal.period=Ajouter un filtre sur l'exercice
lima.filter.date.interval=Ajouter un filtre sur un interval de dates
lima.filter.date.one=Ajouter un filtre sur une date
+lima.filter.date.window=
lima.filter.debit=Ajouter un filtre sur les débits
lima.filter.description=Ajouter un filtre sur les descriptions
lima.filter.entrybook=Ajouter un filtre sur les journaux
@@ -404,8 +405,9 @@
lima.ui.financialtransaction.buttonnext=→
lima.ui.financialtransaction.credit=Crédit
lima.ui.financialtransaction.date=Date
-lima.ui.financialtransaction.date.in=Date du
-lima.ui.financialtransaction.date.to=au
+lima.ui.financialtransaction.dateInterval=Interval de dates
+lima.ui.financialtransaction.dateInterval.in=Du
+lima.ui.financialtransaction.dateInterval.to=au
lima.ui.financialtransaction.debit=Débit
lima.ui.financialtransaction.description=Description
lima.ui.financialtransaction.entrybook=Journal
1
0
r3855 - trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction
by sbavencoff@users.chorem.org 22 Jul '14
by sbavencoff@users.chorem.org 22 Jul '14
22 Jul '14
Author: sbavencoff
Date: 2014-07-22 15:36:55 +0200 (Tue, 22 Jul 2014)
New Revision: 3855
Url: http://forge.chorem.org/projects/lima/repository/revisions/3855
Log:
fixes #1045 : disable lettering column
Modified:
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/LetterColumn.java
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/LetterColumn.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/LetterColumn.java 2014-07-18 15:52:47 UTC (rev 3854)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/LetterColumn.java 2014-07-22 13:36:55 UTC (rev 3855)
@@ -36,7 +36,7 @@
public class LetterColumn extends AbstractColumn<FinancialTransactionTableModel> {
public LetterColumn() {
- super(String.class, t("lima.table.letter"), true);
+ super(String.class, t("lima.table.letter"), false);
}
@Override
1
0
r3854 - trunk/lima-business/src/main/java/org/chorem/lima/business/ejb
by sbavencoff@users.chorem.org 18 Jul '14
by sbavencoff@users.chorem.org 18 Jul '14
18 Jul '14
Author: sbavencoff
Date: 2014-07-18 17:52:47 +0200 (Fri, 18 Jul 2014)
New Revision: 3854
Url: http://forge.chorem.org/projects/lima/repository/revisions/3854
Log:
refs #1044 : fiscal period
Modified:
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FiscalPeriodServiceImpl.java
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-18 15:33:15 UTC (rev 3853)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FiscalPeriodServiceImpl.java 2014-07-18 15:52:47 UTC (rev 3854)
@@ -111,9 +111,6 @@
MoreOneUnlockFiscalPeriodException {
FiscalPeriodTopiaDao fiscalPeriodTopiaDao = getDaoHelper().getFiscalPeriodDao();
- FinancialPeriodTopiaDao financialPeriodTopiaDao = getDaoHelper().getFinancialPeriodDao();
-
- ClosedPeriodicEntryBookTopiaDao closedPeriodicEntryBookTopiaDao = getDaoHelper().getClosedPeriodicEntryBookDao();
EntryBookTopiaDao entryBookTopiaDao = getDaoHelper().getEntryBookDao();
AccountingRules accountingRules = LimaConfig.getInstance().getAccountingRules();
@@ -224,7 +221,7 @@
// Get the old fiscal period instance for no object conflict
FiscalPeriod oldFiscalPeriod =
- fiscalPeriodTopiaDao.findByTopiaId(fiscalPeriod.getTopiaId());
+ fiscalPeriodTopiaDao.forTopiaIdEquals(fiscalPeriod.getTopiaId()).findUnique();
// lock fiscalperiod
oldFiscalPeriod.setLocked(true);
@@ -245,19 +242,13 @@
financialTransactionService.getAllFinancialTransactions(
fiscalPeriod.getBeginDate(), fiscalPeriod.getEndDate());
//check if they are at least one transaction to be report
- if (!financialTransactionsList.isEmpty()) {
- int i = 0;
- while (i < financialTransactionsList.size() && !found) {
- Collection<Entry> entryList = financialTransactionsList.get(i).getEntry();
- for (Entry entry : entryList) {
- if (entry.getAccount() != null) {
- if (Integer.valueOf(entry.getAccount().getAccountNumber().substring(0, 1)) < 6
- && !entry.getAmount().equals(BigDecimal.ZERO)) {
- found = true;
- }
- }
+ for (FinancialTransaction financialTransaction : financialTransactionsList) {
+ for (Entry entry : financialTransaction.getEntry()) {
+ if (Integer.valueOf(entry.getAccount().getAccountNumber().substring(0, 1)) < 6
+ && !entry.getAmount().equals(BigDecimal.ZERO)) {
+ found = true;
+ return found;
}
- i++;
}
}
return found;
@@ -269,7 +260,7 @@
FiscalPeriodTopiaDao fiscalPeriodTopiaDao = getDaoHelper().getFiscalPeriodDao();
String topiaId = fiscalPeriod.getTopiaId();
- FiscalPeriod fiscalPeriodOld = fiscalPeriodTopiaDao.findByTopiaId(topiaId);
+ FiscalPeriod fiscalPeriodOld = fiscalPeriodTopiaDao.forTopiaIdEquals(topiaId).findUnique();
Date endDate = fiscalPeriod.getEndDate();
fiscalPeriodOld.setEndDate(endDate);
@@ -461,7 +452,7 @@
FiscalPeriodTopiaDao fiscalPeriodTopiaDao = getDaoHelper().getFiscalPeriodDao();
// re-attach entities to current session
- FiscalPeriod localFiscalPeriod = fiscalPeriodTopiaDao.findByTopiaId(fiscalPeriod.getTopiaId());
+ FiscalPeriod localFiscalPeriod = fiscalPeriodTopiaDao.forTopiaIdEquals(fiscalPeriod.getTopiaId()).findUnique();
//check rules
accountingRules.deleteFiscalPeriodRules(localFiscalPeriod);
1
0
r3853 - trunk/lima-business/src/main/java/org/chorem/lima/business/ejb
by sbavencoff@users.chorem.org 18 Jul '14
by sbavencoff@users.chorem.org 18 Jul '14
18 Jul '14
Author: sbavencoff
Date: 2014-07-18 17:33:15 +0200 (Fri, 18 Jul 2014)
New Revision: 3853
Url: http://forge.chorem.org/projects/lima/repository/revisions/3853
Log:
refs #1044 : financial transaction
Modified:
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java
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-18 15:02:19 UTC (rev 3852)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java 2014-07-18 15:33:15 UTC (rev 3853)
@@ -30,8 +30,6 @@
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.chorem.lima.filter.FilterGenerator;
-import org.chorem.lima.filter.FinancialTransactionFilter;
import org.chorem.lima.beans.FinancialTransactionCondition;
import org.chorem.lima.beans.LetteringFilter;
import org.chorem.lima.business.AccountingRules;
@@ -44,7 +42,6 @@
import org.chorem.lima.business.api.AccountService;
import org.chorem.lima.business.api.FinancialTransactionService;
import org.chorem.lima.business.utils.LetteringComparator;
-import org.chorem.lima.entity.Account;
import org.chorem.lima.entity.Entry;
import org.chorem.lima.entity.EntryBook;
import org.chorem.lima.entity.EntryImpl;
@@ -53,6 +50,8 @@
import org.chorem.lima.entity.FinancialTransaction;
import org.chorem.lima.entity.FinancialTransactionTopiaDao;
import org.chorem.lima.entity.FiscalPeriod;
+import org.chorem.lima.filter.FilterGenerator;
+import org.chorem.lima.filter.FinancialTransactionFilter;
import org.nuiton.util.beans.Binder;
import org.nuiton.util.beans.BinderFactory;
@@ -83,25 +82,14 @@
@TransactionAttribute
public class FinancialTransactionServiceImpl extends AbstractLimaService implements FinancialTransactionService {
-// @EJB
-// protected FinancialPeriodService financialPeriodService;
-
-// @EJB
-// protected ReportService reportService;
-
- //@EJB
- //protected EntryBookService entryBookService;
-
@EJB
protected AccountService accountService;
-// @EJB
-// protected OptionsService optionsService;
-
protected static final Log log = LogFactory.getLog(FinancialTransactionServiceImpl.class);
@Override
- public FinancialTransaction createFinancialTransaction(FinancialTransaction financialtransaction) throws LockedFinancialPeriodException, LockedEntryBookException {
+ public FinancialTransaction createFinancialTransaction(FinancialTransaction financialtransaction)
+ throws LockedFinancialPeriodException, LockedEntryBookException {
AccountingRules accountingRules = LimaConfig.getInstance().getAccountingRules();
@@ -279,19 +267,17 @@
protected void amountsCalculation( BigDecimal resultOfFirstSecondEntrySubtraction, Entry sameAccountEntry, Entry costOrProductEntry) {
sameAccountEntry.setAmount(resultOfFirstSecondEntrySubtraction.abs());
costOrProductEntry.setAmount(resultOfFirstSecondEntrySubtraction.abs());
- Account costOrProductAccount;
/*-1 for less than 0 : credit*/
if (resultOfFirstSecondEntrySubtraction.compareTo(BigDecimal.ZERO) == -1) {
sameAccountEntry.setDebit(true);
costOrProductEntry.setDebit(false);
- costOrProductAccount = accountService.getAccountByNumber("758");
+ costOrProductEntry.setAccount(accountService.getAccountByNumber("758"));
} else { /*Greater than 0 : debit*/
sameAccountEntry.setDebit(false);
costOrProductEntry.setDebit(true);
- costOrProductAccount = accountService.getAccountByNumber("658");
+ costOrProductEntry.setAccount(accountService.getAccountByNumber("658"));
}
- costOrProductEntry.setAccount(costOrProductAccount);
}
public String findLastLetter(List<String> letters) {
@@ -364,23 +350,10 @@
@Override
public List<FinancialTransaction> getAllInexactFinancialTransactions(FiscalPeriod fiscalPeriod) {
- //List<FinancialTransaction> checkedResult = new ArrayList<FinancialTransaction>();
-
FinancialTransactionTopiaDao financialTransactionTopiaDao = getDaoHelper().getFinancialTransactionDao();
List<FinancialTransaction> result = financialTransactionTopiaDao.getAllIncorrectTransaction(fiscalPeriod.getBeginDate(),
fiscalPeriod.getEndDate(), null);
- /*for (FinancialTransaction fTransaction : result) {
- BigDecimal credit = fTransaction.getAmountCredit();
- BigDecimal debit = fTransaction.getAmountDebit();
- credit = credit.setScale(optionsService.getScale(),
- BigDecimal.ROUND_HALF_UP);
- debit = debit.setScale(optionsService.getScale(),
- BigDecimal.ROUND_HALF_UP);
- if (credit.equals(debit)) {
- checkedResult.add(fTransaction);
- }
- }*/
return result;
}
@@ -434,10 +407,8 @@
AccountingRules accountingRules = LimaConfig.getInstance().getAccountingRules();
- //FIXME mallon 22/06/2012 : Revoir l'utilisation du rattachement à la session et celle des deux objets 'financialTransactionOld'
- //et 'financialTransaction'
FinancialTransactionTopiaDao transactionTopiaDao = getDaoHelper().getFinancialTransactionDao();
- FinancialTransaction financialTransactionOld = transactionTopiaDao.findByTopiaId(financialTransaction.getTopiaId());
+ FinancialTransaction financialTransactionOld = transactionTopiaDao.forTopiaIdEquals(financialTransaction.getTopiaId()).findUnique();
accountingRules.updateFinancialTransactionDateRules(financialTransaction, financialTransactionOld);
@@ -461,14 +432,14 @@
accountingRules.checkFinancialPeriodBlockedWithFinancialTransaction(financialTransaction);
FinancialTransactionTopiaDao transactionTopiaDao = getDaoHelper().getFinancialTransactionDao();
- FinancialTransaction financialTransactionOld = transactionTopiaDao.findByTopiaId(financialTransaction.getTopiaId());
+ FinancialTransaction financialTransactionOld = transactionTopiaDao.forTopiaIdEquals(financialTransaction.getTopiaId()).findUnique();
transactionTopiaDao.delete(financialTransactionOld);
}
@Override
public FinancialTransaction getFinancialTransactionWithId(String id) {
FinancialTransactionTopiaDao transactionTopiaDao = getDaoHelper().getFinancialTransactionDao();
- FinancialTransaction result = transactionTopiaDao.findByTopiaId(id);
+ FinancialTransaction result = transactionTopiaDao.forTopiaIdEquals(id).findUnique();
return result;
}
@@ -496,7 +467,7 @@
EntryTopiaDao entryTopiaDao = getDaoHelper().getEntryDao();
- Entry entryOld = entryTopiaDao.findByTopiaId(entry.getTopiaId());
+ Entry entryOld = entryTopiaDao.forTopiaIdEquals(entry.getTopiaId()).findUnique();
//check rules
accountingRules.updateEntryRules(entry, entryOld);
@@ -522,7 +493,7 @@
accountingRules.checkFinancialPeriodBlockedWithFinancialTransaction(financialTransaction);
EntryTopiaDao entryTopiaDao = getDaoHelper().getEntryDao();
- Entry entryOld = entryTopiaDao.findByTopiaId(entry.getTopiaId());
+ Entry entryOld = entryTopiaDao.forTopiaIdEquals(entry.getTopiaId()).findUnique();
entryOld.getFinancialTransaction().removeEntry(entryOld);
entryTopiaDao.delete(entryOld);
1
0
r3852 - trunk/lima-business/src/main/java/org/chorem/lima/business/ejb
by sbavencoff@users.chorem.org 18 Jul '14
by sbavencoff@users.chorem.org 18 Jul '14
18 Jul '14
Author: sbavencoff
Date: 2014-07-18 17:02:19 +0200 (Fri, 18 Jul 2014)
New Revision: 3852
Url: http://forge.chorem.org/projects/lima/repository/revisions/3852
Log:
refs #1044 : ident + topia function
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/FinancialStatementServiceImpl.java
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java 2014-07-11 13:27:33 UTC (rev 3851)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java 2014-07-18 15:02:19 UTC (rev 3852)
@@ -186,7 +186,7 @@
* Si le compte n'existe pas, il envoie alors un message d'avertissement.
*
* @param account compte à modifier
- * @throws LimaException
+ * @throws InvalidAccountNumberException
*/
@Override
public Account updateAccount(Account account) throws InvalidAccountNumberException {
@@ -201,6 +201,7 @@
return result;
}
+ // TODO sbavencoff 18/07/2014 revoir la selection des comptes #1046
@Override
public List<Account> stringToListAccounts(String selectedAccounts) {
Set<Account> accounts = new HashSet<Account>();
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-11 13:27:33 UTC (rev 3851)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialStatementServiceImpl.java 2014-07-18 15:02:19 UTC (rev 3852)
@@ -25,6 +25,7 @@
package org.chorem.lima.business.ejb;
+import com.google.common.collect.Lists;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -98,23 +99,19 @@
// remove financialstatement
FinancialStatement financialStatementToDelete =
- financialStatementTopiaDao.findByTopiaId(
- financialStatement.getTopiaId());
+ financialStatementTopiaDao.findByTopiaId(financialStatement.getTopiaId());
financialStatementTopiaDao.delete(financialStatementToDelete);
//get all subFinancialStatement
List<FinancialStatement> financialStatements =
- getAllChildrenFinancialStatement(financialStatement,
- new ArrayList<FinancialStatement>());
+ getAllChildrenFinancialStatement(financialStatement, new ArrayList<FinancialStatement>());
//if FinancialStatement have subFinancialStatement
- if (financialStatements.size() > 0) {
- for (FinancialStatement subFinancialStatement : financialStatements) {
- FinancialStatement subFinancialStatementToDelete =
- financialStatementTopiaDao.findByTopiaId(
- subFinancialStatement.getTopiaId());
- financialStatementTopiaDao.delete(subFinancialStatementToDelete);
- }
+ for (FinancialStatement subFinancialStatement : financialStatements) {
+ FinancialStatement subFinancialStatementToDelete =
+ financialStatementTopiaDao.findByTopiaId(
+ subFinancialStatement.getTopiaId());
+ financialStatementTopiaDao.delete(subFinancialStatementToDelete);
}
}
@@ -147,11 +144,7 @@
@Override
public List<FinancialStatement> getChildrenFinancialStatement(FinancialStatement masterFinancialStatement) {
-
- FinancialStatementTopiaDao financialStatementTopiaDao = getDaoHelper().getFinancialStatementDao();
- List<FinancialStatement> financialStatements = financialStatementTopiaDao.findChildrenFinancialStatement(masterFinancialStatement);
-
- return financialStatements;
+ return Lists.newArrayList(masterFinancialStatement.getSubFinancialStatements());
}
@@ -204,49 +197,49 @@
FinancialStatementAmounts financialStatementAmounts = financialStatementAmounts(subFinancialStatement, selectedBeginDate, selectedEndDate);
if (!subFinancialStatement.isHeader()) {
//on calcul
- grossAmount =
- grossAmount.add(financialStatementAmounts.getGrossAmount());
+ grossAmount = grossAmount.add(financialStatementAmounts.getGrossAmount());
+
provisionDeprecationAmount = provisionDeprecationAmount.add(
financialStatementAmounts.getProvisionDeprecationAmount());
+
subResult.add(financialStatementAmounts);
+
} else {
FinancialStatementDatas financialStatementDatas =
financialStatementReport(subFinancialStatement,
selectedBeginDate, selectedEndDate, result);
+
grossAmount = grossAmount.add(financialStatementDatas.
getFinancialStatementAmounts().getGrossAmount());
+
provisionDeprecationAmount = provisionDeprecationAmount.
add(financialStatementDatas.getFinancialStatementAmounts().
getProvisionDeprecationAmount());
-
FinancialStatementAmounts headerfinancialStatementAmounts =
financialStatementDatas.getFinancialStatementAmounts();
+
//Si sous-total
if (subFinancialStatement.isSubAmount()) {
- FinancialStatementAmounts header =
- new FinancialStatementAmountsImpl();
+ FinancialStatementAmounts header = new FinancialStatementAmountsImpl();
header.setLabel(headerfinancialStatementAmounts.getLabel());
header.setLevel(headerfinancialStatementAmounts.getLevel());
header.setHeader(true);
+
//ajoute header
subResult.add(header);
+
//ajoute liste
if (financialStatementDatas.getListResult() != null) {
subResult.addAll(financialStatementDatas.getListResult());
}
+
//ajoute sstotal
- FinancialStatementAmounts subAmount =
- new FinancialStatementAmountsImpl();
- subAmount.setLabel(
- "TOTAL " + headerfinancialStatementAmounts.getLabel());
- subAmount.setLevel(
- headerfinancialStatementAmounts.getLevel());
- subAmount.setGrossAmount(
- headerfinancialStatementAmounts.getGrossAmount());
- subAmount.setProvisionDeprecationAmount(
- headerfinancialStatementAmounts.
- getProvisionDeprecationAmount());
+ FinancialStatementAmounts subAmount = new FinancialStatementAmountsImpl();
+ subAmount.setLabel("TOTAL " + headerfinancialStatementAmounts.getLabel());
+ subAmount.setLevel(headerfinancialStatementAmounts.getLevel());
+ subAmount.setGrossAmount(headerfinancialStatementAmounts.getGrossAmount());
+ subAmount.setProvisionDeprecationAmount(headerfinancialStatementAmounts.getProvisionDeprecationAmount());
subAmount.setSubAmount(true);
subResult.add(subAmount);
//ajoute une ligne vide
@@ -258,10 +251,8 @@
if (subFinancialStatement.isHeaderAmount()) {
subResult.add(headerfinancialStatementAmounts);
} else {
- headerfinancialStatementAmounts.
- setGrossAmount(new BigDecimal(0));
- headerfinancialStatementAmounts.
- setProvisionDeprecationAmount(new BigDecimal(0));
+ headerfinancialStatementAmounts.setGrossAmount(new BigDecimal(0));
+ headerfinancialStatementAmounts.setProvisionDeprecationAmount(new BigDecimal(0));
subResult.add(headerfinancialStatementAmounts);
}
//ajoute liste
@@ -271,11 +262,9 @@
}
}
}
- FinancialStatementAmounts financialStatementAmounts =
- new FinancialStatementAmountsImpl();
+ FinancialStatementAmounts financialStatementAmounts = new FinancialStatementAmountsImpl();
financialStatementAmounts.setGrossAmount(grossAmount);
- financialStatementAmounts.setProvisionDeprecationAmount(
- provisionDeprecationAmount);
+ financialStatementAmounts.setProvisionDeprecationAmount(provisionDeprecationAmount);
if (financialStatement != null) {
financialStatementAmounts.setLabel(financialStatement.getLabel());
financialStatementAmounts.setHeader(financialStatement.isHeader());
@@ -307,10 +296,8 @@
BigDecimal creditAmount = new BigDecimal(0);
BigDecimal provisionDeprecationAmount = new BigDecimal(0);
- FinancialStatement masterFinancialStatement =
- financialStatement.getMasterFinancialStatement();
- FinancialStatementWayEnum financialStatementWayEnum =
- FinancialStatementWayEnum.BOTH;
+ FinancialStatement masterFinancialStatement = financialStatement.getMasterFinancialStatement();
+ FinancialStatementWayEnum financialStatementWayEnum = FinancialStatementWayEnum.BOTH;
if (masterFinancialStatement != null) {
financialStatementWayEnum = masterFinancialStatement.getWay();
}
@@ -332,19 +319,15 @@
//CREDIT ACCOUNTS LIST
String creditAccountsString = financialStatement.getCreditAccounts();
if (creditAccountsString != null && !creditAccountsString.equals("")) {
- amounts = amountFromAccountList(creditAccountsString,
- selectedBeginDate, selectedEndDate);
+ amounts = amountFromAccountList(creditAccountsString, selectedBeginDate, selectedEndDate);
creditAmount = creditAmount.add(amounts.getCredit());
}
// PROVISION & DEPRECATION
- String provisionDeprecationAccountsString =
- financialStatement.getProvisionDeprecationAccounts();
+ String provisionDeprecationAccountsString = financialStatement.getProvisionDeprecationAccounts();
if (provisionDeprecationAccountsString != null && !provisionDeprecationAccountsString.equals("")) {
amounts = amountFromAccountList(provisionDeprecationAccountsString, selectedBeginDate, selectedEndDate);
- provisionDeprecationAmount =
- provisionDeprecationAmount.add(amounts.getCredit());
- provisionDeprecationAmount =
- provisionDeprecationAmount.subtract(amounts.getDebit());
+ provisionDeprecationAmount = provisionDeprecationAmount.add(amounts.getCredit());
+ provisionDeprecationAmount = provisionDeprecationAmount.subtract(amounts.getDebit());
}
switch (financialStatementWayEnum) {
case BOTH:
@@ -363,10 +346,8 @@
financialStatementAmounts.setGrossAmount(amount);
financialStatementAmounts.setLabel(financialStatement.getLabel());
- financialStatementAmounts.setProvisionDeprecationAmount(
- provisionDeprecationAmount);
- financialStatementAmounts.setLevel(
- financialStatement.getLevel());
+ financialStatementAmounts.setProvisionDeprecationAmount(provisionDeprecationAmount);
+ financialStatementAmounts.setLevel(financialStatement.getLevel());
return financialStatementAmounts;
}
@@ -379,22 +360,21 @@
BigDecimal credit = new BigDecimal(0);
Boolean substract = false;
- AccountTopiaDao accountTopiaDao = getDaoHelper().getAccountDao();
//Remove Spaces
String result = StringUtils.deleteWhitespace(accountsNumberList);
StringTokenizer stQuote = new StringTokenizer(result, "-");
while (stQuote.hasMoreTokens()) {
String s = stQuote.nextToken();
- //List<Account> accountsList = accountTopiaDao.stringToListAccounts(s, false);
List<Account> accountsList = accountService.stringToListAccounts(s);
BigDecimal debitTemp = new BigDecimal(0);
BigDecimal creditTemp = new BigDecimal(0);
for (Account account : accountsList) {
- ReportsDatas reportsDatas = reportService.
- generateAccountsReports(
+ ReportsDatas reportsDatas =
+ reportService.generateAccountsReports(
account,
true,
- selectedBeginDate, selectedEndDate);
+ selectedBeginDate,
+ selectedEndDate);
if (reportsDatas.getSoldeDebit()) {
debitTemp = debitTemp.add(reportsDatas.getAmountSolde());
} else {
@@ -419,35 +399,24 @@
@Override
public String checkFinancialStatementChart() {
- StringBuilder result =
- new StringBuilder(t("lima-business.financialstatement.check.warn"));
+ StringBuilder result = new StringBuilder(t("lima-business.financialstatement.check.warn"));
AccountTopiaDao accountTopiaDao = getDaoHelper().getAccountDao();
FinancialStatementTopiaDao financialStatementTopiaDao = getDaoHelper().getFinancialStatementDao();
List<Account> accountsList = accountTopiaDao.findAllLeafAccounts();
- List<FinancialStatement> financialStatementsList =
- financialStatementTopiaDao.findAll();
+ List<FinancialStatement> financialStatementsList = financialStatementTopiaDao.findAll();
-
for (FinancialStatement financialStatement : financialStatementsList) {
- accountsList.removeAll(
- accountService.stringToListAccounts(
- financialStatement.getAccounts()));
+ accountsList.removeAll(accountService.stringToListAccounts(financialStatement.getAccounts()));
- accountsList.removeAll(
- accountService.stringToListAccounts(
- financialStatement.getCreditAccounts()));
+ accountsList.removeAll(accountService.stringToListAccounts(financialStatement.getCreditAccounts()));
- accountsList.removeAll(
- accountService.stringToListAccounts(
- financialStatement.getDebitAccounts()));
+ accountsList.removeAll(accountService.stringToListAccounts(financialStatement.getDebitAccounts()));
- accountsList.removeAll(
- accountService.stringToListAccounts(
- financialStatement.getProvisionDeprecationAccounts()));
+ accountsList.removeAll(accountService.stringToListAccounts(financialStatement.getProvisionDeprecationAccounts()));
}
for (Account account : accountsList) {
@@ -471,7 +440,7 @@
@Override
public FinancialStatement getFinancialStatementByLabel(String label) {
FinancialStatementTopiaDao financialStatementTopiaDao = getDaoHelper().getFinancialStatementDao();
- FinancialStatement result = financialStatementTopiaDao.findByLabel(label);
+ FinancialStatement result = financialStatementTopiaDao.forLabelEquals(label).findUniqueOrNull();
return result;
}
1
0
r3851 - in trunk: . lima-business/src/main/java/org/chorem/lima/business/migration lima-callao/src/main/java/org/chorem/lima/entity
by athimel@users.chorem.org 11 Jul '14
by athimel@users.chorem.org 11 Jul '14
11 Jul '14
Author: athimel
Date: 2014-07-11 15:27:33 +0200 (Fri, 11 Jul 2014)
New Revision: 3851
Url: http://forge.chorem.org/projects/lima/repository/revisions/3851
Log:
upgrade versions (mavenpom, eugene, topia, openEJB, pdfbox, nuiton-csv)
Modified:
trunk/lima-business/src/main/java/org/chorem/lima/business/migration/DatabaseMigrationClass.java
trunk/lima-business/src/main/java/org/chorem/lima/business/migration/MigrationV0V0_5.java
trunk/lima-business/src/main/java/org/chorem/lima/business/migration/MigrationV0_6.java
trunk/lima-business/src/main/java/org/chorem/lima/business/migration/MigrationV0_8.java
trunk/lima-callao/src/main/java/org/chorem/lima/entity/LimaCallaoTopiaPersistenceContext.java
trunk/pom.xml
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-11 13:19:35 UTC (rev 3850)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/migration/DatabaseMigrationClass.java 2014-07-11 13:27:33 UTC (rev 3851)
@@ -24,20 +24,13 @@
*/
package org.chorem.lima.business.migration;
-import org.chorem.lima.entity.LimaCallaoTopiaPersistenceContext;
import org.nuiton.topia.migration.TopiaMigrationCallbackByClassNG;
-import org.nuiton.topia.persistence.TopiaApplicationContext;
-import org.nuiton.topia.persistence.TopiaMigrationService;
-import org.nuiton.topia.persistence.TopiaMigrationServiceException;
-import org.nuiton.topia.persistence.TopiaService;
-import org.nuiton.topia.persistence.support.TopiaSqlSupport;
import org.nuiton.util.Version;
import java.util.List;
-import java.util.Map;
import java.util.Set;
-public class DatabaseMigrationClass extends TopiaMigrationCallbackByClassNG<LimaCallaoTopiaPersistenceContext> {
+public class DatabaseMigrationClass extends TopiaMigrationCallbackByClassNG {
protected static final Version VERSION_0_5 = new Version("0.5");
protected static final Version VERSION_0_6 = new Version("0.6");
@@ -53,11 +46,6 @@
return false;
}
- @Override
- protected TopiaSqlSupport getSqlSupport(LimaCallaoTopiaPersistenceContext limaCallaoTopiaPersistenceContext) {
- return null;
- }
-
static class MigrationResolver implements MigrationCallBackForVersionResolver {
@Override
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-11 13:19:35 UTC (rev 3850)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/migration/MigrationV0V0_5.java 2014-07-11 13:27:33 UTC (rev 3851)
@@ -26,7 +26,7 @@
import org.nuiton.topia.migration.TopiaMigrationCallbackByClassNG.MigrationCallBackForVersion;
import org.nuiton.topia.persistence.TopiaException;
-import org.nuiton.topia.persistence.TopiaPersistenceContext;
+import org.nuiton.topia.persistence.support.TopiaSqlSupport;
import org.nuiton.util.Version;
import java.util.List;
@@ -37,7 +37,7 @@
}
@Override
- protected void prepareMigrationScript(TopiaPersistenceContext tx,
+ protected void prepareMigrationScript(TopiaSqlSupport sqlSupport,
List queries,
boolean showSql,
boolean showProgression) throws TopiaException {
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-11 13:19:35 UTC (rev 3850)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/migration/MigrationV0_6.java 2014-07-11 13:27:33 UTC (rev 3851)
@@ -27,10 +27,9 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.nuiton.topia.migration.TopiaMigrationCallbackByClass;
import org.nuiton.topia.migration.TopiaMigrationCallbackByClassNG;
import org.nuiton.topia.persistence.TopiaException;
-import org.nuiton.topia.persistence.TopiaPersistenceContext;
+import org.nuiton.topia.persistence.support.TopiaSqlSupport;
import org.nuiton.util.Version;
@@ -52,7 +51,7 @@
}
@Override
- protected void prepareMigrationScript(TopiaPersistenceContext tx,
+ protected void prepareMigrationScript(TopiaSqlSupport sqlSupport,
List queries,
boolean showSql,
boolean showProgression) throws TopiaException {
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/migration/MigrationV0_8.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/migration/MigrationV0_8.java 2014-07-11 13:19:35 UTC (rev 3850)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/migration/MigrationV0_8.java 2014-07-11 13:27:33 UTC (rev 3851)
@@ -26,7 +26,7 @@
import org.apache.commons.logging.LogFactory;
import org.nuiton.topia.migration.TopiaMigrationCallbackByClassNG;
import org.nuiton.topia.persistence.TopiaException;
-import org.nuiton.topia.persistence.TopiaPersistenceContext;
+import org.nuiton.topia.persistence.support.TopiaSqlSupport;
import org.nuiton.util.Version;
import java.util.List;
@@ -47,7 +47,7 @@
}
@Override
- protected void prepareMigrationScript(TopiaPersistenceContext tx,
+ protected void prepareMigrationScript(TopiaSqlSupport sqlSupport,
List queries,
boolean showSql,
boolean showProgression) throws TopiaException {
Modified: trunk/lima-callao/src/main/java/org/chorem/lima/entity/LimaCallaoTopiaPersistenceContext.java
===================================================================
--- trunk/lima-callao/src/main/java/org/chorem/lima/entity/LimaCallaoTopiaPersistenceContext.java 2014-07-11 13:19:35 UTC (rev 3850)
+++ trunk/lima-callao/src/main/java/org/chorem/lima/entity/LimaCallaoTopiaPersistenceContext.java 2014-07-11 13:27:33 UTC (rev 3851)
@@ -28,8 +28,8 @@
import org.nuiton.topia.persistence.TopiaIdFactory;
import org.nuiton.topia.persistence.internal.HibernateProvider;
import org.nuiton.topia.persistence.internal.TopiaHibernateSessionRegistry;
+import org.nuiton.topia.persistence.internal.support.TopiaFiresSupport;
import org.nuiton.topia.persistence.support.TopiaHibernateSupport;
-import org.nuiton.topia.persistence.support.TopiaListenableSupport;
import org.nuiton.topia.persistence.support.TopiaSqlQuery;
import org.nuiton.topia.persistence.support.TopiaSqlSupport;
import org.nuiton.topia.persistence.support.TopiaSqlWork;
@@ -38,8 +38,8 @@
public class LimaCallaoTopiaPersistenceContext extends AbstractLimaCallaoTopiaPersistenceContext implements TopiaHibernateSupport, TopiaSqlSupport {
- public LimaCallaoTopiaPersistenceContext(HibernateProvider hibernateProvider, TopiaListenableSupport listenableSupport, TopiaIdFactory topiaIdFactory, TopiaHibernateSessionRegistry sessionRegistry) {
- super(hibernateProvider, listenableSupport, topiaIdFactory, sessionRegistry);
+ public LimaCallaoTopiaPersistenceContext(HibernateProvider hibernateProvider, TopiaFiresSupport applicationFiresSupport, TopiaIdFactory topiaIdFactory, TopiaHibernateSessionRegistry sessionRegistry) {
+ super(hibernateProvider, applicationFiresSupport, topiaIdFactory, sessionRegistry);
}
@Override
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2014-07-11 13:19:35 UTC (rev 3850)
+++ trunk/pom.xml 2014-07-11 13:27:33 UTC (rev 3851)
@@ -5,7 +5,7 @@
<parent>
<groupId>org.nuiton</groupId>
<artifactId>mavenpom4redmine</artifactId>
- <version>5.0.7</version>
+ <version>5.0.9</version>
</parent>
<groupId>org.chorem</groupId>
@@ -176,15 +176,15 @@
<nuitonConfigVersion>3.0-alpha-2</nuitonConfigVersion>
<nuitonDecoratorVersion>3.0-alpha-3</nuitonDecoratorVersion>
<nuitonProfilingVersion>2.7.1</nuitonProfilingVersion>
- <nuitonCsvVersion>3.0-rc-1</nuitonCsvVersion>
- <eugeneVersion>2.10</eugeneVersion>
+ <nuitonCsvVersion>3.0-rc-2</nuitonCsvVersion>
+ <eugeneVersion>2.12-SNAPSHOT</eugeneVersion>
<nuitonI18nVersion>3.1</nuitonI18nVersion>
- <topiaVersion>3.0-beta-5</topiaVersion>
+ <topiaVersion>3.0-SNAPSHOT</topiaVersion>
<swinglabsVersion>3.0.4</swinglabsVersion>
<h2Version>1.3.176</h2Version>
<hibernateVersion>4.3.5.Final</hibernateVersion>
- <openejbJavaeeApiVersion>6.0-5</openejbJavaeeApiVersion>
+ <openejbJavaeeApiVersion>6.0-6</openejbJavaeeApiVersion>
<dom4jVersion>1.6.1</dom4jVersion>
<jdomVersion>2.0.2</jdomVersion>
<openCsvVersion>2.3</openCsvVersion>
@@ -195,7 +195,7 @@
<openEjbVersion>4.6.0.2</openEjbVersion>
<slf4jVersion>1.7.7</slf4jVersion>
<swingxVersion>1.6.5-1</swingxVersion>
- <pdfboxVersion>1.8.5</pdfboxVersion>
+ <pdfboxVersion>1.8.6</pdfboxVersion>
<jbossTransactionVersion>1.0.0.Final</jbossTransactionVersion>
<commonsCodecVersion>1.9</commonsCodecVersion>
1
0
r3850 - in trunk: lima-business/src/main/java/org/chorem/lima/business/ejb lima-callao/src/main/java/org/chorem/lima lima-callao/src/main/java/org/chorem/lima/clause lima-callao/src/main/java/org/chorem/lima/entity lima-callao/src/main/java/org/chorem/lima/filter
by athimel@users.chorem.org 11 Jul '14
by athimel@users.chorem.org 11 Jul '14
11 Jul '14
Author: athimel
Date: 2014-07-11 15:19:35 +0200 (Fri, 11 Jul 2014)
New Revision: 3850
Url: http://forge.chorem.org/projects/lima/repository/revisions/3850
Log:
Rename package "Filter" to "filter"
Added:
trunk/lima-callao/src/main/java/org/chorem/lima/filter/
Removed:
trunk/lima-callao/src/main/java/org/chorem/lima/Filter/
Modified:
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java
trunk/lima-callao/src/main/java/org/chorem/lima/clause/SubFilterClause.java
trunk/lima-callao/src/main/java/org/chorem/lima/entity/FinancialTransactionTopiaDao.java
trunk/lima-callao/src/main/java/org/chorem/lima/entity/GeneratorHQuery.java
trunk/lima-callao/src/main/java/org/chorem/lima/filter/AbstractFilter.java
trunk/lima-callao/src/main/java/org/chorem/lima/filter/AccountFilter.java
trunk/lima-callao/src/main/java/org/chorem/lima/filter/EntryBookFilter.java
trunk/lima-callao/src/main/java/org/chorem/lima/filter/EntryFilter.java
trunk/lima-callao/src/main/java/org/chorem/lima/filter/Filter.java
trunk/lima-callao/src/main/java/org/chorem/lima/filter/FilterGenerator.java
trunk/lima-callao/src/main/java/org/chorem/lima/filter/FinancialTransactionFilter.java
trunk/lima-callao/src/main/java/org/chorem/lima/filter/VisitorFilter.java
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-11 06:56:57 UTC (rev 3849)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java 2014-07-11 13:19:35 UTC (rev 3850)
@@ -30,8 +30,8 @@
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.chorem.lima.Filter.FilterGenerator;
-import org.chorem.lima.Filter.FinancialTransactionFilter;
+import org.chorem.lima.filter.FilterGenerator;
+import org.chorem.lima.filter.FinancialTransactionFilter;
import org.chorem.lima.beans.FinancialTransactionCondition;
import org.chorem.lima.beans.LetteringFilter;
import org.chorem.lima.business.AccountingRules;
Modified: trunk/lima-callao/src/main/java/org/chorem/lima/clause/SubFilterClause.java
===================================================================
--- trunk/lima-callao/src/main/java/org/chorem/lima/clause/SubFilterClause.java 2014-07-11 06:56:57 UTC (rev 3849)
+++ trunk/lima-callao/src/main/java/org/chorem/lima/clause/SubFilterClause.java 2014-07-11 13:19:35 UTC (rev 3850)
@@ -24,7 +24,7 @@
* #L%
*/
-import org.chorem.lima.Filter.Filter;
+import org.chorem.lima.filter.Filter;
/**
* @author Sylvain Bavencoff <bavencoff(a)codelutin.com>
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-11 06:56:57 UTC (rev 3849)
+++ trunk/lima-callao/src/main/java/org/chorem/lima/entity/FinancialTransactionTopiaDao.java 2014-07-11 13:19:35 UTC (rev 3850)
@@ -28,7 +28,7 @@
import com.google.common.collect.Maps;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.chorem.lima.Filter.Filter;
+import org.chorem.lima.filter.Filter;
import org.nuiton.topia.persistence.HqlAndParametersBuilder;
import java.util.Date;
Modified: trunk/lima-callao/src/main/java/org/chorem/lima/entity/GeneratorHQuery.java
===================================================================
--- trunk/lima-callao/src/main/java/org/chorem/lima/entity/GeneratorHQuery.java 2014-07-11 06:56:57 UTC (rev 3849)
+++ trunk/lima-callao/src/main/java/org/chorem/lima/entity/GeneratorHQuery.java 2014-07-11 13:19:35 UTC (rev 3850)
@@ -36,12 +36,12 @@
import org.chorem.lima.clause.StringClause;
import org.chorem.lima.clause.SubFilterClause;
import org.chorem.lima.clause.VisitorClause;
-import org.chorem.lima.Filter.AccountFilter;
-import org.chorem.lima.Filter.EntryBookFilter;
-import org.chorem.lima.Filter.EntryFilter;
-import org.chorem.lima.Filter.Filter;
-import org.chorem.lima.Filter.FinancialTransactionFilter;
-import org.chorem.lima.Filter.VisitorFilter;
+import org.chorem.lima.filter.AccountFilter;
+import org.chorem.lima.filter.EntryBookFilter;
+import org.chorem.lima.filter.EntryFilter;
+import org.chorem.lima.filter.Filter;
+import org.chorem.lima.filter.FinancialTransactionFilter;
+import org.chorem.lima.filter.VisitorFilter;
import java.util.ArrayList;
import java.util.Deque;
Modified: trunk/lima-callao/src/main/java/org/chorem/lima/filter/AbstractFilter.java
===================================================================
--- trunk/lima-callao/src/main/java/org/chorem/lima/Filter/AbstractFilter.java 2014-07-11 06:56:57 UTC (rev 3849)
+++ trunk/lima-callao/src/main/java/org/chorem/lima/filter/AbstractFilter.java 2014-07-11 13:19:35 UTC (rev 3850)
@@ -1,4 +1,4 @@
-package org.chorem.lima.Filter;
+package org.chorem.lima.filter;
/*
* #%L
Modified: trunk/lima-callao/src/main/java/org/chorem/lima/filter/AccountFilter.java
===================================================================
--- trunk/lima-callao/src/main/java/org/chorem/lima/Filter/AccountFilter.java 2014-07-11 06:56:57 UTC (rev 3849)
+++ trunk/lima-callao/src/main/java/org/chorem/lima/filter/AccountFilter.java 2014-07-11 13:19:35 UTC (rev 3850)
@@ -1,4 +1,4 @@
-package org.chorem.lima.Filter;
+package org.chorem.lima.filter;
/*
* #%L
Modified: trunk/lima-callao/src/main/java/org/chorem/lima/filter/EntryBookFilter.java
===================================================================
--- trunk/lima-callao/src/main/java/org/chorem/lima/Filter/EntryBookFilter.java 2014-07-11 06:56:57 UTC (rev 3849)
+++ trunk/lima-callao/src/main/java/org/chorem/lima/filter/EntryBookFilter.java 2014-07-11 13:19:35 UTC (rev 3850)
@@ -1,4 +1,4 @@
-package org.chorem.lima.Filter;
+package org.chorem.lima.filter;
/*
* #%L
Modified: trunk/lima-callao/src/main/java/org/chorem/lima/filter/EntryFilter.java
===================================================================
--- trunk/lima-callao/src/main/java/org/chorem/lima/Filter/EntryFilter.java 2014-07-11 06:56:57 UTC (rev 3849)
+++ trunk/lima-callao/src/main/java/org/chorem/lima/filter/EntryFilter.java 2014-07-11 13:19:35 UTC (rev 3850)
@@ -1,4 +1,4 @@
-package org.chorem.lima.Filter;
+package org.chorem.lima.filter;
/*
* #%L
Modified: trunk/lima-callao/src/main/java/org/chorem/lima/filter/Filter.java
===================================================================
--- trunk/lima-callao/src/main/java/org/chorem/lima/Filter/Filter.java 2014-07-11 06:56:57 UTC (rev 3849)
+++ trunk/lima-callao/src/main/java/org/chorem/lima/filter/Filter.java 2014-07-11 13:19:35 UTC (rev 3850)
@@ -1,4 +1,4 @@
-package org.chorem.lima.Filter;
+package org.chorem.lima.filter;
/*
* #%L
Modified: trunk/lima-callao/src/main/java/org/chorem/lima/filter/FilterGenerator.java
===================================================================
--- trunk/lima-callao/src/main/java/org/chorem/lima/Filter/FilterGenerator.java 2014-07-11 06:56:57 UTC (rev 3849)
+++ trunk/lima-callao/src/main/java/org/chorem/lima/filter/FilterGenerator.java 2014-07-11 13:19:35 UTC (rev 3850)
@@ -1,4 +1,4 @@
-package org.chorem.lima.Filter;
+package org.chorem.lima.filter;
/*
* #%L
Modified: trunk/lima-callao/src/main/java/org/chorem/lima/filter/FinancialTransactionFilter.java
===================================================================
--- trunk/lima-callao/src/main/java/org/chorem/lima/Filter/FinancialTransactionFilter.java 2014-07-11 06:56:57 UTC (rev 3849)
+++ trunk/lima-callao/src/main/java/org/chorem/lima/filter/FinancialTransactionFilter.java 2014-07-11 13:19:35 UTC (rev 3850)
@@ -1,4 +1,4 @@
-package org.chorem.lima.Filter;
+package org.chorem.lima.filter;
/*
* #%L
Modified: trunk/lima-callao/src/main/java/org/chorem/lima/filter/VisitorFilter.java
===================================================================
--- trunk/lima-callao/src/main/java/org/chorem/lima/Filter/VisitorFilter.java 2014-07-11 06:56:57 UTC (rev 3849)
+++ trunk/lima-callao/src/main/java/org/chorem/lima/filter/VisitorFilter.java 2014-07-11 13:19:35 UTC (rev 3850)
@@ -1,4 +1,4 @@
-package org.chorem.lima.Filter;
+package org.chorem.lima.filter;
/*
* #%L
1
0
r3849 - trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced
by sbavencoff@users.chorem.org 11 Jul '14
by sbavencoff@users.chorem.org 11 Jul '14
11 Jul '14
Author: sbavencoff
Date: 2014-07-11 08:56:57 +0200 (Fri, 11 Jul 2014)
New Revision: 3849
Url: http://forge.chorem.org/projects/lima/repository/revisions/3849
Log:
fixes #975 : Entr?\195?\169es Incorretes : Suppression colone lettre
Modified:
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedTableModel.java
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedTableModel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedTableModel.java 2014-07-11 06:50:04 UTC (rev 3848)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedTableModel.java 2014-07-11 06:56:57 UTC (rev 3849)
@@ -36,7 +36,6 @@
import org.chorem.lima.ui.financialtransaction.DebitColumn;
import org.chorem.lima.ui.financialtransaction.DescriptionColumn;
import org.chorem.lima.ui.financialtransaction.EntryBookColumn;
-import org.chorem.lima.ui.financialtransaction.LetterColumn;
import org.chorem.lima.ui.financialtransaction.VoucherColumn;
import java.util.List;
@@ -66,7 +65,6 @@
addColumn(new DescriptionColumn());
addColumn(new DebitColumn());
addColumn(new CreditColumn());
- addColumn(new LetterColumn());
}
/**
1
0
11 Jul '14
Author: sbavencoff
Date: 2014-07-11 08:50:04 +0200 (Fri, 11 Jul 2014)
New Revision: 3848
Url: http://forge.chorem.org/projects/lima/repository/revisions/3848
Log:
fixes #977 : Rapport : suppression des menus
Removed:
trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/
trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/
trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/
trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/
trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatreports/
Modified:
trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainViewHandler.java
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainView.jaxx 2014-07-10 15:28:04 UTC (rev 3847)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainView.jaxx 2014-07-11 06:50:04 UTC (rev 3848)
@@ -164,29 +164,7 @@
onActionPerformed='getHandler().showLetteringView(this)'
actionIcon='lettering'/>
</JMenu>
- <JMenu text="lima.reports" mnemonic="{'R'}">
- <JMenuItem text="lima.reports.accounts"
- onActionPerformed='getHandler().showAccountReports(this)'
- actionIcon='reports-account'/>
- <JMenuItem text="lima.reports.entrybooks"
- onActionPerformed='getHandler().showEntryBookReports(this)'
- actionIcon='reports-entrybook'/>
- <JMenuItem text="lima.reports.balance"
- onActionPerformed='getHandler().showBalanceView(this)'
- actionIcon='reports-balance'/>
- <JMenuItem text="lima.reports.ledger"
- onActionPerformed='getHandler().showLedgerView(this)'
- actionIcon='reports-ledger'/>
- <JMenuItem text="lima.reports.financialstatement"
- onActionPerformed='getHandler().showFinancialStatementReportsView(this)'
- actionIcon='reports-financialstatement'/>
- <!-- useless #669-->
- <!--<JMenuItem text="lima.reports.vat"-->
- <!--onActionPerformed='getHandler().showVatReportView(this)'-->
- <!--actionIcon='reports-vatstatement'/>-->
- </JMenu>
-
<JMenu text="lima.menu.help" mnemonic="{'H'}">
<!--<JMenuItem id="help" text='lima.menu.help.help' actionIcon="help"-->
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainViewHandler.java 2014-07-10 15:28:04 UTC (rev 3847)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainViewHandler.java 2014-07-11 06:50:04 UTC (rev 3848)
@@ -37,15 +37,11 @@
import org.chorem.lima.enums.ImportExportEnum;
import org.chorem.lima.service.LimaServiceFactory;
import org.chorem.lima.ui.account.AccountView;
-import org.chorem.lima.ui.accountsreports.AccountsReportsView;
-import org.chorem.lima.ui.balance.BalanceReportsView;
import org.chorem.lima.ui.celleditor.NumberSeparatorCellRenderer;
import org.chorem.lima.ui.celleditor.NumberSeparatorTableCellRenderer;
import org.chorem.lima.ui.entrybook.EntryBookView;
-import org.chorem.lima.ui.entrybooksreports.EntryBooksReportsView;
import org.chorem.lima.ui.financialperiod.FinancialPeriodView;
import org.chorem.lima.ui.financialstatementchart.FinancialStatementChartView;
-import org.chorem.lima.ui.financialstatementreport.FinancialStatementReportView;
import org.chorem.lima.ui.financialtransaction.FinancialTransactionView;
import org.chorem.lima.ui.financialtransactionsearch.FinancialTransactionSearchView;
import org.chorem.lima.ui.financialtransactionunbalanced.FinancialTransactionUnbalancedView;
@@ -53,17 +49,22 @@
import org.chorem.lima.ui.home.HomeView;
import org.chorem.lima.ui.identity.IdentityForm;
import org.chorem.lima.ui.importexport.ImportExport;
-import org.chorem.lima.ui.ledger.LedgerView;
import org.chorem.lima.ui.lettering.LetteringView;
import org.chorem.lima.ui.vatchart.VatChartView;
-import org.chorem.lima.ui.vatreports.VatReportView;
import org.nuiton.util.DesktopUtil;
import org.nuiton.widget.SwingSession;
-import javax.swing.*;
+import javax.swing.DefaultCellEditor;
+import javax.swing.ImageIcon;
+import javax.swing.JButton;
+import javax.swing.JComboBox;
+import javax.swing.JEditorPane;
+import javax.swing.JScrollPane;
+import javax.swing.JTabbedPane;
+import javax.swing.UIManager;
import javax.swing.border.LineBorder;
import javax.swing.plaf.BorderUIResource;
-import java.awt.*;
+import java.awt.Component;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
@@ -446,33 +447,6 @@
}
/**
- * Show account table report to view an account on a period
- *
- * @param rootContext the root application context
- */
- public void showAccountReports(JAXXContext rootContext) {
- MainView mainView = getUI(rootContext);
- AccountsReportsView accountsReportsView =
- new AccountsReportsView(mainView);
- showTab(mainView, t("lima.reports.accounts"), accountsReportsView);
- swingSession.add(accountsReportsView);
- }
-
- /**
- * Show entry book table report to view an account on a period
- *
- * @param rootContext the root application context
- */
- public void showEntryBookReports(JAXXContext rootContext) {
- MainView mainView = getUI(rootContext);
- EntryBooksReportsView entryBooksReportsView =
- new EntryBooksReportsView(mainView);
- showTab(mainView, t("lima.reports.entrybooks"), entryBooksReportsView);
- swingSession.add(entryBooksReportsView);
- }
-
-
- /**
* Show financial transactions view to create entries
*
* @param rootContext the root application context
@@ -510,36 +484,6 @@
swingSession.add(letteringView);
}
- public void showBalanceView(JAXXContext rootContext) {
- MainView mainView = getUI(rootContext);
- BalanceReportsView balanceView = new BalanceReportsView(mainView);
- showTab(mainView, t("lima.reports.balance"), balanceView);
- swingSession.add(balanceView);
- }
-
- public void showLedgerView(JAXXContext rootContext) {
- MainView mainView = getUI(rootContext);
- LedgerView ledgerView = new LedgerView(mainView);
- showTab(mainView, t("lima.reports.ledger"), ledgerView);
- swingSession.add(ledgerView);
- }
-
- public void showFinancialStatementReportsView(JAXXContext rootContext) {
- MainView mainView = getUI(rootContext);
- FinancialStatementReportView financialStatementReportView =
- new FinancialStatementReportView(mainView);
- showTab(mainView, t("lima.reports.financialstatement"),
- financialStatementReportView);
- swingSession.add(financialStatementReportView);
- }
-
- public void showVatReportView(JAXXContext rootContext) {
- MainView mainView = getUI(rootContext);
- VatReportView vatReportView = new VatReportView(mainView);
- showTab(mainView, t("lima.reports.vat"), vatReportView);
- swingSession.add(vatReportView);
- }
-
public void showImportExportView(JAXXContext rootContext,
ImportExportEnum type) {
MainView mainView = getUI(rootContext);
1
0