Lima-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
August 2010
- 3 participants
- 42 discussions
r3011 - in trunk: lima-business/src/main/java/org/chorem/lima/business/ejb lima-business/src/main/java/org/chorem/lima/business/ejbinterface lima-callao/src/main/java/org/chorem/lima/entity lima-callao/src/main/xmi lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced lima-swing/src/main/java/org/chorem/lima/ui/home
by jpepin@users.chorem.org 21 Aug '10
by jpepin@users.chorem.org 21 Aug '10
21 Aug '10
Author: jpepin
Date: 2010-08-21 13:51:36 +0200 (Sat, 21 Aug 2010)
New Revision: 3011
Url: http://chorem.org/repositories/revision/lima/3011
Log:
Optimize topiaquery and lazy loading.
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/ReportServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialTransactionService.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialTransactionServiceLocal.java
trunk/lima-callao/src/main/java/org/chorem/lima/entity/AccountDAOImpl.java
trunk/lima-callao/src/main/xmi/accounting.properties
trunk/lima-callao/src/main/xmi/accounting.zargo
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedTableModel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/FinancialTransactionsPane.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 2010-08-20 23:46:18 UTC (rev 3010)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java 2010-08-21 11:51:36 UTC (rev 3011)
@@ -21,9 +21,7 @@
import java.math.BigDecimal;
import java.util.Date;
-import java.util.HashSet;
import java.util.List;
-import java.util.Set;
import javax.ejb.Stateless;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -147,8 +145,12 @@
FinancialTransactionDAO transactionDAO =
LimaCallaoDAOHelper.getFinancialTransactionDAO(topiaTransaction);
+ String financialPeriodProperty = TopiaQuery.getProperty(FinancialTransaction.FINANCIAL_PERIOD);
+ String entryBookLabelProperty = TopiaQuery.getProperty(FinancialTransaction.ENTRY_BOOK);
+ String accountProperty = TopiaQuery.getProperty(FinancialTransaction.ENTRY, Entry.ACCOUNT);
+
// filter with topia query
- TopiaQuery query = transactionDAO.createQuery();
+ TopiaQuery query = transactionDAO.createQuery("T");
if (entryBook != null) {
query.addEquals("entryBook", entryBook);
@@ -157,19 +159,13 @@
if (financialPeriod != null) {
query.addEquals("financialPeriod", financialPeriod);
}
- query.addOrder(FinancialTransaction.TOPIA_CREATE_DATE);
+ query.addDistinct()
+ .addOrder("T."+FinancialTransaction.TOPIA_CREATE_DATE)
+ //load for lazy
+ .addLoad(financialPeriodProperty)
+ .addLoad(entryBookLabelProperty)
+ .addFetch("T."+accountProperty);
financialTransactions = transactionDAO.findAllByQuery(query);
-
- //IMPORTANT : LOADING ENTRIES AND IS COLUMN FOR NO LAZY EXCEPTION
- for (FinancialTransaction financialTransaction : financialTransactions) {
- financialTransaction.getEntryBook();
-
- for (Entry entry : financialTransaction.getEntry()) {
- entry.getAccount();
- entry.getFinancialTransaction();
- entry.getFinancialTransaction().getFinancialPeriod();
- }
- }
}
catch (TopiaException ex) {
doCatch(topiaTransaction, ex, log);
@@ -186,44 +182,35 @@
* Get unbalanced financialtransaction from selected fiscalperiod
*/
@Override
- public Set<FinancialTransaction> getAllInexactFinancialTransactions(FiscalPeriod fiscalPeriod) throws LimaException {
+ public List<FinancialTransaction> getAllInexactFinancialTransactions(FiscalPeriod fiscalPeriod) throws LimaException {
TopiaContext topiaContext = null;
- Set<FinancialTransaction> result = new HashSet<FinancialTransaction>();
+ List<FinancialTransaction> result = null;
try {
topiaContext = beginTransaction();
FinancialTransactionDAO financialTransactionDAO =
LimaCallaoDAOHelper.getFinancialTransactionDAO(topiaContext);
- TopiaQuery query = financialTransactionDAO.createQuery("E");
- query.addFrom(FiscalPeriod.class, "F")
- .addWhere("E.amountCredit != E.amountDebit OR E.entryBook = null")
- .addInElements("E.financialPeriod", "F.financialPeriod")
- .addEquals("F", fiscalPeriod);
- result.addAll(financialTransactionDAO.findAllByQuery(query));
- TopiaQuery query2 = financialTransactionDAO.createQuery("T");
- query2.addFrom(Entry.class, "E")
- .addWhere("E.account = null")
- .addInElements("E", "T.entry");
- result.addAll(financialTransactionDAO.findAllByQuery(query2));
+ String financialPeriodProperty = TopiaQuery.getProperty(FinancialTransaction.FINANCIAL_PERIOD);
+ String entryBookLabelProperty = TopiaQuery.getProperty(FinancialTransaction.ENTRY_BOOK);
+ String accountProperty = TopiaQuery.getProperty(Entry.ACCOUNT);
- /* Just for fun : IN HQL
- result = topiaContext.find(
- "FROM org.chorem.lima.entity.FinancialTransaction "+
- "WHERE amountCredit != amountDebit and (financialPeriod in (" +
- "FROM org.chorem.lima.entity.FinancialPeriod " +
- "WHERE (fiscalPeriod = :fiscalPeriod)))","fiscalPeriod",fiscalPeriod);*/
+
+
+ TopiaQuery query = financialTransactionDAO.createQuery("T");
+ query.addFrom(FiscalPeriod.class, "F")
+ .addDistinct()
+ .addLeftJoin("T."+FinancialTransaction.ENTRY, "E", true)
+ .addWhere("T.amountCredit != T.amountDebit OR E.account = null OR T.entryBook = null")
+ .addInElements("T.financialPeriod", "F.financialPeriod")
+ .addEquals("F", fiscalPeriod)
+ // load lazy
+ .addLeftJoin("E."+accountProperty,"A", true)
+ .addLoad(financialPeriodProperty)
+ .addLoad(entryBookLabelProperty);
- //IMPORTANT : LOADING ENTRIES AND IS COLUMN FOR NO LAZY EXCEPTION
- for (FinancialTransaction financialTransaction : result) {
-
- for (Entry entry : financialTransaction.getEntry()) {
- entry.getAccount();
- entry.getFinancialTransaction();
- entry.getFinancialTransaction().getEntryBook();
- entry.getFinancialTransaction().getFinancialPeriod();
- }
- }
+ result = financialTransactionDAO.findAllByQuery(query);
+
}
catch (TopiaException ex) {
@@ -241,7 +228,7 @@
List<FinancialTransaction> result = null;
try {
topiaContext = beginTransaction();
- result = getAllFinancialTransactionsBalanced(topiaContext);
+ result = getAllFinancialTransactionsBalanced(fiscalPeriod, topiaContext);
}
catch (TopiaException ex) {
doCatch(topiaContext, ex, log);
@@ -256,28 +243,24 @@
/**
* Get balanced financialtransaction from selected fiscalperiod
*/
- @Override
- public List<FinancialTransaction> getAllFinancialTransactionsBalanced(TopiaContext topiaContext) throws LimaException {
+ public List<FinancialTransaction> getAllFinancialTransactionsBalanced(FiscalPeriod fiscalPeriod, TopiaContext topiaContext) throws LimaException {
List<FinancialTransaction> result = null;
try {
FinancialTransactionDAO financialTransactionDAO =
LimaCallaoDAOHelper.getFinancialTransactionDAO(topiaContext);
+
+ // WARN No load lazy, modify query with addLoad or addFetch if loading is necessary
+ TopiaQuery query = financialTransactionDAO.createQuery("T");
+ query.addFrom(FiscalPeriod.class, "F")
+ .addLeftJoin("T."+FinancialTransaction.ENTRY, "E", false)
+ .addWhere("T.amountCredit = T.amountDebit")
+ .addNotNull("E.account")
+ .addNotNull("T.entryBook")
+ .addInElements("T.financialPeriod", "F.financialPeriod")
+ .addEquals("F", fiscalPeriod);
- TopiaQuery query = financialTransactionDAO.createQuery("E");
- query.addWhere("E.amountCredit = E.amountDebit")
- .addNotNull("E.entryBook");
- result = financialTransactionDAO.findAllByQuery(query);
-
- //IMPORTANT : LOADING ENTRIES AND IS COLUMN FOR NO LAZY EXCEPTION
- for (FinancialTransaction financialTransaction : result) {
-
- for (Entry entry : financialTransaction.getEntry()) {
- entry.getAccount();
- entry.getFinancialTransaction();
- entry.getFinancialTransaction().getEntryBook();
- entry.getFinancialTransaction().getFinancialPeriod();
- }
- }
+ result = financialTransactionDAO.findAllByQuery(query);
+
}
catch (TopiaException ex) {
doCatch(topiaContext, ex, log);
@@ -648,7 +631,8 @@
}
else if (accountsList != null){
AccountDAO accountDAO = LimaCallaoDAOHelper.getAccountDAO(topiaContext);
- List<Account> accounts = accountDAO.stringToListAccounts(accountsList, false);
+ List<Account> accounts =
+ accountDAO.stringToListAccounts(accountsList, false);
StringBuffer accountNumbers = new StringBuffer("0,");
int max = accounts.size();
for (int i = 1; i <= max; i++) {
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java 2010-08-20 23:46:18 UTC (rev 3010)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java 2010-08-21 11:51:36 UTC (rev 3011)
@@ -155,23 +155,24 @@
/**
* Query for find entries for accountsreports and balancereports
- * Just balanced transaction are calculated
+ * Just exact and balanced transaction are calculated
*/
public TopiaQuery createEntryQuery(Account account, Date beginDate, Date endDate, EntryDAO entryDAO, String queryAlias) throws LimaException{
TopiaQuery query = entryDAO.createQuery(queryAlias);
- String transactionDateProperty =
- TopiaQuery.getProperty(Entry.FINANCIAL_TRANSACTION,
- FinancialTransaction.TRANSACTION_DATE);
- String amountCreditProperty =
- TopiaQuery.getProperty(Entry.FINANCIAL_TRANSACTION,
- FinancialTransaction.AMOUNT_CREDIT);
- String amountDebitProperty =
- TopiaQuery.getProperty(Entry.FINANCIAL_TRANSACTION,
- FinancialTransaction.AMOUNT_DEBIT);
+ String transactionDateProperty = TopiaQuery.getProperty(
+ Entry.FINANCIAL_TRANSACTION, FinancialTransaction.TRANSACTION_DATE);
+ String amountCreditProperty = TopiaQuery.getProperty(
+ Entry.FINANCIAL_TRANSACTION, FinancialTransaction.AMOUNT_CREDIT);
+ String amountDebitProperty = TopiaQuery.getProperty(
+ Entry.FINANCIAL_TRANSACTION, FinancialTransaction.AMOUNT_DEBIT);
+ String entryBookProperty = TopiaQuery.getProperty(
+ Entry.FINANCIAL_TRANSACTION, FinancialTransaction.ENTRY_BOOK);
+
query
.addWhere(amountCreditProperty+" = "+amountDebitProperty)
.addWhere(transactionDateProperty+" BETWEEN :beginDate AND :endDate")
+ .addNotNull(entryBookProperty)
.addParam("beginDate", beginDate)
.addParam("endDate", endDate)
.addEquals(Entry.ACCOUNT, account);
@@ -355,12 +356,6 @@
entriesQuery.addOrder(orderDateProperty)
.addOrder(orderIdProperty);
reportsDatas.setListEntry(entryDAO.findAllByQuery(entriesQuery));
-
-
- //TODO 20100603 PEPIN imbriqué les deux conditions de comparator
- // tri sur date, tri sur topiaid
- //Collections.sort(entries, new EntryFinancialTransactionDateComparator());
- //Collections.sort(entries, new EntryFinancialTransactionComparator());
TopiaQuery amountsQuery =
createEntryBookReportsQuery(entryBook, beginDate, endDate, entryDAO, "E");
@@ -427,7 +422,6 @@
FinancialTransaction.ENTRY_BOOK);
query
.addWhere(amountCreditProperty+" = "+amountDebitProperty)
- //TODO check this
.addEquals(entryBookProperty, entryBook)
.addWhere(transactionDateProperty+" BETWEEN :beginDate AND :endDate")
.addParam("beginDate", beginDate)
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialTransactionService.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialTransactionService.java 2010-08-20 23:46:18 UTC (rev 3010)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialTransactionService.java 2010-08-21 11:51:36 UTC (rev 3011)
@@ -60,7 +60,7 @@
List<FinancialTransaction> getAllFinancialTransactionsForEntryBookAndFinancialPeriod(
EntryBook entryBook, FinancialPeriod period) throws LimaException;
- Set<FinancialTransaction> getAllInexactFinancialTransactions(FiscalPeriod fiscalPeriod) throws LimaException;
+ List<FinancialTransaction> getAllInexactFinancialTransactions(FiscalPeriod fiscalPeriod) throws LimaException;
List<FinancialTransaction> getAllFinancialTransactionsBalanced(FiscalPeriod fiscalPeriod) throws LimaException;
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialTransactionServiceLocal.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialTransactionServiceLocal.java 2010-08-20 23:46:18 UTC (rev 3010)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialTransactionServiceLocal.java 2010-08-21 11:51:36 UTC (rev 3011)
@@ -19,7 +19,6 @@
package org.chorem.lima.business.ejbinterface;
-import java.util.List;
import javax.ejb.Local;
import org.chorem.lima.business.LimaException;
import org.chorem.lima.entity.Entry;
@@ -38,8 +37,6 @@
@Local
public interface FinancialTransactionServiceLocal extends FinancialTransactionService {
-
- List<FinancialTransaction> getAllFinancialTransactionsBalanced(TopiaContext topiaContext) throws LimaException;
void createFinancialTransactionWithTransaction(FinancialTransaction financialtransaction, TopiaContext topiaContext) throws LimaException;
Modified: trunk/lima-callao/src/main/java/org/chorem/lima/entity/AccountDAOImpl.java
===================================================================
--- trunk/lima-callao/src/main/java/org/chorem/lima/entity/AccountDAOImpl.java 2010-08-20 23:46:18 UTC (rev 3010)
+++ trunk/lima-callao/src/main/java/org/chorem/lima/entity/AccountDAOImpl.java 2010-08-21 11:51:36 UTC (rev 3011)
@@ -23,12 +23,16 @@
import java.util.List;
import java.util.StringTokenizer;
import org.apache.commons.lang.StringUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.nuiton.topia.TopiaException;
import org.nuiton.topia.framework.TopiaQuery;
import org.nuiton.topia.framework.TopiaQuery.Op;
public class AccountDAOImpl <E extends Account> extends AccountDAOAbstract<E> {
+ private static final Log log = LogFactory.getLog(AccountDAOImpl.class);
+
/**
* List all subaccounts (no folderaccounts, exclude accounts contains thirdpart accounts)
* Sort by accout number in lexicographical order
@@ -42,118 +46,98 @@
return (List<Account>) findAllByQuery(query);
}
-
- /**
- * Convert string of extends number to list of accounts
- * Example '22, 45..48, 67' -> [22, 45, 46, 47, 48, 67]
- * SubAccountsMode return list of existing subaccounts ex 6 return : 61, 62, .., 69, 610, .., 619 etc
- */
@Override
+ public Account findSubAccountByNumber(String number) throws TopiaException {
+ TopiaQuery query = createQuery();
+ String subAccountsProperty = TopiaQuery.getProperty(Account.SUB_ACCOUNTS);
+ String subLedgersProperty = TopiaQuery.getProperty(Account.SUB_LEDGERS);
+ query.addWhere("not exists elements ("+subAccountsProperty+")")
+ .addWhere("not exists elements ("+subLedgersProperty+")")
+ .addEquals(Account.ACCOUNT_NUMBER, number);
+ return findByQuery(query);
+ }
+
+ public List<Account> findIntervalAccountByNumber(String accountNumberLow, String accountNumberHigh) throws TopiaException {
+ TopiaQuery query = createQuery();
+ query.addBetween(Account.ACCOUNT_NUMBER, accountNumberLow, accountNumberHigh);
+ return (List<Account>) findAllByQuery(query);
+ }
+
+ @Override
public List<Account> stringToListAccounts(String selectedAccounts,
Boolean subAccountsMode) throws TopiaException {
- List<Account> accounts = new ArrayList<Account>();
+ HashSet<Account> accounts = new HashSet<Account>();
if (selectedAccounts != null){
//Remove Spaces
- selectedAccounts = StringUtils.deleteWhitespace(selectedAccounts);
- //use hashset for delete duplicate numbers
- HashSet<String> accountNumbers = new HashSet<String>();
- HashSet<String> accountNumbersToRemove = new HashSet<String>();
+ String result = StringUtils.deleteWhitespace(selectedAccounts);
+
Boolean first = true;
- StringTokenizer stStar = new StringTokenizer(selectedAccounts, "-");
+ StringTokenizer stStar = new StringTokenizer(result, "-");
while (stStar.hasMoreTokens()) {
String subString = stStar.nextToken();
+ log.debug(subString);
//Split comma
StringTokenizer stComma = new StringTokenizer(subString, ",");
while (stComma.hasMoreTokens()) {
String s = stComma.nextToken();
+ //if intervall account
if (s.contains("..") && !s.endsWith("..")){
//Split ..
String stringDoubleDot[] = s.split("\\.\\.");
- int lowAccount = Integer.parseInt(stringDoubleDot[0]);
- int highAccount = Integer.parseInt(stringDoubleDot[1]);
- //prevent to much result, can't let intervall superior to 1000
- if (highAccount - lowAccount <= 10000){
- for (int i=lowAccount; i <= highAccount; i++) {
- //if first add accounts, else remove
- if (first){
- accountNumbers.add(String.valueOf(i));
- }
- else {
- accountNumbersToRemove.add(String.valueOf(i));
- }
- }
- }
+ List<Account> resultIntervall =
+ findIntervalAccountByNumber(stringDoubleDot[0], stringDoubleDot[1]);
+
+ //if first add accounts, else remove
+ if (first){
+ accounts.addAll(resultIntervall);
+ }
+ else {
+ accounts.removeAll(resultIntervall);
+ }
}
+ //else one account
else{
- //if first
- if (first){
- accountNumbers.add(s);
- }
- else {
- accountNumbersToRemove.add(s);
- }
+ Account account = null;
+ if (subAccountsMode){
+ account = findSubAccountByNumber(s);
+ }
+ else {
+ account = findByAccountNumber(s);
+ }
+ //if exist
+ if (account != null){
+ //if first
+ if (first){
+ accounts.add(account);
+ }
+ else {
+ accounts.remove(account);
+ }
+ }
+ //search all account start with accountnumber
+ else {
+ TopiaQuery query = createQuery();
+ String subAccountsProperty = TopiaQuery.getProperty(Account.SUB_ACCOUNTS);
+ query.addWhere("not exists elements ("+subAccountsProperty+")")
+ .addWhere(Account.ACCOUNT_NUMBER, Op.LIKE, s+"%");
+ List<Account> accountsResult = (List<Account>) findAllByQuery(query);
+ if (accountsResult != null){
+ //if first
+ if (first){
+ accounts.addAll(accountsResult);
+ }
+ else {
+ accounts.removeAll(accountsResult);
+ }
+ }
+ }
}
}
first=false;
}
- //add all accounts
- for (String accountNumber : accountNumbers) {
- Account account = null;
- if (subAccountsMode){
- account = findSubAccountByNumber(accountNumber);
- }
- else {
- account = findByAccountNumber(accountNumber);
-
- }
- //add account if exist
- if (account != null){
- accounts.add(account);
- }
- //search all account start with accountnumber
- else {
- TopiaQuery query = createQuery();
- String subAccountsProperty = TopiaQuery.getProperty(Account.SUB_ACCOUNTS);
- //String subLedgersProperty = TopiaQuery.getProperty(Account.SUB_LEDGERS);
- query.addWhere("not exists elements ("+subAccountsProperty+")")
- //.addWhere("not exists elements ("+subLedgersProperty+")")
- .addWhere(Account.ACCOUNT_NUMBER, Op.LIKE, accountNumber+"%");
- List<Account> accountsResult = (List<Account>) findAllByQuery(query);
- if (accountsResult != null){
- accounts.addAll(accountsResult);
- }
- }
- }
- //remove all accounts
- for (String accountNumber : accountNumbersToRemove) {
- Account account = null;
- if (subAccountsMode){
- account = findSubAccountByNumber(accountNumber);
- }
- else {
- account = findByAccountNumber(accountNumber);
- }
- if (account != null) {
- accounts.remove(account);
- }
- }
}
- return accounts;
+ return new ArrayList(accounts);
}
-
-
-
- @Override
- public Account findSubAccountByNumber(String number) throws TopiaException {
- TopiaQuery query = createQuery();
- String subAccountsProperty = TopiaQuery.getProperty(Account.SUB_ACCOUNTS);
- String subLedgersProperty = TopiaQuery.getProperty(Account.SUB_LEDGERS);
- query.addWhere("not exists elements ("+subAccountsProperty+")")
- .addWhere("not exists elements ("+subLedgersProperty+")")
- .addEquals(Account.ACCOUNT_NUMBER, number);
- return findByQuery(query);
- }
-
}
Modified: trunk/lima-callao/src/main/xmi/accounting.properties
===================================================================
--- trunk/lima-callao/src/main/xmi/accounting.properties 2010-08-20 23:46:18 UTC (rev 3010)
+++ trunk/lima-callao/src/main/xmi/accounting.properties 2010-08-21 11:51:36 UTC (rev 3011)
@@ -21,7 +21,6 @@
# lazy
org.chorem.lima.entity.Account.attribute.subAccounts.tagvalue.lazy=false
org.chorem.lima.entity.Account.attribute.subLedgers.tagvalue.lazy=false
-org.chorem.lima.entity.FinancialTransaction.attribute.financialPeriod.tagvalue.lazy=false
org.chorem.lima.entity.FiscalPeriod.attribute.financialPeriod.tagvalue.lazy=false
org.chorem.lima.entity.FinancialStatement.attribute.subFinancialStatements.tagvalue.lazy=false
org.chorem.lima.entity.FinancialStatement.attribute.masterFinancialStatement.tagvalue.lazy=false
Modified: trunk/lima-callao/src/main/xmi/accounting.zargo
===================================================================
(Binary files differ)
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 2010-08-20 23:46:18 UTC (rev 3010)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedTableModel.java 2010-08-21 11:51:36 UTC (rev 3011)
@@ -100,7 +100,7 @@
List<Object> results = new ArrayList<Object>();
if(selectedFiscalPeriod != null){
try {
- Set<FinancialTransaction> financialtransactions =
+ List<FinancialTransaction> financialtransactions =
financialTransactionService.getAllInexactFinancialTransactions(selectedFiscalPeriod);
for (FinancialTransaction financialtransaction : financialtransactions) {
results.add(financialtransaction);
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/FinancialTransactionsPane.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/FinancialTransactionsPane.java 2010-08-20 23:46:18 UTC (rev 3010)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/FinancialTransactionsPane.java 2010-08-21 11:51:36 UTC (rev 3011)
@@ -21,8 +21,6 @@
import static org.nuiton.i18n.I18n._;
import java.awt.Color;
import java.util.List;
-import java.util.Set;
-
import javax.swing.JEditorPane;
import javax.swing.event.HyperlinkEvent;
import javax.swing.event.HyperlinkListener;
@@ -101,7 +99,7 @@
List<FiscalPeriod> unblockedFiscalPeriods =
fiscalPeriodService.getAllUnblockedFiscalPeriods();
if (unblockedFiscalPeriods.size() != 0){
- Set<FinancialTransaction> financialTransactionsUnbal =
+ List<FinancialTransaction> financialTransactionsUnbal =
financialTransactionService.
getAllInexactFinancialTransactions(unblockedFiscalPeriods.get(0));
if (financialTransactionsUnbal.size()>0){
1
0
Author: jpepin
Date: 2010-08-21 01:46:18 +0200 (Sat, 21 Aug 2010)
New Revision: 3010
Url: http://chorem.org/repositories/revision/lima/3010
Log:
D?\195?\169bogue et optimisation ?\195?\160 partir du rapport Sonar.
Removed:
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/RecordServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/UserServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/RecordService.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/RecordServiceLocal.java
trunk/lima-business/src/test/java/org/chorem/lima/business/RecordServiceImplTest.java
trunk/lima-business/src/test/java/org/chorem/lima/business/UserServiceImplTest.java
Modified:
trunk/lima-business/src/main/java/org/chorem/lima/business/AccountingRules.java
trunk/lima-business/src/main/java/org/chorem/lima/business/LimaConfig.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ServiceMonitorable.java
trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/DefaultAccountingRules.java
trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/FranceAccountingRules.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/DocumentServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/EntryBookServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ExportServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialStatementServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FiscalPeriodServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/HttpServerServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/AccountService.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/AccountServiceLocal.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/DocumentService.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/DocumentServiceLocal.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/EntryBookServiceLocal.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ExportService.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialStatementService.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialStatementServiceLocal.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialTransactionService.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialTransactionServiceLocal.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/HttpServerService.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/IdentityService.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/IdentityServiceLocal.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ImportService.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ReportServiceLocal.java
trunk/lima-business/src/main/java/org/chorem/lima/business/utils/AccountComparator.java
trunk/lima-business/src/main/java/org/chorem/lima/business/utils/AccountEBPComparator.java
trunk/lima-business/src/main/java/org/chorem/lima/business/utils/EntryComparator.java
trunk/lima-business/src/main/java/org/chorem/lima/business/utils/EntryEBPComparator.java
trunk/lima-business/src/main/java/org/chorem/lima/business/utils/FiscalPeriodComparator.java
trunk/lima-business/src/test/java/org/chorem/lima/business/LimaConfigTest.java
trunk/lima-swing/src/main/java/org/chorem/lima/service/LimaServiceFactory.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartViewHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/util/ErrorHelper.java
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/AccountingRules.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/AccountingRules.java 2010-08-20 12:11:16 UTC (rev 3009)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/AccountingRules.java 2010-08-20 23:46:18 UTC (rev 3010)
@@ -18,8 +18,8 @@
*/
package org.chorem.lima.business;
+
import java.util.List;
-
import org.chorem.lima.entity.Account;
import org.chorem.lima.entity.ClosedPeriodicEntryBook;
import org.chorem.lima.entity.Entry;
@@ -42,11 +42,11 @@
* @param account
* @throws LimaException
*/
- public void createAccountRules(Account masterAccount, Account account) throws LimaException;
- public void createSubLedgerRules(Account masterAccount, Account account) throws LimaException;
- public void updateAccountRules(Account masterAccount, Account account) throws LimaException;
- public void updateSubLedgerRules(Account account) throws LimaException;
- public void removeAccountRules(Account account, TopiaContext transaction) throws LimaException;
+ void createAccountRules(Account masterAccount, Account account) throws LimaException;
+ void createSubLedgerRules(Account masterAccount, Account account) throws LimaException;
+ void updateAccountRules(Account masterAccount, Account account) throws LimaException;
+ void updateSubLedgerRules(Account account) throws LimaException;
+ void removeAccountRules(Account account, TopiaContext transaction) throws LimaException;
/**
* Entrybook rules
@@ -54,7 +54,7 @@
* @param topiaTransaction
* @throws LimaException
*/
- public void removeEntryBookRules(EntryBook entryBook, TopiaContext topiaTransaction) throws LimaException;
+ void removeEntryBookRules(EntryBook entryBook, TopiaContext topiaTransaction) throws LimaException;
/**
* Fiscal Period rules
@@ -62,8 +62,8 @@
* @param transaction
* @throws LimaException
*/
- public List<FinancialPeriod> createFiscalPeriodRules(FiscalPeriod fiscalPeriod, TopiaContext transaction) throws LimaException;
- public void blockFiscalPeriodRules(FiscalPeriod fiscalPeriod, TopiaContext transaction) throws LimaException;
+ List<FinancialPeriod> createFiscalPeriodRules(FiscalPeriod fiscalPeriod, TopiaContext transaction) throws LimaException;
+ void blockFiscalPeriodRules(FiscalPeriod fiscalPeriod, TopiaContext transaction) throws LimaException;
/**
* Entry rules
@@ -71,14 +71,14 @@
* @param topiaTransaction
* @throws LimaException
*/
- public void updateEntryRules(Entry entry, Entry entryOld, TopiaContext topiaTransaction) throws LimaException;
- public void updateFinancialTransactionDateRules(FinancialTransaction financialTransaction, FinancialTransaction financialTransactionOld, TopiaContext topiaContext) throws LimaException, LimaBusinessException;
+ void updateEntryRules(Entry entry, Entry entryOld, TopiaContext topiaTransaction) throws LimaException;
+ void updateFinancialTransactionDateRules(FinancialTransaction financialTransaction, FinancialTransaction financialTransactionOld, TopiaContext topiaContext) throws LimaException;
/**
* Financialperiod/entrybook rules
* @param financialTransaction
* @param topiaContext
* @throws LimaException
*/
- public void checkFinancialPeriodBlockedWithFinancialTransaction(FinancialTransaction financialTransaction, TopiaContext topiaContext) throws LimaException;
- public void blockClosedPeriodicEntryBookRules(ClosedPeriodicEntryBook closedPeriodicEntryBook, TopiaContext topiaContext) throws LimaException;
+ void checkFinancialPeriodBlockedWithFinancialTransaction(FinancialTransaction financialTransaction, TopiaContext topiaContext) throws LimaException;
+ void blockClosedPeriodicEntryBookRules(ClosedPeriodicEntryBook closedPeriodicEntryBook, TopiaContext topiaContext) throws LimaException;
}
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/LimaConfig.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/LimaConfig.java 2010-08-20 12:11:16 UTC (rev 3009)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/LimaConfig.java 2010-08-20 23:46:18 UTC (rev 3010)
@@ -43,9 +43,9 @@
private static final Log log = LogFactory.getLog(LimaConfig.class);
- protected static LimaConfig instance;
+ private static LimaConfig instance;
- private static final String configFile = "lima.properties";
+ private static final String CONFIGFILE = "lima.properties";
protected AccountingRules accountingRules;
@@ -59,7 +59,7 @@
public static LimaConfig getInstance() {
if (instance == null) {
instance = new LimaConfig();
- instance.loadConfiguration(configFile);
+ instance.loadConfiguration(CONFIGFILE);
}
return instance;
}
@@ -136,41 +136,41 @@
HTTP_PORT("lima.httpport", _("lima.config.httpport"), "5462", String.class, false, false),
SERVER_ADRESS("lima.serveraddress", _("lima.config.serveraddress"), "", String.class, false, false);
- public final String key;
- public final String description;
- public String defaultValue;
- public final Class<?> type;
- public boolean _transient;
- public boolean _final;
+ private final String key;
+ private final String description;
+ private String defaultValue;
+ private final Class<?> type;
+ private boolean transientBoolean;
+ private boolean finalBoolean;
private Option(String key, String description, String defaultValue,
- Class<?> type, boolean _transient, boolean _final) {
+ Class<?> type, boolean transientBoolean, boolean finalBoolean) {
this.key = key;
this.description = description;
this.defaultValue = defaultValue;
this.type = type;
- this._final = _final;
- this._transient = _transient;
+ this.finalBoolean = finalBoolean;
+ this.transientBoolean = transientBoolean;
}
@Override
public boolean isFinal() {
- return _final;
+ return finalBoolean;
}
@Override
- public void setFinal(boolean _final){
- this._final=_final;
+ public void setFinal(boolean finalBoolean){
+ this.finalBoolean=finalBoolean;
}
@Override
public boolean isTransient() {
- return _transient;
+ return transientBoolean;
}
@Override
- public void setTransient(boolean _transient) {
- this._transient=_transient;
+ public void setTransient(boolean transientBoolean) {
+ this.transientBoolean = transientBoolean;
}
@Override
@@ -180,7 +180,7 @@
@Override
public void setDefaultValue(String defaultValue) {
- this.defaultValue=defaultValue;
+ this.defaultValue = defaultValue;
}
@Override
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ServiceMonitorable.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ServiceMonitorable.java 2010-08-20 12:11:16 UTC (rev 3009)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ServiceMonitorable.java 2010-08-20 23:46:18 UTC (rev 3010)
@@ -20,6 +20,6 @@
package org.chorem.lima.business;
public interface ServiceMonitorable {
- public void addListener(ServiceListener l);
- public void removeListener(ServiceListener l);
+ void addListener(ServiceListener l);
+ void removeListener(ServiceListener l);
}
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/DefaultAccountingRules.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/DefaultAccountingRules.java 2010-08-20 12:11:16 UTC (rev 3009)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/DefaultAccountingRules.java 2010-08-20 23:46:18 UTC (rev 3010)
@@ -131,7 +131,7 @@
/**
* Check if entrybook have financial transaction
*/
- @Override
+ @Override
public void removeEntryBookRules(EntryBook entryBook, TopiaContext topiaTransaction) throws LimaException {
try {
FinancialTransactionDAO financialTransactionDAO = LimaCallaoDAOHelper.getFinancialTransactionDAO(topiaTransaction);
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/FranceAccountingRules.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/FranceAccountingRules.java 2010-08-20 12:11:16 UTC (rev 3009)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/FranceAccountingRules.java 2010-08-20 23:46:18 UTC (rev 3010)
@@ -89,8 +89,8 @@
/**
* Rules to check before create subledger
*/
- public void createSubLedgerRules(Account masterAccount, Account account) throws LimaException {
- super.createSubLedgerRules(masterAccount, account);
+ public void createSubLedgerRules(Account masterAccount, Account account) throws LimaException {
+ super.createSubLedgerRules(masterAccount, account);
// check if the master account number is begin with 4
if (!masterAccount.getAccountNumber().startsWith("4")){
@@ -308,24 +308,4 @@
}
throw new LimaException("Exception during query", cause);
}
-
- /**
- * Generic code used too close a transaction.
- *
- * @param transaction transaction to close
- * @param log log (can be null)
- * @throws LimaException
- */
- protected void doFinally(TopiaContext transaction, Log log) throws LimaException {
- if (transaction != null) {
- try {
- transaction.closeContext();
- } catch (TopiaException ex) {
- if (log != null && log.isErrorEnabled()) {
- log.error("Can't close transaction", ex);
- }
- throw new LimaException("Can't close transaction", ex);
- }
- }
- }
}
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 2010-08-20 12:11:16 UTC (rev 3009)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java 2010-08-20 23:46:18 UTC (rev 3010)
@@ -22,11 +22,8 @@
import static org.nuiton.i18n.I18n._;
import java.util.ArrayList;
import java.util.Collections;
-import java.util.HashSet;
import java.util.List;
-import java.util.StringTokenizer;
import javax.ejb.Stateless;
-import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.business.AccountingRules;
@@ -44,7 +41,6 @@
import org.nuiton.topia.TopiaException;
import org.nuiton.topia.TopiaNotFoundException;
import org.nuiton.topia.framework.TopiaQuery;
-import org.nuiton.topia.framework.TopiaQuery.Op;
/**
* Permet d'implémenter le Plan Comptable Général.
@@ -78,8 +74,7 @@
@Override
- public void createAccountWithTransaction(Account masterAccount, Account account, TopiaContext topiaContext) throws LimaException,
- LimaBusinessException {
+ public void createAccountWithTransaction(Account masterAccount, Account account, TopiaContext topiaContext) throws LimaException {
try {
// check if account number already exist
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/DocumentServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/DocumentServiceImpl.java 2010-08-20 12:11:16 UTC (rev 3009)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/DocumentServiceImpl.java 2010-08-20 23:46:18 UTC (rev 3010)
@@ -43,7 +43,6 @@
import org.chorem.lima.business.LimaException;
import org.chorem.lima.business.ejbinterface.DocumentService;
import org.chorem.lima.business.ejbinterface.DocumentServiceLocal;
-import org.chorem.lima.business.ejbinterface.EntryBookService;
import org.chorem.lima.business.ejbinterface.FinancialStatementService;
import org.chorem.lima.business.ejbinterface.IdentityService;
import org.chorem.lima.business.ejbinterface.ReportService;
@@ -92,17 +91,14 @@
//Services
@EJB
- IdentityService identityService;
+ private IdentityService identityService;
@EJB
- EntryBookService entryBookService;
+ private FinancialStatementService financialStatementService;
@EJB
- FinancialStatementService financialStatementService;
+ private ReportService reportService;
- @EJB
- ReportService reportService;
-
protected String path;
//SDFs
@@ -261,7 +257,7 @@
for (int i=0;i<size;i++) {
FinancialStatementAmounts fStatementAmounts =
financialStatementAmounts.get(i);
- if (fStatementAmounts.getLevel() == 1 && fStatementAmounts.getSubAmount() == false){
+ if (fStatementAmounts.getLevel() == 1 && !fStatementAmounts.getSubAmount()){
if (first){
first=false;
}
@@ -406,9 +402,9 @@
}
else {
//cell1
- String tab = "";
+ StringBuffer tab = new StringBuffer();
for (int i = 0; i < level; i++) {
- tab += "\t";
+ tab.append("\t");
}
Phrase phrase = null;
if (financialStatementAmount.getHeader()){
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 2010-08-20 12:11:16 UTC (rev 3009)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/EntryBookServiceImpl.java 2010-08-20 23:46:18 UTC (rev 3010)
@@ -146,16 +146,16 @@
*/
public List<EntryBook> getAllEntryBooks() throws LimaException {
- List<EntryBook> EntryBooksList = new ArrayList<EntryBook>();
+ List<EntryBook> entryBooksList = new ArrayList<EntryBook>();
TopiaContext transaction = null;
try {
transaction = beginTransaction();
// check if entrybook with is name already exist
- EntryBookDAO EntryBookDAO =
+ EntryBookDAO entryBookDAO =
LimaCallaoDAOHelper.getEntryBookDAO(transaction);
- List<EntryBook> EntryBooks = EntryBookDAO.findAll();
- EntryBooksList.addAll(EntryBooks);
+ List<EntryBook> entryBooks = entryBookDAO.findAll();
+ entryBooksList.addAll(entryBooks);
}
catch (TopiaException ex) {
doCatch(transaction, ex, log);
@@ -164,7 +164,7 @@
doFinally(transaction, log);
}
- return EntryBooksList;
+ return entryBooksList;
}
/**
@@ -213,9 +213,9 @@
accountingRules.removeEntryBookRules(entryBook, topiaTransaction);
//delete
- EntryBookDAO EntryBookDAO =
+ EntryBookDAO entryBookDAO =
LimaCallaoDAOHelper.getEntryBookDAO(topiaTransaction);
- EntryBookDAO.delete(entryBook);
+ entryBookDAO.delete(entryBook);
commitTransaction(topiaTransaction);
}
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ExportServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ExportServiceImpl.java 2010-08-20 12:11:16 UTC (rev 3009)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ExportServiceImpl.java 2010-08-20 23:46:18 UTC (rev 3010)
@@ -73,7 +73,7 @@
private TopiaContext rootContext;
- private static final SimpleDateFormat SDateFormat = new SimpleDateFormat("dd,MM,yyyy HH:mm:ss");
+ private static final SimpleDateFormat SDATEFORMAT = new SimpleDateFormat("dd,MM,yyyy HH:mm:ss");
public ExportServiceImpl() {
LimaConfig config = LimaConfig.getInstance();
@@ -96,7 +96,7 @@
public String exportEntriesAsEBP() throws LimaException {
TopiaContext topiaContext = null;
SimpleDateFormat epbDateFormat = new SimpleDateFormat("ddMMyyyy");
- String result = "";
+ StringBuffer result = new StringBuffer();
int num = 0;
try {
@@ -151,10 +151,10 @@
string = nextln;
}
if (i==8){
- result+=string+"\r\n";
+ result.append(string+"\r\n");
}
else {
- result+=string+",";
+ result.append(string+",");
}
}
}
@@ -169,7 +169,7 @@
finally {
doFinally(topiaContext, log);
}
- return result;
+ return result.toString();
}
/**
@@ -310,17 +310,17 @@
for (FinancialStatement financialStatement : listFinancialStatements) {
nextLine[0] = ImportExportEntityEnum.FINANCIALSTATEMENT.getLabel();
nextLine[1] = financialStatement.getLabel();
- nextLine[2] = new Boolean(
- financialStatement.getHeader()).toString();
+ nextLine[2] = Boolean.toString(
+ financialStatement.getHeader());
nextLine[3] = financialStatement.getAccounts();
nextLine[4] = financialStatement.getDebitAccounts();
nextLine[5] = financialStatement.getCreditAccounts();
nextLine[6] = financialStatement.
getProvisionDeprecationAccounts();
- nextLine[7] = new Boolean(
- financialStatement.getSubAmount()).toString();
- nextLine[8] = new Boolean(
- financialStatement.getHeaderAmount()).toString();
+ nextLine[7] = Boolean.toString(
+ financialStatement.getSubAmount());
+ nextLine[8] = Boolean.toString(
+ financialStatement.getHeaderAmount());
FinancialStatement masterFinancialStatement =
financialStatement.getMasterFinancialStatement();
String masterFinancialStatementString = "";
@@ -491,14 +491,14 @@
nextLine[0] = ImportExportEntityEnum.FINANCIALTRANSACTION.getLabel();
nextLine[1] = String.valueOf(numTransaction);
nextLine[2] =
- SDateFormat.format(financialTransaction.getTransactionDate());
+ SDATEFORMAT.format(financialTransaction.getTransactionDate());
nextLine[3] = financialTransaction.getAmountDebit().toString();
nextLine[4] = financialTransaction.getAmountCredit().toString();
nextLine[5] =
- SDateFormat.format(financialTransaction.getFinancialPeriod().
+ SDATEFORMAT.format(financialTransaction.getFinancialPeriod().
getBeginDate());
nextLine[6] =
- SDateFormat.format(financialTransaction.getFinancialPeriod().
+ SDATEFORMAT.format(financialTransaction.getFinancialPeriod().
getEndDate());
EntryBook entryBook = financialTransaction.getEntryBook();
if (entryBook != null){
@@ -513,7 +513,7 @@
nextLine[1] = String.valueOf(numTransaction);
nextLine[2] = entry.getDescription();
nextLine[3] = entry.getAmount().toString();
- nextLine[4] = new Boolean(entry.getDebit()).toString();
+ nextLine[4] = Boolean.toString(entry.getDebit());
nextLine[5] = entry.getLettering();
nextLine[6] = entry.getDetail();
nextLine[7] = entry.getVoucher();
@@ -546,9 +546,9 @@
// For all Entry
for (FiscalPeriod fiscalPeriod : listFiscalPeriod) {
nextLine[0] = ImportExportEntityEnum.FISCALPERIOD.getLabel();
- nextLine[1] = SDateFormat.format(fiscalPeriod.getBeginDate());
- nextLine[2] = SDateFormat.format(fiscalPeriod.getEndDate());
- nextLine[3] = new Boolean(fiscalPeriod.getLocked()).toString();
+ nextLine[1] = SDATEFORMAT.format(fiscalPeriod.getBeginDate());
+ nextLine[2] = SDATEFORMAT.format(fiscalPeriod.getEndDate());
+ nextLine[3] = Boolean.toString(fiscalPeriod.getLocked());
// Ajoute la ligne au fichier
csvWriter.writeNext(nextLine);
}
@@ -574,13 +574,13 @@
// For all Entry
for (ClosedPeriodicEntryBook closedPeriodicEntryBook : listClosedPeriodicEntryBook) {
nextLine[0] = ImportExportEntityEnum.CLOSEDPERIODICENTRYBOOK.getLabel();
- nextLine[1] = new Boolean(
- closedPeriodicEntryBook.getLocked()).toString();
+ nextLine[1] = Boolean.toString(
+ closedPeriodicEntryBook.getLocked());
nextLine[2] =
- SDateFormat.format(closedPeriodicEntryBook.getFinancialPeriod().
+ SDATEFORMAT.format(closedPeriodicEntryBook.getFinancialPeriod().
getBeginDate());
nextLine[3] =
- SDateFormat.format(closedPeriodicEntryBook.getFinancialPeriod().
+ SDATEFORMAT.format(closedPeriodicEntryBook.getFinancialPeriod().
getEndDate());
nextLine[4] = closedPeriodicEntryBook.getEntryBook().getCode();
// Ajoute la ligne au fichier
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 2010-08-20 12:11:16 UTC (rev 3009)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialStatementServiceImpl.java 2010-08-20 23:46:18 UTC (rev 3010)
@@ -37,7 +37,6 @@
import org.chorem.lima.beans.FinancialStatementDatasImpl;
import org.chorem.lima.beans.ReportsDatas;
import org.chorem.lima.business.AccountingRules;
-import org.chorem.lima.business.LimaBusinessException;
import org.chorem.lima.business.LimaConfig;
import org.chorem.lima.business.LimaException;
import org.chorem.lima.business.ejbinterface.FinancialStatementService;
@@ -66,7 +65,7 @@
protected AccountingRules accountingRules;
@EJB
- ReportServiceLocal reportServiceLocal;
+ private ReportServiceLocal reportServiceLocal;
public FinancialStatementServiceImpl() {
LimaConfig config = LimaConfig.getInstance();
@@ -84,7 +83,7 @@
public void createFinancialStatementWithTransaction(
FinancialStatement masterFinancialStatement,
FinancialStatement financialStatement, TopiaContext topiaContext)
- throws LimaException, LimaBusinessException {
+ throws LimaException {
try {
@@ -126,7 +125,7 @@
}
@Override
- public void createFinancialStatement(FinancialStatement masterFinancialStatement, FinancialStatement financialStatement) throws LimaException, LimaBusinessException {
+ public void createFinancialStatement(FinancialStatement masterFinancialStatement, FinancialStatement financialStatement) throws LimaException {
TopiaContext transaction = null;
try {
@@ -144,7 +143,7 @@
@Override
- public void removeFinancialStatement(FinancialStatement financialStatement) throws LimaException, LimaBusinessException {
+ public void removeFinancialStatement(FinancialStatement financialStatement) throws LimaException {
TopiaContext transaction = null;
try {
@@ -189,8 +188,7 @@
@Override
- public void removeAllFinancialStatement() throws LimaException,
- LimaBusinessException {
+ public void removeAllFinancialStatement() throws LimaException {
for (FinancialStatement financialStatement : getChildrenFinancialStatement(null)) {
removeFinancialStatement(financialStatement);
}
@@ -212,7 +210,7 @@
}
@Override
- public List<FinancialStatement> getAllChildrenFinancialStatement(FinancialStatement financialStatement, List<FinancialStatement> result) throws LimaException, LimaBusinessException {
+ public List<FinancialStatement> getAllChildrenFinancialStatement(FinancialStatement financialStatement, List<FinancialStatement> result) throws LimaException {
List<FinancialStatement> childFinancialStatements =
getChildrenFinancialStatement(financialStatement);
for (FinancialStatement childFinancialStatement: childFinancialStatements) {
@@ -250,7 +248,7 @@
@Override
- public void updateFinancialStatement(FinancialStatement financialStatement) throws LimaException, LimaBusinessException {
+ public void updateFinancialStatement(FinancialStatement financialStatement) throws LimaException {
TopiaContext transaction = null;
try {
transaction = beginTransaction();
@@ -460,8 +458,8 @@
if (accountsNumberList != null){
//Remove Spaces
AccountDAO accountDAO = LimaCallaoDAOHelper.getAccountDAO(topiaContext);
- accountsNumberList = StringUtils.deleteWhitespace(accountsNumberList);
- StringTokenizer stQuote = new StringTokenizer(accountsNumberList, "-");
+ String result = StringUtils.deleteWhitespace(accountsNumberList);
+ StringTokenizer stQuote = new StringTokenizer(result, "-");
while (stQuote.hasMoreTokens()) {
String s = stQuote.nextToken();
List<Account> accountsList = accountDAO.stringToListAccounts(s, false);
@@ -526,7 +524,7 @@
@Override
public String checkFinancialStatementChart() throws LimaException {
- String result =_("lima-business.financialstatement.check.warn");
+ StringBuffer result = new StringBuffer(_("lima-business.financialstatement.check.warn"));
TopiaContext transaction = null;
try {
transaction = beginTransaction();
@@ -562,8 +560,8 @@
for (Account account : accountsList) {
- result += _("lima-business.financialstatement.check.nothing")
- + " : "+account.getAccountNumber()+" - "+account.getLabel()+"\n";
+ result.append(_("lima-business.financialstatement.check.nothing")
+ + " : "+account.getAccountNumber()+" - "+account.getLabel()+"\n");
}
}
@@ -573,7 +571,7 @@
finally {
doFinally(transaction, log);
}
- return result;
+ return result.toString();
}
public List<FinancialStatement> findFinancialStatementByAccountNumber(String accountNumber, TopiaContext topiaContext) throws TopiaException{
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 2010-08-20 12:11:16 UTC (rev 3009)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java 2010-08-20 23:46:18 UTC (rev 3010)
@@ -19,9 +19,7 @@
package org.chorem.lima.business.ejb;
-import static org.nuiton.i18n.I18n._;
import java.math.BigDecimal;
-import java.util.ArrayList;
import java.util.Date;
import java.util.HashSet;
import java.util.List;
@@ -651,12 +649,12 @@
else if (accountsList != null){
AccountDAO accountDAO = LimaCallaoDAOHelper.getAccountDAO(topiaContext);
List<Account> accounts = accountDAO.stringToListAccounts(accountsList, false);
- String accountNumbers = "0,";
+ StringBuffer accountNumbers = new StringBuffer("0,");
int max = accounts.size();
for (int i = 1; i <= max; i++) {
- accountNumbers += accounts.get(i-1).getAccountNumber();
+ accountNumbers.append(accounts.get(i-1).getAccountNumber());
if (i != max){
- accountNumbers += ",";
+ accountNumbers.append(",");
}
}
if (accounts.size() > 0){
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 2010-08-20 12:11:16 UTC (rev 3009)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FiscalPeriodServiceImpl.java 2010-08-20 23:46:18 UTC (rev 3010)
@@ -19,7 +19,6 @@
package org.chorem.lima.business.ejb;
-import static org.nuiton.i18n.I18n._;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
@@ -63,7 +62,7 @@
protected AccountingRules accountingRules;
@EJB
- FinancialPeriodServiceLocal financialPeriodService;
+ private FinancialPeriodServiceLocal financialPeriodService;
public FiscalPeriodServiceImpl() {
LimaConfig config = LimaConfig.getInstance();
@@ -222,7 +221,7 @@
try {
transaction = beginTransaction();
- if (fiscalPeriod.getLocked()==true){
+ if (fiscalPeriod.getLocked()){
throw new LimaBusinessException("Fiscal Period already blocked");
}
//check rules
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/HttpServerServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/HttpServerServiceImpl.java 2010-08-20 12:11:16 UTC (rev 3009)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/HttpServerServiceImpl.java 2010-08-20 23:46:18 UTC (rev 3010)
@@ -57,11 +57,10 @@
@Stateless
public class HttpServerServiceImpl extends AbstractLimaService implements HttpServerService, HttpServerServiceLocal {
- private static final Log log =
- LogFactory.getLog(HttpServerServiceImpl.class);
+ private static final Log log = LogFactory.getLog(HttpServerServiceImpl.class);
@EJB
- DocumentService documentService;
+ private DocumentService documentService;
protected Server server;
@@ -69,8 +68,7 @@
protected int port;
- private static SimpleDateFormat dateFormat =
- new SimpleDateFormat("yyyy-MM-dd");
+ private static SimpleDateFormat DATEFORMAT = new SimpleDateFormat("yyyy-MM-dd");
public HttpServerServiceImpl() {
path = LimaConfig.getInstance().getReportsDir();
@@ -110,7 +108,7 @@
/** this servlet send a static html page */
public class MainServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
- String serverAddressConfig = LimaConfig.getInstance().getAddressServer();
+ private String serverAddressConfig = LimaConfig.getInstance().getAddressServer();
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
@@ -139,8 +137,8 @@
+ model +formatsEnum.getExtension());
//create docs
try {
- Date beginDateFormat = dateFormat.parse(beginDate);
- Date endDateFormat = dateFormat.parse(endDate);
+ Date beginDateFormat = DATEFORMAT.parse(beginDate);
+ Date endDateFormat = DATEFORMAT.parse(endDate);
switch (DocumentsEnum.valueOfLink(model)) {
case BALANCE:
@@ -177,7 +175,7 @@
// else return home html
else {
resp.setContentType(FormatsEnum.HTML.getMimeType());
- String pageContent = "";
+ StringBuffer pageContent = new StringBuffer();
String serverAdress = "http://";
log.info("Page load");
@@ -198,7 +196,7 @@
beginDatePicker =
DateUtils.truncate(beginDatePicker, Calendar.YEAR);
- pageContent = "<!DOCTYPE html>\n"
+ pageContent.append("<!DOCTYPE html>\n"
+ "<html lang=\"fr\">\n"
+ "<head>\n"
+ "<title>LIMA Documents Report</title>\n"
@@ -216,29 +214,29 @@
+ "<td rowspan=3><form method=GET action="
+ serverAdress + ">\n"
+ _("lima-business.document.date.begin")
- + "<input value=\""+dateFormat.format(beginDatePicker)
+ + "<input value=\""+DATEFORMAT.format(beginDatePicker)
+ "\" type=\"date\" name=\"beginDate\">\n"
+ _("lima-business.document.date.end")
- + "<input value=\""+dateFormat.format(endDatePicker)
+ + "<input value=\""+DATEFORMAT.format(endDatePicker)
+ "\" type=\"date\" name=\"endDate\">\n<br/><br/>"
- + "Format : <select name=\"format\">";
+ + "Format : <select name=\"format\">");
for (FormatsEnum formatsEnum : FormatsEnum.values()) {
- pageContent += "<option value=\""
+ pageContent.append("<option value=\""
+ formatsEnum.getExtension()+"\">"
- + formatsEnum.getDescription()+"</option>\n";
+ + formatsEnum.getDescription()+"</option>\n");
}
- pageContent += "</select>\n"
- + "Documents : <select name=\"model\">";
+ pageContent.append("</select>\n"
+ + "Documents : <select name=\"model\">");
for (DocumentsEnum documentsEnum : DocumentsEnum.values()) {
- pageContent += "<option value=\""
+ pageContent.append("<option value=\""
+ documentsEnum.getFileName()+"\">"
- + documentsEnum.getDescription()+"</option>\n";
+ + documentsEnum.getDescription()+"</option>\n");
}
- pageContent += "</select>\n"
+ pageContent.append("</select>\n"
+ "<tr><td><img src=\"?img=entries.png\"/></td></tr>\n"
+ "<tr><td><img src=\"?img=accounts.png\"/></td></tr>\n"
+ "<tr><td><img src=\"?img=entrybooks.png\"/></td>\n"
@@ -247,9 +245,9 @@
+ "<tr><td><img src=\"?img=fiscalperiods.png\"/></td></tr>\n"
+ "</table>\n"
+ "</body>\n"
- + "</html>";
+ + "</html>");
- resp.getWriter().write(pageContent);
+ resp.getWriter().write(pageContent.toString());
}
}
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 2010-08-20 12:11:16 UTC (rev 3009)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java 2010-08-20 23:46:18 UTC (rev 3010)
@@ -123,27 +123,27 @@
// Services
@EJB
- AccountServiceLocal accountService;
+ private AccountServiceLocal accountService;
@EJB
- FiscalPeriodServiceLocal fiscalPeriodService;
+ private FiscalPeriodServiceLocal fiscalPeriodService;
@EJB
- FinancialPeriodServiceLocal financialPeriodService;
+ private FinancialPeriodServiceLocal financialPeriodService;
@EJB
- FinancialTransactionServiceLocal financialTransactionService;
+ private FinancialTransactionServiceLocal financialTransactionService;
@EJB
- FinancialStatementServiceLocal financialStatementService;
+ private FinancialStatementServiceLocal financialStatementService;
@EJB
- EntryBookServiceLocal entryBookService;
+ private EntryBookServiceLocal entryBookService;
@EJB
- IdentityServiceLocal identityService;
+ private IdentityServiceLocal identityService;
- private static final SimpleDateFormat SDateFormat = new SimpleDateFormat(
+ private static final SimpleDateFormat SDATEFORMAT = new SimpleDateFormat(
"dd,MM,yyyy HH:mm:ss");
public ImportServiceImpl() {
@@ -162,7 +162,7 @@
@Override
public String importEntriesFromEbp(String datas) throws LimaException {
SimpleDateFormat epbDateFormat = new SimpleDateFormat("dd/MM/yyyy");
- String result = "";
+ StringBuffer result = new StringBuffer();
TopiaContext topiaContext = null;
try {
@@ -232,9 +232,9 @@
else if (date.compareTo(beginDate) < 0 || date.compareTo(endDate) > 0){
- result += "WARNING : " + date + " entries is out of range of" +
+ result.append("WARNING : " + date + " entries is out of range of" +
" opened fiscal periods. "
- + "Entry was skip !\n";
+ + "Entry was skip !\n");
}
else {
entry.setAccount(account);
@@ -260,8 +260,8 @@
entryBook.setCode(entryBookCode);
// create it
entryBookService.createEntryBook(entryBook);
- result += "WARNING : Entrybook " + entryBook
- + "not exist was created !\n";
+ result.append("WARNING : Entrybook " + entryBook
+ + "not exist was created !\n");
}
if (financialTransaction == null
@@ -287,15 +287,15 @@
financialTransactionService
.createFinancialTransactionWithTransaction(
financialTransaction, topiaContext);
- result += "SUCCES : FinancialTransaction" + date + " "
- + entryBook.getCode() + " added\n";
+ result.append("SUCCES : FinancialTransaction" + date + " "
+ + entryBook.getCode() + " added\n");
}
financialTransaction.addEntry(entry);
financialTransactionService.createEntryWithTransaction(
entry, topiaContext);
- result += "SUCCES : Entry" + entry.getDescription() + " "
- + entry.getAmount() + " added\n";
+ result.append("SUCCES : Entry" + entry.getDescription() + " "
+ + entry.getAmount() + " added\n");
}
}
// update last financial transaction
@@ -320,12 +320,12 @@
} finally {
doFinally(topiaContext, log);
}
- return result;
+ return result.toString();
}
@Override
public String importAccountsChartFromEbp(String datas) throws LimaException {
- String result = "";
+ StringBuffer result = new StringBuffer();
TopiaContext topiaContext = null;
try {
@@ -355,8 +355,8 @@
for (AccountEBP accountEBP : list) {
String accountNumber = accountEBP.getNumero();
if (accountDAO.findByAccountNumber(accountNumber) != null) {
- result += "FAILED : Account" + accountNumber
- + " already exist \n";
+ result.append("FAILED : Account" + accountNumber
+ + " already exist \n");
} else {
String label = accountEBP.getIntitule();
Account account = new AccountImpl();
@@ -376,8 +376,8 @@
}
accountService.createSubLedgerWithTransaction(
masterAccount, account, topiaContext);
- result += "SUCCES : Account" + accountNumber + " "
- + label + " added\n";
+ result.append("SUCCES : Account" + accountNumber + " "
+ + label + " added\n");
}
// else is account
else {
@@ -386,8 +386,8 @@
if (nbCharAccountNumber == 1) {
accountService.createAccountWithTransaction(null,
account, topiaContext);
- result += "SUCCES : Account" + accountNumber + " "
- + label + " added\n";
+ result.append("SUCCES : Account" + accountNumber + " "
+ + label + " added\n");
}
else {
Account masterAccount = null;
@@ -401,8 +401,8 @@
}
accountService.createAccountWithTransaction(
masterAccount, account, topiaContext);
- result += "SUCCES : Account" + accountNumber + " "
- + label + " added\n";
+ result.append("SUCCES : Account" + accountNumber + " "
+ + label + " added\n");
}
}
}
@@ -417,7 +417,7 @@
doFinally(topiaContext, log);
}
- return result;
+ return result.toString();
}
@Override
@@ -439,7 +439,7 @@
*/
@Override
public String importAllAsCSV(String datas) throws LimaException {
- String result = "";
+ StringBuffer result = new StringBuffer();
Map<String, AccountImport> accounts = new TreeMap<String, AccountImport>();
@@ -470,20 +470,20 @@
if (importExportEntityEnum != null) {
switch (importExportEntityEnum) {
case ACCOUNT:
- result += importAccountsChartsCSV(nextLine, accounts,
- topiaContext);
+ result.append(importAccountsChartsCSV(nextLine, accounts,
+ topiaContext));
break;
case ENTRYBOOK:
- result += importEntryBooksChartCSV(nextLine,
- topiaContext);
+ result.append(importEntryBooksChartCSV(nextLine,
+ topiaContext));
break;
case FINANCIALSTATEMENT:
- result += importFinancialsStatementChartCSV(nextLine,
- financialStatements, topiaContext);
+ result.append(importFinancialsStatementChartCSV(nextLine,
+ financialStatements, topiaContext));
break;
case FISCALPERIOD:
- result += importFiscalPeriodCSV(nextLine,
- fiscalPeriods, topiaContext);
+ result.append(importFiscalPeriodCSV(nextLine,
+ fiscalPeriods, topiaContext));
break;
case CLOSEDPERIODICENTRYBOOK:
importClosedPeriodicEntryBookCSV(nextLine,
@@ -504,19 +504,19 @@
}
// create accounts
- result += createAccounts(accounts, topiaContext);
+ result.append(createAccounts(accounts, topiaContext));
// create financialStatements
- result += createFinancialStatements(financialStatements,
- topiaContext);
+ result.append(createFinancialStatements(financialStatements,
+ topiaContext));
// create fiscalperiod
Collections.sort(fiscalPeriods, new FiscalPeriodComparator());
- result += createFiscalPeriod(fiscalPeriods, topiaContext);
+ result.append(createFiscalPeriod(fiscalPeriods, topiaContext));
// update closedperiodicentrybooks
- result += updateClosedPeriodicEntryBooks(closedPeriodicEntryBooks,
- topiaContext);
+ result.append(updateClosedPeriodicEntryBooks(closedPeriodicEntryBooks,
+ topiaContext));
// create financialtransaction and entries
- result += createFinancialTransactionsAndEntries(
- financialTransactions, entries, topiaContext);
+ result.append(createFinancialTransactionsAndEntries(
+ financialTransactions, entries, topiaContext));
commitTransaction(topiaContext);
@@ -527,7 +527,7 @@
} finally {
doFinally(topiaContext, log);
}
- return result;
+ return result.toString();
}
/**
@@ -536,7 +536,7 @@
*/
@Override
public String importAsCSV(String datas, ImportExportEntityEnum importExportEntityEnum) throws LimaException {
- String result = "";
+ StringBuffer result = new StringBuffer();
// FinancialStatements
LinkedHashMap<String, ArrayList<FinancialStatementImport>> financialStatements = null;
@@ -563,17 +563,17 @@
if (ImportExportEntityEnum.valueOfLabel(nextLine[0]) == importExportEntityEnum) {
switch (importExportEntityEnum) {
case ENTRYBOOK:
- result += importEntryBooksChartCSV(nextLine, topiaContext);
+ result.append(importEntryBooksChartCSV(nextLine, topiaContext));
break;
case ACCOUNT:
- result += importAccountsChartsCSV(nextLine, accounts,
- topiaContext);
+ result.append(importAccountsChartsCSV(nextLine, accounts,
+ topiaContext));
break;
case FINANCIALSTATEMENT:
- result += importFinancialsStatementChartCSV(nextLine,
- financialStatements, topiaContext);
+ result.append(importFinancialsStatementChartCSV(nextLine,
+ financialStatements, topiaContext));
break;
}
}
@@ -582,11 +582,11 @@
//create entity
switch (importExportEntityEnum) {
case ACCOUNT:
- result += createAccounts(accounts, topiaContext);
+ result.append(createAccounts(accounts, topiaContext));
break;
case FINANCIALSTATEMENT:
- result += createFinancialStatements(financialStatements,
- topiaContext);
+ result.append(createFinancialStatements(financialStatements,
+ topiaContext));
break;
}
@@ -597,7 +597,7 @@
} finally {
doFinally(topiaContext, log);
}
- return result;
+ return result.toString();
}
@@ -610,7 +610,7 @@
public String importAccountsChartsCSV(String[] nextLine,
Map<String, AccountImport> accounts, TopiaContext topiaContext)
throws LimaException {
- String result = "";
+ StringBuffer result = new StringBuffer();
String accountNumber = nextLine[1];
String label = nextLine[2];
String thirdParty = nextLine[3];
@@ -633,13 +633,13 @@
// put it in hashset
accounts.put(accountNumber, accountImport);
} else {
- result += "FAILED : The account " + accountNumber
- + " already exists !\n";
+ result.append("FAILED : The account " + accountNumber
+ + " already exists !\n");
}
} catch (TopiaException eeeTE) {
doCatch(topiaContext, eeeTE, log);
}
- return result;
+ return result.toString();
}
/**
@@ -649,24 +649,24 @@
public String importFiscalPeriodCSV(String[] nextLine,
List<FiscalPeriod> fiscalPeriods, TopiaContext topiaContext)
throws LimaException {
- String result = "";
+ StringBuffer result = new StringBuffer();
try {
FiscalPeriodDAO fiscalPeriodDAO = LimaCallaoDAOHelper
.getFiscalPeriodDAO(topiaContext);
FiscalPeriod fiscalPeriod = new FiscalPeriodImpl();
- Date beginDate = SDateFormat.parse(nextLine[1]);
+ Date beginDate = SDATEFORMAT.parse(nextLine[1]);
fiscalPeriod.setBeginDate(beginDate);
- Date endDate = SDateFormat.parse(nextLine[2]);
+ Date endDate = SDATEFORMAT.parse(nextLine[2]);
fiscalPeriod.setEndDate(endDate);
- fiscalPeriod.setLocked(new Boolean(nextLine[3]));
+ fiscalPeriod.setLocked(Boolean.parseBoolean(nextLine[3]));
// if not exist, skip
if (fiscalPeriodDAO.findByNaturalId(beginDate, endDate) == null) {
fiscalPeriods.add(fiscalPeriod);
} else {
- result += "FAILED : The fiscalperiod " + beginDate + "-"
- + endDate + " already exists !\n";
+ result.append("FAILED : The fiscalperiod " + beginDate + "-"
+ + endDate + " already exists !\n");
}
} catch (ParseException eeePE) {
if (log.isDebugEnabled()) {
@@ -675,7 +675,7 @@
} catch (TopiaException eeeTE) {
doCatch(topiaContext, eeeTE, log);
}
- return result;
+ return result.toString();
}
/**
@@ -683,7 +683,7 @@
*/
public String importEntryBooksChartCSV(String[] nextLine,
TopiaContext topiaContext) throws LimaException {
- String result = "";
+ StringBuffer result = new StringBuffer();
try {
EntryBookDAO entryBookDAO = LimaCallaoDAOHelper
@@ -696,18 +696,18 @@
// if exist, skip
if (entryBookDAO.findByCode(entryBook.getCode()) != null) {
- result += "FAILED : The entrybook " + entryBook.getLabel()
- + " already exists !\n";
+ result.append("FAILED : The entrybook " + entryBook.getLabel()
+ + " already exists !\n");
} else {
// create it
entryBookService.createEntryBook(entryBook);
- result += "SUCCESS : The financialStatement "
- + entryBook.getLabel() + " is created ! \n";
+ result.append("SUCCESS : The financialStatement "
+ + entryBook.getLabel() + " is created ! \n");
}
} catch (TopiaException eeeTE) {
doCatch(topiaContext, eeeTE, log);
}
- return result;
+ return result.toString();
}
/**
@@ -722,7 +722,7 @@
String endDate = nextLine[3];
String entryBookCode = nextLine[4];
- if (new Boolean(locked)) {
+ if (Boolean.parseBoolean(locked)) {
ClosedPeriodicEntryBookImport closedPeriodicEntryBookImport = new ClosedPeriodicEntryBookImportImpl();
closedPeriodicEntryBookImport.setLocked(locked);
closedPeriodicEntryBookImport
@@ -744,7 +744,7 @@
public String importFinancialsStatementChartCSV(String[] nextLine,
LinkedHashMap<String, ArrayList<FinancialStatementImport>> financialStatements,
TopiaContext topiaContext) throws LimaException {
- String result = "";
+ StringBuffer result = new StringBuffer();
String label = nextLine[1];
String header = nextLine[2];
@@ -788,13 +788,13 @@
financialStatements.put(label, (ArrayList<FinancialStatementImport>) list);
}
} else {
- result += "FAILED : The financialstatement " + label
- + " already exists !\n";
+ result.append("FAILED : The financialstatement " + label
+ + " already exists !\n");
}
} catch (TopiaException eeeTE) {
doCatch(topiaContext, eeeTE, log);
}
- return result;
+ return result.toString();
}
/**
@@ -852,7 +852,7 @@
public String createFinancialStatements(LinkedHashMap<String, ArrayList<FinancialStatementImport>> financialStatements,
TopiaContext topiaContext) throws LimaException {
- String result = "";
+ StringBuffer result = new StringBuffer();
try {
FinancialStatementDAO financialStatementDAO = LimaCallaoDAOHelper
@@ -911,18 +911,18 @@
masterFinancialStatement,
financialStatement, topiaContext);
- result += "SUCCESS : The financialStatement "
+ result.append("SUCCESS : The financialStatement "
+ financialStatementImport.getLabel()
- + " is created ! \n";
+ + " is created ! \n");
itr2.remove();
} else if (!financialStatements
.containsKey(masterFinancialStatementLabel)) {
- result += "FAILED : The financialStatement "
+ result.append("FAILED : The financialStatement "
+ financialStatementImport.getLabel()
+ " have masterFinancialStatement : "
+ masterFinancialStatementLabel
- + "which not exist \n";
+ + "which not exist \n");
itr2.remove();
}
}
@@ -934,30 +934,30 @@
} catch (TopiaException eeeTE) {
doCatch(topiaContext, eeeTE, log);
}
- return result;
+ return result.toString();
}
public String createFiscalPeriod(List<FiscalPeriod> fiscalPeriods,
TopiaContext topiaContext) {
- String result = "";
+ StringBuffer result = new StringBuffer();
for (FiscalPeriod fiscalPeriod : fiscalPeriods) {
// create fiscalPeriod
try {
fiscalPeriodService.createFiscalPeriodWithTransaction(
fiscalPeriod, topiaContext);
- result += "SUCCESS : The fiscalPeriod "
+ result.append("SUCCESS : The fiscalPeriod "
+ fiscalPeriod.getBeginDate() + "-"
- + fiscalPeriod.getEndDate() + " is created ! \n";
+ + fiscalPeriod.getEndDate() + " is created ! \n");
} catch (LimaException eee) {
- result += "FAILED : " + eee + " \n";
+ result.append("FAILED : " + eee + " \n");
}
}
- return result;
+ return result.toString();
}
public String createAccounts(Map<String, AccountImport> accounts,
TopiaContext topiaContext) throws LimaException {
- String result = "";
+ StringBuffer result = new StringBuffer();
try {
AccountDAO accountDAO = LimaCallaoDAOHelper
@@ -993,16 +993,16 @@
accountService.createAccountWithTransaction(
masterAccount, account, topiaContext);
}
- result += "SUCCESS : The account "
+ result.append("SUCCESS : The account "
+ accountImport.getAccountNumber()
- + " is created ! \n";
+ + " is created ! \n");
itr.remove();
} else if (!accounts.containsKey(masterAccountNumber)
&& !accounts.containsKey(generalLedgerNumber)) {
- result += "FAILED : The account "
+ result.append("FAILED : The account "
+ accountImport.getAccountNumber()
+ " have masterAccount : "
- + masterAccountNumber + "which not exist \n";
+ + masterAccountNumber + "which not exist \n");
itr.remove();
}
}
@@ -1010,13 +1010,13 @@
} catch (TopiaException eeeTE) {
doCatch(topiaContext, eeeTE, log);
}
- return result;
+ return result.toString();
}
public String updateClosedPeriodicEntryBooks(
List<ClosedPeriodicEntryBookImport> closedPeriodicEntryBooks,
TopiaContext topiaContext) throws LimaException {
- String result = "";
+ StringBuffer result = new StringBuffer();
try {
FinancialPeriodDAO financialPeriodDAO = LimaCallaoDAOHelper
@@ -1027,10 +1027,10 @@
.getClosedPeriodicEntryBookDAO(topiaContext);
for (ClosedPeriodicEntryBookImport closedPeriodicEntryBookImport : closedPeriodicEntryBooks) {
// update closedPeriodicEntryBook
- Date beginDateFinancialPeriod = SDateFormat
+ Date beginDateFinancialPeriod = SDATEFORMAT
.parse(closedPeriodicEntryBookImport
.getBeginDateFinancialPeriod());
- Date endDateFinancialPeriod = SDateFormat
+ Date endDateFinancialPeriod = SDATEFORMAT
.parse(closedPeriodicEntryBookImport
.getEndDateFinancialPeriod());
FinancialPeriod financialPeriod = financialPeriodDAO
@@ -1046,12 +1046,12 @@
financialPeriodService
.blockClosedPeriodicEntryBookWithTransaction(
closedPeriodicEntryBook, topiaContext);
- result += "SUCCESS : The blockClosedPeriodicEntryBook "
+ result.append("SUCCESS : The blockClosedPeriodicEntryBook "
+ beginDateFinancialPeriod + "-"
+ endDateFinancialPeriod + ", " + codeEntryBook
- + " is updated ! \n";
+ + " is updated ! \n");
} catch (LimaException eee) {
- result += "FAILED : " + eee + " \n";
+ result.append("FAILED : " + eee + " \n");
}
}
} catch (TopiaException eeeTE) {
@@ -1061,14 +1061,14 @@
log.debug("Can't parse date", eeePE);
}
}
- return result;
+ return result.toString();
}
public String createFinancialTransactionsAndEntries(
Map<Integer, FinancialTransactionImport> financialTransactions,
Map<Integer, List<EntryImport>> entries, TopiaContext topiaContext)
throws LimaException {
- String result = "";
+ StringBuffer result = new StringBuffer();
try {
EntryBookDAO entryBookDAO = LimaCallaoDAOHelper
.getEntryBookDAO(topiaContext);
@@ -1085,7 +1085,7 @@
FinancialTransactionImport financialTransactionImport = map
.getValue();
FinancialTransaction financialTransaction = new FinancialTransactionImpl();
- Date dateFinancialTransaction = SDateFormat
+ Date dateFinancialTransaction = SDATEFORMAT
.parse(financialTransactionImport.getDate());
financialTransaction
.setTransactionDate(dateFinancialTransaction);
@@ -1112,7 +1112,7 @@
entry.setAccount(account);
entry.setDescription(entryImport.getDescription());
entry.setAmount(new BigDecimal(entryImport.getAmount()));
- entry.setDebit(new Boolean(entryImport.getDebit()));
+ entry.setDebit(Boolean.parseBoolean(entryImport.getDebit()));
entry.setLettering(entryImport.getLettering());
entry.setDetail(entryImport.getDetail());
entry.setVoucher(entryImport.getVoucher());
@@ -1128,12 +1128,12 @@
log.debug("Can't parse date", eeePE);
}
}
- return result;
+ return result.toString();
}
public String importIdentity(String[] nextLine, TopiaContext topiaContext)
throws LimaException {
- String result = "";
+ StringBuffer result = new StringBuffer();
Identity identity = new IdentityImpl();
nextLine[0] = ImportExportEntityEnum.IDENTITY.getLabel();
@@ -1151,10 +1151,10 @@
identityService.updateIdentityWithTransaction(identity, topiaContext);
// create it
- result += "SUCCESS : The identity " + identity.getName()
- + " is created ! \n";
+ result.append("SUCCESS : The identity " + identity.getName()
+ + " is created ! \n");
- return result;
+ return result.toString();
}
protected TopiaContext beginTransaction() throws TopiaException {
Deleted: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/RecordServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/RecordServiceImpl.java 2010-08-20 12:11:16 UTC (rev 3009)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/RecordServiceImpl.java 2010-08-20 23:46:18 UTC (rev 3010)
@@ -1,371 +0,0 @@
-/* *##% Lima Business
- * Copyright (C) 2008 - 2010 CodeLutin
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * 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, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- * ##%*
- */
-
-package org.chorem.lima.business.ejb;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.ejb.Stateless;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.chorem.lima.business.LimaConfig;
-import org.chorem.lima.business.LimaException;
-import org.chorem.lima.business.ejbinterface.RecordService;
-import org.chorem.lima.business.ejbinterface.RecordServiceLocal;
-import org.chorem.lima.entity.LimaCallaoDAOHelper;
-import org.chorem.lima.entity.Record;
-import org.chorem.lima.entity.RecordDAO;
-import org.nuiton.topia.TopiaContext;
-import org.nuiton.topia.TopiaContextFactory;
-import org.nuiton.topia.TopiaException;
-import org.nuiton.topia.TopiaNotFoundException;
-
-/**
- * Permet d'ajouter des logs au systeme.
- *
- * ATTENTION on ne peut supprimer un log.
- *
- * @author Rémi Chapelet
- */
-@Stateless
-public class RecordServiceImpl implements RecordService, RecordServiceLocal {
-
- /** log */
- private static final Log log = LogFactory.getLog(RecordServiceImpl.class);
-
- private TopiaContext rootContext;
-
-
- public RecordServiceImpl() {
- LimaConfig config = LimaConfig.getInstance();
- try {
- rootContext = TopiaContextFactory.getContext(config.getOptions());
- } catch (TopiaNotFoundException ex) {
- if (log.isErrorEnabled()) {
- log.error("Can't init topia context", ex);
- }
- }
- }
-
- /**
- * Création d'un log dans le systeme.
- *
- * @param entryLog date de creation du log
- * @throws LimaException
- */
- public void addLog(Record entryLog) throws LimaException {
- /*String result = ServiceHelper.RESPOND_ERROR;
- try {
- // Acces BDD
- TopiaContext topiaContext = rootContext.beginTransaction();
- // Chargement du DAO
- EntryLogDAO logDAO = LimaCallaoDAOHelper.getEntryLogDAO(topiaContext);
- // Creation du log
- EntryLog newlog = logDAO.create();
- newlog.setLogDate(logDate);
- newlog.setTransDate(transDate);
- newlog.setVoucherRef(voucherRef);
- newlog.setType(type);
- newlog.setTransDesc(transDesc);
- newlog.setEntryDesc(entryDesc);
- newlog.setAmount(amount);
- newlog.setDebit(debit);
- newlog.setLettering(lettering);
- // Création BDD
- topiaContext.commitTransaction();
- // Fermeture BDD
- topiaContext.closeContext();
- // Affichage pour les logs
- String topiaId = newlog.getTopiaId();
- if (log.isInfoEnabled()) {
- log.info("Log created: "+ topiaId);
- }
- result = ServiceHelper.RESPOND_SUCCESS;
- }catch (TopiaException e) {
- log.error(e);
- }
- return result;*/
-
- TopiaContext transaction = null;
- try {
- // basic check done, make check in database
- // TODO move it into JTA
- transaction = rootContext.beginTransaction();
-
- // creation
- RecordDAO recordDAO = LimaCallaoDAOHelper
- .getRecordDAO(transaction);
- recordDAO.create(entryLog);
-
- // commit
- transaction.commitTransaction();
- } catch (TopiaException ex) {
- if (transaction != null) {
- try {
- transaction.rollbackTransaction();
- } catch (TopiaException e) {
- if (log.isErrorEnabled()) {
- log.error("Error during rollback context", ex);
- }
- }
- }
- if (log.isErrorEnabled()) {
- log.error("Error during create account", ex);
- }
- throw new LimaException("Can't create entry log", ex);
- } finally {
- if (transaction != null) {
- try {
- transaction.closeContext();
- } catch (TopiaException ex) {
- if (log.isErrorEnabled()) {
- log.error("Error during rollback context", ex);
- }
- throw new LimaException("Can't create entry log", ex);
- }
- }
- }
- }
-
- /*
- * Création d'un log à partir d'un log DTO.
- * @param logDTO log en format DTO qu'on souhaite créer
- * @return
- *
- public String addLog (LogDTO logDTO) {
- String result = ServiceHelper.RESPOND_ERROR;
- // Vérifie si logDTO existe
- if (logDTO != null)
- {
- result = addLog(logDTO.getLogDate(),logDTO.getTransDate(),logDTO.getType(),
- logDTO.getVoucherRef(),logDTO.getTransDesc(),logDTO.getEntryDesc(),
- logDTO.getAmount(),logDTO.isDebit(),logDTO.getLettering());
- }
- return result;
- }*/
-
- /**
- * Recherche tous les logs dans la base de donnees.
- *
- * @return la liste des logs
- * @throws LimaException
- */
- public List<Record> listeAllLog() throws LimaException {
- /*List<EntryLog> listelog = null;
- try {
- // Acces BDD
- TopiaContext topiaContext = rootContext.beginTransaction();
- // Chargement du DAO
- EntryLogDAO logDAO = LimaCallaoDAOHelper
- .getEntryLogDAO(topiaContext);
- // recherche des log
- listelog = logDAO.findAll();
- // Fermeture BDD
- topiaContext.closeContext();
- if (log.isInfoEnabled()) {
- log.info("Search all logs");
- }
- } catch (TopiaException e) {
- log.error(e);
- }
- return listelog;*/
-
- List<Record> entryLogsList = new ArrayList<Record>();
- TopiaContext transaction = null;
- try {
- // basic check done, make check in database
- // TODO move it into JTA
- transaction = rootContext.beginTransaction();
-
- // creation
- RecordDAO recordDAO = LimaCallaoDAOHelper
- .getRecordDAO(transaction);
- List<Record> entryLogs = recordDAO.findAll();
- entryLogsList.addAll(entryLogs);
-
- // commit
- transaction.commitTransaction();
- } catch (TopiaException ex) {
- if (transaction != null) {
- try {
- transaction.rollbackTransaction();
- } catch (TopiaException e) {
- if (log.isErrorEnabled()) {
- log.error("Error during rollback context", ex);
- }
- }
- }
- if (log.isErrorEnabled()) {
- log.error("Error during create account", ex);
- }
- throw new LimaException("Can't create entry log", ex);
- } finally {
- if (transaction != null) {
- try {
- transaction.closeContext();
- } catch (TopiaException ex) {
- if (log.isErrorEnabled()) {
- log.error("Error during rollback context", ex);
- }
- throw new LimaException("Can't create entry log", ex);
- }
- }
- }
-
- return entryLogsList;
- }
-
- /*
- * Permet de renvoyer tous les logs au format DTO.
- * @return
- *
- public List<LogDTO> listeAllLogDTO() {
- List<LogDTO> listLogDTO = new ArrayList<LogDTO>();
- // On recherche tous les logs.
- List<EntryLog> listLog = listeAllLog();
- // Pour chaque log, on le converti en logDTO et on l'ajoute à la nouvelle liste de DTO
- for (EntryLog log : listLog) {
- // conerti de l'entity en DTO
- LogDTO logDTO = convertLog.logEntityToDto(log);
- // Ajoute à la liste des logs DTO
- listLogDTO.add(logDTO);
- }
- return listLogDTO;
- }*/
-
- /*
- * Renvoie une liste de tous les logs suivant la date de creation
- * @param datecreate date de creation des logs recherchés
- * @return une liste des logs trouves
- *
- public List<EntryLog> searchLogWithDateCreate(Date dateCreate) {
- List<EntryLog> listelog = null;
- try {
- // Acces BDD
- TopiaContext topiaContext = rootContext.beginTransaction();
- // Chargement du DAO
- EntryLogDAO logDAO = LimaCallaoDAOHelper
- .getEntryLogDAO(topiaContext);
- // recherche des log
- listelog = logDAO.findAllByLogDate(dateCreate);
- // Fermeture BDD
- topiaContext.closeContext();
- if (log.isInfoEnabled()) {
- log.info("Log(s) find : " + listelog.size() + "log(s)");
- }
- } catch (TopiaException e) {
- log.error(e);
- }
- return listelog;
- }*/
-
- /*
- * Permet de rechercher tous les logs suivant la date de création, c'est à
- * dire de l'opération effectuée sur une entry à un jour précis, et qui a
- * déclenchée automatiquement une création de log.
- * La méthode renvoie sous forme de liste, en convertissant les objets
- * entitys en DTO.
- * @param dateCreate date de création des logs recherchés
- * @return
- *
- public List<LogDTO> searchLogDTOWithDateCreate(Date dateCreate) {
- List<LogDTO> listLogDTO = new ArrayList<LogDTO>();
- // On recherche tous les logs suivant la date de création.
- List<EntryLog> listLog = searchLogWithDateCreate(dateCreate);
- // Pour chaque log, on le converti en logDTO et on l'ajoute à la nouvelle liste de DTO
- for (EntryLog log : listLog) {
- // conerti de l'entity en DTO
- LogDTO logDTO = convertLog.logEntityToDto(log);
- // Ajoute à la liste des logs DTO
- listLogDTO.add(logDTO);
- }
- return listLogDTO;
- }*/
-
- /*
- * Recherche un log avec son identifiant topiaId.
- * @param topiaId identifiant d'un log
- * @return
- *
- public EntryLog searchLogWithTopiaId(String topiaId) {
- EntryLog logSearch = null;
- try {
- // Acces BDD
- TopiaContext topiaContext = rootContext.beginTransaction();
- // Chargement du DAO
- EntryLogDAO logDAO = LimaCallaoDAOHelper
- .getEntryLogDAO(topiaContext);
- // Creation du journal
- logSearch = logDAO.findByTopiaId(topiaId);
- // Fermeture BDD
- topiaContext.closeContext();
- } catch (TopiaException e) {
- log.error(e);
- }
- return logSearch;
- }*/
-
- /*
- * Efface un log : uniquement utilisé pour supprimer les logs dans les tests
- * unitaires.
- * @param topiaId identifiant du log à supprimer
- * @return
- *
- public String removeLog(String topiaId) {
- String result = ServiceHelper.RESPOND_ERROR;
- EntryLog logDelete = searchLogWithTopiaId(topiaId);
- // Si le log n'existe pas
- if (logDelete == null) {
- if (log.isWarnEnabled()) {
- log.warn("Le log " + topiaId + " n'existe pas !");
- }
- } else // Sinon on efface le log
- {
- try {
- // Acces BDD
- TopiaContext topiaContext = rootContext.beginTransaction();
- // Chargement du DAO
- EntryLogDAO logDAO = LimaCallaoDAOHelper
- .getEntryLogDAO(topiaContext);
- // Supprime le log
- logDAO.delete(logDelete);
- // Création BDD
- topiaContext.commitTransaction();
- // Fermeture BDD
- topiaContext.closeContext();
- result = ServiceHelper.RESPOND_SUCCESS;
- } catch (TopiaException e) {
- log.error(e);
- }
- }
- return result;
- }*/
-
- /*
- * Permet de supprimer un log à partir de son DTO.
- * @param logDTO log à supprimer
- * @return
- *
- public String removeLog(LogDTO logDTO) {
- String result = removeLog(logDTO.getId());
- return result;
- }*/
-}
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java 2010-08-20 12:11:16 UTC (rev 3009)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java 2010-08-20 23:46:18 UTC (rev 3010)
@@ -105,7 +105,7 @@
BigDecimal solde = new BigDecimal(0);
List<Entry> entries = new ArrayList<Entry>();
if (account != null){
-
+
//Get allsubaccounts and thirdParts accounts
List<Account> accounts = (List<Account>) account.getSubAccounts();
if (thirdPartAccountsMode){
@@ -183,7 +183,6 @@
* Get list entries
* Calculate all credit, debit and solde amounts for the accounts reports
*/
- @SuppressWarnings("unchecked")
protected ReportsDatas generateSubAccountReportsWithTransaction(Account account, Date beginDate, Date endDate, TopiaContext topiaContext) throws LimaException {
ReportsDatas reportsDatas = new ReportsDatasImpl();
BigDecimal credit = new BigDecimal(0);
@@ -254,7 +253,6 @@
*
* Get all entries if true
*/
- @SuppressWarnings("unchecked")
protected ReportsDatas generateSubAccountBalanceWithTransaction(Account account, Date beginDate, Date endDate, Boolean getEntries, TopiaContext topiaContext) throws LimaException {
ReportsDatas reportsDatas = new ReportsDatasImpl();
BigDecimal credit = new BigDecimal(0);
@@ -332,7 +330,6 @@
* Just balanced transaction are calculated
*
*/
- @SuppressWarnings({ "unchecked" })
@Override
public ReportsDatas generateEntryBooksReports(EntryBook entryBook, Date beginDate, Date endDate) throws LimaException {
ReportsDatas reportsDatas = new ReportsDatasImpl();
@@ -468,15 +465,15 @@
List<Account> accounts =null;
//Remove Spaces
- selectedAccounts = StringUtils.deleteWhitespace(selectedAccounts);
+ String result = StringUtils.deleteWhitespace(selectedAccounts);
//if no filter account
- if (selectedAccounts == null || selectedAccounts.equals("")){
+ if (result == null || result.equals("")){
accounts = accountDAO.findAll();
}
//build list account from selectedAccounts
else{
accounts = accountDAO.stringToListAccounts(
- selectedAccounts, false);
+ result, false);
}
for (Account account : accounts) {
ReportsDatas reportsDatas =
@@ -549,15 +546,4 @@
return topiaTransaction;
}
- protected void commitTransaction(TopiaContext topiaTransaction) throws TopiaException {
- try {
- topiaTransaction.commitTransaction();
- } catch (TopiaException eee) {
- if (log.isErrorEnabled()) {
- log.error("Error during commit context", eee);
- }
- throw eee;
- }
- }
-
}
Deleted: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/UserServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/UserServiceImpl.java 2010-08-20 12:11:16 UTC (rev 3009)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/UserServiceImpl.java 2010-08-20 23:46:18 UTC (rev 3010)
@@ -1,114 +0,0 @@
-/* *##% Lima Business
- * Copyright (C) 2008 - 2010 CodeLutin
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * 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, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- * ##%*
- */
-
-package org.chorem.lima.business.ejb;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.chorem.lima.business.LimaConfig;
-import org.nuiton.topia.TopiaContext;
-import org.nuiton.topia.TopiaContextFactory;
-import org.nuiton.topia.TopiaNotFoundException;
-
-/**
- * User service.
- *
- * @author chatellier
- * @version $Revision$
- *
- * Last update : $Date$
- * By : $Author$
- */
-public class UserServiceImpl {
-
- /** log */
- private static final Log log = LogFactory.getLog(UserServiceImpl.class);
-
- private TopiaContext rootContext;
-
- public UserServiceImpl() {
- LimaConfig config = LimaConfig.getInstance();
- try {
- rootContext = TopiaContextFactory.getContext(config.getOptions());
- } catch (TopiaNotFoundException ex) {
- if (log.isErrorEnabled()) {
- log.error("Can't init topia context", ex);
- }
- }
- }
-
- /**
- * Add new user.
- *
- * @param name new user name
- * @throws LimaException
- */
- /*
- public void addUser(User user/*String name) throws LimaException {
- // Attention doublon utilisateur
- try {
- // Acces BDD
- TopiaContext topiaContext = rootContext.beginTransaction();
- // Chargement du DAO
- UsersDAO userdao = LimaCallaoDAOHelper.getUsersDAO(topiaContext);
- // Création de l'user
- Users newuser = userdao.create();
- newuser.setMatcher(name);
- // Création BDD
- topiaContext.commitTransaction();
- topiaContext.closeContext();
- if (log.isInfoEnabled()) {
- log.info("Add user : " + name);
- }
- } catch (TopiaException ex) {
- if (log.isErrorEnabled()) {
- log.error("Can't create user", ex);
- throw new LimaException("Can't create user", ex);
- }
-
- }
- }*/
-
- /**
- * Find user with name.
- *
- * @param name
- * @throws LimaException
- */
- /*public void findUser(String name) throws LimaException {
- /*try {
- // Acces BDD
- TopiaContext topiaContext = rootContext.beginTransaction();
- // Chargement du DAO
- UsersDAO userdao = LimaCallaoDAOHelper.getUsersDAO(topiaContext);
- // Recherche du user
- Users newuser = userdao.findByMatcher(name);
- // Fermeture BDD
- topiaContext.closeContext();
- if (newuser == null) {
- throw new LimaBusinessException("can't find user " + name);
- }
- } catch (TopiaException ex) {
- if (log.isErrorEnabled()) {
- log.error("Can't find user", ex);
- throw new LimaException("Can't find user", ex);
- }
- }
- }*/
-}
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/AccountService.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/AccountService.java 2010-08-20 12:11:16 UTC (rev 3009)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/AccountService.java 2010-08-20 23:46:18 UTC (rev 3010)
@@ -21,7 +21,6 @@
import java.util.List;
import javax.ejb.Remote;
-import org.chorem.lima.business.LimaBusinessException;
import org.chorem.lima.business.LimaException;
import org.chorem.lima.entity.Account;
@@ -51,13 +50,13 @@
* @throws LimaException
*/
//EJB Remote
- void createAccount(Account masterAccount, Account account) throws LimaException, LimaBusinessException;
+ void createAccount(Account masterAccount, Account account) throws LimaException;
- void createSubLedger(Account masterAccount, Account account) throws LimaException, LimaBusinessException;
+ void createSubLedger(Account masterAccount, Account account) throws LimaException;
- void updateAccount(Account account) throws LimaException, LimaBusinessException;
+ void updateAccount(Account account) throws LimaException;
- void removeAccount(Account account) throws LimaException, LimaBusinessException;
+ void removeAccount(Account account) throws LimaException;
void removeAllAccount() throws LimaException;
List<Account> getAllChildrenAccounts(Account masterAccount, List<Account> accounts) throws LimaException;
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/AccountServiceLocal.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/AccountServiceLocal.java 2010-08-20 12:11:16 UTC (rev 3009)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/AccountServiceLocal.java 2010-08-20 23:46:18 UTC (rev 3010)
@@ -19,10 +19,7 @@
package org.chorem.lima.business.ejbinterface;
-import java.util.List;
import javax.ejb.Local;
-
-import org.chorem.lima.business.LimaBusinessException;
import org.chorem.lima.business.LimaException;
import org.chorem.lima.entity.Account;
import org.nuiton.topia.TopiaContext;
@@ -40,7 +37,7 @@
@Local
public interface AccountServiceLocal extends AccountService{
- void createAccountWithTransaction(Account masterAccount, Account account, TopiaContext topiaContext) throws LimaException, LimaBusinessException;
+ void createAccountWithTransaction(Account masterAccount, Account account, TopiaContext topiaContext) throws LimaException;
void createSubLedgerWithTransaction(Account masterAccount, Account account, TopiaContext topiaContext) throws LimaException;
}
\ No newline at end of file
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/DocumentService.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/DocumentService.java 2010-08-20 12:11:16 UTC (rev 3009)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/DocumentService.java 2010-08-20 23:46:18 UTC (rev 3010)
@@ -33,10 +33,10 @@
@Remote
public interface DocumentService {
- public void createFinancialStatementsDocuments(Date beginDate, Date endDate, FormatsEnum format) throws LimaException;
- public void createLedgerDocuments(Date beginDate, Date endDate, FormatsEnum format) throws LimaException;
- public void createEntryBooksDocuments(Date beginDate, Date endDate, FormatsEnum format) throws LimaException;
- public void createBalanceDocuments(Date beginDate, Date endDate, FormatsEnum format) throws LimaException;
- public void createGeneralEntryBooksDocuments(Date beginDate, Date endDate, FormatsEnum format) throws LimaException;
+ void createFinancialStatementsDocuments(Date beginDate, Date endDate, FormatsEnum format) throws LimaException;
+ void createLedgerDocuments(Date beginDate, Date endDate, FormatsEnum format) throws LimaException;
+ void createEntryBooksDocuments(Date beginDate, Date endDate, FormatsEnum format) throws LimaException;
+ void createBalanceDocuments(Date beginDate, Date endDate, FormatsEnum format) throws LimaException;
+ void createGeneralEntryBooksDocuments(Date beginDate, Date endDate, FormatsEnum format) throws LimaException;
}
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/DocumentServiceLocal.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/DocumentServiceLocal.java 2010-08-20 12:11:16 UTC (rev 3009)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/DocumentServiceLocal.java 2010-08-20 23:46:18 UTC (rev 3010)
@@ -30,5 +30,4 @@
@Local
public interface DocumentServiceLocal {
-
}
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/EntryBookServiceLocal.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/EntryBookServiceLocal.java 2010-08-20 12:11:16 UTC (rev 3009)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/EntryBookServiceLocal.java 2010-08-20 23:46:18 UTC (rev 3010)
@@ -39,6 +39,6 @@
@Local
public interface EntryBookServiceLocal extends EntryBookService {
- public void createEntryBookWithTransaction(EntryBook entryBook, TopiaContext topiaContext) throws LimaException;
+ void createEntryBookWithTransaction(EntryBook entryBook, TopiaContext topiaContext) throws LimaException;
}
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ExportService.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ExportService.java 2010-08-20 12:11:16 UTC (rev 3009)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ExportService.java 2010-08-20 23:46:18 UTC (rev 3010)
@@ -43,32 +43,32 @@
* @return export as byte array
* @throws LimaException
*/
- public String exportAsCSV() throws LimaException;
+ String exportAsCSV() throws LimaException;
/**
* export entrybook chart as CSV.
*/
- public String exportEntryBookChartAsCSV() throws LimaException;
+ String exportEntryBookChartAsCSV() throws LimaException;
/**
* export financialstatement chart as CSV.
*/
- public String exportFinancialStatementChartAsCSV() throws LimaException;
+ String exportFinancialStatementChartAsCSV() throws LimaException;
/**
* export accounts chart as CSV.
*/
- public String exportAccountsChartAsCSV() throws LimaException;
+ String exportAccountsChartAsCSV() throws LimaException;
/**
* export entries as EBP
*/
- public String exportEntriesAsEBP() throws LimaException;
+ String exportEntriesAsEBP() throws LimaException;
/**
* export accounts as EBP
*/
- public String exportAccountsAsEBP() throws LimaException;
+ String exportAccountsAsEBP() throws LimaException;
}
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialStatementService.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialStatementService.java 2010-08-20 12:11:16 UTC (rev 3009)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialStatementService.java 2010-08-20 23:46:18 UTC (rev 3010)
@@ -23,7 +23,6 @@
import java.util.List;
import javax.ejb.Remote;
import org.chorem.lima.beans.FinancialStatementAmounts;
-import org.chorem.lima.business.LimaBusinessException;
import org.chorem.lima.business.LimaException;
import org.chorem.lima.entity.FinancialStatement;
@@ -31,17 +30,17 @@
public interface FinancialStatementService {
- public void createFinancialStatement(FinancialStatement masterFinancialStatement, FinancialStatement financialStatement) throws LimaException, LimaBusinessException;
- public void updateFinancialStatement(FinancialStatement financialStatement) throws LimaException, LimaBusinessException;
- public void removeFinancialStatement(FinancialStatement financialStatement) throws LimaException, LimaBusinessException;
- public void removeAllFinancialStatement() throws LimaException, LimaBusinessException;
+ void createFinancialStatement(FinancialStatement masterFinancialStatement, FinancialStatement financialStatement) throws LimaException;
+ void updateFinancialStatement(FinancialStatement financialStatement) throws LimaException;
+ void removeFinancialStatement(FinancialStatement financialStatement) throws LimaException;
+ void removeAllFinancialStatement() throws LimaException;
- public List<FinancialStatement> getAllFinancialStatements() throws LimaException;
- public List<FinancialStatement> getChildrenFinancialStatement(FinancialStatement financialStatement) throws LimaException;
- public List<FinancialStatement> getAllChildrenFinancialStatement(FinancialStatement financialStatement, List<FinancialStatement> financialStatements) throws LimaException, LimaBusinessException;
+ List<FinancialStatement> getAllFinancialStatements() throws LimaException;
+ List<FinancialStatement> getChildrenFinancialStatement(FinancialStatement financialStatement) throws LimaException;
+ List<FinancialStatement> getAllChildrenFinancialStatement(FinancialStatement financialStatement, List<FinancialStatement> financialStatements) throws LimaException;
- public List<FinancialStatementAmounts> financialStatementReport(Date selectedBeginDate, Date selectedEndDate) throws LimaException;
+ List<FinancialStatementAmounts> financialStatementReport(Date selectedBeginDate, Date selectedEndDate) throws LimaException;
- public String checkFinancialStatementChart() throws LimaException;
+ String checkFinancialStatementChart() throws LimaException;
}
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialStatementServiceLocal.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialStatementServiceLocal.java 2010-08-20 12:11:16 UTC (rev 3009)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialStatementServiceLocal.java 2010-08-20 23:46:18 UTC (rev 3010)
@@ -20,8 +20,6 @@
package org.chorem.lima.business.ejbinterface;
import javax.ejb.Local;
-
-import org.chorem.lima.business.LimaBusinessException;
import org.chorem.lima.business.LimaException;
import org.chorem.lima.entity.FinancialStatement;
import org.nuiton.topia.TopiaContext;
@@ -29,8 +27,8 @@
@Local
public interface FinancialStatementServiceLocal extends FinancialStatementService {
- public void createFinancialStatementWithTransaction(FinancialStatement masterFinancialStatement,
- FinancialStatement financialStatement, TopiaContext topiaContext) throws LimaException, LimaBusinessException;
+ void createFinancialStatementWithTransaction(FinancialStatement masterFinancialStatement,
+ FinancialStatement financialStatement, TopiaContext topiaContext) throws LimaException;
}
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialTransactionService.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialTransactionService.java 2010-08-20 12:11:16 UTC (rev 3009)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialTransactionService.java 2010-08-20 23:46:18 UTC (rev 3010)
@@ -22,11 +22,8 @@
import java.util.Date;
import java.util.List;
import java.util.Set;
-
import javax.ejb.Remote;
-
import org.chorem.lima.FinancialStatementWayEnum;
-import org.chorem.lima.business.LimaBusinessException;
import org.chorem.lima.business.LimaException;
import org.chorem.lima.entity.Account;
import org.chorem.lima.entity.Entry;
@@ -69,7 +66,7 @@
void createFinancialTransaction(FinancialTransaction financialtransaction) throws LimaException;
- void updateFinancialTransaction(FinancialTransaction financialtransaction) throws LimaException, LimaBusinessException;
+ void updateFinancialTransaction(FinancialTransaction financialtransaction) throws LimaException;
void removeFinancialTransaction(FinancialTransaction financialtransaction) throws LimaException;
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialTransactionServiceLocal.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialTransactionServiceLocal.java 2010-08-20 12:11:16 UTC (rev 3009)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialTransactionServiceLocal.java 2010-08-20 23:46:18 UTC (rev 3010)
@@ -21,8 +21,6 @@
import java.util.List;
import javax.ejb.Local;
-
-import org.chorem.lima.business.LimaBusinessException;
import org.chorem.lima.business.LimaException;
import org.chorem.lima.entity.Entry;
import org.chorem.lima.entity.FinancialTransaction;
@@ -41,11 +39,11 @@
@Local
public interface FinancialTransactionServiceLocal extends FinancialTransactionService {
- public List<FinancialTransaction> getAllFinancialTransactionsBalanced(TopiaContext topiaContext) throws LimaException;
+ List<FinancialTransaction> getAllFinancialTransactionsBalanced(TopiaContext topiaContext) throws LimaException;
void createFinancialTransactionWithTransaction(FinancialTransaction financialtransaction, TopiaContext topiaContext) throws LimaException;
- void updateFinancialTransactionWithTransaction(FinancialTransaction financialtransaction, TopiaContext topiaContext) throws LimaException, LimaBusinessException;
+ void updateFinancialTransactionWithTransaction(FinancialTransaction financialtransaction, TopiaContext topiaContext) throws LimaException;
void createEntryWithTransaction(Entry entry, TopiaContext topiaContext) throws LimaException;
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/HttpServerService.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/HttpServerService.java 2010-08-20 12:11:16 UTC (rev 3009)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/HttpServerService.java 2010-08-20 23:46:18 UTC (rev 3010)
@@ -25,7 +25,7 @@
@Remote
public interface HttpServerService {
- public void start();
- public int getHttpPort();
+ void start();
+ int getHttpPort();
}
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/IdentityService.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/IdentityService.java 2010-08-20 12:11:16 UTC (rev 3009)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/IdentityService.java 2010-08-20 23:46:18 UTC (rev 3010)
@@ -27,7 +27,7 @@
@Remote
public interface IdentityService {
- public Identity getIdentity() throws LimaException;
- public void updateIdentity(Identity identity) throws LimaException;
+ Identity getIdentity() throws LimaException;
+ void updateIdentity(Identity identity) throws LimaException;
}
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/IdentityServiceLocal.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/IdentityServiceLocal.java 2010-08-20 12:11:16 UTC (rev 3009)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/IdentityServiceLocal.java 2010-08-20 23:46:18 UTC (rev 3010)
@@ -28,7 +28,7 @@
@Local
public interface IdentityServiceLocal {
- public void updateIdentityWithTransaction(Identity identity, TopiaContext topiaContext) throws LimaException;
- public Identity getIdentityWithTransaction(TopiaContext topiaContext) throws LimaException;
+ void updateIdentityWithTransaction(Identity identity, TopiaContext topiaContext) throws LimaException;
+ Identity getIdentityWithTransaction(TopiaContext topiaContext) throws LimaException;
}
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ImportService.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ImportService.java 2010-08-20 12:11:16 UTC (rev 3009)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ImportService.java 2010-08-20 23:46:18 UTC (rev 3010)
@@ -43,8 +43,8 @@
* @param data
* @throws LimaException
*/
- public String importEntriesFromEbp(String datas) throws LimaException;
- public String importAccountsChartFromEbp(String datas) throws LimaException;
+ String importEntriesFromEbp(String datas) throws LimaException;
+ String importAccountsChartFromEbp(String datas) throws LimaException;
/**
@@ -53,7 +53,7 @@
* @param data
* @throws LimaException
*/
- public void importAsSage(byte[] data) throws LimaException;
+ void importAsSage(byte[] data) throws LimaException;
/**
* Import data as Ciel Compta export.
@@ -61,13 +61,13 @@
* @param data
* @throws LimaException
*/
- public void importAsCiel(byte[] data) throws LimaException;
+ void importAsCiel(byte[] data) throws LimaException;
/**
* import CSV.
* Return result log
*/
- public String importAllAsCSV(String path) throws LimaException;
+ String importAllAsCSV(String path) throws LimaException;
- public String importAsCSV(String path, ImportExportEntityEnum importExportEntityEnum) throws LimaException;
+ String importAsCSV(String path, ImportExportEntityEnum importExportEntityEnum) throws LimaException;
}
Deleted: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/RecordService.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/RecordService.java 2010-08-20 12:11:16 UTC (rev 3009)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/RecordService.java 2010-08-20 23:46:18 UTC (rev 3010)
@@ -1,44 +0,0 @@
-/* *##% Lima Business
- * Copyright (C) 2008 - 2010 CodeLutin
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * 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, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- * ##%*
- */
-
-package org.chorem.lima.business.ejbinterface;
-
-import javax.ejb.Remote;
-
-/**
- * Fiscal period service.
- *
- * @author chatellier
- * @version $Revision$
- *
- * Last update : $Date$
- * By : $Author$
- */
-
-@Remote
-public interface RecordService {
-
- //List<FiscalPeriod> getAllFiscalPeriods() throws LimaException;
-
- //void createFiscalPeriod(FiscalPeriod fiscalPeriod) throws LimaException;
-
- //void updateFiscalPeriod(FiscalPeriod fiscalPeriod) throws LimaException;
-
- //void removeFiscalPeriod(FiscalPeriod fiscalPeriod) throws LimaException;
-}
Deleted: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/RecordServiceLocal.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/RecordServiceLocal.java 2010-08-20 12:11:16 UTC (rev 3009)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/RecordServiceLocal.java 2010-08-20 23:46:18 UTC (rev 3010)
@@ -1,37 +0,0 @@
-/* *##% Lima Business
- * Copyright (C) 2008 - 2010 CodeLutin
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * 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, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- * ##%*
- */
-
-package org.chorem.lima.business.ejbinterface;
-
-import javax.ejb.Local;
-
-/**
- * Fiscal period service.
- *
- * @author chatellier
- * @version $Revision: 2902 $
- *
- * Last update : $Date: 2010-05-19 18:38:02 +0200 (mer. 19 mai 2010) $
- * By : $Author: jpepin $
- */
-
-@Local
-public interface RecordServiceLocal extends RecordService {
-
-}
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ReportServiceLocal.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ReportServiceLocal.java 2010-08-20 12:11:16 UTC (rev 3009)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ReportServiceLocal.java 2010-08-20 23:46:18 UTC (rev 3010)
@@ -46,6 +46,6 @@
@Local
public interface ReportServiceLocal extends ReportService {
- public ReportsDatas generateAccountReportsWithTransaction (Account account, Boolean thirdPartAccountsMode, Date beginDate, Date endDate, TopiaContext topiaContext) throws LimaException;
+ ReportsDatas generateAccountReportsWithTransaction (Account account, Boolean thirdPartAccountsMode, Date beginDate, Date endDate, TopiaContext topiaContext) throws LimaException;
}
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/utils/AccountComparator.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/utils/AccountComparator.java 2010-08-20 12:11:16 UTC (rev 3009)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/utils/AccountComparator.java 2010-08-20 23:46:18 UTC (rev 3010)
@@ -19,12 +19,15 @@
package org.chorem.lima.business.utils;
+import java.io.Serializable;
import java.util.Comparator;
import org.chorem.lima.entity.Account;
-public class AccountComparator implements Comparator<Account>{
+public class AccountComparator implements Serializable, Comparator<Account>{
- /**
+ private static final long serialVersionUID = 1L;
+
+ /**
* sort by accout number in lexicographical order
*/
@Override
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/utils/AccountEBPComparator.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/utils/AccountEBPComparator.java 2010-08-20 12:11:16 UTC (rev 3009)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/utils/AccountEBPComparator.java 2010-08-20 23:46:18 UTC (rev 3010)
@@ -1,11 +1,14 @@
package org.chorem.lima.business.utils;
+import java.io.Serializable;
import java.util.Comparator;
import org.chorem.lima.beans.AccountEBP;
-public class AccountEBPComparator implements Comparator<AccountEBP> {
+public class AccountEBPComparator implements Serializable, Comparator<AccountEBP> {
+ private static final long serialVersionUID = 1L;
+
@Override
public int compare(AccountEBP o1, AccountEBP o2) {
return o1.getNumero().compareTo(o2.getNumero());
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/utils/EntryComparator.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/utils/EntryComparator.java 2010-08-20 12:11:16 UTC (rev 3009)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/utils/EntryComparator.java 2010-08-20 23:46:18 UTC (rev 3010)
@@ -19,11 +19,14 @@
package org.chorem.lima.business.utils;
+import java.io.Serializable;
import java.util.Comparator;
import org.chorem.lima.entity.Entry;
-public class EntryComparator implements Comparator<Entry>{
+public class EntryComparator implements Serializable, Comparator<Entry>{
+ private static final long serialVersionUID = 1L;
+
@Override
public int compare(Entry o1, Entry o2) {
return o1.getTopiaCreateDate().compareTo(o2.getTopiaCreateDate());
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/utils/EntryEBPComparator.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/utils/EntryEBPComparator.java 2010-08-20 12:11:16 UTC (rev 3009)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/utils/EntryEBPComparator.java 2010-08-20 23:46:18 UTC (rev 3010)
@@ -19,11 +19,14 @@
package org.chorem.lima.business.utils;
+import java.io.Serializable;
import java.util.Comparator;
import org.chorem.lima.beans.EntryEBP;
-public class EntryEBPComparator implements Comparator<EntryEBP>{
+public class EntryEBPComparator implements Serializable, Comparator<EntryEBP>{
+ private static final long serialVersionUID = 1L;
+
@Override
public int compare(EntryEBP o1, EntryEBP o2) {
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/utils/FiscalPeriodComparator.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/utils/FiscalPeriodComparator.java 2010-08-20 12:11:16 UTC (rev 3009)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/utils/FiscalPeriodComparator.java 2010-08-20 23:46:18 UTC (rev 3010)
@@ -19,11 +19,14 @@
package org.chorem.lima.business.utils;
+import java.io.Serializable;
import java.util.Comparator;
import org.chorem.lima.entity.FiscalPeriod;
-public class FiscalPeriodComparator implements Comparator<FiscalPeriod>{
+public class FiscalPeriodComparator implements Serializable, Comparator<FiscalPeriod>{
+ private static final long serialVersionUID = 1L;
+
/**
* sort by fiscal begin date
*/
Modified: trunk/lima-business/src/test/java/org/chorem/lima/business/LimaConfigTest.java
===================================================================
--- trunk/lima-business/src/test/java/org/chorem/lima/business/LimaConfigTest.java 2010-08-20 12:11:16 UTC (rev 3009)
+++ trunk/lima-business/src/test/java/org/chorem/lima/business/LimaConfigTest.java 2010-08-20 23:46:18 UTC (rev 3010)
@@ -20,9 +20,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.chorem.lima.entity.LimaCallaoDAOHelper;
import org.junit.Ignore;
-import org.nuiton.util.ArgumentsParserException;
/**
* TODO add comment here.
@@ -40,12 +38,13 @@
private static final String configFile = "lima_test.properties";
+ /*
public static LimaConfig getInstance() {
-
+
if (instance == null) {
instance = new LimaConfig();
instance.loadConfiguration(configFile);
}
return instance;
- }
+ }*/
}
Deleted: trunk/lima-business/src/test/java/org/chorem/lima/business/RecordServiceImplTest.java
===================================================================
--- trunk/lima-business/src/test/java/org/chorem/lima/business/RecordServiceImplTest.java 2010-08-20 12:11:16 UTC (rev 3009)
+++ trunk/lima-business/src/test/java/org/chorem/lima/business/RecordServiceImplTest.java 2010-08-20 23:46:18 UTC (rev 3010)
@@ -1,109 +0,0 @@
-package org.chorem.lima.business;
-
-import java.util.Date;
-import java.util.List;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.chorem.lima.business.ejb.RecordServiceImpl;
-import org.chorem.lima.entity.Record;
-import org.junit.AfterClass;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- * Tests pour la gestion des timespans
- * @author Rémi Chapelet
- */
-public class RecordServiceImplTest {
-
- /** log. */
- private static final org.apache.commons.logging.Log log = LogFactory
- .getLog(UserServiceImplTest.class);
-
- private static RecordServiceImpl instance;
-
- @BeforeClass
- public static void setUpClass() throws Exception {
- LimaConfigTest.getInstance();
- }
-
- @Before
- public void setUp() {
- instance = new RecordServiceImpl();
- }
-
- @AfterClass
- public static void tearDownClass() throws Exception {
- /*List<LogDTO> list = instance.listeAllLogDTO();
- for (LogDTO logDTO : list)
- {
- instance.removeLog(logDTO);
- }*/
- }
-
- /**
- * Permet de tester la recherche de tous les logs
- */
- @Test
- public void listeAllLogTest() {
- /*// Ajout d'un log
- Date logDate = new Date(2008,1,1);
- Date transDate = new Date();
- instance.addLog(logDate, transDate, "test", "test", "test",
- "test", "test", true, "test");
- // Recherche des logs
- List<EntryLog> result = instance.listeAllLog();
- if (log.isDebugEnabled()) {
- log.debug("Nombre de log : " + result.size());
- }
- // trouve un log
- Assert.assertEquals(1,result.size());*/
- }
-
- /**
- * Test de la fonction de recherche de tous les logs suivant la date
- * de création
- */
- @Test
- public void searchDateCreateTest() {
- /*// Ajout d'un log avec comme date de creation 01/01/2009
- Date logDate = new Date(2009,1,1);
- Date transDate = new Date();
- instance.addLog(logDate, transDate, "test", "test", "test",
- "test", "test", true, "test");
- // Recherche des logs suivant la date
- List<EntryLog> result = instance.searchLogWithDateCreate(logDate);
- if (log.isDebugEnabled()) {
- log.debug("Nombre de log recherche pour la date de creation : "
- + result.size());
- }
- // Apres avoir inséré un log a la date, il doit obligatoirement
- // avoir au moins un log.
- Assert.assertEquals(1,result.size());*/
- }
-
- /**
- * Permet de tester la recherche de logs en format DTO.
- */
- @Test
- public void searchLogDTOWithDateCreate() {
-
- // Création de trois logs DTO
- /*Date logDate = new Date(2000,1,1);
- Date transDate = new Date();
- // Création logDTO
- LogDTO logDTO = new LogDTO("",logDate, "test", transDate, "test", "test",
- "test", "test", true, "test");
- // Ajout de trois logs
- instance.addLog(logDTO);
- instance.addLog(logDTO);
- instance.addLog(logDTO);
- // Recherche de ses trois logs sous forme de list de DTO
- List<LogDTO> listLogDTO = instance.searchLogDTOWithDateCreate(logDate);
- Assert.assertEquals(3,listLogDTO.size());*/
- }
-
-}
Deleted: trunk/lima-business/src/test/java/org/chorem/lima/business/UserServiceImplTest.java
===================================================================
--- trunk/lima-business/src/test/java/org/chorem/lima/business/UserServiceImplTest.java 2010-08-20 12:11:16 UTC (rev 3009)
+++ trunk/lima-business/src/test/java/org/chorem/lima/business/UserServiceImplTest.java 2010-08-20 23:46:18 UTC (rev 3010)
@@ -1,52 +0,0 @@
-package org.chorem.lima.business;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.chorem.lima.business.ejb.UserServiceImpl;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- * Tests pour la gestion des timespans
- * @author Rémi Chapelet
- */
-public class UserServiceImplTest {
-
- /** log. */
- private static final Log log = LogFactory.getLog(UserServiceImplTest.class);
-
- private UserServiceImpl instance;
-
- @BeforeClass
- public static void setUpClass() throws Exception {
- LimaConfigTest.getInstance();
- }
-
- @Before
- public void setUp() {
- instance = new UserServiceImpl();
- }
-
- @AfterClass
- public static void tearDownClass() throws Exception {
-
- }
-
- public UserServiceImplTest() {
- }
-
- /**
- * Permet de tester l'ajout d'un utilisateur dans la base de données
- */
- @Test
- public void addUserTest() {
- /*String result = instance.addUser("test-add-user");
- if (log.isDebugEnabled()) {
- log.debug("Ajout utilisateur (name is test-add-user) : result " + result);
- }
- Assert.assertEquals("success", instance.findUser("test-add-user"));*/
- }
-
-}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/service/LimaServiceFactory.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/service/LimaServiceFactory.java 2010-08-20 12:11:16 UTC (rev 3009)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/service/LimaServiceFactory.java 2010-08-20 23:46:18 UTC (rev 3010)
@@ -32,8 +32,6 @@
import org.apache.openejb.assembler.classic.Assembler;
import org.apache.openejb.loader.SystemInstance;
import org.chorem.lima.LimaMain;
-import org.chorem.lima.business.ServiceMonitorable;
-import org.chorem.lima.business.ejb.AbstractLimaService;
/**
* This class is a service factory based on embedded openejb container.
@@ -44,7 +42,7 @@
private static Log log = LogFactory.getLog(LimaServiceFactory.class);
/** Single instance. */
- protected static LimaServiceFactory instance;
+ private static LimaServiceFactory instance;
protected HashMap<Class, Object> services = new HashMap<Class, Object>();
/** JNDI context used to look for EJB. */
@@ -108,215 +106,9 @@
}
return result;
}
-
-
- /**
- * Get Account service.
- *
- * @return account service proxy
- */
- /*public AccountServiceMonitorable getAccountService() {
- // TODO EC-20100410 put lookup name in configuration
- // name should be fully configurable due to custom implementation used
- String lookupName = "AccountServiceImplRemote";
- AccountService ejbHome = null;
- try {
- ejbHome = (AccountService)ctx.lookup(lookupName);
- } catch (NamingException eee) {
- if (log.isErrorEnabled()) {
- log.error("Can't lookup for service : " + lookupName, eee);
- }
- }
- InvocationHandler handler = new ServiceMonitorableHandler(ejbHome);
- AccountServiceMonitorable result = (AccountServiceMonitorable)Proxy.newProxyInstance(
- AccountServiceMonitorable.class.getClassLoader(),
- new Class[]{AccountServiceMonitorable.class}, handler);
- return result;
- }
-
- /**
- * Get FiscalPeriod service.
- *
- * @return fiscalPeriod service proxy
- *
- public FiscalPeriodService getFiscalPeriodService() {
- // TODO EC-20100410 put lookup name in configuration
- // name should be fully configurable due to custom implementation used
- String lookupName = "FiscalPeriodServiceImplRemote";
- FiscalPeriodService ejbHome = null;
- try {
- ejbHome = (FiscalPeriodService)ctx.lookup(lookupName);
- } catch (NamingException eee) {
- if (log.isErrorEnabled()) {
- log.error("Can't lookup for service : " + lookupName, eee);
- }
- }
- return ejbHome;
- }
-
/**
- * Get FinancialPeriod service.
- *
- * @return Financial Period service proxy
- *
- public FinancialPeriodService getFinancialPeriodService() {
-
- // TODO EC-20100410 put lookup name in configuration
- // name should be fully configurable due to custom implementation used
- String lookupName = "FinancialPeriodServiceImplRemote";
- FinancialPeriodService ejbHome = null;
- try {
- ejbHome = (FinancialPeriodService)ctx.lookup(lookupName);
- } catch (NamingException eee) {
- if (log.isErrorEnabled()) {
- log.error("Can't lookup for service : " + lookupName, eee);
- }
- }
- return ejbHome;
- }
-
- /**
- * Get transaction service.
- *
- * @return transaction service proxy
- *
- public FinancialTransactionService getTransactionService() {
-
- // TODO EC-20100410 put lookup name in configuration
- // name should be fully configurable due to custom implementation used
- String lookupName = "FinancialTransactionServiceImplRemote";
- FinancialTransactionService ejbHome = null;
- try {
- ejbHome = (FinancialTransactionService)ctx.lookup(lookupName);
- } catch (NamingException eee) {
- if (log.isErrorEnabled()) {
- log.error("Can't lookup for service : " + lookupName, eee);
- }
- }
- return ejbHome;
- }
-
- /**
- * Get entrybook service.
- *
- * @return entrybook service proxy
- *
- public EntryBookService getEntryBookService() {
-
- // TODO EC-20100410 put lookup name in configuration
- // name should be fully configurable due to custom implementation used
- String lookupName = "EntryBookServiceImplRemote";
- EntryBookService ejbHome = null;
- try {
- ejbHome = (EntryBookService)ctx.lookup(lookupName);
- } catch (NamingException eee) {
- if (log.isErrorEnabled()) {
- log.error("Can't lookup for service : " + lookupName, eee);
- }
- }
- return ejbHome;
- }
-
-
- /**
- * Get report service.
- *
- *
- public ReportService getReportService() {
-
- // TODO EC-20100410 put lookup name in configuration
- // name should be fully configurable due to custom implementation used
- String lookupName = "ReportServiceImplRemote";
- ReportService ejbHome = null;
- try {
- ejbHome = (ReportService)ctx.lookup(lookupName);
- } catch (NamingException eee) {
- if (log.isErrorEnabled()) {
- log.error("Can't lookup for service : " + lookupName, eee);
- }
- }
- return ejbHome;
- }
-
- /**
- * Get financial statement service.
- *
- *
- public FinancialStatementService getFinancialStatementService() {
-
- String lookupName = "FinancialStatementServiceImplRemote";
- FinancialStatementService ejbHome = null;
- try {
- ejbHome = (FinancialStatementService)ctx.lookup(lookupName);
- } catch (NamingException eee) {
- if (log.isErrorEnabled()) {
- log.error("Can't lookup for service : " + lookupName, eee);
- }
- }
- return ejbHome;
- }
-
- /**
- * Get import service.
- *
- *
- public ImportService getImportService() {
-
- String lookupName = "ImportServiceImplRemote";
- ImportService ejbHome = null;
- try {
- ejbHome = (ImportService)ctx.lookup(lookupName);
- } catch (NamingException eee) {
- if (log.isErrorEnabled()) {
- log.error("Can't lookup for service : " + lookupName, eee);
- }
- }
- return ejbHome;
- }
-
-
- /**
- * Get export service.
- *
- *
- public ExportService getExportService() {
-
- String lookupName = "ExportServiceImplRemote";
- ExportService ejbHome = null;
- try {
- ejbHome = (ExportService)ctx.lookup(lookupName);
- } catch (NamingException eee) {
- if (log.isErrorEnabled()) {
- log.error("Can't lookup for service : " + lookupName, eee);
- }
- }
- return ejbHome;
- }
-
- /**
- * Get record service.
- *
- * @return record service proxy
- *
- public RecordService getRecordService() {
-
- // TODO EC-20100410 put lookup name in configuration
- // name should be fully configurable due to custom implementation used
- String lookupName = "RecordServiceImplRemote";
- RecordService ejbHome = null;
- try {
- ejbHome = (RecordService)ctx.lookup(lookupName);
- } catch (NamingException eee) {
- if (log.isErrorEnabled()) {
- log.error("Can't lookup for service : " + lookupName, eee);
- }
- }
- return ejbHome;
- }*/
-
- /**
* Destroy openejb jndi context.
*
* Code taken from openEJB faq :
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartViewHandler.java 2010-08-20 12:11:16 UTC (rev 3009)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartViewHandler.java 2010-08-20 23:46:18 UTC (rev 3010)
@@ -88,8 +88,8 @@
// null == cancel action
newFinancialStatementHeader = financialStatementHeaderForm.getFinancialStatement();
- newFinancialStatementHeader.setHeader(true);
if (newFinancialStatementHeader != null) {
+ newFinancialStatementHeader.setHeader(true);
// get current selection path
TreePath treePath = null;
int selectedRow = treeTable.getSelectedRow();
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/util/ErrorHelper.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/util/ErrorHelper.java 2010-08-20 12:11:16 UTC (rev 3009)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/util/ErrorHelper.java 2010-08-20 23:46:18 UTC (rev 3010)
@@ -114,19 +114,20 @@
email.setSubject("Project error notification : Lima");
// message description
- String message = formatMessage("Project", "Lima " + LimaMain.config.getVersion());
- message += formatMessage("Date", new Date().toString());
- message += formatMessage("Title", errorInfo.getTitle());
- message += formatMessage("Description", errorInfo.getBasicErrorMessage().replaceAll("<[^>]+>", ""));
+ StringBuffer message = new StringBuffer();
+ message.append(formatMessage("Project", "Lima " + LimaMain.config.getVersion()));
+ message.append(formatMessage("Date", new Date().toString()));
+ message.append(formatMessage("Title", errorInfo.getTitle()));
+ message.append(formatMessage("Description", errorInfo.getBasicErrorMessage().replaceAll("<[^>]+>", "")));
// message configuration
- message += formatMessage("Configuration", null);
+ message.append(formatMessage("Configuration", null));
List<String> propertiesNames = new ArrayList<String>(LimaMain.config.getOptions().stringPropertyNames());
Collections.sort(propertiesNames);
for (String propertyName : propertiesNames) {
// security, don't send string containing password :
if (!propertyName.contains("pass")) {
- message += "\t" + propertyName + " : " + LimaMain.config.getOptions().getProperty(propertyName) + "\n";
+ message.append("\t" + propertyName + " : " + LimaMain.config.getOptions().getProperty(propertyName) + "\n");
}
}
@@ -134,10 +135,10 @@
StringWriter out = new StringWriter();
PrintWriter writer = new PrintWriter(out);
errorInfo.getErrorException().printStackTrace(writer);
- message += formatMessage("Exception", out.toString());
+ message.append(formatMessage("Exception", out.toString()));
// TODO EC-20100409 i18n files are iso encoded ?
- email.setContent(message, "text/plain; charset=ISO-8859-9");
+ email.setContent(message.toString(), "text/plain; charset=ISO-8859-9");
// send mail
email.send();
1
0
r3009 - trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction
by jpepin@users.chorem.org 20 Aug '10
by jpepin@users.chorem.org 20 Aug '10
20 Aug '10
Author: jpepin
Date: 2010-08-20 14:11:16 +0200 (Fri, 20 Aug 2010)
New Revision: 3009
Url: http://chorem.org/repositories/revision/lima/3009
Log:
D?\195?\169bogue ajout de ligne automatique.
Modified:
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTable.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTableModel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionViewHandler.java
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTable.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTable.java 2010-08-19 23:48:02 UTC (rev 3008)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTable.java 2010-08-20 12:11:16 UTC (rev 3009)
@@ -18,6 +18,8 @@
package org.chorem.lima.ui.financialtransaction;
+import static org.nuiton.i18n.I18n._;
+
import java.awt.Color;
import java.awt.Component;
import java.awt.event.FocusEvent;
@@ -28,11 +30,14 @@
import java.awt.event.MouseListener;
import java.math.BigDecimal;
import java.util.Date;
+import java.util.concurrent.ExecutionException;
+import javax.swing.SwingWorker;
import javax.swing.table.TableColumn;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.chorem.lima.business.LimaException;
import org.chorem.lima.entity.Account;
import org.chorem.lima.entity.Entry;
import org.chorem.lima.entity.EntryBook;
@@ -40,6 +45,7 @@
import org.chorem.lima.ui.celleditor.AccountTableCellEditor;
import org.chorem.lima.ui.celleditor.DateTableCellEditor;
import org.chorem.lima.ui.celleditor.EntryBookTableCellEditor;
+import org.chorem.lima.util.DialogHelper;
import org.jdesktop.swingx.JXTable;
import org.jdesktop.swingx.decorator.ColorHighlighter;
import org.jdesktop.swingx.decorator.ComponentAdapter;
@@ -66,6 +72,9 @@
private Highlighter colorTransaction;
private ColorHighlighter colorBalance;
+
+ private int x_tab;
+ private int y_tab;
public FinancialTransactionTable(FinancialTransactionViewHandler handler) {
@@ -148,7 +157,7 @@
//TODO combinaison de touches dans la config
- // delete selected row with the key : delete or ctrl clear
+ // delete selected row with the key : delete or ctrl + clear
// ou de l'entree
if ((e.getKeyCode() == KeyEvent.VK_DELETE )
|| (e.getKeyCode() == KeyEvent.VK_CLEAR
@@ -164,11 +173,27 @@
}
// add financial transaction with the key combination : ctrl + tab
+ if (e.getKeyCode() == KeyEvent.VK_C
+ && e.getModifiers() == KeyEvent.CTRL_MASK) {
+ handler.copyRow();
+ }
+
+ // copy : ctrl + c
+
+ // add financial transaction with the key combination : ctrl + tab
+ if (e.getKeyCode() == KeyEvent.VK_V
+ && e.getModifiers() == KeyEvent.CTRL_MASK) {
+ handler.pasteRow();
+ }
+
+ // paste : ctrl + v
+
+ // add financial transaction with the key combination : ctrl + tab
if (e.getKeyCode() == KeyEvent.VK_TAB
&& e.getModifiers() == KeyEvent.CTRL_MASK) {
handler.addFinancialTransaction();
}
-
+
/**
* Touche tab
* Incrémente le curseur de case tant que la case n'est pas editable
@@ -176,21 +201,24 @@
* la dernière cellule et si la transaction est non équilibré
* sinon rajoute une transaction
*/
+
if (e.getKeyChar() == KeyEvent.VK_TAB) {
int max_x = this.getColumnCount();
int max_y = this.getRowCount();
- int x_tab = this.getSelectedColumn();
- int y_tab = this.getSelectedRow();
+ x_tab = this.getSelectedColumn();
+ y_tab = this.getSelectedRow();
+ Boolean end = true;
- if (x_tab < max_x - 1){
+ if (x_tab < max_x - 1){
x_tab++;
}
+ //end of row
else {
+ x_tab=0;
y_tab++;
}
- //skip all cell while not editable
- while (!isCellEditable(y_tab, x_tab)){
-
+ //skip all cell while not editable or if end of table add entry or transaction or end of table
+ while (!isCellEditable(y_tab, x_tab) && end ){
//if end of row
if (x_tab == max_x-1) {
Object object = this.handler.tableModel.getElementAt(y_tab);
@@ -205,35 +233,60 @@
}
//if entry
else {
- Entry entry = (Entry) object;
- FinancialTransaction financialTransaction = entry.getFinancialTransaction();
- Boolean balanced =
- financialTransaction.getAmountCredit() ==
- financialTransaction.getAmountDebit();
- if (balanced){
- if (y_tab == max_y-1){
- handler.addFinancialTransaction();
- this.setColumnSelectionInterval(0, 0);
- }
- }
- else {
- handler.addEmptyEntry();
- this.setColumnSelectionInterval(1, 1);
- }
+ log.debug("not end");
+ //FIXME set value is doing after key pressed
+ // so update not terminated before get balanced
+ //Swing Worker stop the UI 500ms
+ // found best solution ?
+ final JXTable table = this;
+ final int y_t = y_tab;
+ final int m_t = max_y;
+ new SwingWorker<Void,Void>() {
+ @Override protected Void doInBackground() throws InterruptedException {
+ Thread.sleep(500);
+ return null;
+ }
+ @Override protected void done() {
+ Object object = handler.tableModel.getElementAt(y_tab-1);
+ FinancialTransaction financialTransaction = null;
+ if (object instanceof Entry){
+ financialTransaction = ((Entry) object).getFinancialTransaction();
+ }
+ else if (object instanceof FinancialTransaction){
+ financialTransaction = (FinancialTransaction) object;
+ }
+ BigDecimal amountC = financialTransaction.getAmountCredit();
+ BigDecimal amountD = financialTransaction.getAmountDebit();
+ if (amountC == amountD){
+ if (y_t == m_t-1){
+ handler.addFinancialTransaction();
+ table.setColumnSelectionInterval(0, 0);
+ }
+ }
+ else {
+ handler.addEmptyEntry();
+ table.setColumnSelectionInterval(1, 1);
+ y_tab++;
+ // positionne la sélection sur la nouvelle ligne créée
+ table.setRowSelectionInterval(y_tab, y_tab);
+ x_tab=0;
+ }
+ }
+ }.execute();
}
- y_tab++;
- // positionne la sélection sur la nouvelle ligne créée
- this.setRowSelectionInterval(y_tab, y_tab);
- x_tab=0;
+ end = false;
}
else {
if (x_tab < max_x){
+ this.setRowSelectionInterval(y_tab, y_tab);
this.setColumnSelectionInterval(x_tab, x_tab);
x_tab++;
}
}
}
}
+
+
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTableModel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTableModel.java 2010-08-19 23:48:02 UTC (rev 3008)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTableModel.java 2010-08-20 12:11:16 UTC (rev 3009)
@@ -159,7 +159,7 @@
result = String.class;
break;
case 5:
- result = BigDecimal.class;
+ result = String.class;
break;
case 6:
result = BigDecimal.class;
@@ -168,7 +168,7 @@
result = BigDecimal.class;
break;
case 8:
- result = String.class;
+ result = BigDecimal.class;
break;
}
@@ -198,16 +198,16 @@
result = _("lima.table.description");
break;
case 5:
- result = _("lima.table.debit");
+ result = _("lima.table.letter");
break;
case 6:
- result = _("lima.table.credit");
+ result = _("lima.table.debit");
break;
case 7:
- result = _("lima.table.balance");
+ result = _("lima.table.credit");
break;
case 8:
- result = _("lima.table.letter");
+ result = _("lima.table.balance");
break;
}
@@ -260,16 +260,16 @@
result = null; // description
break;
case 5 :
- result = amountDebit;
+ result = null; // letter
break;
case 6:
- result = amountCredit;
+ result = amountDebit;
break;
case 7:
- result = amountDebit.subtract(amountCredit);
+ result = amountCredit;
break;
case 8:
- result = null;
+ result = amountDebit.subtract(amountCredit);
break;
}
}
@@ -297,16 +297,16 @@
result = currentEntry.getDescription();
break;
case 5 :
- result = currentEntry.getDebit() ? currentEntry.getAmount() : 0;
+ result = currentEntry.getLettering();
break;
case 6:
- result = currentEntry.getDebit() ? 0 : currentEntry.getAmount();
+ result = currentEntry.getDebit() ? currentEntry.getAmount() : 0;
break;
case 7:
- result = null;
+ result = currentEntry.getDebit() ? 0 : currentEntry.getAmount();
break;
case 8:
- result = currentEntry.getLettering();
+ result = null;
break;
}
@@ -329,11 +329,11 @@
boolean editableCell=false;
Object currentRow = cacheDataList.get(rowIndex);
// cells editable for the entry row, all cells exclude the date
- if ((currentRow instanceof Entry) && !((columnIndex==0) || (columnIndex==1))) {
+ if ((currentRow instanceof Entry) && !((columnIndex==0) || (columnIndex==1) || (columnIndex==8))) {
editableCell=true;
}
// cells editable for the financialtransaction row, no cells exclude the date
- if ((currentRow instanceof FinancialTransaction) && ((columnIndex==0) || (columnIndex==1) || (columnIndex==8))){
+ if ((currentRow instanceof FinancialTransaction) && ((columnIndex==0) || (columnIndex==1))){
editableCell=true;
}
return editableCell;
@@ -494,16 +494,16 @@
currentEntry.setDescription((String)value);
break;
case 5 :
+ currentEntry.setLettering((String)value);
+ break;
+ case 6:
currentEntry.setAmount((BigDecimal)value);
currentEntry.setDebit(true);
break;
- case 6:
+ case 7:
currentEntry.setAmount((BigDecimal)value);
currentEntry.setDebit(false);
break;
- case 8:
- currentEntry.setLettering((String)value);
- break;
}
try {
financialTransactionService.updateEntry(currentEntry);
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionViewHandler.java 2010-08-19 23:48:02 UTC (rev 3008)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionViewHandler.java 2010-08-20 12:11:16 UTC (rev 3009)
@@ -67,6 +67,7 @@
//copy entry
public void copyRow(){
+ table = view.getFinancialTransactionTable();
int indexSelectedRow = table.getSelectedRow();
if (indexSelectedRow != -1) {
@@ -76,6 +77,7 @@
//paste entry
public void pasteRow(){
+ table = view.getFinancialTransactionTable();
int indexSelectedRow = table.getSelectedRow();
if (indexSelectedRow != -1) {
1
0
r3008 - in trunk/lima-swing/src/main: java/org/chorem/lima/ui java/org/chorem/lima/ui/financialtransaction java/org/chorem/lima/ui/financialtransactionsearch java/org/chorem/lima/ui/financialtransactionunbalanced java/org/chorem/lima/ui/importexport java/org/chorem/lima/ui/opening resources/i18n
by jpepin@users.chorem.org 19 Aug '10
by jpepin@users.chorem.org 19 Aug '10
19 Aug '10
Author: jpepin
Date: 2010-08-20 01:48:02 +0200 (Fri, 20 Aug 2010)
New Revision: 3008
Url: http://chorem.org/repositories/revision/lima/3008
Log:
Fen?\195?\170tre d'import/export est d?\195?\169sormais modal
Optimisation import/export : remont?\195?\169 des exception ?\195?\160 l'utilisateur
Remise en marche du jaxx configbuilder
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
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTable.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTableModel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchTableModel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedTableModel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExportWaitView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/OpeningView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/OpeningViewHandler.java
trunk/lima-swing/src/main/resources/i18n/lima-swing-en_GB.properties
trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainView.jaxx 2010-08-19 21:13:17 UTC (rev 3007)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainView.jaxx 2010-08-19 23:48:02 UTC (rev 3008)
@@ -159,16 +159,11 @@
actionIcon='entries-unbalanced'/>
<JMenuItem text="lima.entries.searchtransaction" onActionPerformed='getHandler().showTransactionSearchView(this)'
actionIcon='entries-search'/>
- <JMenuItem text="lima.entries.lettering" onActionPerformed='getHandler().showLetteringView(this)'
+ <!-- Menu prévu pour le lettrage automatique
+ <JMenuItem text="lima.entries.lettering" onActionPerformed='getHandler().showLetteringView(this)'
actionIcon='lettering'/>
+ -->
</JMenu>
- <!--
- <JMenu text="lima.view">
- <JCheckBoxMenuItem id="viewFlatten" text="lima.view.flatten"
- onItemStateChanged='getHandler().onChangeView(this)'
- selected="false" actionIcon='view'/>
- </JMenu>
- -->
<JMenu text="lima.reports" mnemonic="{'R'}">
<JMenuItem text="lima.reports.accounts" onActionPerformed='getHandler().showAccountReports(this)'
actionIcon='reports-account'/>
@@ -225,12 +220,7 @@
</JMenu>
</JMenuBar>
<JPanel layout='{new BorderLayout()}'>
-
<JTabbedPane id="contentTabbedPane" constraints="BorderLayout.CENTER"/>
-
- <!-- class not found <jaxx.runtime.swing.StatusMessagePanel id='statusBar'
- _help='"ui.main.statusBar"'
- constraints="BorderLayout.SOUTH"/> -->
</JPanel>
</JFrame>
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 2010-08-19 21:13:17 UTC (rev 3007)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainViewHandler.java 2010-08-19 23:48:02 UTC (rev 3008)
@@ -24,9 +24,7 @@
import java.util.Locale;
import jaxx.runtime.JAXXContext;
import jaxx.runtime.swing.AboutPanel;
-import jaxx.runtime.swing.editor.config.ConfigUI;
-import jaxx.runtime.swing.editor.config.ConfigUIBuilder;
-import jaxx.runtime.swing.editor.config.model.ConfigUIModel;
+import jaxx.runtime.swing.editor.config.ConfigUIHelper;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.LimaConfig;
@@ -151,27 +149,19 @@
public void showConfig(JAXXContext context) {
MainView ui = getUI(context);
LimaConfig config = context.getContextValue(LimaConfig.class);
- ConfigUIModel model = new ConfigUIModel(config);
- //TODO pepin 20100510 methode deprecate
- /*
- // categorie repertoires
- model.addCategory(
- n_("lima.config.category.directories"),
- n_("lima.config.category.directories.description"),
- LimaConfig.Option.CONFIG_FILE);
+ //TODO pepin 2010-08-20 add all options
- // others
- model.addCategory(
- n_("lima.config.category.other"),
- n_("lima.config.category.other.description"),
- LimaConfig.Option.FULL_SCREEN,
- LimaConfig.Option.LOCALE);
- */
-
- ConfigUI configUI = ConfigUIBuilder.newConfigUI(context, model, "lima.config.category.directories");
-
- ConfigUIBuilder.showConfigUI(configUI, ui, false);
+ ConfigUIHelper helper = new ConfigUIHelper(config);
+ helper.addCategory(_("lima.config.category.directories"), _("lima.config.category.directories.description"));
+ helper.addOption(LimaConfig.Option.CONFIG_FILE);
+
+ helper.addCategory(_("lima.config.category.other"), _("lima.config.category.other.description"));
+ helper.addOption(LimaConfig.Option.FULL_SCREEN);
+ helper.addOption(LimaConfig.Option.LOCALE);
+
+ helper.buildUI(context, _("lima.config.category.directories"));
+ helper.displayUI(ui, false);
}
public void showHelp(JAXXContext context, String helpId) {
@@ -410,31 +400,4 @@
ImportExport importExport = ImportExport.getInstance(mainView);
importExport.importExport(type, "", true);
}
-
- public void showExportView(String type) {
-
- /*if (!getExportView(type).isEnabled()) {
- getExportView(type).setEnabled(true);
- }*/
- }
-
- public void showLetteringView(JAXXContext rootContext) {
- MainView mainView = getUI(rootContext);
- // LetteringView letteringView = new LetteringView(mainView);
- // mainView.showTab(_("lima.entries.lettering"), letteringView);
- }
-
- public void showSearchView(JAXXContext rootContext) {
- /*if (!getSearchView().isEnabled()) {
- getSearchView().setEnabled(true);
- }
- getSearchView().setVisible(true);*/
- }
-
- public void showResultView(JAXXContext rootContext) {
- MainView mainView = getUI(rootContext);
- //ResultView resultView = new ResultView(mainView);
- // mainView.showTab(_("lima.tab.result"), resultView);
- }
-
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTable.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTable.java 2010-08-19 21:13:17 UTC (rev 3007)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTable.java 2010-08-19 23:48:02 UTC (rev 3008)
@@ -29,6 +29,8 @@
import java.math.BigDecimal;
import java.util.Date;
+import javax.swing.table.TableColumn;
+
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.entity.Account;
@@ -68,7 +70,7 @@
public FinancialTransactionTable(FinancialTransactionViewHandler handler) {
this.handler = handler;
-
+
addKeyListener(this);
//Get new date editor
@@ -83,7 +85,7 @@
// highlight unbalanced financial transactions
addColorNonBalancedTransaction();
}
-
+
/**
* Cette méthode permet de colorer toutes les transactions dans le tableau
* afin de bien distinguer les transactions et entrées comptables.
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTableModel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTableModel.java 2010-08-19 21:13:17 UTC (rev 3007)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTableModel.java 2010-08-19 23:48:02 UTC (rev 3008)
@@ -159,7 +159,7 @@
result = String.class;
break;
case 5:
- result = String.class;
+ result = BigDecimal.class;
break;
case 6:
result = BigDecimal.class;
@@ -168,13 +168,15 @@
result = BigDecimal.class;
break;
case 8:
- result = BigDecimal.class;
+ result = String.class;
break;
}
return result;
}
+
+
@Override
public String getColumnName(int column) {
String result = "n/a";
@@ -196,16 +198,16 @@
result = _("lima.table.description");
break;
case 5:
- result = _("lima.table.position");
+ result = _("lima.table.debit");
break;
case 6:
- result = _("lima.table.debit");
+ result = _("lima.table.credit");
break;
case 7:
- result = _("lima.table.credit");
+ result = _("lima.table.balance");
break;
case 8:
- result = _("lima.table.balance");
+ result = _("lima.table.letter");
break;
}
@@ -258,16 +260,16 @@
result = null; // description
break;
case 5 :
- result = null; // position
+ result = amountDebit;
break;
case 6:
- result = amountDebit;
+ result = amountCredit;
break;
case 7:
- result = amountCredit;
+ result = amountDebit.subtract(amountCredit);
break;
case 8:
- result = amountDebit.subtract(amountCredit);
+ result = null;
break;
}
}
@@ -295,16 +297,16 @@
result = currentEntry.getDescription();
break;
case 5 :
- result = currentEntry.getPosition();
+ result = currentEntry.getDebit() ? currentEntry.getAmount() : 0;
break;
case 6:
- result = currentEntry.getDebit() ? currentEntry.getAmount() : 0;
+ result = currentEntry.getDebit() ? 0 : currentEntry.getAmount();
break;
case 7:
- result = currentEntry.getDebit() ? 0 : currentEntry.getAmount();
+ result = null;
break;
case 8:
- result = null; // balance
+ result = currentEntry.getLettering();
break;
}
@@ -327,11 +329,11 @@
boolean editableCell=false;
Object currentRow = cacheDataList.get(rowIndex);
// cells editable for the entry row, all cells exclude the date
- if ((currentRow instanceof Entry) && !((columnIndex==0) || (columnIndex==1) || (columnIndex==8))) {
+ if ((currentRow instanceof Entry) && !((columnIndex==0) || (columnIndex==1))) {
editableCell=true;
}
// cells editable for the financialtransaction row, no cells exclude the date
- if ((currentRow instanceof FinancialTransaction) && ((columnIndex==0) || (columnIndex==1))){
+ if ((currentRow instanceof FinancialTransaction) && ((columnIndex==0) || (columnIndex==1) || (columnIndex==8))){
editableCell=true;
}
return editableCell;
@@ -492,16 +494,16 @@
currentEntry.setDescription((String)value);
break;
case 5 :
- currentEntry.setPosition((String)value);
- break;
- case 6:
currentEntry.setAmount((BigDecimal)value);
currentEntry.setDebit(true);
break;
- case 7:
- currentEntry.setAmount((BigDecimal)value);
+ case 6:
+ currentEntry.setAmount((BigDecimal)value);
currentEntry.setDebit(false);
break;
+ case 8:
+ currentEntry.setLettering((String)value);
+ break;
}
try {
financialTransactionService.updateEntry(currentEntry);
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchTableModel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchTableModel.java 2010-08-19 21:13:17 UTC (rev 3007)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchTableModel.java 2010-08-19 23:48:02 UTC (rev 3008)
@@ -58,6 +58,7 @@
* By : $Author: jpepin $
*/
public class FinancialTransactionSearchTableModel extends AbstractTableModel {
+
/** serialVersionUID. */
private static final long serialVersionUID = 3914954536809622358L;
@@ -69,7 +70,6 @@
/** data cache */
protected List<Entry> cacheDataList;
-
public void refresh(List<Entry> objects){
cacheDataList = objects;
@@ -103,7 +103,7 @@
result = String.class;
break;
case 5:
- result = String.class;
+ result = BigDecimal.class;
break;
case 6:
result = BigDecimal.class;
@@ -112,7 +112,7 @@
result = BigDecimal.class;
break;
case 8:
- result = BigDecimal.class;
+ result = String.class;
break;
}
@@ -140,16 +140,16 @@
result = _("lima.table.description");
break;
case 5:
- result = _("lima.table.position");
+ result = _("lima.table.debit");
break;
case 6:
- result = _("lima.table.debit");
+ result = _("lima.table.credit");
break;
case 7:
- result = _("lima.table.credit");
+ result = _("lima.table.balance");
break;
case 8:
- result = _("lima.table.balance");
+ result = _("lima.table.letter");
break;
}
@@ -206,16 +206,16 @@
result = currentRow.getDescription();
break;
case 5 :
- result = currentRow.getPosition();
+ result = currentRow.getDebit() ? currentRow.getAmount() : 0;
break;
case 6:
- result = currentRow.getDebit() ? currentRow.getAmount() : 0;
+ result = currentRow.getDebit() ? 0 : currentRow.getAmount();
break;
case 7:
- result = currentRow.getDebit() ? 0 : currentRow.getAmount();
+ result = null; // balance
break;
case 8:
- result = null; // balance
+ result = currentRow.getLettering();
break;
}
@@ -225,104 +225,12 @@
}
- /**
- * To set cells editable or not
- * different condition for entry or financial transaction
- */
@Override
public boolean isCellEditable(int rowIndex, int columnIndex) {
- boolean editableCell=false;
- Object currentRow = cacheDataList.get(rowIndex);
- // cells editable for the entry row, all cells exclude the date
- if ((currentRow instanceof Entry) && !((columnIndex==0) || (columnIndex==1))) {
- editableCell=true;
- }
- // cells editable for the financialtransaction row, no cells exclude the date
- if ((currentRow instanceof FinancialTransaction) && ((columnIndex==0) || (columnIndex==1))){
- editableCell=true;
- }
- return editableCell;
+
+ return false;
}
-
- /* /**
- * to modifiy financialtransaction or entry
- *
- @Override
- public void setValueAt(Object value, int row, int column) {
- int financialTransactionRow=0;
- // just prevent too much result
- if (selectedFiscalPeriod != null) {
- Object currentRow = cacheDataList.get(row);
- if (currentRow instanceof FinancialTransaction) {
- FinancialTransaction currentFinancialTransaction =
- (FinancialTransaction)currentRow;
- switch (column) {
- case 0:
- //update
- currentFinancialTransaction.setTransactionDate((Date)value);
- break;
- case 1 :
- currentFinancialTransaction.setEntryBook((EntryBook)value);
- break;
- }
- // notify service for modification
- try {
- financialTransactionService.
- updateFinancialTransaction(currentFinancialTransaction);
- } catch (LimaException eee) {
- if (log.isDebugEnabled()){
- log.debug("Can't update financial transaction", eee);
- }
- DialogHelper.showMessageDialog(eee.getMessage());
- }
- //update the financial transaction in entire
- financialTransactionRow =
- cacheDataList.indexOf(((FinancialTransaction) currentRow));
- }
- else if (currentRow instanceof Entry) {
- Entry currentEntry = (Entry)currentRow;
- switch (column) {
- case 2 :
- currentEntry.setVoucher((String)value);
- break;
- case 3:
- currentEntry.setAccount((Account)value);
- break;
- case 4:
- currentEntry.setDescription((String)value);
- break;
- case 5 :
- currentEntry.setPosition((String)value);
- break;
- case 6:
- currentEntry.setAmount((BigDecimal)value);
- currentEntry.setDebit(true);
- break;
- case 7:
- currentEntry.setAmount((BigDecimal)value);
- currentEntry.setDebit(false);
- break;
- }
- try {
- financialTransactionService.updateEntry(currentEntry);
- } catch (LimaException eee) {
- if (log.isDebugEnabled()){
- log.debug("Can't update entry", eee);
- }
- DialogHelper.showMessageDialog(eee.getMessage());
- }
- //update the financial transaction in entire
- financialTransactionRow =
- cacheDataList.indexOf(((Entry) currentRow).
- getFinancialTransaction());
- }
- //on recharge la liste
- //TODO PEPIN 20100607 Get financial transaction of cachedatelist on replace it
- fireTableRowsUpdated(financialTransactionRow, getRowCount()-1);
- }
- }*/
-
public Object getElementAt(int row){
Object currentRow = cacheDataList.get(row);
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 2010-08-19 21:13:17 UTC (rev 3007)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedTableModel.java 2010-08-19 23:48:02 UTC (rev 3008)
@@ -153,7 +153,7 @@
result = String.class;
break;
case 5:
- result = String.class;
+ result = BigDecimal.class;
break;
case 6:
result = BigDecimal.class;
@@ -162,7 +162,7 @@
result = BigDecimal.class;
break;
case 8:
- result = BigDecimal.class;
+ result = String.class;
break;
}
@@ -190,16 +190,16 @@
result = _("lima.table.description");
break;
case 5:
- result = _("lima.table.position");
+ result = _("lima.table.debit");
break;
case 6:
- result = _("lima.table.debit");
+ result = _("lima.table.credit");
break;
case 7:
- result = _("lima.table.credit");
+ result = _("lima.table.balance");
break;
case 8:
- result = _("lima.table.balance");
+ result = _("lima.table.letter");
break;
}
@@ -253,16 +253,16 @@
result = null; // description
break;
case 5 :
- result = null; // position
+ result = amountDebit;
break;
case 6:
- result = amountDebit;
+ result = amountCredit;
break;
case 7:
- result = amountCredit;
+ result = amountDebit.subtract(amountCredit);
break;
case 8:
- result = amountDebit.subtract(amountCredit);
+ result = null;
break;
}
}
@@ -290,16 +290,16 @@
result = currentEntry.getDescription();
break;
case 5 :
- result = currentEntry.getPosition();
+ result = currentEntry.getDebit() ? currentEntry.getAmount() : 0;
break;
case 6:
- result = currentEntry.getDebit() ? currentEntry.getAmount() : 0;
+ result = currentEntry.getDebit() ? 0 : currentEntry.getAmount();
break;
case 7:
- result = currentEntry.getDebit() ? 0 : currentEntry.getAmount();
+ result = null;
break;
case 8:
- result = null; // balance
+ result = currentEntry.getLettering();
break;
}
@@ -405,16 +405,16 @@
currentEntry.setDescription((String)value);
break;
case 5 :
- currentEntry.setPosition((String)value);
- break;
- case 6:
currentEntry.setAmount((BigDecimal)value);
currentEntry.setDebit(true);
break;
- case 7:
- currentEntry.setAmount((BigDecimal)value);
+ case 6:
+ currentEntry.setAmount((BigDecimal)value);
currentEntry.setDebit(false);
break;
+ case 8:
+ currentEntry.setLettering((String)value);
+ break;
}
try {
financialTransactionService.updateEntry(currentEntry);
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 2010-08-19 21:13:17 UTC (rev 3007)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java 2010-08-19 23:48:02 UTC (rev 3008)
@@ -181,9 +181,7 @@
log.debug("Can't get result message", eeeIE);
}
} catch (ExecutionException eeeEE) {
- if (log.isDebugEnabled()){
- log.debug("Can't get result message", eeeEE);
- }
+ DialogHelper.showMessageDialog(eeeEE.getMessage());
}
}
}.execute();
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExportWaitView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExportWaitView.jaxx 2010-08-19 21:13:17 UTC (rev 3007)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExportWaitView.jaxx 2010-08-19 23:48:02 UTC (rev 3008)
@@ -15,7 +15,7 @@
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
##% -->
-<JDialog id="waitDialog">
+<JDialog modal="true" id="waitDialog">
<script>
<![CDATA[
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/OpeningView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/OpeningView.jaxx 2010-08-19 21:13:17 UTC (rev 3007)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/OpeningView.jaxx 2010-08-19 23:48:02 UTC (rev 3008)
@@ -41,6 +41,7 @@
<cell weightx="0.9" rows="4" fill="both">
<JPanel id='panel'>
<JLabel text='lima.opening.welcome' />
+ <JButton text='lima.opening.import' onActionPerformed="handler.importSave()"/>
</JPanel>
</cell>
</row>
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/OpeningViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/OpeningViewHandler.java 2010-08-19 21:13:17 UTC (rev 3007)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/OpeningViewHandler.java 2010-08-19 23:48:02 UTC (rev 3008)
@@ -63,6 +63,13 @@
step = 0;
}
+
+ public void importSave(){
+ ImportExport importExport = new ImportExport(view);
+ importExport.importExport(ImportExportEnum.CSV_ALL_IMPORT, "", true);
+ view.dispose();
+ }
+
public void next(){
ImportExport importExport = ImportExport.getInstance(view);
JPanel panel = view.getPanel();
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 2010-08-19 21:13:17 UTC (rev 3007)
+++ trunk/lima-swing/src/main/resources/i18n/lima-swing-en_GB.properties 2010-08-19 23:48:02 UTC (rev 3008)
@@ -195,6 +195,7 @@
lima.openejb.remotemode.description=
lima.opening.accounts=
lima.opening.entrybook=
+lima.opening.import=
lima.opening.welcome=
lima.pdf=
lima.period.begindate=
@@ -240,6 +241,7 @@
lima.table.grossamount=
lima.table.label=
lima.table.letter=
+lima.table.lettering=
lima.table.move.credit=
lima.table.move.debit=
lima.table.netamount=
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 2010-08-19 21:13:17 UTC (rev 3007)
+++ trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties 2010-08-19 23:48:02 UTC (rev 3008)
@@ -181,7 +181,8 @@
lima.openejb.remotemode.description=
lima.opening.accounts=<html><center>Aucun plan comptable charg\u00E9<br/>Veuillez s\u00E9lectionner un plan par d\u00E9fault, <br/>importer un plan personnalis\u00E9<br/> ou annuler pour cr\u00E9er votre propre plan.</center></html>
lima.opening.entrybook=<html>Cochez la case pour importer les journaux par d\u00E9faut \:<br/> Achats, Ventes, Tr\u00E9sorerie, Op\u00E9ration diverses</html>
-lima.opening.welcome=<html><center>Bienvenue dans Lima<br/>Laissez vous guider par cet assistant pour d\u00E9marrer votre comptabilit\u00E9 en quelques instants\u0085</center></html>
+lima.opening.import=Importer une sauvegarde CSV
+lima.opening.welcome=<html><center>Bienvenue dans Lima<br/>Laissez vous guider par cet assistant pour d\u00E9marrer votre comptabilit\u00E9 en quelques instants\u0085<br/>Ou bien importer directement une ancienne sauvegarde de LIMA au format CSV<br/><br/><br/><br/></center></html>
lima.pdf=
lima.period.begindate=D\u00E9but
lima.period.create=Choisissez la date de d\u00E9but et de fin du nouvel exercice
@@ -226,6 +227,7 @@
lima.table.grossamount=Brut
lima.table.label=Libell\u00E9
lima.table.letter=Lettre
+lima.table.lettering=
lima.table.move.credit=Mouvement au cr\u00E9dit
lima.table.move.debit=Mouvement au d\u00E9bit
lima.table.netamount=Net
1
0
Author: jpepin
Date: 2010-08-19 23:13:17 +0200 (Thu, 19 Aug 2010)
New Revision: 3007
Url: http://chorem.org/repositories/revision/lima/3007
Log:
Impl?\195?\169mentation recherche ?\195?\169critures.
D?\195?\169placement de la m?\195?\169thode accountsToStrings du service account vers le DAO account.
Added:
trunk/lima-swing/src/main/java/org/chorem/lima/enums/ComboBoxEntryBooksEnum.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/AmountSearchPanel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/EntryBookSearchPanel.java
Removed:
trunk/lima-swing/src/main/java/org/chorem/lima/enums/ComboBoxAmountEnum.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/FinancialStatementServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/AccountServiceLocal.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialTransactionService.java
trunk/lima-callao/src/main/java/org/chorem/lima/FinancialStatementWayEnum.java
trunk/lima-callao/src/main/java/org/chorem/lima/entity/AccountDAOImpl.java
trunk/lima-callao/src/main/xmi/accounting.zargo
trunk/lima-swing/src/main/java/org/chorem/lima/enums/ComboBoxAccountsEnum.java
trunk/lima-swing/src/main/java/org/chorem/lima/enums/ComboBoxOperatorsEnum.java
trunk/lima-swing/src/main/java/org/chorem/lima/enums/ComboBoxPeriodEnum.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/EntryBookComboBoxModel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/AccountSearchComboBox.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/AccountSearchPanel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/EntryBookSearchComboBox.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchTable.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchTableModel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchViewHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/PeriodSearchPanel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedTable.java
trunk/lima-swing/src/main/resources/i18n/lima-swing-en_GB.properties
trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java 2010-08-18 14:47:44 UTC (rev 3006)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java 2010-08-19 21:13:17 UTC (rev 3007)
@@ -344,13 +344,15 @@
Account accountToDelete = accountDAO.findByTopiaId(account.getTopiaId());
//get all subaccounts
- List<Account> accounts = getAllChildrenAccounts(accountToDelete, new ArrayList<Account>());
+ List<Account> accounts =
+ getAllChildrenAccounts(accountToDelete, new ArrayList<Account>());
//if account have sub accounts
if (accounts.size() > 0){
for (Account subAccount : accounts) {
// Check rules for subaccount if have entries
accountingRules.removeAccountRules(subAccount, transaction);
- Account subAccountToDelete = accountDAO.findByTopiaId(subAccount.getTopiaId());
+ Account subAccountToDelete =
+ accountDAO.findByTopiaId(subAccount.getTopiaId());
accountDAO.delete(subAccountToDelete);
}
}
@@ -435,11 +437,11 @@
}
- /**
+ /*
* Convert string of extends number to list of accounts
* Example '22, 45..48, 67' -> [22, 45, 46, 47, 48, 67]
* SubAccountsMode return list of existing subaccounts ex 6 return : 61, 62, .., 69, 610, .., 619 etc
- */
+ *
@Override
public List<Account> stringToListAccountsWithTransaction(String selectedAccounts, Boolean subAccountsMode, TopiaContext topiaContext) throws LimaException{
List<Account> accounts = new ArrayList<Account>();
@@ -536,7 +538,7 @@
}
return accounts;
- }
+ }*/
protected TopiaContext beginTransaction() throws TopiaException {
// basic check done, make check in database
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 2010-08-18 14:47:44 UTC (rev 3006)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialStatementServiceImpl.java 2010-08-19 21:13:17 UTC (rev 3007)
@@ -40,7 +40,6 @@
import org.chorem.lima.business.LimaBusinessException;
import org.chorem.lima.business.LimaConfig;
import org.chorem.lima.business.LimaException;
-import org.chorem.lima.business.ejbinterface.AccountServiceLocal;
import org.chorem.lima.business.ejbinterface.FinancialStatementService;
import org.chorem.lima.business.ejbinterface.FinancialStatementServiceLocal;
import org.chorem.lima.business.ejbinterface.ReportServiceLocal;
@@ -67,9 +66,6 @@
protected AccountingRules accountingRules;
@EJB
- AccountServiceLocal accountServiceLocal;
-
- @EJB
ReportServiceLocal reportServiceLocal;
public FinancialStatementServiceImpl() {
@@ -463,12 +459,12 @@
try {
if (accountsNumberList != null){
//Remove Spaces
+ AccountDAO accountDAO = LimaCallaoDAOHelper.getAccountDAO(topiaContext);
accountsNumberList = StringUtils.deleteWhitespace(accountsNumberList);
StringTokenizer stQuote = new StringTokenizer(accountsNumberList, "-");
while (stQuote.hasMoreTokens()) {
String s = stQuote.nextToken();
- List<Account> accountsList = accountServiceLocal.
- stringToListAccountsWithTransaction(s, false, topiaContext);
+ List<Account> accountsList = accountDAO.stringToListAccounts(s, false);
BigDecimal resAmount = new BigDecimal(0);
for (Account account : accountsList) {
@@ -521,7 +517,9 @@
}
}catch (LimaException ex) {
doCatch(topiaContext, ex, log);
- }
+ } catch (TopiaException e) {
+ doCatch(topiaContext, e, log);
+ }
return amount;
}
@@ -546,20 +544,20 @@
for (FinancialStatement financialStatement : financialStatementsList) {
accountsList.removeAll(
- accountServiceLocal.stringToListAccountsWithTransaction(
- financialStatement.getAccounts(), true, transaction));
+ accountDAO.stringToListAccounts(
+ financialStatement.getAccounts(), true));
accountsList.removeAll(
- accountServiceLocal.stringToListAccountsWithTransaction(
- financialStatement.getCreditAccounts(), true, transaction));
+ accountDAO.stringToListAccounts(
+ financialStatement.getCreditAccounts(), true));
accountsList.removeAll(
- accountServiceLocal.stringToListAccountsWithTransaction(
- financialStatement.getDebitAccounts(), true, transaction));
+ accountDAO.stringToListAccounts(
+ financialStatement.getDebitAccounts(), true));
accountsList.removeAll(
- accountServiceLocal.stringToListAccountsWithTransaction(
- financialStatement.getProvisionDeprecationAccounts(), true, transaction));
+ accountDAO.stringToListAccounts(
+ financialStatement.getProvisionDeprecationAccounts(), true));
}
for (Account account : accountsList) {
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 2010-08-18 14:47:44 UTC (rev 3006)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java 2010-08-19 21:13:17 UTC (rev 3007)
@@ -20,21 +20,23 @@
package org.chorem.lima.business.ejb;
import static org.nuiton.i18n.I18n._;
-
import java.math.BigDecimal;
+import java.util.ArrayList;
import java.util.Date;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
-
import javax.ejb.Stateless;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.chorem.lima.FinancialStatementWayEnum;
import org.chorem.lima.business.AccountingRules;
import org.chorem.lima.business.LimaConfig;
import org.chorem.lima.business.LimaException;
import org.chorem.lima.business.ejbinterface.FinancialTransactionService;
import org.chorem.lima.business.ejbinterface.FinancialTransactionServiceLocal;
+import org.chorem.lima.entity.Account;
+import org.chorem.lima.entity.AccountDAO;
import org.chorem.lima.entity.Entry;
import org.chorem.lima.entity.EntryBook;
import org.chorem.lima.entity.EntryDAO;
@@ -605,7 +607,97 @@
- protected TopiaContext beginTransaction() throws TopiaException {
+
+ @Override
+ public List<Entry> searchEntry(Date beginDate, Date endDate, String voucher,
+ String description, String letter, String accountsList,
+ Account account, EntryBook entryBook,
+ FinancialStatementWayEnum fStWayEnum, String operator,
+ String amount, String amount2) throws LimaException {
+ List<Entry> entries = null;
+ TopiaContext topiaContext = null;
+ try {
+ topiaContext = beginTransaction();
+ EntryDAO entryDAO = LimaCallaoDAOHelper.getEntryDAO(topiaContext);
+ TopiaQuery query = entryDAO.createQuery();
+ String dateProperty = TopiaQuery.getProperty(Entry.FINANCIAL_TRANSACTION, FinancialTransaction.TRANSACTION_DATE);
+ String entryBookProperty = TopiaQuery.getProperty(Entry.FINANCIAL_TRANSACTION, FinancialTransaction.ENTRY_BOOK);
+ String entryBookLabelProperty = TopiaQuery.getProperty(Entry.FINANCIAL_TRANSACTION, FinancialTransaction.ENTRY_BOOK, EntryBook.LABEL);
+ String accountProperty = TopiaQuery.getProperty(Entry.ACCOUNT, Account.ACCOUNT_NUMBER);
+
+ //Load for lazy
+ query.addLoad(dateProperty)
+ .addLoad(entryBookLabelProperty)
+ .addLoad(accountProperty);
+
+ if (beginDate != null && endDate != null){
+ query.addBetween(dateProperty, beginDate, endDate);
+ }
+ else if (beginDate != null){
+ query.addEquals(dateProperty, beginDate);
+ }
+ if (voucher != null){
+ query.addWhere(Entry.VOUCHER, Op.LIKE, "%"+voucher+"%");
+ }
+ if (description != null){
+ query.addWhere(Entry.DESCRIPTION, Op.LIKE, "%"+description+"%");
+ }
+ if (letter != null){
+ query.addWhere(Entry.LETTERING, Op.LIKE, "%"+letter+"%");
+ }
+ if (account != null){
+ query.addEquals(Entry.ACCOUNT, account);
+ }
+ else if (accountsList != null){
+ AccountDAO accountDAO = LimaCallaoDAOHelper.getAccountDAO(topiaContext);
+ List<Account> accounts = accountDAO.stringToListAccounts(accountsList, false);
+ String accountNumbers = "0,";
+ int max = accounts.size();
+ for (int i = 1; i <= max; i++) {
+ accountNumbers += accounts.get(i-1).getAccountNumber();
+ if (i != max){
+ accountNumbers += ",";
+ }
+ }
+ if (accounts.size() > 0){
+ query.addWhere(accountProperty + " in (" + accountNumbers + ")");
+ }
+
+ }
+ if (entryBook != null){
+ query.addEquals(entryBookProperty, entryBook);
+ }
+ else if (amount != null){
+ if (amount2 != null){
+ BigDecimal value1 = new BigDecimal(amount);
+ BigDecimal value2 = new BigDecimal(amount2);
+ query.addBetween(Entry.AMOUNT, value1, value2);
+ }
+ else if (operator != null) {
+ query.addWhere(Entry.AMOUNT+" "+operator+" "+amount);
+ }
+ switch (fStWayEnum) {
+ case CREDIT:
+ query.addEquals(Entry.DEBIT, false);
+ break;
+ case DEBIT:
+ query.addEquals(Entry.DEBIT, true);
+ break;
+ }
+ }
+ log.debug(query);
+ entries = entryDAO.findAllByQuery(query);
+ }
+ catch (TopiaException ex) {
+ doCatch(topiaContext, ex, log);
+ }
+ finally {
+ doFinally(topiaContext, log);
+ }
+ return entries;
+ }
+
+ protected TopiaContext beginTransaction() throws TopiaException {
// basic check done, make check in database
// TODO move it into JTA
TopiaContext topiaTransaction;
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java 2010-08-18 14:47:44 UTC (rev 3006)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java 2010-08-19 21:13:17 UTC (rev 3007)
@@ -23,7 +23,6 @@
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
-import javax.ejb.EJB;
import javax.ejb.Stateless;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
@@ -34,7 +33,6 @@
import org.chorem.lima.beans.ReportsDatasImpl;
import org.chorem.lima.business.LimaConfig;
import org.chorem.lima.business.LimaException;
-import org.chorem.lima.business.ejbinterface.AccountServiceLocal;
import org.chorem.lima.business.ejbinterface.ReportService;
import org.chorem.lima.business.ejbinterface.ReportServiceLocal;
import org.chorem.lima.entity.Account;
@@ -57,9 +55,6 @@
private TopiaContext rootContext;
- @EJB
- AccountServiceLocal accountServiceLocal;
-
public ReportServiceImpl() {
LimaConfig config = LimaConfig.getInstance();
try {
@@ -480,8 +475,8 @@
}
//build list account from selectedAccounts
else{
- accounts = accountServiceLocal.stringToListAccountsWithTransaction(
- selectedAccounts, false, topiaTransaction);
+ accounts = accountDAO.stringToListAccounts(
+ selectedAccounts, false);
}
for (Account account : accounts) {
ReportsDatas reportsDatas =
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/AccountServiceLocal.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/AccountServiceLocal.java 2010-08-18 14:47:44 UTC (rev 3006)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/AccountServiceLocal.java 2010-08-19 21:13:17 UTC (rev 3007)
@@ -40,7 +40,6 @@
@Local
public interface AccountServiceLocal extends AccountService{
- public List<Account> stringToListAccountsWithTransaction(String selectedAccounts, Boolean subAccountsMode, TopiaContext topiaContext) throws LimaException;
void createAccountWithTransaction(Account masterAccount, Account account, TopiaContext topiaContext) throws LimaException, LimaBusinessException;
void createSubLedgerWithTransaction(Account masterAccount, Account account, TopiaContext topiaContext) throws LimaException;
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialTransactionService.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialTransactionService.java 2010-08-18 14:47:44 UTC (rev 3006)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialTransactionService.java 2010-08-19 21:13:17 UTC (rev 3007)
@@ -19,12 +19,16 @@
package org.chorem.lima.business.ejbinterface;
+import java.util.Date;
import java.util.List;
import java.util.Set;
import javax.ejb.Remote;
+
+import org.chorem.lima.FinancialStatementWayEnum;
import org.chorem.lima.business.LimaBusinessException;
import org.chorem.lima.business.LimaException;
+import org.chorem.lima.entity.Account;
import org.chorem.lima.entity.Entry;
import org.chorem.lima.entity.EntryBook;
import org.chorem.lima.entity.FinancialPeriod;
@@ -80,5 +84,6 @@
void updateEntry(Entry entry) throws LimaException;
void removeEntry(Entry entry) throws LimaException;
-
+
+ List<Entry> searchEntry(Date beginDate, Date endDate, String voucher, String description, String letter, String accountsList, Account account, EntryBook entryBook, FinancialStatementWayEnum fStWayEnum, String operator, String amount, String amount2) throws LimaException;
}
Modified: trunk/lima-callao/src/main/java/org/chorem/lima/FinancialStatementWayEnum.java
===================================================================
--- trunk/lima-callao/src/main/java/org/chorem/lima/FinancialStatementWayEnum.java 2010-08-18 14:47:44 UTC (rev 3006)
+++ trunk/lima-callao/src/main/java/org/chorem/lima/FinancialStatementWayEnum.java 2010-08-19 21:13:17 UTC (rev 3007)
@@ -1,7 +1,43 @@
package org.chorem.lima;
+import static org.nuiton.i18n.I18n._;
+
public enum FinancialStatementWayEnum {
- BOTH, DEBIT, CREDIT;
+ BOTH(_("lima.enum.comboboxamount.both")),
+ DEBIT(_("lima.enum.comboboxamount.debit")),
+ CREDIT(_("lima.enum.comboboxamount.credit"));
+ private final String description;
+
+ private FinancialStatementWayEnum(String description) {
+ this.description = description;
+ }
+
+ public String getDescription() {
+ return this.description;
+ }
+
+ public static String[] descriptions(){
+ int nbElts = FinancialStatementWayEnum.values().length;
+ String[] descriptions = new String[nbElts];
+ FinancialStatementWayEnum[] enums = FinancialStatementWayEnum.values();
+ for (int i = 0; i < nbElts; i++) {
+ descriptions[i] = enums[i].getDescription();
+ }
+ return descriptions;
+ }
+
+ public static FinancialStatementWayEnum valueOfDescription(String description){
+ FinancialStatementWayEnum value = null;
+
+ for (FinancialStatementWayEnum enums : FinancialStatementWayEnum.values()) {
+ if (description.equals(enums.description)){
+ value = enums;
+ break;
+ }
+ }
+ return value;
+ }
+
}
Modified: trunk/lima-callao/src/main/java/org/chorem/lima/entity/AccountDAOImpl.java
===================================================================
--- trunk/lima-callao/src/main/java/org/chorem/lima/entity/AccountDAOImpl.java 2010-08-18 14:47:44 UTC (rev 3006)
+++ trunk/lima-callao/src/main/java/org/chorem/lima/entity/AccountDAOImpl.java 2010-08-19 21:13:17 UTC (rev 3007)
@@ -18,9 +18,14 @@
package org.chorem.lima.entity;
+import java.util.ArrayList;
+import java.util.HashSet;
import java.util.List;
+import java.util.StringTokenizer;
+import org.apache.commons.lang.StringUtils;
import org.nuiton.topia.TopiaException;
import org.nuiton.topia.framework.TopiaQuery;
+import org.nuiton.topia.framework.TopiaQuery.Op;
public class AccountDAOImpl <E extends Account> extends AccountDAOAbstract<E> {
@@ -34,11 +39,113 @@
String subAccountsProperty = TopiaQuery.getProperty(Account.SUB_ACCOUNTS);
query.addWhere("not exists elements ("+subAccountsProperty+")")
.addOrder(Account.ACCOUNT_NUMBER);
-
return (List<Account>) findAllByQuery(query);
}
+
+ /**
+ * Convert string of extends number to list of accounts
+ * Example '22, 45..48, 67' -> [22, 45, 46, 47, 48, 67]
+ * SubAccountsMode return list of existing subaccounts ex 6 return : 61, 62, .., 69, 610, .., 619 etc
+ */
@Override
+ public List<Account> stringToListAccounts(String selectedAccounts,
+ Boolean subAccountsMode) throws TopiaException {
+ List<Account> accounts = new ArrayList<Account>();
+ if (selectedAccounts != null){
+ //Remove Spaces
+ selectedAccounts = StringUtils.deleteWhitespace(selectedAccounts);
+ //use hashset for delete duplicate numbers
+ HashSet<String> accountNumbers = new HashSet<String>();
+ HashSet<String> accountNumbersToRemove = new HashSet<String>();
+ Boolean first = true;
+ StringTokenizer stStar = new StringTokenizer(selectedAccounts, "-");
+ while (stStar.hasMoreTokens()) {
+ String subString = stStar.nextToken();
+
+ //Split comma
+ StringTokenizer stComma = new StringTokenizer(subString, ",");
+ while (stComma.hasMoreTokens()) {
+ String s = stComma.nextToken();
+ if (s.contains("..") && !s.endsWith("..")){
+ //Split ..
+ String stringDoubleDot[] = s.split("\\.\\.");
+ int lowAccount = Integer.parseInt(stringDoubleDot[0]);
+ int highAccount = Integer.parseInt(stringDoubleDot[1]);
+
+ //prevent to much result, can't let intervall superior to 1000
+ if (highAccount - lowAccount <= 10000){
+ for (int i=lowAccount; i <= highAccount; i++) {
+ //if first add accounts, else remove
+ if (first){
+ accountNumbers.add(String.valueOf(i));
+ }
+ else {
+ accountNumbersToRemove.add(String.valueOf(i));
+ }
+ }
+ }
+ }
+ else{
+ //if first
+ if (first){
+ accountNumbers.add(s);
+ }
+ else {
+ accountNumbersToRemove.add(s);
+ }
+ }
+ }
+ first=false;
+ }
+ //add all accounts
+ for (String accountNumber : accountNumbers) {
+ Account account = null;
+ if (subAccountsMode){
+ account = findSubAccountByNumber(accountNumber);
+ }
+ else {
+ account = findByAccountNumber(accountNumber);
+
+ }
+ //add account if exist
+ if (account != null){
+ accounts.add(account);
+ }
+ //search all account start with accountnumber
+ else {
+ TopiaQuery query = createQuery();
+ String subAccountsProperty = TopiaQuery.getProperty(Account.SUB_ACCOUNTS);
+ //String subLedgersProperty = TopiaQuery.getProperty(Account.SUB_LEDGERS);
+ query.addWhere("not exists elements ("+subAccountsProperty+")")
+ //.addWhere("not exists elements ("+subLedgersProperty+")")
+ .addWhere(Account.ACCOUNT_NUMBER, Op.LIKE, accountNumber+"%");
+ List<Account> accountsResult = (List<Account>) findAllByQuery(query);
+ if (accountsResult != null){
+ accounts.addAll(accountsResult);
+ }
+ }
+ }
+ //remove all accounts
+ for (String accountNumber : accountNumbersToRemove) {
+ Account account = null;
+ if (subAccountsMode){
+ account = findSubAccountByNumber(accountNumber);
+ }
+ else {
+ account = findByAccountNumber(accountNumber);
+ }
+ if (account != null) {
+ accounts.remove(account);
+ }
+ }
+ }
+ return accounts;
+ }
+
+
+
+ @Override
public Account findSubAccountByNumber(String number) throws TopiaException {
TopiaQuery query = createQuery();
String subAccountsProperty = TopiaQuery.getProperty(Account.SUB_ACCOUNTS);
Modified: trunk/lima-callao/src/main/xmi/accounting.zargo
===================================================================
(Binary files differ)
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/enums/ComboBoxAccountsEnum.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/enums/ComboBoxAccountsEnum.java 2010-08-18 14:47:44 UTC (rev 3006)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/enums/ComboBoxAccountsEnum.java 2010-08-19 21:13:17 UTC (rev 3007)
@@ -23,6 +23,7 @@
public enum ComboBoxAccountsEnum {
+ ALL(_("lima.enum.comboboxaccount.allaccount")),
ACCOUNT(_("lima.enum.comboboxaccount.account")),
ACCOUNT_LIST(_("lima.enum.comboboxaccount.accountlist"));
Deleted: trunk/lima-swing/src/main/java/org/chorem/lima/enums/ComboBoxAmountEnum.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/enums/ComboBoxAmountEnum.java 2010-08-18 14:47:44 UTC (rev 3006)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/enums/ComboBoxAmountEnum.java 2010-08-19 21:13:17 UTC (rev 3007)
@@ -1,61 +0,0 @@
-/* *##% Lima Swing
- * Copyright (C) 2008 - 2010 CodeLutin
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * 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, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- * ##%*/
-
-package org.chorem.lima.enums;
-
-import static org.nuiton.i18n.I18n._;
-
-
-public enum ComboBoxAmountEnum {
-
- BOTH(_("lima.enum.comboboxamount.both")),
- DEBIT(_("lima.enum.comboboxamount.debit")),
- CREDIT(_("lima.enum.comboboxamount.credit"));
-
- private final String description;
-
- private ComboBoxAmountEnum(String description) {
- this.description = description;
- }
-
- public String getDescription() {
- return this.description;
- }
-
- public static String[] descriptions(){
- int nbElts = ComboBoxAmountEnum.values().length;
- String[] descriptions = new String[nbElts];
- ComboBoxAmountEnum[] enums = ComboBoxAmountEnum.values();
- for (int i = 0; i < nbElts; i++) {
- descriptions[i] = enums[i].getDescription();
- }
- return descriptions;
- }
-
- public static ComboBoxAmountEnum valueOfDescription(String description){
- ComboBoxAmountEnum value = null;
-
- for (ComboBoxAmountEnum enums : ComboBoxAmountEnum.values()) {
- if (description.equals(enums.description)){
- value = enums;
- break;
- }
- }
- return value;
- }
-}
Added: trunk/lima-swing/src/main/java/org/chorem/lima/enums/ComboBoxEntryBooksEnum.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/enums/ComboBoxEntryBooksEnum.java (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/enums/ComboBoxEntryBooksEnum.java 2010-08-19 21:13:17 UTC (rev 3007)
@@ -0,0 +1,60 @@
+/* *##% Lima Swing
+ * Copyright (C) 2008 - 2010 CodeLutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * ##%*/
+
+package org.chorem.lima.enums;
+
+import static org.nuiton.i18n.I18n._;
+
+
+public enum ComboBoxEntryBooksEnum {
+
+ ALL(_("lima.enum.comboboxentrybook.all")),
+ SELECT_ONE(_("lima.enum.comboboxentrybook.select_one"));
+
+ private final String description;
+
+ private ComboBoxEntryBooksEnum(String description) {
+ this.description = description;
+ }
+
+ public String getDescription() {
+ return this.description;
+ }
+
+ public static String[] descriptions(){
+ int nbElts = ComboBoxEntryBooksEnum.values().length;
+ String[] descriptions = new String[nbElts];
+ ComboBoxEntryBooksEnum[] enums = ComboBoxEntryBooksEnum.values();
+ for (int i = 0; i < nbElts; i++) {
+ descriptions[i] = enums[i].getDescription();
+ }
+ return descriptions;
+ }
+
+ public static ComboBoxEntryBooksEnum valueOfDescription(String description){
+ ComboBoxEntryBooksEnum value = null;
+
+ for (ComboBoxEntryBooksEnum enums : ComboBoxEntryBooksEnum.values()) {
+ if (description.equals(enums.description)){
+ value = enums;
+ break;
+ }
+ }
+ return value;
+ }
+}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/enums/ComboBoxOperatorsEnum.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/enums/ComboBoxOperatorsEnum.java 2010-08-18 14:47:44 UTC (rev 3006)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/enums/ComboBoxOperatorsEnum.java 2010-08-19 21:13:17 UTC (rev 3007)
@@ -23,20 +23,30 @@
public enum ComboBoxOperatorsEnum {
- EQUAL(_("lima.enum.comboboxoperator.equal")),
- SUPERIOR(_("lima.enum.comboboxoperator.superior")),
- INFERIOR(_("lima.enum.comboboxoperator.inferior"));;
+ EQUAL(_("lima.enum.comboboxoperator.equal"), "="),
+ SUPERIOR_OR_EQUAL(_("lima.enum.comboboxoperator.superiororequal"), ">="),
+ INFERIOR_OR_EQUAL(_("lima.enum.comboboxoperator.inferiororequal"), "<="),
+ SUPERIOR(_("lima.enum.comboboxoperator.superior"), ">"),
+ INFERIOR(_("lima.enum.comboboxoperator.inferior"), "<"),
+ INTERVAL(_("lima.enum.comboboxoperator.interval"), ""),
+ NOT_EQUAL(_("lima.enum.comboboxoperator.notequal"),"!=");
private final String description;
+ private final String symbol;
- private ComboBoxOperatorsEnum(String description) {
+ private ComboBoxOperatorsEnum(String description, String symbol) {
this.description = description;
+ this.symbol = symbol;
}
public String getDescription() {
- return this.description;
+ return this.description;
}
+ public String getSymbol(){
+ return this.symbol;
+ }
+
public static String[] descriptions(){
int nbElts = ComboBoxOperatorsEnum.values().length;
String[] descriptions = new String[nbElts];
@@ -46,6 +56,7 @@
}
return descriptions;
}
+
public static ComboBoxOperatorsEnum valueOfDescription(String description){
ComboBoxOperatorsEnum value = null;
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/enums/ComboBoxPeriodEnum.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/enums/ComboBoxPeriodEnum.java 2010-08-18 14:47:44 UTC (rev 3006)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/enums/ComboBoxPeriodEnum.java 2010-08-19 21:13:17 UTC (rev 3007)
@@ -23,8 +23,8 @@
public enum ComboBoxPeriodEnum {
+ PERIOD(_("lima.enum.comboboxperiod.period")),
DATE(_("lima.enum.comboboxperiod.date")),
- PERIOD(_("lima.enum.comboboxperiod.period")),
FISCAL_PERIOD(_("lima.enum.comboboxperiod.fiscalperiod")),
FINANCIAL_PERIOD(_("lima.enum.comboboxperiod.financialperiod"));
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/EntryBookComboBoxModel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/EntryBookComboBoxModel.java 2010-08-18 14:47:44 UTC (rev 3006)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/EntryBookComboBoxModel.java 2010-08-19 21:13:17 UTC (rev 3007)
@@ -100,6 +100,7 @@
return result;
}
+
public void refresh(){
cacheDatas = getDataList();
fireContentsChanged(this, 0, cacheDatas.size());
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/AccountSearchComboBox.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/AccountSearchComboBox.java 2010-08-18 14:47:44 UTC (rev 3006)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/AccountSearchComboBox.java 2010-08-19 21:13:17 UTC (rev 3007)
@@ -58,7 +58,8 @@
public void actionPerformed(ActionEvent e) {
Object object = this.getSelectedItem();
if (object instanceof Account){
- //handler.setAccount((Account) this.getSelectedItem());
+ handler.setAccount((Account) this.getSelectedItem());
+ handler.refresh();
}
}
@@ -72,7 +73,13 @@
public void keyReleased(KeyEvent e) {
Object object = this.getSelectedItem();
if (object instanceof Account){
- //handler.setAccount((Account) this.getSelectedItem());
+ Account account = (Account) this.getSelectedItem();
+ //to prevent useless call to service
+ if (!account.equals(handler.getAccount())){
+ handler.setAccount(account);
+ handler.refresh();
+ }
+
}
// delegate popup list menu
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/AccountSearchPanel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/AccountSearchPanel.java 2010-08-18 14:47:44 UTC (rev 3006)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/AccountSearchPanel.java 2010-08-19 21:13:17 UTC (rev 3007)
@@ -18,8 +18,11 @@
package org.chorem.lima.ui.financialtransactionsearch;
+import java.awt.event.KeyEvent;
+import java.awt.event.KeyListener;
import javax.swing.JPanel;
import javax.swing.JTextField;
+import org.chorem.lima.entity.Account;
import org.chorem.lima.enums.ComboBoxAccountsEnum;
public class AccountSearchPanel extends JPanel {
@@ -28,7 +31,6 @@
public AccountSearchPanel(FinancialTransactionSearchViewHandler handler) {
this.handler = handler;
- refresh(ComboBoxAccountsEnum.ACCOUNT);
}
static final long serialVersionUID = 1L;
@@ -36,14 +38,46 @@
public void refresh(ComboBoxAccountsEnum comboBoxAccountsEnum){
switch (comboBoxAccountsEnum) {
+ case ALL:
+ handler.setAccount(null);
+ handler.refresh();
+ this.removeAll();
+ break;
+
case ACCOUNT:
- AccountSearchComboBox accountComboBox = new AccountSearchComboBox(handler);
+ final AccountSearchComboBox accountComboBox = new AccountSearchComboBox(handler);
+ handler.setAccount((Account) accountComboBox.getSelectedItem());
+ handler.refresh();
this.removeAll();
this.add(accountComboBox);
break;
case ACCOUNT_LIST:
- JTextField accountsList = new JTextField(16);
+ final JTextField accountsList = new JTextField(16);
+ KeyListener accountsListKeyListener = new KeyListener() {
+
+ @Override
+ public void keyTyped(KeyEvent e) {
+ }
+
+ @Override
+ public void keyReleased(KeyEvent e) {
+ String accounts = accountsList.getText();
+ //to prevent useless call to service
+ if (!accounts.equals(handler.getAccountsList())){
+ handler.setAccountsList(accounts);
+ handler.refresh();
+ }
+ }
+
+ @Override
+ public void keyPressed(KeyEvent e) {
+ }
+ };
+ accountsList.addKeyListener(accountsListKeyListener);
+ handler.setAccountsList(accountsList.getText());
+ handler.setAccount(null);
+ handler.refresh();
this.removeAll();
this.add(accountsList);
break;
Added: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/AmountSearchPanel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/AmountSearchPanel.java (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/AmountSearchPanel.java 2010-08-19 21:13:17 UTC (rev 3007)
@@ -0,0 +1,101 @@
+/* *##% Lima Swing
+ * Copyright (C) 2008 - 2010 CodeLutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * ##%*/
+
+package org.chorem.lima.ui.financialtransactionsearch;
+
+import java.awt.event.KeyEvent;
+import java.awt.event.KeyListener;
+import javax.swing.JPanel;
+import javax.swing.JTextField;
+import org.chorem.lima.enums.ComboBoxOperatorsEnum;
+
+public class AmountSearchPanel extends JPanel {
+
+ protected FinancialTransactionSearchViewHandler handler;
+
+ public AmountSearchPanel(FinancialTransactionSearchViewHandler handler) {
+ this.handler = handler;
+ refresh(ComboBoxOperatorsEnum.EQUAL);
+ }
+
+ static final long serialVersionUID = 1L;
+
+ public void refresh(ComboBoxOperatorsEnum enums){
+
+ final JTextField amountTextField = new JTextField(16);
+ KeyListener amountKeyListener = new KeyListener() {
+
+ @Override
+ public void keyTyped(KeyEvent e) {
+ }
+
+ @Override
+ public void keyReleased(KeyEvent e) {
+ String amount = amountTextField.getText();
+ //to prevent useless call to service
+ if (!amount.equals(handler.getAmount())){
+ handler.setAmount(amount);
+ handler.refresh();
+ }
+ }
+
+ @Override
+ public void keyPressed(KeyEvent e) {
+ }
+ };
+ amountTextField.addKeyListener(amountKeyListener);
+ handler.setAmount2("");
+ handler.setOperator(enums.getSymbol());
+ this.removeAll();
+ this.add(amountTextField);
+
+ switch (enums) {
+ case INTERVAL:
+ final JTextField amount2TextField = new JTextField(16);
+ KeyListener amount2KeyListener = new KeyListener() {
+
+ @Override
+ public void keyTyped(KeyEvent e) {
+ }
+
+ @Override
+ public void keyReleased(KeyEvent e) {
+
+ String amount2 = amount2TextField.getText();
+ //to prevent useless call to service
+ if (!amount2.equals(handler.getAmount2())){
+ handler.setAmount2(amount2);
+ handler.refresh();
+ }
+ }
+
+ @Override
+ public void keyPressed(KeyEvent e) {
+ }
+ };
+ amount2TextField.addKeyListener(amount2KeyListener);
+ handler.setAmount("");
+ this.add(amount2TextField);
+ break;
+ }
+ amountTextField.setText(handler.getAmount());
+ handler.refresh();
+
+ }
+
+}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/EntryBookSearchComboBox.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/EntryBookSearchComboBox.java 2010-08-18 14:47:44 UTC (rev 3006)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/EntryBookSearchComboBox.java 2010-08-19 21:13:17 UTC (rev 3007)
@@ -58,7 +58,8 @@
public void actionPerformed(ActionEvent e) {
Object object = this.getSelectedItem();
if (object instanceof EntryBook){
- //handler.setEntryBook((EntryBook) this.getSelectedItem());
+ handler.setEntryBook((EntryBook) this.getSelectedItem());
+ handler.refresh();
}
}
@@ -72,7 +73,8 @@
public void keyReleased(KeyEvent e) {
Object object = this.getSelectedItem();
if (object instanceof EntryBook){
- //handler.setEntryBook((EntryBook) this.getSelectedItem());
+ handler.setEntryBook((EntryBook) this.getSelectedItem());
+ handler.refresh();
}
// delegate popup list menu
if ( e.getKeyChar() == KeyEvent.VK_ENTER )
Added: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/EntryBookSearchPanel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/EntryBookSearchPanel.java (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/EntryBookSearchPanel.java 2010-08-19 21:13:17 UTC (rev 3007)
@@ -0,0 +1,54 @@
+/* *##% Lima Swing
+ * Copyright (C) 2008 - 2010 CodeLutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * ##%*/
+
+package org.chorem.lima.ui.financialtransactionsearch;
+
+import javax.swing.JPanel;
+import org.chorem.lima.enums.ComboBoxEntryBooksEnum;
+
+public class EntryBookSearchPanel extends JPanel {
+
+ protected FinancialTransactionSearchViewHandler handler;
+
+ public EntryBookSearchPanel(FinancialTransactionSearchViewHandler handler) {
+ this.handler = handler;
+ }
+
+ static final long serialVersionUID = 1L;
+
+ public void refresh(ComboBoxEntryBooksEnum enums){
+
+ switch (enums) {
+ case SELECT_ONE:
+ EntryBookSearchComboBox entryBookSearchComboBox = new EntryBookSearchComboBox(handler);
+ handler.setEntryBook(null);
+ handler.refresh();
+ this.removeAll();
+ this.add(entryBookSearchComboBox);
+ break;
+
+ case ALL:
+ handler.setEntryBook(null);
+ handler.refresh();
+ this.removeAll();
+ break;
+ }
+
+ }
+
+}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchTable.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchTable.java 2010-08-18 14:47:44 UTC (rev 3006)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchTable.java 2010-08-19 21:13:17 UTC (rev 3007)
@@ -42,7 +42,7 @@
* @author ore
* @author Rémi Chapelet
*/
-public class FinancialTransactionSearchTable extends JXTable implements KeyListener {
+public class FinancialTransactionSearchTable extends JXTable {
/** serialVersionUID. */
private static final long serialVersionUID = 3133690382049594727L;
@@ -58,8 +58,6 @@
public FinancialTransactionSearchTable(FinancialTransactionSearchViewHandler handler) {
this.handler = handler;
-
- addKeyListener(this);
//Get new date editor
setDefaultEditor(Date.class, new DateTableCellEditor());
@@ -126,29 +124,4 @@
new ColorHighlighter(predicate, new Color(255, 198, 209), null);
addHighlighter(colorTransaction);
}
-
- /**
- * for each action combination key are think
- * for extend keyboard and laptop keyboard
- */
- @Override
- public void keyPressed(KeyEvent e) {
-
- }
-
- /*
- * @see java.awt.event.KeyListener#keyTyped(java.awt.event.KeyEvent)
- */
- @Override
- public void keyTyped(KeyEvent e) {
-
- }
-
- /*
- * @see java.awt.event.KeyListener#keyReleased(java.awt.event.KeyEvent)
- */
- @Override
- public void keyReleased(KeyEvent e) {
-
- }
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchTableModel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchTableModel.java 2010-08-18 14:47:44 UTC (rev 3006)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchTableModel.java 2010-08-19 21:13:17 UTC (rev 3007)
@@ -66,63 +66,13 @@
private static final Log log = LogFactory
.getLog(FinancialTransactionSearchTableModel.class);
- /** Transaction service. */
- protected final FinancialTransactionService financialTransactionService;
- /** selected financial period */
- protected FiscalPeriod selectedFiscalPeriod;
-
/** data cache */
- protected List<Object> cacheDataList;
-
- /** collection
+ protected List<Entry> cacheDataList;
- /**
- * Model constructor.
- *
- * Just init service proxies.
- */
- public FinancialTransactionSearchTableModel() {
- /* Services */
- financialTransactionService =
- LimaServiceFactory.getInstance().getService(
- FinancialTransactionServiceMonitorable.class);
- }
-
- /**
- * Le model est une combinaison de Transaction/Entries.
- *
- *
- * @return
- */
- protected List<Object> getDataList() {
- List<Object> results = new ArrayList<Object>();
- if(selectedFiscalPeriod != null){
- try {
- Set<FinancialTransaction> financialtransactions =
- financialTransactionService.getAllInexactFinancialTransactions(selectedFiscalPeriod);
- for (FinancialTransaction financialtransaction : financialtransactions) {
- results.add(financialtransaction);
- List<Entry> entries = (List<Entry>) financialtransaction.getEntry();
- Collections.sort(entries, new EntryComparator());
- results.addAll(entries);
- }
- }
- catch (LimaException eee) {
- if (log.isErrorEnabled()) {
- log.debug("Can't update model", eee);
- }
-
- ErrorHelper.showErrorDialog("Can't get transaction list", eee);
- }
- }
-
- return results;
- }
-
- public void refresh(){
- cacheDataList = getDataList();
+ public void refresh(List<Entry> objects){
+ cacheDataList = objects;
fireTableDataChanged();
}
@@ -224,79 +174,45 @@
// just prevent too much result
if (cacheDataList != null) {
- result = cacheDataList.get(row);
-
- if (result instanceof FinancialTransaction) {
- FinancialTransaction currentRow = (FinancialTransaction)result;
- BigDecimal amountDebit = currentRow.getAmountDebit();
- BigDecimal amountCredit = currentRow.getAmountCredit();
-
+ Entry currentRow = cacheDataList.get(row);
+
switch (column) {
case 0:
- result = currentRow.getTransactionDate();
+ result = currentRow.getFinancialTransaction().getTransactionDate();
break;
case 1:
- if (currentRow.getEntryBook() != null){
- result = currentRow.getEntryBook().getCode();
+ EntryBook entryBook =
+ currentRow.getFinancialTransaction().getEntryBook();
+ if (entryBook != null){
+ result = entryBook.getCode();
}
else {
result = null;
}
break;
case 2:
- result = null; //entrybook
+ result = currentRow.getVoucher();
break;
- case 3:
- result = null; // account
- break;
- case 4:
- result = null; // description
- break;
- case 5 :
- result = null; // position
- break;
- case 6:
- result = amountDebit;
- break;
- case 7:
- result = amountCredit;
- break;
- case 8:
- result = amountDebit.subtract(amountCredit);
- break;
- }
- }
- else if (result instanceof Entry) {
- Entry currentEntry = (Entry)result;
- switch (column) {
- case 0:
- result = null; // date
- break;
- case 1 : // entry book
- result = null;
- break;
- case 2:
- result = currentEntry.getVoucher();
- break;
case 3: // account
- if (currentEntry.getAccount() != null){
- result = currentEntry.getAccount().getAccountNumber();
+ Account account = currentRow.getAccount();
+ if (account != null){
+ result = account.getAccountNumber();
}
else {
result = null;
}
break;
case 4:
- result = currentEntry.getDescription();
+ result = currentRow.getDescription();
break;
case 5 :
- result = currentEntry.getPosition();
+ result = currentRow.getPosition();
break;
case 6:
- result = currentEntry.getDebit() ? currentEntry.getAmount() : 0;
+ result = currentRow.getDebit() ? currentRow.getAmount() : 0;
break;
case 7:
- result = currentEntry.getDebit() ? 0 : currentEntry.getAmount();
+ result = currentRow.getDebit() ? 0 : currentRow.getAmount();
break;
case 8:
result = null; // balance
@@ -304,14 +220,10 @@
}
}
- }
return result;
}
- public void setFiscalPeriod(FiscalPeriod fiscalPeriod){
- selectedFiscalPeriod = fiscalPeriod;
- }
/**
* To set cells editable or not
@@ -333,33 +245,9 @@
}
- /**
- * @throws LimaException
- */
- public void addEmptyEntry(Object value, int row) throws LimaException {
- FinancialTransaction currentTransaction = null;
- Object currentRow = cacheDataList.get(row);
- Entry entry = new EntryImpl();
- entry.setAmount(new BigDecimal(0));
- //check if current row is a transaction or an entry
- if (currentRow instanceof FinancialTransaction) {
- currentTransaction = (FinancialTransaction)currentRow;
- }
- else if (currentRow instanceof Entry) {
- Entry currentEntry = (Entry)currentRow;
- //get back the parent transaction of the entry
- currentTransaction = currentEntry.getFinancialTransaction();
- }
- //create it
- entry.setFinancialTransaction(currentTransaction);
- financialTransactionService.createEntry(entry);
- //on recharge la liste
- refresh();
- }
-
- /**
+ /* /**
* to modifiy financialtransaction or entry
- */
+ *
@Override
public void setValueAt(Object value, int row, int column) {
int financialTransactionRow=0;
@@ -433,35 +321,12 @@
//TODO PEPIN 20100607 Get financial transaction of cachedatelist on replace it
fireTableRowsUpdated(financialTransactionRow, getRowCount()-1);
}
- }
+ }*/
public Object getElementAt(int row){
Object currentRow = cacheDataList.get(row);
return currentRow;
}
-
-
- /**
- * Delete selected row in table (could be transaction or entry).
- *
- * Called by model.
- * @param Object, int
- * @throws LimaException
- */
- public void removeObject(Object object, int row) throws LimaException {
- Object currentRow = cacheDataList.get(row);
- if (currentRow instanceof FinancialTransaction) {
- FinancialTransaction currentTransaction =
- (FinancialTransaction)currentRow;
- financialTransactionService.removeFinancialTransaction(currentTransaction);
- }
- else if (currentRow instanceof Entry) {
- Entry currentEntry = (Entry)currentRow;
- financialTransactionService.removeEntry(currentEntry);
- }
- //on recharge la liste
- refresh();
- }
}
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 2010-08-18 14:47:44 UTC (rev 3006)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchView.jaxx 2010-08-19 21:13:17 UTC (rev 3007)
@@ -22,13 +22,21 @@
<![CDATA[
import org.chorem.lima.enums.ComboBoxPeriodEnum;
import org.chorem.lima.enums.ComboBoxAccountsEnum;
- import org.chorem.lima.enums.ComboBoxAmountEnum;
+ import org.chorem.lima.enums.ComboBoxEntryBooksEnum;
+ import org.chorem.lima.FinancialStatementWayEnum;
import org.chorem.lima.enums.ComboBoxOperatorsEnum;
AccountSearchPanel accountSearchPanel = new AccountSearchPanel(handler);
+ AmountSearchPanel amountSearchPanel = new AmountSearchPanel(handler);
+ EntryBookSearchPanel entryBookSearchPanel = new EntryBookSearchPanel(handler);
PeriodSearchPanel periodSearchPanel = new PeriodSearchPanel(handler);
void $afterCompleteSetup() {
+ handler.init();
+ handler.setAmountWayEnum(FinancialStatementWayEnum.valueOfDescription(
+ (String) getAmountComboBox().getSelectedItem()));
+ handler.setOperator(ComboBoxOperatorsEnum.valueOfDescription(
+ (String) getOperatorComboBox().getSelectedItem()).getSymbol());
}
]]>
@@ -58,16 +66,22 @@
onActionPerformed="accountSearchPanel.refresh(ComboBoxAccountsEnum.valueOfDescription((String) accountComboBox.getSelectedItem()));
validate(); repaint()"/></cell>
<cell><AccountSearchPanel javaBean="accountSearchPanel"/></cell>
- <cell anchor='east'><JLabel text="lima.table.entrybook"/></cell>
- <cell anchor='west'><EntryBookSearchComboBox javaBean="new EntryBookSearchComboBox(handler)"/></cell>
+ <cell><JComboBox id="entryBookComboBox" javaBean="new JComboBox(ComboBoxEntryBooksEnum.descriptions())"
+ onActionPerformed="entryBookSearchPanel.refresh(ComboBoxEntryBooksEnum.valueOfDescription((String) entryBookComboBox.getSelectedItem()));
+ validate(); repaint()"/></cell>
+ <cell><EntryBookSearchPanel javaBean="entryBookSearchPanel"/></cell>
</row></Table></cell>
</row>
<row>
<cell><Table><row>
<cell><JLabel text="lima.amount"/></cell>
- <cell><JComboBox id="amountComboBox" javaBean="new JComboBox(ComboBoxAmountEnum.descriptions())"/></cell>
- <cell><JComboBox id="operatorComboBox" javaBean="new JComboBox(ComboBoxOperatorsEnum.descriptions())"/></cell>
- <cell><JTextField id='amount'/></cell>
+ <cell><JComboBox id="amountComboBox" javaBean="new JComboBox(FinancialStatementWayEnum.descriptions())"
+ onActionPerformed="handler.setAmountWayEnum(FinancialStatementWayEnum.valueOfDescription((String)amountComboBox.getSelectedItem()));
+ handler.refresh()"/></cell>
+ <cell><JComboBox id="operatorComboBox" javaBean="new JComboBox(ComboBoxOperatorsEnum.descriptions())"
+ onActionPerformed="amountSearchPanel.refresh(ComboBoxOperatorsEnum.valueOfDescription((String) operatorComboBox.getSelectedItem()));
+ validate(); repaint()"/></cell>
+ <cell><AmountSearchPanel javaBean="amountSearchPanel"/></cell>
</row></Table></cell>
</row>
<row>
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchViewHandler.java 2010-08-18 14:47:44 UTC (rev 3006)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchViewHandler.java 2010-08-19 21:13:17 UTC (rev 3007)
@@ -19,10 +19,23 @@
package org.chorem.lima.ui.financialtransactionsearch;
import static org.nuiton.i18n.I18n._;
-
+import java.awt.event.KeyEvent;
+import java.awt.event.KeyListener;
+import java.util.Date;
+import java.util.List;
+import javax.swing.JTextField;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.chorem.lima.FinancialStatementWayEnum;
+import org.chorem.lima.business.FinancialTransactionServiceMonitorable;
+import org.chorem.lima.business.LimaException;
+import org.chorem.lima.business.ejbinterface.FinancialTransactionService;
+import org.chorem.lima.entity.Account;
+import org.chorem.lima.entity.Entry;
+import org.chorem.lima.entity.EntryBook;
+import org.chorem.lima.service.LimaServiceFactory;
import org.chorem.lima.ui.combobox.FiscalPeriodComboBoxModel;
+import org.chorem.lima.util.ErrorHelper;
/**
* Handler associated with financial transaction view.
@@ -47,14 +60,225 @@
protected FiscalPeriodComboBoxModel comboBoxModel;
+ /** Transaction service. */
+ protected final FinancialTransactionService financialTransactionService;
+
+ protected Date beginDate;
+ protected Date endDate;
+ protected String voucher;
+ protected String description;
+ protected String letter;
+ protected String accountsList;
+ protected Account account;
+ protected EntryBook entryBook;
+ protected FinancialStatementWayEnum amountWayEnum;
+ protected String operator;
+ protected String amount;
+ protected String amount2;
+
protected FinancialTransactionSearchViewHandler(FinancialTransactionSearchView view) {
this.view = view;
+
+ /* Services */
+ financialTransactionService =
+ LimaServiceFactory.getInstance().getService(
+ FinancialTransactionServiceMonitorable.class);
+ }
+
+ public void init(){
+
+ final JTextField descriptionTextField = view.getDescription();
+ KeyListener descriptionKeyListener = new KeyListener() {
+
+ @Override
+ public void keyTyped(KeyEvent e) {
+ }
+
+ @Override
+ public void keyReleased(KeyEvent e) {
+ setDescription(descriptionTextField.getText());
+ refresh();
+ }
+
+ @Override
+ public void keyPressed(KeyEvent e) {
+ }
+ };
+ descriptionTextField.addKeyListener(descriptionKeyListener);
+
+ final JTextField letterTextField = view.getLetter();
+ KeyListener letterKeyListener = new KeyListener() {
+
+ @Override
+ public void keyTyped(KeyEvent e) {
+ }
+
+ @Override
+ public void keyReleased(KeyEvent e) {
+ //to prevent useless call to service
+ String letterNew = letterTextField.getText();
+ if (!letterNew.equals(letter)){
+ setLetter(letterNew);
+ refresh();
+ }
+ }
+
+ @Override
+ public void keyPressed(KeyEvent e) {
+ }
+ };
+ letterTextField.addKeyListener(letterKeyListener);
+
+ final JTextField voucherTextField = view.getVoucher();
+ KeyListener voucherKeyListener = new KeyListener() {
+
+ @Override
+ public void keyTyped(KeyEvent e) {
+ }
+
+ @Override
+ public void keyReleased(KeyEvent e) {
+ //to prevent useless call to service
+ String voucherNew = voucherTextField.getText();
+ if (!voucherNew.equals(voucher)){
+ setVoucher(voucherNew);
+ refresh();
+ }
+ }
+
+ @Override
+ public void keyPressed(KeyEvent e) {
+ }
+ };
+ voucherTextField.addKeyListener(voucherKeyListener);
+ }
+
+ public void setBeginDate(Date beginDate){
+ this.beginDate = beginDate;
+ log.debug(beginDate);
+ }
+
+ public void setEndDate(Date endDate){
+ this.endDate = endDate;
+ log.debug(endDate);
+ }
+
+ public void setVoucher(String voucher){
+ String result = null;
+ if (!voucher.equals("")){
+ result = voucher;
+ }
+ this.voucher=result;
+ }
+
+ public void setDescription(String description){
+ String result = null;
+ if (!description.equals("")){
+ result = description;
+ }
+ this.description=result;
+ }
+
+ public void setLetter(String letter){
+ String result = null;
+ if (!letter.equals("")){
+ result = letter;
+ }
+ this.letter=result;
+ }
+
+ public String getAccountsList(){
+ return this.accountsList;
+ }
+
+ public void setAccountsList(String accountsList){
+ String result = null;
+ if (!accountsList.equals("")){
+ result = accountsList;
+ }
+ this.accountsList=result;
+ }
+ public Account getAccount(){
+ return this.account;
}
+ public void setAccount(Account account){
+ this.account=account;
+ }
+
+ public void setEntryBook(EntryBook entryBook){
+ this.entryBook=entryBook;
+ }
+
+
+ public String getAmount(){
+ return this.amount;
+ }
+
+ public void setAmount(String amount){
+ String result = null;
+ if (!amount.equals("")){
+ result = amount;
+ }
+ this.amount=result;
+ }
+
+ public String getAmount2(){
+ return this.amount2;
+ }
+
+ public void setAmount2(String amount2){
+ String result = null;
+ if (!amount2.equals("")){
+ result = amount2;
+ }
+ this.amount2=result;
+ }
+
+ public void setAmountWayEnum(FinancialStatementWayEnum amountWayEnum){
+ this.amountWayEnum=amountWayEnum;
+ }
+
+ public void setOperator(String operator){
+ String result = null;
+ if (!operator.equals("")){
+ result = operator;
+ }
+ this.operator=result;
+ }
+
public void refresh(){
tableModel = view.getFinancialTransactionSearchTableModel();
- tableModel.refresh();
+ if (tableModel != null){
+ log.debug(voucher+" "
+ +description+" "+letter+" "+accountsList+" "
+ +account+" "+entryBook+" "+amount);
+ //prevent to much result
+ tableModel.refresh(getDataList());
+ }
}
+
+ protected List<Entry> getDataList() {
+ List<Entry> results = null;
+ if (voucher != null || description != null || letter != null ||
+ accountsList != null || account != null || entryBook != null ||
+ (amount != null && operator != null) || (amount != null && amount2 != null)){
+ try {
+ results = financialTransactionService.searchEntry(beginDate, endDate,
+ voucher, description, letter, accountsList, account,
+ entryBook, amountWayEnum, operator, amount, amount2);
+
+ }
+ catch (LimaException eee) {
+ if (log.isErrorEnabled()) {
+ log.debug("Can't update model", eee);
+ }
+ ErrorHelper.showErrorDialog("Can't get transaction list", eee);
+ }
+ }
+ return results;
+ }
+
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/PeriodSearchPanel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/PeriodSearchPanel.java 2010-08-18 14:47:44 UTC (rev 3006)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/PeriodSearchPanel.java 2010-08-19 21:13:17 UTC (rev 3007)
@@ -18,6 +18,8 @@
package org.chorem.lima.ui.financialtransactionsearch;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
import java.util.Calendar;
import java.util.Date;
import static org.nuiton.i18n.I18n._;
@@ -28,6 +30,8 @@
import org.apache.commons.lang.time.DateUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.chorem.lima.entity.FinancialPeriod;
+import org.chorem.lima.entity.FiscalPeriod;
import org.chorem.lima.enums.ComboBoxPeriodEnum;
import org.chorem.lima.ui.combobox.FinancialPeriodComboBoxModel;
import org.chorem.lima.ui.combobox.FinancialPeriodComboBoxRenderer;
@@ -44,7 +48,9 @@
public PeriodSearchPanel(FinancialTransactionSearchViewHandler handler) {
this.handler = handler;
- refresh(ComboBoxPeriodEnum.DATE);
+
+ //init date
+ refresh(ComboBoxPeriodEnum.PERIOD);
}
static final long serialVersionUID = 1L;
@@ -56,7 +62,18 @@
Calendar calendar = Calendar.getInstance();
Date date = calendar.getTime();
date = DateUtils.truncate(date, Calendar.DATE);
- JXDatePicker datePicker = new JXDatePicker(date);
+ final JXDatePicker datePicker = new JXDatePicker(date);
+ ActionListener dateActionListener = new ActionListener() {
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ handler.setBeginDate(datePicker.getDate());
+ handler.refresh();
+ }
+ };
+ handler.setBeginDate(datePicker.getDate());
+ handler.setEndDate(null);
+ handler.refresh();
+ datePicker.addActionListener(dateActionListener);
this.removeAll();
this.add(datePicker);
break;
@@ -74,9 +91,30 @@
Date endDate = calendarEnd.getTime();
//handler().setEndDate(endDate);
JLabel beginDateLabel = new JLabel(_("lima.period.begindate"));
- JXDatePicker beginDatePicker = new JXDatePicker(beginDate);
+ final JXDatePicker beginDatePicker = new JXDatePicker(beginDate);
+ ActionListener beginDateActionListener = new ActionListener() {
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ handler.setBeginDate(beginDatePicker.getDate());
+ handler.refresh();
+ }
+ };
+ handler.setBeginDate(beginDatePicker.getDate());
+ beginDatePicker.addActionListener(beginDateActionListener);
+
JLabel endDateLabel = new JLabel(_("lima.period.enddate"));
- JXDatePicker endDatePicker = new JXDatePicker(endDate);
+ final JXDatePicker endDatePicker = new JXDatePicker(endDate);
+ ActionListener endDateActionListener = new ActionListener() {
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ handler.setEndDate(endDatePicker.getDate());
+ handler.refresh();
+ }
+ };
+ handler.setEndDate(endDatePicker.getDate());
+ endDatePicker.addActionListener(endDateActionListener);
+ handler.refresh();
+
this.removeAll();
this.add(beginDateLabel);
this.add(beginDatePicker);
@@ -87,10 +125,20 @@
case FISCAL_PERIOD:
FiscalPeriodComboBoxModel fiscalModel = new FiscalPeriodComboBoxModel();
FiscalPeriodComboBoxRenderer fiscalRenderer = new FiscalPeriodComboBoxRenderer();
- JComboBox fiscalPeriod = new JComboBox(fiscalModel);
+ final JComboBox fiscalPeriod = new JComboBox(fiscalModel);
fiscalPeriod.setRenderer(fiscalRenderer);
fiscalPeriod.setEditable(false);
- //fiscalPeriod.actionPerformed(handler.);
+ ActionListener fiscalPeriodActionListener = new ActionListener() {
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ FiscalPeriod fPeriod = (FiscalPeriod) fiscalPeriod.getSelectedItem();
+ handler.setBeginDate(fPeriod.getBeginDate());
+ handler.setEndDate(fPeriod.getEndDate());
+ handler.refresh();
+ }
+ };
+ fiscalPeriod.addActionListener(fiscalPeriodActionListener);
+
this.removeAll();
this.add(fiscalPeriod);
break;
@@ -98,9 +146,19 @@
case FINANCIAL_PERIOD:
FinancialPeriodComboBoxModel financialModel = new FinancialPeriodComboBoxModel();
FinancialPeriodComboBoxRenderer financialRenderer = new FinancialPeriodComboBoxRenderer();
- JComboBox financialPeriod = new JComboBox(financialModel);
+ final JComboBox financialPeriod = new JComboBox(financialModel);
financialPeriod.setRenderer(financialRenderer);
financialPeriod.setEditable(false);
+ ActionListener financialPeriodActionListener = new ActionListener() {
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ FinancialPeriod fPeriod = (FinancialPeriod) financialPeriod.getSelectedItem();
+ handler.setBeginDate(fPeriod.getBeginDate());
+ handler.setEndDate(fPeriod.getEndDate());
+ handler.refresh();
+ }
+ };
+ financialPeriod.addActionListener(financialPeriodActionListener);
this.removeAll();
this.add(financialPeriod);
break;
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedTable.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedTable.java 2010-08-18 14:47:44 UTC (rev 3006)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedTable.java 2010-08-19 21:13:17 UTC (rev 3007)
@@ -157,6 +157,9 @@
* Ajoute une entrée comptable si tab est sur
* la dernière cellule.
*/
+
+ //TODO 2010-08-19 verifier si la transaction est équilibré
+ // cf. FinancialTransactionTable.java comme modèle
if (e.getKeyChar() == KeyEvent.VK_TAB) {
// Vérifie si la cellule sélectionnée est la dernière
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 2010-08-18 14:47:44 UTC (rev 3006)
+++ trunk/lima-swing/src/main/resources/i18n/lima-swing-en_GB.properties 2010-08-19 21:13:17 UTC (rev 3007)
@@ -93,12 +93,20 @@
lima.entrybook.type5=
lima.enum.comboboxaccount.account=
lima.enum.comboboxaccount.accountlist=
+lima.enum.comboboxaccount.allaccount=
lima.enum.comboboxamount.both=
lima.enum.comboboxamount.credit=
lima.enum.comboboxamount.debit=
+lima.enum.comboboxentrybook.all=
+lima.enum.comboboxentrybook.select_one=
lima.enum.comboboxoperator.equal=
lima.enum.comboboxoperator.inferior=
+lima.enum.comboboxoperator.inferiororequal=
+lima.enum.comboboxoperator.interval=
+lima.enum.comboboxoperator.intervalle=
+lima.enum.comboboxoperator.notequal=
lima.enum.comboboxoperator.superior=
+lima.enum.comboboxoperator.superiororequal=
lima.enum.comboboxperiod.date=
lima.enum.comboboxperiod.financialperiod=
lima.enum.comboboxperiod.fiscalperiod=
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 2010-08-18 14:47:44 UTC (rev 3006)
+++ trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties 2010-08-19 21:13:17 UTC (rev 3007)
@@ -87,13 +87,20 @@
lima.entrybook.type4=G\u00E9n\u00E9ral
lima.entrybook.type5=Situation
lima.enum.comboboxaccount.account=Compte
-lima.enum.comboboxaccount.accountlist=Liste de compte
+lima.enum.comboboxaccount.accountlist=Liste de comptes
+lima.enum.comboboxaccount.allaccount=Tous les comptes
lima.enum.comboboxamount.both=Les deux
lima.enum.comboboxamount.credit=Cr\u00E9dit
lima.enum.comboboxamount.debit=D\u00E9bit
+lima.enum.comboboxentrybook.all=Tous les journaux
+lima.enum.comboboxentrybook.select_one=Journal
lima.enum.comboboxoperator.equal=\u00C9gal
lima.enum.comboboxoperator.inferior=Inf\u00E9rieur
+lima.enum.comboboxoperator.inferiororequal=Inf\u00E9rieur ou \u00E9gal
+lima.enum.comboboxoperator.interval=Intervalle
+lima.enum.comboboxoperator.notequal=Diff\u00E9rent
lima.enum.comboboxoperator.superior=Sup\u00E9rieur
+lima.enum.comboboxoperator.superiororequal=Sup\u00E9rieur ou \u00E9gal
lima.enum.comboboxperiod.date=Date
lima.enum.comboboxperiod.financialperiod=P\u00E9riode Financi\u00E8re
lima.enum.comboboxperiod.fiscalperiod=Exercice
1
0
r3006 - in trunk/lima-swing/src/main: java/org/chorem/lima/enums java/org/chorem/lima/ui java/org/chorem/lima/ui/financialtransactionsearch java/org/chorem/lima/ui/opening resources/i18n
by jpepin@users.chorem.org 18 Aug '10
by jpepin@users.chorem.org 18 Aug '10
18 Aug '10
Author: jpepin
Date: 2010-08-18 16:47:44 +0200 (Wed, 18 Aug 2010)
New Revision: 3006
Url: http://chorem.org/repositories/revision/lima/3006
Log:
Ajout vue recherches d'?\195?\169critures.
Added:
trunk/lima-swing/src/main/java/org/chorem/lima/enums/ComboBoxAccountsEnum.java
trunk/lima-swing/src/main/java/org/chorem/lima/enums/ComboBoxAmountEnum.java
trunk/lima-swing/src/main/java/org/chorem/lima/enums/ComboBoxOperatorsEnum.java
trunk/lima-swing/src/main/java/org/chorem/lima/enums/ComboBoxPeriodEnum.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/AccountSearchComboBox.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/AccountSearchPanel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/EntryBookSearchComboBox.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchTable.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchTableModel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchViewHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/PeriodSearchPanel.java
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
trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/OpeningViewHandler.java
trunk/lima-swing/src/main/resources/i18n/lima-swing-en_GB.properties
trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties
Added: trunk/lima-swing/src/main/java/org/chorem/lima/enums/ComboBoxAccountsEnum.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/enums/ComboBoxAccountsEnum.java (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/enums/ComboBoxAccountsEnum.java 2010-08-18 14:47:44 UTC (rev 3006)
@@ -0,0 +1,60 @@
+/* *##% Lima Swing
+ * Copyright (C) 2008 - 2010 CodeLutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * ##%*/
+
+package org.chorem.lima.enums;
+
+import static org.nuiton.i18n.I18n._;
+
+
+public enum ComboBoxAccountsEnum {
+
+ ACCOUNT(_("lima.enum.comboboxaccount.account")),
+ ACCOUNT_LIST(_("lima.enum.comboboxaccount.accountlist"));
+
+ private final String description;
+
+ private ComboBoxAccountsEnum(String description) {
+ this.description = description;
+ }
+
+ public String getDescription() {
+ return this.description;
+ }
+
+ public static String[] descriptions(){
+ int nbElts = ComboBoxAccountsEnum.values().length;
+ String[] descriptions = new String[nbElts];
+ ComboBoxAccountsEnum[] enums = ComboBoxAccountsEnum.values();
+ for (int i = 0; i < nbElts; i++) {
+ descriptions[i] = enums[i].getDescription();
+ }
+ return descriptions;
+ }
+
+ public static ComboBoxAccountsEnum valueOfDescription(String description){
+ ComboBoxAccountsEnum value = null;
+
+ for (ComboBoxAccountsEnum enums : ComboBoxAccountsEnum.values()) {
+ if (description.equals(enums.description)){
+ value = enums;
+ break;
+ }
+ }
+ return value;
+ }
+}
Added: trunk/lima-swing/src/main/java/org/chorem/lima/enums/ComboBoxAmountEnum.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/enums/ComboBoxAmountEnum.java (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/enums/ComboBoxAmountEnum.java 2010-08-18 14:47:44 UTC (rev 3006)
@@ -0,0 +1,61 @@
+/* *##% Lima Swing
+ * Copyright (C) 2008 - 2010 CodeLutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * ##%*/
+
+package org.chorem.lima.enums;
+
+import static org.nuiton.i18n.I18n._;
+
+
+public enum ComboBoxAmountEnum {
+
+ BOTH(_("lima.enum.comboboxamount.both")),
+ DEBIT(_("lima.enum.comboboxamount.debit")),
+ CREDIT(_("lima.enum.comboboxamount.credit"));
+
+ private final String description;
+
+ private ComboBoxAmountEnum(String description) {
+ this.description = description;
+ }
+
+ public String getDescription() {
+ return this.description;
+ }
+
+ public static String[] descriptions(){
+ int nbElts = ComboBoxAmountEnum.values().length;
+ String[] descriptions = new String[nbElts];
+ ComboBoxAmountEnum[] enums = ComboBoxAmountEnum.values();
+ for (int i = 0; i < nbElts; i++) {
+ descriptions[i] = enums[i].getDescription();
+ }
+ return descriptions;
+ }
+
+ public static ComboBoxAmountEnum valueOfDescription(String description){
+ ComboBoxAmountEnum value = null;
+
+ for (ComboBoxAmountEnum enums : ComboBoxAmountEnum.values()) {
+ if (description.equals(enums.description)){
+ value = enums;
+ break;
+ }
+ }
+ return value;
+ }
+}
Added: trunk/lima-swing/src/main/java/org/chorem/lima/enums/ComboBoxOperatorsEnum.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/enums/ComboBoxOperatorsEnum.java (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/enums/ComboBoxOperatorsEnum.java 2010-08-18 14:47:44 UTC (rev 3006)
@@ -0,0 +1,61 @@
+/* *##% Lima Swing
+ * Copyright (C) 2008 - 2010 CodeLutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * ##%*/
+
+package org.chorem.lima.enums;
+
+import static org.nuiton.i18n.I18n._;
+
+
+public enum ComboBoxOperatorsEnum {
+
+ EQUAL(_("lima.enum.comboboxoperator.equal")),
+ SUPERIOR(_("lima.enum.comboboxoperator.superior")),
+ INFERIOR(_("lima.enum.comboboxoperator.inferior"));;
+
+ private final String description;
+
+ private ComboBoxOperatorsEnum(String description) {
+ this.description = description;
+ }
+
+ public String getDescription() {
+ return this.description;
+ }
+
+ public static String[] descriptions(){
+ int nbElts = ComboBoxOperatorsEnum.values().length;
+ String[] descriptions = new String[nbElts];
+ ComboBoxOperatorsEnum[] enums = ComboBoxOperatorsEnum.values();
+ for (int i = 0; i < nbElts; i++) {
+ descriptions[i] = enums[i].getDescription();
+ }
+ return descriptions;
+ }
+
+ public static ComboBoxOperatorsEnum valueOfDescription(String description){
+ ComboBoxOperatorsEnum value = null;
+
+ for (ComboBoxOperatorsEnum enums : ComboBoxOperatorsEnum.values()) {
+ if (description.equals(enums.description)){
+ value = enums;
+ break;
+ }
+ }
+ return value;
+ }
+}
Added: trunk/lima-swing/src/main/java/org/chorem/lima/enums/ComboBoxPeriodEnum.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/enums/ComboBoxPeriodEnum.java (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/enums/ComboBoxPeriodEnum.java 2010-08-18 14:47:44 UTC (rev 3006)
@@ -0,0 +1,62 @@
+/* *##% Lima Swing
+ * Copyright (C) 2008 - 2010 CodeLutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * ##%*/
+
+package org.chorem.lima.enums;
+
+import static org.nuiton.i18n.I18n._;
+
+
+public enum ComboBoxPeriodEnum {
+
+ DATE(_("lima.enum.comboboxperiod.date")),
+ PERIOD(_("lima.enum.comboboxperiod.period")),
+ FISCAL_PERIOD(_("lima.enum.comboboxperiod.fiscalperiod")),
+ FINANCIAL_PERIOD(_("lima.enum.comboboxperiod.financialperiod"));
+
+ private final String description;
+
+ private ComboBoxPeriodEnum(String description) {
+ this.description = description;
+ }
+
+ public String getDescription() {
+ return this.description;
+ }
+
+ public static String[] descriptions(){
+ int nbElts = ComboBoxPeriodEnum.values().length;
+ String[] descriptions = new String[nbElts];
+ ComboBoxPeriodEnum[] enums = ComboBoxPeriodEnum.values();
+ for (int i = 0; i < nbElts; i++) {
+ descriptions[i] = enums[i].getDescription();
+ }
+ return descriptions;
+ }
+
+ public static ComboBoxPeriodEnum valueOfDescription(String description){
+ ComboBoxPeriodEnum value = null;
+
+ for (ComboBoxPeriodEnum enums : ComboBoxPeriodEnum.values()) {
+ if (description.equals(enums.description)){
+ value = enums;
+ break;
+ }
+ }
+ return value;
+ }
+}
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 2010-08-17 15:34:26 UTC (rev 3005)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainView.jaxx 2010-08-18 14:47:44 UTC (rev 3006)
@@ -157,6 +157,8 @@
actionIcon='entries-balanced'/>
<JMenuItem text="lima.entries.searchunbalancedtransaction" onActionPerformed='getHandler().showTransactionUnbalancedView(this)'
actionIcon='entries-unbalanced'/>
+ <JMenuItem text="lima.entries.searchtransaction" onActionPerformed='getHandler().showTransactionSearchView(this)'
+ actionIcon='entries-search'/>
<JMenuItem text="lima.entries.lettering" onActionPerformed='getHandler().showLetteringView(this)'
actionIcon='lettering'/>
</JMenu>
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 2010-08-17 15:34:26 UTC (rev 3005)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainViewHandler.java 2010-08-18 14:47:44 UTC (rev 3006)
@@ -42,6 +42,7 @@
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;
import org.chorem.lima.ui.home.HomeView;
import org.chorem.lima.ui.identity.IdentityForm;
@@ -380,6 +381,12 @@
mainView.showTab(_("lima.entries.searchunbalancedtransaction"), searchResultView);
}
+ public void showTransactionSearchView(JAXXContext rootContext) {
+ MainView mainView = getUI(rootContext);
+ FinancialTransactionSearchView searchView = new FinancialTransactionSearchView(mainView);
+ mainView.showTab(_("lima.entries.searchtransaction"), searchView);
+ }
+
public void showBalanceView(JAXXContext rootContext) {
MainView mainView = getUI(rootContext);
BalanceView balanceView = new BalanceView(mainView);
Added: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/AccountSearchComboBox.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/AccountSearchComboBox.java (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/AccountSearchComboBox.java 2010-08-18 14:47:44 UTC (rev 3006)
@@ -0,0 +1,90 @@
+/* *##% Lima Swing
+ * Copyright (C) 2008 - 2010 CodeLutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * ##%*/
+
+package org.chorem.lima.ui.financialtransactionsearch;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.KeyEvent;
+import java.awt.event.KeyListener;
+import javax.swing.JComboBox;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.chorem.lima.entity.Account;
+import org.chorem.lima.ui.accountsreports.AccountRenderer;
+import org.chorem.lima.ui.combobox.AccountComboBoxModel;
+import org.chorem.lima.util.AccountToString;
+import org.jdesktop.swingx.autocomplete.AutoCompleteDecorator;
+
+public class AccountSearchComboBox extends JComboBox implements KeyListener, ActionListener {
+
+ private static final long serialVersionUID = 1L;
+
+ private static final Log log =
+ LogFactory.getLog(AccountSearchComboBox.class);
+
+ protected FinancialTransactionSearchViewHandler handler;
+
+ public AccountSearchComboBox(FinancialTransactionSearchViewHandler handler) {
+ this.handler = handler;
+ AccountComboBoxModel accountComboBoxModel = new AccountComboBoxModel();
+ AccountRenderer accountRenderer = new AccountRenderer();
+ setModel(accountComboBoxModel);
+ setRenderer(accountRenderer);
+ setEditable(true);
+ AutoCompleteDecorator.decorate(this, AccountToString.getInstance());
+ this.getEditor().getEditorComponent().addKeyListener(this);
+ this.addActionListener(this);
+ }
+
+
+
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ Object object = this.getSelectedItem();
+ if (object instanceof Account){
+ //handler.setAccount((Account) this.getSelectedItem());
+ }
+ }
+
+
+ @Override
+ public void keyPressed(KeyEvent e) {
+
+ }
+
+ @Override
+ public void keyReleased(KeyEvent e) {
+ Object object = this.getSelectedItem();
+ if (object instanceof Account){
+ //handler.setAccount((Account) this.getSelectedItem());
+ }
+
+ // delegate popup list menu
+ if ( e.getKeyChar() == KeyEvent.VK_ENTER )
+ {
+ firePopupMenuCanceled();
+ }
+ }
+
+ @Override
+ public void keyTyped(KeyEvent e) {
+
+ }
+
+}
Added: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/AccountSearchPanel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/AccountSearchPanel.java (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/AccountSearchPanel.java 2010-08-18 14:47:44 UTC (rev 3006)
@@ -0,0 +1,54 @@
+/* *##% Lima Swing
+ * Copyright (C) 2008 - 2010 CodeLutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * ##%*/
+
+package org.chorem.lima.ui.financialtransactionsearch;
+
+import javax.swing.JPanel;
+import javax.swing.JTextField;
+import org.chorem.lima.enums.ComboBoxAccountsEnum;
+
+public class AccountSearchPanel extends JPanel {
+
+ protected FinancialTransactionSearchViewHandler handler;
+
+ public AccountSearchPanel(FinancialTransactionSearchViewHandler handler) {
+ this.handler = handler;
+ refresh(ComboBoxAccountsEnum.ACCOUNT);
+ }
+
+ static final long serialVersionUID = 1L;
+
+ public void refresh(ComboBoxAccountsEnum comboBoxAccountsEnum){
+
+ switch (comboBoxAccountsEnum) {
+ case ACCOUNT:
+ AccountSearchComboBox accountComboBox = new AccountSearchComboBox(handler);
+ this.removeAll();
+ this.add(accountComboBox);
+ break;
+
+ case ACCOUNT_LIST:
+ JTextField accountsList = new JTextField(16);
+ this.removeAll();
+ this.add(accountsList);
+ break;
+ }
+
+ }
+
+}
Added: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/EntryBookSearchComboBox.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/EntryBookSearchComboBox.java (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/EntryBookSearchComboBox.java 2010-08-18 14:47:44 UTC (rev 3006)
@@ -0,0 +1,89 @@
+/* *##% Lima Swing
+ * Copyright (C) 2008 - 2010 CodeLutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * ##%*/
+
+package org.chorem.lima.ui.financialtransactionsearch;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.KeyEvent;
+import java.awt.event.KeyListener;
+import javax.swing.JComboBox;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.chorem.lima.entity.EntryBook;
+import org.chorem.lima.ui.combobox.EntryBookComboBoxModel;
+import org.chorem.lima.ui.combobox.EntryBookRenderer;
+import org.chorem.lima.util.EntryBookToString;
+import org.jdesktop.swingx.autocomplete.AutoCompleteDecorator;
+
+public class EntryBookSearchComboBox extends JComboBox implements KeyListener, ActionListener {
+
+ private static final long serialVersionUID = 1L;
+
+ private static final Log log =
+ LogFactory.getLog(EntryBookSearchComboBox.class);
+
+ protected FinancialTransactionSearchViewHandler handler;
+
+ public EntryBookSearchComboBox(FinancialTransactionSearchViewHandler handler) {
+ this.handler = handler;
+ EntryBookComboBoxModel entryBookComboBoxModel = new EntryBookComboBoxModel();
+ EntryBookRenderer entryBookRenderer = new EntryBookRenderer();
+ setModel(entryBookComboBoxModel);
+ setRenderer(entryBookRenderer);
+ setEditable(true);
+ AutoCompleteDecorator.decorate(this, EntryBookToString.getInstance());
+ this.getEditor().getEditorComponent().addKeyListener(this);
+ this.addActionListener(this);
+ }
+
+
+
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ Object object = this.getSelectedItem();
+ if (object instanceof EntryBook){
+ //handler.setEntryBook((EntryBook) this.getSelectedItem());
+ }
+ }
+
+
+ @Override
+ public void keyPressed(KeyEvent e) {
+
+ }
+
+ @Override
+ public void keyReleased(KeyEvent e) {
+ Object object = this.getSelectedItem();
+ if (object instanceof EntryBook){
+ //handler.setEntryBook((EntryBook) this.getSelectedItem());
+ }
+ // delegate popup list menu
+ if ( e.getKeyChar() == KeyEvent.VK_ENTER )
+ {
+ firePopupMenuCanceled();
+ }
+ }
+
+ @Override
+ public void keyTyped(KeyEvent e) {
+
+ }
+
+}
Added: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchTable.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchTable.java (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchTable.java 2010-08-18 14:47:44 UTC (rev 3006)
@@ -0,0 +1,154 @@
+/* *##% Lima Swing
+ * Copyright (C) 2008 - 2010 CodeLutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * ##%*/
+
+package org.chorem.lima.ui.financialtransactionsearch;
+
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.event.KeyEvent;
+import java.awt.event.KeyListener;
+import java.math.BigDecimal;
+import java.util.Date;
+import org.chorem.lima.entity.Account;
+import org.chorem.lima.entity.EntryBook;
+import org.chorem.lima.ui.celleditor.AccountTableCellEditor;
+import org.chorem.lima.ui.celleditor.DateTableCellEditor;
+import org.chorem.lima.ui.celleditor.EntryBookTableCellEditor;
+import org.jdesktop.swingx.JXTable;
+import org.jdesktop.swingx.decorator.ColorHighlighter;
+import org.jdesktop.swingx.decorator.ComponentAdapter;
+import org.jdesktop.swingx.decorator.HighlightPredicate;
+import org.jdesktop.swingx.decorator.Highlighter;
+
+
+/**
+ * Table des transaction qui ajoute des comportement (keys).
+ *
+ * @author ore
+ * @author Rémi Chapelet
+ */
+public class FinancialTransactionSearchTable extends JXTable implements KeyListener {
+
+ /** serialVersionUID. */
+ private static final long serialVersionUID = 3133690382049594727L;
+
+ protected FinancialTransactionSearchViewHandler handler;
+
+ private Highlighter colorTransaction;
+
+ private ColorHighlighter colorBalance;
+
+ /**
+ */
+ public FinancialTransactionSearchTable(FinancialTransactionSearchViewHandler handler) {
+
+ this.handler = handler;
+
+ addKeyListener(this);
+
+ //Get new date editor
+ setDefaultEditor(Date.class, new DateTableCellEditor());
+ //Get new entry book editor
+ setDefaultEditor(EntryBook.class, new EntryBookTableCellEditor());
+ //Get new account editor
+ setDefaultEditor(Account.class, new AccountTableCellEditor());
+
+ //highlight financial financial transactions
+ addColorTransaction();
+ // highlight unbalanced financial transactions
+ addColorNonBalancedTransaction();
+ }
+
+ /**
+ * Cette méthode permet de colorer toutes les transactions dans le tableau
+ * afin de bien distinguer les transactions et entrées comptables.
+ * On récupère la première cellule, on vérifie que c'est une date
+ */
+ protected void addColorTransaction() {
+ if (colorTransaction != null) {
+ removeHighlighter(colorTransaction);
+ }
+ HighlightPredicate predicate = new HighlightPredicate() {
+ @Override
+ public boolean isHighlighted(Component renderer,
+ ComponentAdapter adapter) {
+ return adapter.getValueAt(adapter.row, 0) instanceof Date;
+ }
+ };
+ colorTransaction =
+ new ColorHighlighter(predicate, new Color(222,222,222), null);
+ addHighlighter(colorTransaction);
+ }
+
+
+
+ /**
+ * Permet de surligner une transaction dans le tableau lorsque
+ * cette dernière n'est pas équilibrée.
+ * On récupère la dernière cellule de la ligne
+ * et on vérifie si la valeur est différente de 0
+ */
+ protected void addColorNonBalancedTransaction() {
+ if (colorBalance != null) {
+ removeHighlighter(colorBalance);
+ }
+ HighlightPredicate predicate = new HighlightPredicate() {
+ @Override
+ public boolean isHighlighted(Component renderer,
+ ComponentAdapter adapter) {
+ boolean isHighlighted = false;
+ Object value = adapter.getValueAt(adapter.row, 8);
+ if (value instanceof BigDecimal) {
+ BigDecimal currentBalance = (BigDecimal) value;
+ if (currentBalance.doubleValue() != 0) {
+ isHighlighted = true;
+ }
+ }
+ return isHighlighted;
+ }
+ };
+ colorTransaction =
+ new ColorHighlighter(predicate, new Color(255, 198, 209), null);
+ addHighlighter(colorTransaction);
+ }
+
+ /**
+ * for each action combination key are think
+ * for extend keyboard and laptop keyboard
+ */
+ @Override
+ public void keyPressed(KeyEvent e) {
+
+ }
+
+ /*
+ * @see java.awt.event.KeyListener#keyTyped(java.awt.event.KeyEvent)
+ */
+ @Override
+ public void keyTyped(KeyEvent e) {
+
+ }
+
+ /*
+ * @see java.awt.event.KeyListener#keyReleased(java.awt.event.KeyEvent)
+ */
+ @Override
+ public void keyReleased(KeyEvent e) {
+
+ }
+}
Property changes on: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchTable.java
___________________________________________________________________
Added: svn:executable
+ *
Added: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchTableModel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchTableModel.java (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchTableModel.java 2010-08-18 14:47:44 UTC (rev 3006)
@@ -0,0 +1,467 @@
+/* *##% Lima Swing
+ * Copyright (C) 2008 - 2010 CodeLutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * ##%*/
+
+package org.chorem.lima.ui.financialtransactionsearch;
+
+import static org.nuiton.i18n.I18n._;
+
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Date;
+import java.util.List;
+import java.util.Set;
+
+import javax.swing.table.AbstractTableModel;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.chorem.lima.business.FinancialTransactionServiceMonitorable;
+import org.chorem.lima.business.LimaException;
+import org.chorem.lima.business.ejbinterface.FinancialTransactionService;
+import org.chorem.lima.business.utils.EntryComparator;
+import org.chorem.lima.entity.Account;
+import org.chorem.lima.entity.Entry;
+import org.chorem.lima.entity.EntryBook;
+import org.chorem.lima.entity.EntryImpl;
+import org.chorem.lima.entity.FinancialTransaction;
+import org.chorem.lima.entity.FiscalPeriod;
+import org.chorem.lima.service.LimaServiceFactory;
+import org.chorem.lima.util.DialogHelper;
+import org.chorem.lima.util.ErrorHelper;
+
+/**
+ * Basic transaction table model.
+ *
+ * Le modele est filtré sur {@link #selectedEntryBook} et
+ * {@link #selectedFinancialPeriod} (montée en charge !).
+ *
+ * @author ore
+ * @author chatellier
+ * @version $Revision: 2897 $
+ *
+ * Last update : $Date: 2010-05-14 13:22:26 +0200 (ven. 14 mai 2010) $
+ * By : $Author: jpepin $
+ */
+public class FinancialTransactionSearchTableModel extends AbstractTableModel {
+
+ /** serialVersionUID. */
+ private static final long serialVersionUID = 3914954536809622358L;
+
+ /** log. */
+ private static final Log log = LogFactory
+ .getLog(FinancialTransactionSearchTableModel.class);
+
+ /** Transaction service. */
+ protected final FinancialTransactionService financialTransactionService;
+
+ /** selected financial period */
+ protected FiscalPeriod selectedFiscalPeriod;
+
+ /** data cache */
+ protected List<Object> cacheDataList;
+
+ /** collection
+
+
+ /**
+ * Model constructor.
+ *
+ * Just init service proxies.
+ */
+ public FinancialTransactionSearchTableModel() {
+ /* Services */
+ financialTransactionService =
+ LimaServiceFactory.getInstance().getService(
+ FinancialTransactionServiceMonitorable.class);
+ }
+
+ /**
+ * Le model est une combinaison de Transaction/Entries.
+ *
+ *
+ * @return
+ */
+ protected List<Object> getDataList() {
+ List<Object> results = new ArrayList<Object>();
+ if(selectedFiscalPeriod != null){
+ try {
+ Set<FinancialTransaction> financialtransactions =
+ financialTransactionService.getAllInexactFinancialTransactions(selectedFiscalPeriod);
+ for (FinancialTransaction financialtransaction : financialtransactions) {
+ results.add(financialtransaction);
+ List<Entry> entries = (List<Entry>) financialtransaction.getEntry();
+ Collections.sort(entries, new EntryComparator());
+ results.addAll(entries);
+ }
+ }
+ catch (LimaException eee) {
+ if (log.isErrorEnabled()) {
+ log.debug("Can't update model", eee);
+ }
+
+ ErrorHelper.showErrorDialog("Can't get transaction list", eee);
+ }
+ }
+
+ return results;
+ }
+
+ public void refresh(){
+ cacheDataList = getDataList();
+ fireTableDataChanged();
+ }
+
+ @Override
+ public int getColumnCount() {
+ return 9;
+ }
+
+ @Override
+ public Class<?> getColumnClass(int column) {
+
+ Class<?> result = null;
+
+ switch (column) {
+ case 0:
+ result = Date.class;
+ break;
+ case 1:
+ result = EntryBook.class;
+ break;
+ case 2:
+ result = String.class;
+ break;
+ case 3:
+ result = Account.class;
+ break;
+ case 4:
+ result = String.class;
+ break;
+ case 5:
+ result = String.class;
+ break;
+ case 6:
+ result = BigDecimal.class;
+ break;
+ case 7:
+ result = BigDecimal.class;
+ break;
+ case 8:
+ result = BigDecimal.class;
+ break;
+ }
+
+ return result;
+ }
+
+ @Override
+ public String getColumnName(int column) {
+ String result = "n/a";
+
+ switch (column) {
+ case 0:
+ result = _("lima.table.date");
+ break;
+ case 1:
+ result = _("lima.table.entrybook");
+ break;
+ case 2:
+ result = _("lima.table.voucher");
+ break;
+ case 3:
+ result = _("lima.table.account");
+ break;
+ case 4:
+ result = _("lima.table.description");
+ break;
+ case 5:
+ result = _("lima.table.position");
+ break;
+ case 6:
+ result = _("lima.table.debit");
+ break;
+ case 7:
+ result = _("lima.table.credit");
+ break;
+ case 8:
+ result = _("lima.table.balance");
+ break;
+ }
+
+ return result;
+ }
+
+ @Override
+ public int getRowCount() {
+ int result = 0;
+
+ // just prevent too much result
+ if (cacheDataList != null) {
+ result = cacheDataList.size();
+ }
+
+ return result;
+ }
+
+ @Override
+ public Object getValueAt(int row, int column) {
+ Object result = null;
+
+ // just prevent too much result
+ if (cacheDataList != null) {
+ result = cacheDataList.get(row);
+
+ if (result instanceof FinancialTransaction) {
+ FinancialTransaction currentRow = (FinancialTransaction)result;
+ BigDecimal amountDebit = currentRow.getAmountDebit();
+ BigDecimal amountCredit = currentRow.getAmountCredit();
+
+ switch (column) {
+ case 0:
+ result = currentRow.getTransactionDate();
+ break;
+ case 1:
+ if (currentRow.getEntryBook() != null){
+ result = currentRow.getEntryBook().getCode();
+ }
+ else {
+ result = null;
+ }
+ break;
+ case 2:
+ result = null; //entrybook
+ break;
+ case 3:
+ result = null; // account
+ break;
+ case 4:
+ result = null; // description
+ break;
+ case 5 :
+ result = null; // position
+ break;
+ case 6:
+ result = amountDebit;
+ break;
+ case 7:
+ result = amountCredit;
+ break;
+ case 8:
+ result = amountDebit.subtract(amountCredit);
+ break;
+ }
+ }
+ else if (result instanceof Entry) {
+ Entry currentEntry = (Entry)result;
+ switch (column) {
+ case 0:
+ result = null; // date
+ break;
+ case 1 : // entry book
+ result = null;
+ break;
+ case 2:
+ result = currentEntry.getVoucher();
+ break;
+ case 3: // account
+ if (currentEntry.getAccount() != null){
+ result = currentEntry.getAccount().getAccountNumber();
+ }
+ else {
+ result = null;
+ }
+ break;
+ case 4:
+ result = currentEntry.getDescription();
+ break;
+ case 5 :
+ result = currentEntry.getPosition();
+ break;
+ case 6:
+ result = currentEntry.getDebit() ? currentEntry.getAmount() : 0;
+ break;
+ case 7:
+ result = currentEntry.getDebit() ? 0 : currentEntry.getAmount();
+ break;
+ case 8:
+ result = null; // balance
+ break;
+ }
+
+ }
+ }
+
+ return result;
+ }
+
+ public void setFiscalPeriod(FiscalPeriod fiscalPeriod){
+ selectedFiscalPeriod = fiscalPeriod;
+ }
+
+ /**
+ * To set cells editable or not
+ * different condition for entry or financial transaction
+ */
+ @Override
+ public boolean isCellEditable(int rowIndex, int columnIndex) {
+ boolean editableCell=false;
+ Object currentRow = cacheDataList.get(rowIndex);
+ // cells editable for the entry row, all cells exclude the date
+ if ((currentRow instanceof Entry) && !((columnIndex==0) || (columnIndex==1))) {
+ editableCell=true;
+ }
+ // cells editable for the financialtransaction row, no cells exclude the date
+ if ((currentRow instanceof FinancialTransaction) && ((columnIndex==0) || (columnIndex==1))){
+ editableCell=true;
+ }
+ return editableCell;
+ }
+
+
+ /**
+ * @throws LimaException
+ */
+ public void addEmptyEntry(Object value, int row) throws LimaException {
+ FinancialTransaction currentTransaction = null;
+ Object currentRow = cacheDataList.get(row);
+ Entry entry = new EntryImpl();
+ entry.setAmount(new BigDecimal(0));
+ //check if current row is a transaction or an entry
+ if (currentRow instanceof FinancialTransaction) {
+ currentTransaction = (FinancialTransaction)currentRow;
+ }
+ else if (currentRow instanceof Entry) {
+ Entry currentEntry = (Entry)currentRow;
+ //get back the parent transaction of the entry
+ currentTransaction = currentEntry.getFinancialTransaction();
+ }
+ //create it
+ entry.setFinancialTransaction(currentTransaction);
+ financialTransactionService.createEntry(entry);
+ //on recharge la liste
+ refresh();
+ }
+
+ /**
+ * to modifiy financialtransaction or entry
+ */
+ @Override
+ public void setValueAt(Object value, int row, int column) {
+ int financialTransactionRow=0;
+ // just prevent too much result
+ if (selectedFiscalPeriod != null) {
+ Object currentRow = cacheDataList.get(row);
+ if (currentRow instanceof FinancialTransaction) {
+ FinancialTransaction currentFinancialTransaction =
+ (FinancialTransaction)currentRow;
+ switch (column) {
+ case 0:
+ //update
+ currentFinancialTransaction.setTransactionDate((Date)value);
+ break;
+ case 1 :
+ currentFinancialTransaction.setEntryBook((EntryBook)value);
+ break;
+ }
+ // notify service for modification
+ try {
+ financialTransactionService.
+ updateFinancialTransaction(currentFinancialTransaction);
+ } catch (LimaException eee) {
+ if (log.isDebugEnabled()){
+ log.debug("Can't update financial transaction", eee);
+ }
+ DialogHelper.showMessageDialog(eee.getMessage());
+ }
+ //update the financial transaction in entire
+ financialTransactionRow =
+ cacheDataList.indexOf(((FinancialTransaction) currentRow));
+ }
+ else if (currentRow instanceof Entry) {
+ Entry currentEntry = (Entry)currentRow;
+ switch (column) {
+ case 2 :
+ currentEntry.setVoucher((String)value);
+ break;
+ case 3:
+ currentEntry.setAccount((Account)value);
+ break;
+ case 4:
+ currentEntry.setDescription((String)value);
+ break;
+ case 5 :
+ currentEntry.setPosition((String)value);
+ break;
+ case 6:
+ currentEntry.setAmount((BigDecimal)value);
+ currentEntry.setDebit(true);
+ break;
+ case 7:
+ currentEntry.setAmount((BigDecimal)value);
+ currentEntry.setDebit(false);
+ break;
+ }
+ try {
+ financialTransactionService.updateEntry(currentEntry);
+ } catch (LimaException eee) {
+ if (log.isDebugEnabled()){
+ log.debug("Can't update entry", eee);
+ }
+ DialogHelper.showMessageDialog(eee.getMessage());
+ }
+ //update the financial transaction in entire
+ financialTransactionRow =
+ cacheDataList.indexOf(((Entry) currentRow).
+ getFinancialTransaction());
+ }
+ //on recharge la liste
+ //TODO PEPIN 20100607 Get financial transaction of cachedatelist on replace it
+ fireTableRowsUpdated(financialTransactionRow, getRowCount()-1);
+ }
+ }
+
+ public Object getElementAt(int row){
+
+ Object currentRow = cacheDataList.get(row);
+ return currentRow;
+ }
+
+
+ /**
+ * Delete selected row in table (could be transaction or entry).
+ *
+ * Called by model.
+ * @param Object, int
+ * @throws LimaException
+ */
+ public void removeObject(Object object, int row) throws LimaException {
+ Object currentRow = cacheDataList.get(row);
+ if (currentRow instanceof FinancialTransaction) {
+ FinancialTransaction currentTransaction =
+ (FinancialTransaction)currentRow;
+ financialTransactionService.removeFinancialTransaction(currentTransaction);
+ }
+ else if (currentRow instanceof Entry) {
+ Entry currentEntry = (Entry)currentRow;
+ financialTransactionService.removeEntry(currentEntry);
+ }
+ //on recharge la liste
+ refresh();
+ }
+
+}
Property changes on: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchTableModel.java
___________________________________________________________________
Added: svn:executable
+ *
Added: 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 (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchView.jaxx 2010-08-18 14:47:44 UTC (rev 3006)
@@ -0,0 +1,87 @@
+<!-- ##% Lima Swing
+ Copyright (C) 2008 - 2010 CodeLutin
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ as published by the Free Software Foundation; either version 2
+ 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, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ ##% -->
+
+<Table>
+ <FinancialTransactionSearchViewHandler id="handler" javaBean="new FinancialTransactionSearchViewHandler(this)" />
+ <Boolean id="selectedRow" javaBean="false" />
+ <script>
+ <![CDATA[
+ import org.chorem.lima.enums.ComboBoxPeriodEnum;
+ import org.chorem.lima.enums.ComboBoxAccountsEnum;
+ import org.chorem.lima.enums.ComboBoxAmountEnum;
+ import org.chorem.lima.enums.ComboBoxOperatorsEnum;
+
+ AccountSearchPanel accountSearchPanel = new AccountSearchPanel(handler);
+ PeriodSearchPanel periodSearchPanel = new PeriodSearchPanel(handler);
+
+ void $afterCompleteSetup() {
+ }
+
+ ]]>
+ </script>
+
+ <row>
+ <cell><Table><row>
+ <cell anchor="west"><JComboBox id="periodComboBox" javaBean="new JComboBox(ComboBoxPeriodEnum.descriptions())"
+ onActionPerformed="periodSearchPanel.refresh(ComboBoxPeriodEnum.valueOfDescription((String) periodComboBox.getSelectedItem()));
+ validate(); repaint()"/></cell>
+ <cell><PeriodSearchPanel javaBean="periodSearchPanel"/></cell>
+ </row></Table></cell>
+ </row>
+ <row>
+ <cell><Table><row>
+ <cell><JLabel text="lima.table.voucher"/></cell>
+ <cell><JTextField id='voucher'/></cell>
+ <cell><JLabel text="lima.table.description"/></cell>
+ <cell><JTextField id='description'/></cell>
+ <cell><JLabel text="lima.table.letter"/></cell>
+ <cell><JTextField id='letter'/></cell>
+ </row></Table></cell>
+ </row>
+ <row>
+ <cell><Table><row>
+ <cell><JComboBox id="accountComboBox" javaBean="new JComboBox(ComboBoxAccountsEnum.descriptions())"
+ onActionPerformed="accountSearchPanel.refresh(ComboBoxAccountsEnum.valueOfDescription((String) accountComboBox.getSelectedItem()));
+ validate(); repaint()"/></cell>
+ <cell><AccountSearchPanel javaBean="accountSearchPanel"/></cell>
+ <cell anchor='east'><JLabel text="lima.table.entrybook"/></cell>
+ <cell anchor='west'><EntryBookSearchComboBox javaBean="new EntryBookSearchComboBox(handler)"/></cell>
+ </row></Table></cell>
+ </row>
+ <row>
+ <cell><Table><row>
+ <cell><JLabel text="lima.amount"/></cell>
+ <cell><JComboBox id="amountComboBox" javaBean="new JComboBox(ComboBoxAmountEnum.descriptions())"/></cell>
+ <cell><JComboBox id="operatorComboBox" javaBean="new JComboBox(ComboBoxOperatorsEnum.descriptions())"/></cell>
+ <cell><JTextField id='amount'/></cell>
+ </row></Table></cell>
+ </row>
+ <row>
+ <cell fill="both" weightx="1" weighty="1">
+ <JScrollPane>
+ <org.chorem.lima.ui.financialtransactionsearch.FinancialTransactionSearchTableModel
+ id="financialTransactionSearchTableModel" />
+ <org.chorem.lima.ui.financialtransactionsearch.FinancialTransactionSearchTable
+ id="financialTransactionSearchTable" sortable="false" rowHeight="22"
+ constructorParams="getHandler()" model="{getFinancialTransactionSearchTableModel()}"
+ selectionMode="{ListSelectionModel.SINGLE_SELECTION}" />
+ <javax.swing.ListSelectionModel javaBean="getFinancialTransactionSearchTable().getSelectionModel()"
+ onValueChanged="setSelectedRow(financialTransactionSearchTable.getSelectedRow() != -1)"/>
+ </JScrollPane>
+ </cell>
+ </row>
+</Table>
\ No newline at end of file
Property changes on: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchView.jaxx
___________________________________________________________________
Added: svn:executable
+ *
Added: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchViewHandler.java (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchViewHandler.java 2010-08-18 14:47:44 UTC (rev 3006)
@@ -0,0 +1,60 @@
+/* *##% Lima Swing
+ * Copyright (C) 2008 - 2010 CodeLutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * ##%*/
+
+package org.chorem.lima.ui.financialtransactionsearch;
+
+import static org.nuiton.i18n.I18n._;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.chorem.lima.ui.combobox.FiscalPeriodComboBoxModel;
+
+/**
+ * Handler associated with financial transaction view.
+ *
+ * @author chatellier
+ * @version $Revision: 2901 $
+ *
+ * Last update : $Date: 2010-05-19 12:52:43 +0200 (mer. 19 mai 2010) $
+ * By : $Author: jpepin $
+ */
+public class FinancialTransactionSearchViewHandler {
+
+ /** log. */
+ private static final Log log =
+ LogFactory.getLog(FinancialTransactionSearchViewHandler.class);
+
+ protected FinancialTransactionSearchView view;
+
+ protected FinancialTransactionSearchTable table;
+
+ protected FinancialTransactionSearchTableModel tableModel;
+
+ protected FiscalPeriodComboBoxModel comboBoxModel;
+
+
+ protected FinancialTransactionSearchViewHandler(FinancialTransactionSearchView view) {
+ this.view = view;
+
+ }
+
+ public void refresh(){
+ tableModel = view.getFinancialTransactionSearchTableModel();
+ tableModel.refresh();
+ }
+}
Property changes on: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchViewHandler.java
___________________________________________________________________
Added: svn:executable
+ *
Added: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/PeriodSearchPanel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/PeriodSearchPanel.java (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/PeriodSearchPanel.java 2010-08-18 14:47:44 UTC (rev 3006)
@@ -0,0 +1,111 @@
+/* *##% Lima Swing
+ * Copyright (C) 2008 - 2010 CodeLutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * ##%*/
+
+package org.chorem.lima.ui.financialtransactionsearch;
+
+import java.util.Calendar;
+import java.util.Date;
+import static org.nuiton.i18n.I18n._;
+import javax.swing.JComboBox;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+
+import org.apache.commons.lang.time.DateUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.chorem.lima.enums.ComboBoxPeriodEnum;
+import org.chorem.lima.ui.combobox.FinancialPeriodComboBoxModel;
+import org.chorem.lima.ui.combobox.FinancialPeriodComboBoxRenderer;
+import org.chorem.lima.ui.combobox.FiscalPeriodComboBoxModel;
+import org.chorem.lima.ui.combobox.FiscalPeriodComboBoxRenderer;
+import org.jdesktop.swingx.JXDatePicker;
+
+public class PeriodSearchPanel extends JPanel {
+
+ private static final Log log =
+ LogFactory.getLog(PeriodSearchPanel.class);
+
+ protected FinancialTransactionSearchViewHandler handler;
+
+ public PeriodSearchPanel(FinancialTransactionSearchViewHandler handler) {
+ this.handler = handler;
+ refresh(ComboBoxPeriodEnum.DATE);
+ }
+
+ static final long serialVersionUID = 1L;
+
+ public void refresh(ComboBoxPeriodEnum comboBoxPeriodEnum){
+
+ switch (comboBoxPeriodEnum) {
+ case DATE:
+ Calendar calendar = Calendar.getInstance();
+ Date date = calendar.getTime();
+ date = DateUtils.truncate(date, Calendar.DATE);
+ JXDatePicker datePicker = new JXDatePicker(date);
+ this.removeAll();
+ this.add(datePicker);
+ break;
+
+ case PERIOD:
+ // get begin date
+ Calendar calendarBegin = Calendar.getInstance();
+ // set begindate to JAN 1 - 0:00.000 of this years
+ Date beginDate = calendarBegin.getTime();
+ beginDate = DateUtils.truncate(beginDate, Calendar.YEAR);
+ //handler().setBeginDate(beginDate);
+
+ // get end date
+ Calendar calendarEnd = Calendar.getInstance();
+ Date endDate = calendarEnd.getTime();
+ //handler().setEndDate(endDate);
+ JLabel beginDateLabel = new JLabel(_("lima.period.begindate"));
+ JXDatePicker beginDatePicker = new JXDatePicker(beginDate);
+ JLabel endDateLabel = new JLabel(_("lima.period.enddate"));
+ JXDatePicker endDatePicker = new JXDatePicker(endDate);
+ this.removeAll();
+ this.add(beginDateLabel);
+ this.add(beginDatePicker);
+ this.add(endDateLabel);
+ this.add(endDatePicker);
+ break;
+
+ case FISCAL_PERIOD:
+ FiscalPeriodComboBoxModel fiscalModel = new FiscalPeriodComboBoxModel();
+ FiscalPeriodComboBoxRenderer fiscalRenderer = new FiscalPeriodComboBoxRenderer();
+ JComboBox fiscalPeriod = new JComboBox(fiscalModel);
+ fiscalPeriod.setRenderer(fiscalRenderer);
+ fiscalPeriod.setEditable(false);
+ //fiscalPeriod.actionPerformed(handler.);
+ this.removeAll();
+ this.add(fiscalPeriod);
+ break;
+
+ case FINANCIAL_PERIOD:
+ FinancialPeriodComboBoxModel financialModel = new FinancialPeriodComboBoxModel();
+ FinancialPeriodComboBoxRenderer financialRenderer = new FinancialPeriodComboBoxRenderer();
+ JComboBox financialPeriod = new JComboBox(financialModel);
+ financialPeriod.setRenderer(financialRenderer);
+ financialPeriod.setEditable(false);
+ this.removeAll();
+ this.add(financialPeriod);
+ break;
+ }
+
+ }
+
+}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/OpeningViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/OpeningViewHandler.java 2010-08-17 15:34:26 UTC (rev 3005)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/OpeningViewHandler.java 2010-08-18 14:47:44 UTC (rev 3006)
@@ -20,12 +20,10 @@
import static org.nuiton.i18n.I18n._;
import java.awt.Color;
-
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import javax.swing.border.Border;
import javax.swing.border.EmptyBorder;
-
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.business.FiscalPeriodServiceMonitorable;
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 2010-08-17 15:34:26 UTC (rev 3005)
+++ trunk/lima-swing/src/main/resources/i18n/lima-swing-en_GB.properties 2010-08-18 14:47:44 UTC (rev 3006)
@@ -79,6 +79,7 @@
lima.entries=Entries
lima.entries.addtransaction=
lima.entries.lettering=
+lima.entries.searchtransaction=
lima.entries.searchunbalancedtransaction=
lima.entrybook=Entry Book
lima.entrybook.add=Add Entry Book
@@ -90,6 +91,18 @@
lima.entrybook.type3=
lima.entrybook.type4=
lima.entrybook.type5=
+lima.enum.comboboxaccount.account=
+lima.enum.comboboxaccount.accountlist=
+lima.enum.comboboxamount.both=
+lima.enum.comboboxamount.credit=
+lima.enum.comboboxamount.debit=
+lima.enum.comboboxoperator.equal=
+lima.enum.comboboxoperator.inferior=
+lima.enum.comboboxoperator.superior=
+lima.enum.comboboxperiod.date=
+lima.enum.comboboxperiod.financialperiod=
+lima.enum.comboboxperiod.fiscalperiod=
+lima.enum.comboboxperiod.period=
lima.error=Error
lima.error.errorpane.htmlmessage=<html><body><b>An application error happened</b>\:<br/>%s</body></html>
lima.error.errorpane.title=Lima error
@@ -218,6 +231,7 @@
lima.table.fiscalperiod=
lima.table.grossamount=
lima.table.label=
+lima.table.letter=
lima.table.move.credit=
lima.table.move.debit=
lima.table.netamount=
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 2010-08-17 15:34:26 UTC (rev 3005)
+++ trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties 2010-08-18 14:47:44 UTC (rev 3006)
@@ -74,6 +74,7 @@
lima.entries=Traitement
lima.entries.addtransaction=Saisir des \u00E9critures
lima.entries.lettering=Ajouter une lettre
+lima.entries.searchtransaction=Rechercher des \u00E9critures
lima.entries.searchunbalancedtransaction=Entr\u00E9es incorrect
lima.entrybook=Journal
lima.entrybook.add=Ajouter un journal
@@ -85,6 +86,18 @@
lima.entrybook.type3=Tr\u00E9sorerie
lima.entrybook.type4=G\u00E9n\u00E9ral
lima.entrybook.type5=Situation
+lima.enum.comboboxaccount.account=Compte
+lima.enum.comboboxaccount.accountlist=Liste de compte
+lima.enum.comboboxamount.both=Les deux
+lima.enum.comboboxamount.credit=Cr\u00E9dit
+lima.enum.comboboxamount.debit=D\u00E9bit
+lima.enum.comboboxoperator.equal=\u00C9gal
+lima.enum.comboboxoperator.inferior=Inf\u00E9rieur
+lima.enum.comboboxoperator.superior=Sup\u00E9rieur
+lima.enum.comboboxperiod.date=Date
+lima.enum.comboboxperiod.financialperiod=P\u00E9riode Financi\u00E8re
+lima.enum.comboboxperiod.fiscalperiod=Exercice
+lima.enum.comboboxperiod.period=P\u00E9riode
lima.error=Erreur
lima.error.errorpane.htmlmessage=<html><body><b>Une erreur s'est produite</b>\:<br/>%s</body></html>
lima.error.errorpane.title=Lima erreur
@@ -205,6 +218,7 @@
lima.table.fiscalperiod=Exercice
lima.table.grossamount=Brut
lima.table.label=Libell\u00E9
+lima.table.letter=Lettre
lima.table.move.credit=Mouvement au cr\u00E9dit
lima.table.move.debit=Mouvement au d\u00E9bit
lima.table.netamount=Net
1
0
Author: jpepin
Date: 2010-08-17 17:34:26 +0200 (Tue, 17 Aug 2010)
New Revision: 3005
Url: http://chorem.org/repositories/revision/lima/3005
Log:
D?\195?\169bogue g?\195?\169n?\195?\169ration bilan - CR.
Plans comptable et BCR d?\195?\169finitifs.
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
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ReportService.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ReportServiceLocal.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-callao/src/main/xmi/accounting.zargo
trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsViewHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTable.java
trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties
trunk/lima-swing/src/main/resources/import/bcr_base.csv
trunk/lima-swing/src/main/resources/import/bcr_developed.csv
trunk/lima-swing/src/main/resources/import/bcr_shortened.csv
trunk/lima-swing/src/main/resources/import/pcg_base.csv
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 2010-08-16 13:11:52 UTC (rev 3004)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java 2010-08-17 15:34:26 UTC (rev 3005)
@@ -506,44 +506,16 @@
else {
TopiaQuery query = accountDAO.createQuery();
String subAccountsProperty = TopiaQuery.getProperty(Account.SUB_ACCOUNTS);
- String subLedgersProperty = TopiaQuery.getProperty(Account.SUB_LEDGERS);
+ //String subLedgersProperty = TopiaQuery.getProperty(Account.SUB_LEDGERS);
query.addWhere("not exists elements ("+subAccountsProperty+")")
//.addWhere("not exists elements ("+subLedgersProperty+")")
- .addWhere(Account.ACCOUNT_NUMBER, Op.LIKE, accountNumber+"%");
+ .addWhere(Account.ACCOUNT_NUMBER, Op.LIKE, accountNumber+"%");
List<Account> accountsResult = accountDAO.findAllByQuery(query);
if (accountsResult != null){
accounts.addAll(accountsResult);
}
}
}
- /*for (String accountNumber : accountNumbers) {
- if (subAccountsMode){
- Account account = accountDAO.findSubAccountByNumber(accountNumber);
- if (account == null){
- TopiaQuery query = accountDAO.createQuery();
- String subAccountsProperty = TopiaQuery.getProperty(Account.SUB_ACCOUNTS);
- String subLedgersProperty = TopiaQuery.getProperty(Account.SUB_LEDGERS);
- query.addWhere("not exists elements ("+subAccountsProperty+")")
- //.addWhere("not exists elements ("+subLedgersProperty+")")
- .addWhere(Account.ACCOUNT_NUMBER, Op.LIKE, accountNumber+"%");
- List<Account> accountsResult = accountDAO.findAllByQuery(query);
- if (accountsResult != null){
- accounts.addAll(accountsResult);
- }
- }
- //add account if exist
- else {
- accounts.add(account);
- }
- }
- else {
- Account account = accountDAO.findByAccountNumber(accountNumber);
- if (account != null){
- accounts.add(account);
- }
- }
-
- }*/
//remove all accounts
for (String accountNumber : accountNumbersToRemove) {
Account account = null;
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 2010-08-16 13:11:52 UTC (rev 3004)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialStatementServiceImpl.java 2010-08-17 15:34:26 UTC (rev 3005)
@@ -20,10 +20,8 @@
package org.chorem.lima.business.ejb;
import static org.nuiton.i18n.I18n._;
-
import java.math.BigDecimal;
import java.util.ArrayList;
-import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.StringTokenizer;
@@ -46,7 +44,6 @@
import org.chorem.lima.business.ejbinterface.FinancialStatementService;
import org.chorem.lima.business.ejbinterface.FinancialStatementServiceLocal;
import org.chorem.lima.business.ejbinterface.ReportServiceLocal;
-import org.chorem.lima.business.utils.AccountComparator;
import org.chorem.lima.entity.Account;
import org.chorem.lima.entity.AccountDAO;
import org.chorem.lima.entity.FinancialStatement;
@@ -476,13 +473,12 @@
for (Account account : accountsList) {
ReportsDatas reportsDatas = reportServiceLocal.
- generateAccountReportsWithTransaction(account,
+ generateAccountReportsWithTransaction(account, true,
selectedBeginDate, selectedEndDate, topiaContext);
BigDecimal tempAmount = new BigDecimal(0);
-
//check the way of financialstatement amount
//exemple compte de résultat : charge -> débit, produit -> crédit
- switch (financialStatementWayEnum) {
+ switch (financialStatementWayEnum) {
case BOTH:
tempAmount = tempAmount.add(reportsDatas.getAmountSolde());
break;
@@ -495,8 +491,8 @@
tempAmount = tempAmount.subtract(reportsDatas.getAmountDebit());
break;
}
-
- //add the calcul in function of list type: allaccounts, debit or credit
+
+ //add the calcul in function of list type: allaccounts, debit or credit
switch (debitCredit) {
case BOTH:
resAmount = resAmount.add(tempAmount);
@@ -512,6 +508,7 @@
}
break;
}
+
}
if (amount.doubleValue() == 0){
amount = resAmount;
@@ -531,7 +528,7 @@
@Override
public String checkFinancialStatementChart() throws LimaException {
- String result ="";
+ String result =_("lima-business.financialstatement.check.warn");
TopiaContext transaction = null;
try {
transaction = beginTransaction();
@@ -567,7 +564,8 @@
for (Account account : accountsList) {
- result += "NOT FOUND : "+account.getAccountNumber()+"\n";
+ result += _("lima-business.financialstatement.check.nothing")
+ + " : "+account.getAccountNumber()+" - "+account.getLabel()+"\n";
}
}
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 2010-08-16 13:11:52 UTC (rev 3004)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java 2010-08-17 15:34:26 UTC (rev 3005)
@@ -417,11 +417,17 @@
FinancialTransaction financialTransaction =
entry.getFinancialTransaction();
- BigDecimal amountDebit = financialTransaction.getAmountDebit();
+ BigDecimal amountDebit = financialTransaction.getAmountDebit();
+ if (amountDebit == null){
+ amountDebit = new BigDecimal(0);
+ }
amountDebit = amountDebit.add(entryDebit);
financialTransaction.setAmountDebit(amountDebit);
BigDecimal amountCredit = financialTransaction.getAmountCredit();
+ if (amountCredit == null){
+ amountCredit = new BigDecimal(0);
+ }
amountCredit = amountCredit.add(entryCredit);
financialTransaction.setAmountCredit(amountCredit);
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 2010-08-16 13:11:52 UTC (rev 3004)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java 2010-08-17 15:34:26 UTC (rev 3005)
@@ -193,7 +193,6 @@
CsvToBean<EntryEBPImpl> csv = new CsvToBean<EntryEBPImpl>();
List<EntryEBPImpl> list = csv.parse(strat, csvReader);
Collections.sort(list, new EntryEBPComparator());
- log.debug(list.size()+" list /n"+list);
// DAOs
AccountDAO accountDAO = LimaCallaoDAOHelper
@@ -240,9 +239,7 @@
else {
entry.setAccount(account);
BigDecimal debit = new BigDecimal(entryEBP.getDebit());
- log.debug(debit);
BigDecimal credit = new BigDecimal(entryEBP.getCredit());
- log.debug(credit);
if (debit.doubleValue() == 0) {
entry.setDebit(false);
entry.setAmount(credit);
@@ -870,7 +867,6 @@
for (Iterator<FinancialStatementImport> itr2 = financialStatementImports.iterator(); itr2.hasNext();) {
FinancialStatementImport financialStatementImport =
itr2.next();
- log.debug(financialStatementImport.getLabel());
String masterFinancialStatementLabel = financialStatementImport
.getMasterFinancialStatement();
FinancialStatement masterFinancialStatement = financialStatementDAO
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java 2010-08-16 13:11:52 UTC (rev 3004)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java 2010-08-17 15:34:26 UTC (rev 3005)
@@ -72,7 +72,7 @@
}
@Override
- public ReportsDatas generateAccountsReports(Account account, Date beginDate, Date endDate) throws LimaException {
+ public ReportsDatas generateAccountsReports(Account account, Boolean thirdPartAccountsMode, Date beginDate, Date endDate) throws LimaException {
ReportsDatas reportsDatas = null;
TopiaContext topiaTransaction = null;
@@ -80,7 +80,7 @@
topiaTransaction = beginTransaction();
reportsDatas =
- generateAccountReportsWithTransaction(account, beginDate,
+ generateAccountReportsWithTransaction(account, thirdPartAccountsMode, beginDate,
endDate, topiaTransaction);
}
catch (TopiaException ex) {
@@ -103,7 +103,7 @@
* - for a foldthirdparts accounts
*/
@Override
- public ReportsDatas generateAccountReportsWithTransaction (Account account, Date beginDate, Date endDate, TopiaContext topiaContext) throws LimaException{
+ public ReportsDatas generateAccountReportsWithTransaction (Account account, Boolean thirdPartAccountsMode, Date beginDate, Date endDate, TopiaContext topiaContext) throws LimaException{
ReportsDatas reportsDatas = new ReportsDatasImpl();
BigDecimal credit = new BigDecimal(0);
BigDecimal debit = new BigDecimal(0);
@@ -113,25 +113,29 @@
//Get allsubaccounts and thirdParts accounts
List<Account> accounts = (List<Account>) account.getSubAccounts();
- List<Account> thirdPartAccount = (List<Account>) account.getSubLedgers();
- if (thirdPartAccount != null){
- ReportsDatas subReportsDatas = generateSubAccountReportsWithTransaction(account,
- beginDate, endDate, topiaContext);
- entries.addAll(subReportsDatas.getListEntry());
- debit = debit.add(subReportsDatas.getAmountDebit());
- credit = credit.add(subReportsDatas.getAmountCredit());
- accounts.addAll(thirdPartAccount);
+ if (thirdPartAccountsMode){
+ List<Account> thirdPartAccount = (List<Account>) account.getSubLedgers();
+ if (thirdPartAccount != null){
+ ReportsDatas subReportsDatas = generateSubAccountReportsWithTransaction(account,
+ beginDate, endDate, topiaContext);
+
+ entries.addAll(subReportsDatas.getListEntry());
+ debit = debit.add(subReportsDatas.getAmountDebit());
+ credit = credit.add(subReportsDatas.getAmountCredit());
+ accounts.addAll(thirdPartAccount);
+ }
}
+
// is already subaccount
if (accounts.size() == 0){
reportsDatas = generateSubAccountReportsWithTransaction(account,
beginDate, endDate, topiaContext);
}
- // else is folder accounts contains many subs and thirds accoutns
+ // else is folder accounts contains many subs and thirds accounts
else {
for (Account subAccount : accounts) {
ReportsDatas subReportsDatas =
- generateAccountReportsWithTransaction(subAccount,
+ generateAccountReportsWithTransaction(subAccount, true,
beginDate,endDate, topiaContext);
debit = debit.add(subReportsDatas.getAmountDebit());
credit = credit.add(subReportsDatas.getAmountCredit());
@@ -266,7 +270,6 @@
List<Object[]> results = new ArrayList<Object[]>();
String queryAlias = "E";
if (beginDate != null && endDate != null){
- log.debug("solde 0 : "+solde);
try {
EntryDAO entryDAO= LimaCallaoDAOHelper.getEntryDAO(topiaContext);
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ReportService.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ReportService.java 2010-08-16 13:11:52 UTC (rev 3004)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ReportService.java 2010-08-17 15:34:26 UTC (rev 3005)
@@ -74,7 +74,7 @@
/**
* Generation du rapports des comptes
*/
- ReportsDatas generateAccountsReports(Account account, Date beginDate, Date endDate) throws LimaException;
+ ReportsDatas generateAccountsReports(Account account, Boolean thirdPartAccountsMode, Date beginDate, Date endDate) throws LimaException;
/**
* Generation du rapports des journaux
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ReportServiceLocal.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ReportServiceLocal.java 2010-08-16 13:11:52 UTC (rev 3004)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ReportServiceLocal.java 2010-08-17 15:34:26 UTC (rev 3005)
@@ -46,6 +46,6 @@
@Local
public interface ReportServiceLocal extends ReportService {
- public ReportsDatas generateAccountReportsWithTransaction (Account account, Date beginDate, Date endDate, TopiaContext topiaContext) throws LimaException;
+ public ReportsDatas generateAccountReportsWithTransaction (Account account, Boolean thirdPartAccountsMode, Date beginDate, Date endDate, TopiaContext topiaContext) throws LimaException;
}
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 2010-08-16 13:11:52 UTC (rev 3004)
+++ trunk/lima-business/src/main/resources/i18n/lima-business-en_GB.properties 2010-08-17 15:34:26 UTC (rev 3005)
@@ -40,6 +40,8 @@
lima-business.document.soldedebit=
lima-business.document.vatnumber=
lima-business.document.voucher=Voucher
+lima-business.financialstatement.check.nothing=
+lima-business.financialstatement.check.warn=
lima.business.document.date=Date
lima.config.configFileName.description=
lima.config.http-port=
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 2010-08-16 13:11:52 UTC (rev 3004)
+++ trunk/lima-business/src/main/resources/i18n/lima-business-fr_FR.properties 2010-08-17 15:34:26 UTC (rev 3005)
@@ -37,6 +37,8 @@
lima-business.document.soldedebit=Solde D\u00E9biteur
lima-business.document.vatnumber=N\u00B0 TVA
lima-business.document.voucher=Pi\u00E8ce comptable
+lima-business.financialstatement.check.nothing=Introuvable
+lima-business.financialstatement.check.warn=Attention cette fonctionnalit\u00E9 n'est qu'une aide utilisateur.\n Certains comptes ne doivent pas \u00EAtre pr\u00E9sent au bilan et compte de r\u00E9sultat.\n Il est donc normal que des comptes sont marqu\u00E9s comme introuvable.\n\n
lima.config.configFileName.description=
lima.config.http-port=
lima.config.httpport=
Modified: trunk/lima-callao/src/main/xmi/accounting.zargo
===================================================================
(Binary files differ)
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsViewHandler.java 2010-08-16 13:11:52 UTC (rev 3004)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsViewHandler.java 2010-08-17 15:34:26 UTC (rev 3005)
@@ -96,7 +96,7 @@
//avoid unnecessary call to service
if (selectedAccount != null){
try {
- results = reportService.generateAccountsReports(selectedAccount,
+ results = reportService.generateAccountsReports(selectedAccount, true,
selectedBeginDate, selectedEndDate);
}
catch (LimaException eee) {
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 2010-08-16 13:11:52 UTC (rev 3004)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartView.jaxx 2010-08-17 15:34:26 UTC (rev 3005)
@@ -72,7 +72,7 @@
</row>
<row>
<cell fill="horizontal">
- <JButton id="checkButton" text="lima.financialstament.check"
+ <JButton id="checkButton" text="lima.financialstatement.check"
onActionPerformed="getHandler().financialStatementChartCheck()"/>
</cell>
</row>
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTable.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTable.java 2010-08-16 13:11:52 UTC (rev 3004)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTable.java 2010-08-17 15:34:26 UTC (rev 3005)
@@ -20,8 +20,12 @@
import java.awt.Color;
import java.awt.Component;
+import java.awt.event.FocusEvent;
+import java.awt.event.FocusListener;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseListener;
import java.math.BigDecimal;
import java.util.Date;
@@ -44,8 +48,7 @@
/**
* Table des transaction qui ajoute des comportement (keys).
*
- * @author ore
- * @author Rémi Chapelet
+ * @author jpepin
*/
public class FinancialTransactionTable extends JXTable implements KeyListener {
@@ -242,4 +245,5 @@
public void keyReleased(KeyEvent e) {
}
+
}
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 2010-08-16 13:11:52 UTC (rev 3004)
+++ trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties 2010-08-17 15:34:26 UTC (rev 3005)
@@ -93,9 +93,8 @@
lima.export.all=Exporter toutes les donn\u00E9es (XML)
lima.export.all.csv=Exporter toutes les donn\u00E9es (CSV)
lima.financialperiod.block=Cloturer une p\u00E9riode
-lima.financialstament.check=
lima.financialstatement.accounts=Liste de comptes au cr\u00E9dit et au d\u00E9bit
-lima.financialstatement.check=
+lima.financialstatement.check=V\u00E9rification des comptes aux postes
lima.financialstatement.credit=Sens du poste \: d\u00E9bit
lima.financialstatement.creditaccounts=Liste de comptes au cr\u00E9dit
lima.financialstatement.debitaccounts=Liste de comptes au d\u00E9bit
Modified: trunk/lima-swing/src/main/resources/import/bcr_base.csv
===================================================================
--- trunk/lima-swing/src/main/resources/import/bcr_base.csv 2010-08-16 13:11:52 UTC (rev 3004)
+++ trunk/lima-swing/src/main/resources/import/bcr_base.csv 2010-08-17 15:34:26 UTC (rev 3005)
@@ -1,134 +1,134 @@
-"FNST";"BILAN ACTIF";"true";"";"";"";"";"true";"false";""
-"FNST";"Capital Souscrit non appelé";"false";"109";" ";" ";" ";"false";"false";"BILAN ACTIF"
-"FNST";"BILAN PASSIF";"true";"";"";"";"";"true";"false";""
-"FNST";"CAPITAUX PROPRES";"true";"";"";"";"";"true";"false";"BILAN PASSIF"
-"FNST";"COMPTE DE RESULTAT";"true";"";"";"";"";"false";"false";""
-"FNST";"Capital (dont versé?)";"false";"101";"";"";"";"false";"false";"CAPITAUX PROPRES"
-"FNST";"CHARGES";"true";" ";" ";" ";" ";"true";"false";"COMPTE DE RESULTAT"
-"FNST";"PRODUITS";"true";"";"";"";"";"true";"false";"COMPTE DE RESULTAT"
-"FNST";"ACTIF IMMOBILISÉ";"true";" ";" ";" ";" ";"true";"false";"BILAN ACTIF"
-"FNST";"ACTIF CIRCULANT";"true";"";"";"";"";"true";"false";"BILAN ACTIF"
-"FNST";"CHARGES D'EXPLOITATION";"true";"";"";"";"";"true";"false";"CHARGES"
-"FNST";"Coût d'achat des marchandises";"true";"";"";"";"";"false";"true";"CHARGES D'EXPLOITATION"
-"FNST";"Stocks et en-cours";"true";"";"";"";"";"false";"true";"ACTIF CIRCULANT"
-"FNST";"Marchandises";"false";"37";"";"";"397";"false";"false";"Stocks et en-cours"
-"FNST";"Variations de stocks de march.";"false";"603";"";"";"";"false";"false";"Coût d'achat des marchandises"
-"FNST";"Achat de marchandises";"false";"607";"";"";"";"false";"false";"Coût d'achat des marchandises"
-"FNST";"Immobilisations incorporelles";"true";"";"";"";"";"false";"false";"ACTIF IMMOBILISÉ"
-"FNST";"Frais d'établissement";"false";"201";"";"";"2801";"false";"false";"Immobilisations incorporelles"
-"FNST";"Frais de recherche et développement";"false";"203";"";"";"2803";"false";"false";"Immobilisations incorporelles"
-"FNST";"Concessions, brevets, licences, marques, procédés, logiciels, droits et valeurs similaires";"false";"205";"";"";"2805, 2905";"false";"false";"Immobilisations incorporelles"
-"FNST";"Fonds commercial";"false";"206, 207";"";"";"2807, 2906, 2907";"false";"false";"Immobilisations incorporelles"
-"FNST";"Autres";"false";"208";"";"";"2808, 2908";"false";"false";"Immobilisations incorporelles"
-"FNST";"Immobilisations incorporelles en cours";"false";"232";"";"";"2932";"false";"false";"Immobilisations incorporelles"
-"FNST";"Avances et acomptes";"false";"237";"";"";"";"false";"false";"Immobilisations incorporelles"
-"FNST";"Immobilisations corporelles";"true";"";"";"";"";"false";"false";"ACTIF IMMOBILISÉ"
-"FNST";"Terrains";"false";"211, 212";"";"";"2811, 2812, 2911";"false";"false";"Immobilisations corporelles"
-"FNST";"Constructions";"false";"213, 214";"";"";"2813, 2814";"false";"false";"Immobilisations corporelles"
-"FNST";"Installations techniques, matériels, et outillage industriels";"false";"215";"";"";"2815";"false";"false";"Immobilisations corporelles"
-"FNST";"Immobilisations corporelles en cours";"false";"231";"";"";"2931";"false";"false";"Immobilisations corporelles"
-"FNST";"Immobilisations financières";"true";"";"";"";"";"false";"false";"ACTIF IMMOBILISÉ"
-"FNST";"Participations";"false";"261, 266";"";"";"2961, 2966";"false";"false";"Immobilisations financières"
-"FNST";"Créances rattachées à des participations";"false";"267, 268";"";"";"2967, 2968";"false";"false";"Immobilisations financières"
-"FNST";"Titres immobilisés de l'activité de portefeuille";"false";"273";"";"";"2973";"false";"false";"Immobilisations financières"
-"FNST";"Autres titres immobilisés";"false";"271, 272, 27682";"";"";"2971, 2972";"false";"false";"Immobilisations financières"
-"FNST";"Prêts";"false";"274, 27684";"";"";"2974";"false";"false";"Immobilisations financières"
-"FNST";"Matières premières et autres approvisionnements";"false";"31, 32";"";"";"391, 392";"false";"false";"Stocks et en-cours"
-"FNST";"En cours de production (biens et services)";"false";"33, 34";"";"";"393, 394";"false";"false";"Stocks et en-cours"
-"FNST";"Produits intermédiaires et finis";"false";"35";"";"";"395";"false";"false";"Stocks et en-cours"
-"FNST";"Avances et acomptes versés sur commandes";"false";"4091";"";"";"";"false";"false";"ACTIF CIRCULANT"
-"FNST";"Créances";"true";"";"";"";"";"false";"false";"ACTIF CIRCULANT"
-"FNST";"Valeurs mobilières de placement";"true";"";"";"";"";"false";"false";"ACTIF CIRCULANT"
-"FNST";"Actions propres";"false";"502";"";"";"59";"false";"false";"Valeurs mobilières de placement"
-"FNST";"Autres titres";"false";"50 -502 -509";"";"";"59";"false";"false";"Valeurs mobilières de placement"
-"FNST";"Disponibilités";"false";"53, 54 -5181 -519";"51";"";"";"false";"false";"ACTIF CIRCULANT"
-"FNST";"Charges constatées d'avance";"false";"486";"";"";"";"false";"false";"ACTIF CIRCULANT"
-"FNST";"Instrument de trésorerie";"false";"";"52";"";"";"false";"false";"Valeurs mobilières de placement"
-"FNST";"Charges à répartir sur plusieurs exercices";"false";"481";"";"";"";"false";"false";"BILAN ACTIF"
-"FNST";"Primes de remboursement des emprunts";"false";"169";"";"";"";"false";"false";"BILAN ACTIF"
-"FNST";"Ecarts de conversion Actif";"false";"476";"";"";"";"false";"false";"BILAN ACTIF"
-"FNST";"Primes d'émission, de fusion, d'apport";"false";"104";"";"";"";"false";"false";"CAPITAUX PROPRES"
-"FNST";"Ecart de réévaluation";"false";"105";"";"";"";"false";"false";"CAPITAUX PROPRES"
-"FNST";"Ecart d'équivalence";"false";"107";"";"";"";"false";"false";"CAPITAUX PROPRES"
-"FNST";"Réserves";"true";"";"";"";"";"false";"false";"CAPITAUX PROPRES"
-"FNST";"Réserve légale";"false";"1061";"";"";"";"false";"false";"Réserves"
-"FNST";"Réserves statutaires ou contractuelles";"false";"1063";"";"";"";"false";"false";"Réserves"
-"FNST";"Réserves réglementées";"false";"1062, 1064";"";"";"";"false";"false";"Réserves"
-"FNST";"Report à nouveau";"false";"11";"";"";"";"false";"false";"CAPITAUX PROPRES"
-"FNST";"RÉSULTAT DE L'EXERCICE (BÉNÉFICE OU PERTE)";"false";"12";"";"";"";"false";"false";"CAPITAUX PROPRES"
-"FNST";"Subventions d'investissement";"false";"13";"";"";"";"false";"false";"CAPITAUX PROPRES"
-"FNST";"Provisions réglementées";"false";"14";"";"";"";"false";"false";"CAPITAUX PROPRES"
-"FNST";"AUTRES FONDS PROPRES";"true";"";"";"";"";"true";"false";"BILAN PASSIF"
-"FNST";"Produits des émissions de titres participatifs";"false";"1671";"";"";"";"false";"false";"AUTRES FONDS PROPRES"
-"FNST";"Avances conditionnées";"false";"1674";"";"";"";"false";"false";"AUTRES FONDS PROPRES"
-"FNST";"PROVISIONS POUR RISQUES ET CHARGES";"true";"";"";"";"";"true";"false";"BILAN PASSIF"
-"FNST";"Provisions pour risques";"false";"151";"";"";"";"false";"false";"PROVISIONS POUR RISQUES ET CHARGES"
-"FNST";"Provisions pour charges";"false";"15 -151";"";"";"";"false";"false";"PROVISIONS POUR RISQUES ET CHARGES"
-"FNST";"DETTES";"true";"";"";"";"";"true";"false";"BILAN PASSIF"
-"FNST";"Emprunts obligataires convertibles";"false";"161, 16881";"";"";"";"false";"false";"DETTES"
-"FNST";"Autres emprunts obligataires";"false";"163, 16683";"";"";"";"false";"false";"DETTES"
-"FNST";"Emprunts et dettes auprès établissements de crédits";"false";"164, 16684, 5181, 519";"";"512, 514, 517";"";"false";"false";"DETTES"
-"FNST";"Emprunts et dettes financières diverses";"false";"165, 166, 1675, 168, 16883, 17, 426 -16881 -457";"";"45";"";"false";"false";"DETTES"
-"FNST";"Avances et acomptes reçues sur commandes en cours";"false";"4191";"";"";"";"false";"false";"DETTES"
-"FNST";"Ecarts de conversion passif";"false";"477";"";"";"";"false";"false";"BILAN PASSIF"
-"FNST";"Coût d'achats de matières premières et autres approvisionnements";"true";"";"";"";"";"false";"false";"CHARGES D'EXPLOITATION"
-"FNST";"Achats de matières premières et autres approvisionnements";"false";"601, 602, 6081, 6082, 6091, 6092";"";"";"";"false";"false";"Coût d'achats de matières premières et autres approvisionnements"
-"FNST";"Variation des stock";"false";"6037";"";"";"";"false";"false";"Coût d'achats de matières premières et autres approvisionnements"
-"FNST";"Autres achats et charges externes";"false";"604, 605, 606, 6084, 6085, 6086, 6094, 6095, 6096, 61, 62";"";"";"";"false";"false";"CHARGES D'EXPLOITATION"
-"FNST";"Impôts, taxes et versements assimilés";"false";"63";"";"";"";"false";"false";"CHARGES D'EXPLOITATION"
-"FNST";"Salaires et traitements";"false";"641, 644, 648";"";"";"";"false";"false";"CHARGES D'EXPLOITATION"
-"FNST";"Charges sociales";"false";"645, 646, 647, 648";"";"";"";"false";"false";"CHARGES D'EXPLOITATION"
-"FNST";"Dotations aux amortis. & provisions";"true";" ";" ";" ";" ";"false";"true";"CHARGES D'EXPLOITATION"
-"FNST";"Autres charges";"false";"65 -655";"";"";"";"false";"false";"CHARGES D'EXPLOITATION"
-"FNST";"Quotes-parts de résultat sur opérations faites en commun";"false";"655";"";"";"";"false";"false";"CHARGES"
-"FNST";"Charges financières";"true";"";"";"";"";"false";"true";"CHARGES"
-"FNST";"Dotations aux amortissements et provisions";"false";"686";"";"";"";"false";"false";"Charges financières"
-"FNST";"Intérêts et charges assimilées";"false";"661, 664, 665, 668";"";"";"";"false";"false";"Charges financières"
-"FNST";"Différences négatives de change";"false";"666";"";"";"";"false";"false";"Charges financières"
-"FNST";"Charges nettes sur cessions de valeurs mobilières de placement";"false";"667";"";"";"";"false";"false";"Charges financières"
-"FNST";"Charges exceptionnelles";"true";"";"";"";"";"false";"true";"CHARGES"
-"FNST";"Sur opérations de gestion";"false";"671";"";"";"";"false";"false";"Charges exceptionnelles"
-"FNST";"Sur opérations en capital";"false";"675, 678";"";"";"";"false";"false";"Charges exceptionnelles"
-"FNST";"Dotations aux amortissements et aux provisions";"false";"687";"";"";"";"false";"false";"Charges exceptionnelles"
-"FNST";"Participation des salariés aux résultats";"false";"691";"";"";"";"false";"false";"CHARGES"
-"FNST";"Impôts sur les bénéfices";"false";"695, 697, 689, 698, 699, 789";"";"";"";"false";"false";"CHARGES"
-"FNST";"Produits d'exploitation";"true";"";"";"";"";"true";"false";"PRODUITS"
-"FNST";"Montant net Chiffre d'affaires";"true";"";"";"";"";"false";"true";"Produits d'exploitation"
-"FNST";"Production vendue (B&S)";"false";"70 -707 -708-7097";"";"";"";"false";"false";"Montant net Chiffre d'affaires"
-"FNST";"Ventes de marchandises";"false";"707, 708 -7097";"";"";"";"false";"false";"Montant net Chiffre d'affaires"
-"FNST";"Autres produits d'exploitation";"true";"";"";"";"";"false";"true";"Produits d'exploitation"
-"FNST";"Production stockée";"false";"713";"";"";"";"false";"false";"Autres produits d'exploitation"
-"FNST";"Production immobilisée";"false";"72, 73";"";"";"";"false";"false";"Autres produits d'exploitation"
-"FNST";"Subventions d'exploitation";"false";"74";"";"";"";"false";"false";"Autres produits d'exploitation"
-"FNST";"Reprises sur provisions (et amortissements), transferts de charges";"false";"781, 791";"";"";"";"false";"false";"Autres produits d'exploitation"
-"FNST";"Autres produits";"false";"75 -755";"";"";"";"false";"false";"Autres produits d'exploitation"
-"FNST";"Quote-parts de résultat sur opérations faites en commun";"false";"755";"";"";"";"false";"false";"PRODUITS"
-"FNST";"Produits financiers";"true";"";"";"";"";"false";"true";"PRODUITS"
-"FNST";"De participations";"false";"761";"";"";"";"false";"false";"Produits financiers"
-"FNST";"D'autres valeurs mobilières et créances de l'actif immobilisé";"false";"762";"";"";"";"false";"false";"Produits financiers"
-"FNST";"Autres intérêts et produits assimilés";"false";"763, 764, 765, 768";"";"";"";"false";"false";"Produits financiers"
-"FNST";"Reprises sur provisions et transfers de charges";"false";"786, 796";"";"";"";"false";"false";"Produits financiers"
-"FNST";"Différences positives de change";"false";"766";"";"";"";"false";"false";"Produits financiers"
-"FNST";"Produits nets sur cessions de valeurs mobilières de placement";"false";"767";"";"";"";"false";"false";"Produits financiers"
-"FNST";"Produits exceptionnels";"true";"";"";"";"";"false";"true";"PRODUITS"
-"FNST";"Reprises sur provisions et transferts de charges";"false";"787, 797";"";"";"";"false";"false";"Produits exceptionnels"
-"FNST";"Sur immobilisations : dotations aux amortissements";"false";"6811, 6812";"";"";"";"false";"false";"Dotations aux amortis. & provisions"
-"FNST";"Sur immobilisations : dotations aux provisions";"false";"6816";"";"";"";"false";"false";"Dotations aux amortis. & provisions"
-"FNST";"Sur actif circulant : dotations aux provisions";"false";"6817";"";"";"";"false";"false";"Dotations aux amortis. & provisions"
-"FNST";"Pour risques et charges : dotations aux provisions";"false";"6815";"";"";"";"false";"false";"Dotations aux amortis. & provisions"
-"FNST";"Créances Clients et Comptes rattachés";"false";"411, 413, 416, 418";;;"491";"false";"false";"Créances"
-"FNST";"Autres";"false";"4096, 4097, 4098, 425, 4287, 4387, 441, 4452, 4456, 44581, 44582, 44583, 44586, 4487, 462, 465, 467, 4687";"443, 444, 451, 455, 456, 458 -4562";"";"";"false";"false";"Créances"
-"FNST";"Capital souscrit et appelé, non versé";"false";"4562";"";"";"";"false";"false";"Créances"
-"FNST";"Autres";"false";"275, 2761, 27685, 27688";"";"";"2975, 2976";"false";"false";"Immobilisations financières"
-"FNST";"Autres";"false";"218";"";"";"2818";"false";"false";"Immobilisations corporelles"
-"FNST";"Autres";"false";"1068";"";"";"";"false";"false";"Réserves"
-"FNST";"Autres";"false";"";"";"";"";"false";"false";"AUTRES FONDS PROPRES"
-"FNST";"Avances et acomptes";"false";"238";"";"";"";"false";"false";"Immobilisations corporelles"
-"FNST";"Sur opérations de gestion";"false";"771";"";"";"";"false";"false";"Produits exceptionnels"
-"FNST";"Sur opérations en capital";"false";"775, 777, 778";"";"";"";"false";"false";"Produits exceptionnels"
-"FNST";"Dettes Fournisseurs et Comptes rattachés";"false";"401, 403, 4081, 4088";;;;"false";"false";"DETTES"
-"FNST";"Dettes fiscales et sociales";"false";"421, 422, 424, 427, 4282, 4286, 43, 442, 4455, 4457, 44584, 44587, 446, 447, 4482, 4486, 457 -4387";"";"443, 444";;"false";"false";"DETTES"
-"FNST";"Dettes sur immobilisations et Comptes rattachés";"false";"269, 279, 404, 405, 4084, 4088";;;;"false";"false";"DETTES"
-"FNST";"Autres dettes";"false";"4196, 4197, 4198, 464, 4686, 509";"";"467, 478";;"false";"false";"DETTES"
-"FNST";"Instruments de trésorerie";"false";;"";"52";;"false";"false";"DETTES"
-"FNST";"Produits constatés d'avance";"false";"487";;;;"false";"false";"DETTES"
+"FNST";"BILAN ACTIF";"true";"";"";"";"";"true";"false";"";"BOTH"
+"FNST";"Capital Souscrit non appelé";"false";"109";" ";" ";" ";"false";"false";"BILAN ACTIF";""
+"FNST";"BILAN PASSIF";"true";"";"";"";"";"true";"false";"";"BOTH"
+"FNST";"CAPITAUX PROPRES";"true";"";"";"";"";"true";"false";"BILAN PASSIF";"BOTH"
+"FNST";"COMPTE DE RESULTAT";"true";"";"";"";"";"false";"false";"";"BOTH"
+"FNST";"Capital (dont versé?)";"false";"101, 108";"";"";"";"false";"false";"CAPITAUX PROPRES";""
+"FNST";"CHARGES";"true";" ";" ";" ";" ";"true";"false";"COMPTE DE RESULTAT";"DEBIT"
+"FNST";"PRODUITS";"true";"";"";"";"";"true";"false";"COMPTE DE RESULTAT";"CREDIT"
+"FNST";"ACTIF IMMOBILISÉ";"true";" ";" ";" ";" ";"true";"false";"BILAN ACTIF";"BOTH"
+"FNST";"ACTIF CIRCULANT";"true";"";"";"";"";"true";"false";"BILAN ACTIF";"BOTH"
+"FNST";"CHARGES D'EXPLOITATION";"true";"";"";"";"";"true";"false";"CHARGES";"DEBIT"
+"FNST";"Coût d'achat des marchandises";"true";"";"";"";"";"false";"true";"CHARGES D'EXPLOITATION";"DEBIT"
+"FNST";"Stocks et en-cours";"true";"";"";"";"";"false";"true";"ACTIF CIRCULANT";"BOTH"
+"FNST";"Marchandises";"false";"37";"";"";"397";"false";"false";"Stocks et en-cours";""
+"FNST";"Variations de stocks de march.";"false";"6037";"";"";"";"false";"false";"Coût d'achat des marchandises";""
+"FNST";"Achat de marchandises";"false";"607, 6097";"";"";"";"false";"false";"Coût d'achat des marchandises";""
+"FNST";"Immobilisations incorporelles";"true";"";"";"";"";"false";"false";"ACTIF IMMOBILISÉ";"BOTH"
+"FNST";"Frais d'établissement";"false";"201";"";"";"2801";"false";"false";"Immobilisations incorporelles";""
+"FNST";"Frais de recherche et développement";"false";"203";"";"";"2803";"false";"false";"Immobilisations incorporelles";""
+"FNST";"Concessions, brevets, licences, marques, procédés, logiciels, droits et valeurs similaires";"false";"205";"";"";"2805, 2905";"false";"false";"Immobilisations incorporelles";""
+"FNST";"Fonds commercial";"false";"206, 207";"";"";"2807, 2906, 2907";"false";"false";"Immobilisations incorporelles";""
+"FNST";"Autres";"false";"208";"";"";"2808, 2908";"false";"false";"Immobilisations incorporelles";""
+"FNST";"Immobilisations incorporelles en cours";"false";"232";"";"";"2932";"false";"false";"Immobilisations incorporelles";""
+"FNST";"Avances et acomptes";"false";"237";"";"";"";"false";"false";"Immobilisations incorporelles";""
+"FNST";"Immobilisations corporelles";"true";"";"";"";"";"false";"false";"ACTIF IMMOBILISÉ";"BOTH"
+"FNST";"Terrains";"false";"211, 212";"";"";"2811, 2812, 2911";"false";"false";"Immobilisations corporelles";""
+"FNST";"Constructions";"false";"213, 214";"";"";"2813, 2814";"false";"false";"Immobilisations corporelles";""
+"FNST";"Installations techniques, matériels, et outillage industriels";"false";"215";"";"";"2815";"false";"false";"Immobilisations corporelles";""
+"FNST";"Immobilisations corporelles en cours";"false";"231";"";"";"2931";"false";"false";"Immobilisations corporelles";""
+"FNST";"Immobilisations financières";"true";"";"";"";"";"false";"false";"ACTIF IMMOBILISÉ";"BOTH"
+"FNST";"Participations";"false";"261, 266";"";"";"2961, 2966";"false";"false";"Immobilisations financières";""
+"FNST";"Créances rattachées à des participations";"false";"267, 268";"";"";"2967, 2968";"false";"false";"Immobilisations financières";""
+"FNST";"Titres immobilisés de l'activité de portefeuille";"false";"273";"";"";"2973";"false";"false";"Immobilisations financières";""
+"FNST";"Autres titres immobilisés";"false";"271, 272, 27682";"";"";"2971, 2972";"false";"false";"Immobilisations financières";""
+"FNST";"Prêts";"false";"274, 27684";"";"";"2974";"false";"false";"Immobilisations financières";""
+"FNST";"Matières premières et autres approvisionnements";"false";"31, 32";"";"";"391, 392";"false";"false";"Stocks et en-cours";""
+"FNST";"En cours de production (biens et services)";"false";"33, 34";"";"";"393, 394";"false";"false";"Stocks et en-cours";""
+"FNST";"Produits intermédiaires et finis";"false";"35";"";"";"395";"false";"false";"Stocks et en-cours";""
+"FNST";"Avances et acomptes versés sur commandes";"false";"4091";"";"";"";"false";"false";"ACTIF CIRCULANT";""
+"FNST";"Créances";"true";"";"";"";"";"false";"false";"ACTIF CIRCULANT";"BOTH"
+"FNST";"Valeurs mobilières de placement";"true";"";"";"";"";"false";"false";"ACTIF CIRCULANT";"BOTH"
+"FNST";"Actions propres";"false";"502";"";"";"59";"false";"false";"Valeurs mobilières de placement";""
+"FNST";"Autres titres";"false";"50 -502 -509";"";"";"59";"false";"false";"Valeurs mobilières de placement";""
+"FNST";"Disponibilités";"false";"53, 54";"51 -5181 -519";"";"";"false";"false";"ACTIF CIRCULANT";""
+"FNST";"Charges constatées d'avance";"false";"486";"";"";"";"false";"false";"ACTIF CIRCULANT";""
+"FNST";"Instrument de trésorerie";"false";"";"52";"";"";"false";"false";"Valeurs mobilières de placement";""
+"FNST";"Charges à répartir sur plusieurs exercices";"false";"481";"";"";"";"false";"false";"BILAN ACTIF";""
+"FNST";"Primes de remboursement des emprunts";"false";"169";"";"";"";"false";"false";"BILAN ACTIF";""
+"FNST";"Ecarts de conversion Actif";"false";"476";"";"";"";"false";"false";"BILAN ACTIF";""
+"FNST";"Primes d'émission, de fusion, d'apport";"false";"104";"";"";"";"false";"false";"CAPITAUX PROPRES";""
+"FNST";"Ecart de réévaluation";"false";"105";"";"";"";"false";"false";"CAPITAUX PROPRES";""
+"FNST";"Ecart d'équivalence";"false";"107";"";"";"";"false";"false";"CAPITAUX PROPRES";""
+"FNST";"Réserves";"true";"";"";"";"";"false";"false";"CAPITAUX PROPRES";"BOTH"
+"FNST";"Réserve légale";"false";"1061";"";"";"";"false";"false";"Réserves";""
+"FNST";"Réserves statutaires ou contractuelles";"false";"1063";"";"";"";"false";"false";"Réserves";""
+"FNST";"Réserves réglementées";"false";"1062, 1064";"";"";"";"false";"false";"Réserves";""
+"FNST";"Report à nouveau";"false";"110-119";"";"";"";"false";"false";"CAPITAUX PROPRES";""
+"FNST";"RÉSULTAT DE L'EXERCICE (BÉNÉFICE OU PERTE)";"false";"7-6";"";"";"";"false";"false";"CAPITAUX PROPRES";""
+"FNST";"Subventions d'investissement";"false";"13";"";"";"";"false";"false";"CAPITAUX PROPRES";""
+"FNST";"Provisions réglementées";"false";"14";"";"";"";"false";"false";"CAPITAUX PROPRES";""
+"FNST";"AUTRES FONDS PROPRES";"true";"";"";"";"";"true";"false";"BILAN PASSIF";"BOTH"
+"FNST";"Produits des émissions de titres participatifs";"false";"1671";"";"";"";"false";"false";"AUTRES FONDS PROPRES";""
+"FNST";"Avances conditionnées";"false";"1674";"";"";"";"false";"false";"AUTRES FONDS PROPRES";""
+"FNST";"PROVISIONS POUR RISQUES ET CHARGES";"true";"";"";"";"";"true";"false";"BILAN PASSIF";"BOTH"
+"FNST";"Provisions pour risques";"false";"151";"";"";"";"false";"false";"PROVISIONS POUR RISQUES ET CHARGES";""
+"FNST";"Provisions pour charges";"false";"15 -151";"";"";"";"false";"false";"PROVISIONS POUR RISQUES ET CHARGES";""
+"FNST";"DETTES";"true";"";"";"";"";"true";"false";"BILAN PASSIF";"BOTH"
+"FNST";"Emprunts obligataires convertibles";"false";"161, 16881";"";"";"";"false";"false";"DETTES";""
+"FNST";"Autres emprunts obligataires";"false";"163, 16683";"";"";"";"false";"false";"DETTES";""
+"FNST";"Emprunts et dettes auprès établissements de crédits";"false";"164, 16684, 5181, 519";"";"512, 514, 517";"";"false";"false";"DETTES";""
+"FNST";"Emprunts et dettes financières diverses";"false";"165, 166, 1675, 168, 16883, 17, 426 -16881 -457";"";"45";"";"false";"false";"DETTES";""
+"FNST";"Avances et acomptes reçues sur commandes en cours";"false";"4191";"";"";"";"false";"false";"DETTES";""
+"FNST";"Ecarts de conversion passif";"false";"477";"";"";"";"false";"false";"BILAN PASSIF";""
+"FNST";"Coût d'achats de matières premières et autres approvisionnements";"true";"";"";"";"";"false";"true";"CHARGES D'EXPLOITATION";"DEBIT"
+"FNST";"Achats de matières premières et autres approvisionnements";"false";"601, 602, 608, 6091, 6092";"";"";"";"false";"false";"Coût d'achats de matières premières et autres approvisionnements";""
+"FNST";"Variation des stock d'approv.";"false";"6031, 6032";"";"";"";"false";"false";"Coût d'achats de matières premières et autres approvisionnements";""
+"FNST";"Autres achats et charges externes";"false";"604, 605, 606, 6094, 6095, 6096, 61, 62";"";"";"";"false";"false";"CHARGES D'EXPLOITATION";""
+"FNST";"Impôts, taxes et versements assimilés";"false";"63";"";"";"";"false";"false";"CHARGES D'EXPLOITATION";""
+"FNST";"Salaires et traitements";"false";"641, 644, 648";"";"";"";"false";"false";"CHARGES D'EXPLOITATION";""
+"FNST";"Charges sociales";"false";"645, 646, 647, 648";"";"";"";"false";"false";"CHARGES D'EXPLOITATION";""
+"FNST";"Dotations aux amortis. & provisions";"true";" ";" ";" ";" ";"false";"true";"CHARGES D'EXPLOITATION";"DEBIT"
+"FNST";"Autres charges";"false";"65 -655";"";"";"";"false";"false";"CHARGES D'EXPLOITATION";""
+"FNST";"Quotes-parts de résultat sur opérations faites en commun";"false";"655";"";"";"";"false";"false";"CHARGES";""
+"FNST";"Charges financières";"true";"";"";"";"";"false";"true";"CHARGES";"DEBIT"
+"FNST";"Dotations aux amortissements et provisions";"false";"686";"";"";"";"false";"false";"Charges financières";""
+"FNST";"Intérêts et charges assimilées";"false";"661, 664, 665, 668";"";"";"";"false";"false";"Charges financières";""
+"FNST";"Différences négatives de change";"false";"666";"";"";"";"false";"false";"Charges financières";""
+"FNST";"Charges nettes sur cessions de valeurs mobilières de placement";"false";"667";"";"";"";"false";"false";"Charges financières";""
+"FNST";"Charges exceptionnelles";"true";"";"";"";"";"false";"true";"CHARGES";"DEBIT"
+"FNST";"Sur opérations de gestion";"false";"671";"";"";"";"false";"false";"Charges exceptionnelles";""
+"FNST";"Sur opérations en capital";"false";"675, 678";"";"";"";"false";"false";"Charges exceptionnelles";""
+"FNST";"Dotations aux amortissements et aux provisions";"false";"687";"";"";"";"false";"false";"Charges exceptionnelles";""
+"FNST";"Participation des salariés aux résultats";"false";"691";"";"";"";"false";"false";"CHARGES";""
+"FNST";"Impôts sur les bénéfices";"false";"695, 697, 689, 698, 699, 789";"";"";"";"false";"false";"CHARGES";""
+"FNST";"Produits d'exploitation";"true";"";"";"";"";"true";"false";"PRODUITS";"CREDIT"
+"FNST";"Montant net Chiffre d'affaires";"true";"";"";"";"";"false";"true";"Produits d'exploitation";"CREDIT"
+"FNST";"Production vendue (B&S)";"false";"70 -707 -708 -7097";"";"";"";"false";"false";"Montant net Chiffre d'affaires";""
+"FNST";"Ventes de marchandises";"false";"707, 708 -7097";"";"";"";"false";"false";"Montant net Chiffre d'affaires";""
+"FNST";"Autres produits d'exploitation";"true";"";"";"";"";"false";"true";"Produits d'exploitation";"CREDIT"
+"FNST";"Production stockée";"false";"713";"";"";"";"false";"false";"Autres produits d'exploitation";""
+"FNST";"Production immobilisée";"false";"72, 73";"";"";"";"false";"false";"Autres produits d'exploitation";""
+"FNST";"Subventions d'exploitation";"false";"74";"";"";"";"false";"false";"Autres produits d'exploitation";""
+"FNST";"Reprises sur provisions (et amortissements), transferts de charges";"false";"781, 791";"";"";"";"false";"false";"Autres produits d'exploitation";""
+"FNST";"Autres produits";"false";"75 -755";"";"";"";"false";"false";"Autres produits d'exploitation";""
+"FNST";"Quote-parts de résultat sur opérations faites en commun";"false";"755";"";"";"";"false";"false";"PRODUITS";""
+"FNST";"Produits financiers";"true";"";"";"";"";"false";"true";"PRODUITS";"CREDIT"
+"FNST";"De participations";"false";"761";"";"";"";"false";"false";"Produits financiers";""
+"FNST";"D'autres valeurs mobilières et créances de l'actif immobilisé";"false";"762";"";"";"";"false";"false";"Produits financiers";""
+"FNST";"Autres intérêts et produits assimilés";"false";"763, 764, 765, 768";"";"";"";"false";"false";"Produits financiers";""
+"FNST";"Reprises sur provisions et transfers de charges";"false";"786, 796";"";"";"";"false";"false";"Produits financiers";""
+"FNST";"Différences positives de change";"false";"766";"";"";"";"false";"false";"Produits financiers";""
+"FNST";"Produits nets sur cessions de valeurs mobilières de placement";"false";"767";"";"";"";"false";"false";"Produits financiers";""
+"FNST";"Produits exceptionnels";"true";"";"";"";"";"false";"true";"PRODUITS";"CREDIT"
+"FNST";"Reprises sur provisions et transferts de charges";"false";"787, 797";"";"";"";"false";"false";"Produits exceptionnels";""
+"FNST";"Sur immobilisations : dotations aux amortissements";"false";"6811, 6812";"";"";"";"false";"false";"Dotations aux amortis. & provisions";""
+"FNST";"Sur immobilisations : dotations aux provisions";"false";"6816";"";"";"";"false";"false";"Dotations aux amortis. & provisions";""
+"FNST";"Sur actif circulant : dotations aux provisions";"false";"6817";"";"";"";"false";"false";"Dotations aux amortis. & provisions";""
+"FNST";"Pour risques et charges : dotations aux provisions";"false";"6815";"";"";"";"false";"false";"Dotations aux amortis. & provisions";""
+"FNST";"Créances Clients et Comptes rattachés";"false";"410, 411, 413, 416, 418";"";"";"491";"false";"false";"Créances";""
+"FNST";"Capital souscrit et appelé, non versé";"false";"4562";"";"";"";"false";"false";"Créances";""
+"FNST";"Dettes Fournisseurs et Comptes rattachés";"false";"400, 401, 403, 4081, 4088";"";"";"";"false";"false";"DETTES";""
+"FNST";"Dettes fiscales et sociales";"false";"421, 422, 424, 427, 4282, 4286, 43, 442, 4455, 4457, 44584, 44587, 446, 447, 4482, 4486, 457 -4387";"";"443, 444";"";"false";"false";"DETTES";""
+"FNST";"Dettes sur immobilisations et Comptes rattachés";"false";"269, 279, 404, 405, 4084, 4088";"";"";"";"false";"false";"DETTES";""
+"FNST";"Autres dettes";"false";"4196, 4197, 4198, 464, 4686, 509";"";"467, 478";"";"false";"false";"DETTES";""
+"FNST";"Instruments de trésorerie";"false";"";"";"52";"";"false";"false";"DETTES";""
+"FNST";"Produits constatés d'avance";"false";"487";"";"";"";"false";"false";"DETTES";""
+"FNST";"Autres";"false";"4096, 4097, 4098, 425, 4287, 4387, 441, 4452, 4456, 44581, 44582, 44583, 44586, 4487, 462, 465, 467, 4687";"443, 444, 451, 455, 456, 458 -4562";"";"495, 496";"false";"false";"Créances";""
+"FNST";"Autres";"false";"275, 2761, 27685, 27688";"";"";"2975, 2976";"false";"false";"Immobilisations financières";""
+"FNST";"Autres";"false";"218";"";"";"2818";"false";"false";"Immobilisations corporelles";""
+"FNST";"Autres";"false";"1068";"";"";"";"false";"false";"Réserves";""
+"FNST";"Autres";"false";"";"";"";"";"false";"false";"AUTRES FONDS PROPRES";""
+"FNST";"Avances et acomptes";"false";"238";"";"";"";"false";"false";"Immobilisations corporelles";""
+"FNST";"Sur opérations de gestion";"false";"771";"";"";"";"false";"false";"Produits exceptionnels";""
+"FNST";"Sur opérations en capital";"false";"775, 777, 778";"";"";"";"false";"false";"Produits exceptionnels";""
Modified: trunk/lima-swing/src/main/resources/import/bcr_developed.csv
===================================================================
--- trunk/lima-swing/src/main/resources/import/bcr_developed.csv 2010-08-16 13:11:52 UTC (rev 3004)
+++ trunk/lima-swing/src/main/resources/import/bcr_developed.csv 2010-08-17 15:34:26 UTC (rev 3005)
@@ -1,138 +1,159 @@
-"FNST";"BILAN ACTIF";"true";"";"";"";"";"true";"false";""
-"FNST";"Capital Souscrit non appelé";"false";"109";" ";" ";" ";"false";"false";"BILAN ACTIF"
-"FNST";"BILAN PASSIF";"true";"";"";"";"";"true";"false";""
-"FNST";"CAPITAUX PROPRES";"true";"";"";"";"";"true";"false";"BILAN PASSIF"
-"FNST";"COMPTE DE RESULTAT";"true";"";"";"";"";"false";"false";""
-"FNST";"Capital (dont versé?)";"false";"101";"";"";"";"false";"false";"CAPITAUX PROPRES"
-"FNST";"CHARGES";"true";" ";" ";" ";" ";"true";"false";"COMPTE DE RESULTAT"
-"FNST";"PRODUITS";"true";"";"";"";"";"true";"false";"COMPTE DE RESULTAT"
-"FNST";"ACTIF IMMOBILISÉ";"true";" ";" ";" ";" ";"true";"false";"BILAN ACTIF"
-"FNST";"ACTIF CIRCULANT";"true";"";"";"";"";"true";"false";"BILAN ACTIF"
-"FNST";"CHARGES D'EXPLOITATION";"true";"";"";"";"";"true";"false";"CHARGES"
-"FNST";"Coût d'achat des marchandises";"true";"";"";"";"";"false";"true";"CHARGES D'EXPLOITATION"
-"FNST";"Stocks et en-cours";"true";"";"";"";"";"false";"true";"ACTIF CIRCULANT"
-"FNST";"Marchandises";"false";"37";"";"";"397";"false";"false";"Stocks et en-cours"
-"FNST";"Variations de stocks de march.";"false";"603";"";"";"";"false";"false";"Coût d'achat des marchandises"
-"FNST";"Achat de marchandises";"false";"607";"";"";"";"false";"false";"Coût d'achat des marchandises"
-"FNST";"Immobilisations incorporelles";"true";"";"";"";"";"false";"false";"ACTIF IMMOBILISÉ"
-"FNST";"Frais d'établissement";"false";"201";"";"";"2801";"false";"false";"Immobilisations incorporelles"
-"FNST";"Frais de recherche et développement";"false";"203";"";"";"2803";"false";"false";"Immobilisations incorporelles"
-"FNST";"Concessions, brevets, licences, marques, procédés, logiciels, droits et valeurs similaires";"false";"205";"";"";"2805, 2905";"false";"false";"Immobilisations incorporelles"
-"FNST";"Fonds commercial";"false";"206, 207";"";"";"2807, 2906, 2907";"false";"false";"Immobilisations incorporelles"
-"FNST";"Autres";"false";"208";"";"";"2808, 2908";"false";"false";"Immobilisations incorporelles"
-"FNST";"Immobilisations incorporelles en cours";"false";"232";"";"";"2932";"false";"false";"Immobilisations incorporelles"
-"FNST";"Avances et acomptes";"false";"237";"";"";"";"false";"false";"Immobilisations incorporelles"
-"FNST";"Immobilisations corporelles";"true";"";"";"";"";"false";"false";"ACTIF IMMOBILISÉ"
-"FNST";"Terrains";"false";"211, 212";"";"";"2811, 2812, 2911";"false";"false";"Immobilisations corporelles"
-"FNST";"Constructions";"false";"213, 214";"";"";"2813, 2814";"false";"false";"Immobilisations corporelles"
-"FNST";"Installations techniques, matériels, et outillage industriels";"false";"215";"";"";"2815";"false";"false";"Immobilisations corporelles"
-"FNST";"Immobilisations corporelles en cours";"false";"231";"";"";"2931";"false";"false";"Immobilisations corporelles"
-"FNST";"Immobilisations financières";"true";"";"";"";"";"false";"false";"ACTIF IMMOBILISÉ"
-"FNST";"Participations";"false";"261, 266";"";"";"2961, 2966";"false";"false";"Immobilisations financières"
-"FNST";"Créances rattachées à des participations";"false";"267, 268";"";"";"2967, 2968";"false";"false";"Immobilisations financières"
-"FNST";"Titres immobilisés de l'activité de portefeuille";"false";"273";"";"";"2973";"false";"false";"Immobilisations financières"
-"FNST";"Autres titres immobilisés";"false";"271, 272, 27682";"";"";"2971, 2972";"false";"false";"Immobilisations financières"
-"FNST";"Prêts";"false";"274, 27684";"";"";"2974";"false";"false";"Immobilisations financières"
-"FNST";"Matières premières et autres approvisionnements";"false";"31, 32";"";"";"391, 392";"false";"false";"Stocks et en-cours"
-"FNST";"En cours de production (biens et services)";"false";"33, 34";"";"";"393, 394";"false";"false";"Stocks et en-cours"
-"FNST";"Produits intermédiaires et finis";"false";"35";"";"";"395";"false";"false";"Stocks et en-cours"
-"FNST";"Avances et acomptes versés sur commandes";"false";"4091";"";"";"";"false";"false";"ACTIF CIRCULANT"
-"FNST";"Créances";"true";"";"";"";"";"false";"false";"ACTIF CIRCULANT"
-"FNST";"Valeurs mobilières de placement";"true";"";"";"";"";"false";"false";"ACTIF CIRCULANT"
-"FNST";"Actions propres";"false";"502";"";"";"59";"false";"false";"Valeurs mobilières de placement"
-"FNST";"Autres titres";"false";"50 -502 -509";"";"";"59";"false";"false";"Valeurs mobilières de placement"
-"FNST";"Disponibilités";"false";"53, 54 -5181 -519";"51";"";"";"false";"false";"ACTIF CIRCULANT"
-"FNST";"Charges constatées d'avance";"false";"486";"";"";"";"false";"false";"ACTIF CIRCULANT"
-"FNST";"Instrument de trésorerie";"false";"";"52";"";"";"false";"false";"Valeurs mobilières de placement"
-"FNST";"Charges à répartir sur plusieurs exercices";"false";"481";"";"";"";"false";"false";"BILAN ACTIF"
-"FNST";"Primes de remboursement des emprunts";"false";"169";"";"";"";"false";"false";"BILAN ACTIF"
-"FNST";"Ecarts de conversion Actif";"false";"476";"";"";"";"false";"false";"BILAN ACTIF"
-"FNST";"Primes d'émission, de fusion, d'apport";"false";"104";"";"";"";"false";"false";"CAPITAUX PROPRES"
-"FNST";"Ecart de réévaluation";"false";"105";"";"";"";"false";"false";"CAPITAUX PROPRES"
-"FNST";"Ecart d'équivalence";"false";"107";"";"";"";"false";"false";"CAPITAUX PROPRES"
-"FNST";"Réserves";"true";"";"";"";"";"false";"false";"CAPITAUX PROPRES"
-"FNST";"Réserve légale";"false";"1061";"";"";"";"false";"false";"Réserves"
-"FNST";"Réserves statutaires ou contractuelles";"false";"1063";"";"";"";"false";"false";"Réserves"
-"FNST";"Réserves réglementées";"false";"1062, 1064";"";"";"";"false";"false";"Réserves"
-"FNST";"Report à nouveau";"false";"11";"";"";"";"false";"false";"CAPITAUX PROPRES"
-"FNST";"RÉSULTAT DE L'EXERCICE (BÉNÉFICE OU PERTE)";"false";"12";"";"";"";"false";"false";"CAPITAUX PROPRES"
-"FNST";"Subventions d'investissement";"false";"13";"";"";"";"false";"false";"CAPITAUX PROPRES"
-"FNST";"Provisions réglementées";"false";"14";"";"";"";"false";"false";"CAPITAUX PROPRES"
-"FNST";"AUTRES FONDS PROPRES";"true";"";"";"";"";"true";"false";"BILAN PASSIF"
-"FNST";"Produits des émissions de titres participatifs";"false";"1671";"";"";"";"false";"false";"AUTRES FONDS PROPRES"
-"FNST";"Avances conditionnées";"false";"1674";"";"";"";"false";"false";"AUTRES FONDS PROPRES"
-"FNST";"PROVISIONS POUR RISQUES ET CHARGES";"true";"";"";"";"";"true";"false";"BILAN PASSIF"
-"FNST";"Provisions pour risques";"false";"151";"";"";"";"false";"false";"PROVISIONS POUR RISQUES ET CHARGES"
-"FNST";"Provisions pour charges";"false";"15 -151";"";"";"";"false";"false";"PROVISIONS POUR RISQUES ET CHARGES"
-"FNST";"DETTES";"true";"";"";"";"";"true";"false";"BILAN PASSIF"
-"FNST";"Emprunts obligataires convertibles";"false";"161, 16881";"";"";"";"false";"false";"DETTES"
-"FNST";"Autres emprunts obligataires";"false";"163, 16683";"";"";"";"false";"false";"DETTES"
-"FNST";"Emprunts et dettes auprès établissements de crédits";"false";"164, 16684, 5181, 519";"";"512, 514, 517";"";"false";"false";"DETTES"
-"FNST";"Emprunts et dettes financières diverses";"false";"165, 166, 1675, 168, 16883, 17, 426 -16881 -457";"";"45";"";"false";"false";"DETTES"
-"FNST";"Avances et acomptes reçues sur commandes en cours";"false";"4191";"";"";"";"false";"false";"DETTES"
-"FNST";"Ecarts de conversion passif";"false";"477";"";"";"";"false";"false";"BILAN PASSIF"
-"FNST";"Coût d'achats de matières premières et autres approvisionnements";"true";"";"";"";"";"false";"false";"CHARGES D'EXPLOITATION"
-"FNST";"Achats de matières premières et autres approvisionnements";"false";"601, 602, 6081, 6082, 6091, 6092";"";"";"";"false";"false";"Coût d'achats de matières premières et autres approvisionnements"
-"FNST";"Variation des stock";"false";"6037";"";"";"";"false";"false";"Coût d'achats de matières premières et autres approvisionnements"
-"FNST";"Autres achats et charges externes";"false";"604, 605, 606, 6084, 6085, 6086, 6094, 6095, 6096, 61, 62";"";"";"";"false";"false";"CHARGES D'EXPLOITATION"
-"FNST";"Impôts, taxes et versements assimilés";"false";"63";"";"";"";"false";"false";"CHARGES D'EXPLOITATION"
-"FNST";"Salaires et traitements";"false";"641, 644, 648";"";"";"";"false";"false";"CHARGES D'EXPLOITATION"
-"FNST";"Charges sociales";"false";"645, 646, 647, 648";"";"";"";"false";"false";"CHARGES D'EXPLOITATION"
-"FNST";"Dotations aux amortis. & provisions";"true";" ";" ";" ";" ";"false";"true";"CHARGES D'EXPLOITATION"
-"FNST";"Autres charges";"false";"65 -655";"";"";"";"false";"false";"CHARGES D'EXPLOITATION"
-"FNST";"Quotes-parts de résultat sur opérations faites en commun";"false";"655";"";"";"";"false";"false";"CHARGES"
-"FNST";"Charges financières";"true";"";"";"";"";"false";"true";"CHARGES"
-"FNST";"Dotations aux amortissements et provisions";"false";"686";"";"";"";"false";"false";"Charges financières"
-"FNST";"Intérêts et charges assimilées";"false";"661, 664, 665, 668";"";"";"";"false";"false";"Charges financières"
-"FNST";"Différences négatives de change";"false";"666";"";"";"";"false";"false";"Charges financières"
-"FNST";"Charges nettes sur cessions de valeurs mobilières de placement";"false";"667";"";"";"";"false";"false";"Charges financières"
-"FNST";"Charges exceptionnelles";"true";"";"";"";"";"false";"true";"CHARGES"
-"FNST";"Sur opérations de gestion";"false";"671";"";"";"";"false";"false";"Charges exceptionnelles"
-"FNST";"Sur opérations en capital";"false";"675, 678";"";"";"";"false";"false";"Charges exceptionnelles"
-"FNST";"Dotations aux amortissements et aux provisions";"false";"687";"";"";"";"false";"false";"Charges exceptionnelles"
-"FNST";"Participation des salariés aux résultats";"false";"691";"";"";"";"false";"false";"CHARGES"
-"FNST";"Impôts sur les bénéfices";"false";"695, 697, 689, 698, 699, 789";"";"";"";"false";"false";"CHARGES"
-"FNST";"Produits d'exploitation";"true";"";"";"";"";"true";"false";"PRODUITS"
-"FNST";"Montant net Chiffre d'affaires";"true";"";"";"";"";"false";"true";"Produits d'exploitation"
-"FNST";"Production vendue (B&S)";"false";"70 -707 -708-7097";"";"";"";"false";"false";"Montant net Chiffre d'affaires"
-"FNST";"Ventes de marchandises";"false";"707, 708 -7097";"";"";"";"false";"false";"Montant net Chiffre d'affaires"
-"FNST";"Autres produits d'exploitation";"true";"";"";"";"";"false";"true";"Produits d'exploitation"
-"FNST";"Production stockée";"false";"713";"";"";"";"false";"false";"Autres produits d'exploitation"
-"FNST";"Production immobilisée";"false";"72, 73";"";"";"";"false";"false";"Autres produits d'exploitation"
-"FNST";"Subventions d'exploitation";"false";"74";"";"";"";"false";"false";"Autres produits d'exploitation"
-"FNST";"Reprises sur provisions (et amortissements), transferts de charges";"false";"781, 791";"";"";"";"false";"false";"Autres produits d'exploitation"
-"FNST";"Autres produits";"false";"75 -755";"";"";"";"false";"false";"Autres produits d'exploitation"
-"FNST";"Quote-parts de résultat sur opérations faites en commun";"false";"755";"";"";"";"false";"false";"PRODUITS"
-"FNST";"Produits financiers";"true";"";"";"";"";"false";"true";"PRODUITS"
-"FNST";"De participations";"false";"761";"";"";"";"false";"false";"Produits financiers"
-"FNST";"D'autres valeurs mobilières et créances de l'actif immobilisé";"false";"762";"";"";"";"false";"false";"Produits financiers"
-"FNST";"Autres intérêts et produits assimilés";"false";"763, 764, 765, 768";"";"";"";"false";"false";"Produits financiers"
-"FNST";"Reprises sur provisions et transfers de charges";"false";"786, 796";"";"";"";"false";"false";"Produits financiers"
-"FNST";"Différences positives de change";"false";"766";"";"";"";"false";"false";"Produits financiers"
-"FNST";"Produits nets sur cessions de valeurs mobilières de placement";"false";"767";"";"";"";"false";"false";"Produits financiers"
-"FNST";"Produits exceptionnels";"true";"";"";"";"";"false";"true";"PRODUITS"
-"FNST";"Reprises sur provisions et transferts de charges";"false";"787, 797";"";"";"";"false";"false";"Produits exceptionnels"
-"FNST";"Sur immobilisations : dotations aux amortissements";"false";"6811, 6812";"";"";"";"false";"false";"Dotations aux amortis. & provisions"
-"FNST";"Sur immobilisations : dotations aux provisions";"false";"6816";"";"";"";"false";"false";"Dotations aux amortis. & provisions"
-"FNST";"Sur actif circulant : dotations aux provisions";"false";"6817";"";"";"";"false";"false";"Dotations aux amortis. & provisions"
-"FNST";"Pour risques et charges : dotations aux provisions";"false";"6815";"";"";"";"false";"false";"Dotations aux amortis. & provisions"
-"FNST";"Créance d'exploitation";"true";"";"";"";"";"false";"false";"Créances"
-"FNST";"Créances clients et Comptes rattachés";"false";"411, 413, 416, 418";"";"";"491";"false";"false";"Créance d'exploitation"
-"FNST";"Créances diverses";"false";"4411, 4418, 4487, 4456, 462, 465, 4687";"443, 444, 451, 456, 458, 467 -4562";"";"";"false";"false";"Créances"
-"FNST";"Capital souscrit et appelé, non versé";"false";"4562";"";"";"";"false";"false";"Créances"
-"FNST";"Dettes d'exploitation";"true";"";"";"";"";"false";"false";"DETTES"
-"FNST";"Dettes fournisseurs et comptes rattachés";"false";"401, 403, 4081";"";"";"";"false";"false";"Dettes d'exploitation"
-"FNST";"Dettes fiscales et sociales";"false";"421, 422, 424, 427, 4282, 4286, 431, 437, 4386, 4455, 446, 447, 4486";"";"4458";"";"false";"false";"Dettes d'exploitation"
-"FNST";"Dettes diverses";"true";"";"";"";"";"false";"false";"DETTES"
-"FNST";"Dettes sur immobilisations et Comptes rattachés";"false";"269, 279, 404, 405, 4084";"";"";"";"false";"false";"Dettes diverses"
-"FNST";"Dettes fiscales (impôts sur les bénéfices)";"false";"";"";"444";"";"false";"false";"Dettes diverses"
-"FNST";"Autres";"false";"275, 2761, 27685, 27688";"";"";"2975, 2976";"false";"false";"Immobilisations financières"
-"FNST";"Autres";"false";"218";"";"";"2818";"false";"false";"Immobilisations corporelles"
-"FNST";"Autres";"false";"1068";"";"";"";"false";"false";"Réserves"
-"FNST";"Autres";"false";"";"";"";"";"false";"false";"AUTRES FONDS PROPRES"
-"FNST";"Autres";"false";"4096, 4097, 4098, 425, 4287, 4387, 4417, 4456, 4487";"4458";"";"495, 496";"false";"false";"Créance d'exploitation"
-"FNST";"Autres";"false";"4196, 4197, 4198, 4419";"";"";"";"false";"false";"Dettes d'exploitation"
-"FNST";"Autres";"false";"424, 426, 4284, 4419, 442, 4486, 457, 464, 467, 4686, 509";"";"443, 451, 455, 456, 458";"";"false";"false";"Dettes diverses"
-"FNST";"Avances et acomptes";"false";"238";"";"";"";"false";"false";"Immobilisations corporelles"
-"FNST";"Sur opérations de gestion";"false";"771";"";"";"";"false";"false";"Produits exceptionnels"
-"FNST";"Sur opérations en capital";"false";"775, 777, 778";"";"";"";"false";"false";"Produits exceptionnels"
+"FNST";"BILAN ACTIF";"true";"";"";"";"";"true";"false";"";"BOTH"
+"FNST";"Capital Souscrit non appelé";"false";"109";" ";" ";" ";"false";"false";"BILAN ACTIF";""
+"FNST";"BILAN PASSIF";"true";"";"";"";"";"true";"false";"";"BOTH"
+"FNST";"CAPITAUX PROPRES";"true";"";"";"";"";"true";"false";"BILAN PASSIF";"BOTH"
+"FNST";"COMPTE DE RESULTAT";"true";"";"";"";"";"false";"false";"";"BOTH"
+"FNST";"Capital (dont versé?)";"false";"101, 108, 1013";"";"";"";"false";"false";"CAPITAUX PROPRES";""
+"FNST";"CHARGES";"true";" ";" ";" ";" ";"true";"false";"COMPTE DE RESULTAT";"DEBIT"
+"FNST";"PRODUITS";"true";"";"";"";"";"true";"false";"COMPTE DE RESULTAT";"CREDIT"
+"FNST";"ACTIF IMMOBILISÉ";"true";" ";" ";" ";" ";"true";"false";"BILAN ACTIF";"BOTH"
+"FNST";"ACTIF CIRCULANT";"true";"";"";"";"";"true";"false";"BILAN ACTIF";"BOTH"
+"FNST";"CHARGES D'EXPLOITATION";"true";"";"";"";"";"true";"false";"CHARGES";"DEBIT"
+"FNST";"Coût d'achat des marchandises";"true";"";"";"";"";"false";"true";"CHARGES D'EXPLOITATION";"DEBIT"
+"FNST";"Stocks et en-cours";"true";"";"";"";"";"false";"true";"ACTIF CIRCULANT";"BOTH"
+"FNST";"Marchandises";"false";"37";"";"";"397";"false";"false";"Stocks et en-cours";""
+"FNST";"Variations de stocks de march.";"false";"6037";"";"";"";"false";"false";"Coût d'achat des marchandises";""
+"FNST";"Achat de marchandises";"false";"607, 6087, 6097";"";"";"";"false";"false";"Coût d'achat des marchandises";""
+"FNST";"Immobilisations incorporelles";"true";"";"";"";"";"false";"false";"ACTIF IMMOBILISÉ";"BOTH"
+"FNST";"Frais d'établissement";"false";"201";"";"";"2801";"false";"false";"Immobilisations incorporelles";""
+"FNST";"Frais de recherche et développement";"false";"203";"";"";"2803";"false";"false";"Immobilisations incorporelles";""
+"FNST";"Concessions, brevets, licences, marques, procédés, logiciels, droits et valeurs similaires";"false";"205";"";"";"2805, 2905";"false";"false";"Immobilisations incorporelles";""
+"FNST";"Fonds commercial";"false";"206, 207";"";"";"2807, 2906, 2907";"false";"false";"Immobilisations incorporelles";""
+"FNST";"Autres";"false";"208";"";"";"2808, 2908";"false";"false";"Immobilisations incorporelles";""
+"FNST";"Immobilisations incorporelles en cours";"false";"232";"";"";"2932";"false";"false";"Immobilisations incorporelles";""
+"FNST";"Avances et acomptes";"false";"237";"";"";"";"false";"false";"Immobilisations incorporelles";""
+"FNST";"Immobilisations corporelles";"true";"";"";"";"";"false";"false";"ACTIF IMMOBILISÉ";"BOTH"
+"FNST";"Terrains";"false";"211, 212";"";"";"2811, 2812, 2911";"false";"false";"Immobilisations corporelles";""
+"FNST";"Constructions";"false";"213, 214";"";"";"2813, 2814";"false";"false";"Immobilisations corporelles";""
+"FNST";"Installations techniques, matériels, et outillage industriels";"false";"215";"";"";"2815";"false";"false";"Immobilisations corporelles";""
+"FNST";"Immobilisations corporelles en cours";"false";"231";"";"";"2931";"false";"false";"Immobilisations corporelles";""
+"FNST";"Immobilisations financières";"true";"";"";"";"";"false";"false";"ACTIF IMMOBILISÉ";"BOTH"
+"FNST";"Participations";"false";"261, 266";"";"";"2961, 2966";"false";"false";"Immobilisations financières";""
+"FNST";"Créances rattachées à des participations";"false";"267, 268";"";"";"2967, 2968";"false";"false";"Immobilisations financières";""
+"FNST";"Titres immobilisés de l'activité de portefeuille";"false";"273";"";"";"2973";"false";"false";"Immobilisations financières";""
+"FNST";"Autres titres immobilisés";"false";"271, 272, 27682";"";"";"2971, 2972";"false";"false";"Immobilisations financières";""
+"FNST";"Prêts";"false";"274, 27684";"";"";"2974";"false";"false";"Immobilisations financières";""
+"FNST";"Matières premières et autres approvisionnements";"false";"31, 32";"";"";"391, 392";"false";"false";"Stocks et en-cours";""
+"FNST";"En cours de production (biens et services)";"false";"33, 34";"";"";"393, 394";"false";"false";"Stocks et en-cours";""
+"FNST";"Produits intermédiaires et finis";"false";"35";"";"";"395";"false";"false";"Stocks et en-cours";""
+"FNST";"Avances et acomptes versés sur commandes";"false";"4091";"";"";"";"false";"false";"ACTIF CIRCULANT";""
+"FNST";"Créances";"true";"";"";"";"";"false";"false";"ACTIF CIRCULANT";"BOTH"
+"FNST";"Valeurs mobilières de placement";"true";"";"";"";"";"false";"false";"ACTIF CIRCULANT";"BOTH"
+"FNST";"Actions propres";"false";"502";"";"";"59";"false";"false";"Valeurs mobilières de placement";""
+"FNST";"Autres titres";"false";"50 -502 -509";"";"";"59";"false";"false";"Valeurs mobilières de placement";""
+"FNST";"Disponibilités";"false";"53, 54 -5181 -519";"51";"";"";"false";"false";"ACTIF CIRCULANT";""
+"FNST";"Charges constatées d'avance";"false";"486";"";"";"";"false";"false";"ACTIF CIRCULANT";""
+"FNST";"Instrument de trésorerie";"false";"";"52";"";"";"false";"false";"Valeurs mobilières de placement";""
+"FNST";"Charges à répartir sur plusieurs exercices";"false";"481";"";"";"";"false";"false";"BILAN ACTIF";""
+"FNST";"Primes de remboursement des emprunts";"false";"169";"";"";"";"false";"false";"BILAN ACTIF";""
+"FNST";"Ecarts de conversion Actif";"false";"476";"";"";"";"false";"false";"BILAN ACTIF";""
+"FNST";"Primes d'émission, de fusion, d'apport";"false";"104";"";"";"";"false";"false";"CAPITAUX PROPRES";""
+"FNST";"Ecart de réévaluation";"false";"105";"";"";"";"false";"false";"CAPITAUX PROPRES";""
+"FNST";"Ecart d'équivalence";"false";"107";"";"";"";"false";"false";"CAPITAUX PROPRES";""
+"FNST";"Réserves";"true";"";"";"";"";"false";"false";"CAPITAUX PROPRES";"BOTH"
+"FNST";"Réserve légale";"false";"1061";"";"";"";"false";"false";"Réserves";""
+"FNST";"Réserves statutaires ou contractuelles";"false";"1063";"";"";"";"false";"false";"Réserves";""
+"FNST";"Réserves réglementées";"false";"1062, 1064";"";"";"";"false";"false";"Réserves";""
+"FNST";"Report à nouveau";"false";"110-119";"";"";"";"false";"false";"CAPITAUX PROPRES";""
+"FNST";"RÉSULTAT DE L'EXERCICE (BÉNÉFICE OU PERTE)";"false";"7-6";"";"";"";"false";"false";"CAPITAUX PROPRES";""
+"FNST";"Subventions d'investissement";"false";"13";"";"";"";"false";"false";"CAPITAUX PROPRES";""
+"FNST";"Provisions réglementées";"false";"14";"";"";"";"false";"false";"CAPITAUX PROPRES";""
+"FNST";"AUTRES FONDS PROPRES";"true";"";"";"";"";"true";"false";"BILAN PASSIF";"BOTH"
+"FNST";"Produits des émissions de titres participatifs";"false";"1671";"";"";"";"false";"false";"AUTRES FONDS PROPRES";""
+"FNST";"Avances conditionnées";"false";"1674";"";"";"";"false";"false";"AUTRES FONDS PROPRES";""
+"FNST";"PROVISIONS POUR RISQUES ET CHARGES";"true";"";"";"";"";"true";"false";"BILAN PASSIF";"BOTH"
+"FNST";"Provisions pour risques";"false";"151";"";"";"";"false";"false";"PROVISIONS POUR RISQUES ET CHARGES";""
+"FNST";"Provisions pour charges";"false";"15 -151";"";"";"";"false";"false";"PROVISIONS POUR RISQUES ET CHARGES";""
+"FNST";"DETTES";"true";"";"";"";"";"true";"false";"BILAN PASSIF";"BOTH"
+"FNST";"Emprunts obligataires convertibles";"false";"161, 16881";"";"";"";"false";"false";"DETTES";""
+"FNST";"Autres emprunts obligataires";"false";"163, 16683";"";"";"";"false";"false";"DETTES";""
+"FNST";"Emprunts et dettes auprès établissements de crédits";"false";"164, 16684, 5181, 519";"";"512, 514, 517";"";"false";"false";"DETTES";""
+"FNST";"Emprunts et dettes financières diverses";"false";"165, 166, 1675, 168, 16883, 17, 426 -16881 -457";"";"45";"";"false";"false";"DETTES";""
+"FNST";"Avances et acomptes reçues sur commandes en cours";"false";"4191";"";"";"";"false";"false";"DETTES";""
+"FNST";"Ecarts de conversion passif";"false";"477";"";"";"";"false";"false";"BILAN PASSIF";""
+"FNST";"Coût d'achats de matières premières et autres approvisionnements";"true";"";"";"";"";"false";"false";"CHARGES D'EXPLOITATION";"DEBIT"
+"FNST";"Achats de matières premières et autres approvisionnements";"false";"601, 6081, 6091";"";"";"";"false";"false";"Coût d'achats de matières premières et autres approvisionnements";""
+"FNST";"Variation des stock";"false";"6031, 6032";"";"";"";"false";"false";"Coût d'achats de matières premières et autres approvisionnements";""
+"FNST";"Salaires et traitements";"false";"641, 644, 648";"";"";"";"false";"false";"CHARGES D'EXPLOITATION";""
+"FNST";"Charges sociales";"false";"645, 646, 647, 648";"";"";"";"false";"false";"CHARGES D'EXPLOITATION";""
+"FNST";"Dotations aux amortis. & provisions";"true";" ";" ";" ";" ";"false";"true";"CHARGES D'EXPLOITATION";"DEBIT"
+"FNST";"Autres charges";"false";"65 -655";"";"";"";"false";"false";"CHARGES D'EXPLOITATION";""
+"FNST";"Quotes-parts de résultat sur opérations faites en commun";"false";"655";"";"";"";"false";"false";"CHARGES";""
+"FNST";"Charges financières";"true";"";"";"";"";"false";"true";"CHARGES";"DEBIT"
+"FNST";"Dotations aux amortissements et provisions";"false";"686";"";"";"";"false";"false";"Charges financières";""
+"FNST";"Intérêts et charges assimilées";"false";"661, 664, 665, 668";"";"";"";"false";"false";"Charges financières";""
+"FNST";"Différences négatives de change";"false";"666";"";"";"";"false";"false";"Charges financières";""
+"FNST";"Charges nettes sur cessions de valeurs mobilières de placement";"false";"667";"";"";"";"false";"false";"Charges financières";""
+"FNST";"Charges exceptionnelles";"true";"";"";"";"";"false";"true";"CHARGES";"DEBIT"
+"FNST";"Sur opérations de gestion";"false";"671";"";"";"";"false";"false";"Charges exceptionnelles";""
+"FNST";"Participation des salariés aux résultats";"false";"691";"";"";"";"false";"false";"CHARGES";""
+"FNST";"Impôts sur les bénéfices";"false";"695, 697, 689, 698, 699, 789";"";"";"";"false";"false";"CHARGES";""
+"FNST";"Produits d'exploitation";"true";"";"";"";"";"true";"false";"PRODUITS";"CREDIT"
+"FNST";"Production vendue";"true";"";"";"";"";"false";"true";"Produits d'exploitation";"CREDIT"
+"FNST";"Ventes";"false";"701, 702, 703, 707, 708, 7091, 7092, 7097, 7098";"";"";"";"false";"false";"Production vendue";""
+"FNST";"Travaux";"false";"704, 708, 7094, 7098";"";"";"";"false";"false";"Production vendue";""
+"FNST";"Autres produits d'exploitation";"true";"";"";"";"";"false";"true";"Produits d'exploitation";"CREDIT"
+"FNST";"Quote-parts de résultat sur opérations faites en commun";"false";"755";"";"";"";"false";"false";"PRODUITS";""
+"FNST";"Produits financiers";"true";"";"";"";"";"false";"true";"PRODUITS";"CREDIT"
+"FNST";"De participations";"false";"761";"";"";"";"false";"false";"Produits financiers";""
+"FNST";"D'autres valeurs mobilières et créances de l'actif immobilisé";"false";"762";"";"";"";"false";"false";"Produits financiers";""
+"FNST";"Autres intérêts et produits assimilés";"false";"763, 764, 765, 768";"";"";"";"false";"false";"Produits financiers";""
+"FNST";"Reprises sur provisions et transfers de charges";"false";"786, 796";"";"";"";"false";"false";"Produits financiers";""
+"FNST";"Différences positives de change";"false";"766";"";"";"";"false";"false";"Produits financiers";""
+"FNST";"Produits nets sur cessions de valeurs mobilières de placement";"false";"767";"";"";"";"false";"false";"Produits financiers";""
+"FNST";"Produits exceptionnels";"true";"";"";"";"";"false";"true";"PRODUITS";"CREDIT"
+"FNST";"Reprises sur provisions et transferts de charges";"false";"787, 797";"";"";"";"false";"false";"Produits exceptionnels";""
+"FNST";"Sur immobilisations : dotations aux amortissements";"false";"6811, 6812";"";"";"";"false";"false";"Dotations aux amortis. & provisions";""
+"FNST";"Sur immobilisations : dotations aux provisions";"false";"6816";"";"";"";"false";"false";"Dotations aux amortis. & provisions";""
+"FNST";"Sur actif circulant : dotations aux provisions";"false";"6817";"";"";"";"false";"false";"Dotations aux amortis. & provisions";""
+"FNST";"Pour risques et charges : dotations aux provisions";"false";"6815";"";"";"";"false";"false";"Dotations aux amortis. & provisions";""
+"FNST";"Créance d'exploitation";"true";"";"";"";"";"false";"false";"Créances";"BOTH"
+"FNST";"Créances clients et Comptes rattachés";"false";"410, 411, 413, 416, 418";"";"";"491";"false";"false";"Créance d'exploitation";""
+"FNST";"Créances diverses";"false";"4411, 4418, 462, 465, 4687";"443, 444, 451, 456, 458, 467 -4562";"";"";"false";"false";"Créances";""
+"FNST";"Capital souscrit et appelé, non versé";"false";"4562";"";"";"";"false";"false";"Créances";""
+"FNST";"Dettes d'exploitation";"true";"";"";"";"";"false";"false";"DETTES";"BOTH"
+"FNST";"Dettes fournisseurs et comptes rattachés";"false";"400, 401, 403, 4081, 4088";"";"";"";"false";"false";"Dettes d'exploitation";""
+"FNST";"Dettes fiscales et sociales";"false";"421, 422, 424, 427, 4282, 4286, 431, 437, 4386, 4455, 4457, 446, 447, 4486";"";"4458";"";"false";"false";"Dettes d'exploitation";""
+"FNST";"Dettes diverses";"true";"";"";"";"";"false";"false";"DETTES";"BOTH"
+"FNST";"Dettes sur immobilisations et Comptes rattachés";"false";"269, 279, 404, 405, 4084";"";"";"";"false";"false";"Dettes diverses";""
+"FNST";"Dettes fiscales (impôts sur les bénéfices)";"false";"";"";"444";"";"false";"false";"Dettes diverses";""
+"FNST";"Sur opérations en capital";"false";"775, 777, 778";"";"";"";"false";"false";"Produits exceptionnels";""
+"FNST";"Prestation de services";"false";"705, 706, 708, 7095, 7096, 7098";"";"";"";"false";"false";"Production vendue";""
+"FNST";"Production stockée";"true";"";"";"";"";"false";"true";"Autres produits d'exploitation";"CREDIT"
+"FNST";"En-cours de production de biens";"false";"7133";"";"";"";"false";"false";"Production stockée";""
+"FNST";"En-cours de production de services";"false";"7134";"";"";"";"false";"false";"Production stockée";""
+"FNST";"Produits";"false";"7135";"";"";"";"false";"false";"Production stockée";""
+"FNST";"Reprises sur provisions (et amortissements), transferts de charges";"true";"";"";"";"";"false";"true";"Autres produits d'exploitation";"CREDIT"
+"FNST";"Reprises sur provisions (et amortissements)";"false";"781";"";"";"";"false";"false";"Reprises sur provisions (et amortissements), transferts de charges";""
+"FNST";"Transferts de charges";"false";"791";"";"";"";"false";"false";"Reprises sur provisions (et amortissements), transferts de charges";""
+"FNST";"Production exceptionnels sur opérations en capital";"true";"";"";"";"";"false";"true";"Autres produits d'exploitation";"CREDIT"
+"FNST";"Produits des cessions d'éléments d'actif";"false";"775";"";"";"";"false";"false";"Production exceptionnels sur opérations en capital";""
+"FNST";"Subvention d'investissement virées au résultat de l'exercice";"false";"778";"";"";"";"false";"false";"Production exceptionnels sur opérations en capital";""
+"FNST";"Autres approvisionnements";"false";"602, 6082, 6092";"";"";"";"false";"false";"Coût d'achats de matières premières et autres approvisionnements";""
+"FNST";"Autres charges et charges externes";"true";"";"";"";"";"false";"true";"CHARGES D'EXPLOITATION";"DEBIT"
+"FNST";"Achats de sous-traitance";"false";"604, 6084, 6094, 6095";"";"";"";"false";"false";"Autres charges et charges externes";""
+"FNST";"Achats non stockés de matières et fournitures";"false";"605, 606, 6085, 6086, 6096";"";"";"";"false";"false";"Autres charges et charges externes";""
+"FNST";"Services extérieurs";"true";"";"";"";"";"false";"true";"Autres charges et charges externes";"DEBIT"
+"FNST";"Personnel extérieur";"false";"621";"";"";"";"false";"false";"Services extérieurs";""
+"FNST";"Loyers en crédit-bail mobilier";"false";"6122";"";"";"";"false";"false";"Services extérieurs";""
+"FNST";"Loyers en crédit-bail immobilier";"false";"";"";"";"";"false";"false";"Services extérieurs";""
+"FNST";"Impôts, taxes et versements assimilés";"true";"";"";"";"";"false";"true";"CHARGES D'EXPLOITATION";"DEBIT"
+"FNST";"sur rémunérations";"false";"631, 633";"";"";"";"false";"false";"Impôts, taxes et versements assimilés";""
+"FNST";"autres";"false";"635, 637";"";"";"";"false";"false";"Impôts, taxes et versements assimilés";""
+"FNST";"sur opération en capital";"true";"";"";"";"";"false";"true";"Charges exceptionnelles";"DEBIT"
+"FNST";"valeurs comptables des éléments immobiliers et financiers cédés";"false";"675";"";"";"";"false";"false";"sur opération en capital";""
+"FNST";"Dotations aux amortissements et aux provisions";"true";"";"";"";"";"false";"true";"Charges exceptionnelles";"DEBIT"
+"FNST";"Dotations aux provisions réglementées";"false";"6872, 6873, 6874";"";"";"";"false";"false";"Dotations aux amortissements et aux provisions";""
+"FNST";"dotations aux amortissements et aux provisions";"false";"6871, 6875, 6876";"";"";"";"false";"false";"Dotations aux amortissements et aux provisions";""
+"FNST";"Produits constatés d'avance";"false";"487";"";"";"";"false";"false";"DETTES";""
+"FNST";"Autres";"false";"275, 2761, 27685, 27688";"";"";"2975, 2976";"false";"false";"Immobilisations financières";""
+"FNST";"Autres";"false";"218";"";"";"2818";"false";"false";"Immobilisations corporelles";""
+"FNST";"Autres";"false";"1068";"";"";"";"false";"false";"Réserves";""
+"FNST";"Autres";"false";"";"";"";"";"false";"false";"AUTRES FONDS PROPRES";""
+"FNST";"Autres";"false";"4096, 4097, 4098, 425, 4287, 4387, 4417, 4452, 4456, 4487";"4458";"";"495, 496";"false";"false";"Créance d'exploitation";""
+"FNST";"Autres";"false";"4196, 4197, 4198, 4419";"";"";"";"false";"false";"Dettes d'exploitation";""
+"FNST";"Autres";"false";"424, 426, 4284, 4419, 442, 4486, 457, 464, 467, 4686, 509";"";"443, 451, 455, 456, 458";"";"false";"false";"Dettes diverses";""
+"FNST";"Autres";"false";"61, 62 -6122 -6125 -621";"";"";"";"false";"false";"Services extérieurs";""
+"FNST";"Avances et acomptes";"false";"238";"";"";"";"false";"false";"Immobilisations corporelles";""
+"FNST";"Sur opérations de gestion";"false";"771";"";"";"";"false";"false";"Produits exceptionnels";""
+"FNST";"autres";"false";"678";"";"";"";"false";"false";"sur opération en capital";""
Modified: trunk/lima-swing/src/main/resources/import/bcr_shortened.csv
===================================================================
--- trunk/lima-swing/src/main/resources/import/bcr_shortened.csv 2010-08-16 13:11:52 UTC (rev 3004)
+++ trunk/lima-swing/src/main/resources/import/bcr_shortened.csv 2010-08-17 15:34:26 UTC (rev 3005)
@@ -1,68 +1,68 @@
-"FNST";"BILAN ACTIF";"true";"";"";"";"";"true";"false";""
-"FNST";"BILAN PASSIF";"true";"";"";"";"";"true";"false";""
-"FNST";"CAPITAUX PROPRES";"true";"";"";"";"";"true";"false";"BILAN PASSIF"
-"FNST";"COMPTE DE RESULTAT";"true";"";"";"";"";"false";"false";""
-"FNST";"Capital";"false";"101, 108";"";"";"";"false";"false";"CAPITAUX PROPRES"
-"FNST";"CHARGES";"true";" ";" ";" ";" ";"true";"false";"COMPTE DE RESULTAT"
-"FNST";"CHARGES D'EXPLOITATION ET FINANCIERES";"true";"";"";"";"";"true";"false";"CHARGES"
-"FNST";"PRODUITS";"true";"";"";"";"";"true";"false";"COMPTE DE RESULTAT"
-"FNST";"ACTIF IMMOBILISÉ";"true";" ";" ";" ";" ";"true";"false";"BILAN ACTIF"
-"FNST";"ACTIF CIRCULANT";"true";"";"";"";"";"true";"false";"BILAN ACTIF"
-"FNST";"Stocks et en-cours";"true";"";"";"";"";"false";"true";"ACTIF CIRCULANT"
-"FNST";"Marchandises";"false";"37";"";"";"397";"false";"false";"Stocks et en-cours"
-"FNST";"Immobilisations incorporelles";"true";"";"";"";"";"false";"false";"ACTIF IMMOBILISÉ"
-"FNST";"Fonds commercial";"false";"206, 207";"";"";"";"false";"false";"Immobilisations incorporelles"
-"FNST";"Autres";"false";"201, 208";"";"";"280, 290";"false";"false";"Immobilisations incorporelles"
-"FNST";"Autres";"false";"31, 32, 33, 34, 35";"";"";"391, 393, 394, 395";"false";"false";"Stocks et en-cours"
-"FNST";"Avances et acomptes versés sur commandes";"false";"409";"";"";"";"false";"false";"ACTIF CIRCULANT"
-"FNST";"Créances";"true";"";"";"";"";"false";"false";"ACTIF CIRCULANT"
-"FNST";"Charges constatées d'avance";"false";"486";"";"";"";"false";"false";"BILAN ACTIF"
-"FNST";"Ecart de réévaluation";"false";"105";"";"";"";"false";"false";"CAPITAUX PROPRES"
-"FNST";"Réserves";"true";"";"";"";"";"false";"false";"CAPITAUX PROPRES"
-"FNST";"Réserve légale";"false";"1061";"";"";"";"false";"false";"Réserves"
-"FNST";"Réserves réglementées";"false";"1064";"";"";"";"false";"false";"Réserves"
-"FNST";"Report à nouveau";"false";"110";"";"";"";"false";"false";"CAPITAUX PROPRES"
-"FNST";"RÉSULTAT DE L'EXERCICE (BÉNÉFICE OU PERTE)";"false";"7-6";"";"";"";"false";"false";"CAPITAUX PROPRES"
-"FNST";"Provisions réglementées";"false";"145, 146, 147, 148";"";"";"";"false";"false";"CAPITAUX PROPRES"
-"FNST";"Provisions pour risques et charges";"false";"15";"";"";"";"false";"false";"BILAN PASSIF"
-"FNST";"DETTES";"true";"";"";"";"";"true";"false";"BILAN PASSIF"
-"FNST";"Emprunts et dettes assimilées";"false";"16";"";"";"";"false";"false";"DETTES"
-"FNST";"Avances et acomptes reçues sur commandes en cours";"false";"419";"";"";"";"false";"false";"DETTES"
-"FNST";"Immobilisations corporelles";"false";"21, 23";"";"";"281, 291";"false";"false";"ACTIF IMMOBILISÉ"
-"FNST";"Immobilisations financières";"false";"27";"";"";"297";"false";"false";"ACTIF IMMOBILISÉ"
-"FNST";"Clients et comptes rattachés";"false";"410";"";"";"491";"false";"false";"Créances"
-"FNST";"Valeurs mobilières de placement";"false";"50";"";"";"590";"false";"false";"ACTIF CIRCULANT"
-"FNST";"Disponibilités (autres que caisse)";"false";"54, 58";"51";"";"";"false";"false";"ACTIF CIRCULANT"
-"FNST";"Caisse";"false";"53";"";"";"";"false";"false";"ACTIF CIRCULANT"
-"FNST";"Fournisseurs et comptes rattachés";"false";"400";"";"";"";"false";"false";"DETTES"
-"FNST";"Produits constatés d'avance";"false";"487";"";"";"";"false";"false";"BILAN PASSIF"
-"FNST";"Charges exceptionnelles";"false";"67, 687, 691";"";"";"";"false";"false";"CHARGES"
-"FNST";"Impôts sur les bénéfices";"false";"695, 697";"";"";"";"false";"false";"CHARGES"
-"FNST";"PRODUITS D'EXPLOITATION ET FINANCIERS";"true";"";"";"";"";"true";"false";"PRODUITS"
-"FNST";"Produits d'exploitation";"true";"";"";"";"";"false";"false";"PRODUITS D'EXPLOITATION ET FINANCIERS"
-"FNST";"Produits financiers";"false";"76, 786, 79";"";"";"";"false";"false";"PRODUITS D'EXPLOITATION ET FINANCIERS"
-"FNST";"Ventes de marchandises";"false";"707, 709";"";"";"";"false";"false";"Produits d'exploitation"
-"FNST";"Production vendue (bien et services)";"false";"701, 706, 708, 709";"";"";"";"false";"false";"Produits d'exploitation"
-"FNST";"Production stockée";"false";"713";"";"";"";"false";"false";"Produits d'exploitation"
-"FNST";"Production immobilisée";"false";"72";"";"";"";"false";"false";"Produits d'exploitation"
-"FNST";"Subventions d'exploitation";"false";"74";"";"";"";"false";"false";"Produits d'exploitation"
-"FNST";"Autres produits";"false";"75, 781, 79";"";"";"";"false";"false";"Produits d'exploitation"
-"FNST";"Produits exceptionnels";"false";"77, 787, 79";"";"";"";"false";"false";"PRODUITS"
-"FNST";"Charges d'exploitation";"true";"";"";"";"";"true";"false";"CHARGES D'EXPLOITATION ET FINANCIERES"
-"FNST";"Coût d'achat des marchandises";"true";"";"";"";"";"false";"true";"Charges d'exploitation"
-"FNST";"Variations de stocks de march.";"false";"6037";"";"";"";"false";"false";"Coût d'achat des marchandises"
-"FNST";"Achat de marchandises";"false";"607";"";"";"";"false";"false";"Coût d'achat des marchandises"
-"FNST";"Coût d'achats des approvisionnements";"true";"";"";"";"";"false";"false";"Charges d'exploitation"
-"FNST";"Achats d'approvisionnements";"false";"60 -607";"";"";"";"false";"false";"Coût d'achats des approvisionnements"
-"FNST";"Variation des stock (approvisionnements)";"false";"6031, 6032";"";"";"";"false";"false";"Coût d'achats des approvisionnements"
-"FNST";"Autres charges externes";"false";"61, 62";"";"";"";"false";"false";"Charges d'exploitation"
-"FNST";"Impôts, taxes et versements assimilés";"false";"63";"";"";"";"false";"false";"Charges d'exploitation"
-"FNST";"Rémunération du personnel";"false";"641, 644";"";"";"";"false";"false";"Charges d'exploitation"
-"FNST";"Charges sociales";"false";"645, 646";"";"";"";"false";"false";"Charges d'exploitation"
-"FNST";"Dotations aux amortissements";"false";"6811";"";"";"";"false";"false";"Charges d'exploitation"
-"FNST";"Dotations aux provisions";"false";"6815, 6816, 6817";"";"";"";"false";"false";"Charges d'exploitation"
-"FNST";"Autres charges";"false";"65";"";"";"";"false";"false";"Charges d'exploitation"
-"FNST";"Charges financières";"false";"66, 686";"";"";"";"false";"false";"CHARGES D'EXPLOITATION ET FINANCIERES"
-"FNST";"Autres";"false";"1063, 1068";"";"";"";"false";"false";"Réserves"
-"FNST";"Autres";"false";"409, 428, 46";"43, 444, 445, 455";"";"496";"false";"false";"Créances"
-"FNST";"Autres";"false";"419, 421, 428, 447, 46";"";"43, 444, 445, 455";"";"false";"false";"DETTES"
+"FNST";"BILAN ACTIF";"true";"";"";"";"";"true";"false";"";"BOTH"
+"FNST";"BILAN PASSIF";"true";"";"";"";"";"true";"false";"";"BOTH"
+"FNST";"CAPITAUX PROPRES";"true";"";"";"";"";"true";"false";"BILAN PASSIF";"BOTH"
+"FNST";"COMPTE DE RESULTAT";"true";"";"";"";"";"false";"false";"";"BOTH"
+"FNST";"Capital";"false";"101, 108";"";"";"";"false";"false";"CAPITAUX PROPRES";""
+"FNST";"CHARGES";"true";" ";" ";" ";" ";"true";"false";"COMPTE DE RESULTAT";"DEBIT"
+"FNST";"CHARGES D'EXPLOITATION ET FINANCIERES";"true";"";"";"";"";"true";"false";"CHARGES";"DEBIT"
+"FNST";"PRODUITS";"true";"";"";"";"";"true";"false";"COMPTE DE RESULTAT";"CREDIT"
+"FNST";"ACTIF IMMOBILISÉ";"true";" ";" ";" ";" ";"true";"false";"BILAN ACTIF";"BOTH"
+"FNST";"ACTIF CIRCULANT";"true";"";"";"";"";"true";"false";"BILAN ACTIF";"BOTH"
+"FNST";"Stocks et en-cours";"true";"";"";"";"";"false";"true";"ACTIF CIRCULANT";"BOTH"
+"FNST";"Marchandises";"false";"37";"";"";"397";"false";"false";"Stocks et en-cours";""
+"FNST";"Immobilisations incorporelles";"true";"";"";"";"";"false";"false";"ACTIF IMMOBILISÉ";"BOTH"
+"FNST";"Fonds commercial";"false";"206, 207";"";"";"";"false";"false";"Immobilisations incorporelles";""
+"FNST";"Autres";"false";"201, 208";"";"";"280, 290";"false";"false";"Immobilisations incorporelles";""
+"FNST";"Autres";"false";"31, 32, 33, 34, 35";"";"";"391, 393, 394, 395";"false";"false";"Stocks et en-cours";""
+"FNST";"Avances et acomptes versés sur commandes";"false";"409";"";"";"";"false";"false";"ACTIF CIRCULANT";""
+"FNST";"Créances";"true";"";"";"";"";"false";"false";"ACTIF CIRCULANT";"BOTH"
+"FNST";"Charges constatées d'avance";"false";"486";"";"";"";"false";"false";"BILAN ACTIF";""
+"FNST";"Ecart de réévaluation";"false";"105";"";"";"";"false";"false";"CAPITAUX PROPRES";""
+"FNST";"Réserves";"true";"";"";"";"";"false";"false";"CAPITAUX PROPRES";"BOTH"
+"FNST";"Réserve légale";"false";"1061";"";"";"";"false";"false";"Réserves";""
+"FNST";"Réserves réglementées";"false";"1064";"";"";"";"false";"false";"Réserves";""
+"FNST";"Report à nouveau";"false";"110-119";"";"";"";"false";"false";"CAPITAUX PROPRES";""
+"FNST";"RÉSULTAT DE L'EXERCICE (BÉNÉFICE OU PERTE)";"false";"7-6";"";"";"";"false";"false";"CAPITAUX PROPRES";""
+"FNST";"Provisions réglementées";"false";"145, 146, 147, 148";"";"";"";"false";"false";"CAPITAUX PROPRES";""
+"FNST";"Provisions pour risques et charges";"false";"15";"";"";"";"false";"false";"BILAN PASSIF";""
+"FNST";"DETTES";"true";"";"";"";"";"true";"false";"BILAN PASSIF";"BOTH"
+"FNST";"Emprunts et dettes assimilées";"false";"16";"";"";"";"false";"false";"DETTES";""
+"FNST";"Avances et acomptes reçues sur commandes en cours";"false";"419";"";"";"";"false";"false";"DETTES";""
+"FNST";"Immobilisations corporelles";"false";"21, 23";"";"";"281, 291";"false";"false";"ACTIF IMMOBILISÉ";""
+"FNST";"Immobilisations financières";"false";"27";"";"";"297";"false";"false";"ACTIF IMMOBILISÉ";""
+"FNST";"Clients et comptes rattachés";"false";"41 - 419";"";"";"491";"false";"false";"Créances";""
+"FNST";"Valeurs mobilières de placement";"false";"50";"";"";"590";"false";"false";"ACTIF CIRCULANT";""
+"FNST";"Disponibilités (autres que caisse)";"false";"54, 58";"51";"";"";"false";"false";"ACTIF CIRCULANT";""
+"FNST";"Caisse";"false";"53";"";"";"";"false";"false";"ACTIF CIRCULANT";""
+"FNST";"Fournisseurs et comptes rattachés";"false";"40";"";"";"";"false";"false";"DETTES";""
+"FNST";"Produits constatés d'avance";"false";"487";"";"";"";"false";"false";"BILAN PASSIF";""
+"FNST";"Charges exceptionnelles";"false";"67, 687, 691";"";"";"";"false";"false";"CHARGES";""
+"FNST";"Impôts sur les bénéfices";"false";"695, 697";"";"";"";"false";"false";"CHARGES";""
+"FNST";"PRODUITS D'EXPLOITATION ET FINANCIERS";"true";"";"";"";"";"true";"false";"PRODUITS";"CREDIT"
+"FNST";"Produits d'exploitation";"true";"";"";"";"";"false";"false";"PRODUITS D'EXPLOITATION ET FINANCIERS";"CREDIT"
+"FNST";"Produits financiers";"false";"76, 786, 79";"";"";"";"false";"false";"PRODUITS D'EXPLOITATION ET FINANCIERS";""
+"FNST";"Ventes de marchandises";"false";"707, 709";"";"";"";"false";"false";"Produits d'exploitation";""
+"FNST";"Production vendue (bien et services)";"false";"701, 706, 708, 709";"";"";"";"false";"false";"Produits d'exploitation";""
+"FNST";"Production stockée";"false";"713";"";"";"";"false";"false";"Produits d'exploitation";""
+"FNST";"Production immobilisée";"false";"72";"";"";"";"false";"false";"Produits d'exploitation";""
+"FNST";"Subventions d'exploitation";"false";"74";"";"";"";"false";"false";"Produits d'exploitation";""
+"FNST";"Autres produits";"false";"75, 781, 79";"";"";"";"false";"false";"Produits d'exploitation";""
+"FNST";"Produits exceptionnels";"false";"77, 787, 79";"";"";"";"false";"false";"PRODUITS";""
+"FNST";"Charges d'exploitation";"true";"";"";"";"";"true";"false";"CHARGES D'EXPLOITATION ET FINANCIERES";"DEBIT"
+"FNST";"Coût d'achat des marchandises";"true";"";"";"";"";"false";"true";"Charges d'exploitation";"DEBIT"
+"FNST";"Variations de stocks de march.";"false";"6037";"";"";"";"false";"false";"Coût d'achat des marchandises";""
+"FNST";"Achat de marchandises";"false";"607";"";"";"";"false";"false";"Coût d'achat des marchandises";""
+"FNST";"Coût d'achats des approvisionnements";"true";"";"";"";"";"false";"false";"Charges d'exploitation";"DEBIT"
+"FNST";"Achats d'approvisionnements";"false";"60 -603 -607";"";"";"";"false";"false";"Coût d'achats des approvisionnements";""
+"FNST";"Variation des stock (approvisionnements)";"false";"6031, 6032";"";"";"";"false";"false";"Coût d'achats des approvisionnements";""
+"FNST";"Autres charges externes";"false";"61, 62";"";"";"";"false";"false";"Charges d'exploitation";""
+"FNST";"Impôts, taxes et versements assimilés";"false";"63";"";"";"";"false";"false";"Charges d'exploitation";""
+"FNST";"Rémunération du personnel";"false";"641, 644";"";"";"";"false";"false";"Charges d'exploitation";""
+"FNST";"Charges sociales";"false";"645, 646";"";"";"";"false";"false";"Charges d'exploitation";""
+"FNST";"Dotations aux amortissements";"false";"6811";"";"";"";"false";"false";"Charges d'exploitation";""
+"FNST";"Dotations aux provisions";"false";"6815, 6816, 6817";"";"";"";"false";"false";"Charges d'exploitation";""
+"FNST";"Autres charges";"false";"65";"";"";"";"false";"false";"Charges d'exploitation";""
+"FNST";"Charges financières";"false";"66, 686";"";"";"";"false";"false";"CHARGES D'EXPLOITATION ET FINANCIERES";""
+"FNST";"Autres";"false";"1063, 1068";"";"";"";"false";"false";"Réserves";""
+"FNST";"Autres";"false";"409, 428, 46";"43, 444, 445, 455";"";"496";"false";"false";"Créances";""
+"FNST";"Autres";"false";"419, 421, 428, 447, 46";"";"43, 444, 445";"";"false";"false";"DETTES";""
Modified: trunk/lima-swing/src/main/resources/import/pcg_base.csv
===================================================================
--- trunk/lima-swing/src/main/resources/import/pcg_base.csv 2010-08-16 13:11:52 UTC (rev 3004)
+++ trunk/lima-swing/src/main/resources/import/pcg_base.csv 2010-08-17 15:34:26 UTC (rev 3005)
@@ -44,8 +44,6 @@
"ACCN";"164";"Emprunts auprès des établissements de crédit";"";"16";""
"ACCN";"165";"Dépôts et cautionnements reçus";"";"16";""
"ACCN";"166";"Participation des salariés aux résultats";"";"16";""
-"ACCN";"167";"Emprunts et dettes assortis de conditions particulières";"";"16";""
-"ACCN";"168";"Autres emprunts et dettes assimilées";"";"16";""
"ACCN";"16";"EMPRUNTS ET DETTES ASSIMILEES";"";"1";""
"ACCN";"169";"Primes de remboursement des obligations";"";"16";""
"ACCN";"171";"Dettes rattachées à des participations (groupe)";"";"17";""
@@ -53,11 +51,6 @@
"ACCN";"17";"DETTES RATTACHÉES À DES PARTICIPATIONS";"";"1";""
"ACCN";"178";"Dettes rattachées à des sociétés en participation";"";"17";""
"ACCN";"1";"COMPTES DE CAPITAUX";"";"";""
-"ACCN";"181";"Compte de liaison des établissements";"";"18";""
-"ACCN";"186";"Bien et prestations de services échangés entre établissements (charges)";"";"18";""
-"ACCN";"187";"Bien et prestations de services échangés entre établissements (produits)";"";"18";""
-"ACCN";"18";"COMPTES DE LIAISON DES ÉTABLISSEMENTS ET DES SOCIÉTÉS EN PARTICIPATION";"";"1";""
-"ACCN";"188";"Comptes de liaison des sociétés en participation";"";"18";""
"ACCN";"201";"Frais détablissement";"";"20";""
"ACCN";"203";"Frais de recherche et de développement";"";"20";""
"ACCN";"205";"Concessions et droits similaires";"";"20";""
@@ -72,13 +65,11 @@
"ACCN";"215";"Installations techniques; matériel et outillage industriels";"";"21";""
"ACCN";"21";"IMMOBlLlSATIONS CORPORELLES";"";"2";""
"ACCN";"218";"Autres immobilisations corporelles";"";"21";""
-"ACCN";"22";"IMMOBILISATIONS MISES EN CONCESSION";"";"2";""
"ACCN";"231";"Immobilisations corporelles en cours";"";"23";""
"ACCN";"232";"Immobilisations incorporelles en cours";"";"23";""
"ACCN";"237";"Avances et acomptes versés sur immobilisations incorporelles";"";"23";""
"ACCN";"23";"IMMOBILlSATlONS EN COURS";"";"2";""
"ACCN";"238";"Avances et acomptes versés sur immobilisations corporelles";"";"23";""
-"ACCN";"25";"ENTREPRISES LIÉES - PARTS ET CRÉANCES";"";"2";""
"ACCN";"261";"Titres de participation";"";"26";""
"ACCN";"266";"Autres formes de participation";"";"26";""
"ACCN";"267";"Créances rattachées à des participations";"";"26";""
@@ -90,20 +81,11 @@
"ACCN";"273";"Titres immobilisés de l'activité portefeuille";"";"27";""
"ACCN";"274";"Prêts";"";"27";""
"ACCN";"275";"Dépôts et cautionnements versés";"";"27";""
-"ACCN";"276";"Autres créances immobilisées";"";"27";""
-"ACCN";"277";"Actions propres ou parts propres";"";"27";""
"ACCN";"27";"AUTRES IMMOBILISATIONS FINANCIERES";"";"2";""
"ACCN";"279";"Versements restant à effectuer sur titres immobilisés non libérés";"";"27";""
-"ACCN";"280";"Amortissements des immobilisations incorporelles";"";"28";""
"ACCN";"28";"AMORTISSEMENTS DES IMMOBILISATIONS";"";"2";""
-"ACCN";"281";"Amortissements des immobilisations corporelles";"";"28";""
"ACCN";"2";"COMPTES D'IMMOBILISATIONS";"";"";""
-"ACCN";"290";"Provisions pour dépréciation immobilisations incorporelles";"";"29";""
-"ACCN";"291";"Provisions pour dépréciation immobilisations corporelles";"";"29";""
-"ACCN";"293";"Dépréciations des immobilisations en cours";"";"29";""
-"ACCN";"296";" Dépréciations des participations et créances rattachées à des participations";"";"29";""
"ACCN";"29";"PROVISIONS POUR DEPRECIATION DES IMMOBILISATIONS";"";"2";""
-"ACCN";"297";"Provisions pour dépréciation des immobilisations financières";"";"29";""
"ACCN";"311";"Matière (ou groupe) A";"";"31";""
"ACCN";"312";"Matières (ou groupe) B";"";"31";""
"ACCN";"31";"MATIERES PREMIERES (et fournitures)";"";"3";""
@@ -125,7 +107,6 @@
"ACCN";"371";"Marchandise (ou groupe) A";"";"37";""
"ACCN";"37";"STOCKS DE MARCHANDISES";"";"3";""
"ACCN";"372";"Marchandise (ou groupe) B";"";"37";""
-"ACCN";"38";"STOCKS EN VOIE D'ACHEMINEMENT, MIS EN DÉPOT OU DONNÉS EN CONSIGNATION";"";"3";""
"ACCN";"3";"COMPTES DE STOCKS ET D'EN-COURS";"";"";""
"ACCN";"391";"Provisions pour dépréciation des stocks dapprovisionnement";"";"39";""
"ACCN";"392";"Provisions pour dépréciation des autres approvisionnements";"";"39";""
@@ -139,9 +120,7 @@
"ACCN";"403";"Fournisseurs - Effets à payer";"";"40";""
"ACCN";"404";"Fournisseurs d'immobilisations";"";"40";""
"ACCN";"405";"Fournisseurs d'immobilisations - Effets à payer";"";"40";""
-"ACCN";"408";"Fournisseurs - Factures non parvenues";"";"40";""
"ACCN";"40";"FOURNISSEURS ET COMPTES RATTACHES";"";"4";""
-"ACCN";"409";"Fournisseurs débiteurs";"";"40";""
"ACCN";"410";"Clients et comptes rattachés";"";"41";""
"ACCN";"411";"Clients";"";"41";""
"ACCN";"413";"Clients - Effets a recevoir";"";"41";""
@@ -149,7 +128,6 @@
"ACCN";"417";"Créances sur travaux non encore facturables";"";"41";""
"ACCN";"418";"Clients - Produits non encore facturés";"";"41";""
"ACCN";"41";"CLIENTS ET COMPTES RATTACHES";"";"4";""
-"ACCN";"419";"Clients créditeurs";"";"41";""
"ACCN";"421";"Personnel - Rémunérations dues";"";"42";""
"ACCN";"422";"Comités d'entreprise, d'établissement...";"";"42";""
"ACCN";"424";"Participations des salariés aux résultats";"";"42";""
@@ -157,7 +135,6 @@
"ACCN";"426";"Personnel - Dépôts";"";"42";""
"ACCN";"427";"Personnel - Oppositions";"";"42";""
"ACCN";"42";"PERSONNEL ET COMPTES RATTACHES";"";"4";""
-"ACCN";"428";"Personnel - Charges à payer et produits à recevoir";"";"42";""
"ACCN";"431";"Sécurité sociale";"";"43";""
"ACCN";"437";"Autres organismes sociaux";"";"43";""
"ACCN";"43";"SECURITE SOCIALE - AUTRES ORGANISMES SOCIAUX";"";"4";""
@@ -181,6 +158,8 @@
"ACCN";"445711";"TVA collectée 19;6 % débits";"";"44571";""
"ACCN";"445712";"TVA collectée 5;5 % débits";"";"44571";""
"ACCN";"445714";"TVA collectée 19;6 % encaissements";"";"44571";""
+"ACCN";"44571";"TVA collectée";"";"4457";""
+"ACCN";"445715";"TVA collectée 5;5 % encaissements";"";"44571";""
"ACCN";"445";"Etat - Taxes sur le chiffre d'affaires";"";"44";""
"ACCN";"44583";"Remboursement de taxes sur le chiffre d'affaires demandé";"";"4458";""
"ACCN";"44584";"TVA récupérée d'avance";"";"4458";""
@@ -255,17 +234,12 @@
"ACCN";"59";"PROVISION POUR DÉPRÉCIATION DES COMPTES FINANCIERS";"";"5";""
"ACCN";"590";"Provisions pour dépréciation valeurs mobilières de placement";"";"59";""
"ACCN";"601";"Achats stockés - Matières premières (et fournitures)";"";"60";""
-"ACCN";"602";"Achats stockés - Autres approvisionnements";"";"60";""
-"ACCN";"6022";"Fournitures consommables";"";"60";""
-"ACCN";"6026";"Emballages";"";"60";""
-"ACCN";"603";"Variation des stocks (approvisionnements et marchandises)";"";"60";""
"ACCN";"604";"Achats d'études et prestations de services";"";"60";""
"ACCN";"605";"Achats de matériel, équipements et travaux";"";"60";""
"ACCN";"606";"Achats non stockés de matières et fournitures";"";"60";""
"ACCN";"607";"Achats de marchandises";"";"60";""
"ACCN";"608";"Frais accessoires d'achat";"";"60";""
"ACCN";"60";"ACHATS (sauf 603)";"";"6";""
-"ACCN";"609";"Rabais; remises et ristournes obtenus sur achats";"";"60";""
"ACCN";"611";"Sous-traitance générale";"";"61";""
"ACCN";"612";"Redevances de crédit-bail";"";"61";""
"ACCN";"613";"Locations";"";"61";""
@@ -405,5 +379,83 @@
"ACCN";"890";"Bilan d'ouverture";"";"89";""
"ACCN";"89";"BILAN";"";"8";""
"ACCN";"891";"Bilan de clôture";"";"89";""
-"ACCN";"44571";"TVA collectée";"";"4457";""
-"ACCN";"445715";"TVA collectée 5;5 % encaissements";"";"44571";""
+"ACCN";"6031";"Variation des stocks de matières premières (et fournitures)";;"603";""
+"ACCN";"6032";"Variation des stocks des autres approvisionnements";;"603";""
+"ACCN";"603";"Variation des stocks (approvisionnements et marchandises)";"";"60";""
+"ACCN";"2761";"Créances diverses";;"276";""
+"ACCN";"276";"Autres créances immobilisées";"";"27";""
+"ACCN";"27682";"Sur titres immobilisés (droits de créance)";;"2768";""
+"ACCN";"27684";"Sur prêts";;"2768";""
+"ACCN";"27685";"Sur dépôts et cautionnements";;"2768";""
+"ACCN";"27688";"Sur créances diverses";;"2768";""
+"ACCN";"2768";"Intérêts courus";;"276";""
+"ACCN";"2801";"Frais d'établissement (même ventilation que celle du compte 201)";;"280";""
+"ACCN";"2803";"Frais de recherche et développement";;"280";""
+"ACCN";"2805";"Concessions et droits similaires, brevets, licences, logiciels, droits et valeurs similaires";;"280";""
+"ACCN";"2807";"Fonds commercial";;"280";""
+"ACCN";"2808";"Autres immobilisations incorporelles";;"280";""
+"ACCN";"280";"Amortissements des immobilisations incorporelles";"";"28";""
+"ACCN";"2811";"Terrains de gisement";;"281";""
+"ACCN";"2812";"Agencements, aménagements de terrains (même ventilation que celle du compte 212)";;"281";""
+"ACCN";"2813";"Constructions (même ventilation que celle du compte 213)";;"281";""
+"ACCN";"2814";"Constructions sur sol d'autrui (même ventilation que celle du compte 214)";;"281";""
+"ACCN";"2815";"Installations techniques, matériel et outillage industriels (même ventilation que celle du compte 215)";;"281";""
+"ACCN";"2818";"Autres immobilisations corporelles (même ventilation que celle du compte 218)";;"281";""
+"ACCN";"281";"Amortissements des immobilisations corporelles";"";"28";""
+"ACCN";"2905";"Marques, procédés, droits, et valeurs similaires";;"290";""
+"ACCN";"2906";"Droit au bail";;"290";""
+"ACCN";"2907";"Fonds commercial";;"290";""
+"ACCN";"2908";"Autres immobilisations incorporelles";;"290";""
+"ACCN";"290";"Provisions pour dépréciation immobilisations incorporelles";"";"29";""
+"ACCN";"2911";"Terrains (autres que terrains de gisement)";;"291";""
+"ACCN";"291";"Provisions pour dépréciation immobilisations corporelles";"";"29";""
+"ACCN";"2931";"Immobilisations corporelles en cours";;"293";""
+"ACCN";"2932";"Immobilisations incorporelles en cours";;"293";""
+"ACCN";"293";"Dépréciations des immobilisations en cours";"";"29";""
+"ACCN";"2961";"Titres de participation";;"296";""
+"ACCN";"2966";"Autres formes de participation";;"296";""
+"ACCN";"2967";"Créances rattachées à des participations (même ventilation que celle du compte 267)";;"296";""
+"ACCN";"2968";"Créances rattachées à des sociétés en participation (même ventilation que celle du compte 268)";;"296";""
+"ACCN";"296";" Dépréciations des participations et créances rattachées à des participations";"";"29";""
+"ACCN";"2971";"Titres immobilisés autres que les titres immobilisés de l'activité portefeuille - droit de propriété (même ventilation que celle du compte 271)";;"297";""
+"ACCN";"2972";"Titres immobilisés - droit de créance (même ventilation que celle du compte 272)";;"297";""
+"ACCN";"2973";"Titres immobilisés de l'activité portefeuille";;"297";""
+"ACCN";"2974";"Prêts (même ventilation que celle du compte 274)";;"297";""
+"ACCN";"2975";"Dépôts et cautionnements versés (même ventilation que celle du compte 275)";;"297";""
+"ACCN";"2976";"Autres créances immobilisées (même ventilation que celle du compte 276)";;"297";""
+"ACCN";"297";"Provisions pour dépréciation des immobilisations financières";"";"29";""
+"ACCN";"1671";"Émissions de titres participatifs";;"167";""
+"ACCN";"1674";"Avances conditionnées de l'État";;"167";""
+"ACCN";"1675";"Emprunts participatifs";;"167";""
+"ACCN";"167";"Emprunts et dettes assortis de conditions particulières";"";"16";""
+"ACCN";"168";"Autres emprunts et dettes assimilées";"";"16";""
+"ACCN";"4081";"Fournisseurs";;"408";""
+"ACCN";"4084";"Fournisseurs d'immobilisations";;"408";""
+"ACCN";"4088";"Fournisseurs - Intérêts courus";;"408";""
+"ACCN";"408";"Fournisseurs - Factures non parvenues";"";"40";""
+"ACCN";"4091";"Fournisseurs - Avances et acomptes versés sur commandes";;"409";""
+"ACCN";"4096";"Fournisseurs - Créances pour emballages et matériel à rendre";;"409";""
+"ACCN";"4097";"Fournisseurs - Autres Avoirs";;"409";""
+"ACCN";"4098";"Rabais, remises, ristournes à obtenir et autres avoirs non encore reçus";;"409";""
+"ACCN";"409";"Fournisseurs débiteurs";"";"40";""
+"ACCN";"4191";"Clients - Avances et acomptes reçus sur commandes";;"419";""
+"ACCN";"4196";"Clients - Dettes pour emballages et matériels consignés";;"419";""
+"ACCN";"4197";"Clients - Autres avoirs";;"419";""
+"ACCN";"4198";"Rabais, remises, ristournes à accorder et autres avoirs à établir";;"419";""
+"ACCN";"419";"Clients créditeurs";"";"41";""
+"ACCN";"4282";"Dettes provisionnées pour congés à payer";;"428";""
+"ACCN";"4284";"Dettes provisionnées pour participation des salariés aux résultats";;"428";""
+"ACCN";"4286";"Autres charges à payer";;"428";""
+"ACCN";"4287";"Produits à recevoir";;"428";""
+"ACCN";"428";"Personnel - Charges à payer et produits à recevoir";"";"42";""
+"ACCN";"6022";"Fournitures consommables";;"602";""
+"ACCN";"602";"Achats stockés - Autres approvisionnements";"";"60";""
+"ACCN";"6026";"Emballages";;"602";""
+"ACCN";"6091";"de matières premières (et fournitures)";;"609";""
+"ACCN";"6092";"d'autres approvisionnements stockés";;"609";""
+"ACCN";"6094";"d'études et de prestations de services";;"609";""
+"ACCN";"6095";"de matériel, équipements et travaux";;"609";""
+"ACCN";"6096";"d'approvisionnements non stockés";;"609";""
+"ACCN";"6097";"de marchandises";;"609";""
+"ACCN";"6098";"Rabais, remises et ristournes non affectés";;"609";""
+"ACCN";"609";"Rabais; remises et ristournes obtenus sur achats";"";"60";""
1
0
r3004 - trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction
by jpepin@users.chorem.org 16 Aug '10
by jpepin@users.chorem.org 16 Aug '10
16 Aug '10
Author: jpepin
Date: 2010-08-16 15:11:52 +0200 (Mon, 16 Aug 2010)
New Revision: 3004
Url: http://chorem.org/repositories/revision/lima/3004
Log:
KeyListerner sur la touche tab :
Saut automatique des cellules non ?\195?\169ditables.
Ajout d'une entr?\195?\169e en fin de ligne si la transaction est non ?\195?\169quilibr?\195?\169.
Ajout d'une nouvelle transaction en fin de ligne via tab si la derni?\195?\168re est ?\195?\169quilibr?\195?\169.
Added:
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionView.jaxx
Removed:
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionView.jaxx
Modified:
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTable.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTableModel.java
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTable.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTable.java 2010-08-13 15:27:33 UTC (rev 3003)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTable.java 2010-08-16 13:11:52 UTC (rev 3004)
@@ -28,7 +28,9 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
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.ui.celleditor.AccountTableCellEditor;
import org.chorem.lima.ui.celleditor.DateTableCellEditor;
import org.chorem.lima.ui.celleditor.EntryBookTableCellEditor;
@@ -164,37 +166,78 @@
/**
* Touche tab
+ * Incrémente le curseur de case tant que la case n'est pas editable
* Ajoute une entrée comptable si tab est sur
- * la dernière cellule.
+ * la dernière cellule et si la transaction est non équilibré
+ * sinon rajoute une transaction
*/
if (e.getKeyChar() == KeyEvent.VK_TAB) {
- // Vérifie si la cellule sélectionnée est la dernière
+ int max_x = this.getColumnCount();
+ int max_y = this.getRowCount();
+ int x_tab = this.getSelectedColumn();
+ int y_tab = this.getSelectedRow();
+
+ if (x_tab < max_x - 1){
+ x_tab++;
+ }
+ else {
+ y_tab++;
+ }
+ //skip all cell while not editable
+ while (!isCellEditable(y_tab, x_tab)){
- int x = this.getSelectedColumn();
- int y = this.getSelectedRow();
- int max_x = this.getColumnCount() - 1;
- int max_y = this.getRowCount() - 1;
- if (x == max_x && y == max_y) {
- handler.addEmptyEntry();
- // positionne la sélection sur la nouvelle ligne créée
- this.setColumnSelectionInterval(0, 0);
- this.setRowSelectionInterval(max_y + 1, max_y + 1);
- }
+ //if end of row
+ if (x_tab == max_x-1) {
+ Object object = this.handler.tableModel.getElementAt(y_tab);
+
+ //if transaction, add entry
+ if (object instanceof FinancialTransaction){
+ FinancialTransaction financialTransaction = (FinancialTransaction) object;
+ if (financialTransaction.getEntry().size() == 0){
+ handler.addEmptyEntry();
+ this.setColumnSelectionInterval(1, 1);
+ }
+ }
+ //if entry
+ else {
+ Entry entry = (Entry) object;
+ FinancialTransaction financialTransaction = entry.getFinancialTransaction();
+ Boolean balanced =
+ financialTransaction.getAmountCredit() ==
+ financialTransaction.getAmountDebit();
+ if (balanced){
+ if (y_tab == max_y-1){
+ handler.addFinancialTransaction();
+ this.setColumnSelectionInterval(0, 0);
+ }
+ }
+ else {
+ handler.addEmptyEntry();
+ this.setColumnSelectionInterval(1, 1);
+ }
+ }
+ y_tab++;
+ // positionne la sélection sur la nouvelle ligne créée
+ this.setRowSelectionInterval(y_tab, y_tab);
+ x_tab=0;
+ }
+ else {
+ if (x_tab < max_x){
+ this.setColumnSelectionInterval(x_tab, x_tab);
+ x_tab++;
+ }
+ }
+ }
}
-
}
- /*
- * @see java.awt.event.KeyListener#keyTyped(java.awt.event.KeyEvent)
- */
+
@Override
public void keyTyped(KeyEvent e) {
}
- /*
- * @see java.awt.event.KeyListener#keyReleased(java.awt.event.KeyEvent)
- */
+
@Override
public void keyReleased(KeyEvent e) {
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTableModel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTableModel.java 2010-08-13 15:27:33 UTC (rev 3003)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTableModel.java 2010-08-16 13:11:52 UTC (rev 3004)
@@ -327,7 +327,7 @@
boolean editableCell=false;
Object currentRow = cacheDataList.get(rowIndex);
// cells editable for the entry row, all cells exclude the date
- if ((currentRow instanceof Entry) && !((columnIndex==0) || (columnIndex==1))) {
+ if ((currentRow instanceof Entry) && !((columnIndex==0) || (columnIndex==1) || (columnIndex==8))) {
editableCell=true;
}
// cells editable for the financialtransaction row, no cells exclude the date
@@ -336,7 +336,9 @@
}
return editableCell;
}
+
+
/**
* @throws LimaException
*/
@@ -550,7 +552,7 @@
}
//on recharge la liste
cacheDataList = getDataList();
- fireTableRowsDeleted(row, getRowCount());
+ fireTableDataChanged();
}
@Override
Deleted: 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 2010-08-13 15:27:33 UTC (rev 3003)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionView.jaxx 2010-08-16 13:11:52 UTC (rev 3004)
@@ -1,104 +0,0 @@
-<!-- ##% Lima Swing
- Copyright (C) 2008 - 2010 CodeLutin
- This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License
- as published by the Free Software Foundation; either version 2
- 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, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- ##% -->
-
-<Table>
- <FinancialTransactionViewHandler id="handler" javaBean="new FinancialTransactionViewHandler(this)" />
- <Boolean id="selectedRow" javaBean="false" />
- <org.chorem.lima.ui.combobox.FinancialPeriodComboBoxModel id="modelFinancialPeriod"/>
- <org.chorem.lima.ui.combobox.FiscalPeriodComboBoxModel id="modelFiscalPeriod"/>
- <script>
- <![CDATA[
- import org.chorem.lima.entity.FiscalPeriod;
- import org.chorem.lima.entity.FinancialPeriod;
-
- void $afterCompleteSetup() {
- getHandler().refresh();
- }
-
- ]]>
- </script>
-
- <!-- <JPopupMenu id="MenuRightPanel">
- <JMenuItem text="lima.add.transaction" onActionPerformed='addEmptyTransaction()'/>
- <JMenuItem text="lima.print"/>
- </JPopupMenu>
- <JPopupMenu id="MenuRightTransaction">
- <JMenuItem text="lima.add" onActionPerformed='addEmptyTransaction()'/>
- <JMenuItem text="lima.print"/>
- </JPopupMenu> -->
-
- <row weightx="1" weighty="0" anchor="center">
- <cell anchor="east">
- <JLabel id="fiscalPeriodLabel" text="lima.charts.fiscalyear"/>
- </cell>
- <cell anchor="west">
- <JComboBox id="fiscalPeriodComboBox"
- model="{getModelFiscalPeriod()}"
- renderer="{new org.chorem.lima.ui.combobox.FiscalPeriodComboBoxRenderer()}"
- onActionPerformed="getModelFinancialPeriod().setFiscalPeriod( (FiscalPeriod) fiscalPeriodComboBox.getSelectedItem());
- getHandler().refresh()"
- editable="false"/>
- </cell>
- <cell anchor="east">
- <JLabel id="financialPeriodLabel" text="lima.transaction.period"
- />
- </cell>
- <cell anchor="west">
- <JComboBox id="financialPeriodComboBox"
- model="{getModelFinancialPeriod()}"
- renderer="{new org.chorem.lima.ui.combobox.FinancialPeriodComboBoxRenderer()}"
- onActionPerformed="getFinancialTransactionTableModel().setFinancialPeriod( (FinancialPeriod) financialPeriodComboBox.getSelectedItem());
- getHandler().refresh()"
- editable="false"
- />
- </cell>
- <cell>
- <JButton text="lima.common.copy"
- onActionPerformed="getHandler().copyRow()" enabled="{isSelectedRow()}"/>
- </cell>
- <cell>
- <JButton text="lima.common.paste"
- onActionPerformed="getHandler().pasteRow()" enabled="{isSelectedRow()}"/>
- </cell>
- <cell>
- <JButton text="lima.add.transaction"
- onActionPerformed="getHandler().addFinancialTransaction()"/>
- </cell>
- <cell>
- <JButton text="lima.add.entry" onActionPerformed="getHandler().addEmptyEntry()" enabled="{isSelectedRow()}"/>
- </cell>
- <cell>
- <JButton text="lima.common.remove"
- onActionPerformed="getHandler().deleteSelectedRow()"
- enabled="{isSelectedRow()}"/>
- </cell>
- </row>
- <row>
- <cell fill="both" weightx="1" weighty="1" rows="3" columns="9">
- <JScrollPane>
- <org.chorem.lima.ui.financialtransaction.FinancialTransactionTableModel
- id="financialTransactionTableModel"/>
- <org.chorem.lima.ui.financialtransaction.FinancialTransactionTable
- id="financialTransactionTable" sortable="false" rowHeight="22"
- constructorParams="getHandler()" model="{getFinancialTransactionTableModel()}"
- selectionMode="{ListSelectionModel.SINGLE_SELECTION}" />
- <javax.swing.ListSelectionModel javaBean="getFinancialTransactionTable().getSelectionModel()"
- onValueChanged="setSelectedRow(financialTransactionTable.getSelectedRow() != -1)"/>
- </JScrollPane>
- </cell>
- </row>
-</Table>
\ No newline at end of file
Copied: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionView.jaxx (from rev 3003, 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 (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionView.jaxx 2010-08-16 13:11:52 UTC (rev 3004)
@@ -0,0 +1,104 @@
+<!-- ##% Lima Swing
+ Copyright (C) 2008 - 2010 CodeLutin
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ as published by the Free Software Foundation; either version 2
+ 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, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ ##% -->
+
+<Table>
+ <FinancialTransactionViewHandler id="handler" javaBean="new FinancialTransactionViewHandler(this)" />
+ <Boolean id="selectedRow" javaBean="false" />
+ <org.chorem.lima.ui.combobox.FinancialPeriodComboBoxModel id="modelFinancialPeriod"/>
+ <org.chorem.lima.ui.combobox.FiscalPeriodComboBoxModel id="modelFiscalPeriod"/>
+ <script>
+ <![CDATA[
+ import org.chorem.lima.entity.FiscalPeriod;
+ import org.chorem.lima.entity.FinancialPeriod;
+
+ void $afterCompleteSetup() {
+ getHandler().refresh();
+ }
+
+ ]]>
+ </script>
+
+ <!-- <JPopupMenu id="MenuRightPanel">
+ <JMenuItem text="lima.add.transaction" onActionPerformed='addEmptyTransaction()'/>
+ <JMenuItem text="lima.print"/>
+ </JPopupMenu>
+ <JPopupMenu id="MenuRightTransaction">
+ <JMenuItem text="lima.add" onActionPerformed='addEmptyTransaction()'/>
+ <JMenuItem text="lima.print"/>
+ </JPopupMenu> -->
+
+ <row weightx="1" weighty="0" anchor="center">
+ <cell anchor="east">
+ <JLabel id="fiscalPeriodLabel" text="lima.charts.fiscalyear"/>
+ </cell>
+ <cell anchor="west">
+ <JComboBox id="fiscalPeriodComboBox"
+ model="{getModelFiscalPeriod()}"
+ renderer="{new org.chorem.lima.ui.combobox.FiscalPeriodComboBoxRenderer()}"
+ onActionPerformed="getModelFinancialPeriod().setFiscalPeriod( (FiscalPeriod) fiscalPeriodComboBox.getSelectedItem());
+ getHandler().refresh()"
+ editable="false"/>
+ </cell>
+ <cell anchor="east">
+ <JLabel id="financialPeriodLabel" text="lima.transaction.period"
+ />
+ </cell>
+ <cell anchor="west">
+ <JComboBox id="financialPeriodComboBox"
+ model="{getModelFinancialPeriod()}"
+ renderer="{new org.chorem.lima.ui.combobox.FinancialPeriodComboBoxRenderer()}"
+ onActionPerformed="getFinancialTransactionTableModel().setFinancialPeriod( (FinancialPeriod) financialPeriodComboBox.getSelectedItem());
+ getHandler().refresh()"
+ editable="false"
+ />
+ </cell>
+ <cell>
+ <JButton text="lima.common.copy"
+ onActionPerformed="getHandler().copyRow()" enabled="{isSelectedRow()}"/>
+ </cell>
+ <cell>
+ <JButton text="lima.common.paste"
+ onActionPerformed="getHandler().pasteRow()" enabled="{isSelectedRow()}"/>
+ </cell>
+ <cell>
+ <JButton text="lima.add.transaction"
+ onActionPerformed="getHandler().addFinancialTransaction()"/>
+ </cell>
+ <cell>
+ <JButton text="lima.add.entry" onActionPerformed="getHandler().addEmptyEntry()" enabled="{isSelectedRow()}"/>
+ </cell>
+ <cell>
+ <JButton text="lima.common.remove"
+ onActionPerformed="getHandler().deleteSelectedRow()"
+ enabled="{isSelectedRow()}"/>
+ </cell>
+ </row>
+ <row>
+ <cell fill="both" weightx="1" weighty="1" rows="3" columns="9">
+ <JScrollPane>
+ <org.chorem.lima.ui.financialtransaction.FinancialTransactionTableModel
+ id="financialTransactionTableModel"/>
+ <org.chorem.lima.ui.financialtransaction.FinancialTransactionTable
+ id="financialTransactionTable" sortable="false" rowHeight="22"
+ constructorParams="getHandler()" model="{getFinancialTransactionTableModel()}"
+ selectionMode="{ListSelectionModel.SINGLE_SELECTION}" />
+ <javax.swing.ListSelectionModel javaBean="getFinancialTransactionTable().getSelectionModel()"
+ onValueChanged="setSelectedRow(financialTransactionTable.getSelectedRow() != -1)"/>
+ </JScrollPane>
+ </cell>
+ </row>
+</Table>
\ No newline at end of file
1
0
13 Aug '10
Author: jpepin
Date: 2010-08-13 17:27:33 +0200 (Fri, 13 Aug 2010)
New Revision: 3003
Url: http://chorem.org/repositories/revision/lima/3003
Log:
Modification de la fonction d'entr?\195?\169es non ?\195?\169quilibr?\195?\169s en entr?\195?\169es incorrectes : v?\195?\169rification suppl?\195?\169mentaire sur le journal et les comptes.
D?\195?\169bogue surlignage entr?\195?\169e non ?\195?\169quilibr?\195?\169.
Ajout fonction copie-colle d'entr?\195?\169es.
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/FinancialTransactionServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialTransactionService.java
trunk/lima-swing/src/main/java/org/chorem/lima/service/ServiceMonitorableHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTable.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTableModel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionViewHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedTable.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedTableModel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/FinancialTransactionsPane.java
trunk/lima-swing/src/main/resources/i18n/lima-swing-en_GB.properties
trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties
trunk/pom.xml
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java 2010-08-13 13:01:51 UTC (rev 3002)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java 2010-08-13 15:27:33 UTC (rev 3003)
@@ -408,7 +408,6 @@
.addParam("account", account);
Account master = accountDAO.findByQuery(query);
- log.debug(master);
accountingRules.updateAccountRules(master, account);
subAccount.setMasterAccount(account.getMasterAccount());
subAccount.setSubAccounts(account.getSubAccounts());
@@ -563,9 +562,6 @@
doCatch(topiaContext, ex, log);
}
}
- for (Account account : accounts) {
- log.debug("accounts " + account.getAccountNumber());
- }
return accounts;
}
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 2010-08-13 13:01:51 UTC (rev 3002)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java 2010-08-13 15:27:33 UTC (rev 3003)
@@ -23,7 +23,10 @@
import java.math.BigDecimal;
import java.util.Date;
+import java.util.HashSet;
import java.util.List;
+import java.util.Set;
+
import javax.ejb.Stateless;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -46,6 +49,7 @@
import org.nuiton.topia.TopiaException;
import org.nuiton.topia.TopiaNotFoundException;
import org.nuiton.topia.framework.TopiaQuery;
+import org.nuiton.topia.framework.TopiaQuery.Op;
/**
* Cette classe permet la création d'une transaction comptable dans l'application.
@@ -182,21 +186,27 @@
* Get unbalanced financialtransaction from selected fiscalperiod
*/
@Override
- public List<FinancialTransaction> getAllFinancialTransactionsUnbalanced(FiscalPeriod fiscalPeriod) throws LimaException {
+ public Set<FinancialTransaction> getAllInexactFinancialTransactions(FiscalPeriod fiscalPeriod) throws LimaException {
TopiaContext topiaContext = null;
- List<FinancialTransaction> result = null;
+ Set<FinancialTransaction> result = new HashSet<FinancialTransaction>();
try {
topiaContext = beginTransaction();
FinancialTransactionDAO financialTransactionDAO =
LimaCallaoDAOHelper.getFinancialTransactionDAO(topiaContext);
-
TopiaQuery query = financialTransactionDAO.createQuery("E");
query.addFrom(FiscalPeriod.class, "F")
- .addWhere("E.amountCredit != E.amountDebit")
+ .addWhere("E.amountCredit != E.amountDebit OR E.entryBook = null")
.addInElements("E.financialPeriod", "F.financialPeriod")
.addEquals("F", fiscalPeriod);
- result = financialTransactionDAO.findAllByQuery(query);
+ result.addAll(financialTransactionDAO.findAllByQuery(query));
+
+ TopiaQuery query2 = financialTransactionDAO.createQuery("T");
+ query2.addFrom(Entry.class, "E")
+ .addWhere("E.account = null")
+ .addInElements("E", "T.entry");
+ result.addAll(financialTransactionDAO.findAllByQuery(query2));
+
/* Just for fun : IN HQL
result = topiaContext.find(
"FROM org.chorem.lima.entity.FinancialTransaction "+
@@ -391,6 +401,34 @@
EntryDAO entryDAO = LimaCallaoDAOHelper.getEntryDAO(topiaContext);
entryDAO.create(entry);
+
+ //get new entry amounts
+ BigDecimal entryAmount = entry.getAmount();
+ Boolean entryAmountIsDebit = entry.getDebit();
+ BigDecimal entryDebit = new BigDecimal(0), entryCredit = new BigDecimal(0);
+ if (entryAmountIsDebit){
+ entryDebit = entryAmount;
+ }
+ else {
+ entryCredit = entryAmount;
+ }
+
+ //calculate financial transaction amounts
+ FinancialTransaction financialTransaction =
+ entry.getFinancialTransaction();
+
+ BigDecimal amountDebit = financialTransaction.getAmountDebit();
+ amountDebit = amountDebit.add(entryDebit);
+ financialTransaction.setAmountDebit(amountDebit);
+
+ BigDecimal amountCredit = financialTransaction.getAmountCredit();
+ amountCredit = amountCredit.add(entryCredit);
+ financialTransaction.setAmountCredit(amountCredit);
+
+ //update financial transaction
+ updateFinancialTransactionWithTransaction(
+ financialTransaction, topiaContext);
+
commitTransaction(topiaContext);
}
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialTransactionService.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialTransactionService.java 2010-08-13 13:01:51 UTC (rev 3002)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialTransactionService.java 2010-08-13 15:27:33 UTC (rev 3003)
@@ -20,6 +20,8 @@
package org.chorem.lima.business.ejbinterface;
import java.util.List;
+import java.util.Set;
+
import javax.ejb.Remote;
import org.chorem.lima.business.LimaBusinessException;
import org.chorem.lima.business.LimaException;
@@ -57,7 +59,7 @@
List<FinancialTransaction> getAllFinancialTransactionsForEntryBookAndFinancialPeriod(
EntryBook entryBook, FinancialPeriod period) throws LimaException;
- List<FinancialTransaction> getAllFinancialTransactionsUnbalanced(FiscalPeriod fiscalPeriod) throws LimaException;
+ Set<FinancialTransaction> getAllInexactFinancialTransactions(FiscalPeriod fiscalPeriod) throws LimaException;
List<FinancialTransaction> getAllFinancialTransactionsBalanced(FiscalPeriod fiscalPeriod) throws LimaException;
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/service/ServiceMonitorableHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/service/ServiceMonitorableHandler.java 2010-08-13 13:01:51 UTC (rev 3002)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/service/ServiceMonitorableHandler.java 2010-08-13 15:27:33 UTC (rev 3003)
@@ -25,8 +25,6 @@
import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.chorem.lima.business.LimaBusinessException;
-import org.chorem.lima.business.LimaException;
import org.chorem.lima.business.ServiceListener;
public class ServiceMonitorableHandler implements InvocationHandler {
@@ -67,6 +65,7 @@
if (!method.getName().startsWith("get")){
for (ServiceListener serviceListener : listeners) {
serviceListener.notifyMethod(service.toString(), method.getName());
+ log.debug("proxy : " + service.toString() + " " + method.getName());
}
}
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTable.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTable.java 2010-08-13 13:01:51 UTC (rev 3002)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTable.java 2010-08-13 15:27:33 UTC (rev 3003)
@@ -22,7 +22,11 @@
import java.awt.Component;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
+import java.math.BigDecimal;
import java.util.Date;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.chorem.lima.entity.Account;
import org.chorem.lima.entity.EntryBook;
import org.chorem.lima.ui.celleditor.AccountTableCellEditor;
@@ -45,6 +49,10 @@
/** serialVersionUID. */
private static final long serialVersionUID = 3133690382049594727L;
+
+ /** log. */
+ private static final Log log = LogFactory
+ .getLog(FinancialTransactionTable.class);
protected FinancialTransactionViewHandler handler;
@@ -110,9 +118,9 @@
ComponentAdapter adapter) {
boolean isHighlighted = false;
Object value = adapter.getValueAt(adapter.row, 8);
- if (value instanceof Double) {
- Double currentBalance = (Double) value;
- if (currentBalance != 0) {
+ if (value instanceof BigDecimal) {
+ BigDecimal currentBalance = (BigDecimal) value;
+ if (currentBalance.doubleValue() != 0) {
isHighlighted = true;
}
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTableModel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTableModel.java 2010-08-13 13:01:51 UTC (rev 3002)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTableModel.java 2010-08-13 15:27:33 UTC (rev 3003)
@@ -413,12 +413,42 @@
fireTableDataChanged();
}
+ public void addEntry(Object value, Entry entry, int row) throws LimaException {
+ FinancialTransaction currentTransaction = null;
+ int financialTransactionRow = 0;
+ Object currentRow = cacheDataList.get(row);
+ //check if current row is a transaction or an entry
+ if (currentRow instanceof FinancialTransaction) {
+ currentTransaction = (FinancialTransaction)currentRow;
+ //update the financial transaction in entire
+ financialTransactionRow =
+ getDataList().indexOf(((FinancialTransaction) currentRow));
+ }
+ else if (currentRow instanceof Entry) {
+ Entry currentEntry = (Entry)currentRow;
+ //get back the parent transaction of the entry
+ currentTransaction = currentEntry.getFinancialTransaction();
+ //update the financial transaction in entire
+ financialTransactionRow =
+ getDataList().indexOf(((Entry) currentRow).
+ getFinancialTransaction());
+ }
+ //create it
+ entry.setFinancialTransaction(currentTransaction);
+ financialTransactionService.createEntry(entry);
+ fireTableRowsUpdated(financialTransactionRow, getRowCount()-1);
+
+ //on recharge la liste
+ cacheDataList = getDataList();
+ fireTableDataChanged();
+ }
+
/**
* to modifiy financialtransaction or entry
*/
@Override
public void setValueAt(Object value, int row, int column) {
- int financialTransactionRow=0;
+ int financialTransactionRow = 0;
if (cacheDataList != null) {
Object currentRow = cacheDataList.get(row);
if (currentRow instanceof FinancialTransaction) {
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 2010-08-13 13:01:51 UTC (rev 3002)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionView.jaxx 2010-08-13 15:27:33 UTC (rev 3003)
@@ -67,11 +67,19 @@
/>
</cell>
<cell>
+ <JButton text="lima.common.copy"
+ onActionPerformed="getHandler().copyRow()" enabled="{isSelectedRow()}"/>
+ </cell>
+ <cell>
+ <JButton text="lima.common.paste"
+ onActionPerformed="getHandler().pasteRow()" enabled="{isSelectedRow()}"/>
+ </cell>
+ <cell>
<JButton text="lima.add.transaction"
onActionPerformed="getHandler().addFinancialTransaction()"/>
</cell>
<cell>
- <JButton text="lima.add.entry" onActionPerformed="getHandler().addEmptyEntry()"/>
+ <JButton text="lima.add.entry" onActionPerformed="getHandler().addEmptyEntry()" enabled="{isSelectedRow()}"/>
</cell>
<cell>
<JButton text="lima.common.remove"
@@ -80,7 +88,7 @@
</cell>
</row>
<row>
- <cell fill="both" weightx="1" weighty="1" rows="3" columns="8">
+ <cell fill="both" weightx="1" weighty="1" rows="3" columns="9">
<JScrollPane>
<org.chorem.lima.ui.financialtransaction.FinancialTransactionTableModel
id="financialTransactionTableModel"/>
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionViewHandler.java 2010-08-13 13:01:51 UTC (rev 3002)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionViewHandler.java 2010-08-13 15:27:33 UTC (rev 3003)
@@ -27,6 +27,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.business.LimaException;
+import org.chorem.lima.entity.Entry;
import org.chorem.lima.entity.FinancialTransaction;
import org.chorem.lima.ui.combobox.FinancialPeriodComboBoxModel;
import org.chorem.lima.ui.combobox.FiscalPeriodComboBoxModel;
@@ -57,11 +58,51 @@
protected FiscalPeriodComboBoxModel fiscalPeriodComboBoxModel;
protected FinancialPeriodComboBoxModel financialPeriodComboBoxModel;
+
+ protected Object clipBoard;
protected FinancialTransactionViewHandler(FinancialTransactionView view) {
this.view = view;
}
+ //copy entry
+ public void copyRow(){
+ int indexSelectedRow = table.getSelectedRow();
+
+ if (indexSelectedRow != -1) {
+ clipBoard = tableModel.getElementAt(indexSelectedRow);
+ }
+ }
+
+ //paste entry
+ public void pasteRow(){
+ int indexSelectedRow = table.getSelectedRow();
+
+ if (indexSelectedRow != -1) {
+ Object selectedValue = tableModel.getElementAt(indexSelectedRow);
+ if (clipBoard instanceof Entry) {
+ try {
+ tableModel.addEntry(selectedValue, (Entry) clipBoard, indexSelectedRow);
+ //select the new line
+ ListSelectionModel selectionModel =
+ table.getSelectionModel();
+ selectionModel.setSelectionInterval(
+ indexSelectedRow+1, indexSelectedRow+1);
+ //focus on second column
+ table.changeSelection(indexSelectedRow+1, 1, false, false);
+ table.requestFocusInWindow();
+ } catch (LimaException eee){
+ if (log.isErrorEnabled()) {
+ log.error("Can't past entry", eee);
+ }
+ DialogHelper.showMessageDialog(eee.getMessage());
+ }
+ }
+
+ }
+
+ }
+
//add a new transaction
public void addFinancialTransaction() {
table = view.getFinancialTransactionTable();
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedTable.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedTable.java 2010-08-13 13:01:51 UTC (rev 3002)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedTable.java 2010-08-13 15:27:33 UTC (rev 3003)
@@ -22,6 +22,7 @@
import java.awt.Component;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
+import java.math.BigDecimal;
import java.util.Date;
import org.chorem.lima.entity.Account;
import org.chorem.lima.entity.EntryBook;
@@ -113,9 +114,9 @@
ComponentAdapter adapter) {
boolean isHighlighted = false;
Object value = adapter.getValueAt(adapter.row, 8);
- if (value instanceof Double) {
- Double currentBalance = (Double) value;
- if (currentBalance != 0) {
+ if (value instanceof BigDecimal) {
+ BigDecimal currentBalance = (BigDecimal) value;
+ if (currentBalance.doubleValue() != 0) {
isHighlighted = true;
}
}
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 2010-08-13 13:01:51 UTC (rev 3002)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedTableModel.java 2010-08-13 15:27:33 UTC (rev 3003)
@@ -25,6 +25,8 @@
import java.util.Collections;
import java.util.Date;
import java.util.List;
+import java.util.Set;
+
import javax.swing.table.AbstractTableModel;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -98,8 +100,8 @@
List<Object> results = new ArrayList<Object>();
if(selectedFiscalPeriod != null){
try {
- List<FinancialTransaction> financialtransactions =
- financialTransactionService.getAllFinancialTransactionsUnbalanced(selectedFiscalPeriod);
+ Set<FinancialTransaction> financialtransactions =
+ financialTransactionService.getAllInexactFinancialTransactions(selectedFiscalPeriod);
for (FinancialTransaction financialtransaction : financialtransactions) {
results.add(financialtransaction);
List<Entry> entries = (List<Entry>) financialtransaction.getEntry();
@@ -338,6 +340,7 @@
FinancialTransaction currentTransaction = null;
Object currentRow = cacheDataList.get(row);
Entry entry = new EntryImpl();
+ entry.setAmount(new BigDecimal(0));
//check if current row is a transaction or an entry
if (currentRow instanceof FinancialTransaction) {
currentTransaction = (FinancialTransaction)currentRow;
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/FinancialTransactionsPane.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/FinancialTransactionsPane.java 2010-08-13 13:01:51 UTC (rev 3002)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/FinancialTransactionsPane.java 2010-08-13 15:27:33 UTC (rev 3003)
@@ -21,6 +21,8 @@
import static org.nuiton.i18n.I18n._;
import java.awt.Color;
import java.util.List;
+import java.util.Set;
+
import javax.swing.JEditorPane;
import javax.swing.event.HyperlinkEvent;
import javax.swing.event.HyperlinkListener;
@@ -99,9 +101,9 @@
List<FiscalPeriod> unblockedFiscalPeriods =
fiscalPeriodService.getAllUnblockedFiscalPeriods();
if (unblockedFiscalPeriods.size() != 0){
- List<FinancialTransaction> financialTransactionsUnbal =
+ Set<FinancialTransaction> financialTransactionsUnbal =
financialTransactionService.
- getAllFinancialTransactionsUnbalanced(unblockedFiscalPeriods.get(0));
+ getAllInexactFinancialTransactions(unblockedFiscalPeriods.get(0));
if (financialTransactionsUnbal.size()>0){
setBackground(redBackground);
String transactionsString = financialTransactionsUnbal.size()
@@ -146,7 +148,7 @@
@Override
public void notifyMethod(String serviceName, String methodeName) {
- if (methodeName.contains("FiscalPeriod") || methodeName.contains("FinancialTransaction") || methodeName.contains("importEntries") || methodeName.contains("importAll")){
+ if (methodeName.contains("FiscalPeriod") || methodeName.contains("FinancialTransaction") || methodeName.contains("Entry") || methodeName.contains("importEntries") || methodeName.contains("importAll")){
refresh();
}
}
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 2010-08-13 13:01:51 UTC (rev 3002)
+++ trunk/lima-swing/src/main/resources/i18n/lima-swing-en_GB.properties 2010-08-13 15:27:33 UTC (rev 3003)
@@ -46,11 +46,13 @@
lima.common.addSubLedger=
lima.common.cancel=
lima.common.close=
+lima.common.copy=
lima.common.fin=
lima.common.import=
lima.common.importexport=Import/Export
lima.common.next=
lima.common.ok=
+lima.common.paste=
lima.common.print=
lima.common.quit=
lima.common.remove=
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 2010-08-13 13:01:51 UTC (rev 3002)
+++ trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties 2010-08-13 15:27:33 UTC (rev 3003)
@@ -43,10 +43,12 @@
lima.common.addSubLedger=Ajouter Compte Tiers
lima.common.cancel=Annuler
lima.common.close=Fermer
+lima.common.copy=Copier
lima.common.fin=Termin\u00E9
lima.common.importexport=Importer/Exporter
lima.common.next=Suivant
lima.common.ok=OK
+lima.common.paste=Coller
lima.common.print=
lima.common.quit=Quitter
lima.common.remove=Supprimer
@@ -72,7 +74,7 @@
lima.entries=Traitement
lima.entries.addtransaction=Saisir des \u00E9critures
lima.entries.lettering=Ajouter une lettre
-lima.entries.searchunbalancedtransaction=Entr\u00E9es non \u00E9quilibr\u00E9es
+lima.entries.searchunbalancedtransaction=Entr\u00E9es incorrect
lima.entrybook=Journal
lima.entrybook.add=Ajouter un journal
lima.entrybook.code=
@@ -241,7 +243,7 @@
limahome.transaction.balanced=transactions, toutes sont \u00E9quilibr\u00E9es
limahome.transaction.create=Ajouter des \u00E9critures
limahome.transaction.modifiy.balanced=Modifier les \u00E9critures
-limahome.transaction.modifiy.unbalanced=Modifier les \u00E9critures non \u00E9quilibr\u00E9es
+limahome.transaction.modifiy.unbalanced=Modifier les \u00E9critures incorrect
limahome.transaction.nothing=Aucune \u00E9criture
limahome.transaction.unbalanced=\u00E9critures ne sont pas \u00E9quilibr\u00E9es \!
update=
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2010-08-13 13:01:51 UTC (rev 3002)
+++ trunk/pom.xml 2010-08-13 15:27:33 UTC (rev 3003)
@@ -275,9 +275,9 @@
<projectId>lima</projectId>
<!-- customized libs version -->
- <nuiton-utils.version>1.3.2-SNAPSHOT</nuiton-utils.version>
+ <nuiton-utils.version>1.4</nuiton-utils.version>
<eugene.version>2.1.1</eugene.version>
- <topia.version>2.4.1-SNAPSHOT</topia.version>
+ <topia.version>2.4.2</topia.version>
<jaxx.version>2.1</jaxx.version>
<i18n.version>1.2.2</i18n.version>
1
0
r3002 - trunk/lima-business/src/main/java/org/chorem/lima/business/ejb
by jpepin@users.chorem.org 13 Aug '10
by jpepin@users.chorem.org 13 Aug '10
13 Aug '10
Author: jpepin
Date: 2010-08-13 15:01:51 +0200 (Fri, 13 Aug 2010)
New Revision: 3002
Url: http://chorem.org/repositories/revision/lima/3002
Log:
Mise ?\195?\160 jour algo de calcul du bilan / compte de r?\195?\169sultat : probl?\195?\168me si regroupement de compte inexistant r?\195?\169solu.
Modified:
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.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 2010-08-13 10:43:53 UTC (rev 3001)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java 2010-08-13 13:01:51 UTC (rev 3002)
@@ -491,7 +491,34 @@
}
//add all accounts
for (String accountNumber : accountNumbers) {
+ Account account = null;
if (subAccountsMode){
+ account = accountDAO.findSubAccountByNumber(accountNumber);
+ }
+ else {
+ account = accountDAO.findByAccountNumber(accountNumber);
+
+ }
+ //add account if exist
+ if (account != null){
+ accounts.add(account);
+ }
+ //search all account start with accountnumber
+ else {
+ TopiaQuery query = accountDAO.createQuery();
+ String subAccountsProperty = TopiaQuery.getProperty(Account.SUB_ACCOUNTS);
+ String subLedgersProperty = TopiaQuery.getProperty(Account.SUB_LEDGERS);
+ query.addWhere("not exists elements ("+subAccountsProperty+")")
+ //.addWhere("not exists elements ("+subLedgersProperty+")")
+ .addWhere(Account.ACCOUNT_NUMBER, Op.LIKE, accountNumber+"%");
+ List<Account> accountsResult = accountDAO.findAllByQuery(query);
+ if (accountsResult != null){
+ accounts.addAll(accountsResult);
+ }
+ }
+ }
+ /*for (String accountNumber : accountNumbers) {
+ if (subAccountsMode){
Account account = accountDAO.findSubAccountByNumber(accountNumber);
if (account == null){
TopiaQuery query = accountDAO.createQuery();
@@ -517,7 +544,7 @@
}
}
- }
+ }*/
//remove all accounts
for (String accountNumber : accountNumbersToRemove) {
Account account = null;
1
0