Lima-commits
Threads by month
- ----- 2026 -----
- August
- July
- 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
April 2012
- 2 participants
- 49 discussions
r3372 - trunk/lima-business/src/main/java/org/chorem/lima
by echatellier@users.chorem.org April 17, 2012
by echatellier@users.chorem.org April 17, 2012
April 17, 2012
Author: echatellier
Date: 2012-04-17 17:39:47 +0200 (Tue, 17 Apr 2012)
New Revision: 3372
Url: http://chorem.org/repositories/revision/lima/3372
Log:
Remove unused class
Removed:
trunk/lima-business/src/main/java/org/chorem/lima/LimaThread.java
Deleted: trunk/lima-business/src/main/java/org/chorem/lima/LimaThread.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/LimaThread.java 2012-04-17 15:37:23 UTC (rev 3371)
+++ trunk/lima-business/src/main/java/org/chorem/lima/LimaThread.java 2012-04-17 15:39:47 UTC (rev 3372)
@@ -1,42 +0,0 @@
-/*
- * #%L
- *
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2012 Codelutin, Chatellier Eric
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
- *
- * You should have received a copy of the GNU General Lesser Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/lgpl-3.0.html>.
- * #L%
- */
-
-package org.chorem.lima;
-
-import org.nuiton.topia.TopiaContext;
-
-/**
- * TODO add comment here.
- *
- * @author chatellier
- * @version $Revision$
- *
- * Last update : $Date$
- * By : $Author$
- */
-public class LimaThread {
-
- public static ThreadLocal<TopiaContext> threadLocal = new ThreadLocal<TopiaContext>();
-}
1
0
r3371 - in trunk: lima-business/src/main/java/org/chorem/lima lima-business/src/main/java/org/chorem/lima/business lima-business/src/main/java/org/chorem/lima/business/accountingrules lima-business/src/main/java/org/chorem/lima/business/ejb lima-business/src/main/resources/META-INF lima-business-api/src/main/java/org/chorem/lima/business/api
by echatellier@users.chorem.org April 17, 2012
by echatellier@users.chorem.org April 17, 2012
April 17, 2012
Author: echatellier
Date: 2012-04-17 17:37:23 +0200 (Tue, 17 Apr 2012)
New Revision: 3371
Url: http://chorem.org/repositories/revision/lima/3371
Log:
Add transaction support by container.
Added:
trunk/lima-business/src/main/java/org/chorem/lima/LimaThread.java
trunk/lima-business/src/main/java/org/chorem/lima/LimaXAResource.java
trunk/lima-business/src/main/java/org/chorem/lima/business/LimaDaoHelper.java
trunk/lima-business/src/main/java/org/chorem/lima/business/LimaInterceptor.java
Removed:
trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/AccountServiceLocal.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/DefaultAccountingRules.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FiscalPeriodServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java
trunk/lima-business/src/main/resources/META-INF/ejb-jar.xml
Added: trunk/lima-business/src/main/java/org/chorem/lima/LimaThread.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/LimaThread.java (rev 0)
+++ trunk/lima-business/src/main/java/org/chorem/lima/LimaThread.java 2012-04-17 15:37:23 UTC (rev 3371)
@@ -0,0 +1,42 @@
+/*
+ * #%L
+ *
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2012 Codelutin, Chatellier Eric
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
+package org.chorem.lima;
+
+import org.nuiton.topia.TopiaContext;
+
+/**
+ * TODO add comment here.
+ *
+ * @author chatellier
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author$
+ */
+public class LimaThread {
+
+ public static ThreadLocal<TopiaContext> threadLocal = new ThreadLocal<TopiaContext>();
+}
Property changes on: trunk/lima-business/src/main/java/org/chorem/lima/LimaThread.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: trunk/lima-business/src/main/java/org/chorem/lima/LimaXAResource.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/LimaXAResource.java (rev 0)
+++ trunk/lima-business/src/main/java/org/chorem/lima/LimaXAResource.java 2012-04-17 15:37:23 UTC (rev 3371)
@@ -0,0 +1,153 @@
+/*
+ * #%L
+ *
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2012 Codelutin, Chatellier Eric
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
+package org.chorem.lima;
+
+import javax.transaction.xa.XAException;
+import javax.transaction.xa.XAResource;
+import javax.transaction.xa.Xid;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.nuiton.topia.TopiaContext;
+import org.nuiton.topia.TopiaException;
+
+/**
+ * Topia XA ressource containing TopiaContext to commit or rollback.
+ *
+ * @author chatellier
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author$
+ */
+public class LimaXAResource implements XAResource {
+
+ private static Log log = LogFactory.getLog(LimaXAResource.class);
+
+ protected TopiaContext context;
+
+ protected int timeout;
+
+ public LimaXAResource(TopiaContext context) {
+ this.context = context;
+ }
+
+ /*
+ * @see javax.transaction.xa.XAResource#commit(javax.transaction.xa.Xid, boolean)
+ */
+ @Override
+ public void commit(Xid arg0, boolean arg1) throws XAException {
+ try {
+ context.commitTransaction();
+ } catch (TopiaException ex) {
+ if (log.isErrorEnabled()) {
+ log.error("Error", ex);
+ }
+ throw new XAException(XAException.XA_HEURCOM);
+ }
+ }
+
+ /*
+ * @see javax.transaction.xa.XAResource#end(javax.transaction.xa.Xid, int)
+ */
+ @Override
+ public void end(Xid arg0, int arg1) throws XAException {
+ /*try {
+ context.closeContext();
+ } catch (TopiaException ex) {
+ throw new XAException(XAException.XA_HEURCOM);
+ }*/
+ }
+
+ /*
+ * @see javax.transaction.xa.XAResource#forget(javax.transaction.xa.Xid)
+ */
+ @Override
+ public void forget(Xid xid) throws XAException {
+
+ }
+
+ /*
+ * @see javax.transaction.xa.XAResource#getTransactionTimeout()
+ */
+ @Override
+ public int getTransactionTimeout() throws XAException {
+ return timeout;
+ }
+
+ /*
+ * @see javax.transaction.xa.XAResource#isSameRM(javax.transaction.xa.XAResource)
+ */
+ @Override
+ public boolean isSameRM(XAResource xar) throws XAException {
+ return false;
+ }
+
+ /*
+ * @see javax.transaction.xa.XAResource#prepare(javax.transaction.xa.Xid)
+ */
+ @Override
+ public int prepare(Xid xid) throws XAException {
+ return XAResource.XA_OK;
+ }
+
+ /*
+ * @see javax.transaction.xa.XAResource#recover(int)
+ */
+ @Override
+ public Xid[] recover(int arg0) throws XAException {
+ return null;
+ }
+
+ /*
+ * @see javax.transaction.xa.XAResource#rollback(javax.transaction.xa.Xid)
+ */
+ @Override
+ public void rollback(Xid arg0) throws XAException {
+ try {
+ context.rollbackTransaction();
+ } catch (TopiaException ex) {
+ throw new XAException(XAException.XA_HEURCOM);
+ }
+ }
+
+ /*
+ * @see javax.transaction.xa.XAResource#setTransactionTimeout(int)
+ */
+ @Override
+ public boolean setTransactionTimeout(int timeout) throws XAException {
+ this.timeout = timeout;
+ return true;
+ }
+
+ /*
+ * @see javax.transaction.xa.XAResource#start(javax.transaction.xa.Xid, int)
+ */
+ @Override
+ public void start(Xid arg0, int arg1) throws XAException {
+
+ }
+}
Property changes on: trunk/lima-business/src/main/java/org/chorem/lima/LimaXAResource.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/AccountingRules.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/AccountingRules.java 2012-04-13 16:06:28 UTC (rev 3370)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/AccountingRules.java 2012-04-17 15:37:23 UTC (rev 3371)
@@ -53,7 +53,7 @@
void updateAccountRules(Account account) throws LimaException;
- void removeAccountRules(Account account, TopiaContext transaction) throws LimaException;
+ void removeAccountRules(Account account) throws LimaException;
/**
* Entrybook rules.
Added: trunk/lima-business/src/main/java/org/chorem/lima/business/LimaDaoHelper.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/LimaDaoHelper.java (rev 0)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/LimaDaoHelper.java 2012-04-17 15:37:23 UTC (rev 3371)
@@ -0,0 +1,62 @@
+/*
+ * #%L
+ *
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2012 Codelutin, Chatellier Eric
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
+package org.chorem.lima.business;
+
+import org.chorem.lima.entity.AccountDAO;
+import org.chorem.lima.entity.EntryDAO;
+import org.chorem.lima.entity.LimaCallaoDAOHelper;
+import org.nuiton.topia.TopiaContext;
+import org.nuiton.topia.TopiaException;
+
+/**
+ * DOA helper based on EJB because of context using.
+ *
+ * @author chatellier
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author$
+ */
+public class LimaDaoHelper {
+
+ protected static TopiaContext getContextTransaction() {
+ TopiaContext result = (TopiaContext)LimaInterceptor.TOPIA_CONTEXT.get();
+
+ if (result == null) {
+ throw new IllegalStateException("No opened transaction found. Put @TransactionAttribute on method or class");
+ }
+
+ return result;
+ }
+
+ public static AccountDAO getAccountDAO() throws TopiaException {
+ return LimaCallaoDAOHelper.getAccountDAO(getContextTransaction());
+ }
+
+ public static EntryDAO getEntryDAO() throws TopiaException {
+ return LimaCallaoDAOHelper.getEntryDAO(getContextTransaction());
+ }
+}
Property changes on: trunk/lima-business/src/main/java/org/chorem/lima/business/LimaDaoHelper.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: trunk/lima-business/src/main/java/org/chorem/lima/business/LimaInterceptor.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/LimaInterceptor.java (rev 0)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/LimaInterceptor.java 2012-04-17 15:37:23 UTC (rev 3371)
@@ -0,0 +1,122 @@
+/*
+ * #%L
+ *
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2012 Codelutin, Chatellier Eric
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
+package org.chorem.lima.business;
+
+import javax.annotation.Resource;
+import javax.ejb.Stateless;
+import javax.ejb.TransactionAttribute;
+import javax.interceptor.AroundInvoke;
+import javax.interceptor.InvocationContext;
+import javax.transaction.Transaction;
+import javax.transaction.TransactionManager;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.chorem.lima.LimaXAResource;
+import org.nuiton.topia.TopiaContext;
+import org.nuiton.topia.TopiaContextFactory;
+import org.nuiton.topia.TopiaNotFoundException;
+
+/**
+ * Interceptor for topia context transaction.
+ *
+ * http://stackoverflow.com/questions/8608349
+ *
+ * @author chatellier
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author$
+ */
+@Stateless
+public class LimaInterceptor {
+
+ private final Log log = LogFactory.getLog(LimaInterceptor.class);
+
+ public static final ThreadLocal<TopiaContext> TOPIA_CONTEXT = new ThreadLocal<TopiaContext>();
+
+ @Resource
+ private TransactionManager transactionManager;
+
+ protected TopiaContext rootContext;
+
+ public LimaInterceptor() {
+ if (log.isInfoEnabled()) {
+ log.info("Init root context");
+ }
+
+ LimaConfig config = LimaConfig.getInstance();
+ try {
+ rootContext = TopiaContextFactory.getContext(config.getFlatOptions());
+ } catch (TopiaNotFoundException ex) {
+ if (log.isErrorEnabled()) {
+ log.error("Can't init root context", ex);
+ }
+ }
+ }
+
+ @AroundInvoke
+ public Object invoke(InvocationContext context) throws Exception {
+
+ Object result;
+
+ // only open transaction when incoming call just
+ // enter in service layer
+ // interceptor will be called before each internal
+ // ejb call, but opening a new transaction in not required
+ if (TOPIA_CONTEXT.get() == null) {
+
+ // maybe take care of TransactionAttributeTypes ?
+ if (context.getTarget().getClass().getAnnotation(TransactionAttribute.class) != null ||
+ context.getMethod().getAnnotation(TransactionAttribute.class) != null) {
+ if (log.isDebugEnabled()) {
+ log.debug("Init new topia transaction for method : " +
+ context.getTarget().getClass() + "#" + context.getMethod().getName());
+ }
+
+ TopiaContext tx = rootContext.beginTransaction();
+
+ TOPIA_CONTEXT.set(tx);
+
+ Transaction tr = transactionManager.getTransaction();
+
+ // enlist topia xaresource, will will commited or rollback
+ // by container
+ tr.enlistResource(new LimaXAResource(tx));
+
+ result = context.proceed();
+ TOPIA_CONTEXT.remove();
+ } else {
+ result = context.proceed();
+ }
+
+ } else {
+ result = context.proceed();
+ }
+
+ return result;
+ }
+}
Property changes on: trunk/lima-business/src/main/java/org/chorem/lima/business/LimaInterceptor.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/DefaultAccountingRules.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/DefaultAccountingRules.java 2012-04-13 16:06:28 UTC (rev 3370)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/DefaultAccountingRules.java 2012-04-17 15:37:23 UTC (rev 3371)
@@ -25,11 +25,18 @@
package org.chorem.lima.business.accountingrules;
+import static org.nuiton.i18n.I18n._;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.business.AccountingRules;
import org.chorem.lima.business.LimaBusinessException;
+import org.chorem.lima.business.LimaDaoHelper;
import org.chorem.lima.business.LimaException;
import org.chorem.lima.entity.Account;
import org.chorem.lima.entity.ClosedPeriodicEntryBook;
@@ -48,12 +55,6 @@
import org.nuiton.topia.TopiaException;
import org.nuiton.topia.framework.TopiaQuery;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-
-import static org.nuiton.i18n.I18n._;
-
/**
* Defaults rules, if no localized rules classes is instantiated
* this default class contain the strict minimum rules to check the data integrity.
@@ -67,6 +68,9 @@
protected static final Log log =
LogFactory.getLog(DefaultAccountingRules.class);
+ /** DAO helper not injected by EJB. */
+ protected LimaDaoHelper daoHelper = new LimaDaoHelper();
+
/**
* Rules to check before create accounts.
*/
@@ -111,16 +115,16 @@
* Recursive function
*/
@Override
- public void removeAccountRules(Account account, TopiaContext transaction) throws LimaException {
+ public void removeAccountRules(Account account) throws LimaException {
try {
- EntryDAO entryDAO = LimaCallaoDAOHelper.getEntryDAO(transaction);
+ EntryDAO entryDAO = daoHelper.getEntryDAO();
// Check if account have entries
int nbentries = entryDAO.findAllByAccount(account).size();
if (nbentries != 0) {
throw new LimaBusinessException(_("lima-business.defaultaccountingrules.deleteaccounterror"));
}
} catch (TopiaException ex) {
- doCatch(transaction, ex, log);
+ throw new LimaException("Can't remvoe account", 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 2012-04-13 16:06:28 UTC (rev 3370)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java 2012-04-17 15:37:23 UTC (rev 3371)
@@ -25,28 +25,26 @@
package org.chorem.lima.business.ejb;
+import static org.nuiton.i18n.I18n._;
+
+import java.util.Collections;
+import java.util.List;
+
+import javax.ejb.Remote;
+import javax.ejb.Stateless;
+import javax.ejb.TransactionAttribute;
+
import org.chorem.lima.business.AccountingRules;
import org.chorem.lima.business.LimaBusinessException;
import org.chorem.lima.business.LimaConfig;
+import org.chorem.lima.business.LimaDaoHelper;
import org.chorem.lima.business.LimaException;
import org.chorem.lima.business.api.AccountService;
-import org.chorem.lima.business.api.AccountServiceLocal;
import org.chorem.lima.business.utils.AccountComparator;
import org.chorem.lima.entity.Account;
import org.chorem.lima.entity.AccountDAO;
-import org.chorem.lima.entity.LimaCallaoDAOHelper;
-import org.nuiton.topia.TopiaContext;
import org.nuiton.topia.TopiaException;
-import javax.ejb.Local;
-import javax.ejb.Remote;
-import javax.ejb.Stateless;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import static org.nuiton.i18n.I18n._;
-
/**
* Permet d'implémenter le Plan Comptable Général.
* Un compte ne peut être supprimé si il contient des écritures comptables.
@@ -57,40 +55,35 @@
*/
@Stateless
@Remote(AccountService.class)
-(a)Local(AccountServiceLocal.class)
-public class AccountServiceImpl extends AbstractLimaService implements AccountService, AccountServiceLocal {
+@TransactionAttribute
+public class AccountServiceImpl extends AbstractLimaService implements AccountService {
- private TopiaContext rootContext;
-
- public AccountServiceImpl() {
- rootContext = acquireRootContext();
- }
-
@Override
public long getAccountCount() throws LimaException {
long result = 0;
- TopiaContext transaction = beginTransaction(rootContext);
- try {
- // check if the accountnumber already exist
- AccountDAO accountDAO = LimaCallaoDAOHelper.getAccountDAO(transaction);
-
+ try {
+ AccountDAO accountDAO = LimaDaoHelper.getAccountDAO();
result = accountDAO.count();
- } catch (Exception ex) {
- doCatch(transaction, ex);
- } finally {
- doFinally(transaction);
+ } catch (TopiaException ex) {
+ throw new LimaException("Can't count", ex);
}
return result;
}
/**
- * Create new account with existing transaction.
+ * Permet de créer un nouveau compte dans le PCG de l'application.
+ *
+ * @param account account to create
+ * @throws LimaException
*/
@Override
- public Account createAccountWithTransaction(Account account,
- TopiaContext topiaContext) throws LimaException {
+ public Account createAccount(Account account) throws LimaException {
+ // check rules before create the account
+ AccountingRules accountingRules = LimaConfig.getInstance().getAccountingRules();
+ accountingRules.createAccountRules(account);
+
Account result = null;
try {
@@ -98,8 +91,7 @@
account.setAccountNumber(account.getAccountNumber().toUpperCase());
// check if account number already exist
- AccountDAO accountDAO =
- LimaCallaoDAOHelper.getAccountDAO(topiaContext);
+ AccountDAO accountDAO = LimaDaoHelper.getAccountDAO();
Account existAccount =
accountDAO.findByAccountNumber(account.getAccountNumber());
@@ -111,63 +103,19 @@
//create it
result = accountDAO.create(account);
-
- commitTransaction(topiaContext);
} catch (TopiaException ex) {
- doCatch(topiaContext, ex);
+ throw new LimaException("Can't create account", ex);
}
return result;
}
-
- /**
- * Permet de créer un nouveau compte dans le PCG de l'application.
- * ATTENTION : le compte masterAccount, c'est à dire le compte père, doit
- * exister, sinon le compte n'est pas créé. Si le compte n'a pas de père, alors
- * mettre masterAccount à null.
- *
- * @param account account to create
- * @throws LimaException
- */
@Override
- public Account createAccount(Account account) throws LimaException {
-
- // check rules before create the account
- AccountingRules accountingRules = LimaConfig.getInstance().getAccountingRules();
- accountingRules.createAccountRules(account);
-
- Account result = null;
- TopiaContext transaction = beginTransaction(rootContext);
- try {
-
- // check if the accountnumber already exist
- AccountDAO accountDAO = LimaCallaoDAOHelper.getAccountDAO(transaction);
- Account existAccount =
- accountDAO.findByAccountNumber(account.getAccountNumber());
- if (existAccount != null) {
- throw new LimaBusinessException(_(
- "lima-business.account.accountalreardyexist",
- account.getAccountNumber()));
- }
-
- result = createAccountWithTransaction(account, transaction);
- } catch (Exception ex) {
- doCatch(transaction, ex);
- } finally {
- doFinally(transaction);
- }
- return result;
- }
-
- @Override
public Account getMasterAccount(String accountNumber) throws LimaException {
Account account = null;
- TopiaContext transaction = beginTransaction(rootContext);
try {
- AccountDAO accountDAO =
- LimaCallaoDAOHelper.getAccountDAO(transaction);
+ AccountDAO accountDAO = LimaDaoHelper.getAccountDAO();
while (account == null && accountNumber.length() > 1) {
@@ -175,10 +123,8 @@
account = accountDAO.findByAccountNumber(accountNumber);
}
- } catch (Exception ex) {
- doCatch(transaction, ex);
- } finally {
- doFinally(transaction);
+ } catch (TopiaException ex) {
+ throw new LimaException("Can't get master account", ex);
}
return account;
}
@@ -188,16 +134,11 @@
public Account getAccountByNumber(String number) throws LimaException {
Account account = null;
- TopiaContext transaction = beginTransaction(rootContext);
try {
-
- AccountDAO accountDAO =
- LimaCallaoDAOHelper.getAccountDAO(transaction);
+ AccountDAO accountDAO = LimaDaoHelper.getAccountDAO();
account = accountDAO.findByAccountNumber(number);
} catch (Exception ex) {
- doCatch(transaction, ex);
- } finally {
- doFinally(transaction);
+ throw new LimaException("Can't get master account", ex);
}
return account;
@@ -208,18 +149,15 @@
@Override
public List<Account> getAllAccounts() throws LimaException {
- List<Account> accountsList = new ArrayList<Account>();
+ List<Account> accountsList;
- TopiaContext transaction = beginTransaction(rootContext);
try {
- AccountDAO accountDAO = LimaCallaoDAOHelper.getAccountDAO(transaction);
+ AccountDAO accountDAO = LimaDaoHelper.getAccountDAO();
accountsList = accountDAO.findAll();
Collections.sort(accountsList, new AccountComparator());
} catch (Exception ex) {
- doCatch(transaction, ex);
- } finally {
- doFinally(transaction);
+ throw new LimaException("Can't get all accounts", ex);
}
return accountsList;
@@ -232,15 +170,11 @@
List<Account> accountsList = null;
- TopiaContext transaction = beginTransaction(rootContext);
try {
- AccountDAO accountDAO =
- LimaCallaoDAOHelper.getAccountDAO(transaction);
+ AccountDAO accountDAO = LimaDaoHelper.getAccountDAO();
accountsList = accountDAO.findAllLeafAccounts();
} catch (Exception ex) {
- doCatch(transaction, ex);
- } finally {
- doFinally(transaction);
+ throw new LimaException("Can't get all leaf accounts", ex);
}
return accountsList;
@@ -258,10 +192,8 @@
List<Account> accountsList = null;
- TopiaContext transaction = beginTransaction(rootContext);
try {
- AccountDAO accountDAO =
- LimaCallaoDAOHelper.getAccountDAO(transaction);
+ AccountDAO accountDAO = LimaDaoHelper.getAccountDAO();
//TopiaQuery query = accountDAO.createQuery();
//tchemit 2011-09-21 Only consider account childs from the master account
@@ -294,9 +226,7 @@
accountsList = accountDAO.getSubAccounts(masterAccount);
} catch (Exception ex) {
- doCatch(transaction, ex);
- } finally {
- doFinally(transaction);
+ throw new LimaException("Can't get children accounts", ex);
}
return accountsList;
@@ -320,24 +250,21 @@
*/
@Override
public void removeAccount(Account account) throws LimaException {
- TopiaContext transaction = beginTransaction(rootContext);
+
AccountingRules accountingRules = LimaConfig.getInstance().getAccountingRules();
try {
// Check rules for account if have entries
- accountingRules.removeAccountRules(account, transaction);
+ accountingRules.removeAccountRules(account);
// remove account
- AccountDAO accountDAO = LimaCallaoDAOHelper.getAccountDAO(transaction);
+ AccountDAO accountDAO = LimaDaoHelper.getAccountDAO();
Account accountToDelete = accountDAO.findByTopiaId(account.getTopiaId());
accountDAO.delete(accountToDelete);
- commitTransaction(transaction);
- } catch (Exception ex) {
- doCatch(transaction, ex);
- } finally {
- doFinally(transaction);
+ } catch (TopiaException ex) {
+ throw new LimaException("Can't remove account", ex);
}
}
@@ -349,7 +276,6 @@
}
}
-
/**
* Permet de modifier un compte sur son label.
* <p/>
@@ -362,23 +288,19 @@
@Override
public Account updateAccount(Account account) throws LimaException {
- TopiaContext transaction = beginTransaction(rootContext);
AccountingRules accountingRules = LimaConfig.getInstance().getAccountingRules();
Account result = null;
try {
// DAO
- AccountDAO accountDAO =
- LimaCallaoDAOHelper.getAccountDAO(transaction);
+ AccountDAO accountDAO = LimaDaoHelper.getAccountDAO();
accountingRules.updateAccountRules(account);
result = accountDAO.update(account);
- commitTransaction(transaction);
+
} catch (Exception ex) {
- doCatch(transaction, ex);
- } finally {
- doFinally(transaction);
+ throw new LimaException("Can't update account", ex);
}
-
+
return result;
}
}
\ No newline at end of file
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 2012-04-13 16:06:28 UTC (rev 3370)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FiscalPeriodServiceImpl.java 2012-04-17 15:37:23 UTC (rev 3371)
@@ -25,6 +25,22 @@
package org.chorem.lima.business.ejb;
+import static org.nuiton.i18n.I18n._;
+
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Date;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.ejb.EJB;
+import javax.ejb.Local;
+import javax.ejb.Remote;
+import javax.ejb.Stateless;
+
import org.apache.commons.lang3.time.DateUtils;
import org.chorem.lima.beans.BalanceTrial;
import org.chorem.lima.beans.ReportsDatas;
@@ -32,7 +48,7 @@
import org.chorem.lima.business.LimaBusinessException;
import org.chorem.lima.business.LimaConfig;
import org.chorem.lima.business.LimaException;
-import org.chorem.lima.business.api.AccountServiceLocal;
+import org.chorem.lima.business.api.AccountService;
import org.chorem.lima.business.api.EntryBookServiceLocal;
import org.chorem.lima.business.api.FinancialPeriodServiceLocal;
import org.chorem.lima.business.api.FinancialTransactionServiceLocal;
@@ -56,21 +72,6 @@
import org.nuiton.topia.TopiaException;
import org.nuiton.topia.framework.TopiaQuery;
-import javax.ejb.EJB;
-import javax.ejb.Local;
-import javax.ejb.Remote;
-import javax.ejb.Stateless;
-import java.math.BigDecimal;
-import java.util.ArrayList;
-import java.util.Calendar;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Date;
-import java.util.Iterator;
-import java.util.List;
-
-import static org.nuiton.i18n.I18n._;
-
/**
* Gestion des exercices.
* Un exercice ne peut être supprimée et débloquée après cloture.
@@ -85,7 +86,7 @@
private TopiaContext rootContext;
@EJB
- protected AccountServiceLocal accountService;
+ protected AccountService accountService;
@EJB
protected FinancialPeriodServiceLocal financialPeriodService;
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 2012-04-13 16:06:28 UTC (rev 3370)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java 2012-04-17 15:37:23 UTC (rev 3371)
@@ -25,9 +25,32 @@
package org.chorem.lima.business.ejb;
-import au.com.bytecode.opencsv.CSVReader;
-import au.com.bytecode.opencsv.bean.ColumnPositionMappingStrategy;
-import au.com.bytecode.opencsv.bean.CsvToBean;
+import static org.nuiton.i18n.I18n._;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.StringReader;
+import java.math.BigDecimal;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.TreeMap;
+
+import javax.ejb.EJB;
+import javax.ejb.Local;
+import javax.ejb.Remote;
+import javax.ejb.Stateless;
+
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -54,7 +77,7 @@
import org.chorem.lima.business.LimaBusinessException;
import org.chorem.lima.business.LimaConfig;
import org.chorem.lima.business.LimaException;
-import org.chorem.lima.business.api.AccountServiceLocal;
+import org.chorem.lima.business.api.AccountService;
import org.chorem.lima.business.api.EntryBookServiceLocal;
import org.chorem.lima.business.api.FinancialPeriodServiceLocal;
import org.chorem.lima.business.api.FinancialStatementServiceLocal;
@@ -100,31 +123,10 @@
import org.nuiton.topia.TopiaContext;
import org.nuiton.topia.TopiaException;
-import javax.ejb.EJB;
-import javax.ejb.Local;
-import javax.ejb.Remote;
-import javax.ejb.Stateless;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.StringReader;
-import java.math.BigDecimal;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.TreeMap;
+import au.com.bytecode.opencsv.CSVReader;
+import au.com.bytecode.opencsv.bean.ColumnPositionMappingStrategy;
+import au.com.bytecode.opencsv.bean.CsvToBean;
-import static org.nuiton.i18n.I18n._;
-
/**
* Import export service.
* Currently import and export as CSV and EBP.
@@ -139,7 +141,7 @@
private TopiaContext rootContext;
@EJB
- private AccountServiceLocal accountService;
+ private AccountService accountService;
@EJB
private FiscalPeriodServiceLocal fiscalPeriodService;
@@ -365,7 +367,7 @@
.findByAccountNumber(masterAccountNumber);
i++;
}
- accountService.createAccountWithTransaction(account, topiaContext);
+ accountService.createAccount(account);
result.append(_("lima-business.import.accountadded", accountNumber, label));
}
// else if account and exclude account start with 0 (fix from error on EBP)
@@ -373,7 +375,7 @@
// if account is class account : 1, 2, 3, 4, 5, 6, 7,…
int nbCharAccountNumber = accountNumber.length();
if (nbCharAccountNumber == 1) {
- accountService.createAccountWithTransaction(account, topiaContext);
+ accountService.createAccount(account);
result.append(_("lima-business.import.accountadded", accountNumber, label));
} else {
Account masterAccount = null;
@@ -385,7 +387,7 @@
.findByAccountNumber(masterAccountNumber);
i++;
}
- accountService.createAccountWithTransaction(account, topiaContext);
+ accountService.createAccount(account);
result.append(_("lima-business.import.accountadded", accountNumber, label));
}
}
@@ -1174,7 +1176,7 @@
account.setLabel(accountImport.getLabel());
account.setThirdParty(accountImport.getThirdParty());
- accountService.createAccountWithTransaction(account, topiaContext);
+ accountService.createAccount(account);
result.append(_("lima-business.import.accountadded",
accountImport.getAccountNumber(),
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 2012-04-13 16:06:28 UTC (rev 3370)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java 2012-04-17 15:37:23 UTC (rev 3371)
@@ -25,13 +25,23 @@
package org.chorem.lima.business.ejb;
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+import javax.ejb.EJB;
+import javax.ejb.Local;
+import javax.ejb.Remote;
+import javax.ejb.Stateless;
+
import org.apache.commons.lang3.StringUtils;
import org.chorem.lima.beans.BalanceTrial;
import org.chorem.lima.beans.BalanceTrialImpl;
import org.chorem.lima.beans.ReportsDatas;
import org.chorem.lima.beans.ReportsDatasImpl;
import org.chorem.lima.business.LimaException;
-import org.chorem.lima.business.api.AccountServiceLocal;
+import org.chorem.lima.business.api.AccountService;
import org.chorem.lima.business.api.FinancialPeriodServiceLocal;
import org.chorem.lima.business.api.ReportService;
import org.chorem.lima.business.api.ReportServiceLocal;
@@ -48,15 +58,6 @@
import org.nuiton.topia.TopiaException;
import org.nuiton.topia.framework.TopiaQuery;
-import javax.ejb.EJB;
-import javax.ejb.Local;
-import javax.ejb.Remote;
-import javax.ejb.Stateless;
-import java.math.BigDecimal;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-
@Stateless
@Remote(ReportService.class)
@Local(ReportServiceLocal.class)
@@ -68,7 +69,7 @@
protected FinancialPeriodServiceLocal financialPeriodService;
@EJB
- protected AccountServiceLocal accountService;
+ protected AccountService accountService;
public ReportServiceImpl() {
rootContext = acquireRootContext();
Modified: trunk/lima-business/src/main/resources/META-INF/ejb-jar.xml
===================================================================
--- trunk/lima-business/src/main/resources/META-INF/ejb-jar.xml 2012-04-13 16:06:28 UTC (rev 3370)
+++ trunk/lima-business/src/main/resources/META-INF/ejb-jar.xml 2012-04-17 15:37:23 UTC (rev 3371)
@@ -25,5 +25,14 @@
<!--
Empty configuration file based on
http://openejb.apache.org/application-discovery-via-the-classpath.html
+
+ Interceptor based on : http://openejb.apache.org/examples-trunk/alternate-descriptors/
-->
-<ejb-jar/>
+<ejb-jar>
+ <assembly-descriptor>
+ <interceptor-binding>
+ <ejb-name>*</ejb-name>
+ <interceptor-class>org.chorem.lima.business.LimaInterceptor</interceptor-class>
+ </interceptor-binding>
+ </assembly-descriptor>
+</ejb-jar>
Deleted: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/AccountServiceLocal.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/AccountServiceLocal.java 2012-04-13 16:06:28 UTC (rev 3370)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/AccountServiceLocal.java 2012-04-17 15:37:23 UTC (rev 3371)
@@ -1,45 +0,0 @@
-/*
- * #%L
- * Lima business
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2008 - 2012 CodeLutin, Chatellier Eric
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-package org.chorem.lima.business.api;
-
-import org.chorem.lima.business.LimaException;
-import org.chorem.lima.entity.Account;
-import org.nuiton.topia.TopiaContext;
-
-/**
- * Account service.
- *
- * @author chatellier
- * @version $Revision$
- * <p/>
- * Last update : $Date$
- * By : $Author$
- */
-public interface AccountServiceLocal extends AccountService {
-
- Account createAccountWithTransaction(Account account, TopiaContext topiaContext) throws LimaException;
-
-}
\ No newline at end of file
1
0
r3370 - in trunk: lima-business/src/main/java/org/chorem/lima/business lima-business/src/main/java/org/chorem/lima/business/ejb lima-business-api/src/main/java/org/chorem/lima/business/api lima-callao/src/main/java/org/chorem/lima/entity lima-swing/src/main/java/org/chorem/lima/ui/celleditor lima-swing/src/main/java/org/chorem/lima/ui/combobox lima-swing/src/main/java/org/chorem/lima/widgets
by echatellier@users.chorem.org April 13, 2012
by echatellier@users.chorem.org April 13, 2012
April 13, 2012
Author: echatellier
Date: 2012-04-13 18:06:28 +0200 (Fri, 13 Apr 2012)
New Revision: 3370
Url: http://chorem.org/repositories/revision/lima/3370
Log:
Fix leaf account display
Added:
trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/LeafAccountComboBoxModel.java
Removed:
trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/
trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/SubAccountComboBoxModel.java
Modified:
trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/AccountService.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java
trunk/lima-callao/src/main/java/org/chorem/lima/entity/AccountDAO.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/celleditor/AccountTableCellEditor.java
trunk/lima-swing/src/main/java/org/chorem/lima/widgets/JWideComboBox.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 2012-04-13 15:26:32 UTC (rev 3369)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java 2012-04-13 16:06:28 UTC (rev 3370)
@@ -160,28 +160,7 @@
return result;
}
- /** Permer d'obtenir la liste des comptes à partir d'une de ses propriétés */
@Override
- public List<Account> getAllAccountByProperty(String propertyName,
- String value) throws LimaException {
- List<Account> account = null;
-
- TopiaContext transaction = beginTransaction(rootContext);
- try {
-
- AccountDAO accountDAO =
- LimaCallaoDAOHelper.getAccountDAO(transaction);
- account = accountDAO.findAllByProperty(propertyName, value);
- } catch (Exception ex) {
- doCatch(transaction, ex);
- } finally {
- doFinally(transaction);
- }
-
- return account;
- }
-
- @Override
public Account getMasterAccount(String accountNumber) throws LimaException {
Account account = null;
TopiaContext transaction = beginTransaction(rootContext);
@@ -208,13 +187,19 @@
@Override
public Account getAccountByNumber(String number) throws LimaException {
- List<Account> accountsList = getAllAccountByProperty(
- Account.PROPERTY_ACCOUNT_NUMBER, number);
-
Account account = null;
- if (accountsList.size() > 0) {
- account = accountsList.get(0);
+ TopiaContext transaction = beginTransaction(rootContext);
+ try {
+
+ AccountDAO accountDAO =
+ LimaCallaoDAOHelper.getAccountDAO(transaction);
+ account = accountDAO.findByAccountNumber(number);
+ } catch (Exception ex) {
+ doCatch(transaction, ex);
+ } finally {
+ doFinally(transaction);
}
+
return account;
}
Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/AccountService.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/AccountService.java 2012-04-13 15:26:32 UTC (rev 3369)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/AccountService.java 2012-04-13 16:06:28 UTC (rev 3370)
@@ -35,9 +35,9 @@
*
* @author chatellier
* @version $Revision$
- * <p/>
- * Last update : $Date$
- * By : $Author$
+ *
+ * Last update : $Date$
+ * By : $Author$
*/
public interface AccountService {
@@ -49,9 +49,6 @@
*/
long getAccountCount() throws LimaException;
- List<Account> getAllAccountByProperty(String propertyName,
- String value) throws LimaException;
-
/**
* Obtain the master account for the given account number.
* <p/>
Modified: trunk/lima-callao/src/main/java/org/chorem/lima/entity/AccountDAO.java
===================================================================
--- trunk/lima-callao/src/main/java/org/chorem/lima/entity/AccountDAO.java 2012-04-13 15:26:32 UTC (rev 3369)
+++ trunk/lima-callao/src/main/java/org/chorem/lima/entity/AccountDAO.java 2012-04-13 16:06:28 UTC (rev 3370)
@@ -27,11 +27,11 @@
import java.util.ArrayList;
import java.util.HashSet;
+import java.util.Iterator;
import java.util.List;
import java.util.Set;
import java.util.StringTokenizer;
-
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -44,11 +44,29 @@
/**
* Retourne tous les comptes qui n'ont pas eux meme de sous compte.
*/
- public List<Account> findAllLeafAccounts() throws TopiaException {
- String query = "FROM " + Account.class.getName() + " a WHERE a NOT IN (" +
+ public List<Account> findAllLeafAccounts() throws TopiaException {
+ // FIXME echatellier 20120413 la requete ne fonctionne pas
+ // et retourne vide
+ /*String query = "FROM " + Account.class.getName() + " a WHERE a NOT IN (" +
"FROM " + Account.class.getName() + " b where b.accountNumber like concat(a.accountNumber,'%'))";
- List<Account> accounts = context.find(query);
- return accounts;
+ List<Account> accounts = context.find(query);*/
+
+ // code temporaire non performant en attandant:
+ List<Account> allAccounts = findAll();
+ Iterator<Account> itAccount = allAccounts.iterator();
+ while (itAccount.hasNext()) {
+ Account acc = itAccount.next();
+ Iterator<Account> itAccount2 = allAccounts.iterator();
+ while (itAccount2.hasNext()) {
+ Account acc2 = itAccount2.next();
+ if (!acc2.getAccountNumber().equals(acc.getAccountNumber()) &&
+ acc2.getAccountNumber().startsWith(acc.getAccountNumber())) {
+ itAccount.remove();
+ break;
+ }
+ }
+ }
+ return allAccounts;
}
/**
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/celleditor/AccountTableCellEditor.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/celleditor/AccountTableCellEditor.java 2012-04-13 15:26:32 UTC (rev 3369)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/celleditor/AccountTableCellEditor.java 2012-04-13 16:06:28 UTC (rev 3370)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2008 - 2010 CodeLutin
+ * Copyright (C) 2008 - 2012 CodeLutin
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
@@ -29,7 +29,7 @@
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.entity.Account;
import org.chorem.lima.ui.combobox.AccountRenderer;
-import org.chorem.lima.ui.combobox.SubAccountComboBoxModel;
+import org.chorem.lima.ui.combobox.LeafAccountComboBoxModel;
import org.chorem.lima.util.AccountToString;
import org.chorem.lima.widgets.JWideComboBox;
import org.jdesktop.swingx.autocomplete.AutoCompleteDecorator;
@@ -45,21 +45,30 @@
import java.awt.event.MouseEvent;
import java.util.EventObject;
+/**
+ * Editor des cellules de tableau de type "Account".
+ * Affiche une wide combo box pour selectionner un compte.
+ *
+ * @author chatellier
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author$
+ */
public class AccountTableCellEditor extends AbstractCellEditor implements TableCellEditor, KeyListener {
- protected static final Log log = LogFactory.getLog(EntryBookTableCellEditor.class);
+ protected static final Log log = LogFactory.getLog(AccountTableCellEditor.class);
private final JWideComboBox comboBox;
private static final long serialVersionUID = 1L;
-// private static AccountTableCellEditor editor;
private static boolean keyPressed;
/** constructor */
public AccountTableCellEditor() {
comboBox = new JWideComboBox();
- SubAccountComboBoxModel accountComboBoxModel = new SubAccountComboBoxModel();
+ LeafAccountComboBoxModel accountComboBoxModel = new LeafAccountComboBoxModel();
comboBox.setModel(accountComboBoxModel);
AccountRenderer accountRenderer = new AccountRenderer();
comboBox.setRenderer(accountRenderer);
@@ -140,11 +149,4 @@
}
-// public static AccountTableCellEditor getInstance() {
-// if (editor == null) {
-// editor = new AccountTableCellEditor();
-// }
-// return editor;
-// }
-
}
Copied: trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/LeafAccountComboBoxModel.java (from rev 3366, trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/SubAccountComboBoxModel.java)
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/LeafAccountComboBoxModel.java (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/LeafAccountComboBoxModel.java 2012-04-13 16:06:28 UTC (rev 3370)
@@ -0,0 +1,113 @@
+/*
+ * #%L
+ * Lima Swing
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2008 - 2012 CodeLutin, Chatellier Eric
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+package org.chorem.lima.ui.combobox;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.chorem.lima.business.LimaException;
+import org.chorem.lima.business.ServiceListener;
+import org.chorem.lima.business.api.AccountService;
+import org.chorem.lima.business.monitorable.AccountServiceMonitorable;
+import org.chorem.lima.business.monitorable.ImportServiceMonitorable;
+import org.chorem.lima.entity.Account;
+import org.chorem.lima.service.LimaServiceFactory;
+
+import javax.swing.AbstractListModel;
+import javax.swing.ComboBoxModel;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Account combo box model containing only leaf account (without sub accounts).
+ */
+public class LeafAccountComboBoxModel extends AbstractListModel implements ComboBoxModel, ServiceListener {
+
+ private static final long serialVersionUID = 1L;
+
+ private static final Log log = LogFactory.getLog(LeafAccountComboBoxModel.class);
+
+ protected Object selectedAccount;
+
+ protected List<Account> datasCache;
+
+ protected AccountService accountService;
+
+ public LeafAccountComboBoxModel() {
+ accountService =
+ LimaServiceFactory.getService(AccountServiceMonitorable.class);
+ LimaServiceFactory.addServiceListener(accountService, this);
+ LimaServiceFactory.addServiceListener(ImportServiceMonitorable.class, this);
+ datasCache = getDataList();
+ }
+
+ @Override
+ public Object getSelectedItem() {
+ return selectedAccount;
+ }
+
+ @Override
+ public void setSelectedItem(Object anItem) {
+ selectedAccount = anItem;
+ fireContentsChanged(this, -1, -1);
+ }
+
+ @Override
+ public Object getElementAt(int index) {
+ return datasCache.get(index);
+ }
+
+ @Override
+ public int getSize() {
+ return datasCache.size();
+ }
+
+ public List<Account> getDataList() {
+ List<Account> result = new ArrayList<Account>();
+ try {
+ result = accountService.getAllLeafAccounts();
+ } catch (LimaException eee) {
+ if (log.isDebugEnabled()) {
+ log.debug("Can't get list subaccounts", eee);
+ }
+ }
+ return result;
+
+ }
+
+ public void refresh() {
+ datasCache = getDataList();
+ fireContentsChanged(this, 0, datasCache.size());
+ }
+
+ @Override
+ public void notifyMethod(String serviceName, String methodName) {
+ if (serviceName.contains("Account") ||
+ methodName.contains("importAll")) {
+ refresh();
+ }
+ }
+
+}
Deleted: trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/SubAccountComboBoxModel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/SubAccountComboBoxModel.java 2012-04-13 15:26:32 UTC (rev 3369)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/SubAccountComboBoxModel.java 2012-04-13 16:06:28 UTC (rev 3370)
@@ -1,114 +0,0 @@
-/*
- * #%L
- * Lima Swing
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2008 - 2012 CodeLutin, Chatellier Eric
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-package org.chorem.lima.ui.combobox;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.chorem.lima.business.LimaException;
-import org.chorem.lima.business.ServiceListener;
-import org.chorem.lima.business.api.AccountService;
-import org.chorem.lima.business.monitorable.AccountServiceMonitorable;
-import org.chorem.lima.business.monitorable.ImportServiceMonitorable;
-import org.chorem.lima.entity.Account;
-import org.chorem.lima.service.LimaServiceFactory;
-
-import javax.swing.AbstractListModel;
-import javax.swing.ComboBoxModel;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Account combo box model.
- */
-public class SubAccountComboBoxModel extends AbstractListModel implements ComboBoxModel, ServiceListener {
-
- private static final long serialVersionUID = 1L;
-
- private static final Log log = LogFactory.getLog(SubAccountComboBoxModel.class);
-
- protected Object selectedAccount;
-
- protected List<Account> datasCache;
-
- protected AccountService accountService;
-
- public SubAccountComboBoxModel() {
- accountService =
- LimaServiceFactory.getService(AccountServiceMonitorable.class);
- LimaServiceFactory.addServiceListener(accountService, this);
- LimaServiceFactory.addServiceListener(ImportServiceMonitorable.class, this);
- datasCache = getDataList();
- }
-
- @Override
- public Object getSelectedItem() {
- return selectedAccount;
- }
-
- @Override
- public void setSelectedItem(Object anItem) {
- selectedAccount = anItem;
- fireContentsChanged(this, -1, -1);
- }
-
- @Override
- public Object getElementAt(int index) {
- return datasCache.get(index);
- }
-
- @Override
- public int getSize() {
- return datasCache.size();
- }
-
- public List<Account> getDataList() {
- List<Account> result = new ArrayList<Account>();
- try {
- result = accountService.getAllLeafAccounts();
- } catch (LimaException eee) {
- if (log.isDebugEnabled()) {
- log.debug("Can't get list subaccounts", eee);
- }
- }
- return result;
-
- }
-
- public void refresh() {
- datasCache = getDataList();
- fireContentsChanged(this, 0, datasCache.size());
- }
-
- @Override
- public void notifyMethod(String serviceName, String methodeName) {
- if (serviceName.contains("Account") ||
- methodeName.contains("importAll")) {
- refresh();
- }
- }
-
-
-}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/widgets/JWideComboBox.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/widgets/JWideComboBox.java 2012-04-13 15:26:32 UTC (rev 3369)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/widgets/JWideComboBox.java 2012-04-13 16:06:28 UTC (rev 3370)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2008 - 2010 CodeLutin
+ * Copyright (C) 2008 - 2012 CodeLutin, Chatellier Eric
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
1
0
r3369 - trunk/lima-swing/src/main/java/org/chorem/lima/ui/celleditor
by echatellier@users.chorem.org April 13, 2012
by echatellier@users.chorem.org April 13, 2012
April 13, 2012
Author: echatellier
Date: 2012-04-13 17:26:32 +0200 (Fri, 13 Apr 2012)
New Revision: 3369
Url: http://chorem.org/repositories/revision/lima/3369
Log:
Add documentation.
Modified:
trunk/lima-swing/src/main/java/org/chorem/lima/ui/celleditor/EmptyCellRenderer.java
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/celleditor/EmptyCellRenderer.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/celleditor/EmptyCellRenderer.java 2012-04-13 14:56:37 UTC (rev 3368)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/celleditor/EmptyCellRenderer.java 2012-04-13 15:26:32 UTC (rev 3369)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2008 - 2011 CodeLutin
+ * Copyright (C) 2008 - 2012 CodeLutin, Chatellier Eric
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
@@ -24,23 +24,43 @@
*/
package org.chorem.lima.ui.celleditor;
-import sun.swing.DefaultLookup;
+import java.awt.Color;
+import java.awt.Component;
import javax.swing.JLabel;
import javax.swing.JTable;
+import javax.swing.UIManager;
import javax.swing.border.Border;
import javax.swing.border.EmptyBorder;
import javax.swing.table.DefaultTableCellRenderer;
-import java.awt.Color;
-import java.awt.Component;
-@SuppressWarnings("restriction")
+/**
+ * Renderer qui affiche la valeur de la cellule (toString()) en permettant de
+ * conserver les cases rouges (entre invalides) meme lors de la selection
+ * de la ligne.
+ *
+ * TODO echatellier 20120412 reprise de code herité du jdk, pas très propre
+ * mais en essayant de l'enlevr, on perd le coloration des lignes non
+ * selectionnées.
+ *
+ * @author chatellier
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author$
+ */
public class EmptyCellRenderer extends DefaultTableCellRenderer {
+ /** serialVersionUID. */
private static final long serialVersionUID = -7834417406160620726L;
+ public EmptyCellRenderer() {
+
+ }
+
public Component getTableCellRendererComponent(JTable table, Object value,
boolean isSelected, boolean hasFocus, int row, int column) {
+
//Create a new JLabel to avoid colouring only when row is selected
JLabel mycell = new JLabel();
mycell.setOpaque(true);
@@ -57,10 +77,10 @@
if (hasFocus) {
Border border = null;
if (isSelected) {
- border = DefaultLookup.getBorder(this, ui, "Table.focusSelectedCellHighlightBorder");
+ border = UIManager.getBorder("Table.focusSelectedCellHighlightBorder");
}
if (border == null) {
- border = DefaultLookup.getBorder(this, ui, "Table.focusCellHighlightBorder");
+ border = UIManager.getBorder("Table.focusCellHighlightBorder");
}
mycell.setBorder(border);
}
@@ -70,7 +90,7 @@
// if empty or null, colour background in red
// else setText
if (value instanceof String) {
- if (String.valueOf(value).isEmpty() || String.valueOf(value) == null) {
+ if (String.valueOf(value) == null || String.valueOf(value).isEmpty()) {
mycell.setBackground(new Color(255, 198, 209));
} else {
mycell.setText(value.toString());
1
0
r3368 - in trunk/lima-swing/src/main: java/org/chorem/lima/ui/account resources/i18n
by echatellier@users.chorem.org April 13, 2012
by echatellier@users.chorem.org April 13, 2012
April 13, 2012
Author: echatellier
Date: 2012-04-13 16:56:37 +0200 (Fri, 13 Apr 2012)
New Revision: 3368
Url: http://chorem.org/repositories/revision/lima/3368
Log:
Fix translation
Modified:
trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountView.jaxx
trunk/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties
trunk/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountView.jaxx 2012-04-13 14:44:59 UTC (rev 3367)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountView.jaxx 2012-04-13 14:56:37 UTC (rev 3368)
@@ -37,7 +37,7 @@
<script><![CDATA[
void $afterCompleteSetup() {
handler.init();
- }
+ }
]]></script>
<row>
@@ -72,7 +72,7 @@
</row>
<row>
<cell fill="horizontal" anchor="north" weighty="1">
- <JButton id="importButton" text="lima.iu.importexport.import"
+ <JButton id="importButton" text="lima.ui.importexport.import"
onActionPerformed="handler.importAccountsChart()"/>
</cell>
</row>
Modified: trunk/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties
===================================================================
--- trunk/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties 2012-04-13 14:44:59 UTC (rev 3367)
+++ trunk/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties 2012-04-13 14:56:37 UTC (rev 3368)
@@ -203,7 +203,6 @@
lima.importexport.wait=Job in progress…
lima.init.closed=Lima closed at %1$s
lima.init.errorclosing=Error during Lima close
-lima.iu.importexport.import=
lima.ledger.documentcreationerror=Enable to create document
lima.lettering.listerror=Can't get entries list
lima.menu.file=File
@@ -354,6 +353,7 @@
lima.ui.home.transaction.modifiy.unbalanced=
lima.ui.home.transaction.nothing=
lima.ui.home.transaction.unbalanced=
+lima.ui.importexport.import=
lima.ui.importexport.importcsv=
lima.ui.importexport.importebp=
lima.vatreport.listerror=Can't get entries list
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 2012-04-13 14:44:59 UTC (rev 3367)
+++ trunk/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties 2012-04-13 14:56:37 UTC (rev 3368)
@@ -183,7 +183,6 @@
lima.importexport.wait=Traitement en cours …
lima.init.closed=Lima fermé à %1$s
lima.init.errorclosing=Erreur lors de la fermeture
-lima.iu.importexport.import=
lima.ledger.documentcreationerror=Erreur lors de la création du document
lima.lettering.listerror=Erreur lors de la récupération des données de la liste
lima.menu.file=Fichier
@@ -333,6 +332,7 @@
lima.ui.home.transaction.modifiy.unbalanced=Modifier les écritures incorrectes
lima.ui.home.transaction.nothing=Aucune écriture
lima.ui.home.transaction.unbalanced=transactions ne sont pas équilibrées \!
+lima.ui.importexport.import=Importer
lima.ui.importexport.importcsv=Import/Export CSV
lima.ui.importexport.importebp=Import/Export EBP
lima.vatreport.listerror=Erreur lors de la récupération des données de la liste
1
0
r3367 - in trunk: lima-callao/src/main/java/org/chorem/lima/entity lima-swing/src/main/java/org/chorem/lima/ui/financialperiod lima-swing/src/main/resources/i18n
by echatellier@users.chorem.org April 13, 2012
by echatellier@users.chorem.org April 13, 2012
April 13, 2012
Author: echatellier
Date: 2012-04-13 16:44:59 +0200 (Fri, 13 Apr 2012)
New Revision: 3367
Url: http://chorem.org/repositories/revision/lima/3367
Log:
Financial period ui refactoring
Added:
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialperiod/package-info.java
Modified:
trunk/lima-callao/src/main/java/org/chorem/lima/entity/FinancialTransactionImpl.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialperiod/FinancialPeriodTable.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialperiod/FinancialPeriodTableModel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialperiod/FinancialPeriodView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialperiod/FinancialPeriodViewHandler.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-callao/src/main/java/org/chorem/lima/entity/FinancialTransactionImpl.java
===================================================================
--- trunk/lima-callao/src/main/java/org/chorem/lima/entity/FinancialTransactionImpl.java 2012-04-13 13:46:24 UTC (rev 3366)
+++ trunk/lima-callao/src/main/java/org/chorem/lima/entity/FinancialTransactionImpl.java 2012-04-13 14:44:59 UTC (rev 3367)
@@ -46,11 +46,11 @@
@Override
public BigDecimal getAmountDebit() {
BigDecimal result = new BigDecimal(0);
- /*for (Entry entryFT : getEntry()) {
+ for (Entry entryFT : getEntry()) {
if (entryFT.isDebit()) {
result.add(entryFT.getAmount());
}
- }*/
+ }
return result;
}
@@ -60,11 +60,11 @@
@Override
public BigDecimal getAmountCredit() {
BigDecimal result = new BigDecimal(0);
- /*for (Entry entryFT : getEntry()) {
+ for (Entry entryFT : getEntry()) {
if (!entryFT.isDebit()) {
result.add(entryFT.getAmount());
}
- }*/
+ }
return result;
}
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialperiod/FinancialPeriodTable.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialperiod/FinancialPeriodTable.java 2012-04-13 13:46:24 UTC (rev 3366)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialperiod/FinancialPeriodTable.java 2012-04-13 14:44:59 UTC (rev 3367)
@@ -25,112 +25,78 @@
package org.chorem.lima.ui.financialperiod;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.chorem.lima.business.LimaException;
-import org.chorem.lima.business.api.FinancialPeriodService;
-import org.chorem.lima.business.monitorable.FinancialPeriodServiceMonitorable;
-import org.chorem.lima.entity.ClosedPeriodicEntryBook;
-import org.chorem.lima.entity.ClosedPeriodicEntryBookImpl;
-import org.chorem.lima.service.LimaServiceFactory;
-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;
-
import java.awt.Color;
import java.awt.Component;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
-import java.text.SimpleDateFormat;
-public class FinancialPeriodTable extends JXTable
- implements KeyListener, MouseListener {
+import org.chorem.lima.entity.ClosedPeriodicEntryBook;
+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;
+import org.jdesktop.swingx.decorator.HighlighterFactory;
+/**
+ * Financial period table adding color hidhlighter and key management.
+ *
+ * @author chatellier
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author$
+ */
+public class FinancialPeriodTable extends JXTable implements KeyListener, MouseListener {
+
+ /** serialVersionUID. */
private static final long serialVersionUID = -1960326844433064178L;
- private static final Log log =
- LogFactory.getLog(FinancialPeriodTableModel.class);
-
protected FinancialPeriodViewHandler handler;
protected FinancialPeriodTableModel model;
- protected FinancialPeriodService financialPeriodService;
-
- private Highlighter colorTransaction;
-
- /*
- * Constructor, call highlighter
- */
+ /**
+ * Constructor, install highlighter.
+ *
+ * @param handler
+ */
public FinancialPeriodTable(FinancialPeriodViewHandler handler) {
-
this.handler = handler;
+ model = handler.view.getFinancialPeriodTableModel();
addKeyListener(this);
addMouseListener(this);
- model = this.handler.getView().modelFinancialPeriodTable;
- financialPeriodService =
- LimaServiceFactory.getService(
- FinancialPeriodServiceMonitorable.class);
-
//highlight financial financial transactions
- addMonthColor();
+ addStripingColor();
addBlockColor();
}
- /*
+ /**
* Color the background row in grey if the month number is even (pair in french)
*/
- protected void addMonthColor() {
- HighlightPredicate predicate = new HighlightPredicate() {
- @Override
- public boolean isHighlighted(Component renderer,
- ComponentAdapter adapter) {
- ClosedPeriodicEntryBook closedPeriodicEntryBook
- = (ClosedPeriodicEntryBook) model.getElementAt(adapter.row);
- SimpleDateFormat simpleDateFormat = new SimpleDateFormat("MM");
- int month = Integer.parseInt(simpleDateFormat.format(
- closedPeriodicEntryBook.getFinancialPeriod().getBeginDate()));
- // true if month is even
- return month % 2 == 0;
-
- }
- };
- colorTransaction =
- new ColorHighlighter(predicate, new Color(222, 222, 222), null);
+ protected void addStripingColor() {
+ Highlighter colorTransaction = HighlighterFactory.createSimpleStriping(new Color(233,233,233));
addHighlighter(colorTransaction);
}
- /*
- * Color the font in red if period are closed
- */
+ /**
+ * Color the font in red if period are closed
+ */
protected void addBlockColor() {
HighlightPredicate predicate = new HighlightPredicate() {
@Override
public boolean isHighlighted(Component renderer,
ComponentAdapter adapter) {
ClosedPeriodicEntryBook closedPeriodicEntryBook =
- new ClosedPeriodicEntryBookImpl();
- ClosedPeriodicEntryBook selectedClosedPeriodicEntryBook =
(ClosedPeriodicEntryBook) model.getElementAt(adapter.row);
- // true if locked
- try {
- closedPeriodicEntryBook =
- financialPeriodService.getClosedPeriodicEntryBook(
- selectedClosedPeriodicEntryBook.getEntryBook(),
- selectedClosedPeriodicEntryBook.getFinancialPeriod());
- } catch (LimaException eee) {
- log.debug("Can't get closePeriodicEntryBook", eee);
- }
return closedPeriodicEntryBook.getLocked();
}
};
- colorTransaction =
+ Highlighter colorTransaction =
new ColorHighlighter(predicate, null, new Color(222, 0, 0));
addHighlighter(colorTransaction);
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialperiod/FinancialPeriodTableModel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialperiod/FinancialPeriodTableModel.java 2012-04-13 13:46:24 UTC (rev 3366)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialperiod/FinancialPeriodTableModel.java 2012-04-13 14:44:59 UTC (rev 3367)
@@ -25,77 +25,63 @@
package org.chorem.lima.ui.financialperiod;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.chorem.lima.business.LimaException;
-import org.chorem.lima.business.ServiceListener;
-import org.chorem.lima.business.monitorable.FinancialPeriodServiceMonitorable;
-import org.chorem.lima.business.monitorable.FiscalPeriodServiceMonitorable;
-import org.chorem.lima.business.monitorable.ImportServiceMonitorable;
-import org.chorem.lima.business.utils.FinancialPeriodComparator;
-import org.chorem.lima.entity.ClosedPeriodicEntryBook;
-import org.chorem.lima.entity.EntryBook;
-import org.chorem.lima.entity.FinancialPeriod;
-import org.chorem.lima.service.LimaServiceFactory;
+import static org.nuiton.i18n.I18n._;
-import javax.swing.table.AbstractTableModel;
+import java.text.DateFormat;
import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Collections;
import java.util.List;
-import static org.nuiton.i18n.I18n._;
+import javax.swing.table.AbstractTableModel;
+import org.chorem.lima.entity.ClosedPeriodicEntryBook;
+import org.chorem.lima.entity.EntryBook;
+import org.chorem.lima.entity.FinancialPeriod;
+
/**
- * TODO add comment here.
+ * Financial period table model.
*
* @author chatellier
* @version $Revision$
- * <p/>
- * Last update : $Date$
- * By : $Author$
+ *
+ * Last update : $Date$
+ * By : $Author$
*/
-public class FinancialPeriodTableModel extends AbstractTableModel implements ServiceListener {
+public class FinancialPeriodTableModel extends AbstractTableModel {
/** serialVersionUID. */
private static final long serialVersionUID = 77027335135838258L;
- private static final Log log =
- LogFactory.getLog(FinancialPeriodTableModel.class);
-
- /** service */
- protected FinancialPeriodServiceMonitorable financialPeriodService;
-
/** Datas cache */
- protected List<Object> cacheDataList;
+ protected List<ClosedPeriodicEntryBook> closedPeriodicEntryBooks;
public FinancialPeriodTableModel() {
- financialPeriodService =
- LimaServiceFactory.getService(
- FinancialPeriodServiceMonitorable.class);
- LimaServiceFactory.addServiceListener(ImportServiceMonitorable.class, this);
- LimaServiceFactory.addServiceListener(FiscalPeriodServiceMonitorable.class, this);
+
}
+ /**
+ * Update model data list.
+ *
+ * @param closedPeriodicEntryBooks new data
+ */
+ public void setClosedPeriodicEntryBooks(List<ClosedPeriodicEntryBook> closedPeriodicEntryBooks) {
+ this.closedPeriodicEntryBooks = closedPeriodicEntryBooks;
+ fireTableDataChanged();
+ }
@Override
public int getRowCount() {
int result = 0;
-
- if (cacheDataList != null) {
- result = cacheDataList.size();
+ if (closedPeriodicEntryBooks != null) {
+ result = closedPeriodicEntryBooks.size();
}
-
return result;
}
-
@Override
public int getColumnCount() {
return 3;
}
-
@Override
public String getColumnName(int columnIndex) {
@@ -103,111 +89,69 @@
switch (columnIndex) {
case 0:
- result = _("lima.table.period");
+ result = _("lima.ui.financialperiod.period");
break;
case 1:
- result = _("lima.table.entrybook");
+ result = _("lima.ui.financialperiod.entrybook");
break;
case 2:
- result = _("lima.table.closure");
+ result = _("lima.ui.financialperiod.closure");
break;
}
return result;
}
-
@Override
public Class<?> getColumnClass(int columnIndex) {
// both String
return String.class;
}
-
@Override
public boolean isCellEditable(int rowIndex, int columnIndex) {
return false;
}
- public ClosedPeriodicEntryBook getFinancialPeriodAtRow(int row) throws LimaException {
- return (ClosedPeriodicEntryBook) cacheDataList.get(row);
- }
-
-
- public Object getElementAt(int row) {
-
- Object currentRow = cacheDataList.get(row);
+ public ClosedPeriodicEntryBook getElementAt(int row) {
+ ClosedPeriodicEntryBook currentRow = closedPeriodicEntryBooks.get(row);
return currentRow;
}
-
@Override
public Object getValueAt(int rowIndex, int columnIndex) {
Object result = null;
- ClosedPeriodicEntryBook closedPeriodicEntryBook
- = (ClosedPeriodicEntryBook) cacheDataList.get(rowIndex);
+ ClosedPeriodicEntryBook closedPeriodicEntryBook = closedPeriodicEntryBooks.get(rowIndex);
- if (closedPeriodicEntryBook != null) {
- EntryBook entryBook = closedPeriodicEntryBook.getEntryBook();
- FinancialPeriod financialPeriod =
- closedPeriodicEntryBook.getFinancialPeriod();
-
- SimpleDateFormat simpleDateFormat
- = new SimpleDateFormat("dd MMM yyyy");
-
- switch (columnIndex) {
- case 0:
- result = simpleDateFormat.format(financialPeriod.getBeginDate())
- + " - " + simpleDateFormat.format(financialPeriod.getEndDate());
- break;
- case 1:
- result = entryBook.getCode() + " - " + entryBook.getLabel();
- break;
- case 2:
- if (closedPeriodicEntryBook.getLocked()) {
- result = _("lima.common.closed");
- } else {
- result = _("lima.common.open");
- }
- break;
- }
+ switch (columnIndex) {
+ case 0:
+ // FIXME echatellier 20120413 remove hardcoded french date format
+ DateFormat df = new SimpleDateFormat("dd MMM yyyy");
+ FinancialPeriod financialPeriod = closedPeriodicEntryBook.getFinancialPeriod();
+ result = df.format(financialPeriod.getBeginDate())
+ + " - " + df.format(financialPeriod.getEndDate());
+ break;
+ case 1:
+ EntryBook entryBook = closedPeriodicEntryBook.getEntryBook();
+ result = entryBook.getCode() + " - " + entryBook.getLabel();
+ break;
+ case 2:
+ if (closedPeriodicEntryBook.getLocked()) {
+ result = _("lima.common.closed");
+ } else {
+ result = _("lima.common.open");
+ }
+ break;
}
+
return result;
}
- public List<Object> getDataList() {
- List<Object> results =
- new ArrayList<Object>();
- try {
- List<ClosedPeriodicEntryBook> closedPeriodicEntryBook = financialPeriodService.//getAllClosedPeriodicEntryBooks();
- getAllClosedPeriodicEntryBooksFromUnblockedFiscalPeriod();
- Collections.sort(closedPeriodicEntryBook, new FinancialPeriodComparator());
- results.addAll(closedPeriodicEntryBook);
- } catch (LimaException eee) {
- if (log.isDebugEnabled()) {
- log.debug("Can't get closedperiodicentrybook list", eee);
- }
- }
- return results;
- }
-
- public void refresh() {
- cacheDataList = getDataList();
- fireTableDataChanged();
- }
-
- public void blockFinancialPeriod(ClosedPeriodicEntryBook closedPeriodicEntryBook) throws LimaException {
+ /*public void blockFinancialPeriod(ClosedPeriodicEntryBook closedPeriodicEntryBook) throws LimaException {
financialPeriodService.
blockClosedPeriodicEntryBook(closedPeriodicEntryBook);
refresh();
- }
+ }*/
-
- @Override
- public void notifyMethod(String serviceName, String methodeName) {
- if (methodeName.contains("FiscalPeriod") || methodeName.contains("importAll")) {
- refresh();
- }
- }
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialperiod/FinancialPeriodView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialperiod/FinancialPeriodView.jaxx 2012-04-13 13:46:24 UTC (rev 3366)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialperiod/FinancialPeriodView.jaxx 2012-04-13 14:44:59 UTC (rev 3367)
@@ -5,7 +5,7 @@
$Id$
$HeadURL$
%%
- Copyright (C) 2008 - 2010 CodeLutin
+ Copyright (C) 2008 - 2012 CodeLutin, Chatellier Eric
%%
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as
@@ -32,32 +32,27 @@
org.chorem.lima.ui.financialperiod.FinancialPeriodTableModel
</import>
- <FinancialPeriodViewHandler id="handler"
- javaBean="new FinancialPeriodViewHandler(this)"/>
+ <FinancialPeriodViewHandler id="handler" constructorParams="this"/>
<Boolean id="selectedPeriod" javaBean="false"/>
- <script>
- <![CDATA[
-
+ <script><![CDATA[
void $afterCompleteSetup() {
- getHandler().refresh();
- }
-
- ]]>
- </script>
+ getHandler().init();
+ }
+ ]]></script>
+
<row>
<cell fill="both" weightx="1" weighty="1">
<JScrollPane>
- <FinancialPeriodTableModel
- id="modelFinancialPeriodTable"/>
+ <FinancialPeriodTableModel id="financialPeriodTableModel"/>
<FinancialPeriodTable
id="financialPeriodTable" sortable="false" rowHeight="24"
constructorParams="getHandler()"
- model="{getModelFinancialPeriodTable()}"
+ model="{financialPeriodTableModel}"
selectionMode="{ListSelectionModel.SINGLE_INTERVAL_SELECTION}"
columnControlVisible="true"/>
<ListSelectionModel
- javaBean="getFinancialPeriodTable().getSelectionModel()"
+ javaBean="financialPeriodTable.getSelectionModel()"
onValueChanged="setSelectedPeriod(financialPeriodTable.getSelectedRow() != -1)"/>
</JScrollPane>
</cell>
@@ -65,7 +60,7 @@
<Table>
<row>
<cell>
- <JButton id="blockButton" text="lima.charts.financialperiod.block"
+ <JButton text="lima.ui.financialperiod.block"
enabled="{isSelectedPeriod()}"
onActionPerformed="getHandler().blockFinancialPeriod();"/>
</cell>
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialperiod/FinancialPeriodViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialperiod/FinancialPeriodViewHandler.java 2012-04-13 13:46:24 UTC (rev 3366)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialperiod/FinancialPeriodViewHandler.java 2012-04-13 14:44:59 UTC (rev 3367)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2008 - 2010 CodeLutin
+ * Copyright (C) 2008 - 2012 CodeLutin, Chatellier Eric
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
@@ -25,40 +25,74 @@
package org.chorem.lima.ui.financialperiod;
+import static org.nuiton.i18n.I18n._;
+
+import java.util.Collections;
+import java.util.List;
+
+import javax.swing.JOptionPane;
+
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.business.LimaException;
+import org.chorem.lima.business.LimaRuntimeException;
+import org.chorem.lima.business.ServiceListener;
+import org.chorem.lima.business.api.FinancialPeriodService;
+import org.chorem.lima.business.api.FiscalPeriodService;
+import org.chorem.lima.business.api.ImportService;
+import org.chorem.lima.business.utils.FinancialPeriodComparator;
import org.chorem.lima.entity.ClosedPeriodicEntryBook;
-import org.chorem.lima.util.DialogHelper;
+import org.chorem.lima.service.LimaServiceFactory;
import org.jdesktop.swingx.JXTable;
-import javax.swing.JOptionPane;
-
-import static org.nuiton.i18n.I18n._;
-
/**
- * TODO add comment here.
+ * Handler for FinancialPeriodView.
*
* @author chatellier
* @version $Revision$
- * <p/>
- * Last update : $Date$
- * By : $Author$
+ *
+ * Last update : $Date$
+ * By : $Author$
*/
-public class FinancialPeriodViewHandler {
+public class FinancialPeriodViewHandler implements ServiceListener {
private static final Log log = LogFactory.getLog(FinancialPeriodViewHandler.class);
+ protected FinancialPeriodService financialPeriodService;
+
protected FinancialPeriodView view;
- protected FinancialPeriodTable table;
-
- protected FinancialPeriodTableModel tableModel;
-
protected FinancialPeriodViewHandler(FinancialPeriodView view) {
this.view = view;
+
+ financialPeriodService = LimaServiceFactory.getService(FinancialPeriodService.class);
+ LimaServiceFactory.addServiceListener(ImportService.class, this);
+ LimaServiceFactory.addServiceListener(FiscalPeriodService.class, this);
}
+ /**
+ * Init view.
+ */
+ public void init() {
+ try {
+ // get data from service
+ List<ClosedPeriodicEntryBook> closedPeriodicEntryBooks = financialPeriodService.
+ getAllClosedPeriodicEntryBooksFromUnblockedFiscalPeriod();
+ Collections.sort(closedPeriodicEntryBooks, new FinancialPeriodComparator());
+ if (log.isDebugEnabled()) {
+ log.debug(String.format("Loaded %d closed periodic entry book", closedPeriodicEntryBooks.size()));
+ }
+
+ // notify ui
+ view.getFinancialPeriodTableModel().setClosedPeriodicEntryBooks(closedPeriodicEntryBooks);
+ } catch (LimaException ex) {
+ throw new LimaRuntimeException("Can't get closed periodic eb list", ex);
+ }
+ }
+
+ /**
+ * Block selected period.
+ */
public void blockFinancialPeriod() {
JXTable financialPeriodeTable = view.getFinancialPeriodTable();
int selectedRow = financialPeriodeTable.getSelectedRow();
@@ -66,27 +100,24 @@
// blocked it
try {
- ClosedPeriodicEntryBook closedPeriodicEntryBook = model.getFinancialPeriodAtRow(selectedRow);
- int response = JOptionPane.showConfirmDialog(view, _("lima.charts.financialperiod.question.blocked"),
- _("lima.common.question"), JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);
+ ClosedPeriodicEntryBook closedPeriodicEntryBook = model.getElementAt(selectedRow);
+ int response = JOptionPane.showConfirmDialog(view, _("lima.ui.financialperiod.blockmessage"),
+ _("lima.ui.financialperiod.blocktitle"),
+ JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);
if (response == JOptionPane.YES_OPTION) {
- model.blockFinancialPeriod(closedPeriodicEntryBook);
+ financialPeriodService.blockClosedPeriodicEntryBook(closedPeriodicEntryBook);
+ model.fireTableRowsUpdated(selectedRow, selectedRow);
}
} catch (LimaException eee) {
- if (log.isErrorEnabled()) {
- log.error("Can't block financialperiod", eee);
- }
- DialogHelper.showMessageDialog(eee.getMessage());
+ throw new LimaRuntimeException("Can't block financialperiod", eee);
}
}
- public FinancialPeriodView getView() {
- return view;
+ @Override
+ public void notifyMethod(String serviceName, String methodName) {
+ if (serviceName.contains("FiscalPeriod") || methodName.contains("importAll")) {
+ init();
+ }
}
-
- public void refresh() {
- tableModel = (FinancialPeriodTableModel) getView().getFinancialPeriodTable().getModel();
- tableModel.refresh();
- }
}
Added: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialperiod/package-info.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialperiod/package-info.java (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialperiod/package-info.java 2012-04-13 14:44:59 UTC (rev 3367)
@@ -0,0 +1,30 @@
+/*
+ * #%L
+ *
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2012 Codelutin, Chatellier Eric
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+/**
+ * Gestion des périodes comptables.
+ *
+ * Affichage, et cloture par période.
+ */
+package org.chorem.lima.ui.financialperiod;
Property changes on: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialperiod/package-info.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
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 2012-04-13 13:46:24 UTC (rev 3366)
+++ trunk/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties 2012-04-13 14:44:59 UTC (rev 3367)
@@ -293,6 +293,12 @@
lima.ui.entrybook.label=
lima.ui.entrybook.remove=
lima.ui.entrybook.update=
+lima.ui.financialperiod.block=
+lima.ui.financialperiod.blockmessage=
+lima.ui.financialperiod.blocktitle=
+lima.ui.financialperiod.closure=
+lima.ui.financialperiod.entrybook=
+lima.ui.financialperiod.period=
lima.ui.financialtransaction.account=
lima.ui.financialtransaction.balance=
lima.ui.financialtransaction.buttonback=
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 2012-04-13 13:46:24 UTC (rev 3366)
+++ trunk/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties 2012-04-13 14:44:59 UTC (rev 3367)
@@ -272,6 +272,12 @@
lima.ui.entrybook.label=Libellé
lima.ui.entrybook.remove=Supprimer
lima.ui.entrybook.update=Modifier
+lima.ui.financialperiod.block=Cloturer une période
+lima.ui.financialperiod.blockmessage=Êtes vous sûre de vouloir clôturer cette période ? Cette action est irréversible \!
+lima.ui.financialperiod.blocktitle=Clôture
+lima.ui.financialperiod.closure=Clôture
+lima.ui.financialperiod.entrybook=Journal
+lima.ui.financialperiod.period=Période
lima.ui.financialtransaction.account=Compte
lima.ui.financialtransaction.balance=Balance
lima.ui.financialtransaction.buttonback=←
@@ -296,7 +302,7 @@
lima.ui.fiscalperiod.block.confirmation=Ètes vous sûre de vouloir clôturer cette période ? Cette action est irréversible \!
lima.ui.fiscalperiod.block.newyear=Voulez vous créer un nouvel exercice?
lima.ui.fiscalperiod.block.retainedearningstitle=Report à nouveau
-lima.ui.fiscalperiod.block.title=Cloture de l'excercice
+lima.ui.fiscalperiod.block.title=Cloture de l'exercice
lima.ui.fiscalperiod.closed=Cloturé
lima.ui.fiscalperiod.closure=Cloture
lima.ui.fiscalperiod.fiscalperiod=Exercice
1
0
April 13, 2012
Author: echatellier
Date: 2012-04-13 15:46:24 +0200 (Fri, 13 Apr 2012)
New Revision: 3366
Url: http://chorem.org/repositories/revision/lima/3366
Log:
Refatoring de la saisie des ?\195?\169critures
Added:
trunk/lima-callao/src/main/java/org/chorem/lima/entity/EntryImpl.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/common/
trunk/lima-swing/src/main/java/org/chorem/lima/ui/common/EntryBookComboBoxModel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/common/EntryBookListRenderer.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/common/FinancialPeriodComboBoxModel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/common/FinancialPeriodListRenderer.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/common/FiscalPeriodComboBoxModel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/common/FiscalPeriodListRenderer.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/common/GenericComboBoxModel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/package-info.java
Removed:
trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/EntryBookListRenderer.java
Modified:
trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialTransactionService.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ServiceMonitorable.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/utils/EntryComparator.java
trunk/lima-business/src/main/java/org/chorem/lima/service/LimaServiceFactory.java
trunk/lima-callao/src/main/java/org/chorem/lima/entity/FinancialTransactionImpl.java
trunk/lima-callao/src/main/xmi/accounting.zargo
trunk/lima-swing/pom.xml
trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountViewHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/AccountComboBoxModel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/EntryBookComboBoxModel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/FinancialPeriodComboBoxModel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/SubAccountComboBoxModel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookTable.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookViewHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsView.jaxx
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/FinancialTransactionUnbalancedView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/FiscalPeriodTable.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/FiscalPeriodViewHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/RetainedEarningsEntryBookForm.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringTableModel.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/lima-swing/src/main/resources/log4j.properties
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 2012-04-12 16:37:45 UTC (rev 3365)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ServiceMonitorable.java 2012-04-13 13:46:24 UTC (rev 3366)
@@ -26,6 +26,7 @@
package org.chorem.lima.business;
+
public interface ServiceMonitorable {
void addServiceListener(ServiceListener l);
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 2012-04-12 16:37:45 UTC (rev 3365)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java 2012-04-13 13:46:24 UTC (rev 3366)
@@ -136,14 +136,14 @@
/** Return the list of all financial transaction of a financial period */
@Override
- public List<FinancialTransaction> getAllFinancialTransactionsForFinancialPeriod(
+ public List<FinancialTransaction> getAllFinancialTransactions(
FinancialPeriod period) throws LimaException {
- return getAllFinancialTransactionsForEntryBookAndFinancialPeriod(null, period);
+ return getAllFinancialTransactions(period, null);
}
/** Return the list of all financial transaction from two dates */
@Override
- public List<FinancialTransaction> getAllFinancialTransactionsFromDateToDate(
+ public List<FinancialTransaction> getAllFinancialTransactions(
Date beginDate, Date endDate) throws LimaException {
List<FinancialTransaction> financialTransactions = null;
TopiaContext topiaTransaction = beginTransaction(rootContext);
@@ -178,7 +178,7 @@
/** Return the list of all financial transaction of a financial period and an entrybook */
@Override
- public List<FinancialTransaction> getAllFinancialTransactionsForEntryBookAndFinancialPeriod(EntryBook entryBook, FinancialPeriod financialPeriod) throws LimaException {
+ public List<FinancialTransaction> getAllFinancialTransactions(FinancialPeriod financialPeriod, EntryBook entryBook) throws LimaException {
List<FinancialTransaction> financialTransactions = null;
TopiaContext topiaTransaction = beginTransaction(rootContext);
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 2012-04-12 16:37:45 UTC (rev 3365)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/utils/EntryComparator.java 2012-04-13 13:46:24 UTC (rev 3366)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2008 - 2010 CodeLutin
+ * Copyright (C) 2008 - 2012 CodeLutin, Chatellier Eric
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
Modified: trunk/lima-business/src/main/java/org/chorem/lima/service/LimaServiceFactory.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/service/LimaServiceFactory.java 2012-04-12 16:37:45 UTC (rev 3365)
+++ trunk/lima-business/src/main/java/org/chorem/lima/service/LimaServiceFactory.java 2012-04-13 13:46:24 UTC (rev 3366)
@@ -148,9 +148,12 @@
}
protected <M> M newService(Class<M> serviceMonitorableClass) {
- M result;
Object ejbHome;
String serviceName = serviceMonitorableClass.getSimpleName().replace("Monitorable", "Impl");
+ // only usefull during non monitorable transition
+ if (!serviceName.endsWith("Impl")) {
+ serviceName += "Impl";
+ }
try {
ejbHome = container.getContext().lookup(NAMESPACE + serviceName);
} catch (NamingException eee) {
@@ -160,7 +163,7 @@
}
InvocationHandler handler = new ServiceMonitorableHandler(ejbHome);
ClassLoader classLoader = serviceMonitorableClass.getClassLoader();
- result = (M) Proxy.newProxyInstance(
+ M result = (M) Proxy.newProxyInstance(
classLoader,
new Class[]{ServiceMonitorable.class, serviceMonitorableClass},
handler
Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialTransactionService.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialTransactionService.java 2012-04-12 16:37:45 UTC (rev 3365)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialTransactionService.java 2012-04-13 13:46:24 UTC (rev 3366)
@@ -55,13 +55,11 @@
void removeFinancialTransaction(FinancialTransaction financialtransaction) throws LimaException;
- List<FinancialTransaction> getAllFinancialTransactionsForFinancialPeriod(FinancialPeriod period) throws LimaException;
+ List<FinancialTransaction> getAllFinancialTransactions(FinancialPeriod period) throws LimaException;
- List<FinancialTransaction> getAllFinancialTransactionsFromDateToDate(Date beginDate,
- Date endDate) throws LimaException;
+ List<FinancialTransaction> getAllFinancialTransactions(Date beginDate, Date endDate) throws LimaException;
- List<FinancialTransaction> getAllFinancialTransactionsForEntryBookAndFinancialPeriod(EntryBook entryBook,
- FinancialPeriod period) throws LimaException;
+ List<FinancialTransaction> getAllFinancialTransactions(FinancialPeriod period, EntryBook entryBook) throws LimaException;
List<FinancialTransaction> getAllInexactFinancialTransactions(FiscalPeriod fiscalPeriod) throws LimaException;
Added: trunk/lima-callao/src/main/java/org/chorem/lima/entity/EntryImpl.java
===================================================================
--- trunk/lima-callao/src/main/java/org/chorem/lima/entity/EntryImpl.java (rev 0)
+++ trunk/lima-callao/src/main/java/org/chorem/lima/entity/EntryImpl.java 2012-04-13 13:46:24 UTC (rev 3366)
@@ -0,0 +1,47 @@
+/*
+ * #%L
+ * Lima callao
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2008 - 2010 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+package org.chorem.lima.entity;
+
+import java.math.BigDecimal;
+
+/**
+ * Define default value for entry entity.
+ *
+ * @author chatellier
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author$
+ */
+public class EntryImpl extends EntryAbstract {
+
+ private static final long serialVersionUID = 7016948394597245796L;
+
+ public EntryImpl() {
+ setAmount(BigDecimal.ZERO);
+ }
+
+} //EntryImpl
Property changes on: trunk/lima-callao/src/main/java/org/chorem/lima/entity/EntryImpl.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Modified: trunk/lima-callao/src/main/java/org/chorem/lima/entity/FinancialTransactionImpl.java
===================================================================
--- trunk/lima-callao/src/main/java/org/chorem/lima/entity/FinancialTransactionImpl.java 2012-04-12 16:37:45 UTC (rev 3365)
+++ trunk/lima-callao/src/main/java/org/chorem/lima/entity/FinancialTransactionImpl.java 2012-04-13 13:46:24 UTC (rev 3366)
@@ -46,11 +46,11 @@
@Override
public BigDecimal getAmountDebit() {
BigDecimal result = new BigDecimal(0);
- for (Entry entryFT : getEntry()) {
+ /*for (Entry entryFT : getEntry()) {
if (entryFT.isDebit()) {
result.add(entryFT.getAmount());
}
- }
+ }*/
return result;
}
@@ -60,11 +60,11 @@
@Override
public BigDecimal getAmountCredit() {
BigDecimal result = new BigDecimal(0);
- for (Entry entryFT : getEntry()) {
+ /*for (Entry entryFT : getEntry()) {
if (!entryFT.isDebit()) {
result.add(entryFT.getAmount());
}
- }
+ }*/
return result;
}
}
Modified: trunk/lima-callao/src/main/xmi/accounting.zargo
===================================================================
(Binary files differ)
Modified: trunk/lima-swing/pom.xml
===================================================================
--- trunk/lima-swing/pom.xml 2012-04-12 16:37:45 UTC (rev 3365)
+++ trunk/lima-swing/pom.xml 2012-04-13 13:46:24 UTC (rev 3366)
@@ -18,6 +18,12 @@
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
+ <artifactId>lima-business-api</artifactId>
+ <version>${project.version}</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
<artifactId>lima-business</artifactId>
<version>${project.version}</version>
<scope>compile</scope>
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountViewHandler.java 2012-04-12 16:37:45 UTC (rev 3365)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountViewHandler.java 2012-04-13 13:46:24 UTC (rev 3366)
@@ -50,8 +50,7 @@
import org.chorem.lima.business.LimaRuntimeException;
import org.chorem.lima.business.ServiceListener;
import org.chorem.lima.business.api.AccountService;
-import org.chorem.lima.business.monitorable.AccountServiceMonitorable;
-import org.chorem.lima.business.monitorable.ImportServiceMonitorable;
+import org.chorem.lima.business.api.ImportService;
import org.chorem.lima.entity.Account;
import org.chorem.lima.enums.AccountsChartEnum;
import org.chorem.lima.enums.ImportExportEnum;
@@ -111,8 +110,8 @@
public AccountViewHandler(AccountView view) {
this.view = view;
// Gets factory service
- LimaServiceFactory.addServiceListener(ImportServiceMonitorable.class, this);
- accountService = LimaServiceFactory.getService(AccountServiceMonitorable.class);
+ LimaServiceFactory.addServiceListener(ImportService.class, this);
+ accountService = LimaServiceFactory.getService(AccountService.class);
}
/**
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/AccountComboBoxModel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/AccountComboBoxModel.java 2012-04-12 16:37:45 UTC (rev 3365)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/AccountComboBoxModel.java 2012-04-13 13:46:24 UTC (rev 3366)
@@ -34,7 +34,6 @@
import org.chorem.lima.business.monitorable.ImportServiceMonitorable;
import org.chorem.lima.entity.Account;
import org.chorem.lima.service.LimaServiceFactory;
-import org.chorem.lima.ui.financialperiod.FinancialPeriodTableModel;
import javax.swing.AbstractListModel;
import javax.swing.ComboBoxModel;
@@ -47,7 +46,7 @@
private static final long serialVersionUID = 1L;
private static final Log log =
- LogFactory.getLog(FinancialPeriodTableModel.class);
+ LogFactory.getLog(AccountComboBoxModel.class);
protected Object selectedAccount;
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 2012-04-12 16:37:45 UTC (rev 3365)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/EntryBookComboBoxModel.java 2012-04-13 13:46:24 UTC (rev 3366)
@@ -34,7 +34,6 @@
import org.chorem.lima.business.monitorable.ImportServiceMonitorable;
import org.chorem.lima.entity.EntryBook;
import org.chorem.lima.service.LimaServiceFactory;
-import org.chorem.lima.ui.financialperiod.FinancialPeriodTableModel;
import javax.swing.AbstractListModel;
import javax.swing.ComboBoxModel;
@@ -54,7 +53,7 @@
private static final long serialVersionUID = 1L;
private static final Log log =
- LogFactory.getLog(FinancialPeriodTableModel.class);
+ LogFactory.getLog(EntryBookComboBoxModel.class);
protected Object selectedEntryBook;
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/FinancialPeriodComboBoxModel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/FinancialPeriodComboBoxModel.java 2012-04-12 16:37:45 UTC (rev 3365)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/FinancialPeriodComboBoxModel.java 2012-04-13 13:46:24 UTC (rev 3366)
@@ -36,7 +36,6 @@
import org.chorem.lima.entity.FinancialPeriod;
import org.chorem.lima.entity.FiscalPeriod;
import org.chorem.lima.service.LimaServiceFactory;
-import org.chorem.lima.ui.financialperiod.FinancialPeriodTableModel;
import javax.swing.AbstractListModel;
import javax.swing.ComboBoxModel;
@@ -56,7 +55,7 @@
private static final long serialVersionUID = 1L;
private static final Log log =
- LogFactory.getLog(FinancialPeriodTableModel.class);
+ LogFactory.getLog(FinancialPeriodComboBoxModel.class);
protected Object selectedFinancialPeriod;
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/SubAccountComboBoxModel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/SubAccountComboBoxModel.java 2012-04-12 16:37:45 UTC (rev 3365)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/SubAccountComboBoxModel.java 2012-04-13 13:46:24 UTC (rev 3366)
@@ -40,8 +40,9 @@
import java.util.ArrayList;
import java.util.List;
-/** Account combo box model. */
-
+/**
+ * Account combo box model.
+ */
public class SubAccountComboBoxModel extends AbstractListModel implements ComboBoxModel, ServiceListener {
private static final long serialVersionUID = 1L;
Added: trunk/lima-swing/src/main/java/org/chorem/lima/ui/common/EntryBookComboBoxModel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/common/EntryBookComboBoxModel.java (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/common/EntryBookComboBoxModel.java 2012-04-13 13:46:24 UTC (rev 3366)
@@ -0,0 +1,40 @@
+/*
+ * #%L
+ * Lima Swing
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2012 CodeLutin, Chatellier Eric
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+package org.chorem.lima.ui.common;
+
+import org.chorem.lima.entity.EntryBook;
+
+/**
+ * Entry book combo model.
+ *
+ * @author chatellier
+ * @version $Revision$
+ */
+public class EntryBookComboBoxModel extends GenericComboBoxModel<EntryBook> {
+
+ /** serialVersionUID. */
+ private static final long serialVersionUID = 6991293987668268456L;
+}
Property changes on: trunk/lima-swing/src/main/java/org/chorem/lima/ui/common/EntryBookComboBoxModel.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Copied: trunk/lima-swing/src/main/java/org/chorem/lima/ui/common/EntryBookListRenderer.java (from rev 3360, trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/EntryBookListRenderer.java)
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/common/EntryBookListRenderer.java (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/common/EntryBookListRenderer.java 2012-04-13 13:46:24 UTC (rev 3366)
@@ -0,0 +1,61 @@
+/*
+ * #%L
+ *
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2012 Codelutin, Chatellier Eric
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
+package org.chorem.lima.ui.common;
+
+import java.awt.Component;
+
+import javax.swing.DefaultListCellRenderer;
+import javax.swing.JList;
+
+import org.chorem.lima.entity.EntryBook;
+
+/**
+ * EntryBook renderer for fiscal period retaining earning list.
+ *
+ * @author chatellier
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author$
+ */
+public class EntryBookListRenderer extends DefaultListCellRenderer {
+
+ /** serialVersionUID. */
+ private static final long serialVersionUID = -9089182547408397051L;
+
+ @Override
+ public Component getListCellRendererComponent(JList list, Object value,
+ int index, boolean isSelected, boolean cellHasFocus) {
+
+ EntryBook entryBook = (EntryBook)value;
+ Object newValue = entryBook;
+ if (entryBook != null) {
+ newValue = entryBook.getCode() + " - " + entryBook.getLabel();
+ }
+ return super.getListCellRendererComponent(list, newValue, index, isSelected,
+ cellHasFocus);
+ }
+}
Added: trunk/lima-swing/src/main/java/org/chorem/lima/ui/common/FinancialPeriodComboBoxModel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/common/FinancialPeriodComboBoxModel.java (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/common/FinancialPeriodComboBoxModel.java 2012-04-13 13:46:24 UTC (rev 3366)
@@ -0,0 +1,40 @@
+/*
+ * #%L
+ * Lima Swing
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2012 CodeLutin, Chatellier Eric
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+package org.chorem.lima.ui.common;
+
+import org.chorem.lima.entity.FinancialPeriod;
+
+/**
+ * Financial period combo model.
+ *
+ * @author chatellier
+ * @version $Revision$
+ */
+public class FinancialPeriodComboBoxModel extends GenericComboBoxModel<FinancialPeriod> {
+
+ /** serialVersionUID. */
+ private static final long serialVersionUID = 6991293987668268456L;
+}
Property changes on: trunk/lima-swing/src/main/java/org/chorem/lima/ui/common/FinancialPeriodComboBoxModel.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: trunk/lima-swing/src/main/java/org/chorem/lima/ui/common/FinancialPeriodListRenderer.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/common/FinancialPeriodListRenderer.java (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/common/FinancialPeriodListRenderer.java 2012-04-13 13:46:24 UTC (rev 3366)
@@ -0,0 +1,64 @@
+/*
+ * #%L
+ *
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2012 Codelutin, Chatellier Eric
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
+package org.chorem.lima.ui.common;
+
+import java.awt.Component;
+import java.text.DateFormat;
+
+import javax.swing.DefaultListCellRenderer;
+import javax.swing.JList;
+
+import org.chorem.lima.entity.FinancialPeriod;
+
+/**
+ * Financial period list renderer.
+ *
+ * @author chatellier
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author$
+ */
+public class FinancialPeriodListRenderer extends DefaultListCellRenderer {
+
+ /** serialVersionUID. */
+ private static final long serialVersionUID = -9089182547408397051L;
+
+ @Override
+ public Component getListCellRendererComponent(JList list, Object value,
+ int index, boolean isSelected, boolean cellHasFocus) {
+
+ FinancialPeriod financialPeriod = (FinancialPeriod)value;
+ Object newValue = financialPeriod;
+ if (financialPeriod != null) {
+ DateFormat df = DateFormat.getDateInstance();
+ newValue = df.format(financialPeriod.getBeginDate()) + " - " + df.format(financialPeriod.getEndDate());
+ }
+ return super.getListCellRendererComponent(list, newValue, index, isSelected,
+ cellHasFocus);
+ }
+
+}
Property changes on: trunk/lima-swing/src/main/java/org/chorem/lima/ui/common/FinancialPeriodListRenderer.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: trunk/lima-swing/src/main/java/org/chorem/lima/ui/common/FiscalPeriodComboBoxModel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/common/FiscalPeriodComboBoxModel.java (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/common/FiscalPeriodComboBoxModel.java 2012-04-13 13:46:24 UTC (rev 3366)
@@ -0,0 +1,44 @@
+/*
+ * #%L
+ * Lima Swing
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2008 - 2012 CodeLutin, Chatellier Eric
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+package org.chorem.lima.ui.common;
+
+import org.chorem.lima.entity.FiscalPeriod;
+
+/**
+ * Model des exercices comptable.
+ *
+ * @author chatellier
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author$
+ */
+public class FiscalPeriodComboBoxModel extends GenericComboBoxModel<FiscalPeriod> {
+
+ /** serialVersionUID. */
+ private static final long serialVersionUID = 3017195549616278980L;
+
+}
Property changes on: trunk/lima-swing/src/main/java/org/chorem/lima/ui/common/FiscalPeriodComboBoxModel.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: trunk/lima-swing/src/main/java/org/chorem/lima/ui/common/FiscalPeriodListRenderer.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/common/FiscalPeriodListRenderer.java (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/common/FiscalPeriodListRenderer.java 2012-04-13 13:46:24 UTC (rev 3366)
@@ -0,0 +1,64 @@
+/*
+ * #%L
+ *
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2012 Codelutin, Chatellier Eric
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
+package org.chorem.lima.ui.common;
+
+import java.awt.Component;
+import java.text.DateFormat;
+
+import javax.swing.DefaultListCellRenderer;
+import javax.swing.JList;
+
+import org.chorem.lima.entity.FiscalPeriod;
+
+/**
+ * Fiscal period list renderer.
+ *
+ * @author chatellier
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author$
+ */
+public class FiscalPeriodListRenderer extends DefaultListCellRenderer {
+
+ /** serialVersionUID. */
+ private static final long serialVersionUID = -9089182547408397051L;
+
+ @Override
+ public Component getListCellRendererComponent(JList list, Object value,
+ int index, boolean isSelected, boolean cellHasFocus) {
+
+ FiscalPeriod fiscalPeriod = (FiscalPeriod)value;
+ Object newValue = fiscalPeriod;
+ if (fiscalPeriod != null) {
+ DateFormat df = DateFormat.getDateInstance();
+ newValue = df.format(fiscalPeriod.getBeginDate()) + " - " + df.format(fiscalPeriod.getEndDate());
+ }
+ return super.getListCellRendererComponent(list, newValue, index, isSelected,
+ cellHasFocus);
+ }
+
+}
Property changes on: trunk/lima-swing/src/main/java/org/chorem/lima/ui/common/FiscalPeriodListRenderer.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: trunk/lima-swing/src/main/java/org/chorem/lima/ui/common/GenericComboBoxModel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/common/GenericComboBoxModel.java (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/common/GenericComboBoxModel.java 2012-04-13 13:46:24 UTC (rev 3366)
@@ -0,0 +1,67 @@
+/*
+ * #%L
+ * Lima Swing
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2008 - 2012 CodeLutin, Chatellier Eric
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+package org.chorem.lima.ui.common;
+
+import java.util.List;
+
+import javax.swing.DefaultComboBoxModel;
+
+/**
+ * Model generique pour les objects lima.
+ *
+ * @param <E> type d'object géré
+ * @author chatellier
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author$
+ */
+public class GenericComboBoxModel<E> extends DefaultComboBoxModel {
+
+ /** serialVersionUID. */
+ private static final long serialVersionUID = 4778917695588663498L;
+
+ protected List<E> objects;
+
+ @Override
+ public int getSize() {
+ int result = 0;
+ if (objects != null) {
+ result = objects.size();
+ }
+ return result;
+ }
+
+ @Override
+ public Object getElementAt(int index) {
+ return objects.get(index);
+ }
+
+ public void setObjects(List<E> objects) {
+ this.objects = objects;
+ fireContentsChanged(this, 0, objects.size());
+ }
+}
Property changes on: trunk/lima-swing/src/main/java/org/chorem/lima/ui/common/GenericComboBoxModel.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookTable.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookTable.java 2012-04-12 16:37:45 UTC (rev 3365)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookTable.java 2012-04-13 13:46:24 UTC (rev 3366)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2008 - 2011 CodeLutin
+ * Copyright (C) 2008 - 2012 CodeLutin, Chatellier Eric
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
@@ -24,8 +24,6 @@
*/
package org.chorem.lima.ui.entrybook;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.jdesktop.swingx.JXTable;
import java.awt.event.KeyEvent;
@@ -39,10 +37,6 @@
/** serialVersionUID. */
private static final long serialVersionUID = 6228396251512013262L;
- /** log. */
- private static final Log log = LogFactory
- .getLog(EntryBookTable.class);
-
protected EntryBookViewHandler handler;
public EntryBookTable(EntryBookViewHandler handler) {
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookViewHandler.java 2012-04-12 16:37:45 UTC (rev 3365)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookViewHandler.java 2012-04-13 13:46:24 UTC (rev 3366)
@@ -37,8 +37,7 @@
import org.chorem.lima.business.LimaRuntimeException;
import org.chorem.lima.business.ServiceListener;
import org.chorem.lima.business.api.EntryBookService;
-import org.chorem.lima.business.monitorable.EntryBookServiceMonitorable;
-import org.chorem.lima.business.monitorable.ImportServiceMonitorable;
+import org.chorem.lima.business.api.ImportService;
import org.chorem.lima.entity.EntryBook;
import org.chorem.lima.entity.EntryBookImpl;
import org.chorem.lima.enums.EntryBooksChartEnum;
@@ -66,10 +65,8 @@
public EntryBookViewHandler(EntryBookView view) {
this.view = view;
- entryBookService =
- LimaServiceFactory.getService(
- EntryBookServiceMonitorable.class);
- LimaServiceFactory.addServiceListener(ImportServiceMonitorable.class, this);
+ entryBookService = LimaServiceFactory.getService(EntryBookService.class);
+ LimaServiceFactory.addServiceListener(ImportService.class, this);
}
public void init() {
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsView.jaxx 2012-04-12 16:37:45 UTC (rev 3365)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsView.jaxx 2012-04-13 13:46:24 UTC (rev 3366)
@@ -35,7 +35,7 @@
<EntryBooksReportsViewHandler id="handler"
javaBean="new EntryBooksReportsViewHandler(this)"/>
<Boolean id="selectedRow" javaBean="false"/>
- <EntryBookComboBoxModel id="modelEntryBook"/>
+ <org.chorem.lima.ui.combobox.EntryBookComboBoxModel id="modelEntryBook"/>
<EntryBooksReportsTableModel id="modelTable"/>
<script>
<![CDATA[
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 2012-04-12 16:37:45 UTC (rev 3365)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTable.java 2012-04-13 13:46:24 UTC (rev 3366)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2008 - 2010 CodeLutin
+ * Copyright (C) 2008 - 2012 CodeLutin,Chatellier Eric
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
@@ -62,14 +62,8 @@
/** serialVersionUID. */
private static final long serialVersionUID = 3133690382049594727L;
-// /** log. */
-// private static final Log log = LogFactory
-// .getLog(FinancialTransactionTable.class);
-
protected FinancialTransactionViewHandler handler;
-// private ColorHighlighter colorBalance;
-
private int x_tab;
private int y_tab;
@@ -148,238 +142,6 @@
return handler;
}
-// /**
-// * 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;
-// // can compare two BigDecimals with different scales
-// // e.g: 3.1 == 3.10
-// if (currentBalance.compareTo(BigDecimal.ZERO) != 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) {
-//
-// //TODO combinaison de touches dans la config
-//
-// // 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
-// && e.getModifiers() == KeyEvent.CTRL_MASK) {
-// handler.deleteSelectedRow();
-// }
-//
-// // add entry with the key combination : insert or ctrl + enter
-// if (e.getKeyCode() == KeyEvent.VK_INSERT
-// || e.getKeyCode() == KeyEvent.VK_ENTER
-// && e.getModifiers() == KeyEvent.CTRL_MASK) {
-// handler.addEntry();
-// }
-//
-// // copy : ctrl + c
-//
-// // add financial transaction with the key combination : ctrl + c
-// if (e.getKeyCode() == KeyEvent.VK_C
-// && e.getModifiers() == KeyEvent.CTRL_MASK) {
-// handler.copyRow();
-// }
-//
-// // paste : ctrl + v
-//
-// // add financial transaction with the key combination : ctrl + v
-// if (e.getKeyCode() == KeyEvent.VK_V
-// && e.getModifiers() == KeyEvent.CTRL_MASK) {
-// handler.pasteRow();
-// }
-//
-// // add financial transaction with the key combination : ctrl + tab
-// if (e.getKeyCode() == KeyEvent.VK_TAB
-// && e.getModifiers() == KeyEvent.CTRL_MASK) {
-// handler.addFinancialTransaction();
-// }
-//
-// // clear row selection with the key: escape
-// if (e.getKeyCode() == KeyEvent.VK_ESCAPE) {
-// if (!isEditing()) {
-// clearSelection();
-// }
-// }
-//
-// /**
-// * 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 et si la transaction est non équilibré
-// * sinon rajoute une transaction
-// */
-//
-// if (e.getKeyChar() == KeyEvent.VK_TAB) {
-// int max_x = getColumnCount();
-// int max_y = getRowCount();
-// x_tab = getSelectedColumn();
-// y_tab = getSelectedRow();
-// Boolean end = true;
-//
-// if (x_tab < max_x - 1) {
-// x_tab++;
-// }
-// //end of row
-// else {
-// x_tab = 0;
-// y_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 = handler.tableModel.getElementAt(y_tab);
-//
-// //if transaction, add entry
-// if (object instanceof FinancialTransaction) {
-// FinancialTransaction financialTransaction = (FinancialTransaction) object;
-// if (financialTransaction.getEntry().size() == 0) {
-// handler.addEntry();
-// setColumnSelectionInterval(1, 1);
-// }
-// }
-// //if entry
-// else {
-// //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.addEntry();
-// 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();
-// }
-// end = false;
-// } else {
-// if (x_tab < max_x) {
-// setRowSelectionInterval(y_tab, y_tab);
-// setColumnSelectionInterval(x_tab, x_tab);
-// x_tab++;
-// }
-// }
-// }
-// }
-// }
-//
-//
-// @Override
-// public void keyTyped(KeyEvent e) {
-// }
-//
-//
-// @Override
-// public void keyReleased(KeyEvent e) {
-// }
-//
-// @Override
-// public void mouseClicked(MouseEvent e) {
-// }
-//
-// @Override
-// public void mousePressed(MouseEvent e) {
-// if (rowAtPoint(e.getPoint()) == -1) {
-// clearSelection();
-// }
-// }
-//
-// @Override
-// public void mouseReleased(MouseEvent e) {
-// }
-//
-// @Override
-// public void mouseEntered(MouseEvent e) {
-// }
-//
-// @Override
-// public void mouseExited(MouseEvent e) {
-// }
-
private class MyKeyAdapter extends KeyAdapter {
@Override
@@ -459,7 +221,7 @@
while (!isCellEditable(y_tab, x_tab) && end) {
//if end of row
if (x_tab == max_x - 1) {
- Object object = handler.getTableModel().getElementAt(y_tab);
+ Object object = handler.view.getFinancialTransactionTableModel().getElementAt(y_tab);
//if transaction, add entry
if (object instanceof FinancialTransaction) {
@@ -486,7 +248,7 @@
@Override
protected void done() {
- Object object = handler.getTableModel().getElementAt(y_tab - 1);
+ Object object = handler.view.getFinancialTransactionTableModel().getElementAt(y_tab - 1);
FinancialTransaction financialTransaction = null;
if (object instanceof Entry) {
financialTransaction = ((Entry) object).getFinancialTransaction();
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 2012-04-12 16:37:45 UTC (rev 3365)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTableModel.java 2012-04-13 13:46:24 UTC (rev 3366)
@@ -25,116 +25,46 @@
package org.chorem.lima.ui.financialtransaction;
-import org.apache.commons.lang3.time.DateUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.chorem.lima.business.LimaBusinessException;
+import static org.nuiton.i18n.I18n._;
+
+import java.math.BigDecimal;
+import java.util.Date;
+import java.util.List;
+
+import javax.swing.table.AbstractTableModel;
+
import org.chorem.lima.business.LimaException;
-import org.chorem.lima.business.ServiceListener;
+import org.chorem.lima.business.LimaRuntimeException;
import org.chorem.lima.business.api.FinancialTransactionService;
-import org.chorem.lima.business.monitorable.FinancialTransactionServiceMonitorable;
-import org.chorem.lima.business.monitorable.ImportServiceMonitorable;
-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.FinancialPeriod;
import org.chorem.lima.entity.FinancialTransaction;
-import org.chorem.lima.entity.FinancialTransactionImpl;
import org.chorem.lima.service.LimaServiceFactory;
-import org.chorem.lima.util.ErrorHelper;
-import javax.swing.table.AbstractTableModel;
-import java.math.BigDecimal;
-import java.util.ArrayList;
-import java.util.Calendar;
-import java.util.Collections;
-import java.util.Date;
-import java.util.List;
-
-import static org.nuiton.i18n.I18n._;
-
/**
* Basic transaction table model.
- * <p/>
- * Le modele est filtré sur {@link #selectedFinancialPeriod} et
- * {@link #selectedFinancialPeriod} (montée en charge !).
*
* @author ore
* @author chatellier
* @version $Revision$
*/
-public class FinancialTransactionTableModel extends AbstractTableModel implements ServiceListener {
+public class FinancialTransactionTableModel extends AbstractTableModel {
- private static final long serialVersionUID = 1L;
+ /** serialVersionUID. */
+ private static final long serialVersionUID = -7495388454688562991L;
- /** log. */
- private static final Log log = LogFactory
- .getLog(FinancialTransactionTableModel.class);
+ /** Service (just to update setValueAt(). */
+ protected FinancialTransactionService financialTransactionService;
- /** Transaction service. */
- protected final FinancialTransactionService financialTransactionService;
+ protected List<Object> transactionAndEntries;
- /** selected financial period */
- protected FinancialPeriod selectedFinancialPeriod;
-
- /** data cache */
- protected List<?> cacheDataList;
-
- protected EntryBook selectedEntryBook;
-
public FinancialTransactionTableModel() {
- /* Services */
- financialTransactionService = LimaServiceFactory.getService(
- FinancialTransactionServiceMonitorable.class);
- LimaServiceFactory.addServiceListener(financialTransactionService, this);
- LimaServiceFactory.addServiceListener(ImportServiceMonitorable.class, this);
+ financialTransactionService = LimaServiceFactory.getService(FinancialTransactionService.class);
}
- /**
- * Le model est une combinaison de Transaction/Entries.
- *
- * @return
- */
- protected List<?> getDataList() {
- List<Object> results = new ArrayList<Object>();
- if (selectedFinancialPeriod != null) {
- try {
- List<FinancialTransaction> transactions;
-
- if (selectedEntryBook == null) {
-
- // get all transactions for all entry books
- transactions = financialTransactionService.getAllFinancialTransactionsForFinancialPeriod(
- selectedFinancialPeriod);
- } else {
-
- // get all transactions for selected entry book
- transactions = financialTransactionService.getAllFinancialTransactionsForEntryBookAndFinancialPeriod(
- selectedEntryBook,
- selectedFinancialPeriod
- );
- }
-
- for (FinancialTransaction transaction : transactions) {
- results.add(transaction);
- List<Entry> entries = (List<Entry>) transaction.getEntry();
- Collections.sort(entries, new EntryComparator());
- results.addAll(entries);
- }
- } catch (LimaException eee) {
- if (log.isErrorEnabled()) {
- log.error("Can't update model", eee);
- }
- ErrorHelper.showErrorDialog("Can't get transaction list", eee);
- }
- }
- return results;
- }
-
- public void refresh() {
- cacheDataList = getDataList();
+ public void setTransactionAndEntries(List<Object> transactionAndEntries) {
+ this.transactionAndEntries = transactionAndEntries;
fireTableDataChanged();
}
@@ -186,31 +116,31 @@
switch (column) {
case 0:
- result = _("lima.table.date");
+ result = _("lima.ui.financialtransaction.date");
break;
case 1:
- result = _("lima.table.entrybook");
+ result = _("lima.ui.financialtransaction.entrybook");
break;
case 2:
- result = _("lima.table.voucher");
+ result = _("lima.ui.financialtransaction.voucher");
break;
case 3:
- result = _("lima.table.account");
+ result = _("lima.ui.financialtransaction.account");
break;
case 4:
- result = _("lima.table.description");
+ result = _("lima.ui.financialtransaction.description");
break;
case 5:
- result = _("lima.table.letter");
+ result = _("lima.ui.financialtransaction.letter");
break;
case 6:
- result = _("lima.table.debit");
+ result = _("lima.ui.financialtransaction.debit");
break;
case 7:
- result = _("lima.table.credit");
+ result = _("lima.ui.financialtransaction.credit");
break;
case 8:
- result = _("lima.table.balance");
+ result = _("lima.ui.financialtransaction.balance");
break;
}
return result;
@@ -218,12 +148,10 @@
@Override
public int getRowCount() {
- int result;
+ int result = 0;
- if (cacheDataList == null) {
- result = 0;
- } else {
- result = cacheDataList.size();
+ if (transactionAndEntries != null) {
+ result = transactionAndEntries.size();
}
return result;
@@ -231,103 +159,85 @@
@Override
public Object getValueAt(int row, int column) {
- Object result = null;
+ Object result = transactionAndEntries.get(row);
- // 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();
- 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; //voucher
- break;
- case 3:
- result = null; // account
- break;
- case 4:
- result = null; // description
- break;
- case 5:
- result = null; // letter
- 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
+ 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 = 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.getLettering();
- break;
- case 6:
- result = currentEntry.getDebit() ? currentEntry.getAmount() : BigDecimal.ZERO;
- break;
- case 7:
- result = currentEntry.getDebit() ? BigDecimal.ZERO : currentEntry.getAmount();
- break;
- case 8:
+ }
+ break;
+ case 2:
+ result = null; //voucher
+ break;
+ case 3:
+ result = null; // account
+ break;
+ case 4:
+ result = null; // description
+ break;
+ case 5:
+ result = null; // letter
+ 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;
- }
+ }
+ break;
+ case 4:
+ result = currentEntry.getDescription();
+ break;
+ case 5:
+ result = currentEntry.getLettering();
+ break;
+ case 6:
+ result = currentEntry.getDebit() ? currentEntry.getAmount() : BigDecimal.ZERO;
+ break;
+ case 7:
+ result = currentEntry.getDebit() ? BigDecimal.ZERO : currentEntry.getAmount();
+ break;
+ case 8:
+ result = null;
+ break;
}
}
return result;
}
- public void setSelectedFinancialPeriod(FinancialPeriod financialPeriod) {
- if (log.isDebugEnabled()) {
- log.debug("New selected financial period " + financialPeriod);
- }
- selectedFinancialPeriod = financialPeriod;
- refresh();
- }
-
- public void setSelectedEntryBook(EntryBook selectedEntryBook) {
- this.selectedEntryBook = selectedEntryBook;
- refresh();
- }
-
/**
* To set cells editable or not
* different condition for entry or financial transaction
@@ -335,22 +245,15 @@
@Override
public boolean isCellEditable(int rowIndex, int columnIndex) {
boolean editableCell = false;
- Object currentRow = cacheDataList.get(rowIndex);
+ Object currentRow = transactionAndEntries.get(rowIndex);
+ // cells editable for the financialtransaction row, no cells exclude the date
+ if (currentRow instanceof FinancialTransaction && (columnIndex == 0 /*|| columnIndex == 1*/)) {
+ editableCell = true;
+ }
// cells editable for the entry row, all cells exclude the date
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)) {
-
-// if (selectedEntryBook == null || columnIndex == 0) {
-//
-// // can only edit the transaction entry book only if there is
-// // no entry book selected (otherwise we will loose the transaction
-// editableCell = true;
-// }
- editableCell = true;
- }
return editableCell;
}
@@ -358,13 +261,13 @@
* Obtain the first entry book of the current transaction.
*
* @param selectedRow
- * @return
+ * @return first entry index
*/
public int getFirstEntry(int selectedRow) {
int result = -1;
int currentRow = selectedRow;
while (currentRow > -1) {
- Object o = cacheDataList.get(currentRow);
+ Object o = transactionAndEntries.get(currentRow);
if (o instanceof Entry) {
// current row is still a entry book
@@ -391,166 +294,33 @@
return result;
}
- /**
- * @return int: indexOf new FianancialTransaction
- * @throws LimaException
- */
- public int addFinancialTransaction() throws LimaException {
- /* Calling transaction service */
- FinancialTransaction financialTransaction = new FinancialTransactionImpl();
-
- //if a period is selected
- if (selectedFinancialPeriod == null) {
- throw new LimaBusinessException("No financial period selected");
- }
-
- financialTransaction.setFinancialPeriod(selectedFinancialPeriod);
-
- if (selectedEntryBook != null) {
- financialTransaction.setEntryBook(selectedEntryBook);
- }
-
- // get today
- Calendar actualCalendar = Calendar.getInstance();
-
- // get the financial period date
- Date transactionDate = selectedFinancialPeriod.getBeginDate();
-
- Calendar calEnd = Calendar.getInstance();
- calEnd.setTime(selectedFinancialPeriod.getEndDate());
- int dayMax = calEnd.get(Calendar.DAY_OF_MONTH);
- Calendar calBegin = Calendar.getInstance();
- calBegin.setTime(selectedFinancialPeriod.getBeginDate());
- int dayMin = calBegin.get(Calendar.DAY_OF_MONTH);
- int toDay = actualCalendar.get(Calendar.DAY_OF_MONTH);
-
- if (toDay > dayMax || toDay < dayMin) {
- // change the day
- transactionDate = DateUtils.setDays(transactionDate, dayMax);
- } else {
- // change the day
- transactionDate = DateUtils.setDays(transactionDate, toDay);
- }
-
-
- // set date to the financial transaction
- financialTransaction.setTransactionDate(transactionDate);
- // create it
- FinancialTransaction fTransaction =
- financialTransactionService.createFinancialTransaction(financialTransaction);
-
- //on recharge la liste
- cacheDataList = getDataList();
- int row = cacheDataList.indexOf(fTransaction);
- fireTableRowsInserted(row, row);
- return row;
- }
-
- /**
- * @param voucher
- * @param description
- * @param row
- * @return int: indexOf new Entry
- * @throws LimaException
- */
- public int addEmptyEntry(String voucher,
- String description,
- int row) throws LimaException {
- FinancialTransaction currentTransaction = null;
- Object currentRow = cacheDataList.get(row);
- Entry entry = new EntryImpl();
- entry.setAmount(BigDecimal.ZERO);
- if (voucher != null) {
- entry.setVoucher(voucher);
- }
- if (description != null) {
- entry.setDescription(description);
- }
- //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);
- Entry newEntry = financialTransactionService.createEntry(entry);
-
- //on recharge la liste
- cacheDataList = getDataList();
- int newrow = cacheDataList.indexOf(newEntry);
- fireTableRowsInserted(newrow, newrow);
- return newrow;
- }
-
- /**
- * @param entry
- * @param row
- * @return int: indexOf new Entry
- * @throws LimaException
- */
- public int addEntry(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(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);
- Entry newEntry = financialTransactionService.createEntry(entry);
- fireTableRowsUpdated(financialTransactionRow, getRowCount() - 1);
-
- //on recharge la liste
- cacheDataList = getDataList();
- int newrow = cacheDataList.indexOf(newEntry);
- fireTableRowsInserted(newrow, newrow);
- return newrow;
- }
-
/** to modifiy financialtransaction or entry */
@Override
public void setValueAt(Object value, int row, int column) {
- int financialTransactionRow = 0;
- if (cacheDataList != null) {
- Object currentRow = cacheDataList.get(row);
+
+ try {
+ Object currentRow = transactionAndEntries.get(row);
+
if (currentRow instanceof FinancialTransaction) {
- FinancialTransaction currentFinancialTransaction =
- (FinancialTransaction) currentRow;
+ FinancialTransaction currentFinancialTransaction = (FinancialTransaction) currentRow;
switch (column) {
case 0:
//update
currentFinancialTransaction.setTransactionDate((Date) value);
break;
+ /* FIXME echatellier 20120413 : ca devrait carrement pas être editable
case 1:
if (selectedEntryBook != null) {
-
// not authorized to change the value
return;
}
currentFinancialTransaction.setEntryBook((EntryBook) value);
- break;
+ break;*/
}
+
// update transaction
- updateFinancialTransaction(currentFinancialTransaction);
-
- //update the financial transaction in entire
- financialTransactionRow =
- getDataList().indexOf(currentRow);
+ financialTransactionService.updateFinancialTransaction(currentFinancialTransaction);
+
} else if (currentRow instanceof Entry) {
Entry currentEntry = (Entry) currentRow;
FinancialTransaction financialTransaction =
@@ -559,19 +329,19 @@
switch (column) {
case 2:
String voucher = ((String) value).trim();
-
+
int firstEntryRow = getFirstEntry(row);
if (row == firstEntryRow) {
-
+
// let's update the voucher of all entries of
// the transaction
-
+
for (Entry entry : financialTransaction.getEntry()) {
entry.setVoucher(voucher);
}
updateTransaction = true;
} else {
-
+
// not on first row, just update this entry voucher
currentEntry.setVoucher(voucher);
}
@@ -585,7 +355,7 @@
if (row == firstEntryRow) {
// let's update the description of all entries of
// the transaction
-
+
for (Entry entry : financialTransaction.getEntry()) {
entry.setDescription(description1);
}
@@ -599,16 +369,16 @@
String description = ((String) value).trim();
firstEntryRow = getFirstEntry(row);
if (row == firstEntryRow) {
-
+
// let's update the description of all entries of
// the transaction
-
+
for (Entry entry : financialTransaction.getEntry()) {
entry.setDescription(description);
}
updateTransaction = true;
} else {
-
+
// not on first row, just update this entry description
currentEntry.setDescription(description);
}
@@ -625,86 +395,67 @@
currentEntry.setDebit(false);
break;
}
+
+ // some modification must update all other
+ // first row modification update following rows
if (updateTransaction) {
-
+ // FIXME echatellier 20120413 make a single service call
for (Entry entry : financialTransaction.getEntry()) {
- updateEntry(entry);
+ financialTransactionService.updateEntry(entry);
}
} else {
-
- updateEntry(currentEntry);
+ financialTransactionService.updateEntry(currentEntry);
}
-
- //update the financial transaction in entire
- financialTransactionRow =
- getDataList().indexOf(financialTransaction);
}
- //on recharge la liste
- cacheDataList = getDataList();
- fireTableRowsUpdated(financialTransactionRow, getRowCount() - 1);
- }
- }
+
+ // FIXME echatellier 20120413 une modification des dates fait que l'ordre
+ // devient faux
+ fireTableRowsUpdated(row, row);
- protected void updateFinancialTransaction(FinancialTransaction transaction) {
- try {
- financialTransactionService.updateFinancialTransaction(transaction);
- } catch (LimaException eee) {
- if (log.isDebugEnabled()) {
- log.debug("Can't update financial transaction", eee);
- }
- ErrorHelper.showErrorDialog("Can't update financial transaction", eee);
+ } catch (LimaException ex) {
+ throw new LimaRuntimeException("Can't propagate data modification to service", ex);
}
}
- protected void updateEntry(Entry entry) {
- try {
- financialTransactionService.updateEntry(entry);
- } catch (LimaException eee) {
- if (log.isDebugEnabled()) {
- log.debug("Can't update entry", eee);
- }
- ErrorHelper.showErrorDialog("Can't update entry", eee);
- }
- }
-
public Object getElementAt(int row) {
- Object result = null;
- if (cacheDataList != null) {
- result = cacheDataList.get(row);
- }
+ Object result = transactionAndEntries.get(row);
return result;
}
+
+ public int indexOf(Object o) {
+ return transactionAndEntries.indexOf(o);
+ }
/**
- * Delete selected row in table (could be transaction or entry).
- * <p/>
- * Called by model.
- *
- * @param row
- * @throws LimaException
+ * Delete row.
+ *
+ * @param row row to delete
*/
- public void removeObject(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
- cacheDataList = getDataList();
- fireTableDataChanged();
+ public void deleteRow(int row) {
+ transactionAndEntries.remove(row);
+ fireTableRowsDeleted(row, row);
}
- @Override
- public void notifyMethod(String serviceName, String methodeName) {
- if (serviceName.contains("FinancialTransaction") ||
- methodeName.contains("importEntries") ||
- methodeName.contains("importAll")) {
- refresh();
- }
+ /**
+ * Insert new row.
+ *
+ * @param object object to insert
+ * @param newRow position
+ */
+ public void addRow(Object object, int newRow) {
+ transactionAndEntries.add(newRow, object);
+ fireTableRowsInserted(newRow, newRow);
+
}
+ /**
+ * Insert new row.
+ *
+ * @param object
+ */
+ public void addRow(Object object) {
+ transactionAndEntries.add(object);
+ fireTableRowsInserted(transactionAndEntries.size() - 1, transactionAndEntries.size() - 1);
+
+ }
}
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 2012-04-12 16:37:45 UTC (rev 3365)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionView.jaxx 2012-04-13 13:46:24 UTC (rev 3366)
@@ -5,7 +5,7 @@
$Id$
$HeadURL$
%%
- Copyright (C) 2008 - 2010 CodeLutin
+ Copyright (C) 2008 - 2012 CodeLutin, Chatellier Eric
%%
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as
@@ -22,7 +22,6 @@
<http://www.gnu.org/licenses/gpl-3.0.html>.
#L%
-->
-
<Table>
<import>
@@ -30,62 +29,54 @@
org.chorem.lima.entity.FiscalPeriod
org.chorem.lima.entity.FinancialPeriod
org.chorem.lima.entity.EntryBook
- org.chorem.lima.ui.combobox.FinancialPeriodComboBoxModel
- org.chorem.lima.ui.combobox.FiscalPeriodComboBoxModel
- org.chorem.lima.ui.LimaRendererUtil
+ org.chorem.lima.ui.common.EntryBookListRenderer
</import>
<FinancialTransactionViewHandler id="handler" constructorParams="this"/>
<Boolean id="selectedRow" javaBean="false"/>
- <FinancialTransactionTableModel id="financialTransactionTableModel"/>
- <FiscalPeriodComboBoxModel id="fiscalPeriodComboBoxModel"/>
- <FinancialPeriodComboBoxModel id="financialPeriodComboBoxModel"/>
<script>
<![CDATA[
void $afterCompleteSetup() {
- handler.initEntryBookModel(entryBookComboBox);
- handler.refresh();
+ handler.init();
}
]]>
</script>
<row weightx="1" weighty="0" anchor="center">
<cell anchor="east">
- <JLabel id="fiscalPeriodLabel" text="lima.charts.fiscalyear"
- labelFor='{fiscalPeriodComboBox}'/>
+ <JLabel text="lima.ui.financialtransaction.fiscalyear" labelFor='{fiscalPeriodComboBox}'/>
</cell>
<cell anchor="west">
-
- <JComboBox id="fiscalPeriodComboBox"
- model="{fiscalPeriodComboBoxModel}"
- renderer="{LimaRendererUtil.newDecoratorListCellRenderer(FiscalPeriod.class)}"
- onItemStateChanged="if ( event.getStateChange() == 1 ) financialPeriodComboBoxModel.setSelectedFiscalPeriod( (FiscalPeriod) event.getItem() );"/>
+ <org.chorem.lima.ui.common.FiscalPeriodComboBoxModel id="fiscalPeriodComboBoxModel"/>
+ <JComboBox id="fiscalPeriodComboBox" model="{fiscalPeriodComboBoxModel}"
+ renderer="{new org.chorem.lima.ui.common.FiscalPeriodListRenderer()}"
+ onItemStateChanged="handler.fiscalPeriodSelected(event)"/>
</cell>
<cell anchor="east">
- <JLabel id="financialPeriodLabel" text="lima.common.period"
- labelFor='{financialPeriodComboBox}'/>
+ <JLabel text="lima.ui.financialtransaction.financialperiod" labelFor='{financialPeriodComboBox}'/>
</cell>
<cell anchor="west">
<JPanel>
+ <org.chorem.lima.ui.common.FinancialPeriodComboBoxModel id="financialPeriodComboBoxModel"/>
<JComboBox id="financialPeriodComboBox"
model="{financialPeriodComboBoxModel}"
- renderer="{LimaRendererUtil.newDecoratorListCellRenderer(FinancialPeriod.class)}"
- onItemStateChanged="if ( event.getStateChange() == 1 ) financialTransactionTableModel.setSelectedFinancialPeriod( (FinancialPeriod) event.getItem() );"/>
- <JButton id="back" text="lima.common.buttonback"
+ renderer="{new org.chorem.lima.ui.common.FinancialPeriodListRenderer()}"
+ onItemStateChanged="handler.financialPeriodSelected(event)"/>
+ <JButton id="back" text="lima.ui.financialtransaction.buttonback"
onActionPerformed="handler.back(financialPeriodComboBox)"/>
- <JButton id="next" text="lima.common.buttonnext"
+ <JButton id="next" text="lima.ui.financialtransaction.buttonnext"
onActionPerformed="handler.next(financialPeriodComboBox)"/>
</JPanel>
</cell>
<cell anchor="east">
- <JLabel id="entryBookComboBoxLabel" text="lima.common.entrybook"
- labelFor='{entryBookComboBox}'/>
+ <JLabel text="lima.ui.financialtransaction.entrybook" labelFor='{entryBookComboBox}'/>
</cell>
<cell anchor="west">
- <JComboBox id="entryBookComboBox"
- renderer="{LimaRendererUtil.newDecoratorListCellRenderer(EntryBook.class)}"
- onItemStateChanged="if ( event.getStateChange() == 1 ) financialTransactionTableModel.setSelectedEntryBook( (EntryBook) event.getItem() );"/>
+ <org.chorem.lima.ui.common.EntryBookComboBoxModel id="entryBookComboBoxModel"/>
+ <JComboBox id="entryBookComboBox" model="{entryBookComboBoxModel}"
+ renderer="{new org.chorem.lima.ui.common.EntryBookListRenderer()}"
+ onItemStateChanged="handler.entryBookSelected(event)"/>
</cell>
</row>
<row>
@@ -110,7 +101,7 @@
<row>
<cell fill="both" weightx="1" weighty="1" rows="3" columns="8">
<JScrollPane>
-
+ <FinancialTransactionTableModel id="financialTransactionTableModel"/>
<FinancialTransactionTable
id="financialTransactionTable" sortable="false" rowHeight="22"
constructorParams='handler'
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 2012-04-12 16:37:45 UTC (rev 3365)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionViewHandler.java 2012-04-13 13:46:24 UTC (rev 3366)
@@ -25,27 +25,40 @@
package org.chorem.lima.ui.financialtransaction;
-import jaxx.runtime.SwingUtil;
+import static org.nuiton.i18n.I18n._;
+
+import java.awt.event.ItemEvent;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Collections;
+import java.util.Date;
+import java.util.List;
+
+import javax.swing.JComboBox;
+import javax.swing.JOptionPane;
+import javax.swing.ListSelectionModel;
+
+import org.apache.commons.lang3.time.DateUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.business.LimaException;
-import org.chorem.lima.business.monitorable.EntryBookServiceMonitorable;
+import org.chorem.lima.business.LimaRuntimeException;
+import org.chorem.lima.business.ServiceListener;
+import org.chorem.lima.business.api.EntryBookService;
+import org.chorem.lima.business.api.FinancialPeriodService;
+import org.chorem.lima.business.api.FinancialTransactionService;
+import org.chorem.lima.business.api.FiscalPeriodService;
+import org.chorem.lima.business.api.ImportService;
+import org.chorem.lima.business.utils.EntryComparator;
import org.chorem.lima.entity.Entry;
import org.chorem.lima.entity.EntryBook;
+import org.chorem.lima.entity.EntryImpl;
+import org.chorem.lima.entity.FinancialPeriod;
import org.chorem.lima.entity.FinancialTransaction;
+import org.chorem.lima.entity.FinancialTransactionImpl;
+import org.chorem.lima.entity.FiscalPeriod;
import org.chorem.lima.service.LimaServiceFactory;
-import org.chorem.lima.ui.combobox.FinancialPeriodComboBoxModel;
-import org.chorem.lima.ui.combobox.FiscalPeriodComboBoxModel;
-import org.chorem.lima.util.DialogHelper;
-import org.chorem.lima.util.ErrorHelper;
-import javax.swing.JComboBox;
-import javax.swing.JOptionPane;
-import javax.swing.ListSelectionModel;
-import java.util.List;
-
-import static org.nuiton.i18n.I18n._;
-
/**
* Handler associated with financial transaction view.
*
@@ -55,158 +68,336 @@
* Last update : $Date$
* By : $Author$
*/
-public class FinancialTransactionViewHandler {
+public class FinancialTransactionViewHandler implements ServiceListener {
/** log. */
- private static final Log log =
- LogFactory.getLog(FinancialTransactionViewHandler.class);
+ private static final Log log = LogFactory.getLog(FinancialTransactionViewHandler.class);
+ /** Managed view. */
protected FinancialTransactionView view;
+ /** Cache object used to copy & paste. */
protected Object clipBoard;
- protected FinancialTransactionViewHandler(FinancialTransactionView view) {
+ protected EntryBookService entryBookService;
+ protected FinancialPeriodService financialPeriodService;
+ protected FiscalPeriodService fiscalPeriodService;
+ protected FinancialTransactionService financialTransactionService;
+
+ public FinancialTransactionViewHandler(FinancialTransactionView view) {
this.view = view;
+
+ entryBookService = LimaServiceFactory.getService(EntryBookService.class);
+ financialPeriodService = LimaServiceFactory.getService(FinancialPeriodService.class);
+ fiscalPeriodService = LimaServiceFactory.getService(FiscalPeriodService.class);
+ financialTransactionService = LimaServiceFactory.getService(FinancialTransactionService.class);
+ LimaServiceFactory.addServiceListener(FinancialPeriodService.class, this);
+ LimaServiceFactory.addServiceListener(FiscalPeriodService.class, this);
+ LimaServiceFactory.addServiceListener(ImportService.class, this);
}
- public FinancialTransactionTable getTable() {
- return view.getFinancialTransactionTable();
+ /**
+ * Init all combo box in view.
+ */
+ public void init() {
+ try {
+ // fiscal periods
+ List<FiscalPeriod> fiscalPeriods = fiscalPeriodService.getAllUnblockedFiscalPeriods();
+ view.getFiscalPeriodComboBoxModel().setObjects(fiscalPeriods);
+ if (log.isDebugEnabled()) {
+ log.debug(String.format("Loaded %d fiscal periods", fiscalPeriods.size()));
+ }
+ if (!fiscalPeriods.isEmpty()) {
+ view.getFiscalPeriodComboBoxModel().setSelectedItem(fiscalPeriods.get(0));
+ }
+
+ // entry books
+ List<EntryBook> allEntryBooks = entryBookService.getAllEntryBooks();
+ view.getEntryBookComboBoxModel().setObjects(allEntryBooks);
+ if (log.isDebugEnabled()) {
+ log.debug(String.format("Loaded %d entry books", allEntryBooks.size()));
+ }
+ } catch (LimaException ex) {
+ throw new LimaRuntimeException("Can't init financial transaction view", ex);
+ }
}
- public FinancialTransactionTableModel getTableModel() {
- return view.getFinancialTransactionTableModel();
+ /**
+ * New fiscal period selection.
+ *
+ * @param event event
+ */
+ public void fiscalPeriodSelected(ItemEvent event) {
+ if ( event.getStateChange() == ItemEvent.SELECTED ) {
+ FiscalPeriod selectedFiscalPeriod = (FiscalPeriod) event.getItem();
+
+ try {
+ List<FinancialPeriod> financialPeriods = financialPeriodService.getFinancialPeriods(selectedFiscalPeriod.getBeginDate(),
+ selectedFiscalPeriod.getEndDate());
+
+ if (log.isDebugEnabled()) {
+ log.debug(String.format("Loaded %d financial periods", financialPeriods.size()));
+ }
+ view.getFinancialPeriodComboBoxModel().setObjects(financialPeriods);
+
+ // update transactions
+ updateFinancialTransactions();
+ } catch (LimaException ex) {
+ throw new LimaRuntimeException("Can't update financial period list", ex);
+ }
+ }
}
- public FiscalPeriodComboBoxModel getFiscalPeriodComboBoxModel() {
- return view.getFiscalPeriodComboBoxModel();
+ /**
+ * New financial period selection.
+ *
+ * @param event event
+ */
+ public void financialPeriodSelected(ItemEvent event) {
+ if ( event.getStateChange() == ItemEvent.SELECTED ) {
+ updateFinancialTransactions();
+ }
}
- public FinancialPeriodComboBoxModel getFinancialPeriodComboBoxModel() {
- return view.getFinancialPeriodComboBoxModel();
+ /**
+ * New entry book selected.
+ *
+ * @param event event
+ */
+ public void entryBookSelected(ItemEvent event) {
+ if ( event.getStateChange() == ItemEvent.SELECTED ) {
+ updateFinancialTransactions();
+ }
}
- public void initEntryBookModel(JComboBox comboBox) {
- EntryBookServiceMonitorable service =
- LimaServiceFactory.getService(EntryBookServiceMonitorable.class);
+ /**
+ * Fill transaction for selection fiscal period, financial perdiod
+ * and entry book.
+ */
+ public void updateFinancialTransactions() {
+ FinancialPeriod financialPeriod = (FinancialPeriod)view.getFinancialPeriodComboBox().getSelectedItem();
+ EntryBook entryBook = (EntryBook)view.getEntryBookComboBox().getSelectedItem();
+
+ // la selection de la financialPeriod est obligatoire
+ // sinon, tout un exercice, c'est trop lourd
+ // l'entry book par contre, est facultatif
+ if (financialPeriod == null) {
+ return;
+ }
+
try {
- List<EntryBook> allEntryBooks = service.getAllEntryBooks();
- allEntryBooks.add(0, null);
- SwingUtil.fillComboBox(comboBox, allEntryBooks, null);
- } catch (LimaException e) {
- ErrorHelper.showErrorDialog(view, e.getMessage(), e.getCause());
+ List<Object> transAndEntries = new ArrayList<Object>();
+ List<FinancialTransaction> transactions;
+ if (entryBook == null) {
+ transactions = financialTransactionService.getAllFinancialTransactions(financialPeriod);
+ } else {
+ transactions = financialTransactionService.getAllFinancialTransactions(financialPeriod, entryBook);
+ }
+
+ // move it to unique collection for table rendering
+ for (FinancialTransaction transaction : transactions) {
+ transAndEntries.add(transaction);
+ List<Entry> entries = (List<Entry>) transaction.getEntry();
+ Collections.sort(entries, new EntryComparator());
+ transAndEntries.addAll(entries);
+ }
+
+ view.getFinancialTransactionTableModel().setTransactionAndEntries(transAndEntries);
+ } catch (LimaException ex) {
+ throw new LimaRuntimeException("Can't get transactions list", ex);
}
}
- //copy entry
+ /**
+ * Copy selected transaction or entry.
+ *
+ * @param indexSelectedRow
+ */
public void copyRow(int indexSelectedRow) {
- if (indexSelectedRow != -1) {
- clipBoard = getTableModel().getElementAt(indexSelectedRow);
- }
+ clipBoard = view.getFinancialTransactionTableModel().getElementAt(indexSelectedRow);
}
- //paste entry
+ /**
+ * Paste entry.
+ *
+ * @param indexSelectedRow selected row to paste entry
+ */
public void pasteRow(int indexSelectedRow) {
- FinancialTransactionTable table = getTable();
- FinancialTransactionTableModel tableModel = getTableModel();
+ FinancialTransactionTable table = view.getFinancialTransactionTable();
- if (indexSelectedRow != -1) {
- if (clipBoard instanceof Entry) {
- try {
- int index = tableModel.addEntry((Entry) clipBoard,
- indexSelectedRow);
+ if (clipBoard instanceof Entry) {
+ try {
+ int index = addEntry((Entry) clipBoard, indexSelectedRow);
- //select the new line
- ListSelectionModel selectionModel =
- table.getSelectionModel();
- selectionModel.setSelectionInterval(
- indexSelectedRow + 1, indexSelectedRow + 1);
- //focus on second column
- table.changeSelection(index, 1, false, false);
- table.requestFocusInWindow();
- } catch (LimaException eee) {
- if (log.isErrorEnabled()) {
- log.error("Can't past entry", eee);
- }
- DialogHelper.showErrorMessageDialog(view, eee);
- }
+ //select the new line
+ ListSelectionModel selectionModel = table.getSelectionModel();
+ selectionModel.setSelectionInterval(indexSelectedRow + 1, indexSelectedRow + 1);
+ //focus on second column
+ table.changeSelection(index, 1, false, false);
+ table.requestFocusInWindow();
+ } catch (LimaException eee) {
+ throw new LimaRuntimeException("Can't past entry", eee);
}
}
}
- //add a new transaction
+ /**
+ * @param entry
+ * @param row
+ * @return int: indexOf new Entry
+ * @throws LimaException
+ */
+ protected int addEntry(Entry entry, int row) throws LimaException {
+ FinancialTransactionTableModel tableModel = view.getFinancialTransactionTableModel();
+ FinancialTransaction currentTransaction = null;
+ int financialTransactionRow = 0;
+ Object currentRow = tableModel.getElementAt(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 = tableModel.indexOf(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 = tableModel.indexOf(((Entry) currentRow).
+ getFinancialTransaction());
+ }
+ //create it
+ entry.setFinancialTransaction(currentTransaction);
+ Entry newEntry = financialTransactionService.createEntry(entry);
+ currentTransaction.addEntry(entry);
+ //FIXME echatellier 20120413 what is fired here ?
+ //fireTableRowsUpdated(financialTransactionRow, financialTransactionRow + currentTransaction.getEntry().size() - 1);
+
+ // on met a jour l'ui
+ int newRow = financialTransactionRow + currentTransaction.getEntry().size() + 1;
+ tableModel.addRow(newEntry, newRow);
+ return newRow;
+ }
+
+ /**
+ * Add new transaction.
+ */
public void addFinancialTransaction() {
- FinancialTransactionTable table = getTable();
- FinancialTransactionTableModel tableModel = getTableModel();
+ FinancialTransactionTable table = view.getFinancialTransactionTable();
ListSelectionModel selectionModel = table.getSelectionModel();
try {
- int index = tableModel.addFinancialTransaction();
+ addFinancialTransaction2();
//select the new line
int numberRow = table.getRowCount();
selectionModel.setSelectionInterval(numberRow - 1, numberRow - 1);
//focus on first column
- table.changeSelection(index, 0, false, false);
-// table.requestFocusInWindow();
- table.scrollCellToVisible(index, 0);
+ table.changeSelection(numberRow, 0, false, false);
+ table.scrollCellToVisible(numberRow, 0);
} catch (LimaException eee) {
- if (log.isErrorEnabled()) {
- log.error("Can't add financialtransaction", eee);
- }
- DialogHelper.showErrorMessageDialog(view, eee);
+ throw new LimaRuntimeException("Can't add financialtransaction", eee);
}
}
+
+ /**
+ * Add new transaction after calling service.
+ *
+ * @throws LimaException
+ */
+ public void addFinancialTransaction2() throws LimaException {
- //implement new transaction button
- //add a new entry to the selected transaction
- public void addEntry() {
+ FinancialPeriod financialPeriod = (FinancialPeriod)view.getFinancialPeriodComboBox().getSelectedItem();
+ EntryBook entryBook = (EntryBook)view.getEntryBookComboBox().getSelectedItem();
+ FinancialTransactionTableModel tableModel = view.getFinancialTransactionTableModel();
- FinancialTransactionTable table = getTable();
- FinancialTransactionTableModel tableModel = getTableModel();
- ListSelectionModel selectionModel = table.getSelectionModel();
+ FinancialTransaction financialTransaction = new FinancialTransactionImpl();
+ financialTransaction.setFinancialPeriod(financialPeriod);
+ // can be defined later by user
+ if (entryBook != null) {
+ financialTransaction.setEntryBook(entryBook);
+ }
- int indexSelectedRow = table.getSelectedRow();
- if (indexSelectedRow != -1) {
+ // compute new transaction date from selected financial
+ // transaction begin date
+ Calendar actualCalendar = Calendar.getInstance();
+ Date transactionDate = financialPeriod.getBeginDate();
+ Calendar calEnd = Calendar.getInstance();
+ calEnd.setTime(financialPeriod.getEndDate());
+ int dayMax = calEnd.get(Calendar.DAY_OF_MONTH);
+ Calendar calBegin = Calendar.getInstance();
+ calBegin.setTime(financialPeriod.getBeginDate());
+ int dayMin = calBegin.get(Calendar.DAY_OF_MONTH);
+ int toDay = actualCalendar.get(Calendar.DAY_OF_MONTH);
- int firstentryBookrow =
- tableModel.getFirstEntry(indexSelectedRow);
+ // FIXME echatellier 20120413 explain this code, why actualCalendar
+ // is not enought ?
+ if (toDay > dayMax || toDay < dayMin) {
+ transactionDate = DateUtils.setDays(transactionDate, dayMax);
+ } else {
+ transactionDate = DateUtils.setDays(transactionDate, toDay);
+ }
- String voucher;
- String description;
- if (firstentryBookrow == -1) {
+ // set date to the financial transaction
+ financialTransaction.setTransactionDate(transactionDate);
+ // create it
+ FinancialTransaction fTransaction = financialTransactionService.createFinancialTransaction(financialTransaction);
- // no entry book for this transaction
- voucher = null;
- description = null;
+ //on recharge la liste
+ tableModel.addRow(fTransaction);
+ }
- } else {
+ /**
+ * Add new entry to selected transaction.
+ */
+ public void addEntry() {
+ FinancialTransactionTable table = view.getFinancialTransactionTable();
+ FinancialTransactionTableModel tableModel = view.getFinancialTransactionTableModel();
+
+ // FIXME echatellier 20120413 what is excatlty selected row here ?
+ // real selected row or selected transaction row ?
+ int indexSelectedRow = table.getSelectedRow();
+ if (indexSelectedRow != -1) {
+ int firstentryBookrow = tableModel.getFirstEntry(indexSelectedRow);
+
+ String defaultVoucher = null;
+ String dafaultDescription = null;
+ if (firstentryBookrow != -1) {
// there is no first entry, grab the voucher and
- voucher = (String)
- tableModel.getValueAt(indexSelectedRow, 2);
- description = (String)
- tableModel.getValueAt(indexSelectedRow, 4);
+ defaultVoucher = (String) tableModel.getValueAt(firstentryBookrow, 2);
+ dafaultDescription = (String) tableModel.getValueAt(firstentryBookrow, 4);
}
+
try {
-
// creates the new entry
+ Entry entry = new EntryImpl();
+ entry.setVoucher(defaultVoucher);
+ entry.setDescription(dafaultDescription);
+ // check if current row is a transaction or an entry
+ FinancialTransaction currentTransaction = null;
+ Object currentRow = tableModel.getElementAt(indexSelectedRow);
+ 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 in service
+ entry.setFinancialTransaction(currentTransaction);
+ Entry newEntry = financialTransactionService.createEntry(entry);
+ currentTransaction.addEntry(newEntry);
- int index = tableModel.addEmptyEntry(
- voucher,
- description,
- indexSelectedRow
- );
+ // add it in ui
+ tableModel.addRow(newEntry, indexSelectedRow + currentTransaction.getEntry().size());
//select the new line
+ ListSelectionModel selectionModel = table.getSelectionModel();
selectionModel.setSelectionInterval(
indexSelectedRow + 1, indexSelectedRow + 1);
- //focus on second column
- table.changeSelection(index, 1, false, false);
-// table.requestFocusInWindow();
- } catch (LimaException eee) {
- if (log.isErrorEnabled()) {
- log.error("Can't add emptyentry", eee);
- }
- DialogHelper.showErrorMessageDialog(view, eee);
+ table.changeSelection(indexSelectedRow + 1, 1, false, false);
+
+ } catch (LimaException ex) {
+ throw new LimaRuntimeException("Can't add emptyentry", ex);
}
} else {
if (log.isWarnEnabled()) {
@@ -218,42 +409,47 @@
/**
* Delete selected row in table (could be transaction or entry).
* <p/>
- * Called by model.
+ * Called by table.
*/
public void deleteSelectedRow() {
- FinancialTransactionTable table = getTable();
- FinancialTransactionTableModel tableModel = getTableModel();
+ FinancialTransactionTable table = view.getFinancialTransactionTable();
+ FinancialTransactionTableModel tableModel = view.getFinancialTransactionTableModel();
int indexSelectedRow = table.getSelectedRow();
if (indexSelectedRow != -1) {
Object selectedValue = tableModel.getElementAt(indexSelectedRow);
- String message;
+
+ int response;
if (selectedValue instanceof FinancialTransaction) {
- message = _("lima.charts.financialtransaction.question.removetransaction");
+ response = JOptionPane.showConfirmDialog(
+ view, _("lima.ui.financialtransaction.messageremovetransaction"),
+ _("lima.ui.financialtransaction.titleremovetransaction"), JOptionPane.YES_NO_OPTION);
} else {
- message = _("lima.charts.financialtransaction.question.removeentry");
+ response = JOptionPane.showConfirmDialog(
+ view, _("lima.ui.financialtransaction.messageremoveentry"),
+ _("lima.ui.financialtransaction.titleremoveentry"), JOptionPane.YES_NO_OPTION);
}
- int response = JOptionPane.showConfirmDialog(
- view, message,
- _("lima.common.confirmation"), JOptionPane.YES_NO_OPTION);
-
if (response == JOptionPane.YES_OPTION) {
+ try {
+ if (selectedValue instanceof FinancialTransaction) {
+ FinancialTransaction currentTransaction =
+ (FinancialTransaction) selectedValue;
+ financialTransactionService.removeFinancialTransaction(currentTransaction);
+
+ } else if (selectedValue instanceof Entry) {
+ Entry currentEntry = (Entry) selectedValue;
+ financialTransactionService.removeEntry(currentEntry);
+ }
+ tableModel.deleteRow(indexSelectedRow);
- try {
- tableModel.removeObject(indexSelectedRow);
//select the upper line
- ListSelectionModel selectionModel =
- table.getSelectionModel();
- selectionModel.setSelectionInterval(
- indexSelectedRow - 1, indexSelectedRow - 1);
- } catch (LimaException eee) {
- if (log.isErrorEnabled()) {
- log.error("Can't remove transaction or entry", eee);
- }
- DialogHelper.showErrorMessageDialog(view, eee);
+ ListSelectionModel selectionModel = table.getSelectionModel();
+ selectionModel.setSelectionInterval(indexSelectedRow - 1, indexSelectedRow - 1);
+ } catch (LimaException ex) {
+ throw new LimaRuntimeException("Can't remove transaction or entry", ex);
}
}
} else {
@@ -263,36 +459,47 @@
}
}
+ /**
+ * Select previous value in combo box.
+ *
+ * @param comboBox combo box
+ */
public void back(JComboBox comboBox) {
int row = comboBox.getSelectedIndex();
- if (log.isDebugEnabled()) {
- log.debug(row);
- }
if (row > 0) {
comboBox.setSelectedIndex(row - 1);
- //FIXME tchemit-2011-09-20 Should never referesh ui by hand
- comboBox.repaint();
}
}
+ /**
+ * Select next value in combo box.
+ *
+ * @param comboBox combo box
+ */
public void next(JComboBox comboBox) {
int size = comboBox.getModel().getSize();
int row = comboBox.getSelectedIndex();
- if (log.isDebugEnabled()) {
- log.debug(row);
- }
if (row < size - 1) {
comboBox.setSelectedIndex(row + 1);
- //FIXME tchemit-2011-09-20 Should never referesh ui by hand
- comboBox.repaint();
}
}
- public void refresh() {
- getTableModel().refresh();
- getFiscalPeriodComboBoxModel().refresh();
- getFinancialPeriodComboBoxModel().refresh();
+ /*
+ * @see org.chorem.lima.business.ServiceListener#notifyMethod(java.lang.String, java.lang.String)
+ */
+ @Override
+ public void notifyMethod(String serviceName, String methodName) {
+
+ if (log.isDebugEnabled()) {
+ log.debug("Method notified " + serviceName + "#" + methodName);
+ }
+
+ if (serviceName.contains("FinancialTransaction") ||
+ methodName.contains("importEntries") ||
+ methodName.contains("importAll")) {
+ updateFinancialTransactions();
+ }
}
}
Added: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/package-info.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/package-info.java (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/package-info.java 2012-04-13 13:46:24 UTC (rev 3366)
@@ -0,0 +1,31 @@
+/*
+ * #%L
+ *
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2012 Codelutin, Chatellier Eric
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+/**
+ * Saisie des écritures.
+ *
+ * Selection de l'exercice, de la periode et du journal et affichage
+ * de la liste correspondante.
+ */
+package org.chorem.lima.ui.financialtransaction;
Property changes on: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/package-info.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedView.jaxx 2012-04-12 16:37:45 UTC (rev 3365)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedView.jaxx 2012-04-13 13:46:24 UTC (rev 3366)
@@ -33,7 +33,7 @@
<FinancialTransactionUnbalancedViewHandler id="handler"
javaBean="new FinancialTransactionUnbalancedViewHandler(this)"/>
<Boolean id="selectedRow" javaBean="false"/>
- <FiscalPeriodComboBoxModel id="modelFiscalPeriod"/>
+ <org.chorem.lima.ui.combobox.FiscalPeriodComboBoxModel id="modelFiscalPeriod"/>
<script>
<![CDATA[
void $afterCompleteSetup() {
Deleted: trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/EntryBookListRenderer.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/EntryBookListRenderer.java 2012-04-12 16:37:45 UTC (rev 3365)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/EntryBookListRenderer.java 2012-04-13 13:46:24 UTC (rev 3366)
@@ -1,61 +0,0 @@
-/*
- * #%L
- *
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2012 Codelutin, Chatellier Eric
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
- *
- * You should have received a copy of the GNU General Lesser Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/lgpl-3.0.html>.
- * #L%
- */
-
-package org.chorem.lima.ui.fiscalperiod;
-
-import java.awt.Component;
-
-import javax.swing.DefaultListCellRenderer;
-import javax.swing.JList;
-
-import org.chorem.lima.entity.EntryBook;
-
-/**
- * EntryBook renderer for fiscal period retaining earning list.
- *
- * @author chatellier
- * @version $Revision$
- *
- * Last update : $Date$
- * By : $Author$
- */
-public class EntryBookListRenderer extends DefaultListCellRenderer {
-
- /** serialVersionUID. */
- private static final long serialVersionUID = -9089182547408397051L;
-
- @Override
- public Component getListCellRendererComponent(JList list, Object value,
- int index, boolean isSelected, boolean cellHasFocus) {
-
- EntryBook entryBook = (EntryBook)value;
- Object newValue = entryBook;
- if (entryBook != null) {
- newValue = entryBook.getCode() + " - " + entryBook.getLabel();
- }
- return super.getListCellRendererComponent(list, newValue, index, isSelected,
- cellHasFocus);
- }
-}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/FiscalPeriodTable.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/FiscalPeriodTable.java 2012-04-12 16:37:45 UTC (rev 3365)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/FiscalPeriodTable.java 2012-04-13 13:46:24 UTC (rev 3366)
@@ -59,16 +59,11 @@
private static final long serialVersionUID = -8462838870024505659L;
- protected FiscalPeriodViewHandler handler;
-
protected FiscalPeriodTableModel model;
- private Highlighter colorTransaction;
-
public FiscalPeriodTable(FiscalPeriodTableModel model) {
super(model);
this.model = model;
- this.handler = handler;
addKeyListener(this);
addMouseListener(this);
@@ -90,7 +85,7 @@
return fiscalPeriod.getLocked();
}
};
- colorTransaction =
+ Highlighter colorTransaction =
new ColorHighlighter(predicate, null, new Color(222, 0, 0));
addHighlighter(colorTransaction);
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/FiscalPeriodViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/FiscalPeriodViewHandler.java 2012-04-12 16:37:45 UTC (rev 3365)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/FiscalPeriodViewHandler.java 2012-04-13 13:46:24 UTC (rev 3366)
@@ -43,8 +43,6 @@
import org.chorem.lima.business.ServiceListener;
import org.chorem.lima.business.api.FinancialTransactionService;
import org.chorem.lima.business.api.FiscalPeriodService;
-import org.chorem.lima.business.monitorable.FinancialTransactionServiceMonitorable;
-import org.chorem.lima.business.monitorable.FiscalPeriodServiceMonitorable;
import org.chorem.lima.entity.Entry;
import org.chorem.lima.entity.EntryBook;
import org.chorem.lima.entity.EntryBookImpl;
@@ -60,15 +58,15 @@
*
* @author chatellier
* @version $Revision$
- * <p/>
- * Last update : $Date$
- * By : $Author$
+ *
+ * Last update : $Date$
+ * By : $Author$
*/
public class FiscalPeriodViewHandler implements ServiceListener {
private static final Log log = LogFactory.getLog(FiscalPeriodViewHandler.class);
- private FiscalPeriodView view;
+ protected FiscalPeriodView view;
/** Service. */
protected FiscalPeriodService fiscalPeriodService;
@@ -83,10 +81,10 @@
public FiscalPeriodViewHandler(FiscalPeriodView view) {
this.view = view;
- fiscalPeriodService = LimaServiceFactory.getService(FiscalPeriodServiceMonitorable.class);
- financialTransactionService = LimaServiceFactory.getService(FinancialTransactionServiceMonitorable.class);
+ fiscalPeriodService = LimaServiceFactory.getService(FiscalPeriodService.class);
+ financialTransactionService = LimaServiceFactory.getService(FinancialTransactionService.class);
- LimaServiceFactory.addServiceListener(FiscalPeriodServiceMonitorable.class, this);
+ LimaServiceFactory.addServiceListener(FiscalPeriodService.class, this);
}
public void init() {
@@ -236,7 +234,7 @@
try {
boolean found = false;
List<FinancialTransaction> financialTransactionsList =
- financialTransactionService.getAllFinancialTransactionsFromDateToDate(
+ financialTransactionService.getAllFinancialTransactions(
selectedFiscalPeriod.getBeginDate(), selectedFiscalPeriod.getEndDate());
//check if they are at least one transaction to be report
if (!financialTransactionsList.isEmpty()) {
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/RetainedEarningsEntryBookForm.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/RetainedEarningsEntryBookForm.jaxx 2012-04-12 16:37:45 UTC (rev 3365)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/RetainedEarningsEntryBookForm.jaxx 2012-04-13 13:46:24 UTC (rev 3366)
@@ -29,7 +29,7 @@
<import>
javax.swing.text.Document
org.chorem.lima.entity.EntryBook
- org.chorem.lima.ui.combobox.EntryBookComboBoxModel
+ org.chorem.lima.ui.common.EntryBookListRenderer
</import>
<EntryBook id="entryBook" javaBean="null"/>
@@ -92,7 +92,7 @@
<JLabel id="entryBookSelectorLabel" text="lima.common.entrybook"/>
</cell>
<cell>
- <EntryBookComboBoxModel id="modelEntryBookComboBox"/>
+ <org.chorem.lima.ui.combobox.EntryBookComboBoxModel id="modelEntryBookComboBox"/>
<JComboBox id="entryBookComboBox"
model="{getModelEntryBookComboBox()}"
renderer="{new EntryBookListRenderer()}"
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringTableModel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringTableModel.java 2012-04-12 16:37:45 UTC (rev 3365)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringTableModel.java 2012-04-13 13:46:24 UTC (rev 3366)
@@ -123,7 +123,7 @@
if (selectedBeginDate != null && selectedEndDate != null) {
try {
List<FinancialTransaction> financialtransactions =
- financialTransactionService.getAllFinancialTransactionsFromDateToDate(
+ financialTransactionService.getAllFinancialTransactions(
selectedBeginDate, selectedEndDate);
for (FinancialTransaction financialtransaction : financialtransactions) {
results.add(financialtransaction);
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 2012-04-12 16:37:45 UTC (rev 3365)
+++ trunk/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties 2012-04-13 13:46:24 UTC (rev 3366)
@@ -293,6 +293,23 @@
lima.ui.entrybook.label=
lima.ui.entrybook.remove=
lima.ui.entrybook.update=
+lima.ui.financialtransaction.account=
+lima.ui.financialtransaction.balance=
+lima.ui.financialtransaction.buttonback=
+lima.ui.financialtransaction.buttonnext=
+lima.ui.financialtransaction.credit=
+lima.ui.financialtransaction.date=
+lima.ui.financialtransaction.debit=
+lima.ui.financialtransaction.description=
+lima.ui.financialtransaction.entrybook=
+lima.ui.financialtransaction.financialperiod=
+lima.ui.financialtransaction.fiscalyear=
+lima.ui.financialtransaction.letter=
+lima.ui.financialtransaction.messageremoveentry=
+lima.ui.financialtransaction.messageremovetransaction=
+lima.ui.financialtransaction.titleremoveentry=
+lima.ui.financialtransaction.titleremovetransaction=
+lima.ui.financialtransaction.voucher=
lima.ui.fiscalperiod.addfiscalperiod.morethan12=
lima.ui.fiscalperiod.addfiscalperiodtitle=
lima.ui.fiscalperiod.addperiodtitle=
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 2012-04-12 16:37:45 UTC (rev 3365)
+++ trunk/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties 2012-04-13 13:46:24 UTC (rev 3366)
@@ -272,6 +272,23 @@
lima.ui.entrybook.label=Libellé
lima.ui.entrybook.remove=Supprimer
lima.ui.entrybook.update=Modifier
+lima.ui.financialtransaction.account=Compte
+lima.ui.financialtransaction.balance=Balance
+lima.ui.financialtransaction.buttonback=←
+lima.ui.financialtransaction.buttonnext=→
+lima.ui.financialtransaction.credit=Crédit
+lima.ui.financialtransaction.date=Date
+lima.ui.financialtransaction.debit=Débit
+lima.ui.financialtransaction.description=Description
+lima.ui.financialtransaction.entrybook=Journal
+lima.ui.financialtransaction.financialperiod=Périodes comptables
+lima.ui.financialtransaction.fiscalyear=Exercices
+lima.ui.financialtransaction.letter=Lettre
+lima.ui.financialtransaction.messageremoveentry=Voulez-vous supprimer cette ligne de transaction?
+lima.ui.financialtransaction.messageremovetransaction=Voulez-vous supprimer cette transaction?
+lima.ui.financialtransaction.titleremoveentry=Suppression
+lima.ui.financialtransaction.titleremovetransaction=Suppression
+lima.ui.financialtransaction.voucher=Pièce comptable
lima.ui.fiscalperiod.addfiscalperiod.morethan12=La période sélectionnée n'est pas de 12 mois, voulez-vous continuer ?
lima.ui.fiscalperiod.addfiscalperiodtitle=Nouvel exercice
lima.ui.fiscalperiod.addperiodtitle=
Modified: trunk/lima-swing/src/main/resources/log4j.properties
===================================================================
--- trunk/lima-swing/src/main/resources/log4j.properties 2012-04-12 16:37:45 UTC (rev 3365)
+++ trunk/lima-swing/src/main/resources/log4j.properties 2012-04-13 13:46:24 UTC (rev 3366)
@@ -38,4 +38,5 @@
# package level
log4j.logger.org.chorem.lima=INFO
+log4j.logger.org.chorem.lima.business.ejb=DEBUG
log4j.logger.org.chorem.lima.ui.account=DEBUG
\ No newline at end of file
1
0
April 12, 2012
Author: echatellier
Date: 2012-04-12 18:37:45 +0200 (Thu, 12 Apr 2012)
New Revision: 3365
Url: http://chorem.org/repositories/revision/lima/3365
Log:
Remove Letter entity and VatStatement#amount from model
Removed:
trunk/lima-swing/src/main/java/org/chorem/lima/ui/celleditor/LetterTableCellEditor.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/LetterComboBoxModel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/LetterSearchComboBox.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetterComboBox.java
trunk/lima-swing/src/main/java/org/chorem/lima/util/LetterToString.java
Modified:
trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialTransactionService.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/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/migration/MigrationV0_6.java
trunk/lima-callao/src/main/xmi/accounting.zargo
trunk/lima-swing/src/main/java/org/chorem/lima/ui/LimaDecoratorProvider.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsTableModel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsTableModel.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/financialtransactionsearch/FinancialTransactionSearchViewHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/LetterSearchPanel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedTableModel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/AddLetterForm.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringTable.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringTableModel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringViewHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatchart/VatChartViewHandler.java
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 2012-04-12 14:24:21 UTC (rev 3364)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ExportServiceImpl.java 2012-04-12 16:37:45 UTC (rev 3365)
@@ -545,7 +545,7 @@
nextLine[2] = entry.getDescription();
nextLine[3] = entry.getAmount().toString();
nextLine[4] = Boolean.toString(entry.getDebit());
- nextLine[5] = entry.getLetter().getCode();
+ nextLine[5] = entry.getLettering();
nextLine[6] = entry.getDetail();
nextLine[7] = entry.getVoucher();
nextLine[8] = entry.getPosition();
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 2012-04-12 14:24:21 UTC (rev 3364)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java 2012-04-12 16:37:45 UTC (rev 3365)
@@ -25,6 +25,16 @@
package org.chorem.lima.business.ejb;
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+import javax.ejb.EJB;
+import javax.ejb.Local;
+import javax.ejb.Remote;
+import javax.ejb.Stateless;
+
import org.chorem.lima.FinancialStatementWayEnum;
import org.chorem.lima.beans.FinancialTransactionSearch;
import org.chorem.lima.business.AccountingRules;
@@ -46,24 +56,12 @@
import org.chorem.lima.entity.FinancialTransaction;
import org.chorem.lima.entity.FinancialTransactionDAO;
import org.chorem.lima.entity.FiscalPeriod;
-import org.chorem.lima.entity.Letter;
-import org.chorem.lima.entity.LetterDAO;
-import org.chorem.lima.entity.LetterImpl;
import org.chorem.lima.entity.LimaCallaoDAOHelper;
import org.nuiton.topia.TopiaContext;
import org.nuiton.topia.TopiaException;
import org.nuiton.topia.framework.TopiaQuery;
import org.nuiton.topia.framework.TopiaQuery.Op;
-import javax.ejb.EJB;
-import javax.ejb.Local;
-import javax.ejb.Remote;
-import javax.ejb.Stateless;
-import java.math.BigDecimal;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-
/**
* Cette classe permet la création d'une transaction comptable dans l'application.
* Toute action sur une transaction entraîne automatiquement une création de log.
@@ -168,8 +166,7 @@
.addLoad(financialPeriodProperty)
.addLoad(entryBookLabelProperty)
.addLeftJoin("T." + FinancialTransaction.PROPERTY_ENTRY, "E", true)
- .addFetch("E." + Entry.PROPERTY_ACCOUNT)
- .addFetch("E." + Entry.PROPERTY_LETTER);
+ .addFetch("E." + Entry.PROPERTY_ACCOUNT);
financialTransactions = transactionDAO.findAllByQuery(query);
} catch (Exception ex) {
doCatch(topiaTransaction, ex);
@@ -209,8 +206,7 @@
.addLoad(financialPeriodProperty)
.addLoad(entryBookLabelProperty)
.addLeftJoin("T." + FinancialTransaction.PROPERTY_ENTRY, "E", true)
- .addFetch("E." + Entry.PROPERTY_ACCOUNT)
- .addFetch("E." + Entry.PROPERTY_LETTER);
+ .addFetch("E." + Entry.PROPERTY_ACCOUNT);
financialTransactions = transactionDAO.findAllByQuery(query);
} catch (Exception ex) {
doCatch(topiaTransaction, ex);
@@ -258,7 +254,6 @@
.addEquals("F", fiscalPeriod)
// load lazy
.addFetch("E." + Entry.PROPERTY_ACCOUNT)
- .addFetch("E." + Entry.PROPERTY_LETTER)
.addLoad(financialPeriodProperty)
.addLoad(entryBookLabelProperty);
@@ -505,7 +500,7 @@
entryOld.setVoucher(entry.getVoucher());
entryOld.setFinancialTransaction(entry.getFinancialTransaction());
entryOld.setPosition(entry.getPosition());
- entryOld.setLetter(entry.getLetter());
+ entryOld.setLettering(entry.getLettering());
//update entry
entryDAO.update(entryOld);
@@ -542,139 +537,7 @@
}
}
- /**
- * Get letter from count of existing letter
- * 1 -> A, 2 -> B, 26 -> Z, 27 -> AA, 28 -> AB, ...
- */
@Override
- public Letter getNewLetter() throws LimaException {
- Letter letter = new LetterImpl();
- TopiaContext topiaContext = beginTransaction(rootContext);
- try {
- LetterDAO letterDAO = LimaCallaoDAOHelper.getLetterDAO(topiaContext);
- long n = letterDAO.count();
- String res = numberToString(n, null);
-
- //if already exist
- while (letterDAO.findByCode(res) != null) {
- res = numberToString(n++, null);
- }
- letter.setCode(res);
- } catch (Exception ex) {
- doCatch(topiaContext, ex);
- } finally {
- doFinally(topiaContext);
- }
- return letter;
- }
-
- public String numberToString(long n, StringBuffer result) {
- if (result == null) {
- result = new StringBuffer();
- }
- long mod = (n - 1) % 26;
- long div = (n - 1) / 26;
- if (div > 0) {
- result.append(numberToString(div, result));
- }
- return result.append((char) (mod + 65)).toString();
- }
-
- @Override
- public void createLetter(Letter letter) throws LimaException {
- TopiaContext topiaContext = beginTransaction(rootContext);
- try {
- createLetterWithTransaction(letter, topiaContext);
- } catch (Exception ex) {
- doCatch(topiaContext, ex);
- } finally {
- doFinally(topiaContext);
- }
- }
-
- public void createLetterWithTransaction(Letter letter,
- TopiaContext topiaContext) throws LimaException {
- try {
- LetterDAO letterDAO = LimaCallaoDAOHelper.getLetterDAO(topiaContext);
- letterDAO.create(letter);
- commitTransaction(topiaContext);
- } catch (TopiaException ex) {
- doCatch(topiaContext, ex);
- }
- }
-
- @Override
- public void removeLetter(Letter letter) throws LimaException {
- TopiaContext topiaContext = beginTransaction(rootContext);
- try {
- LetterDAO letterDAO = LimaCallaoDAOHelper.getLetterDAO(topiaContext);
- letterDAO.delete(letter);
- commitTransaction(topiaContext);
- } catch (Exception ex) {
- doCatch(topiaContext, ex);
- } finally {
- doFinally(topiaContext);
- }
- }
-
-
- @Override
- public List<Letter> getAllLetters() throws LimaException {
- List<Letter> letters = null;
- TopiaContext topiaContext = beginTransaction(rootContext);
- try {
- LetterDAO letterDAO = LimaCallaoDAOHelper.getLetterDAO(topiaContext);
- letters = letterDAO.findAll();
- } catch (Exception ex) {
- doCatch(topiaContext, ex);
- } finally {
- doFinally(topiaContext);
- }
- return letters;
- }
-
-
- @Override
- public void setEntryLetter(Entry entry,
- Letter letter) throws LimaException {
-
- TopiaContext topiaContext = beginTransaction(rootContext);
- try {
- LetterDAO letterDAO = LimaCallaoDAOHelper.getLetterDAO(topiaContext);
- Letter letterOld = letterDAO.findByCode(letter.getCode());
- if (letterOld == null) {
- createLetterWithTransaction(letter, topiaContext);
- letterOld = letter;
- }
- EntryDAO entryDAO = LimaCallaoDAOHelper.getEntryDAO(topiaContext);
- Entry entryOld = entryDAO.findByTopiaId(entry.getTopiaId());
- entryOld.setLetter(letterOld);
- commitTransaction(topiaContext);
- } catch (Exception ex) {
- doCatch(topiaContext, ex);
- } finally {
- doFinally(topiaContext);
- }
- }
-
- @Override
- public void removeEntryLetter(Entry entry) throws LimaException {
-
- TopiaContext topiaContext = beginTransaction(rootContext);
- try {
-
- EntryDAO entryDAO = LimaCallaoDAOHelper.getEntryDAO(topiaContext);
- Entry entryOld = entryDAO.findByTopiaId(entry.getTopiaId());
- entryOld.setLetter(null);
- commitTransaction(topiaContext);
- } catch (Exception ex) {
- doCatch(topiaContext, ex);
- } finally {
- doFinally(topiaContext);
- }
- }
-
- @Override
public List<Object> searchFinancialTransaction(FinancialTransactionSearch financialTransactionSearch) throws LimaException {
List<Object> result = new ArrayList<Object>();
List<FinancialTransaction> financialTransactions;
@@ -708,9 +571,9 @@
if (description != null) {
query.addWhere("E.description", Op.LIKE, "%" + description + "%");
}
- Letter letter = financialTransactionSearch.getLetter();
+ String letter = financialTransactionSearch.getLettering();
if (letter != null) {
- query.addEquals("E.letter", letter);
+ query.addEquals("E.lettering", letter);
}
Account account = financialTransactionSearch.getAccount();
String accountsList = financialTransactionSearch.getAccountList();
@@ -766,8 +629,6 @@
TopiaQuery query2 = entryDAO.createQuery();
query2.addEquals(Entry.PROPERTY_FINANCIAL_TRANSACTION, financialTransaction);
- //Load for lazy
- query2.addLoad(Entry.PROPERTY_ACCOUNT, Entry.PROPERTY_LETTER);
List<Entry> entries = entryDAO.findAllByQuery(query2);
result.addAll(entries);
}
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 2012-04-12 14:24:21 UTC (rev 3364)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java 2012-04-12 16:37:45 UTC (rev 3365)
@@ -93,9 +93,6 @@
import org.chorem.lima.entity.FiscalPeriodImpl;
import org.chorem.lima.entity.Identity;
import org.chorem.lima.entity.IdentityImpl;
-import org.chorem.lima.entity.Letter;
-import org.chorem.lima.entity.LetterDAO;
-import org.chorem.lima.entity.LetterImpl;
import org.chorem.lima.entity.LimaCallaoDAOHelper;
import org.chorem.lima.entity.VatStatement;
import org.chorem.lima.entity.VatStatementDAO;
@@ -263,9 +260,7 @@
entry.setDescription(entryEBP.getLibelle());
entry.setVoucher(entryEBP.getPiece());
- Letter letter = createLetter(
- entryEBP.getLettre(), topiaContext);
- entry.setLetter(letter);
+ entry.setLettering(entryEBP.getLettre());
String entryBookCode = entryEBP.getJournal();
EntryBook entryBook = entryBookDAO
@@ -767,41 +762,7 @@
return result.toString();
}
-
/**
- * Import and create Letter : TYPE | Code
- *
- * @param nextLine
- * @param topiaContext
- * @return
- * @throws LimaException
- */
- protected String importLetterCSV(String[] nextLine,
- TopiaContext topiaContext) throws LimaException {
- StringBuilder result = new StringBuilder();
- try {
-
- LetterDAO letterDAO = LimaCallaoDAOHelper.getLetterDAO(topiaContext);
-
- Letter letter = new LetterImpl();
- String code = nextLine[1];
- letter.setCode(code);
-
- // if exist, skip
- if (letterDAO.findByCode(code) != null) {
- result.append(_("lima-business.import.letteralreadyexist", code));
- } else {
- // create it
- financialTransactionService.createLetter(letter);
- result.append(_("lima-business.import.letteradded", code));
- }
- } catch (TopiaException eeeTE) {
- doCatch(topiaContext, eeeTE);
- }
- return result.toString();
- }
-
- /**
* Import and create closedperiodicentrybook import Structure : TYPE |
* BeginDate | EndDate | Locked
*
@@ -1135,7 +1096,7 @@
vatStatement.setHeader(Boolean
.parseBoolean(vatStatementImport
.getHeader()));
- vatStatement.setAmount(BigDecimal.ZERO);
+
vatStatementService
.createVatStatementWithTransaction(
masterVatStatement,
@@ -1182,33 +1143,6 @@
return result.toString();
}
-
- /**
- * Dynamic letter creation used by CSV and EBP Import
- *
- * @param letterCode
- * @param topiaContext
- * @return
- * @throws LimaException
- */
- protected Letter createLetter(String letterCode,
- TopiaContext topiaContext) throws LimaException {
- Letter letter = null;
- try {
- LetterDAO letterDAO = LimaCallaoDAOHelper.getLetterDAO(topiaContext);
- letter = letterDAO.findByCode(letterCode);
- // if letter not exist create it !
- if (letter == null) {
- letter = new LetterImpl();
- letter.setCode(letterCode);
- financialTransactionService.createLetter(letter);
- }
- } catch (TopiaException eeeTE) {
- doCatch(topiaContext, eeeTE);
- }
- return letter;
- }
-
protected String createAccounts(Map<String, AccountImport> accounts,
TopiaContext topiaContext) throws LimaException {
StringBuilder result = new StringBuilder();
@@ -1355,9 +1289,7 @@
entry.setAmount(new BigDecimal(entryImport.getAmount()));
entry.setDebit(Boolean.parseBoolean(entryImport.getDebit()));
- Letter letter = createLetter(
- entryImport.getLettering(), topiaContext);
- entry.setLetter(letter);
+ entry.setLettering(entryImport.getLettering());
entry.setDetail(entryImport.getDetail());
entry.setVoucher(entryImport.getVoucher());
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 2012-04-12 14:24:21 UTC (rev 3364)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java 2012-04-12 16:37:45 UTC (rev 3365)
@@ -232,8 +232,7 @@
String loadEntryBookProperty =
TopiaQuery.getProperty(Entry.PROPERTY_FINANCIAL_TRANSACTION,
FinancialTransaction.PROPERTY_ENTRY_BOOK);
- entriesQuery.addLoad(Entry.PROPERTY_ACCOUNT, Entry.PROPERTY_FINANCIAL_TRANSACTION, Entry.PROPERTY_LETTER)
- .addLoad(loadEntryBookProperty);
+ entriesQuery.addLoad(loadEntryBookProperty);
reportsDatas.setListEntry(entryDAO.findAllByQuery(entriesQuery));
TopiaQuery amountsQuery =
@@ -377,8 +376,6 @@
EntryDAO entryDAO = LimaCallaoDAOHelper.getEntryDAO(topiaTransaction);
TopiaQuery entriesQuery = createEntryBookReportsQuery(
entryBook, beginDate, endDate, entryDAO, "E");
- //IMPORTANT : LOADING ENTRIES AND IS COLUMN FOR NO LAZY EXCEPTION
- entriesQuery.addLoad(Entry.PROPERTY_ACCOUNT, Entry.PROPERTY_FINANCIAL_TRANSACTION, Entry.PROPERTY_LETTER);
String orderDateProperty =
TopiaQuery.getProperty("E", Entry.PROPERTY_FINANCIAL_TRANSACTION, FinancialTransaction.PROPERTY_TRANSACTION_DATE);
String orderIdProperty =
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/migration/MigrationV0_6.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/migration/MigrationV0_6.java 2012-04-12 14:24:21 UTC (rev 3364)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/migration/MigrationV0_6.java 2012-04-12 16:37:45 UTC (rev 3365)
@@ -63,11 +63,18 @@
// delete computed fields
queries.add("Alter table FINANCIALTRANSACTION drop column AMOUNTDEBIT");
queries.add("Alter table FINANCIALTRANSACTION drop column AMOUNTCREDIT");
-
+
// modele refactoring
queries.add("drop table record");
+
queries.add("alter table account drop column masteraccount");
queries.add("alter table account drop column generalledger");
+
+ queries.add("alter table entry add column lettering varchar(30)");
+ queries.add("update entry e set lettering = (select l.code from Letter l where l.topiaid = e.letter)");
+ queries.add("alter table entry drop column letter");
+ queries.add("drop table letter");
+
+ queries.add("alter table vatstatement drop column amount");
}
-
}
Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialTransactionService.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialTransactionService.java 2012-04-12 14:24:21 UTC (rev 3364)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialTransactionService.java 2012-04-12 16:37:45 UTC (rev 3365)
@@ -32,7 +32,6 @@
import org.chorem.lima.entity.FinancialPeriod;
import org.chorem.lima.entity.FinancialTransaction;
import org.chorem.lima.entity.FiscalPeriod;
-import org.chorem.lima.entity.Letter;
import java.util.Date;
import java.util.List;
@@ -75,17 +74,4 @@
void updateEntry(Entry entry) throws LimaException;
void removeEntry(Entry entry) throws LimaException;
-
- Letter getNewLetter() throws LimaException;
-
- void createLetter(Letter letter) throws LimaException;
-
- void removeLetter(Letter letter) throws LimaException;
-
- List<Letter> getAllLetters() throws LimaException;
-
- void setEntryLetter(Entry entry, Letter letter) throws LimaException;
-
- void removeEntryLetter(Entry entry) throws LimaException;
-
}
Modified: trunk/lima-callao/src/main/xmi/accounting.zargo
===================================================================
(Binary files differ)
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/LimaDecoratorProvider.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/LimaDecoratorProvider.java 2012-04-12 14:24:21 UTC (rev 3364)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/LimaDecoratorProvider.java 2012-04-12 16:37:45 UTC (rev 3365)
@@ -27,7 +27,6 @@
import org.chorem.lima.entity.EntryBook;
import org.chorem.lima.entity.FinancialPeriod;
import org.chorem.lima.entity.FiscalPeriod;
-import org.chorem.lima.entity.Letter;
import org.nuiton.util.decorator.DecoratorProvider;
/**
@@ -43,8 +42,6 @@
registerJXPathDecorator(EntryBook.class, "${code}$s - ${label}$s");
- registerJXPathDecorator(Letter.class, "${code}$s");
-
registerJXPathDecorator(
FiscalPeriod.class,
"${beginDate}$td/%1$tm/%1$tY - ${endDate}$td/%1$tm/%1$tY");
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsTableModel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsTableModel.java 2012-04-12 14:24:21 UTC (rev 3364)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsTableModel.java 2012-04-12 16:37:45 UTC (rev 3365)
@@ -30,7 +30,6 @@
import org.chorem.lima.beans.ReportsDatas;
import org.chorem.lima.entity.Account;
import org.chorem.lima.entity.Entry;
-import org.chorem.lima.entity.Letter;
import javax.swing.table.AbstractTableModel;
import java.math.BigDecimal;
@@ -96,7 +95,7 @@
result = String.class;
break;
case 5:
- result = Letter.class;
+ result = String.class;
break;
case 6:
result = BigDecimal.class;
@@ -172,11 +171,7 @@
result = currentRow.getDescription();
break;
case 5:
- if (currentRow.getLetter() != null) {
- result = currentRow.getLetter().getCode();
- } else {
- result = null;
- }
+ result = currentRow.getLettering();
break;
case 6:
result = currentRow.getDebit() ? currentRow.getAmount() : BigDecimal.ZERO;
Deleted: trunk/lima-swing/src/main/java/org/chorem/lima/ui/celleditor/LetterTableCellEditor.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/celleditor/LetterTableCellEditor.java 2012-04-12 14:24:21 UTC (rev 3364)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/celleditor/LetterTableCellEditor.java 2012-04-12 16:37:45 UTC (rev 3365)
@@ -1,153 +0,0 @@
-/*
- * #%L
- * Lima Swing
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2008 - 2010 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-package org.chorem.lima.ui.celleditor;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.chorem.lima.entity.Account;
-import org.chorem.lima.entity.Letter;
-import org.chorem.lima.ui.LimaRendererUtil;
-import org.chorem.lima.ui.combobox.LetterComboBoxModel;
-import org.chorem.lima.util.LetterToString;
-import org.chorem.lima.widgets.JWideComboBox;
-import org.jdesktop.swingx.autocomplete.AutoCompleteDecorator;
-
-import javax.swing.AbstractCellEditor;
-import javax.swing.JTable;
-import javax.swing.ListCellRenderer;
-import javax.swing.SwingUtilities;
-import javax.swing.table.TableCellEditor;
-import javax.swing.text.JTextComponent;
-import java.awt.Component;
-import java.awt.event.KeyEvent;
-import java.awt.event.KeyListener;
-import java.awt.event.MouseEvent;
-import java.util.EventObject;
-
-public class LetterTableCellEditor extends AbstractCellEditor implements TableCellEditor, KeyListener {
-
- protected static final Log log = LogFactory.getLog(EntryBookTableCellEditor.class);
-
- private static final long serialVersionUID = 1L;
-
- private final JWideComboBox comboBox;
-// private static LetterTableCellEditor editor;
-
- private static boolean keyPressed;
-
- /** constructor */
- public LetterTableCellEditor() {
- comboBox = new JWideComboBox();
- LetterComboBoxModel comboBoxModel = new LetterComboBoxModel();
- comboBox.setModel(comboBoxModel);
- ListCellRenderer renderer =
- LimaRendererUtil.newDecoratorListCellRenderer(Letter.class);
- comboBox.setRenderer(renderer);
- AutoCompleteDecorator.decorate(comboBox, LetterToString.getInstance());
- comboBox.getEditor().getEditorComponent().addKeyListener(this);
- }
-
- @Override
- public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) {
- if (value instanceof Account) {
- comboBox.setSelectedItem(value);
- }
- return comboBox;
- }
-
- @Override
- public Object getCellEditorValue() {
- return comboBox.getSelectedItem();
- }
-
- /**
- * Vérifie si la cellule peut être éditable :
- * seulement si il y a une frappe au clavier ou un double clic.
- *
- * @param evt
- * @return
- */
- @Override
- public boolean isCellEditable(EventObject evt) {
- // Si il y a une frappe au clavier
- if (evt instanceof KeyEvent) {
- final KeyEvent keyEvent = (KeyEvent) evt;
- // Empèche la touche echap
- if (keyEvent.getKeyChar() != KeyEvent.VK_ESCAPE) {
- // Permet de placer le focus sur l'editor de la comboBox
- SwingUtilities.invokeLater(new Runnable() {
- @Override
- public void run() {
- comboBox.getEditor().getEditorComponent().requestFocus();
- JTextComponent edit = (JTextComponent) comboBox.getEditor().getEditorComponent();
- if (!Character.isIdentifierIgnorable(keyEvent.getKeyChar())) {
- edit.setText(Character.toString(keyEvent.getKeyChar()));
- }
- }
- });
- }
- }
- keyPressed = false;
- return !(evt instanceof MouseEvent) || ((MouseEvent) evt).getClickCount() == 2;
- }
-
-
- @Override
- public void keyPressed(KeyEvent e) {
-
- }
-
- @Override
- public void keyReleased(KeyEvent e) {
-
- // Vérifie si c'est la première frappe au clavier
- if (!keyPressed) {
- // Récupère l'editor de la comboBox
- JTextComponent edit = (JTextComponent) comboBox.getEditor().getEditorComponent();
- // Met en place le curseur et la selection après la première lettre
- edit.select(1, edit.getText().length());
- keyPressed = true;
- }
-
- // delegate popup list menu
- if (e.getKeyChar() == KeyEvent.VK_ENTER) {
- fireEditingStopped();
- }
- }
-
- @Override
- public void keyTyped(KeyEvent e) {
-
- }
-
-// public static LetterTableCellEditor getInstance() {
-// if (editor == null) {
-// editor = new LetterTableCellEditor();
-// }
-// return editor;
-// }
-
-}
Deleted: trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/LetterComboBoxModel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/LetterComboBoxModel.java 2012-04-12 14:24:21 UTC (rev 3364)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/LetterComboBoxModel.java 2012-04-12 16:37:45 UTC (rev 3365)
@@ -1,115 +0,0 @@
-/*
- * #%L
- * Lima Swing
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2008 - 2012 CodeLutin, Chatellier Eric
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-package org.chorem.lima.ui.combobox;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.chorem.lima.business.LimaException;
-import org.chorem.lima.business.ServiceListener;
-import org.chorem.lima.business.api.FinancialTransactionService;
-import org.chorem.lima.business.monitorable.FinancialTransactionServiceMonitorable;
-import org.chorem.lima.business.monitorable.ImportServiceMonitorable;
-import org.chorem.lima.entity.Letter;
-import org.chorem.lima.service.LimaServiceFactory;
-import org.chorem.lima.ui.financialperiod.FinancialPeriodTableModel;
-
-import javax.swing.AbstractListModel;
-import javax.swing.ComboBoxModel;
-import java.util.List;
-
-/** Account combo box model. */
-
-public class LetterComboBoxModel extends AbstractListModel implements ComboBoxModel, ServiceListener {
-
- private static final long serialVersionUID = 1L;
-
- private static final Log log =
- LogFactory.getLog(FinancialPeriodTableModel.class);
-
- protected Object selectedAccount;
-
- protected List<Letter> datasCache;
-
- protected FinancialTransactionService service;
-
- public LetterComboBoxModel() {
- service =
- LimaServiceFactory.getService(
- FinancialTransactionServiceMonitorable.class);
- LimaServiceFactory.addServiceListener(service, this);
- LimaServiceFactory.addServiceListener(ImportServiceMonitorable.class, this);
- datasCache = getDataList();
- }
-
- @Override
- public Object getSelectedItem() {
- return selectedAccount;
- }
-
- @Override
- public void setSelectedItem(Object anItem) {
- selectedAccount = anItem;
- fireContentsChanged(this, -1, -1);
- }
-
-
- @Override
- public Object getElementAt(int index) {
- return datasCache.get(index);
- }
-
- @Override
- public int getSize() {
- return datasCache.size();
- }
-
- public List<Letter> getDataList() {
- List<Letter> result = null;
- try {
- result = service.getAllLetters();
- } catch (LimaException eee) {
- if (log.isDebugEnabled()) {
- log.debug("Can't get list letters", eee);
- }
- }
- return result;
-
- }
-
- public void refresh() {
- datasCache = getDataList();
- fireContentsChanged(this, 0, datasCache.size());
- }
-
- @Override
- public void notifyMethod(String serviceName, String methodeName) {
- if (methodeName.contains("Letter") || methodeName.contains("importAll")) {
- refresh();
- }
- }
-
-
-}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsTableModel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsTableModel.java 2012-04-12 14:24:21 UTC (rev 3364)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsTableModel.java 2012-04-12 16:37:45 UTC (rev 3365)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2008 - 2010 CodeLutin
+ * Copyright (C) 2008 - 2012 CodeLutin, Chatellier Eric
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
@@ -30,7 +30,6 @@
import org.chorem.lima.beans.ReportsDatas;
import org.chorem.lima.entity.Account;
import org.chorem.lima.entity.Entry;
-import org.chorem.lima.entity.Letter;
import javax.swing.table.AbstractTableModel;
import java.math.BigDecimal;
@@ -91,7 +90,7 @@
result = String.class;
break;
case 4:
- result = Letter.class;
+ result = String.class;
break;
case 5:
result = BigDecimal.class;
@@ -160,11 +159,7 @@
result = currentRow.getDescription();
break;
case 4:
- if (currentRow.getLetter() != null) {
- result = currentRow.getLetter().getCode();
- } else {
- result = null;
- }
+ result = currentRow.getLettering();
break;
case 5:
result = currentRow.getDebit() ? currentRow.getAmount() : BigDecimal.ZERO;
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 2012-04-12 14:24:21 UTC (rev 3364)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTableModel.java 2012-04-12 16:37:45 UTC (rev 3365)
@@ -42,7 +42,6 @@
import org.chorem.lima.entity.FinancialPeriod;
import org.chorem.lima.entity.FinancialTransaction;
import org.chorem.lima.entity.FinancialTransactionImpl;
-import org.chorem.lima.entity.Letter;
import org.chorem.lima.service.LimaServiceFactory;
import org.chorem.lima.util.ErrorHelper;
@@ -166,7 +165,7 @@
result = String.class;
break;
case 5:
- result = Letter.class;
+ result = String.class;
break;
case 6:
result = BigDecimal.class;
@@ -299,11 +298,7 @@
result = currentEntry.getDescription();
break;
case 5:
- if (currentEntry.getLetter() != null) {
- result = currentEntry.getLetter().getCode();
- } else {
- result = null;
- }
+ result = currentEntry.getLettering();
break;
case 6:
result = currentEntry.getDebit() ? currentEntry.getAmount() : BigDecimal.ZERO;
@@ -619,7 +614,7 @@
}
break;
case 5:
- currentEntry.setLetter((Letter) value);
+ currentEntry.setLettering((String) value);
break;
case 6:
currentEntry.setAmount((BigDecimal) value);
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 2012-04-12 14:24:21 UTC (rev 3364)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchTableModel.java 2012-04-12 16:37:45 UTC (rev 3365)
@@ -44,7 +44,6 @@
import org.chorem.lima.entity.FinancialTransaction;
import org.chorem.lima.entity.FinancialTransactionImpl;
import org.chorem.lima.entity.FiscalPeriod;
-import org.chorem.lima.entity.Letter;
import org.chorem.lima.service.LimaServiceFactory;
import org.chorem.lima.util.DialogHelper;
import org.chorem.lima.util.ErrorHelper;
@@ -118,7 +117,7 @@
List<Object> results = null;
//prevent to much result
if (financialTransactionSearch != null && (financialTransactionSearch.getVoucher() != null || financialTransactionSearch.getDescription() != null
- || financialTransactionSearch.getLetter() != null || financialTransactionSearch.getAccountList() != null
+ || financialTransactionSearch.getLettering() != null || financialTransactionSearch.getAccountList() != null
|| financialTransactionSearch.getAccount() != null || financialTransactionSearch.getEntryBook() != null
|| financialTransactionSearch.getAmount() != null && financialTransactionSearch.getOperator() != null
|| financialTransactionSearch.getAmount() != null && financialTransactionSearch.getAmount2() != null)) {
@@ -171,7 +170,7 @@
result = String.class; //Description
break;
case 5:
- result = Letter.class; //Letter
+ result = String.class; //Letter
break;
case 6:
result = BigDecimal.class; //Debit
@@ -308,11 +307,7 @@
result = currentEntry.getDescription(); //Description
break;
case 5:
- if (currentEntry.getLetter() != null) {
- result = currentEntry.getLetter().getCode();
- } else {
- result = null;
- }
+ result = currentEntry.getLettering();
break;
case 6: //Debit
result = currentEntry.getDebit() ? currentEntry.getAmount() : BigDecimal.ZERO;
@@ -496,7 +491,7 @@
currentEntry.setDebit(false);
break;
case 8:
- currentEntry.setLetter((Letter) value);
+ currentEntry.setLettering((String) value);
break;
}
try {
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 2012-04-12 14:24:21 UTC (rev 3364)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchViewHandler.java 2012-04-12 16:37:45 UTC (rev 3365)
@@ -37,7 +37,6 @@
import org.chorem.lima.entity.Entry;
import org.chorem.lima.entity.EntryBook;
import org.chorem.lima.entity.FinancialTransaction;
-import org.chorem.lima.entity.Letter;
import org.chorem.lima.service.LimaServiceFactory;
import org.chorem.lima.ui.combobox.FiscalPeriodComboBoxModel;
import org.chorem.lima.util.DialogHelper;
@@ -116,8 +115,8 @@
financialTransactionSearch.setDescription(result);
}
- public void setLetter(Letter letter) {
- financialTransactionSearch.setLetter(letter);
+ public void setLetter(String lettering) {
+ financialTransactionSearch.setLettering(lettering);
}
public String getAccountsList() {
Deleted: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/LetterSearchComboBox.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/LetterSearchComboBox.java 2012-04-12 14:24:21 UTC (rev 3364)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/LetterSearchComboBox.java 2012-04-12 16:37:45 UTC (rev 3365)
@@ -1,95 +0,0 @@
-/*
- * #%L
- * Lima Swing
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2008 - 2010 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-package org.chorem.lima.ui.financialtransactionsearch;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.chorem.lima.entity.Letter;
-import org.chorem.lima.ui.LimaRendererUtil;
-import org.chorem.lima.ui.combobox.LetterComboBoxModel;
-import org.chorem.lima.util.LetterToString;
-import org.jdesktop.swingx.autocomplete.AutoCompleteDecorator;
-
-import javax.swing.JComboBox;
-import javax.swing.ListCellRenderer;
-import java.awt.event.ActionEvent;
-import java.awt.event.KeyEvent;
-import java.awt.event.KeyListener;
-
-public class LetterSearchComboBox extends JComboBox implements KeyListener {
-
- private static final long serialVersionUID = 1L;
-
- private static final Log log =
- LogFactory.getLog(LetterSearchComboBox.class);
-
- protected FinancialTransactionSearchViewHandler handler;
-
- public LetterSearchComboBox(FinancialTransactionSearchViewHandler handler) {
- this.handler = handler;
- LetterComboBoxModel letterComboBoxModel = new LetterComboBoxModel();
- ListCellRenderer renderer =
- LimaRendererUtil.newDecoratorListCellRenderer(Letter.class);
- setModel(letterComboBoxModel);
- setRenderer(renderer);
- setEditable(true);
- AutoCompleteDecorator.decorate(this, LetterToString.getInstance());
- getEditor().getEditorComponent().addKeyListener(this);
- addActionListener(this);
- }
-
- @Override
- public void actionPerformed(ActionEvent e) {
- Object object = getSelectedItem();
- if (object instanceof Letter) {
- handler.setLetter((Letter) getSelectedItem());
- }
- }
-
-
- @Override
- public void keyPressed(KeyEvent e) {
-
- }
-
- @Override
- public void keyReleased(KeyEvent e) {
- Object object = getSelectedItem();
- if (object instanceof Letter) {
- handler.setLetter((Letter) getSelectedItem());
- }
- // delegate popup list menu
- if (e.getKeyChar() == KeyEvent.VK_ENTER) {
- firePopupMenuCanceled();
- }
- }
-
- @Override
- public void keyTyped(KeyEvent e) {
-
- }
-
-}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/LetterSearchPanel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/LetterSearchPanel.java 2012-04-12 14:24:21 UTC (rev 3364)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/LetterSearchPanel.java 2012-04-12 16:37:45 UTC (rev 3365)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2008 - 2010 CodeLutin
+ * Copyright (C) 2008 - 2012 CodeLutin, Chatellier Eric
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
@@ -31,6 +31,9 @@
public class LetterSearchPanel extends JPanel {
+ /** serialVersionUID. */
+ private static final long serialVersionUID = 7682668138031148237L;
+
protected FinancialTransactionSearchViewHandler handler;
public LetterSearchPanel(FinancialTransactionSearchViewHandler handler) {
@@ -47,9 +50,9 @@
break;
case SELECT_ONE:
- LetterSearchComboBox comboBox = new LetterSearchComboBox(handler);
+ /*LetterSearchComboBox comboBox = new LetterSearchComboBox(handler);
removeAll();
- add(comboBox);
+ add(comboBox);*/
break;
}
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 2012-04-12 14:24:21 UTC (rev 3364)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedTableModel.java 2012-04-12 16:37:45 UTC (rev 3365)
@@ -38,7 +38,6 @@
import org.chorem.lima.entity.EntryImpl;
import org.chorem.lima.entity.FinancialTransaction;
import org.chorem.lima.entity.FiscalPeriod;
-import org.chorem.lima.entity.Letter;
import org.chorem.lima.service.LimaServiceFactory;
import org.chorem.lima.util.DialogHelper;
import org.chorem.lima.util.ErrorHelper;
@@ -169,7 +168,7 @@
result = BigDecimal.class;
break;
case 8:
- result = Letter.class;
+ result = String.class;
break;
}
@@ -303,11 +302,7 @@
result = null;
break;
case 8:
- if (currentEntry.getLetter() != null) {
- result = currentEntry.getLetter().getCode();
- } else {
- result = null;
- }
+ result = currentEntry.getLettering();
break;
}
@@ -426,7 +421,7 @@
currentEntry.setDebit(false);
break;
case 8:
- currentEntry.setLetter((Letter) value);
+ currentEntry.setLettering((String) value);
break;
}
try {
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/AddLetterForm.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/AddLetterForm.jaxx 2012-04-12 14:24:21 UTC (rev 3364)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/AddLetterForm.jaxx 2012-04-12 16:37:45 UTC (rev 3365)
@@ -66,7 +66,7 @@
</cell>
<cell>
<JComboBox id='LetterListComboBox' visible="{listLetter.isSelected()}"
- javaBean="new LetterComboBox()"/>
+ javaBean="new JComboBox()"/>
</cell>
</row>
<row>
Deleted: trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetterComboBox.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetterComboBox.java 2012-04-12 14:24:21 UTC (rev 3364)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetterComboBox.java 2012-04-12 16:37:45 UTC (rev 3365)
@@ -1,58 +0,0 @@
-/*
- * #%L
- * Lima Swing
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2008 - 2010 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-package org.chorem.lima.ui.lettering;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.chorem.lima.entity.Letter;
-import org.chorem.lima.ui.LimaRendererUtil;
-import org.chorem.lima.ui.combobox.LetterComboBoxModel;
-import org.chorem.lima.util.LetterToString;
-import org.jdesktop.swingx.autocomplete.AutoCompleteDecorator;
-
-import javax.swing.JComboBox;
-import javax.swing.ListCellRenderer;
-
-public class LetterComboBox extends JComboBox {
-
- private static final long serialVersionUID = 1L;
-
- private static final Log log =
- LogFactory.getLog(LetterComboBox.class);
-
-
- public LetterComboBox() {
-
- LetterComboBoxModel letterComboBoxModel = new LetterComboBoxModel();
- ListCellRenderer renderer =
- LimaRendererUtil.newDecoratorListCellRenderer(Letter.class);
- setModel(letterComboBoxModel);
- setRenderer(renderer);
- setEditable(true);
- AutoCompleteDecorator.decorate(this, LetterToString.getInstance());
- }
-
-}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringTable.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringTable.java 2012-04-12 14:24:21 UTC (rev 3364)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringTable.java 2012-04-12 16:37:45 UTC (rev 3365)
@@ -29,13 +29,11 @@
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.entity.Account;
import org.chorem.lima.entity.EntryBook;
-import org.chorem.lima.entity.Letter;
import org.chorem.lima.ui.celleditor.AccountTableCellEditor;
import org.chorem.lima.ui.celleditor.BigDecimalTableCellEditor;
import org.chorem.lima.ui.celleditor.BigDecimalTableCellRenderer;
import org.chorem.lima.ui.celleditor.DateTableCellEditor;
import org.chorem.lima.ui.celleditor.EntryBookTableCellEditor;
-import org.chorem.lima.ui.celleditor.LetterTableCellEditor;
import org.jdesktop.swingx.JXTable;
import org.jdesktop.swingx.decorator.ColorHighlighter;
import org.jdesktop.swingx.decorator.ComponentAdapter;
@@ -86,8 +84,7 @@
setDefaultEditor(EntryBook.class, new EntryBookTableCellEditor());
//Get new account editor
setDefaultEditor(Account.class, new AccountTableCellEditor());
- //Get new letter editor
- setDefaultEditor(Letter.class, new LetterTableCellEditor());
+
//Get new amount editor
setDefaultEditor(BigDecimal.class, new BigDecimalTableCellEditor());
//Get new BigDecimal renderer
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringTableModel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringTableModel.java 2012-04-12 14:24:21 UTC (rev 3364)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringTableModel.java 2012-04-12 16:37:45 UTC (rev 3365)
@@ -37,7 +37,6 @@
import org.chorem.lima.entity.Entry;
import org.chorem.lima.entity.EntryBook;
import org.chorem.lima.entity.FinancialTransaction;
-import org.chorem.lima.entity.Letter;
import org.chorem.lima.service.LimaServiceFactory;
import org.chorem.lima.util.DialogHelper;
import org.chorem.lima.util.ErrorHelper;
@@ -142,7 +141,7 @@
return results;
}
- public void setLetter(int row, Letter letter) {
+ /*public void setLetter(int row, Letter letter) {
Object currentRow = cacheDataList.get(row);
if (currentRow instanceof Entry) {
Entry entry = (Entry) currentRow;
@@ -163,10 +162,10 @@
f.dispose();
}
}
- }
+ }*/
public void removeLetter(int row) {
- try {
+ /*try {
Object currentRow = cacheDataList.get(row);
if (currentRow instanceof Entry) {
Entry entry = (Entry) currentRow;
@@ -174,7 +173,7 @@
}
} catch (LimaException eee) {
log.error("Can't remove letter", eee);
- }
+ }*/
}
public void refresh() {
@@ -209,7 +208,7 @@
result = String.class;
break;
case 5:
- result = Letter.class;
+ result = String.class;
break;
case 6:
result = BigDecimal.class;
@@ -343,11 +342,7 @@
result = currentEntry.getDescription();
break;
case 5:
- if (currentEntry.getLetter() != null) {
- result = currentEntry.getLetter().getCode();
- } else {
- result = null;
- }
+ result = currentEntry.getLettering();
break;
case 6:
result = currentEntry.getDebit() ? currentEntry.getAmount() : BigDecimal.ZERO;
@@ -400,7 +395,7 @@
Entry currentEntry = (Entry) currentRow;
switch (column) {
case 5:
- currentEntry.setLetter((Letter) value);
+ currentEntry.setLettering((String) value);
break;
}
try {
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringViewHandler.java 2012-04-12 14:24:21 UTC (rev 3364)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringViewHandler.java 2012-04-12 16:37:45 UTC (rev 3365)
@@ -29,7 +29,6 @@
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.business.LimaException;
import org.chorem.lima.business.monitorable.FinancialTransactionServiceMonitorable;
-import org.chorem.lima.entity.Letter;
import org.chorem.lima.service.LimaServiceFactory;
import org.chorem.lima.ui.combobox.FinancialPeriodComboBoxModel;
import org.chorem.lima.ui.combobox.FiscalPeriodComboBoxModel;
@@ -92,8 +91,7 @@
}
public void addLetter() {
- Letter letter = null;
- Boolean valid = true;
+ /*Boolean valid = true;
table = view.getTable();
tableModel = view.getTableModel();
@@ -132,7 +130,7 @@
}
tableModel.refresh();
}
- }
+ }*/
}
public void removeLetter() {
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatchart/VatChartViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatchart/VatChartViewHandler.java 2012-04-12 14:24:21 UTC (rev 3364)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatchart/VatChartViewHandler.java 2012-04-12 16:37:45 UTC (rev 3365)
@@ -93,7 +93,7 @@
// null == cancel action
if (newVatChartMovement != null) {
- newVatChartMovement.setAmount(BigDecimal.ZERO);
+
// add it
try {
treeTableModel.addVatStatement(treePath, newVatChartMovement);
Deleted: trunk/lima-swing/src/main/java/org/chorem/lima/util/LetterToString.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/util/LetterToString.java 2012-04-12 14:24:21 UTC (rev 3364)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/util/LetterToString.java 2012-04-12 16:37:45 UTC (rev 3365)
@@ -1,65 +0,0 @@
-/*
- * #%L
- * Lima Swing
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2008 - 2010 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-package org.chorem.lima.util;
-
-import org.chorem.lima.LimaContext;
-import org.chorem.lima.entity.Letter;
-import org.jdesktop.swingx.autocomplete.ObjectToStringConverter;
-import org.nuiton.util.decorator.Decorator;
-import org.nuiton.util.decorator.DecoratorProvider;
-
-public class LetterToString extends ObjectToStringConverter {
-
- private static LetterToString converter;
-
- protected Decorator<Letter> decorator;
-
- public LetterToString() {
-
- DecoratorProvider provider = LimaContext.get().getDecoratorProvider();
- decorator = provider.getDecoratorByType(Letter.class);
- }
-
- @Override
- public String getPreferredStringForItem(Object item) {
- String result = null;
- if (item != null) {
- if (item instanceof Letter) {
- Letter letter = (Letter) item;
- result = decorator.toString(letter);
- }
- }
- return result;
- }
-
- public static LetterToString getInstance() {
- if (converter == null) {
- converter = new LetterToString();
- }
- return converter;
- }
-
-}
1
0
Author: echatellier
Date: 2012-04-12 16:24:21 +0200 (Thu, 12 Apr 2012)
New Revision: 3364
Url: http://chorem.org/repositories/revision/lima/3364
Log:
svn:ignore
Modified:
trunk/lima-business-api/
Property changes on: trunk/lima-business-api
___________________________________________________________________
Modified: svn:ignore
- target
.idea
.classpath
.project
.settigns
*.ipr
*.iws
*.iml
+ target
.idea
.classpath
.project
.settigns
*.ipr
*.iws
*.iml
.settings
1
0
r3363 - in trunk: lima-business/src/main/java/org/chorem/lima/business/ejb lima-swing/src/main/java/org/chorem/lima/ui lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod
by echatellier@users.chorem.org April 12, 2012
by echatellier@users.chorem.org April 12, 2012
April 12, 2012
Author: echatellier
Date: 2012-04-12 16:23:46 +0200 (Thu, 12 Apr 2012)
New Revision: 3363
Url: http://chorem.org/repositories/revision/lima/3363
Log:
Misc code style update
Removed:
trunk/lima-swing/src/main/java/org/chorem/lima/ui/LimaModelUtil.java
Modified:
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/HttpServerServiceImpl.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/ClosableTabHeader.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainViewHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/FiscalPeriodViewHandler.java
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 2012-04-12 14:23:28 UTC (rev 3362)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/HttpServerServiceImpl.java 2012-04-12 14:23:46 UTC (rev 3363)
@@ -86,7 +86,6 @@
@Override
public void start() {
if (server == null) {
-
try {
FileUtil.createDirectoryIfNecessary(new File(path));
@@ -98,7 +97,9 @@
server.setHandler(context);
server.start();
- log.info("Web server are running on port: " + port);
+ if (log.isInfoEnabled()) {
+ log.info("Web server are running on port: " + port);
+ }
} catch (Exception eee) {
log.error("error while booting http server", eee);
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/ClosableTabHeader.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/ClosableTabHeader.jaxx 2012-04-12 14:23:28 UTC (rev 3362)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/ClosableTabHeader.jaxx 2012-04-12 14:23:46 UTC (rev 3363)
@@ -5,7 +5,7 @@
$Id$
$HeadURL$
%%
- Copyright (C) 2008 - 2010 CodeLutin
+ Copyright (C) 2008 - 2012 CodeLutin, Chatellier Eric
%%
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as
Deleted: trunk/lima-swing/src/main/java/org/chorem/lima/ui/LimaModelUtil.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/LimaModelUtil.java 2012-04-12 14:23:28 UTC (rev 3362)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/LimaModelUtil.java 2012-04-12 14:23:46 UTC (rev 3363)
@@ -1,36 +0,0 @@
-/*
- * #%L
- * Lima :: Swing
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2008 - 2011 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-package org.chorem.lima.ui;
-
-/**
- * Util to create ui models.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.5.2
- */
-public class LimaModelUtil {
-
-
-}
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 2012-04-12 14:23:28 UTC (rev 3362)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainViewHandler.java 2012-04-12 14:23:46 UTC (rev 3363)
@@ -56,7 +56,6 @@
import org.chorem.lima.ui.vatchart.VatChartView;
import org.chorem.lima.ui.vatreports.VatReportView;
import org.chorem.lima.util.ErrorHelper;
-import org.nuiton.profiling.NuitonTrace;
import org.nuiton.util.DesktopUtil;
import javax.swing.JButton;
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/FiscalPeriodViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/FiscalPeriodViewHandler.java 2012-04-12 14:23:28 UTC (rev 3362)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/FiscalPeriodViewHandler.java 2012-04-12 14:23:46 UTC (rev 3363)
@@ -122,15 +122,14 @@
//check if fiscalperiod have 12 months, ask a confirmation
int nbMonth = DateUtil.getDifferenceInMonths(fiscalPeriod.getBeginDate(),
fiscalPeriod.getEndDate());
- int response = JOptionPane.NO_OPTION;
+ int response = JOptionPane.YES_OPTION;
if (nbMonth != 12) {
response = JOptionPane.showConfirmDialog(view,
_("lima.ui.fiscalperiod.addfiscalperiod.morethan12"),
_("lima.ui.fiscalperiod.addfiscalperiodtitle"),
JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);
}
- // FIXME echatellier 20120405 je ne comprend pas le "|| nbMonth == 11"
- if (response == JOptionPane.YES_OPTION || nbMonth == 11) {
+ if (response == JOptionPane.YES_OPTION) {
try {
fiscalPeriod = fiscalPeriodService.createFiscalPeriod(fiscalPeriod);
model.addFiscalPeriod(fiscalPeriod);
1
0
r3362 - in trunk: lima-business/src/main/java/org/chorem/lima/business/ejb lima-callao/src/main/xmi
by echatellier@users.chorem.org April 12, 2012
by echatellier@users.chorem.org April 12, 2012
April 12, 2012
Author: echatellier
Date: 2012-04-12 16:23:28 +0200 (Thu, 12 Apr 2012)
New Revision: 3362
Url: http://chorem.org/repositories/revision/lima/3362
Log:
Remove FinancialPeriod to FinancialTransaction visibility
Modified:
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java
trunk/lima-callao/src/main/xmi/accounting.zargo
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 2012-04-12 13:37:36 UTC (rev 3361)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java 2012-04-12 14:23:28 UTC (rev 3362)
@@ -1343,7 +1343,7 @@
.findByDate(dateFinancialTransaction);
financialTransactionDAO.create(financialTransaction);
- financialPeriod.addFinancialTransaction(financialTransaction);
+ financialTransaction.setFinancialPeriod(financialPeriod);
List<EntryImport> entryImports = entries.get(map.getKey());
for (EntryImport entryImport : entryImports) {
Modified: trunk/lima-callao/src/main/xmi/accounting.zargo
===================================================================
(Binary files differ)
1
0
r3361 - trunk/lima-swing/src/main/java/org/chorem/lima/ui
by echatellier@users.chorem.org April 12, 2012
by echatellier@users.chorem.org April 12, 2012
April 12, 2012
Author: echatellier
Date: 2012-04-12 15:37:36 +0200 (Thu, 12 Apr 2012)
New Revision: 3361
Url: http://chorem.org/repositories/revision/lima/3361
Log:
New killer feature : beta version layer
Added:
trunk/lima-swing/src/main/java/org/chorem/lima/ui/BetaLayerUI.java
Modified:
trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainView.jaxx
Added: trunk/lima-swing/src/main/java/org/chorem/lima/ui/BetaLayerUI.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/BetaLayerUI.java (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/BetaLayerUI.java 2012-04-12 13:37:36 UTC (rev 3361)
@@ -0,0 +1,76 @@
+/*
+ * #%L
+ *
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2012 Codelutin, Chatellier Eric
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
+package org.chorem.lima.ui;
+
+import java.awt.Color;
+import java.awt.Font;
+import java.awt.Graphics2D;
+
+import javax.swing.JComponent;
+
+import org.jdesktop.jxlayer.JXLayer;
+import org.jdesktop.jxlayer.plaf.AbstractLayerUI;
+
+/**
+ * Layer qui affiche "beta version".
+ *
+ * @author chatellier
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author$
+ */
+public class BetaLayerUI extends AbstractLayerUI<JComponent> {
+
+ /** serialVersionUID. */
+ private static final long serialVersionUID = 309245880711380974L;
+
+ @Override
+ protected void paintLayer(Graphics2D g2, JXLayer<? extends JComponent> l) {
+ super.paintLayer(g2, l);
+
+ // position
+ //g2.translate(-35, 90); // top left
+ g2.translate(l.getBounds().getMaxX() - 140, l.getBounds().getMaxY()); // bottom right
+
+ // yellow backgroung
+ g2.rotate(Math.PI * -42 / 180);
+ g2.setColor(Color.YELLOW);
+ g2.fillRect(10, 10, 170, 30);
+
+ // text
+ g2.translate(30, 15);
+ g2.setFont(new Font("Dialog", Font.BOLD, 16));
+ g2.setColor(Color.BLACK);
+ g2.drawString("Beta version",10,10);
+
+ // for test only
+ g2.translate(15, 10);
+ g2.setFont(new Font("Dialog", Font.ITALIC, 10));
+ g2.setColor(Color.BLACK);
+ g2.drawString("(for test only)",10,10);
+ }
+}
Property changes on: trunk/lima-swing/src/main/java/org/chorem/lima/ui/BetaLayerUI.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
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 2012-04-11 16:14:23 UTC (rev 3360)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainView.jaxx 2012-04-12 13:37:36 UTC (rev 3361)
@@ -41,6 +41,10 @@
<script><![CDATA[
+ void $afterCompleteSetup() {
+ SwingUtil.getLayer(mainPanel).setUI(betaLayer);
+ }
+
public LimaConfig getConfig() {
return LimaContext.CONFIG_DEF.getContextValue(getDelegateContext());
}
@@ -220,7 +224,8 @@
</JMenu>
</JMenu>
</JMenuBar>
- <JPanel layout='{new BorderLayout()}'>
+ <BetaLayerUI id="betaLayer" />
+ <JPanel id="mainPanel" layout='{new BorderLayout()}' decorator="boxed">
<JTabbedPane id="contentTabbedPane" constraints="BorderLayout.CENTER"/>
</JPanel>
1
0
April 11, 2012
Author: athimel
Date: 2012-04-11 18:14:23 +0200 (Wed, 11 Apr 2012)
New Revision: 3360
Url: http://chorem.org/repositories/revision/lima/3360
Log:
Remove lima-business-api dependency to javaee-api
Modified:
trunk/lima-business-api/LICENSE.txt
trunk/lima-business-api/README.txt
trunk/lima-business-api/changelog.txt
trunk/lima-business-api/pom.xml
trunk/lima-business-api/src/main/java/org/chorem/lima/business/LimaException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/AccountService.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/AccountServiceLocal.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/DocumentService.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/DocumentServiceLocal.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/EntryBookService.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/EntryBookServiceLocal.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/ExportService.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/ExportServiceLocal.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialPeriodService.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialPeriodServiceLocal.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialStatementService.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialStatementServiceLocal.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialTransactionService.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialTransactionServiceLocal.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FiscalPeriodService.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FiscalPeriodServiceLocal.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/HttpServerService.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/HttpServerServiceLocal.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/IdentityService.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/IdentityServiceLocal.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/ImportService.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/ImportServiceLocal.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/OptionsService.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/OptionsServiceLocal.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/ReportService.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/ReportServiceLocal.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/VatStatementService.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/VatStatementServiceLocal.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/FinancialPeriodServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialStatementServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FiscalPeriodServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/HttpServerServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/IdentityServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/OptionsServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/VatStatementServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/service/LimaServiceFactory.java
trunk/lima-business/src/test/java/org/chorem/lima/business/AbstractLimaTest.java
trunk/lima-business/src/test/java/org/chorem/lima/business/AccountServiceImplTest.java
trunk/lima-business/src/test/java/org/chorem/lima/business/EntryBookServiceImplTest.java
trunk/lima-business/src/test/java/org/chorem/lima/business/FinancialPeriodServiceImplTest.java
trunk/lima-business/src/test/java/org/chorem/lima/business/FinancialTransactionServiceImplTest.java
trunk/lima-business/src/test/java/org/chorem/lima/business/FiscalPeriodServiceImplTest.java
trunk/lima-business/src/test/java/org/chorem/lima/business/ImportServiceImplTest.java
trunk/lima-business/src/test/java/org/chorem/lima/business/ReportServiceImplTest.java
trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/TestAccountingRules.java
trunk/lima-business/src/test/java/org/chorem/lima/business/ejb/ClearService.java
trunk/lima-business/src/test/java/org/chorem/lima/business/ejb/ClearServiceImpl.java
trunk/lima-business/src/test/java/org/chorem/lima/entity/AccountDAOTest.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 2012-04-11 15:59:40 UTC (rev 3359)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java 2012-04-11 16:14:23 UTC (rev 3360)
@@ -38,6 +38,8 @@
import org.nuiton.topia.TopiaContext;
import org.nuiton.topia.TopiaException;
+import javax.ejb.Local;
+import javax.ejb.Remote;
import javax.ejb.Stateless;
import java.util.ArrayList;
import java.util.Collections;
@@ -54,6 +56,8 @@
* @author Rémi Chapelet
*/
@Stateless
+(a)Remote(AccountService.class)
+(a)Local(AccountServiceLocal.class)
public class AccountServiceImpl extends AbstractLimaService implements AccountService, AccountServiceLocal {
private TopiaContext rootContext;
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 2012-04-11 15:59:40 UTC (rev 3359)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/DocumentServiceImpl.java 2012-04-11 16:14:23 UTC (rev 3360)
@@ -74,8 +74,10 @@
import org.nuiton.topia.framework.TopiaQuery.Op;
import javax.ejb.EJB;
+import javax.ejb.Local;
+import javax.ejb.Remote;
import javax.ejb.Stateless;
-import java.awt.Color;
+import java.awt.*;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
@@ -91,6 +93,8 @@
import static org.nuiton.i18n.I18n._;
@Stateless
+(a)Remote(DocumentService.class)
+(a)Local(DocumentServiceLocal.class)
public class DocumentServiceImpl extends AbstractLimaService implements DocumentService, DocumentServiceLocal {
private TopiaContext rootContext;
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 2012-04-11 15:59:40 UTC (rev 3359)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/EntryBookServiceImpl.java 2012-04-11 16:14:23 UTC (rev 3360)
@@ -25,13 +25,6 @@
package org.chorem.lima.business.ejb;
-import static org.nuiton.i18n.I18n._;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.ejb.Stateless;
-
import org.chorem.lima.business.AccountingRules;
import org.chorem.lima.business.LimaBusinessException;
import org.chorem.lima.business.LimaConfig;
@@ -49,6 +42,14 @@
import org.nuiton.topia.TopiaContext;
import org.nuiton.topia.TopiaException;
+import javax.ejb.Local;
+import javax.ejb.Remote;
+import javax.ejb.Stateless;
+import java.util.ArrayList;
+import java.util.List;
+
+import static org.nuiton.i18n.I18n._;
+
/**
* Implémente la fonction multi-EntryBook. Il est possible de créer ici le
* EntryBook des ventes, le EntryBook des achats, etc.
@@ -56,6 +57,8 @@
* @author Rémi Chapelet
*/
@Stateless
+(a)Remote(EntryBookService.class)
+(a)Local(EntryBookServiceLocal.class)
public class EntryBookServiceImpl extends AbstractLimaService implements EntryBookService, EntryBookServiceLocal {
private TopiaContext rootContext;
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 2012-04-11 15:59:40 UTC (rev 3359)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ExportServiceImpl.java 2012-04-11 16:14:23 UTC (rev 3360)
@@ -54,6 +54,8 @@
import org.nuiton.topia.TopiaException;
import org.nuiton.topia.framework.TopiaQuery;
+import javax.ejb.Local;
+import javax.ejb.Remote;
import javax.ejb.Stateless;
import java.io.StringWriter;
import java.text.SimpleDateFormat;
@@ -68,6 +70,8 @@
* By : $Author$
*/
@Stateless
+(a)Remote(ExportService.class)
+(a)Local(ExportServiceLocal.class)
public class ExportServiceImpl extends AbstractLimaService implements ExportService, ExportServiceLocal {
private TopiaContext rootContext;
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialPeriodServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialPeriodServiceImpl.java 2012-04-11 15:59:40 UTC (rev 3359)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialPeriodServiceImpl.java 2012-04-11 16:14:23 UTC (rev 3360)
@@ -43,6 +43,8 @@
import org.nuiton.topia.TopiaException;
import org.nuiton.topia.framework.TopiaQuery;
+import javax.ejb.Local;
+import javax.ejb.Remote;
import javax.ejb.Stateless;
import java.util.Date;
import java.util.List;
@@ -55,6 +57,8 @@
* @author Rémi Chapelet
*/
@Stateless
+(a)Remote(FinancialPeriodService.class)
+(a)Local(FinancialPeriodServiceLocal.class)
public class FinancialPeriodServiceImpl extends AbstractLimaService implements FinancialPeriodService, FinancialPeriodServiceLocal {
private TopiaContext rootContext;
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 2012-04-11 15:59:40 UTC (rev 3359)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialStatementServiceImpl.java 2012-04-11 16:14:23 UTC (rev 3360)
@@ -49,6 +49,8 @@
import org.nuiton.topia.framework.TopiaQuery.Op;
import javax.ejb.EJB;
+import javax.ejb.Local;
+import javax.ejb.Remote;
import javax.ejb.Stateless;
import java.math.BigDecimal;
import java.util.ArrayList;
@@ -59,6 +61,8 @@
import static org.nuiton.i18n.I18n._;
@Stateless
+(a)Remote(FinancialStatementService.class)
+(a)Local(FinancialStatementServiceLocal.class)
public class FinancialStatementServiceImpl extends AbstractLimaService implements FinancialStatementService, FinancialStatementServiceLocal {
private TopiaContext rootContext;
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 2012-04-11 15:59:40 UTC (rev 3359)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java 2012-04-11 16:14:23 UTC (rev 3360)
@@ -56,6 +56,8 @@
import org.nuiton.topia.framework.TopiaQuery.Op;
import javax.ejb.EJB;
+import javax.ejb.Local;
+import javax.ejb.Remote;
import javax.ejb.Stateless;
import java.math.BigDecimal;
import java.util.ArrayList;
@@ -72,6 +74,8 @@
* @author Rémi Chapelet
*/
@Stateless
+(a)Remote(FinancialTransactionService.class)
+(a)Local(FinancialTransactionServiceLocal.class)
public class FinancialTransactionServiceImpl extends AbstractLimaService implements FinancialTransactionService, FinancialTransactionServiceLocal {
private TopiaContext rootContext;
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 2012-04-11 15:59:40 UTC (rev 3359)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FiscalPeriodServiceImpl.java 2012-04-11 16:14:23 UTC (rev 3360)
@@ -57,6 +57,8 @@
import org.nuiton.topia.framework.TopiaQuery;
import javax.ejb.EJB;
+import javax.ejb.Local;
+import javax.ejb.Remote;
import javax.ejb.Stateless;
import java.math.BigDecimal;
import java.util.ArrayList;
@@ -76,6 +78,8 @@
* @author Rémi Chapelet
*/
@Stateless
+(a)Remote(FiscalPeriodService.class)
+(a)Local(FiscalPeriodServiceLocal.class)
public class FiscalPeriodServiceImpl extends AbstractLimaService implements FiscalPeriodService, FiscalPeriodServiceLocal {
private TopiaContext rootContext;
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 2012-04-11 15:59:40 UTC (rev 3359)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/HttpServerServiceImpl.java 2012-04-11 16:14:23 UTC (rev 3360)
@@ -25,25 +25,6 @@
package org.chorem.lima.business.ejb;
-import static org.nuiton.i18n.I18n._;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.net.URL;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.Calendar;
-import java.util.Date;
-
-import javax.ejb.EJB;
-import javax.ejb.Stateless;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.time.DateUtils;
import org.chorem.lima.business.LimaConfig;
@@ -60,7 +41,29 @@
import org.nuiton.util.FileUtil;
import org.nuiton.util.Resource;
+import javax.ejb.EJB;
+import javax.ejb.Local;
+import javax.ejb.Remote;
+import javax.ejb.Stateless;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.URL;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
+import java.util.Date;
+
+import static org.nuiton.i18n.I18n._;
+
@Stateless
+(a)Remote(HttpServerService.class)
+(a)Local(HttpServerServiceLocal.class)
public class HttpServerServiceImpl extends AbstractLimaService implements HttpServerService, HttpServerServiceLocal {
@EJB
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/IdentityServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/IdentityServiceImpl.java 2012-04-11 15:59:40 UTC (rev 3359)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/IdentityServiceImpl.java 2012-04-11 16:14:23 UTC (rev 3360)
@@ -34,10 +34,14 @@
import org.nuiton.topia.TopiaContext;
import org.nuiton.topia.TopiaException;
+import javax.ejb.Local;
+import javax.ejb.Remote;
import javax.ejb.Stateless;
import java.util.List;
@Stateless
+(a)Remote(IdentityService.class)
+(a)Local(IdentityServiceLocal.class)
public class IdentityServiceImpl extends AbstractLimaService implements IdentityService, IdentityServiceLocal {
private TopiaContext rootContext;
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 2012-04-11 15:59:40 UTC (rev 3359)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java 2012-04-11 16:14:23 UTC (rev 3360)
@@ -104,6 +104,8 @@
import org.nuiton.topia.TopiaException;
import javax.ejb.EJB;
+import javax.ejb.Local;
+import javax.ejb.Remote;
import javax.ejb.Stateless;
import java.io.File;
import java.io.FileInputStream;
@@ -131,6 +133,8 @@
* Currently import and export as CSV and EBP.
*/
@Stateless
+(a)Remote(ImportService.class)
+(a)Local(ImportServiceLocal.class)
public class ImportServiceImpl extends AbstractLimaService implements ImportService, ImportServiceLocal {
private static final Log log = LogFactory.getLog(ImportServiceImpl.class);
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/OptionsServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/OptionsServiceImpl.java 2012-04-11 15:59:40 UTC (rev 3359)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/OptionsServiceImpl.java 2012-04-11 16:14:23 UTC (rev 3360)
@@ -28,9 +28,13 @@
import org.chorem.lima.business.api.OptionsService;
import org.chorem.lima.business.api.OptionsServiceLocal;
+import javax.ejb.Local;
+import javax.ejb.Remote;
import javax.ejb.Stateless;
@Stateless
+(a)Remote(OptionsService.class)
+(a)Local(OptionsServiceLocal.class)
public class OptionsServiceImpl extends AbstractLimaService implements OptionsService, OptionsServiceLocal {
protected String scale;
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 2012-04-11 15:59:40 UTC (rev 3359)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java 2012-04-11 16:14:23 UTC (rev 3360)
@@ -49,6 +49,8 @@
import org.nuiton.topia.framework.TopiaQuery;
import javax.ejb.EJB;
+import javax.ejb.Local;
+import javax.ejb.Remote;
import javax.ejb.Stateless;
import java.math.BigDecimal;
import java.util.ArrayList;
@@ -56,6 +58,8 @@
import java.util.List;
@Stateless
+(a)Remote(ReportService.class)
+(a)Local(ReportServiceLocal.class)
public class ReportServiceImpl extends AbstractLimaService implements ReportService, ReportServiceLocal {
private TopiaContext rootContext;
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/VatStatementServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/VatStatementServiceImpl.java 2012-04-11 15:59:40 UTC (rev 3359)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/VatStatementServiceImpl.java 2012-04-11 16:14:23 UTC (rev 3360)
@@ -48,6 +48,8 @@
import org.nuiton.topia.framework.TopiaQuery.Op;
import javax.ejb.EJB;
+import javax.ejb.Local;
+import javax.ejb.Remote;
import javax.ejb.Stateless;
import java.math.BigDecimal;
import java.util.ArrayList;
@@ -61,6 +63,8 @@
* @author vsalaun
*/
@Stateless
+(a)Remote(VatStatementService.class)
+(a)Local(VatStatementServiceLocal.class)
public class VatStatementServiceImpl extends AbstractLimaService implements VatStatementService, VatStatementServiceLocal {
private TopiaContext rootContext;
Modified: trunk/lima-business/src/main/java/org/chorem/lima/service/LimaServiceFactory.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/service/LimaServiceFactory.java 2012-04-11 15:59:40 UTC (rev 3359)
+++ trunk/lima-business/src/main/java/org/chorem/lima/service/LimaServiceFactory.java 2012-04-11 16:14:23 UTC (rev 3360)
@@ -25,6 +25,15 @@
package org.chorem.lima.service;
+import org.apache.commons.io.IOUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.chorem.lima.business.ServiceListener;
+import org.chorem.lima.business.ServiceMonitorable;
+import org.nuiton.util.ApplicationConfig;
+
+import javax.ejb.embeddable.EJBContainer;
+import javax.naming.NamingException;
import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.InvocationHandler;
@@ -33,16 +42,6 @@
import java.util.Map;
import java.util.Properties;
-import javax.ejb.embeddable.EJBContainer;
-import javax.naming.NamingException;
-
-import org.apache.commons.io.IOUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.chorem.lima.business.ServiceListener;
-import org.chorem.lima.business.ServiceMonitorable;
-import org.nuiton.util.ApplicationConfig;
-
/** This class is a service factory based on embedded openejb container. */
public class LimaServiceFactory {
Modified: trunk/lima-business/src/test/java/org/chorem/lima/business/AbstractLimaTest.java
===================================================================
--- trunk/lima-business/src/test/java/org/chorem/lima/business/AbstractLimaTest.java 2012-04-11 15:59:40 UTC (rev 3359)
+++ trunk/lima-business/src/test/java/org/chorem/lima/business/AbstractLimaTest.java 2012-04-11 16:14:23 UTC (rev 3360)
@@ -23,23 +23,12 @@
package org.chorem.lima.business;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.math.BigDecimal;
-import java.text.DateFormat;
-import java.text.ParseException;
-import java.util.Locale;
-import java.util.Properties;
-
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.business.LimaConfig.Option;
import org.chorem.lima.business.accountingrules.TestAccountingRules;
-import org.chorem.lima.business.ejb.ClearService;
-import org.chorem.lima.business.ejb.ClearServiceMonitorable;
import org.chorem.lima.business.api.AccountService;
import org.chorem.lima.business.api.EntryBookService;
import org.chorem.lima.business.api.FinancialPeriodService;
@@ -47,6 +36,8 @@
import org.chorem.lima.business.api.FiscalPeriodService;
import org.chorem.lima.business.api.ImportService;
import org.chorem.lima.business.api.ReportService;
+import org.chorem.lima.business.ejb.ClearService;
+import org.chorem.lima.business.ejb.ClearServiceMonitorable;
import org.chorem.lima.business.monitorable.AccountServiceMonitorable;
import org.chorem.lima.business.monitorable.EntryBookServiceMonitorable;
import org.chorem.lima.business.monitorable.FinancialPeriodServiceMonitorable;
@@ -76,6 +67,15 @@
import org.nuiton.topia.TopiaNotFoundException;
import org.nuiton.topia.TopiaRuntimeException;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.math.BigDecimal;
+import java.text.DateFormat;
+import java.text.ParseException;
+import java.util.Locale;
+import java.util.Properties;
+
/**
* Common initialization code for all lima tests.
*
Modified: trunk/lima-business/src/test/java/org/chorem/lima/business/AccountServiceImplTest.java
===================================================================
--- trunk/lima-business/src/test/java/org/chorem/lima/business/AccountServiceImplTest.java 2012-04-11 15:59:40 UTC (rev 3359)
+++ trunk/lima-business/src/test/java/org/chorem/lima/business/AccountServiceImplTest.java 2012-04-11 16:14:23 UTC (rev 3360)
@@ -25,15 +25,15 @@
package org.chorem.lima.business;
-import java.text.ParseException;
-import java.util.List;
-
import org.chorem.lima.entity.Account;
import org.chorem.lima.entity.AccountImpl;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
+import java.text.ParseException;
+import java.util.List;
+
/**
* Tests pour la gestion des comptes dans le plan comptable.
*
Modified: trunk/lima-business/src/test/java/org/chorem/lima/business/EntryBookServiceImplTest.java
===================================================================
--- trunk/lima-business/src/test/java/org/chorem/lima/business/EntryBookServiceImplTest.java 2012-04-11 15:59:40 UTC (rev 3359)
+++ trunk/lima-business/src/test/java/org/chorem/lima/business/EntryBookServiceImplTest.java 2012-04-11 16:14:23 UTC (rev 3360)
@@ -25,8 +25,6 @@
package org.chorem.lima.business;
-import java.text.ParseException;
-
import org.chorem.lima.entity.EntryBook;
import org.chorem.lima.entity.EntryBookImpl;
import org.junit.Assert;
@@ -34,6 +32,8 @@
import org.junit.Ignore;
import org.junit.Test;
+import java.text.ParseException;
+
/**
* Tests pour la gestion des journaux.
* <p/>
Modified: trunk/lima-business/src/test/java/org/chorem/lima/business/FinancialPeriodServiceImplTest.java
===================================================================
--- trunk/lima-business/src/test/java/org/chorem/lima/business/FinancialPeriodServiceImplTest.java 2012-04-11 15:59:40 UTC (rev 3359)
+++ trunk/lima-business/src/test/java/org/chorem/lima/business/FinancialPeriodServiceImplTest.java 2012-04-11 16:14:23 UTC (rev 3360)
@@ -25,11 +25,11 @@
package org.chorem.lima.business;
-import java.text.ParseException;
-
import org.junit.Before;
import org.junit.Test;
+import java.text.ParseException;
+
/**
* Tests pour la gestion des timespans
* <p/>
Modified: trunk/lima-business/src/test/java/org/chorem/lima/business/FinancialTransactionServiceImplTest.java
===================================================================
--- trunk/lima-business/src/test/java/org/chorem/lima/business/FinancialTransactionServiceImplTest.java 2012-04-11 15:59:40 UTC (rev 3359)
+++ trunk/lima-business/src/test/java/org/chorem/lima/business/FinancialTransactionServiceImplTest.java 2012-04-11 16:14:23 UTC (rev 3360)
@@ -23,10 +23,6 @@
package org.chorem.lima.business;
-import java.math.BigDecimal;
-import java.text.ParseException;
-import java.util.List;
-
import org.chorem.lima.entity.Account;
import org.chorem.lima.entity.Entry;
import org.chorem.lima.entity.EntryBook;
@@ -39,6 +35,10 @@
import org.junit.Before;
import org.junit.Test;
+import java.math.BigDecimal;
+import java.text.ParseException;
+import java.util.List;
+
/**
* Test on financial transaction service.
*
Modified: trunk/lima-business/src/test/java/org/chorem/lima/business/FiscalPeriodServiceImplTest.java
===================================================================
--- trunk/lima-business/src/test/java/org/chorem/lima/business/FiscalPeriodServiceImplTest.java 2012-04-11 15:59:40 UTC (rev 3359)
+++ trunk/lima-business/src/test/java/org/chorem/lima/business/FiscalPeriodServiceImplTest.java 2012-04-11 16:14:23 UTC (rev 3360)
@@ -25,8 +25,6 @@
package org.chorem.lima.business;
-import java.text.ParseException;
-
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.business.ejb.FiscalPeriodServiceImpl;
@@ -39,6 +37,8 @@
import org.nuiton.topia.TopiaException;
import org.nuiton.topia.TopiaNotFoundException;
+import java.text.ParseException;
+
/**
* Tests pour la gestion des périodes
* <p/>
Modified: trunk/lima-business/src/test/java/org/chorem/lima/business/ImportServiceImplTest.java
===================================================================
--- trunk/lima-business/src/test/java/org/chorem/lima/business/ImportServiceImplTest.java 2012-04-11 15:59:40 UTC (rev 3359)
+++ trunk/lima-business/src/test/java/org/chorem/lima/business/ImportServiceImplTest.java 2012-04-11 16:14:23 UTC (rev 3360)
@@ -25,10 +25,6 @@
package org.chorem.lima.business;
-import java.io.IOException;
-import java.io.InputStream;
-import java.text.ParseException;
-
import org.apache.commons.io.IOUtils;
import org.chorem.lima.entity.Account;
import org.chorem.lima.entity.FiscalPeriod;
@@ -36,6 +32,10 @@
import org.junit.Assert;
import org.junit.Test;
+import java.io.IOException;
+import java.io.InputStream;
+import java.text.ParseException;
+
/**
* Test du service d'import en faisant des import/export EBP et xml.
*
Modified: trunk/lima-business/src/test/java/org/chorem/lima/business/ReportServiceImplTest.java
===================================================================
--- trunk/lima-business/src/test/java/org/chorem/lima/business/ReportServiceImplTest.java 2012-04-11 15:59:40 UTC (rev 3359)
+++ trunk/lima-business/src/test/java/org/chorem/lima/business/ReportServiceImplTest.java 2012-04-11 16:14:23 UTC (rev 3360)
@@ -25,10 +25,6 @@
package org.chorem.lima.business;
-import java.math.BigDecimal;
-import java.text.ParseException;
-import java.util.Date;
-
import org.chorem.lima.beans.ReportsDatas;
import org.chorem.lima.entity.Account;
import org.chorem.lima.entity.Entry;
@@ -41,6 +37,10 @@
import org.junit.Before;
import org.junit.Test;
+import java.math.BigDecimal;
+import java.text.ParseException;
+import java.util.Date;
+
/**
* Test le service de génération des reports.
*/
Modified: trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/TestAccountingRules.java
===================================================================
--- trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/TestAccountingRules.java 2012-04-11 15:59:40 UTC (rev 3359)
+++ trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/TestAccountingRules.java 2012-04-11 16:14:23 UTC (rev 3360)
@@ -23,13 +23,6 @@
package org.chorem.lima.business.accountingrules;
-import static org.nuiton.i18n.I18n._;
-
-import java.util.ArrayList;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.List;
-
import org.apache.commons.lang3.time.DateUtils;
import org.chorem.lima.business.LimaBusinessException;
import org.chorem.lima.business.LimaException;
@@ -43,6 +36,13 @@
import org.nuiton.topia.TopiaException;
import org.nuiton.topia.framework.TopiaQuery;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.List;
+
+import static org.nuiton.i18n.I18n._;
+
/**
* Cette classe existe car les tests tourne 2 fois:
* - default
Modified: trunk/lima-business/src/test/java/org/chorem/lima/business/ejb/ClearService.java
===================================================================
--- trunk/lima-business/src/test/java/org/chorem/lima/business/ejb/ClearService.java 2012-04-11 15:59:40 UTC (rev 3359)
+++ trunk/lima-business/src/test/java/org/chorem/lima/business/ejb/ClearService.java 2012-04-11 16:14:23 UTC (rev 3360)
@@ -23,10 +23,10 @@
package org.chorem.lima.business.ejb;
+import org.chorem.lima.business.LimaException;
+
import javax.ejb.Remote;
-import org.chorem.lima.business.LimaException;
-
/**
* Clear database service.
*
Modified: trunk/lima-business/src/test/java/org/chorem/lima/business/ejb/ClearServiceImpl.java
===================================================================
--- trunk/lima-business/src/test/java/org/chorem/lima/business/ejb/ClearServiceImpl.java 2012-04-11 15:59:40 UTC (rev 3359)
+++ trunk/lima-business/src/test/java/org/chorem/lima/business/ejb/ClearServiceImpl.java 2012-04-11 16:14:23 UTC (rev 3360)
@@ -23,12 +23,12 @@
package org.chorem.lima.business.ejb;
-import javax.ejb.Stateless;
-
import org.chorem.lima.business.LimaException;
import org.nuiton.topia.TopiaContext;
import org.nuiton.topia.TopiaException;
+import javax.ejb.Stateless;
+
/**
* Clear database service.
*
Modified: trunk/lima-business/src/test/java/org/chorem/lima/entity/AccountDAOTest.java
===================================================================
--- trunk/lima-business/src/test/java/org/chorem/lima/entity/AccountDAOTest.java 2012-04-11 15:59:40 UTC (rev 3359)
+++ trunk/lima-business/src/test/java/org/chorem/lima/entity/AccountDAOTest.java 2012-04-11 16:14:23 UTC (rev 3360)
@@ -25,13 +25,13 @@
package org.chorem.lima.entity;
-import java.util.List;
-
import org.chorem.lima.business.AbstractLimaTest;
import org.junit.Assert;
import org.junit.Test;
import org.nuiton.topia.TopiaException;
+import java.util.List;
+
/**
* Test for AccountDAO class.
*
Property changes on: trunk/lima-business-api/LICENSE.txt
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Property changes on: trunk/lima-business-api/README.txt
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Property changes on: trunk/lima-business-api/changelog.txt
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/lima-business-api/pom.xml
===================================================================
--- trunk/lima-business-api/pom.xml 2012-04-11 15:59:40 UTC (rev 3359)
+++ trunk/lima-business-api/pom.xml 2012-04-11 16:14:23 UTC (rev 3360)
@@ -17,11 +17,6 @@
<dependencies>
<dependency>
- <groupId>org.apache.openejb</groupId>
- <artifactId>javaee-api</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
<groupId>${project.groupId}</groupId>
<artifactId>lima-callao</artifactId>
<version>${project.version}</version>
Property changes on: trunk/lima-business-api/pom.xml
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/LimaException.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/LimaException.java 2012-04-11 15:59:40 UTC (rev 3359)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/LimaException.java 2012-04-11 16:14:23 UTC (rev 3360)
@@ -36,7 +36,9 @@
*/
public class LimaException extends Exception {
- /** serialVersionUID. */
+ /**
+ * serialVersionUID.
+ */
private static final long serialVersionUID = -6876236663940184462L;
/**
Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/AccountService.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/AccountService.java 2012-04-11 15:59:40 UTC (rev 3359)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/AccountService.java 2012-04-11 16:14:23 UTC (rev 3360)
@@ -28,7 +28,6 @@
import org.chorem.lima.business.LimaException;
import org.chorem.lima.entity.Account;
-import javax.ejb.Remote;
import java.util.List;
/**
@@ -40,12 +39,11 @@
* Last update : $Date$
* By : $Author$
*/
-@Remote
public interface AccountService {
/**
* Return account count.
- *
+ *
* @return account count
* @throws LimaException technical exception
*/
@@ -56,9 +54,9 @@
/**
* Obtain the master account for the given account number.
- *
+ * <p/>
* the master account if the account with the longer account number prefixing the given account number.
- *
+ * <p/>
* Example: for account number 401AB, it could be 4, 40, 401,...
*
* @param accountNumber the account number
@@ -71,7 +69,7 @@
/**
* Return all account ordered by account name.
- *
+ *
* @return all account
* @throws LimaException
*/
@@ -83,7 +81,7 @@
* Create new account. If {@code masterAccount} is not null, {@code account}
* is added in {@code masterAccount}'s subAccounts.
*
- * @param account account
+ * @param account account
* @throws LimaException
*/
Account createAccount(Account account) throws LimaException;
Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/AccountServiceLocal.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/AccountServiceLocal.java 2012-04-11 15:59:40 UTC (rev 3359)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/AccountServiceLocal.java 2012-04-11 16:14:23 UTC (rev 3360)
@@ -29,8 +29,6 @@
import org.chorem.lima.entity.Account;
import org.nuiton.topia.TopiaContext;
-import javax.ejb.Local;
-
/**
* Account service.
*
@@ -40,7 +38,6 @@
* Last update : $Date$
* By : $Author$
*/
-@Local
public interface AccountServiceLocal extends AccountService {
Account createAccountWithTransaction(Account account, TopiaContext topiaContext) throws LimaException;
Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/DocumentService.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/DocumentService.java 2012-04-11 15:59:40 UTC (rev 3359)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/DocumentService.java 2012-04-11 16:14:23 UTC (rev 3360)
@@ -28,7 +28,6 @@
import org.chorem.lima.business.LimaException;
import org.chorem.lima.business.utils.FormatsEnum;
-import javax.ejb.Remote;
import java.util.Date;
/**
@@ -37,7 +36,6 @@
* @author john
*/
-@Remote
public interface DocumentService {
void createFinancialStatementsDocuments(Date beginDate, Date endDate, FormatsEnum format) throws LimaException;
Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/DocumentServiceLocal.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/DocumentServiceLocal.java 2012-04-11 15:59:40 UTC (rev 3359)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/DocumentServiceLocal.java 2012-04-11 16:14:23 UTC (rev 3360)
@@ -25,15 +25,12 @@
package org.chorem.lima.business.api;
-import javax.ejb.Local;
-
/**
* Interface to create pdf and html docs
*
* @author john
*/
-@Local
public interface DocumentServiceLocal extends DocumentService {
}
Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/EntryBookService.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/EntryBookService.java 2012-04-11 15:59:40 UTC (rev 3359)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/EntryBookService.java 2012-04-11 16:14:23 UTC (rev 3360)
@@ -28,7 +28,6 @@
import org.chorem.lima.business.LimaException;
import org.chorem.lima.entity.EntryBook;
-import javax.ejb.Remote;
import java.util.List;
/**
@@ -36,25 +35,24 @@
*
* @author chatellier
* @version $Revision$
- * <p/>
- * Last update : $Date$
- * By : $Author$
+ * <p/>
+ * Last update : $Date$
+ * By : $Author$
*/
-@Remote
public interface EntryBookService {
/**
* Find entry book by code.
- *
+ *
* @param code entry book code
- * @return
+ * @return
* @throws LimaException
*/
EntryBook getEntryBookByCode(String code) throws LimaException;
/**
* Get all entry book.
- *
+ *
* @return all entrybook
* @throws LimaException
*/
@@ -62,7 +60,7 @@
/**
* Create new entry book.
- *
+ *
* @param entryBook
* @throws LimaException
*/
Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/EntryBookServiceLocal.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/EntryBookServiceLocal.java 2012-04-11 15:59:40 UTC (rev 3359)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/EntryBookServiceLocal.java 2012-04-11 16:14:23 UTC (rev 3360)
@@ -29,9 +29,7 @@
import org.chorem.lima.entity.EntryBook;
import org.nuiton.topia.TopiaContext;
-import javax.ejb.Local;
-
/**
* Entry book service.
*
@@ -42,7 +40,6 @@
* By : $Author$
*/
-@Local
public interface EntryBookServiceLocal extends EntryBookService {
EntryBook createEntryBookWithTransaction(EntryBook entryBook, TopiaContext topiaContext) throws LimaException;
Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/ExportService.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/ExportService.java 2012-04-11 15:59:40 UTC (rev 3359)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/ExportService.java 2012-04-11 16:14:23 UTC (rev 3360)
@@ -27,8 +27,6 @@
import org.chorem.lima.business.LimaException;
-import javax.ejb.Remote;
-
/**
* Import export service.
* <p/>
@@ -40,7 +38,6 @@
* Last update : $Date$
* By : $Author$
*/
-@Remote
public interface ExportService {
@@ -52,22 +49,34 @@
*/
String exportAsCSV() throws LimaException;
- /** export entrybook chart as CSV. */
+ /**
+ * export entrybook chart as CSV.
+ */
String exportEntryBookChartAsCSV() throws LimaException;
- /** export financialstatement chart as CSV. */
+ /**
+ * export financialstatement chart as CSV.
+ */
String exportFinancialStatementChartAsCSV() throws LimaException;
- /** export vatstatement chart as CSV */
+ /**
+ * export vatstatement chart as CSV
+ */
String exportVatStatementChartAsCSV() throws LimaException;
- /** export accounts chart as CSV. */
+ /**
+ * export accounts chart as CSV.
+ */
String exportAccountsChartAsCSV() throws LimaException;
- /** export entries as EBP */
+ /**
+ * export entries as EBP
+ */
String exportEntriesAsEBP() throws LimaException;
- /** export accounts as EBP */
+ /**
+ * export accounts as EBP
+ */
String exportAccountsAsEBP() throws LimaException;
Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/ExportServiceLocal.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/ExportServiceLocal.java 2012-04-11 15:59:40 UTC (rev 3359)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/ExportServiceLocal.java 2012-04-11 16:14:23 UTC (rev 3360)
@@ -25,8 +25,6 @@
package org.chorem.lima.business.api;
-import javax.ejb.Local;
-
/**
* Import export service.
* <p/>
@@ -38,7 +36,6 @@
* Last update : $Date$
* By : $Author$
*/
-@Local
public interface ExportServiceLocal extends ExportService {
}
Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialPeriodService.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialPeriodService.java 2012-04-11 15:59:40 UTC (rev 3359)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialPeriodService.java 2012-04-11 16:14:23 UTC (rev 3360)
@@ -30,7 +30,6 @@
import org.chorem.lima.entity.EntryBook;
import org.chorem.lima.entity.FinancialPeriod;
-import javax.ejb.Remote;
import java.util.Date;
import java.util.List;
@@ -44,7 +43,6 @@
* By : $Author$
*/
-@Remote
public interface FinancialPeriodService {
List<FinancialPeriod> getUnblockedFinancialPeriods() throws LimaException;
Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialPeriodServiceLocal.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialPeriodServiceLocal.java 2012-04-11 15:59:40 UTC (rev 3359)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialPeriodServiceLocal.java 2012-04-11 16:14:23 UTC (rev 3360)
@@ -30,7 +30,6 @@
import org.chorem.lima.entity.FinancialPeriod;
import org.nuiton.topia.TopiaContext;
-import javax.ejb.Local;
import java.util.List;
@@ -44,7 +43,6 @@
* By : $Author$
*/
-@Local
public interface FinancialPeriodServiceLocal extends FinancialPeriodService {
void createFinancialPeriodsWithTransaction(List<FinancialPeriod> financialPeriods,
Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialStatementService.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialStatementService.java 2012-04-11 15:59:40 UTC (rev 3359)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialStatementService.java 2012-04-11 16:14:23 UTC (rev 3360)
@@ -29,11 +29,9 @@
import org.chorem.lima.business.LimaException;
import org.chorem.lima.entity.FinancialStatement;
-import javax.ejb.Remote;
import java.util.Date;
import java.util.List;
-@Remote
public interface FinancialStatementService {
Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialStatementServiceLocal.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialStatementServiceLocal.java 2012-04-11 15:59:40 UTC (rev 3359)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialStatementServiceLocal.java 2012-04-11 16:14:23 UTC (rev 3360)
@@ -29,9 +29,6 @@
import org.chorem.lima.entity.FinancialStatement;
import org.nuiton.topia.TopiaContext;
-import javax.ejb.Local;
-
-@Local
public interface FinancialStatementServiceLocal extends FinancialStatementService {
void createFinancialStatementWithTransaction(FinancialStatement masterFinancialStatement,
Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialTransactionService.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialTransactionService.java 2012-04-11 15:59:40 UTC (rev 3359)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialTransactionService.java 2012-04-11 16:14:23 UTC (rev 3360)
@@ -34,7 +34,6 @@
import org.chorem.lima.entity.FiscalPeriod;
import org.chorem.lima.entity.Letter;
-import javax.ejb.Remote;
import java.util.Date;
import java.util.List;
@@ -48,7 +47,6 @@
* By : $Author$
*/
-@Remote
public interface FinancialTransactionService {
Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialTransactionServiceLocal.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialTransactionServiceLocal.java 2012-04-11 15:59:40 UTC (rev 3359)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialTransactionServiceLocal.java 2012-04-11 16:14:23 UTC (rev 3360)
@@ -30,8 +30,6 @@
import org.chorem.lima.entity.FinancialTransaction;
import org.nuiton.topia.TopiaContext;
-import javax.ejb.Local;
-
/**
* Transaction service.
*
@@ -42,7 +40,6 @@
* By : $Author$
*/
-@Local
public interface FinancialTransactionServiceLocal extends FinancialTransactionService {
FinancialTransaction createFinancialTransactionWithTransaction(FinancialTransaction financialtransaction,
Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FiscalPeriodService.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FiscalPeriodService.java 2012-04-11 15:59:40 UTC (rev 3359)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FiscalPeriodService.java 2012-04-11 16:14:23 UTC (rev 3360)
@@ -29,7 +29,6 @@
import org.chorem.lima.entity.EntryBook;
import org.chorem.lima.entity.FiscalPeriod;
-import javax.ejb.Remote;
import java.util.List;
/**
@@ -41,7 +40,6 @@
* Last update : $Date$
* By : $Author$
*/
-@Remote
public interface FiscalPeriodService {
List<FiscalPeriod> getAllFiscalPeriods() throws LimaException;
Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FiscalPeriodServiceLocal.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FiscalPeriodServiceLocal.java 2012-04-11 15:59:40 UTC (rev 3359)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FiscalPeriodServiceLocal.java 2012-04-11 16:14:23 UTC (rev 3360)
@@ -29,8 +29,6 @@
import org.chorem.lima.entity.FiscalPeriod;
import org.nuiton.topia.TopiaContext;
-import javax.ejb.Local;
-
/**
* Fiscal period service.
*
@@ -40,11 +38,10 @@
* Last update : $Date$
* By : $Author$
*/
-@Local
public interface FiscalPeriodServiceLocal extends FiscalPeriodService {
FiscalPeriod createFiscalPeriodWithTransaction(FiscalPeriod fiscalPeriod,
- TopiaContext topiaContext) throws LimaException;
+ TopiaContext topiaContext) throws LimaException;
}
Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/HttpServerService.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/HttpServerService.java 2012-04-11 15:59:40 UTC (rev 3359)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/HttpServerService.java 2012-04-11 16:14:23 UTC (rev 3360)
@@ -25,9 +25,6 @@
package org.chorem.lima.business.api;
-import javax.ejb.Remote;
-
-@Remote
public interface HttpServerService {
void start();
Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/HttpServerServiceLocal.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/HttpServerServiceLocal.java 2012-04-11 15:59:40 UTC (rev 3359)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/HttpServerServiceLocal.java 2012-04-11 16:14:23 UTC (rev 3360)
@@ -25,9 +25,6 @@
package org.chorem.lima.business.api;
-import javax.ejb.Local;
-
-@Local
public interface HttpServerServiceLocal extends HttpServerService {
}
Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/IdentityService.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/IdentityService.java 2012-04-11 15:59:40 UTC (rev 3359)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/IdentityService.java 2012-04-11 16:14:23 UTC (rev 3360)
@@ -28,9 +28,6 @@
import org.chorem.lima.business.LimaException;
import org.chorem.lima.entity.Identity;
-import javax.ejb.Remote;
-
-@Remote
public interface IdentityService {
Identity getIdentity() throws LimaException;
Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/IdentityServiceLocal.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/IdentityServiceLocal.java 2012-04-11 15:59:40 UTC (rev 3359)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/IdentityServiceLocal.java 2012-04-11 16:14:23 UTC (rev 3360)
@@ -29,9 +29,6 @@
import org.chorem.lima.entity.Identity;
import org.nuiton.topia.TopiaContext;
-import javax.ejb.Local;
-
-@Local
public interface IdentityServiceLocal extends IdentityService {
void updateIdentityWithTransaction(Identity identity,
Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/ImportService.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/ImportService.java 2012-04-11 15:59:40 UTC (rev 3359)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/ImportService.java 2012-04-11 16:14:23 UTC (rev 3360)
@@ -28,13 +28,10 @@
import org.chorem.lima.business.LimaException;
import org.chorem.lima.business.utils.ImportExportEntityEnum;
-import javax.ejb.Remote;
-
/**
* Import export service.
* Currently import and export as CSV and EBP.
*/
-@Remote
public interface ImportService {
/**
@@ -57,19 +54,19 @@
/**
* Import data as lima CSV import.
- *
+ * <p/>
* Read first line to detect file type and call {@link #importAsCSV(String, ImportExportEntityEnum)}.
- *
+ *
* @param data import file content as string (remote service can't take File)
* @return result log
- * @throws LimaException
+ * @throws LimaException
*/
String importAllAsCSV(String data) throws LimaException;
/**
* Import content as CSV depending on import type.
- *
- * @param data import file content as string (remote service can't take File)
+ *
+ * @param data import file content as string (remote service can't take File)
* @param importExportEntityEnum import type
* @return result log
* @throws LimaException
@@ -79,7 +76,7 @@
/**
* @deprecated import file (local, can't be used in remote mode)
- * and wrong place for this method
+ * and wrong place for this method
*/
String importAsPDF(String data,
ImportExportEntityEnum importExportEntityEnum,
Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/ImportServiceLocal.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/ImportServiceLocal.java 2012-04-11 15:59:40 UTC (rev 3359)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/ImportServiceLocal.java 2012-04-11 16:14:23 UTC (rev 3360)
@@ -25,8 +25,6 @@
package org.chorem.lima.business.api;
-import javax.ejb.Local;
-
/**
* Import export service.
* <p/>
@@ -38,7 +36,6 @@
* Last update : $Date$
* By : $Author$
*/
-@Local
public interface ImportServiceLocal extends ImportService {
}
Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/OptionsService.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/OptionsService.java 2012-04-11 15:59:40 UTC (rev 3359)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/OptionsService.java 2012-04-11 16:14:23 UTC (rev 3360)
@@ -24,8 +24,6 @@
*/
package org.chorem.lima.business.api;
-import javax.ejb.Remote;
-
/**
* Service de report des certaines configurations du swing dans business
* <p/>
@@ -37,7 +35,6 @@
* @author salaun
*/
-@Remote
public interface OptionsService {
/**
Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/OptionsServiceLocal.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/OptionsServiceLocal.java 2012-04-11 15:59:40 UTC (rev 3359)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/OptionsServiceLocal.java 2012-04-11 16:14:23 UTC (rev 3360)
@@ -24,9 +24,6 @@
*/
package org.chorem.lima.business.api;
-import javax.ejb.Local;
-
-@Local
public interface OptionsServiceLocal extends OptionsService {
}
Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/ReportService.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/ReportService.java 2012-04-11 15:59:40 UTC (rev 3359)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/ReportService.java 2012-04-11 16:14:23 UTC (rev 3360)
@@ -33,7 +33,6 @@
import org.chorem.lima.entity.FiscalPeriod;
import org.nuiton.topia.TopiaContext;
-import javax.ejb.Remote;
import java.util.Date;
import java.util.List;
@@ -54,7 +53,6 @@
* By : $Author$
*/
-@Remote
public interface ReportService {
/**
Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/ReportServiceLocal.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/ReportServiceLocal.java 2012-04-11 15:59:40 UTC (rev 3359)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/ReportServiceLocal.java 2012-04-11 16:14:23 UTC (rev 3360)
@@ -30,7 +30,6 @@
import org.chorem.lima.entity.Account;
import org.nuiton.topia.TopiaContext;
-import javax.ejb.Local;
import java.util.Date;
@@ -50,7 +49,6 @@
* By : $Author$
*/
-@Local
public interface ReportServiceLocal extends ReportService {
ReportsDatas generateAccountReportsWithTransaction(Account account,
Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/VatStatementService.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/VatStatementService.java 2012-04-11 15:59:40 UTC (rev 3359)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/VatStatementService.java 2012-04-11 16:14:23 UTC (rev 3360)
@@ -28,11 +28,9 @@
import org.chorem.lima.business.LimaException;
import org.chorem.lima.entity.VatStatement;
-import javax.ejb.Remote;
import java.util.Date;
import java.util.List;
-@Remote
public interface VatStatementService {
void createVatStatement(VatStatement masterVatStatement,
Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/VatStatementServiceLocal.java
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/VatStatementServiceLocal.java 2012-04-11 15:59:40 UTC (rev 3359)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/VatStatementServiceLocal.java 2012-04-11 16:14:23 UTC (rev 3360)
@@ -30,10 +30,8 @@
import org.chorem.lima.entity.VatStatement;
import org.nuiton.topia.TopiaContext;
-import javax.ejb.Local;
import java.util.Date;
-@Local
public interface VatStatementServiceLocal extends VatStatementService {
void createVatStatementWithTransaction(
1
0
April 11, 2012
Author: athimel
Date: 2012-04-11 17:59:40 +0200 (Wed, 11 Apr 2012)
New Revision: 3359
Url: http://chorem.org/repositories/revision/lima/3359
Log:
Create a separated business API module that externalize business service public interfaces
Added:
trunk/lima-business-api/
trunk/lima-business-api/LICENSE.txt
trunk/lima-business-api/README.txt
trunk/lima-business-api/changelog.txt
trunk/lima-business-api/pom.xml
trunk/lima-business-api/src/
trunk/lima-business-api/src/main/
trunk/lima-business-api/src/main/java/
trunk/lima-business-api/src/main/java/org/
trunk/lima-business-api/src/main/java/org/chorem/
trunk/lima-business-api/src/main/java/org/chorem/lima/
trunk/lima-business-api/src/main/java/org/chorem/lima/business/
trunk/lima-business-api/src/main/java/org/chorem/lima/business/LimaException.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/
trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/AccountService.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/AccountServiceLocal.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/DocumentService.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/DocumentServiceLocal.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/EntryBookService.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/EntryBookServiceLocal.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/ExportService.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/ExportServiceLocal.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialPeriodService.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialPeriodServiceLocal.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialStatementService.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialStatementServiceLocal.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialTransactionService.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialTransactionServiceLocal.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FiscalPeriodService.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FiscalPeriodServiceLocal.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/HttpServerService.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/HttpServerServiceLocal.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/IdentityService.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/IdentityServiceLocal.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/ImportService.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/ImportServiceLocal.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/OptionsService.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/OptionsServiceLocal.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/ReportService.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/ReportServiceLocal.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/VatStatementService.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/VatStatementServiceLocal.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/utils/
trunk/lima-business-api/src/main/java/org/chorem/lima/business/utils/FormatsEnum.java
trunk/lima-business-api/src/main/java/org/chorem/lima/business/utils/ImportExportEntityEnum.java
Removed:
trunk/lima-business/src/main/java/org/chorem/lima/business/LimaException.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/EntryBookService.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/ExportServiceLocal.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialPeriodService.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialPeriodServiceLocal.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/FiscalPeriodService.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FiscalPeriodServiceLocal.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/HttpServerServiceLocal.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/ImportServiceLocal.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/OptionsService.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/OptionsServiceLocal.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/java/org/chorem/lima/business/ejbinterface/VatStatementService.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/VatStatementServiceLocal.java
trunk/lima-business/src/main/java/org/chorem/lima/business/utils/FormatsEnum.java
trunk/lima-business/src/main/java/org/chorem/lima/business/utils/ImportExportEntityEnum.java
Modified:
trunk/
trunk/lima-business/pom.xml
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/FinancialPeriodServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialStatementServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FiscalPeriodServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/HttpServerServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/IdentityServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/OptionsServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/VatStatementServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/monitorable/AccountServiceMonitorable.java
trunk/lima-business/src/main/java/org/chorem/lima/business/monitorable/DocumentServiceMonitorable.java
trunk/lima-business/src/main/java/org/chorem/lima/business/monitorable/EntryBookServiceMonitorable.java
trunk/lima-business/src/main/java/org/chorem/lima/business/monitorable/ExportServiceMonitorable.java
trunk/lima-business/src/main/java/org/chorem/lima/business/monitorable/FinancialPeriodServiceMonitorable.java
trunk/lima-business/src/main/java/org/chorem/lima/business/monitorable/FinancialStatementServiceMonitorable.java
trunk/lima-business/src/main/java/org/chorem/lima/business/monitorable/FinancialTransactionServiceMonitorable.java
trunk/lima-business/src/main/java/org/chorem/lima/business/monitorable/FiscalPeriodServiceMonitorable.java
trunk/lima-business/src/main/java/org/chorem/lima/business/monitorable/HttpServerServiceMonitorable.java
trunk/lima-business/src/main/java/org/chorem/lima/business/monitorable/IdentityServiceMonitorable.java
trunk/lima-business/src/main/java/org/chorem/lima/business/monitorable/ImportServiceMonitorable.java
trunk/lima-business/src/main/java/org/chorem/lima/business/monitorable/OptionsServiceMonitorable.java
trunk/lima-business/src/main/java/org/chorem/lima/business/monitorable/ReportServiceMonitorable.java
trunk/lima-business/src/main/java/org/chorem/lima/business/monitorable/VatStatementServiceMonitorable.java
trunk/lima-business/src/test/java/org/chorem/lima/business/AbstractLimaTest.java
trunk/lima-swing/src/main/java/org/chorem/lima/LimaMain.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountViewHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/AccountComboBoxModel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/EntryBookComboBoxModel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/FinancialPeriodComboBoxModel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/FiscalPeriodComboBoxModel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/LetterComboBoxModel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/SubAccountComboBoxModel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookViewHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialperiod/FinancialPeriodTable.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportTableModel.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/financialtransactionsearch/FinancialTransactionSearchViewHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedTableModel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/FiscalPeriodViewHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/EntryBooksPane.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/FinancialTransactionsPane.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/FiscalPeriodsPane.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/identity/IdentityHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerViewHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringTableModel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatreports/VatReportTableModel.java
trunk/pom.xml
Property changes on: trunk
___________________________________________________________________
Modified: svn:ignore
- *.log
target
bin
.classpath
.project
*.ipr
*.iws
*.iml
.settings
+ *.log
target
bin
.classpath
.project
*.ipr
*.iws
*.iml
.settings
.idea
Modified: trunk/lima-business/pom.xml
===================================================================
--- trunk/lima-business/pom.xml 2012-04-11 13:34:48 UTC (rev 3358)
+++ trunk/lima-business/pom.xml 2012-04-11 15:59:40 UTC (rev 3359)
@@ -27,6 +27,11 @@
<version>${project.version}</version>
</dependency>
<dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>lima-business-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
<groupId>net.sf.opencsv</groupId>
<artifactId>opencsv</artifactId>
</dependency>
Deleted: trunk/lima-business/src/main/java/org/chorem/lima/business/LimaException.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/LimaException.java 2012-04-11 13:34:48 UTC (rev 3358)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/LimaException.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -1,60 +0,0 @@
-/*
- * #%L
- * Lima business
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2008 - 2010 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-package org.chorem.lima.business;
-
-/**
- * Lima exception.
- *
- * @author chatellier
- * @version $Revision$
- * <p/>
- * Last update : $Date$
- * By : $Author$
- */
-public class LimaException extends Exception {
-
- /** serialVersionUID. */
- private static final long serialVersionUID = -6876236663940184462L;
-
- /**
- * Constructs a new exception with the specified detail message.
- *
- * @param message message
- */
- public LimaException(String message) {
- super(message);
- }
-
- /**
- * Constructs a new exception with the specified detail message and cause.
- *
- * @param message message
- * @param cause cause
- */
- public LimaException(String message, Throwable cause) {
- super(message, cause);
- }
-}
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 2012-04-11 13:34:48 UTC (rev 3358)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -29,8 +29,8 @@
import org.chorem.lima.business.LimaBusinessException;
import org.chorem.lima.business.LimaConfig;
import org.chorem.lima.business.LimaException;
-import org.chorem.lima.business.ejbinterface.AccountService;
-import org.chorem.lima.business.ejbinterface.AccountServiceLocal;
+import org.chorem.lima.business.api.AccountService;
+import org.chorem.lima.business.api.AccountServiceLocal;
import org.chorem.lima.business.utils.AccountComparator;
import org.chorem.lima.entity.Account;
import org.chorem.lima.entity.AccountDAO;
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 2012-04-11 13:34:48 UTC (rev 3358)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/DocumentServiceImpl.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -48,12 +48,12 @@
import org.chorem.lima.beans.ReportsDatas;
import org.chorem.lima.business.LimaConfig;
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.FinancialStatementServiceLocal;
-import org.chorem.lima.business.ejbinterface.IdentityServiceLocal;
-import org.chorem.lima.business.ejbinterface.ReportServiceLocal;
-import org.chorem.lima.business.ejbinterface.VatStatementServiceLocal;
+import org.chorem.lima.business.api.DocumentService;
+import org.chorem.lima.business.api.DocumentServiceLocal;
+import org.chorem.lima.business.api.FinancialStatementServiceLocal;
+import org.chorem.lima.business.api.IdentityServiceLocal;
+import org.chorem.lima.business.api.ReportServiceLocal;
+import org.chorem.lima.business.api.VatStatementServiceLocal;
import org.chorem.lima.business.utils.DocumentsEnum;
import org.chorem.lima.business.utils.EntryComparator;
import org.chorem.lima.business.utils.FormatsEnum;
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 2012-04-11 13:34:48 UTC (rev 3358)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/EntryBookServiceImpl.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -36,8 +36,8 @@
import org.chorem.lima.business.LimaBusinessException;
import org.chorem.lima.business.LimaConfig;
import org.chorem.lima.business.LimaException;
-import org.chorem.lima.business.ejbinterface.EntryBookService;
-import org.chorem.lima.business.ejbinterface.EntryBookServiceLocal;
+import org.chorem.lima.business.api.EntryBookService;
+import org.chorem.lima.business.api.EntryBookServiceLocal;
import org.chorem.lima.entity.ClosedPeriodicEntryBook;
import org.chorem.lima.entity.ClosedPeriodicEntryBookDAO;
import org.chorem.lima.entity.ClosedPeriodicEntryBookImpl;
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 2012-04-11 13:34:48 UTC (rev 3358)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ExportServiceImpl.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -29,8 +29,8 @@
import org.apache.commons.lang3.StringUtils;
import org.chorem.lima.FinancialStatementWayEnum;
import org.chorem.lima.business.LimaException;
-import org.chorem.lima.business.ejbinterface.ExportService;
-import org.chorem.lima.business.ejbinterface.ExportServiceLocal;
+import org.chorem.lima.business.api.ExportService;
+import org.chorem.lima.business.api.ExportServiceLocal;
import org.chorem.lima.business.utils.ImportExportEntityEnum;
import org.chorem.lima.entity.Account;
import org.chorem.lima.entity.AccountDAO;
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialPeriodServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialPeriodServiceImpl.java 2012-04-11 13:34:48 UTC (rev 3358)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialPeriodServiceImpl.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -28,8 +28,8 @@
import org.chorem.lima.business.AccountingRules;
import org.chorem.lima.business.LimaConfig;
import org.chorem.lima.business.LimaException;
-import org.chorem.lima.business.ejbinterface.FinancialPeriodService;
-import org.chorem.lima.business.ejbinterface.FinancialPeriodServiceLocal;
+import org.chorem.lima.business.api.FinancialPeriodService;
+import org.chorem.lima.business.api.FinancialPeriodServiceLocal;
import org.chorem.lima.entity.ClosedPeriodicEntryBook;
import org.chorem.lima.entity.ClosedPeriodicEntryBookDAO;
import org.chorem.lima.entity.ClosedPeriodicEntryBookImpl;
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 2012-04-11 13:34:48 UTC (rev 3358)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialStatementServiceImpl.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -35,9 +35,9 @@
import org.chorem.lima.beans.FinancialStatementDatasImpl;
import org.chorem.lima.beans.ReportsDatas;
import org.chorem.lima.business.LimaException;
-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.api.FinancialStatementService;
+import org.chorem.lima.business.api.FinancialStatementServiceLocal;
+import org.chorem.lima.business.api.ReportServiceLocal;
import org.chorem.lima.entity.Account;
import org.chorem.lima.entity.AccountDAO;
import org.chorem.lima.entity.FinancialStatement;
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java 2012-04-11 13:34:48 UTC (rev 3358)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -30,12 +30,12 @@
import org.chorem.lima.business.AccountingRules;
import org.chorem.lima.business.LimaConfig;
import org.chorem.lima.business.LimaException;
-import org.chorem.lima.business.ejbinterface.EntryBookServiceLocal;
-import org.chorem.lima.business.ejbinterface.FinancialPeriodServiceLocal;
-import org.chorem.lima.business.ejbinterface.FinancialTransactionService;
-import org.chorem.lima.business.ejbinterface.FinancialTransactionServiceLocal;
-import org.chorem.lima.business.ejbinterface.OptionsServiceLocal;
-import org.chorem.lima.business.ejbinterface.ReportServiceLocal;
+import org.chorem.lima.business.api.EntryBookServiceLocal;
+import org.chorem.lima.business.api.FinancialPeriodServiceLocal;
+import org.chorem.lima.business.api.FinancialTransactionService;
+import org.chorem.lima.business.api.FinancialTransactionServiceLocal;
+import org.chorem.lima.business.api.OptionsServiceLocal;
+import org.chorem.lima.business.api.ReportServiceLocal;
import org.chorem.lima.entity.Account;
import org.chorem.lima.entity.AccountDAO;
import org.chorem.lima.entity.Entry;
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 2012-04-11 13:34:48 UTC (rev 3358)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FiscalPeriodServiceImpl.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -32,13 +32,13 @@
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.EntryBookServiceLocal;
-import org.chorem.lima.business.ejbinterface.FinancialPeriodServiceLocal;
-import org.chorem.lima.business.ejbinterface.FinancialTransactionServiceLocal;
-import org.chorem.lima.business.ejbinterface.FiscalPeriodService;
-import org.chorem.lima.business.ejbinterface.FiscalPeriodServiceLocal;
-import org.chorem.lima.business.ejbinterface.ReportServiceLocal;
+import org.chorem.lima.business.api.AccountServiceLocal;
+import org.chorem.lima.business.api.EntryBookServiceLocal;
+import org.chorem.lima.business.api.FinancialPeriodServiceLocal;
+import org.chorem.lima.business.api.FinancialTransactionServiceLocal;
+import org.chorem.lima.business.api.FiscalPeriodService;
+import org.chorem.lima.business.api.FiscalPeriodServiceLocal;
+import org.chorem.lima.business.api.ReportServiceLocal;
import org.chorem.lima.business.utils.FinancialPeriodComparator;
import org.chorem.lima.entity.Account;
import org.chorem.lima.entity.AccountImpl;
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 2012-04-11 13:34:48 UTC (rev 3358)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/HttpServerServiceImpl.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -48,9 +48,9 @@
import org.apache.commons.lang3.time.DateUtils;
import org.chorem.lima.business.LimaConfig;
import org.chorem.lima.business.LimaException;
-import org.chorem.lima.business.ejbinterface.DocumentServiceLocal;
-import org.chorem.lima.business.ejbinterface.HttpServerService;
-import org.chorem.lima.business.ejbinterface.HttpServerServiceLocal;
+import org.chorem.lima.business.api.DocumentServiceLocal;
+import org.chorem.lima.business.api.HttpServerService;
+import org.chorem.lima.business.api.HttpServerServiceLocal;
import org.chorem.lima.business.utils.DocumentsEnum;
import org.chorem.lima.business.utils.FormatsEnum;
import org.eclipse.jetty.server.Server;
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/IdentityServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/IdentityServiceImpl.java 2012-04-11 13:34:48 UTC (rev 3358)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/IdentityServiceImpl.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -26,8 +26,8 @@
package org.chorem.lima.business.ejb;
import org.chorem.lima.business.LimaException;
-import org.chorem.lima.business.ejbinterface.IdentityService;
-import org.chorem.lima.business.ejbinterface.IdentityServiceLocal;
+import org.chorem.lima.business.api.IdentityService;
+import org.chorem.lima.business.api.IdentityServiceLocal;
import org.chorem.lima.entity.Identity;
import org.chorem.lima.entity.IdentityDAO;
import org.chorem.lima.entity.LimaCallaoDAOHelper;
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 2012-04-11 13:34:48 UTC (rev 3358)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -54,16 +54,16 @@
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.EntryBookServiceLocal;
-import org.chorem.lima.business.ejbinterface.FinancialPeriodServiceLocal;
-import org.chorem.lima.business.ejbinterface.FinancialStatementServiceLocal;
-import org.chorem.lima.business.ejbinterface.FinancialTransactionServiceLocal;
-import org.chorem.lima.business.ejbinterface.FiscalPeriodServiceLocal;
-import org.chorem.lima.business.ejbinterface.IdentityServiceLocal;
-import org.chorem.lima.business.ejbinterface.ImportService;
-import org.chorem.lima.business.ejbinterface.ImportServiceLocal;
-import org.chorem.lima.business.ejbinterface.VatStatementServiceLocal;
+import org.chorem.lima.business.api.AccountServiceLocal;
+import org.chorem.lima.business.api.EntryBookServiceLocal;
+import org.chorem.lima.business.api.FinancialPeriodServiceLocal;
+import org.chorem.lima.business.api.FinancialStatementServiceLocal;
+import org.chorem.lima.business.api.FinancialTransactionServiceLocal;
+import org.chorem.lima.business.api.FiscalPeriodServiceLocal;
+import org.chorem.lima.business.api.IdentityServiceLocal;
+import org.chorem.lima.business.api.ImportService;
+import org.chorem.lima.business.api.ImportServiceLocal;
+import org.chorem.lima.business.api.VatStatementServiceLocal;
import org.chorem.lima.business.utils.AccountEBPComparator;
import org.chorem.lima.business.utils.DocumentsEnum;
import org.chorem.lima.business.utils.EntryEBPComparator;
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/OptionsServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/OptionsServiceImpl.java 2012-04-11 13:34:48 UTC (rev 3358)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/OptionsServiceImpl.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -25,8 +25,8 @@
package org.chorem.lima.business.ejb;
import org.chorem.lima.business.LimaConfig;
-import org.chorem.lima.business.ejbinterface.OptionsService;
-import org.chorem.lima.business.ejbinterface.OptionsServiceLocal;
+import org.chorem.lima.business.api.OptionsService;
+import org.chorem.lima.business.api.OptionsServiceLocal;
import javax.ejb.Stateless;
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 2012-04-11 13:34:48 UTC (rev 3358)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -31,10 +31,10 @@
import org.chorem.lima.beans.ReportsDatas;
import org.chorem.lima.beans.ReportsDatasImpl;
import org.chorem.lima.business.LimaException;
-import org.chorem.lima.business.ejbinterface.AccountServiceLocal;
-import org.chorem.lima.business.ejbinterface.FinancialPeriodServiceLocal;
-import org.chorem.lima.business.ejbinterface.ReportService;
-import org.chorem.lima.business.ejbinterface.ReportServiceLocal;
+import org.chorem.lima.business.api.AccountServiceLocal;
+import org.chorem.lima.business.api.FinancialPeriodServiceLocal;
+import org.chorem.lima.business.api.ReportService;
+import org.chorem.lima.business.api.ReportServiceLocal;
import org.chorem.lima.entity.Account;
import org.chorem.lima.entity.AccountDAO;
import org.chorem.lima.entity.Entry;
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/VatStatementServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/VatStatementServiceImpl.java 2012-04-11 13:34:48 UTC (rev 3358)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/VatStatementServiceImpl.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -33,9 +33,9 @@
import org.chorem.lima.beans.VatStatementDatas;
import org.chorem.lima.beans.VatStatementDatasImpl;
import org.chorem.lima.business.LimaException;
-import org.chorem.lima.business.ejbinterface.ReportServiceLocal;
-import org.chorem.lima.business.ejbinterface.VatStatementService;
-import org.chorem.lima.business.ejbinterface.VatStatementServiceLocal;
+import org.chorem.lima.business.api.ReportServiceLocal;
+import org.chorem.lima.business.api.VatStatementService;
+import org.chorem.lima.business.api.VatStatementServiceLocal;
import org.chorem.lima.entity.Account;
import org.chorem.lima.entity.AccountDAO;
import org.chorem.lima.entity.LimaCallaoDAOHelper;
Deleted: 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 2012-04-11 13:34:48 UTC (rev 3358)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/AccountService.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -1,100 +0,0 @@
-/*
- * #%L
- * Lima business
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2008 - 2012 CodeLutin, Chatellier Eric
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-package org.chorem.lima.business.ejbinterface;
-
-import org.chorem.lima.business.LimaException;
-import org.chorem.lima.entity.Account;
-
-import javax.ejb.Remote;
-import java.util.List;
-
-/**
- * Account service.
- *
- * @author chatellier
- * @version $Revision$
- * <p/>
- * Last update : $Date$
- * By : $Author$
- */
-@Remote
-public interface AccountService {
-
- /**
- * Return account count.
- *
- * @return account count
- * @throws LimaException technical exception
- */
- long getAccountCount() throws LimaException;
-
- List<Account> getAllAccountByProperty(String propertyName,
- String value) throws LimaException;
-
- /**
- * Obtain the master account for the given account number.
- *
- * the master account if the account with the longer account number prefixing the given account number.
- *
- * Example: for account number 401AB, it could be 4, 40, 401,...
- *
- * @param accountNumber the account number
- * @return the master account number
- * @throws LimaException if any pb while loading account
- */
- Account getMasterAccount(String accountNumber) throws LimaException;
-
- Account getAccountByNumber(String number) throws LimaException;
-
- /**
- * Return all account ordered by account name.
- *
- * @return all account
- * @throws LimaException
- */
- List<Account> getAllAccounts() throws LimaException;
-
- List<Account> getAllLeafAccounts() throws LimaException;
-
- /**
- * Create new account. If {@code masterAccount} is not null, {@code account}
- * is added in {@code masterAccount}'s subAccounts.
- *
- * @param account account
- * @throws LimaException
- */
- Account createAccount(Account account) throws LimaException;
-
- Account updateAccount(Account account) throws LimaException;
-
- void removeAccount(Account account) throws LimaException;
-
- void removeAllAccount() throws LimaException;
-
- List<Account> getAllChildrenAccounts(Account masterAccount) throws LimaException;
-
- List<Account> getChildrenAccounts(Account masterAccount) throws LimaException;
-}
Deleted: 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 2012-04-11 13:34:48 UTC (rev 3358)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/AccountServiceLocal.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -1,48 +0,0 @@
-/*
- * #%L
- * Lima business
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2008 - 2012 CodeLutin, Chatellier Eric
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-package org.chorem.lima.business.ejbinterface;
-
-import org.chorem.lima.business.LimaException;
-import org.chorem.lima.entity.Account;
-import org.nuiton.topia.TopiaContext;
-
-import javax.ejb.Local;
-
-/**
- * Account service.
- *
- * @author chatellier
- * @version $Revision$
- * <p/>
- * Last update : $Date$
- * By : $Author$
- */
-@Local
-public interface AccountServiceLocal extends AccountService {
-
- Account createAccountWithTransaction(Account account, TopiaContext topiaContext) throws LimaException;
-
-}
\ No newline at end of file
Deleted: 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 2012-04-11 13:34:48 UTC (rev 3358)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/DocumentService.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -1,55 +0,0 @@
-/*
- * #%L
- * Lima business
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2008 - 2010 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-package org.chorem.lima.business.ejbinterface;
-
-import org.chorem.lima.business.LimaException;
-import org.chorem.lima.business.utils.FormatsEnum;
-
-import javax.ejb.Remote;
-import java.util.Date;
-
-/**
- * Interface to create pdf and html docs
- *
- * @author john
- */
-
-@Remote
-public interface DocumentService {
-
- 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;
-
- void createVatDocuments(Date beginDate, Date endDate, FormatsEnum format, String autocomplete) throws LimaException;
-
-}
Deleted: 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 2012-04-11 13:34:48 UTC (rev 3358)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/DocumentServiceLocal.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -1,39 +0,0 @@
-/*
- * #%L
- * Lima business
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2008 - 2010 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-package org.chorem.lima.business.ejbinterface;
-
-import javax.ejb.Local;
-
-/**
- * Interface to create pdf and html docs
- *
- * @author john
- */
-
-@Local
-public interface DocumentServiceLocal extends DocumentService {
-
-}
Deleted: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/EntryBookService.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/EntryBookService.java 2012-04-11 13:34:48 UTC (rev 3358)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/EntryBookService.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -1,89 +0,0 @@
-/*
- * #%L
- * Lima business
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2008 - 2012 CodeLutin, Chatellier Eric
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-package org.chorem.lima.business.ejbinterface;
-
-import org.chorem.lima.business.LimaException;
-import org.chorem.lima.entity.EntryBook;
-
-import javax.ejb.Remote;
-import java.util.List;
-
-/**
- * Entry book service.
- *
- * @author chatellier
- * @version $Revision$
- * <p/>
- * Last update : $Date$
- * By : $Author$
- */
-@Remote
-public interface EntryBookService {
-
- /**
- * Find entry book by code.
- *
- * @param code entry book code
- * @return
- * @throws LimaException
- */
- EntryBook getEntryBookByCode(String code) throws LimaException;
-
- /**
- * Get all entry book.
- *
- * @return all entrybook
- * @throws LimaException
- */
- List<EntryBook> getAllEntryBooks() throws LimaException;
-
- /**
- * Create new entry book.
- *
- * @param entryBook
- * @throws LimaException
- */
- EntryBook createEntryBook(EntryBook entryBook) throws LimaException;
-
- /**
- * Permet de modifier un journal.
- *
- * @param entryBook journal
- * @throws LimaException
- */
- EntryBook updateEntryBook(EntryBook entryBook) throws LimaException;
-
- /**
- * Permet d'effacer un EntryBook dans la base de données.
- * <p/>
- * ATTENTION : si un EntryBook est associé avec des entrées, il est alors
- * impossible de supprimer celui-ci.
- *
- * @param entryBook
- * @throws LimaException
- */
- void removeEntryBook(EntryBook entryBook) throws LimaException;
-}
Deleted: 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 2012-04-11 13:34:48 UTC (rev 3358)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/EntryBookServiceLocal.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -1,50 +0,0 @@
-/*
- * #%L
- * Lima business
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2008 - 2010 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-package org.chorem.lima.business.ejbinterface;
-
-import org.chorem.lima.business.LimaException;
-import org.chorem.lima.entity.EntryBook;
-import org.nuiton.topia.TopiaContext;
-
-import javax.ejb.Local;
-
-
-/**
- * Entry book service.
- *
- * @author chatellier
- * @version $Revision$
- * <p/>
- * Last update : $Date$
- * By : $Author$
- */
-
-@Local
-public interface EntryBookServiceLocal extends EntryBookService {
-
- EntryBook createEntryBookWithTransaction(EntryBook entryBook, TopiaContext topiaContext) throws LimaException;
-
-}
Deleted: 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 2012-04-11 13:34:48 UTC (rev 3358)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ExportService.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -1,74 +0,0 @@
-/*
- * #%L
- * Lima business
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2008 - 2010 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-package org.chorem.lima.business.ejbinterface;
-
-import org.chorem.lima.business.LimaException;
-
-import javax.ejb.Remote;
-
-/**
- * Import export service.
- * <p/>
- * Currently import and export as XML.
- *
- * @author chatellier
- * @version $Revision$
- * <p/>
- * Last update : $Date$
- * By : $Author$
- */
-@Remote
-public interface ExportService {
-
-
- /**
- * Get database export as CSV;
- *
- * @return export as byte array
- * @throws LimaException
- */
- String exportAsCSV() throws LimaException;
-
- /** export entrybook chart as CSV. */
- String exportEntryBookChartAsCSV() throws LimaException;
-
- /** export financialstatement chart as CSV. */
- String exportFinancialStatementChartAsCSV() throws LimaException;
-
- /** export vatstatement chart as CSV */
- String exportVatStatementChartAsCSV() throws LimaException;
-
- /** export accounts chart as CSV. */
- String exportAccountsChartAsCSV() throws LimaException;
-
- /** export entries as EBP */
- String exportEntriesAsEBP() throws LimaException;
-
- /** export accounts as EBP */
- String exportAccountsAsEBP() throws LimaException;
-
-
-}
Deleted: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ExportServiceLocal.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ExportServiceLocal.java 2012-04-11 13:34:48 UTC (rev 3358)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ExportServiceLocal.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -1,44 +0,0 @@
-/*
- * #%L
- * Lima business
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2008 - 2010 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-package org.chorem.lima.business.ejbinterface;
-
-import javax.ejb.Local;
-
-/**
- * Import export service.
- * <p/>
- * Currently import and export as XML.
- *
- * @author chatellier
- * @version $Revision$
- * <p/>
- * Last update : $Date$
- * By : $Author$
- */
-@Local
-public interface ExportServiceLocal extends ExportService {
-
-}
Deleted: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialPeriodService.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialPeriodService.java 2012-04-11 13:34:48 UTC (rev 3358)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialPeriodService.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -1,65 +0,0 @@
-/*
- * #%L
- * Lima business
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2008 - 2010 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-package org.chorem.lima.business.ejbinterface;
-
-import org.chorem.lima.business.LimaException;
-import org.chorem.lima.entity.ClosedPeriodicEntryBook;
-import org.chorem.lima.entity.EntryBook;
-import org.chorem.lima.entity.FinancialPeriod;
-
-import javax.ejb.Remote;
-import java.util.Date;
-import java.util.List;
-
-/**
- * Financial period service.
- *
- * @author chatellier
- * @version $Revision$
- * <p/>
- * Last update : $Date$
- * By : $Author$
- */
-
-@Remote
-public interface FinancialPeriodService {
-
- List<FinancialPeriod> getUnblockedFinancialPeriods() throws LimaException;
-
- void createFinancialPeriods(List<FinancialPeriod> financialPeriods) throws LimaException;
-
- ClosedPeriodicEntryBook getClosedPeriodicEntryBook(EntryBook entryBook,
- FinancialPeriod financialPeriod) throws LimaException;
-
- List<ClosedPeriodicEntryBook> getAllClosedPeriodicEntryBooksFromUnblockedFiscalPeriod() throws LimaException;
-
- void blockClosedPeriodicEntryBook(ClosedPeriodicEntryBook closedPeriodicEntryBook) throws LimaException;
-
- List<FinancialPeriod> getAllFinancialPeriods() throws LimaException;
-
- List<FinancialPeriod> getFinancialPeriods(Date beginDate,
- Date endDate) throws LimaException;
-}
Deleted: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialPeriodServiceLocal.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialPeriodServiceLocal.java 2012-04-11 13:34:48 UTC (rev 3358)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialPeriodServiceLocal.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -1,57 +0,0 @@
-/*
- * #%L
- * Lima business
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2008 - 2010 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-package org.chorem.lima.business.ejbinterface;
-
-import org.chorem.lima.business.LimaException;
-import org.chorem.lima.entity.ClosedPeriodicEntryBook;
-import org.chorem.lima.entity.FinancialPeriod;
-import org.nuiton.topia.TopiaContext;
-
-import javax.ejb.Local;
-import java.util.List;
-
-
-/**
- * Financial period service.
- *
- * @author chatellier
- * @version $Revision$
- * <p/>
- * Last update : $Date$
- * By : $Author$
- */
-
-@Local
-public interface FinancialPeriodServiceLocal extends FinancialPeriodService {
-
- void createFinancialPeriodsWithTransaction(List<FinancialPeriod> financialPeriods,
- TopiaContext topiaContext) throws LimaException;
-
- void blockClosedPeriodicEntryBookWithTransaction(ClosedPeriodicEntryBook closedPeriodicEntryBook,
- TopiaContext topiaContext) throws LimaException;
-
-
-}
Deleted: 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 2012-04-11 13:34:48 UTC (rev 3358)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialStatementService.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -1,61 +0,0 @@
-/*
- * #%L
- * Lima business
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2008 - 2010 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-package org.chorem.lima.business.ejbinterface;
-
-import org.chorem.lima.beans.FinancialStatementAmounts;
-import org.chorem.lima.business.LimaException;
-import org.chorem.lima.entity.FinancialStatement;
-
-import javax.ejb.Remote;
-import java.util.Date;
-import java.util.List;
-
-@Remote
-public interface FinancialStatementService {
-
-
- void createFinancialStatement(FinancialStatement masterFinancialStatement,
- FinancialStatement financialStatement) throws LimaException;
-
- void updateFinancialStatement(FinancialStatement financialStatement) throws LimaException;
-
- void removeFinancialStatement(FinancialStatement financialStatement) throws LimaException;
-
- void removeAllFinancialStatement() throws LimaException;
-
- List<FinancialStatement> getAllFinancialStatements() throws LimaException;
-
- List<FinancialStatement> getChildrenFinancialStatement(FinancialStatement financialStatement) throws LimaException;
-
- List<FinancialStatement> getAllChildrenFinancialStatement(FinancialStatement financialStatement,
- List<FinancialStatement> financialStatements) throws LimaException;
-
- List<FinancialStatementAmounts> financialStatementReport(Date selectedBeginDate,
- Date selectedEndDate) throws LimaException;
-
- String checkFinancialStatementChart() throws LimaException;
-
-}
Deleted: 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 2012-04-11 13:34:48 UTC (rev 3358)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialStatementServiceLocal.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -1,42 +0,0 @@
-/*
- * #%L
- * Lima business
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2008 - 2010 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-package org.chorem.lima.business.ejbinterface;
-
-import org.chorem.lima.business.LimaException;
-import org.chorem.lima.entity.FinancialStatement;
-import org.nuiton.topia.TopiaContext;
-
-import javax.ejb.Local;
-
-@Local
-public interface FinancialStatementServiceLocal extends FinancialStatementService {
-
- void createFinancialStatementWithTransaction(FinancialStatement masterFinancialStatement,
- FinancialStatement financialStatement,
- TopiaContext topiaContext) throws LimaException;
-
-
-}
Deleted: 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 2012-04-11 13:34:48 UTC (rev 3358)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialTransactionService.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -1,93 +0,0 @@
-/*
- * #%L
- * Lima business
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2008 - 2010 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-package org.chorem.lima.business.ejbinterface;
-
-import org.chorem.lima.beans.FinancialTransactionSearch;
-import org.chorem.lima.business.LimaException;
-import org.chorem.lima.entity.Entry;
-import org.chorem.lima.entity.EntryBook;
-import org.chorem.lima.entity.FinancialPeriod;
-import org.chorem.lima.entity.FinancialTransaction;
-import org.chorem.lima.entity.FiscalPeriod;
-import org.chorem.lima.entity.Letter;
-
-import javax.ejb.Remote;
-import java.util.Date;
-import java.util.List;
-
-/**
- * Transaction service.
- *
- * @author chatellier
- * @version $Revision$
- * <p/>
- * Last update : $Date$
- * By : $Author$
- */
-
-@Remote
-public interface FinancialTransactionService {
-
-
- FinancialTransaction createFinancialTransaction(FinancialTransaction financialtransaction) throws LimaException;
-
- void updateFinancialTransaction(FinancialTransaction financialtransaction) throws LimaException;
-
- void removeFinancialTransaction(FinancialTransaction financialtransaction) throws LimaException;
-
- List<FinancialTransaction> getAllFinancialTransactionsForFinancialPeriod(FinancialPeriod period) throws LimaException;
-
- List<FinancialTransaction> getAllFinancialTransactionsFromDateToDate(Date beginDate,
- Date endDate) throws LimaException;
-
- List<FinancialTransaction> getAllFinancialTransactionsForEntryBookAndFinancialPeriod(EntryBook entryBook,
- FinancialPeriod period) throws LimaException;
-
- List<FinancialTransaction> getAllInexactFinancialTransactions(FiscalPeriod fiscalPeriod) throws LimaException;
-
- List<FinancialTransaction> getAllFinancialTransactionsBalanced(FiscalPeriod fiscalPeriod) throws LimaException;
-
- List<Object> searchFinancialTransaction(FinancialTransactionSearch financialTransactionSearch) throws LimaException;
-
- Entry createEntry(Entry entry) throws LimaException;
-
- void updateEntry(Entry entry) throws LimaException;
-
- void removeEntry(Entry entry) throws LimaException;
-
- Letter getNewLetter() throws LimaException;
-
- void createLetter(Letter letter) throws LimaException;
-
- void removeLetter(Letter letter) throws LimaException;
-
- List<Letter> getAllLetters() throws LimaException;
-
- void setEntryLetter(Entry entry, Letter letter) throws LimaException;
-
- void removeEntryLetter(Entry entry) throws LimaException;
-
-}
Deleted: 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 2012-04-11 13:34:48 UTC (rev 3358)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialTransactionServiceLocal.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -1,57 +0,0 @@
-/*
- * #%L
- * Lima business
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2008 - 2010 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-package org.chorem.lima.business.ejbinterface;
-
-import org.chorem.lima.business.LimaException;
-import org.chorem.lima.entity.Entry;
-import org.chorem.lima.entity.FinancialTransaction;
-import org.nuiton.topia.TopiaContext;
-
-import javax.ejb.Local;
-
-/**
- * Transaction service.
- *
- * @author chatellier
- * @version $Revision$
- * <p/>
- * Last update : $Date$
- * By : $Author$
- */
-
-@Local
-public interface FinancialTransactionServiceLocal extends FinancialTransactionService {
-
- FinancialTransaction createFinancialTransactionWithTransaction(FinancialTransaction financialtransaction,
- TopiaContext topiaContext) throws LimaException;
-
- void updateFinancialTransactionWithTransaction(FinancialTransaction financialtransaction,
- TopiaContext topiaContext) throws LimaException;
-
- Entry createEntryWithTransaction(Entry entry, TopiaContext topiaContext) throws LimaException;
-
-
-}
Deleted: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FiscalPeriodService.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FiscalPeriodService.java 2012-04-11 13:34:48 UTC (rev 3358)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FiscalPeriodService.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -1,62 +0,0 @@
-/*
- * #%L
- * Lima business
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2008 - 2010 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-package org.chorem.lima.business.ejbinterface;
-
-import org.chorem.lima.business.LimaException;
-import org.chorem.lima.entity.EntryBook;
-import org.chorem.lima.entity.FiscalPeriod;
-
-import javax.ejb.Remote;
-import java.util.List;
-
-/**
- * Fiscal period service.
- *
- * @author chatellier
- * @version $Revision$
- * <p/>
- * Last update : $Date$
- * By : $Author$
- */
-@Remote
-public interface FiscalPeriodService {
-
- List<FiscalPeriod> getAllFiscalPeriods() throws LimaException;
-
- List<FiscalPeriod> getAllBlockedFiscalPeriods() throws LimaException;
-
- List<FiscalPeriod> getAllUnblockedFiscalPeriods() throws LimaException;
-
- FiscalPeriod getLastFiscalPeriod() throws LimaException;
-
- FiscalPeriod createFiscalPeriod(FiscalPeriod fiscalPeriod) throws LimaException;
-
- FiscalPeriod blockFiscalPeriod(FiscalPeriod fiscalPeriod) throws LimaException;
-
- void addRetainedEarnings(FiscalPeriod fiscalPeriod,
- boolean newyear,
- EntryBook entryBook) throws LimaException;
-}
Deleted: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FiscalPeriodServiceLocal.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FiscalPeriodServiceLocal.java 2012-04-11 13:34:48 UTC (rev 3358)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FiscalPeriodServiceLocal.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -1,50 +0,0 @@
-/*
- * #%L
- * Lima business
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2008 - 2010 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-package org.chorem.lima.business.ejbinterface;
-
-import org.chorem.lima.business.LimaException;
-import org.chorem.lima.entity.FiscalPeriod;
-import org.nuiton.topia.TopiaContext;
-
-import javax.ejb.Local;
-
-/**
- * Fiscal period service.
- *
- * @author chatellier
- * @version $Revision$
- * <p/>
- * Last update : $Date$
- * By : $Author$
- */
-@Local
-public interface FiscalPeriodServiceLocal extends FiscalPeriodService {
-
- FiscalPeriod createFiscalPeriodWithTransaction(FiscalPeriod fiscalPeriod,
- TopiaContext topiaContext) throws LimaException;
-
-
-}
Deleted: 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 2012-04-11 13:34:48 UTC (rev 3358)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/HttpServerService.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -1,37 +0,0 @@
-/*
- * #%L
- * Lima business
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2008 - 2010 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-package org.chorem.lima.business.ejbinterface;
-
-import javax.ejb.Remote;
-
-@Remote
-public interface HttpServerService {
-
- void start();
-
- int getHttpPort();
-
-}
Deleted: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/HttpServerServiceLocal.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/HttpServerServiceLocal.java 2012-04-11 13:34:48 UTC (rev 3358)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/HttpServerServiceLocal.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -1,33 +0,0 @@
-/*
- * #%L
- * Lima business
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2008 - 2010 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-package org.chorem.lima.business.ejbinterface;
-
-import javax.ejb.Local;
-
-@Local
-public interface HttpServerServiceLocal extends HttpServerService {
-
-}
Deleted: 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 2012-04-11 13:34:48 UTC (rev 3358)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/IdentityService.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -1,40 +0,0 @@
-/*
- * #%L
- * Lima business
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2008 - 2010 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-package org.chorem.lima.business.ejbinterface;
-
-import org.chorem.lima.business.LimaException;
-import org.chorem.lima.entity.Identity;
-
-import javax.ejb.Remote;
-
-@Remote
-public interface IdentityService {
-
- Identity getIdentity() throws LimaException;
-
- void updateIdentity(Identity identity) throws LimaException;
-
-}
Deleted: 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 2012-04-11 13:34:48 UTC (rev 3358)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/IdentityServiceLocal.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -1,42 +0,0 @@
-/*
- * #%L
- * Lima business
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2008 - 2010 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-package org.chorem.lima.business.ejbinterface;
-
-import org.chorem.lima.business.LimaException;
-import org.chorem.lima.entity.Identity;
-import org.nuiton.topia.TopiaContext;
-
-import javax.ejb.Local;
-
-@Local
-public interface IdentityServiceLocal extends IdentityService {
-
- void updateIdentityWithTransaction(Identity identity,
- TopiaContext topiaContext) throws LimaException;
-
- Identity getIdentityWithTransaction(TopiaContext topiaContext) throws LimaException;
-
-}
Deleted: 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 2012-04-11 13:34:48 UTC (rev 3358)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ImportService.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -1,87 +0,0 @@
-/*
- * #%L
- * Lima business
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2008 - 2012 CodeLutin, Chatellier Eric
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-package org.chorem.lima.business.ejbinterface;
-
-import org.chorem.lima.business.LimaException;
-import org.chorem.lima.business.utils.ImportExportEntityEnum;
-
-import javax.ejb.Remote;
-
-/**
- * Import export service.
- * Currently import and export as CSV and EBP.
- */
-@Remote
-public interface ImportService {
-
- /**
- * Import accounts as EBP import.
- *
- * @param data import file content as string (remote service can't take File)
- * @return result log
- * @throws LimaException
- */
- String importAccountsChartFromEbp(String data) throws LimaException;
-
- /**
- * Import entries as EBP import.
- *
- * @param data import file content as string (remote service can't take File)
- * @return result log
- * @throws LimaException
- */
- String importEntriesFromEbp(String data) throws LimaException;
-
- /**
- * Import data as lima CSV import.
- *
- * Read first line to detect file type and call {@link #importAsCSV(String, ImportExportEntityEnum)}.
- *
- * @param data import file content as string (remote service can't take File)
- * @return result log
- * @throws LimaException
- */
- String importAllAsCSV(String data) throws LimaException;
-
- /**
- * Import content as CSV depending on import type.
- *
- * @param data import file content as string (remote service can't take File)
- * @param importExportEntityEnum import type
- * @return result log
- * @throws LimaException
- */
- String importAsCSV(String data,
- ImportExportEntityEnum importExportEntityEnum) throws LimaException;
-
- /**
- * @deprecated import file (local, can't be used in remote mode)
- * and wrong place for this method
- */
- String importAsPDF(String data,
- ImportExportEntityEnum importExportEntityEnum,
- boolean saveMode) throws LimaException;
-}
Deleted: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ImportServiceLocal.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ImportServiceLocal.java 2012-04-11 13:34:48 UTC (rev 3358)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ImportServiceLocal.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -1,44 +0,0 @@
-/*
- * #%L
- * Lima business
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2008 - 2010 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-package org.chorem.lima.business.ejbinterface;
-
-import javax.ejb.Local;
-
-/**
- * Import export service.
- * <p/>
- * Currently import and export as XML.
- *
- * @author chatellier
- * @version $Revision$
- * <p/>
- * Last update : $Date$
- * By : $Author$
- */
-@Local
-public interface ImportServiceLocal extends ImportService {
-
-}
Deleted: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/OptionsService.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/OptionsService.java 2012-04-11 13:34:48 UTC (rev 3358)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/OptionsService.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -1,57 +0,0 @@
-/*
- * #%L
- * Lima :: business
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2008 - 2011 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-package org.chorem.lima.business.ejbinterface;
-
-import javax.ejb.Remote;
-
-/**
- * Service de report des certaines configurations du swing dans business
- * <p/>
- * Actuellement :
- * <ul>
- * <li>scale</li>
- * </ul>
- *
- * @author salaun
- */
-
-@Remote
-public interface OptionsService {
-
- /**
- * Sets the swing scale to the business scale
- *
- * @param scale scale
- */
- void setScale(String scale);
-
- /**
- * Gets the business scale
- *
- * @return scale
- */
- int getScale();
-
-}
Deleted: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/OptionsServiceLocal.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/OptionsServiceLocal.java 2012-04-11 13:34:48 UTC (rev 3358)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/OptionsServiceLocal.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -1,32 +0,0 @@
-/*
- * #%L
- * Lima :: business
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2008 - 2011 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-package org.chorem.lima.business.ejbinterface;
-
-import javax.ejb.Local;
-
-@Local
-public interface OptionsServiceLocal extends OptionsService {
-
-}
Deleted: 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 2012-04-11 13:34:48 UTC (rev 3358)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ReportService.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -1,150 +0,0 @@
-/*
- * #%L
- * Lima business
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2008 - 2010 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-package org.chorem.lima.business.ejbinterface;
-
-import org.chorem.lima.beans.BalanceTrial;
-import org.chorem.lima.beans.ReportsDatas;
-import org.chorem.lima.business.LimaException;
-import org.chorem.lima.entity.Account;
-import org.chorem.lima.entity.EntryBook;
-import org.chorem.lima.entity.FiscalPeriod;
-import org.nuiton.topia.TopiaContext;
-
-import javax.ejb.Remote;
-import java.util.Date;
-import java.util.List;
-
-/**
- * Service de generation des rapports.
- * <p/>
- * Actuellement:
- * <ul>
- * <li>Balance</li>
- * <li>Bilan</li>
- * <li>TVA</li>
- * </ul>
- *
- * @author chatellier
- * @version $Revision$
- * <p/>
- * Last update : $Date$
- * By : $Author$
- */
-
-@Remote
-public interface ReportService {
-
- /**
- * Generation de la balance.
- *
- * @param beginDate
- * @param endDate
- * @param selectedAccounts
- * @param getEntries
- * @param movementedFilter
- * @return la balance
- * @throws LimaException
- */
- BalanceTrial generateBalanceTrial(Date beginDate,
- Date endDate,
- String selectedAccounts,
- Boolean getEntries,
- Boolean movementedFilter) throws LimaException;
-
- /**
- * Generation du grand-livre.
- *
- * @param beginDate
- * @param endDate
- * @param selectedAccounts
- * @param movementedFilter
- * @return
- * @throws LimaException
- */
- BalanceTrial generateLedger(Date beginDate,
- Date endDate,
- String selectedAccounts,
- Boolean movementedFilter) throws LimaException;
-
-
- /**
- * Generation du rapports des comptes.
- *
- * @param account
- * @param thirdPartAccountsMode
- * @param beginDate
- * @param endDate
- * @return
- * @throws LimaException
- */
- ReportsDatas generateAccountsReports(Account account,
- Boolean thirdPartAccountsMode,
- Date beginDate,
- Date endDate) throws LimaException;
-
-
- /**
- * Calculate all credit, debit and solde amounts for the balance.
- * <p/>
- * Get all entries if true
- *
- * @param account
- * @param beginDate
- * @param endDate
- * @param getEntries
- * @param topiaContext
- * @return
- * @throws LimaException
- */
- ReportsDatas generateSubAccountBalanceWithTransaction(Account account,
- Date beginDate,
- Date endDate,
- Boolean getEntries,
- TopiaContext topiaContext) throws LimaException;
-
- /**
- * Generation du rapports des journaux.
- *
- * @param entryBook
- * @param beginDate
- * @param endDate
- * @return
- * @throws LimaException
- */
- ReportsDatas generateEntryBooksReports(EntryBook entryBook,
- Date beginDate,
- Date endDate) throws LimaException;
-
- /**
- * Generate VAT.
- *
- * @param fiscalPeriod
- * @return
- * @throws LimaException
- */
- List<Object> generateVat(FiscalPeriod fiscalPeriod) throws LimaException;
-
-}
Deleted: 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 2012-04-11 13:34:48 UTC (rev 3358)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ReportServiceLocal.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -1,62 +0,0 @@
-/*
- * #%L
- * Lima business
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2008 - 2010 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-package org.chorem.lima.business.ejbinterface;
-
-import org.chorem.lima.beans.ReportsDatas;
-import org.chorem.lima.business.LimaException;
-import org.chorem.lima.entity.Account;
-import org.nuiton.topia.TopiaContext;
-
-import javax.ejb.Local;
-import java.util.Date;
-
-
-/**
- * Service de generation des rapports.
- * <p/>
- * Actuellement:
- * <ul>
- * <li>Balance</li>
- * <li>Bilan</li>
- * </ul>
- *
- * @author chatellier
- * @version $Revision$
- * <p/>
- * Last update : $Date$
- * By : $Author$
- */
-
-@Local
-public interface ReportServiceLocal extends ReportService {
-
- ReportsDatas generateAccountReportsWithTransaction(Account account,
- Boolean thirdPartAccountsMode,
- Date beginDate,
- Date endDate,
- TopiaContext topiaContext) throws LimaException;
-
-}
Deleted: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/VatStatementService.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/VatStatementService.java 2012-04-11 13:34:48 UTC (rev 3358)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/VatStatementService.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -1,64 +0,0 @@
-/*
- * #%L
- * Lima :: business
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2008 - 2011 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-package org.chorem.lima.business.ejbinterface;
-
-import org.chorem.lima.beans.VatStatementAmounts;
-import org.chorem.lima.business.LimaException;
-import org.chorem.lima.entity.VatStatement;
-
-import javax.ejb.Remote;
-import java.util.Date;
-import java.util.List;
-
-@Remote
-public interface VatStatementService {
-
- void createVatStatement(VatStatement masterVatStatement,
- VatStatement vatStatement) throws LimaException;
-
- List<VatStatement> getAllVatStatements() throws LimaException;
-
- List<VatStatement> getAllChildrenVatStatement(VatStatement vatStatement,
- List<VatStatement> result) throws LimaException;
-
- List<VatStatement> getChildrenVatStatement(VatStatement masterVatStatement) throws LimaException;
-
- void updateVatStatement(VatStatement vatStatement) throws LimaException;
-
- VatStatementAmounts vatStatementAmounts(VatStatement vatStatement,
- Date selectedBeginDate,
- Date selectedEndDate) throws LimaException;
-
- VatStatement findVatStatementByString(String label) throws LimaException;
-
- List<VatStatementAmounts> vatStatementReport(Date beginDate,
- Date endDate) throws LimaException;
-
- void removeAllVatStatement() throws LimaException;
-
- void removeVatStatement(VatStatement vatStatement) throws LimaException;
-
-
-}
\ No newline at end of file
Deleted: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/VatStatementServiceLocal.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/VatStatementServiceLocal.java 2012-04-11 13:34:48 UTC (rev 3358)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/VatStatementServiceLocal.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -1,54 +0,0 @@
-/*
- * #%L
- * Lima :: business
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2008 - 2011 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-package org.chorem.lima.business.ejbinterface;
-
-import org.chorem.lima.beans.VatStatementAmounts;
-import org.chorem.lima.beans.VatStatementDatas;
-import org.chorem.lima.business.LimaException;
-import org.chorem.lima.entity.VatStatement;
-import org.nuiton.topia.TopiaContext;
-
-import javax.ejb.Local;
-import java.util.Date;
-
-@Local
-public interface VatStatementServiceLocal extends VatStatementService {
-
- void createVatStatementWithTransaction(
- VatStatement masterVatStatement, VatStatement vatStatement,
- TopiaContext transaction) throws LimaException;
-
- VatStatementAmounts vatStatementAmounts(VatStatement vatStatement,
- Date selectedBeginDate,
- Date selectedEndDate,
- TopiaContext topiacontext) throws LimaException;
-
- VatStatementDatas vatStatementReport(VatStatement vatStatement,
- Date selectedBeginDate,
- Date selectedEndDate,
- VatStatementDatas result,
- TopiaContext topiaContext) throws LimaException;
-
-}
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/monitorable/AccountServiceMonitorable.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/monitorable/AccountServiceMonitorable.java 2012-04-11 13:34:48 UTC (rev 3358)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/monitorable/AccountServiceMonitorable.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -26,7 +26,7 @@
package org.chorem.lima.business.monitorable;
import org.chorem.lima.business.ServiceMonitorable;
-import org.chorem.lima.business.ejbinterface.AccountService;
+import org.chorem.lima.business.api.AccountService;
public interface AccountServiceMonitorable extends AccountService, ServiceMonitorable {
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/monitorable/DocumentServiceMonitorable.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/monitorable/DocumentServiceMonitorable.java 2012-04-11 13:34:48 UTC (rev 3358)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/monitorable/DocumentServiceMonitorable.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -26,7 +26,7 @@
package org.chorem.lima.business.monitorable;
import org.chorem.lima.business.ServiceMonitorable;
-import org.chorem.lima.business.ejbinterface.DocumentService;
+import org.chorem.lima.business.api.DocumentService;
public interface DocumentServiceMonitorable extends DocumentService, ServiceMonitorable {
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/monitorable/EntryBookServiceMonitorable.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/monitorable/EntryBookServiceMonitorable.java 2012-04-11 13:34:48 UTC (rev 3358)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/monitorable/EntryBookServiceMonitorable.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -26,7 +26,7 @@
package org.chorem.lima.business.monitorable;
import org.chorem.lima.business.ServiceMonitorable;
-import org.chorem.lima.business.ejbinterface.EntryBookService;
+import org.chorem.lima.business.api.EntryBookService;
public interface EntryBookServiceMonitorable extends EntryBookService, ServiceMonitorable {
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/monitorable/ExportServiceMonitorable.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/monitorable/ExportServiceMonitorable.java 2012-04-11 13:34:48 UTC (rev 3358)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/monitorable/ExportServiceMonitorable.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -26,7 +26,7 @@
package org.chorem.lima.business.monitorable;
import org.chorem.lima.business.ServiceMonitorable;
-import org.chorem.lima.business.ejbinterface.ExportService;
+import org.chorem.lima.business.api.ExportService;
public interface ExportServiceMonitorable extends ExportService, ServiceMonitorable {
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/monitorable/FinancialPeriodServiceMonitorable.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/monitorable/FinancialPeriodServiceMonitorable.java 2012-04-11 13:34:48 UTC (rev 3358)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/monitorable/FinancialPeriodServiceMonitorable.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -26,7 +26,7 @@
package org.chorem.lima.business.monitorable;
import org.chorem.lima.business.ServiceMonitorable;
-import org.chorem.lima.business.ejbinterface.FinancialPeriodService;
+import org.chorem.lima.business.api.FinancialPeriodService;
public interface FinancialPeriodServiceMonitorable extends FinancialPeriodService, ServiceMonitorable {
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/monitorable/FinancialStatementServiceMonitorable.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/monitorable/FinancialStatementServiceMonitorable.java 2012-04-11 13:34:48 UTC (rev 3358)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/monitorable/FinancialStatementServiceMonitorable.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -26,7 +26,7 @@
package org.chorem.lima.business.monitorable;
import org.chorem.lima.business.ServiceMonitorable;
-import org.chorem.lima.business.ejbinterface.FinancialStatementService;
+import org.chorem.lima.business.api.FinancialStatementService;
public interface FinancialStatementServiceMonitorable extends FinancialStatementService, ServiceMonitorable {
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/monitorable/FinancialTransactionServiceMonitorable.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/monitorable/FinancialTransactionServiceMonitorable.java 2012-04-11 13:34:48 UTC (rev 3358)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/monitorable/FinancialTransactionServiceMonitorable.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -26,7 +26,7 @@
package org.chorem.lima.business.monitorable;
import org.chorem.lima.business.ServiceMonitorable;
-import org.chorem.lima.business.ejbinterface.FinancialTransactionService;
+import org.chorem.lima.business.api.FinancialTransactionService;
public interface FinancialTransactionServiceMonitorable extends FinancialTransactionService, ServiceMonitorable {
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/monitorable/FiscalPeriodServiceMonitorable.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/monitorable/FiscalPeriodServiceMonitorable.java 2012-04-11 13:34:48 UTC (rev 3358)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/monitorable/FiscalPeriodServiceMonitorable.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -26,7 +26,7 @@
package org.chorem.lima.business.monitorable;
import org.chorem.lima.business.ServiceMonitorable;
-import org.chorem.lima.business.ejbinterface.FiscalPeriodService;
+import org.chorem.lima.business.api.FiscalPeriodService;
public interface FiscalPeriodServiceMonitorable extends FiscalPeriodService, ServiceMonitorable {
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/monitorable/HttpServerServiceMonitorable.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/monitorable/HttpServerServiceMonitorable.java 2012-04-11 13:34:48 UTC (rev 3358)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/monitorable/HttpServerServiceMonitorable.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -26,7 +26,7 @@
package org.chorem.lima.business.monitorable;
import org.chorem.lima.business.ServiceMonitorable;
-import org.chorem.lima.business.ejbinterface.HttpServerService;
+import org.chorem.lima.business.api.HttpServerService;
public interface HttpServerServiceMonitorable extends HttpServerService, ServiceMonitorable {
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/monitorable/IdentityServiceMonitorable.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/monitorable/IdentityServiceMonitorable.java 2012-04-11 13:34:48 UTC (rev 3358)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/monitorable/IdentityServiceMonitorable.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -26,7 +26,7 @@
package org.chorem.lima.business.monitorable;
import org.chorem.lima.business.ServiceMonitorable;
-import org.chorem.lima.business.ejbinterface.IdentityService;
+import org.chorem.lima.business.api.IdentityService;
public interface IdentityServiceMonitorable extends IdentityService, ServiceMonitorable {
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/monitorable/ImportServiceMonitorable.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/monitorable/ImportServiceMonitorable.java 2012-04-11 13:34:48 UTC (rev 3358)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/monitorable/ImportServiceMonitorable.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -26,7 +26,7 @@
package org.chorem.lima.business.monitorable;
import org.chorem.lima.business.ServiceMonitorable;
-import org.chorem.lima.business.ejbinterface.ImportService;
+import org.chorem.lima.business.api.ImportService;
public interface ImportServiceMonitorable extends ImportService, ServiceMonitorable {
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/monitorable/OptionsServiceMonitorable.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/monitorable/OptionsServiceMonitorable.java 2012-04-11 13:34:48 UTC (rev 3358)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/monitorable/OptionsServiceMonitorable.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -22,11 +22,11 @@
* <http://www.gnu.org/licenses/gpl-3.0.html>.
* #L%
*/
-package org.chorem.lima.business.monitorable;
-
+package org.chorem.lima.business.monitorable;
+
import org.chorem.lima.business.ServiceMonitorable;
-import org.chorem.lima.business.ejbinterface.OptionsService;
-
-public interface OptionsServiceMonitorable extends OptionsService, ServiceMonitorable {
-
-}
+import org.chorem.lima.business.api.OptionsService;
+
+public interface OptionsServiceMonitorable extends OptionsService, ServiceMonitorable {
+
+}
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/monitorable/ReportServiceMonitorable.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/monitorable/ReportServiceMonitorable.java 2012-04-11 13:34:48 UTC (rev 3358)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/monitorable/ReportServiceMonitorable.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -26,7 +26,7 @@
package org.chorem.lima.business.monitorable;
import org.chorem.lima.business.ServiceMonitorable;
-import org.chorem.lima.business.ejbinterface.ReportService;
+import org.chorem.lima.business.api.ReportService;
public interface ReportServiceMonitorable extends ReportService, ServiceMonitorable {
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/monitorable/VatStatementServiceMonitorable.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/monitorable/VatStatementServiceMonitorable.java 2012-04-11 13:34:48 UTC (rev 3358)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/monitorable/VatStatementServiceMonitorable.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -25,7 +25,7 @@
package org.chorem.lima.business.monitorable;
import org.chorem.lima.business.ServiceMonitorable;
-import org.chorem.lima.business.ejbinterface.VatStatementService;
+import org.chorem.lima.business.api.VatStatementService;
public interface VatStatementServiceMonitorable extends VatStatementService, ServiceMonitorable {
Deleted: trunk/lima-business/src/main/java/org/chorem/lima/business/utils/FormatsEnum.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/utils/FormatsEnum.java 2012-04-11 13:34:48 UTC (rev 3358)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/utils/FormatsEnum.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -1,70 +0,0 @@
-/*
- * #%L
- * Lima business
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2008 - 2010 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-package org.chorem.lima.business.utils;
-
-public enum FormatsEnum {
-
- HTML(".html", "text/html", "Page Html"),
- PDF(".pdf", "application/pdf", "Document PDF");
-
- private final String extension;
-
- private final String mimeType;
-
- private final String description;
-
- private FormatsEnum(String extension, String mimeType, String description) {
- this.extension = extension;
- this.mimeType = mimeType;
- this.description = description;
- }
-
- public String getExtension() {
- return extension;
- }
-
- public String getMimeType() {
- return mimeType;
- }
-
- public String getDescription() {
- return description;
- }
-
- public static FormatsEnum valueOfExtension(String extension) {
- FormatsEnum value = null;
-
- for (FormatsEnum formatsEnum : FormatsEnum.values()) {
- if (extension.equals(formatsEnum.getExtension())) {
- value = formatsEnum;
- break;
- }
- }
- return value;
- }
-
-
-}
Deleted: trunk/lima-business/src/main/java/org/chorem/lima/business/utils/ImportExportEntityEnum.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/utils/ImportExportEntityEnum.java 2012-04-11 13:34:48 UTC (rev 3358)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/utils/ImportExportEntityEnum.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -1,64 +0,0 @@
-/*
- * #%L
- * Lima business
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2008 - 2010 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-package org.chorem.lima.business.utils;
-
-public enum ImportExportEntityEnum {
-
- ACCOUNT("ACCN"),
- ENTRYBOOK("ENBK"),
- FINANCIALSTATEMENT("FNST"),
- FISCALPERIOD("FSCP"),
- CLOSEDPERIODICENTRYBOOK("CPEB"),
- FINANCIALTRANSACTION("FTRC"),
- ENTRY("NTRY"),
- VATSTATEMENT("VAT"),
- IDENTITY("IDNT"),
- VATPDF("VATPDF");
-
- private final String label;
-
- ImportExportEntityEnum(String label) {
- this.label = label;
- }
-
- public String getLabel() {
- return label;
- }
-
- public static ImportExportEntityEnum valueOfLabel(String label) {
- ImportExportEntityEnum value = null;
-
- for (ImportExportEntityEnum importExportEntityEnum : ImportExportEntityEnum.values()) {
- if (label.equals(importExportEntityEnum.label)) {
- value = importExportEntityEnum;
- break;
- }
- }
- return value;
- }
-}
-
-
Modified: trunk/lima-business/src/test/java/org/chorem/lima/business/AbstractLimaTest.java
===================================================================
--- trunk/lima-business/src/test/java/org/chorem/lima/business/AbstractLimaTest.java 2012-04-11 13:34:48 UTC (rev 3358)
+++ trunk/lima-business/src/test/java/org/chorem/lima/business/AbstractLimaTest.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -40,13 +40,13 @@
import org.chorem.lima.business.accountingrules.TestAccountingRules;
import org.chorem.lima.business.ejb.ClearService;
import org.chorem.lima.business.ejb.ClearServiceMonitorable;
-import org.chorem.lima.business.ejbinterface.AccountService;
-import org.chorem.lima.business.ejbinterface.EntryBookService;
-import org.chorem.lima.business.ejbinterface.FinancialPeriodService;
-import org.chorem.lima.business.ejbinterface.FinancialTransactionService;
-import org.chorem.lima.business.ejbinterface.FiscalPeriodService;
-import org.chorem.lima.business.ejbinterface.ImportService;
-import org.chorem.lima.business.ejbinterface.ReportService;
+import org.chorem.lima.business.api.AccountService;
+import org.chorem.lima.business.api.EntryBookService;
+import org.chorem.lima.business.api.FinancialPeriodService;
+import org.chorem.lima.business.api.FinancialTransactionService;
+import org.chorem.lima.business.api.FiscalPeriodService;
+import org.chorem.lima.business.api.ImportService;
+import org.chorem.lima.business.api.ReportService;
import org.chorem.lima.business.monitorable.AccountServiceMonitorable;
import org.chorem.lima.business.monitorable.EntryBookServiceMonitorable;
import org.chorem.lima.business.monitorable.FinancialPeriodServiceMonitorable;
Property changes on: trunk/lima-business-api
___________________________________________________________________
Added: svn:ignore
+ target
.idea
.classpath
.project
.settigns
*.ipr
*.iws
*.iml
Added: trunk/lima-business-api/pom.xml
===================================================================
--- trunk/lima-business-api/pom.xml (rev 0)
+++ trunk/lima-business-api/pom.xml 2012-04-11 15:59:40 UTC (rev 3359)
@@ -0,0 +1,51 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <!-- ************************************************************* -->
+ <!-- *** POM Relationships *************************************** -->
+ <!-- ************************************************************* -->
+ <parent>
+ <groupId>org.chorem</groupId>
+ <artifactId>lima</artifactId>
+ <version>0.6-SNAPSHOT</version>
+ </parent>
+
+ <groupId>org.chorem.lima</groupId>
+ <artifactId>lima-business-api</artifactId>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.openejb</groupId>
+ <artifactId>javaee-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>lima-callao</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+
+ <!-- ************************************************************* -->
+ <!-- *** Project Information ************************************* -->
+ <!-- ************************************************************* -->
+ <name>Lima :: business API</name>
+ <description>Business API module for lima</description>
+
+ <properties>
+ </properties>
+
+ <!-- ************************************************************* -->
+ <!-- *** Build Settings ****************************************** -->
+ <!-- ************************************************************* -->
+
+ <build>
+ </build>
+
+ <profiles>
+ </profiles>
+
+</project>
+
Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/LimaException.java (from rev 3358, trunk/lima-business/src/main/java/org/chorem/lima/business/LimaException.java)
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/LimaException.java (rev 0)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/LimaException.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -0,0 +1,60 @@
+/*
+ * #%L
+ * Lima business
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2008 - 2010 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+package org.chorem.lima.business;
+
+/**
+ * Lima exception.
+ *
+ * @author chatellier
+ * @version $Revision$
+ * <p/>
+ * Last update : $Date$
+ * By : $Author$
+ */
+public class LimaException extends Exception {
+
+ /** serialVersionUID. */
+ private static final long serialVersionUID = -6876236663940184462L;
+
+ /**
+ * Constructs a new exception with the specified detail message.
+ *
+ * @param message message
+ */
+ public LimaException(String message) {
+ super(message);
+ }
+
+ /**
+ * Constructs a new exception with the specified detail message and cause.
+ *
+ * @param message message
+ * @param cause cause
+ */
+ public LimaException(String message, Throwable cause) {
+ super(message, cause);
+ }
+}
Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/AccountService.java (from rev 3358, trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/AccountService.java)
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/AccountService.java (rev 0)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/AccountService.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -0,0 +1,100 @@
+/*
+ * #%L
+ * Lima business
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2008 - 2012 CodeLutin, Chatellier Eric
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+package org.chorem.lima.business.api;
+
+import org.chorem.lima.business.LimaException;
+import org.chorem.lima.entity.Account;
+
+import javax.ejb.Remote;
+import java.util.List;
+
+/**
+ * Account service.
+ *
+ * @author chatellier
+ * @version $Revision$
+ * <p/>
+ * Last update : $Date$
+ * By : $Author$
+ */
+@Remote
+public interface AccountService {
+
+ /**
+ * Return account count.
+ *
+ * @return account count
+ * @throws LimaException technical exception
+ */
+ long getAccountCount() throws LimaException;
+
+ List<Account> getAllAccountByProperty(String propertyName,
+ String value) throws LimaException;
+
+ /**
+ * Obtain the master account for the given account number.
+ *
+ * the master account if the account with the longer account number prefixing the given account number.
+ *
+ * Example: for account number 401AB, it could be 4, 40, 401,...
+ *
+ * @param accountNumber the account number
+ * @return the master account number
+ * @throws LimaException if any pb while loading account
+ */
+ Account getMasterAccount(String accountNumber) throws LimaException;
+
+ Account getAccountByNumber(String number) throws LimaException;
+
+ /**
+ * Return all account ordered by account name.
+ *
+ * @return all account
+ * @throws LimaException
+ */
+ List<Account> getAllAccounts() throws LimaException;
+
+ List<Account> getAllLeafAccounts() throws LimaException;
+
+ /**
+ * Create new account. If {@code masterAccount} is not null, {@code account}
+ * is added in {@code masterAccount}'s subAccounts.
+ *
+ * @param account account
+ * @throws LimaException
+ */
+ Account createAccount(Account account) throws LimaException;
+
+ Account updateAccount(Account account) throws LimaException;
+
+ void removeAccount(Account account) throws LimaException;
+
+ void removeAllAccount() throws LimaException;
+
+ List<Account> getAllChildrenAccounts(Account masterAccount) throws LimaException;
+
+ List<Account> getChildrenAccounts(Account masterAccount) throws LimaException;
+}
Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/AccountServiceLocal.java (from rev 3358, trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/AccountServiceLocal.java)
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/AccountServiceLocal.java (rev 0)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/AccountServiceLocal.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -0,0 +1,48 @@
+/*
+ * #%L
+ * Lima business
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2008 - 2012 CodeLutin, Chatellier Eric
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+package org.chorem.lima.business.api;
+
+import org.chorem.lima.business.LimaException;
+import org.chorem.lima.entity.Account;
+import org.nuiton.topia.TopiaContext;
+
+import javax.ejb.Local;
+
+/**
+ * Account service.
+ *
+ * @author chatellier
+ * @version $Revision$
+ * <p/>
+ * Last update : $Date$
+ * By : $Author$
+ */
+@Local
+public interface AccountServiceLocal extends AccountService {
+
+ Account createAccountWithTransaction(Account account, TopiaContext topiaContext) throws LimaException;
+
+}
\ No newline at end of file
Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/DocumentService.java (from rev 3358, trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/DocumentService.java)
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/DocumentService.java (rev 0)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/DocumentService.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -0,0 +1,55 @@
+/*
+ * #%L
+ * Lima business
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2008 - 2010 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+package org.chorem.lima.business.api;
+
+import org.chorem.lima.business.LimaException;
+import org.chorem.lima.business.utils.FormatsEnum;
+
+import javax.ejb.Remote;
+import java.util.Date;
+
+/**
+ * Interface to create pdf and html docs
+ *
+ * @author john
+ */
+
+@Remote
+public interface DocumentService {
+
+ 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;
+
+ void createVatDocuments(Date beginDate, Date endDate, FormatsEnum format, String autocomplete) throws LimaException;
+
+}
Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/DocumentServiceLocal.java (from rev 3358, trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/DocumentServiceLocal.java)
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/DocumentServiceLocal.java (rev 0)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/DocumentServiceLocal.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -0,0 +1,39 @@
+/*
+ * #%L
+ * Lima business
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2008 - 2010 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+package org.chorem.lima.business.api;
+
+import javax.ejb.Local;
+
+/**
+ * Interface to create pdf and html docs
+ *
+ * @author john
+ */
+
+@Local
+public interface DocumentServiceLocal extends DocumentService {
+
+}
Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/EntryBookService.java (from rev 3358, trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/EntryBookService.java)
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/EntryBookService.java (rev 0)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/EntryBookService.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -0,0 +1,89 @@
+/*
+ * #%L
+ * Lima business
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2008 - 2012 CodeLutin, Chatellier Eric
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+package org.chorem.lima.business.api;
+
+import org.chorem.lima.business.LimaException;
+import org.chorem.lima.entity.EntryBook;
+
+import javax.ejb.Remote;
+import java.util.List;
+
+/**
+ * Entry book service.
+ *
+ * @author chatellier
+ * @version $Revision$
+ * <p/>
+ * Last update : $Date$
+ * By : $Author$
+ */
+@Remote
+public interface EntryBookService {
+
+ /**
+ * Find entry book by code.
+ *
+ * @param code entry book code
+ * @return
+ * @throws LimaException
+ */
+ EntryBook getEntryBookByCode(String code) throws LimaException;
+
+ /**
+ * Get all entry book.
+ *
+ * @return all entrybook
+ * @throws LimaException
+ */
+ List<EntryBook> getAllEntryBooks() throws LimaException;
+
+ /**
+ * Create new entry book.
+ *
+ * @param entryBook
+ * @throws LimaException
+ */
+ EntryBook createEntryBook(EntryBook entryBook) throws LimaException;
+
+ /**
+ * Permet de modifier un journal.
+ *
+ * @param entryBook journal
+ * @throws LimaException
+ */
+ EntryBook updateEntryBook(EntryBook entryBook) throws LimaException;
+
+ /**
+ * Permet d'effacer un EntryBook dans la base de données.
+ * <p/>
+ * ATTENTION : si un EntryBook est associé avec des entrées, il est alors
+ * impossible de supprimer celui-ci.
+ *
+ * @param entryBook
+ * @throws LimaException
+ */
+ void removeEntryBook(EntryBook entryBook) throws LimaException;
+}
Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/EntryBookServiceLocal.java (from rev 3358, trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/EntryBookServiceLocal.java)
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/EntryBookServiceLocal.java (rev 0)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/EntryBookServiceLocal.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -0,0 +1,50 @@
+/*
+ * #%L
+ * Lima business
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2008 - 2010 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+package org.chorem.lima.business.api;
+
+import org.chorem.lima.business.LimaException;
+import org.chorem.lima.entity.EntryBook;
+import org.nuiton.topia.TopiaContext;
+
+import javax.ejb.Local;
+
+
+/**
+ * Entry book service.
+ *
+ * @author chatellier
+ * @version $Revision$
+ * <p/>
+ * Last update : $Date$
+ * By : $Author$
+ */
+
+@Local
+public interface EntryBookServiceLocal extends EntryBookService {
+
+ EntryBook createEntryBookWithTransaction(EntryBook entryBook, TopiaContext topiaContext) throws LimaException;
+
+}
Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/ExportService.java (from rev 3358, trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ExportService.java)
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/ExportService.java (rev 0)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/ExportService.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -0,0 +1,74 @@
+/*
+ * #%L
+ * Lima business
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2008 - 2010 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+package org.chorem.lima.business.api;
+
+import org.chorem.lima.business.LimaException;
+
+import javax.ejb.Remote;
+
+/**
+ * Import export service.
+ * <p/>
+ * Currently import and export as XML.
+ *
+ * @author chatellier
+ * @version $Revision$
+ * <p/>
+ * Last update : $Date$
+ * By : $Author$
+ */
+@Remote
+public interface ExportService {
+
+
+ /**
+ * Get database export as CSV;
+ *
+ * @return export as byte array
+ * @throws LimaException
+ */
+ String exportAsCSV() throws LimaException;
+
+ /** export entrybook chart as CSV. */
+ String exportEntryBookChartAsCSV() throws LimaException;
+
+ /** export financialstatement chart as CSV. */
+ String exportFinancialStatementChartAsCSV() throws LimaException;
+
+ /** export vatstatement chart as CSV */
+ String exportVatStatementChartAsCSV() throws LimaException;
+
+ /** export accounts chart as CSV. */
+ String exportAccountsChartAsCSV() throws LimaException;
+
+ /** export entries as EBP */
+ String exportEntriesAsEBP() throws LimaException;
+
+ /** export accounts as EBP */
+ String exportAccountsAsEBP() throws LimaException;
+
+
+}
Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/ExportServiceLocal.java (from rev 3358, trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ExportServiceLocal.java)
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/ExportServiceLocal.java (rev 0)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/ExportServiceLocal.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -0,0 +1,44 @@
+/*
+ * #%L
+ * Lima business
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2008 - 2010 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+package org.chorem.lima.business.api;
+
+import javax.ejb.Local;
+
+/**
+ * Import export service.
+ * <p/>
+ * Currently import and export as XML.
+ *
+ * @author chatellier
+ * @version $Revision$
+ * <p/>
+ * Last update : $Date$
+ * By : $Author$
+ */
+@Local
+public interface ExportServiceLocal extends ExportService {
+
+}
Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialPeriodService.java (from rev 3358, trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialPeriodService.java)
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialPeriodService.java (rev 0)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialPeriodService.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -0,0 +1,65 @@
+/*
+ * #%L
+ * Lima business
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2008 - 2010 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+package org.chorem.lima.business.api;
+
+import org.chorem.lima.business.LimaException;
+import org.chorem.lima.entity.ClosedPeriodicEntryBook;
+import org.chorem.lima.entity.EntryBook;
+import org.chorem.lima.entity.FinancialPeriod;
+
+import javax.ejb.Remote;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * Financial period service.
+ *
+ * @author chatellier
+ * @version $Revision$
+ * <p/>
+ * Last update : $Date$
+ * By : $Author$
+ */
+
+@Remote
+public interface FinancialPeriodService {
+
+ List<FinancialPeriod> getUnblockedFinancialPeriods() throws LimaException;
+
+ void createFinancialPeriods(List<FinancialPeriod> financialPeriods) throws LimaException;
+
+ ClosedPeriodicEntryBook getClosedPeriodicEntryBook(EntryBook entryBook,
+ FinancialPeriod financialPeriod) throws LimaException;
+
+ List<ClosedPeriodicEntryBook> getAllClosedPeriodicEntryBooksFromUnblockedFiscalPeriod() throws LimaException;
+
+ void blockClosedPeriodicEntryBook(ClosedPeriodicEntryBook closedPeriodicEntryBook) throws LimaException;
+
+ List<FinancialPeriod> getAllFinancialPeriods() throws LimaException;
+
+ List<FinancialPeriod> getFinancialPeriods(Date beginDate,
+ Date endDate) throws LimaException;
+}
Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialPeriodServiceLocal.java (from rev 3358, trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialPeriodServiceLocal.java)
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialPeriodServiceLocal.java (rev 0)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialPeriodServiceLocal.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -0,0 +1,57 @@
+/*
+ * #%L
+ * Lima business
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2008 - 2010 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+package org.chorem.lima.business.api;
+
+import org.chorem.lima.business.LimaException;
+import org.chorem.lima.entity.ClosedPeriodicEntryBook;
+import org.chorem.lima.entity.FinancialPeriod;
+import org.nuiton.topia.TopiaContext;
+
+import javax.ejb.Local;
+import java.util.List;
+
+
+/**
+ * Financial period service.
+ *
+ * @author chatellier
+ * @version $Revision$
+ * <p/>
+ * Last update : $Date$
+ * By : $Author$
+ */
+
+@Local
+public interface FinancialPeriodServiceLocal extends FinancialPeriodService {
+
+ void createFinancialPeriodsWithTransaction(List<FinancialPeriod> financialPeriods,
+ TopiaContext topiaContext) throws LimaException;
+
+ void blockClosedPeriodicEntryBookWithTransaction(ClosedPeriodicEntryBook closedPeriodicEntryBook,
+ TopiaContext topiaContext) throws LimaException;
+
+
+}
Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialStatementService.java (from rev 3358, trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialStatementService.java)
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialStatementService.java (rev 0)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialStatementService.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -0,0 +1,61 @@
+/*
+ * #%L
+ * Lima business
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2008 - 2010 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+package org.chorem.lima.business.api;
+
+import org.chorem.lima.beans.FinancialStatementAmounts;
+import org.chorem.lima.business.LimaException;
+import org.chorem.lima.entity.FinancialStatement;
+
+import javax.ejb.Remote;
+import java.util.Date;
+import java.util.List;
+
+@Remote
+public interface FinancialStatementService {
+
+
+ void createFinancialStatement(FinancialStatement masterFinancialStatement,
+ FinancialStatement financialStatement) throws LimaException;
+
+ void updateFinancialStatement(FinancialStatement financialStatement) throws LimaException;
+
+ void removeFinancialStatement(FinancialStatement financialStatement) throws LimaException;
+
+ void removeAllFinancialStatement() throws LimaException;
+
+ List<FinancialStatement> getAllFinancialStatements() throws LimaException;
+
+ List<FinancialStatement> getChildrenFinancialStatement(FinancialStatement financialStatement) throws LimaException;
+
+ List<FinancialStatement> getAllChildrenFinancialStatement(FinancialStatement financialStatement,
+ List<FinancialStatement> financialStatements) throws LimaException;
+
+ List<FinancialStatementAmounts> financialStatementReport(Date selectedBeginDate,
+ Date selectedEndDate) throws LimaException;
+
+ String checkFinancialStatementChart() throws LimaException;
+
+}
Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialStatementServiceLocal.java (from rev 3358, trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialStatementServiceLocal.java)
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialStatementServiceLocal.java (rev 0)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialStatementServiceLocal.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -0,0 +1,42 @@
+/*
+ * #%L
+ * Lima business
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2008 - 2010 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+package org.chorem.lima.business.api;
+
+import org.chorem.lima.business.LimaException;
+import org.chorem.lima.entity.FinancialStatement;
+import org.nuiton.topia.TopiaContext;
+
+import javax.ejb.Local;
+
+@Local
+public interface FinancialStatementServiceLocal extends FinancialStatementService {
+
+ void createFinancialStatementWithTransaction(FinancialStatement masterFinancialStatement,
+ FinancialStatement financialStatement,
+ TopiaContext topiaContext) throws LimaException;
+
+
+}
Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialTransactionService.java (from rev 3358, trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialTransactionService.java)
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialTransactionService.java (rev 0)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialTransactionService.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -0,0 +1,93 @@
+/*
+ * #%L
+ * Lima business
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2008 - 2010 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+package org.chorem.lima.business.api;
+
+import org.chorem.lima.beans.FinancialTransactionSearch;
+import org.chorem.lima.business.LimaException;
+import org.chorem.lima.entity.Entry;
+import org.chorem.lima.entity.EntryBook;
+import org.chorem.lima.entity.FinancialPeriod;
+import org.chorem.lima.entity.FinancialTransaction;
+import org.chorem.lima.entity.FiscalPeriod;
+import org.chorem.lima.entity.Letter;
+
+import javax.ejb.Remote;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * Transaction service.
+ *
+ * @author chatellier
+ * @version $Revision$
+ * <p/>
+ * Last update : $Date$
+ * By : $Author$
+ */
+
+@Remote
+public interface FinancialTransactionService {
+
+
+ FinancialTransaction createFinancialTransaction(FinancialTransaction financialtransaction) throws LimaException;
+
+ void updateFinancialTransaction(FinancialTransaction financialtransaction) throws LimaException;
+
+ void removeFinancialTransaction(FinancialTransaction financialtransaction) throws LimaException;
+
+ List<FinancialTransaction> getAllFinancialTransactionsForFinancialPeriod(FinancialPeriod period) throws LimaException;
+
+ List<FinancialTransaction> getAllFinancialTransactionsFromDateToDate(Date beginDate,
+ Date endDate) throws LimaException;
+
+ List<FinancialTransaction> getAllFinancialTransactionsForEntryBookAndFinancialPeriod(EntryBook entryBook,
+ FinancialPeriod period) throws LimaException;
+
+ List<FinancialTransaction> getAllInexactFinancialTransactions(FiscalPeriod fiscalPeriod) throws LimaException;
+
+ List<FinancialTransaction> getAllFinancialTransactionsBalanced(FiscalPeriod fiscalPeriod) throws LimaException;
+
+ List<Object> searchFinancialTransaction(FinancialTransactionSearch financialTransactionSearch) throws LimaException;
+
+ Entry createEntry(Entry entry) throws LimaException;
+
+ void updateEntry(Entry entry) throws LimaException;
+
+ void removeEntry(Entry entry) throws LimaException;
+
+ Letter getNewLetter() throws LimaException;
+
+ void createLetter(Letter letter) throws LimaException;
+
+ void removeLetter(Letter letter) throws LimaException;
+
+ List<Letter> getAllLetters() throws LimaException;
+
+ void setEntryLetter(Entry entry, Letter letter) throws LimaException;
+
+ void removeEntryLetter(Entry entry) throws LimaException;
+
+}
Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialTransactionServiceLocal.java (from rev 3358, trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialTransactionServiceLocal.java)
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialTransactionServiceLocal.java (rev 0)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialTransactionServiceLocal.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -0,0 +1,57 @@
+/*
+ * #%L
+ * Lima business
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2008 - 2010 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+package org.chorem.lima.business.api;
+
+import org.chorem.lima.business.LimaException;
+import org.chorem.lima.entity.Entry;
+import org.chorem.lima.entity.FinancialTransaction;
+import org.nuiton.topia.TopiaContext;
+
+import javax.ejb.Local;
+
+/**
+ * Transaction service.
+ *
+ * @author chatellier
+ * @version $Revision$
+ * <p/>
+ * Last update : $Date$
+ * By : $Author$
+ */
+
+@Local
+public interface FinancialTransactionServiceLocal extends FinancialTransactionService {
+
+ FinancialTransaction createFinancialTransactionWithTransaction(FinancialTransaction financialtransaction,
+ TopiaContext topiaContext) throws LimaException;
+
+ void updateFinancialTransactionWithTransaction(FinancialTransaction financialtransaction,
+ TopiaContext topiaContext) throws LimaException;
+
+ Entry createEntryWithTransaction(Entry entry, TopiaContext topiaContext) throws LimaException;
+
+
+}
Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FiscalPeriodService.java (from rev 3358, trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FiscalPeriodService.java)
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FiscalPeriodService.java (rev 0)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FiscalPeriodService.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -0,0 +1,62 @@
+/*
+ * #%L
+ * Lima business
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2008 - 2010 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+package org.chorem.lima.business.api;
+
+import org.chorem.lima.business.LimaException;
+import org.chorem.lima.entity.EntryBook;
+import org.chorem.lima.entity.FiscalPeriod;
+
+import javax.ejb.Remote;
+import java.util.List;
+
+/**
+ * Fiscal period service.
+ *
+ * @author chatellier
+ * @version $Revision$
+ * <p/>
+ * Last update : $Date$
+ * By : $Author$
+ */
+@Remote
+public interface FiscalPeriodService {
+
+ List<FiscalPeriod> getAllFiscalPeriods() throws LimaException;
+
+ List<FiscalPeriod> getAllBlockedFiscalPeriods() throws LimaException;
+
+ List<FiscalPeriod> getAllUnblockedFiscalPeriods() throws LimaException;
+
+ FiscalPeriod getLastFiscalPeriod() throws LimaException;
+
+ FiscalPeriod createFiscalPeriod(FiscalPeriod fiscalPeriod) throws LimaException;
+
+ FiscalPeriod blockFiscalPeriod(FiscalPeriod fiscalPeriod) throws LimaException;
+
+ void addRetainedEarnings(FiscalPeriod fiscalPeriod,
+ boolean newyear,
+ EntryBook entryBook) throws LimaException;
+}
Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FiscalPeriodServiceLocal.java (from rev 3358, trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FiscalPeriodServiceLocal.java)
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FiscalPeriodServiceLocal.java (rev 0)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FiscalPeriodServiceLocal.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -0,0 +1,50 @@
+/*
+ * #%L
+ * Lima business
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2008 - 2010 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+package org.chorem.lima.business.api;
+
+import org.chorem.lima.business.LimaException;
+import org.chorem.lima.entity.FiscalPeriod;
+import org.nuiton.topia.TopiaContext;
+
+import javax.ejb.Local;
+
+/**
+ * Fiscal period service.
+ *
+ * @author chatellier
+ * @version $Revision$
+ * <p/>
+ * Last update : $Date$
+ * By : $Author$
+ */
+@Local
+public interface FiscalPeriodServiceLocal extends FiscalPeriodService {
+
+ FiscalPeriod createFiscalPeriodWithTransaction(FiscalPeriod fiscalPeriod,
+ TopiaContext topiaContext) throws LimaException;
+
+
+}
Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/HttpServerService.java (from rev 3358, trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/HttpServerService.java)
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/HttpServerService.java (rev 0)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/HttpServerService.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -0,0 +1,37 @@
+/*
+ * #%L
+ * Lima business
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2008 - 2010 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+package org.chorem.lima.business.api;
+
+import javax.ejb.Remote;
+
+@Remote
+public interface HttpServerService {
+
+ void start();
+
+ int getHttpPort();
+
+}
Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/HttpServerServiceLocal.java (from rev 3358, trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/HttpServerServiceLocal.java)
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/HttpServerServiceLocal.java (rev 0)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/HttpServerServiceLocal.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -0,0 +1,33 @@
+/*
+ * #%L
+ * Lima business
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2008 - 2010 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+package org.chorem.lima.business.api;
+
+import javax.ejb.Local;
+
+@Local
+public interface HttpServerServiceLocal extends HttpServerService {
+
+}
Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/IdentityService.java (from rev 3358, trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/IdentityService.java)
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/IdentityService.java (rev 0)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/IdentityService.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -0,0 +1,40 @@
+/*
+ * #%L
+ * Lima business
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2008 - 2010 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+package org.chorem.lima.business.api;
+
+import org.chorem.lima.business.LimaException;
+import org.chorem.lima.entity.Identity;
+
+import javax.ejb.Remote;
+
+@Remote
+public interface IdentityService {
+
+ Identity getIdentity() throws LimaException;
+
+ void updateIdentity(Identity identity) throws LimaException;
+
+}
Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/IdentityServiceLocal.java (from rev 3358, trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/IdentityServiceLocal.java)
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/IdentityServiceLocal.java (rev 0)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/IdentityServiceLocal.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -0,0 +1,42 @@
+/*
+ * #%L
+ * Lima business
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2008 - 2010 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+package org.chorem.lima.business.api;
+
+import org.chorem.lima.business.LimaException;
+import org.chorem.lima.entity.Identity;
+import org.nuiton.topia.TopiaContext;
+
+import javax.ejb.Local;
+
+@Local
+public interface IdentityServiceLocal extends IdentityService {
+
+ void updateIdentityWithTransaction(Identity identity,
+ TopiaContext topiaContext) throws LimaException;
+
+ Identity getIdentityWithTransaction(TopiaContext topiaContext) throws LimaException;
+
+}
Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/ImportService.java (from rev 3358, trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ImportService.java)
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/ImportService.java (rev 0)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/ImportService.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -0,0 +1,87 @@
+/*
+ * #%L
+ * Lima business
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2008 - 2012 CodeLutin, Chatellier Eric
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+package org.chorem.lima.business.api;
+
+import org.chorem.lima.business.LimaException;
+import org.chorem.lima.business.utils.ImportExportEntityEnum;
+
+import javax.ejb.Remote;
+
+/**
+ * Import export service.
+ * Currently import and export as CSV and EBP.
+ */
+@Remote
+public interface ImportService {
+
+ /**
+ * Import accounts as EBP import.
+ *
+ * @param data import file content as string (remote service can't take File)
+ * @return result log
+ * @throws LimaException
+ */
+ String importAccountsChartFromEbp(String data) throws LimaException;
+
+ /**
+ * Import entries as EBP import.
+ *
+ * @param data import file content as string (remote service can't take File)
+ * @return result log
+ * @throws LimaException
+ */
+ String importEntriesFromEbp(String data) throws LimaException;
+
+ /**
+ * Import data as lima CSV import.
+ *
+ * Read first line to detect file type and call {@link #importAsCSV(String, ImportExportEntityEnum)}.
+ *
+ * @param data import file content as string (remote service can't take File)
+ * @return result log
+ * @throws LimaException
+ */
+ String importAllAsCSV(String data) throws LimaException;
+
+ /**
+ * Import content as CSV depending on import type.
+ *
+ * @param data import file content as string (remote service can't take File)
+ * @param importExportEntityEnum import type
+ * @return result log
+ * @throws LimaException
+ */
+ String importAsCSV(String data,
+ ImportExportEntityEnum importExportEntityEnum) throws LimaException;
+
+ /**
+ * @deprecated import file (local, can't be used in remote mode)
+ * and wrong place for this method
+ */
+ String importAsPDF(String data,
+ ImportExportEntityEnum importExportEntityEnum,
+ boolean saveMode) throws LimaException;
+}
Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/ImportServiceLocal.java (from rev 3358, trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ImportServiceLocal.java)
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/ImportServiceLocal.java (rev 0)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/ImportServiceLocal.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -0,0 +1,44 @@
+/*
+ * #%L
+ * Lima business
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2008 - 2010 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+package org.chorem.lima.business.api;
+
+import javax.ejb.Local;
+
+/**
+ * Import export service.
+ * <p/>
+ * Currently import and export as XML.
+ *
+ * @author chatellier
+ * @version $Revision$
+ * <p/>
+ * Last update : $Date$
+ * By : $Author$
+ */
+@Local
+public interface ImportServiceLocal extends ImportService {
+
+}
Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/OptionsService.java (from rev 3358, trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/OptionsService.java)
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/OptionsService.java (rev 0)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/OptionsService.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -0,0 +1,57 @@
+/*
+ * #%L
+ * Lima :: business
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2008 - 2011 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+package org.chorem.lima.business.api;
+
+import javax.ejb.Remote;
+
+/**
+ * Service de report des certaines configurations du swing dans business
+ * <p/>
+ * Actuellement :
+ * <ul>
+ * <li>scale</li>
+ * </ul>
+ *
+ * @author salaun
+ */
+
+@Remote
+public interface OptionsService {
+
+ /**
+ * Sets the swing scale to the business scale
+ *
+ * @param scale scale
+ */
+ void setScale(String scale);
+
+ /**
+ * Gets the business scale
+ *
+ * @return scale
+ */
+ int getScale();
+
+}
Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/OptionsServiceLocal.java (from rev 3358, trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/OptionsServiceLocal.java)
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/OptionsServiceLocal.java (rev 0)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/OptionsServiceLocal.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -0,0 +1,32 @@
+/*
+ * #%L
+ * Lima :: business
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2008 - 2011 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+package org.chorem.lima.business.api;
+
+import javax.ejb.Local;
+
+@Local
+public interface OptionsServiceLocal extends OptionsService {
+
+}
Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/ReportService.java (from rev 3358, trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ReportService.java)
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/ReportService.java (rev 0)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/ReportService.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -0,0 +1,150 @@
+/*
+ * #%L
+ * Lima business
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2008 - 2010 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+package org.chorem.lima.business.api;
+
+import org.chorem.lima.beans.BalanceTrial;
+import org.chorem.lima.beans.ReportsDatas;
+import org.chorem.lima.business.LimaException;
+import org.chorem.lima.entity.Account;
+import org.chorem.lima.entity.EntryBook;
+import org.chorem.lima.entity.FiscalPeriod;
+import org.nuiton.topia.TopiaContext;
+
+import javax.ejb.Remote;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * Service de generation des rapports.
+ * <p/>
+ * Actuellement:
+ * <ul>
+ * <li>Balance</li>
+ * <li>Bilan</li>
+ * <li>TVA</li>
+ * </ul>
+ *
+ * @author chatellier
+ * @version $Revision$
+ * <p/>
+ * Last update : $Date$
+ * By : $Author$
+ */
+
+@Remote
+public interface ReportService {
+
+ /**
+ * Generation de la balance.
+ *
+ * @param beginDate
+ * @param endDate
+ * @param selectedAccounts
+ * @param getEntries
+ * @param movementedFilter
+ * @return la balance
+ * @throws LimaException
+ */
+ BalanceTrial generateBalanceTrial(Date beginDate,
+ Date endDate,
+ String selectedAccounts,
+ Boolean getEntries,
+ Boolean movementedFilter) throws LimaException;
+
+ /**
+ * Generation du grand-livre.
+ *
+ * @param beginDate
+ * @param endDate
+ * @param selectedAccounts
+ * @param movementedFilter
+ * @return
+ * @throws LimaException
+ */
+ BalanceTrial generateLedger(Date beginDate,
+ Date endDate,
+ String selectedAccounts,
+ Boolean movementedFilter) throws LimaException;
+
+
+ /**
+ * Generation du rapports des comptes.
+ *
+ * @param account
+ * @param thirdPartAccountsMode
+ * @param beginDate
+ * @param endDate
+ * @return
+ * @throws LimaException
+ */
+ ReportsDatas generateAccountsReports(Account account,
+ Boolean thirdPartAccountsMode,
+ Date beginDate,
+ Date endDate) throws LimaException;
+
+
+ /**
+ * Calculate all credit, debit and solde amounts for the balance.
+ * <p/>
+ * Get all entries if true
+ *
+ * @param account
+ * @param beginDate
+ * @param endDate
+ * @param getEntries
+ * @param topiaContext
+ * @return
+ * @throws LimaException
+ */
+ ReportsDatas generateSubAccountBalanceWithTransaction(Account account,
+ Date beginDate,
+ Date endDate,
+ Boolean getEntries,
+ TopiaContext topiaContext) throws LimaException;
+
+ /**
+ * Generation du rapports des journaux.
+ *
+ * @param entryBook
+ * @param beginDate
+ * @param endDate
+ * @return
+ * @throws LimaException
+ */
+ ReportsDatas generateEntryBooksReports(EntryBook entryBook,
+ Date beginDate,
+ Date endDate) throws LimaException;
+
+ /**
+ * Generate VAT.
+ *
+ * @param fiscalPeriod
+ * @return
+ * @throws LimaException
+ */
+ List<Object> generateVat(FiscalPeriod fiscalPeriod) throws LimaException;
+
+}
Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/ReportServiceLocal.java (from rev 3358, trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ReportServiceLocal.java)
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/ReportServiceLocal.java (rev 0)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/ReportServiceLocal.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -0,0 +1,62 @@
+/*
+ * #%L
+ * Lima business
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2008 - 2010 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+package org.chorem.lima.business.api;
+
+import org.chorem.lima.beans.ReportsDatas;
+import org.chorem.lima.business.LimaException;
+import org.chorem.lima.entity.Account;
+import org.nuiton.topia.TopiaContext;
+
+import javax.ejb.Local;
+import java.util.Date;
+
+
+/**
+ * Service de generation des rapports.
+ * <p/>
+ * Actuellement:
+ * <ul>
+ * <li>Balance</li>
+ * <li>Bilan</li>
+ * </ul>
+ *
+ * @author chatellier
+ * @version $Revision$
+ * <p/>
+ * Last update : $Date$
+ * By : $Author$
+ */
+
+@Local
+public interface ReportServiceLocal extends ReportService {
+
+ ReportsDatas generateAccountReportsWithTransaction(Account account,
+ Boolean thirdPartAccountsMode,
+ Date beginDate,
+ Date endDate,
+ TopiaContext topiaContext) throws LimaException;
+
+}
Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/VatStatementService.java (from rev 3358, trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/VatStatementService.java)
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/VatStatementService.java (rev 0)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/VatStatementService.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -0,0 +1,64 @@
+/*
+ * #%L
+ * Lima :: business
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2008 - 2011 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+package org.chorem.lima.business.api;
+
+import org.chorem.lima.beans.VatStatementAmounts;
+import org.chorem.lima.business.LimaException;
+import org.chorem.lima.entity.VatStatement;
+
+import javax.ejb.Remote;
+import java.util.Date;
+import java.util.List;
+
+@Remote
+public interface VatStatementService {
+
+ void createVatStatement(VatStatement masterVatStatement,
+ VatStatement vatStatement) throws LimaException;
+
+ List<VatStatement> getAllVatStatements() throws LimaException;
+
+ List<VatStatement> getAllChildrenVatStatement(VatStatement vatStatement,
+ List<VatStatement> result) throws LimaException;
+
+ List<VatStatement> getChildrenVatStatement(VatStatement masterVatStatement) throws LimaException;
+
+ void updateVatStatement(VatStatement vatStatement) throws LimaException;
+
+ VatStatementAmounts vatStatementAmounts(VatStatement vatStatement,
+ Date selectedBeginDate,
+ Date selectedEndDate) throws LimaException;
+
+ VatStatement findVatStatementByString(String label) throws LimaException;
+
+ List<VatStatementAmounts> vatStatementReport(Date beginDate,
+ Date endDate) throws LimaException;
+
+ void removeAllVatStatement() throws LimaException;
+
+ void removeVatStatement(VatStatement vatStatement) throws LimaException;
+
+
+}
\ No newline at end of file
Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/VatStatementServiceLocal.java (from rev 3358, trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/VatStatementServiceLocal.java)
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/VatStatementServiceLocal.java (rev 0)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/VatStatementServiceLocal.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -0,0 +1,54 @@
+/*
+ * #%L
+ * Lima :: business
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2008 - 2011 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+package org.chorem.lima.business.api;
+
+import org.chorem.lima.beans.VatStatementAmounts;
+import org.chorem.lima.beans.VatStatementDatas;
+import org.chorem.lima.business.LimaException;
+import org.chorem.lima.entity.VatStatement;
+import org.nuiton.topia.TopiaContext;
+
+import javax.ejb.Local;
+import java.util.Date;
+
+@Local
+public interface VatStatementServiceLocal extends VatStatementService {
+
+ void createVatStatementWithTransaction(
+ VatStatement masterVatStatement, VatStatement vatStatement,
+ TopiaContext transaction) throws LimaException;
+
+ VatStatementAmounts vatStatementAmounts(VatStatement vatStatement,
+ Date selectedBeginDate,
+ Date selectedEndDate,
+ TopiaContext topiacontext) throws LimaException;
+
+ VatStatementDatas vatStatementReport(VatStatement vatStatement,
+ Date selectedBeginDate,
+ Date selectedEndDate,
+ VatStatementDatas result,
+ TopiaContext topiaContext) throws LimaException;
+
+}
Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/utils/FormatsEnum.java (from rev 3358, trunk/lima-business/src/main/java/org/chorem/lima/business/utils/FormatsEnum.java)
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/utils/FormatsEnum.java (rev 0)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/utils/FormatsEnum.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -0,0 +1,70 @@
+/*
+ * #%L
+ * Lima business
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2008 - 2010 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+package org.chorem.lima.business.utils;
+
+public enum FormatsEnum {
+
+ HTML(".html", "text/html", "Page Html"),
+ PDF(".pdf", "application/pdf", "Document PDF");
+
+ private final String extension;
+
+ private final String mimeType;
+
+ private final String description;
+
+ private FormatsEnum(String extension, String mimeType, String description) {
+ this.extension = extension;
+ this.mimeType = mimeType;
+ this.description = description;
+ }
+
+ public String getExtension() {
+ return extension;
+ }
+
+ public String getMimeType() {
+ return mimeType;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public static FormatsEnum valueOfExtension(String extension) {
+ FormatsEnum value = null;
+
+ for (FormatsEnum formatsEnum : FormatsEnum.values()) {
+ if (extension.equals(formatsEnum.getExtension())) {
+ value = formatsEnum;
+ break;
+ }
+ }
+ return value;
+ }
+
+
+}
Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/utils/ImportExportEntityEnum.java (from rev 3358, trunk/lima-business/src/main/java/org/chorem/lima/business/utils/ImportExportEntityEnum.java)
===================================================================
--- trunk/lima-business-api/src/main/java/org/chorem/lima/business/utils/ImportExportEntityEnum.java (rev 0)
+++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/utils/ImportExportEntityEnum.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -0,0 +1,64 @@
+/*
+ * #%L
+ * Lima business
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2008 - 2010 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+package org.chorem.lima.business.utils;
+
+public enum ImportExportEntityEnum {
+
+ ACCOUNT("ACCN"),
+ ENTRYBOOK("ENBK"),
+ FINANCIALSTATEMENT("FNST"),
+ FISCALPERIOD("FSCP"),
+ CLOSEDPERIODICENTRYBOOK("CPEB"),
+ FINANCIALTRANSACTION("FTRC"),
+ ENTRY("NTRY"),
+ VATSTATEMENT("VAT"),
+ IDENTITY("IDNT"),
+ VATPDF("VATPDF");
+
+ private final String label;
+
+ ImportExportEntityEnum(String label) {
+ this.label = label;
+ }
+
+ public String getLabel() {
+ return label;
+ }
+
+ public static ImportExportEntityEnum valueOfLabel(String label) {
+ ImportExportEntityEnum value = null;
+
+ for (ImportExportEntityEnum importExportEntityEnum : ImportExportEntityEnum.values()) {
+ if (label.equals(importExportEntityEnum.label)) {
+ value = importExportEntityEnum;
+ break;
+ }
+ }
+ return value;
+ }
+}
+
+
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/LimaMain.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/LimaMain.java 2012-04-11 13:34:48 UTC (rev 3358)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/LimaMain.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -28,7 +28,7 @@
import jaxx.runtime.SwingUtil;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.chorem.lima.business.ejbinterface.AccountService;
+import org.chorem.lima.business.api.AccountService;
import org.chorem.lima.business.monitorable.AccountServiceMonitorable;
import org.chorem.lima.business.monitorable.HttpServerServiceMonitorable;
import org.chorem.lima.service.LimaServiceFactory;
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountViewHandler.java 2012-04-11 13:34:48 UTC (rev 3358)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountViewHandler.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -49,7 +49,7 @@
import org.chorem.lima.business.LimaException;
import org.chorem.lima.business.LimaRuntimeException;
import org.chorem.lima.business.ServiceListener;
-import org.chorem.lima.business.ejbinterface.AccountService;
+import org.chorem.lima.business.api.AccountService;
import org.chorem.lima.business.monitorable.AccountServiceMonitorable;
import org.chorem.lima.business.monitorable.ImportServiceMonitorable;
import org.chorem.lima.entity.Account;
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/AccountComboBoxModel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/AccountComboBoxModel.java 2012-04-11 13:34:48 UTC (rev 3358)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/AccountComboBoxModel.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -29,7 +29,7 @@
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.business.LimaException;
import org.chorem.lima.business.ServiceListener;
-import org.chorem.lima.business.ejbinterface.AccountService;
+import org.chorem.lima.business.api.AccountService;
import org.chorem.lima.business.monitorable.AccountServiceMonitorable;
import org.chorem.lima.business.monitorable.ImportServiceMonitorable;
import org.chorem.lima.entity.Account;
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 2012-04-11 13:34:48 UTC (rev 3358)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/EntryBookComboBoxModel.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -29,7 +29,7 @@
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.business.LimaException;
import org.chorem.lima.business.ServiceListener;
-import org.chorem.lima.business.ejbinterface.EntryBookService;
+import org.chorem.lima.business.api.EntryBookService;
import org.chorem.lima.business.monitorable.EntryBookServiceMonitorable;
import org.chorem.lima.business.monitorable.ImportServiceMonitorable;
import org.chorem.lima.entity.EntryBook;
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/FinancialPeriodComboBoxModel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/FinancialPeriodComboBoxModel.java 2012-04-11 13:34:48 UTC (rev 3358)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/FinancialPeriodComboBoxModel.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -29,7 +29,7 @@
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.business.LimaException;
import org.chorem.lima.business.ServiceListener;
-import org.chorem.lima.business.ejbinterface.FinancialPeriodService;
+import org.chorem.lima.business.api.FinancialPeriodService;
import org.chorem.lima.business.monitorable.FinancialPeriodServiceMonitorable;
import org.chorem.lima.business.monitorable.FiscalPeriodServiceMonitorable;
import org.chorem.lima.business.monitorable.ImportServiceMonitorable;
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/FiscalPeriodComboBoxModel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/FiscalPeriodComboBoxModel.java 2012-04-11 13:34:48 UTC (rev 3358)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/FiscalPeriodComboBoxModel.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -29,7 +29,7 @@
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.business.LimaException;
import org.chorem.lima.business.ServiceListener;
-import org.chorem.lima.business.ejbinterface.FiscalPeriodService;
+import org.chorem.lima.business.api.FiscalPeriodService;
import org.chorem.lima.business.monitorable.FiscalPeriodServiceMonitorable;
import org.chorem.lima.business.monitorable.ImportServiceMonitorable;
import org.chorem.lima.entity.FiscalPeriod;
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/LetterComboBoxModel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/LetterComboBoxModel.java 2012-04-11 13:34:48 UTC (rev 3358)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/LetterComboBoxModel.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -29,7 +29,7 @@
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.business.LimaException;
import org.chorem.lima.business.ServiceListener;
-import org.chorem.lima.business.ejbinterface.FinancialTransactionService;
+import org.chorem.lima.business.api.FinancialTransactionService;
import org.chorem.lima.business.monitorable.FinancialTransactionServiceMonitorable;
import org.chorem.lima.business.monitorable.ImportServiceMonitorable;
import org.chorem.lima.entity.Letter;
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/SubAccountComboBoxModel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/SubAccountComboBoxModel.java 2012-04-11 13:34:48 UTC (rev 3358)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/SubAccountComboBoxModel.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -29,7 +29,7 @@
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.business.LimaException;
import org.chorem.lima.business.ServiceListener;
-import org.chorem.lima.business.ejbinterface.AccountService;
+import org.chorem.lima.business.api.AccountService;
import org.chorem.lima.business.monitorable.AccountServiceMonitorable;
import org.chorem.lima.business.monitorable.ImportServiceMonitorable;
import org.chorem.lima.entity.Account;
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookViewHandler.java 2012-04-11 13:34:48 UTC (rev 3358)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookViewHandler.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -36,7 +36,7 @@
import org.chorem.lima.business.LimaException;
import org.chorem.lima.business.LimaRuntimeException;
import org.chorem.lima.business.ServiceListener;
-import org.chorem.lima.business.ejbinterface.EntryBookService;
+import org.chorem.lima.business.api.EntryBookService;
import org.chorem.lima.business.monitorable.EntryBookServiceMonitorable;
import org.chorem.lima.business.monitorable.ImportServiceMonitorable;
import org.chorem.lima.entity.EntryBook;
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialperiod/FinancialPeriodTable.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialperiod/FinancialPeriodTable.java 2012-04-11 13:34:48 UTC (rev 3358)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialperiod/FinancialPeriodTable.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -28,7 +28,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.business.LimaException;
-import org.chorem.lima.business.ejbinterface.FinancialPeriodService;
+import org.chorem.lima.business.api.FinancialPeriodService;
import org.chorem.lima.business.monitorable.FinancialPeriodServiceMonitorable;
import org.chorem.lima.entity.ClosedPeriodicEntryBook;
import org.chorem.lima.entity.ClosedPeriodicEntryBookImpl;
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportTableModel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportTableModel.java 2012-04-11 13:34:48 UTC (rev 3358)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportTableModel.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -31,8 +31,8 @@
import org.chorem.lima.beans.FinancialStatementAmounts;
import org.chorem.lima.business.LimaException;
import org.chorem.lima.business.ServiceListener;
-import org.chorem.lima.business.ejbinterface.DocumentService;
-import org.chorem.lima.business.ejbinterface.FinancialStatementService;
+import org.chorem.lima.business.api.DocumentService;
+import org.chorem.lima.business.api.FinancialStatementService;
import org.chorem.lima.business.monitorable.DocumentServiceMonitorable;
import org.chorem.lima.business.monitorable.FinancialStatementServiceMonitorable;
import org.chorem.lima.business.monitorable.FinancialTransactionServiceMonitorable;
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 2012-04-11 13:34:48 UTC (rev 3358)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTableModel.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -31,7 +31,7 @@
import org.chorem.lima.business.LimaBusinessException;
import org.chorem.lima.business.LimaException;
import org.chorem.lima.business.ServiceListener;
-import org.chorem.lima.business.ejbinterface.FinancialTransactionService;
+import org.chorem.lima.business.api.FinancialTransactionService;
import org.chorem.lima.business.monitorable.FinancialTransactionServiceMonitorable;
import org.chorem.lima.business.monitorable.ImportServiceMonitorable;
import org.chorem.lima.business.utils.EntryComparator;
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 2012-04-11 13:34:48 UTC (rev 3358)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchTableModel.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -32,8 +32,8 @@
import org.chorem.lima.business.LimaBusinessException;
import org.chorem.lima.business.LimaException;
import org.chorem.lima.business.ServiceListener;
-import org.chorem.lima.business.ejbinterface.FinancialPeriodService;
-import org.chorem.lima.business.ejbinterface.FinancialTransactionService;
+import org.chorem.lima.business.api.FinancialPeriodService;
+import org.chorem.lima.business.api.FinancialTransactionService;
import org.chorem.lima.business.monitorable.FinancialPeriodServiceMonitorable;
import org.chorem.lima.business.monitorable.FinancialTransactionServiceMonitorable;
import org.chorem.lima.entity.Account;
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 2012-04-11 13:34:48 UTC (rev 3358)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchViewHandler.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -31,7 +31,7 @@
import org.chorem.lima.beans.FinancialTransactionSearch;
import org.chorem.lima.beans.FinancialTransactionSearchImpl;
import org.chorem.lima.business.LimaException;
-import org.chorem.lima.business.ejbinterface.FinancialTransactionService;
+import org.chorem.lima.business.api.FinancialTransactionService;
import org.chorem.lima.business.monitorable.FinancialTransactionServiceMonitorable;
import org.chorem.lima.entity.Account;
import org.chorem.lima.entity.Entry;
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 2012-04-11 13:34:48 UTC (rev 3358)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedTableModel.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -29,7 +29,7 @@
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.business.LimaException;
import org.chorem.lima.business.ServiceListener;
-import org.chorem.lima.business.ejbinterface.FinancialTransactionService;
+import org.chorem.lima.business.api.FinancialTransactionService;
import org.chorem.lima.business.monitorable.FinancialTransactionServiceMonitorable;
import org.chorem.lima.business.utils.EntryComparator;
import org.chorem.lima.entity.Account;
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/FiscalPeriodViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/FiscalPeriodViewHandler.java 2012-04-11 13:34:48 UTC (rev 3358)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/FiscalPeriodViewHandler.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -41,8 +41,8 @@
import org.chorem.lima.business.LimaException;
import org.chorem.lima.business.LimaRuntimeException;
import org.chorem.lima.business.ServiceListener;
-import org.chorem.lima.business.ejbinterface.FinancialTransactionService;
-import org.chorem.lima.business.ejbinterface.FiscalPeriodService;
+import org.chorem.lima.business.api.FinancialTransactionService;
+import org.chorem.lima.business.api.FiscalPeriodService;
import org.chorem.lima.business.monitorable.FinancialTransactionServiceMonitorable;
import org.chorem.lima.business.monitorable.FiscalPeriodServiceMonitorable;
import org.chorem.lima.entity.Entry;
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/EntryBooksPane.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/EntryBooksPane.java 2012-04-11 13:34:48 UTC (rev 3358)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/EntryBooksPane.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -36,7 +36,7 @@
import org.chorem.lima.LimaContext;
import org.chorem.lima.business.LimaException;
import org.chorem.lima.business.ServiceListener;
-import org.chorem.lima.business.ejbinterface.EntryBookService;
+import org.chorem.lima.business.api.EntryBookService;
import org.chorem.lima.business.monitorable.EntryBookServiceMonitorable;
import org.chorem.lima.business.monitorable.ImportServiceMonitorable;
import org.chorem.lima.entity.EntryBook;
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 2012-04-11 13:34:48 UTC (rev 3358)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/FinancialTransactionsPane.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -36,8 +36,8 @@
import org.chorem.lima.LimaContext;
import org.chorem.lima.business.LimaException;
import org.chorem.lima.business.ServiceListener;
-import org.chorem.lima.business.ejbinterface.FinancialTransactionService;
-import org.chorem.lima.business.ejbinterface.FiscalPeriodService;
+import org.chorem.lima.business.api.FinancialTransactionService;
+import org.chorem.lima.business.api.FiscalPeriodService;
import org.chorem.lima.business.monitorable.FinancialTransactionServiceMonitorable;
import org.chorem.lima.business.monitorable.FiscalPeriodServiceMonitorable;
import org.chorem.lima.business.monitorable.ImportServiceMonitorable;
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/FiscalPeriodsPane.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/FiscalPeriodsPane.java 2012-04-11 13:34:48 UTC (rev 3358)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/FiscalPeriodsPane.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -36,7 +36,7 @@
import org.chorem.lima.LimaContext;
import org.chorem.lima.business.LimaException;
import org.chorem.lima.business.ServiceListener;
-import org.chorem.lima.business.ejbinterface.FiscalPeriodService;
+import org.chorem.lima.business.api.FiscalPeriodService;
import org.chorem.lima.business.monitorable.FiscalPeriodServiceMonitorable;
import org.chorem.lima.business.monitorable.ImportServiceMonitorable;
import org.chorem.lima.entity.FiscalPeriod;
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/identity/IdentityHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/identity/IdentityHandler.java 2012-04-11 13:34:48 UTC (rev 3358)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/identity/IdentityHandler.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -28,7 +28,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.business.LimaException;
-import org.chorem.lima.business.ejbinterface.IdentityService;
+import org.chorem.lima.business.api.IdentityService;
import org.chorem.lima.business.monitorable.IdentityServiceMonitorable;
import org.chorem.lima.entity.Identity;
import org.chorem.lima.entity.IdentityImpl;
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerViewHandler.java 2012-04-11 13:34:48 UTC (rev 3358)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerViewHandler.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -32,8 +32,8 @@
import org.chorem.lima.beans.ReportsDatas;
import org.chorem.lima.business.LimaException;
import org.chorem.lima.business.ServiceListener;
-import org.chorem.lima.business.ejbinterface.FiscalPeriodService;
-import org.chorem.lima.business.ejbinterface.ReportService;
+import org.chorem.lima.business.api.FiscalPeriodService;
+import org.chorem.lima.business.api.ReportService;
import org.chorem.lima.business.monitorable.FinancialTransactionServiceMonitorable;
import org.chorem.lima.business.monitorable.FiscalPeriodServiceMonitorable;
import org.chorem.lima.business.monitorable.HttpServerServiceMonitorable;
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringTableModel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringTableModel.java 2012-04-11 13:34:48 UTC (rev 3358)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringTableModel.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -29,7 +29,7 @@
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.business.LimaException;
import org.chorem.lima.business.ServiceListener;
-import org.chorem.lima.business.ejbinterface.FinancialTransactionService;
+import org.chorem.lima.business.api.FinancialTransactionService;
import org.chorem.lima.business.monitorable.FinancialTransactionServiceMonitorable;
import org.chorem.lima.business.monitorable.ImportServiceMonitorable;
import org.chorem.lima.business.utils.EntryComparator;
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatreports/VatReportTableModel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatreports/VatReportTableModel.java 2012-04-11 13:34:48 UTC (rev 3358)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatreports/VatReportTableModel.java 2012-04-11 15:59:40 UTC (rev 3359)
@@ -29,7 +29,7 @@
import org.chorem.lima.beans.VatStatementAmounts;
import org.chorem.lima.business.LimaException;
import org.chorem.lima.business.ServiceListener;
-import org.chorem.lima.business.ejbinterface.VatStatementService;
+import org.chorem.lima.business.api.VatStatementService;
import org.chorem.lima.business.monitorable.FinancialTransactionServiceMonitorable;
import org.chorem.lima.business.monitorable.ImportServiceMonitorable;
import org.chorem.lima.business.monitorable.VatStatementServiceMonitorable;
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2012-04-11 13:34:48 UTC (rev 3358)
+++ trunk/pom.xml 2012-04-11 15:59:40 UTC (rev 3359)
@@ -10,7 +10,7 @@
<parent>
<groupId>org.nuiton</groupId>
<artifactId>mavenpom4redmine</artifactId>
- <version>3.0.7</version>
+ <version>3.2</version>
</parent>
<groupId>org.chorem</groupId>
@@ -19,6 +19,7 @@
<modules>
<module>lima-callao</module>
+ <module>lima-business-api</module>
<module>lima-business</module>
<module>lima-swing</module>
</modules>
1
0
r3358 - trunk/lima-business/src/main/java/org/chorem/lima/service
by echatellier@users.chorem.org April 11, 2012
by echatellier@users.chorem.org April 11, 2012
April 11, 2012
Author: echatellier
Date: 2012-04-11 15:34:48 +0200 (Wed, 11 Apr 2012)
New Revision: 3358
Url: http://chorem.org/repositories/revision/lima/3358
Log:
Remove fixme
Modified:
trunk/lima-business/src/main/java/org/chorem/lima/service/LimaServiceFactory.java
Modified: trunk/lima-business/src/main/java/org/chorem/lima/service/LimaServiceFactory.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/service/LimaServiceFactory.java 2012-04-11 13:25:39 UTC (rev 3357)
+++ trunk/lima-business/src/main/java/org/chorem/lima/service/LimaServiceFactory.java 2012-04-11 13:34:48 UTC (rev 3358)
@@ -68,10 +68,8 @@
*/
public static void initFactory(ApplicationConfig config) {
- // TODO EC-20100407 maybe put all options in LimaConfig and allow user to configure it (remove getFlatOptions use)
- // TODO EC-20120113 i don't understand this comment anymore :(
- //Properties props = config.getFlatOptions();
- Properties props = config.getOptions();
+ // make a copy of options
+ Properties props = config.getFlatOptions();
// transmission des options de logging a openejb
// sinon, il utilise son propre pattern interne
1
0
r3357 - trunk/lima-business/src/main/java/org/chorem/lima/service
by echatellier@users.chorem.org April 11, 2012
by echatellier@users.chorem.org April 11, 2012
April 11, 2012
Author: echatellier
Date: 2012-04-11 15:25:39 +0200 (Wed, 11 Apr 2012)
New Revision: 3357
Url: http://chorem.org/repositories/revision/lima/3357
Log:
Move to jee 6 api to init ejb container.
Modified:
trunk/lima-business/src/main/java/org/chorem/lima/service/LimaServiceFactory.java
Modified: trunk/lima-business/src/main/java/org/chorem/lima/service/LimaServiceFactory.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/service/LimaServiceFactory.java 2012-04-06 14:32:57 UTC (rev 3356)
+++ trunk/lima-business/src/main/java/org/chorem/lima/service/LimaServiceFactory.java 2012-04-11 13:25:39 UTC (rev 3357)
@@ -33,8 +33,7 @@
import java.util.Map;
import java.util.Properties;
-import javax.naming.Context;
-import javax.naming.InitialContext;
+import javax.ejb.embeddable.EJBContainer;
import javax.naming.NamingException;
import org.apache.commons.io.IOUtils;
@@ -53,17 +52,26 @@
/** Single instance. */
private static LimaServiceFactory instance;
- protected Map<Class<?>, Object> services = new HashMap<Class<?>, Object>();
+ /** Service cache. */
+ protected Map<Class, Object> services = new HashMap<Class, Object>();
- /** JNDI context used to look for EJB. */
- protected static InitialContext ctx;
+ /** EJB container. */
+ protected static EJBContainer container;
- /** Init openejb jndi context. */
+ /** EJB service namespace. */
+ protected static final String NAMESPACE = "java:global/lima-business/";
+
+ /**
+ * Init openejb container.
+ *
+ * @param config configuration
+ */
public static void initFactory(ApplicationConfig config) {
// TODO EC-20100407 maybe put all options in LimaConfig and allow user to configure it (remove getFlatOptions use)
// TODO EC-20120113 i don't understand this comment anymore :(
- Properties props = config.getFlatOptions();
+ //Properties props = config.getFlatOptions();
+ Properties props = config.getOptions();
// transmission des options de logging a openejb
// sinon, il utilise son propre pattern interne
@@ -81,31 +89,18 @@
IOUtils.closeQuietly(log4jFile);
}
- // Context.INITIAL_CONTEXT_FACTORY is a mandatory option
- // containsKey() does'nt work :(
- if (!props.containsKey(Context.INITIAL_CONTEXT_FACTORY)) {
- throw new IllegalStateException(
- "Application configuration is missing mandatory property "
- + Context.INITIAL_CONTEXT_FACTORY);
- }
-
- try {
- ctx = new InitialContext(props);
- } catch (NamingException eee) {
- if (log.isErrorEnabled()) {
- log.error("Can't initialize initial context", eee);
- }
- }
-
+ // see http://openejb.apache.org/embedded-configuration.html
+ // http://openejb.apache.org/properties-listing.html
+ // for embedded configuration
+ container = EJBContainer.createEJBContainer(props);
}
public static <M> M getService(Class<M> serviceMonitorableClass) {
LimaServiceFactory factory = getInstance();
- Map<Class<?>, Object> services = factory.getServices();
+ Map<Class, Object> services = factory.getServices();
M result = (M) services.get(serviceMonitorableClass);
if (result == null) {
result = factory.newService(serviceMonitorableClass);
-
services.put(serviceMonitorableClass, result);
}
return result;
@@ -131,22 +126,10 @@
}
/**
- * Destroy openejb jndi context.
- * <p/>
- * Code taken from openEJB faq :
- * http://openejb.apache.org/faq.html
- *
- * @throws Exception when trying to destroy a non existent application
+ * Close openejb container.
*/
- public static void destroy() throws Exception {
-
- /* not available in openejb 4
- destroy code (only in embedded mode)
- Assembler assembler = SystemInstance.get().getComponent(Assembler.class);
- for (AppInfo appInfo : assembler.getDeployedApplications()) {
- assembler.destroyApplication(appInfo.jarPath);
- }
- OpenEJB.destroy();*/
+ public static void destroy() {
+ container.close();
}
/**
@@ -163,16 +146,16 @@
return instance;
}
- protected Map<Class<?>, Object> getServices() {
- return getInstance().services;
+ protected Map<Class, Object> getServices() {
+ return services;
}
protected <M> M newService(Class<M> serviceMonitorableClass) {
M result;
Object ejbHome;
- String serviceName = serviceMonitorableClass.getSimpleName().replace("Monitorable", "ImplRemote");
+ String serviceName = serviceMonitorableClass.getSimpleName().replace("Monitorable", "Impl");
try {
- ejbHome = ctx.lookup(serviceName);
+ ejbHome = container.getContext().lookup(NAMESPACE + serviceName);
} catch (NamingException eee) {
throw new RuntimeException(
"Can't lookup for service : " + serviceName, eee);
1
0
r3356 - in trunk: lima-business/src/main/java/org/chorem/lima/business/ejb lima-business/src/main/java/org/chorem/lima/business/ejbinterface lima-swing/src/main/java/org/chorem/lima/ui lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod lima-swing/src/main/java/org/chorem/lima/ui/home lima-swing/src/main/java/org/chorem/lima/ui/opening lima-swing/src/main/resources/i18n
by echatellier@users.chorem.org April 6, 2012
by echatellier@users.chorem.org April 6, 2012
April 6, 2012
Author: echatellier
Date: 2012-04-06 16:32:57 +0200 (Fri, 06 Apr 2012)
New Revision: 3356
Url: http://chorem.org/repositories/revision/lima/3356
Log:
Mise ?\195?\160 jour home view et opening.
Added:
trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/AbstractHomePane.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/package-info.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/package-info.java
Modified:
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FiscalPeriodServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FiscalPeriodService.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FiscalPeriodServiceLocal.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainViewHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/EntryBookListRenderer.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/FiscalPeriodTable.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/AccountsPane.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/EntryBooksPane.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/FinancialTransactionsPane.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/FiscalPeriodsPane.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/HomeView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/CreateAccountsPanel.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/CreateEntryBookPanel.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/CreateFiscalPeriodPanel.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/CreateIdentityPanel.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-business/src/main/java/org/chorem/lima/business/ejb/FiscalPeriodServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FiscalPeriodServiceImpl.java 2012-04-06 10:07:48 UTC (rev 3355)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FiscalPeriodServiceImpl.java 2012-04-06 14:32:57 UTC (rev 3356)
@@ -100,10 +100,11 @@
}
@Override
- public void createFiscalPeriodWithTransaction(FiscalPeriod fiscalPeriod,
+ public FiscalPeriod createFiscalPeriodWithTransaction(FiscalPeriod fiscalPeriod,
TopiaContext topiaContext) throws LimaException {
AccountingRules accountingRules = LimaConfig.getInstance().getAccountingRules();
+ FiscalPeriod result = null;
try {
@@ -127,12 +128,14 @@
LimaCallaoDAOHelper.getFiscalPeriodDAO(topiaContext);
//create
- fiscalPeriodDAO.create(fiscalPeriod);
+ result = fiscalPeriodDAO.create(fiscalPeriod);
commitTransaction(topiaContext);
} catch (TopiaException ex) {
doCatch(topiaContext, ex);
}
+
+ return result;
}
/**
@@ -140,17 +143,19 @@
* Check localized rules before create
*/
@Override
- public void createFiscalPeriod(FiscalPeriod fiscalPeriod) throws LimaException {
+ public FiscalPeriod createFiscalPeriod(FiscalPeriod fiscalPeriod) throws LimaException {
TopiaContext transaction = beginTransaction(rootContext);
+ FiscalPeriod result = null;
try {
-
- createFiscalPeriodWithTransaction(fiscalPeriod, transaction);
+ result = createFiscalPeriodWithTransaction(fiscalPeriod, transaction);
} catch (Exception ex) {
doCatch(transaction, ex);
} finally {
doFinally(transaction);
}
+
+ return result;
}
/** return all fiscal period */
@@ -247,12 +252,13 @@
* check localized rules before block it
*/
@Override
- public void blockFiscalPeriod(FiscalPeriod fiscalPeriod) throws LimaException {
+ public FiscalPeriod blockFiscalPeriod(FiscalPeriod fiscalPeriod) throws LimaException {
//open transaction for update
TopiaContext transaction = beginTransaction(rootContext);
AccountingRules accountingRules = LimaConfig.getInstance().getAccountingRules();
+ FiscalPeriod result = null;
try {
if (fiscalPeriod.getLocked()) {
@@ -275,7 +281,7 @@
financialPeriod.setLocked(true);
}
- fiscalPeriodDAO.update(oldFiscalPeriod);
+ result = fiscalPeriodDAO.update(oldFiscalPeriod);
commitTransaction(transaction);
@@ -284,6 +290,8 @@
} finally {
doFinally(transaction);
}
+
+ return result;
}
@Override
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FiscalPeriodService.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FiscalPeriodService.java 2012-04-06 10:07:48 UTC (rev 3355)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FiscalPeriodService.java 2012-04-06 14:32:57 UTC (rev 3356)
@@ -52,9 +52,9 @@
FiscalPeriod getLastFiscalPeriod() throws LimaException;
- void createFiscalPeriod(FiscalPeriod fiscalPeriod) throws LimaException;
+ FiscalPeriod createFiscalPeriod(FiscalPeriod fiscalPeriod) throws LimaException;
- void blockFiscalPeriod(FiscalPeriod fiscalPeriod) throws LimaException;
+ FiscalPeriod blockFiscalPeriod(FiscalPeriod fiscalPeriod) throws LimaException;
void addRetainedEarnings(FiscalPeriod fiscalPeriod,
boolean newyear,
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FiscalPeriodServiceLocal.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FiscalPeriodServiceLocal.java 2012-04-06 10:07:48 UTC (rev 3355)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FiscalPeriodServiceLocal.java 2012-04-06 14:32:57 UTC (rev 3356)
@@ -43,7 +43,7 @@
@Local
public interface FiscalPeriodServiceLocal extends FiscalPeriodService {
- void createFiscalPeriodWithTransaction(FiscalPeriod fiscalPeriod,
+ FiscalPeriod createFiscalPeriodWithTransaction(FiscalPeriod fiscalPeriod,
TopiaContext topiaContext) throws LimaException;
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 2012-04-06 10:07:48 UTC (rev 3355)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainViewHandler.java 2012-04-06 14:32:57 UTC (rev 3356)
@@ -56,6 +56,8 @@
import org.chorem.lima.ui.vatchart.VatChartView;
import org.chorem.lima.ui.vatreports.VatReportView;
import org.chorem.lima.util.ErrorHelper;
+import org.nuiton.profiling.NuitonTrace;
+import org.nuiton.util.DesktopUtil;
import javax.swing.JButton;
import javax.swing.JTabbedPane;
@@ -185,40 +187,19 @@
helper.displayUI(ui, false);
}
-// public void showHelp(JAXXContext context, String helpId) {
-//
-// }
-//
-// public void closeHelp(JAXXContext context) {
-//
-// }
-
public void gotoSite(JAXXContext context) {
LimaConfig config = getUI(context).getConfig();
URL siteURL = config.getOptionAsURL("application.site.url");
- String url = siteURL.toString();
try {
- SwingUtil.openLink(url);
+ DesktopUtil.browse(siteURL.toURI());
} catch (Exception e) {
- ErrorHelper.showErrorDialog("Can't open lima website at " + url, e);
+ ErrorHelper.showErrorDialog("Can't open lima website at " + siteURL, e);
}
-// log.info("goto " + siteURL);
-// if (Desktop.isDesktopSupported() && Desktop.getDesktop().isSupported(Desktop.Action.BROWSE)) {
-// try {
-// Desktop.getDesktop().browse(siteURL.toURI());
-// } catch (Exception ex) {
-// if (log.isErrorEnabled()) {
-// log.error("Can't open lima website", ex);
-// }
-// ErrorHelper.showErrorDialog("Can't open lima website", ex);
-// }
-// }
}
public void showAbout(JAXXContext context) {
-
MainView ui = getUI(context);
AboutPanel about = new AboutPanel();
about.setTitle(_("lima.title.about"));
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/EntryBookListRenderer.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/EntryBookListRenderer.java 2012-04-06 10:07:48 UTC (rev 3355)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/EntryBookListRenderer.java 2012-04-06 14:32:57 UTC (rev 3356)
@@ -55,8 +55,7 @@
if (entryBook != null) {
newValue = entryBook.getCode() + " - " + entryBook.getLabel();
}
- return super.getListCellRendererComponent(list, value, index, isSelected,
+ return super.getListCellRendererComponent(list, newValue, index, isSelected,
cellHasFocus);
}
-
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/FiscalPeriodTable.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/FiscalPeriodTable.java 2012-04-06 10:07:48 UTC (rev 3355)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/FiscalPeriodTable.java 2012-04-06 14:32:57 UTC (rev 3356)
@@ -39,8 +39,6 @@
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
-import javax.swing.table.TableModel;
-
/**
* Fiscal period table add support for JXTable.
*
Added: trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/AbstractHomePane.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/AbstractHomePane.java (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/AbstractHomePane.java 2012-04-06 14:32:57 UTC (rev 3356)
@@ -0,0 +1,64 @@
+/*
+ * #%L
+ *
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2012 Codelutin, Chatellier Eric
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
+package org.chorem.lima.ui.home;
+
+import java.awt.Color;
+
+import javax.swing.JEditorPane;
+import javax.swing.event.HyperlinkListener;
+import javax.swing.plaf.basic.BasicEditorPaneUI;
+
+/**
+ * Common code for all home page panel.
+ *
+ * @author chatellier
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author$
+ */
+public abstract class AbstractHomePane extends JEditorPane implements HyperlinkListener {
+
+ /** serialVersionUID. */
+ private static final long serialVersionUID = -7820679841428370136L;
+
+ protected static final Color RED_BACKGROUND = new Color(0xff, 0xee, 0xee);
+
+ protected static final Color GREEN_BACKGROUND = new Color(0xee, 0xff, 0xee);
+
+ protected HomeView view;
+
+ protected AbstractHomePane(HomeView view) {
+ this.view = view;
+
+ //init
+ setOpaque(true);
+ setContentType("text/html");
+ setEditable(false);
+ setUI(new BasicEditorPaneUI());
+ addHyperlinkListener(this);
+ }
+}
Property changes on: trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/AbstractHomePane.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/AccountsPane.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/AccountsPane.java 2012-04-06 10:07:48 UTC (rev 3355)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/AccountsPane.java 2012-04-06 14:32:57 UTC (rev 3356)
@@ -25,6 +25,10 @@
package org.chorem.lima.ui.home;
+import static org.nuiton.i18n.I18n._;
+
+import javax.swing.event.HyperlinkEvent;
+
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.LimaContext;
@@ -32,57 +36,39 @@
import org.chorem.lima.business.ServiceListener;
import org.chorem.lima.business.monitorable.AccountServiceMonitorable;
import org.chorem.lima.business.monitorable.ImportServiceMonitorable;
-import org.chorem.lima.entity.Account;
import org.chorem.lima.service.LimaServiceFactory;
import org.chorem.lima.ui.MainView;
-import javax.swing.JEditorPane;
-import javax.swing.event.HyperlinkEvent;
-import javax.swing.event.HyperlinkListener;
-import javax.swing.plaf.basic.BasicEditorPaneUI;
-import java.awt.Color;
-import java.util.List;
+/**
+ * Home view pane that display account plan statistics.
+ *
+ * @author chatellier
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author$
+ */
+public class AccountsPane extends AbstractHomePane implements ServiceListener {
-import static org.nuiton.i18n.I18n._;
-
-public class AccountsPane extends JEditorPane implements HyperlinkListener, ServiceListener {
-
private static final long serialVersionUID = 1L;
private static final Log log = LogFactory.getLog(AccountsPane.class);
- protected HomeView view;
-
protected AccountServiceMonitorable accountService;
- private static Color redBackground = new Color(0xff, 0xee, 0xee);
-
- private static Color greenBackground = new Color(0xee, 0xff, 0xee);
-
-
public AccountsPane(HomeView view) {
- this.view = view;
- accountService =
- LimaServiceFactory.getService(
- AccountServiceMonitorable.class);
- LimaServiceFactory.addServiceListener(
- AccountServiceMonitorable.class, this);
- LimaServiceFactory.addServiceListener(
- ImportServiceMonitorable.class, this);
+ super(view);
- //init
- setOpaque(true);
- setContentType("text/html");
- setEditable(false);
- setUI(new BasicEditorPaneUI());
- addHyperlinkListener(this);
+ accountService = LimaServiceFactory.getService(AccountServiceMonitorable.class);
+ LimaServiceFactory.addServiceListener(AccountServiceMonitorable.class, this);
+ LimaServiceFactory.addServiceListener(ImportServiceMonitorable.class, this);
+
refresh();
}
@Override
public void hyperlinkUpdate(HyperlinkEvent e) {
if (HyperlinkEvent.EventType.ACTIVATED.equals(e.getEventType())) {
-
if (e.getDescription().equals("#accountschart")) {
MainView ui = LimaContext.MAIN_UI_ENTRY_DEF.getContextValue(view);
ui.getHandler().showAccountView(ui);
@@ -100,23 +86,25 @@
long accountCount = accountService.getAccountCount();
if (accountCount > 0) {
- setBackground(greenBackground);
- String accountsString = _("lima.home.chartaccounts.state1_2") + " "
- + accountCount + " " + _("lima.home.chartaccounts.state2_2")
+ setBackground(GREEN_BACKGROUND);
+ String accountsString = _("lima.ui.home.chartaccounts.state1_2") + " "
+ + accountCount + " " + _("lima.ui.home.chartaccounts.state2_2")
+ "<br/><br/><a href='#accountschart'>"
- + _("lima.home.chartaccounts.modify") + "</a>";
+ + _("lima.ui.home.chartaccounts.modify") + "</a>";
//set Text
setText(htmlBegin + accountsString + htmlEnd);
} else {
- setBackground(redBackground);
- String accountsString = _("lima.home.chartaccounts.nothing")
+ setBackground(RED_BACKGROUND);
+ String accountsString = _("lima.ui.home.chartaccounts.nothing")
+ "<br/><br/><a href='#accountschart'>"
- + _("lima.home.chartaccounts.create") + "</a>";
+ + _("lima.ui.home.chartaccounts.create") + "</a>";
//set Text
setText(htmlBegin + accountsString + htmlEnd);
}
- } catch (LimaException eee) {
- log.debug("Can't get datas account editor pane home", eee);
+ } catch (LimaException ex) {
+ if (log.isErrorEnabled()) {
+ log.error("Can't get datas account editor pane home", ex);
+ }
}
}
@@ -126,5 +114,4 @@
refresh();
}
}
-
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/EntryBooksPane.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/EntryBooksPane.java 2012-04-06 10:07:48 UTC (rev 3355)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/EntryBooksPane.java 2012-04-06 14:32:57 UTC (rev 3356)
@@ -25,6 +25,12 @@
package org.chorem.lima.ui.home;
+import static org.nuiton.i18n.I18n._;
+
+import java.util.List;
+
+import javax.swing.event.HyperlinkEvent;
+
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.LimaContext;
@@ -37,52 +43,36 @@
import org.chorem.lima.service.LimaServiceFactory;
import org.chorem.lima.ui.MainView;
-import javax.swing.JEditorPane;
-import javax.swing.event.HyperlinkEvent;
-import javax.swing.event.HyperlinkListener;
-import javax.swing.plaf.basic.BasicEditorPaneUI;
-import java.awt.Color;
-import java.util.List;
+/**
+ * Home view pane that display entry books statistics.
+ *
+ * @author chatellier
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author$
+ */
+public class EntryBooksPane extends AbstractHomePane implements ServiceListener {
-import static org.nuiton.i18n.I18n._;
-
-public class EntryBooksPane extends JEditorPane implements HyperlinkListener, ServiceListener {
-
private static final long serialVersionUID = 1L;
private static final Log log = LogFactory.getLog(EntryBooksPane.class);
- protected HomeView view;
-
protected EntryBookService entryBookService;
- private static Color redBackground = new Color(0xff, 0xee, 0xee);
-
- private static Color greenBackground = new Color(0xee, 0xff, 0xee);
-
public EntryBooksPane(HomeView view) {
- this.view = view;
+ super(view);
- entryBookService =
- LimaServiceFactory.getService(
- EntryBookServiceMonitorable.class);
- LimaServiceFactory.addServiceListener(entryBookService, this);
+ entryBookService = LimaServiceFactory.getService(EntryBookServiceMonitorable.class);
+ LimaServiceFactory.addServiceListener(EntryBookServiceMonitorable.class, this);
LimaServiceFactory.addServiceListener(ImportServiceMonitorable.class, this);
- //init
- setOpaque(true);
- setContentType("text/html");
- setEditable(false);
- setUI(new BasicEditorPaneUI());
- addHyperlinkListener(this);
refresh();
}
@Override
public void hyperlinkUpdate(HyperlinkEvent e) {
-
if (HyperlinkEvent.EventType.ACTIVATED.equals(e.getEventType())) {
-
if (e.getDescription().equals("#entrybookschart")) {
MainView ui = LimaContext.MAIN_UI_ENTRY_DEF.getContextValue(view);
ui.getHandler().showEntryBookView(ui);
@@ -101,18 +91,18 @@
List<EntryBook> entryBooks = entryBookService.getAllEntryBooks();
int ebSize = entryBooks.size();
if (ebSize > 0) {
- setBackground(greenBackground);
+ setBackground(GREEN_BACKGROUND);
String entryBooksString;
if (ebSize == 1) {
- entryBooksString = _("lima.home.entrybooks.state.single")
+ entryBooksString = _("lima.ui.home.entrybooks.state.single")
+ "<br/>" + entryBooks.get(0).getLabel()
+ "<br/><br/><a href='#entrybookschart'>"
- + _("lima.home.entrybooks.modify") + "</a>";
+ + _("lima.ui.home.entrybooks.modify") + "</a>";
} else {
- entryBooksString = _("lima.home.entrybooks.state1_2.plural")
+ entryBooksString = _("lima.ui.home.entrybooks.state1_2.plural")
+ " " + entryBooks.size() + " "
- + _("lima.home.entrybooks.state2_2.plural") + "<ul>";
+ + _("lima.ui.home.entrybooks.state2_2.plural") + "<ul>";
for (int i = 0; i < ebSize && i < 3; i++) {
// for (EntryBook entryBook : entryBooks) {
EntryBook entryBook = entryBooks.get(i);
@@ -124,17 +114,17 @@
}
entryBooksString += "</ul></p><p horizontal-align:'center'>"
+ "<a href='#entrybookschart'>"
- + _("lima.home.entrybooks.modify") + "</a>";
+ + _("lima.ui.home.entrybooks.modify") + "</a>";
}
//set Text
setText(htmlBegin + entryBooksString + htmlEnd);
} else {
- setBackground(redBackground);
+ setBackground(RED_BACKGROUND);
//set Text
setText(htmlBegin
- + _("lima.home.entrybooks.nothing")
+ + _("lima.ui.home.entrybooks.nothing")
+ "<br/><br/><a href='#entrybookschart'>"
- + _("lima.home.entrybooks.create") + "</a>" + htmlEnd);
+ + _("lima.ui.home.entrybooks.create") + "</a>" + htmlEnd);
}
} catch (LimaException eee) {
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 2012-04-06 10:07:48 UTC (rev 3355)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/FinancialTransactionsPane.java 2012-04-06 14:32:57 UTC (rev 3356)
@@ -25,6 +25,12 @@
package org.chorem.lima.ui.home;
+import static org.nuiton.i18n.I18n._;
+
+import java.util.List;
+
+import javax.swing.event.HyperlinkEvent;
+
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.LimaContext;
@@ -40,48 +46,34 @@
import org.chorem.lima.service.LimaServiceFactory;
import org.chorem.lima.ui.MainView;
-import javax.swing.JEditorPane;
-import javax.swing.event.HyperlinkEvent;
-import javax.swing.event.HyperlinkListener;
-import javax.swing.plaf.basic.BasicEditorPaneUI;
-import java.awt.Color;
-import java.util.List;
+/**
+ * Home view pane that display statistics about unbalanced transactions.
+ *
+ * @author chatellier
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author$
+ */
+public class FinancialTransactionsPane extends AbstractHomePane implements ServiceListener {
-import static org.nuiton.i18n.I18n._;
-
-public class FinancialTransactionsPane extends JEditorPane implements HyperlinkListener, ServiceListener {
-
private static final long serialVersionUID = 1L;
private static final Log log = LogFactory.getLog(FinancialTransactionsPane.class);
- protected HomeView view;
-
protected FinancialTransactionService financialTransactionService;
protected FiscalPeriodService fiscalPeriodService;
- private static Color redBackground = new Color(0xff, 0xee, 0xee);
-
- private static Color greenBackground = new Color(0xee, 0xff, 0xee);
-
public FinancialTransactionsPane(HomeView view) {
- this.view = view;
+ super(view);
- financialTransactionService =
- LimaServiceFactory.getService(FinancialTransactionServiceMonitorable.class);
- LimaServiceFactory.addServiceListener(financialTransactionService, this);
- fiscalPeriodService =
- LimaServiceFactory.getService(FiscalPeriodServiceMonitorable.class);
- LimaServiceFactory.addServiceListener(fiscalPeriodService, this);
+ financialTransactionService = LimaServiceFactory.getService(FinancialTransactionServiceMonitorable.class);
+ fiscalPeriodService = LimaServiceFactory.getService(FiscalPeriodServiceMonitorable.class);
+ LimaServiceFactory.addServiceListener(FinancialTransactionServiceMonitorable.class, this);
+ LimaServiceFactory.addServiceListener(FiscalPeriodServiceMonitorable.class, this);
LimaServiceFactory.addServiceListener(ImportServiceMonitorable.class, this);
- //init
- setOpaque(true);
- setContentType("text/html");
- setEditable(false);
- setUI(new BasicEditorPaneUI());
- addHyperlinkListener(this);
refresh();
}
@@ -114,11 +106,11 @@
financialTransactionService.
getAllInexactFinancialTransactions(unblockedFiscalPeriods.get(0));
if (financialTransactionsUnbal.size() > 0) {
- setBackground(redBackground);
+ setBackground(RED_BACKGROUND);
String transactionsString = financialTransactionsUnbal.size()
- + " " + _("lima.home.transaction.unbalanced")
+ + " " + _("lima.ui.home.transaction.unbalanced")
+ "<br/><br/><a href='#financialtransactionunbalanced'>"
- + _("lima.home.transaction.modifiy.unbalanced") + "</a>";
+ + _("lima.ui.home.transaction.modifiy.unbalanced") + "</a>";
//set Text
setText(htmlBegin + transactionsString + htmlEnd);
} else {
@@ -126,25 +118,25 @@
financialTransactionService.getAllFinancialTransactionsBalanced(unblockedFiscalPeriods.get(0));
if (financialTransactionsBal.size() > 0) {
- setBackground(greenBackground);
+ setBackground(GREEN_BACKGROUND);
String transactionsString = financialTransactionsBal.size()
- + " " + _("lima.home.transaction.balanced")
+ + " " + _("lima.ui.home.transaction.balanced")
+ "<br/><br/><a href='#financialtransactionbalanced'>"
- + _("lima.home.transaction.modifiy.balanced") + "</a>";
+ + _("lima.ui.home.transaction.modifiy.balanced") + "</a>";
//set Text
setText(htmlBegin + transactionsString + htmlEnd);
} else {
- setBackground(redBackground);
- String transactionsString = _("lima.home.transaction.nothing")
+ setBackground(RED_BACKGROUND);
+ String transactionsString = _("lima.ui.home.transaction.nothing")
+ "<br/><br/><a href='#financialtransactionbalanced'>"
- + _("lima.home.transaction.create") + "</a>";
+ + _("lima.ui.home.transaction.create") + "</a>";
//set Text
setText(htmlBegin + transactionsString + htmlEnd);
}
}
} else {
- setBackground(redBackground);
+ setBackground(RED_BACKGROUND);
}
} catch (LimaException eee) {
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/FiscalPeriodsPane.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/FiscalPeriodsPane.java 2012-04-06 10:07:48 UTC (rev 3355)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/FiscalPeriodsPane.java 2012-04-06 14:32:57 UTC (rev 3356)
@@ -25,6 +25,12 @@
package org.chorem.lima.ui.home;
+import static org.nuiton.i18n.I18n._;
+
+import java.util.List;
+
+import javax.swing.event.HyperlinkEvent;
+
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.LimaContext;
@@ -37,50 +43,42 @@
import org.chorem.lima.service.LimaServiceFactory;
import org.chorem.lima.ui.MainView;
-import javax.swing.JEditorPane;
-import javax.swing.event.HyperlinkEvent;
-import javax.swing.event.HyperlinkListener;
-import javax.swing.plaf.basic.BasicEditorPaneUI;
-import java.awt.Color;
-import java.util.List;
+/**
+ * Panenl de la home view de lima qui affiche les statistiques de
+ * l'exercice en cours.
+ *
+ * @author chatellier
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author$
+ */
+public class FiscalPeriodsPane extends AbstractHomePane implements ServiceListener {
-import static org.nuiton.i18n.I18n._;
-
-public class FiscalPeriodsPane extends JEditorPane implements HyperlinkListener, ServiceListener {
-
private static final long serialVersionUID = 1L;
private static final Log log = LogFactory.getLog(FiscalPeriodsPane.class);
- protected HomeView view;
-
protected FiscalPeriodService fiscalPeriodService;
- private static Color redBackground = new Color(0xff, 0xee, 0xee);
-
- private static Color greenBackground = new Color(0xee, 0xff, 0xee);
-
+ /**
+ * Constructors (init services).
+ *
+ * @param view home view
+ */
public FiscalPeriodsPane(HomeView view) {
- this.view = view;
+ super(view);
- fiscalPeriodService =
- LimaServiceFactory.getService(FiscalPeriodServiceMonitorable.class);
- LimaServiceFactory.addServiceListener(fiscalPeriodService, this);
+ fiscalPeriodService = LimaServiceFactory.getService(FiscalPeriodServiceMonitorable.class);
+ LimaServiceFactory.addServiceListener(FiscalPeriodServiceMonitorable.class, this);
LimaServiceFactory.addServiceListener(ImportServiceMonitorable.class, this);
- //init
- setOpaque(true);
- setContentType("text/html");
- setEditable(false);
- setUI(new BasicEditorPaneUI());
- addHyperlinkListener(this);
refresh();
}
@Override
public void hyperlinkUpdate(HyperlinkEvent e) {
if (HyperlinkEvent.EventType.ACTIVATED.equals(e.getEventType())) {
-
if (e.getDescription().equals("#fiscalperiodschart")) {
MainView ui = LimaContext.MAIN_UI_ENTRY_DEF.getContextValue(view);
ui.getHandler().showFiscalPeriodView(ui);
@@ -102,26 +100,26 @@
List<FiscalPeriod> unblockedFiscalPeriods =
fiscalPeriodService.getAllUnblockedFiscalPeriods();
if (unblockedFiscalPeriods.size() > 0) {
- setBackground(greenBackground);
+ setBackground(GREEN_BACKGROUND);
String fiscalString = unblockedFiscalPeriods.size() + " "
- + _("lima.home.fiscalperiod.opened") + "<br/>"
+ + _("lima.ui.home.fiscalperiod.opened") + "<br/>"
+ (fiscalPeriods.size() - unblockedFiscalPeriods.size())
- + " " + _("lima.home.fiscalperiod.closed")
+ + " " + _("lima.ui.home.fiscalperiod.closed")
+ "<br/><br/><a href='#fiscalperiodschart'>"
- + _("lima.home.fiscalperiod.modify") + "</a>";
+ + _("lima.ui.home.fiscalperiod.modify") + "</a>";
//set Text
setText(htmlBegin + fiscalString + htmlEnd);
} else {
- setBackground(redBackground);
- String fiscalString = _("lima.home.fiscalperiod.noopen");
+ setBackground(RED_BACKGROUND);
+ String fiscalString = _("lima.ui.home.fiscalperiod.noopen");
if (fiscalPeriods.size() > 0) {
fiscalString += "<br/>" + fiscalPeriods.size() + " "
- + _("lima.home.fiscalperiod.closed");
+ + _("lima.ui.home.fiscalperiod.closed");
}
fiscalString += "<br/><br/><a href='#fiscalperiodschart'>"
- + _("lima.home.fiscalperiod.create") + "</a>";
+ + _("lima.ui.home.fiscalperiod.create") + "</a>";
//set Text
setText(htmlBegin + fiscalString + htmlEnd);
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/HomeView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/HomeView.jaxx 2012-04-06 10:07:48 UTC (rev 3355)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/HomeView.jaxx 2012-04-06 14:32:57 UTC (rev 3356)
@@ -5,7 +5,7 @@
$Id$
$HeadURL$
%%
- Copyright (C) 2008 - 2010 CodeLutin
+ Copyright (C) 2008 - 2012 CodeLutin, Chatellier Eric
%%
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as
@@ -22,7 +22,6 @@
<http://www.gnu.org/licenses/gpl-3.0.html>.
#L%
-->
-
<Table>
<import>
java.awt.Color
@@ -38,8 +37,7 @@
<row>
<cell anchor="southeast">
- <JPanel
- id='accountPanel'
+ <JPanel id='accountPanel'
border='{BorderFactory.createEtchedBorder(EtchedBorder.LOWERED)}'
minimumSize='{getMiniSize()}'
preferredSize='{getFixedSize()}'
@@ -47,27 +45,24 @@
<Table>
<row>
<cell weightx="0" weighty="0.1" anchor="northwest">
- <JLabel
- icon='accounts.png'/>
+ <JLabel icon='accounts.png'/>
</cell>
<cell weightx="1" weighty="0.1" anchor="center">
<JLabel foreground='{Color.DARK_GRAY}'
font='{new Font("sans-serif", Font.BOLD, 16)}'
- text='lima.charts.account'/>
+ text='lima.ui.home.account'/>
</cell>
</row>
<row fill="both">
<cell columns="2" weightx="1" weighty="0.9">
- <JEditorPane
- javaBean='new AccountsPane(this)'/>
+ <JEditorPane initializer='new AccountsPane(this)'/>
</cell>
</row>
</Table>
</JPanel>
</cell>
<cell anchor="southwest">
- <JPanel
- id='entryBookPanel'
+ <JPanel id='entryBookPanel'
border='{BorderFactory.createEtchedBorder(EtchedBorder.LOWERED)}'
minimumSize='{getMiniSize()}'
preferredSize='{getFixedSize()}'
@@ -75,19 +70,17 @@
<Table>
<row>
<cell weightx="0" weighty="0.1" anchor="northwest">
- <JLabel
- icon='entrybooks.png'/>
+ <JLabel icon='entrybooks.png'/>
</cell>
<cell weightx="1" weighty="0.1" anchor="center">
<JLabel foreground='{Color.DARK_GRAY}'
font='{new Font("sans-serif", Font.BOLD, 16)}'
- text='lima.common.entrybooks'/>
+ text='lima.ui.home.entrybooks'/>
</cell>
</row>
<row fill="both">
<cell columns="2" weightx="1" weighty="0.9">
- <JEditorPane
- javaBean='new EntryBooksPane(this)'/>
+ <JEditorPane initializer='new EntryBooksPane(this)'/>
</cell>
</row>
</Table>
@@ -96,8 +89,7 @@
</row>
<row>
<cell anchor="northeast">
- <JPanel
- id='fiscalPeriodPanel'
+ <JPanel id='fiscalPeriodPanel'
border='{BorderFactory.createEtchedBorder(EtchedBorder.LOWERED)}'
minimumSize='{getMiniSize()}'
preferredSize='{getFixedSize()}'
@@ -105,27 +97,24 @@
<Table>
<row>
<cell weightx="0" weighty="0.1" anchor="northwest">
- <JLabel
- icon='fiscalperiods.png'/>
+ <JLabel icon='fiscalperiods.png'/>
</cell>
<cell weightx="1" weighty="0.1" anchor="center">
<JLabel foreground='{Color.DARK_GRAY}'
font='{new Font("sans-serif", Font.BOLD, 16)}'
- text='lima.charts.fiscalyear'/>
+ text='lima.ui.home.fiscalyear'/>
</cell>
</row>
<row fill="both">
<cell columns="2" weightx="1" weighty="0.9">
- <JEditorPane
- javaBean='new FiscalPeriodsPane(this)'/>
+ <JEditorPane initializer='new FiscalPeriodsPane(this)'/>
</cell>
</row>
</Table>
</JPanel>
</cell>
<cell anchor="northwest">
- <JPanel
- id='financialTransactionPanel'
+ <JPanel id='financialTransactionPanel'
border='{BorderFactory.createEtchedBorder(EtchedBorder.LOWERED)}'
minimumSize='{getMiniSize()}'
preferredSize='{getFixedSize()}'
@@ -133,13 +122,12 @@
<Table>
<row>
<cell weightx="0" weighty="0.1" anchor="northwest">
- <JLabel
- icon='entries.png'/>
+ <JLabel icon='entries.png'/>
</cell>
<cell weightx="1" weighty="0.1" anchor="center">
<JLabel foreground='{Color.DARK_GRAY}'
font='{new Font("sans-serif", Font.BOLD, 16)}'
- text='lima.daily'/>
+ text='lima.ui.home.daily'/>
</cell>
</row>
<row fill="both">
Added: trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/package-info.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/package-info.java (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/package-info.java 2012-04-06 14:32:57 UTC (rev 3356)
@@ -0,0 +1,29 @@
+/*
+ * #%L
+ *
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2012 Codelutin, Chatellier Eric
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+/**
+ * Contient l'onglet d'acceuil de lima avec les statistiques de la
+ * comptabilite.
+ */
+package org.chorem.lima.ui.home;
Property changes on: trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/package-info.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/CreateAccountsPanel.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/CreateAccountsPanel.jaxx 2012-04-06 10:07:48 UTC (rev 3355)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/CreateAccountsPanel.jaxx 2012-04-06 14:32:57 UTC (rev 3356)
@@ -5,7 +5,7 @@
$Id$
$HeadURL$
%%
- Copyright (C) 2008 - 2010 CodeLutin
+ Copyright (C) 2008 - 2012 CodeLutin, Chatellier Eric
%%
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as
@@ -22,14 +22,12 @@
<http://www.gnu.org/licenses/gpl-3.0.html>.
#L%
-->
-
<JPanel>
<import>
- jaxx.runtime.swing.JAXXButtonGroup
org.chorem.lima.enums.AccountsChartEnum
</import>
- <JAXXButtonGroup id="radioButtons"/>
+ <javax.swing.ButtonGroup id="buttonGroup"/>
<Table>
<row>
@@ -41,7 +39,7 @@
<cell>
<JRadioButton text='lima.charts.account.shortened'
value='{AccountsChartEnum.SHORTENED}'
- buttonGroup="{getRadioButtons()}"
+ buttonGroup="{buttonGroup}"
selected='true'/>
</cell>
</row>
@@ -49,33 +47,29 @@
<cell>
<JRadioButton text='lima.charts.account.base'
value='{AccountsChartEnum.BASE}'
- buttonGroup="{getRadioButtons()}"
- selected='true'/>
+ buttonGroup="{buttonGroup}"/>
</cell>
</row>
<row>
<cell>
<JRadioButton text='lima.charts.account.developed'
value='{AccountsChartEnum.DEVELOPED}'
- buttonGroup="{getRadioButtons()}"
- selected='true'/>
+ buttonGroup="{buttonGroup}"/>
</cell>
</row>
<row>
<cell>
<JRadioButton text='lima.importexport.importcsv'
value='{AccountsChartEnum.IMPORT}'
- buttonGroup="{getRadioButtons()}"
- selected='true'/>
+ buttonGroup="{buttonGroup}"/>
</cell>
</row>
<row>
<cell>
<JRadioButton text='lima.importexport.importebp'
value='{AccountsChartEnum.IMPORTEBP}'
- buttonGroup="{getRadioButtons()}"
- selected='true'/>
+ buttonGroup="{buttonGroup}"/>
</cell>
</row>
</Table>
-</JPanel>
\ No newline at end of file
+</JPanel>
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/CreateEntryBookPanel.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/CreateEntryBookPanel.jaxx 2012-04-06 10:07:48 UTC (rev 3355)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/CreateEntryBookPanel.jaxx 2012-04-06 14:32:57 UTC (rev 3356)
@@ -5,7 +5,7 @@
$Id$
$HeadURL$
%%
- Copyright (C) 2008 - 2010 CodeLutin
+ Copyright (C) 2008 - 2012 CodeLutin, Chatellier Eric
%%
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as
@@ -22,7 +22,6 @@
<http://www.gnu.org/licenses/gpl-3.0.html>.
#L%
-->
-
<JPanel>
<Table>
<row>
@@ -37,4 +36,4 @@
</cell>
</row>
</Table>
-</JPanel>
\ No newline at end of file
+</JPanel>
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/CreateFiscalPeriodPanel.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/CreateFiscalPeriodPanel.jaxx 2012-04-06 10:07:48 UTC (rev 3355)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/CreateFiscalPeriodPanel.jaxx 2012-04-06 14:32:57 UTC (rev 3356)
@@ -90,4 +90,4 @@
</cell>
</row>
</Table>
-</JPanel>
\ No newline at end of file
+</JPanel>
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/CreateIdentityPanel.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/CreateIdentityPanel.jaxx 2012-04-06 10:07:48 UTC (rev 3355)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/CreateIdentityPanel.jaxx 2012-04-06 14:32:57 UTC (rev 3356)
@@ -5,7 +5,7 @@
$Id$
$HeadURL$
%%
- Copyright (C) 2008 - 2010 CodeLutin
+ Copyright (C) 2008 - 2012 CodeLutin, Chatellier Eric
%%
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as
@@ -22,7 +22,6 @@
<http://www.gnu.org/licenses/gpl-3.0.html>.
#L%
-->
-
<JPanel>
<import>
javax.swing.text.Document
@@ -30,14 +29,9 @@
org.chorem.lima.ui.identity.IdentityHandler
</import>
- <IdentityHandler id="handler"
- javaBean="new org.chorem.lima.ui.identity.IdentityHandler()"/>
+ <IdentityHandler id="handler" javaBean="new IdentityHandler()"/>
<Identity id="identity" javaBean='handler.getIdentity()'/>
- <script>
- <![CDATA[
- ]]>
- </script>
<Table>
<row>
<cell fill="horizontal">
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 2012-04-06 10:07:48 UTC (rev 3355)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/OpeningView.jaxx 2012-04-06 14:32:57 UTC (rev 3356)
@@ -5,7 +5,7 @@
$Id$
$HeadURL$
%%
- Copyright (C) 2008 - 2010 CodeLutin
+ Copyright (C) 2008 - 2012 CodeLutin, Chatellier Eric
%%
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as
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 2012-04-06 10:07:48 UTC (rev 3355)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/OpeningViewHandler.java 2012-04-06 14:32:57 UTC (rev 3356)
@@ -111,7 +111,7 @@
break;
case 2:
- Object value = caPanel.getRadioButtons().getSelectedValue();
+ Object value = caPanel.getButtonGroup().getSelectedValue();
// if action confirmed
if (value != null) {
AccountsChartEnum defaultAccountsChartEnum =
Added: trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/package-info.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/package-info.java (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/package-info.java 2012-04-06 14:32:57 UTC (rev 3356)
@@ -0,0 +1,30 @@
+/*
+ * #%L
+ *
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2012 Codelutin, Chatellier Eric
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+/**
+ * Contient l'assisant d'importation de comptabilité
+ * au premier lancement de lima.
+ * Creation d'identité, etc...
+ */
+package org.chorem.lima.ui.opening;
Property changes on: trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/package-info.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
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 2012-04-06 10:07:48 UTC (rev 3355)
+++ trunk/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties 2012-04-06 14:32:57 UTC (rev 3356)
@@ -305,6 +305,32 @@
lima.ui.fiscalperiod.closure=
lima.ui.fiscalperiod.fiscalperiod=
lima.ui.fiscalperiod.open=
+lima.ui.home.account=
+lima.ui.home.chartaccounts.create=
+lima.ui.home.chartaccounts.modify=
+lima.ui.home.chartaccounts.nothing=
+lima.ui.home.chartaccounts.state1_2=
+lima.ui.home.chartaccounts.state2_2=
+lima.ui.home.daily=
+lima.ui.home.entrybooks=
+lima.ui.home.entrybooks.create=
+lima.ui.home.entrybooks.modify=
+lima.ui.home.entrybooks.nothing=
+lima.ui.home.entrybooks.state.single=
+lima.ui.home.entrybooks.state1_2.plural=
+lima.ui.home.entrybooks.state2_2.plural=
+lima.ui.home.fiscalperiod.closed=
+lima.ui.home.fiscalperiod.create=
+lima.ui.home.fiscalperiod.modify=
+lima.ui.home.fiscalperiod.noopen=
+lima.ui.home.fiscalperiod.opened=
+lima.ui.home.fiscalyear=
+lima.ui.home.transaction.balanced=
+lima.ui.home.transaction.create=
+lima.ui.home.transaction.modifiy.balanced=
+lima.ui.home.transaction.modifiy.unbalanced=
+lima.ui.home.transaction.nothing=
+lima.ui.home.transaction.unbalanced=
lima.ui.importexport.importcsv=
lima.ui.importexport.importebp=
lima.vatreport.listerror=Can't get entries list
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 2012-04-06 10:07:48 UTC (rev 3355)
+++ trunk/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties 2012-04-06 14:32:57 UTC (rev 3356)
@@ -149,28 +149,8 @@
lima.fiscalperiod.creationerror=Erreur lors de la création de la période fiscale
lima.fiscalperiod.listerror=Erreur lors de la récupération des données de la liste
lima.fiscalperiod.unbalancedtransactions=La période fiscale contient des transactions non équilibrées
-lima.home.chartaccounts.create=Créer le plan des comptes
-lima.home.chartaccounts.modify=Modifier le plan des comptes
-lima.home.chartaccounts.nothing=Aucun compte \!
-lima.home.chartaccounts.state1_2=Le plan comptable possede
-lima.home.chartaccounts.state2_2=comptes
-lima.home.entrybooks.create=Créer les journaux
-lima.home.entrybooks.modify=Modifier les journaux
-lima.home.entrybooks.nothing=Aucun journal ouvert \!
-lima.home.entrybooks.state.single=Le journal est \:
-lima.home.entrybooks.state1_2.plural=Les
-lima.home.entrybooks.state2_2.plural=journaux sont \:
-lima.home.fiscalperiod.closed=exercices cloturés
-lima.home.fiscalperiod.create=Créer un exercice
-lima.home.fiscalperiod.modify=Modifier les exercices
-lima.home.fiscalperiod.noopen=Aucun exercice ouvert \!
-lima.home.fiscalperiod.opened=exercices ouverts
-lima.home.transaction.balanced=transactions, toutes sont équilibrées
-lima.home.transaction.create=Ajouter des écritures
-lima.home.transaction.modifiy.balanced=Modifier les écritures
-lima.home.transaction.modifiy.unbalanced=Modifier les écritures incorrectes
-lima.home.transaction.nothing=Aucune écriture
-lima.home.transaction.unbalanced=transactions ne sont pas équilibrées \!
+lima.home.chartaccounts.state2_2=
+lima.home.entrybooks.create=
lima.identity=Identité
lima.identity.address=Adresse
lima.identity.address2=Adresse (suite)
@@ -304,6 +284,32 @@
lima.ui.fiscalperiod.closure=Cloture
lima.ui.fiscalperiod.fiscalperiod=Exercice
lima.ui.fiscalperiod.open=Ouvert
+lima.ui.home.account=Plan comptable
+lima.ui.home.chartaccounts.create=Créer le plan des comptes
+lima.ui.home.chartaccounts.modify=Modifier le plan des comptes
+lima.ui.home.chartaccounts.nothing=Aucun compte \!
+lima.ui.home.chartaccounts.state1_2=Le plan comptable possede
+lima.ui.home.chartaccounts.state2_2=comptes
+lima.ui.home.daily=Quotidien
+lima.ui.home.entrybooks=Journaux
+lima.ui.home.entrybooks.create=Créer les journaux
+lima.ui.home.entrybooks.modify=Modifier les journaux
+lima.ui.home.entrybooks.nothing=Aucun journal ouvert \!
+lima.ui.home.entrybooks.state.single=Le journal est \:
+lima.ui.home.entrybooks.state1_2.plural=Les
+lima.ui.home.entrybooks.state2_2.plural=journaux sont \:
+lima.ui.home.fiscalperiod.closed=exercices cloturés
+lima.ui.home.fiscalperiod.create=Créer un exercice
+lima.ui.home.fiscalperiod.modify=Modifier les exercices
+lima.ui.home.fiscalperiod.noopen=Aucun exercice ouvert \!
+lima.ui.home.fiscalperiod.opened=exercices ouverts
+lima.ui.home.fiscalyear=Exercices
+lima.ui.home.transaction.balanced=transactions, toutes sont équilibrées
+lima.ui.home.transaction.create=Ajouter des écritures
+lima.ui.home.transaction.modifiy.balanced=Modifier les écritures
+lima.ui.home.transaction.modifiy.unbalanced=Modifier les écritures incorrectes
+lima.ui.home.transaction.nothing=Aucune écriture
+lima.ui.home.transaction.unbalanced=transactions ne sont pas équilibrées \!
lima.ui.importexport.importcsv=Import/Export CSV
lima.ui.importexport.importebp=Import/Export EBP
lima.vatreport.listerror=Erreur lors de la récupération des données de la liste
1
0
r3355 - in trunk/lima-swing/src/main: java/org/chorem/lima/ui/fiscalperiod resources/i18n
by echatellier@users.chorem.org April 6, 2012
by echatellier@users.chorem.org April 6, 2012
April 6, 2012
Author: echatellier
Date: 2012-04-06 12:07:48 +0200 (Fri, 06 Apr 2012)
New Revision: 3355
Url: http://chorem.org/repositories/revision/lima/3355
Log:
Debut du refactoring de gestion des exercices (le report ?\195?\160 nouveau est encore a gerer et ?\195?\160 d?\195?\169placer dans les services).
Added:
trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/EntryBookListRenderer.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/package-info.java
Modified:
trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/AddPeriod.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/FiscalPeriodTable.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/FiscalPeriodTableModel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/FiscalPeriodView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/FiscalPeriodViewHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/RetainedEarningsEntryBookForm.jaxx
trunk/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties
trunk/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/AddPeriod.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/AddPeriod.jaxx 2012-04-05 14:09:35 UTC (rev 3354)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/AddPeriod.jaxx 2012-04-06 10:07:48 UTC (rev 3355)
@@ -22,84 +22,44 @@
<http://www.gnu.org/licenses/gpl-3.0.html>.
#L%
-->
-<JDialog modal="true"
+<JDialog title="lima.ui.fiscalperiod.addfiscalperiodtitle" modal="true"
defaultCloseOperation="{JDialog.DO_NOTHING_ON_CLOSE}"
onWindowClosing="performCancel();">
<import>
- java.util.Date
- java.util.Calendar
- org.apache.commons.lang3.time.DateUtils
- org.jdesktop.swingx.JXDatePicker
- org.chorem.lima.entity.FiscalPeriodImpl
org.chorem.lima.entity.FiscalPeriod
- org.chorem.lima.business.LimaException
- org.chorem.lima.business.monitorable.FiscalPeriodServiceMonitorable
- org.chorem.lima.service.LimaServiceFactory
- org.chorem.lima.ui.fiscalperiod.FiscalPeriodTableModel
</import>
+
+ <FiscalPeriodViewHandler id='handler' initializer='getContextValue(FiscalPeriodView.class,JAXXUtil.PARENT).getHandler()'/>
+
<FiscalPeriodTableModel id="modelFiscalPeriodTable"/>
+
+ <FiscalPeriod id="period" javaBean="new org.chorem.lima.entity.FiscalPeriodImpl()"/>
+
<script>
<![CDATA[
-
- getRootPane().setDefaultButton(okButton);
-
- protected FiscalPeriodServiceMonitorable fiscalPeriodService =
- LimaServiceFactory.getService(
- FiscalPeriodServiceMonitorable.class);
-
- // set begin date picker
- Date endDate = null;
- Calendar calendarBegin = Calendar.getInstance();
- // set begindate to JAN 1 - 0:00.000 of this years
- Date beginDate = calendarBegin.getTime();
- beginDate = DateUtils.truncate(beginDate, Calendar.DATE);
- try {
- FiscalPeriod result = fiscalPeriodService.getLastFiscalPeriod();
- if (result != null){
- beginDate = result.getEndDate();
- }
+ public void $afterCompleteSetup() {
+ getHandler().init(this);
}
- catch (LimaException eee){
- if(log.isDebugEnabled()){
- log.debug("Can't get last fiscal period", eee);
- }
- }
- beginDate = DateUtils.addDays(beginDate, 1);
- getBeginDatePicker().setDate(beginDate);
-
- // get end date
- Calendar calendarEnd = Calendar.getInstance();
- endDate = DateUtils.addYears(beginDate, 1);
- endDate = DateUtils.addDays(endDate, -1);
- getEndDatePicker().setDate(endDate);
-
protected void performOk() {
- if (period == null) {
- // FIXME never ever use IMPL !!!
- setPeriod(new FiscalPeriodImpl());
- }
getPeriod().setBeginDate(beginDatePicker.getDate());
getPeriod().setEndDate(endDatePicker.getDate());
dispose();
}
-
+
protected void performCancel() {
setPeriod(null);
dispose();
}
- ]]>
- </script>
+ ]]></script>
- <FiscalPeriod id="period" javaBean="null"/>
-
<Table fill="both">
<row>
<cell>
<JLabel text="lima.common.begindate"/>
</cell>
<cell>
- <JXDatePicker id="beginDatePicker"/>
+ <org.jdesktop.swingx.JXDatePicker id="beginDatePicker"/>
</cell>
</row>
<row>
@@ -107,7 +67,7 @@
<JLabel text="lima.common.enddate"/>
</cell>
<cell>
- <JXDatePicker id="endDatePicker"/>
+ <org.jdesktop.swingx.JXDatePicker id="endDatePicker"/>
</cell>
</row>
<row>
Added: trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/EntryBookListRenderer.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/EntryBookListRenderer.java (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/EntryBookListRenderer.java 2012-04-06 10:07:48 UTC (rev 3355)
@@ -0,0 +1,62 @@
+/*
+ * #%L
+ *
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2012 Codelutin, Chatellier Eric
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
+package org.chorem.lima.ui.fiscalperiod;
+
+import java.awt.Component;
+
+import javax.swing.DefaultListCellRenderer;
+import javax.swing.JList;
+
+import org.chorem.lima.entity.EntryBook;
+
+/**
+ * EntryBook renderer for fiscal period retaining earning list.
+ *
+ * @author chatellier
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author$
+ */
+public class EntryBookListRenderer extends DefaultListCellRenderer {
+
+ /** serialVersionUID. */
+ private static final long serialVersionUID = -9089182547408397051L;
+
+ @Override
+ public Component getListCellRendererComponent(JList list, Object value,
+ int index, boolean isSelected, boolean cellHasFocus) {
+
+ EntryBook entryBook = (EntryBook)value;
+ Object newValue = entryBook;
+ if (entryBook != null) {
+ newValue = entryBook.getCode() + " - " + entryBook.getLabel();
+ }
+ return super.getListCellRendererComponent(list, value, index, isSelected,
+ cellHasFocus);
+ }
+
+}
Property changes on: trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/EntryBookListRenderer.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/FiscalPeriodTable.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/FiscalPeriodTable.java 2012-04-05 14:09:35 UTC (rev 3354)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/FiscalPeriodTable.java 2012-04-06 10:07:48 UTC (rev 3355)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2008 - 2010 CodeLutin
+ * Copyright (C) 2008 - 2012 CodeLutin, Chatellier Eric
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
@@ -39,6 +39,23 @@
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
+import javax.swing.table.TableModel;
+
+/**
+ * Fiscal period table add support for JXTable.
+ *
+ * Including:
+ * <ul>
+ * <li>Locked period red highlight
+ * <li>
+ * </ul>
+ *
+ * @author chatellier
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author$
+ */
public class FiscalPeriodTable extends JXTable
implements KeyListener, MouseListener {
@@ -50,26 +67,28 @@
private Highlighter colorTransaction;
- public FiscalPeriodTable(FiscalPeriodViewHandler handler) {
-
+ public FiscalPeriodTable(FiscalPeriodTableModel model) {
+ super(model);
+ this.model = model;
this.handler = handler;
addKeyListener(this);
addMouseListener(this);
- model = this.handler.getView().getModelFiscalPeriodTable();
-
- //highlight financial financial transactions
+ // highlight financial financial transactions
addBlockColor();
}
+ /**
+ * Highlight locked period in RED.
+ */
protected void addBlockColor() {
+
HighlightPredicate predicate = new HighlightPredicate() {
@Override
public boolean isHighlighted(Component renderer,
ComponentAdapter adapter) {
- FiscalPeriod fiscalPeriod = (FiscalPeriod) model.getElementAt(adapter.row);
- // true if locked
+ FiscalPeriod fiscalPeriod = model.getFiscalPeriodAt(adapter.row);
return fiscalPeriod.getLocked();
}
};
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/FiscalPeriodTableModel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/FiscalPeriodTableModel.java 2012-04-05 14:09:35 UTC (rev 3354)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/FiscalPeriodTableModel.java 2012-04-06 10:07:48 UTC (rev 3355)
@@ -25,34 +25,18 @@
package org.chorem.lima.ui.fiscalperiod;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.chorem.lima.business.LimaException;
-import org.chorem.lima.business.ServiceListener;
-import org.chorem.lima.business.ejbinterface.FinancialTransactionService;
-import org.chorem.lima.business.ejbinterface.FiscalPeriodService;
-import org.chorem.lima.business.monitorable.FinancialTransactionServiceMonitorable;
-import org.chorem.lima.business.monitorable.FiscalPeriodServiceMonitorable;
-import org.chorem.lima.business.monitorable.ImportServiceMonitorable;
-import org.chorem.lima.business.utils.FiscalPeriodComparator;
-import org.chorem.lima.entity.FinancialTransaction;
-import org.chorem.lima.entity.FiscalPeriod;
-import org.chorem.lima.service.LimaServiceFactory;
-import org.chorem.lima.util.ErrorHelper;
-import org.nuiton.util.Resource;
+import static org.nuiton.i18n.I18n._;
-import javax.swing.JFrame;
-import javax.swing.JOptionPane;
-import javax.swing.table.AbstractTableModel;
import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Collections;
import java.util.List;
-import static org.nuiton.i18n.I18n._;
+import javax.swing.table.AbstractTableModel;
+import org.chorem.lima.business.LimaException;
+import org.chorem.lima.entity.FiscalPeriod;
+
/**
- * TODO add comment here.
+ * Modele de Fiscal period (rendu de list)
*
* @author chatellier
* @version $Revision$
@@ -60,62 +44,24 @@
* Last update : $Date$
* By : $Author$
*/
-public class FiscalPeriodTableModel extends AbstractTableModel implements ServiceListener {
+public class FiscalPeriodTableModel extends AbstractTableModel {
/** serialVersionUID. */
private static final long serialVersionUID = 77027335135838258L;
- private static final Log log = LogFactory.getLog(FiscalPeriodTableModel.class);
+ protected List<FiscalPeriod> fiscalPeriods;
- protected FiscalPeriodService fiscalPeriodService;
-
- protected FinancialTransactionService financialTransactionService;
-
- /** data cache */
- protected List<?> cacheDataList;
-
- public FiscalPeriodTableModel() {
- fiscalPeriodService =
- LimaServiceFactory.getService(
- FiscalPeriodServiceMonitorable.class);
- LimaServiceFactory.addServiceListener(fiscalPeriodService, this);
- LimaServiceFactory.addServiceListener(ImportServiceMonitorable.class, this);
- financialTransactionService =
- LimaServiceFactory.getService(
- FinancialTransactionServiceMonitorable.class);
- LimaServiceFactory.addServiceListener(financialTransactionService, this);
- cacheDataList = null;
- }
-
- protected List<Object> getDataList() {
- List<Object> results = new ArrayList<Object>();
- try {
- List<FiscalPeriod> fiscalPeriod =
- fiscalPeriodService.getAllFiscalPeriods();
- Collections.sort(fiscalPeriod, new FiscalPeriodComparator());
- results.addAll(fiscalPeriod);
- } catch (LimaException eee) {
- if (log.isErrorEnabled()) {
- log.error("Can't update model", eee);
- }
- ErrorHelper.showErrorDialog(_("lima.fiscalperiod.listerror"), eee);
- }
- return results;
- }
-
- public void refresh() {
- cacheDataList = getDataList();
+ public void setFiscalPeriods(List<FiscalPeriod> fiscalPeriods) {
+ this.fiscalPeriods = fiscalPeriods;
fireTableDataChanged();
}
@Override
public int getRowCount() {
int result = 0;
-
- if (cacheDataList != null) {
- result = cacheDataList.size();
+ if (fiscalPeriods != null) {
+ result = fiscalPeriods.size();
}
-
return result;
}
@@ -124,16 +70,9 @@
return 2;
}
-
- public Object getElementAt(int row) {
-
- Object currentRow = null;
-
- if (cacheDataList != null) {
- currentRow = cacheDataList.get(row);
- }
-
- return currentRow;
+ public FiscalPeriod getFiscalPeriodAt(int row) {
+ FiscalPeriod result = fiscalPeriods.get(row);
+ return result;
}
@Override
@@ -143,10 +82,10 @@
switch (columnIndex) {
case 0:
- result = _("lima.table.fiscalperiod");
+ result = _("lima.ui.fiscalperiod.fiscalperiod");
break;
case 1:
- result = _("lima.table.closure");
+ result = _("lima.ui.fiscalperiod.closure");
break;
}
@@ -154,27 +93,14 @@
}
@Override
- public Class<?> getColumnClass(int columnIndex) {
- // both String
- return String.class;
- }
-
-
- @Override
- public boolean isCellEditable(int rowIndex, int columnIndex) {
- return false;
- }
-
- @Override
public Object getValueAt(int rowIndex, int columnIndex) {
Object result = "n/a";
- List<?> periods;
- periods = cacheDataList;
- FiscalPeriod fiscalPeriod = (FiscalPeriod) periods.get(rowIndex);
+ FiscalPeriod fiscalPeriod = getFiscalPeriodAt(rowIndex);
if (fiscalPeriod != null) {
+ // FIXME echatellier 20120405 i18n problem (hard coded)
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("dd MMM yyyy");
switch (columnIndex) {
@@ -186,9 +112,9 @@
break;
case 1:
if (fiscalPeriod.getLocked()) {
- result = _("lima.common.closed");
+ result = _("lima.ui.fiscalperiod.closed");
} else {
- result = _("lima.common.open");
+ result = _("lima.ui.fiscalperiod.open");
}
break;
}
@@ -197,35 +123,14 @@
return result;
}
- public FiscalPeriod getFiscalPeriodAtRow(int row) throws LimaException {
- FiscalPeriod fiscalPeriod;
- fiscalPeriod = (FiscalPeriod) cacheDataList.get(row);
- return fiscalPeriod;
+ public void addFiscalPeriod(FiscalPeriod fiscalPeriod) {
+ fiscalPeriods.add(fiscalPeriod);
+ int row = fiscalPeriods.indexOf(fiscalPeriod);
+ fireTableRowsInserted(row, row);
}
- /**
- * @param period
- * @throws LimaException
- */
- public void addFiscalPeriod(FiscalPeriod period) throws LimaException {
-
- try {
- // Calling fiscal period service
- fiscalPeriodService.createFiscalPeriod(period);
- //on recharge la liste
- cacheDataList = getDataList();
- int row = getDataList().indexOf(period);
- fireTableRowsInserted(row, row);
- } catch (LimaException eee) {
- if (log.isErrorEnabled()) {
- log.error("Can't create FiscalPeriod", eee);
- }
- ErrorHelper.showErrorDialog(_("lima.fiscalperiod.creationerror"), eee);
- }
- }
-
- public void blockFiscalPeriod(FiscalPeriod fiscalPeriod) throws LimaException {
- List<FinancialTransaction> financialTransactionsUnbal =
+ public void updateFiscalPeriod(FiscalPeriod fiscalPeriod) throws LimaException {
+ /*List<FinancialTransaction> financialTransactionsUnbal =
financialTransactionService.getAllInexactFinancialTransactions(fiscalPeriod);
if (financialTransactionsUnbal.size() > 0) {
JFrame f = new JFrame();
@@ -239,14 +144,8 @@
} else {
fiscalPeriodService.blockFiscalPeriod(fiscalPeriod);
refresh();
- }
+ }*/
+ int row = fiscalPeriods.indexOf(fiscalPeriod);
+ fireTableRowsInserted(row, row);
}
-
- @Override
- public void notifyMethod(String serviceName, String methodeName) {
- //refresh on import datas
- if (methodeName.contains("importAll")) {
- refresh();
- }
- }
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/FiscalPeriodView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/FiscalPeriodView.jaxx 2012-04-05 14:09:35 UTC (rev 3354)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/FiscalPeriodView.jaxx 2012-04-06 10:07:48 UTC (rev 3355)
@@ -5,7 +5,7 @@
$Id$
$HeadURL$
%%
- Copyright (C) 2008 - 2010 CodeLutin
+ Copyright (C) 2008 - 2012 CodeLutin, Chatellier Eric
%%
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as
@@ -29,29 +29,24 @@
javax.swing.ListSelectionModel
org.chorem.lima.entity.FiscalPeriod
org.chorem.lima.entity.FinancialPeriod
- org.chorem.lima.ui.fiscalperiod.FiscalPeriodTable
- org.chorem.lima.ui.fiscalperiod.FiscalPeriodTableModel
</import>
- <FiscalPeriodViewHandler id="handler"
- javaBean="new FiscalPeriodViewHandler(this)"/>
+
+ <FiscalPeriodViewHandler id="handler" constructorParams="this"/>
<Boolean id="selectedPeriod" javaBean="false"/>
- <script>
- <![CDATA[
+ <script><![CDATA[
void $afterCompleteSetup() {
- getHandler().refresh();
+ getHandler().init();
}
-
- ]]>
- </script>
+ ]]></script>
+
<row>
<cell fill="both" weightx="1" weighty="1" rows="5">
<JScrollPane>
- <FiscalPeriodTableModel
- id="modelFiscalPeriodTable"/>
+ <FiscalPeriodTableModel id="fiscalPeriodTableModel" />
<FiscalPeriodTable
id="fiscalPeriodTable" sortable="false" rowHeight="24"
- constructorParams="getHandler()" model="{getModelFiscalPeriodTable()}"
+ constructorParams="getFiscalPeriodTableModel()"
selectionMode="{ListSelectionModel.SINGLE_INTERVAL_SELECTION}"
columnControlVisible="true"/>
<ListSelectionModel
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/FiscalPeriodViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/FiscalPeriodViewHandler.java 2012-04-05 14:09:35 UTC (rev 3354)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/FiscalPeriodViewHandler.java 2012-04-06 10:07:48 UTC (rev 3355)
@@ -25,9 +25,24 @@
package org.chorem.lima.ui.fiscalperiod;
+import static org.nuiton.i18n.I18n._;
+
+import java.math.BigDecimal;
+import java.util.Calendar;
+import java.util.Collection;
+import java.util.Date;
+import java.util.List;
+
+import javax.swing.JOptionPane;
+
+import org.apache.commons.lang3.time.DateUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.business.LimaException;
+import org.chorem.lima.business.LimaRuntimeException;
+import org.chorem.lima.business.ServiceListener;
+import org.chorem.lima.business.ejbinterface.FinancialTransactionService;
+import org.chorem.lima.business.ejbinterface.FiscalPeriodService;
import org.chorem.lima.business.monitorable.FinancialTransactionServiceMonitorable;
import org.chorem.lima.business.monitorable.FiscalPeriodServiceMonitorable;
import org.chorem.lima.entity.Entry;
@@ -40,15 +55,8 @@
import org.jdesktop.swingx.JXTable;
import org.nuiton.util.DateUtil;
-import javax.swing.JOptionPane;
-import java.math.BigDecimal;
-import java.util.Collection;
-import java.util.List;
-
-import static org.nuiton.i18n.I18n._;
-
/**
- * TODO add comment here.
+ * Handler pour la gestion des exercices (creation/fermeture).
*
* @author chatellier
* @version $Revision$
@@ -56,86 +64,133 @@
* Last update : $Date$
* By : $Author$
*/
-public class FiscalPeriodViewHandler {
+public class FiscalPeriodViewHandler implements ServiceListener {
private static final Log log = LogFactory.getLog(FiscalPeriodViewHandler.class);
private FiscalPeriodView view;
- protected FiscalPeriodTable table;
-
- protected FiscalPeriodTableModel tableModel;
-
/** Service. */
- protected FiscalPeriodServiceMonitorable fiscalPeriodService;
+ protected FiscalPeriodService fiscalPeriodService;
- protected FinancialTransactionServiceMonitorable financialTransactionService;
+ protected FinancialTransactionService financialTransactionService;
- protected FiscalPeriodViewHandler(FiscalPeriodView view) {
+ /**
+ * Constructor.
+ *
+ * @param view managed view
+ */
+ public FiscalPeriodViewHandler(FiscalPeriodView view) {
this.view = view;
- fiscalPeriodService =
- LimaServiceFactory.getService(
- FiscalPeriodServiceMonitorable.class);
+ fiscalPeriodService = LimaServiceFactory.getService(FiscalPeriodServiceMonitorable.class);
+ financialTransactionService = LimaServiceFactory.getService(FinancialTransactionServiceMonitorable.class);
- financialTransactionService =
- LimaServiceFactory.getService(
- FinancialTransactionServiceMonitorable.class);
+ LimaServiceFactory.addServiceListener(FiscalPeriodServiceMonitorable.class, this);
}
+ public void init() {
+ loadAllFiscalPeriod();
+ }
+
+ /**
+ * Reload fiscal period list from service and update ui.
+ */
+ public void loadAllFiscalPeriod() {
+ try {
+ List<FiscalPeriod> periods = fiscalPeriodService.getAllFiscalPeriods();
+ view.getFiscalPeriodTableModel().setFiscalPeriods(periods);
+ } catch (LimaException ex) {
+ throw new LimaRuntimeException("Cant get fiscal perdiods", ex);
+ }
+ }
+
+ /**
+ * Display add period form and perform add.
+ */
public void addFiscalPeriod() {
- FiscalPeriodTableModel model =
- (FiscalPeriodTableModel) getView().getFiscalPeriodTable().getModel();
+ FiscalPeriodTableModel model = (FiscalPeriodTableModel) view.getFiscalPeriodTable().getModel();
- AddPeriod addPeriodDialog = new AddPeriod(getView());
- // jaxx don't call super() ?
- addPeriodDialog.setLocationRelativeTo(getView());
+ AddPeriod addPeriodDialog = new AddPeriod(view);
+ addPeriodDialog.setLocationRelativeTo(view);
addPeriodDialog.setVisible(true);
FiscalPeriod fiscalPeriod = addPeriodDialog.getPeriod();
// null = cancel
if (fiscalPeriod != null) {
//check if fiscalperiod have 12 months, ask a confirmation
- int nbMonth =
- DateUtil.getDifferenceInMonths(fiscalPeriod.getBeginDate(),
- fiscalPeriod.getEndDate());
- int n = 0;
+ int nbMonth = DateUtil.getDifferenceInMonths(fiscalPeriod.getBeginDate(),
+ fiscalPeriod.getEndDate());
+ int response = JOptionPane.NO_OPTION;
if (nbMonth != 12) {
- n = JOptionPane.showConfirmDialog(getView(),
- _("lima.charts.fiscalperiod.question.morethan12"),
- _("lima.common.question"),
- JOptionPane.YES_NO_OPTION,
- JOptionPane.QUESTION_MESSAGE);
+ response = JOptionPane.showConfirmDialog(view,
+ _("lima.ui.fiscalperiod.addfiscalperiod.morethan12"),
+ _("lima.ui.fiscalperiod.addfiscalperiodtitle"),
+ JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);
}
- if (n == JOptionPane.YES_OPTION || nbMonth == 11) {
+ // FIXME echatellier 20120405 je ne comprend pas le "|| nbMonth == 11"
+ if (response == JOptionPane.YES_OPTION || nbMonth == 11) {
try {
+ fiscalPeriod = fiscalPeriodService.createFiscalPeriod(fiscalPeriod);
model.addFiscalPeriod(fiscalPeriod);
- } catch (LimaException eee) {
- if (log.isErrorEnabled()) {
- log.error("Can't add fiscal period", eee);
- }
- DialogHelper.showErrorMessageDialog(view, eee);
+ } catch (LimaException ex) {
+ throw new LimaRuntimeException("Can't add fiscal period", ex);
}
}
}
}
+ /**
+ * Init add period view.
+ *
+ * @param addPeriod view to init
+ */
+ public void init(AddPeriod addPeriod) {
+ addPeriod.getRootPane().setDefaultButton(addPeriod.getOkButton());
+
+ // set begin date picker
+ Date endDate = null;
+ Calendar calendarBegin = Calendar.getInstance();
+ // set begindate to JAN 1 - 0:00.000 of this years
+ Date beginDate = calendarBegin.getTime();
+ beginDate = DateUtils.truncate(beginDate, Calendar.DATE);
+ try {
+ FiscalPeriod result = fiscalPeriodService.getLastFiscalPeriod();
+ if (result != null){
+ beginDate = result.getEndDate();
+ }
+ }
+ catch (LimaException eee){
+ if(log.isDebugEnabled()){
+ log.debug("Can't get last fiscal period", eee);
+ }
+ }
+ beginDate = DateUtils.addDays(beginDate, 1);
+ addPeriod.getBeginDatePicker().setDate(beginDate);
+
+ // get end date
+ endDate = DateUtils.addYears(beginDate, 1);
+ endDate = DateUtils.addDays(endDate, -1);
+ addPeriod.getEndDatePicker().setDate(endDate);
+ }
+
+ /**
+ * Block selected fiscal period after user confirmation.
+ */
public void blockFiscalPeriod() {
- JXTable fiscalPeriodeTable = getView().getFiscalPeriodTable();
+ JXTable fiscalPeriodeTable = view.getFiscalPeriodTable();
int selectedRow = fiscalPeriodeTable.getSelectedRow();
- FiscalPeriodTableModel model =
- (FiscalPeriodTableModel) getView().getFiscalPeriodTable().getModel();
- // blocked it
+ FiscalPeriodTableModel model = view.getFiscalPeriodTableModel();
+ FiscalPeriod selectedFiscalPeriod = model.getFiscalPeriodAt(selectedRow);
+
try {
- FiscalPeriod selectedFiscalPeriod =
- model.getFiscalPeriodAtRow(selectedRow);
+
//check if the user want to block the fiscal year
- int response =
- JOptionPane.showConfirmDialog(getView(),
- _("lima.charts.fiscalperiod.question.blocked"),
- _("lima.common.question"), JOptionPane.YES_NO_OPTION,
- JOptionPane.QUESTION_MESSAGE);
+ int response = JOptionPane.showConfirmDialog(view,
+ _("lima.ui.fiscalperiod.block.confirmation"),
+ _("lima.ui.fiscalperiod.block.title"), JOptionPane.YES_NO_OPTION,
+ JOptionPane.WARNING_MESSAGE);
if (response == JOptionPane.YES_OPTION) {
//use to tell if the user wants to create a new fiscal year
boolean newyear = false;
@@ -144,19 +199,22 @@
newyear = true; //two are open
} else {
//check if the user wants to create a new fiscal year
- response =
- JOptionPane.showConfirmDialog(getView(),
- _("lima.charts.fiscalperiod.question.newyear"),
- _("lima.common.question"), JOptionPane.YES_NO_OPTION,
- JOptionPane.QUESTION_MESSAGE);
- //create a new fiscal year
+ response = JOptionPane.showConfirmDialog(view,
+ _("lima.ui.fiscalperiod.block.newyear"),
+ _("lima.ui.fiscalperiod.block.title"), JOptionPane.YES_NO_OPTION,
+ JOptionPane.QUESTION_MESSAGE);
+ // create a new fiscal year
if (response == JOptionPane.YES_OPTION) {
addFiscalPeriod();
newyear = true;
}
}
+
+ // FIXME report a nouveau et bloquage en une seule opération
+ // transactionnelle
addRetainedEarnings(selectedFiscalPeriod, newyear);
- model.blockFiscalPeriod(selectedFiscalPeriod);
+ selectedFiscalPeriod = fiscalPeriodService.blockFiscalPeriod(selectedFiscalPeriod);
+ model.updateFiscalPeriod(selectedFiscalPeriod);
}
} catch (LimaException eee) {
if (log.isErrorEnabled()) {
@@ -167,16 +225,15 @@
}
/**
- * Sets EntryBook and Date to use
+ * Report à nouveau.
*
+ * @deprecated a déplacer en partie en metier
* @param selectedFiscalPeriod
* @param newyear
*/
+ @Deprecated
public void addRetainedEarnings(FiscalPeriod selectedFiscalPeriod, boolean newyear) {
-// JXTable fiscalPeriodeTable = getView().getFiscalPeriodTable();
-// int selectedRow = fiscalPeriodeTable.getSelectedRow();
-// FiscalPeriodTableModel model =
-// (FiscalPeriodTableModel)getView().getFiscalPeriodTable().getModel();
+
try {
boolean found = false;
List<FinancialTransaction> financialTransactionsList =
@@ -199,11 +256,10 @@
//report if they are at least one transaction to be report
if (found) {
//check if the user wants to report datas
- int response =
- JOptionPane.showConfirmDialog(getView(),
- _("lima.charts.fiscalperiod.question.addretainedearnings"),
- _("lima.common.question"), JOptionPane.YES_NO_OPTION,
- JOptionPane.QUESTION_MESSAGE);
+ int response = JOptionPane.showConfirmDialog(view,
+ _("lima.ui.fiscalperiod.block.addretainedearnings"),
+ _("lima.ui.fiscalperiod.block.title"), JOptionPane.YES_NO_OPTION,
+ JOptionPane.QUESTION_MESSAGE);
//ask user for the entrybook to use for retained earnings
if (response == JOptionPane.YES_OPTION) {
//Sets EntryBook
@@ -230,13 +286,12 @@
}
}
-
- public FiscalPeriodView getView() {
- return view;
+
+ @Override
+ public void notifyMethod(String serviceName, String methodeName) {
+ //refresh on import datas
+ if (methodeName.contains("importAll")) {
+ loadAllFiscalPeriod();
+ }
}
-
- public void refresh() {
- tableModel = (FiscalPeriodTableModel) getView().getFiscalPeriodTable().getModel();
- tableModel.refresh();
- }
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/RetainedEarningsEntryBookForm.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/RetainedEarningsEntryBookForm.jaxx 2012-04-05 14:09:35 UTC (rev 3354)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/RetainedEarningsEntryBookForm.jaxx 2012-04-06 10:07:48 UTC (rev 3355)
@@ -5,7 +5,7 @@
$Id$
$HeadURL$
%%
- Copyright (C) 2008 - 2011 CodeLutin
+ Copyright (C) 2008 - 2012 CodeLutin, Chatellier Eric
%%
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as
@@ -22,22 +22,21 @@
<http://www.gnu.org/licenses/gpl-3.0.html>.
#L%
-->
-<JDialog modal="true"
+<JDialog title="lima.ui.fiscalperiod.block.retainedearningstitle" modal="true"
defaultCloseOperation="{JDialog.DO_NOTHING_ON_CLOSE}"
onWindowClosing="performCancel();">
<import>
javax.swing.text.Document
org.chorem.lima.entity.EntryBook
- org.chorem.lima.ui.LimaRendererUtil
org.chorem.lima.ui.combobox.EntryBookComboBoxModel
</import>
+
<EntryBook id="entryBook" javaBean="null"/>
<Boolean id="addState" javaBean='true'/>
<script>
<![CDATA[
-
getRootPane().setDefaultButton(okButton);
/**
@@ -96,7 +95,7 @@
<EntryBookComboBoxModel id="modelEntryBookComboBox"/>
<JComboBox id="entryBookComboBox"
model="{getModelEntryBookComboBox()}"
- renderer="{LimaRendererUtil.newDecoratorListCellRenderer(EntryBook.class)}"
+ renderer="{new EntryBookListRenderer()}"
editable="false"
onItemStateChanged="getEntryBook().setCode(((EntryBook)getEntryBookComboBox().getSelectedItem()).getCode()); getEntryBook().setLabel(((EntryBook)getEntryBookComboBox().getSelectedItem()).getLabel())"/>
</cell>
Added: trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/package-info.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/package-info.java (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/package-info.java 2012-04-06 10:07:48 UTC (rev 3355)
@@ -0,0 +1,31 @@
+/*
+ * #%L
+ *
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2012 Codelutin, Chatellier Eric
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+/**
+ * Gestion des exercices.
+ *
+ * Onglet presentant la liste des exercices, avec option de création et de
+ * cloture avec option de report à nouveau.
+ */
+package org.chorem.lima.ui.fiscalperiod;
Property changes on: trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/package-info.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
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 2012-04-05 14:09:35 UTC (rev 3354)
+++ trunk/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties 2012-04-06 10:07:48 UTC (rev 3355)
@@ -293,6 +293,18 @@
lima.ui.entrybook.label=
lima.ui.entrybook.remove=
lima.ui.entrybook.update=
+lima.ui.fiscalperiod.addfiscalperiod.morethan12=
+lima.ui.fiscalperiod.addfiscalperiodtitle=
+lima.ui.fiscalperiod.addperiodtitle=
+lima.ui.fiscalperiod.block.addretainedearnings=
+lima.ui.fiscalperiod.block.confirmation=
+lima.ui.fiscalperiod.block.newyear=
+lima.ui.fiscalperiod.block.retainedearningstitle=
+lima.ui.fiscalperiod.block.title=
+lima.ui.fiscalperiod.closed=
+lima.ui.fiscalperiod.closure=
+lima.ui.fiscalperiod.fiscalperiod=
+lima.ui.fiscalperiod.open=
lima.ui.importexport.importcsv=
lima.ui.importexport.importebp=
lima.vatreport.listerror=Can't get entries list
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 2012-04-05 14:09:35 UTC (rev 3354)
+++ trunk/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties 2012-04-06 10:07:48 UTC (rev 3355)
@@ -292,6 +292,18 @@
lima.ui.entrybook.label=Libellé
lima.ui.entrybook.remove=Supprimer
lima.ui.entrybook.update=Modifier
+lima.ui.fiscalperiod.addfiscalperiod.morethan12=La période sélectionnée n'est pas de 12 mois, voulez-vous continuer ?
+lima.ui.fiscalperiod.addfiscalperiodtitle=Nouvel exercice
+lima.ui.fiscalperiod.addperiodtitle=
+lima.ui.fiscalperiod.block.addretainedearnings=Reporter à nouveau?
+lima.ui.fiscalperiod.block.confirmation=Ètes vous sûre de vouloir clôturer cette période ? Cette action est irréversible \!
+lima.ui.fiscalperiod.block.newyear=Voulez vous créer un nouvel exercice?
+lima.ui.fiscalperiod.block.retainedearningstitle=Report à nouveau
+lima.ui.fiscalperiod.block.title=Cloture de l'excercice
+lima.ui.fiscalperiod.closed=Cloturé
+lima.ui.fiscalperiod.closure=Cloture
+lima.ui.fiscalperiod.fiscalperiod=Exercice
+lima.ui.fiscalperiod.open=Ouvert
lima.ui.importexport.importcsv=Import/Export CSV
lima.ui.importexport.importebp=Import/Export EBP
lima.vatreport.listerror=Erreur lors de la récupération des données de la liste
1
0
r3354 - in trunk: lima-business/src/main/java/org/chorem/lima/business/accountingrules 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-swing/src/main/java/org/chorem/lima/ui/account lima-swing/src/main/java/org/chorem/lima/ui/entrybook lima-swing/src/main/resources/i18n
by echatellier@users.chorem.org April 5, 2012
by echatellier@users.chorem.org April 5, 2012
April 5, 2012
Author: echatellier
Date: 2012-04-05 16:09:35 +0200 (Thu, 05 Apr 2012)
New Revision: 3354
Url: http://chorem.org/repositories/revision/lima/3354
Log:
Modification (modele/service) de la gestion des journaux.
Added:
trunk/lima-callao/src/main/java/org/chorem/lima/entity/FinancialTransactionDAO.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/package-info.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/package-info.java
Modified:
trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/DefaultAccountingRules.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/EntryBookServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/EntryBookService.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/EntryBookServiceLocal.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountForm.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountImportForm.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/UpdateAccountForm.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookForm.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookImportForm.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookTableModel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookViewHandler.java
trunk/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties
trunk/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/DefaultAccountingRules.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/DefaultAccountingRules.java 2012-04-05 10:58:58 UTC (rev 3353)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/DefaultAccountingRules.java 2012-04-05 14:09:35 UTC (rev 3354)
@@ -130,7 +130,7 @@
try {
FinancialTransactionDAO financialTransactionDAO = LimaCallaoDAOHelper.getFinancialTransactionDAO(topiaTransaction);
// Check if entrybook have entries
- int nbfinancialtransaction = financialTransactionDAO.findAllByEntryBook(entryBook).size();
+ long nbfinancialtransaction = financialTransactionDAO.getCountByEntryBook(entryBook);
if (nbfinancialtransaction != 0) {
throw new LimaBusinessException(_("lima-business.defaultaccountingrules.deleteentrybookerror"));
}
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 2012-04-05 10:58:58 UTC (rev 3353)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/EntryBookServiceImpl.java 2012-04-05 14:09:35 UTC (rev 3354)
@@ -25,6 +25,13 @@
package org.chorem.lima.business.ejb;
+import static org.nuiton.i18n.I18n._;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.ejb.Stateless;
+
import org.chorem.lima.business.AccountingRules;
import org.chorem.lima.business.LimaBusinessException;
import org.chorem.lima.business.LimaConfig;
@@ -42,12 +49,6 @@
import org.nuiton.topia.TopiaContext;
import org.nuiton.topia.TopiaException;
-import javax.ejb.Stateless;
-import java.util.ArrayList;
-import java.util.List;
-
-import static org.nuiton.i18n.I18n._;
-
/**
* Implémente la fonction multi-EntryBook. Il est possible de créer ici le
* EntryBook des ventes, le EntryBook des achats, etc.
@@ -64,10 +65,11 @@
}
@Override
- public void createEntryBookWithTransaction(EntryBook entryBook,
+ public EntryBook createEntryBookWithTransaction(EntryBook entryBook,
TopiaContext topiaContext)
throws LimaException {
+ EntryBook result = null;
try {
// check if entrybook with is name already exist
@@ -82,7 +84,7 @@
}
// creation du EntryBook
- entryBookDAO.create(entryBook);
+ result = entryBookDAO.create(entryBook);
//create ClosedPeriodicEntryBook for all unblocked financial period
ClosedPeriodicEntryBookDAO closedPeriodicEntryBookDAO =
@@ -107,22 +109,25 @@
} catch (TopiaException ex) {
doCatch(topiaContext, ex);
}
-
+ return result;
}
@Override
- public void createEntryBook(EntryBook entryBook) throws LimaException {
+ public EntryBook createEntryBook(EntryBook entryBook) throws LimaException {
TopiaContext transaction = beginTransaction(rootContext);
+ EntryBook result = null;
try {
- createEntryBookWithTransaction(entryBook, transaction);
+ result = createEntryBookWithTransaction(entryBook, transaction);
} catch (Exception ex) {
doCatch(transaction, ex);
} finally {
doFinally(transaction);
}
+
+ return result;
}
@Override
@@ -147,16 +152,17 @@
}
@Override
- public void updateEntryBook(EntryBook entryBook) throws LimaException {
+ public EntryBook updateEntryBook(EntryBook entryBook) throws LimaException {
TopiaContext transaction = beginTransaction(rootContext);
+ EntryBook result = null;
try {
EntryBookDAO entryBookDAO =
LimaCallaoDAOHelper.getEntryBookDAO(transaction);
// creation du EntryBook
- entryBookDAO.update(entryBook);
+ result = entryBookDAO.update(entryBook);
commitTransaction(transaction);
} catch (Exception ex) {
@@ -164,6 +170,8 @@
} finally {
doFinally(transaction);
}
+
+ return result;
}
@Override
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/EntryBookService.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/EntryBookService.java 2012-04-05 10:58:58 UTC (rev 3353)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/EntryBookService.java 2012-04-05 14:09:35 UTC (rev 3354)
@@ -66,7 +66,7 @@
* @param entryBook
* @throws LimaException
*/
- void createEntryBook(EntryBook entryBook) throws LimaException;
+ EntryBook createEntryBook(EntryBook entryBook) throws LimaException;
/**
* Permet de modifier un journal.
@@ -74,7 +74,7 @@
* @param entryBook journal
* @throws LimaException
*/
- void updateEntryBook(EntryBook entryBook) throws LimaException;
+ EntryBook updateEntryBook(EntryBook entryBook) throws LimaException;
/**
* Permet d'effacer un EntryBook dans la base de données.
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 2012-04-05 10:58:58 UTC (rev 3353)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/EntryBookServiceLocal.java 2012-04-05 14:09:35 UTC (rev 3354)
@@ -45,6 +45,6 @@
@Local
public interface EntryBookServiceLocal extends EntryBookService {
- void createEntryBookWithTransaction(EntryBook entryBook, TopiaContext topiaContext) throws LimaException;
+ EntryBook createEntryBookWithTransaction(EntryBook entryBook, TopiaContext topiaContext) throws LimaException;
}
Added: trunk/lima-callao/src/main/java/org/chorem/lima/entity/FinancialTransactionDAO.java
===================================================================
--- trunk/lima-callao/src/main/java/org/chorem/lima/entity/FinancialTransactionDAO.java (rev 0)
+++ trunk/lima-callao/src/main/java/org/chorem/lima/entity/FinancialTransactionDAO.java 2012-04-05 14:09:35 UTC (rev 3354)
@@ -0,0 +1,54 @@
+/*
+ * #%L
+ * Lima callao
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2012 CodeLutin, Chatellier Eric
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+package org.chorem.lima.entity;
+
+import org.nuiton.topia.TopiaException;
+
+/**
+ * Ajout de requetes specifiques aux financial transaction sur le DAO.
+ *
+ * @author chatellier
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author$
+ */
+public class FinancialTransactionDAO extends FinancialTransactionDAOImpl<FinancialTransaction> {
+
+ /**
+ * Return how many transaction are found with specified entryBook.
+ *
+ * @param entryBook entry book
+ * @return transaction referencing entry book
+ * @throws TopiaException
+ */
+ public long getCountByEntryBook(EntryBook entryBook) throws TopiaException {
+ String query = "SELECT count(*) FROM " + FinancialTransaction.class.getName() + " t WHERE t.entryBook = :entryBook";
+ Number count = (Number)context.find(query, "entryBook", entryBook).get(0);
+ return count.longValue();
+ }
+
+} //FinancialTransactionDAO
Property changes on: trunk/lima-callao/src/main/java/org/chorem/lima/entity/FinancialTransactionDAO.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountForm.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountForm.jaxx 2012-04-05 10:58:58 UTC (rev 3353)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountForm.jaxx 2012-04-05 14:09:35 UTC (rev 3354)
@@ -76,4 +76,4 @@
</cell>
</row>
</Table>
-</JDialog>
\ No newline at end of file
+</JDialog>
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountImportForm.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountImportForm.jaxx 2012-04-05 10:58:58 UTC (rev 3353)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountImportForm.jaxx 2012-04-05 14:09:35 UTC (rev 3354)
@@ -22,8 +22,7 @@
<http://www.gnu.org/licenses/gpl-3.0.html>.
#L%
-->
-
-<JDialog modal="true"
+<JDialog title="lima.ui.account.importtitle" modal="true"
defaultCloseOperation="{JDialog.DO_NOTHING_ON_CLOSE}"
onWindowClosing="performCancel();">
@@ -51,7 +50,7 @@
</cell>
</row>
<row>
- <cell>
+ <cell anchor="west">
<JRadioButton text='lima.ui.account.shortened'
value='{AccountsChartEnum.SHORTENED}'
buttonGroup="{buttonGroup}"
@@ -59,35 +58,31 @@
</cell>
</row>
<row>
- <cell>
+ <cell anchor="west">
<JRadioButton text='lima.ui.account.base'
value='{AccountsChartEnum.BASE}'
- buttonGroup="{buttonGroup}"
- selected='true'/>
+ buttonGroup="{buttonGroup}"/>
</cell>
</row>
<row>
- <cell>
+ <cell anchor="west">
<JRadioButton text='lima.ui.account.developed'
value='{AccountsChartEnum.DEVELOPED}'
- buttonGroup="{buttonGroup}"
- selected='true'/>
+ buttonGroup="{buttonGroup}"/>
</cell>
</row>
<row>
- <cell>
+ <cell anchor="west">
<JRadioButton text='lima.ui.importexport.importcsv'
value='{AccountsChartEnum.IMPORT}'
- buttonGroup="{buttonGroup}"
- selected='true'/>
+ buttonGroup="{buttonGroup}"/>
</cell>
</row>
<row>
- <cell>
+ <cell anchor="west">
<JRadioButton text='lima.ui.importexport.importebp'
value='{AccountsChartEnum.IMPORTEBP}'
- buttonGroup="{buttonGroup}"
- selected='true'/>
+ buttonGroup="{buttonGroup}"/>
</cell>
</row>
<row>
@@ -107,4 +102,4 @@
</cell>
</row>
</Table>
-</JDialog>
\ No newline at end of file
+</JDialog>
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountView.jaxx 2012-04-05 10:58:58 UTC (rev 3353)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountView.jaxx 2012-04-05 14:09:35 UTC (rev 3354)
@@ -41,7 +41,7 @@
]]></script>
<row>
- <cell fill="both" weightx="1" weighty="1" rows='5'>
+ <cell fill="both" weightx="1" weighty="1" rows='4'>
<JScrollPane>
<JXTreeTable id="accountsTreeTable"
selectionMode="{ListSelectionModel.SINGLE_SELECTION}"
@@ -52,7 +52,7 @@
</JScrollPane>
</cell>
<cell fill="horizontal">
- <JButton id="addButton" text="lima.ui.account.addAccount"
+ <JButton id="addButton" text="lima.ui.account.addaccount"
onActionPerformed="handler.addAccount()"/>
</cell>
</row>
@@ -71,9 +71,9 @@
</cell>
</row>
<row>
- <cell fill="horizontal">
+ <cell fill="horizontal" anchor="north" weighty="1">
<JButton id="importButton" text="lima.iu.importexport.import"
onActionPerformed="handler.importAccountsChart()"/>
</cell>
</row>
-</Table>
\ No newline at end of file
+</Table>
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/UpdateAccountForm.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/UpdateAccountForm.jaxx 2012-04-05 10:58:58 UTC (rev 3353)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/UpdateAccountForm.jaxx 2012-04-05 14:09:35 UTC (rev 3354)
@@ -73,4 +73,4 @@
</cell>
</row>
</Table>
-</JDialog>
\ No newline at end of file
+</JDialog>
Added: trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/package-info.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/package-info.java (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/package-info.java 2012-04-05 14:09:35 UTC (rev 3354)
@@ -0,0 +1,31 @@
+/*
+ * #%L
+ *
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2012 Codelutin, Chatellier Eric
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+/**
+ * Gestion des creations.
+ *
+ * Onglet presentant la liste des comptes en arbre, avec action de creation,
+ * modification, suppression...
+ */
+package org.chorem.lima.ui.account;
Property changes on: trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/package-info.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookForm.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookForm.jaxx 2012-04-05 10:58:58 UTC (rev 3353)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookForm.jaxx 2012-04-05 14:09:35 UTC (rev 3354)
@@ -5,7 +5,7 @@
$Id$
$HeadURL$
%%
- Copyright (C) 2008 - 2010 CodeLutin
+ Copyright (C) 2008 - 2012 CodeLutin, Chatellier Eric
%%
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as
@@ -22,7 +22,7 @@
<http://www.gnu.org/licenses/gpl-3.0.html>.
#L%
-->
-<JDialog modal="true"
+<JDialog title="lima.ui.entrybook.entrybooktile" modal="true"
defaultCloseOperation="{JDialog.DO_NOTHING_ON_CLOSE}"
onWindowClosing="performCancel();">
@@ -46,10 +46,10 @@
<Table>
<row>
<cell>
- <JLabel text="lima.common.code"/>
+ <JLabel text="lima.ui.entrybook.code"/>
</cell>
<cell>
- <JTextField id="entryBookCodeField" text="{getEntryBook().getCode()}"/>
+ <JTextField id="entryBookCodeField" text="{getEntryBook().getCode()}" editable='{isAddState()}' />
<Document javaBean="getEntryBookCodeField().getDocument()"
onInsertUpdate='getEntryBook().setCode(getEntryBookCodeField().getText())'
onRemoveUpdate='getEntryBook().setCode(getEntryBookCodeField().getText())'/>
@@ -57,10 +57,10 @@
</row>
<row>
<cell>
- <JLabel text="lima.common.label"/>
+ <JLabel text="lima.ui.entrybook.label"/>
</cell>
<cell>
- <JTextField id="entryBookLabelField" editable='{isAddState()}'
+ <JTextField id="entryBookLabelField"
text="{getEntryBook().getLabel()}"/>
<Document javaBean="getEntryBookLabelField().getDocument()"
onInsertUpdate='getEntryBook().setLabel(getEntryBookLabelField().getText())'
@@ -69,14 +69,13 @@
</row>
<row>
<cell>
- <JButton id="cancelButton" text="lima.common.cancel"
+ <JButton id="cancelButton" text="lima.ui.common.cancel"
onActionPerformed="performCancel()"/>
</cell>
<cell>
- <JButton id="okButton" text="lima.common.ok"
+ <JButton id="okButton" text="lima.ui.common.ok"
onActionPerformed="dispose()"/>
</cell>
-
</row>
</Table>
-</JDialog>
\ No newline at end of file
+</JDialog>
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookImportForm.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookImportForm.jaxx 2012-04-05 10:58:58 UTC (rev 3353)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookImportForm.jaxx 2012-04-05 14:09:35 UTC (rev 3354)
@@ -22,23 +22,22 @@
<http://www.gnu.org/licenses/gpl-3.0.html>.
#L%
-->
-
-<JDialog modal="true"
+<JDialog title="lima.ui.entrybook.importtitle" modal="true"
defaultCloseOperation="{JDialog.DO_NOTHING_ON_CLOSE}"
onWindowClosing="performCancel();">
<import>
- jaxx.runtime.swing.JAXXButtonGroup
org.chorem.lima.enums.EntryBooksChartEnum
</import>
- <JAXXButtonGroup id="radioButtons" javaBean='new JAXXButtonGroup()'/>
- <Boolean id="addState" javaBean='true'/>
+ <javax.swing.ButtonGroup id="buttonGroup" />
+ <Boolean id="addState" javaBean='true' />
+
<script>
<![CDATA[
- getRootPane().setDefaultButton(ok);
+ getRootPane().setDefaultButton(okButton);
protected void performCancel() {
- getRadioButtons().setSelectedValue(null);
+ buttonGroup.setSelectedValue(null);
dispose();
}
]]>
@@ -47,16 +46,15 @@
<Table>
<row>
<cell>
- <JRadioButton text='lima.charts.entrybook.default'
+ <JRadioButton text='lima.ui.entrybook.default'
value='{EntryBooksChartEnum.DEFAULT}'
- buttonGroup="{getRadioButtons()}"
+ buttonGroup="{buttonGroup}"
selected='true'/>
</cell>
<cell>
- <JRadioButton text='lima.charts.entrybook.import'
+ <JRadioButton text='lima.ui.entrybook.import'
value='{EntryBooksChartEnum.IMPORT}'
- buttonGroup="{getRadioButtons()}"
- selected='true'/>
+ buttonGroup="{buttonGroup}"/>
</cell>
</row>
<row>
@@ -64,11 +62,11 @@
<Table>
<row>
<cell fill="none">
- <JButton text="lima.common.cancel"
+ <JButton text="lima.ui.common.cancel"
onActionPerformed="performCancel()"/>
</cell>
<cell fill="none">
- <JButton id="ok" text="lima.common.ok"
+ <JButton id="okButton" text="lima.ui.common.ok"
onActionPerformed="dispose()"/>
</cell>
</row>
@@ -76,4 +74,4 @@
</cell>
</row>
</Table>
-</JDialog>
\ No newline at end of file
+</JDialog>
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookTableModel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookTableModel.java 2012-04-05 10:58:58 UTC (rev 3353)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookTableModel.java 2012-04-05 14:09:35 UTC (rev 3354)
@@ -25,21 +25,16 @@
package org.chorem.lima.ui.entrybook;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.chorem.lima.business.LimaException;
-import org.chorem.lima.business.ServiceListener;
-import org.chorem.lima.business.monitorable.EntryBookServiceMonitorable;
-import org.chorem.lima.business.monitorable.ImportServiceMonitorable;
-import org.chorem.lima.entity.EntryBook;
-import org.chorem.lima.service.LimaServiceFactory;
+import static org.nuiton.i18n.I18n._;
+import java.util.List;
+
import javax.swing.table.AbstractTableModel;
-import static org.nuiton.i18n.I18n._;
+import org.chorem.lima.entity.EntryBook;
/**
- * Entry book table model.
+ * Entry book table model only rendering entry book list.
*
* @author ore
* @author chatellier
@@ -48,37 +43,20 @@
* Last update : $Date$
* By : $Author$
*/
-public class EntryBookTableModel extends AbstractTableModel implements ServiceListener {
+public class EntryBookTableModel extends AbstractTableModel {
/** serialVersionUID. */
private static final long serialVersionUID = 7578692417919755647L;
- /** log. */
- private static final Log log = LogFactory.getLog(EntryBookTableModel.class);
+ protected List<EntryBook> entryBooks;
- /** Services. */
- protected EntryBookServiceMonitorable entryBookService;
-
- /** Constructor. */
- public EntryBookTableModel() {
- entryBookService =
- LimaServiceFactory.getService(
- EntryBookServiceMonitorable.class);
- LimaServiceFactory.addServiceListener(ImportServiceMonitorable.class, this);
+ public EntryBookTableModel(List<EntryBook> entryBooks) {
+ this.entryBooks = entryBooks;
}
@Override
public int getRowCount() {
- int result = 0;
-
- try {
- result = entryBookService.getAllEntryBooks().size();
- } catch (LimaException e) {
- if (log.isDebugEnabled()) {
- log.debug("Can't get all entrybooks", e);
- }
- }
-
+ int result = entryBooks.size();
return result;
}
@@ -92,19 +70,17 @@
String res = "n/a";
switch (column) {
case 0:
- res = _("lima.table.code");
+ res = _("lima.ui.entrybook.code");
break;
case 1:
- res = _("lima.table.label");
+ res = _("lima.ui.entrybook.label");
break;
}
return res;
}
- public EntryBook getEntryBookAtRow(int row) throws LimaException {
- EntryBook entryBook;
- entryBook = entryBookService.getAllEntryBooks().get(row);
-
+ public EntryBook getEntryBookAtRow(int row) {
+ EntryBook entryBook = entryBooks.get(row);
return entryBook;
}
@@ -112,21 +88,15 @@
public Object getValueAt(int row, int column) {
Object result = null;
- try {
- EntryBook entryBook = getEntryBookAtRow(row);
+ EntryBook entryBook = getEntryBookAtRow(row);
- switch (column) {
- case 0:
- result = entryBook.getCode();
- break;
- case 1:
- result = entryBook.getLabel();
- break;
- }
- } catch (LimaException eee) {
- if (log.isDebugEnabled()) {
- log.debug("Can't get EntryBook", eee);
- }
+ switch (column) {
+ case 0:
+ result = entryBook.getCode();
+ break;
+ case 1:
+ result = entryBook.getLabel();
+ break;
}
return result;
@@ -134,51 +104,23 @@
@Override
public boolean isCellEditable(int rowIndex, int columnIndex) {
- // Ne cells editable
return false;
}
- /**
- * @param entryBook
- * @throws LimaException
- */
- public void addEntryBook(EntryBook entryBook) throws LimaException {
- /* Calling journal service */
- entryBookService.createEntryBook(entryBook);
- int row = entryBookService.getAllEntryBooks().indexOf(entryBook);
+ public void addEntryBook(EntryBook entryBook) {
+ entryBooks.add(entryBook);
+ int row = entryBooks.indexOf(entryBook);
fireTableRowsInserted(row, row);
}
- /**
- * @param entryBook
- * @throws LimaException
- */
- public void updateEntryBook(EntryBook entryBook) throws LimaException {
- /* Calling journal service */
- entryBookService.updateEntryBook(entryBook);
- int row = entryBookService.getAllEntryBooks().indexOf(entryBook);
+ public void updateEntryBook(EntryBook entryBook) {
+ int row = entryBooks.indexOf(entryBook);
fireTableRowsUpdated(row, row);
}
- /**
- * @param entryBook
- * @throws LimaException
- */
- public void removeEntryBook(EntryBook entryBook) throws LimaException {
- /* Calling journal service */
- int row = entryBookService.getAllEntryBooks().indexOf(entryBook);
- entryBookService.removeEntryBook(entryBook);
+ public void removeEntryBook(EntryBook entryBook) {
+ int row = entryBooks.indexOf(entryBook);
+ entryBooks.remove(entryBook);
fireTableRowsDeleted(row, row);
}
-
- @Override
- public void notifyMethod(String serviceName, String methodeName) {
-
- //refresh on import datas
- if (methodeName.contains("importEntryBooks")
- || methodeName.contains("importAll")
- || methodeName.contains("importAs")) {
- fireTableDataChanged();
- }
- }
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookView.jaxx 2012-04-05 10:58:58 UTC (rev 3353)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookView.jaxx 2012-04-05 14:09:35 UTC (rev 3354)
@@ -5,7 +5,7 @@
$Id$
$HeadURL$
%%
- Copyright (C) 2008 - 2010 CodeLutin
+ Copyright (C) 2008 - 2012 CodeLutin, Chatellier Eric
%%
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as
@@ -34,44 +34,47 @@
<!-- Selected row bindings -->
<Boolean id="selectedRow" javaBean="false"/>
+ <script><![CDATA[
+ void $afterCompleteSetup() {
+ handler.init();
+ }
+ ]]></script>
+
<row>
- <cell fill="both" weightx="1" weighty="1" rows='5'>
+ <cell fill="both" weightx="1" weighty="1" rows='4'>
<JScrollPane>
<EntryBookTable id="entryBooksTable" rowHeight="24"
constructorParams="getHandler()"
- model="{new org.chorem.lima.ui.entrybook.EntryBookTableModel()}"
- highlighters="{org.jdesktop.swingx.decorator.HighlighterFactory.createSimpleStriping(new java.awt.Color(222,222,222))}"
+ highlighters="{org.jdesktop.swingx.decorator.HighlighterFactory.createSimpleStriping(new java.awt.Color(233,233,233))}"
selectionMode="{ListSelectionModel.SINGLE_SELECTION}"
columnControlVisible="true"/>
<ListSelectionModel javaBean="getEntryBooksTable().getSelectionModel()"
onValueChanged="setSelectedRow(entryBooksTable.getSelectedRow() != -1)"/>
</JScrollPane>
</cell>
- </row>
- <row>
<cell fill="horizontal">
- <JButton id="addButton" text="lima.charts.entrybook.add"
+ <JButton id="addButton" text="lima.ui.entrybook.add"
onActionPerformed="getHandler().addEntryBook()"/>
</cell>
</row>
<row>
<cell fill="horizontal">
- <JButton id="updateButton" text="lima.common.update"
+ <JButton id="updateButton" text="lima.ui.entrybook.update"
enabled="{isSelectedRow()}"
onActionPerformed="getHandler().updateEntryBook()"/>
</cell>
</row>
<row>
<cell fill="horizontal">
- <JButton id="removeButton" text="lima.common.remove"
+ <JButton id="removeButton" text="lima.ui.entrybook.remove"
enabled="{isSelectedRow()}"
onActionPerformed="getHandler().deleteEntryBook()"/>
</cell>
</row>
<row>
- <cell fill="horizontal">
+ <cell fill="horizontal" anchor="north" weighty="1">
<JButton id="importButton" text="lima.importexport.import"
onActionPerformed="getHandler().importEntryBooks()"/>
</cell>
</row>
-</Table>
\ No newline at end of file
+</Table>
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookViewHandler.java 2012-04-05 10:58:58 UTC (rev 3353)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookViewHandler.java 2012-04-05 14:09:35 UTC (rev 3354)
@@ -25,24 +25,28 @@
package org.chorem.lima.ui.entrybook;
+import static org.nuiton.i18n.I18n._;
+
+import java.util.List;
+
+import javax.swing.JOptionPane;
+
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.business.LimaException;
+import org.chorem.lima.business.LimaRuntimeException;
+import org.chorem.lima.business.ServiceListener;
import org.chorem.lima.business.ejbinterface.EntryBookService;
import org.chorem.lima.business.monitorable.EntryBookServiceMonitorable;
+import org.chorem.lima.business.monitorable.ImportServiceMonitorable;
import org.chorem.lima.entity.EntryBook;
import org.chorem.lima.entity.EntryBookImpl;
import org.chorem.lima.enums.EntryBooksChartEnum;
import org.chorem.lima.enums.ImportExportEnum;
import org.chorem.lima.service.LimaServiceFactory;
import org.chorem.lima.ui.importexport.ImportExport;
-import org.chorem.lima.util.DialogHelper;
import org.jdesktop.swingx.JXTable;
-import javax.swing.JOptionPane;
-
-import static org.nuiton.i18n.I18n._;
-
/**
* Handler for entry book view.
*
@@ -52,7 +56,7 @@
* Last update : $Date$
* By : $Author$
*/
-public class EntryBookViewHandler {
+public class EntryBookViewHandler implements ServiceListener {
private static final Log log = LogFactory.getLog(EntryBookViewHandler.class);
@@ -65,114 +69,149 @@
entryBookService =
LimaServiceFactory.getService(
EntryBookServiceMonitorable.class);
+ LimaServiceFactory.addServiceListener(ImportServiceMonitorable.class, this);
}
+ public void init() {
+ loadAllEntryBooks();
+ }
+
+ /**
+ * Load all available entry book into table.
+ */
+ protected void loadAllEntryBooks() {
+
+ try {
+ List<EntryBook> entryBooks = entryBookService.getAllEntryBooks();
+ if (log.isDebugEnabled()) {
+ log.debug(String.format("Loaded %d entry books from service", entryBooks.size()));
+ }
+
+ EntryBookTableModel model = new EntryBookTableModel(entryBooks);
+ EntryBookTable table = view.getEntryBooksTable();
+ table.setModel(model);
+ } catch (LimaException ex) {
+ throw new LimaRuntimeException("Can't load entry books", ex);
+ }
+ }
+
+ /**
+ * Add new entry book (display blocking dialog and perform add).
+ */
public void addEntryBook() {
- JXTable entryBookTable = view.getEntryBooksTable();
- EntryBookTableModel entryBookTableModel =
- (EntryBookTableModel) entryBookTable.getModel();
-
EntryBook newEntryBook = new EntryBookImpl();
EntryBookForm entryBookForm = new EntryBookForm(view);
entryBookForm.setEntryBook(newEntryBook);
- // jaxx constructor don't call super() ?
entryBookForm.setLocationRelativeTo(view);
entryBookForm.setVisible(true);
+ newEntryBook = entryBookForm.getEntryBook();
// null == cancel action
- newEntryBook = entryBookForm.getEntryBook();
if (newEntryBook != null) {
- // add it
try {
+ // service call
+ newEntryBook = entryBookService.createEntryBook(newEntryBook);
+
+ // ui refresh
+ JXTable entryBookTable = view.getEntryBooksTable();
+ EntryBookTableModel entryBookTableModel = (EntryBookTableModel) entryBookTable.getModel();
entryBookTableModel.addEntryBook(newEntryBook);
- } catch (LimaException eee) {
- if (log.isErrorEnabled()) {
- log.error("Can't add entry book", eee);
- }
- DialogHelper.showErrorMessageDialog(view, eee);
+ } catch (LimaException ex) {
+ throw new LimaRuntimeException("Can't add entry book", ex);
}
}
}
+ /**
+ * Update existing entry book.
+ */
public void updateEntryBook() {
JXTable entryBookTable = view.getEntryBooksTable();
+ EntryBookTableModel entryBookTableModel = (EntryBookTableModel) entryBookTable.getModel();
int selectedRow = entryBookTable.getSelectedRow();
- EntryBookTableModel entryBookTableModel =
- (EntryBookTableModel) entryBookTable.getModel();
- // add it
- try {
- EntryBook selectedEntryBook =
- entryBookTableModel.getEntryBookAtRow(selectedRow);
- EntryBookForm entryBookForm = new EntryBookForm(view);
- entryBookForm.setEntryBook(selectedEntryBook);
- // jaxx constructor don't call super() ?
- entryBookForm.setLocationRelativeTo(view);
- entryBookForm.setVisible(true);
+ EntryBook selectedEntryBook = entryBookTableModel.getEntryBookAtRow(selectedRow);
+ EntryBookForm entryBookForm = new EntryBookForm(view);
+ entryBookForm.setAddState(false);
+ entryBookForm.setEntryBook(selectedEntryBook);
+ entryBookForm.setLocationRelativeTo(view);
+ entryBookForm.setVisible(true);
- // null == cancel action
- selectedEntryBook = entryBookForm.getEntryBook();
- if (selectedEntryBook != null) {
+ // null == cancel action
+ selectedEntryBook = entryBookForm.getEntryBook();
+ if (selectedEntryBook != null) {
+ try {
+ // service call
+ selectedEntryBook = entryBookService.updateEntryBook(selectedEntryBook);
+
+ // ui refresh
entryBookTableModel.updateEntryBook(selectedEntryBook);
+ } catch (LimaException ex) {
+ throw new LimaRuntimeException("Can't update entry book", ex);
}
- } catch (LimaException eee) {
- if (log.isErrorEnabled()) {
- log.error("Can't add update book", eee);
- }
- DialogHelper.showErrorMessageDialog(view, eee);
}
}
+ /**
+ * Delete selected entry book.
+ */
public void deleteEntryBook() {
JXTable entryBookTable = view.getEntryBooksTable();
int selectedRow = entryBookTable.getSelectedRow();
- EntryBookTableModel entryBookTableModel =
- (EntryBookTableModel) entryBookTable.getModel();
+ EntryBookTableModel entryBookTableModel = (EntryBookTableModel) entryBookTable.getModel();
- // add it
- try {
- EntryBook selectedEntryBook =
- entryBookTableModel.getEntryBookAtRow(selectedRow);
+ EntryBook selectedEntryBook = entryBookTableModel.getEntryBookAtRow(selectedRow);
- int response =
- JOptionPane.showConfirmDialog(view,
- _("lima.charts.entrybook.confirmation",
- selectedEntryBook.getLabel()),
- _("lima.common.confirmation"), JOptionPane.YES_NO_OPTION,
- JOptionPane.QUESTION_MESSAGE);
+ int response = JOptionPane.showConfirmDialog(view,
+ _("lima.ui.entrybook.deletemessage", selectedEntryBook.getLabel()),
+ _("lima.ui.entrybook.deletetitle"), JOptionPane.YES_NO_OPTION,
+ JOptionPane.QUESTION_MESSAGE);
- if (response == JOptionPane.YES_OPTION) {
+ if (response == JOptionPane.YES_OPTION) {
+
+ try {
+ entryBookService.removeEntryBook(selectedEntryBook);
entryBookTableModel.removeEntryBook(selectedEntryBook);
+ } catch (LimaException ex) {
+ throw new LimaRuntimeException("Can't delete entry book", ex);
}
- } catch (LimaException eee) {
- if (log.isErrorEnabled()) {
- log.error("Can't delete update book", eee);
- }
- DialogHelper.showErrorMessageDialog(view, eee);
}
+
}
-
+ /**
+ * Import entry book.
+ *
+ * UI will be refreshed by {@link #notifyMethod(String, String)} called
+ * by service listener.
+ */
public void importEntryBooks() {
- EntryBookImportForm form =
- new EntryBookImportForm();
+ EntryBookImportForm form = new EntryBookImportForm(view);
form.setLocationRelativeTo(view);
form.setVisible(true);
- Object value = form.getRadioButtons().getSelectedValue();
+ Object value = form.getButtonGroup().getSelectedValue();
// if action confirmed
if (value != null) {
- EntryBooksChartEnum defaultEntryBooksEnum =
- (EntryBooksChartEnum) value;
+ EntryBooksChartEnum defaultEntryBooksEnum = (EntryBooksChartEnum) value;
ImportExport importExport = new ImportExport(view);
importExport.importExport(ImportExportEnum.CSV_ENTRYBOOKS_IMPORT,
defaultEntryBooksEnum.getFilePath(), true);
}
}
+ @Override
+ public void notifyMethod(String serviceName, String methodeName) {
+
+ //refresh on import datas
+ if (methodeName.contains("importEntryBooks")
+ || methodeName.contains("importAll")
+ || methodeName.contains("importAs")) {
+ loadAllEntryBooks();
+ }
+ }
}
-
Added: trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/package-info.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/package-info.java (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/package-info.java 2012-04-05 14:09:35 UTC (rev 3354)
@@ -0,0 +1,31 @@
+/*
+ * #%L
+ *
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2012 Codelutin, Chatellier Eric
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+/**
+ * Gestion des journaux.
+ *
+ * Onglet presentant la liste des journaux en table avec action de creation,
+ * modification, suppression...
+ */
+package org.chorem.lima.ui.entrybook;
Property changes on: trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/package-info.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
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 2012-04-05 10:58:58 UTC (rev 3353)
+++ trunk/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties 2012-04-05 14:09:35 UTC (rev 3354)
@@ -267,9 +267,11 @@
lima.tooltip.filter=<html>Regular expression \:<br/>- accounts interval i..j <br/>- accounts list i,j,k <br/>- Exclude an account -i</html>
lima.tooltip.lettering=<html>Add a letter on many entries <br/>Select many rows with combination ctrl + click</html>
lima.ui.account.addAccount=
+lima.ui.account.addaccount=
lima.ui.account.addaccounttitle=
lima.ui.account.base=
lima.ui.account.developed=
+lima.ui.account.importtitle=
lima.ui.account.label=
lima.ui.account.number=
lima.ui.account.removeaccountconfirm=
@@ -280,6 +282,17 @@
lima.ui.common.ok=
lima.ui.common.remove=
lima.ui.common.update=
+lima.ui.entrybook.add=
+lima.ui.entrybook.code=
+lima.ui.entrybook.default=
+lima.ui.entrybook.deletemessage=
+lima.ui.entrybook.deletetitle=
+lima.ui.entrybook.entrybooktile=
+lima.ui.entrybook.import=
+lima.ui.entrybook.importtitle=
+lima.ui.entrybook.label=
+lima.ui.entrybook.remove=
+lima.ui.entrybook.update=
lima.ui.importexport.importcsv=
lima.ui.importexport.importebp=
lima.vatreport.listerror=Can't get entries list
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 2012-04-05 10:58:58 UTC (rev 3353)
+++ trunk/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties 2012-04-05 14:09:35 UTC (rev 3354)
@@ -266,10 +266,11 @@
lima.title.about.description=Logiciel de comptabilité Libre
lima.tooltip.filter=<html>Expression régulière \:<br/>- intervalle de compte i..j <br/>- liste de compte i,j,k <br/>- Exclure un compte -i</html>
lima.tooltip.lettering=<html>Pour ajouter une lettre à plusieurs écritures <br/>Sélectionner plusieurs lignes avec la combinaison ctrl + click</html>
-lima.ui.account.addAccount=Nouveau compte
+lima.ui.account.addaccount=Nouveau compte
lima.ui.account.addaccounttitle=Ajout d'un compte
lima.ui.account.base=Plan comptable de base
lima.ui.account.developed=Plan comptable développé
+lima.ui.account.importtitle=Importer
lima.ui.account.label=Libellé
lima.ui.account.number=Numéro de compte
lima.ui.account.removeaccountconfirm=Voulez-vous supprimer le compte %s ?
@@ -280,6 +281,17 @@
lima.ui.common.ok=Ok
lima.ui.common.remove=Supprimer
lima.ui.common.update=Modifier
+lima.ui.entrybook.add=Ajout de journal
+lima.ui.entrybook.code=Code
+lima.ui.entrybook.default=Journaux par défault
+lima.ui.entrybook.deletemessage=Êtes vous sûr de vouloir supprimer le journal %s ?
+lima.ui.entrybook.deletetitle=Suppression de journal
+lima.ui.entrybook.entrybooktile=Journal
+lima.ui.entrybook.import=Importer
+lima.ui.entrybook.importtitle=Import
+lima.ui.entrybook.label=Libellé
+lima.ui.entrybook.remove=Supprimer
+lima.ui.entrybook.update=Modifier
lima.ui.importexport.importcsv=Import/Export CSV
lima.ui.importexport.importebp=Import/Export EBP
lima.vatreport.listerror=Erreur lors de la récupération des données de la liste
1
0
April 5, 2012
Author: echatellier
Date: 2012-04-05 12:58:58 +0200 (Thu, 05 Apr 2012)
New Revision: 3353
Url: http://chorem.org/repositories/revision/lima/3353
Log:
Add add/update/delete account code
Added:
trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountTreeTableModel.java
Removed:
trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountTreeTable.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/SubLedgerForm.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/UpdateSubLedgerForm.jaxx
Modified:
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.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-swing/src/main/java/org/chorem/lima/LimaContext.java
trunk/lima-swing/src/main/java/org/chorem/lima/LimaMain.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainViewHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountForm.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountImportForm.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountTreeTableRenderer.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountViewHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/UpdateAccountForm.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookViewHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartViewHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/OpeningViewHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatchart/VatChartViewHandler.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/lima-swing/src/main/resources/log4j.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 2012-04-05 10:10:32 UTC (rev 3352)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java 2012-04-05 10:58:58 UTC (rev 3353)
@@ -84,9 +84,11 @@
* Create new account with existing transaction.
*/
@Override
- public void createAccountWithTransaction(Account account,
+ public Account createAccountWithTransaction(Account account,
TopiaContext topiaContext) throws LimaException {
+ Account result = null;
+
try {
// force uppercase account number
account.setAccountNumber(account.getAccountNumber().toUpperCase());
@@ -104,12 +106,14 @@
}
//create it
- accountDAO.create(account);
+ result = accountDAO.create(account);
commitTransaction(topiaContext);
} catch (TopiaException ex) {
doCatch(topiaContext, ex);
}
+
+ return result;
}
@@ -123,12 +127,13 @@
* @throws LimaException
*/
@Override
- public void createAccount(Account account) throws LimaException {
+ public Account createAccount(Account account) throws LimaException {
// check rules before create the account
AccountingRules accountingRules = LimaConfig.getInstance().getAccountingRules();
accountingRules.createAccountRules(account);
+ Account result = null;
TopiaContext transaction = beginTransaction(rootContext);
try {
@@ -142,12 +147,13 @@
account.getAccountNumber()));
}
- createAccountWithTransaction(account, transaction);
+ result = createAccountWithTransaction(account, transaction);
} catch (Exception ex) {
doCatch(transaction, ex);
} finally {
doFinally(transaction);
}
+ return result;
}
/** Permer d'obtenir la liste des comptes à partir d'une de ses propriétés */
@@ -309,15 +315,9 @@
/** Get list of all subaccount and ledger of an account */
@Override
- public List<Account> getAllChildrenAccounts(Account masterAccount,
- List<Account> accounts) throws LimaException {
+ public List<Account> getAllChildrenAccounts(Account masterAccount) throws LimaException {
- List<Account> childAccounts = getChildrenAccounts(masterAccount);
- accounts.addAll(childAccounts);
- for (Account account : childAccounts) {
- getAllChildrenAccounts(account, accounts);
- }
- return accounts;
+ return null;
}
/**
@@ -335,32 +335,16 @@
AccountingRules accountingRules = LimaConfig.getInstance().getAccountingRules();
try {
- AccountDAO accountDAO =
- LimaCallaoDAOHelper.getAccountDAO(transaction);
// Check rules for account if have entries
accountingRules.removeAccountRules(account, transaction);
// remove account
+ AccountDAO accountDAO = LimaCallaoDAOHelper.getAccountDAO(transaction);
Account accountToDelete = accountDAO.findByTopiaId(account.getTopiaId());
-
- //get all subaccounts
- 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());
- accountDAO.delete(subAccountToDelete);
- }
- }
-
accountDAO.delete(accountToDelete);
- //commit
commitTransaction(transaction);
+
} catch (Exception ex) {
doCatch(transaction, ex);
} finally {
@@ -378,7 +362,7 @@
/**
- * Permet de modifier un compte sur son label et son compte père.
+ * Permet de modifier un compte sur son label.
* <p/>
* Il n'est pas possible de modifier un numéro de compte.
* Si le compte n'existe pas, il envoie alors un message d'avertissement.
@@ -387,23 +371,25 @@
* @throws LimaException
*/
@Override
- public void updateAccount(Account account) throws LimaException {
+ public Account updateAccount(Account account) throws LimaException {
TopiaContext transaction = beginTransaction(rootContext);
AccountingRules accountingRules = LimaConfig.getInstance().getAccountingRules();
+ Account result = null;
try {
// DAO
AccountDAO accountDAO =
LimaCallaoDAOHelper.getAccountDAO(transaction);
- Account subAccount = accountDAO.findByTopiaId(account.getTopiaId());
accountingRules.updateAccountRules(account);
- accountDAO.update(subAccount);
+ result = accountDAO.update(account);
commitTransaction(transaction);
} catch (Exception ex) {
doCatch(transaction, ex);
} finally {
doFinally(transaction);
}
+
+ return result;
}
}
\ No newline at end of file
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 2012-04-05 10:10:32 UTC (rev 3352)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/AccountService.java 2012-04-05 10:58:58 UTC (rev 3353)
@@ -83,20 +83,18 @@
* Create new account. If {@code masterAccount} is not null, {@code account}
* is added in {@code masterAccount}'s subAccounts.
*
- * @param masterAccount master account (can be null)
* @param account account
* @throws LimaException
*/
- void createAccount(Account account) throws LimaException;
+ Account createAccount(Account account) throws LimaException;
- void updateAccount(Account account) throws LimaException;
+ Account updateAccount(Account account) throws LimaException;
void removeAccount(Account account) throws LimaException;
void removeAllAccount() throws LimaException;
- List<Account> getAllChildrenAccounts(Account masterAccount,
- List<Account> accounts) throws LimaException;
+ List<Account> getAllChildrenAccounts(Account masterAccount) throws LimaException;
List<Account> getChildrenAccounts(Account masterAccount) 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 2012-04-05 10:10:32 UTC (rev 3352)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/AccountServiceLocal.java 2012-04-05 10:58:58 UTC (rev 3353)
@@ -43,6 +43,6 @@
@Local
public interface AccountServiceLocal extends AccountService {
- void createAccountWithTransaction(Account account, TopiaContext topiaContext) throws LimaException;
+ Account createAccountWithTransaction(Account account, TopiaContext topiaContext) throws LimaException;
}
\ No newline at end of file
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/LimaContext.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/LimaContext.java 2012-04-05 10:10:32 UTC (rev 3352)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/LimaContext.java 2012-04-05 10:58:58 UTC (rev 3353)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2008 - 2010 CodeLutin
+ * Copyright (C) 2008 - 2012 CodeLutin, Chatellier Eric
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
@@ -25,9 +25,12 @@
package org.chorem.lima;
+import java.util.Locale;
+
import jaxx.runtime.JAXXUtil;
import jaxx.runtime.context.DefaultApplicationContext;
import jaxx.runtime.context.JAXXContextEntryDef;
+
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.ui.LimaDecoratorProvider;
@@ -35,15 +38,10 @@
import org.chorem.lima.ui.MainViewHandler;
import org.nuiton.i18n.I18n;
import org.nuiton.i18n.init.DefaultI18nInitializer;
-import org.nuiton.i18n.init.UserI18nInitializer;
-import org.nuiton.util.FileUtil;
+import org.nuiton.i18n.init.I18nInitializer;
import org.nuiton.util.StringUtil;
import org.nuiton.util.decorator.DecoratorProvider;
-import java.io.File;
-import java.io.IOException;
-import java.util.Locale;
-
/** @author chemit */
public class LimaContext extends DefaultApplicationContext {
@@ -116,34 +114,13 @@
I18n.close();
- File i18nDirectory = config.getI18nDirectory();
-
- if (log.isInfoEnabled()) {
- log.info("I18n directory : " + i18nDirectory);
- }
- try {
- //create directory to store i18n files
- FileUtil.createDirectoryIfNecessary(i18nDirectory);
- } catch (IOException eee) {
- throw new RuntimeException(
- "Could not create directory " +
- i18nDirectory.getParentFile(), eee);
- }
- UserI18nInitializer i18nInitializer =
- new UserI18nInitializer(
- i18nDirectory,
- new DefaultI18nInitializer("lima")
- );
-
+ I18nInitializer i18nInitializer = new DefaultI18nInitializer("lima");
Locale locale = config.getLocale();
-
I18n.init(i18nInitializer, locale);
// Default Locale for DatePicker
Locale.setDefault(locale);
- getDecoratorProvider().reload();
-
long t00 = System.nanoTime();
if (log.isDebugEnabled()) {
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/LimaMain.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/LimaMain.java 2012-04-05 10:10:32 UTC (rev 3352)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/LimaMain.java 2012-04-05 10:58:58 UTC (rev 3353)
@@ -31,7 +31,6 @@
import org.chorem.lima.business.ejbinterface.AccountService;
import org.chorem.lima.business.monitorable.AccountServiceMonitorable;
import org.chorem.lima.business.monitorable.HttpServerServiceMonitorable;
-import org.chorem.lima.entity.Account;
import org.chorem.lima.service.LimaServiceFactory;
import org.chorem.lima.ui.MainView;
import org.chorem.lima.ui.MainViewHandler;
@@ -41,7 +40,6 @@
import javax.swing.SwingUtilities;
import java.util.Arrays;
import java.util.Date;
-import java.util.List;
import static org.nuiton.i18n.I18n._;
@@ -115,17 +113,19 @@
// see if this can be dangerous (should not be since jnlp is signed ?)
// moreover it speeds up the loading :)
System.setSecurityManager(null);
-
Runtime.getRuntime().addShutdownHook(new ShutdownHook());
// init root context
LimaContext context = LimaContext.init();
LimaConfig config = context.getConfig();
config.parse(args);
-
- LimaServiceFactory.initFactory(config);
context.initI18n(config);
+ return context;
+ }
+
+ protected static void launch(LimaContext context) throws Exception {
+
// prepare ui look&feel and load ui properties
try {
SwingUtil.initNimbusLoookAndFeel();
@@ -135,13 +135,10 @@
log.warn(_("lima.warning.nimbus.landf"));
}
}
- return context;
- }
- protected static void launch(LimaContext context) throws Exception {
-
splash.drawVersion(config.getVersion());
splash.updateProgression(0.1, _("lima.splash.1"));
+ LimaServiceFactory.initFactory(config);
// do init ui
MainViewHandler uiHandler = context.getContextValue(MainViewHandler.class);
@@ -182,17 +179,6 @@
});
}
- /*protected static void saveTraces(File file) {
- String stats = NuitonTrace.getStatisticsCSVAndClear();
- try {
- FileUtil.writeString(file, stats, "utf-8");
- } catch (IOException e) {
- if (log.isErrorEnabled()) {
- log.error("Could not save traces to file " + file, e);
- }
- }
- }*/
-
public static class ShutdownHook extends Thread {
public ShutdownHook() {
@@ -202,14 +188,6 @@
@Override
public void run() {
try {
- super.run();
- /*File file = new File("lima-trace.csv");
- saveTraces(file);
- String stats = NuitonTrace.getStatisticsCSVAndClear();
- if (log.isInfoEnabled()) {
- log.info(stats);
- }*/
-
LimaContext.get().close();
LimaServiceFactory.destroy();
// force to kill main thread
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 2012-04-05 10:10:32 UTC (rev 3352)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainViewHandler.java 2012-04-05 10:58:58 UTC (rev 3353)
@@ -458,7 +458,7 @@
public void showImportExportView(JAXXContext rootContext,
ImportExportEnum type) {
MainView mainView = getUI(rootContext);
- ImportExport importExport = ImportExport.getInstance(mainView);
+ ImportExport importExport = new ImportExport(mainView);
importExport.importExport(type, "", true);
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountForm.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountForm.jaxx 2012-04-05 10:10:32 UTC (rev 3352)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountForm.jaxx 2012-04-05 10:58:58 UTC (rev 3353)
@@ -5,7 +5,7 @@
$Id$
$HeadURL$
%%
- Copyright (C) 2008 - 2010 CodeLutin
+ Copyright (C) 2008 - 2012 CodeLutin, Chatellier Eric
%%
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as
@@ -23,28 +23,21 @@
#L%
-->
-<JDialog modal="true" defaultCloseOperation="{JDialog.DO_NOTHING_ON_CLOSE}"
- onWindowClosing="dispose()">
+<JDialog title="lima.ui.account.addaccounttitle" modal="true"
+ defaultCloseOperation="{JDialog.DO_NOTHING_ON_CLOSE}" onWindowClosing="dispose()">
<import>
javax.swing.text.Document
org.chorem.lima.entity.Account
</import>
- <AccountViewHandler id='handler'
- initializer='getContextValue(AccountView.class,JAXXUtil.PARENT).getHandler()'/>
+ <AccountViewHandler id='handler' initializer='getContextValue(AccountView.class,JAXXUtil.PARENT).getHandler()'/>
- <Account id="account" javaBean='null'/>
+ <Account id="account" javaBean='new org.chorem.lima.entity.AccountImpl()'/>
<script>
<![CDATA[
getRootPane().setDefaultButton(ok);
-
- @Override
- public void dispose() {
- setAccount(null);
- super.dispose();
- }
]]>
</script>
@@ -78,7 +71,7 @@
<JPanel layout='{new GridLayout(1,0)}'>
<JButton text="lima.common.cancel" onActionPerformed="dispose()"/>
<JButton id="ok" text="lima.common.ok"
- onActionPerformed="handler.doAddAccount(this)"/>
+ onActionPerformed="handler.addAccount(this)"/>
</JPanel>
</cell>
</row>
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountImportForm.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountImportForm.jaxx 2012-04-05 10:10:32 UTC (rev 3352)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountImportForm.jaxx 2012-04-05 10:58:58 UTC (rev 3353)
@@ -5,7 +5,7 @@
$Id$
$HeadURL$
%%
- Copyright (C) 2008 - 2010 CodeLutin
+ Copyright (C) 2008 - 2012 CodeLutin, Chatellier Eric
%%
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as
@@ -28,18 +28,17 @@
onWindowClosing="performCancel();">
<import>
- jaxx.runtime.swing.JAXXButtonGroup
org.chorem.lima.enums.AccountsChartEnum
</import>
- <JAXXButtonGroup id="radioButtons" javaBean='new JAXXButtonGroup()'/>
- <Boolean id="addState" javaBean='true'/>
+ <javax.swing.ButtonGroup id="buttonGroup" />
+ <Boolean id="addState" javaBean='true' />
<script>
<![CDATA[
getRootPane().setDefaultButton(ok);
protected void performCancel() {
- getRadioButtons().setSelectedValue(null);
+ buttonGroup.setSelectedValue(null);
dispose();
}
]]>
@@ -53,41 +52,41 @@
</row>
<row>
<cell>
- <JRadioButton text='lima.charts.account.shortened'
+ <JRadioButton text='lima.ui.account.shortened'
value='{AccountsChartEnum.SHORTENED}'
- buttonGroup="{getRadioButtons()}"
+ buttonGroup="{buttonGroup}"
selected='true'/>
</cell>
</row>
<row>
<cell>
- <JRadioButton text='lima.charts.account.base'
+ <JRadioButton text='lima.ui.account.base'
value='{AccountsChartEnum.BASE}'
- buttonGroup="{getRadioButtons()}"
+ buttonGroup="{buttonGroup}"
selected='true'/>
</cell>
</row>
<row>
<cell>
- <JRadioButton text='lima.charts.account.developed'
+ <JRadioButton text='lima.ui.account.developed'
value='{AccountsChartEnum.DEVELOPED}'
- buttonGroup="{getRadioButtons()}"
+ buttonGroup="{buttonGroup}"
selected='true'/>
</cell>
</row>
<row>
<cell>
- <JRadioButton text='lima.importexport.importcsv'
+ <JRadioButton text='lima.ui.importexport.importcsv'
value='{AccountsChartEnum.IMPORT}'
- buttonGroup="{getRadioButtons()}"
+ buttonGroup="{buttonGroup}"
selected='true'/>
</cell>
</row>
<row>
<cell>
- <JRadioButton text='lima.importexport.importebp'
+ <JRadioButton text='lima.ui.importexport.importebp'
value='{AccountsChartEnum.IMPORTEBP}'
- buttonGroup="{getRadioButtons()}"
+ buttonGroup="{buttonGroup}"
selected='true'/>
</cell>
</row>
@@ -96,11 +95,11 @@
<Table>
<row>
<cell fill="none">
- <JButton text="lima.common.cancel"
+ <JButton text="lima.ui.common.cancel"
onActionPerformed="performCancel()"/>
</cell>
<cell fill="none">
- <JButton id="ok" text="lima.common.ok"
+ <JButton id="ok" text="lima.ui.common.ok"
onActionPerformed="dispose()"/>
</cell>
</row>
Deleted: trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountTreeTable.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountTreeTable.java 2012-04-05 10:10:32 UTC (rev 3352)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountTreeTable.java 2012-04-05 10:58:58 UTC (rev 3353)
@@ -1,103 +0,0 @@
-/*
- * #%L
- * Lima :: Swing
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2008 - 2011 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-package org.chorem.lima.ui.account;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.jdesktop.swingx.JXTreeTable;
-
-import java.awt.event.KeyEvent;
-import java.awt.event.KeyListener;
-import java.awt.event.MouseEvent;
-import java.awt.event.MouseListener;
-
-@Deprecated
-public class AccountTreeTable extends JXTreeTable
- implements KeyListener, MouseListener {
-
- /** serialVersionUID. */
- private static final long serialVersionUID = 1092873442245932784L;
-
- /** log. */
- private static final Log log = LogFactory
- .getLog(AccountTreeTable.class);
-
- protected AccountViewHandler handler;
-
- public AccountTreeTable(AccountViewHandler handler) {
-
- this.handler = handler;
-
- addKeyListener(this);
- addMouseListener(this);
-
- }
-
- @Override
- public void mouseClicked(MouseEvent e) {
- }
-
- @Override
- public void mousePressed(MouseEvent e) {
- if (rowAtPoint(e.getPoint()) == -1) {
- clearSelection();
- }
- }
-
- @Override
- public void mouseReleased(MouseEvent e) {
- }
-
- @Override
- public void mouseEntered(MouseEvent e) {
- }
-
- @Override
- public void mouseExited(MouseEvent e) {
- }
-
- @Override
- public void keyTyped(KeyEvent e) {
- }
-
- /**
- * for each action combination key are think
- * for extend keyboard and laptop keyboard
- */
- @Override
- public void keyPressed(KeyEvent e) {
- // clear row selection with the key: escape
- if (e.getKeyCode() == KeyEvent.VK_ESCAPE) {
- if (!isEditing()) {
- clearSelection();
- }
- }
- }
-
- @Override
- public void keyReleased(KeyEvent e) {
- }
-
-}
Added: trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountTreeTableModel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountTreeTableModel.java (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountTreeTableModel.java 2012-04-05 10:58:58 UTC (rev 3353)
@@ -0,0 +1,67 @@
+/*
+ * #%L
+ *
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2012 Codelutin, Chatellier Eric
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
+package org.chorem.lima.ui.account;
+
+import org.chorem.lima.entity.Account;
+import org.jdesktop.swingx.treetable.DefaultTreeTableModel;
+import org.jdesktop.swingx.treetable.MutableTreeTableNode;
+import org.jdesktop.swingx.treetable.TreeTableNode;
+
+/**
+ * Account tree table model redefining get value at for column.
+ *
+ * @author chatellier
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author$
+ */
+public class AccountTreeTableModel extends DefaultTreeTableModel {
+
+ /**
+ * Creates a new {@code DefaultTreeTableModel} with the specified
+ * {@code root}.
+ *
+ * @param root the root node of the tree
+ */
+ public AccountTreeTableModel(TreeTableNode root) {
+ super(root);
+ }
+
+ @Override
+ public Object getValueAt(Object node, int column) {
+ MutableTreeTableNode treenode = (MutableTreeTableNode)node;
+ Account account = (Account)treenode.getUserObject();
+
+ Object result = null;
+ if (account != null && column == 1) {
+ result = account.getLabel();
+ }
+
+ return result;
+ }
+
+}
Property changes on: trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountTreeTableModel.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountTreeTableRenderer.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountTreeTableRenderer.java 2012-04-05 10:10:32 UTC (rev 3352)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountTreeTableRenderer.java 2012-04-05 10:58:58 UTC (rev 3353)
@@ -28,9 +28,9 @@
import java.awt.Component;
import javax.swing.JTree;
+import javax.swing.tree.DefaultTreeCellRenderer;
import org.chorem.lima.entity.Account;
-import org.jdesktop.swingx.renderer.DefaultTreeRenderer;
import org.jdesktop.swingx.treetable.MutableTreeTableNode;
/**
@@ -42,7 +42,7 @@
* Last update : $Date$
* By : $Author$
*/
-public class AccountTreeTableRenderer extends DefaultTreeRenderer {
+public class AccountTreeTableRenderer extends DefaultTreeCellRenderer {
/** serialVersionUID. */
private static final long serialVersionUID = -3249368726501873583L;
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountView.jaxx 2012-04-05 10:10:32 UTC (rev 3352)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountView.jaxx 2012-04-05 10:58:58 UTC (rev 3353)
@@ -46,40 +46,34 @@
<JXTreeTable id="accountsTreeTable"
selectionMode="{ListSelectionModel.SINGLE_SELECTION}"
treeCellRenderer="{new AccountTreeTableRenderer()}"
- highlighters="{HighlighterFactory.createSimpleStriping(new java.awt.Color(222,222,222))}"/>
+ highlighters="{HighlighterFactory.createSimpleStriping(new java.awt.Color(233,233,233))}"/>
<ListSelectionModel initializer='accountsTreeTable.getSelectionModel()'
onValueChanged="setSelectedRow(accountsTreeTable.getSelectedRow() != -1)"/>
</JScrollPane>
</cell>
<cell fill="horizontal">
- <JButton id="addButton" text="lima.charts.account.addAccount"
- onActionPerformed="handler.launchAddAccountForm()"/>
+ <JButton id="addButton" text="lima.ui.account.addAccount"
+ onActionPerformed="handler.addAccount()"/>
</cell>
</row>
<row>
<cell fill="horizontal">
- <JButton id="addSubLedger" text="lima.charts.account.addSubLedger"
- onActionPerformed="/*handler.launchAddSubLedgerForm()*/"/>
- </cell>
- </row>
- <row>
- <cell fill="horizontal">
- <JButton id="updateButton" text="lima.common.update"
- onActionPerformed="handler.launchUpdateAccountForm()"
+ <JButton id="updateButton" text="lima.ui.common.update"
+ onActionPerformed="handler.updateAccount()"
enabled="{isSelectedRow()}"/>
</cell>
</row>
<row>
<cell fill="horizontal">
- <JButton id="removeButton" text="lima.common.remove"
- onActionPerformed="handler.doRemoveAccount()"
+ <JButton id="removeButton" text="lima.ui.common.remove"
+ onActionPerformed="handler.removeAccount()"
enabled="{isSelectedRow()}"/>
</cell>
</row>
<row>
<cell fill="horizontal">
- <JButton id="importButton" text="lima.importexport.import"
- onActionPerformed="handler.doImportAccountsChart()"/>
+ <JButton id="importButton" text="lima.iu.importexport.import"
+ onActionPerformed="handler.importAccountsChart()"/>
</cell>
</row>
</Table>
\ No newline at end of file
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountViewHandler.java 2012-04-05 10:10:32 UTC (rev 3352)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountViewHandler.java 2012-04-05 10:58:58 UTC (rev 3353)
@@ -31,6 +31,7 @@
import java.awt.event.KeyEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
+import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
@@ -52,15 +53,14 @@
import org.chorem.lima.business.monitorable.AccountServiceMonitorable;
import org.chorem.lima.business.monitorable.ImportServiceMonitorable;
import org.chorem.lima.entity.Account;
-import org.chorem.lima.entity.AccountImpl;
import org.chorem.lima.enums.AccountsChartEnum;
import org.chorem.lima.enums.ImportExportEnum;
import org.chorem.lima.service.LimaServiceFactory;
import org.chorem.lima.ui.importexport.ImportExport;
-import org.chorem.lima.util.ErrorHelper;
import org.jdesktop.swingx.JXTreeTable;
import org.jdesktop.swingx.treetable.DefaultMutableTreeTableNode;
import org.jdesktop.swingx.treetable.DefaultTreeTableModel;
+import org.jdesktop.swingx.treetable.MutableTreeTableNode;
import org.jdesktop.swingx.treetable.TreeTableNode;
/**
@@ -94,6 +94,9 @@
return result;
}
};
+ /**
+ * Sort Account number by lenght in reverse order.
+ */
protected static Comparator<String> reverseAccountLengthComparator = new Comparator<String>() {
@Override
public int compare(String o1, String o2) {
@@ -104,7 +107,7 @@
return result;
}
};
-
+
public AccountViewHandler(AccountView view) {
this.view = view;
// Gets factory service
@@ -112,6 +115,9 @@
accountService = LimaServiceFactory.getService(AccountServiceMonitorable.class);
}
+ /**
+ * Init initialized view by loading account data from service.
+ */
public void init() {
JXTreeTable table = view.getAccountsTreeTable();
table.addKeyListener(new KeyAdapter() {
@@ -151,6 +157,9 @@
// default data load
List<Account> accounts = accountService.getAllAccounts();
Collections.sort(accounts, accountLengthComparator);
+ if (log.isDebugEnabled()) {
+ log.debug(String.format("Loaded %d accounts from service", accounts.size()));
+ }
// render in tree node hierarchy for DefaultTreeTableModel
SortedMap<String, DefaultMutableTreeTableNode> nodeCache = new TreeMap<String, DefaultMutableTreeTableNode>(reverseAccountLengthComparator);
@@ -174,9 +183,10 @@
nodeCache.put(account.getAccountNumber(), node);
}
- DefaultTreeTableModel model = new DefaultTreeTableModel(root);
- model.setColumnIdentifiers(Arrays.asList(_("lima.table.number"),
- _("lima.table.label")));
+
+ // refreshing tree's model
+ DefaultTreeTableModel model = new AccountTreeTableModel(root);
+ model.setColumnIdentifiers(Arrays.asList(_("lima.table.number"), _("lima.table.label")));
JXTreeTable table = view.getAccountsTreeTable();
table.setTreeTableModel(model);
} catch (LimaException ex) {
@@ -184,25 +194,11 @@
}
}
- public void launchAddAccountForm() {
- Account newAccount = new AccountImpl();
- AccountForm accountForm = new AccountForm(view);
- accountForm.setAccount(newAccount);
- // jaxx constructor don't call super() ?
- accountForm.setLocationRelativeTo(view);
- accountForm.setVisible(true);
- }
-
/**
- * Open update account (or subledger) form with selected account
- * from the tree.
+ * Display add account view
*/
- public void launchUpdateAccountForm() {
- Account selectedObject = getSelectedAccount();
-
- UpdateAccountForm accountForm = new UpdateAccountForm(view);
- accountForm.setAccount(selectedObject);
- // jaxx constructor don't call super() ?
+ public void addAccount() {
+ AccountForm accountForm = new AccountForm(view);
accountForm.setLocationRelativeTo(view);
accountForm.setVisible(true);
}
@@ -212,115 +208,121 @@
*
* @param dialog the account form
*/
- public void doAddAccount(AccountForm dialog) {
+ public void addAccount(AccountForm dialog) {
try {
+
Account newAccount = dialog.getAccount();
+ newAccount = accountService.createAccount(newAccount);
- Account masterAccount = null;
+ // update tree
+ JXTreeTable treeTable = view.getAccountsTreeTable();
+ DefaultTreeTableModel model = (DefaultTreeTableModel)treeTable.getTreeTableModel();
+ DefaultMutableTreeTableNode node = (DefaultMutableTreeTableNode)findParentNode(model.getRoot(), newAccount.getAccountNumber());
+ DefaultMutableTreeTableNode newNode = new DefaultMutableTreeTableNode(newAccount);
- if (newAccount.getAccountNumber().length() > 1) {
-
- // a master account is required
- masterAccount = getMasterAccount(newAccount);
-
- if (masterAccount == null) {
-
- // bye-bye :(
- return;
- }
+ List<MutableTreeTableNode> nodesToMove = findSubNodes(node, newAccount.getAccountNumber());
+ for (MutableTreeTableNode nodeToMove : nodesToMove) {
+ model.removeNodeFromParent((MutableTreeTableNode)nodeToMove);
+ newNode.add(nodeToMove);
}
- // add it
- /*try {
- getTreeTableModel().addAccount(masterAccount, newAccount);
- } catch (LimaException ex) {
- if (log.isErrorEnabled()) {
- log.error("Can't add account", ex);
- }
- ErrorHelper.showErrorDialog(view, _("lima.account.addaccounterror"), ex);
- }*/
+ model.insertNodeInto(newNode, node, node.getChildCount());
+ treeTable.expandPath(new TreePath(model.getPathToRoot(node)));
+ } catch (LimaException ex) {
+ throw new LimaRuntimeException("Can't add account", ex);
} finally {
dialog.dispose();
}
}
- /*public void doAddSubLedger(SubLedgerForm dialog) {
+ /**
+ * Find potential parent node for account number.
+ *
+ * @param currentNode node
+ * @param accountNumber node label to search parent
+ * @return found parent (can't be null)
+ */
+ protected TreeTableNode findParentNode(TreeTableNode currentNode,
+ String accountNumber) {
- try {
- Account newAccount = dialog.getAccount();
+ TreeTableNode result = null;
+ Account account = (Account)currentNode.getUserObject();
- Account masterAccount = null;
-
- if (newAccount.getAccountNumber().length() > 1) {
-
- // a master account is required
- masterAccount = getMasterAccount(newAccount);
-
- if (masterAccount == null) {
-
- // bye-bye :(
- return;
- }
+ if (account == null || accountNumber.startsWith(account.getAccountNumber())) {
+ for (int childIndex = 0; childIndex < currentNode.getChildCount() && result == null; childIndex++) {
+ TreeTableNode child = currentNode.getChildAt(childIndex);
+ result = findParentNode(child, accountNumber);
}
- // add it
- try {
- getTreeTableModel().addSubLedger(masterAccount, newAccount);
- } catch (LimaException eee) {
- if (log.isErrorEnabled()) {
- log.error("Can't add subledger", eee);
- }
- ErrorHelper.showErrorDialog(view, "Can't add subledger", eee);
+ if (result == null) {
+ result = currentNode;
}
- } finally {
- dialog.dispose();
}
- }*/
- public void doUpdateAccount(UpdateAccountForm dialog) {
+ return result;
+ }
- Account account = dialog.getAccount();
-
- /*String newMasterAccountNumber =
- dialog.getMasterAccountTextField().getText();
- String newLabel = dialog.getDescriptionTextField().getText();
-
- boolean hasChanged =
- updateMasterAccount(account, newMasterAccountNumber);
- hasChanged |= updateLabel(account, newLabel);*/
-
- try {
- //if (hasChanged) {
-
- // can update account
- updateAccount(account);
- //}
-
- } finally {
-
- // close dialog
- dialog.dispose();
+ /**
+ * Find all subnodes in currentNode with account label starting with accountNumber.
+ *
+ * @param currentNode currentNode to search into
+ * @param accountNumber accountNumber number to search
+ * @return node list
+ */
+ protected List<MutableTreeTableNode> findSubNodes(TreeTableNode currentNode, String accountNumber) {
+ List<MutableTreeTableNode> nodes = new ArrayList<MutableTreeTableNode>();
+ for (int childIndex = 0; childIndex < currentNode.getChildCount(); childIndex++) {
+ MutableTreeTableNode child = (MutableTreeTableNode)currentNode.getChildAt(childIndex);
+ Account account = (Account)child.getUserObject();
+ if (account.getAccountNumber().startsWith(accountNumber)) {
+ nodes.add(child);
+ }
}
+ return nodes;
}
- public void doUpdateSubLedger(UpdateSubLedgerForm dialog) {
+ /**
+ * Open update account (or subledger) form with selected account
+ * from the tree.
+ */
+ public void updateAccount() {
+ JXTreeTable treeTable = view.getAccountsTreeTable();
- Account account = dialog.getAccount();
+ // get selected account
+ int selectedRow = treeTable.getSelectedRow();
+ TreePath treePath = treeTable.getPathForRow(selectedRow);
+ TreeTableNode lastPathComponent = (TreeTableNode) treePath.getLastPathComponent();
+ Account selectedAccount = (Account)lastPathComponent.getUserObject();
- /*String newMasterAccountNumber =
- dialog.getMasterAccountTextField().getText();
- String newLabel = dialog.getDescriptionTextField().getText();
- String newThirdParty = dialog.getThirdPartyTextField().getText();
+ // display edit form
+ UpdateAccountForm accountForm = new UpdateAccountForm(view);
+ accountForm.setAccount(selectedAccount);
+ accountForm.setLocationRelativeTo(view);
+ accountForm.setVisible(true);
+ }
- boolean hasChanged = updateMasterAccount(account,
- newMasterAccountNumber);
- hasChanged |= updateLabel(account, newLabel);
- hasChanged |= updateThirdParty(account, newThirdParty);*/
+ /**
+ * Perform update account to service.
+ *
+ * @param dialog dialog containing account
+ */
+ public void updateAccount(UpdateAccountForm dialog) {
try {
- // can update subLedger
- updateAccount(account);
+ Account account = dialog.getAccount();
+ account = accountService.updateAccount(account);
+
+ // update tree
+ JXTreeTable treeTable = view.getAccountsTreeTable();
+ DefaultTreeTableModel model = (DefaultTreeTableModel)treeTable.getTreeTableModel();
+ int selectedRow = treeTable.getSelectedRow();
+ TreePath treePath = treeTable.getPathForRow(selectedRow);
+ //TreeTableNode lastPathComponent = (TreeTableNode) treePath.getLastPathComponent();
+ //lastPathComponent.setUserObject(account);
+ model.valueForPathChanged(treePath, account);
+ } catch (LimaException ex) {
+ throw new LimaRuntimeException("Can't update account", ex);
} finally {
// close dialog
@@ -328,47 +330,52 @@
}
}
- /** Ask for user to remove for selected account, and remove it if confirmed. */
- public void doRemoveAccount() {
+ /**
+ * Ask for user to remove for selected account, and remove it if confirmed.
+ */
+ public void removeAccount() {
// maybe this code can be factorised
JXTreeTable treeTable = view.getAccountsTreeTable();
-
- // Any row selected
int selectedRow = treeTable.getSelectedRow();
- if (selectedRow != -1) {
- int n = JOptionPane.showConfirmDialog(view,
- _("lima.charts.account.question.remove"),
- _("lima.common.question"),
- JOptionPane.YES_NO_OPTION,
- JOptionPane.QUESTION_MESSAGE);
- if (n == JOptionPane.YES_OPTION) {
- // update view of treetable
- TreePath treePath =
- treeTable.getPathForRow(selectedRow);
+ TreePath treePath = treeTable.getPathForRow(selectedRow);
+ MutableTreeTableNode lastNode = (MutableTreeTableNode)treePath.getLastPathComponent();
+ Account account = (Account)lastNode.getUserObject();
- /*try {
- getTreeTableModel().removeAccount(treePath);
- } catch (LimaException eee) {
- if (log.isErrorEnabled()) {
- log.error("Can't delete account", eee);
- }
- DialogHelper.showErrorMessageDialog(view, eee);
- }*/
+ int response = JOptionPane.showConfirmDialog(view,
+ _("lima.ui.account.removeaccountconfirm", account.getAccountNumber()),
+ _("lima.ui.account.removeaccounttitle"),
+ JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);
+
+ if (response == JOptionPane.YES_OPTION) {
+ try {
+ accountService.removeAccount(account);
+
+ // add all sub accounts to parent
+ DefaultTreeTableModel model = (DefaultTreeTableModel)treeTable.getTreeTableModel();
+ MutableTreeTableNode parent = (MutableTreeTableNode)lastNode.getParent();
+ for (int childIndex = lastNode.getChildCount() -1 ; childIndex >= 0 ; childIndex--) {
+ MutableTreeTableNode child = (MutableTreeTableNode)lastNode.getChildAt(childIndex);
+ model.insertNodeInto(child, parent, parent.getChildCount());
+ }
+
+ // remove node
+ model.removeNodeFromParent(lastNode);
+ } catch (LimaException ex) {
+ throw new LimaRuntimeException("Can't remove account", ex);
}
}
}
- public void doImportAccountsChart() {
+ public void importAccountsChart() {
- AccountImportForm form = new AccountImportForm();
- //
+ AccountImportForm form = new AccountImportForm(view);
form.setLocationRelativeTo(view);
form.setVisible(true);
- ImportExport importExport = ImportExport.getInstance(view);
+ ImportExport importExport = new ImportExport(view);
- Object value = form.getRadioButtons().getSelectedValue();
+ Object value = form.getButtonGroup().getSelectedValue();
// if action confirmed
if (value != null) {
AccountsChartEnum defaultAccountsChartEnum =
@@ -388,127 +395,25 @@
}
}
+ /**
+ * Called when import methods are called on services.
+ */
@Override
- public void notifyMethod(String serviceName, String methodeName) {
+ public void notifyMethod(String serviceName, String methodName) {
- if (methodeName.contains("importAccounts") ||
- methodeName.contains("importAll") ||
- methodeName.contains("importAsCSV")) {
-
- // refresh model
- //getTreeTableModel().refreshTree();
-
- //FIXME tchemit-2011-09-23 Should never do this... refresh view
- view.repaint();
- }
- }
-
- /*protected boolean updateMasterAccount(Account account,
- String newMasterAccountNumber) {
- boolean hasChanged = false;
- String oldMasterAccountNumber = account.getMasterAccount() == null ?
- "" :
- account.getMasterAccount().getAccountNumber();
-
- if (ObjectUtils.notEqual(oldMasterAccountNumber, newMasterAccountNumber)) {
-
- // master account has changed
- hasChanged = true;
-
- // obtain new master account
- try {
- if (log.isInfoEnabled()) {
- log.info("setMaster : "
- + newMasterAccountNumber + " to : "
- + account.getAccountNumber());
- }
- Account masterAccount = accountService
- .getAccountByNumber(newMasterAccountNumber);
- account.setMasterAccount(masterAccount);
- } catch (LimaException eee) {
- log.debug("Can't search account for update : "
- + newMasterAccountNumber, eee);
+ if (methodName.contains("importAccounts") ||
+ methodName.contains("importAll") ||
+ methodName.contains("importAsCSV")) {
+
+ if (log.isInfoEnabled()) {
+ log.info(String.format("Service notification %s, reloading accounts", methodName));
}
- }
- return hasChanged;
- }
- protected boolean updateLabel(Account account, String newLabel) {
- boolean hasChanged = false;
- String oldLabel = account.getLabel();
- if (ObjectUtils.notEqual(oldLabel, newLabel)) {
-
- // label has changed
- hasChanged = true;
- account.setLabel(newLabel);
- }
- return hasChanged;
- }
-
- protected boolean updateThirdParty(Account account, String newThirdParty) {
- boolean hasChanged = false;
- String oldThirdParty = account.getThirdParty();
- if (ObjectUtils.notEqual(oldThirdParty, newThirdParty)) {
-
- // thirdparty has changed
- hasChanged = true;
- account.setThirdParty(newThirdParty);
- }
-
- return hasChanged;
- }*/
-
- protected void updateAccount(Account selectedObject) {
- /*try {
- getTreeTableModel().updateAccount(selectedObject);
- } catch (LimaException eee) {
- if (log.isErrorEnabled()) {
- log.error("Can't add update", eee);
+ loadAllAccounts();
+ } else {
+ if (log.isDebugEnabled()) {
+ log.debug("Ignoring service notification " + serviceName + ":" + methodName);
}
- DialogHelper.showErrorMessageDialog(view, eee);
- }*/
- }
-
- protected Account getMasterAccount(Account account) {
-
- String number = account.getAccountNumber();
-
- Account masterAccount;
-
-
- //search for the nearest account from the one been created
- //e.g.: for 41019 search for 4, 41, 410, 4101
- //and stop when the account doesn't exist, use last account found instead
- try {
-
- masterAccount = accountService.getMasterAccount(number);
-
- } catch (LimaException eee) {
- if (log.isErrorEnabled()) {
- log.error("Can't obtain master account for account number " + number, eee);
- }
- ErrorHelper.showErrorDialog(view, "Can't obtain master account for account number " + number, eee);
- return null;
}
-
- if (masterAccount == null) {
- ErrorHelper.showErrorDialog(_("lima.error.no.masteraccount", number));
- return null;
- }
- return masterAccount;
}
-
- protected Account getSelectedAccount() {
-
- JXTreeTable table = view.getAccountsTreeTable();
-
- Account selectedObject = null;
- int selectedRow = table.getSelectedRow();
- if (selectedRow > -1) {
- TreePath treePath = table.getPathForRow(selectedRow);
- TreeTableNode lastPathComponent = (TreeTableNode) treePath.getLastPathComponent();
- selectedObject = (Account)lastPathComponent.getUserObject();
- }
- return selectedObject;
- }
}
Deleted: trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/SubLedgerForm.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/SubLedgerForm.jaxx 2012-04-05 10:10:32 UTC (rev 3352)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/SubLedgerForm.jaxx 2012-04-05 10:58:58 UTC (rev 3353)
@@ -1,98 +0,0 @@
-<!--
- #%L
- Lima Swing
-
- $Id$
- $HeadURL$
- %%
- Copyright (C) 2008 - 2010 CodeLutin
- %%
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as
- published by the Free Software Foundation, either version 3 of the
- License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public
- License along with this program. If not, see
- <http://www.gnu.org/licenses/gpl-3.0.html>.
- #L%
- -->
-
-<JDialog modal="true" defaultCloseOperation="{JDialog.DO_NOTHING_ON_CLOSE}"
- onWindowClosing="dispose()">
-
- <import>
- javax.swing.text.Document
- org.chorem.lima.entity.Account
- </import>
-
- <AccountViewHandler id='handler'
- initializer='getContextValue(AccountView.class,JAXXUtil.PARENT).getHandler()'/>
-
- <Account id="account" javaBean='null'/>
-
- <script>
- <![CDATA[
- getRootPane().setDefaultButton(ok);
-
- @Override
- public void dispose() {
- setAccount(null);
- super.dispose();
- }
- ]]>
- </script>
-
- <Table>
- <row>
- <cell fill="horizontal">
- <JLabel text="lima.common.code" labelFor='{numberTextField}'/>
- </cell>
- <cell fill="horizontal">
- <JTextField id="numberTextField"
- text="{account.getAccountNumber()}"/>
- <Document initializer="numberTextField.getDocument()"
- onInsertUpdate='account.setAccountNumber(numberTextField.getText())'
- onRemoveUpdate='account.setAccountNumber(numberTextField.getText())'/>
- </cell>
- </row>
- <row>
- <cell fill="horizontal">
- <JLabel text="lima.common.label" labelFor='{descriptionTextField}'/>
- </cell>
- <cell fill="horizontal">
- <JTextField id="descriptionTextField" text="{account.getLabel()}"/>
- <Document initializer="descriptionTextField.getDocument()"
- onInsertUpdate='account.setLabel(descriptionTextField.getText())'
- onRemoveUpdate='account.setLabel(descriptionTextField.getText())'/>
- </cell>
- </row>
- <row>
- <cell fill="horizontal">
- <JLabel text="lima.identity.contact" labelFor='{thirdPartyTextField}'/>
- </cell>
- <cell fill="horizontal">
- <JTextField id="thirdPartyTextField"
- text="{account.getThirdParty()}"/>
- <Document
- javaBean="thirdPartyTextField.getDocument()"
- onInsertUpdate='account.setThirdParty(thirdPartyTextField.getText())'
- onRemoveUpdate='account.setThirdParty(thirdPartyTextField.getText())'/>
- </cell>
- </row>
- <row>
- <cell columns="2">
- <JPanel layout='{new GridLayout(1,0)}'>
- <JButton text="lima.common.cancel" onActionPerformed="dispose()"/>
- <JButton id="ok" text="lima.common.ok"
- onActionPerformed="/*handler.doAddSubLedger(this)*/"/>
- </JPanel>
- </cell>
- </row>
- </Table>
-</JDialog>
\ No newline at end of file
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/UpdateAccountForm.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/UpdateAccountForm.jaxx 2012-04-05 10:10:32 UTC (rev 3352)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/UpdateAccountForm.jaxx 2012-04-05 10:58:58 UTC (rev 3353)
@@ -5,7 +5,7 @@
$Id$
$HeadURL$
%%
- Copyright (C) 2008 - 2011 CodeLutin
+ Copyright (C) 2008 - 2012 CodeLutin, Chatellier Eric
%%
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as
@@ -22,26 +22,22 @@
<http://www.gnu.org/licenses/gpl-3.0.html>.
#L%
-->
-<JDialog modal="true" defaultCloseOperation="{JDialog.DO_NOTHING_ON_CLOSE}"
- onWindowClosing="dispose()">
+<JDialog title="lima.ui.account.updateaccounttitle" modal="true"
+ defaultCloseOperation="{JDialog.DO_NOTHING_ON_CLOSE}" onWindowClosing="dispose()">
<import>
+ javax.swing.text.Document
org.chorem.lima.entity.Account
</import>
- <Account id="account" javaBean='null'/>
-
<AccountViewHandler id='handler'
initializer='getContextValue(AccountView.class,JAXXUtil.PARENT).getHandler()'/>
+
+ <Account id="account" javaBean='null'/>
+
<script>
<![CDATA[
- getRootPane().setDefaultButton(ok);
-
- @Override
- public void dispose() {
- setAccount(null);
- super.dispose();
- }
+ getRootPane().setDefaultButton(okButton);
]]>
</script>
@@ -49,7 +45,7 @@
<row>
<cell fill="horizontal">
- <JLabel text="lima.charts.account.number" labelFor='{numberTextField}'/>
+ <JLabel text="lima.ui.account.number" labelFor='{numberTextField}'/>
</cell>
<cell fill="horizontal">
<JTextField id="numberTextField" editable='{false}'
@@ -58,28 +54,21 @@
</row>
<row>
<cell fill="horizontal">
- <JLabel text="lima.common.label" labelFor='{descriptionTextField}'/>
+ <JLabel text="lima.ui.account.label" labelFor='{descriptionTextField}'/>
</cell>
<cell fill="horizontal">
<JTextField id="descriptionTextField" text="{getAccount().getLabel()}"/>
+ <Document initializer="descriptionTextField.getDocument()"
+ onInsertUpdate='account.setLabel(descriptionTextField.getText())'
+ onRemoveUpdate='account.setLabel(descriptionTextField.getText())'/>
</cell>
</row>
- <!-- <row>
- <cell fill="horizontal">
- <JLabel text="lima.common.masteraccount"
- labelFor='{masterAccountTextField}'/>
- </cell>
- <cell fill="horizontal">
- <JTextField id="masterAccountTextField"
- text="{getAccount().getMasterAccount().getAccountNumber()}"/>
- </cell>
- </row> -->
<row>
<cell columns="2">
<JPanel layout='{new GridLayout(1,0)}'>
- <JButton text="lima.common.cancel" onActionPerformed="dispose()"/>
- <JButton id="ok" text="lima.common.ok"
- onActionPerformed="handler.doUpdateAccount(this)"/>
+ <JButton text="lima.ui.common.cancel" onActionPerformed="dispose()"/>
+ <JButton id="okButton" text="lima.ui.common.ok"
+ onActionPerformed="handler.updateAccount(this)"/>
</JPanel>
</cell>
</row>
Deleted: trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/UpdateSubLedgerForm.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/UpdateSubLedgerForm.jaxx 2012-04-05 10:10:32 UTC (rev 3352)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/UpdateSubLedgerForm.jaxx 2012-04-05 10:58:58 UTC (rev 3353)
@@ -1,96 +0,0 @@
-<!--
- #%L
- Lima :: Swing
-
- $Id$
- $HeadURL$
- %%
- Copyright (C) 2008 - 2011 CodeLutin
- %%
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as
- published by the Free Software Foundation, either version 3 of the
- License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public
- License along with this program. If not, see
- <http://www.gnu.org/licenses/gpl-3.0.html>.
- #L%
- -->
-<JDialog modal="true" defaultCloseOperation="{JDialog.DO_NOTHING_ON_CLOSE}"
- onWindowClosing="dispose()">
-
- <import>
- org.chorem.lima.entity.Account
- </import>
-
- <Account id="account" javaBean='null'/>
-
- <AccountViewHandler id='handler'
- initializer='getContextValue(AccountView.class,JAXXUtil.PARENT).getHandler()'/>
-
- <script>
- <![CDATA[
- getRootPane().setDefaultButton(ok);
-
- @Override
- public void dispose() {
- setAccount(null);
- super.dispose();
- }
- ]]>
- </script>
-
- <Table>
- <row>
- <cell fill="horizontal">
- <JLabel text="lima.common.code" labelFor='{numberTextField}'/>
- </cell>
- <cell fill="horizontal">
- <JTextField id="numberTextField" editable='{false}'
- text="{account.getAccountNumber()}"/>
- </cell>
- </row>
- <row>
- <cell fill="horizontal">
- <JLabel text="lima.common.label" labelFor='{descriptionTextField}'/>
- </cell>
- <cell fill="horizontal">
- <JTextField id="descriptionTextField" text="{getAccount().getLabel()}"/>
- </cell>
- </row>
- <!-- Lien Fiche contact-->
- <row>
- <cell fill="horizontal">
- <JLabel text="lima.identity.contact" labelFor='{thirdPartyTextField}'/>
- </cell>
- <cell fill="horizontal">
- <JTextField id="thirdPartyTextField" text="{getAccount().getThirdParty()}"/>
- </cell>
- </row>
- <!-- <row>
- <cell fill="horizontal">
- <JLabel text="lima.common.masteraccount"
- labelFor='{masterAccountTextField}'/>
- </cell>
- <cell fill="horizontal">
- <JTextField id="masterAccountTextField"
- text="{getAccount().getMasterAccount().getAccountNumber()}"/>
- </cell>
- </row> -->
- <row>
- <cell columns="2">
- <JPanel layout='{new GridLayout(1,0)}'>
- <JButton text="lima.common.cancel" onActionPerformed="dispose()"/>
- <JButton id="ok" text="lima.common.ok"
- onActionPerformed="handler.doUpdateSubLedger(this)"/>
- </JPanel>
- </cell>
- </row>
- </Table>
-</JDialog>
\ No newline at end of file
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookViewHandler.java 2012-04-05 10:10:32 UTC (rev 3352)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookViewHandler.java 2012-04-05 10:58:58 UTC (rev 3353)
@@ -168,7 +168,7 @@
if (value != null) {
EntryBooksChartEnum defaultEntryBooksEnum =
(EntryBooksChartEnum) value;
- ImportExport importExport = ImportExport.getInstance(view);
+ ImportExport importExport = new ImportExport(view);
importExport.importExport(ImportExportEnum.CSV_ENTRYBOOKS_IMPORT,
defaultEntryBooksEnum.getFilePath(), true);
}
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 2012-04-05 10:10:32 UTC (rev 3352)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartViewHandler.java 2012-04-05 10:58:58 UTC (rev 3353)
@@ -293,7 +293,7 @@
}
FinancialStatementsChartEnum defaultFinancialStatementsEnum =
(FinancialStatementsChartEnum) value;
- ImportExport importExport = ImportExport.getInstance(view);
+ ImportExport importExport = new ImportExport(view);
importExport.importExport(ImportExportEnum.CSV_FINANCIALSTATEMENTS_IMPORT,
defaultFinancialStatementsEnum.getFilePath(), true);
}
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 2012-04-05 10:10:32 UTC (rev 3352)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java 2012-04-05 10:58:58 UTC (rev 3353)
@@ -65,11 +65,9 @@
public class ImportExport {
- private static ImportExport exchanger;
-
private static final Log log = LogFactory.getLog(AccountViewHandler.class);
- protected static Component viewComponent;
+ protected Component viewComponent;
protected EncodingEnum encodingEnum;
@@ -343,14 +341,4 @@
return sw.toString();
}
-
- public static ImportExport getInstance(Component view) {
- if (exchanger == null) {
- exchanger = new ImportExport(view);
- } else {
- viewComponent = view;
- }
- return exchanger;
- }
-
}
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 2012-04-05 10:10:32 UTC (rev 3352)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/OpeningViewHandler.java 2012-04-05 10:58:58 UTC (rev 3353)
@@ -86,7 +86,7 @@
}
public void next() {
- ImportExport importExport = ImportExport.getInstance(view);
+ ImportExport importExport = new ImportExport(view);
JPanel panel = view.getPanel();
panel.removeAll();
switch (step) {
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatchart/VatChartViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatchart/VatChartViewHandler.java 2012-04-05 10:10:32 UTC (rev 3352)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatchart/VatChartViewHandler.java 2012-04-05 10:58:58 UTC (rev 3353)
@@ -193,7 +193,7 @@
}
VatStatementsChartEnum defaultVatStatementsEnum =
(VatStatementsChartEnum) value;
- ImportExport importExport = ImportExport.getInstance(view);
+ ImportExport importExport = new ImportExport(view);
importExport.importExport(ImportExportEnum.CSV_VAT_IMPORT,
defaultVatStatementsEnum.getFilePath(), true);
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 2012-04-05 10:10:32 UTC (rev 3352)
+++ trunk/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties 2012-04-05 10:58:58 UTC (rev 3353)
@@ -1,5 +1,4 @@
=
-lima.account.addaccounterror=Can't add account
lima.accountsreports.listerror=Can't get entries list
lima.action.commandline.help=Show help in console
lima.action.fullscreen=Full screen
@@ -11,7 +10,6 @@
lima.balance.listerror=Can't get entries list
lima.charts.account=Accounts chart
lima.charts.account.addAccount=Add account
-lima.charts.account.addSubLedger=Add thirdpart account
lima.charts.account.base=Base accountchart
lima.charts.account.developed=Developped accountchart
lima.charts.account.number=Account Number
@@ -70,7 +68,6 @@
lima.common.globalexception=Global lima exception
lima.common.info=Information
lima.common.label=Label
-lima.common.masteraccount=Master account
lima.common.movmentedfilter=Accounts filtered
lima.common.next=Next
lima.common.ok=OK
@@ -95,16 +92,13 @@
lima.config.decimalseparator.description=
lima.config.host.adress=Host adress
lima.config.i18n.dir.description=
-lima.config.i18ndir=Directory used for i18n files
lima.config.locale.description=Localization used by LIMA
lima.config.resources.dir.description=
-lima.config.resourcesdir=Directory used for Lima resources
lima.config.scale.description=
lima.config.ui.flaunchui.description=
lima.config.ui.fullscreen.description=FullScreen
lima.daily=Daily
lima.documents=Documents…
-lima.documents.error=Can't create document on an open fiscal year
lima.entries=Entries
lima.entries.addEntry=Add entry
lima.entries.addTransaction=Add transaction
@@ -123,9 +117,6 @@
lima.enum.comboboxaccount.account=Account
lima.enum.comboboxaccount.accountlist=Account list
lima.enum.comboboxaccount.allaccount=All accounts
-lima.enum.comboboxamount.both=Both
-lima.enum.comboboxamount.credit=Credit
-lima.enum.comboboxamount.debit=Debit
lima.enum.comboboxentrybook.all=All entrybooks
lima.enum.comboboxentrybook.select_one=EntryBook
lima.enum.comboboxletter.all=All letters
@@ -142,7 +133,6 @@
lima.enum.comboboxperiod.fiscalperiod=Fiscal period
lima.enum.comboboxperiod.period=Period
lima.error.errorpane.htmlmessage=<html><body><b>An application error happened</b>\:<br/>%s</body></html>
-lima.error.no.masteraccount=there is no master account for account with number %s
lima.financialstatement.accounts=Account list on debit and on credit
lima.financialstatement.addfinancialStatementHeadererror=Can't add financialStatementHeader
lima.financialstatement.check=Check accounts passing to movement
@@ -187,7 +177,6 @@
lima.identity.businessNumber=Business number
lima.identity.city=City
lima.identity.classificationCode=Classification code
-lima.identity.contact=Contact
lima.identity.description=Description
lima.identity.email=Email
lima.identity.name=Name
@@ -214,12 +203,12 @@
lima.importexport.wait=Job in progress…
lima.init.closed=Lima closed at %1$s
lima.init.errorclosing=Error during Lima close
+lima.iu.importexport.import=
lima.ledger.documentcreationerror=Enable to create document
lima.lettering.listerror=Can't get entries list
lima.menu.file=File
lima.menu.help=Help
lima.menu.help.about=About
-lima.menu.help.help=Help
lima.menu.help.i18n=Language
lima.menu.help.i18n.fr=French
lima.menu.help.i18n.uk=English
@@ -250,16 +239,12 @@
lima.tab.home=Home
lima.table.account=Account
lima.table.balance=Balance
-lima.table.begin.credit=Beginning Balance Credit
-lima.table.begin.debit=Beginning Balance Debit
lima.table.closure=Closed
lima.table.code=Code
-lima.table.collectedvat=Collected VAT
lima.table.credit=Credit
lima.table.date=Date
lima.table.debit=Debit
lima.table.debitcredit=Debit and credit
-lima.table.deductiblevat=Deductible VAT
lima.table.description=Description
lima.table.entrybook=EntryBook
lima.table.fiscalperiod=Fiscalperiod
@@ -272,21 +257,31 @@
lima.table.number=Account Number
lima.table.period=Period
lima.table.provisiondeprecationamount=Provision & Deprecation
-lima.table.remainingcredit=Remaining credit
-lima.table.repayments=Repayments
lima.table.solde=Solder
lima.table.solde.credit=Credit solde
lima.table.solde.debit=Debit solde
-lima.table.vatcredit=VAT credit
-lima.table.vatdue=Due VAT
-lima.table.vatpaid=VAT paid
-lima.table.vatpayable=VAT payable
lima.table.voucher=Voucher
lima.title=Lutin Invoice Monitoring and Accounting
lima.title.about=About Lima...
lima.title.about.description=Open sources accounting software
lima.tooltip.filter=<html>Regular expression \:<br/>- accounts interval i..j <br/>- accounts list i,j,k <br/>- Exclude an account -i</html>
lima.tooltip.lettering=<html>Add a letter on many entries <br/>Select many rows with combination ctrl + click</html>
+lima.ui.account.addAccount=
+lima.ui.account.addaccounttitle=
+lima.ui.account.base=
+lima.ui.account.developed=
+lima.ui.account.label=
+lima.ui.account.number=
+lima.ui.account.removeaccountconfirm=
+lima.ui.account.removeaccounttitle=
+lima.ui.account.shortened=
+lima.ui.account.updateaccounttitle=
+lima.ui.common.cancel=
+lima.ui.common.ok=
+lima.ui.common.remove=
+lima.ui.common.update=
+lima.ui.importexport.importcsv=
+lima.ui.importexport.importebp=
lima.vatreport.listerror=Can't get entries list
lima.vatstatement.accounts=List of accounts
lima.vatstatement.boxname=PDF BoxName
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 2012-04-05 10:10:32 UTC (rev 3352)
+++ trunk/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties 2012-04-05 10:58:58 UTC (rev 3353)
@@ -1,5 +1,4 @@
=
-lima.account.addaccounterror=Erreur lors de l'ajout d'un compte
lima.accountsreports.listerror=Erreur lors de la récupération des données de la liste
lima.action.commandline.help=Afficher l'aide en console
lima.action.fullscreen=Plein Ecran
@@ -11,7 +10,6 @@
lima.balance.listerror=Erreur lors de la récupération des données de la liste
lima.charts.account=Plan comptable
lima.charts.account.addAccount=Ajout Compte Général
-lima.charts.account.addSubLedger=Ajouter Compte Tiers
lima.charts.account.base=Plan comptable de base
lima.charts.account.developed=Plan comptable développé
lima.charts.account.number=Numéro de compte
@@ -70,7 +68,6 @@
lima.common.globalexception=Global lima exception
lima.common.info=Information
lima.common.label=Libellé
-lima.common.masteraccount=Compte parent
lima.common.movmentedfilter=Comptes mouvementés
lima.common.next=Suivant
lima.common.ok=OK
@@ -95,16 +92,13 @@
lima.config.decimalseparator.description=
lima.config.host.adress=Adresse du serveur distant
lima.config.i18n.dir.description=
-lima.config.i18ndir=Répertoire utilisée pour stocker les fichiers i18n
lima.config.locale.description=Locale utilisée par l'application
lima.config.resources.dir.description=
-lima.config.resourcesdir=Répertoire utilisée pour stocker les ressources
lima.config.scale.description=
lima.config.ui.flaunchui.description=
lima.config.ui.fullscreen.description=Plein écran
lima.daily=Quotidien
lima.documents=Documents…
-lima.documents.error=Impossible de créer un document lorsque l'exercice est ouvert
lima.entries=Traitement
lima.entries.addEntry=Ajouter entrée
lima.entries.addTransaction=Ajouter transaction
@@ -123,9 +117,6 @@
lima.enum.comboboxaccount.account=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édit
-lima.enum.comboboxamount.debit=Débit
lima.enum.comboboxentrybook.all=Tous les journaux
lima.enum.comboboxentrybook.select_one=Journal
lima.enum.comboboxletter.all=Toutes les lettres
@@ -142,7 +133,6 @@
lima.enum.comboboxperiod.fiscalperiod=Exercice
lima.enum.comboboxperiod.period=Période
lima.error.errorpane.htmlmessage=<html><body><b>Une erreur s'est produite</b>\:<br/>%s</body></html>
-lima.error.no.masteraccount=Il n'existe pas de compte parent pour le numéro de compte %s
lima.financialstatement.accounts=Liste de comptes au crédit et au débit
lima.financialstatement.addfinancialStatementHeadererror=Erreur lors de l'ajout de l'entête sur la déclaration financière
lima.financialstatement.check=Vérification des comptes aux postes
@@ -187,7 +177,6 @@
lima.identity.businessNumber=SIRET
lima.identity.city=Ville
lima.identity.classificationCode=Code NAF
-lima.identity.contact=Contact
lima.identity.description=Description
lima.identity.email=Courriel
lima.identity.name=Nom
@@ -214,12 +203,12 @@
lima.importexport.wait=Traitement en cours …
lima.init.closed=Lima fermé à %1$s
lima.init.errorclosing=Erreur lors de la fermeture
+lima.iu.importexport.import=
lima.ledger.documentcreationerror=Erreur lors de la création du document
lima.lettering.listerror=Erreur lors de la récupération des données de la liste
lima.menu.file=Fichier
lima.menu.help=Aide
lima.menu.help.about=À Propos
-lima.menu.help.help=Afficher l'aide
lima.menu.help.i18n=Langue
lima.menu.help.i18n.fr=Français
lima.menu.help.i18n.uk=Anglais
@@ -243,23 +232,19 @@
lima.reports.vat=Edition TVA
lima.response.no=Non
lima.response.yes=Oui
-lima.splash.1=Chargement des services...
+lima.splash.1=Chargement des services
lima.splash.2=Chargement de la comptabilité
lima.splash.3=Application prête \!
lima.structure=Structure
lima.tab.home=Accueil
lima.table.account=Compte
lima.table.balance=Balance
-lima.table.begin.credit=Reprise crèdit
-lima.table.begin.debit=Reprise débit
lima.table.closure=Cloture
lima.table.code=Code
-lima.table.collectedvat=TVA collectée
lima.table.credit=Crédit
lima.table.date=Date
lima.table.debit=Débit
lima.table.debitcredit=Débit et Crédit
-lima.table.deductiblevat=TVA déductible
lima.table.description=Description
lima.table.entrybook=Journal
lima.table.fiscalperiod=Exercice
@@ -272,26 +257,35 @@
lima.table.number=Numéro de compte
lima.table.period=Période
lima.table.provisiondeprecationamount=Amortissements et provisions
-lima.table.remainingcredit=Crédit de TVA
-lima.table.repayments=Remboursements
lima.table.solde=Solde
lima.table.solde.credit=Solde crédit
lima.table.solde.debit=Solde débit
-lima.table.vatcredit=Crédit de TVA
-lima.table.vatdue=TVA due
-lima.table.vatpaid=TVA payée
-lima.table.vatpayable=TVA à payer
lima.table.voucher=Pièce comptable
lima.title=Lutin Invoice Monitoring and Accounting
lima.title.about=À propos de Lima...
lima.title.about.description=Logiciel de comptabilité Libre
lima.tooltip.filter=<html>Expression régulière \:<br/>- intervalle de compte i..j <br/>- liste de compte i,j,k <br/>- Exclure un compte -i</html>
lima.tooltip.lettering=<html>Pour ajouter une lettre à plusieurs écritures <br/>Sélectionner plusieurs lignes avec la combinaison ctrl + click</html>
+lima.ui.account.addAccount=Nouveau compte
+lima.ui.account.addaccounttitle=Ajout d'un compte
+lima.ui.account.base=Plan comptable de base
+lima.ui.account.developed=Plan comptable développé
+lima.ui.account.label=Libellé
+lima.ui.account.number=Numéro de compte
+lima.ui.account.removeaccountconfirm=Voulez-vous supprimer le compte %s ?
+lima.ui.account.removeaccounttitle=Suppression d'un compte
+lima.ui.account.shortened=Plan comptable abrégé
+lima.ui.account.updateaccounttitle=Modification d'un compte
+lima.ui.common.cancel=Annuler
+lima.ui.common.ok=Ok
+lima.ui.common.remove=Supprimer
+lima.ui.common.update=Modifier
+lima.ui.importexport.importcsv=Import/Export CSV
+lima.ui.importexport.importebp=Import/Export EBP
lima.vatreport.listerror=Erreur lors de la récupération des données de la liste
lima.vatstatement.accounts=Liste des comptes
lima.vatstatement.boxname=PDF BoxName
lima.vatstatement.delete=Supprimer le plan TVA actuel avant d'importer
-lima.vatstatement.header=
lima.vatstatement.label=Libellé
lima.vatstatement.mastervatstatement=
lima.vatstatement.movement.add=Ajouter un regrouprement
Modified: trunk/lima-swing/src/main/resources/log4j.properties
===================================================================
--- trunk/lima-swing/src/main/resources/log4j.properties 2012-04-05 10:10:32 UTC (rev 3352)
+++ trunk/lima-swing/src/main/resources/log4j.properties 2012-04-05 10:58:58 UTC (rev 3353)
@@ -38,3 +38,4 @@
# package level
log4j.logger.org.chorem.lima=INFO
+log4j.logger.org.chorem.lima.ui.account=DEBUG
\ No newline at end of file
1
0
r3352 - trunk/lima-swing/src/main/java/org/chorem/lima
by echatellier@users.chorem.org April 5, 2012
by echatellier@users.chorem.org April 5, 2012
April 5, 2012
Author: echatellier
Date: 2012-04-05 12:10:32 +0200 (Thu, 05 Apr 2012)
New Revision: 3352
Url: http://chorem.org/repositories/revision/lima/3352
Log:
Remove code pasted form appConfig
Modified:
trunk/lima-swing/src/main/java/org/chorem/lima/LimaConfig.java
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/LimaConfig.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/LimaConfig.java 2012-04-04 13:25:23 UTC (rev 3351)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/LimaConfig.java 2012-04-05 10:10:32 UTC (rev 3352)
@@ -25,7 +25,17 @@
package org.chorem.lima;
+import static org.nuiton.i18n.I18n._;
+import static org.nuiton.i18n.I18n.n_;
+
+import java.beans.PropertyChangeListener;
+import java.io.File;
+import java.io.IOException;
+import java.util.Locale;
+
import jaxx.runtime.JAXXUtil;
+
+import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.actions.MiscAction;
@@ -35,24 +45,10 @@
import org.nuiton.topia.TopiaContextFactory;
import org.nuiton.util.ApplicationConfig;
import org.nuiton.util.ArgumentsParserException;
-import org.nuiton.util.FileUtil;
-import org.nuiton.util.SortedProperties;
import org.nuiton.util.Version;
import org.nuiton.util.VersionUtil;
import org.nuiton.util.converter.ConverterUtil;
-import java.beans.PropertyChangeListener;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.util.Date;
-import java.util.Locale;
-import java.util.Properties;
-
-import static org.nuiton.i18n.I18n._;
-import static org.nuiton.i18n.I18n.n_;
-
/**
* La configuration de l'application.
*
@@ -498,96 +494,22 @@
}
/**
- * Save configuration, in user home directory using the
- * {@link #getConfigFileName}. Default, env and commande line note saved
- *
- * @param excludeKeys optional list of keys to exclude from
+ * Override save action to propagate some option to server.
*/
- public void saveForUser(String... excludeKeys) {
-
- File file = getUserConfigFile();
- if (log.isDebugEnabled()) {
- log.debug("will save user configuration in " + file);
- }
- try {
- save(file, false, excludeKeys);
- } catch (IOException eee) {
- if (log.isWarnEnabled()) {
- log.warn(_("nuitonutil.error.applicationconfig.save", file),
- eee);
- }
- }
- }
-
- /**
- * Save configuration, in specified file.
- *
- * @param file file where config will be writen
- * @param forceAll if true save all config option
- * (with defaults, classpath, env, command line)
- * @param excludeKeys optional list of keys to exclude from
- * @throws IOException if IO pb
- */
+ @Override
public void save(File file,
boolean forceAll,
String... excludeKeys) throws IOException {
- //
- String[] serverProperties = {"scale"};
+ super.save(file, forceAll, excludeKeys);
- // store sorted in file
- Properties prop = new SortedProperties();
+ // propagate scale option to serveur option
+ optionsService = LimaServiceFactory.getService(OptionsServiceMonitorable.class);
- // store server properties in file
- Properties serverProp = new SortedProperties();
-
- if (forceAll) {
- prop.putAll(defaults);
- prop.putAll(classpath);
+ // scale server option
+ String scaleOption = getOption("scale");
+ if (StringUtils.isNotBlank(scaleOption)) {
+ optionsService.setScale(scaleOption);
}
- prop.putAll(etcfile);
- prop.putAll(homefile);
- prop.putAll(curfile);
- if (forceAll) {
- prop.putAll(jvm);
- prop.putAll(env);
- prop.putAll(line);
- }
- prop.putAll(options);
-
- for (String excludeKey : excludeKeys) {
- prop.remove(excludeKey);
- }
-
- for (String serverPropertie : serverProperties) {
- if (prop.containsKey(serverPropertie)) {
- serverProp.put(serverPropertie, prop.get(serverPropertie));
- }
- }
-
- // Ano #687 : create parentFile before using it in FileWriter
- boolean dirCreated = FileUtil.createDirectoryIfNecessary(file.getParentFile());
- if (dirCreated && log.isDebugEnabled()) {
- log.debug("Creation of config directory " + file.getParent());
- }
-
- OutputStream stream = new FileOutputStream(file);
- try {
- prop.store(stream, "Last saved " + new Date());
- } finally {
- stream.close();
- }
-
- optionsService =
- LimaServiceFactory.getService(
- OptionsServiceMonitorable.class);
-
- if (!serverProp.isEmpty()) {
- if (serverProp.containsKey("scale")) {
- if (!serverProp.getProperty("scale").isEmpty()) {
- optionsService.setScale(serverProp.getProperty("scale"));
- }
- }
- }
}
}
1
0
April 4, 2012
Author: echatellier
Date: 2012-04-04 15:25:23 +0200 (Wed, 04 Apr 2012)
New Revision: 3351
Url: http://chorem.org/repositories/revision/lima/3351
Log:
Remove subAcount and ledgerAccount loop association.
Account tree is now renderer by account number association.
Added:
trunk/lima-business/src/main/java/org/chorem/lima/business/LimaRuntimeException.java
trunk/lima-business/src/test/java/org/chorem/lima/entity/
trunk/lima-business/src/test/java/org/chorem/lima/entity/AccountDAOTest.java
trunk/lima-callao/src/main/java/org/chorem/lima/entity/AccountDAO.java
trunk/lima-callao/src/main/java/org/chorem/lima/entity/ClosedPeriodicEntryBookDAO.java
trunk/lima-callao/src/main/java/org/chorem/lima/entity/FinancialPeriodDAO.java
trunk/lima-callao/src/main/java/org/chorem/lima/entity/FinancialStatementImpl.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountTreeTableRenderer.java
Removed:
trunk/lima-callao/src/main/java/org/chorem/lima/entity/AccountDAOImpl.java
trunk/lima-callao/src/main/java/org/chorem/lima/entity/ClosedPeriodicEntryBookDAOImpl.java
trunk/lima-callao/src/main/java/org/chorem/lima/entity/FinancialPeriodDAOImpl.java
trunk/lima-callao/src/main/java/org/chorem/lima/entity/FinancialStatementImpl.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountTreeTableModel.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/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/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/FiscalPeriodServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/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/migration/MigrationV0_6.java
trunk/lima-business/src/main/java/org/chorem/lima/service/LimaServiceFactory.java
trunk/lima-business/src/test/java/org/chorem/lima/business/AbstractLimaTest.java
trunk/lima-business/src/test/java/org/chorem/lima/business/AccountServiceImplTest.java
trunk/lima-business/src/test/java/org/chorem/lima/business/ImportServiceImplTest.java
trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/AccountServiceRuleFrTest.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/LimaMain.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountViewHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/SubLedgerForm.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/UpdateAccountForm.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/UpdateSubLedgerForm.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/SubAccountComboBoxModel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/AccountsPane.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 2012-04-04 09:03:41 UTC (rev 3350)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/AccountingRules.java 2012-04-04 13:25:23 UTC (rev 3351)
@@ -46,22 +46,17 @@
/**
* Account rule : check create account.
*
- * @param masterAccount parent account
* @param account new account
* @throws LimaException if rule validation fails
*/
- void createAccountRules(Account masterAccount, Account account) throws LimaException;
+ void createAccountRules(Account account) throws LimaException;
- void createSubLedgerRules(Account masterAccount, Account account) throws LimaException;
+ void updateAccountRules(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
+ * Entrybook rules.
*
* @param entryBook
* @param topiaTransaction
Added: trunk/lima-business/src/main/java/org/chorem/lima/business/LimaRuntimeException.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/LimaRuntimeException.java (rev 0)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/LimaRuntimeException.java 2012-04-04 13:25:23 UTC (rev 3351)
@@ -0,0 +1,60 @@
+/*
+ * #%L
+ * Lima business
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2012 CodeLutin, Chatellier Eric
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+package org.chorem.lima.business;
+
+/**
+ * Lima runtime exception.
+ *
+ * @author chatellier
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author$
+ */
+public class LimaRuntimeException extends RuntimeException {
+
+ /** serialVersionUID. */
+ private static final long serialVersionUID = -6876236663940184462L;
+
+ /**
+ * Constructs a new exception with the specified detail message.
+ *
+ * @param message message
+ */
+ public LimaRuntimeException(String message) {
+ super(message);
+ }
+
+ /**
+ * Constructs a new exception with the specified detail message and cause.
+ *
+ * @param message message
+ * @param cause cause
+ */
+ public LimaRuntimeException(String message, Throwable cause) {
+ super(message, cause);
+ }
+}
Property changes on: trunk/lima-business/src/main/java/org/chorem/lima/business/LimaRuntimeException.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/DefaultAccountingRules.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/DefaultAccountingRules.java 2012-04-04 09:03:41 UTC (rev 3350)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/DefaultAccountingRules.java 2012-04-04 13:25:23 UTC (rev 3351)
@@ -71,7 +71,7 @@
* Rules to check before create accounts.
*/
@Override
- public void createAccountRules(Account masterAccount, Account account) throws LimaException {
+ public void createAccountRules(Account account) throws LimaException {
// Check if the numberaccount is not blank
if (StringUtils.isBlank(account.getAccountNumber())) {
@@ -80,19 +80,13 @@
}
}
- /** Rules to check before create subledger */
@Override
- public void createSubLedgerRules(Account masterAccount, Account account)
- throws LimaException {
- // check the number account is not empty
+ public void updateAccountRules(Account account) throws LimaException {
+ // Check if the numberaccount is not blank
if (StringUtils.isBlank(account.getAccountNumber())) {
throw new LimaBusinessException(_("lima-business.defaultaccountingrules.invalidaccountnumber",
account.getAccountNumber()));
}
- // check if parentaccount have no subaccount
- if (masterAccount.getSubAccounts().isEmpty()) {
- throw new LimaBusinessException(_("lima-business.defaultaccountingrules.subledgererror"));
- }
}
/** Rules to check before create fiscals periods */
@@ -455,23 +449,4 @@
}
throw new LimaException(_("lima-business.common.queryerror"), cause);
}
-
- @Override
- public void updateAccountRules(Account masterAccount, Account account) throws LimaException {
- // Check if the numberaccount is not blank
- if (StringUtils.isBlank(account.getAccountNumber())) {
- throw new LimaBusinessException(_("lima-business.defaultaccountingrules.invalidaccountnumber",
- account.getAccountNumber()));
- }
- }
-
- @Override
- public void updateSubLedgerRules(Account account) throws LimaException {
- // check the number account is not empty
- if (StringUtils.isBlank(account.getAccountNumber())) {
- throw new LimaBusinessException(_("lima-business.defaultaccountingrules.invalidaccountnumber",
- account.getAccountNumber()));
- }
- }
-
}
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/FranceAccountingRules.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/FranceAccountingRules.java 2012-04-04 09:03:41 UTC (rev 3350)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/FranceAccountingRules.java 2012-04-04 13:25:23 UTC (rev 3351)
@@ -56,69 +56,48 @@
protected static final Log log = LogFactory.getLog(FranceAccountingRules.class);
- /** Règles de vérification de la création du PCG, appliquées à la comptabilité française */
+ /**
+ * Règles de vérification de la création du PCG, appliquées à la comptabilité française.
+ */
@Override
- public void createAccountRules(Account masterAccount, Account account) throws LimaException {
- super.createAccountRules(masterAccount, account);
+ public void createAccountRules(Account account) throws LimaException {
+ super.createAccountRules(account);
- // Check if the number account is type numeric
- if (!StringUtils.isNumeric(account.getAccountNumber())) {
+ String accountNumber = account.getAccountNumber();
+
+ // ledger account must be located in 411 account
+ if (!StringUtils.isNumeric(accountNumber) && accountNumber.startsWith("4")) {
throw new LimaBusinessException(_("lima-business.franceaccountingrules.accountnumbernotnumeric",
account.getAccountNumber()));
}
- // Check if the number account start with the number of the master account
- if (masterAccount != null && !account.getAccountNumber().startsWith(
- masterAccount.getAccountNumber())) {
- throw new LimaBusinessException(_("lima-business.franceaccountingrules.accountnumbernotmaster",
- account.getAccountNumber()));
- }
-
- // Check if master account have a number between 1 to 8
- if (masterAccount == null && !account.getAccountNumber().matches("[1-8]")) {
+ // Check root account starts with 1 to 8
+ if (accountNumber.length() == 1 && accountNumber.matches("[1-8]")) {
throw new LimaBusinessException(_("lima-business.franceaccountingrules.accountstartnumbererror",
account.getAccountNumber()));
}
-
}
@Override
- public void updateAccountRules(Account masterAccount, Account account) throws LimaException {
- super.updateAccountRules(masterAccount, account);
+ public void updateAccountRules(Account account) throws LimaException {
+ super.updateAccountRules(account);
+ String accountNumber = account.getAccountNumber();
+
// Check if the number account is type numeric
if (!StringUtils.isNumeric(account.getAccountNumber())) {
throw new LimaBusinessException(_("lima-business.franceaccountingrules.accountnumbernotnumeric",
account.getAccountNumber()));
}
- // Check if the number account start with the number of the master account
- if (masterAccount != null && !account.getAccountNumber().startsWith(
- masterAccount.getAccountNumber())) {
- throw new LimaBusinessException(_("lima-business.franceaccountingrules.accountnumbernotmaster",
- account.getAccountNumber()));
- }
-
- // Check if master account have a number between 1 to 8
- if (masterAccount == null && !account.getAccountNumber().matches("[1-8]")) {
+ // Check root account starts with 1 to 8
+ if (accountNumber.length() == 1 && accountNumber.matches("[1-8]")) {
throw new LimaBusinessException(_("lima-business.franceaccountingrules.accountstartnumbererror",
account.getAccountNumber()));
}
}
- /** Rules to check before create subledger */
- @Override
- 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")) {
- throw new LimaBusinessException(_("lima-business.franceaccountingrules.masteraccountnumbererror",
- account.getAccountNumber()));
- }
- }
-
/**
* Règles de vérification d'ouverture d'un exercice, appliquées à la comptabilité française
* <p/>
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 2012-04-04 09:03:41 UTC (rev 3350)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java 2012-04-04 13:25:23 UTC (rev 3351)
@@ -37,7 +37,6 @@
import org.chorem.lima.entity.LimaCallaoDAOHelper;
import org.nuiton.topia.TopiaContext;
import org.nuiton.topia.TopiaException;
-import org.nuiton.topia.framework.TopiaQuery;
import javax.ejb.Stateless;
import java.util.ArrayList;
@@ -64,8 +63,28 @@
}
@Override
- public void createAccountWithTransaction(Account masterAccount,
- Account account,
+ public long getAccountCount() throws LimaException {
+ long result = 0;
+ TopiaContext transaction = beginTransaction(rootContext);
+ try {
+
+ // check if the accountnumber already exist
+ AccountDAO accountDAO = LimaCallaoDAOHelper.getAccountDAO(transaction);
+
+ result = accountDAO.count();
+ } catch (Exception ex) {
+ doCatch(transaction, ex);
+ } finally {
+ doFinally(transaction);
+ }
+ return result;
+ }
+
+ /**
+ * Create new account with existing transaction.
+ */
+ @Override
+ public void createAccountWithTransaction(Account account,
TopiaContext topiaContext) throws LimaException {
try {
@@ -87,18 +106,6 @@
//create it
accountDAO.create(account);
- Account masterAccountUpdate = null;
- if (masterAccount != null) {
- masterAccountUpdate = accountDAO.findByAccountNumber(
- masterAccount.getAccountNumber());
- }
-
- // check if parent account exist;
- if (masterAccountUpdate != null) {
- masterAccountUpdate.addSubAccounts(account);
- accountDAO.update(masterAccountUpdate);
- }
-
commitTransaction(topiaContext);
} catch (TopiaException ex) {
doCatch(topiaContext, ex);
@@ -116,37 +123,17 @@
* @throws LimaException
*/
@Override
- public void createAccount(Account masterAccount,
- Account account) throws LimaException {
+ public void createAccount(Account account) throws LimaException {
- //check rules before create the account
+ // check rules before create the account
AccountingRules accountingRules = LimaConfig.getInstance().getAccountingRules();
- accountingRules.createAccountRules(masterAccount, account);
+ accountingRules.createAccountRules(account);
TopiaContext transaction = beginTransaction(rootContext);
try {
- createAccountWithTransaction(masterAccount, account, transaction);
- } catch (Exception ex) {
- doCatch(transaction, ex);
- } finally {
- doFinally(transaction);
- }
- }
-
- @Override
- public void createSubLedgerWithTransaction(Account masterAccount,
- Account account,
- TopiaContext topiaContext) throws LimaException {
-
- try {
-
- // force upppercase account number
- account.setAccountNumber(account.getAccountNumber().toUpperCase());
-
// check if the accountnumber already exist
- AccountDAO accountDAO =
- LimaCallaoDAOHelper.getAccountDAO(topiaContext);
+ AccountDAO accountDAO = LimaCallaoDAOHelper.getAccountDAO(transaction);
Account existAccount =
accountDAO.findByAccountNumber(account.getAccountNumber());
if (existAccount != null) {
@@ -155,45 +142,12 @@
account.getAccountNumber()));
}
- //create it
- accountDAO.create(account);
-
- Account masterAccountUpdate = null;
- if (masterAccount != null) {
- masterAccountUpdate = accountDAO.findByAccountNumber(
- masterAccount.getAccountNumber());
- }
-
- // check if the masteraccount exist;
- if (masterAccount != null) {
- masterAccountUpdate.addSubLedgers(account);
- accountDAO.update(masterAccountUpdate);
- }
-
- commitTransaction(topiaContext);
- } catch (TopiaException ex) {
- doCatch(topiaContext, ex);
- }
- }
-
- /** Permet de créer des comptes tiers */
- @Override
- public void createSubLedger(Account masterAccount,
- Account account) throws LimaException {
-
- //check rules before create the account
- AccountingRules accountingRules = LimaConfig.getInstance().getAccountingRules();
- accountingRules.createSubLedgerRules(masterAccount, account);
-
- TopiaContext transaction = beginTransaction(rootContext);
- try {
- createSubLedgerWithTransaction(masterAccount, account, transaction);
+ createAccountWithTransaction(account, transaction);
} catch (Exception ex) {
doCatch(transaction, ex);
} finally {
doFinally(transaction);
}
-
}
/** Permer d'obtenir la liste des comptes à partir d'une de ses propriétés */
@@ -263,8 +217,7 @@
TopiaContext transaction = beginTransaction(rootContext);
try {
- AccountDAO accountDAO =
- LimaCallaoDAOHelper.getAccountDAO(transaction);
+ AccountDAO accountDAO = LimaCallaoDAOHelper.getAccountDAO(transaction);
accountsList = accountDAO.findAll();
Collections.sort(accountsList, new AccountComparator());
@@ -280,7 +233,7 @@
/** Permet d'obtenir tout les comptes feuilles */
@Override
- public List<Account> getAllSubAccounts() throws LimaException {
+ public List<Account> getAllLeafAccounts() throws LimaException {
List<Account> accountsList = null;
@@ -288,7 +241,7 @@
try {
AccountDAO accountDAO =
LimaCallaoDAOHelper.getAccountDAO(transaction);
- accountsList = accountDAO.findAllSubAccounts();
+ accountsList = accountDAO.findAllLeafAccounts();
} catch (Exception ex) {
doCatch(transaction, ex);
} finally {
@@ -308,17 +261,17 @@
@Override
public List<Account> getChildrenAccounts(Account masterAccount) throws LimaException {
- List<Account> accountsList = new ArrayList<Account>();
+ List<Account> accountsList = null;
TopiaContext transaction = beginTransaction(rootContext);
try {
AccountDAO accountDAO =
LimaCallaoDAOHelper.getAccountDAO(transaction);
- TopiaQuery query = accountDAO.createQuery();
+ //TopiaQuery query = accountDAO.createQuery();
//tchemit 2011-09-21 Only consider account childs from the master account
// link otherwise account can be found from different masterAccount
- query.addEquals(Account.PROPERTY_MASTER_ACCOUNT, masterAccount);
+ //query.addEquals(Account.PROPERTY_MASTER_ACCOUNT, masterAccount);
// if (masterAccount == null) {
// query.addEquals(Account.PROPERTY_MASTER_ACCOUNT, masterAccount);
// query.addWhere(Account.PROPERTY_GENERAL_LEDGER, TopiaQuery.Op.EQ, null);
@@ -328,20 +281,22 @@
// Account.PROPERTY_GENERAL_LEDGER + " = :value")
// .addParam("value", masterAccount);
// }
- accountsList.addAll(accountDAO.findAllByQuery(query));
- Collections.sort(accountsList, new AccountComparator());
+ //accountsList.addAll(accountDAO.findAllByQuery(query));
+ //Collections.sort(accountsList, new AccountComparator());
// sort of bug fix 2011.09.10 vsalaun (+ bleny)
// do NOT delete these lines unless you find a better way to
// prevent lazy exception when updating account from the account chart
- for (Account t : accountsList) {
+ /*for (Account t : accountsList) {
if (t.getMasterAccount() != null) {
t.getMasterAccount().getTopiaId();
}
t.sizeSubAccounts();
t.sizeSubLedgers();
t.getGeneralLedger();
- }
+ }*/
+
+ accountsList = accountDAO.getSubAccounts(masterAccount);
} catch (Exception ex) {
doCatch(transaction, ex);
@@ -442,25 +397,7 @@
AccountDAO accountDAO =
LimaCallaoDAOHelper.getAccountDAO(transaction);
Account subAccount = accountDAO.findByTopiaId(account.getTopiaId());
- //check rules account if ledger or account
- if (account.getGeneralLedger() == null) { // is an account
-
- Account master = account.getMasterAccount();
-
- accountingRules.updateAccountRules(master, account);
- subAccount.setMasterAccount(account.getMasterAccount());
- subAccount.setSubAccounts(account.getSubAccounts());
- } else { // is a ledger
- accountingRules.updateSubLedgerRules(account);
- subAccount.setGeneralLedger(account.getGeneralLedger());
- subAccount.setSubLedgers(account.getSubLedgers());
- subAccount.setThirdParty(account.getThirdParty());
- }
-
- // update account
- subAccount.setAccountNumber(account.getAccountNumber());
- subAccount.setLabel(account.getLabel());
-
+ accountingRules.updateAccountRules(account);
accountDAO.update(subAccount);
commitTransaction(transaction);
} catch (Exception ex) {
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 2012-04-04 09:03:41 UTC (rev 3350)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ExportServiceImpl.java 2012-04-04 13:25:23 UTC (rev 3351)
@@ -484,18 +484,6 @@
nextLine[1] = account.getAccountNumber();
nextLine[2] = account.getLabel();
nextLine[3] = account.getThirdParty();
- Account masterAccount = account.getMasterAccount();
- Account generalLedger = account.getGeneralLedger();
- String masterAccountString = "";
- String generalLedgerString = "";
- if (masterAccount != null) {
- masterAccountString = masterAccount.getAccountNumber();
- }
- nextLine[4] = masterAccountString;
- if (generalLedger != null) {
- generalLedgerString = generalLedger.getAccountNumber();
- }
- nextLine[5] = generalLedgerString;
// Ajoute la ligne au fichier
csvWriter.writeNext(nextLine);
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 2012-04-04 09:03:41 UTC (rev 3350)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialStatementServiceImpl.java 2012-04-04 13:25:23 UTC (rev 3351)
@@ -521,7 +521,7 @@
FinancialStatementDAO financialStatementDAO =
LimaCallaoDAOHelper.getFinancialStatementDAO(transaction);
- List<Account> accountsList = accountDAO.findAllSubAccounts();
+ List<Account> accountsList = accountDAO.findAllLeafAccounts();
List<FinancialStatement> financialStatementsList =
financialStatementDAO.findAll();
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 2012-04-04 09:03:41 UTC (rev 3350)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FiscalPeriodServiceImpl.java 2012-04-04 13:25:23 UTC (rev 3351)
@@ -333,10 +333,10 @@
//89 BILAN
Account accountMaster = accountService.getAccountByNumber("89");
if (accountMaster == null) {
- Account accountSuperMaster = accountService.getAccountByNumber("8");
+ accountMaster = new AccountImpl();
accountMaster.setAccountNumber("89");
accountMaster.setLabel("BILAN");
- accountService.createAccount(accountSuperMaster, accountMaster);
+ accountService.createAccount(accountMaster);
accountMaster = accountService.getAccountByNumber("89");
}
@@ -346,7 +346,7 @@
beginRetainedAccount = new AccountImpl();
beginRetainedAccount.setAccountNumber("890");
beginRetainedAccount.setLabel("Bilan d'ouverture");
- accountService.createAccount(accountMaster, beginRetainedAccount);
+ accountService.createAccount(beginRetainedAccount);
beginRetainedAccount = accountService.getAccountByNumber("890");
}
@@ -356,7 +356,7 @@
endRetainedAccount = new AccountImpl();
endRetainedAccount.setAccountNumber("891");
endRetainedAccount.setLabel("Bilan de clôture");
- accountService.createAccount(accountMaster, endRetainedAccount);
+ accountService.createAccount(endRetainedAccount);
endRetainedAccount = accountService.getAccountByNumber("891");
}
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 2012-04-04 09:03:41 UTC (rev 3350)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java 2012-04-04 13:25:23 UTC (rev 3351)
@@ -366,8 +366,7 @@
.findByAccountNumber(masterAccountNumber);
i++;
}
- accountService.createSubLedgerWithTransaction(
- masterAccount, account, topiaContext);
+ accountService.createAccountWithTransaction(account, topiaContext);
result.append(_("lima-business.import.accountadded", accountNumber, label));
}
// else if account and exclude account start with 0 (fix from error on EBP)
@@ -375,8 +374,7 @@
// if account is class account : 1, 2, 3, 4, 5, 6, 7,…
int nbCharAccountNumber = accountNumber.length();
if (nbCharAccountNumber == 1) {
- accountService.createAccountWithTransaction(null,
- account, topiaContext);
+ accountService.createAccountWithTransaction(account, topiaContext);
result.append(_("lima-business.import.accountadded", accountNumber, label));
} else {
Account masterAccount = null;
@@ -388,8 +386,7 @@
.findByAccountNumber(masterAccountNumber);
i++;
}
- accountService.createAccountWithTransaction(
- masterAccount, account, topiaContext);
+ accountService.createAccountWithTransaction(account, topiaContext);
result.append(_("lima-business.import.accountadded", accountNumber, label));
}
}
@@ -1239,13 +1236,8 @@
account.setLabel(accountImport.getLabel());
account.setThirdParty(accountImport.getThirdParty());
- if (generalLedger != null) {
- accountService.createSubLedgerWithTransaction(
- generalLedger, account, topiaContext);
- } else {
- accountService.createAccountWithTransaction(
- masterAccount, account, topiaContext);
- }
+ accountService.createAccountWithTransaction(account, topiaContext);
+
result.append(_("lima-business.import.accountadded",
accountImport.getAccountNumber(),
accountImport.getLabel()));
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 2012-04-04 09:03:41 UTC (rev 3350)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java 2012-04-04 13:25:23 UTC (rev 3351)
@@ -114,9 +114,9 @@
if (account != null) {
//Get allsubaccounts and thirdParts accounts
- List<Account> accounts = (List<Account>) account.getSubAccounts();
+ List<Account> accounts = null; // FIXME review code (List<Account>) account.getSubAccounts();
if (thirdPartAccountsMode) {
- List<Account> thirdPartAccount = (List<Account>) account.getSubLedgers();
+ List<Account> thirdPartAccount = null; // FIXME review code (List<Account>) account.getSubLedgers();
if (thirdPartAccount != null) {
ReportsDatas subReportsDatas = generateSubAccountReportsWithTransaction(account,
beginDate, endDate, topiaContext);
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 2012-04-04 09:03:41 UTC (rev 3350)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/AccountService.java 2012-04-04 13:25:23 UTC (rev 3351)
@@ -43,6 +43,14 @@
@Remote
public interface AccountService {
+ /**
+ * Return account count.
+ *
+ * @return account count
+ * @throws LimaException technical exception
+ */
+ long getAccountCount() throws LimaException;
+
List<Account> getAllAccountByProperty(String propertyName,
String value) throws LimaException;
@@ -61,9 +69,15 @@
Account getAccountByNumber(String number) throws LimaException;
+ /**
+ * Return all account ordered by account name.
+ *
+ * @return all account
+ * @throws LimaException
+ */
List<Account> getAllAccounts() throws LimaException;
- List<Account> getAllSubAccounts() throws LimaException;
+ List<Account> getAllLeafAccounts() throws LimaException;
/**
* Create new account. If {@code masterAccount} is not null, {@code account}
@@ -73,12 +87,8 @@
* @param account account
* @throws LimaException
*/
- void createAccount(Account masterAccount,
- Account account) throws LimaException;
+ void createAccount(Account account) throws LimaException;
- void createSubLedger(Account masterAccount,
- Account account) throws LimaException;
-
void updateAccount(Account account) throws LimaException;
void removeAccount(Account account) 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 2012-04-04 09:03:41 UTC (rev 3350)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/AccountServiceLocal.java 2012-04-04 13:25:23 UTC (rev 3351)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2008 - 2010 CodeLutin
+ * Copyright (C) 2008 - 2012 CodeLutin, Chatellier Eric
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
@@ -40,12 +40,9 @@
* Last update : $Date$
* By : $Author$
*/
-
@Local
public interface AccountServiceLocal extends AccountService {
- void createAccountWithTransaction(Account masterAccount, Account account, TopiaContext topiaContext) throws LimaException;
+ void createAccountWithTransaction(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/migration/MigrationV0_6.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/migration/MigrationV0_6.java 2012-04-04 09:03:41 UTC (rev 3350)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/migration/MigrationV0_6.java 2012-04-04 13:25:23 UTC (rev 3351)
@@ -27,9 +27,6 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.chorem.lima.entity.Account;
-import org.chorem.lima.entity.AccountDAO;
-import org.chorem.lima.entity.LimaCallaoDAOHelper;
import org.nuiton.topia.TopiaException;
import org.nuiton.topia.framework.TopiaContextImplementor;
import org.nuiton.topia.migration.TopiaMigrationCallbackByClass;
@@ -63,74 +60,14 @@
log.info("Migrates to version 0.6");
}
- // find all account with no master account and attach them to a master
- // if master does not exists let's create it also
- AccountDAO accountDAO = LimaCallaoDAOHelper.getAccountDAO(tx);
- List<Account> accounts = accountDAO.findAll();
- for (Account account : accounts) {
- fillMasterAccountNumber(accountDAO, account);
- }
-
// delete computed fields
queries.add("Alter table FINANCIALTRANSACTION drop column AMOUNTDEBIT");
queries.add("Alter table FINANCIALTRANSACTION drop column AMOUNTCREDIT");
+
+ // modele refactoring
+ queries.add("drop table record");
+ queries.add("alter table account drop column masteraccount");
+ queries.add("alter table account drop column generalledger");
}
- protected void fillMasterAccountNumber(AccountDAO accountDAO, Account account) throws TopiaException {
- if (account.getMasterAccount() != null) {
- // have already a master account
- return;
- }
-
- String accountNumber = account.getAccountNumber();
-
- if (log.isInfoEnabled()) {
- log.info("Account " + accountNumber + " does not have a masterAccount, will fill one.");
- }
- int length = accountNumber.length();
- if (length == 1) {
-
- // this is a master account, nothing to do
- return;
- }
- String masterAccountNumber = null;
-
- if (length > 3) {
- // fill with master account with 3 digits
- masterAccountNumber = accountNumber.substring(0, 3);
- } else if (length == 3) {
- // fill with master account with 2 digits
- masterAccountNumber = accountNumber.substring(0, 2);
- } else if (length == 2) {
- // fill with master account with 1 digits
- masterAccountNumber = accountNumber.substring(0, 1);
- }
-
- if (masterAccountNumber != null) {
-
- Account masterAccount = getMasterAccount(accountDAO, account, masterAccountNumber);
-
- if (log.isInfoEnabled()) {
- log.info("Set masterAccount [" + masterAccountNumber + "] to account [" + accountNumber + "]");
- }
- account.setMasterAccount(masterAccount);
-
- // let's fill master account
- fillMasterAccountNumber(accountDAO, masterAccount);
- }
- }
-
- protected Account getMasterAccount(AccountDAO accountDAO,
- Account subAccount,
- String accountNumber) throws TopiaException {
- Account masterAccount =
- accountDAO.findByAccountNumber(accountNumber);
- if (masterAccount == null) {
-
- // creates it
- masterAccount = accountDAO.create(Account.PROPERTY_ACCOUNT_NUMBER, accountNumber);
- }
- masterAccount.addSubAccounts(subAccount);
- return masterAccount;
- }
}
Modified: trunk/lima-business/src/main/java/org/chorem/lima/service/LimaServiceFactory.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/service/LimaServiceFactory.java 2012-04-04 09:03:41 UTC (rev 3350)
+++ trunk/lima-business/src/main/java/org/chorem/lima/service/LimaServiceFactory.java 2012-04-04 13:25:23 UTC (rev 3351)
@@ -40,10 +40,6 @@
import org.apache.commons.io.IOUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.apache.openejb.OpenEJB;
-import org.apache.openejb.assembler.classic.AppInfo;
-import org.apache.openejb.assembler.classic.Assembler;
-import org.apache.openejb.loader.SystemInstance;
import org.chorem.lima.business.ServiceListener;
import org.chorem.lima.business.ServiceMonitorable;
import org.nuiton.util.ApplicationConfig;
Modified: trunk/lima-business/src/test/java/org/chorem/lima/business/AbstractLimaTest.java
===================================================================
--- trunk/lima-business/src/test/java/org/chorem/lima/business/AbstractLimaTest.java 2012-04-04 09:03:41 UTC (rev 3350)
+++ trunk/lima-business/src/test/java/org/chorem/lima/business/AbstractLimaTest.java 2012-04-04 13:25:23 UTC (rev 3351)
@@ -71,6 +71,10 @@
import org.junit.BeforeClass;
import org.nuiton.i18n.I18n;
import org.nuiton.i18n.init.ClassPathI18nInitializer;
+import org.nuiton.topia.TopiaContext;
+import org.nuiton.topia.TopiaContextFactory;
+import org.nuiton.topia.TopiaNotFoundException;
+import org.nuiton.topia.TopiaRuntimeException;
/**
* Common initialization code for all lima tests.
@@ -227,37 +231,37 @@
Account classFinancier = new AccountImpl();
classFinancier.setAccountNumber("5");
classFinancier.setLabel("Comptes financiers");
- accountService.createAccount(null, classFinancier);
+ accountService.createAccount(classFinancier);
Account accountVmp = new AccountImpl();
accountVmp.setAccountNumber("50");
accountVmp.setLabel("Valeurs mobilières de placement");
- accountService.createAccount(classFinancier, accountVmp);
+ accountService.createAccount(accountVmp);
Account accountPel = new AccountImpl();
accountPel.setAccountNumber("501");
accountPel.setLabel("Parts dans des entreprises liées");
- accountService.createAccount(accountVmp, accountPel);
+ accountService.createAccount(accountPel);
Account accountAP = new AccountImpl();
accountAP.setAccountNumber("502");
accountAP.setLabel("Actions propres");
- accountService.createAccount(accountVmp, accountAP);
+ accountService.createAccount(accountAP);
Account accountBefa = new AccountImpl();
accountBefa.setAccountNumber("51");
accountBefa.setLabel("Banques établissements financiers et assimilés");
- accountService.createAccount(classFinancier, accountBefa);
+ accountService.createAccount(accountBefa);
Account accountVmpVae = new AccountImpl();
accountVmpVae.setAccountNumber("511");
accountVmpVae.setLabel("Valeurs à l'encaissement");
- accountService.createAccount(accountBefa, accountVmpVae);
+ accountService.createAccount(accountVmpVae);
Account accountBanques = new AccountImpl();
accountBanques.setAccountNumber("512");
accountBanques.setLabel("Banques");
- accountService.createAccount(accountBefa, accountBanques);
+ accountService.createAccount(accountBanques);
// creation d'un journal
EntryBook journalDesVentes = new EntryBookImpl();
@@ -310,4 +314,24 @@
tr1Entry2.setVoucher("voucher");
tr1Entry2 = financialTransactionService.createEntry(tr1Entry2);
}
+
+ /**
+ * Method to use only for class that need a context to be tester.
+ * Only for DOA for now.
+ *
+ * @return a topia context
+ */
+ protected static TopiaContext getTestContext() {
+ try {
+ LimaConfig config = LimaConfig.getInstance();
+ Properties options = config.getFlatOptions();
+
+ if (log.isDebugEnabled()) {
+ log.debug("Opening context to database : " + options.getProperty("hibernate.connection.url"));
+ }
+ return TopiaContextFactory.getContext(options);
+ } catch (TopiaNotFoundException ex) {
+ throw new TopiaRuntimeException("Could not acquire root context", ex);
+ }
+ }
}
Modified: trunk/lima-business/src/test/java/org/chorem/lima/business/AccountServiceImplTest.java
===================================================================
--- trunk/lima-business/src/test/java/org/chorem/lima/business/AccountServiceImplTest.java 2012-04-04 09:03:41 UTC (rev 3350)
+++ trunk/lima-business/src/test/java/org/chorem/lima/business/AccountServiceImplTest.java 2012-04-04 13:25:23 UTC (rev 3351)
@@ -60,7 +60,7 @@
Account myAccount = new AccountImpl();
myAccount.setAccountNumber("2");
myAccount.setLabel("Comptes d'immobilisations");
- accountService.createAccount(null, myAccount);
+ accountService.createAccount(myAccount);
}
/**
@@ -73,7 +73,7 @@
Account myAccount = new AccountImpl();
myAccount.setAccountNumber("5");
myAccount.setLabel("Comptes de capitaux");
- accountService.createAccount(null, myAccount);
+ accountService.createAccount(myAccount);
}
/**
@@ -89,7 +89,7 @@
Account myAccount = new AccountImpl();
myAccount.setAccountNumber("42"); // erreur de compte (4)
myAccount.setLabel("Comptes de tiers");
- accountService.createAccount(null, myAccount);
+ accountService.createAccount(myAccount);
}
/**
@@ -104,22 +104,22 @@
Account classCharges = new AccountImpl();
classCharges.setAccountNumber("6");
classCharges.setLabel("Comptes de charges");
- accountService.createAccount(null, classCharges);
+ accountService.createAccount(classCharges);
Account accountAchat = new AccountImpl();
accountAchat.setAccountNumber("60");
accountAchat.setLabel("Achats (sauf 603)");
- accountService.createAccount(classCharges, accountAchat);
+ accountService.createAccount(accountAchat);
Account accountSe = new AccountImpl();
accountSe.setAccountNumber("61");
accountSe.setLabel("Services extérieurs");
- accountService.createAccount(classCharges, accountSe);
+ accountService.createAccount(accountSe);
Account accountVs = new AccountImpl();
accountVs.setAccountNumber("603");
accountVs.setLabel("Variations des stocks (approvisionnements et marchandises)");
- accountService.createAccount(accountAchat, accountVs);
+ accountService.createAccount(accountVs);
}
/**
@@ -134,12 +134,12 @@
Account classFinancier = new AccountImpl();
classFinancier.setAccountNumber("5");
classFinancier.setLabel("Comptes financiers");
- accountService.createAccount(null, classFinancier);
+ accountService.createAccount(classFinancier);
Account accountVmp = new AccountImpl();
accountVmp.setAccountNumber("40");
accountVmp.setLabel("Fournisseurs et comptes rattachés");
- accountService.createAccount(classFinancier, accountVmp);
+ accountService.createAccount(accountVmp);
}
/**
@@ -178,6 +178,17 @@
}
/**
+ * Find all leaf account.
+ *
+ * @throws LimaException
+ */
+ @Test
+ public void getAllLeafAccountTest() throws LimaException {
+ List<Account> listAccount = accountService.getAllLeafAccounts();
+ Assert.assertEquals(4, listAccount.size());
+ }
+
+ /**
* Permet de tester si un compte est bien effacé.
*
* @throws LimaException
Modified: trunk/lima-business/src/test/java/org/chorem/lima/business/ImportServiceImplTest.java
===================================================================
--- trunk/lima-business/src/test/java/org/chorem/lima/business/ImportServiceImplTest.java 2012-04-04 09:03:41 UTC (rev 3350)
+++ trunk/lima-business/src/test/java/org/chorem/lima/business/ImportServiceImplTest.java 2012-04-04 13:25:23 UTC (rev 3351)
@@ -116,12 +116,13 @@
* @throws Exception
*/
@Test
- public void testImportAccountLedgerAccount() throws Exception {
+ public void testImportCreateIntermediaiteAccount() throws Exception {
importEBPData();
Account compteTiers = accountService.getAccountByNumber("4");
Account employeAccount = accountService.getAccountByNumber("401TEEMP");
- Assert.assertEquals(compteTiers, employeAccount.getGeneralLedger());
+ Assert.assertNotNull(compteTiers);
+ Assert.assertNotNull(employeAccount);
}
/**
Modified: trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/AccountServiceRuleFrTest.java
===================================================================
--- trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/AccountServiceRuleFrTest.java 2012-04-04 09:03:41 UTC (rev 3350)
+++ trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/AccountServiceRuleFrTest.java 2012-04-04 13:25:23 UTC (rev 3351)
@@ -71,6 +71,6 @@
public void testCreateAccountWrongNumber() throws LimaException {
Account myAccount = new AccountImpl();
myAccount.setAccountNumber("42");
- accountService.createAccount(null, myAccount);
+ accountService.createAccount(myAccount);
}
}
Added: trunk/lima-business/src/test/java/org/chorem/lima/entity/AccountDAOTest.java
===================================================================
--- trunk/lima-business/src/test/java/org/chorem/lima/entity/AccountDAOTest.java (rev 0)
+++ trunk/lima-business/src/test/java/org/chorem/lima/entity/AccountDAOTest.java 2012-04-04 13:25:23 UTC (rev 3351)
@@ -0,0 +1,60 @@
+/*
+ * #%L
+ *
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2012 Codelutin, Chatellier Eric
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
+package org.chorem.lima.entity;
+
+import java.util.List;
+
+import org.chorem.lima.business.AbstractLimaTest;
+import org.junit.Assert;
+import org.junit.Test;
+import org.nuiton.topia.TopiaException;
+
+/**
+ * Test for AccountDAO class.
+ *
+ * @author chatellier
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author$
+ */
+public class AccountDAOTest extends AbstractLimaTest {
+
+ /**
+ * Test la recherche de compte par interval.
+ * @throws TopiaException
+ */
+ @Test
+ public void testStringToListAccounts() throws TopiaException {
+ AccountDAO accountDAO = LimaCallaoDAOHelper.getAccountDAO(getTestContext());
+
+ List<Account> accounts = accountDAO.stringToListAccounts("50..511", false);
+ Assert.assertEquals(3, accounts.size());
+
+ accounts = accountDAO.stringToListAccounts("60..99", false);
+ Assert.assertEquals(0, accounts.size());
+ }
+}
Property changes on: trunk/lima-business/src/test/java/org/chorem/lima/entity/AccountDAOTest.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Copied: trunk/lima-callao/src/main/java/org/chorem/lima/entity/AccountDAO.java (from rev 3340, trunk/lima-callao/src/main/java/org/chorem/lima/entity/AccountDAOImpl.java)
===================================================================
--- trunk/lima-callao/src/main/java/org/chorem/lima/entity/AccountDAO.java (rev 0)
+++ trunk/lima-callao/src/main/java/org/chorem/lima/entity/AccountDAO.java 2012-04-04 13:25:23 UTC (rev 3351)
@@ -0,0 +1,198 @@
+/*
+ * #%L
+ * Lima callao
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2008 - 2012 CodeLutin, Chatellier Eric
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+package org.chorem.lima.entity;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import java.util.StringTokenizer;
+
+
+import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.nuiton.topia.TopiaException;
+
+public class AccountDAO extends AccountDAOAbstract<Account> {
+
+ private static final Log log = LogFactory.getLog(AccountDAO.class);
+
+ /**
+ * Retourne tous les comptes qui n'ont pas eux meme de sous compte.
+ */
+ public List<Account> findAllLeafAccounts() throws TopiaException {
+ String query = "FROM " + Account.class.getName() + " a WHERE a NOT IN (" +
+ "FROM " + Account.class.getName() + " b where b.accountNumber like concat(a.accountNumber,'%'))";
+ List<Account> accounts = context.find(query);
+ return accounts;
+ }
+
+ /**
+ * TODO pas compris l'interet de la methode, si on veut un compte feuille
+ * par son numero, cela revient a avoir un compte par son numero.
+ */
+ @Deprecated
+ public Account findLeafAccountByNumber(String number) throws TopiaException {
+ return findByAccountNumber(number);
+ }
+
+ /**
+ * Find account contained into account number interval.
+ *
+ * @param accountNumberLow min account number
+ * @param accountNumberHigh max account number
+ * @return account list
+ * @throws TopiaException
+ */
+ protected List<Account> findIntervalAccountByNumber(String accountNumberLow,
+ String accountNumberHigh) throws TopiaException {
+ String query = "FROM " + Account.class.getName() + " WHERE ? < accountNumber AND accountNumber > ?";
+ return (List<Account>) context.find(query, accountNumberLow, accountNumberHigh);
+ }
+
+ /**
+ * @deprecated since 0.6, business method, need to be moved out of dao
+ */
+ @Deprecated
+ public List<Account> stringToListAccounts(String selectedAccounts,
+ Boolean leafAccountsMode) throws TopiaException {
+ Set<Account> accounts = new HashSet<Account>();
+ if (selectedAccounts != null) {
+ //Remove Spaces
+ String result = StringUtils.deleteWhitespace(selectedAccounts);
+
+ Boolean first = true;
+ StringTokenizer stStar = new StringTokenizer(result, "-");
+ while (stStar.hasMoreTokens()) {
+ String subString = stStar.nextToken();
+
+ //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("\\.\\.");
+
+ 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 {
+ Account account = null;
+ if (leafAccountsMode) {
+ account = findLeafAccountByNumber(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.PROPERTY_SUB_ACCOUNTS);
+ query.addWhere("not exists elements (" + subAccountsProperty + ")")
+ .addWhere(Account.PROPERTY_ACCOUNT_NUMBER, Op.LIKE, s + "%");
+ List<Account> accountsResult = (List<Account>) findAllByQuery(query);*/
+
+ String query = "FROM " + Account.class.getName() + " a WHERE NOT IN (" +
+ "FROM " + Account.class.getName() + " b where b.accountNumber like a.accountNumber+'%')" +
+ " AND a.accountNumber LIKE ?";
+ List<Account> accountsResult = getContext().find(query, s);
+ if (accountsResult != null) {
+ //if first
+ if (first) {
+ accounts.addAll(accountsResult);
+ } else {
+ accounts.removeAll(accountsResult);
+ }
+ }
+ }
+ }
+ }
+ first = false;
+ }
+ }
+ return new ArrayList(accounts);
+ }
+
+ /*
+ * @see org.chorem.lima.entity.AccountDAOAbstract#getSubAccounts(org.chorem.lima.entity.Account)
+ */
+ public List<Account> getSubAccounts(Account account) throws TopiaException {
+
+ List<Account> accountsResult = null;
+
+ /*String query = "FROM " + Account.class.getName() + " a WHERE a.accountNumber LIKE :like" +
+ " ORDER BY a.accountNumber";
+
+
+ // FIXME echatellier 20120321 remove hard coded 8 here
+ // usefull for efficient tree loading but not beautiful code
+ String likeSuffix = "";
+ while (CollectionUtils.isEmpty(accountsResult) && likeSuffix.length() < 8) {
+ likeSuffix += "_";
+ if (account != null) {
+ accountsResult = getContext().find(query, "like", account.getAccountNumber() + likeSuffix);
+ } else {
+ accountsResult = getContext().find(query, "like", likeSuffix);
+ }
+ }*/
+
+ // on recherche les sous comptes de account
+ // qui ne sont pas eux meme des sous comptes intermediaire
+ // autrement dir, les fils directs
+ /*String query = "FROM " + Account.class.getName() + " a" +
+ " WHERE a.accountNumber LIKE :like" +
+ " AND a not in (FROM " + Account.class.getName() + " b" +
+ " WHERE b.accountNumber like concat(a.accountNumber,'%'))" +
+ " ORDER BY a.accountNumber";
+
+ if (account != null) {
+ accountsResult = getContext().find(query, "like", account.getAccountNumber() + "%");
+ } else {
+ accountsResult = getContext().find(query, "like", "%");
+ }*/
+
+ return accountsResult;
+ }
+}
Deleted: trunk/lima-callao/src/main/java/org/chorem/lima/entity/AccountDAOImpl.java
===================================================================
--- trunk/lima-callao/src/main/java/org/chorem/lima/entity/AccountDAOImpl.java 2012-04-04 09:03:41 UTC (rev 3350)
+++ trunk/lima-callao/src/main/java/org/chorem/lima/entity/AccountDAOImpl.java 2012-04-04 13:25:23 UTC (rev 3351)
@@ -1,148 +0,0 @@
-/*
- * #%L
- * Lima callao
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2008 - 2010 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-package org.chorem.lima.entity;
-
-import org.apache.commons.lang3.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;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.StringTokenizer;
-
-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
- */
- @Override
- public List<Account> findAllSubAccounts() throws TopiaException {
- TopiaQuery query = createQuery();
- String subAccountsProperty = TopiaQuery.getProperty(Account.PROPERTY_SUB_ACCOUNTS);
- query.addWhere("not exists elements (" + subAccountsProperty + ")")
- .addOrder(Account.PROPERTY_ACCOUNT_NUMBER);
- return (List<Account>) findAllByQuery(query);
- }
-
- @Override
- public Account findSubAccountByNumber(String number) throws TopiaException {
- TopiaQuery query = createQuery();
- String subAccountsProperty = TopiaQuery.getProperty(Account.PROPERTY_SUB_ACCOUNTS);
- String subLedgersProperty = TopiaQuery.getProperty(Account.PROPERTY_SUB_LEDGERS);
- query.addWhere("not exists elements (" + subAccountsProperty + ")")
- .addWhere("not exists elements (" + subLedgersProperty + ")")
- .addEquals(Account.PROPERTY_ACCOUNT_NUMBER, number);
- return findByQuery(query);
- }
-
- public List<Account> findIntervalAccountByNumber(String accountNumberLow,
- String accountNumberHigh) throws TopiaException {
- TopiaQuery query = createQuery();
- query.addBetween(Account.PROPERTY_ACCOUNT_NUMBER,
- accountNumberLow, accountNumberHigh);
- return (List<Account>) findAllByQuery(query);
- }
-
- @Override
- public List<Account> stringToListAccounts(String selectedAccounts,
- Boolean subAccountsMode) throws TopiaException {
- HashSet<Account> accounts = new HashSet<Account>();
- if (selectedAccounts != null) {
- //Remove Spaces
- String result = StringUtils.deleteWhitespace(selectedAccounts);
-
- Boolean first = true;
- StringTokenizer stStar = new StringTokenizer(result, "-");
- while (stStar.hasMoreTokens()) {
- String subString = stStar.nextToken();
-
- //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("\\.\\.");
-
- 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 {
- 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.PROPERTY_SUB_ACCOUNTS);
- query.addWhere("not exists elements (" + subAccountsProperty + ")")
- .addWhere(Account.PROPERTY_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;
- }
- }
- return new ArrayList(accounts);
- }
-}
Copied: trunk/lima-callao/src/main/java/org/chorem/lima/entity/ClosedPeriodicEntryBookDAO.java (from rev 3322, trunk/lima-callao/src/main/java/org/chorem/lima/entity/ClosedPeriodicEntryBookDAOImpl.java)
===================================================================
--- trunk/lima-callao/src/main/java/org/chorem/lima/entity/ClosedPeriodicEntryBookDAO.java (rev 0)
+++ trunk/lima-callao/src/main/java/org/chorem/lima/entity/ClosedPeriodicEntryBookDAO.java 2012-04-04 13:25:23 UTC (rev 3351)
@@ -0,0 +1,71 @@
+/*
+ * #%L
+ * Lima callao
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2008 - 2010 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+package org.chorem.lima.entity;
+
+import java.util.Date;
+import java.util.List;
+
+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 ClosedPeriodicEntryBookDAO extends ClosedPeriodicEntryBookDAOImpl<ClosedPeriodicEntryBook> {
+
+ private static final Log log = LogFactory.getLog(ClosedPeriodicEntryBookDAO.class);
+
+
+ /** Return ClosedPeriodicEntryBook by EntryBook and FinancialPeriod */
+ public ClosedPeriodicEntryBook findByEntryBookAndFinancialPeriod(
+ EntryBook entryBook, FinancialPeriod financialPeriod)
+ throws TopiaException {
+
+ TopiaQuery query = createQuery();
+ if (entryBook != null) {
+ query.addEquals(ClosedPeriodicEntryBook.PROPERTY_ENTRY_BOOK, entryBook);
+ }
+ if (financialPeriod != null) {
+ query.addEquals(ClosedPeriodicEntryBook.PROPERTY_FINANCIAL_PERIOD, financialPeriod);
+ }
+ return findByQuery(query);
+ }
+
+ public List<ClosedPeriodicEntryBook> findAllByDates(Date beginDate,
+ Date endDate) throws TopiaException {
+ TopiaQuery query = createQuery();
+ if (beginDate != null && endDate != null) {
+ String beginDateProperty = TopiaQuery.getProperty(ClosedPeriodicEntryBook.PROPERTY_FINANCIAL_PERIOD, FinancialPeriod.PROPERTY_BEGIN_DATE);
+ String endDateProperty = TopiaQuery.getProperty(ClosedPeriodicEntryBook.PROPERTY_FINANCIAL_PERIOD, FinancialPeriod.PROPERTY_BEGIN_DATE);
+ String entrybookProperty = TopiaQuery.getProperty(ClosedPeriodicEntryBook.PROPERTY_ENTRY_BOOK, EntryBook.PROPERTY_CODE);
+ query.addWhere(beginDateProperty, Op.GE, beginDate)
+ .addWhere(endDateProperty, Op.LE, endDate)
+ .addOrder(beginDateProperty, entrybookProperty);
+ }
+ return (List<ClosedPeriodicEntryBook>) findAllByQuery(query);
+ }
+
+}
Deleted: trunk/lima-callao/src/main/java/org/chorem/lima/entity/ClosedPeriodicEntryBookDAOImpl.java
===================================================================
--- trunk/lima-callao/src/main/java/org/chorem/lima/entity/ClosedPeriodicEntryBookDAOImpl.java 2012-04-04 09:03:41 UTC (rev 3350)
+++ trunk/lima-callao/src/main/java/org/chorem/lima/entity/ClosedPeriodicEntryBookDAOImpl.java 2012-04-04 13:25:23 UTC (rev 3351)
@@ -1,73 +0,0 @@
-/*
- * #%L
- * Lima callao
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2008 - 2010 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-package org.chorem.lima.entity;
-
-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;
-
-import java.util.Date;
-import java.util.List;
-
-public class ClosedPeriodicEntryBookDAOImpl<E extends ClosedPeriodicEntryBook> extends ClosedPeriodicEntryBookDAOAbstract<E> {
-
- private static final Log log = LogFactory.getLog(ClosedPeriodicEntryBookDAOImpl.class);
-
-
- /** Return ClosedPeriodicEntryBook by EntryBook and FinancialPeriod */
- @Override
- public ClosedPeriodicEntryBook findByEntryBookAndFinancialPeriod(
- EntryBook entryBook, FinancialPeriod financialPeriod)
- throws TopiaException {
-
- TopiaQuery query = createQuery();
- if (entryBook != null) {
- query.addEquals(ClosedPeriodicEntryBook.PROPERTY_ENTRY_BOOK, entryBook);
- }
- if (financialPeriod != null) {
- query.addEquals(ClosedPeriodicEntryBook.PROPERTY_FINANCIAL_PERIOD, financialPeriod);
- }
- return findByQuery(query);
- }
-
- @Override
- public List<ClosedPeriodicEntryBook> findAllByDates(Date beginDate,
- Date endDate) throws TopiaException {
- TopiaQuery query = createQuery();
- if (beginDate != null && endDate != null) {
- String beginDateProperty = TopiaQuery.getProperty(ClosedPeriodicEntryBook.PROPERTY_FINANCIAL_PERIOD, FinancialPeriod.PROPERTY_BEGIN_DATE);
- String endDateProperty = TopiaQuery.getProperty(ClosedPeriodicEntryBook.PROPERTY_FINANCIAL_PERIOD, FinancialPeriod.PROPERTY_BEGIN_DATE);
- String entrybookProperty = TopiaQuery.getProperty(ClosedPeriodicEntryBook.PROPERTY_ENTRY_BOOK, EntryBook.PROPERTY_CODE);
- query.addWhere(beginDateProperty, Op.GE, beginDate)
- .addWhere(endDateProperty, Op.LE, endDate)
- .addOrder(beginDateProperty, entrybookProperty);
- }
- return (List<ClosedPeriodicEntryBook>) findAllByQuery(query);
- }
-
-}
Copied: trunk/lima-callao/src/main/java/org/chorem/lima/entity/FinancialPeriodDAO.java (from rev 3322, trunk/lima-callao/src/main/java/org/chorem/lima/entity/FinancialPeriodDAOImpl.java)
===================================================================
--- trunk/lima-callao/src/main/java/org/chorem/lima/entity/FinancialPeriodDAO.java (rev 0)
+++ trunk/lima-callao/src/main/java/org/chorem/lima/entity/FinancialPeriodDAO.java 2012-04-04 13:25:23 UTC (rev 3351)
@@ -0,0 +1,50 @@
+/*
+ * #%L
+ * Lima callao
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2008 - 2010 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+package org.chorem.lima.entity;
+
+import org.nuiton.topia.TopiaException;
+import org.nuiton.topia.framework.TopiaQuery;
+
+import java.util.Date;
+
+public class FinancialPeriodDAO extends FinancialPeriodDAOImpl<FinancialPeriod> {
+
+ /**
+ * Return FinancialPeriod by Date
+ * Date is include between financialperiod begin and end date
+ */
+ public FinancialPeriod findByDate(Date date) throws TopiaException {
+
+ TopiaQuery query = createQuery();
+ if (date != null) {
+ query.addWhere(FinancialPeriod.PROPERTY_BEGIN_DATE + " <= :value")
+ .addWhere(FinancialPeriod.PROPERTY_END_DATE + " >= :value")
+ .addParam("value", date);
+ }
+ return findByQuery(query);
+ }
+
+}
Deleted: trunk/lima-callao/src/main/java/org/chorem/lima/entity/FinancialPeriodDAOImpl.java
===================================================================
--- trunk/lima-callao/src/main/java/org/chorem/lima/entity/FinancialPeriodDAOImpl.java 2012-04-04 09:03:41 UTC (rev 3350)
+++ trunk/lima-callao/src/main/java/org/chorem/lima/entity/FinancialPeriodDAOImpl.java 2012-04-04 13:25:23 UTC (rev 3351)
@@ -1,51 +0,0 @@
-/*
- * #%L
- * Lima callao
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2008 - 2010 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-package org.chorem.lima.entity;
-
-import org.nuiton.topia.TopiaException;
-import org.nuiton.topia.framework.TopiaQuery;
-
-import java.util.Date;
-
-public class FinancialPeriodDAOImpl<E extends FinancialPeriod> extends FinancialPeriodDAOAbstract<E> {
-
- /**
- * Return FinancialPeriod by Date
- * Date is include between financialperiod begin and end date
- */
- @Override
- public FinancialPeriod findByDate(Date date) throws TopiaException {
-
- TopiaQuery query = createQuery();
- if (date != null) {
- query.addWhere(FinancialPeriod.PROPERTY_BEGIN_DATE + " <= :value")
- .addWhere(FinancialPeriod.PROPERTY_END_DATE + " >= :value")
- .addParam("value", date);
- }
- return findByQuery(query);
- }
-
-}
Deleted: trunk/lima-callao/src/main/java/org/chorem/lima/entity/FinancialStatementImpl.java
===================================================================
--- trunk/lima-callao/src/main/java/org/chorem/lima/entity/FinancialStatementImpl.java 2012-04-04 09:03:41 UTC (rev 3350)
+++ trunk/lima-callao/src/main/java/org/chorem/lima/entity/FinancialStatementImpl.java 2012-04-04 13:25:23 UTC (rev 3351)
@@ -1,45 +0,0 @@
-/*
- * #%L
- * Lima callao
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2008 - 2010 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-package org.chorem.lima.entity;
-
-public class FinancialStatementImpl extends FinancialStatementAbstract {
-
- private static final long serialVersionUID = 1L;
-
- protected Integer level;
-
- @Override
- public int getLevel() {
- if (level == null) {
- if (masterFinancialStatement != null) {
- level = masterFinancialStatement.getLevel() + 1;
- } else {
- level = 1;
- }
- }
- return level;
- }
-}
Copied: trunk/lima-callao/src/main/java/org/chorem/lima/entity/FinancialStatementImpl.java (from rev 3322, trunk/lima-callao/src/main/java/org/chorem/lima/entity/FinancialStatementImpl.java)
===================================================================
--- trunk/lima-callao/src/main/java/org/chorem/lima/entity/FinancialStatementImpl.java (rev 0)
+++ trunk/lima-callao/src/main/java/org/chorem/lima/entity/FinancialStatementImpl.java 2012-04-04 13:25:23 UTC (rev 3351)
@@ -0,0 +1,45 @@
+/*
+ * #%L
+ * Lima callao
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2008 - 2010 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+package org.chorem.lima.entity;
+
+public class FinancialStatementImpl extends FinancialStatementAbstract {
+
+ private static final long serialVersionUID = 1L;
+
+ protected Integer level;
+
+ @Override
+ public int getLevel() {
+ if (level == null) {
+ if (masterFinancialStatement != null) {
+ level = masterFinancialStatement.getLevel() + 1;
+ } else {
+ level = 1;
+ }
+ }
+ return level;
+ }
+}
Modified: trunk/lima-callao/src/main/xmi/accounting.properties
===================================================================
--- trunk/lima-callao/src/main/xmi/accounting.properties 2012-04-04 09:03:41 UTC (rev 3350)
+++ trunk/lima-callao/src/main/xmi/accounting.properties 2012-04-04 13:25:23 UTC (rev 3351)
@@ -27,6 +27,7 @@
model.tagvalue.version=0.6
model.tagvalue.constantPrefix=PROPERTY_
model.tagValue.notGenerateToString=true
+model.tagvalue.String=text
# natural id
org.chorem.lima.entity.Account.class.tagvalue.naturalIdMutable=false
@@ -46,14 +47,8 @@
org.chorem.lima.entity.FiscalPeriod.attribute.endDate.tagvalue.notNull=true
# 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.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
org.chorem.lima.entity.VatStatement.attribute.subVatStatements.tagvalue.lazy=false
org.chorem.lima.entity.VatStatement.attribute.masterVatStatement.tagvalue.lazy=false
-
-
-#model.tagvalue.dbSchema=Callao
-model.tagvalue.String=text
\ No newline at end of file
Modified: trunk/lima-callao/src/main/xmi/accounting.zargo
===================================================================
(Binary files differ)
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/LimaMain.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/LimaMain.java 2012-04-04 09:03:41 UTC (rev 3350)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/LimaMain.java 2012-04-04 13:25:23 UTC (rev 3351)
@@ -161,10 +161,10 @@
AccountService accountService =
LimaServiceFactory.getService(AccountServiceMonitorable.class);
- List<Account> accounts = accountService.getChildrenAccounts(null);
- if (accounts.isEmpty()) {
+ long accountCount = accountService.getAccountCount();
+ if (accountCount == 0) {
if (log.isInfoEnabled()) {
- log.info("Propose for defaut account loading");
+ log.info("Propose for default account loading");
}
OpeningView openingView = new OpeningView();
openingView.setSize(800, 400);
Deleted: trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountTreeTableModel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountTreeTableModel.java 2012-04-04 09:03:41 UTC (rev 3350)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountTreeTableModel.java 2012-04-04 13:25:23 UTC (rev 3351)
@@ -1,374 +0,0 @@
-/*
- * #%L
- * Lima Swing
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2008 - 2012 CodeLutin, Chatellier Eric
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-package org.chorem.lima.ui.account;
-
-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.ejbinterface.AccountService;
-import org.chorem.lima.business.monitorable.AccountServiceMonitorable;
-import org.chorem.lima.entity.Account;
-import org.chorem.lima.service.LimaServiceFactory;
-import org.chorem.lima.util.ErrorHelper;
-import org.jdesktop.swingx.treetable.DefaultMutableTreeTableNode;
-import org.jdesktop.swingx.treetable.DefaultTreeTableModel;
-import org.jdesktop.swingx.treetable.MutableTreeTableNode;
-import org.jdesktop.swingx.treetable.TreeTableNode;
-
-import javax.swing.tree.TreePath;
-import java.util.Arrays;
-import java.util.Enumeration;
-import java.util.List;
-
-import static org.nuiton.i18n.I18n._;
-
-/**
- * Tree table model for account edition.
- *
- * @author ore
- * @author chatellier
- * @version $Revision$
- * <p/>
- * Last update : $Date$
- * By : $Author$
- */
-public class AccountTreeTableModel extends DefaultTreeTableModel {
-
- /** log. */
- private static final Log log = LogFactory.getLog(AccountViewHandler.class);
-
- /** Account service. */
- protected final AccountService accountService;
-
- public class AccountTreeTableNode extends DefaultMutableTreeTableNode {
-
- protected boolean loaded;
-
- AccountTreeTableNode(Account userObject) {
- super(userObject);
- }
-
- @Override
- public Account getUserObject() {
- return (Account) super.getUserObject();
- }
-
- @Override
- public int getChildCount() {
- loadChildrenIfRequired();
- return super.getChildCount();
- }
-
- private void loadChildrenIfRequired() {
- if (!loaded) {
- loaded = true;
- loadChilds(getUserObject());
- }
- }
-
- @Override
- public void setParent(MutableTreeTableNode newParent) {
- parent = newParent;
- }
-
- private void loadChilds(Account account) {
- try {
- if (log.isInfoEnabled()) {
- log.info("Loading childs for account " + (account == null ? "Root node" : account.getAccountNumber()));
- }
- List<Account> childs =
- accountService.getChildrenAccounts(account);
- for (Account child : childs) {
- add(new AccountTreeTableNode(child));
- }
- } catch (LimaException e) {
- ErrorHelper.showErrorDialog(
- "Could not load child of account " + account, e);
- } finally {
- loaded = true;
- }
- }
-
- @Override
- public Enumeration<? extends MutableTreeTableNode> children() {
- loadChildrenIfRequired();
- return super.children();
- }
-
- @Override
- public TreeTableNode getChildAt(int childIndex) {
- loadChildrenIfRequired();
- return super.getChildAt(childIndex);
- }
-
- @Override
- public boolean isEditable(int column) {
- return false;
- }
-
- @Override
- public Object getValueAt(int column) {
- Account account = getUserObject();
-
- Object result = null;
- if (account != null) {
- switch (column) {
- case 0:
- result = account.getAccountNumber();
- break;
- case 1:
- result = account.getLabel();
- break;
- }
- }
- return result;
- }
-
- @Override
- public int getColumnCount() {
- return 2;
- }
- }
-
- /** Model constructor. Init account service used here. */
- public AccountTreeTableModel() {
-
- setColumnIdentifiers(Arrays.asList(_("lima.table.number"),
- _("lima.table.label")));
-
- setRoot(new AccountTreeTableNode(null));
-
- // Gets factory service
- accountService =
- LimaServiceFactory.getService(AccountServiceMonitorable.class);
- }
-
-// @Override
-// public int getColumnCount() {
-// return 2;
-// }
-
-// @Override
-// public String getColumnName(int column) {
-// String res = null;
-// switch (column) {
-// case 0:
-// res = _("lima.table.number");
-// break;
-// case 1:
-// res = _("lima.table.label");
-// break;
-// }
-// return res;
-// }
-
-// @Override
-// public int getChildCount(Object node) {
-// int result = 0;
-// if (node == getRoot()) {
-// try {
-// result = accountService.getChildrenAccounts(null).size();
-// } catch (LimaException eee) {
-// log.debug("Can't count child", eee);
-// }
-// } else {
-// Account parentAccount = (Account) node;
-// try {
-// result = accountService.getChildrenAccounts(parentAccount).size();
-// } catch (LimaException eee) {
-// log.debug("Can't count child", eee);
-// }
-// }
-// return result;
-// }
-
-// @Override
-// public Object getChild(Object parent, int index) {
-// Object result = null;
-// if (parent == getRoot()) {
-// try {
-// List<Account> allAccounts =
-// accountService.getChildrenAccounts(null);
-// result = allAccounts.get(index);
-// } catch (LimaException eee) {
-// log.debug("Can't get child", eee);
-// }
-// } else {
-// Account parentAccount = (Account) parent;
-//
-// // FIXME sub account is a collection ?
-// try {
-// List<Account> subaccounts =
-// accountService.getChildrenAccounts(parentAccount);
-// result = subaccounts.get(index);
-// } catch (LimaException eee) {
-// log.debug("Can't get child", eee);
-// }
-// }
-// return result;
-// }
-
-// @Override
-// public int getIndexOfChild(Object parent, Object child) {
-// int result = 0;
-// Account parentAccount = (Account) parent;
-// Account childAccount = (Account) child;
-//
-// if (parent == getRoot()) {
-// try {
-// List<Account> allAccounts =
-// accountService.getChildrenAccounts(null);
-// result = allAccounts.indexOf(child);
-// } catch (LimaException eee) {
-// log.debug("Can't get index child", eee);
-// }
-// } else {
-// // FIXME sub account is a collection ?
-// try {
-// List<Account> subaccounts =
-// accountService.getChildrenAccounts(parentAccount);
-// result = subaccounts.indexOf(childAccount);
-// } catch (LimaException eee) {
-// log.debug("Can't get index child", eee);
-// }
-// }
-// return result;
-// }
-
-// @Override
-// public Object getValueAt(Object node, int column) {
-// Object result = "n/a";
-// if (node instanceof Account) {
-// Account account = (Account) node;
-// switch (column) {
-// case 0:
-// result = account.getAccountNumber();
-// break;
-// case 1:
-// result = account.getLabel();
-// break;
-// }
-// }
-// return result;
-// }
-
-// @Override
-// public boolean isCellEditable(Object node, int column) {
-// return false;
-// }
-
-// @Override
-// public boolean isLeaf(Object node) {
-// return getChildCount(node) == 0;
-// }
-
- /**
- * Add account
- *
- * @param parentAccount
- * @param account
- * @throws LimaException
- */
- public void addAccount(Account parentAccount,
- Account account) throws LimaException {
- accountService.createAccount(parentAccount, account);
- //FIXME 2011.08.09 vsalaun quick tree refresh, it should refresh only the path changed
- //modelSupport.fireTreeStructureChanged(path);
- modelSupport.fireNewRoot();
- }
-
- /**
- * Add account
- *
- * @param parentAccount
- * @param account
- * @throws LimaException
- */
- public void addSubLedger(Account parentAccount,
- Account account) throws LimaException {
- accountService.createSubLedger(parentAccount, account);
- //FIXME 2011.08.09 vsalaun quick tree refresh, it should refresh only the path changed
- //modelSupport.fireTreeStructureChanged(path);
- modelSupport.fireNewRoot();
- }
-
- /**
- * Update account.
- *
- * @param account
- * @throws LimaException
- */
- public void updateAccount(Account account) throws LimaException {
- // Calling account service
- //FIXME Force fire for no update if error. Where is the cache ?
- try {
- accountService.updateAccount(account);
- } catch (LimaException eee) {
- //modelSupport.fireTreeStructureChanged(path);
- throw new LimaBusinessException("Can't update account : "
- + account.getAccountNumber(), eee);
- }
- //FIXME 2011.08.10 vsalaun quick tree refresh, it should only refresh the path where
- //the account were, and the path where it has been moved
- //modelSupport.fireTreeStructureChanged(path);
- modelSupport.fireNewRoot();
- }
-
- /** Refresh accountschart. */
- public void refreshTree() {
-
- modelSupport.fireNewRoot();
- }
-
- /**
- * Remove account.
- *
- * @param path
- * @throws LimaException
- */
- public void removeAccount(TreePath path) throws LimaException {
-
- // Calling account service
- AccountTreeTableNode node = getLastPathComponent(path);
- Account account = node.getUserObject();
- int index = getIndexOfChild(
- path.getParentPath().getLastPathComponent(), node);
- accountService.removeAccount(account);
- modelSupport.fireChildRemoved(path.getParentPath(), index, node);
- }
-
- public Account getAccount(TreePath path) {
- AccountTreeTableNode lastPathComponent = getLastPathComponent(path);
- Account account = lastPathComponent.getUserObject();
- return account;
- }
-
- public AccountTreeTableNode getLastPathComponent(TreePath path) {
- AccountTreeTableNode lastPathComponent = (AccountTreeTableNode) path.getLastPathComponent();
- return lastPathComponent;
- }
-}
Added: trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountTreeTableRenderer.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountTreeTableRenderer.java (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountTreeTableRenderer.java 2012-04-04 13:25:23 UTC (rev 3351)
@@ -0,0 +1,65 @@
+/*
+ * #%L
+ *
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2012 Codelutin, Chatellier Eric
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
+package org.chorem.lima.ui.account;
+
+import java.awt.Component;
+
+import javax.swing.JTree;
+
+import org.chorem.lima.entity.Account;
+import org.jdesktop.swingx.renderer.DefaultTreeRenderer;
+import org.jdesktop.swingx.treetable.MutableTreeTableNode;
+
+/**
+ * Account renderer in account tree.
+ *
+ * @author chatellier
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author$
+ */
+public class AccountTreeTableRenderer extends DefaultTreeRenderer {
+
+ /** serialVersionUID. */
+ private static final long serialVersionUID = -3249368726501873583L;
+
+ @Override
+ public Component getTreeCellRendererComponent(JTree tree, Object value,
+ boolean selected, boolean expanded, boolean leaf, int row,
+ boolean hasFocus) {
+
+ MutableTreeTableNode node = (MutableTreeTableNode)value;
+ Account account = (Account)node.getUserObject();
+ Object localValue = value;
+ if (account != null) {
+ localValue = account.getAccountNumber();
+ }
+ return super.getTreeCellRendererComponent(tree, localValue, selected, expanded,
+ leaf, row, hasFocus);
+ }
+
+}
Property changes on: trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountTreeTableRenderer.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountView.jaxx 2012-04-04 09:03:41 UTC (rev 3350)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountView.jaxx 2012-04-04 13:25:23 UTC (rev 3351)
@@ -5,7 +5,7 @@
$Id$
$HeadURL$
%%
- Copyright (C) 2008 - 2010 CodeLutin
+ Copyright (C) 2008 - 2012 CodeLutin, Chatellier Eric
%%
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as
@@ -34,20 +34,18 @@
<Boolean id="selectedRow" javaBean="false"/>
- <script>
- <![CDATA[
+ <script><![CDATA[
void $afterCompleteSetup() {
handler.init();
}
- ]]>
- </script>
+ ]]></script>
<row>
<cell fill="both" weightx="1" weighty="1" rows='5'>
<JScrollPane>
<JXTreeTable id="accountsTreeTable"
selectionMode="{ListSelectionModel.SINGLE_SELECTION}"
- treeTableModel="{new AccountTreeTableModel()}"
+ treeCellRenderer="{new AccountTreeTableRenderer()}"
highlighters="{HighlighterFactory.createSimpleStriping(new java.awt.Color(222,222,222))}"/>
<ListSelectionModel initializer='accountsTreeTable.getSelectionModel()'
onValueChanged="setSelectedRow(accountsTreeTable.getSelectedRow() != -1)"/>
@@ -61,7 +59,7 @@
<row>
<cell fill="horizontal">
<JButton id="addSubLedger" text="lima.charts.account.addSubLedger"
- onActionPerformed="handler.launchAddSubLedgerForm()"/>
+ onActionPerformed="/*handler.launchAddSubLedgerForm()*/"/>
</cell>
</row>
<row>
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountViewHandler.java 2012-04-04 09:03:41 UTC (rev 3350)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountViewHandler.java 2012-04-04 13:25:23 UTC (rev 3351)
@@ -25,10 +25,28 @@
package org.chorem.lima.ui.account;
-import org.apache.commons.lang3.ObjectUtils;
+import static org.nuiton.i18n.I18n._;
+
+import java.awt.event.KeyAdapter;
+import java.awt.event.KeyEvent;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.SortedMap;
+import java.util.TreeMap;
+
+import javax.swing.JOptionPane;
+import javax.swing.tree.TreePath;
+
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.business.LimaException;
+import org.chorem.lima.business.LimaRuntimeException;
import org.chorem.lima.business.ServiceListener;
import org.chorem.lima.business.ejbinterface.AccountService;
import org.chorem.lima.business.monitorable.AccountServiceMonitorable;
@@ -39,19 +57,12 @@
import org.chorem.lima.enums.ImportExportEnum;
import org.chorem.lima.service.LimaServiceFactory;
import org.chorem.lima.ui.importexport.ImportExport;
-import org.chorem.lima.util.DialogHelper;
import org.chorem.lima.util.ErrorHelper;
import org.jdesktop.swingx.JXTreeTable;
+import org.jdesktop.swingx.treetable.DefaultMutableTreeTableNode;
+import org.jdesktop.swingx.treetable.DefaultTreeTableModel;
+import org.jdesktop.swingx.treetable.TreeTableNode;
-import javax.swing.JOptionPane;
-import javax.swing.tree.TreePath;
-import java.awt.event.KeyAdapter;
-import java.awt.event.KeyEvent;
-import java.awt.event.MouseAdapter;
-import java.awt.event.MouseEvent;
-
-import static org.nuiton.i18n.I18n._;
-
/**
* Handler associated with account view.
*
@@ -66,20 +77,43 @@
/** log. */
private static final Log log = LogFactory.getLog(AccountViewHandler.class);
- protected final AccountView view;
-
protected AccountService accountService;
- protected AccountViewHandler(AccountView view) {
+ protected AccountView view;
+
+ /**
+ * Sort account with label length.
+ */
+ protected static Comparator<Account> accountLengthComparator = new Comparator<Account>() {
+ @Override
+ public int compare(Account o1, Account o2) {
+ int result = o1.getAccountNumber().length() - o2.getAccountNumber().length();
+ if (result == 0) {
+ result = -1;
+ }
+ return result;
+ }
+ };
+ protected static Comparator<String> reverseAccountLengthComparator = new Comparator<String>() {
+ @Override
+ public int compare(String o1, String o2) {
+ int result = o2.length() - o1.length();
+ if (result == 0) {
+ result = -1;
+ }
+ return result;
+ }
+ };
+
+ public AccountViewHandler(AccountView view) {
this.view = view;
// Gets factory service
LimaServiceFactory.addServiceListener(ImportServiceMonitorable.class, this);
- accountService =
- LimaServiceFactory.getService(AccountServiceMonitorable.class);
+ accountService = LimaServiceFactory.getService(AccountServiceMonitorable.class);
}
public void init() {
- JXTreeTable table = getTreeTable();
+ JXTreeTable table = view.getAccountsTreeTable();
table.addKeyListener(new KeyAdapter() {
/**
* for each action combination key are think
@@ -105,10 +139,52 @@
}
}
});
+
+ loadAllAccounts();
}
+ /**
+ * Load all accounts from service and display it into tree table.
+ */
+ protected void loadAllAccounts() {
+ try {
+ // default data load
+ List<Account> accounts = accountService.getAllAccounts();
+ Collections.sort(accounts, accountLengthComparator);
+
+ // render in tree node hierarchy for DefaultTreeTableModel
+ SortedMap<String, DefaultMutableTreeTableNode> nodeCache = new TreeMap<String, DefaultMutableTreeTableNode>(reverseAccountLengthComparator);
+ DefaultMutableTreeTableNode root = new DefaultMutableTreeTableNode(null);
+ for (Account account : accounts) {
+ // find parent
+ DefaultMutableTreeTableNode parentNode = root;
+ Iterator<Map.Entry<String, DefaultMutableTreeTableNode>> itNodes = nodeCache.entrySet().iterator();
+ while (itNodes.hasNext()) {
+ Map.Entry<String, DefaultMutableTreeTableNode> entry = itNodes.next();
+ String accountNumber = entry.getKey();
+ if (account.getAccountNumber().startsWith(accountNumber)) {
+ parentNode = entry.getValue();
+ break;
+ }
+ }
+
+ // make current node
+ DefaultMutableTreeTableNode node = new DefaultMutableTreeTableNode(account);
+ parentNode.add(node);
+
+ nodeCache.put(account.getAccountNumber(), node);
+ }
+ DefaultTreeTableModel model = new DefaultTreeTableModel(root);
+ model.setColumnIdentifiers(Arrays.asList(_("lima.table.number"),
+ _("lima.table.label")));
+ JXTreeTable table = view.getAccountsTreeTable();
+ table.setTreeTableModel(model);
+ } catch (LimaException ex) {
+ throw new LimaRuntimeException("Can't load accounts from service");
+ }
+ }
+
public void launchAddAccountForm() {
-
Account newAccount = new AccountImpl();
AccountForm accountForm = new AccountForm(view);
accountForm.setAccount(newAccount);
@@ -117,40 +193,18 @@
accountForm.setVisible(true);
}
- public void launchAddSubLedgerForm() {
-
- Account newAccount = new AccountImpl();
- SubLedgerForm subledgerForm = new SubLedgerForm(view);
- subledgerForm.setAccount(newAccount);
- // jaxx constructor don't call super() ?
- subledgerForm.setLocationRelativeTo(view);
- subledgerForm.setVisible(true);
- }
-
/**
* Open update account (or subledger) form with selected account
* from the tree.
*/
public void launchUpdateAccountForm() {
-
Account selectedObject = getSelectedAccount();
- if (selectedObject != null) {
-
- if (selectedObject.getGeneralLedger() == null) {
- UpdateAccountForm accountForm = new UpdateAccountForm(view);
- accountForm.setAccount(selectedObject);
- // jaxx constructor don't call super() ?
- accountForm.setLocationRelativeTo(view);
- accountForm.setVisible(true);
- } else {
- UpdateSubLedgerForm subLedgerForm = new UpdateSubLedgerForm(view);
- subLedgerForm.setAccount(selectedObject);
- // jaxx constructor don't call super() ?
- subLedgerForm.setLocationRelativeTo(view);
- subLedgerForm.setVisible(true);
- }
- }
+ UpdateAccountForm accountForm = new UpdateAccountForm(view);
+ accountForm.setAccount(selectedObject);
+ // jaxx constructor don't call super() ?
+ accountForm.setLocationRelativeTo(view);
+ accountForm.setVisible(true);
}
/**
@@ -177,20 +231,20 @@
}
// add it
- try {
+ /*try {
getTreeTableModel().addAccount(masterAccount, newAccount);
} catch (LimaException ex) {
if (log.isErrorEnabled()) {
log.error("Can't add account", ex);
}
ErrorHelper.showErrorDialog(view, _("lima.account.addaccounterror"), ex);
- }
+ }*/
} finally {
dialog.dispose();
}
}
- public void doAddSubLedger(SubLedgerForm dialog) {
+ /*public void doAddSubLedger(SubLedgerForm dialog) {
try {
Account newAccount = dialog.getAccount();
@@ -221,26 +275,26 @@
} finally {
dialog.dispose();
}
- }
+ }*/
public void doUpdateAccount(UpdateAccountForm dialog) {
Account account = dialog.getAccount();
- String newMasterAccountNumber =
+ /*String newMasterAccountNumber =
dialog.getMasterAccountTextField().getText();
String newLabel = dialog.getDescriptionTextField().getText();
boolean hasChanged =
updateMasterAccount(account, newMasterAccountNumber);
- hasChanged |= updateLabel(account, newLabel);
+ hasChanged |= updateLabel(account, newLabel);*/
try {
- if (hasChanged) {
+ //if (hasChanged) {
// can update account
updateAccount(account);
- }
+ //}
} finally {
@@ -253,7 +307,7 @@
Account account = dialog.getAccount();
- String newMasterAccountNumber =
+ /*String newMasterAccountNumber =
dialog.getMasterAccountTextField().getText();
String newLabel = dialog.getDescriptionTextField().getText();
String newThirdParty = dialog.getThirdPartyTextField().getText();
@@ -261,15 +315,12 @@
boolean hasChanged = updateMasterAccount(account,
newMasterAccountNumber);
hasChanged |= updateLabel(account, newLabel);
- hasChanged |= updateThirdParty(account, newThirdParty);
+ hasChanged |= updateThirdParty(account, newThirdParty);*/
try {
- if (hasChanged) {
+ // can update subLedger
+ updateAccount(account);
- // can update subLedger
- updateAccount(account);
- }
-
} finally {
// close dialog
@@ -281,7 +332,7 @@
public void doRemoveAccount() {
// maybe this code can be factorised
- JXTreeTable treeTable = getTreeTable();
+ JXTreeTable treeTable = view.getAccountsTreeTable();
// Any row selected
int selectedRow = treeTable.getSelectedRow();
@@ -296,14 +347,14 @@
TreePath treePath =
treeTable.getPathForRow(selectedRow);
- try {
+ /*try {
getTreeTableModel().removeAccount(treePath);
} catch (LimaException eee) {
if (log.isErrorEnabled()) {
log.error("Can't delete account", eee);
}
DialogHelper.showErrorMessageDialog(view, eee);
- }
+ }*/
}
}
}
@@ -345,14 +396,14 @@
methodeName.contains("importAsCSV")) {
// refresh model
- getTreeTableModel().refreshTree();
+ //getTreeTableModel().refreshTree();
//FIXME tchemit-2011-09-23 Should never do this... refresh view
view.repaint();
}
}
- protected boolean updateMasterAccount(Account account,
+ /*protected boolean updateMasterAccount(Account account,
String newMasterAccountNumber) {
boolean hasChanged = false;
String oldMasterAccountNumber = account.getMasterAccount() == null ?
@@ -405,29 +456,19 @@
}
return hasChanged;
- }
+ }*/
protected void updateAccount(Account selectedObject) {
- try {
+ /*try {
getTreeTableModel().updateAccount(selectedObject);
} catch (LimaException eee) {
if (log.isErrorEnabled()) {
log.error("Can't add update", eee);
}
DialogHelper.showErrorMessageDialog(view, eee);
- }
+ }*/
}
- protected JXTreeTable getTreeTable() {
- return view.getAccountsTreeTable();
- }
-
- protected AccountTreeTableModel getTreeTableModel() {
- AccountTreeTableModel model =
- (AccountTreeTableModel) getTreeTable().getTreeTableModel();
- return model;
- }
-
protected Account getMasterAccount(Account account) {
String number = account.getAccountNumber();
@@ -459,15 +500,14 @@
protected Account getSelectedAccount() {
- JXTreeTable table = getTreeTable();
+ JXTreeTable table = view.getAccountsTreeTable();
Account selectedObject = null;
int selectedRow = table.getSelectedRow();
if (selectedRow > -1) {
TreePath treePath = table.getPathForRow(selectedRow);
- AccountTreeTableModel.AccountTreeTableNode lastPathComponent =
- (AccountTreeTableModel.AccountTreeTableNode) treePath.getLastPathComponent();
- selectedObject = lastPathComponent.getUserObject();
+ TreeTableNode lastPathComponent = (TreeTableNode) treePath.getLastPathComponent();
+ selectedObject = (Account)lastPathComponent.getUserObject();
}
return selectedObject;
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/SubLedgerForm.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/SubLedgerForm.jaxx 2012-04-04 09:03:41 UTC (rev 3350)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/SubLedgerForm.jaxx 2012-04-04 13:25:23 UTC (rev 3351)
@@ -90,7 +90,7 @@
<JPanel layout='{new GridLayout(1,0)}'>
<JButton text="lima.common.cancel" onActionPerformed="dispose()"/>
<JButton id="ok" text="lima.common.ok"
- onActionPerformed="handler.doAddSubLedger(this)"/>
+ onActionPerformed="/*handler.doAddSubLedger(this)*/"/>
</JPanel>
</cell>
</row>
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/UpdateAccountForm.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/UpdateAccountForm.jaxx 2012-04-04 09:03:41 UTC (rev 3350)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/UpdateAccountForm.jaxx 2012-04-04 13:25:23 UTC (rev 3351)
@@ -64,7 +64,7 @@
<JTextField id="descriptionTextField" text="{getAccount().getLabel()}"/>
</cell>
</row>
- <row>
+ <!-- <row>
<cell fill="horizontal">
<JLabel text="lima.common.masteraccount"
labelFor='{masterAccountTextField}'/>
@@ -73,7 +73,7 @@
<JTextField id="masterAccountTextField"
text="{getAccount().getMasterAccount().getAccountNumber()}"/>
</cell>
- </row>
+ </row> -->
<row>
<cell columns="2">
<JPanel layout='{new GridLayout(1,0)}'>
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/UpdateSubLedgerForm.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/UpdateSubLedgerForm.jaxx 2012-04-04 09:03:41 UTC (rev 3350)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/UpdateSubLedgerForm.jaxx 2012-04-04 13:25:23 UTC (rev 3351)
@@ -73,7 +73,7 @@
<JTextField id="thirdPartyTextField" text="{getAccount().getThirdParty()}"/>
</cell>
</row>
- <row>
+ <!-- <row>
<cell fill="horizontal">
<JLabel text="lima.common.masteraccount"
labelFor='{masterAccountTextField}'/>
@@ -82,7 +82,7 @@
<JTextField id="masterAccountTextField"
text="{getAccount().getMasterAccount().getAccountNumber()}"/>
</cell>
- </row>
+ </row> -->
<row>
<cell columns="2">
<JPanel layout='{new GridLayout(1,0)}'>
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/SubAccountComboBoxModel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/SubAccountComboBoxModel.java 2012-04-04 09:03:41 UTC (rev 3350)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/SubAccountComboBoxModel.java 2012-04-04 13:25:23 UTC (rev 3351)
@@ -86,7 +86,7 @@
public List<Account> getDataList() {
List<Account> result = new ArrayList<Account>();
try {
- result = accountService.getAllSubAccounts();
+ result = accountService.getAllLeafAccounts();
} catch (LimaException eee) {
if (log.isDebugEnabled()) {
log.debug("Can't get list subaccounts", eee);
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/AccountsPane.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/AccountsPane.java 2012-04-04 09:03:41 UTC (rev 3350)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/AccountsPane.java 2012-04-04 13:25:23 UTC (rev 3351)
@@ -98,11 +98,11 @@
try {
- List<Account> accounts = accountService.getAllAccounts();
- if (accounts.size() > 0) {
+ long accountCount = accountService.getAccountCount();
+ if (accountCount > 0) {
setBackground(greenBackground);
String accountsString = _("lima.home.chartaccounts.state1_2") + " "
- + accounts.size() + " " + _("lima.home.chartaccounts.state2_2")
+ + accountCount + " " + _("lima.home.chartaccounts.state2_2")
+ "<br/><br/><a href='#accountschart'>"
+ _("lima.home.chartaccounts.modify") + "</a>";
//set Text
1
0
r3350 - in trunk: lima-business/src/main/java/org/chorem/lima lima-swing/src/main/resources
by echatellier@users.chorem.org April 4, 2012
by echatellier@users.chorem.org April 4, 2012
April 4, 2012
Author: echatellier
Date: 2012-04-04 11:03:41 +0200 (Wed, 04 Apr 2012)
New Revision: 3350
Url: http://chorem.org/repositories/revision/lima/3350
Log:
Use openejb non deprecated classes.
Modified:
trunk/lima-business/src/main/java/org/chorem/lima/LimaServer.java
trunk/lima-swing/src/main/resources/lima-config.properties
Modified: trunk/lima-business/src/main/java/org/chorem/lima/LimaServer.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/LimaServer.java 2012-04-04 08:28:03 UTC (rev 3349)
+++ trunk/lima-business/src/main/java/org/chorem/lima/LimaServer.java 2012-04-04 09:03:41 UTC (rev 3350)
@@ -23,7 +23,7 @@
package org.chorem.lima;
-import org.apache.openejb.client.LocalInitialContextFactory;
+import org.apache.openejb.core.LocalInitialContextFactory;
import javax.naming.Context;
import javax.naming.InitialContext;
Modified: trunk/lima-swing/src/main/resources/lima-config.properties
===================================================================
--- trunk/lima-swing/src/main/resources/lima-config.properties 2012-04-04 08:28:03 UTC (rev 3349)
+++ trunk/lima-swing/src/main/resources/lima-config.properties 2012-04-04 09:03:41 UTC (rev 3350)
@@ -5,7 +5,7 @@
# $Id$
# $HeadURL$
# %%
-# Copyright (C) 2008 - 2010 CodeLutin
+# Copyright (C) 2008 - 2012 CodeLutin, Chatellier Eric
# %%
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as
@@ -46,7 +46,7 @@
# Embedded mode
#lima.openejb.remotemode=false
-java.naming.factory.initial=org.openejb.client.LocalInitialContextFactory
+java.naming.factory.initial=org.apache.openejb.core.LocalInitialContextFactory
#Lima Accounting Host
#lima.host.address=localhost
1
0
Author: echatellier
Date: 2012-04-04 10:28:03 +0200 (Wed, 04 Apr 2012)
New Revision: 3349
Url: http://chorem.org/repositories/revision/lima/3349
Log:
Update nuiton-utils / topia
Modified:
trunk/pom.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2012-03-20 10:05:09 UTC (rev 3348)
+++ trunk/pom.xml 2012-04-04 08:28:03 UTC (rev 3349)
@@ -311,9 +311,9 @@
<projectId>lima</projectId>
<!-- customized libs version -->
- <nuitonUtilsVersion>2.4.5</nuitonUtilsVersion>
+ <nuitonUtilsVersion>2.4.7</nuitonUtilsVersion>
<eugenePluginVersion>2.4.2</eugenePluginVersion>
- <topiaVersion>2.6.8</topiaVersion>
+ <topiaVersion>2.6.9</topiaVersion>
<jaxxVersion>2.5-SNAPSHOT</jaxxVersion>
<nuitonI18nVersion>2.4.1</nuitonI18nVersion>
<openEjbVersion>4.0.0-beta-2</openEjbVersion>
1
0