Lima-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- 1853 discussions
r2998 - in trunk/lima-swing/src/main/java/org/chorem/lima/ui: accountsreports celleditor combobox entrybooksreports financialtransaction
by jpepin@users.chorem.org 06 Aug '10
by jpepin@users.chorem.org 06 Aug '10
06 Aug '10
Author: jpepin
Date: 2010-08-06 17:10:31 +0200 (Fri, 06 Aug 2010)
New Revision: 2998
Url: http://chorem.org/repositories/revision/lima/2998
Log:
Ajout auto compl?\195?\169tion entrybook report.
Debug auto compl?\195?\169tion dans la saisie d'?\195?\169criture.
Added:
trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/AccountComboBoxModel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBookComboBox.java
Removed:
trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountComboBoxModel.java
Modified:
trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountComboBox.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsViewHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/celleditor/AccountTableCellEditor.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/celleditor/EntryBookTableCellEditor.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/SubAccountComboBoxModel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsViewHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTable.java
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountComboBox.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountComboBox.java 2010-08-06 14:01:37 UTC (rev 2997)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountComboBox.java 2010-08-06 15:10:31 UTC (rev 2998)
@@ -26,6 +26,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.entity.Account;
+import org.chorem.lima.ui.combobox.AccountComboBoxModel;
import org.chorem.lima.util.AccountToString;
import org.jdesktop.swingx.autocomplete.AutoCompleteDecorator;
Deleted: trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountComboBoxModel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountComboBoxModel.java 2010-08-06 14:01:37 UTC (rev 2997)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountComboBoxModel.java 2010-08-06 15:10:31 UTC (rev 2998)
@@ -1,110 +0,0 @@
-/* *##% Lima Swing
- * Copyright (C) 2008 - 2010 CodeLutin
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- * ##%*/
-
-package org.chorem.lima.ui.accountsreports;
-
-import java.util.List;
-import javax.swing.AbstractListModel;
-import javax.swing.ComboBoxModel;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.chorem.lima.business.AccountServiceMonitorable;
-import org.chorem.lima.business.ImportServiceMonitorable;
-import org.chorem.lima.business.LimaException;
-import org.chorem.lima.business.ServiceListener;
-import org.chorem.lima.entity.Account;
-import org.chorem.lima.service.LimaServiceFactory;
-import org.chorem.lima.ui.financialperiod.FinancialPeriodTableModel;
-
-/**
- * Account combo box model.
- */
-
-public class AccountComboBoxModel 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<Account> datasCache;
-
- protected AccountServiceMonitorable accountService;
-
- public AccountComboBoxModel () {
- accountService =
- LimaServiceFactory.getInstance().getService(
- AccountServiceMonitorable.class);
- accountService.addListener(this);
- LimaServiceFactory.getInstance().getService(
- ImportServiceMonitorable.class).addListener(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 = null;
- try {
- result = accountService.getAllAccounts();
- }
- catch (LimaException eee) {
- if (log.isDebugEnabled()){
- log.debug("Can't get list accounts", eee);
- }
- }
- return result;
-
- }
-
- public void refresh(){
- datasCache = getDataList();
- fireContentsChanged(this, 0, datasCache.size());
- }
-
- @Override
- public void notifyMethod(String serviceName, String methodeName) {
- if (methodeName.contains("Account") || methodeName.contains("importAll")){
- refresh();
- }
- }
-
-
-}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsViewHandler.java 2010-08-06 14:01:37 UTC (rev 2997)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsViewHandler.java 2010-08-06 15:10:31 UTC (rev 2998)
@@ -30,6 +30,7 @@
import org.chorem.lima.business.ServiceListener;
import org.chorem.lima.entity.Account;
import org.chorem.lima.service.LimaServiceFactory;
+import org.chorem.lima.ui.combobox.AccountComboBoxModel;
import org.chorem.lima.util.ErrorHelper;
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 2010-08-06 14:01:37 UTC (rev 2997)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/celleditor/AccountTableCellEditor.java 2010-08-06 15:10:31 UTC (rev 2998)
@@ -20,15 +20,17 @@
package org.chorem.lima.ui.celleditor;
import java.awt.Component;
-import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
+import java.awt.event.KeyListener;
import java.awt.event.MouseEvent;
import java.util.EventObject;
+
import javax.swing.AbstractCellEditor;
import javax.swing.JTable;
import javax.swing.SwingUtilities;
import javax.swing.table.TableCellEditor;
import javax.swing.text.JTextComponent;
+
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.entity.Account;
@@ -38,7 +40,7 @@
import org.chorem.lima.widgets.JWideComboBox;
import org.jdesktop.swingx.autocomplete.AutoCompleteDecorator;
-public class AccountTableCellEditor extends AbstractCellEditor implements TableCellEditor {
+public class AccountTableCellEditor extends AbstractCellEditor implements TableCellEditor, KeyListener {
protected static final Log log = LogFactory.getLog(EntryBookTableCellEditor.class);
private final JWideComboBox comboBox;
@@ -58,35 +60,7 @@
AccountRenderer accountRenderer = new AccountRenderer();
comboBox.setRenderer(accountRenderer);
AutoCompleteDecorator.decorate(comboBox, AccountToString.getInstance());
-
-
- /**
- * Ajout d'un listener pour la frappe au clavier seulement, permettant
- * de déplacer la sélection (et le caret) du fait que la première touche
- * n'est pas prise en compte.
- */
- comboBox.getEditor().getEditorComponent().addKeyListener(new KeyAdapter() {
-
- @Override
- public void keyReleased(KeyEvent e) {
- // Vérifie si c'est la première frappe au clavier
- if ( keyPressed == false )
- {
- // 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;
- }
- // Validate editing with enter key
- if ( e.getKeyChar() == KeyEvent.VK_ENTER )
- {
- //FIXME pepin 13072010 enter not save the modification
- log.debug(comboBox.getEditor().getItem());
- stopCellEditing();
- }
- }
- });
+ comboBox.getEditor().getEditorComponent().addKeyListener(this);
}
@Override
@@ -108,14 +82,13 @@
* @param evt
* @return
*/
- @Override
+ @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 )
- {
+ if ( keyEvent.getKeyChar() != KeyEvent.VK_ESCAPE){
// Permet de placer le focus sur l'editor de la comboBox
SwingUtilities.invokeLater(new Runnable() {
@Override
@@ -130,17 +103,46 @@
});
}
}
- // Remet à faux pour la premiere lettre tapée au clavier
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 == false )
+ {
+ // 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 AccountTableCellEditor getInstance() {
if (editor == null) {
editor = new AccountTableCellEditor();
}
return editor;
}
-
+
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/celleditor/EntryBookTableCellEditor.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/celleditor/EntryBookTableCellEditor.java 2010-08-06 14:01:37 UTC (rev 2997)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/celleditor/EntryBookTableCellEditor.java 2010-08-06 15:10:31 UTC (rev 2998)
@@ -56,11 +56,6 @@
EntryBookRenderer entryBookRenderer = new EntryBookRenderer();
comboBox.setRenderer(entryBookRenderer);
- /*// Property Change Listener
- LimaContext.getContext().getDataManager().getJournalModel().addPropertyChangeListener(comboBoxModel);
- comboBox.setModel(comboBoxModel);*/
- //LimaContext.getContext().addPropertyChangeListener(entryBookComboBoxModel);
-
// AutoCompletion
AutoCompleteDecorator.decorate(comboBox, EntryBookToString.getInstance());
Copied: trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/AccountComboBoxModel.java (from rev 2997, trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountComboBoxModel.java)
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/AccountComboBoxModel.java (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/AccountComboBoxModel.java 2010-08-06 15:10:31 UTC (rev 2998)
@@ -0,0 +1,110 @@
+/* *##% Lima Swing
+ * Copyright (C) 2008 - 2010 CodeLutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * ##%*/
+
+package org.chorem.lima.ui.combobox;
+
+import java.util.List;
+import javax.swing.AbstractListModel;
+import javax.swing.ComboBoxModel;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.chorem.lima.business.AccountServiceMonitorable;
+import org.chorem.lima.business.ImportServiceMonitorable;
+import org.chorem.lima.business.LimaException;
+import org.chorem.lima.business.ServiceListener;
+import org.chorem.lima.entity.Account;
+import org.chorem.lima.service.LimaServiceFactory;
+import org.chorem.lima.ui.financialperiod.FinancialPeriodTableModel;
+
+/**
+ * Account combo box model.
+ */
+
+public class AccountComboBoxModel 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<Account> datasCache;
+
+ protected AccountServiceMonitorable accountService;
+
+ public AccountComboBoxModel () {
+ accountService =
+ LimaServiceFactory.getInstance().getService(
+ AccountServiceMonitorable.class);
+ accountService.addListener(this);
+ LimaServiceFactory.getInstance().getService(
+ ImportServiceMonitorable.class).addListener(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 = null;
+ try {
+ result = accountService.getAllAccounts();
+ }
+ catch (LimaException eee) {
+ if (log.isDebugEnabled()){
+ log.debug("Can't get list accounts", eee);
+ }
+ }
+ return result;
+
+ }
+
+ public void refresh(){
+ datasCache = getDataList();
+ fireContentsChanged(this, 0, datasCache.size());
+ }
+
+ @Override
+ public void notifyMethod(String serviceName, String methodeName) {
+ if (methodeName.contains("Account") || methodeName.contains("importAll")){
+ refresh();
+ }
+ }
+
+
+}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/EntryBookComboBoxModel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/EntryBookComboBoxModel.java 2010-08-06 14:01:37 UTC (rev 2997)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/EntryBookComboBoxModel.java 2010-08-06 15:10:31 UTC (rev 2998)
@@ -19,7 +19,8 @@
package org.chorem.lima.ui.combobox;
import java.util.List;
-import javax.swing.DefaultComboBoxModel;
+import javax.swing.AbstractListModel;
+import javax.swing.ComboBoxModel;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.business.EntryBookServiceMonitorable;
@@ -39,7 +40,7 @@
* Last update : $Date$
* By : $Author$
*/
-public class EntryBookComboBoxModel extends DefaultComboBoxModel implements ServiceListener {
+public class EntryBookComboBoxModel extends AbstractListModel implements ComboBoxModel, ServiceListener {
private static final long serialVersionUID = 1L;
@@ -75,6 +76,7 @@
@Override
public void setSelectedItem(Object anItem) {
selectedEntryBook = anItem;
+ fireContentsChanged(this, -1, -1);
}
@Override
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 2010-08-06 14:01:37 UTC (rev 2997)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/SubAccountComboBoxModel.java 2010-08-06 15:10:31 UTC (rev 2998)
@@ -22,7 +22,6 @@
import java.util.List;
import javax.swing.AbstractListModel;
import javax.swing.ComboBoxModel;
-import javax.swing.event.ListDataListener;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.business.AccountServiceMonitorable;
@@ -31,7 +30,6 @@
import org.chorem.lima.business.ServiceListener;
import org.chorem.lima.entity.Account;
import org.chorem.lima.service.LimaServiceFactory;
-import org.chorem.lima.ui.financialperiod.FinancialPeriodTableModel;
/**
* Account combo box model.
@@ -39,12 +37,9 @@
public class SubAccountComboBoxModel extends AbstractListModel implements ComboBoxModel, ServiceListener {
- /**
- *
- */
private static final long serialVersionUID = 1L;
- private static final Log log = LogFactory.getLog(FinancialPeriodTableModel.class);
+ private static final Log log = LogFactory.getLog(SubAccountComboBoxModel.class);
protected Object selectedAccount;
@@ -70,15 +65,10 @@
@Override
public void setSelectedItem(Object anItem) {
selectedAccount = anItem;
+ fireContentsChanged(this, -1, -1);
}
@Override
- public void addListDataListener(ListDataListener arg0) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
public Object getElementAt(int index) {
return datasCache.get(index);
}
@@ -88,12 +78,6 @@
return datasCache.size();
}
- @Override
- public void removeListDataListener(ListDataListener arg0) {
- // TODO Auto-generated method stub
-
- }
-
public List<Account> getDataList(){
List<Account> result = new ArrayList<Account>();
try {
Added: trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBookComboBox.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBookComboBox.java (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBookComboBox.java 2010-08-06 15:10:31 UTC (rev 2998)
@@ -0,0 +1,89 @@
+/* *##% Lima Swing
+ * Copyright (C) 2008 - 2010 CodeLutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * ##%*/
+
+package org.chorem.lima.ui.entrybooksreports;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.KeyEvent;
+import java.awt.event.KeyListener;
+import javax.swing.JComboBox;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.chorem.lima.entity.EntryBook;
+import org.chorem.lima.ui.combobox.EntryBookComboBoxModel;
+import org.chorem.lima.ui.combobox.EntryBookRenderer;
+import org.chorem.lima.util.EntryBookToString;
+import org.jdesktop.swingx.autocomplete.AutoCompleteDecorator;
+
+public class EntryBookComboBox extends JComboBox implements KeyListener, ActionListener {
+
+ private static final long serialVersionUID = 1L;
+
+ private static final Log log =
+ LogFactory.getLog(EntryBookComboBox.class);
+
+ protected EntryBooksReportsViewHandler handler;
+
+ public EntryBookComboBox(EntryBooksReportsViewHandler handler) {
+ this.handler = handler;
+ EntryBookComboBoxModel entryBookComboBoxModel = new EntryBookComboBoxModel();
+ EntryBookRenderer entryBookRenderer = new EntryBookRenderer();
+ setModel(entryBookComboBoxModel);
+ setRenderer(entryBookRenderer);
+ setEditable(true);
+ AutoCompleteDecorator.decorate(this, EntryBookToString.getInstance());
+ this.getEditor().getEditorComponent().addKeyListener(this);
+ this.addActionListener(this);
+ }
+
+
+
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ Object object = this.getSelectedItem();
+ if (object instanceof EntryBook){
+ handler.setEntryBook((EntryBook) this.getSelectedItem());
+ }
+ }
+
+
+ @Override
+ public void keyPressed(KeyEvent e) {
+
+ }
+
+ @Override
+ public void keyReleased(KeyEvent e) {
+ Object object = this.getSelectedItem();
+ if (object instanceof EntryBook){
+ handler.setEntryBook((EntryBook) this.getSelectedItem());
+ }
+ // delegate popup list menu
+ if ( e.getKeyChar() == KeyEvent.VK_ENTER )
+ {
+ firePopupMenuCanceled();
+ }
+ }
+
+ @Override
+ public void keyTyped(KeyEvent e) {
+
+ }
+
+}
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 2010-08-06 14:01:37 UTC (rev 2997)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsView.jaxx 2010-08-06 15:10:31 UTC (rev 2998)
@@ -66,13 +66,8 @@
<cell anchor="east">
<JLabel id="entryBookSelectorLabel" text="lima.entrybook"/>
</cell>
- <cell anchor="west">
- <JComboBox id="entryBookComboBox"
- model="{getModelEntryBook()}"
- renderer="{new org.chorem.lima.ui.combobox.EntryBookRenderer()}"
- onActionPerformed="getHandler().setEntryBook((EntryBook) entryBookComboBox.getSelectedItem())"
- editable="false"
- />
+ <cell anchor="west">
+ <JComboBox javaBean='new org.chorem.lima.ui.entrybooksreports.EntryBookComboBox(getHandler())' />
</cell>
<cell>
<EnumEditor id='DocumentEditor'
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsViewHandler.java 2010-08-06 14:01:37 UTC (rev 2997)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsViewHandler.java 2010-08-06 15:10:31 UTC (rev 2998)
@@ -59,8 +59,6 @@
protected EntryBooksReportsTableModel tableModel;
- protected EntryBookComboBoxModel comboBoxModel;
-
/** log. */
private static final Log log = LogFactory.getLog(EntryBooksReportsViewHandler.class);
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTable.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTable.java 2010-08-06 14:01:37 UTC (rev 2997)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTable.java 2010-08-06 15:10:31 UTC (rev 2998)
@@ -52,8 +52,6 @@
private ColorHighlighter colorBalance;
- /**
- */
public FinancialTransactionTable(FinancialTransactionViewHandler handler) {
this.handler = handler;
1
0
Author: jpepin
Date: 2010-08-06 16:01:37 +0200 (Fri, 06 Aug 2010)
New Revision: 2997
Url: http://chorem.org/repositories/revision/lima/2997
Log:
Debug generation bilan et compte de resultat :
- ajout d'un sens d?\195?\169bit et cr?\195?\169dit (utile pour le compte de r?\195?\169sultat).
- dans la liste des comptes de chaque poste, recherche de tout les comptes commencant par le compte recherch?\195?\169.
Ajout combobox editable dans accounts report avec auto completion.
Modification des filtres dans la balance et le grand-livre : filtre automatique lors de la saisie.
Added:
trunk/lima-callao/src/main/java/org/chorem/lima/FinancialStatementWayEnum.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountComboBox.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountComboBoxModel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountRenderer.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceFilterTextField.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerFilterTextField.java
Removed:
trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/AccountComboBoxModel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/AccountRenderer.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/LetteringView.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/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/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/FinancialStatementService.java
trunk/lima-callao/src/main/xmi/accounting.zargo
trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainViewHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsTableModel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsViewHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceTableModel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/celleditor/AccountTableCellEditor.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartViewHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementHeaderForm.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerView.jaxx
trunk/lima-swing/src/main/resources/i18n/lima-swing-en_GB.properties
trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java 2010-08-05 10:50:11 UTC (rev 2996)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java 2010-08-06 14:01:37 UTC (rev 2997)
@@ -38,12 +38,14 @@
import org.chorem.lima.business.utils.AccountComparator;
import org.chorem.lima.entity.Account;
import org.chorem.lima.entity.AccountDAO;
+import org.chorem.lima.entity.FinancialStatement;
import org.chorem.lima.entity.LimaCallaoDAOHelper;
import org.nuiton.topia.TopiaContext;
import org.nuiton.topia.TopiaContextFactory;
import org.nuiton.topia.TopiaException;
import org.nuiton.topia.TopiaNotFoundException;
import org.nuiton.topia.framework.TopiaQuery;
+import org.nuiton.topia.framework.TopiaQuery.Op;
/**
* Permet d'implémenter le Plan Comptable Général.
@@ -222,8 +224,7 @@
AccountDAO accountDAO =
LimaCallaoDAOHelper.getAccountDAO(transaction);
- List<Account> accounts = accountDAO.findAll();
- accountsList.addAll(accounts);
+ accountsList = accountDAO.findAll();
Collections.sort(accountsList, new AccountComparator());
}
@@ -470,10 +471,18 @@
}
for (String accountNumber : accountNumbers) {
- Account accountFilter = accountDAO.findByAccountNumber(accountNumber);
+ Account account = accountDAO.findByAccountNumber(accountNumber);
+ if (account == null){
+ TopiaQuery query = accountDAO.createQuery();
+ query.addWhere(Account.ACCOUNT_NUMBER, Op.LIKE, accountNumber+"%");
+ List<Account> accountsResult = accountDAO.findAllByQuery(query);
+ if (accountsResult != null){
+ accounts.addAll(accountsResult);
+ }
+ }
//add account if exist
- if (accountFilter != null){
- accounts.add(accountFilter);
+ else {
+ accounts.add(account);
}
}
}
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ExportServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ExportServiceImpl.java 2010-08-05 10:50:11 UTC (rev 2996)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ExportServiceImpl.java 2010-08-06 14:01:37 UTC (rev 2997)
@@ -27,6 +27,7 @@
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.chorem.lima.FinancialStatementWayEnum;
import org.chorem.lima.business.LimaConfig;
import org.chorem.lima.business.LimaException;
import org.chorem.lima.business.ejbinterface.ExportService;
@@ -295,7 +296,7 @@
*/
public void exportFinancialStatementChartAsCSV(CSVWriter csvWriter, TopiaContext topiaContext) throws LimaException {
try {
- String[] nextLine = new String[10];
+ String[] nextLine = new String[11];
// Get all Financialstatements
FinancialStatementDAO financialStatementDAO =
LimaCallaoDAOHelper.getFinancialStatementDAO(topiaContext);
@@ -328,6 +329,12 @@
masterFinancialStatement.getLabel();
}
nextLine[9] = masterFinancialStatementString;
+ FinancialStatementWayEnum financialStatementWayEnum = financialStatement.getWay();
+ String financialStatementWay = "";
+ if (financialStatementWayEnum != null){
+ financialStatementWay = financialStatementWayEnum.name();
+ }
+ nextLine[10] = financialStatementWay;
// Add line in file
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 2010-08-05 10:50:11 UTC (rev 2996)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialStatementServiceImpl.java 2010-08-06 14:01:37 UTC (rev 2997)
@@ -21,6 +21,7 @@
import static org.nuiton.i18n.I18n._;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.StringTokenizer;
@@ -29,6 +30,7 @@
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.chorem.lima.FinancialStatementWayEnum;
import org.chorem.lima.beans.FinancialStatementAmounts;
import org.chorem.lima.beans.FinancialStatementAmountsImpl;
import org.chorem.lima.beans.FinancialStatementDatas;
@@ -42,7 +44,9 @@
import org.chorem.lima.business.ejbinterface.FinancialStatementService;
import org.chorem.lima.business.ejbinterface.FinancialStatementServiceLocal;
import org.chorem.lima.business.ejbinterface.ReportServiceLocal;
+import org.chorem.lima.business.utils.AccountComparator;
import org.chorem.lima.entity.Account;
+import org.chorem.lima.entity.AccountDAO;
import org.chorem.lima.entity.FinancialStatement;
import org.chorem.lima.entity.FinancialStatementDAO;
import org.chorem.lima.entity.LimaCallaoDAOHelper;
@@ -51,6 +55,7 @@
import org.nuiton.topia.TopiaException;
import org.nuiton.topia.TopiaNotFoundException;
import org.nuiton.topia.framework.TopiaQuery;
+import org.nuiton.topia.framework.TopiaQuery.Op;
@Stateless
public class FinancialStatementServiceImpl extends AbstractLimaService implements FinancialStatementService, FinancialStatementServiceLocal{
@@ -406,6 +411,7 @@
try {
// DEBIT & CREDIT
String accountsString = financialStatement.getAccounts();
+ log.debug("\n" + accountsString);
Double amount = 0.0;
if (accountsString != null){
//Remove Spaces
@@ -413,14 +419,30 @@
StringTokenizer stQuote = new StringTokenizer(accountsString, "-");
while (stQuote.hasMoreTokens()) {
String s = stQuote.nextToken();
- List<Account> accountsStringList = accountServiceLocal.
+ List<Account> accountsList = accountServiceLocal.
stringToListAccountsWithTransaction(s, topiaContext);
Double resAmount = 0.0;
- for (Account accountString : accountsStringList) {
+
+ for (Account account : accountsList) {
+ log.debug(account.getAccountNumber());
ReportsDatas reportsDatas = reportServiceLocal.
- generateAccountReportsWithTransaction(accountString,
+ generateAccountReportsWithTransaction(account,
selectedBeginDate, selectedEndDate, topiaContext);
- resAmount += reportsDatas.getAmountSolde();
+
+ //check the way of financialstatement amount
+ FinancialStatementWayEnum financialStatementWayEnum =
+ financialStatement.getMasterFinancialStatement().getWay();
+ switch (financialStatementWayEnum) {
+ case BOTH:
+ resAmount += reportsDatas.getAmountSolde();
+ break;
+ case DEBIT:
+ resAmount += reportsDatas.getAmountDebit()-reportsDatas.getAmountCredit();
+ break;
+ case CREDIT:
+ resAmount += reportsDatas.getAmountCredit()-reportsDatas.getAmountDebit();
+ break;
+ }
}
if (amount == 0){
amount=resAmount;
@@ -456,7 +478,7 @@
ReportsDatas reportsDatas = reportServiceLocal.
generateAccountReportsWithTransaction(account,
selectedBeginDate, selectedEndDate, topiaContext);
- debitAmount += reportsDatas.getAmountCredit();
+ debitAmount += reportsDatas.getAmountDebit();
}
}
@@ -493,8 +515,74 @@
return financialStatementAmounts;
}
+
+
- protected TopiaContext beginTransaction() throws TopiaException {
+ @Override
+ public String checkFinancialStatementChart() throws LimaException {
+ String result = "";
+ List<Account> accountsList = new ArrayList<Account>();
+
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+ AccountDAO accountDAO =
+ LimaCallaoDAOHelper.getAccountDAO(transaction);
+
+ accountsList = accountDAO.findAllSubAccounts();
+ Collections.sort(accountsList, new AccountComparator());
+
+ for (Account account : accountsList) {
+ Boolean find = false;
+ String accountNumber = account.getAccountNumber();
+ if (accountNumber.length()>1){
+ while (!find && accountNumber.length() > 1){
+ log.debug(accountNumber);
+ List<FinancialStatement> financialStatements =
+ findFinancialStatementByAccountNumber(accountNumber, transaction);
+ log.debug(financialStatements);
+ if (!(find = financialStatements.size() > 0)){
+ accountNumber = accountNumber.substring(0, accountNumber.length()-1);
+ }
+ }
+
+ if (!find){
+ result += "NOT FOUND : "+account.getAccountNumber()+"\n";
+ }
+ }
+ }
+
+ }
+ catch (TopiaException ex) {
+ doCatch(transaction, ex, log);
+ }
+ finally {
+ doFinally(transaction, log);
+ }
+ return result;
+ }
+
+ public List<FinancialStatement> findFinancialStatementByAccountNumber(String accountNumber, TopiaContext topiaContext) throws TopiaException{
+
+ FinancialStatementDAO financialStatementDAO =
+ LimaCallaoDAOHelper.getFinancialStatementDAO(topiaContext);
+ TopiaQuery query = financialStatementDAO.createQuery();
+
+ String accountProperty = TopiaQuery.getProperty(FinancialStatement.ACCOUNTS);
+ String creditAccountProperty = TopiaQuery.getProperty(FinancialStatement.CREDIT_ACCOUNTS);
+ String debitAccountProperty = TopiaQuery.getProperty(FinancialStatement.DEBIT_ACCOUNTS);
+ String provisionDeprecationProperty = TopiaQuery.getProperty(FinancialStatement.PROVISION_DEPRECATION_ACCOUNTS);
+ String likeCondition = " " + Op.LIKE + " '%"+accountNumber + "%'";
+
+ query.addWhere(accountProperty + likeCondition
+ + " OR " + creditAccountProperty + likeCondition
+ + " OR " + debitAccountProperty + likeCondition
+ + " OR " + provisionDeprecationProperty + likeCondition);
+
+ return financialStatementDAO.findAllByQuery(query);
+ }
+
+ protected TopiaContext beginTransaction() throws TopiaException {
// basic check done, make check in database
// TODO move it into JTA
TopiaContext topiaTransaction;
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java 2010-08-05 10:50:11 UTC (rev 2996)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java 2010-08-06 14:01:37 UTC (rev 2997)
@@ -37,6 +37,7 @@
import javax.ejb.Stateless;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.chorem.lima.FinancialStatementWayEnum;
import org.chorem.lima.beans.AccountEBP;
import org.chorem.lima.beans.AccountEBPImpl;
import org.chorem.lima.beans.AccountImport;
@@ -749,6 +750,7 @@
String subAmount = nextLine[7];
String headerAmount = nextLine[8];
String masterFinancialStatement = nextLine[9];
+ String financialStatementWay = nextLine[10];
try {
FinancialStatementDAO financialStatementDAO = LimaCallaoDAOHelper
@@ -769,6 +771,7 @@
financialStatementImport.setSubAmount(subAmount);
financialStatementImport
.setMasterFinancialStatement(masterFinancialStatement);
+ financialStatementImport.setWay(financialStatementWay);
// put it in hashlinkedlist
if (financialStatements.containsKey(label)){
@@ -891,6 +894,13 @@
financialStatement.setHeaderAmount(Boolean
.parseBoolean(financialStatementImport
.getHeaderAmount()));
+ String financialStatementWay = financialStatementImport.getWay();
+ if (!financialStatementWay.equals("")){
+ FinancialStatementWayEnum financialStatementWayEnum =
+ FinancialStatementWayEnum.valueOf(financialStatementWay);
+ financialStatement.setWay(financialStatementWayEnum);
+ }
+
financialStatementService
.createFinancialStatementWithTransaction(
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java 2010-08-05 10:50:11 UTC (rev 2996)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java 2010-08-06 14:01:37 UTC (rev 2997)
@@ -180,6 +180,7 @@
createEntryQuery(account, beginDate, endDate, entryDAO, queryAlias);
//IMPORTANT : LOADING ENTRIES AND IS COLUMN FOR NO LAZY EXCEPTION
entriesQuery.addLoad(Entry.FINANCIAL_TRANSACTION);
+ entriesQuery.addLoad(Entry.ACCOUNT);
String loadEntryBookProperty =
TopiaQuery.getProperty(Entry.FINANCIAL_TRANSACTION,
FinancialTransaction.ENTRY_BOOK);
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialStatementService.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialStatementService.java 2010-08-05 10:50:11 UTC (rev 2996)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialStatementService.java 2010-08-06 14:01:37 UTC (rev 2997)
@@ -41,5 +41,7 @@
public List<FinancialStatement> getAllChildrenFinancialStatement(FinancialStatement financialStatement, List<FinancialStatement> financialStatements) throws LimaException, LimaBusinessException;
public List<FinancialStatementAmounts> financialStatementReport(Date selectedBeginDate, Date selectedEndDate) throws LimaException;
+
+ public String checkFinancialStatementChart() throws LimaException;
}
Added: trunk/lima-callao/src/main/java/org/chorem/lima/FinancialStatementWayEnum.java
===================================================================
--- trunk/lima-callao/src/main/java/org/chorem/lima/FinancialStatementWayEnum.java (rev 0)
+++ trunk/lima-callao/src/main/java/org/chorem/lima/FinancialStatementWayEnum.java 2010-08-06 14:01:37 UTC (rev 2997)
@@ -0,0 +1,7 @@
+package org.chorem.lima;
+
+public enum FinancialStatementWayEnum {
+
+ BOTH, DEBIT, CREDIT;
+
+}
Modified: trunk/lima-callao/src/main/xmi/accounting.zargo
===================================================================
(Binary files differ)
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainViewHandler.java 2010-08-05 10:50:11 UTC (rev 2996)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainViewHandler.java 2010-08-06 14:01:37 UTC (rev 2997)
@@ -42,7 +42,6 @@
import org.chorem.lima.ui.financialstatementchart.FinancialStatementChartView;
import org.chorem.lima.ui.financialstatementreport.FinancialStatementReportView;
import org.chorem.lima.ui.financialtransaction.FinancialTransactionView;
-import org.chorem.lima.ui.financialtransaction.LetteringView;
import org.chorem.lima.ui.financialtransactionunbalanced.FinancialTransactionUnbalancedView;
import org.chorem.lima.ui.home.HomeView;
import org.chorem.lima.ui.identity.IdentityForm;
@@ -414,8 +413,8 @@
public void showLetteringView(JAXXContext rootContext) {
MainView mainView = getUI(rootContext);
- LetteringView letteringView = new LetteringView(mainView);
- mainView.showTab(_("lima.entries.lettering"), letteringView);
+ // LetteringView letteringView = new LetteringView(mainView);
+ // mainView.showTab(_("lima.entries.lettering"), letteringView);
}
public void showSearchView(JAXXContext rootContext) {
Added: trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountComboBox.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountComboBox.java (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountComboBox.java 2010-08-06 14:01:37 UTC (rev 2997)
@@ -0,0 +1,88 @@
+/* *##% Lima Swing
+ * Copyright (C) 2008 - 2010 CodeLutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * ##%*/
+
+package org.chorem.lima.ui.accountsreports;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.KeyEvent;
+import java.awt.event.KeyListener;
+import javax.swing.JComboBox;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.chorem.lima.entity.Account;
+import org.chorem.lima.util.AccountToString;
+import org.jdesktop.swingx.autocomplete.AutoCompleteDecorator;
+
+public class AccountComboBox extends JComboBox implements KeyListener, ActionListener {
+
+ private static final long serialVersionUID = 1L;
+
+ private static final Log log =
+ LogFactory.getLog(AccountComboBox.class);
+
+ protected AccountsReportsViewHandler handler;
+
+ public AccountComboBox(AccountsReportsViewHandler handler) {
+ this.handler = handler;
+ AccountComboBoxModel accountComboBoxModel = new AccountComboBoxModel();
+ AccountRenderer accountRenderer = new AccountRenderer();
+ setModel(accountComboBoxModel);
+ setRenderer(accountRenderer);
+ setEditable(true);
+ AutoCompleteDecorator.decorate(this, AccountToString.getInstance());
+ this.getEditor().getEditorComponent().addKeyListener(this);
+ this.addActionListener(this);
+ }
+
+
+
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ Object object = this.getSelectedItem();
+ if (object instanceof Account){
+ handler.setAccount((Account) this.getSelectedItem());
+ }
+ }
+
+
+ @Override
+ public void keyPressed(KeyEvent e) {
+
+ }
+
+ @Override
+ public void keyReleased(KeyEvent e) {
+ Object object = this.getSelectedItem();
+ if (object instanceof Account){
+ handler.setAccount((Account) this.getSelectedItem());
+ }
+
+ // delegate popup list menu
+ if ( e.getKeyChar() == KeyEvent.VK_ENTER )
+ {
+ firePopupMenuCanceled();
+ }
+ }
+
+ @Override
+ public void keyTyped(KeyEvent e) {
+
+ }
+
+}
Copied: trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountComboBoxModel.java (from rev 2986, trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/AccountComboBoxModel.java)
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountComboBoxModel.java (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountComboBoxModel.java 2010-08-06 14:01:37 UTC (rev 2997)
@@ -0,0 +1,110 @@
+/* *##% Lima Swing
+ * Copyright (C) 2008 - 2010 CodeLutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * ##%*/
+
+package org.chorem.lima.ui.accountsreports;
+
+import java.util.List;
+import javax.swing.AbstractListModel;
+import javax.swing.ComboBoxModel;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.chorem.lima.business.AccountServiceMonitorable;
+import org.chorem.lima.business.ImportServiceMonitorable;
+import org.chorem.lima.business.LimaException;
+import org.chorem.lima.business.ServiceListener;
+import org.chorem.lima.entity.Account;
+import org.chorem.lima.service.LimaServiceFactory;
+import org.chorem.lima.ui.financialperiod.FinancialPeriodTableModel;
+
+/**
+ * Account combo box model.
+ */
+
+public class AccountComboBoxModel 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<Account> datasCache;
+
+ protected AccountServiceMonitorable accountService;
+
+ public AccountComboBoxModel () {
+ accountService =
+ LimaServiceFactory.getInstance().getService(
+ AccountServiceMonitorable.class);
+ accountService.addListener(this);
+ LimaServiceFactory.getInstance().getService(
+ ImportServiceMonitorable.class).addListener(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 = null;
+ try {
+ result = accountService.getAllAccounts();
+ }
+ catch (LimaException eee) {
+ if (log.isDebugEnabled()){
+ log.debug("Can't get list accounts", eee);
+ }
+ }
+ return result;
+
+ }
+
+ public void refresh(){
+ datasCache = getDataList();
+ fireContentsChanged(this, 0, datasCache.size());
+ }
+
+ @Override
+ public void notifyMethod(String serviceName, String methodeName) {
+ if (methodeName.contains("Account") || methodeName.contains("importAll")){
+ refresh();
+ }
+ }
+
+
+}
Copied: trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountRenderer.java (from rev 2986, trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/AccountRenderer.java)
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountRenderer.java (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountRenderer.java 2010-08-06 14:01:37 UTC (rev 2997)
@@ -0,0 +1,49 @@
+/* *##% Lima Swing
+ * Copyright (C) 2008 - 2010 CodeLutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * ##%*/
+
+package org.chorem.lima.ui.accountsreports;
+
+import java.awt.Component;
+
+import javax.swing.DefaultListCellRenderer;
+import javax.swing.JLabel;
+import javax.swing.JList;
+
+import org.chorem.lima.entity.Account;
+
+public class AccountRenderer extends DefaultListCellRenderer {
+
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
+
+ JLabel label = new JLabel();
+ Account account = (Account) value;
+ if (account != null){
+ String accountLabel = account.getLabel();
+ int nbChars = 30;
+ if (accountLabel.length()>nbChars){
+ accountLabel = accountLabel.substring(0, nbChars)+"…";
+ }
+ label.setText(account.getAccountNumber() +" - " + accountLabel);
+ }
+ return label;
+ }
+
+}
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 2010-08-05 10:50:11 UTC (rev 2996)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsTableModel.java 2010-08-06 14:01:37 UTC (rev 2997)
@@ -59,29 +59,32 @@
@Override
public int getColumnCount() {
- return 6;
+ return 7;
}
@Override
public String getColumnName(int column) {
String res = "n/a";
switch (column) {
- case 0:
+ case 0:
+ res = _("lima.table.account"); //Account Number
+ break;
+ case 1:
res = _("lima.table.date"); //Date
break;
- case 1:
+ case 2:
res = _("lima.table.entrybook"); //EntryBook
break;
- case 2:
+ case 3:
res = _("lima.table.voucher"); // Voucher
break;
- case 3:
+ case 4:
res = _("lima.table.description"); //Description
break;
- case 4:
+ case 5:
res = _("lima.table.debit"); //Debit
break;
- case 5:
+ case 6:
res = _("lima.table.credit"); //Credit
break;
}
@@ -97,11 +100,14 @@
= new SimpleDateFormat("dd MMMMM yyyy");
switch (column) {
- case 0:
+ case 0:
+ result = currentRow.getAccount().getAccountNumber();
+ break;
+ case 1:
result = simpleDateFormat.
format(currentRow.getFinancialTransaction().getTransactionDate());
break;
- case 1:
+ case 2:
if (currentRow.getFinancialTransaction().getEntryBook() != null){
result = currentRow.getFinancialTransaction().getEntryBook().getCode();
}
@@ -109,16 +115,16 @@
result = null;
}
break;
- case 2:
+ case 3:
result = currentRow.getVoucher();
break;
- case 3:
+ case 4:
result = currentRow.getDescription();
break;
- case 4:
+ case 5:
result = currentRow.getDebit() ? currentRow.getAmount() : 0;
break;
- case 5:
+ case 6:
result = currentRow.getDebit() ? 0 : currentRow.getAmount();
break;
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsView.jaxx 2010-08-05 10:50:11 UTC (rev 2996)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsView.jaxx 2010-08-06 14:01:37 UTC (rev 2997)
@@ -18,7 +18,6 @@
<Table>
<AccountsReportsViewHandler id="handler" javaBean="new AccountsReportsViewHandler(this)" />
<Boolean id="selectedRow" javaBean="false" />
- <org.chorem.lima.ui.combobox.AccountComboBoxModel id="modelAccounts"/>
<org.chorem.lima.ui.accountsreports.AccountsReportsTableModel id="modelAccountsReportsTable"/>
<script>
<![CDATA[
@@ -67,12 +66,7 @@
<JLabel id="accountSelectorLabel" text="lima.account"/>
</cell>
<cell anchor="west">
- <JComboBox id="accountSelectorComboBox"
- model="{getModelAccounts()}"
- renderer="{new org.chorem.lima.ui.combobox.AccountRenderer()}"
- onActionPerformed="getHandler().setAccount((Account) accountSelectorComboBox.getSelectedItem())"
- editable="false"
- />
+ <JComboBox javaBean='new org.chorem.lima.ui.accountsreports.AccountComboBox(getHandler())' />
</cell>
</row>
<row>
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsViewHandler.java 2010-08-05 10:50:11 UTC (rev 2996)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsViewHandler.java 2010-08-06 14:01:37 UTC (rev 2997)
@@ -30,7 +30,6 @@
import org.chorem.lima.business.ServiceListener;
import org.chorem.lima.entity.Account;
import org.chorem.lima.service.LimaServiceFactory;
-import org.chorem.lima.ui.combobox.AccountComboBoxModel;
import org.chorem.lima.util.ErrorHelper;
Added: trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceFilterTextField.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceFilterTextField.java (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceFilterTextField.java 2010-08-06 14:01:37 UTC (rev 2997)
@@ -0,0 +1,56 @@
+/*
+ * *##% Lima Swing
+ * Copyright (C) 2008 - 2010 CodeLutin
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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>. ##%*
+ */
+
+package org.chorem.lima.ui.balance;
+
+import java.awt.event.KeyEvent;
+import java.awt.event.KeyListener;
+import javax.swing.JTextField;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+public class BalanceFilterTextField extends JTextField implements KeyListener {
+
+ private static final long serialVersionUID = 1L;
+
+ private static final Log log =
+ LogFactory.getLog(BalanceFilterTextField.class);
+
+ protected BalanceViewHandler handler;
+
+ public BalanceFilterTextField(BalanceViewHandler handler) {
+ this.handler = handler;
+ addKeyListener(this);
+ }
+
+ @Override
+ public void keyPressed(KeyEvent e) {
+ }
+
+ @Override
+ public void keyReleased(KeyEvent e) {
+ handler.setAccountFilter(getText());
+ }
+
+ @Override
+ public void keyTyped(KeyEvent e) {
+
+ }
+
+}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceTableModel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceTableModel.java 2010-08-05 10:50:11 UTC (rev 2996)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceTableModel.java 2010-08-06 14:01:37 UTC (rev 2997)
@@ -1,5 +1,5 @@
/*
- * *##% Lima Main
+ * *##% Lima Swing
* Copyright (C) 2008 - 2010 CodeLutin
*
* This program is free software: you can redistribute it and/or modify
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceView.jaxx 2010-08-05 10:50:11 UTC (rev 2996)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceView.jaxx 2010-08-06 14:01:37 UTC (rev 2997)
@@ -25,9 +25,7 @@
import org.chorem.lima.entity.Account;
import org.apache.commons.lang.time.DateUtils;
import java.util.Calendar;
-
- getRootPane().setDefaultButton(filter);
-
+
// get begin date
Calendar calendarBegin = Calendar.getInstance();
// set begindate to JAN 1 - 0:00.000 of this years
@@ -66,11 +64,10 @@
onActionPerformed="getHandler().setEndDate(endDatePicker.getDate())"/>
</cell>
<cell anchor="east">
- <JTextField id="accountFilter"/>
+ <JLabel text="lima.accountsreports.accountfilter"/>
</cell>
<cell anchor="west">
- <JButton id="filter" text="lima.accountsreports.accountfilter"
- onActionPerformed="getHandler().setAccountFilter(accountFilter.getText())"/>
+ <JTextField javaBean="new org.chorem.lima.ui.balance.BalanceFilterTextField(getHandler())"/>
</cell>
<cell anchor="center">
<JCheckBox id='movmentedFilter' text='lima.accountsreports.movmentedfilter' selected='false'
@@ -78,8 +75,8 @@
</cell>
<cell>
<EnumEditor id='DocumentEditor'
- constructorParams='org.chorem.lima.business.utils.FormatsEnum.class'
- onActionPerformed="getHandler().createDocument()"/>
+ constructorParams='org.chorem.lima.business.utils.FormatsEnum.class'
+ onActionPerformed="getHandler().createDocument()"/>
</cell>
</row>
<row>
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 2010-08-05 10:50:11 UTC (rev 2996)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/celleditor/AccountTableCellEditor.java 2010-08-06 14:01:37 UTC (rev 2997)
@@ -32,7 +32,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.entity.Account;
-import org.chorem.lima.ui.combobox.AccountRenderer;
+import org.chorem.lima.ui.accountsreports.AccountRenderer;
import org.chorem.lima.ui.combobox.SubAccountComboBoxModel;
import org.chorem.lima.util.AccountToString;
import org.chorem.lima.widgets.JWideComboBox;
Deleted: 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 2010-08-05 10:50:11 UTC (rev 2996)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/AccountComboBoxModel.java 2010-08-06 14:01:37 UTC (rev 2997)
@@ -1,110 +0,0 @@
-/* *##% Lima Swing
- * Copyright (C) 2008 - 2010 CodeLutin
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- * ##%*/
-
-package org.chorem.lima.ui.combobox;
-
-import java.util.List;
-import javax.swing.AbstractListModel;
-import javax.swing.ComboBoxModel;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.chorem.lima.business.AccountServiceMonitorable;
-import org.chorem.lima.business.ImportServiceMonitorable;
-import org.chorem.lima.business.LimaException;
-import org.chorem.lima.business.ServiceListener;
-import org.chorem.lima.entity.Account;
-import org.chorem.lima.service.LimaServiceFactory;
-import org.chorem.lima.ui.financialperiod.FinancialPeriodTableModel;
-
-/**
- * Account combo box model.
- */
-
-public class AccountComboBoxModel 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<Account> datasCache;
-
- protected AccountServiceMonitorable accountService;
-
- public AccountComboBoxModel() {
- accountService =
- LimaServiceFactory.getInstance().getService(
- AccountServiceMonitorable.class);
- accountService.addListener(this);
- LimaServiceFactory.getInstance().getService(
- ImportServiceMonitorable.class).addListener(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 = null;
- try {
- result = accountService.getAllAccounts();
- }
- catch (LimaException eee) {
- if (log.isDebugEnabled()){
- log.debug("Can't get list accounts", eee);
- }
- }
- return result;
-
- }
-
- public void refresh(){
- datasCache = getDataList();
- fireContentsChanged(this, 0, datasCache.size());
- }
-
- @Override
- public void notifyMethod(String serviceName, String methodeName) {
- if (methodeName.contains("Account") || methodeName.contains("importAll")){
- refresh();
- }
- }
-
-
-}
Deleted: trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/AccountRenderer.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/AccountRenderer.java 2010-08-05 10:50:11 UTC (rev 2996)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/AccountRenderer.java 2010-08-06 14:01:37 UTC (rev 2997)
@@ -1,44 +0,0 @@
-/* *##% Lima Swing
- * Copyright (C) 2008 - 2010 CodeLutin
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- * ##%*/
-
-package org.chorem.lima.ui.combobox;
-
-import java.awt.Component;
-
-import javax.swing.DefaultListCellRenderer;
-import javax.swing.JLabel;
-import javax.swing.JList;
-
-import org.chorem.lima.entity.Account;
-
-public class AccountRenderer extends DefaultListCellRenderer {
-
- private static final long serialVersionUID = 1L;
-
- @Override
- public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
-
- JLabel label = new JLabel();
- Account account = (Account) value;
- if (account != null){
- label.setText(account.getAccountNumber()+" - "+account.getLabel());
- }
- return label;
- }
-
-}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartView.jaxx 2010-08-05 10:50:11 UTC (rev 2996)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartView.jaxx 2010-08-06 14:01:37 UTC (rev 2997)
@@ -27,7 +27,7 @@
</script>
<row>
- <cell fill="both" weightx="1" weighty="1" rows='5'>
+ <cell fill="both" weightx="1" weighty="1" rows='6'>
<JScrollPane>
<org.jdesktop.swingx.JXTreeTable id="treeTable"
selectionMode="{ListSelectionModel.SINGLE_SELECTION}"
@@ -64,10 +64,16 @@
enabled="{isSelectedRow()}"/>
</cell>
</row>
- <row>
+ <row>
<cell fill="horizontal">
<JButton id="importButton" text="lima.importexport.import"
onActionPerformed="getHandler().importFinancialStatementChart()"/>
</cell>
</row>
+ <row>
+ <cell fill="horizontal">
+ <JButton id="checkButton" text="lima.financialstament.check"
+ onActionPerformed="getHandler().financialStatementChartCheck()"/>
+ </cell>
+ </row>
</Table>
\ No newline at end of file
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartViewHandler.java 2010-08-05 10:50:11 UTC (rev 2996)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartViewHandler.java 2010-08-06 14:01:37 UTC (rev 2997)
@@ -302,6 +302,18 @@
}
+ public void financialStatementChartCheck(){
+ String result;
+ try {
+ result = financialStatementService.checkFinancialStatementChart();
+ DialogHelper.showReportDialog(result, _("lima.financialstatement.check"), view);
+
+ } catch (LimaException e) {
+ log.error("Can't check financialstatement chart",e);
+ }
+
+ }
+
@Override
public void notifyMethod(String serviceName, String methodName) {
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementHeaderForm.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementHeaderForm.jaxx 2010-08-05 10:50:11 UTC (rev 2996)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementHeaderForm.jaxx 2010-08-06 14:01:37 UTC (rev 2997)
@@ -22,6 +22,21 @@
<script>
<![CDATA[
+ import org.chorem.lima.entity.FinancialStatementImpl;
+ import org.chorem.lima.FinancialStatementWayEnum;
+
+
+ protected void getFinancialStatementWayValue(){
+
+ FinancialStatementWayEnum fSWE =
+ (FinancialStatementWayEnum) wayEnumEditor.getSelectedItem();
+
+ if (fSWE == null){
+ fSWE = FinancialStatementWayEnum.BOTH;
+ }
+ getFinancialStatement().setWay(fSWE);
+ }
+
getRootPane().setDefaultButton(ok);
protected void performCancel() {
setFinancialStatement(null);
@@ -57,6 +72,14 @@
</cell>
</row>
<row>
+ <cell>
+ <EnumEditor id='wayEnumEditor'
+ selectedItem="{getFinancialStatement().getWay()}"
+ constructorParams='org.chorem.lima.FinancialStatementWayEnum.class'
+ onActionPerformed="getFinancialStatementWayValue()"/>
+ </cell>
+ </row>
+ <row>
<cell fill="none">
<JButton text="lima.common.cancel" onActionPerformed="performCancel()"/>
</cell>
Deleted: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/LetteringView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/LetteringView.jaxx 2010-08-05 10:50:11 UTC (rev 2996)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/LetteringView.jaxx 2010-08-06 14:01:37 UTC (rev 2997)
@@ -1,122 +0,0 @@
-<!-- ##% Lima Swing
- Copyright (C) 2008 - 2010 CodeLutin
- This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License
- as published by the Free Software Foundation; either version 2
- of the License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- ##% -->
-
-<Table fill="both">
- <script>
- <![CDATA[
- import org.chorem.lima.entity.Account;
- import org.jdesktop.swingx.autocomplete.AutoCompleteDecorator;
- import org.jdesktop.swingx.autocomplete.ObjectToStringConverter;
-
- // Swingx auto complete (for account) :
- AutoCompleteDecorator.decorate(accountComboBox, new ObjectToStringConverter() {
- @Override
- public String getPreferredStringForItem(Object item) {
- if (item == null) {
- return "";
- }
- Account account = (Account) item;
- return account.getAccountNumber() + " : " + account.getLabel();
- }
- });
-
- protected void addLettering() {
- // never been implemented :(
- };
- protected void removeLettering() {
- // never been implemented :(
- };
- ]]>
- </script>
- <row>
- <cell>
- <Table>
- <!-- account -->
- <row fill="horizontal" weightx="1" anchor="center">
- <cell anchor="east">
- <JLabel text="lima.account"/>
- </cell>
- <cell>
- <org.chorem.lima.widgets.JWideComboBox id="accountComboBox"
- model="{new org.chorem.lima.ui.combobox.AccountComboBoxModel()}" />
- </cell>
- </row>
- <!-- from -->
- <row fill="horizontal" weightx="1" anchor="center">
- <cell anchor="east">
- <JLabel text="lima.lettering.from"/>
- </cell>
- <cell>
- <org.chorem.lima.widgets.JWideComboBox id="fromPeriodComoboBox" />
- </cell>
- </row>
- <!-- to -->
- <row fill="horizontal" weightx="1" anchor="center">
- <cell anchor="east">
- <JLabel text="lima.lettering.to"/>
- </cell>
- <cell>
- <org.chorem.lima.widgets.JWideComboBox id="toPeriodComoboBox" />
- </cell>
- </row>
- </Table>
- </cell>
- <cell>
- <!-- entries -->
- <Table fill="both">
- <row columns="3">
- <cell>
- <JLabel text="lima.lettering.entries"/>
- </cell>
- </row>
- <row>
- <cell>
- <JRadioButton buttonGroup='entryButtons' text='lima.lettering.lettered'
- value='{_("lima.lettering.lettered")}' selected='true'/>
- </cell>
- <cell>
- <JRadioButton buttonGroup='entryButtons' text='lima.lettering.notlettered'
- value='{_("lima.lettering.notlettered")}'/>
- </cell>
- <cell>
- <JRadioButton buttonGroup='entryButtons' text='lima.lettering.letteredall'
- value='{_("lima.lettering.letteredall")}'/>
- </cell>
- </row>
- </Table>
- </cell>
- </row>
- <row columns="2" weightx="1" weighty="1" anchor="center" fill="both">
- <cell>
- <JScrollPane>
- <org.jdesktop.swingx.JXTable id="letteringTable" />
- </JScrollPane>
- </cell>
- </row>
- <row>
- <cell>
- <!-- add lettering -->
- <JButton id="addButton" text="lima.lettering.add"
- onActionPerformed="addLettering()"/>
- </cell>
- <cell>
- <!-- remove lettering -->
- <JButton id="removeButton" text="lima.lettering.remove"
- onActionPerformed="removeLettering()"/>
- </cell>
- </row>
-</Table>
\ No newline at end of file
Added: trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerFilterTextField.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerFilterTextField.java (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerFilterTextField.java 2010-08-06 14:01:37 UTC (rev 2997)
@@ -0,0 +1,58 @@
+/*
+ * *##% Lima Swing
+ * Copyright (C) 2008 - 2010 CodeLutin
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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>. ##%*
+ */
+
+package org.chorem.lima.ui.ledger;
+
+import java.awt.event.KeyEvent;
+import java.awt.event.KeyListener;
+import javax.swing.JTextField;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+public class LedgerFilterTextField extends JTextField implements KeyListener {
+
+ private static final long serialVersionUID = 1L;
+
+ private static final Log log =
+ LogFactory.getLog(LedgerFilterTextField.class);
+
+ protected LedgerViewHandler handler;
+
+ public LedgerFilterTextField(LedgerViewHandler handler) {
+ this.handler = handler;
+ addKeyListener(this);
+ }
+
+ @Override
+ public void keyPressed(KeyEvent e) {
+
+ }
+
+ @Override
+ public void keyReleased(KeyEvent e) {
+ handler.setAccountFilter(getText());
+
+ }
+
+ @Override
+ public void keyTyped(KeyEvent e) {
+
+ }
+
+}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerView.jaxx 2010-08-05 10:50:11 UTC (rev 2996)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerView.jaxx 2010-08-06 14:01:37 UTC (rev 2997)
@@ -26,8 +26,6 @@
import org.apache.commons.lang.time.DateUtils;
import java.util.Calendar;
- getRootPane().setDefaultButton(filter);
-
// get begin date
Calendar calendarBegin = Calendar.getInstance();
// set begindate to JAN 1 - 0:00.000 of this years
@@ -65,11 +63,10 @@
onActionPerformed="getHandler().setEndDate(endDatePicker.getDate())"/>
</cell>
<cell anchor="east">
- <JTextField id="accountFilter"/>
+ <JLabel text="lima.accountsreports.accountfilter"/>
</cell>
<cell anchor="west">
- <JButton id="filter" text="lima.accountsreports.accountfilter"
- onActionPerformed="getHandler().setAccountFilter(accountFilter.getText())"/>
+ <JTextField javaBean="new org.chorem.lima.ui.ledger.LedgerFilterTextField(getHandler())"/>
</cell>
<cell anchor="center">
<JCheckBox id='movmentedFilter' text='lima.accountsreports.movmentedfilter' selected='false'
Modified: trunk/lima-swing/src/main/resources/i18n/lima-swing-en_GB.properties
===================================================================
--- trunk/lima-swing/src/main/resources/i18n/lima-swing-en_GB.properties 2010-08-05 10:50:11 UTC (rev 2996)
+++ trunk/lima-swing/src/main/resources/i18n/lima-swing-en_GB.properties 2010-08-06 14:01:37 UTC (rev 2997)
@@ -96,8 +96,12 @@
lima.export.all=Export all datas (XML)
lima.export.all.csv=Exporter all datas (CSV)
lima.financialperiod.block=
+lima.financialstament.check=
lima.financialstatement.accounts=
+lima.financialstatement.check=
+lima.financialstatement.credit=
lima.financialstatement.creditaccounts=
+lima.financialstatement.debit=
lima.financialstatement.debitaccounts=
lima.financialstatement.delete=
lima.financialstatement.formula=
Modified: trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties
===================================================================
--- trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties 2010-08-05 10:50:11 UTC (rev 2996)
+++ trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties 2010-08-06 14:01:37 UTC (rev 2997)
@@ -91,7 +91,10 @@
lima.export.all=Exporter toutes les donn\u00E9es (XML)
lima.export.all.csv=Exporter toutes les donn\u00E9es (CSV)
lima.financialperiod.block=Cloturer une p\u00E9riode
+lima.financialstament.check=
lima.financialstatement.accounts=Liste de comptes au cr\u00E9dit et au d\u00E9bit
+lima.financialstatement.check=
+lima.financialstatement.credit=Sens du poste \: d\u00E9bit
lima.financialstatement.creditaccounts=Liste de comptes au cr\u00E9dit
lima.financialstatement.debitaccounts=Liste de comptes au d\u00E9bit
lima.financialstatement.delete=Supprimer le plan BCR actuel avant d'importer
1
0
Author: jpepin
Date: 2010-08-05 12:50:11 +0200 (Thu, 05 Aug 2010)
New Revision: 2996
Url: http://chorem.org/repositories/revision/lima/2996
Log:
Ajout choix de format sur la servlet : html ou pdf.
Ajout d'une propertie de config vers l'adresse du server dans l'ui.
Ajout dans l'ui appel des documents du serveur http.
Modification d'icones.
Added:
trunk/lima-business/src/main/java/org/chorem/lima/business/utils/FormatsEnum.java
trunk/lima-swing/src/main/resources/icons/action-documents.png
Removed:
trunk/lima-swing/src/main/resources/icons/action-print.png
Modified:
trunk/lima-business/src/main/java/org/chorem/lima/business/LimaConfig.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/HttpServerServiceImpl.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/DocumentService.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/ReportService.java
trunk/lima-business/src/main/java/org/chorem/lima/business/utils/DocumentsEnum.java
trunk/lima-business/src/main/resources/lima.properties
trunk/lima-swing/src/main/java/org/chorem/lima/LimaConfig.java
trunk/lima-swing/src/main/java/org/chorem/lima/LimaMain.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceViewHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsViewHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportTableModel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportViewHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerViewHandler.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/icons/action-export-element.png
trunk/lima-swing/src/main/resources/icons/action-import-element.png
trunk/lima-swing/src/main/resources/lima-config.properties
trunk/pom.xml
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/LimaConfig.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/LimaConfig.java 2010-08-04 17:59:27 UTC (rev 2995)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/LimaConfig.java 2010-08-05 10:50:11 UTC (rev 2996)
@@ -119,7 +119,7 @@
}
}
instance.setOption("topia.persistence.classes", LimaCallaoDAOHelper.getImplementationClassesAsString());
- }
+ }
/**
* Lima option definition.
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/DocumentServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/DocumentServiceImpl.java 2010-08-04 17:59:27 UTC (rev 2995)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/DocumentServiceImpl.java 2010-08-05 10:50:11 UTC (rev 2996)
@@ -46,7 +46,9 @@
import org.chorem.lima.business.ejbinterface.FinancialStatementService;
import org.chorem.lima.business.ejbinterface.IdentityService;
import org.chorem.lima.business.ejbinterface.ReportService;
+import org.chorem.lima.business.utils.DocumentsEnum;
import org.chorem.lima.business.utils.EntryComparator;
+import org.chorem.lima.business.utils.FormatsEnum;
import org.chorem.lima.entity.Account;
import org.chorem.lima.entity.ClosedPeriodicEntryBook;
import org.chorem.lima.entity.ClosedPeriodicEntryBookDAO;
@@ -58,8 +60,6 @@
import org.chorem.lima.entity.FinancialTransaction;
import org.chorem.lima.entity.Identity;
import org.chorem.lima.entity.LimaCallaoDAOHelper;
-import org.mortbay.jetty.Server;
-import org.mortbay.jetty.handler.ResourceHandler;
import org.nuiton.topia.TopiaContext;
import org.nuiton.topia.TopiaContextFactory;
import org.nuiton.topia.TopiaException;
@@ -225,7 +225,7 @@
@Override
- public void createFinancialStatementsDocuments(Date beginDate, Date endDate) throws LimaException {
+ public void createFinancialStatementsDocuments(Date beginDate, Date endDate, FormatsEnum format) throws LimaException {
Document document = new Document(PageSize.A4, 8, 8, 8, 8);
List<FinancialStatementAmounts> financialStatementAmounts =
@@ -236,10 +236,16 @@
String dateS = dateFormat.format(newDate);
String hourS = hourFormat.format(newDate);
- PdfWriter pdfWriter = PdfWriter.getInstance(document,
- new FileOutputStream(path+File.separator+"lima_financialstatements.pdf"));
- HtmlWriter htmlWriter = HtmlWriter.getInstance(document,
- new FileOutputStream(path+File.separator+"lima_financialstatements.html"));
+ String filePath = path+File.separator+DocumentsEnum.FINANCIALSTATEMENT.getFileName();
+ FileOutputStream fileOut = new FileOutputStream(filePath+format.getExtension());
+ switch (format) {
+ case HTML:
+ HtmlWriter htmlWriter = HtmlWriter.getInstance(document, fileOut);
+ break;
+ case PDF:
+ PdfWriter pdfWriter = PdfWriter.getInstance(document, fileOut);
+ break;
+ }
document.open();
int nbpages = 1;
@@ -270,11 +276,16 @@
for (List<FinancialStatementAmounts> list : listList) {
String title = list.get(0).getLabel();
//list = list.subList(1, list.size());
- int i=0;
- int n=list.size();
- while (i<n){
- int j=i+35;
- if (j>n){
+ int i = 0;
+ int n = list.size();
+ int max = n;
+ // alloc nb rows max for pdf documents on one page
+ if (format == FormatsEnum.PDF){
+ max = 35;
+ }
+ while (i < n){
+ int j = i + max;
+ if (j > n){
j = n;
}
List <FinancialStatementAmounts> subFinancialStatementAmounts =
@@ -300,7 +311,7 @@
chapter.add(paragraphTable);
//add page
document.add(chapter);
- i=i+35;
+ i = i + max;
nbpages++;
}
}
@@ -444,12 +455,12 @@
@Override
- public void createLedgerDocuments(Date beginDate, Date endDate) throws LimaException {
+ public void createLedgerDocuments(Date beginDate, Date endDate, FormatsEnum format) throws LimaException {
Document document = new Document(PageSize.A4, 8, 8, 8, 8);
List<Object> list = new ArrayList<Object>();
try {
- BalanceTrial balanceTrial = reportService.generateLedger(beginDate, endDate, true);
+ BalanceTrial balanceTrial = reportService.generateLedger(beginDate, endDate, null, true);
if (balanceTrial.getReportsDatas() != null){
for (ReportsDatas reportsDatas : balanceTrial.getReportsDatas()) {
list.add(reportsDatas);
@@ -469,22 +480,31 @@
Double currentAmountCredit = 0.0;
String accountcarry ="";
- PdfWriter pdfWriter = PdfWriter.getInstance(document,
- new FileOutputStream(path+File.separator+"lima_ledger.pdf"));
- HtmlWriter htmlWriter = HtmlWriter.getInstance(document,
- new FileOutputStream(path+File.separator+"lima_ledger.html"));
+ String filePath = path+File.separator+DocumentsEnum.LEDGER.getFileName();
+ FileOutputStream fileOut = new FileOutputStream(filePath+format.getExtension());
+ switch (format) {
+ case HTML:
+ HtmlWriter htmlWriter = HtmlWriter.getInstance(document, fileOut);
+ break;
+ case PDF:
+ PdfWriter pdfWriter = PdfWriter.getInstance(document, fileOut);
+ break;
+ }
document.open();
int nbpages = 1;
Identity identity = identityService.getIdentity();
//create pages
- String title = _("lima-business.document.ledger");
- int i=0;
- int n=list.size();
- int max = 32;
- while (i<n){
- int j = i+max;
- if (j>n){
+ int i = 0;
+ int n = list.size();
+ int max = n;
+ // alloc nb rows max for pdf documents on one page
+ if (format == FormatsEnum.PDF){
+ max = 32;
+ }
+ while (i < n){
+ int j = i + max;
+ if (j > n){
j = n;
}
List <Object> subList = list.subList(i, j);
@@ -493,7 +513,7 @@
//new page
Chapter chapter = new Chapter(0);
//headerPage
- chapter.add(createHeaderPage(title, identity,
+ chapter.add(createHeaderPage(DocumentsEnum.LEDGER.getDescription(), identity,
dateFormat.format(beginDate), dateFormat.format(endDate)));
//n° page
chapter.add(createNumberPage(nbpages, dateS, hourS));
@@ -530,7 +550,7 @@
}
}
//forward amounts
- if (n>max && i<=n-max){
+ if (n > max && i <= n-max){
Paragraph forwardParagraph = new Paragraph();
forwardParagraph.add(createLedgerAmountTable("",
_("lima-business.document.carryforward"),
@@ -538,7 +558,7 @@
chapter.add(forwardParagraph);
}
//final amounts
- if (i>=n-max){
+ if (i >= n-max){
Paragraph finalAmountParagraph = new Paragraph();
finalAmountParagraph.add(createLedgerAmountTable("",
_("lima-business.document.amounts"),
@@ -547,7 +567,7 @@
}
//add page
document.add(chapter);
- i=i+max;
+ i = i + max;
nbpages++;
}
document.close();
@@ -696,7 +716,7 @@
@Override
- public void createEntryBooksDocuments(Date beginDate, Date endDate) throws LimaException {
+ public void createEntryBooksDocuments(Date beginDate, Date endDate, FormatsEnum format) throws LimaException {
Document document = new Document(PageSize.A4, 8, 8, 8, 8);
TopiaContext transaction = null;
@@ -706,109 +726,117 @@
Date newDate = new Date();
String dateS = dateFormat.format(newDate);
String hourS = hourFormat.format(newDate);
- String fileDateS = filedateFormat.format(newDate);
- log.debug(path);
- PdfWriter pdfWriter = PdfWriter.getInstance(document,
- new FileOutputStream(path+File.separator+"lima_entrybooks.pdf"));
- HtmlWriter htmlWriter = HtmlWriter.getInstance(document,
- new FileOutputStream(path+File.separator+"lima_entrybooks.html"));
- document.open();
- int nbpages = 1;
+ String filePath = path+File.separator+DocumentsEnum.ENTRYBOOKS.getFileName();
+ FileOutputStream fileOut = new FileOutputStream(filePath+format.getExtension());
+ switch (format) {
+ case HTML:
+ HtmlWriter htmlWriter = HtmlWriter.getInstance(document, fileOut);
+ break;
+ case PDF:
+ PdfWriter pdfWriter = PdfWriter.getInstance(document, fileOut);
+ break;
+ }
+ document.open();
+ int nbpages = 1;
+
+ Identity identity = identityService.getIdentity();
+
+ ClosedPeriodicEntryBookDAO closedPeriodicEntryBookDAO =
+ LimaCallaoDAOHelper.getClosedPeriodicEntryBookDAO(transaction);
+ EntryDAO entryDAO = LimaCallaoDAOHelper.getEntryDAO(transaction);
+ //Split list by financialstatement type
+ List<ClosedPeriodicEntryBook> closedPeriodicEntryBookList =
+ closedPeriodicEntryBookDAO.findAllByDates(beginDate, endDate);
+ for (ClosedPeriodicEntryBook closedPeriodicEntryBook : closedPeriodicEntryBookList) {
- Identity identity = identityService.getIdentity();
+ TopiaQuery query = entryDAO.createQuery();
+ String financialPeriodProperty =
+ TopiaQuery.getProperty(Entry.FINANCIAL_TRANSACTION,
+ FinancialTransaction.FINANCIAL_PERIOD);
+ String entryBookProperty =
+ TopiaQuery.getProperty(Entry.FINANCIAL_TRANSACTION,
+ FinancialTransaction.ENTRY_BOOK);
+ query.addWhere(financialPeriodProperty, Op.EQ,
+ closedPeriodicEntryBook.getFinancialPeriod())
+ .addWhere(entryBookProperty, Op.EQ,
+ closedPeriodicEntryBook.getEntryBook());
- ClosedPeriodicEntryBookDAO closedPeriodicEntryBookDAO =
- LimaCallaoDAOHelper.getClosedPeriodicEntryBookDAO(transaction);
- EntryDAO entryDAO = LimaCallaoDAOHelper.getEntryDAO(transaction);
- //Split list by financialstatement type
- List<ClosedPeriodicEntryBook> closedPeriodicEntryBookList =
- closedPeriodicEntryBookDAO.findAllByDates(beginDate, endDate);
- for (ClosedPeriodicEntryBook closedPeriodicEntryBook : closedPeriodicEntryBookList) {
-
- TopiaQuery query = entryDAO.createQuery();
- String financialPeriodProperty =
- TopiaQuery.getProperty(Entry.FINANCIAL_TRANSACTION,
- FinancialTransaction.FINANCIAL_PERIOD);
- String entryBookProperty =
- TopiaQuery.getProperty(Entry.FINANCIAL_TRANSACTION,
- FinancialTransaction.ENTRY_BOOK);
- query.addWhere(financialPeriodProperty, Op.EQ,
- closedPeriodicEntryBook.getFinancialPeriod())
- .addWhere(entryBookProperty, Op.EQ,
- closedPeriodicEntryBook.getEntryBook());
-
- List<Entry> entries = entryDAO.findAllByQuery(query);
-
- List<Object[]> results = new ArrayList<Object[]>();
- Double debit = 0.0;
- Double credit = 0.0;
- query.setSelect(Entry.DEBIT, "SUM("+Entry.AMOUNT+")");
- query.addGroup(Entry.DEBIT);
- results = query.execute(transaction);
- int nbAmount = results.size();
- if(nbAmount==2){
- debit = (Double)results.get(0)[1];
- credit = (Double)results.get(1)[1];
- }
- if (nbAmount==1){
- if ((Boolean)results.get(0)[0]){
- debit = (Double)results.get(0)[1];
- }
- else {
- credit = (Double)results.get(0)[1];
- }
- }
-
- //create pages
- String title = closedPeriodicEntryBook.getEntryBook().getLabel()
- + "\n" + monthYearFormat.format(
- closedPeriodicEntryBook.getFinancialPeriod().getBeginDate());
- //list = list.subList(1, list.size());
- int i=0;
- int n=entries.size();
- int max=35;
- while (i<n){
- int j=i+max;
- if (j>n){
- j = n;
- }
- List <Entry> subEntries =
- entries.subList(i, j);
- //create page : header + table + footer
- Table headerTable = createEntryBooksHeaderTable();
- Table table = createEntryBooksTable(subEntries);
- //new page
- Chapter chapter = new Chapter(0);
- //headerPage
- chapter.add(createHeaderPage(title, identity,
- dateFormat.format(beginDate), dateFormat.format(endDate)));
- //n° page
- chapter.add(createNumberPage(nbpages, dateS, hourS));
- //headerTable
- Paragraph paragraphHeaderTable = new Paragraph();
- paragraphHeaderTable.add(headerTable);
- chapter.add(paragraphHeaderTable);
- //table
- Paragraph paragraphTable = new Paragraph();
- paragraphTable.add(table);
- chapter.add(paragraphTable);
- //final amounts
- if (i>=n-max){
- Paragraph finalAmountParagraph = new Paragraph();
- finalAmountParagraph.add(createEntryBooksAmountTable(
- _("lima-business.document.amounts"), debit, credit));
- chapter.add(finalAmountParagraph);
- }
- //add page
- document.add(chapter);
- i=i+max;
- nbpages++;
+ List<Entry> entries = entryDAO.findAllByQuery(query);
+
+ List<Object[]> results = new ArrayList<Object[]>();
+ Double debit = 0.0;
+ Double credit = 0.0;
+ query.setSelect(Entry.DEBIT, "SUM("+Entry.AMOUNT+")");
+ query.addGroup(Entry.DEBIT);
+ results = query.execute(transaction);
+ int nbAmount = results.size();
+ if(nbAmount==2){
+ debit = (Double)results.get(0)[1];
+ credit = (Double)results.get(1)[1];
+ }
+ if (nbAmount==1){
+ if ((Boolean)results.get(0)[0]){
+ debit = (Double)results.get(0)[1];
+ }
+ else {
+ credit = (Double)results.get(0)[1];
+ }
+ }
+
+ //create pages
+ String title = closedPeriodicEntryBook.getEntryBook().getLabel()
+ + "\n" + monthYearFormat.format(
+ closedPeriodicEntryBook.getFinancialPeriod().getBeginDate());
+ //list = list.subList(1, list.size());
+ int i = 0;
+ int n = entries.size();
+ int max = n;
+ // alloc nb rows max for pdf documents on one page
+ if (format == FormatsEnum.PDF){
+ max = 35;
+ }
+ while (i < n){
+ int j = i + max;
+ if (j > n){
+ j = n;
}
+ List <Entry> subEntries =
+ entries.subList(i, j);
+ //create page : header + table + footer
+ Table headerTable = createEntryBooksHeaderTable();
+ Table table = createEntryBooksTable(subEntries);
+ //new page
+ Chapter chapter = new Chapter(0);
+ //headerPage
+ chapter.add(createHeaderPage(title, identity,
+ dateFormat.format(beginDate), dateFormat.format(endDate)));
+ //n° page
+ chapter.add(createNumberPage(nbpages, dateS, hourS));
+ //headerTable
+ Paragraph paragraphHeaderTable = new Paragraph();
+ paragraphHeaderTable.add(headerTable);
+ chapter.add(paragraphHeaderTable);
+ //table
+ Paragraph paragraphTable = new Paragraph();
+ paragraphTable.add(table);
+ chapter.add(paragraphTable);
+ //final amounts
+ if (i>=n-max){
+ Paragraph finalAmountParagraph = new Paragraph();
+ finalAmountParagraph.add(createEntryBooksAmountTable(
+ _("lima-business.document.amounts"), debit, credit));
+ chapter.add(finalAmountParagraph);
+ }
+ //add page
+ document.add(chapter);
+ i = i + max;
+ nbpages++;
}
+ }
+
+ document.close();
- document.close();
-
} catch (FileNotFoundException eeFNFE) {
log.error("Can't create pdf file", eeFNFE);
} catch (DocumentException eeDE) {
@@ -912,7 +940,7 @@
//############## Balance ##############
@Override
- public void createBalanceDocuments(Date beginDate, Date endDate) throws LimaException {
+ public void createBalanceDocuments(Date beginDate, Date endDate, FormatsEnum format) throws LimaException {
Document document = new Document(PageSize.A4, 8, 8, 8, 8);
BalanceTrial balanceTrial =
@@ -931,22 +959,31 @@
Double currentSoldeDebit = 0.0;
Double currentSoldeCredit = 0.0;
- PdfWriter pdfWriter = PdfWriter.getInstance(document,
- new FileOutputStream(path+File.separator+"lima_balance.pdf"));
- HtmlWriter htmlWriter = HtmlWriter.getInstance(document,
- new FileOutputStream(path+File.separator+"lima_balance.html"));
+ String filePath = path+File.separator+DocumentsEnum.BALANCE.getFileName();
+ FileOutputStream fileOut = new FileOutputStream(filePath+format.getExtension());
+ switch (format) {
+ case HTML:
+ HtmlWriter htmlWriter = HtmlWriter.getInstance(document, fileOut);
+ break;
+ case PDF:
+ PdfWriter pdfWriter = PdfWriter.getInstance(document, fileOut);
+ break;
+ }
document.open();
int nbpages = 1;
Identity identity = identityService.getIdentity();
//create pages
- String title = _("lima-business.document.balance");
- int i=0;
- int n=list.size();
- int max = 26;
- while (i<n){
- int j = i+max;
- if (j>n){
+ int i = 0;
+ int n = list.size();
+ int max = n;
+ // alloc nb rows max for pdf documents on one page
+ if (format == FormatsEnum.PDF){
+ max = 26;
+ }
+ while (i < n){
+ int j = i + max;
+ if (j > n){
j = n;
}
List <ReportsDatas> subList = list.subList(i, j);
@@ -955,7 +992,7 @@
//new page
Chapter chapter = new Chapter(0);
//headerPage
- chapter.add(createHeaderPage(title, identity, dateFormat.format(beginDate), dateFormat.format(endDate)));
+ chapter.add(createHeaderPage(DocumentsEnum.BALANCE.getDescription(), identity, dateFormat.format(beginDate), dateFormat.format(endDate)));
//n° page
chapter.add(createNumberPage(nbpages, dateS, hourS));
//headerTable
@@ -985,7 +1022,7 @@
reportsDatas.getSoldeDebit() ? 0 : reportsDatas.getAmountSolde();
}
//forward amounts
- if (n>max && i<=n-max){
+ if (n > max && i <= n-max){
Paragraph forwardParagraph = new Paragraph();
forwardParagraph.add(createBalanceAmountTable(
_("lima-business.document.carryforward"),
@@ -994,7 +1031,7 @@
chapter.add(forwardParagraph);
}
//final amounts
- if (i>=n-max){
+ if (i >= n-max){
Paragraph finalAmountParagraph = new Paragraph();
finalAmountParagraph.add(createBalanceAmountTable(
_("lima-business.document.amounts"),
@@ -1004,7 +1041,7 @@
}
//add page
document.add(chapter);
- i=i+max;
+ i = i + max;
nbpages++;
}
document.close();
@@ -1111,7 +1148,7 @@
@Override
- public void createGeneralEntryBooksDocuments(Date beginDate, Date endDate) throws LimaException {
+ public void createGeneralEntryBooksDocuments(Date beginDate, Date endDate, FormatsEnum format) throws LimaException {
Document document = new Document(PageSize.A4, 8, 8, 8, 8);
TopiaContext transaction = null;
@@ -1121,10 +1158,17 @@
Date newDate = new Date();
String dateS = dateFormat.format(newDate);
String hourS = hourFormat.format(newDate);
- PdfWriter pdfWriter = PdfWriter.getInstance(document,
- new FileOutputStream(path+File.separator+"lima_general_entybook.pdf"));
- HtmlWriter htmlWriter = HtmlWriter.getInstance(document,
- new FileOutputStream(path+File.separator+"lima_general_entybook.html"));
+
+ String filePath = path+File.separator+DocumentsEnum.GENERAL_ENTRYBOOK.getFileName();
+ FileOutputStream fileOut = new FileOutputStream(filePath+format.getExtension());
+ switch (format) {
+ case HTML:
+ HtmlWriter htmlWriter = HtmlWriter.getInstance(document, fileOut);
+ break;
+ case PDF:
+ PdfWriter pdfWriter = PdfWriter.getInstance(document, fileOut);
+ break;
+ }
document.open();
int nbpages = 1;
@@ -1178,11 +1222,11 @@
results = query.execute(transaction);
int nbAmount = results.size();
- if(nbAmount==2){
+ if(nbAmount == 2){
debit = (Double)results.get(0)[1];
credit = (Double)results.get(1)[1];
}
- if (nbAmount==1){
+ if (nbAmount == 1){
if ((Boolean)results.get(0)[0]){
debit = (Double)results.get(0)[1];
}
@@ -1224,12 +1268,16 @@
//create pages
- int i=0;
- int n=list.size();
- int max=35;
- while (i<n){
- int j=i+max;
- if (j>n){
+ int i = 0;
+ int n = list.size();
+ int max = n;
+ // alloc nb rows max for pdf documents on one page
+ if (format == FormatsEnum.PDF){
+ max = 35;
+ }
+ while (i < n){
+ int j = i + max;
+ if (j > n){
j = n;
}
List <GeneralEntryBooksDatas> subList =
@@ -1241,7 +1289,7 @@
Chapter chapter = new Chapter(0);
//headerPage
chapter.add(createHeaderPage(
- _("lima-business.document.generalentrybook"),
+ DocumentsEnum.GENERAL_ENTRYBOOK.getDescription(),
identity, dateFormat.format(beginDate),
dateFormat.format(endDate)));
//n° page
@@ -1256,7 +1304,7 @@
chapter.add(paragraphTable);
//add page
document.add(chapter);
- i=i+max;
+ i = i + max;
nbpages++;
}
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/HttpServerServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/HttpServerServiceImpl.java 2010-08-04 17:59:27 UTC (rev 2995)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/HttpServerServiceImpl.java 2010-08-05 10:50:11 UTC (rev 2996)
@@ -21,16 +21,9 @@
package org.chorem.lima.business.ejb;
import static org.nuiton.i18n.I18n._;
-
-import java.awt.Image;
-import java.awt.image.BufferedImage;
-import java.io.BufferedInputStream;
-import java.io.BufferedReader;
import java.io.File;
-import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
-import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.URL;
import java.text.ParseException;
@@ -39,13 +32,11 @@
import java.util.Date;
import javax.ejb.EJB;
import javax.ejb.Stateless;
-import javax.imageio.ImageIO;
import javax.servlet.Servlet;
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.lang.time.DateUtils;
import org.apache.commons.logging.Log;
@@ -56,13 +47,10 @@
import org.chorem.lima.business.ejbinterface.HttpServerService;
import org.chorem.lima.business.ejbinterface.HttpServerServiceLocal;
import org.chorem.lima.business.utils.DocumentsEnum;
+import org.chorem.lima.business.utils.FormatsEnum;
import org.mortbay.jetty.Server;
-import org.mortbay.jetty.AbstractGenerator.Output;
import org.mortbay.jetty.servlet.Context;
import org.mortbay.jetty.servlet.ServletHolder;
-import org.nuiton.topia.TopiaContext;
-import org.nuiton.topia.TopiaContextFactory;
-import org.nuiton.topia.TopiaNotFoundException;
import org.nuiton.util.Resource;
@@ -71,9 +59,7 @@
private static final Log log =
LogFactory.getLog(HttpServerServiceImpl.class);
-
- private TopiaContext rootContext;
-
+
@EJB
DocumentService documentService;
@@ -81,37 +67,30 @@
protected String path;
+ protected int port;
+
private static SimpleDateFormat dateFormat =
new SimpleDateFormat("yyyy-MM-dd");
public HttpServerServiceImpl() {
- LimaConfig config = LimaConfig.getInstance();
- try {
- rootContext = TopiaContextFactory.getContext(config.getOptions());
- } catch (TopiaNotFoundException ex) {
- if (log.isErrorEnabled()) {
- log.error("Can't init topia context", ex);
- }
- }
path = LimaConfig.getInstance().getReportsDir();
-
+ port = LimaConfig.getInstance().getHttpPort();
}
/** start the server */
+ @Override
public void start() {
if (server == null) {
- int port = LimaConfig.getInstance().getHttpPort();
new File(path).mkdir();
- String imagesPath = getClass().getResource("/images").toExternalForm();
try {
server = new Server(port);
Context root = new Context(server, "/", Context.NO_SESSIONS);
root.addServlet(new ServletHolder((Servlet) new MainServlet()), "/");
-
server.start();
+
log.info("Web server are running on port: "+port);
} catch (Exception eee) {
@@ -121,18 +100,31 @@
}
- /** this servlet send a static html page */
+
+ @Override
+ public int getHttpPort() {
+ return port;
+ }
+
+
+ /** this servlet send a static html page */
public class MainServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
String serverAddressConfig = LimaConfig.getInstance().getAddressServer();
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
+
+ //get all params
String imageParam = req.getParameter("img");
- log.info(imageParam);
+ String model = req.getParameter("model");
+ String format = req.getParameter("format");
+ String beginDate = req.getParameter("beginDate");
+ String endDate = req.getParameter("endDate");
+
+ //if image
if (imageParam != null){
URL image = Resource.getURLOrNull("images/"+imageParam);
- log.info("image :"+image);
if (image != null){
resp.setContentType("image/png");
InputStream in = image.openStream();
@@ -140,8 +132,51 @@
IOUtils.copy(in, out);
}
}
+ //if doc pdf or html
+ else if (model != null && format != null && beginDate != null && endDate != null){
+ FormatsEnum formatsEnum = FormatsEnum.valueOfExtension(format);
+ URL doc = new URL("file:" + path + File.separator
+ + model +formatsEnum.getExtension());
+ //create docs
+ try {
+ Date beginDateFormat = dateFormat.parse(beginDate);
+ Date endDateFormat = dateFormat.parse(endDate);
+
+ switch (DocumentsEnum.valueOfLink(model)) {
+ case BALANCE:
+ documentService.createBalanceDocuments(
+ beginDateFormat, endDateFormat, formatsEnum);
+ break;
+ case ENTRYBOOKS:
+ documentService.createEntryBooksDocuments(
+ beginDateFormat, endDateFormat, formatsEnum);
+ break;
+ case FINANCIALSTATEMENT:
+ documentService.createFinancialStatementsDocuments(
+ beginDateFormat, endDateFormat, formatsEnum);
+ break;
+ case GENERAL_ENTRYBOOK:
+ documentService.createGeneralEntryBooksDocuments(
+ beginDateFormat, endDateFormat, formatsEnum);
+ break;
+ case LEDGER:
+ documentService.createLedgerDocuments(
+ beginDateFormat, endDateFormat, formatsEnum);
+ break;
+ }
+ } catch (LimaException eeeLE) {
+ log.error("Can't call document service for create html document", eeeLE);
+ } catch (ParseException eeePE) {
+ log.error("Can't parse date", eeePE);
+ }
+ resp.setContentType(formatsEnum.getMimeType());
+ InputStream in = doc.openStream();
+ OutputStream out = resp.getOutputStream();
+ IOUtils.copy(in, out);
+ }
+ // else return home html
else {
- resp.setContentType("text/html");
+ resp.setContentType(FormatsEnum.HTML.getMimeType());
String pageContent = "";
String serverAdress = "http://";
@@ -149,94 +184,73 @@
/** create server Address : static config if exist or dynamical adress */
if (serverAddressConfig.equals("")){
- serverAdress += req.getServerName() + ":" + req.getServerPort();
+ serverAdress += req.getServerName()
+ + ":" + req.getServerPort();
}
else {
serverAdress += serverAddressConfig + ":"
+ LimaConfig.getInstance().getHttpPort();
}
-
- String link = req.getParameter("link");
- String beginDate = req.getParameter("beginDate");
- String endDate = req.getParameter("endDate");
-
- if (link != null && beginDate != null && endDate != null){
- try {
- Date beginDateFormat = dateFormat.parse(beginDate);
- Date endDateFormat = dateFormat.parse(endDate);
- switch (DocumentsEnum.valueOfLink(link)) {
- case BALANCE:
- documentService.createBalanceDocuments(beginDateFormat, endDateFormat);
- break;
- case ENTRYBOOKS:
- documentService.createEntryBooksDocuments(beginDateFormat, endDateFormat);
- break;
- case FINANCIALSTATEMENT:
- documentService.createFinancialStatementsDocuments(beginDateFormat, endDateFormat);
- break;
- case GENERAL_ENTRYBOOK:
- documentService.createGeneralEntryBooksDocuments(beginDateFormat, endDateFormat);
- break;
- case LEDGER:
- documentService.createLedgerDocuments(beginDateFormat, endDateFormat);
- break;
- }
- } catch (LimaException eeeLE) {
- log.error("Can't call document service for create html document", eeeLE);
- } catch (ParseException eeePE) {
- log.error("Can't parse date", eeePE);
- }
- pageContent = extractFile(path+File.separatorChar+link);
- }
- else {
-
- Calendar calendar = Calendar.getInstance();
- Date endDatePicker = calendar.getTime();
- Date beginDatePicker = calendar.getTime();
- beginDatePicker = DateUtils.truncate(beginDatePicker, Calendar.YEAR);
-
- pageContent = "<!DOCTYPE html>\n"
- + "<html lang=\"fr\">\n"
- + "<head>\n"
- + "<title>LIMA Documents Report</title>\n"
- + "<style type=\"text/css\">"
- + "body { font: 14px sans-serif; }"
- + "h1 { font: 20px sans-serif; text-align: center; }"
- + "table.paddingleft td {padding-left:100px;}"
- + ".tdright {text-align: right;}"
- + "</style>"
- + "</head>\n"
- + "<body>\n"
- + "<table class=\"paddingleft\">\n"
- + "<tr><td colspan=2><h1>LIMA Documents Report</h1></td></tr>\n"
- + "<tr><td><img src=\"?img=identity.png\"/></td>\n"
- + "<td rowspan=3><form method=GET action=" + serverAdress + ">\n"
- + _("lima-business.document.date.begin") + "<input value=\""+dateFormat.format(beginDatePicker)
- + "\" type=\"date\" name=\"beginDate\">\n"
- + _("lima-business.document.date.end") + "<input value=\""+dateFormat.format(endDatePicker)
- + "\" type=\"date\" name=\"endDate\">\n<br/><br/>"
- + "Documents : <select name=\"link\">";
-
- for (DocumentsEnum documentsEnum : DocumentsEnum.values()) {
- pageContent += "<option value=\""+documentsEnum.getLink()+"\">"
- + documentsEnum.getDescription()+"</OPTION>\n";
- }
-
- pageContent += "<tr><td><img src=\"?img=entries.png\"/></td></tr>\n"
- + "<tr><td><img src=\"?img=accounts.png\"/></td></tr>\n"
- + "<tr><td><img src=\"?img=entrybooks.png\"/></td>\n"
- + "</select>\n<br/><br/>"
- + "<td class=\"tdright\"><input type=\"submit\"></td></tr>"
- + "</form>\n"
- + "<tr><td><img src=\"?img=fiscalperiods.png\"/></td></tr>\n"
- + "</table>\n"
- + "</body>\n"
- + "</html>";
- }
-
- resp.getWriter().write(pageContent);
+ Calendar calendar = Calendar.getInstance();
+ Date endDatePicker = calendar.getTime();
+ Date beginDatePicker = calendar.getTime();
+ beginDatePicker =
+ DateUtils.truncate(beginDatePicker, Calendar.YEAR);
+
+ pageContent = "<!DOCTYPE html>\n"
+ + "<html lang=\"fr\">\n"
+ + "<head>\n"
+ + "<title>LIMA Documents Report</title>\n"
+ + "<style type=\"text/css\">"
+ + "body { font: 14px sans-serif; }"
+ + "h1 { font: 20px sans-serif; text-align: center; }"
+ + "table.paddingleft td {padding-left:100px;}"
+ + ".tdright {text-align: right;}"
+ + "</style>"
+ + "</head>\n"
+ + "<body>\n"
+ + "<table class=\"paddingleft\">\n"
+ + "<tr><td colspan=2><h1>LIMA Documents Report</h1></td></tr>\n"
+ + "<tr><td><img src=\"?img=identity.png\"/></td>\n"
+ + "<td rowspan=3><form method=GET action="
+ + serverAdress + ">\n"
+ + _("lima-business.document.date.begin")
+ + "<input value=\""+dateFormat.format(beginDatePicker)
+ + "\" type=\"date\" name=\"beginDate\">\n"
+ + _("lima-business.document.date.end")
+ + "<input value=\""+dateFormat.format(endDatePicker)
+ + "\" type=\"date\" name=\"endDate\">\n<br/><br/>"
+ + "Format : <select name=\"format\">";
+
+ for (FormatsEnum formatsEnum : FormatsEnum.values()) {
+ pageContent += "<option value=\""
+ + formatsEnum.getExtension()+"\">"
+ + formatsEnum.getDescription()+"</option>\n";
+ }
+
+ pageContent += "</select>\n"
+ + "Documents : <select name=\"model\">";
+
+ for (DocumentsEnum documentsEnum : DocumentsEnum.values()) {
+ pageContent += "<option value=\""
+ + documentsEnum.getFileName()+"\">"
+ + documentsEnum.getDescription()+"</option>\n";
+ }
+
+ pageContent += "</select>\n"
+ + "<tr><td><img src=\"?img=entries.png\"/></td></tr>\n"
+ + "<tr><td><img src=\"?img=accounts.png\"/></td></tr>\n"
+ + "<tr><td><img src=\"?img=entrybooks.png\"/></td>\n"
+ + "<td class=\"tdright\"><input type=\"submit\"></td></tr>"
+ + "</form>\n"
+ + "<tr><td><img src=\"?img=fiscalperiods.png\"/></td></tr>\n"
+ + "</table>\n"
+ + "</body>\n"
+ + "</html>";
+ resp.getWriter().write(pageContent);
+
}
}
@Override
@@ -246,20 +260,5 @@
}
}
-
- public String extractFile(String filePath){
- char[] datas = new char[(int) new File(filePath).length()];
- try {
- BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(filePath)));
- in.read(datas);
- in.close();
- }
- catch (IOException eee) {
- if (log.isDebugEnabled()){
- log.debug("Can't read file "+filePath, eee);
- }
- }
- return new String(datas);
- }
}
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java 2010-08-04 17:59:27 UTC (rev 2995)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java 2010-08-05 10:50:11 UTC (rev 2996)
@@ -492,8 +492,8 @@
* Get all entries
*/
@Override
- public BalanceTrial generateLedger(Date beginDate, Date endDate, Boolean movementedFilter) throws LimaException {
- return generateBalanceTrial(beginDate, endDate, null, true, movementedFilter);
+ public BalanceTrial generateLedger(Date beginDate, Date endDate, String selectedAccounts, Boolean movementedFilter) throws LimaException {
+ return generateBalanceTrial(beginDate, endDate, selectedAccounts, true, movementedFilter);
}
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/DocumentService.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/DocumentService.java 2010-08-04 17:59:27 UTC (rev 2995)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/DocumentService.java 2010-08-05 10:50:11 UTC (rev 2996)
@@ -20,9 +20,9 @@
package org.chorem.lima.business.ejbinterface;
import java.util.Date;
-import java.util.List;
import javax.ejb.Remote;
import org.chorem.lima.business.LimaException;
+import org.chorem.lima.business.utils.FormatsEnum;
/**
* Interface to create pdf and html docs
@@ -33,10 +33,10 @@
@Remote
public interface DocumentService {
- public void createFinancialStatementsDocuments(Date beginDate, Date endDate) throws LimaException;
- public void createLedgerDocuments(Date beginDate, Date endDate) throws LimaException;
- public void createEntryBooksDocuments(Date beginDate, Date endDate) throws LimaException;
- public void createBalanceDocuments(Date beginDate, Date endDate) throws LimaException;
- public void createGeneralEntryBooksDocuments(Date beginDate, Date endDate) throws LimaException;
+ public void createFinancialStatementsDocuments(Date beginDate, Date endDate, FormatsEnum format) throws LimaException;
+ public void createLedgerDocuments(Date beginDate, Date endDate, FormatsEnum format) throws LimaException;
+ public void createEntryBooksDocuments(Date beginDate, Date endDate, FormatsEnum format) throws LimaException;
+ public void createBalanceDocuments(Date beginDate, Date endDate, FormatsEnum format) throws LimaException;
+ public void createGeneralEntryBooksDocuments(Date beginDate, Date endDate, FormatsEnum format) throws LimaException;
}
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/HttpServerService.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/HttpServerService.java 2010-08-04 17:59:27 UTC (rev 2995)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/HttpServerService.java 2010-08-05 10:50:11 UTC (rev 2996)
@@ -26,5 +26,6 @@
public interface HttpServerService {
public void start();
+ public int getHttpPort();
}
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ReportService.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ReportService.java 2010-08-04 17:59:27 UTC (rev 2995)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ReportService.java 2010-08-05 10:50:11 UTC (rev 2996)
@@ -68,7 +68,7 @@
*
* @throws LimaException
*/
- BalanceTrial generateLedger(Date beginDate, Date endDate, Boolean movementedFilter) throws LimaException;
+ BalanceTrial generateLedger(Date beginDate, Date endDate, String selectedAccounts, Boolean movementedFilter) throws LimaException;
/**
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/utils/DocumentsEnum.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/utils/DocumentsEnum.java 2010-08-04 17:59:27 UTC (rev 2995)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/utils/DocumentsEnum.java 2010-08-05 10:50:11 UTC (rev 2996)
@@ -1,3 +1,23 @@
+/* *##% Lima Business
+ * Copyright (C) 2008 - 2010 CodeLutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * ##%*
+ */
+
+
package org.chorem.lima.business.utils;
import static org.nuiton.i18n.I18n._;
@@ -4,24 +24,24 @@
public enum DocumentsEnum {
-
- ENTRYBOOKS(_("lima-business.document.entrybook"),"lima_entrybooks.html"),
- GENERAL_ENTRYBOOK(_("lima-business.document.generalentrybook"),"lima_general_entybook.html"),
- FINANCIALSTATEMENT(_("lima-business.document.financialstatement"),"lima_financialstatements.html"),
- BALANCE(_("lima-business.document.balance"),"lima_balance.html"),
- LEDGER(_("lima-business.document.ledger"),"lima_ledger.html");
- private final String link;
+ GENERAL_ENTRYBOOK(_("lima-business.document.generalentrybook"),"lima_general_entybook"),
+ ENTRYBOOKS(_("lima-business.document.entrybook"),"lima_entrybooks"),
+ BALANCE(_("lima-business.document.balance"),"lima_balance"),
+ LEDGER(_("lima-business.document.ledger"),"lima_ledger"),
+ FINANCIALSTATEMENT(_("lima-business.document.financialstatement"),"lima_financialstatements");
+ private final String fileName;
+
private final String description;
- private DocumentsEnum(String description, String link) {
+ private DocumentsEnum(String description, String fileName) {
this.description = description;
- this.link = link;
+ this.fileName = fileName;
}
- public String getLink() {
- return this.link;
+ public String getFileName() {
+ return this.fileName;
}
public String getDescription() {
@@ -32,7 +52,7 @@
DocumentsEnum value = null;
for (DocumentsEnum documentsEnum : DocumentsEnum.values()) {
- if (label.equals(documentsEnum.link)){
+ if (label.equals(documentsEnum.fileName)){
value = documentsEnum;
break;
}
Added: 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 (rev 0)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/utils/FormatsEnum.java 2010-08-05 10:50:11 UTC (rev 2996)
@@ -0,0 +1,63 @@
+/* *##% Lima Business
+ * Copyright (C) 2008 - 2010 CodeLutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * ##%*
+ */
+
+
+package org.chorem.lima.business.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 this.extension;
+ }
+
+ public String getMimeType() {
+ return this.mimeType;
+ }
+
+ public String getDescription(){
+ return this.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;
+ }
+
+
+}
Modified: trunk/lima-business/src/main/resources/lima.properties
===================================================================
--- trunk/lima-business/src/main/resources/lima.properties 2010-08-04 17:59:27 UTC (rev 2995)
+++ trunk/lima-business/src/main/resources/lima.properties 2010-08-05 10:50:11 UTC (rev 2996)
@@ -1,6 +1,6 @@
#LIMA Defaults values
# main directory
-lima.dir=${user.home}/.lima/
+lima.dir=${user.home}/.lima
# http port for reports
lima.httpport=5462
# server address (optional for server behind proxy)
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/LimaConfig.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/LimaConfig.java 2010-08-04 17:59:27 UTC (rev 2995)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/LimaConfig.java 2010-08-05 10:50:11 UTC (rev 2996)
@@ -24,6 +24,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.actions.MiscAction;
+import org.chorem.lima.entity.LimaCallaoDAOHelper;
import org.nuiton.util.ApplicationConfig;
import org.nuiton.util.ArgumentsParserException;
import org.nuiton.util.Version;
@@ -45,7 +46,11 @@
* to use log facility, just put in your code: log.info(\"...\");
*/
static private Log log = LogFactory.getLog(LimaConfig.class);
-
+
+ protected static LimaConfig instance;
+
+ private static final String configFile = "lima-config.properties";
+
/**
* La version du logiciel.
*/
@@ -99,9 +104,27 @@
//getLimaUserDirectory().mkdirs();
}
- /*
- * @see org.nuiton.util.ApplicationConfig#parse(java.lang.String[])
- */
+ public static LimaConfig getInstance() {
+ if (instance == null) {
+ instance = new LimaConfig();
+ instance.loadConfiguration(configFile);
+ }
+ return instance;
+ }
+
+ protected void loadConfiguration(String configFileName){
+
+ instance.setConfigFileName(configFileName);
+ try {
+ instance.parse(new String[0]);
+ } catch (ArgumentsParserException ex) {
+ if (log.isErrorEnabled()) {
+ log.error("Can't read configuration", ex);
+ }
+ }
+ instance.setOption("topia.persistence.classes", LimaCallaoDAOHelper.getImplementationClassesAsString());
+}
+
@Override
public void parse(String[] args) throws ArgumentsParserException {
@@ -205,9 +228,8 @@
public String getHostAdress() {
return getOption(Option.LIMA_HOST_ADDRESS.key);
- }
+ }
-
/**
* Used in ????
*/
@@ -249,7 +271,7 @@
LAUNCH_UI("lima.ui.launchui", _("lima.config.ui.flaunchui.description"), "true", Boolean.class, true, true),
SUPPORT_EMAIL("lima.misc.supportemail", _("lima.misc.supportemail.description"), "", String.class, false, false),
OPENEJB_REMOTEMODE("lima.openejb.remotemode", _("lima.openejb.remotemode.description"), "false", String.class, false, false),
- LIMA_HOST_ADDRESS("lima.host.address", _("lima.config.host.adress"), "", String.class, false, false);
+ LIMA_HOST_ADDRESS("lima.host.address", _("lima.config.host.adress"), "localhost", String.class, false, false);
public final String key;
public final String description;
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/LimaMain.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/LimaMain.java 2010-08-04 17:59:27 UTC (rev 2995)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/LimaMain.java 2010-08-05 10:50:11 UTC (rev 2996)
@@ -21,29 +21,21 @@
import static org.nuiton.i18n.I18n._;
import java.util.List;
import java.util.Locale;
-import javax.swing.JOptionPane;
import javax.swing.SwingUtilities;
import jaxx.runtime.SwingUtil;
-import org.apache.commons.beanutils.ConvertUtils;
-import org.apache.commons.beanutils.Converter;
-import org.apache.commons.beanutils.converters.DateConverter;
-import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.business.AccountServiceMonitorable;
import org.chorem.lima.business.HttpServerServiceMonitorable;
import org.chorem.lima.business.ejbinterface.AccountService;
-import org.chorem.lima.business.ejbinterface.HttpServerService;
import org.chorem.lima.entity.Account;
import org.chorem.lima.service.LimaServiceFactory;
import org.chorem.lima.ui.MainView;
import org.chorem.lima.ui.MainViewHandler;
import org.chorem.lima.ui.opening.OpeningView;
-import org.chorem.lima.ui.opening.OpeningViewHandler;
import org.chorem.lima.util.ErrorHelper;
import org.nuiton.i18n.I18n;
import org.nuiton.util.StringUtil;
-import org.nuiton.util.converter.ConverterUtil;
/**
* Lima main.
@@ -175,7 +167,7 @@
// if not, call #loadDefaultAccount()
splash.updateProgression(0.5, _("Loading accounting..."));
- //start servlet
+ //start http server
LimaServiceFactory.getInstance().getService(HttpServerServiceMonitorable.class).start();
AccountService accountService =
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainView.jaxx 2010-08-04 17:59:27 UTC (rev 2995)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainView.jaxx 2010-08-05 10:50:11 UTC (rev 2996)
@@ -29,6 +29,8 @@
import org.chorem.lima.enums.ImportExportEnum;
import java.net.URISyntaxException;
import java.net.URI;
+ import org.chorem.lima.business.HttpServerServiceMonitorable;
+ import org.chorem.lima.service.LimaServiceFactory;
public LimaConfig getConfig() {
return getContextValue(LimaConfig.class);
@@ -41,21 +43,19 @@
public boolean acceptLocale(Locale l, String expected) {
return l != null && l.toString().equals(expected);
}
-
- URI uri = null;
- try {
- uri = new URI("http://localhost:5462/");
- } catch (URISyntaxException e) {
- e.printStackTrace();
- }
- public void loadURI(){
- try {
- desktop.browse(uri);
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
+ public void loadURI(){
+ try {
+ int port = LimaServiceFactory.getInstance().getService(
+ HttpServerServiceMonitorable.class).getHttpPort();
+ String address = LimaConfig.getInstance().getHostAdress();
+ String url = "http://"+address+":"+port+"/";
+ desktop.browse(new URI(url));
+ } catch (IOException e) {
+ log.error("Can't open browser",e);
+ } catch (URISyntaxException e) {
+ log.error("Can't create URI",e);
+ }
}
/**
@@ -101,7 +101,7 @@
<JMenuBar>
<JMenu text="lima.menu.file">
- <JMenu text="lima.importexport.lima">
+ <JMenu text="lima.importexport.csv">
<JMenu text="lima.importexport.import" actionIcon='import-element'>
<JMenuItem text="lima.importexport.all" onActionPerformed='getHandler().showImportExportView(this, ImportExportEnum.CSV_ALL_IMPORT)'/>
<JMenuItem text="lima.importexport.accountcharts" onActionPerformed='getHandler().showImportExportView(this, ImportExportEnum.CSV_ACCOUNTCHARTS_IMPORT)'/>
@@ -126,7 +126,7 @@
</JMenu>
</JMenu>
<JSeparator/>
- <JMenuItem text="lima.documents.html"
+ <JMenuItem actionIcon='documents' text="lima.documents"
onActionPerformed="loadURI()"/>
<JSeparator/>
<JMenuItem text="lima.identity"
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceView.jaxx 2010-08-04 17:59:27 UTC (rev 2995)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceView.jaxx 2010-08-05 10:50:11 UTC (rev 2996)
@@ -26,6 +26,8 @@
import org.apache.commons.lang.time.DateUtils;
import java.util.Calendar;
+ getRootPane().setDefaultButton(filter);
+
// get begin date
Calendar calendarBegin = Calendar.getInstance();
// set begindate to JAN 1 - 0:00.000 of this years
@@ -67,16 +69,18 @@
<JTextField id="accountFilter"/>
</cell>
<cell anchor="west">
- <JButton text="lima.accountsreports.accountfilter"
+ <JButton id="filter" text="lima.accountsreports.accountfilter"
onActionPerformed="getHandler().setAccountFilter(accountFilter.getText())"/>
</cell>
<cell anchor="center">
<JCheckBox id='movmentedFilter' text='lima.accountsreports.movmentedfilter' selected='false'
onActionPerformed="getHandler().refresh()"/>
</cell>
- <cell>
- <JButton text="lima.createPDF" onActionPerformed="getHandler().createPdf()"/>
- </cell>
+ <cell>
+ <EnumEditor id='DocumentEditor'
+ constructorParams='org.chorem.lima.business.utils.FormatsEnum.class'
+ onActionPerformed="getHandler().createDocument()"/>
+ </cell>
</row>
<row>
<cell fill="both" weightx="1" weighty="1" columns="8">
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceViewHandler.java 2010-08-04 17:59:27 UTC (rev 2995)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceViewHandler.java 2010-08-05 10:50:11 UTC (rev 2996)
@@ -19,16 +19,24 @@
package org.chorem.lima.ui.balance;
import static org.nuiton.i18n.I18n._;
+import java.awt.Desktop;
+import java.io.IOException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.text.SimpleDateFormat;
import java.util.Date;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.chorem.lima.LimaConfig;
import org.chorem.lima.beans.BalanceTrial;
-import org.chorem.lima.business.DocumentServiceMonitorable;
import org.chorem.lima.business.FinancialTransactionServiceMonitorable;
+import org.chorem.lima.business.HttpServerServiceMonitorable;
import org.chorem.lima.business.ImportServiceMonitorable;
import org.chorem.lima.business.LimaException;
import org.chorem.lima.business.ReportServiceMonitorable;
import org.chorem.lima.business.ServiceListener;
+import org.chorem.lima.business.utils.DocumentsEnum;
+import org.chorem.lima.business.utils.FormatsEnum;
import org.chorem.lima.service.LimaServiceFactory;
import org.chorem.lima.util.ErrorHelper;
@@ -46,7 +54,7 @@
/** Services. */
protected ReportServiceMonitorable reportService;
- protected DocumentServiceMonitorable documentService;
+ protected HttpServerServiceMonitorable httpServerServiceMonitorable;
/** DatePicker Begin Date. */
protected Date selectedBeginDate;
@@ -58,16 +66,20 @@
protected String selectedAccounts;
protected BalanceTableModel model;
-
+
+ private static SimpleDateFormat dateFormat =
+ new SimpleDateFormat("yyyy-MM-dd");
+
+ protected int port;
+
protected BalanceViewHandler(BalanceView view) {
this.view = view;
reportService =
LimaServiceFactory.getInstance().getService(
ReportServiceMonitorable.class);
- documentService =
- LimaServiceFactory.getInstance().getService(
- DocumentServiceMonitorable.class);
+ port = LimaServiceFactory.getInstance().getService(
+ HttpServerServiceMonitorable.class).getHttpPort();
LimaServiceFactory.getInstance().getService(
ImportServiceMonitorable.class).addListener(this);
LimaServiceFactory.getInstance().getService(
@@ -141,13 +153,20 @@
}
}
- public void createPdf() {
+ public void createDocument() {
+
+ FormatsEnum selectedEnum = (FormatsEnum) view.getDocumentEditor().getSelectedItem();
+ String address = LimaConfig.getInstance().getHostAdress();
+
try {
- documentService.createBalanceDocuments(selectedBeginDate, selectedEndDate);
- } catch (LimaException eee) {
- if(log.isDebugEnabled()){
- log.debug("Can't create PDF", eee);
- }
+ String url = "http://"+address+":"+port+"/?beginDate="+dateFormat.format(selectedBeginDate)
+ +"&endDate="+dateFormat.format(selectedEndDate)+"&format="+selectedEnum.getExtension()+"&model="
+ + DocumentsEnum.BALANCE.getFileName();
+ Desktop.getDesktop().browse(new URI(url));
+ } catch (IOException e) {
+ log.error("Can't open browser", e);
+ } catch (URISyntaxException e) {
+ log.error("Can't create news URI", e);
}
}
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 2010-08-04 17:59:27 UTC (rev 2995)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsView.jaxx 2010-08-05 10:50:11 UTC (rev 2996)
@@ -75,7 +75,9 @@
/>
</cell>
<cell>
- <JButton text="lima.createPDF" onActionPerformed="getHandler().createPdf()"/>
+ <EnumEditor id='DocumentEditor'
+ constructorParams='org.chorem.lima.business.utils.FormatsEnum.class'
+ onActionPerformed="getHandler().createDocument()"/>
</cell>
</row>
<row>
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsViewHandler.java 2010-08-04 17:59:27 UTC (rev 2995)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsViewHandler.java 2010-08-05 10:50:11 UTC (rev 2996)
@@ -20,18 +20,27 @@
import static org.nuiton.i18n.I18n._;
+import java.awt.Desktop;
+import java.io.IOException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.text.SimpleDateFormat;
import java.util.Date;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.chorem.lima.LimaConfig;
import org.chorem.lima.beans.ReportsDatas;
import org.chorem.lima.beans.ReportsDatasImpl;
import org.chorem.lima.business.DocumentServiceMonitorable;
import org.chorem.lima.business.FinancialTransactionServiceMonitorable;
+import org.chorem.lima.business.HttpServerServiceMonitorable;
import org.chorem.lima.business.ImportServiceMonitorable;
import org.chorem.lima.business.LimaException;
import org.chorem.lima.business.ReportServiceMonitorable;
import org.chorem.lima.business.ServiceListener;
+import org.chorem.lima.business.utils.DocumentsEnum;
+import org.chorem.lima.business.utils.FormatsEnum;
import org.chorem.lima.entity.EntryBook;
import org.chorem.lima.service.LimaServiceFactory;
import org.chorem.lima.ui.combobox.EntryBookComboBoxModel;
@@ -67,6 +76,11 @@
/** EndDate. */
protected Date selectedEndDate;
+
+ protected int port;
+
+ private static SimpleDateFormat dateFormat =
+ new SimpleDateFormat("yyyy-MM-dd");
protected EntryBooksReportsViewHandler(EntryBooksReportsView view) {
this.view = view;
@@ -74,6 +88,8 @@
reportService =
LimaServiceFactory.getInstance().getService(
ReportServiceMonitorable.class);
+ port = LimaServiceFactory.getInstance().getService(
+ HttpServerServiceMonitorable.class).getHttpPort();
documentService =
LimaServiceFactory.getInstance().getService(
DocumentServiceMonitorable.class);
@@ -148,14 +164,28 @@
}
}
- public void createPdf() {
+
+
+ public void createDocument() {
+
+ FormatsEnum selectedEnum = (FormatsEnum) view.getDocumentEditor().getSelectedItem();
+ String address = LimaConfig.getInstance().getHostAdress();
+
try {
- documentService.createEntryBooksDocuments(selectedBeginDate, selectedEndDate);
- documentService.createGeneralEntryBooksDocuments(selectedBeginDate, selectedEndDate);
- } catch (LimaException eee) {
- if(log.isDebugEnabled()){
- log.debug("Can't create PDF", eee);
- }
+ String url = "http://"+address+":"+port+"/?beginDate="+dateFormat.format(selectedBeginDate)
+ +"&endDate="+dateFormat.format(selectedEndDate)+"&format="+selectedEnum.getExtension()+"&model="
+ + DocumentsEnum.ENTRYBOOKS.getFileName();
+ Desktop.getDesktop().browse(new URI(url));
+
+ String url2 = "http://"+address+":"+port+"/?beginDate="+dateFormat.format(selectedBeginDate)
+ +"&endDate="+dateFormat.format(selectedEndDate)+"&format="+selectedEnum.getExtension()+"&model="
+ + DocumentsEnum.GENERAL_ENTRYBOOK.getFileName();
+ Desktop.getDesktop().browse(new URI(url2));
+
+ } catch (IOException e) {
+ log.error("Can't open browser", e);
+ } catch (URISyntaxException e) {
+ log.error("Can't create news URI", e);
}
}
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 2010-08-04 17:59:27 UTC (rev 2995)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportTableModel.java 2010-08-05 10:50:11 UTC (rev 2996)
@@ -20,18 +20,28 @@
package org.chorem.lima.ui.financialstatementreport;
import static org.nuiton.i18n.I18n._;
+
+import java.awt.Desktop;
+import java.io.IOException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import javax.swing.table.AbstractTableModel;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.chorem.lima.LimaConfig;
import org.chorem.lima.beans.FinancialStatementAmounts;
import org.chorem.lima.business.DocumentServiceMonitorable;
import org.chorem.lima.business.FinancialStatementServiceMonitorable;
import org.chorem.lima.business.FinancialTransactionServiceMonitorable;
+import org.chorem.lima.business.HttpServerServiceMonitorable;
import org.chorem.lima.business.ImportServiceMonitorable;
import org.chorem.lima.business.LimaException;
import org.chorem.lima.business.ServiceListener;
+import org.chorem.lima.business.utils.DocumentsEnum;
+import org.chorem.lima.business.utils.FormatsEnum;
import org.chorem.lima.service.LimaServiceFactory;
import org.chorem.lima.util.ErrorHelper;
@@ -63,6 +73,11 @@
/** DatePicker EndDate. */
protected Date selectedEndDate;
+ protected int port;
+
+ private static SimpleDateFormat dateFormat =
+ new SimpleDateFormat("yyyy-MM-dd");
+
/** data cache */
protected List<FinancialStatementAmounts> cacheDataList;
@@ -73,7 +88,10 @@
financialStatementService =
LimaServiceFactory.getInstance().getService(
FinancialStatementServiceMonitorable.class);
+
financialStatementService.addListener(this);
+ port = LimaServiceFactory.getInstance().getService(
+ HttpServerServiceMonitorable.class).getHttpPort();
LimaServiceFactory.getInstance().getService(
ImportServiceMonitorable.class).addListener(this);
LimaServiceFactory.getInstance().getService(
@@ -208,16 +226,23 @@
fireTableDataChanged();
}
- public void createDocuments(){
+
+ public void createDocument(FormatsEnum formatsEnum) {
+
+ String address = LimaConfig.getInstance().getHostAdress();
+
try {
- documentService.createFinancialStatementsDocuments(selectedBeginDate, selectedEndDate);
- } catch (LimaException e) {
- if (log.isDebugEnabled()){
- log.debug("Error on create document",e);
- }
+ String url = "http://"+address+":"+port+"/?beginDate="+dateFormat.format(selectedBeginDate)
+ +"&endDate="+dateFormat.format(selectedEndDate)+"&format="+formatsEnum.getExtension()+"&model="
+ + DocumentsEnum.FINANCIALSTATEMENT.getFileName();
+ Desktop.getDesktop().browse(new URI(url));
+ } catch (IOException e) {
+ log.error("Can't open browser", e);
+ } catch (URISyntaxException e) {
+ log.error("Can't create news URI", e);
}
}
-
+
@Override
public void notifyMethod(String serviceName, String methodeName) {
if (serviceName.contains("FinancialTransaction") || methodeName.contains("FinancialStatement") || methodeName.contains("importAll")){
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportView.jaxx 2010-08-04 17:59:27 UTC (rev 2995)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportView.jaxx 2010-08-05 10:50:11 UTC (rev 2996)
@@ -66,7 +66,9 @@
getHandler().refresh()"/>
</cell>
<cell>
- <JButton text="lima.createPDF" onActionPerformed="getHandler().createPdf()"/>
+ <EnumEditor id='DocumentEditor'
+ constructorParams='org.chorem.lima.business.utils.FormatsEnum.class'
+ onActionPerformed="getHandler().createDocument()"/>
</cell>
</row>
<row>
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportViewHandler.java 2010-08-04 17:59:27 UTC (rev 2995)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportViewHandler.java 2010-08-05 10:50:11 UTC (rev 2996)
@@ -18,8 +18,17 @@
package org.chorem.lima.ui.financialstatementreport;
+import java.awt.Desktop;
+import java.io.IOException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import org.chorem.lima.LimaConfig;
+import org.chorem.lima.business.utils.DocumentsEnum;
+import org.chorem.lima.business.utils.FormatsEnum;
+
+
/**
* Handler associated with accounts reports view.
*
@@ -48,7 +57,10 @@
return view;
}
- public void createPdf() {
- model.createDocuments();
+ public void createDocument() {
+
+ FormatsEnum selectedEnum = (FormatsEnum) view.getDocumentEditor().getSelectedItem();
+ model.createDocument(selectedEnum);
+
}
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerView.jaxx 2010-08-04 17:59:27 UTC (rev 2995)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerView.jaxx 2010-08-05 10:50:11 UTC (rev 2996)
@@ -26,6 +26,8 @@
import org.apache.commons.lang.time.DateUtils;
import java.util.Calendar;
+ getRootPane().setDefaultButton(filter);
+
// get begin date
Calendar calendarBegin = Calendar.getInstance();
// set begindate to JAN 1 - 0:00.000 of this years
@@ -62,13 +64,22 @@
<org.jdesktop.swingx.JXDatePicker id="endDatePicker"
onActionPerformed="getHandler().setEndDate(endDatePicker.getDate())"/>
</cell>
- <cell>
- <JButton text="lima.createPDF" onActionPerformed="getHandler().createPdf()"/>
+ <cell anchor="east">
+ <JTextField id="accountFilter"/>
</cell>
+ <cell anchor="west">
+ <JButton id="filter" text="lima.accountsreports.accountfilter"
+ onActionPerformed="getHandler().setAccountFilter(accountFilter.getText())"/>
+ </cell>
<cell anchor="center">
<JCheckBox id='movmentedFilter' text='lima.accountsreports.movmentedfilter' selected='false'
onActionPerformed="getHandler().refresh()"/>
</cell>
+ <cell>
+ <EnumEditor id='DocumentEditor'
+ constructorParams='org.chorem.lima.business.utils.FormatsEnum.class'
+ onActionPerformed="getHandler().createDocument()"/>
+ </cell>
</row>
<row>
<cell fill="both" weightx="1" weighty="1" columns="8">
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 2010-08-04 17:59:27 UTC (rev 2995)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerViewHandler.java 2010-08-05 10:50:11 UTC (rev 2996)
@@ -20,6 +20,11 @@
import static org.nuiton.i18n.I18n._;
+import java.awt.Desktop;
+import java.io.IOException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
@@ -27,15 +32,19 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.chorem.lima.LimaConfig;
import org.chorem.lima.beans.BalanceTrial;
import org.chorem.lima.beans.ReportsDatas;
import org.chorem.lima.business.DocumentServiceMonitorable;
import org.chorem.lima.business.FinancialTransactionServiceMonitorable;
+import org.chorem.lima.business.HttpServerServiceMonitorable;
import org.chorem.lima.business.ImportServiceMonitorable;
import org.chorem.lima.business.LimaException;
import org.chorem.lima.business.ReportServiceMonitorable;
import org.chorem.lima.business.ServiceListener;
+import org.chorem.lima.business.utils.DocumentsEnum;
import org.chorem.lima.business.utils.EntryComparator;
+import org.chorem.lima.business.utils.FormatsEnum;
import org.chorem.lima.entity.Entry;
import org.chorem.lima.entity.EntryBook;
import org.chorem.lima.service.LimaServiceFactory;
@@ -68,8 +77,16 @@
/** EndDate. */
protected Date selectedEndDate;
+ /** Text field Accounts */
+ protected String selectedAccounts;
+
protected BalanceTrial balanceTrialCache;
+
+ private static SimpleDateFormat dateFormat =
+ new SimpleDateFormat("yyyy-MM-dd");
+ protected int port;
+
protected List<Object> cachedatasList;
protected LedgerViewHandler(LedgerView view) {
@@ -79,6 +96,8 @@
LimaServiceFactory.getInstance().getService(
ReportServiceMonitorable.class);
reportService.addListener(this);
+ port = LimaServiceFactory.getInstance().getService(
+ HttpServerServiceMonitorable.class).getHttpPort();
documentService =
LimaServiceFactory.getInstance().getService(
DocumentServiceMonitorable.class);
@@ -96,6 +115,11 @@
selectedEndDate = date;
}
+ public void setAccountFilter(String accounts) {
+ selectedAccounts = accounts;
+ refresh();
+ }
+
/**
* get all account fot the selected period
* @return
@@ -103,7 +127,8 @@
public List<Object> getDataList(){
List<Object> results = new ArrayList<Object>();
try {
- balanceTrialCache = reportService.generateLedger(selectedBeginDate, selectedEndDate, view.getMovmentedFilter().isSelected());
+ balanceTrialCache = reportService.generateLedger(selectedBeginDate,
+ selectedEndDate, selectedAccounts, view.getMovmentedFilter().isSelected());
if (balanceTrialCache.getReportsDatas() != null){
for (ReportsDatas reportsDatas : balanceTrialCache.getReportsDatas()) {
results.add(reportsDatas);
@@ -158,13 +183,20 @@
}
}
- public void createPdf() {
+ public void createDocument() {
+
+ FormatsEnum selectedEnum = (FormatsEnum) view.getDocumentEditor().getSelectedItem();
+ String address = LimaConfig.getInstance().getHostAdress();
+
try {
- documentService.createLedgerDocuments(selectedBeginDate, selectedEndDate);
- } catch (LimaException eee) {
- if(log.isDebugEnabled()){
- log.debug("Can't create PDF", eee);
- }
+ String url = "http://"+address+":"+port+"/?beginDate="+dateFormat.format(selectedBeginDate)
+ +"&endDate="+dateFormat.format(selectedEndDate)+"&format="+selectedEnum.getExtension()+"&model="
+ + DocumentsEnum.LEDGER.getFileName();
+ Desktop.getDesktop().browse(new URI(url));
+ } catch (IOException e) {
+ log.error("Can't open browser", e);
+ } catch (URISyntaxException e) {
+ log.error("Can't create news URI", e);
}
}
Modified: trunk/lima-swing/src/main/resources/i18n/lima-swing-en_GB.properties
===================================================================
--- trunk/lima-swing/src/main/resources/i18n/lima-swing-en_GB.properties 2010-08-04 17:59:27 UTC (rev 2995)
+++ trunk/lima-swing/src/main/resources/i18n/lima-swing-en_GB.properties 2010-08-05 10:50:11 UTC (rev 2996)
@@ -61,6 +61,7 @@
lima.config.category.other.description=
lima.config.configFileName.description=
lima.config.host.adress=
+lima.config.host.httpport=
lima.config.locale.description=
lima.config.ui.flaunchui.description=
lima.config.ui.fullscreen.description=
@@ -71,6 +72,7 @@
lima.debit=Debit
lima.description=Description
lima.dialogreport=
+lima.documents=
lima.documents.html=
lima.entries=Entries
lima.entries.addtransaction=
@@ -129,6 +131,7 @@
lima.importexport.accountcharts=
lima.importexport.all=
lima.importexport.choiceencoding=
+lima.importexport.csv=
lima.importexport.ebp=
lima.importexport.entries=
lima.importexport.entrybooks=
Modified: trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties
===================================================================
--- trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties 2010-08-04 17:59:27 UTC (rev 2995)
+++ trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties 2010-08-05 10:50:11 UTC (rev 2996)
@@ -57,6 +57,7 @@
lima.config.category.other.description=Autre propri\u00E9t\u00E9s de configuration
lima.config.configFileName.description=
lima.config.host.adress=
+lima.config.host.httpport=
lima.config.locale.description=Locale utilis\u00E9e par l'application
lima.config.ui.flaunchui.description=
lima.config.ui.fullscreen.description=
@@ -67,7 +68,7 @@
lima.debit=Debit
lima.description=Description
lima.dialogreport=
-lima.documents.html=
+lima.documents=Documents\u0085
lima.entries=Traitement
lima.entries.addtransaction=Saisir des \u00E9critures
lima.entries.lettering=Ajouter une lettre
@@ -120,6 +121,7 @@
lima.importexport.accountcharts=Plan des comptes
lima.importexport.all=Tout
lima.importexport.choiceencoding=Choisir encodage \:
+lima.importexport.csv=Import/Export CSV
lima.importexport.ebp=Import/Export EBP
lima.importexport.entries=\u00C9critures
lima.importexport.entrybooks=Journaux
@@ -129,7 +131,6 @@
lima.importexport.import.terminated=Import termin\u00E9
lima.importexport.importcsv=Import CSV
lima.importexport.importebp=Import EBP
-lima.importexport.lima=Import/Export Lima
lima.importexport.wait=Traitement en cours \u2026
lima.init.closed=Lima ferm\u00E9 \u00E0 %1$s
lima.init.errorclosing=
Added: trunk/lima-swing/src/main/resources/icons/action-documents.png
===================================================================
(Binary files differ)
Property changes on: trunk/lima-swing/src/main/resources/icons/action-documents.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Modified: trunk/lima-swing/src/main/resources/icons/action-export-element.png
===================================================================
(Binary files differ)
Modified: trunk/lima-swing/src/main/resources/icons/action-import-element.png
===================================================================
(Binary files differ)
Deleted: trunk/lima-swing/src/main/resources/icons/action-print.png
===================================================================
(Binary files differ)
Modified: trunk/lima-swing/src/main/resources/lima-config.properties
===================================================================
--- trunk/lima-swing/src/main/resources/lima-config.properties 2010-08-04 17:59:27 UTC (rev 2995)
+++ trunk/lima-swing/src/main/resources/lima-config.properties 2010-08-05 10:50:11 UTC (rev 2996)
@@ -18,7 +18,7 @@
lima.openejb.remotemode=false
java.naming.factory.initial=org.openejb.client.LocalInitialContextFactory
-#Lima Accounting Host address
+#Lima Accounting Host
lima.host.address=localhost
# Remote mode
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2010-08-04 17:59:27 UTC (rev 2995)
+++ trunk/pom.xml 2010-08-05 10:50:11 UTC (rev 2996)
@@ -253,6 +253,16 @@
<role>Développeur</role>
</roles>
</contributor>
+ <contributor>
+ <name>jpepin</name>
+ <email>pepin(a)codelutin.com</email>
+ <organization>Code Lutin</organization>
+ <organizationUrl>http://www.codelutin.com</organizationUrl>
+ <timezone>+2</timezone>
+ <roles>
+ <role>Développeur</role>
+ </roles>
+ </contributor>
</contributors>
<!-- ************************************************************* -->
1
0
Author: jpepin
Date: 2010-08-04 19:59:27 +0200 (Wed, 04 Aug 2010)
New Revision: 2995
Url: http://chorem.org/repositories/revision/lima/2995
Log:
Ajout servelet pour acc?\195?\168der aux documents html.
Added:
trunk/lima-business/src/main/java/org/chorem/lima/business/HttpServerServiceMonitorable.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/HttpServerServiceImpl.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/utils/DocumentsEnum.java
trunk/lima-business/src/main/resources/images/
trunk/lima-business/src/main/resources/images/accounts.png
trunk/lima-business/src/main/resources/images/entries.png
trunk/lima-business/src/main/resources/images/entrybooks.png
trunk/lima-business/src/main/resources/images/fiscalperiods.png
trunk/lima-business/src/main/resources/images/identity.png
trunk/lima-business/src/main/resources/images/logo-codelutin.png
trunk/lima-business/src/main/resources/images/splash.png
Removed:
trunk/lima-swing/:limadb.lock.db
trunk/lima-swing/limadb.h2.db
trunk/lima-swing/limadb.lock.db
trunk/lima-swing/src/main/java/org/chorem/lima/ui/document/
Modified:
trunk/lima-business/src/main/java/org/chorem/lima/business/LimaConfig.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/DocumentServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/IdentityService.java
trunk/lima-business/src/main/resources/i18n/lima-business-en_GB.properties
trunk/lima-business/src/main/resources/i18n/lima-business-fr_FR.properties
trunk/lima-business/src/main/resources/lima.properties
trunk/lima-swing/src/main/java/org/chorem/lima/LimaConfig.java
trunk/lima-swing/src/main/java/org/chorem/lima/LimaMain.java
trunk/lima-swing/src/main/java/org/chorem/lima/service/ServiceMonitorableHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainViewHandler.java
trunk/lima-swing/src/main/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/lima-config.properties
Added: trunk/lima-business/src/main/java/org/chorem/lima/business/HttpServerServiceMonitorable.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/HttpServerServiceMonitorable.java (rev 0)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/HttpServerServiceMonitorable.java 2010-08-04 17:59:27 UTC (rev 2995)
@@ -0,0 +1,26 @@
+/* *##% Lima Business
+ * Copyright (C) 2008 - 2010 CodeLutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * ##%*
+ */
+
+package org.chorem.lima.business;
+
+import org.chorem.lima.business.ejbinterface.HttpServerService;
+
+public interface HttpServerServiceMonitorable extends HttpServerService, ServiceMonitorable {
+
+}
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/LimaConfig.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/LimaConfig.java 2010-08-03 17:23:31 UTC (rev 2994)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/LimaConfig.java 2010-08-04 17:59:27 UTC (rev 2995)
@@ -99,6 +99,10 @@
return getOption(Option.REPORTS_DIR.getKey());
}
+ public String getAddressServer(){
+ return getOption(Option.SERVER_ADRESS.getKey());
+ }
+
public int getHttpPort(){
return Integer.valueOf(getOption(Option.HTTP_PORT.getKey()));
}
@@ -128,8 +132,9 @@
CONFIG_FILE(CONFIG_FILE_NAME, _("lima.config.configFileName.description"), "lima-config.properties", String.class, true, true),
RULES_NATIONALTY("lima.rules", _("lima.config.rulesnationality"), "default", String.class, false, false),
- REPORTS_DIR("lima.report.dir", _("lima.config.reports-dir"), "", String.class, false, false),
- HTTP_PORT("lima.httpport", _("lima.config.http-port"), "5462", String.class, false, false);
+ REPORTS_DIR("lima.report.dir", _("lima.config.reportsdir"), "", String.class, false, false),
+ HTTP_PORT("lima.httpport", _("lima.config.httpport"), "5462", String.class, false, false),
+ SERVER_ADRESS("lima.serveraddress", _("lima.config.serveraddress"), "", String.class, false, false);
public final String key;
public final String description;
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/DocumentServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/DocumentServiceImpl.java 2010-08-03 17:23:31 UTC (rev 2994)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/DocumentServiceImpl.java 2010-08-04 17:59:27 UTC (rev 2995)
@@ -88,9 +88,7 @@
LogFactory.getLog(DocumentServiceImpl.class);
private TopiaContext rootContext;
-
- protected Server server;
-
+
//Services
@EJB
IdentityService identityService;
@@ -140,30 +138,9 @@
}
}
path = LimaConfig.getInstance().getReportsDir();
- start();
}
- /** start the server */
- public void start() {
- if (server == null) {
- int port = LimaConfig.getInstance().getHttpPort();
- new File(path).mkdir();
- try {
- server = new Server(port);
- ResourceHandler resourceHandler = new ResourceHandler();
- resourceHandler.setResourceBase(path);
- server.setHandler(resourceHandler);
- server.start();
- log.info("Web server are running on port: "+port);
-
- } catch (Exception eee) {
- log.error("error while booting http server", eee);
- }
- }
- }
-
-
public Paragraph createHeaderPage(String title, Identity identity, String beginDate, String endDate){
Paragraph paragraphHeaderPage = new Paragraph();
Table t = null;
@@ -240,6 +217,7 @@
+ hourS, normalFont));
infos.addCell(new Phrase(_("lima-business.document.pagenumber")
+ nbPages, normalFont));
+ paragraphPage.add(infos);
return paragraphPage;
}
Added: 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 (rev 0)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/HttpServerServiceImpl.java 2010-08-04 17:59:27 UTC (rev 2995)
@@ -0,0 +1,265 @@
+/* *##% Lima Business
+ * Copyright (C) 2008 - 2010 CodeLutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * ##%*
+ */
+
+
+package org.chorem.lima.business.ejb;
+
+import static org.nuiton.i18n.I18n._;
+
+import java.awt.Image;
+import java.awt.image.BufferedImage;
+import java.io.BufferedInputStream;
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+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.imageio.ImageIO;
+import javax.servlet.Servlet;
+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.lang.time.DateUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.chorem.lima.business.LimaConfig;
+import org.chorem.lima.business.LimaException;
+import org.chorem.lima.business.ejbinterface.DocumentService;
+import org.chorem.lima.business.ejbinterface.HttpServerService;
+import org.chorem.lima.business.ejbinterface.HttpServerServiceLocal;
+import org.chorem.lima.business.utils.DocumentsEnum;
+import org.mortbay.jetty.Server;
+import org.mortbay.jetty.AbstractGenerator.Output;
+import org.mortbay.jetty.servlet.Context;
+import org.mortbay.jetty.servlet.ServletHolder;
+import org.nuiton.topia.TopiaContext;
+import org.nuiton.topia.TopiaContextFactory;
+import org.nuiton.topia.TopiaNotFoundException;
+import org.nuiton.util.Resource;
+
+
+@Stateless
+public class HttpServerServiceImpl extends AbstractLimaService implements HttpServerService, HttpServerServiceLocal {
+
+ private static final Log log =
+ LogFactory.getLog(HttpServerServiceImpl.class);
+
+ private TopiaContext rootContext;
+
+ @EJB
+ DocumentService documentService;
+
+ protected Server server;
+
+ protected String path;
+
+ private static SimpleDateFormat dateFormat =
+ new SimpleDateFormat("yyyy-MM-dd");
+
+ public HttpServerServiceImpl() {
+ LimaConfig config = LimaConfig.getInstance();
+ try {
+ rootContext = TopiaContextFactory.getContext(config.getOptions());
+ } catch (TopiaNotFoundException ex) {
+ if (log.isErrorEnabled()) {
+ log.error("Can't init topia context", ex);
+ }
+ }
+ path = LimaConfig.getInstance().getReportsDir();
+
+ }
+
+
+
+ /** start the server */
+ public void start() {
+ if (server == null) {
+ int port = LimaConfig.getInstance().getHttpPort();
+ new File(path).mkdir();
+ String imagesPath = getClass().getResource("/images").toExternalForm();
+ try {
+ server = new Server(port);
+
+ Context root = new Context(server, "/", Context.NO_SESSIONS);
+ root.addServlet(new ServletHolder((Servlet) new MainServlet()), "/");
+
+ server.start();
+ log.info("Web server are running on port: "+port);
+
+ } catch (Exception eee) {
+ log.error("error while booting http server", eee);
+ }
+ }
+ }
+
+
+ /** this servlet send a static html page */
+ public class MainServlet extends HttpServlet {
+ private static final long serialVersionUID = 1L;
+ String serverAddressConfig = LimaConfig.getInstance().getAddressServer();
+
+ @Override
+ protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
+ String imageParam = req.getParameter("img");
+ log.info(imageParam);
+ if (imageParam != null){
+ URL image = Resource.getURLOrNull("images/"+imageParam);
+ log.info("image :"+image);
+ if (image != null){
+ resp.setContentType("image/png");
+ InputStream in = image.openStream();
+ OutputStream out = resp.getOutputStream();
+ IOUtils.copy(in, out);
+ }
+ }
+ else {
+ resp.setContentType("text/html");
+ String pageContent = "";
+ String serverAdress = "http://";
+
+ log.info("Page load");
+
+ /** create server Address : static config if exist or dynamical adress */
+ if (serverAddressConfig.equals("")){
+ serverAdress += req.getServerName() + ":" + req.getServerPort();
+ }
+ else {
+ serverAdress += serverAddressConfig + ":"
+ + LimaConfig.getInstance().getHttpPort();
+ }
+
+ String link = req.getParameter("link");
+ String beginDate = req.getParameter("beginDate");
+ String endDate = req.getParameter("endDate");
+
+ if (link != null && beginDate != null && endDate != null){
+ try {
+ Date beginDateFormat = dateFormat.parse(beginDate);
+ Date endDateFormat = dateFormat.parse(endDate);
+
+ switch (DocumentsEnum.valueOfLink(link)) {
+ case BALANCE:
+ documentService.createBalanceDocuments(beginDateFormat, endDateFormat);
+ break;
+ case ENTRYBOOKS:
+ documentService.createEntryBooksDocuments(beginDateFormat, endDateFormat);
+ break;
+ case FINANCIALSTATEMENT:
+ documentService.createFinancialStatementsDocuments(beginDateFormat, endDateFormat);
+ break;
+ case GENERAL_ENTRYBOOK:
+ documentService.createGeneralEntryBooksDocuments(beginDateFormat, endDateFormat);
+ break;
+ case LEDGER:
+ documentService.createLedgerDocuments(beginDateFormat, endDateFormat);
+ break;
+ }
+ } catch (LimaException eeeLE) {
+ log.error("Can't call document service for create html document", eeeLE);
+ } catch (ParseException eeePE) {
+ log.error("Can't parse date", eeePE);
+ }
+ pageContent = extractFile(path+File.separatorChar+link);
+ }
+ else {
+
+ Calendar calendar = Calendar.getInstance();
+ Date endDatePicker = calendar.getTime();
+ Date beginDatePicker = calendar.getTime();
+ beginDatePicker = DateUtils.truncate(beginDatePicker, Calendar.YEAR);
+
+ pageContent = "<!DOCTYPE html>\n"
+ + "<html lang=\"fr\">\n"
+ + "<head>\n"
+ + "<title>LIMA Documents Report</title>\n"
+ + "<style type=\"text/css\">"
+ + "body { font: 14px sans-serif; }"
+ + "h1 { font: 20px sans-serif; text-align: center; }"
+ + "table.paddingleft td {padding-left:100px;}"
+ + ".tdright {text-align: right;}"
+ + "</style>"
+ + "</head>\n"
+ + "<body>\n"
+ + "<table class=\"paddingleft\">\n"
+ + "<tr><td colspan=2><h1>LIMA Documents Report</h1></td></tr>\n"
+ + "<tr><td><img src=\"?img=identity.png\"/></td>\n"
+ + "<td rowspan=3><form method=GET action=" + serverAdress + ">\n"
+ + _("lima-business.document.date.begin") + "<input value=\""+dateFormat.format(beginDatePicker)
+ + "\" type=\"date\" name=\"beginDate\">\n"
+ + _("lima-business.document.date.end") + "<input value=\""+dateFormat.format(endDatePicker)
+ + "\" type=\"date\" name=\"endDate\">\n<br/><br/>"
+ + "Documents : <select name=\"link\">";
+
+ for (DocumentsEnum documentsEnum : DocumentsEnum.values()) {
+ pageContent += "<option value=\""+documentsEnum.getLink()+"\">"
+ + documentsEnum.getDescription()+"</OPTION>\n";
+ }
+
+ pageContent += "<tr><td><img src=\"?img=entries.png\"/></td></tr>\n"
+ + "<tr><td><img src=\"?img=accounts.png\"/></td></tr>\n"
+ + "<tr><td><img src=\"?img=entrybooks.png\"/></td>\n"
+ + "</select>\n<br/><br/>"
+ + "<td class=\"tdright\"><input type=\"submit\"></td></tr>"
+ + "</form>\n"
+ + "<tr><td><img src=\"?img=fiscalperiods.png\"/></td></tr>\n"
+ + "</table>\n"
+ + "</body>\n"
+ + "</html>";
+ }
+
+ resp.getWriter().write(pageContent);
+
+ }
+ }
+ @Override
+ protected void doPost(HttpServletRequest req, HttpServletResponse resp)
+ throws ServletException, IOException {
+ doGet(req, resp);
+
+ }
+ }
+
+ public String extractFile(String filePath){
+ char[] datas = new char[(int) new File(filePath).length()];
+ try {
+ BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(filePath)));
+ in.read(datas);
+ in.close();
+ }
+ catch (IOException eee) {
+ if (log.isDebugEnabled()){
+ log.debug("Can't read file "+filePath, eee);
+ }
+ }
+ return new String(datas);
+ }
+
+}
Added: 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 (rev 0)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/HttpServerService.java 2010-08-04 17:59:27 UTC (rev 2995)
@@ -0,0 +1,30 @@
+/* *##% Lima Business
+ * Copyright (C) 2008 - 2010 CodeLutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * ##%*
+ */
+
+
+package org.chorem.lima.business.ejbinterface;
+
+import javax.ejb.Remote;
+
+@Remote
+public interface HttpServerService {
+
+ public void start();
+
+}
Added: 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 (rev 0)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/HttpServerServiceLocal.java 2010-08-04 17:59:27 UTC (rev 2995)
@@ -0,0 +1,28 @@
+/* *##% Lima Business
+ * Copyright (C) 2008 - 2010 CodeLutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * ##%*
+ */
+
+
+package org.chorem.lima.business.ejbinterface;
+
+import javax.ejb.Local;
+
+@Local
+public interface HttpServerServiceLocal {
+
+}
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/IdentityService.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/IdentityService.java 2010-08-03 17:23:31 UTC (rev 2994)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/IdentityService.java 2010-08-04 17:59:27 UTC (rev 2995)
@@ -23,7 +23,6 @@
import org.chorem.lima.business.LimaException;
import org.chorem.lima.entity.Identity;
-import org.nuiton.topia.TopiaContext;
@Remote
public interface IdentityService {
Added: trunk/lima-business/src/main/java/org/chorem/lima/business/utils/DocumentsEnum.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/utils/DocumentsEnum.java (rev 0)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/utils/DocumentsEnum.java 2010-08-04 17:59:27 UTC (rev 2995)
@@ -0,0 +1,43 @@
+package org.chorem.lima.business.utils;
+
+import static org.nuiton.i18n.I18n._;
+
+
+public enum DocumentsEnum {
+
+ ENTRYBOOKS(_("lima-business.document.entrybook"),"lima_entrybooks.html"),
+ GENERAL_ENTRYBOOK(_("lima-business.document.generalentrybook"),"lima_general_entybook.html"),
+ FINANCIALSTATEMENT(_("lima-business.document.financialstatement"),"lima_financialstatements.html"),
+ BALANCE(_("lima-business.document.balance"),"lima_balance.html"),
+ LEDGER(_("lima-business.document.ledger"),"lima_ledger.html");
+
+ private final String link;
+
+ private final String description;
+
+ private DocumentsEnum(String description, String link) {
+ this.description = description;
+ this.link = link;
+ }
+
+ public String getLink() {
+ return this.link;
+ }
+
+ public String getDescription() {
+ return this.description;
+ }
+
+ public static DocumentsEnum valueOfLink(String label){
+ DocumentsEnum value = null;
+
+ for (DocumentsEnum documentsEnum : DocumentsEnum.values()) {
+ if (label.equals(documentsEnum.link)){
+ value = documentsEnum;
+ break;
+ }
+ }
+ return value;
+ }
+
+}
Modified: trunk/lima-business/src/main/resources/i18n/lima-business-en_GB.properties
===================================================================
--- trunk/lima-business/src/main/resources/i18n/lima-business-en_GB.properties 2010-08-03 17:23:31 UTC (rev 2994)
+++ trunk/lima-business/src/main/resources/i18n/lima-business-en_GB.properties 2010-08-04 17:59:27 UTC (rev 2995)
@@ -1,6 +1,7 @@
An\ EntryBook\ already\ exists\ with\ this\ label\ \:\ %s=
An\ account\ already\ exists\ with\ this\ number\ \:\ %s=
An\ financialStatement\ already\ exists\ with\ this\ label\ \:\ %s=
+business.document.financialstatement=
lima-business.config.configFileName.description=
lima-business.config.rulesnationality=
lima-business.document.accountnubmer=
@@ -17,9 +18,12 @@
lima-business.document.createdate2=
lima-business.document.credit=Credit
lima-business.document.date=Date
+lima-business.document.date.begin=
+lima-business.document.date.end=
lima-business.document.debit=Debit
lima-business.document.description=Description
lima-business.document.entrybook=EntryBook
+lima-business.document.financialstatement=
lima-business.document.generalentrybook=
lima-business.document.grossamount=Gross Amount
lima-business.document.label=Label
@@ -39,8 +43,11 @@
lima.business.document.date=Date
lima.config.configFileName.description=
lima.config.http-port=
+lima.config.httpport=
lima.config.reports-dir=
+lima.config.reportsdir=
lima.config.rulesnationality=
+lima.config.serveraddress=
lima.table.grossamount=
lima.table.label=Test
lima.table.netamount=
Modified: trunk/lima-business/src/main/resources/i18n/lima-business-fr_FR.properties
===================================================================
--- trunk/lima-business/src/main/resources/i18n/lima-business-fr_FR.properties 2010-08-03 17:23:31 UTC (rev 2994)
+++ trunk/lima-business/src/main/resources/i18n/lima-business-fr_FR.properties 2010-08-04 17:59:27 UTC (rev 2995)
@@ -1,9 +1,11 @@
An\ EntryBook\ already\ exists\ with\ this\ label\ \:\ %s=
An\ account\ already\ exists\ with\ this\ number\ \:\ %s=
An\ financialStatement\ already\ exists\ with\ this\ label\ \:\ %s=
+business.document.financialstatement=
lima-business.document.accountnumber=N\u00B0 Compte
lima-business.document.amounts=Totaux
lima-business.document.balance=Balance
+lima-business.document.beginDate=Date de d\u00E9but \:
lima-business.document.businessnumber=N\u00B0 Siret
lima-business.document.carryback=Report
lima-business.document.carryforward=\u00C0 reporter
@@ -12,9 +14,13 @@
lima-business.document.createdate2=\u00E0
lima-business.document.credit=Cr\u00E9dit
lima-business.document.date=Date
+lima-business.document.date.begin=Date de d\u00E9but \:
+lima-business.document.date.end=Date de fin \:
lima-business.document.debit=D\u00E9bit
lima-business.document.description=Description
+lima-business.document.endDate=Date de fin \:
lima-business.document.entrybook=Journal
+lima-business.document.financialstatement=Bilan et compte de r\u00E9sultat
lima-business.document.generalentrybook=Journal G\u00E9n\u00E9ral
lima-business.document.grossamount=Brut
lima-business.document.label=Libell\u00E9
@@ -33,5 +39,8 @@
lima-business.document.voucher=Pi\u00E8ce comptable
lima.config.configFileName.description=
lima.config.http-port=
+lima.config.httpport=
lima.config.reports-dir=
+lima.config.reportsdir=
lima.config.rulesnationality=
+lima.config.serveraddress=
Added: trunk/lima-business/src/main/resources/images/accounts.png
===================================================================
(Binary files differ)
Property changes on: trunk/lima-business/src/main/resources/images/accounts.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/lima-business/src/main/resources/images/entries.png
===================================================================
(Binary files differ)
Property changes on: trunk/lima-business/src/main/resources/images/entries.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/lima-business/src/main/resources/images/entrybooks.png
===================================================================
(Binary files differ)
Property changes on: trunk/lima-business/src/main/resources/images/entrybooks.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/lima-business/src/main/resources/images/fiscalperiods.png
===================================================================
(Binary files differ)
Property changes on: trunk/lima-business/src/main/resources/images/fiscalperiods.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/lima-business/src/main/resources/images/identity.png
===================================================================
(Binary files differ)
Property changes on: trunk/lima-business/src/main/resources/images/identity.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/lima-business/src/main/resources/images/logo-codelutin.png
===================================================================
(Binary files differ)
Property changes on: trunk/lima-business/src/main/resources/images/logo-codelutin.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/lima-business/src/main/resources/images/splash.png
===================================================================
(Binary files differ)
Property changes on: trunk/lima-business/src/main/resources/images/splash.png
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ application/octet-stream
Modified: trunk/lima-business/src/main/resources/lima.properties
===================================================================
--- trunk/lima-business/src/main/resources/lima.properties 2010-08-03 17:23:31 UTC (rev 2994)
+++ trunk/lima-business/src/main/resources/lima.properties 2010-08-04 17:59:27 UTC (rev 2995)
@@ -3,6 +3,8 @@
lima.dir=${user.home}/.lima/
# http port for reports
lima.httpport=5462
+# server address (optional for server behind proxy)
+lima.serveraddress=
# Local class for accounting rules
lima.rules=org.chorem.lima.business.accountingrules.FranceAccountingRules
# directory for http server
Deleted: trunk/lima-swing/:limadb.lock.db
===================================================================
--- trunk/lima-swing/:limadb.lock.db 2010-08-03 17:23:31 UTC (rev 2994)
+++ trunk/lima-swing/:limadb.lock.db 2010-08-04 17:59:27 UTC (rev 2995)
@@ -1,4 +0,0 @@
-#FileLock
-#Tue Aug 03 19:12:33 CEST 2010
-id=12a38f0b67cbf55cf1fb51d173d8db55399628ae048
-method=file
Deleted: trunk/lima-swing/limadb.h2.db
===================================================================
(Binary files differ)
Deleted: trunk/lima-swing/limadb.lock.db
===================================================================
--- trunk/lima-swing/limadb.lock.db 2010-08-03 17:23:31 UTC (rev 2994)
+++ trunk/lima-swing/limadb.lock.db 2010-08-04 17:59:27 UTC (rev 2995)
@@ -1,4 +0,0 @@
-#FileLock
-#Tue Aug 03 19:13:22 CEST 2010
-id=12a38f1750004a9a1ddce8ec18615a18acf9c511c71
-method=file
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/LimaConfig.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/LimaConfig.java 2010-08-03 17:23:31 UTC (rev 2994)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/LimaConfig.java 2010-08-04 17:59:27 UTC (rev 2995)
@@ -202,7 +202,12 @@
boolean result = getOptionAsBoolean(Option.OPENEJB_REMOTEMODE.key);
return result;
}
+
+ public String getHostAdress() {
+ return getOption(Option.LIMA_HOST_ADDRESS.key);
+ }
+
/**
* Used in ????
*/
@@ -243,8 +248,9 @@
FULL_SCREEN("lima.ui.fullscreen", _("lima.config.ui.fullscreen.description"), "false", Boolean.class, false, false),
LAUNCH_UI("lima.ui.launchui", _("lima.config.ui.flaunchui.description"), "true", Boolean.class, true, true),
SUPPORT_EMAIL("lima.misc.supportemail", _("lima.misc.supportemail.description"), "", String.class, false, false),
- OPENEJB_REMOTEMODE("lima.openejb.remotemode", _("lima.openejb.remotemode.description"), "false", String.class, false, false);
-
+ OPENEJB_REMOTEMODE("lima.openejb.remotemode", _("lima.openejb.remotemode.description"), "false", String.class, false, false),
+ LIMA_HOST_ADDRESS("lima.host.address", _("lima.config.host.adress"), "", String.class, false, false);
+
public final String key;
public final String description;
public String defaultValue;
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/LimaMain.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/LimaMain.java 2010-08-03 17:23:31 UTC (rev 2994)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/LimaMain.java 2010-08-04 17:59:27 UTC (rev 2995)
@@ -31,7 +31,9 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.business.AccountServiceMonitorable;
+import org.chorem.lima.business.HttpServerServiceMonitorable;
import org.chorem.lima.business.ejbinterface.AccountService;
+import org.chorem.lima.business.ejbinterface.HttpServerService;
import org.chorem.lima.entity.Account;
import org.chorem.lima.service.LimaServiceFactory;
import org.chorem.lima.ui.MainView;
@@ -172,6 +174,9 @@
// load accounts and test if there is an account plan defined
// if not, call #loadDefaultAccount()
splash.updateProgression(0.5, _("Loading accounting..."));
+
+ //start servlet
+ LimaServiceFactory.getInstance().getService(HttpServerServiceMonitorable.class).start();
AccountService accountService =
LimaServiceFactory.getInstance().getService(
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/service/ServiceMonitorableHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/service/ServiceMonitorableHandler.java 2010-08-03 17:23:31 UTC (rev 2994)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/service/ServiceMonitorableHandler.java 2010-08-04 17:59:27 UTC (rev 2995)
@@ -19,6 +19,7 @@
package org.chorem.lima.service;
import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;
@@ -58,7 +59,11 @@
removeServiceListener((ServiceListener) args[0]);
}
else {
+ try {
result = method.invoke(service, args);
+ }catch (InvocationTargetException eee){
+ throw eee.getCause();
+ }
if (!method.getName().startsWith("get")){
for (ServiceListener serviceListener : listeners) {
serviceListener.notifyMethod(service.toString(), method.getName());
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainView.jaxx 2010-08-03 17:23:31 UTC (rev 2994)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainView.jaxx 2010-08-04 17:59:27 UTC (rev 2995)
@@ -21,25 +21,43 @@
resizable="true" width="800" height="600"
extendedState='{this.MAXIMIZED_BOTH}'>
-
+<java.awt.Desktop id='desktop' javaBean='java.awt.Desktop.getDesktop()'/>
<script><![CDATA[
-import java.util.Locale;
-import org.chorem.lima.LimaConfig;
-import org.chorem.lima.enums.ImportExportEnum;
+ import java.util.Locale;
+ import org.chorem.lima.LimaConfig;
+ import org.chorem.lima.enums.ImportExportEnum;
+ import java.net.URISyntaxException;
+ import java.net.URI;
-public LimaConfig getConfig() {
- return getContextValue(LimaConfig.class);
-}
+ public LimaConfig getConfig() {
+ return getContextValue(LimaConfig.class);
+ }
-public MainViewHandler getHandler() {
- return getContextValue(MainViewHandler.class);
-}
+ public MainViewHandler getHandler() {
+ return getContextValue(MainViewHandler.class);
+ }
-public boolean acceptLocale(Locale l, String expected) {
- return l != null && l.toString().equals(expected);
-}
+ public boolean acceptLocale(Locale l, String expected) {
+ return l != null && l.toString().equals(expected);
+ }
+ URI uri = null;
+ try {
+ uri = new URI("http://localhost:5462/");
+ } catch (URISyntaxException e) {
+ e.printStackTrace();
+ }
+
+ public void loadURI(){
+ try {
+ desktop.browse(uri);
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+
/**
* Show a new closable tab.
*
@@ -107,6 +125,9 @@
<JMenuItem text="lima.importexport.entries" onActionPerformed='getHandler().showImportExportView(this, ImportExportEnum.EBP_ENTRIES_EXPORT)'/>
</JMenu>
</JMenu>
+ <JSeparator/>
+ <JMenuItem text="lima.documents.html"
+ onActionPerformed="loadURI()"/>
<JSeparator/>
<JMenuItem text="lima.identity"
actionIcon="identity" onActionPerformed="getHandler().showIdentity(this)"/>
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainViewHandler.java 2010-08-03 17:23:31 UTC (rev 2994)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainViewHandler.java 2010-08-04 17:59:27 UTC (rev 2995)
@@ -77,7 +77,6 @@
* @return l'ui instancie et initialisee mais non visible encore
*/
public MainView initUI(LimaContext rootContext, boolean fullscreen) {
-
// show main ui
MainView ui = new MainView(rootContext);
Modified: trunk/lima-swing/src/main/resources/i18n/lima-swing-en_GB.properties
===================================================================
--- trunk/lima-swing/src/main/resources/i18n/lima-swing-en_GB.properties 2010-08-03 17:23:31 UTC (rev 2994)
+++ trunk/lima-swing/src/main/resources/i18n/lima-swing-en_GB.properties 2010-08-04 17:59:27 UTC (rev 2995)
@@ -60,6 +60,7 @@
lima.config.category.other=
lima.config.category.other.description=
lima.config.configFileName.description=
+lima.config.host.adress=
lima.config.locale.description=
lima.config.ui.flaunchui.description=
lima.config.ui.fullscreen.description=
@@ -70,6 +71,7 @@
lima.debit=Debit
lima.description=Description
lima.dialogreport=
+lima.documents.html=
lima.entries=Entries
lima.entries.addtransaction=
lima.entries.lettering=
@@ -164,6 +166,7 @@
lima.opening.accounts=
lima.opening.entrybook=
lima.opening.welcome=
+lima.pdf=
lima.period.begindate=
lima.period.create=
lima.period.enddate=
Modified: trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties
===================================================================
--- trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties 2010-08-03 17:23:31 UTC (rev 2994)
+++ trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties 2010-08-04 17:59:27 UTC (rev 2995)
@@ -56,6 +56,7 @@
lima.config.category.other=Autre
lima.config.category.other.description=Autre propri\u00E9t\u00E9s de configuration
lima.config.configFileName.description=
+lima.config.host.adress=
lima.config.locale.description=Locale utilis\u00E9e par l'application
lima.config.ui.flaunchui.description=
lima.config.ui.fullscreen.description=
@@ -66,6 +67,7 @@
lima.debit=Debit
lima.description=Description
lima.dialogreport=
+lima.documents.html=
lima.entries=Traitement
lima.entries.addtransaction=Saisir des \u00E9critures
lima.entries.lettering=Ajouter une lettre
@@ -155,6 +157,7 @@
lima.opening.accounts=<html><center>Aucun plan comptable charg\u00E9<br/>Veuillez s\u00E9lectionner un plan par d\u00E9fault, <br/>importer un plan personnalis\u00E9<br/> ou annuler pour cr\u00E9er votre propre plan.</center></html>
lima.opening.entrybook=<html>Cochez la case pour importer les journaux par d\u00E9faut \:<br/> Achats, Ventes, Tr\u00E9sorerie, Op\u00E9ration diverses</html>
lima.opening.welcome=<html><center>Bienvenue dans Lima<br/>Laissez vous guider par cet assistant pour d\u00E9marrer votre comptabilit\u00E9 en quelques instants\u0085</center></html>
+lima.pdf=
lima.period.begindate=D\u00E9but
lima.period.create=Choisissez la date de d\u00E9but et de fin du nouvel exercice
lima.period.enddate=Fin
Modified: trunk/lima-swing/src/main/resources/lima-config.properties
===================================================================
--- trunk/lima-swing/src/main/resources/lima-config.properties 2010-08-03 17:23:31 UTC (rev 2994)
+++ trunk/lima-swing/src/main/resources/lima-config.properties 2010-08-04 17:59:27 UTC (rev 2995)
@@ -18,6 +18,9 @@
lima.openejb.remotemode=false
java.naming.factory.initial=org.openejb.client.LocalInitialContextFactory
+#Lima Accounting Host address
+lima.host.address=localhost
+
# Remote mode
#lima.openejb.remotemode=true
#java.naming.factory.initial=org.apache.openejb.client.RemoteInitialContextFactory
1
0
03 Aug '10
Author: jpepin
Date: 2010-08-03 19:23:31 +0200 (Tue, 03 Aug 2010)
New Revision: 2994
Url: http://chorem.org/repositories/revision/lima/2994
Log:
Serveur http embarqu?\195?\169 + ajout de propri?\195?\169t?\195?\169s dans lima config.
Added:
trunk/lima-swing/:limadb.lock.db
trunk/lima-swing/limadb.h2.db
trunk/lima-swing/limadb.lock.db
trunk/lima-swing/src/main/java/org/chorem/lima/ui/document/
trunk/lima-swing/src/main/java/org/chorem/lima/ui/document/DocumentHtmlPane.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/document/DocumentHtmlView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/document/DocumentPdf.java
Removed:
trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExportFileChooser.java
Modified:
trunk/lima-business/pom.xml
trunk/lima-business/src/main/java/org/chorem/lima/business/LimaConfig.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/DocumentServiceImpl.java
trunk/lima-business/src/main/resources/i18n/lima-business-en_GB.properties
trunk/lima-business/src/main/resources/i18n/lima-business-fr_FR.properties
trunk/lima-business/src/main/resources/lima.properties
trunk/pom.xml
Modified: trunk/lima-business/pom.xml
===================================================================
--- trunk/lima-business/pom.xml 2010-08-03 10:41:31 UTC (rev 2993)
+++ trunk/lima-business/pom.xml 2010-08-03 17:23:31 UTC (rev 2994)
@@ -32,7 +32,13 @@
<groupId>com.lowagie</groupId>
<artifactId>itext</artifactId>
</dependency>
+
<dependency>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>jetty</artifactId>
+ </dependency>
+
+ <dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/LimaConfig.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/LimaConfig.java 2010-08-03 10:41:31 UTC (rev 2993)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/LimaConfig.java 2010-08-03 17:23:31 UTC (rev 2994)
@@ -91,7 +91,19 @@
}
+ /**
+ *
+ * @param configFileName
+ */
+ public String getReportsDir(){
+ return getOption(Option.REPORTS_DIR.getKey());
+ }
+ public int getHttpPort(){
+ return Integer.valueOf(getOption(Option.HTTP_PORT.getKey()));
+ }
+
+
protected void loadConfiguration(String configFileName){
instance.setConfigFileName(configFileName);
@@ -115,7 +127,9 @@
public static enum Option implements OptionDef {
CONFIG_FILE(CONFIG_FILE_NAME, _("lima.config.configFileName.description"), "lima-config.properties", String.class, true, true),
- RULES_NATIONALTY("lima.rules",_("lima.config.rulesnationality"),"default", String.class, false, false);
+ RULES_NATIONALTY("lima.rules", _("lima.config.rulesnationality"), "default", String.class, false, false),
+ REPORTS_DIR("lima.report.dir", _("lima.config.reports-dir"), "", String.class, false, false),
+ HTTP_PORT("lima.httpport", _("lima.config.http-port"), "5462", String.class, false, false);
public final String key;
public final String description;
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/DocumentServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/DocumentServiceImpl.java 2010-08-03 10:41:31 UTC (rev 2993)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/DocumentServiceImpl.java 2010-08-03 17:23:31 UTC (rev 2994)
@@ -21,6 +21,7 @@
import static org.nuiton.i18n.I18n._;
import java.awt.Color;
+import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.text.SimpleDateFormat;
@@ -57,13 +58,14 @@
import org.chorem.lima.entity.FinancialTransaction;
import org.chorem.lima.entity.Identity;
import org.chorem.lima.entity.LimaCallaoDAOHelper;
+import org.mortbay.jetty.Server;
+import org.mortbay.jetty.handler.ResourceHandler;
import org.nuiton.topia.TopiaContext;
import org.nuiton.topia.TopiaContextFactory;
import org.nuiton.topia.TopiaException;
import org.nuiton.topia.TopiaNotFoundException;
import org.nuiton.topia.framework.TopiaQuery;
import org.nuiton.topia.framework.TopiaQuery.Op;
-
import com.lowagie.text.BadElementException;
import com.lowagie.text.Cell;
import com.lowagie.text.Chapter;
@@ -87,7 +89,9 @@
private TopiaContext rootContext;
- //Service
+ protected Server server;
+
+ //Services
@EJB
IdentityService identityService;
@@ -100,6 +104,8 @@
@EJB
ReportService reportService;
+ protected String path;
+
//SDFs
private static SimpleDateFormat dateFormat =
new SimpleDateFormat("dd/MM/yyyy");
@@ -133,10 +139,31 @@
log.error("Can't init topia context", ex);
}
}
+ path = LimaConfig.getInstance().getReportsDir();
+ start();
}
-
+ /** start the server */
+ public void start() {
+ if (server == null) {
+ int port = LimaConfig.getInstance().getHttpPort();
+ new File(path).mkdir();
+ try {
+ server = new Server(port);
+ ResourceHandler resourceHandler = new ResourceHandler();
+ resourceHandler.setResourceBase(path);
+ server.setHandler(resourceHandler);
+ server.start();
+ log.info("Web server are running on port: "+port);
+
+ } catch (Exception eee) {
+ log.error("error while booting http server", eee);
+ }
+ }
+ }
+
+
public Paragraph createHeaderPage(String title, Identity identity, String beginDate, String endDate){
Paragraph paragraphHeaderPage = new Paragraph();
Table t = null;
@@ -230,12 +257,11 @@
Date newDate = new Date();
String dateS = dateFormat.format(newDate);
String hourS = hourFormat.format(newDate);
- String fileDateS = filedateFormat.format(newDate);
PdfWriter pdfWriter = PdfWriter.getInstance(document,
- new FileOutputStream("/lima_bcr"+fileDateS+".pdf"));
+ new FileOutputStream(path+File.separator+"lima_financialstatements.pdf"));
HtmlWriter htmlWriter = HtmlWriter.getInstance(document,
- new FileOutputStream("/lima_bcr"+fileDateS+".html"));
+ new FileOutputStream(path+File.separator+"lima_financialstatements.html"));
document.open();
int nbpages = 1;
@@ -460,16 +486,15 @@
Date newDate = new Date();
String dateS = dateFormat.format(newDate);
String hourS = hourFormat.format(newDate);
- String fileDateS = filedateFormat.format(newDate);
Double currentAmountDebit = 0.0;
Double currentAmountCredit = 0.0;
String accountcarry ="";
PdfWriter pdfWriter = PdfWriter.getInstance(document,
- new FileOutputStream("/ledger_lima"+fileDateS+".pdf"));
+ new FileOutputStream(path+File.separator+"lima_ledger.pdf"));
HtmlWriter htmlWriter = HtmlWriter.getInstance(document,
- new FileOutputStream("/ledger_lima"+fileDateS+".html"));
+ new FileOutputStream(path+File.separator+"lima_ledger.html"));
document.open();
int nbpages = 1;
Identity identity = identityService.getIdentity();
@@ -705,10 +730,11 @@
String hourS = hourFormat.format(newDate);
String fileDateS = filedateFormat.format(newDate);
+ log.debug(path);
PdfWriter pdfWriter = PdfWriter.getInstance(document,
- new FileOutputStream("/lima_ebs"+fileDateS+".pdf"));
+ new FileOutputStream(path+File.separator+"lima_entrybooks.pdf"));
HtmlWriter htmlWriter = HtmlWriter.getInstance(document,
- new FileOutputStream("/lima_ebs"+fileDateS+".html"));
+ new FileOutputStream(path+File.separator+"lima_entrybooks.html"));
document.open();
int nbpages = 1;
@@ -928,9 +954,9 @@
Double currentSoldeCredit = 0.0;
PdfWriter pdfWriter = PdfWriter.getInstance(document,
- new FileOutputStream("/balance_lima"+fileDateS+".pdf"));
+ new FileOutputStream(path+File.separator+"lima_balance.pdf"));
HtmlWriter htmlWriter = HtmlWriter.getInstance(document,
- new FileOutputStream("/balance_lima"+fileDateS+".html"));
+ new FileOutputStream(path+File.separator+"lima_balance.html"));
document.open();
int nbpages = 1;
Identity identity = identityService.getIdentity();
@@ -1117,12 +1143,10 @@
Date newDate = new Date();
String dateS = dateFormat.format(newDate);
String hourS = hourFormat.format(newDate);
- String fileDateS = filedateFormat.format(newDate);
-
PdfWriter pdfWriter = PdfWriter.getInstance(document,
- new FileOutputStream("/lima_Gebs"+fileDateS+".pdf"));
+ new FileOutputStream(path+File.separator+"lima_general_entybook.pdf"));
HtmlWriter htmlWriter = HtmlWriter.getInstance(document,
- new FileOutputStream("/lima_Gebs"+fileDateS+".html"));
+ new FileOutputStream(path+File.separator+"lima_general_entybook.html"));
document.open();
int nbpages = 1;
Modified: trunk/lima-business/src/main/resources/i18n/lima-business-en_GB.properties
===================================================================
--- trunk/lima-business/src/main/resources/i18n/lima-business-en_GB.properties 2010-08-03 10:41:31 UTC (rev 2993)
+++ trunk/lima-business/src/main/resources/i18n/lima-business-en_GB.properties 2010-08-03 17:23:31 UTC (rev 2994)
@@ -38,6 +38,8 @@
lima-business.document.voucher=Voucher
lima.business.document.date=Date
lima.config.configFileName.description=
+lima.config.http-port=
+lima.config.reports-dir=
lima.config.rulesnationality=
lima.table.grossamount=
lima.table.label=Test
Modified: trunk/lima-business/src/main/resources/i18n/lima-business-fr_FR.properties
===================================================================
--- trunk/lima-business/src/main/resources/i18n/lima-business-fr_FR.properties 2010-08-03 10:41:31 UTC (rev 2993)
+++ trunk/lima-business/src/main/resources/i18n/lima-business-fr_FR.properties 2010-08-03 17:23:31 UTC (rev 2994)
@@ -32,4 +32,6 @@
lima-business.document.vatnumber=N\u00B0 TVA
lima-business.document.voucher=Pi\u00E8ce comptable
lima.config.configFileName.description=
+lima.config.http-port=
+lima.config.reports-dir=
lima.config.rulesnationality=
Modified: trunk/lima-business/src/main/resources/lima.properties
===================================================================
--- trunk/lima-business/src/main/resources/lima.properties 2010-08-03 10:41:31 UTC (rev 2993)
+++ trunk/lima-business/src/main/resources/lima.properties 2010-08-03 17:23:31 UTC (rev 2994)
@@ -1,3 +1,14 @@
+#LIMA Defaults values
+# main directory
+lima.dir=${user.home}/.lima/
+# http port for reports
+lima.httpport=5462
+# Local class for accounting rules
+lima.rules=org.chorem.lima.business.accountingrules.FranceAccountingRules
+# directory for http server
+lima.report.dir=${lima.dir}/reports
+
+
# Proprietes par defaut pour une base de donnees de type H2
hibernate.hbm2ddl.auto=update
#hibernate.show_sql=true
@@ -2,2 +13,3 @@
+
hibernate.dialect=org.hibernate.dialect.H2Dialect
@@ -7,5 +19,4 @@
hibernate.connection.password=
hibernate.connection.driver_class=org.h2.Driver
hibernate.connection.url=jdbc:h2:file:~/.lima/limadb
-
-lima.rules=org.chorem.lima.business.accountingrules.FranceAccountingRules
+#FIXME hibernate.connection.url=jdbc:h2:file:${lima.dir}/limadb
\ No newline at end of file
Added: trunk/lima-swing/:limadb.lock.db
===================================================================
--- trunk/lima-swing/:limadb.lock.db (rev 0)
+++ trunk/lima-swing/:limadb.lock.db 2010-08-03 17:23:31 UTC (rev 2994)
@@ -0,0 +1,4 @@
+#FileLock
+#Tue Aug 03 19:12:33 CEST 2010
+id=12a38f0b67cbf55cf1fb51d173d8db55399628ae048
+method=file
Added: trunk/lima-swing/limadb.h2.db
===================================================================
(Binary files differ)
Property changes on: trunk/lima-swing/limadb.h2.db
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/lima-swing/limadb.lock.db
===================================================================
--- trunk/lima-swing/limadb.lock.db (rev 0)
+++ trunk/lima-swing/limadb.lock.db 2010-08-03 17:23:31 UTC (rev 2994)
@@ -0,0 +1,4 @@
+#FileLock
+#Tue Aug 03 19:13:22 CEST 2010
+id=12a38f1750004a9a1ddce8ec18615a18acf9c511c71
+method=file
Added: trunk/lima-swing/src/main/java/org/chorem/lima/ui/document/DocumentHtmlPane.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/document/DocumentHtmlPane.java (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/document/DocumentHtmlPane.java 2010-08-03 17:23:31 UTC (rev 2994)
@@ -0,0 +1,122 @@
+/* *##% Lima Swing
+ * Copyright (C) 2008 - 2010 CodeLutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * ##%*/
+
+package org.chorem.lima.ui.document;
+
+import static org.nuiton.i18n.I18n._;
+import java.awt.Color;
+import java.util.List;
+import javax.swing.JEditorPane;
+import javax.swing.event.HyperlinkEvent;
+import javax.swing.event.HyperlinkListener;
+import javax.swing.plaf.basic.BasicEditorPaneUI;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.chorem.lima.LimaContext;
+import org.chorem.lima.business.AccountServiceMonitorable;
+import org.chorem.lima.business.ImportServiceMonitorable;
+import org.chorem.lima.business.LimaException;
+import org.chorem.lima.business.ServiceListener;
+import org.chorem.lima.entity.Account;
+import org.chorem.lima.service.LimaServiceFactory;
+import org.chorem.lima.ui.MainView;
+
+public class DocumentHtmlPane extends JEditorPane implements HyperlinkListener, ServiceListener {
+
+ private static final long serialVersionUID = 1L;
+
+ private static final Log log = LogFactory.getLog(DocumentHtmlPane.class);
+
+ protected DocumentHtmlView view;
+
+ protected AccountServiceMonitorable accountService;
+
+ private static Color redBackground = new Color(0xff, 0xee, 0xee);
+ private static Color greenBackground = new Color(0xee, 0xff, 0xee);
+
+
+
+ public DocumentHtmlPane(DocumentHtmlView view) {
+ this.view=view;
+ accountService =
+ LimaServiceFactory.getInstance().getService(
+ AccountServiceMonitorable.class);
+ accountService.addListener(this);
+ LimaServiceFactory.getInstance().getService(
+ ImportServiceMonitorable.class).addListener(this);
+
+ //init
+ setOpaque(true);
+ setContentType("text/html");
+ setEditable(false);
+ setUI(new BasicEditorPaneUI());
+ addHyperlinkListener(this);
+ refresh();
+ }
+
+ @Override
+ public void hyperlinkUpdate(HyperlinkEvent e) {
+ if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
+
+ if (e.getDescription().equals("#accountschart")) {
+ MainView ui = LimaContext.MAIN_UI_ENTRY_DEF.getContextValue(view);
+ ui.getHandler().showAccountView(ui);
+ }
+ }
+ }
+
+ public void refresh(){
+
+ String htmlBegin = "<font face='sans-serif' size=3>"
+ + "<p style=vertical-align:'bottom', horizontal-align:'center'>";
+ String htmlEnd = "</p></font>";
+
+ try {
+
+ List<Account> accounts = accountService.getAllAccounts();
+ if (accounts.size()>0){
+ setBackground(greenBackground);
+ String accountsString = _("limahome.chartaccounts.state1_2") + " "
+ + accounts.size() + " " + _("limahome.chartaccounts.state2_2")
+ + "<br/><br/><a href='#accountschart'>"
+ + _("limahome.chartaccounts.modify") + "</a>";
+ //set Text
+ setText(htmlBegin + accountsString + htmlEnd);
+ }
+ else {
+ setBackground(redBackground);
+ String accountsString = _("limahome.chartaccounts.nothing")
+ + "<br/><br/><a href='#accountschart'>"
+ + _("limahome.chartaccounts.create") + "</a>";
+ //set Text
+ setText(htmlBegin + accountsString + htmlEnd);
+ }
+ } catch (LimaException eee) {
+ log.debug("Can't get datas account editor pane home", eee);
+ }
+ }
+
+ @Override
+ public void notifyMethod(String serviceName, String methodeName) {
+ if (methodeName.contains("Account") || methodeName.contains("importAll")){
+ refresh();
+ }
+ }
+
+}
Added: trunk/lima-swing/src/main/java/org/chorem/lima/ui/document/DocumentHtmlView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/document/DocumentHtmlView.jaxx (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/document/DocumentHtmlView.jaxx 2010-08-03 17:23:31 UTC (rev 2994)
@@ -0,0 +1,42 @@
+<!-- ##% Lima Swing
+ Copyright (C) 2008 - 2010 CodeLutin
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ as published by the Free Software Foundation; either version 2
+ of the License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ ##% -->
+
+<JDialog modal="true">
+
+ <script>
+ <![CDATA[
+ import javax.swing.BorderFactory;
+ getRootPane().setDefaultButton(ok);
+ protected void performOk() {
+ dispose();
+ }
+ ]]>
+ </script>
+
+ <Table>
+ <row>
+ <cell>
+ <JEditorPane javaBean='new org.chorem.lima.ui.document.DocumentHtmlPane(this)'/>
+ </cell>
+ </row>
+ <row>
+ <cell anchor='east' fill="none">
+ <JButton id='ok' text="lima.common.ok" onActionPerformed="performOk()"/>
+ </cell>
+ </row>
+ </Table>
+</JDialog>
\ No newline at end of file
Added: trunk/lima-swing/src/main/java/org/chorem/lima/ui/document/DocumentPdf.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/document/DocumentPdf.java (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/document/DocumentPdf.java 2010-08-03 17:23:31 UTC (rev 2994)
@@ -0,0 +1,5 @@
+package org.chorem.lima.ui.document;
+
+public class DocumentPdf {
+
+}
Deleted: trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExportFileChooser.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExportFileChooser.java 2010-08-03 10:41:31 UTC (rev 2993)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExportFileChooser.java 2010-08-03 17:23:31 UTC (rev 2994)
@@ -1,34 +0,0 @@
-package org.chorem.lima.ui.importexport;
-
-import java.awt.BorderLayout;
-import java.awt.Component;
-
-import javax.swing.JPanel;
-
-public class ImportExportFileChooser extends JPanel {
-
- private static final long serialVersionUID = 1L;
-
- public ImportExportFileChooser() {
-
- setLayout(new BorderLayout());
- // il y a 4 composants dans le JFileChooser, on les retire un par un pour les replacer comme on le souhaite
- Component navigationBar = getComponent(0);
- remove(0);
- // on retire un JPanel qui n'est pas utile
- remove(0);
- add(navigationBar, BorderLayout.NORTH);
- Component panelFiles = getComponent(0);
- remove(0);
- add(panelFiles, BorderLayout.CENTER);
- Component buttons = getComponent(0);
- remove(0);
- add(buttons, BorderLayout.SOUTH);
-
- //this.add(panelFileChooser);
- //this.add(panelOptions, BorderLayout.SOUTH);
-
- }
-
-
-}
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2010-08-03 10:41:31 UTC (rev 2993)
+++ trunk/pom.xml 2010-08-03 17:23:31 UTC (rev 2994)
@@ -173,6 +173,13 @@
<version>2.1.7</version>
</dependency>
+ <dependency>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>jetty</artifactId>
+ <version>6.1.25</version>
+ </dependency>
+
+
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
1
0
r2993 - in trunk: lima-business/src/main/java/org/chorem/lima/business/ejb lima-business/src/main/java/org/chorem/lima/business/ejbinterface lima-business/src/main/resources/i18n lima-callao/src/main/xmi lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports lima-swing/src/main/java/org/chorem/lima/ui/ledger
by jpepin@users.chorem.org 03 Aug '10
by jpepin@users.chorem.org 03 Aug '10
03 Aug '10
Author: jpepin
Date: 2010-08-03 12:41:31 +0200 (Tue, 03 Aug 2010)
New Revision: 2993
Url: http://chorem.org/repositories/revision/lima/2993
Log:
Sortie document pdf journal g?\195?\169n?\195?\169ral.
Modified:
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/DocumentServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/DocumentService.java
trunk/lima-business/src/main/resources/i18n/lima-business-en_GB.properties
trunk/lima-business/src/main/resources/i18n/lima-business-fr_FR.properties
trunk/lima-callao/src/main/xmi/accounting.zargo
trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsViewHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerViewHandler.java
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/DocumentServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/DocumentServiceImpl.java 2010-08-02 16:54:10 UTC (rev 2992)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/DocumentServiceImpl.java 2010-08-03 10:41:31 UTC (rev 2993)
@@ -25,6 +25,7 @@
import java.io.FileOutputStream;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.Date;
import java.util.List;
import javax.ejb.EJB;
@@ -33,6 +34,8 @@
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.beans.BalanceTrial;
import org.chorem.lima.beans.FinancialStatementAmounts;
+import org.chorem.lima.beans.GeneralEntryBooksDatas;
+import org.chorem.lima.beans.GeneralEntryBooksDatasImpl;
import org.chorem.lima.beans.ReportsDatas;
import org.chorem.lima.business.LimaConfig;
import org.chorem.lima.business.LimaException;
@@ -42,12 +45,15 @@
import org.chorem.lima.business.ejbinterface.FinancialStatementService;
import org.chorem.lima.business.ejbinterface.IdentityService;
import org.chorem.lima.business.ejbinterface.ReportService;
+import org.chorem.lima.business.utils.EntryComparator;
import org.chorem.lima.entity.Account;
import org.chorem.lima.entity.ClosedPeriodicEntryBook;
import org.chorem.lima.entity.ClosedPeriodicEntryBookDAO;
import org.chorem.lima.entity.Entry;
import org.chorem.lima.entity.EntryBook;
import org.chorem.lima.entity.EntryDAO;
+import org.chorem.lima.entity.FinancialPeriod;
+import org.chorem.lima.entity.FinancialPeriodDAO;
import org.chorem.lima.entity.FinancialTransaction;
import org.chorem.lima.entity.Identity;
import org.chorem.lima.entity.LimaCallaoDAOHelper;
@@ -131,7 +137,8 @@
- public Table createHeaderPage(String title, Identity identity, String beginDate, String endDate){
+ public Paragraph createHeaderPage(String title, Identity identity, String beginDate, String endDate){
+ Paragraph paragraphHeaderPage = new Paragraph();
Table t = null;
try {
@@ -154,34 +161,61 @@
titleCell.setHorizontalAlignment(Element.ALIGN_CENTER);
titleCell.setRowspan(2);
t.addCell(titleCell);
- t.addCell(new Phrase(_("lima-business.document.businessnumber"), bolditalicFont));
+ t.addCell(new Phrase(_("lima-business.document.businessnumber"),
+ bolditalicFont));
t.addCell(new Phrase(identity.getBusinessNumber(), italicFont));
//line 2
t.addCell(new Phrase(identity.getDescription(), italicFont));
- t.addCell(new Phrase(_("lima-business.document.classificationcode"), bolditalicFont));
+ t.addCell(new Phrase(_("lima-business.document.classificationcode"),
+ bolditalicFont));
t.addCell(new Phrase(identity.getClassificationCode(), italicFont));
//line 3
t.addCell(new Phrase(identity.getAddress(), italicFont));
t.addCell("");
- t.addCell(new Phrase(_("lima-business.document.vatnumber"), bolditalicFont));
+ t.addCell(new Phrase(_("lima-business.document.vatnumber"),
+ bolditalicFont));
t.addCell(new Phrase(identity.getVatNumber(), italicFont));
//line 4
t.addCell(new Phrase(identity.getAddress2(), italicFont));
t.addCell("");
- t.addCell(new Phrase(_("lima-business.document.period1"), bolditalicFont));
+ t.addCell(new Phrase(_("lima-business.document.period1"),
+ bolditalicFont));
t.addCell(new Phrase(beginDate, italicFont));
//line 5
- t.addCell(new Phrase(identity.getZipCode() + " " + identity.getCity(), italicFont));
+ t.addCell(new Phrase(identity.getZipCode() + " " + identity.getCity(),
+ italicFont));
t.addCell("");
- t.addCell(new Phrase(_("lima-business.document.period2"), bolditalicFont));
+ t.addCell(new Phrase(_("lima-business.document.period2"),
+ bolditalicFont));
t.addCell(new Phrase(endDate, italicFont));
} catch (BadElementException eeBEE) {
log.error("Can't create table", eeBEE);
}
- return t;
+
+ paragraphHeaderPage.add(t);
+ return paragraphHeaderPage;
}
+ public Paragraph createNumberPage (int nbPages, String dateS, String hourS) throws BadElementException{
+ //n° page
+ Paragraph paragraphPage = new Paragraph();
+ Table infos = new Table(2);
+ infos.setWidth(100f);
+ infos.setBorder(Rectangle.NO_BORDER);
+ infos.setOffset(2);
+ Cell c = new Cell();
+ c.setBorder(Rectangle.NO_BORDER);
+ c.setHorizontalAlignment(Element.ALIGN_CENTER);
+ infos.setDefaultCell(c);
+ infos.addCell(new Phrase(_("lima-business.document.createdate1")
+ + dateS + _("lima-business.document.createdate2")
+ + hourS, normalFont));
+ infos.addCell(new Phrase(_("lima-business.document.pagenumber")
+ + nbPages, normalFont));
+ return paragraphPage;
+ }
+
//############## FinancialStatements ##############
@@ -189,7 +223,8 @@
public void createFinancialStatementsDocuments(Date beginDate, Date endDate) throws LimaException {
Document document = new Document(PageSize.A4, 8, 8, 8, 8);
- List<FinancialStatementAmounts> financialStatementAmounts = financialStatementService.financialStatementReport(beginDate, endDate);
+ List<FinancialStatementAmounts> financialStatementAmounts =
+ financialStatementService.financialStatementReport(beginDate, endDate);
try {
Date newDate = new Date();
@@ -207,12 +242,14 @@
Identity identity = identityService.getIdentity();
//Split list by financialstatement type
- List<List<FinancialStatementAmounts>> listList = new ArrayList<List<FinancialStatementAmounts>>();
+ List<List<FinancialStatementAmounts>> listList =
+ new ArrayList<List<FinancialStatementAmounts>>();
Boolean first = true;
int min=0;
int size = financialStatementAmounts.size();
for (int i=0;i<size;i++) {
- FinancialStatementAmounts fStatementAmounts = financialStatementAmounts.get(i);
+ FinancialStatementAmounts fStatementAmounts =
+ financialStatementAmounts.get(i);
if (fStatementAmounts.getLevel() == 1 && fStatementAmounts.getSubAmount() == false){
if (first){
first=false;
@@ -239,29 +276,16 @@
List <FinancialStatementAmounts> subFinancialStatementAmounts =
list.subList(i, j);
//create page : header + table + footer
- Table headerPage = createHeaderPage(title, identity, dateFormat.format(beginDate), dateFormat.format(endDate));
Table headerTable = createFinancialStatementsHeaderTable();
- Table table = createFinancialStatementsTable(subFinancialStatementAmounts);
+ Table table = createFinancialStatementsTable(
+ subFinancialStatementAmounts);
//new page
Chapter chapter = new Chapter(0);
//headerPage
- Paragraph paragraphHeaderPage = new Paragraph();
- paragraphHeaderPage.add(headerPage);
- chapter.add(paragraphHeaderPage);
+ chapter.add(createHeaderPage(title, identity,
+ dateFormat.format(beginDate), dateFormat.format(endDate)));
//n° page
- Paragraph paragraphPage = new Paragraph();
- Table infos = new Table(2);
- infos.setWidth(100f);
- infos.setBorder(Rectangle.NO_BORDER);
- infos.setOffset(2);
- Cell c = new Cell();
- c.setBorder(Rectangle.NO_BORDER);
- c.setHorizontalAlignment(Element.ALIGN_CENTER);
- infos.setDefaultCell(c);
- infos.addCell(new Phrase(_("lima-business.document.createdate1") + dateS + _("lima-business.document.createdate2") + hourS, normalFont));
- infos.addCell(new Phrase(_("lima-business.document.pagenumber")+nbpages, normalFont));
- paragraphPage.add(infos);
- chapter.add(paragraphPage);
+ chapter.add(createNumberPage(nbpages, dateS, hourS));
//headerTable
Paragraph paragraphHeaderTable = new Paragraph();
paragraphHeaderTable.add(headerTable);
@@ -300,10 +324,14 @@
cell.setHorizontalAlignment(Element.ALIGN_CENTER);
t.setDefaultCell(cell);
t.setOffset(8);
- t.addCell(new Phrase(_("lima-business.document.label"), boldFont));
- t.addCell(new Phrase(_("lima-business.document.grossamount"), boldFont));
- t.addCell(new Phrase(_("lima-business.document.provisiondeprecationamount"), boldFont));
- t.addCell(new Phrase(_("lima-business.document.netamount"), boldFont));
+ t.addCell(new Phrase(_("lima-business.document.label"),
+ boldFont));
+ t.addCell(new Phrase(_("lima-business.document.grossamount"),
+ boldFont));
+ t.addCell(new Phrase(_("lima-business.document.provisiondeprecationamount"),
+ boldFont));
+ t.addCell(new Phrase(_("lima-business.document.netamount"),
+ boldFont));
} catch (BadElementException eeBEE) {
log.error("Can't create table", eeBEE);
@@ -334,10 +362,11 @@
String label = financialStatementAmount.getLabel();
int level = financialStatementAmount.getLevel();
- Double grossAmount = financialStatementAmount.getGrossAmount();
- Double provisionDeprecationAmount = financialStatementAmount.getProvisionDeprecationAmount();
+ Double grossAmount =
+ financialStatementAmount.getGrossAmount();
+ Double provisionDeprecationAmount =
+ financialStatementAmount.getProvisionDeprecationAmount();
- log.debug(label +" "+ level);
if (financialStatementAmount.getSubAmount() && level==1){
cell.setGrayFill(0.88f);
}
@@ -371,7 +400,8 @@
t.addCell(c);
//cell2
if (grossAmount != 0.0){
- phrase = new Phrase(String.valueOf(grossAmount), normalFont);
+ phrase = new Phrase(String.valueOf(
+ grossAmount), normalFont);
}
else {
phrase = new Phrase("");
@@ -379,7 +409,8 @@
t.addCell(phrase);
//cell 3
if (provisionDeprecationAmount != 0.0){
- phrase = new Phrase(String.valueOf(provisionDeprecationAmount), normalFont);
+ phrase = new Phrase(String.valueOf(
+ provisionDeprecationAmount), normalFont);
}
else {
phrase = new Phrase("");
@@ -387,7 +418,8 @@
t.addCell(phrase);
//cell 4
if (grossAmount-provisionDeprecationAmount != 0.0){
- phrase = new Phrase(String.valueOf(grossAmount-provisionDeprecationAmount), normalFont);
+ phrase = new Phrase(String.valueOf(
+ grossAmount-provisionDeprecationAmount), normalFont);
}
else {
phrase = new Phrase("");
@@ -408,10 +440,23 @@
@Override
- public void createLedgerDocuments(List<Object> list, Date beginDate, Date endDate) throws LimaException {
+ public void createLedgerDocuments(Date beginDate, Date endDate) throws LimaException {
Document document = new Document(PageSize.A4, 8, 8, 8, 8);
-
+ List<Object> list = new ArrayList<Object>();
try {
+
+ BalanceTrial balanceTrial = reportService.generateLedger(beginDate, endDate, true);
+ if (balanceTrial.getReportsDatas() != null){
+ for (ReportsDatas reportsDatas : balanceTrial.getReportsDatas()) {
+ list.add(reportsDatas);
+ List<Entry> entries = (List<Entry>) reportsDatas.getListEntry();
+ if (entries != null){
+ Collections.sort(entries, new EntryComparator());
+ list.addAll(entries);
+ }
+ }
+ }
+
Date newDate = new Date();
String dateS = dateFormat.format(newDate);
String hourS = hourFormat.format(newDate);
@@ -441,28 +486,14 @@
}
List <Object> subList = list.subList(i, j);
//create page : header + table + footer
- Table headerPage = createHeaderPage(title, identity, dateFormat.format(beginDate), dateFormat.format(endDate));
Table headerTable = createLedgerHeaderTable();
//new page
Chapter chapter = new Chapter(0);
//headerPage
- Paragraph paragraphHeaderPage = new Paragraph();
- paragraphHeaderPage.add(headerPage);
- chapter.add(paragraphHeaderPage);
+ chapter.add(createHeaderPage(title, identity,
+ dateFormat.format(beginDate), dateFormat.format(endDate)));
//n° page
- Paragraph paragraphPage = new Paragraph();
- Table infos = new Table(2);
- infos.setWidth(100f);
- infos.setBorder(Rectangle.NO_BORDER);
- infos.setOffset(2);
- Cell c = new Cell();
- c.setBorder(Rectangle.NO_BORDER);
- c.setHorizontalAlignment(Element.ALIGN_CENTER);
- infos.setDefaultCell(c);
- infos.addCell(new Phrase(_("lima-business.document.createdate1") + dateS + _("lima-business.document.createdate2") + hourS, normalFont));
- infos.addCell(new Phrase(_("lima-business.document.pagenumber")+nbpages, normalFont));
- paragraphPage.add(infos);
- chapter.add(paragraphPage);
+ chapter.add(createNumberPage(nbpages, dateS, hourS));
//headerTable
Paragraph paragraphHeaderTable = new Paragraph();
paragraphHeaderTable.add(headerTable);
@@ -470,7 +501,9 @@
//backward amounts
if (n>max && nbpages>1){
Paragraph backwardParagraph = new Paragraph();
- backwardParagraph.add(createLedgerAmountTable(accountcarry, _("lima-business.document.carryback"), currentAmountDebit, currentAmountCredit));
+ backwardParagraph.add(createLedgerAmountTable(
+ accountcarry, _("lima-business.document.carryback"),
+ currentAmountDebit, currentAmountCredit));
chapter.add(backwardParagraph);
}
//table
@@ -488,21 +521,25 @@
ReportsDatas reportsDatas = (ReportsDatas) object;
Account account = reportsDatas.getAccount();
if ( account != null){
- accountcarry = account.getAccountNumber()+" "+account.getLabel()+" ";
- log.debug(accountcarry);
+ accountcarry = account.getAccountNumber()
+ + " " + account.getLabel() + " ";
}
}
}
//forward amounts
if (n>max && i<=n-max){
Paragraph forwardParagraph = new Paragraph();
- forwardParagraph.add(createLedgerAmountTable("", _("lima-business.document.carryforward"), currentAmountDebit, currentAmountCredit));
+ forwardParagraph.add(createLedgerAmountTable("",
+ _("lima-business.document.carryforward"),
+ currentAmountDebit, currentAmountCredit));
chapter.add(forwardParagraph);
}
//final amounts
if (i>=n-max){
Paragraph finalAmountParagraph = new Paragraph();
- finalAmountParagraph.add(createLedgerAmountTable("", _("lima-business.document.amounts"), currentAmountDebit, currentAmountCredit));
+ finalAmountParagraph.add(createLedgerAmountTable("",
+ _("lima-business.document.amounts"),
+ currentAmountDebit, currentAmountCredit));
chapter.add(finalAmountParagraph);
}
//add page
@@ -599,13 +636,18 @@
Double amountDebit = entry.getDebit() ? entry.getAmount() : 0;
Double amountCredit = entry.getDebit() ? 0 : entry.getAmount();
- t.addCell(new Phrase(dateFormat.format(entry.getFinancialTransaction().getTransactionDate()), normalFont));
+ t.addCell(new Phrase(dateFormat.format(
+ entry.getFinancialTransaction().getTransactionDate()),
+ normalFont));
t.addCell(new Phrase(entryBookCode, normalFont));
t.addCell(new Phrase(entry.getVoucher(), normalFont));
t.addCell(new Phrase(entry.getDescription(), normalFont));
- t.addCell(new Phrase(String.valueOf(amountDebit), normalFont));
- t.addCell(new Phrase(String.valueOf(amountCredit), normalFont));
- t.addCell(new Phrase(String.valueOf(amountDebit-amountCredit), normalFont));
+ t.addCell(new Phrase(String.valueOf(amountDebit),
+ normalFont));
+ t.addCell(new Phrase(String.valueOf(amountCredit),
+ normalFont));
+ t.addCell(new Phrase(String.valueOf(amountDebit-amountCredit),
+ normalFont));
}
}
@@ -672,17 +714,25 @@
Identity identity = identityService.getIdentity();
- ClosedPeriodicEntryBookDAO closedPeriodicEntryBookDAO = LimaCallaoDAOHelper.getClosedPeriodicEntryBookDAO(transaction);
+ ClosedPeriodicEntryBookDAO closedPeriodicEntryBookDAO =
+ LimaCallaoDAOHelper.getClosedPeriodicEntryBookDAO(transaction);
EntryDAO entryDAO = LimaCallaoDAOHelper.getEntryDAO(transaction);
//Split list by financialstatement type
- List<ClosedPeriodicEntryBook> closedPeriodicEntryBookList = closedPeriodicEntryBookDAO.findAllByDates(beginDate, endDate);
+ List<ClosedPeriodicEntryBook> closedPeriodicEntryBookList =
+ closedPeriodicEntryBookDAO.findAllByDates(beginDate, endDate);
for (ClosedPeriodicEntryBook closedPeriodicEntryBook : closedPeriodicEntryBookList) {
TopiaQuery query = entryDAO.createQuery();
- String financialPeriodProperty = TopiaQuery.getProperty(Entry.FINANCIAL_TRANSACTION, FinancialTransaction.FINANCIAL_PERIOD);
- String entryBookProperty = TopiaQuery.getProperty(Entry.FINANCIAL_TRANSACTION, FinancialTransaction.ENTRY_BOOK);
- query.addWhere(financialPeriodProperty, Op.EQ, closedPeriodicEntryBook.getFinancialPeriod())
- .addWhere(entryBookProperty, Op.EQ, closedPeriodicEntryBook.getEntryBook());
+ String financialPeriodProperty =
+ TopiaQuery.getProperty(Entry.FINANCIAL_TRANSACTION,
+ FinancialTransaction.FINANCIAL_PERIOD);
+ String entryBookProperty =
+ TopiaQuery.getProperty(Entry.FINANCIAL_TRANSACTION,
+ FinancialTransaction.ENTRY_BOOK);
+ query.addWhere(financialPeriodProperty, Op.EQ,
+ closedPeriodicEntryBook.getFinancialPeriod())
+ .addWhere(entryBookProperty, Op.EQ,
+ closedPeriodicEntryBook.getEntryBook());
List<Entry> entries = entryDAO.findAllByQuery(query);
@@ -707,7 +757,9 @@
}
//create pages
- String title = closedPeriodicEntryBook.getEntryBook().getLabel() + "\n" + monthYearFormat.format(closedPeriodicEntryBook.getFinancialPeriod().getBeginDate());
+ String title = closedPeriodicEntryBook.getEntryBook().getLabel()
+ + "\n" + monthYearFormat.format(
+ closedPeriodicEntryBook.getFinancialPeriod().getBeginDate());
//list = list.subList(1, list.size());
int i=0;
int n=entries.size();
@@ -720,29 +772,15 @@
List <Entry> subEntries =
entries.subList(i, j);
//create page : header + table + footer
- Table headerPage = createHeaderPage(title, identity, dateFormat.format(beginDate), dateFormat.format(endDate));
Table headerTable = createEntryBooksHeaderTable();
Table table = createEntryBooksTable(subEntries);
//new page
Chapter chapter = new Chapter(0);
- //headerPage
- Paragraph paragraphHeaderPage = new Paragraph();
- paragraphHeaderPage.add(headerPage);
- chapter.add(paragraphHeaderPage);
- //n° page
- Paragraph paragraphPage = new Paragraph();
- Table infos = new Table(2);
- infos.setWidth(100f);
- infos.setBorder(Rectangle.NO_BORDER);
- infos.setOffset(2);
- Cell c = new Cell();
- c.setBorder(Rectangle.NO_BORDER);
- c.setHorizontalAlignment(Element.ALIGN_CENTER);
- infos.setDefaultCell(c);
- infos.addCell(new Phrase(_("lima-business.document.createdate1") + dateS + _("lima-business.document.createdate2") + hourS, normalFont));
- infos.addCell(new Phrase(_("lima-business.document.pagenumber")+nbpages, normalFont));
- paragraphPage.add(infos);
- chapter.add(paragraphPage);
+ //headerPage
+ chapter.add(createHeaderPage(title, identity,
+ dateFormat.format(beginDate), dateFormat.format(endDate)));
+ //n° page
+ chapter.add(createNumberPage(nbpages, dateS, hourS));
//headerTable
Paragraph paragraphHeaderTable = new Paragraph();
paragraphHeaderTable.add(headerTable);
@@ -754,7 +792,8 @@
//final amounts
if (i>=n-max){
Paragraph finalAmountParagraph = new Paragraph();
- finalAmountParagraph.add(createEntryBooksAmountTable(_("lima-business.document.amounts"), debit, credit));
+ finalAmountParagraph.add(createEntryBooksAmountTable(
+ _("lima-business.document.amounts"), debit, credit));
chapter.add(finalAmountParagraph);
}
//add page
@@ -824,12 +863,16 @@
t.setDefaultCell(cell);
for (Entry entry : entries) {
- t.addCell(new Phrase(dateFormat.format(entry.getFinancialTransaction().getTransactionDate()), normalFont));
+ t.addCell(new Phrase(dateFormat.format(
+ entry.getFinancialTransaction().getTransactionDate()),
+ normalFont));
t.addCell(new Phrase(entry.getAccount().getAccountNumber(), normalFont));
t.addCell(new Phrase(entry.getVoucher(), normalFont));
t.addCell(new Phrase(entry.getDescription(), normalFont));
- t.addCell(new Phrase(String.valueOf(entry.getDebit() ? entry.getAmount() : 0), normalFont));
- t.addCell(new Phrase(String.valueOf(entry.getDebit() ? entry.getAmount() : 0), normalFont));
+ t.addCell(new Phrase(String.valueOf(
+ entry.getDebit() ? entry.getAmount() : 0), normalFont));
+ t.addCell(new Phrase(String.valueOf(
+ entry.getDebit() ? entry.getAmount() : 0), normalFont));
}
} catch (BadElementException eeBEE) {
@@ -869,7 +912,7 @@
Document document = new Document(PageSize.A4, 8, 8, 8, 8);
BalanceTrial balanceTrial =
- reportService.generateBalanceTrial(beginDate, endDate, null, false, false);
+ reportService.generateBalanceTrial(beginDate, endDate, null, false, true);
List<ReportsDatas> list = (List<ReportsDatas>) balanceTrial.getReportsDatas();
@@ -904,28 +947,13 @@
}
List <ReportsDatas> subList = list.subList(i, j);
//create page : header + table + footer
- Table headerPage = createHeaderPage(title, identity, dateFormat.format(beginDate), dateFormat.format(endDate));
Table headerTable = createBalanceHeaderTable();
//new page
Chapter chapter = new Chapter(0);
//headerPage
- Paragraph paragraphHeaderPage = new Paragraph();
- paragraphHeaderPage.add(headerPage);
- chapter.add(paragraphHeaderPage);
+ chapter.add(createHeaderPage(title, identity, dateFormat.format(beginDate), dateFormat.format(endDate)));
//n° page
- Paragraph paragraphPage = new Paragraph();
- Table infos = new Table(2);
- infos.setWidth(100f);
- infos.setBorder(Rectangle.NO_BORDER);
- infos.setOffset(2);
- Cell c = new Cell();
- c.setBorder(Rectangle.NO_BORDER);
- c.setHorizontalAlignment(Element.ALIGN_CENTER);
- infos.setDefaultCell(c);
- infos.addCell(new Phrase(_("lima-business.document.createdate1") + dateS + _("lima-business.document.createdate2") + hourS, normalFont));
- infos.addCell(new Phrase(_("lima-business.document.pagenumber") + nbpages, normalFont));
- paragraphPage.add(infos);
- chapter.add(paragraphPage);
+ chapter.add(createNumberPage(nbpages, dateS, hourS));
//headerTable
Paragraph paragraphHeaderTable = new Paragraph();
paragraphHeaderTable.add(headerTable);
@@ -933,7 +961,10 @@
//backward amounts
if (n>max && nbpages>1){
Paragraph backwardParagraph = new Paragraph();
- backwardParagraph.add(createBalanceAmountTable(_("lima-business.document.carryback"), currentAmountDebit, currentAmountCredit, currentSoldeDebit, currentSoldeCredit));
+ backwardParagraph.add(createBalanceAmountTable(
+ _("lima-business.document.carryback"),
+ currentAmountDebit, currentAmountCredit,
+ currentSoldeDebit, currentSoldeCredit));
chapter.add(backwardParagraph);
}
//table
@@ -944,19 +975,27 @@
for (ReportsDatas reportsDatas : subList){
currentAmountDebit += reportsDatas.getAmountDebit();
currentAmountCredit += reportsDatas.getAmountCredit();
- currentSoldeDebit += reportsDatas.getSoldeDebit() ? reportsDatas.getAmountSolde() : 0;
- currentSoldeCredit += reportsDatas.getSoldeDebit() ? 0 : reportsDatas.getAmountSolde();
+ currentSoldeDebit +=
+ reportsDatas.getSoldeDebit() ? reportsDatas.getAmountSolde() : 0;
+ currentSoldeCredit +=
+ reportsDatas.getSoldeDebit() ? 0 : reportsDatas.getAmountSolde();
}
//forward amounts
if (n>max && i<=n-max){
Paragraph forwardParagraph = new Paragraph();
- forwardParagraph.add(createBalanceAmountTable(_("lima-business.document.carryforward"), currentAmountDebit, currentAmountCredit, currentSoldeDebit, currentSoldeCredit));
+ forwardParagraph.add(createBalanceAmountTable(
+ _("lima-business.document.carryforward"),
+ currentAmountDebit, currentAmountCredit,
+ currentSoldeDebit, currentSoldeCredit));
chapter.add(forwardParagraph);
}
//final amounts
if (i>=n-max){
Paragraph finalAmountParagraph = new Paragraph();
- finalAmountParagraph.add(createBalanceAmountTable(_("lima-business.document.amounts"), currentAmountDebit, currentAmountCredit, currentSoldeDebit, currentSoldeCredit));
+ finalAmountParagraph.add(createBalanceAmountTable(
+ _("lima-business.document.amounts"),
+ currentAmountDebit, currentAmountCredit,
+ currentSoldeDebit, currentSoldeCredit));
chapter.add(finalAmountParagraph);
}
//add page
@@ -1064,7 +1103,267 @@
return t;
}
+ //############## General EntryBook ##############
+
+ @Override
+ public void createGeneralEntryBooksDocuments(Date beginDate, Date endDate) throws LimaException {
+ Document document = new Document(PageSize.A4, 8, 8, 8, 8);
+ TopiaContext transaction = null;
+
+ try {
+ transaction = beginTransaction();
+
+ Date newDate = new Date();
+ String dateS = dateFormat.format(newDate);
+ String hourS = hourFormat.format(newDate);
+ String fileDateS = filedateFormat.format(newDate);
+
+ PdfWriter pdfWriter = PdfWriter.getInstance(document,
+ new FileOutputStream("/lima_Gebs"+fileDateS+".pdf"));
+ HtmlWriter htmlWriter = HtmlWriter.getInstance(document,
+ new FileOutputStream("/lima_Gebs"+fileDateS+".html"));
+ document.open();
+ int nbpages = 1;
+
+ Identity identity = identityService.getIdentity();
+
+ FinancialPeriodDAO financialPeriodDAO =
+ LimaCallaoDAOHelper.getFinancialPeriodDAO(transaction);
+ ClosedPeriodicEntryBookDAO closedPeriodicEntryBookDAO =
+ LimaCallaoDAOHelper.getClosedPeriodicEntryBookDAO(transaction);
+ EntryDAO entryDAO = LimaCallaoDAOHelper.getEntryDAO(transaction);
+
+
+ TopiaQuery financialPeriodsQuery = financialPeriodDAO.createQuery();
+ String beginDateProperty = TopiaQuery.getProperty(FinancialPeriod.BEGIN_DATE);
+ String endDateProperty = TopiaQuery.getProperty(FinancialPeriod.BEGIN_DATE);
+ financialPeriodsQuery.addWhere(beginDateProperty, Op.GE, beginDate)
+ .addWhere(endDateProperty, Op.LE, endDate)
+ .addOrder(beginDateProperty);
+ List<FinancialPeriod> financialPeriods =
+ financialPeriodDAO.findAllByQuery(financialPeriodsQuery);
+
+ List<GeneralEntryBooksDatas> list = new ArrayList<GeneralEntryBooksDatas>();
+ Double amountDebit = 0.0;
+ Double amountCredit = 0.0;
+ for (FinancialPeriod financialPeriod : financialPeriods) {
+ List<ClosedPeriodicEntryBook> closedPeriodicEntryBookList =
+ closedPeriodicEntryBookDAO.findAllByDates(
+ financialPeriod.getBeginDate(), financialPeriod.getEndDate());
+
+ Double subAmountDebit = 0.0;
+ Double subAmountCredit = 0.0;
+ for (ClosedPeriodicEntryBook closedPeriodicEntryBook : closedPeriodicEntryBookList) {
+
+ List<Object[]> results = new ArrayList<Object[]>();
+ TopiaQuery query = entryDAO.createQuery();
+ Double debit = 0.0;
+ Double credit = 0.0;
+
+ String financialPeriodProperty = TopiaQuery.getProperty(
+ Entry.FINANCIAL_TRANSACTION,
+ FinancialTransaction.FINANCIAL_PERIOD);
+ String entryBookProperty = TopiaQuery.getProperty(
+ Entry.FINANCIAL_TRANSACTION,
+ FinancialTransaction.ENTRY_BOOK);
+ query.addWhere(financialPeriodProperty, Op.EQ,
+ closedPeriodicEntryBook.getFinancialPeriod())
+ .addWhere(entryBookProperty, Op.EQ,
+ closedPeriodicEntryBook.getEntryBook())
+ .setSelect(Entry.DEBIT, "SUM("+Entry.AMOUNT+")")
+ .addGroup(Entry.DEBIT);
+ results = query.execute(transaction);
+
+ int nbAmount = results.size();
+ if(nbAmount==2){
+ debit = (Double)results.get(0)[1];
+ credit = (Double)results.get(1)[1];
+ }
+ if (nbAmount==1){
+ if ((Boolean)results.get(0)[0]){
+ debit = (Double)results.get(0)[1];
+ }
+ else {
+ credit = (Double)results.get(0)[1];
+ }
+ }
+ GeneralEntryBooksDatas generalEntryBooksDatas =
+ new GeneralEntryBooksDatasImpl();
+ generalEntryBooksDatas.setCode(
+ closedPeriodicEntryBook.getEntryBook().getCode());
+ generalEntryBooksDatas.setDescription(
+ closedPeriodicEntryBook.getEntryBook().getLabel());
+ generalEntryBooksDatas.setPeriod(
+ monthYearFormat.format(financialPeriod.getBeginDate()));
+ generalEntryBooksDatas.setCredit(credit);
+ generalEntryBooksDatas.setDebit(debit);
+ list.add(generalEntryBooksDatas);
+ subAmountCredit += credit;
+ subAmountDebit += debit;
+ }
+ GeneralEntryBooksDatas generalEntryBooksDatas =
+ new GeneralEntryBooksDatasImpl();
+ generalEntryBooksDatas.setSubAmount(true);
+ generalEntryBooksDatas.setCredit(subAmountCredit);
+ generalEntryBooksDatas.setDebit(subAmountDebit);
+ generalEntryBooksDatas.setPeriod(
+ monthYearFormat.format(financialPeriod.getBeginDate()));
+ list.add(generalEntryBooksDatas);
+ amountCredit += subAmountCredit;
+ amountDebit += subAmountDebit;
+ }
+ GeneralEntryBooksDatas generalEntryBooksDatas =
+ new GeneralEntryBooksDatasImpl();
+ generalEntryBooksDatas.setAmount(true);
+ generalEntryBooksDatas.setCredit(amountCredit);
+ generalEntryBooksDatas.setDebit(amountDebit);
+ list.add(generalEntryBooksDatas);
+
+
+ //create pages
+ int i=0;
+ int n=list.size();
+ int max=35;
+ while (i<n){
+ int j=i+max;
+ if (j>n){
+ j = n;
+ }
+ List <GeneralEntryBooksDatas> subList =
+ list.subList(i, j);
+ //create page : header + table + footer
+ Table headerTable = createGeneralEntryBooksHeaderTable();
+ Table table = createGeneralEntryBooksTable(subList);
+ //new page
+ Chapter chapter = new Chapter(0);
+ //headerPage
+ chapter.add(createHeaderPage(
+ _("lima-business.document.generalentrybook"),
+ identity, dateFormat.format(beginDate),
+ dateFormat.format(endDate)));
+ //n° page
+ chapter.add(createNumberPage(nbpages, dateS, hourS));
+ //headerTable
+ Paragraph paragraphHeaderTable = new Paragraph();
+ paragraphHeaderTable.add(headerTable);
+ chapter.add(paragraphHeaderTable);
+ //table
+ Paragraph paragraphTable = new Paragraph();
+ paragraphTable.add(table);
+ chapter.add(paragraphTable);
+ //add page
+ document.add(chapter);
+ i=i+max;
+ nbpages++;
+ }
+
+ document.close();
+
+ } catch (FileNotFoundException eeFNFE) {
+ log.error("Can't create pdf file", eeFNFE);
+ } catch (DocumentException eeDE) {
+ log.error("Can't create document", eeDE);
+ } catch (TopiaException eeTE) {
+ log.error("Can't get entries", eeTE);
+ }
+
+ }
+
+ public Table createGeneralEntryBooksHeaderTable(){
+ Table t = null;
+ try {
+ t = new Table(5,1);
+ float[] widths = {0.1f, 0.45f, 0.15f, 0.15f, 0.15f};
+ t.setWidths(widths);
+ t.setWidth(100f);
+ t.setPadding(3f);
+ //defaut cell
+ Cell cell = new Cell();
+ cell.setBorder(Rectangle.LEFT);
+ cell.setHorizontalAlignment(Element.ALIGN_CENTER);
+ t.setDefaultCell(cell);
+ t.setOffset(8);
+ t.addCell(new Phrase(_("lima-business.document.entrybook"), boldFont));
+ t.addCell(new Phrase(_("lima-business.document.label"), boldFont));
+ t.addCell(new Phrase(_("lima-business.document.date"), boldFont));
+ t.addCell(new Phrase(_("lima-business.document.debit"), boldFont));
+ t.addCell(new Phrase(_("lima-business.document.credit"), boldFont));
+
+ } catch (BadElementException eeBEE) {
+ log.error("Can't create table", eeBEE);
+ }
+ return t;
+
+ }
+
+ public Table createGeneralEntryBooksTable(List <GeneralEntryBooksDatas> list){
+ int nbrow = list.size();
+ Table t = null;
+ try {
+ //define table
+ t = new Table(5,nbrow);
+ t.setWidth(100f);
+ float[] widths = {0.1f, 0.45f, 0.15f, 0.15f, 0.15f};
+ t.setWidths(widths);
+ t.setPadding(1.5f);
+ t.setBorderWidth(1);
+ t.setOffset(0);
+ //define default cell
+ Cell cell = new Cell();
+ cell.setBorder(Rectangle.LEFT);
+ cell.setHorizontalAlignment(Element.ALIGN_RIGHT);
+ t.setDefaultCell(cell);
+
+ for (GeneralEntryBooksDatas generalEntryBooksDatas : list) {
+ if (!generalEntryBooksDatas.getAmount() && !generalEntryBooksDatas.getSubAmount()){
+ t.addCell(new Phrase(
+ generalEntryBooksDatas.getCode(), normalFont));
+ t.addCell(new Phrase(
+ generalEntryBooksDatas.getDescription(), normalFont));
+ t.addCell(new Phrase(
+ generalEntryBooksDatas.getPeriod(), normalFont));
+ t.addCell(new Phrase(
+ String.valueOf(generalEntryBooksDatas.getDebit()),
+ normalFont));
+ t.addCell(new Phrase(
+ String.valueOf(generalEntryBooksDatas.getCredit()),
+ normalFont));
+ }
+ else {
+ Phrase phrase = null;
+ if (generalEntryBooksDatas.getAmount()){
+ phrase = new Phrase(_("lima-business.document.amounts"),
+ boldFont);
+ }
+ else {
+ phrase = new Phrase(_("lima-business.document.amounts")
+ + " " + generalEntryBooksDatas.getPeriod(),
+ boldFont);
+ }
+ Cell cell2 = new Cell(phrase);
+ cell2.setBorder(Rectangle.TOP+Rectangle.BOTTOM);
+ cell2.setColspan(3);
+ t.addCell(cell2);
+ cell2 = new Cell(new Phrase(
+ String.valueOf(generalEntryBooksDatas.getDebit()),
+ boldFont));
+ cell2.setBorder(Rectangle.TOP+Rectangle.BOTTOM);
+ t.addCell(cell2);
+ cell2 = new Cell(new Phrase(
+ String.valueOf(generalEntryBooksDatas.getCredit()),
+ boldFont));
+ cell2.setBorder(Rectangle.TOP+Rectangle.BOTTOM);
+ t.addCell(cell2);
+ }
+ }
+
+ } catch (BadElementException eeBEE) {
+ log.error("Can't create table", eeBEE);
+ }
+ return t;
+ }
+
protected TopiaContext beginTransaction() throws TopiaException {
// basic check done, make check in database
// TODO move it into JTA
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/DocumentService.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/DocumentService.java 2010-08-02 16:54:10 UTC (rev 2992)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/DocumentService.java 2010-08-03 10:41:31 UTC (rev 2993)
@@ -34,7 +34,9 @@
public interface DocumentService {
public void createFinancialStatementsDocuments(Date beginDate, Date endDate) throws LimaException;
- public void createLedgerDocuments(List<Object> objects, Date beginDate, Date endDate) throws LimaException;
+ public void createLedgerDocuments(Date beginDate, Date endDate) throws LimaException;
public void createEntryBooksDocuments(Date beginDate, Date endDate) throws LimaException;
public void createBalanceDocuments(Date beginDate, Date endDate) throws LimaException;
+ public void createGeneralEntryBooksDocuments(Date beginDate, Date endDate) throws LimaException;
+
}
Modified: trunk/lima-business/src/main/resources/i18n/lima-business-en_GB.properties
===================================================================
--- trunk/lima-business/src/main/resources/i18n/lima-business-en_GB.properties 2010-08-02 16:54:10 UTC (rev 2992)
+++ trunk/lima-business/src/main/resources/i18n/lima-business-en_GB.properties 2010-08-03 10:41:31 UTC (rev 2993)
@@ -20,6 +20,7 @@
lima-business.document.debit=Debit
lima-business.document.description=Description
lima-business.document.entrybook=EntryBook
+lima-business.document.generalentrybook=
lima-business.document.grossamount=Gross Amount
lima-business.document.label=Label
lima-business.document.ledger=
Modified: trunk/lima-business/src/main/resources/i18n/lima-business-fr_FR.properties
===================================================================
--- trunk/lima-business/src/main/resources/i18n/lima-business-fr_FR.properties 2010-08-02 16:54:10 UTC (rev 2992)
+++ trunk/lima-business/src/main/resources/i18n/lima-business-fr_FR.properties 2010-08-03 10:41:31 UTC (rev 2993)
@@ -15,6 +15,7 @@
lima-business.document.debit=D\u00E9bit
lima-business.document.description=Description
lima-business.document.entrybook=Journal
+lima-business.document.generalentrybook=Journal G\u00E9n\u00E9ral
lima-business.document.grossamount=Brut
lima-business.document.label=Libell\u00E9
lima-business.document.ledger=Grand Livre
Modified: trunk/lima-callao/src/main/xmi/accounting.zargo
===================================================================
(Binary files differ)
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsViewHandler.java 2010-08-02 16:54:10 UTC (rev 2992)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsViewHandler.java 2010-08-03 10:41:31 UTC (rev 2993)
@@ -151,6 +151,7 @@
public void createPdf() {
try {
documentService.createEntryBooksDocuments(selectedBeginDate, selectedEndDate);
+ documentService.createGeneralEntryBooksDocuments(selectedBeginDate, selectedEndDate);
} catch (LimaException eee) {
if(log.isDebugEnabled()){
log.debug("Can't create PDF", eee);
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 2010-08-02 16:54:10 UTC (rev 2992)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerViewHandler.java 2010-08-03 10:41:31 UTC (rev 2993)
@@ -160,7 +160,7 @@
public void createPdf() {
try {
- documentService.createLedgerDocuments(cachedatasList, selectedBeginDate, selectedEndDate);
+ documentService.createLedgerDocuments(selectedBeginDate, selectedEndDate);
} catch (LimaException eee) {
if(log.isDebugEnabled()){
log.debug("Can't create PDF", eee);
1
0
Author: jpepin
Date: 2010-08-02 18:54:10 +0200 (Mon, 02 Aug 2010)
New Revision: 2992
Url: http://chorem.org/repositories/revision/lima/2992
Log:
Sortie document pdf balance et journaux.
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/DocumentServiceImpl.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/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/DocumentService.java
trunk/lima-business/src/main/resources/i18n/lima-business-en_GB.properties
trunk/lima-business/src/main/resources/i18n/lima-business-fr_FR.properties
trunk/lima-callao/src/main/java/org/chorem/lima/entity/ClosedPeriodicEntryBookDAOImpl.java
trunk/lima-callao/src/main/xmi/accounting.zargo
trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceViewHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsViewHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportTableModel.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/accountingrules/DefaultAccountingRules.java 2010-08-02 13:02:10 UTC (rev 2991)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/DefaultAccountingRules.java 2010-08-02 16:54:10 UTC (rev 2992)
@@ -173,7 +173,7 @@
for (EntryBook entryBook : entryBooks) {
ClosedPeriodicEntryBook closedPeriodicEntryBook =
- closedPeriodicEntryBookDAO.findbyEntryBookAndFinancialPeriod(
+ closedPeriodicEntryBookDAO.findByEntryBookAndFinancialPeriod(
entryBook, financialPeriod);
if(closedPeriodicEntryBook.getLocked()){
closedEntryBooks.add(entryBook);
@@ -237,7 +237,7 @@
//second case
ClosedPeriodicEntryBook closedPeriodicEntryBook =
- closedPeriodicEntryBookDAO.findbyEntryBookAndFinancialPeriod(
+ closedPeriodicEntryBookDAO.findByEntryBookAndFinancialPeriod(
entryOld.getFinancialTransaction().getEntryBook(), financialPeriod);
if (closedPeriodicEntryBook.getLocked()){
throw new LimaBusinessException("2 - Can't update entry : financialperiod of this entrybook is closed");
@@ -245,7 +245,7 @@
//third case
ClosedPeriodicEntryBook closedPeriodicEntryBook2 =
- closedPeriodicEntryBookDAO.findbyEntryBookAndFinancialPeriod(
+ closedPeriodicEntryBookDAO.findByEntryBookAndFinancialPeriod(
entry.getFinancialTransaction().getEntryBook(), financialPeriod);
// Check 2 & 3 cases
@@ -293,7 +293,7 @@
//3. the actual entrybook belong to a blocked closedPeriodicEntryBook
ClosedPeriodicEntryBook closedPeriodicEntryBookOld =
- closedPeriodicEntryBookDAO.findbyEntryBookAndFinancialPeriod(
+ closedPeriodicEntryBookDAO.findByEntryBookAndFinancialPeriod(
financialTransactionOld.getEntryBook(), financialPeriod);
if (closedPeriodicEntryBookOld.getLocked()){
throw new LimaBusinessException("Can't update financialtransaction : financialperiod of this entrybook is closed");
@@ -301,7 +301,7 @@
//4. the new entrybook belong to a blocked closedPeriodicEntryBook
ClosedPeriodicEntryBook closedPeriodicEntryBook =
- closedPeriodicEntryBookDAO.findbyEntryBookAndFinancialPeriod(
+ closedPeriodicEntryBookDAO.findByEntryBookAndFinancialPeriod(
financialTransaction.getEntryBook(), financialPeriod);
if (closedPeriodicEntryBook.getLocked()){
throw new LimaBusinessException("Can't update financialtransaction : financialperiod of new entrybook is closed");
@@ -309,7 +309,7 @@
//5. the actual entrybook belong to a blocked closedPeriodicEntryBook
ClosedPeriodicEntryBook closedPeriodicEntryBookOld2 =
- closedPeriodicEntryBookDAO.findbyEntryBookAndFinancialPeriod(
+ closedPeriodicEntryBookDAO.findByEntryBookAndFinancialPeriod(
financialTransactionOld.getEntryBook(), financialPeriodOld);
if (closedPeriodicEntryBookOld2.getLocked()){
throw new LimaBusinessException("Can't update financialtransaction : the new financialperiod of this entrybook is closed");
@@ -317,7 +317,7 @@
//6. the new entrybook belong to a blocked closedPeriodicEntryBook
ClosedPeriodicEntryBook closedPeriodicEntryBook2 =
- closedPeriodicEntryBookDAO.findbyEntryBookAndFinancialPeriod(
+ closedPeriodicEntryBookDAO.findByEntryBookAndFinancialPeriod(
financialTransaction.getEntryBook(), financialPeriodOld);
if (closedPeriodicEntryBook2.getLocked()){
throw new LimaBusinessException("Can't update financialtransaction : this financialperiod of new entrybook is closed");
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/DocumentServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/DocumentServiceImpl.java 2010-08-02 13:02:10 UTC (rev 2991)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/DocumentServiceImpl.java 2010-08-02 16:54:10 UTC (rev 2992)
@@ -31,21 +31,33 @@
import javax.ejb.Stateless;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.chorem.lima.beans.BalanceTrial;
import org.chorem.lima.beans.FinancialStatementAmounts;
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.EntryBookService;
+import org.chorem.lima.business.ejbinterface.FinancialStatementService;
import org.chorem.lima.business.ejbinterface.IdentityService;
+import org.chorem.lima.business.ejbinterface.ReportService;
import org.chorem.lima.entity.Account;
+import org.chorem.lima.entity.ClosedPeriodicEntryBook;
+import org.chorem.lima.entity.ClosedPeriodicEntryBookDAO;
import org.chorem.lima.entity.Entry;
import org.chorem.lima.entity.EntryBook;
+import org.chorem.lima.entity.EntryDAO;
+import org.chorem.lima.entity.FinancialTransaction;
import org.chorem.lima.entity.Identity;
+import org.chorem.lima.entity.LimaCallaoDAOHelper;
import org.nuiton.topia.TopiaContext;
import org.nuiton.topia.TopiaContextFactory;
import org.nuiton.topia.TopiaException;
import org.nuiton.topia.TopiaNotFoundException;
+import org.nuiton.topia.framework.TopiaQuery;
+import org.nuiton.topia.framework.TopiaQuery.Op;
+
import com.lowagie.text.BadElementException;
import com.lowagie.text.Cell;
import com.lowagie.text.Chapter;
@@ -73,6 +85,15 @@
@EJB
IdentityService identityService;
+ @EJB
+ EntryBookService entryBookService;
+
+ @EJB
+ FinancialStatementService financialStatementService;
+
+ @EJB
+ ReportService reportService;
+
//SDFs
private static SimpleDateFormat dateFormat =
new SimpleDateFormat("dd/MM/yyyy");
@@ -80,6 +101,8 @@
new SimpleDateFormat("HH:mm");
private static SimpleDateFormat filedateFormat =
new SimpleDateFormat("dd-MM-yyyy_HH-mm");
+ private static SimpleDateFormat monthYearFormat =
+ new SimpleDateFormat("MMM yyyy");
//FONTs
private static Font titleFont =
@@ -158,14 +181,16 @@
return t;
}
-
+
//############## FinancialStatements ##############
@Override
- public void createFinancialStatementsDocuments(List<FinancialStatementAmounts> financialStatementAmounts, Date beginDate, Date endDate) throws LimaException {
+ public void createFinancialStatementsDocuments(Date beginDate, Date endDate) throws LimaException {
Document document = new Document(PageSize.A4, 8, 8, 8, 8);
+ List<FinancialStatementAmounts> financialStatementAmounts = financialStatementService.financialStatementReport(beginDate, endDate);
+
try {
Date newDate = new Date();
String dateS = dateFormat.format(newDate);
@@ -383,8 +408,7 @@
@Override
- public void createLedgerDocuments(List<Object> list, Date beginDate,
- Date endDate) throws LimaException {
+ public void createLedgerDocuments(List<Object> list, Date beginDate, Date endDate) throws LimaException {
Document document = new Document(PageSize.A4, 8, 8, 8, 8);
try {
@@ -472,13 +496,13 @@
//forward amounts
if (n>max && i<=n-max){
Paragraph forwardParagraph = new Paragraph();
- forwardParagraph.add(createLedgerAmountTable("", _("", "lima-business.document.carryforward"), currentAmountDebit, currentAmountCredit));
+ forwardParagraph.add(createLedgerAmountTable("", _("lima-business.document.carryforward"), currentAmountDebit, currentAmountCredit));
chapter.add(forwardParagraph);
}
//final amounts
if (i>=n-max){
Paragraph finalAmountParagraph = new Paragraph();
- finalAmountParagraph.add(createLedgerAmountTable("", _("lima-business.document.amount"), currentAmountDebit, currentAmountCredit));
+ finalAmountParagraph.add(createLedgerAmountTable("", _("lima-business.document.amounts"), currentAmountDebit, currentAmountCredit));
chapter.add(finalAmountParagraph);
}
//add page
@@ -524,37 +548,6 @@
}
- public Table createLedgerAmountTable(String account, String title, Double credit, Double debit){
- Table t = null;
- try {
- t = new Table(5,1);
- float[] widths = {0.4f,0.15f, 0.15f, 0.15f, 0.15f};
- t.setWidths(widths);
- t.setWidth(100f);
- t.setPadding(3f);
- t.setOffset(0);
- //defaut cell
- Cell cell = new Cell();
- cell.setBorder(Rectangle.RIGHT);
- cell.setHorizontalAlignment(Element.ALIGN_RIGHT);
- t.setDefaultCell(cell);
-
- Cell accountCell = new Cell(new Phrase(account, boldFont));
- accountCell.setHorizontalAlignment(Element.ALIGN_LEFT);
- accountCell.setBorder(Rectangle.NO_BORDER);
- t.addCell(accountCell);
- t.addCell(new Phrase(title, boldFont));
- t.addCell(new Phrase(debit.toString(), boldFont));
- t.addCell(new Phrase(credit.toString(), boldFont));
- Double solde = debit-credit;
- t.addCell(new Phrase(solde.toString(), boldFont));
- } catch (BadElementException eeBEE) {
- log.error("Can't create table", eeBEE);
- }
- return t;
-
- }
-
public Table createLedgerTable(List<Object> subList){
int nbrow = subList.size();
Table t = null;
@@ -623,7 +616,456 @@
return t;
}
- protected TopiaContext beginTransaction() throws TopiaException {
+ public Table createLedgerAmountTable(String account, String title, Double credit, Double debit){
+ Table t = null;
+ try {
+ t = new Table(5,1);
+ float[] widths = {0.4f,0.15f, 0.15f, 0.15f, 0.15f};
+ t.setWidths(widths);
+ t.setWidth(100f);
+ t.setPadding(3f);
+ t.setOffset(0);
+ //defaut cell
+ Cell cell = new Cell();
+ cell.setBorder(Rectangle.RIGHT);
+ cell.setHorizontalAlignment(Element.ALIGN_RIGHT);
+ t.setDefaultCell(cell);
+
+ Cell accountCell = new Cell(new Phrase(account, boldFont));
+ accountCell.setHorizontalAlignment(Element.ALIGN_LEFT);
+ accountCell.setBorder(Rectangle.NO_BORDER);
+ t.addCell(accountCell);
+ t.addCell(new Phrase(title, boldFont));
+ t.addCell(new Phrase(debit.toString(), boldFont));
+ t.addCell(new Phrase(credit.toString(), boldFont));
+ Double solde = debit-credit;
+ t.addCell(new Phrase(solde.toString(), boldFont));
+ } catch (BadElementException eeBEE) {
+ log.error("Can't create table", eeBEE);
+ }
+ return t;
+ }
+
+ //############## EntryBooks ##############
+
+
+
+ @Override
+ public void createEntryBooksDocuments(Date beginDate, Date endDate) throws LimaException {
+ Document document = new Document(PageSize.A4, 8, 8, 8, 8);
+ TopiaContext transaction = null;
+
+ try {
+ transaction = beginTransaction();
+
+ Date newDate = new Date();
+ String dateS = dateFormat.format(newDate);
+ String hourS = hourFormat.format(newDate);
+ String fileDateS = filedateFormat.format(newDate);
+
+ PdfWriter pdfWriter = PdfWriter.getInstance(document,
+ new FileOutputStream("/lima_ebs"+fileDateS+".pdf"));
+ HtmlWriter htmlWriter = HtmlWriter.getInstance(document,
+ new FileOutputStream("/lima_ebs"+fileDateS+".html"));
+ document.open();
+ int nbpages = 1;
+
+ Identity identity = identityService.getIdentity();
+
+ ClosedPeriodicEntryBookDAO closedPeriodicEntryBookDAO = LimaCallaoDAOHelper.getClosedPeriodicEntryBookDAO(transaction);
+ EntryDAO entryDAO = LimaCallaoDAOHelper.getEntryDAO(transaction);
+ //Split list by financialstatement type
+ List<ClosedPeriodicEntryBook> closedPeriodicEntryBookList = closedPeriodicEntryBookDAO.findAllByDates(beginDate, endDate);
+ for (ClosedPeriodicEntryBook closedPeriodicEntryBook : closedPeriodicEntryBookList) {
+
+ TopiaQuery query = entryDAO.createQuery();
+ String financialPeriodProperty = TopiaQuery.getProperty(Entry.FINANCIAL_TRANSACTION, FinancialTransaction.FINANCIAL_PERIOD);
+ String entryBookProperty = TopiaQuery.getProperty(Entry.FINANCIAL_TRANSACTION, FinancialTransaction.ENTRY_BOOK);
+ query.addWhere(financialPeriodProperty, Op.EQ, closedPeriodicEntryBook.getFinancialPeriod())
+ .addWhere(entryBookProperty, Op.EQ, closedPeriodicEntryBook.getEntryBook());
+
+ List<Entry> entries = entryDAO.findAllByQuery(query);
+
+ List<Object[]> results = new ArrayList<Object[]>();
+ Double debit = 0.0;
+ Double credit = 0.0;
+ query.setSelect(Entry.DEBIT, "SUM("+Entry.AMOUNT+")");
+ query.addGroup(Entry.DEBIT);
+ results = query.execute(transaction);
+ int nbAmount = results.size();
+ if(nbAmount==2){
+ debit = (Double)results.get(0)[1];
+ credit = (Double)results.get(1)[1];
+ }
+ if (nbAmount==1){
+ if ((Boolean)results.get(0)[0]){
+ debit = (Double)results.get(0)[1];
+ }
+ else {
+ credit = (Double)results.get(0)[1];
+ }
+ }
+
+ //create pages
+ String title = closedPeriodicEntryBook.getEntryBook().getLabel() + "\n" + monthYearFormat.format(closedPeriodicEntryBook.getFinancialPeriod().getBeginDate());
+ //list = list.subList(1, list.size());
+ int i=0;
+ int n=entries.size();
+ int max=35;
+ while (i<n){
+ int j=i+max;
+ if (j>n){
+ j = n;
+ }
+ List <Entry> subEntries =
+ entries.subList(i, j);
+ //create page : header + table + footer
+ Table headerPage = createHeaderPage(title, identity, dateFormat.format(beginDate), dateFormat.format(endDate));
+ Table headerTable = createEntryBooksHeaderTable();
+ Table table = createEntryBooksTable(subEntries);
+ //new page
+ Chapter chapter = new Chapter(0);
+ //headerPage
+ Paragraph paragraphHeaderPage = new Paragraph();
+ paragraphHeaderPage.add(headerPage);
+ chapter.add(paragraphHeaderPage);
+ //n° page
+ Paragraph paragraphPage = new Paragraph();
+ Table infos = new Table(2);
+ infos.setWidth(100f);
+ infos.setBorder(Rectangle.NO_BORDER);
+ infos.setOffset(2);
+ Cell c = new Cell();
+ c.setBorder(Rectangle.NO_BORDER);
+ c.setHorizontalAlignment(Element.ALIGN_CENTER);
+ infos.setDefaultCell(c);
+ infos.addCell(new Phrase(_("lima-business.document.createdate1") + dateS + _("lima-business.document.createdate2") + hourS, normalFont));
+ infos.addCell(new Phrase(_("lima-business.document.pagenumber")+nbpages, normalFont));
+ paragraphPage.add(infos);
+ chapter.add(paragraphPage);
+ //headerTable
+ Paragraph paragraphHeaderTable = new Paragraph();
+ paragraphHeaderTable.add(headerTable);
+ chapter.add(paragraphHeaderTable);
+ //table
+ Paragraph paragraphTable = new Paragraph();
+ paragraphTable.add(table);
+ chapter.add(paragraphTable);
+ //final amounts
+ if (i>=n-max){
+ Paragraph finalAmountParagraph = new Paragraph();
+ finalAmountParagraph.add(createEntryBooksAmountTable(_("lima-business.document.amounts"), debit, credit));
+ chapter.add(finalAmountParagraph);
+ }
+ //add page
+ document.add(chapter);
+ i=i+max;
+ nbpages++;
+ }
+ }
+
+ document.close();
+
+ } catch (FileNotFoundException eeFNFE) {
+ log.error("Can't create pdf file", eeFNFE);
+ } catch (DocumentException eeDE) {
+ log.error("Can't create document", eeDE);
+ } catch (TopiaException eeTE) {
+ log.error("Can't get entries", eeTE);
+
+ }
+
+ }
+
+ public Table createEntryBooksHeaderTable(){
+ Table t = null;
+ try {
+ t = new Table(6,1);
+ float[] widths = {0.1f, 0.1f, 0.1f, 0.4f, 0.15f, 0.15f};
+ t.setWidths(widths);
+ t.setWidth(100f);
+ t.setPadding(3f);
+ //defaut cell
+ Cell cell = new Cell();
+ cell.setBorder(Rectangle.LEFT);
+ cell.setHorizontalAlignment(Element.ALIGN_CENTER);
+ t.setDefaultCell(cell);
+ t.setOffset(8);
+ t.addCell(new Phrase(_("lima-business.document.date"), boldFont));
+ t.addCell(new Phrase(_("lima-business.document.accountnumber"), boldFont));
+ t.addCell(new Phrase(_("lima-business.document.voucher"), boldFont));
+ t.addCell(new Phrase(_("lima-business.document.description"), boldFont));
+ t.addCell(new Phrase(_("lima-business.document.debit"), boldFont));
+ t.addCell(new Phrase(_("lima-business.document.credit"), boldFont));
+
+ } catch (BadElementException eeBEE) {
+ log.error("Can't create table", eeBEE);
+ }
+ return t;
+
+ }
+
+ public Table createEntryBooksTable(List<Entry> entries){
+ int nbrow = entries.size();
+ Table t = null;
+ try {
+ //define table
+ t = new Table(6,nbrow);
+ t.setWidth(100f);
+ float[] widths = {0.1f, 0.1f, 0.1f, 0.4f, 0.15f, 0.15f};
+ t.setWidths(widths);
+ t.setPadding(1.5f);
+ t.setBorderWidth(1);
+ t.setOffset(0);
+ //define default cell
+ Cell cell = new Cell();
+ cell.setBorder(Rectangle.LEFT);
+ cell.setHorizontalAlignment(Element.ALIGN_RIGHT);
+ t.setDefaultCell(cell);
+
+ for (Entry entry : entries) {
+ t.addCell(new Phrase(dateFormat.format(entry.getFinancialTransaction().getTransactionDate()), normalFont));
+ t.addCell(new Phrase(entry.getAccount().getAccountNumber(), normalFont));
+ t.addCell(new Phrase(entry.getVoucher(), normalFont));
+ t.addCell(new Phrase(entry.getDescription(), normalFont));
+ t.addCell(new Phrase(String.valueOf(entry.getDebit() ? entry.getAmount() : 0), normalFont));
+ t.addCell(new Phrase(String.valueOf(entry.getDebit() ? entry.getAmount() : 0), normalFont));
+ }
+
+ } catch (BadElementException eeBEE) {
+ log.error("Can't create table", eeBEE);
+ }
+ return t;
+ }
+
+ public Table createEntryBooksAmountTable(String title, Double credit, Double debit){
+ Table t = null;
+ try {
+ t = new Table(3,1);
+ float[] widths = {0.7f, 0.15f, 0.15f};
+ t.setWidths(widths);
+ t.setWidth(100f);
+ t.setPadding(3f);
+ t.setOffset(0);
+ //defaut cell
+ Cell cell = new Cell();
+ cell.setBorder(Rectangle.RIGHT);
+ cell.setHorizontalAlignment(Element.ALIGN_RIGHT);
+ t.setDefaultCell(cell);
+
+ t.addCell(new Phrase(title, boldFont));
+ t.addCell(new Phrase(debit.toString(), boldFont));
+ t.addCell(new Phrase(credit.toString(), boldFont));
+ } catch (BadElementException eeBEE) {
+ log.error("Can't create table", eeBEE);
+ }
+ return t;
+ }
+
+ //############## Balance ##############
+
+ @Override
+ public void createBalanceDocuments(Date beginDate, Date endDate) throws LimaException {
+ Document document = new Document(PageSize.A4, 8, 8, 8, 8);
+
+ BalanceTrial balanceTrial =
+ reportService.generateBalanceTrial(beginDate, endDate, null, false, false);
+
+ List<ReportsDatas> list = (List<ReportsDatas>) balanceTrial.getReportsDatas();
+
+ try {
+ Date newDate = new Date();
+ String dateS = dateFormat.format(newDate);
+ String hourS = hourFormat.format(newDate);
+ String fileDateS = filedateFormat.format(newDate);
+
+ Double currentAmountDebit = 0.0;
+ Double currentAmountCredit = 0.0;
+ Double currentSoldeDebit = 0.0;
+ Double currentSoldeCredit = 0.0;
+
+ PdfWriter pdfWriter = PdfWriter.getInstance(document,
+ new FileOutputStream("/balance_lima"+fileDateS+".pdf"));
+ HtmlWriter htmlWriter = HtmlWriter.getInstance(document,
+ new FileOutputStream("/balance_lima"+fileDateS+".html"));
+ document.open();
+ int nbpages = 1;
+ Identity identity = identityService.getIdentity();
+
+ //create pages
+ String title = _("lima-business.document.balance");
+ int i=0;
+ int n=list.size();
+ int max = 26;
+ while (i<n){
+ int j = i+max;
+ if (j>n){
+ j = n;
+ }
+ List <ReportsDatas> subList = list.subList(i, j);
+ //create page : header + table + footer
+ Table headerPage = createHeaderPage(title, identity, dateFormat.format(beginDate), dateFormat.format(endDate));
+ Table headerTable = createBalanceHeaderTable();
+ //new page
+ Chapter chapter = new Chapter(0);
+ //headerPage
+ Paragraph paragraphHeaderPage = new Paragraph();
+ paragraphHeaderPage.add(headerPage);
+ chapter.add(paragraphHeaderPage);
+ //n° page
+ Paragraph paragraphPage = new Paragraph();
+ Table infos = new Table(2);
+ infos.setWidth(100f);
+ infos.setBorder(Rectangle.NO_BORDER);
+ infos.setOffset(2);
+ Cell c = new Cell();
+ c.setBorder(Rectangle.NO_BORDER);
+ c.setHorizontalAlignment(Element.ALIGN_CENTER);
+ infos.setDefaultCell(c);
+ infos.addCell(new Phrase(_("lima-business.document.createdate1") + dateS + _("lima-business.document.createdate2") + hourS, normalFont));
+ infos.addCell(new Phrase(_("lima-business.document.pagenumber") + nbpages, normalFont));
+ paragraphPage.add(infos);
+ chapter.add(paragraphPage);
+ //headerTable
+ Paragraph paragraphHeaderTable = new Paragraph();
+ paragraphHeaderTable.add(headerTable);
+ chapter.add(paragraphHeaderTable);
+ //backward amounts
+ if (n>max && nbpages>1){
+ Paragraph backwardParagraph = new Paragraph();
+ backwardParagraph.add(createBalanceAmountTable(_("lima-business.document.carryback"), currentAmountDebit, currentAmountCredit, currentSoldeDebit, currentSoldeCredit));
+ chapter.add(backwardParagraph);
+ }
+ //table
+ Paragraph paragraphTable = new Paragraph();
+ Table table = createBalanceTable(subList);
+ paragraphTable.add(table);
+ chapter.add(paragraphTable);
+ for (ReportsDatas reportsDatas : subList){
+ currentAmountDebit += reportsDatas.getAmountDebit();
+ currentAmountCredit += reportsDatas.getAmountCredit();
+ currentSoldeDebit += reportsDatas.getSoldeDebit() ? reportsDatas.getAmountSolde() : 0;
+ currentSoldeCredit += reportsDatas.getSoldeDebit() ? 0 : reportsDatas.getAmountSolde();
+ }
+ //forward amounts
+ if (n>max && i<=n-max){
+ Paragraph forwardParagraph = new Paragraph();
+ forwardParagraph.add(createBalanceAmountTable(_("lima-business.document.carryforward"), currentAmountDebit, currentAmountCredit, currentSoldeDebit, currentSoldeCredit));
+ chapter.add(forwardParagraph);
+ }
+ //final amounts
+ if (i>=n-max){
+ Paragraph finalAmountParagraph = new Paragraph();
+ finalAmountParagraph.add(createBalanceAmountTable(_("lima-business.document.amounts"), currentAmountDebit, currentAmountCredit, currentSoldeDebit, currentSoldeCredit));
+ chapter.add(finalAmountParagraph);
+ }
+ //add page
+ document.add(chapter);
+ i=i+max;
+ nbpages++;
+ }
+ document.close();
+
+ } catch (FileNotFoundException eeFNFE) {
+ log.error("Can't create pdf file", eeFNFE);
+ } catch (DocumentException eeDE) {
+ log.error("Can't create document", eeDE);
+ }
+ }
+
+ public Table createBalanceHeaderTable(){
+ Table t = null;
+ try {
+ t = new Table(6,1);
+ float[] widths = {0.07f, 0.33f, 0.15f, 0.15f, 0.15f, 0.15f};
+ t.setWidths(widths);
+ t.setWidth(100f);
+ t.setPadding(3.5f);
+ //defaut cell
+ Cell cell = new Cell();
+ cell.setBorder(Rectangle.LEFT);
+ cell.setHorizontalAlignment(Element.ALIGN_CENTER);
+ t.setDefaultCell(cell);
+ t.setOffset(8);
+ t.addCell(new Phrase(_("lima-business.document.accountnumber"), boldFont));
+ t.addCell(new Phrase(_("lima-business.document.description"), boldFont));
+ t.addCell(new Phrase(_("lima-business.document.movementdebit"), boldFont));
+ t.addCell(new Phrase(_("lima-business.document.movementcredit"), boldFont));
+ t.addCell(new Phrase(_("lima-business.document.soldedebit"), boldFont));
+ t.addCell(new Phrase(_("lima-business.document.soldecredit"), boldFont));
+
+ } catch (BadElementException eeBEE) {
+ log.error("Can't create table", eeBEE);
+ }
+ return t;
+
+ }
+
+ public Table createBalanceTable(List<ReportsDatas> subList){
+ int nbrow = subList.size();
+ Table t = null;
+ try {
+ //define table
+ t = new Table(6, nbrow);
+ t.setWidth(100f);
+ float[] widths = {0.07f, 0.33f, 0.15f, 0.15f, 0.15f, 0.15f};
+ t.setWidths(widths);
+ t.setPadding(1.5f);
+ t.setBorderWidth(1);
+ t.setOffset(0);
+ //define default cell
+ Cell cell = new Cell();
+ cell.setBorder(Rectangle.LEFT);
+ cell.setHorizontalAlignment(Element.ALIGN_RIGHT);
+ t.setDefaultCell(cell);
+
+ for (ReportsDatas reportsDatas : subList) {
+
+ String soldeDebit = String.valueOf(reportsDatas.getSoldeDebit() ? reportsDatas.getAmountSolde() : 0);
+ String soldeCredit = String.valueOf(reportsDatas.getSoldeDebit() ? 0 : reportsDatas.getAmountSolde());
+
+ t.addCell(new Phrase(reportsDatas.getAccount().getAccountNumber(), normalFont));
+ t.addCell(new Phrase(reportsDatas.getAccount().getLabel(), normalFont));
+ t.addCell(new Phrase(String.valueOf(reportsDatas.getAmountDebit()), normalFont));
+ t.addCell(new Phrase(String.valueOf(reportsDatas.getAmountCredit()), normalFont));
+ t.addCell(new Phrase(soldeDebit, normalFont));
+ t.addCell(new Phrase(soldeCredit, normalFont));
+ }
+ } catch (DocumentException eeDE) {
+ log.error("Can't create table", eeDE);
+
+ }
+ return t;
+ }
+
+ public Table createBalanceAmountTable(String title, Double amountDebit, Double amountCredit, Double soldeDebit, Double soldeCredit ){
+ Table t = null;
+ try {
+ t = new Table(5,1);
+ float[] widths = {0.4f,0.15f, 0.15f, 0.15f, 0.15f};
+ t.setWidths(widths);
+ t.setWidth(100f);
+ t.setPadding(3f);
+ t.setOffset(0);
+ //defaut cell
+ Cell cell = new Cell();
+ cell.setBorder(Rectangle.RIGHT);
+ cell.setHorizontalAlignment(Element.ALIGN_RIGHT);
+ t.setDefaultCell(cell);
+
+ t.addCell(new Phrase(title, boldFont));
+ t.addCell(new Phrase(amountDebit.toString(), boldFont));
+ t.addCell(new Phrase(amountCredit.toString(), boldFont));
+ t.addCell(new Phrase(soldeDebit.toString(), boldFont));
+ t.addCell(new Phrase(soldeCredit.toString(), boldFont));
+ } catch (BadElementException eeBEE) {
+ log.error("Can't create table", eeBEE);
+ }
+ return t;
+ }
+
+
+ protected TopiaContext beginTransaction() throws TopiaException {
// basic check done, make check in database
// TODO move it into JTA
TopiaContext topiaTransaction;
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialPeriodServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialPeriodServiceImpl.java 2010-08-02 13:02:10 UTC (rev 2991)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialPeriodServiceImpl.java 2010-08-02 16:54:10 UTC (rev 2992)
@@ -225,7 +225,7 @@
ClosedPeriodicEntryBookDAO closedPeriodicEntryBookDAO =
LimaCallaoDAOHelper.getClosedPeriodicEntryBookDAO(topiaContext);
- closedPeriodicEntryBook = closedPeriodicEntryBookDAO.findbyEntryBookAndFinancialPeriod(entryBook, financialPeriod);
+ closedPeriodicEntryBook = closedPeriodicEntryBookDAO.findByEntryBookAndFinancialPeriod(entryBook, financialPeriod);
}
catch (TopiaException ex) {
doCatch(topiaContext, ex, log);
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java 2010-08-02 13:02:10 UTC (rev 2991)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java 2010-08-02 16:54:10 UTC (rev 2992)
@@ -1026,7 +1026,7 @@
.getCodeEntryBook();
EntryBook entryBook = entryBookDAO.findByCode(codeEntryBook);
ClosedPeriodicEntryBook closedPeriodicEntryBook = closedPeriodicEntryBookDAO
- .findbyEntryBookAndFinancialPeriod(entryBook,
+ .findByEntryBookAndFinancialPeriod(entryBook,
financialPeriod);
try {
financialPeriodService
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java 2010-08-02 13:02:10 UTC (rev 2991)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java 2010-08-02 16:54:10 UTC (rev 2992)
@@ -175,7 +175,7 @@
String queryAlias = "E";
if (beginDate != null && endDate != null){
try {
- EntryDAO entryDAO= LimaCallaoDAOHelper.getEntryDAO(topiaContext);
+ EntryDAO entryDAO = LimaCallaoDAOHelper.getEntryDAO(topiaContext);
TopiaQuery entriesQuery =
createEntryQuery(account, beginDate, endDate, entryDAO, queryAlias);
//IMPORTANT : LOADING ENTRIES AND IS COLUMN FOR NO LAZY EXCEPTION
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/DocumentService.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/DocumentService.java 2010-08-02 13:02:10 UTC (rev 2991)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/DocumentService.java 2010-08-02 16:54:10 UTC (rev 2992)
@@ -21,10 +21,7 @@
import java.util.Date;
import java.util.List;
-
import javax.ejb.Remote;
-
-import org.chorem.lima.beans.FinancialStatementAmounts;
import org.chorem.lima.business.LimaException;
/**
@@ -36,6 +33,8 @@
@Remote
public interface DocumentService {
- public void createFinancialStatementsDocuments(List<FinancialStatementAmounts> financialStatementAmounts, Date beginDate, Date endDate) throws LimaException;
+ public void createFinancialStatementsDocuments(Date beginDate, Date endDate) throws LimaException;
public void createLedgerDocuments(List<Object> objects, Date beginDate, Date endDate) throws LimaException;
+ public void createEntryBooksDocuments(Date beginDate, Date endDate) throws LimaException;
+ public void createBalanceDocuments(Date beginDate, Date endDate) throws LimaException;
}
Modified: trunk/lima-business/src/main/resources/i18n/lima-business-en_GB.properties
===================================================================
--- trunk/lima-business/src/main/resources/i18n/lima-business-en_GB.properties 2010-08-02 13:02:10 UTC (rev 2991)
+++ trunk/lima-business/src/main/resources/i18n/lima-business-en_GB.properties 2010-08-02 16:54:10 UTC (rev 2992)
@@ -3,7 +3,11 @@
An\ financialStatement\ already\ exists\ with\ this\ label\ \:\ %s=
lima-business.config.configFileName.description=
lima-business.config.rulesnationality=
+lima-business.document.accountnubmer=
+lima-business.document.accountnumber=
lima-business.document.amount=Amout
+lima-business.document.amounts=
+lima-business.document.balance=
lima-business.document.businessnumber=
lima-business.document.carryback=Carry Back
lima-business.document.carryforward=reporter\u00C0
@@ -19,12 +23,16 @@
lima-business.document.grossamount=Gross Amount
lima-business.document.label=Label
lima-business.document.ledger=
+lima-business.document.movementcredit=
+lima-business.document.movementdebit=
lima-business.document.netamount=Net Amount
lima-business.document.pagenumber=
lima-business.document.period1=
lima-business.document.period2=
lima-business.document.provisiondeprecationamount=Provision Deprecation Amount
lima-business.document.solde=Solde
+lima-business.document.soldecredit=
+lima-business.document.soldedebit=
lima-business.document.vatnumber=
lima-business.document.voucher=Voucher
lima.business.document.date=Date
Modified: trunk/lima-business/src/main/resources/i18n/lima-business-fr_FR.properties
===================================================================
--- trunk/lima-business/src/main/resources/i18n/lima-business-fr_FR.properties 2010-08-02 13:02:10 UTC (rev 2991)
+++ trunk/lima-business/src/main/resources/i18n/lima-business-fr_FR.properties 2010-08-02 16:54:10 UTC (rev 2992)
@@ -1,7 +1,9 @@
An\ EntryBook\ already\ exists\ with\ this\ label\ \:\ %s=
An\ account\ already\ exists\ with\ this\ number\ \:\ %s=
An\ financialStatement\ already\ exists\ with\ this\ label\ \:\ %s=
-lima-business.document.amount=Total
+lima-business.document.accountnumber=N\u00B0 Compte
+lima-business.document.amounts=Totaux
+lima-business.document.balance=Balance
lima-business.document.businessnumber=N\u00B0 Siret
lima-business.document.carryback=Report
lima-business.document.carryforward=\u00C0 reporter
@@ -16,12 +18,16 @@
lima-business.document.grossamount=Brut
lima-business.document.label=Libell\u00E9
lima-business.document.ledger=Grand Livre
+lima-business.document.movementcredit=Mouvement Cr\u00E9diteur
+lima-business.document.movementdebit=Mouvement D\u00E9biteur
lima-business.document.netamount=Net
lima-business.document.pagenumber=N\u00B0 page
lima-business.document.period1=P\u00E9riode du
lima-business.document.period2=au
lima-business.document.provisiondeprecationamount=Amortissements et provisions
lima-business.document.solde=Solde
+lima-business.document.soldecredit=Solde Cr\u00E9diteur
+lima-business.document.soldedebit=Solde D\u00E9biteur
lima-business.document.vatnumber=N\u00B0 TVA
lima-business.document.voucher=Pi\u00E8ce comptable
lima.config.configFileName.description=
Modified: trunk/lima-callao/src/main/java/org/chorem/lima/entity/ClosedPeriodicEntryBookDAOImpl.java
===================================================================
--- trunk/lima-callao/src/main/java/org/chorem/lima/entity/ClosedPeriodicEntryBookDAOImpl.java 2010-08-02 13:02:10 UTC (rev 2991)
+++ trunk/lima-callao/src/main/java/org/chorem/lima/entity/ClosedPeriodicEntryBookDAOImpl.java 2010-08-02 16:54:10 UTC (rev 2992)
@@ -1,19 +1,28 @@
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.chorem.lima.entity.ClosedPeriodicEntryBook;
import org.chorem.lima.entity.ClosedPeriodicEntryBookDAOAbstract;
import org.chorem.lima.entity.EntryBook;
import org.chorem.lima.entity.FinancialPeriod;
import org.nuiton.topia.TopiaException;
import org.nuiton.topia.framework.TopiaQuery;
+import org.nuiton.topia.framework.TopiaQuery.Op;
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(
+ public ClosedPeriodicEntryBook findByEntryBookAndFinancialPeriod(
EntryBook entryBook, FinancialPeriod financialPeriod)
throws TopiaException {
@@ -27,4 +36,19 @@
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.FINANCIAL_PERIOD, FinancialPeriod.BEGIN_DATE);
+ String endDateProperty = TopiaQuery.getProperty(ClosedPeriodicEntryBook.FINANCIAL_PERIOD, FinancialPeriod.BEGIN_DATE);
+ String entrybookProperty = TopiaQuery.getProperty(ClosedPeriodicEntryBook.ENTRY_BOOK, EntryBook.CODE);
+ query.addWhere(beginDateProperty, Op.GE, beginDate)
+ .addWhere(endDateProperty, Op.LE, endDate)
+ .addOrder(beginDateProperty, entrybookProperty);
+ }
+ return (List<ClosedPeriodicEntryBook>) findAllByQuery(query);
+ }
+
}
Modified: trunk/lima-callao/src/main/xmi/accounting.zargo
===================================================================
(Binary files differ)
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceView.jaxx 2010-08-02 13:02:10 UTC (rev 2991)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceView.jaxx 2010-08-02 16:54:10 UTC (rev 2992)
@@ -74,9 +74,12 @@
<JCheckBox id='movmentedFilter' text='lima.accountsreports.movmentedfilter' selected='false'
onActionPerformed="getHandler().refresh()"/>
</cell>
+ <cell>
+ <JButton text="lima.createPDF" onActionPerformed="getHandler().createPdf()"/>
+ </cell>
</row>
<row>
- <cell fill="both" weightx="1" weighty="1" columns="7">
+ <cell fill="both" weightx="1" weighty="1" columns="8">
<JScrollPane>
<org.jdesktop.swingx.JXTable id="balanceTable" rowHeight="24"
model="{getModelBalanceTable()}"
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceViewHandler.java 2010-08-02 13:02:10 UTC (rev 2991)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceViewHandler.java 2010-08-02 16:54:10 UTC (rev 2992)
@@ -23,6 +23,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.beans.BalanceTrial;
+import org.chorem.lima.business.DocumentServiceMonitorable;
import org.chorem.lima.business.FinancialTransactionServiceMonitorable;
import org.chorem.lima.business.ImportServiceMonitorable;
import org.chorem.lima.business.LimaException;
@@ -45,6 +46,7 @@
/** Services. */
protected ReportServiceMonitorable reportService;
+ protected DocumentServiceMonitorable documentService;
/** DatePicker Begin Date. */
protected Date selectedBeginDate;
@@ -63,6 +65,9 @@
reportService =
LimaServiceFactory.getInstance().getService(
ReportServiceMonitorable.class);
+ documentService =
+ LimaServiceFactory.getInstance().getService(
+ DocumentServiceMonitorable.class);
LimaServiceFactory.getInstance().getService(
ImportServiceMonitorable.class).addListener(this);
LimaServiceFactory.getInstance().getService(
@@ -136,6 +141,16 @@
}
}
+ public void createPdf() {
+ try {
+ documentService.createBalanceDocuments(selectedBeginDate, selectedEndDate);
+ } catch (LimaException eee) {
+ if(log.isDebugEnabled()){
+ log.debug("Can't create PDF", eee);
+ }
+ }
+ }
+
@Override
public void notifyMethod(String serviceName, String methodeName) {
if (serviceName.contains("FinancialTransaction") || methodeName.contains("importAccount") || methodeName.contains("importAll")){
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 2010-08-02 13:02:10 UTC (rev 2991)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsView.jaxx 2010-08-02 16:54:10 UTC (rev 2992)
@@ -74,9 +74,12 @@
editable="false"
/>
</cell>
+ <cell>
+ <JButton text="lima.createPDF" onActionPerformed="getHandler().createPdf()"/>
+ </cell>
</row>
<row>
- <cell fill="both" weightx="1" weighty="1" columns="6">
+ <cell fill="both" weightx="1" weighty="1" columns="7">
<JScrollPane>
<org.chorem.lima.ui.entrybooksreports.EntryBooksReportsTable
id="table" sortable="false" rowHeight="24"
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsViewHandler.java 2010-08-02 13:02:10 UTC (rev 2991)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsViewHandler.java 2010-08-02 16:54:10 UTC (rev 2992)
@@ -26,6 +26,7 @@
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.beans.ReportsDatas;
import org.chorem.lima.beans.ReportsDatasImpl;
+import org.chorem.lima.business.DocumentServiceMonitorable;
import org.chorem.lima.business.FinancialTransactionServiceMonitorable;
import org.chorem.lima.business.ImportServiceMonitorable;
import org.chorem.lima.business.LimaException;
@@ -56,6 +57,7 @@
/** Services. */
protected ReportServiceMonitorable reportService;
+ protected DocumentServiceMonitorable documentService;
/** Account. */
protected EntryBook selectedEntryBook;
@@ -72,6 +74,9 @@
reportService =
LimaServiceFactory.getInstance().getService(
ReportServiceMonitorable.class);
+ documentService =
+ LimaServiceFactory.getInstance().getService(
+ DocumentServiceMonitorable.class);
LimaServiceFactory.getInstance().getService(
ImportServiceMonitorable.class).addListener(this);
LimaServiceFactory.getInstance().getService(
@@ -143,6 +148,16 @@
}
}
+ public void createPdf() {
+ try {
+ documentService.createEntryBooksDocuments(selectedBeginDate, selectedEndDate);
+ } catch (LimaException eee) {
+ if(log.isDebugEnabled()){
+ log.debug("Can't create PDF", eee);
+ }
+ }
+ }
+
@Override
public void notifyMethod(String serviceName, String methodeName) {
if (serviceName.contains("FinancialTransaction") || methodeName.contains("importEntryBook") || methodeName.contains("importAll")){
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 2010-08-02 13:02:10 UTC (rev 2991)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportTableModel.java 2010-08-02 16:54:10 UTC (rev 2992)
@@ -210,7 +210,7 @@
public void createDocuments(){
try {
- documentService.createFinancialStatementsDocuments(cacheDataList, selectedBeginDate, selectedEndDate);
+ documentService.createFinancialStatementsDocuments(selectedBeginDate, selectedEndDate);
} catch (LimaException e) {
if (log.isDebugEnabled()){
log.debug("Error on create document",e);
1
0
r2991 - in trunk: lima-business lima-business/src/main/java/org/chorem/lima/business/ejb lima-business/src/main/resources lima-business/src/main/resources/i18n lima-swing/src/main/resources/i18n
by jpepin@users.chorem.org 02 Aug '10
by jpepin@users.chorem.org 02 Aug '10
02 Aug '10
Author: jpepin
Date: 2010-08-02 15:02:10 +0200 (Mon, 02 Aug 2010)
New Revision: 2991
Url: http://chorem.org/repositories/revision/lima/2991
Log:
Sortie document pdf du grand-livre termin?\195?\169.
Added:
trunk/lima-business/src/main/resources/i18n/
trunk/lima-business/src/main/resources/i18n/lima-business-en_GB.properties
trunk/lima-business/src/main/resources/i18n/lima-business-fr_FR.properties
Modified:
trunk/lima-business/pom.xml
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/DocumentServiceImpl.java
trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties
Modified: trunk/lima-business/pom.xml
===================================================================
--- trunk/lima-business/pom.xml 2010-08-02 08:19:54 UTC (rev 2990)
+++ trunk/lima-business/pom.xml 2010-08-02 13:02:10 UTC (rev 2991)
@@ -59,6 +59,20 @@
<packaging>jar</packaging>
<build>
+ <plugins>
+ <plugin>
+ <groupId>org.nuiton.i18n</groupId>
+ <artifactId>maven-i18n-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>parserJava</goal>
+ <goal>gen</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
<pluginManagement>
<plugins>
<plugin>
@@ -91,6 +105,8 @@
<attach>false</attach>
</configuration>
</plugin>
+
+
</plugins>
</pluginManagement>
</build>
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/DocumentServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/DocumentServiceImpl.java 2010-08-02 08:19:54 UTC (rev 2990)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/DocumentServiceImpl.java 2010-08-02 13:02:10 UTC (rev 2991)
@@ -27,7 +27,6 @@
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
-
import javax.ejb.EJB;
import javax.ejb.Stateless;
import org.apache.commons.logging.Log;
@@ -47,7 +46,6 @@
import org.nuiton.topia.TopiaContextFactory;
import org.nuiton.topia.TopiaException;
import org.nuiton.topia.TopiaNotFoundException;
-
import com.lowagie.text.BadElementException;
import com.lowagie.text.Cell;
import com.lowagie.text.Chapter;
@@ -61,9 +59,6 @@
import com.lowagie.text.Rectangle;
import com.lowagie.text.Table;
import com.lowagie.text.html.HtmlWriter;
-import com.lowagie.text.pdf.PdfPCell;
-import com.lowagie.text.pdf.PdfPTable;
-import com.lowagie.text.pdf.PdfTable;
import com.lowagie.text.pdf.PdfWriter;
@Stateless
@@ -136,26 +131,26 @@
titleCell.setHorizontalAlignment(Element.ALIGN_CENTER);
titleCell.setRowspan(2);
t.addCell(titleCell);
- t.addCell(new Phrase("N° Siret", bolditalicFont));
+ t.addCell(new Phrase(_("lima-business.document.businessnumber"), bolditalicFont));
t.addCell(new Phrase(identity.getBusinessNumber(), italicFont));
//line 2
- t.addCell(new Phrase("SSL", italicFont));
- t.addCell(new Phrase("NAF :", bolditalicFont));
+ t.addCell(new Phrase(identity.getDescription(), italicFont));
+ t.addCell(new Phrase(_("lima-business.document.classificationcode"), bolditalicFont));
t.addCell(new Phrase(identity.getClassificationCode(), italicFont));
//line 3
t.addCell(new Phrase(identity.getAddress(), italicFont));
t.addCell("");
- t.addCell(new Phrase("n°TVA", bolditalicFont));
+ t.addCell(new Phrase(_("lima-business.document.vatnumber"), bolditalicFont));
t.addCell(new Phrase(identity.getVatNumber(), italicFont));
//line 4
t.addCell(new Phrase(identity.getAddress2(), italicFont));
t.addCell("");
- t.addCell(new Phrase("Période du", bolditalicFont));
+ t.addCell(new Phrase(_("lima-business.document.period1"), bolditalicFont));
t.addCell(new Phrase(beginDate, italicFont));
//line 5
t.addCell(new Phrase(identity.getZipCode() + " " + identity.getCity(), italicFont));
t.addCell("");
- t.addCell(new Phrase("au", bolditalicFont));
+ t.addCell(new Phrase(_("lima-business.document.period2"), bolditalicFont));
t.addCell(new Phrase(endDate, italicFont));
} catch (BadElementException eeBEE) {
log.error("Can't create table", eeBEE);
@@ -164,7 +159,7 @@
}
- //############## FinancialStatements
+ //############## FinancialStatements ##############
@Override
@@ -220,8 +215,8 @@
list.subList(i, j);
//create page : header + table + footer
Table headerPage = createHeaderPage(title, identity, dateFormat.format(beginDate), dateFormat.format(endDate));
- Table headerTable = createHeaderTableFinancialStatement();
- Table table = createFinancialStatementTable(subFinancialStatementAmounts);
+ Table headerTable = createFinancialStatementsHeaderTable();
+ Table table = createFinancialStatementsTable(subFinancialStatementAmounts);
//new page
Chapter chapter = new Chapter(0);
//headerPage
@@ -238,8 +233,8 @@
c.setBorder(Rectangle.NO_BORDER);
c.setHorizontalAlignment(Element.ALIGN_CENTER);
infos.setDefaultCell(c);
- infos.addCell(new Phrase("Date de tirage " + dateS + " à " + hourS, normalFont));
- infos.addCell(new Phrase("Page n° "+nbpages, normalFont));
+ infos.addCell(new Phrase(_("lima-business.document.createdate1") + dateS + _("lima-business.document.createdate2") + hourS, normalFont));
+ infos.addCell(new Phrase(_("lima-business.document.pagenumber")+nbpages, normalFont));
paragraphPage.add(infos);
chapter.add(paragraphPage);
//headerTable
@@ -266,7 +261,7 @@
}
}
- public Table createHeaderTableFinancialStatement(){
+ public Table createFinancialStatementsHeaderTable(){
Table t = null;
try {
t = new Table(4,1);
@@ -280,10 +275,10 @@
cell.setHorizontalAlignment(Element.ALIGN_CENTER);
t.setDefaultCell(cell);
t.setOffset(8);
- t.addCell(new Phrase(_("lima.table.label"), boldFont));
- t.addCell(new Phrase(_("lima.table.grossamount"), boldFont));
- t.addCell(new Phrase(_("lima.table.provisiondeprecationamount"), boldFont));
- t.addCell(new Phrase(_("lima.table.netamount"), boldFont));
+ t.addCell(new Phrase(_("lima-business.document.label"), boldFont));
+ t.addCell(new Phrase(_("lima-business.document.grossamount"), boldFont));
+ t.addCell(new Phrase(_("lima-business.document.provisiondeprecationamount"), boldFont));
+ t.addCell(new Phrase(_("lima-business.document.netamount"), boldFont));
} catch (BadElementException eeBEE) {
log.error("Can't create table", eeBEE);
@@ -292,7 +287,7 @@
}
- public Table createFinancialStatementTable(List<FinancialStatementAmounts> financialStatementAmounts){
+ public Table createFinancialStatementsTable(List<FinancialStatementAmounts> financialStatementAmounts){
int nbrow = financialStatementAmounts.size();
Table t = null;
try {
@@ -382,7 +377,9 @@
return t;
}
- //############## Ledger
+
+
+ //############## Ledger ##############
@Override
@@ -397,6 +394,8 @@
String fileDateS = filedateFormat.format(newDate);
Double currentAmountDebit = 0.0;
+ Double currentAmountCredit = 0.0;
+ String accountcarry ="";
PdfWriter pdfWriter = PdfWriter.getInstance(document,
new FileOutputStream("/ledger_lima"+fileDateS+".pdf"));
@@ -407,20 +406,19 @@
Identity identity = identityService.getIdentity();
//create pages
- String title = "Ledger";
+ String title = _("lima-business.document.ledger");
int i=0;
int n=list.size();
- int max=n;
+ int max = 32;
while (i<n){
- int j=i+max;
+ int j = i+max;
if (j>n){
j = n;
}
List <Object> subList = list.subList(i, j);
//create page : header + table + footer
Table headerPage = createHeaderPage(title, identity, dateFormat.format(beginDate), dateFormat.format(endDate));
- Table headerTable = createHeaderTableLedger();
- PdfPTable table = createTableLedger(subList);
+ Table headerTable = createLedgerHeaderTable();
//new page
Chapter chapter = new Chapter(0);
//headerPage
@@ -437,8 +435,8 @@
c.setBorder(Rectangle.NO_BORDER);
c.setHorizontalAlignment(Element.ALIGN_CENTER);
infos.setDefaultCell(c);
- infos.addCell(new Phrase("Date de tirage " + dateS + " à " + hourS, normalFont));
- infos.addCell(new Phrase("Page n° "+nbpages, normalFont));
+ infos.addCell(new Phrase(_("lima-business.document.createdate1") + dateS + _("lima-business.document.createdate2") + hourS, normalFont));
+ infos.addCell(new Phrase(_("lima-business.document.pagenumber")+nbpages, normalFont));
paragraphPage.add(infos);
chapter.add(paragraphPage);
//headerTable
@@ -448,20 +446,41 @@
//backward amounts
if (n>max && nbpages>1){
Paragraph backwardParagraph = new Paragraph();
- backwardParagraph.add("");
+ backwardParagraph.add(createLedgerAmountTable(accountcarry, _("lima-business.document.carryback"), currentAmountDebit, currentAmountCredit));
chapter.add(backwardParagraph);
}
-
//table
Paragraph paragraphTable = new Paragraph();
+ Table table = createLedgerTable(subList);
paragraphTable.add(table);
chapter.add(paragraphTable);
+ for (Object object : subList) {
+ if (object instanceof Entry){
+ Entry entry = (Entry) object;
+ currentAmountDebit += entry.getDebit() ? entry.getAmount() : 0;
+ currentAmountCredit += entry.getDebit() ? 0 : entry.getAmount();
+ }
+ else {
+ ReportsDatas reportsDatas = (ReportsDatas) object;
+ Account account = reportsDatas.getAccount();
+ if ( account != null){
+ accountcarry = account.getAccountNumber()+" "+account.getLabel()+" ";
+ log.debug(accountcarry);
+ }
+ }
+ }
//forward amounts
- if (n>max){
+ if (n>max && i<=n-max){
Paragraph forwardParagraph = new Paragraph();
- forwardParagraph.add("");
+ forwardParagraph.add(createLedgerAmountTable("", _("", "lima-business.document.carryforward"), currentAmountDebit, currentAmountCredit));
chapter.add(forwardParagraph);
}
+ //final amounts
+ if (i>=n-max){
+ Paragraph finalAmountParagraph = new Paragraph();
+ finalAmountParagraph.add(createLedgerAmountTable("", _("lima-business.document.amount"), currentAmountDebit, currentAmountCredit));
+ chapter.add(finalAmountParagraph);
+ }
//add page
document.add(chapter);
i=i+max;
@@ -476,27 +495,27 @@
}
}
- public Table createHeaderTableLedger(){
+ public Table createLedgerHeaderTable(){
Table t = null;
try {
t = new Table(7,1);
float[] widths = {0.1f, 0.05f, 0.1f, 0.3f, 0.15f, 0.15f, 0.15f};
t.setWidths(widths);
t.setWidth(100f);
- t.setPadding(3f);
+ t.setPadding(3.5f);
//defaut cell
Cell cell = new Cell();
cell.setBorder(Rectangle.LEFT);
cell.setHorizontalAlignment(Element.ALIGN_CENTER);
t.setDefaultCell(cell);
t.setOffset(8);
- t.addCell(new Phrase(_("lima.table.date"), boldFont));
- t.addCell(new Phrase(_("lima.table.entrybook"), boldFont));
- t.addCell(new Phrase(_("lima.table.voucher"), boldFont));
- t.addCell(new Phrase(_("lima.table.description"), boldFont));
- t.addCell(new Phrase(_("lima.table.debit"), boldFont));
- t.addCell(new Phrase(_("lima.table.credit"), boldFont));
- t.addCell(new Phrase(_("lima.table.solde"), boldFont));
+ t.addCell(new Phrase(_("lima-business.document.date"), boldFont));
+ t.addCell(new Phrase(_("lima-business.document.entrybook"), boldFont));
+ t.addCell(new Phrase(_("lima-business.document.voucher"), boldFont));
+ t.addCell(new Phrase(_("lima-business.document.description"), boldFont));
+ t.addCell(new Phrase(_("lima-business.document.debit"), boldFont));
+ t.addCell(new Phrase(_("lima-business.document.credit"), boldFont));
+ t.addCell(new Phrase(_("lima-business.document.solde"), boldFont));
} catch (BadElementException eeBEE) {
log.error("Can't create table", eeBEE);
@@ -505,37 +524,55 @@
}
- public PdfPTable createTableLedger(List<Object> subList){
+ public Table createLedgerAmountTable(String account, String title, Double credit, Double debit){
+ Table t = null;
+ try {
+ t = new Table(5,1);
+ float[] widths = {0.4f,0.15f, 0.15f, 0.15f, 0.15f};
+ t.setWidths(widths);
+ t.setWidth(100f);
+ t.setPadding(3f);
+ t.setOffset(0);
+ //defaut cell
+ Cell cell = new Cell();
+ cell.setBorder(Rectangle.RIGHT);
+ cell.setHorizontalAlignment(Element.ALIGN_RIGHT);
+ t.setDefaultCell(cell);
+
+ Cell accountCell = new Cell(new Phrase(account, boldFont));
+ accountCell.setHorizontalAlignment(Element.ALIGN_LEFT);
+ accountCell.setBorder(Rectangle.NO_BORDER);
+ t.addCell(accountCell);
+ t.addCell(new Phrase(title, boldFont));
+ t.addCell(new Phrase(debit.toString(), boldFont));
+ t.addCell(new Phrase(credit.toString(), boldFont));
+ Double solde = debit-credit;
+ t.addCell(new Phrase(solde.toString(), boldFont));
+ } catch (BadElementException eeBEE) {
+ log.error("Can't create table", eeBEE);
+ }
+ return t;
+
+ }
+
+ public Table createLedgerTable(List<Object> subList){
int nbrow = subList.size();
- PdfPTable t = null;
+ Table t = null;
try {
//define table
- t = new PdfPTable(7);
- t.setWidthPercentage(100f);
+ t = new Table(7, nbrow);
+ t.setWidth(100f);
float[] widths = {0.1f, 0.05f, 0.1f, 0.3f, 0.15f, 0.15f, 0.15f};
t.setWidths(widths);
- t.setHeaderRows(2);
- //t.setPadding(1.5f);
- //t.setBorderWidth(1);
- //t.setOffset(0);
+ t.setPadding(1.5f);
+ t.setBorderWidth(1);
+ t.setOffset(0);
//define default cell
Cell cell = new Cell();
cell.setBorder(Rectangle.LEFT);
cell.setHorizontalAlignment(Element.ALIGN_RIGHT);
- //t.setDefaultCell(cell);
-
- Paragraph p = new Paragraph("test");
- PdfPCell header = new PdfPCell(p);
- header.setColspan(7);
- t.addCell(header);
- //t.setTableFitsPage(true);
-
- t.setFooterRows(1);
- Paragraph p2 = new Paragraph("footer");
- PdfPCell footer = new PdfPCell(p2);
- footer.setColspan(7);
- t.addCell(footer);
-
+ t.setDefaultCell(cell);
+
for (Object object : subList) {
if (object instanceof ReportsDatas) {
@@ -549,7 +586,7 @@
Double amountCredit = reportsDatas.getAmountCredit();
Double amountDebit = reportsDatas.getAmountDebit();
- PdfPCell c = new PdfPCell(new Phrase(accountS, boldFont));
+ Cell c = new Cell(new Phrase(accountS, boldFont));
c.setColspan(4);
c.setHorizontalAlignment(Element.ALIGN_LEFT);
t.addCell(c);
Added: trunk/lima-business/src/main/resources/i18n/lima-business-en_GB.properties
===================================================================
--- trunk/lima-business/src/main/resources/i18n/lima-business-en_GB.properties (rev 0)
+++ trunk/lima-business/src/main/resources/i18n/lima-business-en_GB.properties 2010-08-02 13:02:10 UTC (rev 2991)
@@ -0,0 +1,36 @@
+An\ EntryBook\ already\ exists\ with\ this\ label\ \:\ %s=
+An\ account\ already\ exists\ with\ this\ number\ \:\ %s=
+An\ financialStatement\ already\ exists\ with\ this\ label\ \:\ %s=
+lima-business.config.configFileName.description=
+lima-business.config.rulesnationality=
+lima-business.document.amount=Amout
+lima-business.document.businessnumber=
+lima-business.document.carryback=Carry Back
+lima-business.document.carryforward=reporter\u00C0
+lima-business.document.classificationcode=
+lima-business.document.classificationcode\ \:=
+lima-business.document.createdate1=
+lima-business.document.createdate2=
+lima-business.document.credit=Credit
+lima-business.document.date=Date
+lima-business.document.debit=Debit
+lima-business.document.description=Description
+lima-business.document.entrybook=EntryBook
+lima-business.document.grossamount=Gross Amount
+lima-business.document.label=Label
+lima-business.document.ledger=
+lima-business.document.netamount=Net Amount
+lima-business.document.pagenumber=
+lima-business.document.period1=
+lima-business.document.period2=
+lima-business.document.provisiondeprecationamount=Provision Deprecation Amount
+lima-business.document.solde=Solde
+lima-business.document.vatnumber=
+lima-business.document.voucher=Voucher
+lima.business.document.date=Date
+lima.config.configFileName.description=
+lima.config.rulesnationality=
+lima.table.grossamount=
+lima.table.label=Test
+lima.table.netamount=
+lima.table.provisiondeprecationamount=
Added: trunk/lima-business/src/main/resources/i18n/lima-business-fr_FR.properties
===================================================================
--- trunk/lima-business/src/main/resources/i18n/lima-business-fr_FR.properties (rev 0)
+++ trunk/lima-business/src/main/resources/i18n/lima-business-fr_FR.properties 2010-08-02 13:02:10 UTC (rev 2991)
@@ -0,0 +1,28 @@
+An\ EntryBook\ already\ exists\ with\ this\ label\ \:\ %s=
+An\ account\ already\ exists\ with\ this\ number\ \:\ %s=
+An\ financialStatement\ already\ exists\ with\ this\ label\ \:\ %s=
+lima-business.document.amount=Total
+lima-business.document.businessnumber=N\u00B0 Siret
+lima-business.document.carryback=Report
+lima-business.document.carryforward=\u00C0 reporter
+lima-business.document.classificationcode=NAF
+lima-business.document.createdate1=Date de tirage
+lima-business.document.createdate2=\u00E0
+lima-business.document.credit=Cr\u00E9dit
+lima-business.document.date=Date
+lima-business.document.debit=D\u00E9bit
+lima-business.document.description=Description
+lima-business.document.entrybook=Journal
+lima-business.document.grossamount=Brut
+lima-business.document.label=Libell\u00E9
+lima-business.document.ledger=Grand Livre
+lima-business.document.netamount=Net
+lima-business.document.pagenumber=N\u00B0 page
+lima-business.document.period1=P\u00E9riode du
+lima-business.document.period2=au
+lima-business.document.provisiondeprecationamount=Amortissements et provisions
+lima-business.document.solde=Solde
+lima-business.document.vatnumber=N\u00B0 TVA
+lima-business.document.voucher=Pi\u00E8ce comptable
+lima.config.configFileName.description=
+lima.config.rulesnationality=
Modified: trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties
===================================================================
--- trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties 2010-08-02 08:19:54 UTC (rev 2990)
+++ trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties 2010-08-02 13:02:10 UTC (rev 2991)
@@ -4,7 +4,6 @@
Global\ lima\ exception=
LIMA=
Loading\ accounting...=
-blabla=
export=
hello\ world=
lima.about.message=\u00C0 propos de Lima
1
0
Author: jpepin
Date: 2010-08-02 10:19:54 +0200 (Mon, 02 Aug 2010)
New Revision: 2990
Url: http://chorem.org/repositories/revision/lima/2990
Log:
Quelques modifications et apports au niveau UI. R?\195?\169solution d'un bogue de date. Mise ?\195?\160 jour des fichiers plan comptable / BCR.
Added:
trunk/lima-swing/src/main/resources/import/bcr_base.csv
trunk/lima-swing/src/main/resources/import/bcr_developed.csv
trunk/lima-swing/src/main/resources/import/bcr_shortened.csv
Removed:
trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExportForm.jaxx
Modified:
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialTransactionService.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ReportService.java
trunk/lima-swing/src/main/java/org/chorem/lima/enums/EncodingEnum.java
trunk/lima-swing/src/main/java/org/chorem/lima/enums/FinancialStatementsChartEnum.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/SubLedgerForm.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceViewHandler.java
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/financialstatementchart/FinancialStatementChartTreeTableModel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementHeaderForm.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementImportForm.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementMovementForm.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTableModel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/AddPeriod.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/FinancialTransactionsPane.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/identity/IdentityForm.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerViewHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/OpeningView.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
trunk/lima-swing/src/main/resources/import/pcg_shortened.csv
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java 2010-07-29 12:51:43 UTC (rev 2989)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java 2010-08-02 08:19:54 UTC (rev 2990)
@@ -222,6 +222,23 @@
return result;
}
+ @Override
+ public List<FinancialTransaction> getAllFinancialTransactionsBalanced(FiscalPeriod fiscalPeriod) throws LimaException {
+ TopiaContext topiaContext = null;
+ List<FinancialTransaction> result = null;
+ try {
+ topiaContext = beginTransaction();
+ result = getAllFinancialTransactionsBalanced(topiaContext);
+ }
+ catch (TopiaException ex) {
+ doCatch(topiaContext, ex, log);
+ }
+ finally {
+ doFinally(topiaContext, log);
+ }
+ return result;
+ }
+
/**
* Get balanced financialtransaction from selected fiscalperiod
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java 2010-07-29 12:51:43 UTC (rev 2989)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java 2010-08-02 08:19:54 UTC (rev 2990)
@@ -415,7 +415,7 @@
* - GetEntries = true for generate ledger
*/
@Override
- public BalanceTrial generateBalanceTrial(Date beginDate, Date endDate, String selectedAccounts, Boolean getEntries) throws LimaException {
+ public BalanceTrial generateBalanceTrial(Date beginDate, Date endDate, String selectedAccounts, Boolean getEntries, Boolean movementedFilter) throws LimaException {
BalanceTrial balanceTrial = new BalanceTrialImpl();
balanceTrial.setReportsDatas(new ArrayList<ReportsDatas>());
double credit = 0, debit = 0, solde = 0;
@@ -445,13 +445,23 @@
generateSubAccountBalanceWithTransaction(account, beginDate,
endDate, getEntries, topiaTransaction);
reportsDatas.setAccount(account);
- // add balance sheet to balance trial
- balanceTrial.addReportsDatas(reportsDatas);
+ Double amount = reportsDatas.getAmountSolde();
+ if (movementedFilter){
+ if (amount != 0){
+ // add balance sheet to balance trial
+ balanceTrial.addReportsDatas(reportsDatas);
+ }
+ }
+ else {
+ // add balance sheet to balance trial
+ balanceTrial.addReportsDatas(reportsDatas);
+ }
+
if (reportsDatas.getSoldeDebit()) {
- debit += reportsDatas.getAmountSolde();
+ debit += amount;
}
else {
- credit += reportsDatas.getAmountSolde();
+ credit += amount;
}
}
// set the amounts and solde
@@ -482,8 +492,8 @@
* Get all entries
*/
@Override
- public BalanceTrial generateLedger(Date beginDate, Date endDate) throws LimaException {
- return generateBalanceTrial(beginDate, endDate, null, true);
+ public BalanceTrial generateLedger(Date beginDate, Date endDate, Boolean movementedFilter) throws LimaException {
+ return generateBalanceTrial(beginDate, endDate, null, true, movementedFilter);
}
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialTransactionService.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialTransactionService.java 2010-07-29 12:51:43 UTC (rev 2989)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialTransactionService.java 2010-08-02 08:19:54 UTC (rev 2990)
@@ -58,6 +58,8 @@
EntryBook entryBook, FinancialPeriod period) throws LimaException;
List<FinancialTransaction> getAllFinancialTransactionsUnbalanced(FiscalPeriod fiscalPeriod) throws LimaException;
+ List<FinancialTransaction> getAllFinancialTransactionsBalanced(FiscalPeriod fiscalPeriod) throws LimaException;
+
void createFinancialTransaction(FinancialTransaction financialtransaction) throws LimaException;
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ReportService.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ReportService.java 2010-07-29 12:51:43 UTC (rev 2989)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ReportService.java 2010-08-02 08:19:54 UTC (rev 2990)
@@ -61,14 +61,14 @@
* @return la balance
* @throws LimaException
*/
- BalanceTrial generateBalanceTrial(Date beginDate, Date endDate, String selectedAccounts, Boolean getEntries) throws LimaException;
+ BalanceTrial generateBalanceTrial(Date beginDate, Date endDate, String selectedAccounts, Boolean getEntries, Boolean movementedFilter) throws LimaException;
/**
* Generation du grand-livre
*
* @throws LimaException
*/
- BalanceTrial generateLedger(Date beginDate, Date endDate) throws LimaException;
+ BalanceTrial generateLedger(Date beginDate, Date endDate, Boolean movementedFilter) throws LimaException;
/**
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/enums/EncodingEnum.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/enums/EncodingEnum.java 2010-07-29 12:51:43 UTC (rev 2989)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/enums/EncodingEnum.java 2010-08-02 08:19:54 UTC (rev 2990)
@@ -20,7 +20,8 @@
public enum EncodingEnum {
- UTF8("UTF-8", "UTF-8 Lima"), ISOLATIN1("ISO-8859-1", "ISO-Latin-1 Excel / Windows");
+ UTF8("UTF-8", "UTF-8 Lima"), ISOLATIN1("ISO-8859-1", "ISO-Latin-1 Excel / Windows"),
+ MACROMAN("MacRoman", "MacRoman Excel / Mac");
private final String encoding;
private final String description;
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/enums/FinancialStatementsChartEnum.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/enums/FinancialStatementsChartEnum.java 2010-07-29 12:51:43 UTC (rev 2989)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/enums/FinancialStatementsChartEnum.java 2010-08-02 08:19:54 UTC (rev 2990)
@@ -20,7 +20,7 @@
public enum FinancialStatementsChartEnum {
- IMPORT(""), SHORTENED(""), BASE(""), DEVELOPED("");
+ IMPORT(""), SHORTENED("bcr_shortened.csv"), BASE("bcr_base.csv"), DEVELOPED("bcr_developed.csv");
private final String filePath;
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 2010-07-29 12:51:43 UTC (rev 2989)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountForm.jaxx 2010-08-02 08:19:54 UTC (rev 2990)
@@ -22,6 +22,7 @@
<script>
<![CDATA[
+ getRootPane().setDefaultButton(ok);
protected void performCancel() {
setAccount(null);
dispose();
@@ -54,10 +55,10 @@
</row>
<row>
<cell fill="none">
- <JButton text="lima.common.ok" onActionPerformed="dispose()"/>
+ <JButton text="lima.common.cancel" onActionPerformed="performCancel()"/>
</cell>
<cell fill="none">
- <JButton text="lima.common.cancel" onActionPerformed="performCancel()"/>
+ <JButton id="ok" text="lima.common.ok" onActionPerformed="dispose()"/>
</cell>
</row>
</Table>
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 2010-07-29 12:51:43 UTC (rev 2989)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountImportForm.jaxx 2010-08-02 08:19:54 UTC (rev 2990)
@@ -23,6 +23,7 @@
<script>
<![CDATA[
import org.chorem.lima.enums.AccountsChartEnum;
+ getRootPane().setDefaultButton(ok);
protected void performCancel() {
getRadioButtons().setSelectedValue(null);
dispose();
@@ -72,7 +73,7 @@
<JButton text="lima.common.cancel" onActionPerformed="performCancel()"/>
</cell>
<cell fill="none">
- <JButton text="lima.common.ok" onActionPerformed="dispose()"/>
+ <JButton id="ok" text="lima.common.ok" onActionPerformed="dispose()"/>
</cell>
</row>
</Table>
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 2010-07-29 12:51:43 UTC (rev 2989)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/SubLedgerForm.jaxx 2010-08-02 08:19:54 UTC (rev 2990)
@@ -23,6 +23,7 @@
<script>
<![CDATA[
+ getRootPane().setDefaultButton(ok);
protected void performCancel() {
setAccount(null);
dispose();
@@ -68,10 +69,10 @@
</row>
<row>
<cell fill="none">
- <JButton text="lima.common.ok" onActionPerformed="dispose()"/>
+ <JButton text="lima.common.cancel" onActionPerformed="performCancel()"/>
</cell>
<cell fill="none">
- <JButton text="lima.common.cancel" onActionPerformed="performCancel()"/>
+ <JButton id="ok" text="lima.common.ok" onActionPerformed="dispose()"/>
</cell>
</row>
</Table>
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceView.jaxx 2010-07-29 12:51:43 UTC (rev 2989)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceView.jaxx 2010-08-02 08:19:54 UTC (rev 2990)
@@ -70,9 +70,13 @@
<JButton text="lima.accountsreports.accountfilter"
onActionPerformed="getHandler().setAccountFilter(accountFilter.getText())"/>
</cell>
+ <cell anchor="center">
+ <JCheckBox id='movmentedFilter' text='lima.accountsreports.movmentedfilter' selected='false'
+ onActionPerformed="getHandler().refresh()"/>
+ </cell>
</row>
<row>
- <cell fill="both" weightx="1" weighty="1" columns="6">
+ <cell fill="both" weightx="1" weighty="1" columns="7">
<JScrollPane>
<org.jdesktop.swingx.JXTable id="balanceTable" rowHeight="24"
model="{getModelBalanceTable()}"
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceViewHandler.java 2010-07-29 12:51:43 UTC (rev 2989)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceViewHandler.java 2010-08-02 08:19:54 UTC (rev 2990)
@@ -92,7 +92,7 @@
BalanceTrial results = null;
try {
- results = reportService.generateBalanceTrial(selectedBeginDate, selectedEndDate, selectedAccounts, false);
+ results = reportService.generateBalanceTrial(selectedBeginDate, selectedEndDate, selectedAccounts, false, view.getMovmentedFilter().isSelected());
}
catch (LimaException eee) {
if (log.isErrorEnabled()) {
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 2010-07-29 12:51:43 UTC (rev 2989)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookForm.jaxx 2010-08-02 08:19:54 UTC (rev 2990)
@@ -22,6 +22,7 @@
<script>
<![CDATA[
+ getRootPane().setDefaultButton(okButton);
protected void performCancel() {
setEntryBook(null);
dispose();
@@ -64,11 +65,12 @@
</row>
<row>
<cell>
- <JButton id="okButton" text="lima.common.ok" onActionPerformed="dispose()"/>
+ <JButton id="cancelButton" text="lima.common.cancel" onActionPerformed="performCancel()"/>
</cell>
<cell>
- <JButton id="cancelButton" text="lima.common.cancel" onActionPerformed="performCancel()"/>
+ <JButton id="okButton" text="lima.common.ok" onActionPerformed="dispose()"/>
</cell>
+
</row>
</Table>
</JDialog>
\ No newline at end of file
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 2010-07-29 12:51:43 UTC (rev 2989)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookImportForm.jaxx 2010-08-02 08:19:54 UTC (rev 2990)
@@ -23,6 +23,7 @@
<script>
<![CDATA[
import org.chorem.lima.enums.EntryBooksChartEnum;
+ getRootPane().setDefaultButton(ok);
protected void performCancel() {
getRadioButtons().setSelectedValue(null);
dispose();
@@ -49,7 +50,7 @@
<JButton text="lima.common.cancel" onActionPerformed="performCancel()"/>
</cell>
<cell fill="none">
- <JButton text="lima.common.ok" onActionPerformed="dispose()"/>
+ <JButton id="ok" text="lima.common.ok" onActionPerformed="dispose()"/>
</cell>
</row>
</Table>
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartTreeTableModel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartTreeTableModel.java 2010-07-29 12:51:43 UTC (rev 2989)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartTreeTableModel.java 2010-08-02 08:19:54 UTC (rev 2990)
@@ -63,7 +63,7 @@
@Override
public int getColumnCount() {
- return 1;
+ return 5;
}
@Override
@@ -73,6 +73,18 @@
case 0:
res = _("lima.table.label");
break;
+ case 1:
+ res = _("lima.table.debitcredit");
+ break;
+ case 2:
+ res = _("lima.table.debit");
+ break;
+ case 3:
+ res = _("lima.table.credit");
+ break;
+ case 4:
+ res = _("lima.table.provisiondeprecationamount");
+ break;
}
return res;
}
@@ -162,6 +174,18 @@
case 0:
result = financialStatement.getLabel();
break;
+ case 1:
+ result = financialStatement.getAccounts();
+ break;
+ case 2:
+ result = financialStatement.getDebitAccounts();
+ break;
+ case 3:
+ result = financialStatement.getCreditAccounts();
+ break;
+ case 4:
+ result = financialStatement.getProvisionDeprecationAccounts();
+ break;
}
return result;
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementHeaderForm.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementHeaderForm.jaxx 2010-07-29 12:51:43 UTC (rev 2989)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementHeaderForm.jaxx 2010-08-02 08:19:54 UTC (rev 2990)
@@ -21,7 +21,8 @@
<Boolean id="addState" javaBean='true'/>
<script>
- <![CDATA[
+ <![CDATA[
+ getRootPane().setDefaultButton(ok);
protected void performCancel() {
setFinancialStatement(null);
dispose();
@@ -57,10 +58,10 @@
</row>
<row>
<cell fill="none">
- <JButton text="lima.common.ok" onActionPerformed="dispose()"/>
+ <JButton text="lima.common.cancel" onActionPerformed="performCancel()"/>
</cell>
<cell fill="none">
- <JButton text="lima.common.cancel" onActionPerformed="performCancel()"/>
+ <JButton id="ok" text="lima.common.ok" onActionPerformed="dispose()"/>
</cell>
</row>
</Table>
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementImportForm.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementImportForm.jaxx 2010-07-29 12:51:43 UTC (rev 2989)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementImportForm.jaxx 2010-08-02 08:19:54 UTC (rev 2990)
@@ -23,6 +23,7 @@
<script>
<![CDATA[
import org.chorem.lima.enums.FinancialStatementsChartEnum;
+ getRootPane().setDefaultButton(ok);
protected void performCancel() {
getRadioButtons().setSelectedValue(null);
dispose();
@@ -71,9 +72,9 @@
<JButton text="lima.common.cancel" onActionPerformed="performCancel()"/>
</cell>
<cell fill="none">
- <JButton text="lima.common.ok" onActionPerformed="dispose()"/>
+ <JButton id="ok" text="lima.common.ok" onActionPerformed="dispose()"/>
</cell>
- </row>
+ </row>
</Table>
</cell>
</row>
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementMovementForm.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementMovementForm.jaxx 2010-07-29 12:51:43 UTC (rev 2989)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementMovementForm.jaxx 2010-08-02 08:19:54 UTC (rev 2990)
@@ -23,6 +23,7 @@
<script>
<![CDATA[
+ getRootPane().setDefaultButton(ok);
protected void performCancel() {
setFinancialStatement(null);
dispose();
@@ -55,7 +56,7 @@
</row>
<row>
<cell fill="horizontal">
- <JLabel text="lima.financialstatement.creditaccounts"/>
+ <JLabel text="lima.financialstatement.debitaccounts"/>
</cell>
<cell fill="horizontal">
<JTextField id="debitAccountsTextField" text="{getFinancialStatement().getDebitAccounts()}"/>
@@ -66,7 +67,7 @@
</row>
<row>
<cell fill="horizontal">
- <JLabel text="lima.financialstatement.debitaccounts"/>
+ <JLabel text="lima.financialstatement.creditaccounts"/>
</cell>
<cell fill="horizontal">
<JTextField id="creditAccountsTextField" text="{getFinancialStatement().getCreditAccounts()}"/>
@@ -88,10 +89,10 @@
</row>
<row>
<cell fill="none">
- <JButton text="lima.common.ok" onActionPerformed="dispose()"/>
+ <JButton text="lima.common.cancel" onActionPerformed="performCancel()"/>
</cell>
<cell fill="none">
- <JButton text="lima.common.cancel" onActionPerformed="performCancel()"/>
+ <JButton id="ok" text="lima.common.ok" onActionPerformed="dispose()"/>
</cell>
</row>
</Table>
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTableModel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTableModel.java 2010-07-29 12:51:43 UTC (rev 2989)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTableModel.java 2010-08-02 08:19:54 UTC (rev 2990)
@@ -348,9 +348,23 @@
Calendar actualCalendar = Calendar.getInstance();
// get the financial period date
Date transactionDate = selectedFinancialPeriod.getBeginDate();
- // change the day
- transactionDate = DateUtils.setDays(transactionDate,
- actualCalendar.get(Calendar.DAY_OF_MONTH));
+
+ Calendar selectedPeriodCal = Calendar.getInstance();
+ selectedPeriodCal.setTime(transactionDate);
+ int dayMax = selectedPeriodCal.getActualMaximum(Calendar.DAY_OF_MONTH);
+
+ int toDay = actualCalendar.get(Calendar.DAY_OF_MONTH);
+
+ if (toDay>dayMax){
+ // 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
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 2010-07-29 12:51:43 UTC (rev 2989)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/AddPeriod.jaxx 2010-08-02 08:19:54 UTC (rev 2990)
@@ -24,7 +24,9 @@
import org.chorem.lima.business.LimaException;
import org.apache.commons.lang.time.DateUtils;
import org.chorem.lima.entity.FiscalPeriodImpl;
-
+
+ getRootPane().setDefaultButton(okButton);
+
protected FiscalPeriodServiceMonitorable fiscalPeriodService =
LimaServiceFactory.getInstance().getService(
FiscalPeriodServiceMonitorable.class);
@@ -95,12 +97,12 @@
<row>
<cell>
<Table fill="none" anchor="center" weighty="1">
- <row>
+ <row>
<cell>
- <JButton id="okButton" text="lima.common.ok" onActionPerformed="performOk()"/>
+ <JButton id="cancelButton" text="lima.common.cancel" onActionPerformed="performCancel()"/>
</cell>
<cell>
- <JButton id="cancelButton" text="lima.common.cancel" onActionPerformed="performCancel()"/>
+ <JButton id="okButton" text="lima.common.ok" onActionPerformed="performOk()"/>
</cell>
</row>
</Table>
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/FinancialTransactionsPane.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/FinancialTransactionsPane.java 2010-07-29 12:51:43 UTC (rev 2989)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/FinancialTransactionsPane.java 2010-08-02 08:19:54 UTC (rev 2990)
@@ -99,25 +99,40 @@
List<FiscalPeriod> unblockedFiscalPeriods =
fiscalPeriodService.getAllUnblockedFiscalPeriods();
if (unblockedFiscalPeriods.size() != 0){
- List<FinancialTransaction> financialTransactions =
+ List<FinancialTransaction> financialTransactionsUnbal =
financialTransactionService.
getAllFinancialTransactionsUnbalanced(unblockedFiscalPeriods.get(0));
- if (financialTransactions.size()>0){
+ if (financialTransactionsUnbal.size()>0){
setBackground(redBackground);
- String transactionsString = financialTransactions.size()
+ String transactionsString = financialTransactionsUnbal.size()
+ " " + _("limahome.transaction.unbalanced")
+ "<br/><br/><a href='#financialtransactionunbalanced'>"
- + _("limahome.transaction.modifiy") + "</a>";
+ + _("limahome.transaction.modifiy.unbalanced") + "</a>";
//set Text
setText(htmlBegin + transactionsString + htmlEnd);
}
else {
- setBackground(greenBackground);
- String transactionsString = _("limahome.transaction.balanced")
- + "<br/><br/><a href='#financialtransactionbalanced'>"
- + _("limahome.transaction.create") + "</a>";
- //set Text
- setText(htmlBegin + transactionsString + htmlEnd);
+ List<FinancialTransaction> financialTransactionsBal =
+ financialTransactionService.getAllFinancialTransactionsBalanced(unblockedFiscalPeriods.get(0));
+
+ if (financialTransactionsBal.size()>0){
+ setBackground(greenBackground);
+ String transactionsString = financialTransactionsBal.size()
+ + " " + _("limahome.transaction.balanced")
+ + "<br/><br/><a href='#financialtransactionbalanced'>"
+ + _("limahome.transaction.modifiy.balanced") + "</a>";
+ //set Text
+ setText(htmlBegin + transactionsString + htmlEnd);
+ }
+ else {
+ setBackground(redBackground);
+ String transactionsString = _("limahome.transaction.nothing")
+ + "<br/><br/><a href='#financialtransactionbalanced'>"
+ + _("limahome.transaction.create") + "</a>";
+ //set Text
+ setText(htmlBegin + transactionsString + htmlEnd);
+ }
+
}
}
else {
@@ -131,7 +146,7 @@
@Override
public void notifyMethod(String serviceName, String methodeName) {
- if (methodeName.contains("FiscalPeriod") || methodeName.contains("FinancialTransaction") || methodeName.contains("importAll")){
+ if (methodeName.contains("FiscalPeriod") || methodeName.contains("FinancialTransaction") || methodeName.contains("importEntries") || methodeName.contains("importAll")){
refresh();
}
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/identity/IdentityForm.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/identity/IdentityForm.jaxx 2010-07-29 12:51:43 UTC (rev 2989)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/identity/IdentityForm.jaxx 2010-08-02 08:19:54 UTC (rev 2990)
@@ -22,7 +22,7 @@
<script>
<![CDATA[
-
+ getRootPane().setDefaultButton(ok);
protected void performCancel() {
setIdentity(null);
dispose();
@@ -154,11 +154,11 @@
</row>
<row>
<cell fill="none">
- <JButton text="lima.common.ok" onActionPerformed="handler.updateIdentity(getIdentity());
- dispose()"/>
+ <JButton text="lima.common.cancel" onActionPerformed="performCancel()"/>
</cell>
<cell fill="none">
- <JButton text="lima.common.cancel" onActionPerformed="performCancel()"/>
+ <JButton id="ok" text="lima.common.ok" onActionPerformed="handler.updateIdentity(getIdentity());
+ dispose()"/>
</cell>
</row>
</Table>
Deleted: trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExportForm.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExportForm.jaxx 2010-07-29 12:51:43 UTC (rev 2989)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExportForm.jaxx 2010-08-02 08:19:54 UTC (rev 2990)
@@ -1,50 +0,0 @@
-<!-- ##% Lima Swing
- Copyright (C) 2008 - 2010 CodeLutin
- This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License
- as published by the Free Software Foundation; either version 2
- of the License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- ##% -->
-
-<JDialog modal="true">
-
- <jaxx.runtime.swing.JAXXButtonGroup id="radioButtons" javaBean='new JAXXButtonGroup()'/>
- <Boolean id="addState" javaBean='true'/>
-
- <script>
- <![CDATA[
- protected void performCancel() {
- getRadioButtons().setSelectedValue(null);
- dispose();
- }
- ]]>
- </script>
-
- <Table>
- <row>
- <cell>
- <JRadioButton text='lima.importexport.export' value='export' buttonGroup="{getRadioButtons()}"
- selected='true'/>
- </cell>
- <cell>
- <JRadioButton text='lima.importexport.import' value='import' buttonGroup="{getRadioButtons()}"
- selected='true'/>
- </cell>
- <cell fill="none">
- <JButton text="lima.common.ok" onActionPerformed="dispose()"/>
- </cell>
- <cell fill="none">
- <JButton text="lima.common.cancel" onActionPerformed="performCancel()"/>
- </cell>
- </row>
- </Table>
-</JDialog>
\ No newline at end of file
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerView.jaxx 2010-07-29 12:51:43 UTC (rev 2989)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerView.jaxx 2010-08-02 08:19:54 UTC (rev 2990)
@@ -65,9 +65,13 @@
<cell>
<JButton text="lima.createPDF" onActionPerformed="getHandler().createPdf()"/>
</cell>
+ <cell anchor="center">
+ <JCheckBox id='movmentedFilter' text='lima.accountsreports.movmentedfilter' selected='false'
+ onActionPerformed="getHandler().refresh()"/>
+ </cell>
</row>
<row>
- <cell fill="both" weightx="1" weighty="1" columns="7">
+ <cell fill="both" weightx="1" weighty="1" columns="8">
<JScrollPane>
<org.chorem.lima.ui.ledger.LedgerTable
id="table" sortable="false" rowHeight="24"
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 2010-07-29 12:51:43 UTC (rev 2989)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerViewHandler.java 2010-08-02 08:19:54 UTC (rev 2990)
@@ -103,7 +103,7 @@
public List<Object> getDataList(){
List<Object> results = new ArrayList<Object>();
try {
- balanceTrialCache = reportService.generateLedger(selectedBeginDate, selectedEndDate);
+ balanceTrialCache = reportService.generateLedger(selectedBeginDate, selectedEndDate, view.getMovmentedFilter().isSelected());
if (balanceTrialCache.getReportsDatas() != null){
for (ReportsDatas reportsDatas : balanceTrialCache.getReportsDatas()) {
results.add(reportsDatas);
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/OpeningView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/OpeningView.jaxx 2010-07-29 12:51:43 UTC (rev 2989)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/OpeningView.jaxx 2010-08-02 08:19:54 UTC (rev 2990)
@@ -63,7 +63,7 @@
<cell weightx="0.8"><JLabel text=''/>
</cell>
<cell weightx="0.1" fill="none">
- <JButton text="lima.common.cancel" onActionPerformed="performCancel()"/>
+ <JButton text="lima.common.close" onActionPerformed="performCancel()"/>
</cell>
<cell weightx="0.1" fill="none">
<JButton id="ok" text="lima.common.next" onActionPerformed="handler.next()"/>
Modified: trunk/lima-swing/src/main/resources/i18n/lima-swing-en_GB.properties
===================================================================
--- trunk/lima-swing/src/main/resources/i18n/lima-swing-en_GB.properties 2010-07-29 12:51:43 UTC (rev 2989)
+++ trunk/lima-swing/src/main/resources/i18n/lima-swing-en_GB.properties 2010-08-02 08:19:54 UTC (rev 2990)
@@ -15,6 +15,7 @@
lima.accountsreports.accountfilter=Filter
lima.accountsreports.begincalendar=
lima.accountsreports.endcalendar=
+lima.accountsreports.movmentedfilter=
lima.action.commandline.help=Show help in console
lima.action.fullscreen=Full screen
lima.action.fullscreen.tip=Open ui in full screen
@@ -44,6 +45,7 @@
lima.common.add=
lima.common.addSubLedger=
lima.common.cancel=
+lima.common.close=
lima.common.fin=
lima.common.import=
lima.common.importexport=Import/Export
@@ -198,6 +200,7 @@
lima.table.credit=
lima.table.date=
lima.table.debit=
+lima.table.debitcredit=
lima.table.description=
lima.table.entrybook=
lima.table.fiscalperiod=
@@ -252,6 +255,9 @@
limahome.transaction.balanced=
limahome.transaction.create=
limahome.transaction.modifiy=
+limahome.transaction.modifiy.balanced=
+limahome.transaction.modifiy.unbalanced=
+limahome.transaction.nothing=
limahome.transaction.unbalanced=
limahome.transactionbalanced=
limahome.transactionunbalanced=
Modified: trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties
===================================================================
--- trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties 2010-07-29 12:51:43 UTC (rev 2989)
+++ trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties 2010-08-02 08:19:54 UTC (rev 2990)
@@ -14,6 +14,7 @@
lima.accountsreports.accountfilter=Filtrer
lima.accountsreports.begincalendar=Date d\u00E9but
lima.accountsreports.endcalendar=Date fin
+lima.accountsreports.movmentedfilter=Afficher que les comptes mouvement\u00E9s
lima.action.commandline.help=Afficher l'aide en console
lima.action.fullscreen=Plein Ecran
lima.action.fullscreen.tip=Passer en mode plein \u00E9cran
@@ -42,6 +43,7 @@
lima.common.add=Ajout Compte G\u00E9n\u00E9ral
lima.common.addSubLedger=Ajouter Compte Tiers
lima.common.cancel=Annuler
+lima.common.close=Fermer
lima.common.fin=Termin\u00E9
lima.common.importexport=Importer/Exporter
lima.common.next=Suivant
@@ -113,7 +115,7 @@
lima.identity.phoneNumber=n\u00B0 Tel
lima.identity.vatNumber=n\u00B0 TVA
lima.identity.zipCode=Code Postal
-lima.import.journal=
+lima.import.journal=Journaux par d\u00E9faut
lima.importexport.accountcharts=Plan des comptes
lima.importexport.all=Tout
lima.importexport.choiceencoding=Choisir encodage \:
@@ -124,8 +126,8 @@
lima.importexport.financialstatements=Plan BCR
lima.importexport.import=Import
lima.importexport.import.terminated=Import termin\u00E9
-lima.importexport.importcsv=
-lima.importexport.importebp=
+lima.importexport.importcsv=Import CSV
+lima.importexport.importebp=Import EBP
lima.importexport.lima=Import/Export Lima
lima.importexport.wait=Traitement en cours \u2026
lima.init.closed=Lima ferm\u00E9 \u00E0 %1$s
@@ -190,6 +192,7 @@
lima.table.credit=Cr\u00E9dit
lima.table.date=Date
lima.table.debit=D\u00E9bit
+lima.table.debitcredit=D\u00E9bit et Cr\u00E9dit
lima.table.description=Description
lima.table.entrybook=Journal
lima.table.fiscalperiod=Exercice
@@ -229,8 +232,10 @@
limahome.fiscalperiod.modify=Modifier les exercices
limahome.fiscalperiod.noopen=Aucun exercice ouvert \!
limahome.fiscalperiod.opened=exercices ouverts
-limahome.transaction.balanced=Toutes les \u00E9critures sont \u00E9quilibr\u00E9es
-limahome.transaction.create=Modifier les \u00E9critures
-limahome.transaction.modifiy=Modifier les \u00E9critures non \u00E9quilibr\u00E9es
+limahome.transaction.balanced=transactions, toutes sont \u00E9quilibr\u00E9es
+limahome.transaction.create=Ajouter des \u00E9critures
+limahome.transaction.modifiy.balanced=Modifier les \u00E9critures
+limahome.transaction.modifiy.unbalanced=Modifier les \u00E9critures non \u00E9quilibr\u00E9es
+limahome.transaction.nothing=Aucune \u00E9criture
limahome.transaction.unbalanced=\u00E9critures ne sont pas \u00E9quilibr\u00E9es \!
update=
Added: trunk/lima-swing/src/main/resources/import/bcr_base.csv
===================================================================
--- trunk/lima-swing/src/main/resources/import/bcr_base.csv (rev 0)
+++ trunk/lima-swing/src/main/resources/import/bcr_base.csv 2010-08-02 08:19:54 UTC (rev 2990)
@@ -0,0 +1,134 @@
+"FNST";"BILAN ACTIF";"true";"";"";"";"";"true";"false";""
+"FNST";"Capital Souscrit non appelé";"false";"109";" ";" ";" ";"false";"false";"BILAN ACTIF"
+"FNST";"BILAN PASSIF";"true";"";"";"";"";"true";"false";""
+"FNST";"CAPITAUX PROPRES";"true";"";"";"";"";"true";"false";"BILAN PASSIF"
+"FNST";"COMPTE DE RESULTAT";"true";"";"";"";"";"false";"false";""
+"FNST";"Capital (dont versé?)";"false";"101";"";"";"";"false";"false";"CAPITAUX PROPRES"
+"FNST";"CHARGES";"true";" ";" ";" ";" ";"true";"false";"COMPTE DE RESULTAT"
+"FNST";"PRODUITS";"true";"";"";"";"";"true";"false";"COMPTE DE RESULTAT"
+"FNST";"ACTIF IMMOBILISÉ";"true";" ";" ";" ";" ";"true";"false";"BILAN ACTIF"
+"FNST";"ACTIF CIRCULANT";"true";"";"";"";"";"true";"false";"BILAN ACTIF"
+"FNST";"CHARGES D'EXPLOITATION";"true";"";"";"";"";"true";"false";"CHARGES"
+"FNST";"Coût d'achat des marchandises";"true";"";"";"";"";"false";"true";"CHARGES D'EXPLOITATION"
+"FNST";"Stocks et en-cours";"true";"";"";"";"";"false";"true";"ACTIF CIRCULANT"
+"FNST";"Marchandises";"false";"37";"";"";"397";"false";"false";"Stocks et en-cours"
+"FNST";"Variations de stocks de march.";"false";"603";"";"";"";"false";"false";"Coût d'achat des marchandises"
+"FNST";"Achat de marchandises";"false";"607";"";"";"";"false";"false";"Coût d'achat des marchandises"
+"FNST";"Immobilisations incorporelles";"true";"";"";"";"";"false";"false";"ACTIF IMMOBILISÉ"
+"FNST";"Frais d'établissement";"false";"201";"";"";"2801";"false";"false";"Immobilisations incorporelles"
+"FNST";"Frais de recherche et développement";"false";"203";"";"";"2803";"false";"false";"Immobilisations incorporelles"
+"FNST";"Concessions, brevets, licences, marques, procédés, logiciels, droits et valeurs similaires";"false";"205";"";"";"2805, 2905";"false";"false";"Immobilisations incorporelles"
+"FNST";"Fonds commercial";"false";"206, 207";"";"";"2807, 2906, 2907";"false";"false";"Immobilisations incorporelles"
+"FNST";"Autres";"false";"208";"";"";"2808, 2908";"false";"false";"Immobilisations incorporelles"
+"FNST";"Immobilisations incorporelles en cours";"false";"232";"";"";"2932";"false";"false";"Immobilisations incorporelles"
+"FNST";"Avances et acomptes";"false";"237";"";"";"";"false";"false";"Immobilisations incorporelles"
+"FNST";"Immobilisations corporelles";"true";"";"";"";"";"false";"false";"ACTIF IMMOBILISÉ"
+"FNST";"Terrains";"false";"211, 212";"";"";"2811, 2812, 2911";"false";"false";"Immobilisations corporelles"
+"FNST";"Constructions";"false";"213, 214";"";"";"2813, 2814";"false";"false";"Immobilisations corporelles"
+"FNST";"Installations techniques, matériels, et outillage industriels";"false";"215";"";"";"2815";"false";"false";"Immobilisations corporelles"
+"FNST";"Immobilisations corporelles en cours";"false";"231";"";"";"2931";"false";"false";"Immobilisations corporelles"
+"FNST";"Immobilisations financières";"true";"";"";"";"";"false";"false";"ACTIF IMMOBILISÉ"
+"FNST";"Participations";"false";"261, 266";"";"";"2961, 2966";"false";"false";"Immobilisations financières"
+"FNST";"Créances rattachées à des participations";"false";"267, 268";"";"";"2967, 2968";"false";"false";"Immobilisations financières"
+"FNST";"Titres immobilisés de l'activité de portefeuille";"false";"273";"";"";"2973";"false";"false";"Immobilisations financières"
+"FNST";"Autres titres immobilisés";"false";"271, 272, 27682";"";"";"2971, 2972";"false";"false";"Immobilisations financières"
+"FNST";"Prêts";"false";"274, 27684";"";"";"2974";"false";"false";"Immobilisations financières"
+"FNST";"Matières premières et autres approvisionnements";"false";"31, 32";"";"";"391, 392";"false";"false";"Stocks et en-cours"
+"FNST";"En cours de production (biens et services)";"false";"33, 34";"";"";"393, 394";"false";"false";"Stocks et en-cours"
+"FNST";"Produits intermédiaires et finis";"false";"35";"";"";"395";"false";"false";"Stocks et en-cours"
+"FNST";"Avances et acomptes versés sur commandes";"false";"4091";"";"";"";"false";"false";"ACTIF CIRCULANT"
+"FNST";"Créances";"true";"";"";"";"";"false";"false";"ACTIF CIRCULANT"
+"FNST";"Valeurs mobilières de placement";"true";"";"";"";"";"false";"false";"ACTIF CIRCULANT"
+"FNST";"Actions propres";"false";"502";"";"";"59";"false";"false";"Valeurs mobilières de placement"
+"FNST";"Autres titres";"false";"50 -502 -509";"";"";"59";"false";"false";"Valeurs mobilières de placement"
+"FNST";"Disponibilités";"false";"53, 54 -5181 -519";"51";"";"";"false";"false";"ACTIF CIRCULANT"
+"FNST";"Charges constatées d'avance";"false";"486";"";"";"";"false";"false";"ACTIF CIRCULANT"
+"FNST";"Instrument de trésorerie";"false";"";"52";"";"";"false";"false";"Valeurs mobilières de placement"
+"FNST";"Charges à répartir sur plusieurs exercices";"false";"481";"";"";"";"false";"false";"BILAN ACTIF"
+"FNST";"Primes de remboursement des emprunts";"false";"169";"";"";"";"false";"false";"BILAN ACTIF"
+"FNST";"Ecarts de conversion Actif";"false";"476";"";"";"";"false";"false";"BILAN ACTIF"
+"FNST";"Primes d'émission, de fusion, d'apport";"false";"104";"";"";"";"false";"false";"CAPITAUX PROPRES"
+"FNST";"Ecart de réévaluation";"false";"105";"";"";"";"false";"false";"CAPITAUX PROPRES"
+"FNST";"Ecart d'équivalence";"false";"107";"";"";"";"false";"false";"CAPITAUX PROPRES"
+"FNST";"Réserves";"true";"";"";"";"";"false";"false";"CAPITAUX PROPRES"
+"FNST";"Réserve légale";"false";"1061";"";"";"";"false";"false";"Réserves"
+"FNST";"Réserves statutaires ou contractuelles";"false";"1063";"";"";"";"false";"false";"Réserves"
+"FNST";"Réserves réglementées";"false";"1062, 1064";"";"";"";"false";"false";"Réserves"
+"FNST";"Report à nouveau";"false";"11";"";"";"";"false";"false";"CAPITAUX PROPRES"
+"FNST";"RÉSULTAT DE L'EXERCICE (BÉNÉFICE OU PERTE)";"false";"12";"";"";"";"false";"false";"CAPITAUX PROPRES"
+"FNST";"Subventions d'investissement";"false";"13";"";"";"";"false";"false";"CAPITAUX PROPRES"
+"FNST";"Provisions réglementées";"false";"14";"";"";"";"false";"false";"CAPITAUX PROPRES"
+"FNST";"AUTRES FONDS PROPRES";"true";"";"";"";"";"true";"false";"BILAN PASSIF"
+"FNST";"Produits des émissions de titres participatifs";"false";"1671";"";"";"";"false";"false";"AUTRES FONDS PROPRES"
+"FNST";"Avances conditionnées";"false";"1674";"";"";"";"false";"false";"AUTRES FONDS PROPRES"
+"FNST";"PROVISIONS POUR RISQUES ET CHARGES";"true";"";"";"";"";"true";"false";"BILAN PASSIF"
+"FNST";"Provisions pour risques";"false";"151";"";"";"";"false";"false";"PROVISIONS POUR RISQUES ET CHARGES"
+"FNST";"Provisions pour charges";"false";"15 -151";"";"";"";"false";"false";"PROVISIONS POUR RISQUES ET CHARGES"
+"FNST";"DETTES";"true";"";"";"";"";"true";"false";"BILAN PASSIF"
+"FNST";"Emprunts obligataires convertibles";"false";"161, 16881";"";"";"";"false";"false";"DETTES"
+"FNST";"Autres emprunts obligataires";"false";"163, 16683";"";"";"";"false";"false";"DETTES"
+"FNST";"Emprunts et dettes auprès établissements de crédits";"false";"164, 16684, 5181, 519";"";"512, 514, 517";"";"false";"false";"DETTES"
+"FNST";"Emprunts et dettes financières diverses";"false";"165, 166, 1675, 168, 16883, 17, 426 -16881 -457";"";"45";"";"false";"false";"DETTES"
+"FNST";"Avances et acomptes reçues sur commandes en cours";"false";"4191";"";"";"";"false";"false";"DETTES"
+"FNST";"Ecarts de conversion passif";"false";"477";"";"";"";"false";"false";"BILAN PASSIF"
+"FNST";"Coût d'achats de matières premières et autres approvisionnements";"true";"";"";"";"";"false";"false";"CHARGES D'EXPLOITATION"
+"FNST";"Achats de matières premières et autres approvisionnements";"false";"601, 602, 6081, 6082, 6091, 6092";"";"";"";"false";"false";"Coût d'achats de matières premières et autres approvisionnements"
+"FNST";"Variation des stock";"false";"6037";"";"";"";"false";"false";"Coût d'achats de matières premières et autres approvisionnements"
+"FNST";"Autres achats et charges externes";"false";"604, 605, 606, 6084, 6085, 6086, 6094, 6095, 6096, 61, 62";"";"";"";"false";"false";"CHARGES D'EXPLOITATION"
+"FNST";"Impôts, taxes et versements assimilés";"false";"63";"";"";"";"false";"false";"CHARGES D'EXPLOITATION"
+"FNST";"Salaires et traitements";"false";"641, 644, 648";"";"";"";"false";"false";"CHARGES D'EXPLOITATION"
+"FNST";"Charges sociales";"false";"645, 646, 647, 648";"";"";"";"false";"false";"CHARGES D'EXPLOITATION"
+"FNST";"Dotations aux amortis. & provisions";"true";" ";" ";" ";" ";"false";"true";"CHARGES D'EXPLOITATION"
+"FNST";"Autres charges";"false";"65 -655";"";"";"";"false";"false";"CHARGES D'EXPLOITATION"
+"FNST";"Quotes-parts de résultat sur opérations faites en commun";"false";"655";"";"";"";"false";"false";"CHARGES"
+"FNST";"Charges financières";"true";"";"";"";"";"false";"true";"CHARGES"
+"FNST";"Dotations aux amortissements et provisions";"false";"686";"";"";"";"false";"false";"Charges financières"
+"FNST";"Intérêts et charges assimilées";"false";"661, 664, 665, 668";"";"";"";"false";"false";"Charges financières"
+"FNST";"Différences négatives de change";"false";"666";"";"";"";"false";"false";"Charges financières"
+"FNST";"Charges nettes sur cessions de valeurs mobilières de placement";"false";"667";"";"";"";"false";"false";"Charges financières"
+"FNST";"Charges exceptionnelles";"true";"";"";"";"";"false";"true";"CHARGES"
+"FNST";"Sur opérations de gestion";"false";"671";"";"";"";"false";"false";"Charges exceptionnelles"
+"FNST";"Sur opérations en capital";"false";"675, 678";"";"";"";"false";"false";"Charges exceptionnelles"
+"FNST";"Dotations aux amortissements et aux provisions";"false";"687";"";"";"";"false";"false";"Charges exceptionnelles"
+"FNST";"Participation des salariés aux résultats";"false";"691";"";"";"";"false";"false";"CHARGES"
+"FNST";"Impôts sur les bénéfices";"false";"695, 697, 689, 698, 699, 789";"";"";"";"false";"false";"CHARGES"
+"FNST";"Produits d'exploitation";"true";"";"";"";"";"true";"false";"PRODUITS"
+"FNST";"Montant net Chiffre d'affaires";"true";"";"";"";"";"false";"true";"Produits d'exploitation"
+"FNST";"Production vendue (B&S)";"false";"70 -707 -708-7097";"";"";"";"false";"false";"Montant net Chiffre d'affaires"
+"FNST";"Ventes de marchandises";"false";"707, 708 -7097";"";"";"";"false";"false";"Montant net Chiffre d'affaires"
+"FNST";"Autres produits d'exploitation";"true";"";"";"";"";"false";"true";"Produits d'exploitation"
+"FNST";"Production stockée";"false";"713";"";"";"";"false";"false";"Autres produits d'exploitation"
+"FNST";"Production immobilisée";"false";"72, 73";"";"";"";"false";"false";"Autres produits d'exploitation"
+"FNST";"Subventions d'exploitation";"false";"74";"";"";"";"false";"false";"Autres produits d'exploitation"
+"FNST";"Reprises sur provisions (et amortissements), transferts de charges";"false";"781, 791";"";"";"";"false";"false";"Autres produits d'exploitation"
+"FNST";"Autres produits";"false";"75 -755";"";"";"";"false";"false";"Autres produits d'exploitation"
+"FNST";"Quote-parts de résultat sur opérations faites en commun";"false";"755";"";"";"";"false";"false";"PRODUITS"
+"FNST";"Produits financiers";"true";"";"";"";"";"false";"true";"PRODUITS"
+"FNST";"De participations";"false";"761";"";"";"";"false";"false";"Produits financiers"
+"FNST";"D'autres valeurs mobilières et créances de l'actif immobilisé";"false";"762";"";"";"";"false";"false";"Produits financiers"
+"FNST";"Autres intérêts et produits assimilés";"false";"763, 764, 765, 768";"";"";"";"false";"false";"Produits financiers"
+"FNST";"Reprises sur provisions et transfers de charges";"false";"786, 796";"";"";"";"false";"false";"Produits financiers"
+"FNST";"Différences positives de change";"false";"766";"";"";"";"false";"false";"Produits financiers"
+"FNST";"Produits nets sur cessions de valeurs mobilières de placement";"false";"767";"";"";"";"false";"false";"Produits financiers"
+"FNST";"Produits exceptionnels";"true";"";"";"";"";"false";"true";"PRODUITS"
+"FNST";"Reprises sur provisions et transferts de charges";"false";"787, 797";"";"";"";"false";"false";"Produits exceptionnels"
+"FNST";"Sur immobilisations : dotations aux amortissements";"false";"6811, 6812";"";"";"";"false";"false";"Dotations aux amortis. & provisions"
+"FNST";"Sur immobilisations : dotations aux provisions";"false";"6816";"";"";"";"false";"false";"Dotations aux amortis. & provisions"
+"FNST";"Sur actif circulant : dotations aux provisions";"false";"6817";"";"";"";"false";"false";"Dotations aux amortis. & provisions"
+"FNST";"Pour risques et charges : dotations aux provisions";"false";"6815";"";"";"";"false";"false";"Dotations aux amortis. & provisions"
+"FNST";"Créances Clients et Comptes rattachés";"false";"411, 413, 416, 418";;;"491";"false";"false";"Créances"
+"FNST";"Autres";"false";"4096, 4097, 4098, 425, 4287, 4387, 441, 4452, 4456, 44581, 44582, 44583, 44586, 4487, 462, 465, 467, 4687";"443, 444, 451, 455, 456, 458 -4562";"";"";"false";"false";"Créances"
+"FNST";"Capital souscrit et appelé, non versé";"false";"4562";"";"";"";"false";"false";"Créances"
+"FNST";"Autres";"false";"275, 2761, 27685, 27688";"";"";"2975, 2976";"false";"false";"Immobilisations financières"
+"FNST";"Autres";"false";"218";"";"";"2818";"false";"false";"Immobilisations corporelles"
+"FNST";"Autres";"false";"1068";"";"";"";"false";"false";"Réserves"
+"FNST";"Autres";"false";"";"";"";"";"false";"false";"AUTRES FONDS PROPRES"
+"FNST";"Avances et acomptes";"false";"238";"";"";"";"false";"false";"Immobilisations corporelles"
+"FNST";"Sur opérations de gestion";"false";"771";"";"";"";"false";"false";"Produits exceptionnels"
+"FNST";"Sur opérations en capital";"false";"775, 777, 778";"";"";"";"false";"false";"Produits exceptionnels"
+"FNST";"Dettes Fournisseurs et Comptes rattachés";"false";"401, 403, 4081, 4088";;;;"false";"false";"DETTES"
+"FNST";"Dettes fiscales et sociales";"false";"421, 422, 424, 427, 4282, 4286, 43, 442, 4455, 4457, 44584, 44587, 446, 447, 4482, 4486, 457 -4387";"";"443, 444";;"false";"false";"DETTES"
+"FNST";"Dettes sur immobilisations et Comptes rattachés";"false";"269, 279, 404, 405, 4084, 4088";;;;"false";"false";"DETTES"
+"FNST";"Autres dettes";"false";"4196, 4197, 4198, 464, 4686, 509";"";"467, 478";;"false";"false";"DETTES"
+"FNST";"Instruments de trésorerie";"false";;"";"52";;"false";"false";"DETTES"
+"FNST";"Produits constatés d'avance";"false";"487";;;;"false";"false";"DETTES"
Added: trunk/lima-swing/src/main/resources/import/bcr_developed.csv
===================================================================
--- trunk/lima-swing/src/main/resources/import/bcr_developed.csv (rev 0)
+++ trunk/lima-swing/src/main/resources/import/bcr_developed.csv 2010-08-02 08:19:54 UTC (rev 2990)
@@ -0,0 +1,138 @@
+"FNST";"BILAN ACTIF";"true";"";"";"";"";"true";"false";""
+"FNST";"Capital Souscrit non appelé";"false";"109";" ";" ";" ";"false";"false";"BILAN ACTIF"
+"FNST";"BILAN PASSIF";"true";"";"";"";"";"true";"false";""
+"FNST";"CAPITAUX PROPRES";"true";"";"";"";"";"true";"false";"BILAN PASSIF"
+"FNST";"COMPTE DE RESULTAT";"true";"";"";"";"";"false";"false";""
+"FNST";"Capital (dont versé?)";"false";"101";"";"";"";"false";"false";"CAPITAUX PROPRES"
+"FNST";"CHARGES";"true";" ";" ";" ";" ";"true";"false";"COMPTE DE RESULTAT"
+"FNST";"PRODUITS";"true";"";"";"";"";"true";"false";"COMPTE DE RESULTAT"
+"FNST";"ACTIF IMMOBILISÉ";"true";" ";" ";" ";" ";"true";"false";"BILAN ACTIF"
+"FNST";"ACTIF CIRCULANT";"true";"";"";"";"";"true";"false";"BILAN ACTIF"
+"FNST";"CHARGES D'EXPLOITATION";"true";"";"";"";"";"true";"false";"CHARGES"
+"FNST";"Coût d'achat des marchandises";"true";"";"";"";"";"false";"true";"CHARGES D'EXPLOITATION"
+"FNST";"Stocks et en-cours";"true";"";"";"";"";"false";"true";"ACTIF CIRCULANT"
+"FNST";"Marchandises";"false";"37";"";"";"397";"false";"false";"Stocks et en-cours"
+"FNST";"Variations de stocks de march.";"false";"603";"";"";"";"false";"false";"Coût d'achat des marchandises"
+"FNST";"Achat de marchandises";"false";"607";"";"";"";"false";"false";"Coût d'achat des marchandises"
+"FNST";"Immobilisations incorporelles";"true";"";"";"";"";"false";"false";"ACTIF IMMOBILISÉ"
+"FNST";"Frais d'établissement";"false";"201";"";"";"2801";"false";"false";"Immobilisations incorporelles"
+"FNST";"Frais de recherche et développement";"false";"203";"";"";"2803";"false";"false";"Immobilisations incorporelles"
+"FNST";"Concessions, brevets, licences, marques, procédés, logiciels, droits et valeurs similaires";"false";"205";"";"";"2805, 2905";"false";"false";"Immobilisations incorporelles"
+"FNST";"Fonds commercial";"false";"206, 207";"";"";"2807, 2906, 2907";"false";"false";"Immobilisations incorporelles"
+"FNST";"Autres";"false";"208";"";"";"2808, 2908";"false";"false";"Immobilisations incorporelles"
+"FNST";"Immobilisations incorporelles en cours";"false";"232";"";"";"2932";"false";"false";"Immobilisations incorporelles"
+"FNST";"Avances et acomptes";"false";"237";"";"";"";"false";"false";"Immobilisations incorporelles"
+"FNST";"Immobilisations corporelles";"true";"";"";"";"";"false";"false";"ACTIF IMMOBILISÉ"
+"FNST";"Terrains";"false";"211, 212";"";"";"2811, 2812, 2911";"false";"false";"Immobilisations corporelles"
+"FNST";"Constructions";"false";"213, 214";"";"";"2813, 2814";"false";"false";"Immobilisations corporelles"
+"FNST";"Installations techniques, matériels, et outillage industriels";"false";"215";"";"";"2815";"false";"false";"Immobilisations corporelles"
+"FNST";"Immobilisations corporelles en cours";"false";"231";"";"";"2931";"false";"false";"Immobilisations corporelles"
+"FNST";"Immobilisations financières";"true";"";"";"";"";"false";"false";"ACTIF IMMOBILISÉ"
+"FNST";"Participations";"false";"261, 266";"";"";"2961, 2966";"false";"false";"Immobilisations financières"
+"FNST";"Créances rattachées à des participations";"false";"267, 268";"";"";"2967, 2968";"false";"false";"Immobilisations financières"
+"FNST";"Titres immobilisés de l'activité de portefeuille";"false";"273";"";"";"2973";"false";"false";"Immobilisations financières"
+"FNST";"Autres titres immobilisés";"false";"271, 272, 27682";"";"";"2971, 2972";"false";"false";"Immobilisations financières"
+"FNST";"Prêts";"false";"274, 27684";"";"";"2974";"false";"false";"Immobilisations financières"
+"FNST";"Matières premières et autres approvisionnements";"false";"31, 32";"";"";"391, 392";"false";"false";"Stocks et en-cours"
+"FNST";"En cours de production (biens et services)";"false";"33, 34";"";"";"393, 394";"false";"false";"Stocks et en-cours"
+"FNST";"Produits intermédiaires et finis";"false";"35";"";"";"395";"false";"false";"Stocks et en-cours"
+"FNST";"Avances et acomptes versés sur commandes";"false";"4091";"";"";"";"false";"false";"ACTIF CIRCULANT"
+"FNST";"Créances";"true";"";"";"";"";"false";"false";"ACTIF CIRCULANT"
+"FNST";"Valeurs mobilières de placement";"true";"";"";"";"";"false";"false";"ACTIF CIRCULANT"
+"FNST";"Actions propres";"false";"502";"";"";"59";"false";"false";"Valeurs mobilières de placement"
+"FNST";"Autres titres";"false";"50 -502 -509";"";"";"59";"false";"false";"Valeurs mobilières de placement"
+"FNST";"Disponibilités";"false";"53, 54 -5181 -519";"51";"";"";"false";"false";"ACTIF CIRCULANT"
+"FNST";"Charges constatées d'avance";"false";"486";"";"";"";"false";"false";"ACTIF CIRCULANT"
+"FNST";"Instrument de trésorerie";"false";"";"52";"";"";"false";"false";"Valeurs mobilières de placement"
+"FNST";"Charges à répartir sur plusieurs exercices";"false";"481";"";"";"";"false";"false";"BILAN ACTIF"
+"FNST";"Primes de remboursement des emprunts";"false";"169";"";"";"";"false";"false";"BILAN ACTIF"
+"FNST";"Ecarts de conversion Actif";"false";"476";"";"";"";"false";"false";"BILAN ACTIF"
+"FNST";"Primes d'émission, de fusion, d'apport";"false";"104";"";"";"";"false";"false";"CAPITAUX PROPRES"
+"FNST";"Ecart de réévaluation";"false";"105";"";"";"";"false";"false";"CAPITAUX PROPRES"
+"FNST";"Ecart d'équivalence";"false";"107";"";"";"";"false";"false";"CAPITAUX PROPRES"
+"FNST";"Réserves";"true";"";"";"";"";"false";"false";"CAPITAUX PROPRES"
+"FNST";"Réserve légale";"false";"1061";"";"";"";"false";"false";"Réserves"
+"FNST";"Réserves statutaires ou contractuelles";"false";"1063";"";"";"";"false";"false";"Réserves"
+"FNST";"Réserves réglementées";"false";"1062, 1064";"";"";"";"false";"false";"Réserves"
+"FNST";"Report à nouveau";"false";"11";"";"";"";"false";"false";"CAPITAUX PROPRES"
+"FNST";"RÉSULTAT DE L'EXERCICE (BÉNÉFICE OU PERTE)";"false";"12";"";"";"";"false";"false";"CAPITAUX PROPRES"
+"FNST";"Subventions d'investissement";"false";"13";"";"";"";"false";"false";"CAPITAUX PROPRES"
+"FNST";"Provisions réglementées";"false";"14";"";"";"";"false";"false";"CAPITAUX PROPRES"
+"FNST";"AUTRES FONDS PROPRES";"true";"";"";"";"";"true";"false";"BILAN PASSIF"
+"FNST";"Produits des émissions de titres participatifs";"false";"1671";"";"";"";"false";"false";"AUTRES FONDS PROPRES"
+"FNST";"Avances conditionnées";"false";"1674";"";"";"";"false";"false";"AUTRES FONDS PROPRES"
+"FNST";"PROVISIONS POUR RISQUES ET CHARGES";"true";"";"";"";"";"true";"false";"BILAN PASSIF"
+"FNST";"Provisions pour risques";"false";"151";"";"";"";"false";"false";"PROVISIONS POUR RISQUES ET CHARGES"
+"FNST";"Provisions pour charges";"false";"15 -151";"";"";"";"false";"false";"PROVISIONS POUR RISQUES ET CHARGES"
+"FNST";"DETTES";"true";"";"";"";"";"true";"false";"BILAN PASSIF"
+"FNST";"Emprunts obligataires convertibles";"false";"161, 16881";"";"";"";"false";"false";"DETTES"
+"FNST";"Autres emprunts obligataires";"false";"163, 16683";"";"";"";"false";"false";"DETTES"
+"FNST";"Emprunts et dettes auprès établissements de crédits";"false";"164, 16684, 5181, 519";"";"512, 514, 517";"";"false";"false";"DETTES"
+"FNST";"Emprunts et dettes financières diverses";"false";"165, 166, 1675, 168, 16883, 17, 426 -16881 -457";"";"45";"";"false";"false";"DETTES"
+"FNST";"Avances et acomptes reçues sur commandes en cours";"false";"4191";"";"";"";"false";"false";"DETTES"
+"FNST";"Ecarts de conversion passif";"false";"477";"";"";"";"false";"false";"BILAN PASSIF"
+"FNST";"Coût d'achats de matières premières et autres approvisionnements";"true";"";"";"";"";"false";"false";"CHARGES D'EXPLOITATION"
+"FNST";"Achats de matières premières et autres approvisionnements";"false";"601, 602, 6081, 6082, 6091, 6092";"";"";"";"false";"false";"Coût d'achats de matières premières et autres approvisionnements"
+"FNST";"Variation des stock";"false";"6037";"";"";"";"false";"false";"Coût d'achats de matières premières et autres approvisionnements"
+"FNST";"Autres achats et charges externes";"false";"604, 605, 606, 6084, 6085, 6086, 6094, 6095, 6096, 61, 62";"";"";"";"false";"false";"CHARGES D'EXPLOITATION"
+"FNST";"Impôts, taxes et versements assimilés";"false";"63";"";"";"";"false";"false";"CHARGES D'EXPLOITATION"
+"FNST";"Salaires et traitements";"false";"641, 644, 648";"";"";"";"false";"false";"CHARGES D'EXPLOITATION"
+"FNST";"Charges sociales";"false";"645, 646, 647, 648";"";"";"";"false";"false";"CHARGES D'EXPLOITATION"
+"FNST";"Dotations aux amortis. & provisions";"true";" ";" ";" ";" ";"false";"true";"CHARGES D'EXPLOITATION"
+"FNST";"Autres charges";"false";"65 -655";"";"";"";"false";"false";"CHARGES D'EXPLOITATION"
+"FNST";"Quotes-parts de résultat sur opérations faites en commun";"false";"655";"";"";"";"false";"false";"CHARGES"
+"FNST";"Charges financières";"true";"";"";"";"";"false";"true";"CHARGES"
+"FNST";"Dotations aux amortissements et provisions";"false";"686";"";"";"";"false";"false";"Charges financières"
+"FNST";"Intérêts et charges assimilées";"false";"661, 664, 665, 668";"";"";"";"false";"false";"Charges financières"
+"FNST";"Différences négatives de change";"false";"666";"";"";"";"false";"false";"Charges financières"
+"FNST";"Charges nettes sur cessions de valeurs mobilières de placement";"false";"667";"";"";"";"false";"false";"Charges financières"
+"FNST";"Charges exceptionnelles";"true";"";"";"";"";"false";"true";"CHARGES"
+"FNST";"Sur opérations de gestion";"false";"671";"";"";"";"false";"false";"Charges exceptionnelles"
+"FNST";"Sur opérations en capital";"false";"675, 678";"";"";"";"false";"false";"Charges exceptionnelles"
+"FNST";"Dotations aux amortissements et aux provisions";"false";"687";"";"";"";"false";"false";"Charges exceptionnelles"
+"FNST";"Participation des salariés aux résultats";"false";"691";"";"";"";"false";"false";"CHARGES"
+"FNST";"Impôts sur les bénéfices";"false";"695, 697, 689, 698, 699, 789";"";"";"";"false";"false";"CHARGES"
+"FNST";"Produits d'exploitation";"true";"";"";"";"";"true";"false";"PRODUITS"
+"FNST";"Montant net Chiffre d'affaires";"true";"";"";"";"";"false";"true";"Produits d'exploitation"
+"FNST";"Production vendue (B&S)";"false";"70 -707 -708-7097";"";"";"";"false";"false";"Montant net Chiffre d'affaires"
+"FNST";"Ventes de marchandises";"false";"707, 708 -7097";"";"";"";"false";"false";"Montant net Chiffre d'affaires"
+"FNST";"Autres produits d'exploitation";"true";"";"";"";"";"false";"true";"Produits d'exploitation"
+"FNST";"Production stockée";"false";"713";"";"";"";"false";"false";"Autres produits d'exploitation"
+"FNST";"Production immobilisée";"false";"72, 73";"";"";"";"false";"false";"Autres produits d'exploitation"
+"FNST";"Subventions d'exploitation";"false";"74";"";"";"";"false";"false";"Autres produits d'exploitation"
+"FNST";"Reprises sur provisions (et amortissements), transferts de charges";"false";"781, 791";"";"";"";"false";"false";"Autres produits d'exploitation"
+"FNST";"Autres produits";"false";"75 -755";"";"";"";"false";"false";"Autres produits d'exploitation"
+"FNST";"Quote-parts de résultat sur opérations faites en commun";"false";"755";"";"";"";"false";"false";"PRODUITS"
+"FNST";"Produits financiers";"true";"";"";"";"";"false";"true";"PRODUITS"
+"FNST";"De participations";"false";"761";"";"";"";"false";"false";"Produits financiers"
+"FNST";"D'autres valeurs mobilières et créances de l'actif immobilisé";"false";"762";"";"";"";"false";"false";"Produits financiers"
+"FNST";"Autres intérêts et produits assimilés";"false";"763, 764, 765, 768";"";"";"";"false";"false";"Produits financiers"
+"FNST";"Reprises sur provisions et transfers de charges";"false";"786, 796";"";"";"";"false";"false";"Produits financiers"
+"FNST";"Différences positives de change";"false";"766";"";"";"";"false";"false";"Produits financiers"
+"FNST";"Produits nets sur cessions de valeurs mobilières de placement";"false";"767";"";"";"";"false";"false";"Produits financiers"
+"FNST";"Produits exceptionnels";"true";"";"";"";"";"false";"true";"PRODUITS"
+"FNST";"Reprises sur provisions et transferts de charges";"false";"787, 797";"";"";"";"false";"false";"Produits exceptionnels"
+"FNST";"Sur immobilisations : dotations aux amortissements";"false";"6811, 6812";"";"";"";"false";"false";"Dotations aux amortis. & provisions"
+"FNST";"Sur immobilisations : dotations aux provisions";"false";"6816";"";"";"";"false";"false";"Dotations aux amortis. & provisions"
+"FNST";"Sur actif circulant : dotations aux provisions";"false";"6817";"";"";"";"false";"false";"Dotations aux amortis. & provisions"
+"FNST";"Pour risques et charges : dotations aux provisions";"false";"6815";"";"";"";"false";"false";"Dotations aux amortis. & provisions"
+"FNST";"Créance d'exploitation";"true";"";"";"";"";"false";"false";"Créances"
+"FNST";"Créances clients et Comptes rattachés";"false";"411, 413, 416, 418";"";"";"491";"false";"false";"Créance d'exploitation"
+"FNST";"Créances diverses";"false";"4411, 4418, 4487, 4456, 462, 465, 4687";"443, 444, 451, 456, 458, 467 -4562";"";"";"false";"false";"Créances"
+"FNST";"Capital souscrit et appelé, non versé";"false";"4562";"";"";"";"false";"false";"Créances"
+"FNST";"Dettes d'exploitation";"true";"";"";"";"";"false";"false";"DETTES"
+"FNST";"Dettes fournisseurs et comptes rattachés";"false";"401, 403, 4081";"";"";"";"false";"false";"Dettes d'exploitation"
+"FNST";"Dettes fiscales et sociales";"false";"421, 422, 424, 427, 4282, 4286, 431, 437, 4386, 4455, 446, 447, 4486";"";"4458";"";"false";"false";"Dettes d'exploitation"
+"FNST";"Dettes diverses";"true";"";"";"";"";"false";"false";"DETTES"
+"FNST";"Dettes sur immobilisations et Comptes rattachés";"false";"269, 279, 404, 405, 4084";"";"";"";"false";"false";"Dettes diverses"
+"FNST";"Dettes fiscales (impôts sur les bénéfices)";"false";"";"";"444";"";"false";"false";"Dettes diverses"
+"FNST";"Autres";"false";"275, 2761, 27685, 27688";"";"";"2975, 2976";"false";"false";"Immobilisations financières"
+"FNST";"Autres";"false";"218";"";"";"2818";"false";"false";"Immobilisations corporelles"
+"FNST";"Autres";"false";"1068";"";"";"";"false";"false";"Réserves"
+"FNST";"Autres";"false";"";"";"";"";"false";"false";"AUTRES FONDS PROPRES"
+"FNST";"Autres";"false";"4096, 4097, 4098, 425, 4287, 4387, 4417, 4456, 4487";"4458";"";"495, 496";"false";"false";"Créance d'exploitation"
+"FNST";"Autres";"false";"4196, 4197, 4198, 4419";"";"";"";"false";"false";"Dettes d'exploitation"
+"FNST";"Autres";"false";"424, 426, 4284, 4419, 442, 4486, 457, 464, 467, 4686, 509";"";"443, 451, 455, 456, 458";"";"false";"false";"Dettes diverses"
+"FNST";"Avances et acomptes";"false";"238";"";"";"";"false";"false";"Immobilisations corporelles"
+"FNST";"Sur opérations de gestion";"false";"771";"";"";"";"false";"false";"Produits exceptionnels"
+"FNST";"Sur opérations en capital";"false";"775, 777, 778";"";"";"";"false";"false";"Produits exceptionnels"
Added: trunk/lima-swing/src/main/resources/import/bcr_shortened.csv
===================================================================
--- trunk/lima-swing/src/main/resources/import/bcr_shortened.csv (rev 0)
+++ trunk/lima-swing/src/main/resources/import/bcr_shortened.csv 2010-08-02 08:19:54 UTC (rev 2990)
@@ -0,0 +1,68 @@
+"FNST";"BILAN ACTIF";"true";"";"";"";"";"true";"false";""
+"FNST";"BILAN PASSIF";"true";"";"";"";"";"true";"false";""
+"FNST";"CAPITAUX PROPRES";"true";"";"";"";"";"true";"false";"BILAN PASSIF"
+"FNST";"COMPTE DE RESULTAT";"true";"";"";"";"";"false";"false";""
+"FNST";"Capital";"false";"101, 108";"";"";"";"false";"false";"CAPITAUX PROPRES"
+"FNST";"CHARGES";"true";" ";" ";" ";" ";"true";"false";"COMPTE DE RESULTAT"
+"FNST";"CHARGES D'EXPLOITATION ET FINANCIERES";"true";"";"";"";"";"true";"false";"CHARGES"
+"FNST";"PRODUITS";"true";"";"";"";"";"true";"false";"COMPTE DE RESULTAT"
+"FNST";"ACTIF IMMOBILISÉ";"true";" ";" ";" ";" ";"true";"false";"BILAN ACTIF"
+"FNST";"ACTIF CIRCULANT";"true";"";"";"";"";"true";"false";"BILAN ACTIF"
+"FNST";"Stocks et en-cours";"true";"";"";"";"";"false";"true";"ACTIF CIRCULANT"
+"FNST";"Marchandises";"false";"37";"";"";"397";"false";"false";"Stocks et en-cours"
+"FNST";"Immobilisations incorporelles";"true";"";"";"";"";"false";"false";"ACTIF IMMOBILISÉ"
+"FNST";"Fonds commercial";"false";"206, 207";"";"";"";"false";"false";"Immobilisations incorporelles"
+"FNST";"Autres";"false";"201, 208";"";"";"280, 290";"false";"false";"Immobilisations incorporelles"
+"FNST";"Autres";"false";"31, 32, 33, 34, 35";"";"";"391, 393, 394, 395";"false";"false";"Stocks et en-cours"
+"FNST";"Avances et acomptes versés sur commandes";"false";"409";"";"";"";"false";"false";"ACTIF CIRCULANT"
+"FNST";"Créances";"true";"";"";"";"";"false";"false";"ACTIF CIRCULANT"
+"FNST";"Charges constatées d'avance";"false";"486";"";"";"";"false";"false";"BILAN ACTIF"
+"FNST";"Ecart de réévaluation";"false";"105";"";"";"";"false";"false";"CAPITAUX PROPRES"
+"FNST";"Réserves";"true";"";"";"";"";"false";"false";"CAPITAUX PROPRES"
+"FNST";"Réserve légale";"false";"1061";"";"";"";"false";"false";"Réserves"
+"FNST";"Réserves réglementées";"false";"1064";"";"";"";"false";"false";"Réserves"
+"FNST";"Report à nouveau";"false";"110";"";"";"";"false";"false";"CAPITAUX PROPRES"
+"FNST";"RÉSULTAT DE L'EXERCICE (BÉNÉFICE OU PERTE)";"false";"7-6";"";"";"";"false";"false";"CAPITAUX PROPRES"
+"FNST";"Provisions réglementées";"false";"145, 146, 147, 148";"";"";"";"false";"false";"CAPITAUX PROPRES"
+"FNST";"Provisions pour risques et charges";"false";"15";"";"";"";"false";"false";"BILAN PASSIF"
+"FNST";"DETTES";"true";"";"";"";"";"true";"false";"BILAN PASSIF"
+"FNST";"Emprunts et dettes assimilées";"false";"16";"";"";"";"false";"false";"DETTES"
+"FNST";"Avances et acomptes reçues sur commandes en cours";"false";"419";"";"";"";"false";"false";"DETTES"
+"FNST";"Immobilisations corporelles";"false";"21, 23";"";"";"281, 291";"false";"false";"ACTIF IMMOBILISÉ"
+"FNST";"Immobilisations financières";"false";"27";"";"";"297";"false";"false";"ACTIF IMMOBILISÉ"
+"FNST";"Clients et comptes rattachés";"false";"410";"";"";"491";"false";"false";"Créances"
+"FNST";"Valeurs mobilières de placement";"false";"50";"";"";"590";"false";"false";"ACTIF CIRCULANT"
+"FNST";"Disponibilités (autres que caisse)";"false";"54, 58";"51";"";"";"false";"false";"ACTIF CIRCULANT"
+"FNST";"Caisse";"false";"53";"";"";"";"false";"false";"ACTIF CIRCULANT"
+"FNST";"Fournisseurs et comptes rattachés";"false";"400";"";"";"";"false";"false";"DETTES"
+"FNST";"Produits constatés d'avance";"false";"487";"";"";"";"false";"false";"BILAN PASSIF"
+"FNST";"Charges exceptionnelles";"false";"67, 687, 691";"";"";"";"false";"false";"CHARGES"
+"FNST";"Impôts sur les bénéfices";"false";"695, 697";"";"";"";"false";"false";"CHARGES"
+"FNST";"PRODUITS D'EXPLOITATION ET FINANCIERS";"true";"";"";"";"";"true";"false";"PRODUITS"
+"FNST";"Produits d'exploitation";"true";"";"";"";"";"false";"false";"PRODUITS D'EXPLOITATION ET FINANCIERS"
+"FNST";"Produits financiers";"false";"76, 786, 79";"";"";"";"false";"false";"PRODUITS D'EXPLOITATION ET FINANCIERS"
+"FNST";"Ventes de marchandises";"false";"707, 709";"";"";"";"false";"false";"Produits d'exploitation"
+"FNST";"Production vendue (bien et services)";"false";"701, 706, 708, 709";"";"";"";"false";"false";"Produits d'exploitation"
+"FNST";"Production stockée";"false";"713";"";"";"";"false";"false";"Produits d'exploitation"
+"FNST";"Production immobilisée";"false";"72";"";"";"";"false";"false";"Produits d'exploitation"
+"FNST";"Subventions d'exploitation";"false";"74";"";"";"";"false";"false";"Produits d'exploitation"
+"FNST";"Autres produits";"false";"75, 781, 79";"";"";"";"false";"false";"Produits d'exploitation"
+"FNST";"Produits exceptionnels";"false";"77, 787, 79";"";"";"";"false";"false";"PRODUITS"
+"FNST";"Charges d'exploitation";"true";"";"";"";"";"true";"false";"CHARGES D'EXPLOITATION ET FINANCIERES"
+"FNST";"Coût d'achat des marchandises";"true";"";"";"";"";"false";"true";"Charges d'exploitation"
+"FNST";"Variations de stocks de march.";"false";"6037";"";"";"";"false";"false";"Coût d'achat des marchandises"
+"FNST";"Achat de marchandises";"false";"607";"";"";"";"false";"false";"Coût d'achat des marchandises"
+"FNST";"Coût d'achats des approvisionnements";"true";"";"";"";"";"false";"false";"Charges d'exploitation"
+"FNST";"Achats d'approvisionnements";"false";"60 -607";"";"";"";"false";"false";"Coût d'achats des approvisionnements"
+"FNST";"Variation des stock (approvisionnements)";"false";"6031, 6032";"";"";"";"false";"false";"Coût d'achats des approvisionnements"
+"FNST";"Autres charges externes";"false";"61, 62";"";"";"";"false";"false";"Charges d'exploitation"
+"FNST";"Impôts, taxes et versements assimilés";"false";"63";"";"";"";"false";"false";"Charges d'exploitation"
+"FNST";"Rémunération du personnel";"false";"641, 644";"";"";"";"false";"false";"Charges d'exploitation"
+"FNST";"Charges sociales";"false";"645, 646";"";"";"";"false";"false";"Charges d'exploitation"
+"FNST";"Dotations aux amortissements";"false";"6811";"";"";"";"false";"false";"Charges d'exploitation"
+"FNST";"Dotations aux provisions";"false";"6815, 6816, 6817";"";"";"";"false";"false";"Charges d'exploitation"
+"FNST";"Autres charges";"false";"65";"";"";"";"false";"false";"Charges d'exploitation"
+"FNST";"Charges financières";"false";"66, 686";"";"";"";"false";"false";"CHARGES D'EXPLOITATION ET FINANCIERES"
+"FNST";"Autres";"false";"1063, 1068";"";"";"";"false";"false";"Réserves"
+"FNST";"Autres";"false";"409, 428, 46";"43, 444, 445, 455";"";"496";"false";"false";"Créances"
+"FNST";"Autres";"false";"419, 421, 428, 447, 46";"";"43, 444, 445, 455";"";"false";"false";"DETTES"
Modified: trunk/lima-swing/src/main/resources/import/pcg_shortened.csv
===================================================================
--- trunk/lima-swing/src/main/resources/import/pcg_shortened.csv 2010-07-29 12:51:43 UTC (rev 2989)
+++ trunk/lima-swing/src/main/resources/import/pcg_shortened.csv 2010-08-02 08:19:54 UTC (rev 2990)
@@ -1,266 +1,250 @@
-"ACCN";"1";"COMPTES DE CAPITAUX";;"";""
-"ACCN";"10";"CAPITAL ET RESERVE";;"1";""
-"ACCN";"101";"Capital";;"10";""
-"ACCN";"105";"Ecarts de réévaluation";;"10";""
-"ACCN";"106";"Réserves";;"10";""
-"ACCN";"1061";"Réserve légale";;"106";""
-"ACCN";"1063";"Réserves statutaires ou contractuelles";;"106";""
-"ACCN";"1064";"Réserves réglementées";;"106";""
-"ACCN";"1068";"Autres réserves";;"106";""
-"ACCN";"108";"Compte de l'exploitant";;"10";""
-"ACCN";"11";"REPORT A NOUVEAU (solde créditeur ou débiteur)";;"1";""
-"ACCN";"110";"Report à nouveau (solde créditeur)";;"11";""
-"ACCN";"119";"Report à nouveau (solde débiteur)";;"11";""
-"ACCN";"12";"RESULTAT DE L'EXERCICE (bénéfice ou perte)";;"1";""
-"ACCN";"120";"Résultat de l'exercice (bénéfice)";;"12";""
-"ACCN";"129";"Résultat de l'exercice (perte)";;"12";""
-"ACCN";"14";"PROVISIONS REGLEMENTEES";;"1";""
-"ACCN";"145";"Amortissements dérogatoires";;"14";""
-"ACCN";"146";"Provision spéciale de réévaluation";;"14";""
-"ACCN";"147";"Plus-values réinvesties";;"14";""
-"ACCN";"148";"Autres provisions réglementées";;"14";""
-"ACCN";"15";"PROVlSlONS POUR RISQUES ET CHARGES";;"1";""
-"ACCN";"151";"Provisions pour risques";;"15";""
-"ACCN";"155";"Provisions pour impôts";;"15";""
-"ACCN";"158";"Autres provisions pour charges";;"15";""
-"ACCN";"16";"EMPRUNTS ET DETTES ASSIMILEES";;"1";""
-"ACCN";"163";"Autres emprunts obligataires";;"16";""
-"ACCN";"164";"Emprunts auprès des établissements de crédit";;"16";""
-"ACCN";"168";"Autres emprunts et dettes assimilées";;"16";""
-"ACCN";"2";"COMPTES D'IMMOBILISATIONS";;"";""
-"ACCN";"20";"IMMOBILISATIONS INCORPORELLES";;"2";""
-"ACCN";"201";"Frais détablissement";;"20";""
-"ACCN";"206";"Droit au bail";;"20";""
-"ACCN";"207";"Fonds commercial";;"20";""
-"ACCN";"208";"Autres immobilisations incorporelles";;"20";""
-"ACCN";"21";"IMMOBlLlSATIONS CORPORELLES";;"2";""
-"ACCN";"211";"Terrains";;"21";""
-"ACCN";"213";"Constructions";;"21";""
-"ACCN";"215";"Installations techniques; matériel et outillage industriels";;"21";""
-"ACCN";"218";"Autres immobilisations corporelles";;"21";""
-"ACCN";"23";"IMMOBILlSATlONS EN COURS";;"2";""
-"ACCN";"231";"Immobilisations corporelles en cours";;"23";""
-"ACCN";"232";"Immobilisations incorporelles en cours";;"23";""
-"ACCN";"27";"AUTRES IMMOBILISATIONS FINANCIERES";;"2";""
-"ACCN";"274";"Prêts";;"27";""
-"ACCN";"275";"Dépôts et cautionnements versés";;"27";""
-"ACCN";"28";"AMORTISSEMENTS DES IMMOBILISATIONS";;"2";""
-"ACCN";"280";"Amortissements des immobilisations incorporelles";;"28";""
-"ACCN";"281";"Amortissements des immobilisations corporelles";;"28";""
-"ACCN";"290";"Provisions pour dépréciation immobilisations incorporelles";;"29";""
-"ACCN";"291";"Provisions pour dépréciation immobilisations corporelles";;"29";""
-"ACCN";"29";"PROVISIONS POUR DEPRECIATION DES IMMOBILISATIONS";;"2";""
-"ACCN";"297";"Provisions pour dépréciation des immobilisations financières";;"29";""
-"ACCN";"3";"COMPTES DE STOCKS ET D'EN-COURS";;"";""
-"ACCN";"31";"MATIERES PREMIERES (et fournitures)";;"3";""
-"ACCN";"310";"Stocks dapprovisionnement";;"31";""
-"ACCN";"32";"AUTRES APPROVISIONNEMENTS";;"3";""
-"ACCN";"321";"Matières consommables";;"32";""
-"ACCN";"322";"Fournitures consommables";;"32";""
-"ACCN";"326";"Emballages";;"32";""
-"ACCN";"35";"STOCKS DE PRODUITS";;"3";""
-"ACCN";"351";"Produits intermédiaires";;"35";""
-"ACCN";"355";"Produits finis";;"35";""
-"ACCN";"358";"Produits résiduels (ou matières de récupérations)";;"35";""
-"ACCN";"37";"STOCKS DE MARCHANDISES";;"3";""
-"ACCN";"370";"Stocks de marchandises";;"37";""
-"ACCN";"39";"PROVISIONS POUR DEPRECIATION DES STOCKS ET EN-COURS";;"3";""
-"ACCN";"391";"Provisions pour dépréciation des stocks dapprovisionnement";;"39";""
-"ACCN";"395";"Provisions pour dépréciation des stocks de produits";;"39";""
-"ACCN";"397";"Provisions pour dépréciation des stocks de marchandises";;"39";""
-"ACCN";"4";"COMPTES DE TIERS";;"";""
-"ACCN";"40";"FOURNISSEURS ET COMPTES RATTACHES";;"4";""
-"ACCN";"400";"Fournisseurs et comptes rattachés";;"40";""
-"ACCN";"401";"Fournisseurs";;"40";""
-"ACCN";"403";"Fournisseurs - Effets à payer";;"40";""
-"ACCN";"404";"Fournisseurs d'immobilisations";;"40";""
-"ACCN";"408";"Fournisseurs - Factures non parvenues";;"40";""
-"ACCN";"409";"Fournisseurs débiteurs";;"40";""
-"ACCN";"41";"CLIENTS ET COMPTES RATTACHES";;"4";""
-"ACCN";"410";"Clients et comptes rattachés";;"41";""
-"ACCN";"411";"Clients";;"41";""
-"ACCN";"413";"Clients - Effets a recevoir";;"41";""
-"ACCN";"416";"Clients douteux ou litigieux";;"41";""
-"ACCN";"418";"Clients - Produits non encore facturés";;"41";""
-"ACCN";"419";"Clients créditeurs";;"41";""
-"ACCN";"42";"PERSONNEL ET COMPTES RATTACHES";;"4";""
-"ACCN";"421";"Personnel - Rémunérations dues";;"42";""
-"ACCN";"428";"Personnel - Charges à payer et produits à recevoir";;"42";""
-"ACCN";"43";"SECURITE SOCIALE - AUTRES ORGANISMES SOCIAUX";;"4";""
-"ACCN";"431";"Sécurité sociale";;"43";""
-"ACCN";"437";"Autres organismes sociaux";;"43";""
-"ACCN";"438";"Organismes sociaux - Charges à payer et produits à recevoir";;"43";""
-"ACCN";"44";"ETAT ET AUTRES COLLECTIVITES PUBLIQUES";;"4";""
-"ACCN";"444";"Etat - Impôts sur les bénéfices";;"44";""
-"ACCN";"445";"Etat - Taxes sur le chiffre d'affaires";;"44";""
-"ACCN";"4452";"TVA due intracommunautaire";;"445";""
-"ACCN";"4455";"Taxes sur le chiffre d'affaires à décaisser";;"445";""
-"ACCN";"44551";"TVA à décaisser";;"4455";""
-"ACCN";"4456";"Taxes sur le chiffre d'affaires déductible";;"445";""
-"ACCN";"44562";"TVA sur immobilisations";;"4456";""
-"ACCN";"44566";"TVA sur autres biens et services";;"4456";""
-"ACCN";"44567";"Crédit de TVA à reporter";;"4456";""
-"ACCN";"445661";"TVA sur autres biens et services 19;6% débits";;"44566";""
-"ACCN";"445662";"TVA sur autres biens et services 5;5% débits";;"44566";""
-"ACCN";"445664";"TVA sur autres biens et services 19;6% encaissements";;"44566";""
-"ACCN";"445665";"TVA sur autres biens et services 5;5% encaissements";;"44566";""
-"ACCN";"4457";"Taxes sur le chiffre d'affaires collectées par l'entreprise";;"445";""
-"ACCN";"44571";"TVA collectée";;"4457";""
-"ACCN";"445711";"TVA collectée 19;6 % débits";;"44571";""
-"ACCN";"445712";"TVA collectée 5;5 % débits";;"44571";""
-"ACCN";"445714";"TVA collectée 19;6 % encaissements";;"44571";""
-"ACCN";"445715";"TVA collectée 5;5 % encaissements";;"44571";""
-"ACCN";"4458";"Taxes sur le chiffre d'affaires à régulariser ou en attente";;"445";""
-"ACCN";"44583";"Remboursement de taxes sur le chiffre d'affaires demandé";;"4458";""
-"ACCN";"44584";"TVA récupérée d'avance";;"4458";""
-"ACCN";"44586";"Taxes sur le chiffre d'affaires sur factures non parvenues";;"4458";""
-"ACCN";"44587";"Taxes sur le chiffre d'affaires sur factures à établir";;"4458";""
-"ACCN";"446";"Obligations cautionnées";;"44";""
-"ACCN";"447";"Autres impôts; taxes et versements assimilés";;"44";""
-"ACCN";"45";"GROUPES ET ASSOCIES";;"4";""
-"ACCN";"455";"Associés - Comptes courants";;"45";""
-"ACCN";"46";"DEBITEURS ET CREDITEURS DIVERS";;"4";""
-"ACCN";"462";"Créances sur cessions d'immobilisations";;"46";""
-"ACCN";"468";"Divers - Charges à payer et Produits à recevoir";;"46";""
-"ACCN";"4686";"Charges à payer";;"468";""
-"ACCN";"4687";"Produits à recevoir";;"468";""
-"ACCN";"47";"COMPTES TRANSITOIRES OU D'ATTENTE";;"4";""
-"ACCN";"470";"Compte d'attente";;"47";""
-"ACCN";"48";"COMPTE DE REGULARISATION";;"4";""
-"ACCN";"481";"Charges à repartir sur plusieurs exercices";;"48";""
-"ACCN";"486";"Charges constatées d'avance";;"48";""
-"ACCN";"487";"Produits constatés d'avance";;"48";""
-"ACCN";"49";"PROVISIONS POUR DEPRECIATION DES COMPTES DE TIERS";;"4";""
-"ACCN";"491";"Provisions pour dépréciation des comptes de clients";;"49";""
-"ACCN";"496";"Provisions pour dépréciation des comptes de débiteurs divers";;"49";""
-"ACCN";"5";"COMPTES FINANCIERS";;"";""
-"ACCN";"50";"VALEURS MOBILIERES DE PLACEMENT";;"5";""
-"ACCN";"503";"Actions";;"50";""
-"ACCN";"506";"Obligations";;"50";""
-"ACCN";"51";"BANQUES; ETABLISSEMENTS FINANCIERS ET ASSIMILES";;"5";""
-"ACCN";"511";"Valeurs à l'encaissement";;"51";""
-"ACCN";"5111";"Espèces";;"511";""
-"ACCN";"5112";"Chèques";;"511";""
-"ACCN";"5113";"Cartes bancaires";;"511";""
-"ACCN";"5114";"Autres paiements";;"511";""
-"ACCN";"512";"Banques";;"51";""
-"ACCN";"5121";"Banque principale";;"512";""
-"ACCN";"5122";"Banque secondaire";;"512";""
-"ACCN";"514";"Chèques postaux";;"51";""
-"ACCN";"517";"Autres organismes financiers";;"51";""
-"ACCN";"518";"Intérêts courus";;"51";""
-"ACCN";"53";"CAISSE";;"5";""
-"ACCN";"530";"Caisse";;"53";""
-"ACCN";"54";"REGIES D'AVANCES ET ACCREDITIFS";;"5";""
-"ACCN";"540";"Régies davances et accréditifs";;"54";""
-"ACCN";"58";"VIREMENTS INTERNES";;"5";""
-"ACCN";"580";"Virements internes";;"58";""
-"ACCN";"59";"PROVISIONS POUR DEPRECIATION DES COMPTES FINANCIERS";;"5";""
-"ACCN";"590";"Provisions pour dépréciation des valeurs mobilières de placement";;"59";""
-"ACCN";"6";"COMPTES DE CHARGES";;"";""
-"ACCN";"60";"ACHATS (sauf 603)";;"6";""
-"ACCN";"601";"Achats stockés - Matières premières (et fournitures)";;"60";""
-"ACCN";"6022";"Fournitures consommables";;"60";""
-"ACCN";"6026";"Emballages";;"60";""
-"ACCN";"603";"Variation des stocks (approvisionnements et marchandises)";;"60";""
-"ACCN";"606";"Achats non stockés de matières et fournitures";;"60";""
-"ACCN";"607";"Achats de marchandises";;"60";""
-"ACCN";"608";"Frais accessoires d'achat";;"60";""
-"ACCN";"609";"Rabais; remises et ristournes obtenus sur achats";;"60";""
-"ACCN";"61";"SERVICES EXTERIEURS";;"6";""
-"ACCN";"611";"Sous-traitance générale";;"61";""
-"ACCN";"612";"Redevances de crédit-bail";;"61";""
-"ACCN";"613";"Locations";;"61";""
-"ACCN";"614";"Charges locatives et de copropriété";;"61";""
-"ACCN";"615";"Entretien et réparations";;"61";""
-"ACCN";"616";"Primes d'assurance";;"61";""
-"ACCN";"62";"AUTRES SERVICES EXTERIEURS";;"6";""
-"ACCN";"621";"Personnel extérieur à l'entreprise";;"62";""
-"ACCN";"622";"Rémunérations dintermédiaires et honoraires";;"62";""
-"ACCN";"623";"Publicité; publications; relations publiques";;"62";""
-"ACCN";"624";"Transports de biens et transports collectifs du personnel";;"62";""
-"ACCN";"625";"Déplacements; missions et réceptions";;"62";""
-"ACCN";"626";"Frais postaux et frais de télécommunications";;"62";""
-"ACCN";"627";"Services bancaires et assimiles";;"62";""
-"ACCN";"63";"IMPOTS; TAXES ET VERSEMENTS";;"6";""
-"ACCN";"633";"Impôts; taxes et versements sur rémunérations (autres org.)";;"63";""
-"ACCN";"635";"Autres impôts; taxes et versements (administration)";;"63";""
-"ACCN";"6371";"Contribution sociale de solidarité à la charge des sociétés";;"63";""
-"ACCN";"64";"CHARGES DE PERSONNEL";;"6";""
-"ACCN";"641";"Rémunérations du personnel";;"64";""
-"ACCN";"6411";"Salaires";;"641";""
-"ACCN";"6412";"Congés payes";;"641";""
-"ACCN";"6413";"Primes et gratifications";;"641";""
-"ACCN";"6414";"Indemnités et avantages divers";;"641";""
-"ACCN";"644";"Rémunération du travail de l'exploitant";;"64";""
-"ACCN";"645";"Charges de sécurité sociale et de prévoyance";;"64";""
-"ACCN";"6451";"Cotisations à l'URSSAF";;"645";""
-"ACCN";"6452";"Cotisations aux mutuelles";;"645";""
-"ACCN";"6453";"Cotisations aux caisses de retraites";;"645";""
-"ACCN";"6454";"Cotisations aux ASSEDIC";;"645";""
-"ACCN";"646";"Cotisations sociales personnelles de l'exploitant";;"64";""
-"ACCN";"65";"AUTRES CHARGES DE GESTION COURANTE";;"6";""
-"ACCN";"651";"Redevances pour concessions; brevets; licences; etc.";;"65";""
-"ACCN";"654";"Pertes sur créances irrécouvrables";;"65";""
-"ACCN";"655";"Quote-part de résultat sur opérations faites en commun";;"65";""
-"ACCN";"658";"Autres charges de gestion courante";;"65";""
-"ACCN";"66";"CHARGES FINANCIERES";;"6";""
-"ACCN";"661";"Charges dintérêt";;"66";""
-"ACCN";"665";"Escomptes accordés";;"66";""
-"ACCN";"6688";"Pertes de change ou de conversion";;"66";""
-"ACCN";"67";"CHARGES EXCEPTIONNELLES";;"6";""
-"ACCN";"670";"Charges exceptionnelles";;"67";""
-"ACCN";"675";"Valeurs comptables des éléments d'actif cédés";;"67";""
-"ACCN";"68";"DOTATIONS AUX AMORTISSEMENTS ET AUX PROVISIONS";;"6";""
-"ACCN";"681";"Dotations aux amortissements - Charges d'exploitation";;"68";""
-"ACCN";"68111";"Dotations aux amort. immobilisations incorporelles";;"681";""
-"ACCN";"68112";"Dotations aux amort. immobilisations corporelles";;"681";""
-"ACCN";"68161";"Dotations provisions dépréc. immos incorporelles";;"681";""
-"ACCN";"68162";"Dotations provisions dépréc. immos corporelles";;"681";""
-"ACCN";"686";"Dotations aux amort. et provisions - Charges financières";;"68";""
-"ACCN";"687";"Dotations aux amort. et provisions - Charges exceptionnelles";;"68";""
-"ACCN";"68725";"Dotations provisions réglementées - Amort. dérogatoires";;"687";""
-"ACCN";"69";"PARTICIPATION DES SALARIES - IMPOTS SUR LES BENEFICES";;"6";""
-"ACCN";"691";"Participation des salaries aux résultats de lentreprise";;"69";""
-"ACCN";"695";"Impôts sur les bénéfices";;"69";""
-"ACCN";"697";"Imposition forfaitaire annuelle des sociétés";;"69";""
-"ACCN";"698";"Contribution additionnelle";;"69";""
-"ACCN";"699";"Produits - Reports en arrière des déficits";;"69";""
-"ACCN";"7";"COMPTES DE PRODUITS";;"";""
-"ACCN";"70";"VENTES DE PRODUITS; PRESTATIONS DE SERVICES; MARCHANDISES";;"7";""
-"ACCN";"701";"Ventes de produits finis";;"70";""
-"ACCN";"706";"Travaux et prestations de services";;"70";""
-"ACCN";"707";"Ventes de marchandises";;"70";""
-"ACCN";"708";"Produits des activités annexes";;"70";""
-"ACCN";"709";"Rabais; remises et ristournes accordées par l'entreprise";;"70";""
-"ACCN";"71";"PRODUCTION STOCKEE (ou déstockage)";;"7";""
-"ACCN";"713";"VARIATION DES STOCKS (en-cours de production; produits)";;"71";""
-"ACCN";"7133";"Variation des en-cours de production de biens";;"713";""
-"ACCN";"7134";"Variation des en-cours de production de services";;"713";""
-"ACCN";"7135";"Variation des stocks de produits";;"713";""
-"ACCN";"72";"PRODUCTION IMMOBILISEE";;"7";""
-"ACCN";"721";"Immobilisations incorporelles";;"72";""
-"ACCN";"722";"Immobilisations corporelles";;"72";""
-"ACCN";"74";"SUBVENTlONS D'EXPLOITATION";;"7";""
-"ACCN";"740";"Subventions dexploitation";;"74";""
-"ACCN";"75";"AUTRES PRODUITS DE GESTION COURANTE";;"7";""
-"ACCN";"758";"Produits divers de gestion courante";;"75";""
-"ACCN";"76";"PRODUITS FINANCIERS";;"7";""
-"ACCN";"765";"Escomptes obtenus";;"76";""
-"ACCN";"77";"PRODUITS EXCEPTIONNELS";;"7";""
-"ACCN";"770";"Produits exceptionnels";;"77";""
-"ACCN";"775";"Produits des cessions d'éléments d'actif";;"77";""
-"ACCN";"78161";"Reprises prov. dépréc. immos incorporelles";;"781";""
-"ACCN";"78";"REPRISES SUR AMORTISSEMENTS ET PROVISIONS";;"7";""
-"ACCN";"781";"Reprises sur amortissements et provisions";;"78";""
-"ACCN";"78162";"Reprises prov. dépréc. immos corporelles";;"781";""
-"ACCN";"786";"Reprises sur provisions pour risques";;"78";""
-"ACCN";"787";"Reprises sur provisions";;"78";""
-"ACCN";"78725";"Reprises sur provisions - Amort. dérogatoires";;"787";""
-"ACCN";"791";"Transfert de charges d'exploitation";;"79";""
-"ACCN";"79";"TRANSFERTS DE CHARGES";;"7";""
-"ACCN";"796";"Transfert de charges financières";;"79";""
-"ACCN";"8";"COMPTES SPECIAUX";;"";""
-"ACCN";"80";"ENGAGEMENTS";;"8";""
-"ACCN";"88";"RESULTAT EN INSTANCE DAFFECTATION";;"8";""
-"ACCN";"89";"BILAN";;"8";""
\ No newline at end of file
+"ACCN";"101";"Capital";"";"10";""
+"ACCN";"105";"Ecarts de réévaluation";"";"10";""
+"ACCN";"1061";"Réserve légale";"";"106";""
+"ACCN";"1063";"Réserves statutaires ou contractuelles";"";"106";""
+"ACCN";"1064";"Réserves réglementées";"";"106";""
+"ACCN";"106";"Réserves";"";"10";""
+"ACCN";"1068";"Autres réserves";"";"106";""
+"ACCN";"10";"CAPITAL ET RESERVE";"";"1";""
+"ACCN";"108";"Compte de l'exploitant";"";"10";""
+"ACCN";"110";"Report à nouveau (solde créditeur)";"";"11";""
+"ACCN";"11";"REPORT A NOUVEAU (solde créditeur ou débiteur)";"";"1";""
+"ACCN";"119";"Report à nouveau (solde débiteur)";"";"11";""
+"ACCN";"120";"Résultat de l'exercice (bénéfice)";"";"12";""
+"ACCN";"12";"RESULTAT DE L'EXERCICE (bénéfice ou perte)";"";"1";""
+"ACCN";"129";"Résultat de l'exercice (perte)";"";"12";""
+"ACCN";"145";"Amortissements dérogatoires";"";"14";""
+"ACCN";"146";"Provision spéciale de réévaluation";"";"14";""
+"ACCN";"147";"Plus-values réinvesties";"";"14";""
+"ACCN";"14";"PROVISIONS REGLEMENTEES";"";"1";""
+"ACCN";"148";"Autres provisions réglementées";"";"14";""
+"ACCN";"151";"Provisions pour risques";"";"15";""
+"ACCN";"155";"Provisions pour impôts";"";"15";""
+"ACCN";"15";"PROVlSlONS POUR RISQUES ET CHARGES";"";"1";""
+"ACCN";"158";"Autres provisions pour charges";"";"15";""
+"ACCN";"1";"COMPTES DE CAPITAUX";"";"";""
+"ACCN";"163";"Autres emprunts obligataires";"";"16";""
+"ACCN";"164";"Emprunts auprès des établissements de crédit";"";"16";""
+"ACCN";"16";"EMPRUNTS ET DETTES ASSIMILEES";"";"1";""
+"ACCN";"168";"Autres emprunts et dettes assimilées";"";"16";""
+"ACCN";"201";"Frais détablissement";"";"20";""
+"ACCN";"206";"Droit au bail";"";"20";""
+"ACCN";"207";"Fonds commercial";"";"20";""
+"ACCN";"20";"IMMOBILISATIONS INCORPORELLES";"";"2";""
+"ACCN";"208";"Autres immobilisations incorporelles";"";"20";""
+"ACCN";"211";"Terrains";"";"21";""
+"ACCN";"213";"Constructions";"";"21";""
+"ACCN";"215";"Installations techniques; matériel et outillage industriels";"";"21";""
+"ACCN";"21";"IMMOBlLlSATIONS CORPORELLES";"";"2";""
+"ACCN";"218";"Autres immobilisations corporelles";"";"21";""
+"ACCN";"231";"Immobilisations corporelles en cours";"";"23";""
+"ACCN";"23";"IMMOBILlSATlONS EN COURS";"";"2";""
+"ACCN";"232";"Immobilisations incorporelles en cours";"";"23";""
+"ACCN";"274";"Prêts";"";"27";""
+"ACCN";"27";"AUTRES IMMOBILISATIONS FINANCIERES";"";"2";""
+"ACCN";"275";"Dépôts et cautionnements versés";"";"27";""
+"ACCN";"280";"Amortissements des immobilisations incorporelles";"";"28";""
+"ACCN";"28";"AMORTISSEMENTS DES IMMOBILISATIONS";"";"2";""
+"ACCN";"281";"Amortissements des immobilisations corporelles";"";"28";""
+"ACCN";"2";"COMPTES D'IMMOBILISATIONS";"";"";""
+"ACCN";"290";"Provisions pour dépréciation immobilisations incorporelles";"";"29";""
+"ACCN";"291";"Provisions pour dépréciation immobilisations corporelles";"";"29";""
+"ACCN";"29";"PROVISIONS POUR DEPRECIATION DES IMMOBILISATIONS";"";"2";""
+"ACCN";"297";"Provisions pour dépréciation des immobilisations financières";"";"29";""
+"ACCN";"31";"MATIERES PREMIERES (et fournitures)";"";"3";""
+"ACCN";"310";"Stocks dapprovisionnement";"";"31";""
+"ACCN";"321";"Matières consommables";"";"32";""
+"ACCN";"322";"Fournitures consommables";"";"32";""
+"ACCN";"32";"AUTRES APPROVISIONNEMENTS";"";"3";""
+"ACCN";"326";"Emballages";"";"32";""
+"ACCN";"351";"Produits intermédiaires";"";"35";""
+"ACCN";"355";"Produits finis";"";"35";""
+"ACCN";"35";"STOCKS DE PRODUITS";"";"3";""
+"ACCN";"358";"Produits résiduels (ou matières de récupérations)";"";"35";""
+"ACCN";"37";"STOCKS DE MARCHANDISES";"";"3";""
+"ACCN";"370";"Stocks de marchandises";"";"37";""
+"ACCN";"3";"COMPTES DE STOCKS ET D'EN-COURS";"";"";""
+"ACCN";"391";"Provisions pour dépréciation des stocks dapprovisionnement";"";"39";""
+"ACCN";"395";"Provisions pour dépréciation des stocks de produits";"";"39";""
+"ACCN";"39";"PROVISIONS POUR DEPRECIATION DES STOCKS ET EN-COURS";"";"3";""
+"ACCN";"397";"Provisions pour dépréciation des stocks de marchandises";"";"39";""
+"ACCN";"400";"Fournisseurs et comptes rattachés";"";"40";""
+"ACCN";"40";"FOURNISSEURS ET COMPTES RATTACHES";"";"4";""
+"ACCN";"409";"Fournisseurs débiteurs";"";"40";""
+"ACCN";"410";"Clients et comptes rattachés";"";"41";""
+"ACCN";"418";"Clients - Produits non encore facturés";"";"41";""
+"ACCN";"41";"CLIENTS ET COMPTES RATTACHES";"";"4";""
+"ACCN";"421";"Personnel - Rémunérations dues";"";"42";""
+"ACCN";"42";"PERSONNEL ET COMPTES RATTACHES";"";"4";""
+"ACCN";"428";"Personnel - Charges à payer et produits à recevoir";"";"42";""
+"ACCN";"43";"SECURITE SOCIALE - AUTRES ORGANISMES SOCIAUX";"";"4";""
+"ACCN";"444";"Etat - Impôts sur les bénéfices";"";"44";""
+"ACCN";"44";"ETAT ET AUTRES COLLECTIVITES PUBLIQUES";"";"4";""
+"ACCN";"447";"Autres impôts; taxes et versements assimilés";"";"44";""
+"ACCN";"45";"GROUPES ET ASSOCIES";"";"4";""
+"ACCN";"455";"Associés - Comptes courants";"";"45";""
+"ACCN";"46";"DEBITEURS ET CREDITEURS DIVERS";"";"4";""
+"ACCN";"47";"COMPTES TRANSITOIRES OU D'ATTENTE";"";"4";""
+"ACCN";"470";"Compte d'attente";"";"47";""
+"ACCN";"481";"Charges à repartir sur plusieurs exercices";"";"48";""
+"ACCN";"486";"Charges constatées d'avance";"";"48";""
+"ACCN";"48";"COMPTE DE REGULARISATION";"";"4";""
+"ACCN";"487";"Produits constatés d'avance";"";"48";""
+"ACCN";"4";"COMPTES DE TIERS";"";"";""
+"ACCN";"491";"Provisions pour dépréciation des comptes de clients";"";"49";""
+"ACCN";"49";"PROVISIONS POUR DEPRECIATION DES COMPTES DE TIERS";"";"4";""
+"ACCN";"496";"Provisions pour dépréciation des comptes de débiteurs divers";"";"49";""
+"ACCN";"503";"Actions";"";"50";""
+"ACCN";"50";"VALEURS MOBILIERES DE PLACEMENT";"";"5";""
+"ACCN";"506";"Obligations";"";"50";""
+"ACCN";"5111";"Espèces";"";"511";""
+"ACCN";"5112";"Chèques";"";"511";""
+"ACCN";"5113";"Cartes bancaires";"";"511";""
+"ACCN";"511";"Valeurs à l'encaissement";"";"51";""
+"ACCN";"5114";"Autres paiements";"";"511";""
+"ACCN";"5121";"Banque principale";"";"512";""
+"ACCN";"512";"Banques";"";"51";""
+"ACCN";"5122";"Banque secondaire";"";"512";""
+"ACCN";"514";"Chèques postaux";"";"51";""
+"ACCN";"517";"Autres organismes financiers";"";"51";""
+"ACCN";"51";"BANQUES; ETABLISSEMENTS FINANCIERS ET ASSIMILES";"";"5";""
+"ACCN";"518";"Intérêts courus";"";"51";""
+"ACCN";"53";"CAISSE";"";"5";""
+"ACCN";"530";"Caisse";"";"53";""
+"ACCN";"54";"REGIES D'AVANCES ET ACCREDITIFS";"";"5";""
+"ACCN";"540";"Régies davances et accréditifs";"";"54";""
+"ACCN";"58";"VIREMENTS INTERNES";"";"5";""
+"ACCN";"580";"Virements internes";"";"58";""
+"ACCN";"5";"COMPTES FINANCIERS";"";"";""
+"ACCN";"59";"PROVISIONS POUR DEPRECIATION DES COMPTES FINANCIERS";"";"5";""
+"ACCN";"590";"Provisions pour dépréciation des valeurs mobilières de placement";"";"59";""
+"ACCN";"601";"Achats stockés - Matières premières (et fournitures)";"";"60";""
+"ACCN";"6022";"Fournitures consommables";"";"60";""
+"ACCN";"6026";"Emballages";"";"60";""
+"ACCN";"606";"Achats non stockés de matières et fournitures";"";"60";""
+"ACCN";"607";"Achats de marchandises";"";"60";""
+"ACCN";"608";"Frais accessoires d'achat";"";"60";""
+"ACCN";"60";"ACHATS (sauf 603)";"";"6";""
+"ACCN";"609";"Rabais; remises et ristournes obtenus sur achats";"";"60";""
+"ACCN";"611";"Sous-traitance générale";"";"61";""
+"ACCN";"612";"Redevances de crédit-bail";"";"61";""
+"ACCN";"613";"Locations";"";"61";""
+"ACCN";"614";"Charges locatives et de copropriété";"";"61";""
+"ACCN";"615";"Entretien et réparations";"";"61";""
+"ACCN";"61";"SERVICES EXTERIEURS";"";"6";""
+"ACCN";"616";"Primes d'assurance";"";"61";""
+"ACCN";"621";"Personnel extérieur à l'entreprise";"";"62";""
+"ACCN";"622";"Rémunérations dintermédiaires et honoraires";"";"62";""
+"ACCN";"623";"Publicité; publications; relations publiques";"";"62";""
+"ACCN";"624";"Transports de biens et transports collectifs du personnel";"";"62";""
+"ACCN";"625";"Déplacements; missions et réceptions";"";"62";""
+"ACCN";"626";"Frais postaux et frais de télécommunications";"";"62";""
+"ACCN";"62";"AUTRES SERVICES EXTERIEURS";"";"6";""
+"ACCN";"627";"Services bancaires et assimiles";"";"62";""
+"ACCN";"633";"Impôts; taxes et versements sur rémunérations (autres org.)";"";"63";""
+"ACCN";"635";"Autres impôts; taxes et versements (administration)";"";"63";""
+"ACCN";"63";"IMPOTS; TAXES ET VERSEMENTS";"";"6";""
+"ACCN";"6371";"Contribution sociale de solidarité à la charge des sociétés";"";"63";""
+"ACCN";"6411";"Salaires";"";"641";""
+"ACCN";"6412";"Congés payes";"";"641";""
+"ACCN";"6413";"Primes et gratifications";"";"641";""
+"ACCN";"641";"Rémunérations du personnel";"";"64";""
+"ACCN";"6414";"Indemnités et avantages divers";"";"641";""
+"ACCN";"644";"Rémunération du travail de l'exploitant";"";"64";""
+"ACCN";"6451";"Cotisations à l'URSSAF";"";"645";""
+"ACCN";"6452";"Cotisations aux mutuelles";"";"645";""
+"ACCN";"6453";"Cotisations aux caisses de retraites";"";"645";""
+"ACCN";"645";"Charges de sécurité sociale et de prévoyance";"";"64";""
+"ACCN";"6454";"Cotisations aux ASSEDIC";"";"645";""
+"ACCN";"64";"CHARGES DE PERSONNEL";"";"6";""
+"ACCN";"646";"Cotisations sociales personnelles de l'exploitant";"";"64";""
+"ACCN";"651";"Redevances pour concessions; brevets; licences; etc.";"";"65";""
+"ACCN";"654";"Pertes sur créances irrécouvrables";"";"65";""
+"ACCN";"655";"Quote-part de résultat sur opérations faites en commun";"";"65";""
+"ACCN";"65";"AUTRES CHARGES DE GESTION COURANTE";"";"6";""
+"ACCN";"658";"Autres charges de gestion courante";"";"65";""
+"ACCN";"661";"Charges dintérêt";"";"66";""
+"ACCN";"665";"Escomptes accordés";"";"66";""
+"ACCN";"66";"CHARGES FINANCIERES";"";"6";""
+"ACCN";"6688";"Pertes de change ou de conversion";"";"66";""
+"ACCN";"670";"Charges exceptionnelles";"";"67";""
+"ACCN";"67";"CHARGES EXCEPTIONNELLES";"";"6";""
+"ACCN";"675";"Valeurs comptables des éléments d'actif cédés";"";"67";""
+"ACCN";"68111";"Dotations aux amort. immobilisations incorporelles";"";"681";""
+"ACCN";"68112";"Dotations aux amort. immobilisations corporelles";"";"681";""
+"ACCN";"68161";"Dotations provisions dépréc. immos incorporelles";"";"681";""
+"ACCN";"681";"Dotations aux amortissements - Charges d'exploitation";"";"68";""
+"ACCN";"68162";"Dotations provisions dépréc. immos corporelles";"";"681";""
+"ACCN";"686";"Dotations aux amort. et provisions - Charges financières";"";"68";""
+"ACCN";"68";"DOTATIONS AUX AMORTISSEMENTS ET AUX PROVISIONS";"";"6";""
+"ACCN";"687";"Dotations aux amort. et provisions - Charges exceptionnelles";"";"68";""
+"ACCN";"68725";"Dotations provisions réglementées - Amort. dérogatoires";"";"687";""
+"ACCN";"6";"COMPTES DE CHARGES";"";"";""
+"ACCN";"691";"Participation des salaries aux résultats de lentreprise";"";"69";""
+"ACCN";"695";"Impôts sur les bénéfices";"";"69";""
+"ACCN";"697";"Imposition forfaitaire annuelle des sociétés";"";"69";""
+"ACCN";"69";"PARTICIPATION DES SALARIES - IMPOTS SUR LES BENEFICES";"";"6";""
+"ACCN";"701";"Ventes de produits finis";"";"70";""
+"ACCN";"706";"Travaux et prestations de services";"";"70";""
+"ACCN";"707";"Ventes de marchandises";"";"70";""
+"ACCN";"708";"Produits des activités annexes";"";"70";""
+"ACCN";"70";"VENTES DE PRODUITS; PRESTATIONS DE SERVICES; MARCHANDISES";"";"7";""
+"ACCN";"709";"Rabais; remises et ristournes accordées par l'entreprise";"";"70";""
+"ACCN";"71";"PRODUCTION STOCKEE (ou déstockage)";"";"7";""
+"ACCN";"7133";"Variation des en-cours de production de biens";"";"713";""
+"ACCN";"7134";"Variation des en-cours de production de services";"";"713";""
+"ACCN";"713";"VARIATION DES STOCKS (en-cours de production; produits)";"";"71";""
+"ACCN";"7135";"Variation des stocks de produits";"";"713";""
+"ACCN";"721";"Immobilisations incorporelles";"";"72";""
+"ACCN";"72";"PRODUCTION IMMOBILISEE";"";"7";""
+"ACCN";"722";"Immobilisations corporelles";"";"72";""
+"ACCN";"74";"SUBVENTlONS D'EXPLOITATION";"";"7";""
+"ACCN";"740";"Subventions dexploitation";"";"74";""
+"ACCN";"75";"AUTRES PRODUITS DE GESTION COURANTE";"";"7";""
+"ACCN";"758";"Produits divers de gestion courante";"";"75";""
+"ACCN";"76";"PRODUITS FINANCIERS";"";"7";""
+"ACCN";"765";"Escomptes obtenus";"";"76";""
+"ACCN";"770";"Produits exceptionnels";"";"77";""
+"ACCN";"77";"PRODUITS EXCEPTIONNELS";"";"7";""
+"ACCN";"775";"Produits des cessions d'éléments d'actif";"";"77";""
+"ACCN";"78161";"Reprises prov. dépréc. immos incorporelles";"";"781";""
+"ACCN";"781";"Reprises sur amortissements et provisions";"";"78";""
+"ACCN";"78162";"Reprises prov. dépréc. immos corporelles";"";"781";""
+"ACCN";"786";"Reprises sur provisions pour risques";"";"78";""
+"ACCN";"78";"REPRISES SUR AMORTISSEMENTS ET PROVISIONS";"";"7";""
+"ACCN";"787";"Reprises sur provisions";"";"78";""
+"ACCN";"78725";"Reprises sur provisions - Amort. dérogatoires";"";"787";""
+"ACCN";"7";"COMPTES DE PRODUITS";"";"";""
+"ACCN";"791";"Transfert de charges d'exploitation";"";"79";""
+"ACCN";"79";"TRANSFERTS DE CHARGES";"";"7";""
+"ACCN";"796";"Transfert de charges financières";"";"79";""
+"ACCN";"80";"ENGAGEMENTS";"";"8";""
+"ACCN";"88";"RESULTAT EN INSTANCE DAFFECTATION";"";"8";""
+"ACCN";"8";"COMPTES SPECIAUX";"";"";""
+"ACCN";"89";"BILAN";"";"8";""
+"ACCN";"6031";"Variation des stocks de matières premères (et fournitures)";;"603";""
+"ACCN";"6032";"Variation des stocks des autres approvisionnements";;"603";""
+"ACCN";"603";"Variation des stocks (approvisionnements et marchandises)";"";"60";""
+"ACCN";"4452";"TVA due intracommunautaire";"";"445";""
+"ACCN";"4455";"Taxes sur le chiffre d'affaires à décaisser";"";"445";""
+"ACCN";"44551";"TVA à décaisser";"";"4455";""
+"ACCN";"44562";"TVA sur immobilisations";"";"4456";""
+"ACCN";"445661";"TVA sur autres biens et services 19;6% débits";"";"44566";""
+"ACCN";"445662";"TVA sur autres biens et services 5;5% débits";"";"44566";""
+"ACCN";"445664";"TVA sur autres biens et services 19;6% encaissements";"";"44566";""
+"ACCN";"44566";"TVA sur autres biens et services";"";"4456";""
+"ACCN";"445665";"TVA sur autres biens et services 5;5% encaissements";"";"44566";""
+"ACCN";"4456";"Taxes sur le chiffre d'affaires déductible";"";"445";""
+"ACCN";"44567";"Crédit de TVA à reporter";"";"4456";""
+"ACCN";"4457";"Taxes sur le chiffre d'affaires collectées par l'entreprise";"";"445";""
+"ACCN";"445711";"TVA collectée 19;6 % débits";"";"44571";""
+"ACCN";"445712";"TVA collectée 5;5 % débits";"";"44571";""
+"ACCN";"445714";"TVA collectée 19;6 % encaissements";"";"44571";""
+"ACCN";"44571";"TVA collectée";"";"4457";""
+"ACCN";"445715";"TVA collectée 5;5 % encaissements";"";"44571";""
+"ACCN";"445";"Etat - Taxes sur le chiffre d'affaires";"";"44";""
+"ACCN";"44583";"Remboursement de taxes sur le chiffre d'affaires demandé";"";"4458";""
+"ACCN";"44584";"TVA récupérée d'avance";"";"4458";""
+"ACCN";"44586";"Taxes sur le chiffre d'affaires sur factures non parvenues";"";"4458";""
+"ACCN";"4458";"Taxes sur le chiffre d'affaires à régulariser ou en attente";"";"445";""
+"ACCN";"44587";"Taxes sur le chiffre d'affaires sur factures à établir";"";"4458";""
1
0
Author: jpepin
Date: 2010-07-29 14:51:43 +0200 (Thu, 29 Jul 2010)
New Revision: 2989
Url: http://chorem.org/repositories/revision/lima/2989
Log:
Ajout dans l'import/export d'une option de s?\195?\169lection de l'encodage du fichier CSV, d?\195?\169sormais compatible avec Excel.
Added:
trunk/lima-swing/src/main/java/org/chorem/lima/enums/EncodingEnum.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExportFileChooser.java
Modified:
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialStatementServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialStatementService.java
trunk/lima-swing/src/main/java/org/chorem/lima/enums/AccountsChartEnum.java
trunk/lima-swing/src/main/java/org/chorem/lima/enums/EntryBooksChartEnum.java
trunk/lima-swing/src/main/java/org/chorem/lima/enums/FinancialStatementsChartEnum.java
trunk/lima-swing/src/main/java/org/chorem/lima/enums/ImportExportEnum.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountViewHandler.java
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/financialstatementchart/FinancialStatementImportForm.jaxx
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/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/FinancialStatementServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialStatementServiceImpl.java 2010-07-28 18:53:39 UTC (rev 2988)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialStatementServiceImpl.java 2010-07-29 12:51:43 UTC (rev 2989)
@@ -186,7 +186,17 @@
}
}
+
+
@Override
+ public void removeAllFinancialStatement() throws LimaException,
+ LimaBusinessException {
+ for (FinancialStatement financialStatement : getChildrenFinancialStatement(null)) {
+ removeFinancialStatement(financialStatement);
+ }
+ }
+
+ @Override
public List<FinancialStatement> getAllFinancialStatements() throws LimaException {
TopiaContext transaction = null;
List<FinancialStatement> financialStatements = null;
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialStatementService.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialStatementService.java 2010-07-28 18:53:39 UTC (rev 2988)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialStatementService.java 2010-07-29 12:51:43 UTC (rev 2989)
@@ -34,7 +34,8 @@
public void createFinancialStatement(FinancialStatement masterFinancialStatement, FinancialStatement financialStatement) throws LimaException, LimaBusinessException;
public void updateFinancialStatement(FinancialStatement financialStatement) throws LimaException, LimaBusinessException;
public void removeFinancialStatement(FinancialStatement financialStatement) throws LimaException, LimaBusinessException;
-
+ public void removeAllFinancialStatement() throws LimaException, LimaBusinessException;
+
public List<FinancialStatement> getAllFinancialStatements() throws LimaException;
public List<FinancialStatement> getChildrenFinancialStatement(FinancialStatement financialStatement) throws LimaException;
public List<FinancialStatement> getAllChildrenFinancialStatement(FinancialStatement financialStatement, List<FinancialStatement> financialStatements) throws LimaException, LimaBusinessException;
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/enums/AccountsChartEnum.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/enums/AccountsChartEnum.java 2010-07-28 18:53:39 UTC (rev 2988)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/enums/AccountsChartEnum.java 2010-07-29 12:51:43 UTC (rev 2989)
@@ -1,3 +1,21 @@
+/* *##% Lima Swing
+ * Copyright (C) 2008 - 2010 CodeLutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * ##%*/
+
package org.chorem.lima.enums;
public enum AccountsChartEnum {
Added: trunk/lima-swing/src/main/java/org/chorem/lima/enums/EncodingEnum.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/enums/EncodingEnum.java (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/enums/EncodingEnum.java 2010-07-29 12:51:43 UTC (rev 2989)
@@ -0,0 +1,63 @@
+/* *##% Lima Swing
+ * Copyright (C) 2008 - 2010 CodeLutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * ##%*/
+
+package org.chorem.lima.enums;
+
+public enum EncodingEnum {
+
+ UTF8("UTF-8", "UTF-8 Lima"), ISOLATIN1("ISO-8859-1", "ISO-Latin-1 Excel / Windows");
+
+ private final String encoding;
+ private final String description;
+
+ private EncodingEnum(String encoding, String description) {
+ this.encoding = encoding;
+ this.description = description;
+ }
+
+ public String getEncoding() {
+ return this.encoding;
+ }
+
+ public String getDescription(){
+ return this.description;
+ }
+
+ public static String[] descriptions(){
+ int nbElts = EncodingEnum.values().length;
+ String[] descriptions = new String[nbElts];
+ EncodingEnum[] encodingEnums = EncodingEnum.values();
+ for (int i = 0; i < nbElts; i++) {
+ descriptions[i] = encodingEnums[i].getDescription();
+ }
+ return descriptions;
+ }
+
+ public static EncodingEnum valueOfDescription(String description){
+ EncodingEnum value = null;
+
+ for (EncodingEnum encodingEnum : EncodingEnum.values()) {
+ if (description.equals(encodingEnum.description)){
+ value = encodingEnum;
+ break;
+ }
+ }
+ return value;
+ }
+
+}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/enums/EntryBooksChartEnum.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/enums/EntryBooksChartEnum.java 2010-07-28 18:53:39 UTC (rev 2988)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/enums/EntryBooksChartEnum.java 2010-07-29 12:51:43 UTC (rev 2989)
@@ -1,3 +1,21 @@
+/* *##% Lima Swing
+ * Copyright (C) 2008 - 2010 CodeLutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * ##%*/
+
package org.chorem.lima.enums;
public enum EntryBooksChartEnum {
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/enums/FinancialStatementsChartEnum.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/enums/FinancialStatementsChartEnum.java 2010-07-28 18:53:39 UTC (rev 2988)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/enums/FinancialStatementsChartEnum.java 2010-07-29 12:51:43 UTC (rev 2989)
@@ -1,3 +1,21 @@
+/* *##% Lima Swing
+ * Copyright (C) 2008 - 2010 CodeLutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * ##%*/
+
package org.chorem.lima.enums;
public enum FinancialStatementsChartEnum {
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/enums/ImportExportEnum.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/enums/ImportExportEnum.java 2010-07-28 18:53:39 UTC (rev 2988)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/enums/ImportExportEnum.java 2010-07-29 12:51:43 UTC (rev 2989)
@@ -1,3 +1,21 @@
+/* *##% Lima Swing
+ * Copyright (C) 2008 - 2010 CodeLutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * ##%*/
+
package org.chorem.lima.enums;
@@ -6,18 +24,32 @@
*
*/
public enum ImportExportEnum {
- LIMA_ALL_EXPORT(false), LIMA_ALL_IMPORT(true),
- LIMA_ACCOUNTCHARTS_EXPORT(false), LIMA_ENTRYBOOKS_EXPORT(false), LIMA_FINANCIALSTATEMENTS_EXPORT(false),
- LIMA_ACCOUNTCHARTS_IMPORT(true), LIMA_ENTRYBOOKS_IMPORT(true), LIMA_FINANCIALSTATEMENTS_IMPORT(true),
- EBP_ACCOUNTCHARTS_EXPORT(false), EBP_ENTRIES_EXPORT(false),
- EBP_ACCOUNTCHARTS_IMPORT(true), EBP_ENTRIES_IMPORT(true);
+ CSV_ALL_EXPORT(false, true), CSV_ALL_IMPORT(true, true),
+ CSV_ACCOUNTCHARTS_EXPORT(false, true), CSV_ENTRYBOOKS_EXPORT(false, true), CSV_FINANCIALSTATEMENTS_EXPORT(false, true),
+ CSV_ACCOUNTCHARTS_IMPORT(true, true), CSV_ENTRYBOOKS_IMPORT(true, true), CSV_FINANCIALSTATEMENTS_IMPORT(true, true),
+ EBP_ACCOUNTCHARTS_EXPORT(false, false), EBP_ENTRIES_EXPORT(false, false),
+ EBP_ACCOUNTCHARTS_IMPORT(true, false), EBP_ENTRIES_IMPORT(true, false);
private final Boolean importMode;
+ private final Boolean encodingOption;
- private ImportExportEnum(Boolean importMode) {
+ /**
+ * import mode :
+ * true if import, false if export
+ */
+ private ImportExportEnum(Boolean importMode, Boolean encodingOption) {
this.importMode = importMode;
+ this.encodingOption = encodingOption;
}
+ /**
+ * encoding choice
+ * true if import or export methode let encoding option
+ */
+ public Boolean getEncodingOption(){
+ return this.encodingOption;
+ }
+
public Boolean getImportMode() {
return this.importMode;
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainView.jaxx 2010-07-28 18:53:39 UTC (rev 2988)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainView.jaxx 2010-07-29 12:51:43 UTC (rev 2989)
@@ -85,16 +85,16 @@
<JMenu text="lima.menu.file">
<JMenu text="lima.importexport.lima">
<JMenu text="lima.importexport.import" actionIcon='import-element'>
- <JMenuItem text="lima.importexport.all" onActionPerformed='getHandler().showImportExportView(this, ImportExportEnum.LIMA_ALL_IMPORT)'/>
- <JMenuItem text="lima.importexport.accountcharts" onActionPerformed='getHandler().showImportExportView(this, ImportExportEnum.LIMA_ACCOUNTCHARTS_IMPORT)'/>
- <JMenuItem text="lima.importexport.entrybooks" onActionPerformed='getHandler().showImportExportView(this, ImportExportEnum.LIMA_ENTRYBOOKS_IMPORT)'/>
- <JMenuItem text="lima.importexport.financialstatements" onActionPerformed='getHandler().showImportExportView(this, ImportExportEnum.LIMA_FINANCIALSTATEMENTS_IMPORT)'/>
+ <JMenuItem text="lima.importexport.all" onActionPerformed='getHandler().showImportExportView(this, ImportExportEnum.CSV_ALL_IMPORT)'/>
+ <JMenuItem text="lima.importexport.accountcharts" onActionPerformed='getHandler().showImportExportView(this, ImportExportEnum.CSV_ACCOUNTCHARTS_IMPORT)'/>
+ <JMenuItem text="lima.importexport.entrybooks" onActionPerformed='getHandler().showImportExportView(this, ImportExportEnum.CSV_ENTRYBOOKS_IMPORT)'/>
+ <JMenuItem text="lima.importexport.financialstatements" onActionPerformed='getHandler().showImportExportView(this, ImportExportEnum.CSV_FINANCIALSTATEMENTS_IMPORT)'/>
</JMenu>
<JMenu text="lima.importexport.export" actionIcon='export-element'>
- <JMenuItem text="lima.importexport.all" onActionPerformed='getHandler().showImportExportView(this, ImportExportEnum.LIMA_ALL_EXPORT)'/>
- <JMenuItem text="lima.importexport.accountcharts" onActionPerformed='getHandler().showImportExportView(this, ImportExportEnum.LIMA_ACCOUNTCHARTS_EXPORT)'/>
- <JMenuItem text="lima.importexport.entrybooks" onActionPerformed='getHandler().showImportExportView(this, ImportExportEnum.LIMA_ENTRYBOOKS_EXPORT)'/>
- <JMenuItem text="lima.importexport.financialstatements" onActionPerformed='getHandler().showImportExportView(this, ImportExportEnum.LIMA_FINANCIALSTATEMENTS_EXPORT)'/>
+ <JMenuItem text="lima.importexport.all" onActionPerformed='getHandler().showImportExportView(this, ImportExportEnum.CSV_ALL_EXPORT)'/>
+ <JMenuItem text="lima.importexport.accountcharts" onActionPerformed='getHandler().showImportExportView(this, ImportExportEnum.CSV_ACCOUNTCHARTS_EXPORT)'/>
+ <JMenuItem text="lima.importexport.entrybooks" onActionPerformed='getHandler().showImportExportView(this, ImportExportEnum.CSV_ENTRYBOOKS_EXPORT)'/>
+ <JMenuItem text="lima.importexport.financialstatements" onActionPerformed='getHandler().showImportExportView(this, ImportExportEnum.CSV_FINANCIALSTATEMENTS_EXPORT)'/>
</JMenu>
</JMenu>
<JMenu text="lima.importexport.ebp">
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 2010-07-28 18:53:39 UTC (rev 2988)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountViewHandler.java 2010-07-29 12:51:43 UTC (rev 2989)
@@ -277,7 +277,7 @@
AccountsChartEnum defaultAccountsChartEnum =
(AccountsChartEnum) value;
ImportExport importExport = ImportExport.getInstance(view);
- importExport.importExport(ImportExportEnum.LIMA_ACCOUNTCHARTS_IMPORT,
+ importExport.importExport(ImportExportEnum.CSV_ACCOUNTCHARTS_IMPORT,
defaultAccountsChartEnum.getFilePath(), true);
}
}
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 2010-07-28 18:53:39 UTC (rev 2988)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookViewHandler.java 2010-07-29 12:51:43 UTC (rev 2989)
@@ -30,7 +30,6 @@
import org.chorem.lima.enums.EntryBooksChartEnum;
import org.chorem.lima.enums.ImportExportEnum;
import org.chorem.lima.service.LimaServiceFactory;
-import org.chorem.lima.ui.MainView;
import org.chorem.lima.ui.importexport.ImportExport;
import org.chorem.lima.util.DialogHelper;
import org.jdesktop.swingx.JXTable;
@@ -149,30 +148,21 @@
public void importEntryBooks(){
-
- try {
- if (entryBookService.getAllEntryBooks().size() == 0){
- EntryBookImportForm form =
- new EntryBookImportForm();
- form.setLocationRelativeTo(view);
- form.setVisible(true);
+ EntryBookImportForm form =
+ new EntryBookImportForm();
+ form.setLocationRelativeTo(view);
+ form.setVisible(true);
- Object value = form.getRadioButtons().getSelectedValue();
- // if action confirmed
- if (value != null){
- EntryBooksChartEnum defaultEntryBooksEnum =
- (EntryBooksChartEnum) value;
- ImportExport importExport = ImportExport.getInstance(view);
- importExport.importExport(ImportExportEnum.LIMA_ENTRYBOOKS_IMPORT,
- defaultEntryBooksEnum.getFilePath(), true);
- }
- }
- } catch (LimaException eee) {
- if (log.isErrorEnabled()) {
- log.error("Can't get default accounts chart", eee);
- }
- }
+ Object value = form.getRadioButtons().getSelectedValue();
+ // if action confirmed
+ if (value != null){
+ EntryBooksChartEnum defaultEntryBooksEnum =
+ (EntryBooksChartEnum) value;
+ ImportExport importExport = ImportExport.getInstance(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 2010-07-28 18:53:39 UTC (rev 2988)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartViewHandler.java 2010-07-29 12:51:43 UTC (rev 2989)
@@ -23,7 +23,6 @@
import javax.swing.tree.TreePath;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.chorem.lima.beans.FinancialStatementImport;
import org.chorem.lima.business.FinancialStatementServiceMonitorable;
import org.chorem.lima.business.ImportServiceMonitorable;
import org.chorem.lima.business.LimaBusinessException;
@@ -34,7 +33,6 @@
import org.chorem.lima.enums.FinancialStatementsChartEnum;
import org.chorem.lima.enums.ImportExportEnum;
import org.chorem.lima.service.LimaServiceFactory;
-import org.chorem.lima.ui.MainView;
import org.chorem.lima.ui.financialstatementchart.FinancialStatementHeaderForm;
import org.chorem.lima.ui.financialstatementchart.FinancialStatementMovementForm;
import org.chorem.lima.ui.importexport.ImportExport;
@@ -277,30 +275,33 @@
}
public void importFinancialStatementChart(){
- try {
- if (financialStatementService.getAllFinancialStatements().size() == 0){
- FinancialStatementImportForm form =
- new FinancialStatementImportForm();
- form.setLocationRelativeTo(view);
- form.setVisible(true);
+ FinancialStatementImportForm form =
+ new FinancialStatementImportForm();
+ form.setLocationRelativeTo(view);
+ form.setVisible(true);
- Object value = form.getRadioButtons().getSelectedValue();
- // if action confirmed
- if (value != null){
- FinancialStatementsChartEnum defaultFinancialStatementsEnum =
- (FinancialStatementsChartEnum) value;
- ImportExport importExport = ImportExport.getInstance(view);
- importExport.importExport(ImportExportEnum.LIMA_FINANCIALSTATEMENTS_IMPORT,
- defaultFinancialStatementsEnum.getFilePath(), true);
+ Object value = form.getRadioButtons().getSelectedValue();
+ // if action confirmed
+ if (value != null){
+ if (form.getDeleteFinancialStatementChart().isSelected()){
+ try {
+ financialStatementService.removeAllFinancialStatement();
+
+ } catch (LimaException eee) {
+ if (log.isDebugEnabled()){
+ log.debug("Can't delete financial statement chart", eee);
+ }
}
- }
- } catch (LimaException eee) {
- if (log.isErrorEnabled()) {
- log.error("Can't get default accounts chart", eee);
- }
+ }
+ FinancialStatementsChartEnum defaultFinancialStatementsEnum =
+ (FinancialStatementsChartEnum) value;
+ ImportExport importExport = ImportExport.getInstance(view);
+ importExport.importExport(ImportExportEnum.CSV_FINANCIALSTATEMENTS_IMPORT,
+ defaultFinancialStatementsEnum.getFilePath(), true);
}
- }
+ }
+
@Override
public void notifyMethod(String serviceName, String methodName) {
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementImportForm.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementImportForm.jaxx 2010-07-28 18:53:39 UTC (rev 2988)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementImportForm.jaxx 2010-07-29 12:51:43 UTC (rev 2989)
@@ -59,6 +59,11 @@
</cell>
</row>
<row>
+ <cell>
+ <JCheckBox id='deleteFinancialStatementChart' text='lima.financialstatement.delete' selected='false'/>
+ </cell>
+ </row>
+ <row>
<cell>
<Table>
<row>
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java 2010-07-28 18:53:39 UTC (rev 2988)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java 2010-07-29 12:51:43 UTC (rev 2989)
@@ -20,8 +20,10 @@
package org.chorem.lima.ui.importexport;
import static org.nuiton.i18n.I18n._;
+import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
+import java.awt.Container;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
@@ -31,15 +33,17 @@
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.util.concurrent.ExecutionException;
+import javax.swing.JComboBox;
import javax.swing.JFileChooser;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
import javax.swing.SwingWorker;
-import javax.swing.text.StyledEditorKit.BoldAction;
-
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.business.ExportServiceMonitorable;
import org.chorem.lima.business.ImportServiceMonitorable;
import org.chorem.lima.business.LimaException;
+import org.chorem.lima.enums.EncodingEnum;
import org.chorem.lima.enums.ImportExportEnum;
import org.chorem.lima.service.LimaServiceFactory;
import org.chorem.lima.ui.account.AccountViewHandler;
@@ -54,6 +58,8 @@
private static final Log log = LogFactory.getLog(AccountViewHandler.class);
protected static Component viewComponent;
+
+ protected EncodingEnum encodingEnum;
protected ImportServiceMonitorable importService;
@@ -87,71 +93,69 @@
*/
public void importExport(ImportExportEnum importExportMethode, String file, Boolean verbose){
final ImportExportEnum importExportMethodeF = importExportMethode;
+ encodingEnum = EncodingEnum.UTF8;
if (file.equals("")){
- file = chooseFile(importExportMethode.getImportMode());
+ file = chooseFile(importExportMethode.getImportMode(), importExportMethode);
+ log.debug(encodingEnum.getEncoding());
}
+ final EncodingEnum charset = encodingEnum;
final String filePath = file;
final Boolean verboseMode = verbose;
new SwingWorker<String,Void>() {
@Override protected String doInBackground() throws LimaException {
- String charset = "UTF-8";
String datas = "";
String result = "";
switch (importExportMethodeF) {
- case LIMA_ALL_EXPORT:
+ case CSV_ALL_EXPORT:
datas = exportService.exportAsCSV();
- createFile(filePath, charset, datas);
+ createFile(filePath, charset.getEncoding(), datas);
break;
- case LIMA_ACCOUNTCHARTS_EXPORT:
+ case CSV_ACCOUNTCHARTS_EXPORT:
datas = exportService.exportAccountsChartAsCSV();
- createFile(filePath, charset, datas);
+ createFile(filePath, charset.getEncoding(), datas);
break;
- case LIMA_ENTRYBOOKS_EXPORT:
+ case CSV_ENTRYBOOKS_EXPORT:
datas = exportService.exportEntryBookChartAsCSV();
- createFile(filePath, charset, datas);
+ createFile(filePath, charset.getEncoding(), datas);
break;
- case LIMA_FINANCIALSTATEMENTS_EXPORT:
+ case CSV_FINANCIALSTATEMENTS_EXPORT:
datas = exportService.exportFinancialStatementChartAsCSV();
- createFile(filePath, charset, datas);
+ createFile(filePath, charset.getEncoding(), datas);
break;
case EBP_ACCOUNTCHARTS_EXPORT:
//For windows ebp
- charset = "ISO-8859-1";
datas = exportService.exportAccountsAsEBP();
- createFile(filePath, charset, datas);
+ createFile(filePath, EncodingEnum.ISOLATIN1.getEncoding(), datas);
break;
case EBP_ENTRIES_EXPORT:
//For windows ebp
- charset = "ISO-8859-1";
datas = exportService.exportEntriesAsEBP();
- createFile(filePath, charset, datas);
+ createFile(filePath, EncodingEnum.ISOLATIN1.getEncoding(), datas);
break;
- case LIMA_ALL_IMPORT:
- datas = extractFile(filePath, charset);
+ case CSV_ALL_IMPORT:
+ datas = extractFile(filePath, charset.getEncoding());
result = importService.importAllAsCSV(datas);
break;
- case LIMA_ACCOUNTCHARTS_IMPORT:
- datas = extractFile(filePath, charset);
+ case CSV_ACCOUNTCHARTS_IMPORT:
+ datas = extractFile(filePath, charset.getEncoding());
result = importService.importAccountsChartAsCSV(datas);
break;
- case LIMA_ENTRYBOOKS_IMPORT:
- datas = extractFile(filePath, charset);
+ case CSV_ENTRYBOOKS_IMPORT:
+ datas = extractFile(filePath, charset.getEncoding());
result = importService.importEntryBooksChartAsCSV(datas);
break;
- case LIMA_FINANCIALSTATEMENTS_IMPORT:
- datas = extractFile(filePath, charset);
+ case CSV_FINANCIALSTATEMENTS_IMPORT:
+ datas = extractFile(filePath, charset.getEncoding());
result = importService.importFinancialStatementsChartAsCSV(datas);
break;
case EBP_ACCOUNTCHARTS_IMPORT:
//For windows ebp
- charset = "ISO-8859-1";
- datas = extractFile(filePath, charset);
+ datas = extractFile(filePath, EncodingEnum.ISOLATIN1.getEncoding());
result = importService.importAccountsChartFromEbp(datas);
break;
case EBP_ENTRIES_IMPORT:
//For windows ebp
- charset = "ISO-8859-1";
- datas = extractFile(filePath, charset);
+ datas = extractFile(filePath, EncodingEnum.ISOLATIN1.getEncoding());
result = importService.importEntriesFromEbp(datas);
break;
}
@@ -192,25 +196,37 @@
* @param importMode
* @return
*/
- public String chooseFile(Boolean importMode){
+ public String chooseFile(Boolean importMode, ImportExportEnum importExportMethode){
String filePath = "";
FileChooseView fileChooseView = new FileChooseView();
JFileChooser chooser = fileChooseView.getChooser();
-
+ //Encoding option
+
+ JComboBox comboBox = new JComboBox(EncodingEnum.descriptions());
+ if (importExportMethode.getEncodingOption()){
+ JPanel panel = new JPanel();
+ panel.setLayout(new BorderLayout());
+ panel.add(new JLabel(_("lima.importexport.choiceencoding")), BorderLayout.WEST);
+ panel.add(comboBox, BorderLayout.CENTER);
+ ((Container)chooser.getComponent(2)).add(panel, BorderLayout.SOUTH);
+ }
+
if (importMode){
chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
- if (chooser.showOpenDialog(viewComponent) == JFileChooser.APPROVE_OPTION) {
- filePath = chooser.getSelectedFile().getAbsolutePath();
- }
}
else {
chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
- if (chooser.showOpenDialog(viewComponent) == JFileChooser.APPROVE_OPTION) {
- filePath = chooser.getSelectedFile().getAbsolutePath();
- filePath = chooser.getSelectedFile().getAbsolutePath();
+ }
+ if (chooser.showOpenDialog(viewComponent) == JFileChooser.APPROVE_OPTION) {
+ filePath = chooser.getSelectedFile().getAbsolutePath();
+
+ if (importExportMethode.getEncodingOption()){
+ encodingEnum = EncodingEnum.valueOfDescription((String) comboBox.getSelectedItem());
}
- }
- log.debug(filePath);
+ log.debug(encodingEnum.getEncoding());
+ log.debug(filePath);
+ }
+
return filePath;
}
Added: trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExportFileChooser.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExportFileChooser.java (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExportFileChooser.java 2010-07-29 12:51:43 UTC (rev 2989)
@@ -0,0 +1,34 @@
+package org.chorem.lima.ui.importexport;
+
+import java.awt.BorderLayout;
+import java.awt.Component;
+
+import javax.swing.JPanel;
+
+public class ImportExportFileChooser extends JPanel {
+
+ private static final long serialVersionUID = 1L;
+
+ public ImportExportFileChooser() {
+
+ setLayout(new BorderLayout());
+ // il y a 4 composants dans le JFileChooser, on les retire un par un pour les replacer comme on le souhaite
+ Component navigationBar = getComponent(0);
+ remove(0);
+ // on retire un JPanel qui n'est pas utile
+ remove(0);
+ add(navigationBar, BorderLayout.NORTH);
+ Component panelFiles = getComponent(0);
+ remove(0);
+ add(panelFiles, BorderLayout.CENTER);
+ Component buttons = getComponent(0);
+ remove(0);
+ add(buttons, BorderLayout.SOUTH);
+
+ //this.add(panelFileChooser);
+ //this.add(panelOptions, BorderLayout.SOUTH);
+
+ }
+
+
+}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/OpeningViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/OpeningViewHandler.java 2010-07-28 18:53:39 UTC (rev 2988)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/OpeningViewHandler.java 2010-07-29 12:51:43 UTC (rev 2989)
@@ -104,22 +104,22 @@
break;
default:
- importExport.importExport(ImportExportEnum.LIMA_ACCOUNTCHARTS_IMPORT,
+ importExport.importExport(ImportExportEnum.CSV_ACCOUNTCHARTS_IMPORT,
defaultAccountsChartEnum.getFilePath(), false);
break;
}
//Import financialstatement
switch (defaultAccountsChartEnum) {
case SHORTENED:
- importExport.importExport(ImportExportEnum.LIMA_FINANCIALSTATEMENTS_IMPORT,
+ importExport.importExport(ImportExportEnum.CSV_FINANCIALSTATEMENTS_IMPORT,
FinancialStatementsChartEnum.SHORTENED.getFilePath(), false);
break;
case DEVELOPED:
- importExport.importExport(ImportExportEnum.LIMA_FINANCIALSTATEMENTS_IMPORT,
+ importExport.importExport(ImportExportEnum.CSV_FINANCIALSTATEMENTS_IMPORT,
FinancialStatementsChartEnum.DEVELOPED.getFilePath(), false);
break;
default:
- importExport.importExport(ImportExportEnum.LIMA_FINANCIALSTATEMENTS_IMPORT,
+ importExport.importExport(ImportExportEnum.CSV_FINANCIALSTATEMENTS_IMPORT,
FinancialStatementsChartEnum.BASE.getFilePath(), false);
break;
}
@@ -134,7 +134,7 @@
case 3 :
if (ebPanel.getImportEntryBook().isSelected()){
- importExport.importExport(ImportExportEnum.LIMA_ENTRYBOOKS_IMPORT,
+ importExport.importExport(ImportExportEnum.CSV_ENTRYBOOKS_IMPORT,
EntryBooksChartEnum.DEFAULT.getFilePath(), false);
}
view.getEntrybooksIcon().setBorder(noBorder);
Modified: trunk/lima-swing/src/main/resources/i18n/lima-swing-en_GB.properties
===================================================================
--- trunk/lima-swing/src/main/resources/i18n/lima-swing-en_GB.properties 2010-07-28 18:53:39 UTC (rev 2988)
+++ trunk/lima-swing/src/main/resources/i18n/lima-swing-en_GB.properties 2010-07-29 12:51:43 UTC (rev 2989)
@@ -93,6 +93,7 @@
lima.financialstatement.accounts=
lima.financialstatement.creditaccounts=
lima.financialstatement.debitaccounts=
+lima.financialstatement.delete=
lima.financialstatement.formula=
lima.financialstatement.header.add=
lima.financialstatement.headeramount=
@@ -123,6 +124,7 @@
lima.import.journal=Import journal
lima.importexport.accountcharts=
lima.importexport.all=
+lima.importexport.choiceencoding=
lima.importexport.ebp=
lima.importexport.entries=
lima.importexport.entrybooks=
Modified: trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties
===================================================================
--- trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties 2010-07-28 18:53:39 UTC (rev 2988)
+++ trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties 2010-07-29 12:51:43 UTC (rev 2989)
@@ -90,6 +90,7 @@
lima.financialstatement.accounts=Liste de comptes au cr\u00E9dit et au d\u00E9bit
lima.financialstatement.creditaccounts=Liste de comptes au cr\u00E9dit
lima.financialstatement.debitaccounts=Liste de comptes au d\u00E9bit
+lima.financialstatement.delete=Supprimer le plan BCR actuel avant d'importer
lima.financialstatement.formula=Formule de compte, ex \: '7'-'6'+'510-520'
lima.financialstatement.header.add=Ajouter une cat\u00E9gorie
lima.financialstatement.headeramount=Calculer le total en en-tete
@@ -115,6 +116,7 @@
lima.import.journal=
lima.importexport.accountcharts=Plan des comptes
lima.importexport.all=Tout
+lima.importexport.choiceencoding=Choisir encodage \:
lima.importexport.ebp=Import/Export EBP
lima.importexport.entries=\u00C9critures
lima.importexport.entrybooks=Journaux
1
0