Lima-commits
Threads by month
- ----- 2026 -----
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
August 2010
- 3 participants
- 42 discussions
r3006 - in trunk/lima-swing/src/main: java/org/chorem/lima/enums java/org/chorem/lima/ui java/org/chorem/lima/ui/financialtransactionsearch java/org/chorem/lima/ui/opening resources/i18n
by jpepin@users.chorem.org Aug. 18, 2010
by jpepin@users.chorem.org Aug. 18, 2010
Aug. 18, 2010
Author: jpepin
Date: 2010-08-18 16:47:44 +0200 (Wed, 18 Aug 2010)
New Revision: 3006
Url: http://chorem.org/repositories/revision/lima/3006
Log:
Ajout vue recherches d'?\195?\169critures.
Added:
trunk/lima-swing/src/main/java/org/chorem/lima/enums/ComboBoxAccountsEnum.java
trunk/lima-swing/src/main/java/org/chorem/lima/enums/ComboBoxAmountEnum.java
trunk/lima-swing/src/main/java/org/chorem/lima/enums/ComboBoxOperatorsEnum.java
trunk/lima-swing/src/main/java/org/chorem/lima/enums/ComboBoxPeriodEnum.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/AccountSearchComboBox.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/AccountSearchPanel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/EntryBookSearchComboBox.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchTable.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchTableModel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchViewHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/PeriodSearchPanel.java
Modified:
trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainViewHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/OpeningViewHandler.java
trunk/lima-swing/src/main/resources/i18n/lima-swing-en_GB.properties
trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties
Added: trunk/lima-swing/src/main/java/org/chorem/lima/enums/ComboBoxAccountsEnum.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/enums/ComboBoxAccountsEnum.java (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/enums/ComboBoxAccountsEnum.java 2010-08-18 14:47:44 UTC (rev 3006)
@@ -0,0 +1,60 @@
+/* *##% Lima Swing
+ * Copyright (C) 2008 - 2010 CodeLutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * ##%*/
+
+package org.chorem.lima.enums;
+
+import static org.nuiton.i18n.I18n._;
+
+
+public enum ComboBoxAccountsEnum {
+
+ ACCOUNT(_("lima.enum.comboboxaccount.account")),
+ ACCOUNT_LIST(_("lima.enum.comboboxaccount.accountlist"));
+
+ private final String description;
+
+ private ComboBoxAccountsEnum(String description) {
+ this.description = description;
+ }
+
+ public String getDescription() {
+ return this.description;
+ }
+
+ public static String[] descriptions(){
+ int nbElts = ComboBoxAccountsEnum.values().length;
+ String[] descriptions = new String[nbElts];
+ ComboBoxAccountsEnum[] enums = ComboBoxAccountsEnum.values();
+ for (int i = 0; i < nbElts; i++) {
+ descriptions[i] = enums[i].getDescription();
+ }
+ return descriptions;
+ }
+
+ public static ComboBoxAccountsEnum valueOfDescription(String description){
+ ComboBoxAccountsEnum value = null;
+
+ for (ComboBoxAccountsEnum enums : ComboBoxAccountsEnum.values()) {
+ if (description.equals(enums.description)){
+ value = enums;
+ break;
+ }
+ }
+ return value;
+ }
+}
Added: trunk/lima-swing/src/main/java/org/chorem/lima/enums/ComboBoxAmountEnum.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/enums/ComboBoxAmountEnum.java (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/enums/ComboBoxAmountEnum.java 2010-08-18 14:47:44 UTC (rev 3006)
@@ -0,0 +1,61 @@
+/* *##% Lima Swing
+ * Copyright (C) 2008 - 2010 CodeLutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * ##%*/
+
+package org.chorem.lima.enums;
+
+import static org.nuiton.i18n.I18n._;
+
+
+public enum ComboBoxAmountEnum {
+
+ BOTH(_("lima.enum.comboboxamount.both")),
+ DEBIT(_("lima.enum.comboboxamount.debit")),
+ CREDIT(_("lima.enum.comboboxamount.credit"));
+
+ private final String description;
+
+ private ComboBoxAmountEnum(String description) {
+ this.description = description;
+ }
+
+ public String getDescription() {
+ return this.description;
+ }
+
+ public static String[] descriptions(){
+ int nbElts = ComboBoxAmountEnum.values().length;
+ String[] descriptions = new String[nbElts];
+ ComboBoxAmountEnum[] enums = ComboBoxAmountEnum.values();
+ for (int i = 0; i < nbElts; i++) {
+ descriptions[i] = enums[i].getDescription();
+ }
+ return descriptions;
+ }
+
+ public static ComboBoxAmountEnum valueOfDescription(String description){
+ ComboBoxAmountEnum value = null;
+
+ for (ComboBoxAmountEnum enums : ComboBoxAmountEnum.values()) {
+ if (description.equals(enums.description)){
+ value = enums;
+ break;
+ }
+ }
+ return value;
+ }
+}
Added: trunk/lima-swing/src/main/java/org/chorem/lima/enums/ComboBoxOperatorsEnum.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/enums/ComboBoxOperatorsEnum.java (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/enums/ComboBoxOperatorsEnum.java 2010-08-18 14:47:44 UTC (rev 3006)
@@ -0,0 +1,61 @@
+/* *##% Lima Swing
+ * Copyright (C) 2008 - 2010 CodeLutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * ##%*/
+
+package org.chorem.lima.enums;
+
+import static org.nuiton.i18n.I18n._;
+
+
+public enum ComboBoxOperatorsEnum {
+
+ EQUAL(_("lima.enum.comboboxoperator.equal")),
+ SUPERIOR(_("lima.enum.comboboxoperator.superior")),
+ INFERIOR(_("lima.enum.comboboxoperator.inferior"));;
+
+ private final String description;
+
+ private ComboBoxOperatorsEnum(String description) {
+ this.description = description;
+ }
+
+ public String getDescription() {
+ return this.description;
+ }
+
+ public static String[] descriptions(){
+ int nbElts = ComboBoxOperatorsEnum.values().length;
+ String[] descriptions = new String[nbElts];
+ ComboBoxOperatorsEnum[] enums = ComboBoxOperatorsEnum.values();
+ for (int i = 0; i < nbElts; i++) {
+ descriptions[i] = enums[i].getDescription();
+ }
+ return descriptions;
+ }
+
+ public static ComboBoxOperatorsEnum valueOfDescription(String description){
+ ComboBoxOperatorsEnum value = null;
+
+ for (ComboBoxOperatorsEnum enums : ComboBoxOperatorsEnum.values()) {
+ if (description.equals(enums.description)){
+ value = enums;
+ break;
+ }
+ }
+ return value;
+ }
+}
Added: trunk/lima-swing/src/main/java/org/chorem/lima/enums/ComboBoxPeriodEnum.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/enums/ComboBoxPeriodEnum.java (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/enums/ComboBoxPeriodEnum.java 2010-08-18 14:47:44 UTC (rev 3006)
@@ -0,0 +1,62 @@
+/* *##% Lima Swing
+ * Copyright (C) 2008 - 2010 CodeLutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * ##%*/
+
+package org.chorem.lima.enums;
+
+import static org.nuiton.i18n.I18n._;
+
+
+public enum ComboBoxPeriodEnum {
+
+ DATE(_("lima.enum.comboboxperiod.date")),
+ PERIOD(_("lima.enum.comboboxperiod.period")),
+ FISCAL_PERIOD(_("lima.enum.comboboxperiod.fiscalperiod")),
+ FINANCIAL_PERIOD(_("lima.enum.comboboxperiod.financialperiod"));
+
+ private final String description;
+
+ private ComboBoxPeriodEnum(String description) {
+ this.description = description;
+ }
+
+ public String getDescription() {
+ return this.description;
+ }
+
+ public static String[] descriptions(){
+ int nbElts = ComboBoxPeriodEnum.values().length;
+ String[] descriptions = new String[nbElts];
+ ComboBoxPeriodEnum[] enums = ComboBoxPeriodEnum.values();
+ for (int i = 0; i < nbElts; i++) {
+ descriptions[i] = enums[i].getDescription();
+ }
+ return descriptions;
+ }
+
+ public static ComboBoxPeriodEnum valueOfDescription(String description){
+ ComboBoxPeriodEnum value = null;
+
+ for (ComboBoxPeriodEnum enums : ComboBoxPeriodEnum.values()) {
+ if (description.equals(enums.description)){
+ value = enums;
+ break;
+ }
+ }
+ return value;
+ }
+}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainView.jaxx 2010-08-17 15:34:26 UTC (rev 3005)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainView.jaxx 2010-08-18 14:47:44 UTC (rev 3006)
@@ -157,6 +157,8 @@
actionIcon='entries-balanced'/>
<JMenuItem text="lima.entries.searchunbalancedtransaction" onActionPerformed='getHandler().showTransactionUnbalancedView(this)'
actionIcon='entries-unbalanced'/>
+ <JMenuItem text="lima.entries.searchtransaction" onActionPerformed='getHandler().showTransactionSearchView(this)'
+ actionIcon='entries-search'/>
<JMenuItem text="lima.entries.lettering" onActionPerformed='getHandler().showLetteringView(this)'
actionIcon='lettering'/>
</JMenu>
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainViewHandler.java 2010-08-17 15:34:26 UTC (rev 3005)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainViewHandler.java 2010-08-18 14:47:44 UTC (rev 3006)
@@ -42,6 +42,7 @@
import org.chorem.lima.ui.financialstatementchart.FinancialStatementChartView;
import org.chorem.lima.ui.financialstatementreport.FinancialStatementReportView;
import org.chorem.lima.ui.financialtransaction.FinancialTransactionView;
+import org.chorem.lima.ui.financialtransactionsearch.FinancialTransactionSearchView;
import org.chorem.lima.ui.financialtransactionunbalanced.FinancialTransactionUnbalancedView;
import org.chorem.lima.ui.home.HomeView;
import org.chorem.lima.ui.identity.IdentityForm;
@@ -380,6 +381,12 @@
mainView.showTab(_("lima.entries.searchunbalancedtransaction"), searchResultView);
}
+ public void showTransactionSearchView(JAXXContext rootContext) {
+ MainView mainView = getUI(rootContext);
+ FinancialTransactionSearchView searchView = new FinancialTransactionSearchView(mainView);
+ mainView.showTab(_("lima.entries.searchtransaction"), searchView);
+ }
+
public void showBalanceView(JAXXContext rootContext) {
MainView mainView = getUI(rootContext);
BalanceView balanceView = new BalanceView(mainView);
Added: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/AccountSearchComboBox.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/AccountSearchComboBox.java (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/AccountSearchComboBox.java 2010-08-18 14:47:44 UTC (rev 3006)
@@ -0,0 +1,90 @@
+/* *##% Lima Swing
+ * Copyright (C) 2008 - 2010 CodeLutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * ##%*/
+
+package org.chorem.lima.ui.financialtransactionsearch;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.KeyEvent;
+import java.awt.event.KeyListener;
+import javax.swing.JComboBox;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.chorem.lima.entity.Account;
+import org.chorem.lima.ui.accountsreports.AccountRenderer;
+import org.chorem.lima.ui.combobox.AccountComboBoxModel;
+import org.chorem.lima.util.AccountToString;
+import org.jdesktop.swingx.autocomplete.AutoCompleteDecorator;
+
+public class AccountSearchComboBox extends JComboBox implements KeyListener, ActionListener {
+
+ private static final long serialVersionUID = 1L;
+
+ private static final Log log =
+ LogFactory.getLog(AccountSearchComboBox.class);
+
+ protected FinancialTransactionSearchViewHandler handler;
+
+ public AccountSearchComboBox(FinancialTransactionSearchViewHandler handler) {
+ this.handler = handler;
+ AccountComboBoxModel accountComboBoxModel = new AccountComboBoxModel();
+ AccountRenderer accountRenderer = new AccountRenderer();
+ setModel(accountComboBoxModel);
+ setRenderer(accountRenderer);
+ setEditable(true);
+ AutoCompleteDecorator.decorate(this, AccountToString.getInstance());
+ this.getEditor().getEditorComponent().addKeyListener(this);
+ this.addActionListener(this);
+ }
+
+
+
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ Object object = this.getSelectedItem();
+ if (object instanceof Account){
+ //handler.setAccount((Account) this.getSelectedItem());
+ }
+ }
+
+
+ @Override
+ public void keyPressed(KeyEvent e) {
+
+ }
+
+ @Override
+ public void keyReleased(KeyEvent e) {
+ Object object = this.getSelectedItem();
+ if (object instanceof Account){
+ //handler.setAccount((Account) this.getSelectedItem());
+ }
+
+ // delegate popup list menu
+ if ( e.getKeyChar() == KeyEvent.VK_ENTER )
+ {
+ firePopupMenuCanceled();
+ }
+ }
+
+ @Override
+ public void keyTyped(KeyEvent e) {
+
+ }
+
+}
Added: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/AccountSearchPanel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/AccountSearchPanel.java (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/AccountSearchPanel.java 2010-08-18 14:47:44 UTC (rev 3006)
@@ -0,0 +1,54 @@
+/* *##% Lima Swing
+ * Copyright (C) 2008 - 2010 CodeLutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * ##%*/
+
+package org.chorem.lima.ui.financialtransactionsearch;
+
+import javax.swing.JPanel;
+import javax.swing.JTextField;
+import org.chorem.lima.enums.ComboBoxAccountsEnum;
+
+public class AccountSearchPanel extends JPanel {
+
+ protected FinancialTransactionSearchViewHandler handler;
+
+ public AccountSearchPanel(FinancialTransactionSearchViewHandler handler) {
+ this.handler = handler;
+ refresh(ComboBoxAccountsEnum.ACCOUNT);
+ }
+
+ static final long serialVersionUID = 1L;
+
+ public void refresh(ComboBoxAccountsEnum comboBoxAccountsEnum){
+
+ switch (comboBoxAccountsEnum) {
+ case ACCOUNT:
+ AccountSearchComboBox accountComboBox = new AccountSearchComboBox(handler);
+ this.removeAll();
+ this.add(accountComboBox);
+ break;
+
+ case ACCOUNT_LIST:
+ JTextField accountsList = new JTextField(16);
+ this.removeAll();
+ this.add(accountsList);
+ break;
+ }
+
+ }
+
+}
Added: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/EntryBookSearchComboBox.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/EntryBookSearchComboBox.java (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/EntryBookSearchComboBox.java 2010-08-18 14:47:44 UTC (rev 3006)
@@ -0,0 +1,89 @@
+/* *##% Lima Swing
+ * Copyright (C) 2008 - 2010 CodeLutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * ##%*/
+
+package org.chorem.lima.ui.financialtransactionsearch;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.KeyEvent;
+import java.awt.event.KeyListener;
+import javax.swing.JComboBox;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.chorem.lima.entity.EntryBook;
+import org.chorem.lima.ui.combobox.EntryBookComboBoxModel;
+import org.chorem.lima.ui.combobox.EntryBookRenderer;
+import org.chorem.lima.util.EntryBookToString;
+import org.jdesktop.swingx.autocomplete.AutoCompleteDecorator;
+
+public class EntryBookSearchComboBox extends JComboBox implements KeyListener, ActionListener {
+
+ private static final long serialVersionUID = 1L;
+
+ private static final Log log =
+ LogFactory.getLog(EntryBookSearchComboBox.class);
+
+ protected FinancialTransactionSearchViewHandler handler;
+
+ public EntryBookSearchComboBox(FinancialTransactionSearchViewHandler handler) {
+ this.handler = handler;
+ EntryBookComboBoxModel entryBookComboBoxModel = new EntryBookComboBoxModel();
+ EntryBookRenderer entryBookRenderer = new EntryBookRenderer();
+ setModel(entryBookComboBoxModel);
+ setRenderer(entryBookRenderer);
+ setEditable(true);
+ AutoCompleteDecorator.decorate(this, EntryBookToString.getInstance());
+ this.getEditor().getEditorComponent().addKeyListener(this);
+ this.addActionListener(this);
+ }
+
+
+
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ Object object = this.getSelectedItem();
+ if (object instanceof EntryBook){
+ //handler.setEntryBook((EntryBook) this.getSelectedItem());
+ }
+ }
+
+
+ @Override
+ public void keyPressed(KeyEvent e) {
+
+ }
+
+ @Override
+ public void keyReleased(KeyEvent e) {
+ Object object = this.getSelectedItem();
+ if (object instanceof EntryBook){
+ //handler.setEntryBook((EntryBook) this.getSelectedItem());
+ }
+ // delegate popup list menu
+ if ( e.getKeyChar() == KeyEvent.VK_ENTER )
+ {
+ firePopupMenuCanceled();
+ }
+ }
+
+ @Override
+ public void keyTyped(KeyEvent e) {
+
+ }
+
+}
Added: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchTable.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchTable.java (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchTable.java 2010-08-18 14:47:44 UTC (rev 3006)
@@ -0,0 +1,154 @@
+/* *##% Lima Swing
+ * Copyright (C) 2008 - 2010 CodeLutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * ##%*/
+
+package org.chorem.lima.ui.financialtransactionsearch;
+
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.event.KeyEvent;
+import java.awt.event.KeyListener;
+import java.math.BigDecimal;
+import java.util.Date;
+import org.chorem.lima.entity.Account;
+import org.chorem.lima.entity.EntryBook;
+import org.chorem.lima.ui.celleditor.AccountTableCellEditor;
+import org.chorem.lima.ui.celleditor.DateTableCellEditor;
+import org.chorem.lima.ui.celleditor.EntryBookTableCellEditor;
+import org.jdesktop.swingx.JXTable;
+import org.jdesktop.swingx.decorator.ColorHighlighter;
+import org.jdesktop.swingx.decorator.ComponentAdapter;
+import org.jdesktop.swingx.decorator.HighlightPredicate;
+import org.jdesktop.swingx.decorator.Highlighter;
+
+
+/**
+ * Table des transaction qui ajoute des comportement (keys).
+ *
+ * @author ore
+ * @author Rémi Chapelet
+ */
+public class FinancialTransactionSearchTable extends JXTable implements KeyListener {
+
+ /** serialVersionUID. */
+ private static final long serialVersionUID = 3133690382049594727L;
+
+ protected FinancialTransactionSearchViewHandler handler;
+
+ private Highlighter colorTransaction;
+
+ private ColorHighlighter colorBalance;
+
+ /**
+ */
+ public FinancialTransactionSearchTable(FinancialTransactionSearchViewHandler handler) {
+
+ this.handler = handler;
+
+ addKeyListener(this);
+
+ //Get new date editor
+ setDefaultEditor(Date.class, new DateTableCellEditor());
+ //Get new entry book editor
+ setDefaultEditor(EntryBook.class, new EntryBookTableCellEditor());
+ //Get new account editor
+ setDefaultEditor(Account.class, new AccountTableCellEditor());
+
+ //highlight financial financial transactions
+ addColorTransaction();
+ // highlight unbalanced financial transactions
+ addColorNonBalancedTransaction();
+ }
+
+ /**
+ * Cette méthode permet de colorer toutes les transactions dans le tableau
+ * afin de bien distinguer les transactions et entrées comptables.
+ * On récupère la première cellule, on vérifie que c'est une date
+ */
+ protected void addColorTransaction() {
+ if (colorTransaction != null) {
+ removeHighlighter(colorTransaction);
+ }
+ HighlightPredicate predicate = new HighlightPredicate() {
+ @Override
+ public boolean isHighlighted(Component renderer,
+ ComponentAdapter adapter) {
+ return adapter.getValueAt(adapter.row, 0) instanceof Date;
+ }
+ };
+ colorTransaction =
+ new ColorHighlighter(predicate, new Color(222,222,222), null);
+ addHighlighter(colorTransaction);
+ }
+
+
+
+ /**
+ * Permet de surligner une transaction dans le tableau lorsque
+ * cette dernière n'est pas équilibrée.
+ * On récupère la dernière cellule de la ligne
+ * et on vérifie si la valeur est différente de 0
+ */
+ protected void addColorNonBalancedTransaction() {
+ if (colorBalance != null) {
+ removeHighlighter(colorBalance);
+ }
+ HighlightPredicate predicate = new HighlightPredicate() {
+ @Override
+ public boolean isHighlighted(Component renderer,
+ ComponentAdapter adapter) {
+ boolean isHighlighted = false;
+ Object value = adapter.getValueAt(adapter.row, 8);
+ if (value instanceof BigDecimal) {
+ BigDecimal currentBalance = (BigDecimal) value;
+ if (currentBalance.doubleValue() != 0) {
+ isHighlighted = true;
+ }
+ }
+ return isHighlighted;
+ }
+ };
+ colorTransaction =
+ new ColorHighlighter(predicate, new Color(255, 198, 209), null);
+ addHighlighter(colorTransaction);
+ }
+
+ /**
+ * for each action combination key are think
+ * for extend keyboard and laptop keyboard
+ */
+ @Override
+ public void keyPressed(KeyEvent e) {
+
+ }
+
+ /*
+ * @see java.awt.event.KeyListener#keyTyped(java.awt.event.KeyEvent)
+ */
+ @Override
+ public void keyTyped(KeyEvent e) {
+
+ }
+
+ /*
+ * @see java.awt.event.KeyListener#keyReleased(java.awt.event.KeyEvent)
+ */
+ @Override
+ public void keyReleased(KeyEvent e) {
+
+ }
+}
Property changes on: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchTable.java
___________________________________________________________________
Added: svn:executable
+ *
Added: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchTableModel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchTableModel.java (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchTableModel.java 2010-08-18 14:47:44 UTC (rev 3006)
@@ -0,0 +1,467 @@
+/* *##% Lima Swing
+ * Copyright (C) 2008 - 2010 CodeLutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * ##%*/
+
+package org.chorem.lima.ui.financialtransactionsearch;
+
+import static org.nuiton.i18n.I18n._;
+
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Date;
+import java.util.List;
+import java.util.Set;
+
+import javax.swing.table.AbstractTableModel;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.chorem.lima.business.FinancialTransactionServiceMonitorable;
+import org.chorem.lima.business.LimaException;
+import org.chorem.lima.business.ejbinterface.FinancialTransactionService;
+import org.chorem.lima.business.utils.EntryComparator;
+import org.chorem.lima.entity.Account;
+import org.chorem.lima.entity.Entry;
+import org.chorem.lima.entity.EntryBook;
+import org.chorem.lima.entity.EntryImpl;
+import org.chorem.lima.entity.FinancialTransaction;
+import org.chorem.lima.entity.FiscalPeriod;
+import org.chorem.lima.service.LimaServiceFactory;
+import org.chorem.lima.util.DialogHelper;
+import org.chorem.lima.util.ErrorHelper;
+
+/**
+ * Basic transaction table model.
+ *
+ * Le modele est filtré sur {@link #selectedEntryBook} et
+ * {@link #selectedFinancialPeriod} (montée en charge !).
+ *
+ * @author ore
+ * @author chatellier
+ * @version $Revision: 2897 $
+ *
+ * Last update : $Date: 2010-05-14 13:22:26 +0200 (ven. 14 mai 2010) $
+ * By : $Author: jpepin $
+ */
+public class FinancialTransactionSearchTableModel extends AbstractTableModel {
+
+ /** serialVersionUID. */
+ private static final long serialVersionUID = 3914954536809622358L;
+
+ /** log. */
+ private static final Log log = LogFactory
+ .getLog(FinancialTransactionSearchTableModel.class);
+
+ /** Transaction service. */
+ protected final FinancialTransactionService financialTransactionService;
+
+ /** selected financial period */
+ protected FiscalPeriod selectedFiscalPeriod;
+
+ /** data cache */
+ protected List<Object> cacheDataList;
+
+ /** collection
+
+
+ /**
+ * Model constructor.
+ *
+ * Just init service proxies.
+ */
+ public FinancialTransactionSearchTableModel() {
+ /* Services */
+ financialTransactionService =
+ LimaServiceFactory.getInstance().getService(
+ FinancialTransactionServiceMonitorable.class);
+ }
+
+ /**
+ * Le model est une combinaison de Transaction/Entries.
+ *
+ *
+ * @return
+ */
+ protected List<Object> getDataList() {
+ List<Object> results = new ArrayList<Object>();
+ if(selectedFiscalPeriod != null){
+ try {
+ Set<FinancialTransaction> financialtransactions =
+ financialTransactionService.getAllInexactFinancialTransactions(selectedFiscalPeriod);
+ for (FinancialTransaction financialtransaction : financialtransactions) {
+ results.add(financialtransaction);
+ List<Entry> entries = (List<Entry>) financialtransaction.getEntry();
+ Collections.sort(entries, new EntryComparator());
+ results.addAll(entries);
+ }
+ }
+ catch (LimaException eee) {
+ if (log.isErrorEnabled()) {
+ log.debug("Can't update model", eee);
+ }
+
+ ErrorHelper.showErrorDialog("Can't get transaction list", eee);
+ }
+ }
+
+ return results;
+ }
+
+ public void refresh(){
+ cacheDataList = getDataList();
+ fireTableDataChanged();
+ }
+
+ @Override
+ public int getColumnCount() {
+ return 9;
+ }
+
+ @Override
+ public Class<?> getColumnClass(int column) {
+
+ Class<?> result = null;
+
+ switch (column) {
+ case 0:
+ result = Date.class;
+ break;
+ case 1:
+ result = EntryBook.class;
+ break;
+ case 2:
+ result = String.class;
+ break;
+ case 3:
+ result = Account.class;
+ break;
+ case 4:
+ result = String.class;
+ break;
+ case 5:
+ result = String.class;
+ break;
+ case 6:
+ result = BigDecimal.class;
+ break;
+ case 7:
+ result = BigDecimal.class;
+ break;
+ case 8:
+ result = BigDecimal.class;
+ break;
+ }
+
+ return result;
+ }
+
+ @Override
+ public String getColumnName(int column) {
+ String result = "n/a";
+
+ switch (column) {
+ case 0:
+ result = _("lima.table.date");
+ break;
+ case 1:
+ result = _("lima.table.entrybook");
+ break;
+ case 2:
+ result = _("lima.table.voucher");
+ break;
+ case 3:
+ result = _("lima.table.account");
+ break;
+ case 4:
+ result = _("lima.table.description");
+ break;
+ case 5:
+ result = _("lima.table.position");
+ break;
+ case 6:
+ result = _("lima.table.debit");
+ break;
+ case 7:
+ result = _("lima.table.credit");
+ break;
+ case 8:
+ result = _("lima.table.balance");
+ break;
+ }
+
+ return result;
+ }
+
+ @Override
+ public int getRowCount() {
+ int result = 0;
+
+ // just prevent too much result
+ if (cacheDataList != null) {
+ result = cacheDataList.size();
+ }
+
+ return result;
+ }
+
+ @Override
+ public Object getValueAt(int row, int column) {
+ Object result = null;
+
+ // just prevent too much result
+ if (cacheDataList != null) {
+ result = cacheDataList.get(row);
+
+ if (result instanceof FinancialTransaction) {
+ FinancialTransaction currentRow = (FinancialTransaction)result;
+ BigDecimal amountDebit = currentRow.getAmountDebit();
+ BigDecimal amountCredit = currentRow.getAmountCredit();
+
+ switch (column) {
+ case 0:
+ result = currentRow.getTransactionDate();
+ break;
+ case 1:
+ if (currentRow.getEntryBook() != null){
+ result = currentRow.getEntryBook().getCode();
+ }
+ else {
+ result = null;
+ }
+ break;
+ case 2:
+ result = null; //entrybook
+ break;
+ case 3:
+ result = null; // account
+ break;
+ case 4:
+ result = null; // description
+ break;
+ case 5 :
+ result = null; // position
+ break;
+ case 6:
+ result = amountDebit;
+ break;
+ case 7:
+ result = amountCredit;
+ break;
+ case 8:
+ result = amountDebit.subtract(amountCredit);
+ break;
+ }
+ }
+ else if (result instanceof Entry) {
+ Entry currentEntry = (Entry)result;
+ switch (column) {
+ case 0:
+ result = null; // date
+ break;
+ case 1 : // entry book
+ result = null;
+ break;
+ case 2:
+ result = currentEntry.getVoucher();
+ break;
+ case 3: // account
+ if (currentEntry.getAccount() != null){
+ result = currentEntry.getAccount().getAccountNumber();
+ }
+ else {
+ result = null;
+ }
+ break;
+ case 4:
+ result = currentEntry.getDescription();
+ break;
+ case 5 :
+ result = currentEntry.getPosition();
+ break;
+ case 6:
+ result = currentEntry.getDebit() ? currentEntry.getAmount() : 0;
+ break;
+ case 7:
+ result = currentEntry.getDebit() ? 0 : currentEntry.getAmount();
+ break;
+ case 8:
+ result = null; // balance
+ break;
+ }
+
+ }
+ }
+
+ return result;
+ }
+
+ public void setFiscalPeriod(FiscalPeriod fiscalPeriod){
+ selectedFiscalPeriod = fiscalPeriod;
+ }
+
+ /**
+ * To set cells editable or not
+ * different condition for entry or financial transaction
+ */
+ @Override
+ public boolean isCellEditable(int rowIndex, int columnIndex) {
+ boolean editableCell=false;
+ Object currentRow = cacheDataList.get(rowIndex);
+ // cells editable for the entry row, all cells exclude the date
+ if ((currentRow instanceof Entry) && !((columnIndex==0) || (columnIndex==1))) {
+ editableCell=true;
+ }
+ // cells editable for the financialtransaction row, no cells exclude the date
+ if ((currentRow instanceof FinancialTransaction) && ((columnIndex==0) || (columnIndex==1))){
+ editableCell=true;
+ }
+ return editableCell;
+ }
+
+
+ /**
+ * @throws LimaException
+ */
+ public void addEmptyEntry(Object value, int row) throws LimaException {
+ FinancialTransaction currentTransaction = null;
+ Object currentRow = cacheDataList.get(row);
+ Entry entry = new EntryImpl();
+ entry.setAmount(new BigDecimal(0));
+ //check if current row is a transaction or an entry
+ if (currentRow instanceof FinancialTransaction) {
+ currentTransaction = (FinancialTransaction)currentRow;
+ }
+ else if (currentRow instanceof Entry) {
+ Entry currentEntry = (Entry)currentRow;
+ //get back the parent transaction of the entry
+ currentTransaction = currentEntry.getFinancialTransaction();
+ }
+ //create it
+ entry.setFinancialTransaction(currentTransaction);
+ financialTransactionService.createEntry(entry);
+ //on recharge la liste
+ refresh();
+ }
+
+ /**
+ * to modifiy financialtransaction or entry
+ */
+ @Override
+ public void setValueAt(Object value, int row, int column) {
+ int financialTransactionRow=0;
+ // just prevent too much result
+ if (selectedFiscalPeriod != null) {
+ Object currentRow = cacheDataList.get(row);
+ if (currentRow instanceof FinancialTransaction) {
+ FinancialTransaction currentFinancialTransaction =
+ (FinancialTransaction)currentRow;
+ switch (column) {
+ case 0:
+ //update
+ currentFinancialTransaction.setTransactionDate((Date)value);
+ break;
+ case 1 :
+ currentFinancialTransaction.setEntryBook((EntryBook)value);
+ break;
+ }
+ // notify service for modification
+ try {
+ financialTransactionService.
+ updateFinancialTransaction(currentFinancialTransaction);
+ } catch (LimaException eee) {
+ if (log.isDebugEnabled()){
+ log.debug("Can't update financial transaction", eee);
+ }
+ DialogHelper.showMessageDialog(eee.getMessage());
+ }
+ //update the financial transaction in entire
+ financialTransactionRow =
+ cacheDataList.indexOf(((FinancialTransaction) currentRow));
+ }
+ else if (currentRow instanceof Entry) {
+ Entry currentEntry = (Entry)currentRow;
+ switch (column) {
+ case 2 :
+ currentEntry.setVoucher((String)value);
+ break;
+ case 3:
+ currentEntry.setAccount((Account)value);
+ break;
+ case 4:
+ currentEntry.setDescription((String)value);
+ break;
+ case 5 :
+ currentEntry.setPosition((String)value);
+ break;
+ case 6:
+ currentEntry.setAmount((BigDecimal)value);
+ currentEntry.setDebit(true);
+ break;
+ case 7:
+ currentEntry.setAmount((BigDecimal)value);
+ currentEntry.setDebit(false);
+ break;
+ }
+ try {
+ financialTransactionService.updateEntry(currentEntry);
+ } catch (LimaException eee) {
+ if (log.isDebugEnabled()){
+ log.debug("Can't update entry", eee);
+ }
+ DialogHelper.showMessageDialog(eee.getMessage());
+ }
+ //update the financial transaction in entire
+ financialTransactionRow =
+ cacheDataList.indexOf(((Entry) currentRow).
+ getFinancialTransaction());
+ }
+ //on recharge la liste
+ //TODO PEPIN 20100607 Get financial transaction of cachedatelist on replace it
+ fireTableRowsUpdated(financialTransactionRow, getRowCount()-1);
+ }
+ }
+
+ public Object getElementAt(int row){
+
+ Object currentRow = cacheDataList.get(row);
+ return currentRow;
+ }
+
+
+ /**
+ * Delete selected row in table (could be transaction or entry).
+ *
+ * Called by model.
+ * @param Object, int
+ * @throws LimaException
+ */
+ public void removeObject(Object object, int row) throws LimaException {
+ Object currentRow = cacheDataList.get(row);
+ if (currentRow instanceof FinancialTransaction) {
+ FinancialTransaction currentTransaction =
+ (FinancialTransaction)currentRow;
+ financialTransactionService.removeFinancialTransaction(currentTransaction);
+ }
+ else if (currentRow instanceof Entry) {
+ Entry currentEntry = (Entry)currentRow;
+ financialTransactionService.removeEntry(currentEntry);
+ }
+ //on recharge la liste
+ refresh();
+ }
+
+}
Property changes on: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchTableModel.java
___________________________________________________________________
Added: svn:executable
+ *
Added: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchView.jaxx (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchView.jaxx 2010-08-18 14:47:44 UTC (rev 3006)
@@ -0,0 +1,87 @@
+<!-- ##% Lima Swing
+ Copyright (C) 2008 - 2010 CodeLutin
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ as published by the Free Software Foundation; either version 2
+ of the License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ ##% -->
+
+<Table>
+ <FinancialTransactionSearchViewHandler id="handler" javaBean="new FinancialTransactionSearchViewHandler(this)" />
+ <Boolean id="selectedRow" javaBean="false" />
+ <script>
+ <![CDATA[
+ import org.chorem.lima.enums.ComboBoxPeriodEnum;
+ import org.chorem.lima.enums.ComboBoxAccountsEnum;
+ import org.chorem.lima.enums.ComboBoxAmountEnum;
+ import org.chorem.lima.enums.ComboBoxOperatorsEnum;
+
+ AccountSearchPanel accountSearchPanel = new AccountSearchPanel(handler);
+ PeriodSearchPanel periodSearchPanel = new PeriodSearchPanel(handler);
+
+ void $afterCompleteSetup() {
+ }
+
+ ]]>
+ </script>
+
+ <row>
+ <cell><Table><row>
+ <cell anchor="west"><JComboBox id="periodComboBox" javaBean="new JComboBox(ComboBoxPeriodEnum.descriptions())"
+ onActionPerformed="periodSearchPanel.refresh(ComboBoxPeriodEnum.valueOfDescription((String) periodComboBox.getSelectedItem()));
+ validate(); repaint()"/></cell>
+ <cell><PeriodSearchPanel javaBean="periodSearchPanel"/></cell>
+ </row></Table></cell>
+ </row>
+ <row>
+ <cell><Table><row>
+ <cell><JLabel text="lima.table.voucher"/></cell>
+ <cell><JTextField id='voucher'/></cell>
+ <cell><JLabel text="lima.table.description"/></cell>
+ <cell><JTextField id='description'/></cell>
+ <cell><JLabel text="lima.table.letter"/></cell>
+ <cell><JTextField id='letter'/></cell>
+ </row></Table></cell>
+ </row>
+ <row>
+ <cell><Table><row>
+ <cell><JComboBox id="accountComboBox" javaBean="new JComboBox(ComboBoxAccountsEnum.descriptions())"
+ onActionPerformed="accountSearchPanel.refresh(ComboBoxAccountsEnum.valueOfDescription((String) accountComboBox.getSelectedItem()));
+ validate(); repaint()"/></cell>
+ <cell><AccountSearchPanel javaBean="accountSearchPanel"/></cell>
+ <cell anchor='east'><JLabel text="lima.table.entrybook"/></cell>
+ <cell anchor='west'><EntryBookSearchComboBox javaBean="new EntryBookSearchComboBox(handler)"/></cell>
+ </row></Table></cell>
+ </row>
+ <row>
+ <cell><Table><row>
+ <cell><JLabel text="lima.amount"/></cell>
+ <cell><JComboBox id="amountComboBox" javaBean="new JComboBox(ComboBoxAmountEnum.descriptions())"/></cell>
+ <cell><JComboBox id="operatorComboBox" javaBean="new JComboBox(ComboBoxOperatorsEnum.descriptions())"/></cell>
+ <cell><JTextField id='amount'/></cell>
+ </row></Table></cell>
+ </row>
+ <row>
+ <cell fill="both" weightx="1" weighty="1">
+ <JScrollPane>
+ <org.chorem.lima.ui.financialtransactionsearch.FinancialTransactionSearchTableModel
+ id="financialTransactionSearchTableModel" />
+ <org.chorem.lima.ui.financialtransactionsearch.FinancialTransactionSearchTable
+ id="financialTransactionSearchTable" sortable="false" rowHeight="22"
+ constructorParams="getHandler()" model="{getFinancialTransactionSearchTableModel()}"
+ selectionMode="{ListSelectionModel.SINGLE_SELECTION}" />
+ <javax.swing.ListSelectionModel javaBean="getFinancialTransactionSearchTable().getSelectionModel()"
+ onValueChanged="setSelectedRow(financialTransactionSearchTable.getSelectedRow() != -1)"/>
+ </JScrollPane>
+ </cell>
+ </row>
+</Table>
\ No newline at end of file
Property changes on: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchView.jaxx
___________________________________________________________________
Added: svn:executable
+ *
Added: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchViewHandler.java (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchViewHandler.java 2010-08-18 14:47:44 UTC (rev 3006)
@@ -0,0 +1,60 @@
+/* *##% Lima Swing
+ * Copyright (C) 2008 - 2010 CodeLutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * ##%*/
+
+package org.chorem.lima.ui.financialtransactionsearch;
+
+import static org.nuiton.i18n.I18n._;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.chorem.lima.ui.combobox.FiscalPeriodComboBoxModel;
+
+/**
+ * Handler associated with financial transaction view.
+ *
+ * @author chatellier
+ * @version $Revision: 2901 $
+ *
+ * Last update : $Date: 2010-05-19 12:52:43 +0200 (mer. 19 mai 2010) $
+ * By : $Author: jpepin $
+ */
+public class FinancialTransactionSearchViewHandler {
+
+ /** log. */
+ private static final Log log =
+ LogFactory.getLog(FinancialTransactionSearchViewHandler.class);
+
+ protected FinancialTransactionSearchView view;
+
+ protected FinancialTransactionSearchTable table;
+
+ protected FinancialTransactionSearchTableModel tableModel;
+
+ protected FiscalPeriodComboBoxModel comboBoxModel;
+
+
+ protected FinancialTransactionSearchViewHandler(FinancialTransactionSearchView view) {
+ this.view = view;
+
+ }
+
+ public void refresh(){
+ tableModel = view.getFinancialTransactionSearchTableModel();
+ tableModel.refresh();
+ }
+}
Property changes on: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchViewHandler.java
___________________________________________________________________
Added: svn:executable
+ *
Added: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/PeriodSearchPanel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/PeriodSearchPanel.java (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/PeriodSearchPanel.java 2010-08-18 14:47:44 UTC (rev 3006)
@@ -0,0 +1,111 @@
+/* *##% Lima Swing
+ * Copyright (C) 2008 - 2010 CodeLutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * ##%*/
+
+package org.chorem.lima.ui.financialtransactionsearch;
+
+import java.util.Calendar;
+import java.util.Date;
+import static org.nuiton.i18n.I18n._;
+import javax.swing.JComboBox;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+
+import org.apache.commons.lang.time.DateUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.chorem.lima.enums.ComboBoxPeriodEnum;
+import org.chorem.lima.ui.combobox.FinancialPeriodComboBoxModel;
+import org.chorem.lima.ui.combobox.FinancialPeriodComboBoxRenderer;
+import org.chorem.lima.ui.combobox.FiscalPeriodComboBoxModel;
+import org.chorem.lima.ui.combobox.FiscalPeriodComboBoxRenderer;
+import org.jdesktop.swingx.JXDatePicker;
+
+public class PeriodSearchPanel extends JPanel {
+
+ private static final Log log =
+ LogFactory.getLog(PeriodSearchPanel.class);
+
+ protected FinancialTransactionSearchViewHandler handler;
+
+ public PeriodSearchPanel(FinancialTransactionSearchViewHandler handler) {
+ this.handler = handler;
+ refresh(ComboBoxPeriodEnum.DATE);
+ }
+
+ static final long serialVersionUID = 1L;
+
+ public void refresh(ComboBoxPeriodEnum comboBoxPeriodEnum){
+
+ switch (comboBoxPeriodEnum) {
+ case DATE:
+ Calendar calendar = Calendar.getInstance();
+ Date date = calendar.getTime();
+ date = DateUtils.truncate(date, Calendar.DATE);
+ JXDatePicker datePicker = new JXDatePicker(date);
+ this.removeAll();
+ this.add(datePicker);
+ break;
+
+ case PERIOD:
+ // get begin date
+ Calendar calendarBegin = Calendar.getInstance();
+ // set begindate to JAN 1 - 0:00.000 of this years
+ Date beginDate = calendarBegin.getTime();
+ beginDate = DateUtils.truncate(beginDate, Calendar.YEAR);
+ //handler().setBeginDate(beginDate);
+
+ // get end date
+ Calendar calendarEnd = Calendar.getInstance();
+ Date endDate = calendarEnd.getTime();
+ //handler().setEndDate(endDate);
+ JLabel beginDateLabel = new JLabel(_("lima.period.begindate"));
+ JXDatePicker beginDatePicker = new JXDatePicker(beginDate);
+ JLabel endDateLabel = new JLabel(_("lima.period.enddate"));
+ JXDatePicker endDatePicker = new JXDatePicker(endDate);
+ this.removeAll();
+ this.add(beginDateLabel);
+ this.add(beginDatePicker);
+ this.add(endDateLabel);
+ this.add(endDatePicker);
+ break;
+
+ case FISCAL_PERIOD:
+ FiscalPeriodComboBoxModel fiscalModel = new FiscalPeriodComboBoxModel();
+ FiscalPeriodComboBoxRenderer fiscalRenderer = new FiscalPeriodComboBoxRenderer();
+ JComboBox fiscalPeriod = new JComboBox(fiscalModel);
+ fiscalPeriod.setRenderer(fiscalRenderer);
+ fiscalPeriod.setEditable(false);
+ //fiscalPeriod.actionPerformed(handler.);
+ this.removeAll();
+ this.add(fiscalPeriod);
+ break;
+
+ case FINANCIAL_PERIOD:
+ FinancialPeriodComboBoxModel financialModel = new FinancialPeriodComboBoxModel();
+ FinancialPeriodComboBoxRenderer financialRenderer = new FinancialPeriodComboBoxRenderer();
+ JComboBox financialPeriod = new JComboBox(financialModel);
+ financialPeriod.setRenderer(financialRenderer);
+ financialPeriod.setEditable(false);
+ this.removeAll();
+ this.add(financialPeriod);
+ break;
+ }
+
+ }
+
+}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/OpeningViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/OpeningViewHandler.java 2010-08-17 15:34:26 UTC (rev 3005)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/OpeningViewHandler.java 2010-08-18 14:47:44 UTC (rev 3006)
@@ -20,12 +20,10 @@
import static org.nuiton.i18n.I18n._;
import java.awt.Color;
-
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import javax.swing.border.Border;
import javax.swing.border.EmptyBorder;
-
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.business.FiscalPeriodServiceMonitorable;
Modified: trunk/lima-swing/src/main/resources/i18n/lima-swing-en_GB.properties
===================================================================
--- trunk/lima-swing/src/main/resources/i18n/lima-swing-en_GB.properties 2010-08-17 15:34:26 UTC (rev 3005)
+++ trunk/lima-swing/src/main/resources/i18n/lima-swing-en_GB.properties 2010-08-18 14:47:44 UTC (rev 3006)
@@ -79,6 +79,7 @@
lima.entries=Entries
lima.entries.addtransaction=
lima.entries.lettering=
+lima.entries.searchtransaction=
lima.entries.searchunbalancedtransaction=
lima.entrybook=Entry Book
lima.entrybook.add=Add Entry Book
@@ -90,6 +91,18 @@
lima.entrybook.type3=
lima.entrybook.type4=
lima.entrybook.type5=
+lima.enum.comboboxaccount.account=
+lima.enum.comboboxaccount.accountlist=
+lima.enum.comboboxamount.both=
+lima.enum.comboboxamount.credit=
+lima.enum.comboboxamount.debit=
+lima.enum.comboboxoperator.equal=
+lima.enum.comboboxoperator.inferior=
+lima.enum.comboboxoperator.superior=
+lima.enum.comboboxperiod.date=
+lima.enum.comboboxperiod.financialperiod=
+lima.enum.comboboxperiod.fiscalperiod=
+lima.enum.comboboxperiod.period=
lima.error=Error
lima.error.errorpane.htmlmessage=<html><body><b>An application error happened</b>\:<br/>%s</body></html>
lima.error.errorpane.title=Lima error
@@ -218,6 +231,7 @@
lima.table.fiscalperiod=
lima.table.grossamount=
lima.table.label=
+lima.table.letter=
lima.table.move.credit=
lima.table.move.debit=
lima.table.netamount=
Modified: trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties
===================================================================
--- trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties 2010-08-17 15:34:26 UTC (rev 3005)
+++ trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties 2010-08-18 14:47:44 UTC (rev 3006)
@@ -74,6 +74,7 @@
lima.entries=Traitement
lima.entries.addtransaction=Saisir des \u00E9critures
lima.entries.lettering=Ajouter une lettre
+lima.entries.searchtransaction=Rechercher des \u00E9critures
lima.entries.searchunbalancedtransaction=Entr\u00E9es incorrect
lima.entrybook=Journal
lima.entrybook.add=Ajouter un journal
@@ -85,6 +86,18 @@
lima.entrybook.type3=Tr\u00E9sorerie
lima.entrybook.type4=G\u00E9n\u00E9ral
lima.entrybook.type5=Situation
+lima.enum.comboboxaccount.account=Compte
+lima.enum.comboboxaccount.accountlist=Liste de compte
+lima.enum.comboboxamount.both=Les deux
+lima.enum.comboboxamount.credit=Cr\u00E9dit
+lima.enum.comboboxamount.debit=D\u00E9bit
+lima.enum.comboboxoperator.equal=\u00C9gal
+lima.enum.comboboxoperator.inferior=Inf\u00E9rieur
+lima.enum.comboboxoperator.superior=Sup\u00E9rieur
+lima.enum.comboboxperiod.date=Date
+lima.enum.comboboxperiod.financialperiod=P\u00E9riode Financi\u00E8re
+lima.enum.comboboxperiod.fiscalperiod=Exercice
+lima.enum.comboboxperiod.period=P\u00E9riode
lima.error=Erreur
lima.error.errorpane.htmlmessage=<html><body><b>Une erreur s'est produite</b>\:<br/>%s</body></html>
lima.error.errorpane.title=Lima erreur
@@ -205,6 +218,7 @@
lima.table.fiscalperiod=Exercice
lima.table.grossamount=Brut
lima.table.label=Libell\u00E9
+lima.table.letter=Lettre
lima.table.move.credit=Mouvement au cr\u00E9dit
lima.table.move.debit=Mouvement au d\u00E9bit
lima.table.netamount=Net
1
0
Aug. 17, 2010
Author: jpepin
Date: 2010-08-17 17:34:26 +0200 (Tue, 17 Aug 2010)
New Revision: 3005
Url: http://chorem.org/repositories/revision/lima/3005
Log:
D?\195?\169bogue g?\195?\169n?\195?\169ration bilan - CR.
Plans comptable et BCR d?\195?\169finitifs.
Modified:
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialStatementServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ReportService.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ReportServiceLocal.java
trunk/lima-business/src/main/resources/i18n/lima-business-en_GB.properties
trunk/lima-business/src/main/resources/i18n/lima-business-fr_FR.properties
trunk/lima-callao/src/main/xmi/accounting.zargo
trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsViewHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTable.java
trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties
trunk/lima-swing/src/main/resources/import/bcr_base.csv
trunk/lima-swing/src/main/resources/import/bcr_developed.csv
trunk/lima-swing/src/main/resources/import/bcr_shortened.csv
trunk/lima-swing/src/main/resources/import/pcg_base.csv
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java 2010-08-16 13:11:52 UTC (rev 3004)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java 2010-08-17 15:34:26 UTC (rev 3005)
@@ -506,44 +506,16 @@
else {
TopiaQuery query = accountDAO.createQuery();
String subAccountsProperty = TopiaQuery.getProperty(Account.SUB_ACCOUNTS);
- String subLedgersProperty = TopiaQuery.getProperty(Account.SUB_LEDGERS);
+ //String subLedgersProperty = TopiaQuery.getProperty(Account.SUB_LEDGERS);
query.addWhere("not exists elements ("+subAccountsProperty+")")
//.addWhere("not exists elements ("+subLedgersProperty+")")
- .addWhere(Account.ACCOUNT_NUMBER, Op.LIKE, accountNumber+"%");
+ .addWhere(Account.ACCOUNT_NUMBER, Op.LIKE, accountNumber+"%");
List<Account> accountsResult = accountDAO.findAllByQuery(query);
if (accountsResult != null){
accounts.addAll(accountsResult);
}
}
}
- /*for (String accountNumber : accountNumbers) {
- if (subAccountsMode){
- Account account = accountDAO.findSubAccountByNumber(accountNumber);
- if (account == null){
- TopiaQuery query = accountDAO.createQuery();
- String subAccountsProperty = TopiaQuery.getProperty(Account.SUB_ACCOUNTS);
- String subLedgersProperty = TopiaQuery.getProperty(Account.SUB_LEDGERS);
- query.addWhere("not exists elements ("+subAccountsProperty+")")
- //.addWhere("not exists elements ("+subLedgersProperty+")")
- .addWhere(Account.ACCOUNT_NUMBER, Op.LIKE, accountNumber+"%");
- List<Account> accountsResult = accountDAO.findAllByQuery(query);
- if (accountsResult != null){
- accounts.addAll(accountsResult);
- }
- }
- //add account if exist
- else {
- accounts.add(account);
- }
- }
- else {
- Account account = accountDAO.findByAccountNumber(accountNumber);
- if (account != null){
- accounts.add(account);
- }
- }
-
- }*/
//remove all accounts
for (String accountNumber : accountNumbersToRemove) {
Account account = null;
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialStatementServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialStatementServiceImpl.java 2010-08-16 13:11:52 UTC (rev 3004)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialStatementServiceImpl.java 2010-08-17 15:34:26 UTC (rev 3005)
@@ -20,10 +20,8 @@
package org.chorem.lima.business.ejb;
import static org.nuiton.i18n.I18n._;
-
import java.math.BigDecimal;
import java.util.ArrayList;
-import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.StringTokenizer;
@@ -46,7 +44,6 @@
import org.chorem.lima.business.ejbinterface.FinancialStatementService;
import org.chorem.lima.business.ejbinterface.FinancialStatementServiceLocal;
import org.chorem.lima.business.ejbinterface.ReportServiceLocal;
-import org.chorem.lima.business.utils.AccountComparator;
import org.chorem.lima.entity.Account;
import org.chorem.lima.entity.AccountDAO;
import org.chorem.lima.entity.FinancialStatement;
@@ -476,13 +473,12 @@
for (Account account : accountsList) {
ReportsDatas reportsDatas = reportServiceLocal.
- generateAccountReportsWithTransaction(account,
+ generateAccountReportsWithTransaction(account, true,
selectedBeginDate, selectedEndDate, topiaContext);
BigDecimal tempAmount = new BigDecimal(0);
-
//check the way of financialstatement amount
//exemple compte de résultat : charge -> débit, produit -> crédit
- switch (financialStatementWayEnum) {
+ switch (financialStatementWayEnum) {
case BOTH:
tempAmount = tempAmount.add(reportsDatas.getAmountSolde());
break;
@@ -495,8 +491,8 @@
tempAmount = tempAmount.subtract(reportsDatas.getAmountDebit());
break;
}
-
- //add the calcul in function of list type: allaccounts, debit or credit
+
+ //add the calcul in function of list type: allaccounts, debit or credit
switch (debitCredit) {
case BOTH:
resAmount = resAmount.add(tempAmount);
@@ -512,6 +508,7 @@
}
break;
}
+
}
if (amount.doubleValue() == 0){
amount = resAmount;
@@ -531,7 +528,7 @@
@Override
public String checkFinancialStatementChart() throws LimaException {
- String result ="";
+ String result =_("lima-business.financialstatement.check.warn");
TopiaContext transaction = null;
try {
transaction = beginTransaction();
@@ -567,7 +564,8 @@
for (Account account : accountsList) {
- result += "NOT FOUND : "+account.getAccountNumber()+"\n";
+ result += _("lima-business.financialstatement.check.nothing")
+ + " : "+account.getAccountNumber()+" - "+account.getLabel()+"\n";
}
}
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java 2010-08-16 13:11:52 UTC (rev 3004)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java 2010-08-17 15:34:26 UTC (rev 3005)
@@ -417,11 +417,17 @@
FinancialTransaction financialTransaction =
entry.getFinancialTransaction();
- BigDecimal amountDebit = financialTransaction.getAmountDebit();
+ BigDecimal amountDebit = financialTransaction.getAmountDebit();
+ if (amountDebit == null){
+ amountDebit = new BigDecimal(0);
+ }
amountDebit = amountDebit.add(entryDebit);
financialTransaction.setAmountDebit(amountDebit);
BigDecimal amountCredit = financialTransaction.getAmountCredit();
+ if (amountCredit == null){
+ amountCredit = new BigDecimal(0);
+ }
amountCredit = amountCredit.add(entryCredit);
financialTransaction.setAmountCredit(amountCredit);
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java 2010-08-16 13:11:52 UTC (rev 3004)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java 2010-08-17 15:34:26 UTC (rev 3005)
@@ -193,7 +193,6 @@
CsvToBean<EntryEBPImpl> csv = new CsvToBean<EntryEBPImpl>();
List<EntryEBPImpl> list = csv.parse(strat, csvReader);
Collections.sort(list, new EntryEBPComparator());
- log.debug(list.size()+" list /n"+list);
// DAOs
AccountDAO accountDAO = LimaCallaoDAOHelper
@@ -240,9 +239,7 @@
else {
entry.setAccount(account);
BigDecimal debit = new BigDecimal(entryEBP.getDebit());
- log.debug(debit);
BigDecimal credit = new BigDecimal(entryEBP.getCredit());
- log.debug(credit);
if (debit.doubleValue() == 0) {
entry.setDebit(false);
entry.setAmount(credit);
@@ -870,7 +867,6 @@
for (Iterator<FinancialStatementImport> itr2 = financialStatementImports.iterator(); itr2.hasNext();) {
FinancialStatementImport financialStatementImport =
itr2.next();
- log.debug(financialStatementImport.getLabel());
String masterFinancialStatementLabel = financialStatementImport
.getMasterFinancialStatement();
FinancialStatement masterFinancialStatement = financialStatementDAO
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java 2010-08-16 13:11:52 UTC (rev 3004)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java 2010-08-17 15:34:26 UTC (rev 3005)
@@ -72,7 +72,7 @@
}
@Override
- public ReportsDatas generateAccountsReports(Account account, Date beginDate, Date endDate) throws LimaException {
+ public ReportsDatas generateAccountsReports(Account account, Boolean thirdPartAccountsMode, Date beginDate, Date endDate) throws LimaException {
ReportsDatas reportsDatas = null;
TopiaContext topiaTransaction = null;
@@ -80,7 +80,7 @@
topiaTransaction = beginTransaction();
reportsDatas =
- generateAccountReportsWithTransaction(account, beginDate,
+ generateAccountReportsWithTransaction(account, thirdPartAccountsMode, beginDate,
endDate, topiaTransaction);
}
catch (TopiaException ex) {
@@ -103,7 +103,7 @@
* - for a foldthirdparts accounts
*/
@Override
- public ReportsDatas generateAccountReportsWithTransaction (Account account, Date beginDate, Date endDate, TopiaContext topiaContext) throws LimaException{
+ public ReportsDatas generateAccountReportsWithTransaction (Account account, Boolean thirdPartAccountsMode, Date beginDate, Date endDate, TopiaContext topiaContext) throws LimaException{
ReportsDatas reportsDatas = new ReportsDatasImpl();
BigDecimal credit = new BigDecimal(0);
BigDecimal debit = new BigDecimal(0);
@@ -113,25 +113,29 @@
//Get allsubaccounts and thirdParts accounts
List<Account> accounts = (List<Account>) account.getSubAccounts();
- List<Account> thirdPartAccount = (List<Account>) account.getSubLedgers();
- if (thirdPartAccount != null){
- ReportsDatas subReportsDatas = generateSubAccountReportsWithTransaction(account,
- beginDate, endDate, topiaContext);
- entries.addAll(subReportsDatas.getListEntry());
- debit = debit.add(subReportsDatas.getAmountDebit());
- credit = credit.add(subReportsDatas.getAmountCredit());
- accounts.addAll(thirdPartAccount);
+ if (thirdPartAccountsMode){
+ List<Account> thirdPartAccount = (List<Account>) account.getSubLedgers();
+ if (thirdPartAccount != null){
+ ReportsDatas subReportsDatas = generateSubAccountReportsWithTransaction(account,
+ beginDate, endDate, topiaContext);
+
+ entries.addAll(subReportsDatas.getListEntry());
+ debit = debit.add(subReportsDatas.getAmountDebit());
+ credit = credit.add(subReportsDatas.getAmountCredit());
+ accounts.addAll(thirdPartAccount);
+ }
}
+
// is already subaccount
if (accounts.size() == 0){
reportsDatas = generateSubAccountReportsWithTransaction(account,
beginDate, endDate, topiaContext);
}
- // else is folder accounts contains many subs and thirds accoutns
+ // else is folder accounts contains many subs and thirds accounts
else {
for (Account subAccount : accounts) {
ReportsDatas subReportsDatas =
- generateAccountReportsWithTransaction(subAccount,
+ generateAccountReportsWithTransaction(subAccount, true,
beginDate,endDate, topiaContext);
debit = debit.add(subReportsDatas.getAmountDebit());
credit = credit.add(subReportsDatas.getAmountCredit());
@@ -266,7 +270,6 @@
List<Object[]> results = new ArrayList<Object[]>();
String queryAlias = "E";
if (beginDate != null && endDate != null){
- log.debug("solde 0 : "+solde);
try {
EntryDAO entryDAO= LimaCallaoDAOHelper.getEntryDAO(topiaContext);
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ReportService.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ReportService.java 2010-08-16 13:11:52 UTC (rev 3004)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ReportService.java 2010-08-17 15:34:26 UTC (rev 3005)
@@ -74,7 +74,7 @@
/**
* Generation du rapports des comptes
*/
- ReportsDatas generateAccountsReports(Account account, Date beginDate, Date endDate) throws LimaException;
+ ReportsDatas generateAccountsReports(Account account, Boolean thirdPartAccountsMode, Date beginDate, Date endDate) throws LimaException;
/**
* Generation du rapports des journaux
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ReportServiceLocal.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ReportServiceLocal.java 2010-08-16 13:11:52 UTC (rev 3004)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ReportServiceLocal.java 2010-08-17 15:34:26 UTC (rev 3005)
@@ -46,6 +46,6 @@
@Local
public interface ReportServiceLocal extends ReportService {
- public ReportsDatas generateAccountReportsWithTransaction (Account account, Date beginDate, Date endDate, TopiaContext topiaContext) throws LimaException;
+ public ReportsDatas generateAccountReportsWithTransaction (Account account, Boolean thirdPartAccountsMode, Date beginDate, Date endDate, TopiaContext topiaContext) throws LimaException;
}
Modified: trunk/lima-business/src/main/resources/i18n/lima-business-en_GB.properties
===================================================================
--- trunk/lima-business/src/main/resources/i18n/lima-business-en_GB.properties 2010-08-16 13:11:52 UTC (rev 3004)
+++ trunk/lima-business/src/main/resources/i18n/lima-business-en_GB.properties 2010-08-17 15:34:26 UTC (rev 3005)
@@ -40,6 +40,8 @@
lima-business.document.soldedebit=
lima-business.document.vatnumber=
lima-business.document.voucher=Voucher
+lima-business.financialstatement.check.nothing=
+lima-business.financialstatement.check.warn=
lima.business.document.date=Date
lima.config.configFileName.description=
lima.config.http-port=
Modified: trunk/lima-business/src/main/resources/i18n/lima-business-fr_FR.properties
===================================================================
--- trunk/lima-business/src/main/resources/i18n/lima-business-fr_FR.properties 2010-08-16 13:11:52 UTC (rev 3004)
+++ trunk/lima-business/src/main/resources/i18n/lima-business-fr_FR.properties 2010-08-17 15:34:26 UTC (rev 3005)
@@ -37,6 +37,8 @@
lima-business.document.soldedebit=Solde D\u00E9biteur
lima-business.document.vatnumber=N\u00B0 TVA
lima-business.document.voucher=Pi\u00E8ce comptable
+lima-business.financialstatement.check.nothing=Introuvable
+lima-business.financialstatement.check.warn=Attention cette fonctionnalit\u00E9 n'est qu'une aide utilisateur.\n Certains comptes ne doivent pas \u00EAtre pr\u00E9sent au bilan et compte de r\u00E9sultat.\n Il est donc normal que des comptes sont marqu\u00E9s comme introuvable.\n\n
lima.config.configFileName.description=
lima.config.http-port=
lima.config.httpport=
Modified: trunk/lima-callao/src/main/xmi/accounting.zargo
===================================================================
(Binary files differ)
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsViewHandler.java 2010-08-16 13:11:52 UTC (rev 3004)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsViewHandler.java 2010-08-17 15:34:26 UTC (rev 3005)
@@ -96,7 +96,7 @@
//avoid unnecessary call to service
if (selectedAccount != null){
try {
- results = reportService.generateAccountsReports(selectedAccount,
+ results = reportService.generateAccountsReports(selectedAccount, true,
selectedBeginDate, selectedEndDate);
}
catch (LimaException eee) {
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartView.jaxx 2010-08-16 13:11:52 UTC (rev 3004)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartView.jaxx 2010-08-17 15:34:26 UTC (rev 3005)
@@ -72,7 +72,7 @@
</row>
<row>
<cell fill="horizontal">
- <JButton id="checkButton" text="lima.financialstament.check"
+ <JButton id="checkButton" text="lima.financialstatement.check"
onActionPerformed="getHandler().financialStatementChartCheck()"/>
</cell>
</row>
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTable.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTable.java 2010-08-16 13:11:52 UTC (rev 3004)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTable.java 2010-08-17 15:34:26 UTC (rev 3005)
@@ -20,8 +20,12 @@
import java.awt.Color;
import java.awt.Component;
+import java.awt.event.FocusEvent;
+import java.awt.event.FocusListener;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseListener;
import java.math.BigDecimal;
import java.util.Date;
@@ -44,8 +48,7 @@
/**
* Table des transaction qui ajoute des comportement (keys).
*
- * @author ore
- * @author Rémi Chapelet
+ * @author jpepin
*/
public class FinancialTransactionTable extends JXTable implements KeyListener {
@@ -242,4 +245,5 @@
public void keyReleased(KeyEvent e) {
}
+
}
Modified: trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties
===================================================================
--- trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties 2010-08-16 13:11:52 UTC (rev 3004)
+++ trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties 2010-08-17 15:34:26 UTC (rev 3005)
@@ -93,9 +93,8 @@
lima.export.all=Exporter toutes les donn\u00E9es (XML)
lima.export.all.csv=Exporter toutes les donn\u00E9es (CSV)
lima.financialperiod.block=Cloturer une p\u00E9riode
-lima.financialstament.check=
lima.financialstatement.accounts=Liste de comptes au cr\u00E9dit et au d\u00E9bit
-lima.financialstatement.check=
+lima.financialstatement.check=V\u00E9rification des comptes aux postes
lima.financialstatement.credit=Sens du poste \: d\u00E9bit
lima.financialstatement.creditaccounts=Liste de comptes au cr\u00E9dit
lima.financialstatement.debitaccounts=Liste de comptes au d\u00E9bit
Modified: trunk/lima-swing/src/main/resources/import/bcr_base.csv
===================================================================
--- trunk/lima-swing/src/main/resources/import/bcr_base.csv 2010-08-16 13:11:52 UTC (rev 3004)
+++ trunk/lima-swing/src/main/resources/import/bcr_base.csv 2010-08-17 15:34:26 UTC (rev 3005)
@@ -1,134 +1,134 @@
-"FNST";"BILAN ACTIF";"true";"";"";"";"";"true";"false";""
-"FNST";"Capital Souscrit non appelé";"false";"109";" ";" ";" ";"false";"false";"BILAN ACTIF"
-"FNST";"BILAN PASSIF";"true";"";"";"";"";"true";"false";""
-"FNST";"CAPITAUX PROPRES";"true";"";"";"";"";"true";"false";"BILAN PASSIF"
-"FNST";"COMPTE DE RESULTAT";"true";"";"";"";"";"false";"false";""
-"FNST";"Capital (dont versé?)";"false";"101";"";"";"";"false";"false";"CAPITAUX PROPRES"
-"FNST";"CHARGES";"true";" ";" ";" ";" ";"true";"false";"COMPTE DE RESULTAT"
-"FNST";"PRODUITS";"true";"";"";"";"";"true";"false";"COMPTE DE RESULTAT"
-"FNST";"ACTIF IMMOBILISÉ";"true";" ";" ";" ";" ";"true";"false";"BILAN ACTIF"
-"FNST";"ACTIF CIRCULANT";"true";"";"";"";"";"true";"false";"BILAN ACTIF"
-"FNST";"CHARGES D'EXPLOITATION";"true";"";"";"";"";"true";"false";"CHARGES"
-"FNST";"Coût d'achat des marchandises";"true";"";"";"";"";"false";"true";"CHARGES D'EXPLOITATION"
-"FNST";"Stocks et en-cours";"true";"";"";"";"";"false";"true";"ACTIF CIRCULANT"
-"FNST";"Marchandises";"false";"37";"";"";"397";"false";"false";"Stocks et en-cours"
-"FNST";"Variations de stocks de march.";"false";"603";"";"";"";"false";"false";"Coût d'achat des marchandises"
-"FNST";"Achat de marchandises";"false";"607";"";"";"";"false";"false";"Coût d'achat des marchandises"
-"FNST";"Immobilisations incorporelles";"true";"";"";"";"";"false";"false";"ACTIF IMMOBILISÉ"
-"FNST";"Frais d'établissement";"false";"201";"";"";"2801";"false";"false";"Immobilisations incorporelles"
-"FNST";"Frais de recherche et développement";"false";"203";"";"";"2803";"false";"false";"Immobilisations incorporelles"
-"FNST";"Concessions, brevets, licences, marques, procédés, logiciels, droits et valeurs similaires";"false";"205";"";"";"2805, 2905";"false";"false";"Immobilisations incorporelles"
-"FNST";"Fonds commercial";"false";"206, 207";"";"";"2807, 2906, 2907";"false";"false";"Immobilisations incorporelles"
-"FNST";"Autres";"false";"208";"";"";"2808, 2908";"false";"false";"Immobilisations incorporelles"
-"FNST";"Immobilisations incorporelles en cours";"false";"232";"";"";"2932";"false";"false";"Immobilisations incorporelles"
-"FNST";"Avances et acomptes";"false";"237";"";"";"";"false";"false";"Immobilisations incorporelles"
-"FNST";"Immobilisations corporelles";"true";"";"";"";"";"false";"false";"ACTIF IMMOBILISÉ"
-"FNST";"Terrains";"false";"211, 212";"";"";"2811, 2812, 2911";"false";"false";"Immobilisations corporelles"
-"FNST";"Constructions";"false";"213, 214";"";"";"2813, 2814";"false";"false";"Immobilisations corporelles"
-"FNST";"Installations techniques, matériels, et outillage industriels";"false";"215";"";"";"2815";"false";"false";"Immobilisations corporelles"
-"FNST";"Immobilisations corporelles en cours";"false";"231";"";"";"2931";"false";"false";"Immobilisations corporelles"
-"FNST";"Immobilisations financières";"true";"";"";"";"";"false";"false";"ACTIF IMMOBILISÉ"
-"FNST";"Participations";"false";"261, 266";"";"";"2961, 2966";"false";"false";"Immobilisations financières"
-"FNST";"Créances rattachées à des participations";"false";"267, 268";"";"";"2967, 2968";"false";"false";"Immobilisations financières"
-"FNST";"Titres immobilisés de l'activité de portefeuille";"false";"273";"";"";"2973";"false";"false";"Immobilisations financières"
-"FNST";"Autres titres immobilisés";"false";"271, 272, 27682";"";"";"2971, 2972";"false";"false";"Immobilisations financières"
-"FNST";"Prêts";"false";"274, 27684";"";"";"2974";"false";"false";"Immobilisations financières"
-"FNST";"Matières premières et autres approvisionnements";"false";"31, 32";"";"";"391, 392";"false";"false";"Stocks et en-cours"
-"FNST";"En cours de production (biens et services)";"false";"33, 34";"";"";"393, 394";"false";"false";"Stocks et en-cours"
-"FNST";"Produits intermédiaires et finis";"false";"35";"";"";"395";"false";"false";"Stocks et en-cours"
-"FNST";"Avances et acomptes versés sur commandes";"false";"4091";"";"";"";"false";"false";"ACTIF CIRCULANT"
-"FNST";"Créances";"true";"";"";"";"";"false";"false";"ACTIF CIRCULANT"
-"FNST";"Valeurs mobilières de placement";"true";"";"";"";"";"false";"false";"ACTIF CIRCULANT"
-"FNST";"Actions propres";"false";"502";"";"";"59";"false";"false";"Valeurs mobilières de placement"
-"FNST";"Autres titres";"false";"50 -502 -509";"";"";"59";"false";"false";"Valeurs mobilières de placement"
-"FNST";"Disponibilités";"false";"53, 54 -5181 -519";"51";"";"";"false";"false";"ACTIF CIRCULANT"
-"FNST";"Charges constatées d'avance";"false";"486";"";"";"";"false";"false";"ACTIF CIRCULANT"
-"FNST";"Instrument de trésorerie";"false";"";"52";"";"";"false";"false";"Valeurs mobilières de placement"
-"FNST";"Charges à répartir sur plusieurs exercices";"false";"481";"";"";"";"false";"false";"BILAN ACTIF"
-"FNST";"Primes de remboursement des emprunts";"false";"169";"";"";"";"false";"false";"BILAN ACTIF"
-"FNST";"Ecarts de conversion Actif";"false";"476";"";"";"";"false";"false";"BILAN ACTIF"
-"FNST";"Primes d'émission, de fusion, d'apport";"false";"104";"";"";"";"false";"false";"CAPITAUX PROPRES"
-"FNST";"Ecart de réévaluation";"false";"105";"";"";"";"false";"false";"CAPITAUX PROPRES"
-"FNST";"Ecart d'équivalence";"false";"107";"";"";"";"false";"false";"CAPITAUX PROPRES"
-"FNST";"Réserves";"true";"";"";"";"";"false";"false";"CAPITAUX PROPRES"
-"FNST";"Réserve légale";"false";"1061";"";"";"";"false";"false";"Réserves"
-"FNST";"Réserves statutaires ou contractuelles";"false";"1063";"";"";"";"false";"false";"Réserves"
-"FNST";"Réserves réglementées";"false";"1062, 1064";"";"";"";"false";"false";"Réserves"
-"FNST";"Report à nouveau";"false";"11";"";"";"";"false";"false";"CAPITAUX PROPRES"
-"FNST";"RÉSULTAT DE L'EXERCICE (BÉNÉFICE OU PERTE)";"false";"12";"";"";"";"false";"false";"CAPITAUX PROPRES"
-"FNST";"Subventions d'investissement";"false";"13";"";"";"";"false";"false";"CAPITAUX PROPRES"
-"FNST";"Provisions réglementées";"false";"14";"";"";"";"false";"false";"CAPITAUX PROPRES"
-"FNST";"AUTRES FONDS PROPRES";"true";"";"";"";"";"true";"false";"BILAN PASSIF"
-"FNST";"Produits des émissions de titres participatifs";"false";"1671";"";"";"";"false";"false";"AUTRES FONDS PROPRES"
-"FNST";"Avances conditionnées";"false";"1674";"";"";"";"false";"false";"AUTRES FONDS PROPRES"
-"FNST";"PROVISIONS POUR RISQUES ET CHARGES";"true";"";"";"";"";"true";"false";"BILAN PASSIF"
-"FNST";"Provisions pour risques";"false";"151";"";"";"";"false";"false";"PROVISIONS POUR RISQUES ET CHARGES"
-"FNST";"Provisions pour charges";"false";"15 -151";"";"";"";"false";"false";"PROVISIONS POUR RISQUES ET CHARGES"
-"FNST";"DETTES";"true";"";"";"";"";"true";"false";"BILAN PASSIF"
-"FNST";"Emprunts obligataires convertibles";"false";"161, 16881";"";"";"";"false";"false";"DETTES"
-"FNST";"Autres emprunts obligataires";"false";"163, 16683";"";"";"";"false";"false";"DETTES"
-"FNST";"Emprunts et dettes auprès établissements de crédits";"false";"164, 16684, 5181, 519";"";"512, 514, 517";"";"false";"false";"DETTES"
-"FNST";"Emprunts et dettes financières diverses";"false";"165, 166, 1675, 168, 16883, 17, 426 -16881 -457";"";"45";"";"false";"false";"DETTES"
-"FNST";"Avances et acomptes reçues sur commandes en cours";"false";"4191";"";"";"";"false";"false";"DETTES"
-"FNST";"Ecarts de conversion passif";"false";"477";"";"";"";"false";"false";"BILAN PASSIF"
-"FNST";"Coût d'achats de matières premières et autres approvisionnements";"true";"";"";"";"";"false";"false";"CHARGES D'EXPLOITATION"
-"FNST";"Achats de matières premières et autres approvisionnements";"false";"601, 602, 6081, 6082, 6091, 6092";"";"";"";"false";"false";"Coût d'achats de matières premières et autres approvisionnements"
-"FNST";"Variation des stock";"false";"6037";"";"";"";"false";"false";"Coût d'achats de matières premières et autres approvisionnements"
-"FNST";"Autres achats et charges externes";"false";"604, 605, 606, 6084, 6085, 6086, 6094, 6095, 6096, 61, 62";"";"";"";"false";"false";"CHARGES D'EXPLOITATION"
-"FNST";"Impôts, taxes et versements assimilés";"false";"63";"";"";"";"false";"false";"CHARGES D'EXPLOITATION"
-"FNST";"Salaires et traitements";"false";"641, 644, 648";"";"";"";"false";"false";"CHARGES D'EXPLOITATION"
-"FNST";"Charges sociales";"false";"645, 646, 647, 648";"";"";"";"false";"false";"CHARGES D'EXPLOITATION"
-"FNST";"Dotations aux amortis. & provisions";"true";" ";" ";" ";" ";"false";"true";"CHARGES D'EXPLOITATION"
-"FNST";"Autres charges";"false";"65 -655";"";"";"";"false";"false";"CHARGES D'EXPLOITATION"
-"FNST";"Quotes-parts de résultat sur opérations faites en commun";"false";"655";"";"";"";"false";"false";"CHARGES"
-"FNST";"Charges financières";"true";"";"";"";"";"false";"true";"CHARGES"
-"FNST";"Dotations aux amortissements et provisions";"false";"686";"";"";"";"false";"false";"Charges financières"
-"FNST";"Intérêts et charges assimilées";"false";"661, 664, 665, 668";"";"";"";"false";"false";"Charges financières"
-"FNST";"Différences négatives de change";"false";"666";"";"";"";"false";"false";"Charges financières"
-"FNST";"Charges nettes sur cessions de valeurs mobilières de placement";"false";"667";"";"";"";"false";"false";"Charges financières"
-"FNST";"Charges exceptionnelles";"true";"";"";"";"";"false";"true";"CHARGES"
-"FNST";"Sur opérations de gestion";"false";"671";"";"";"";"false";"false";"Charges exceptionnelles"
-"FNST";"Sur opérations en capital";"false";"675, 678";"";"";"";"false";"false";"Charges exceptionnelles"
-"FNST";"Dotations aux amortissements et aux provisions";"false";"687";"";"";"";"false";"false";"Charges exceptionnelles"
-"FNST";"Participation des salariés aux résultats";"false";"691";"";"";"";"false";"false";"CHARGES"
-"FNST";"Impôts sur les bénéfices";"false";"695, 697, 689, 698, 699, 789";"";"";"";"false";"false";"CHARGES"
-"FNST";"Produits d'exploitation";"true";"";"";"";"";"true";"false";"PRODUITS"
-"FNST";"Montant net Chiffre d'affaires";"true";"";"";"";"";"false";"true";"Produits d'exploitation"
-"FNST";"Production vendue (B&S)";"false";"70 -707 -708-7097";"";"";"";"false";"false";"Montant net Chiffre d'affaires"
-"FNST";"Ventes de marchandises";"false";"707, 708 -7097";"";"";"";"false";"false";"Montant net Chiffre d'affaires"
-"FNST";"Autres produits d'exploitation";"true";"";"";"";"";"false";"true";"Produits d'exploitation"
-"FNST";"Production stockée";"false";"713";"";"";"";"false";"false";"Autres produits d'exploitation"
-"FNST";"Production immobilisée";"false";"72, 73";"";"";"";"false";"false";"Autres produits d'exploitation"
-"FNST";"Subventions d'exploitation";"false";"74";"";"";"";"false";"false";"Autres produits d'exploitation"
-"FNST";"Reprises sur provisions (et amortissements), transferts de charges";"false";"781, 791";"";"";"";"false";"false";"Autres produits d'exploitation"
-"FNST";"Autres produits";"false";"75 -755";"";"";"";"false";"false";"Autres produits d'exploitation"
-"FNST";"Quote-parts de résultat sur opérations faites en commun";"false";"755";"";"";"";"false";"false";"PRODUITS"
-"FNST";"Produits financiers";"true";"";"";"";"";"false";"true";"PRODUITS"
-"FNST";"De participations";"false";"761";"";"";"";"false";"false";"Produits financiers"
-"FNST";"D'autres valeurs mobilières et créances de l'actif immobilisé";"false";"762";"";"";"";"false";"false";"Produits financiers"
-"FNST";"Autres intérêts et produits assimilés";"false";"763, 764, 765, 768";"";"";"";"false";"false";"Produits financiers"
-"FNST";"Reprises sur provisions et transfers de charges";"false";"786, 796";"";"";"";"false";"false";"Produits financiers"
-"FNST";"Différences positives de change";"false";"766";"";"";"";"false";"false";"Produits financiers"
-"FNST";"Produits nets sur cessions de valeurs mobilières de placement";"false";"767";"";"";"";"false";"false";"Produits financiers"
-"FNST";"Produits exceptionnels";"true";"";"";"";"";"false";"true";"PRODUITS"
-"FNST";"Reprises sur provisions et transferts de charges";"false";"787, 797";"";"";"";"false";"false";"Produits exceptionnels"
-"FNST";"Sur immobilisations : dotations aux amortissements";"false";"6811, 6812";"";"";"";"false";"false";"Dotations aux amortis. & provisions"
-"FNST";"Sur immobilisations : dotations aux provisions";"false";"6816";"";"";"";"false";"false";"Dotations aux amortis. & provisions"
-"FNST";"Sur actif circulant : dotations aux provisions";"false";"6817";"";"";"";"false";"false";"Dotations aux amortis. & provisions"
-"FNST";"Pour risques et charges : dotations aux provisions";"false";"6815";"";"";"";"false";"false";"Dotations aux amortis. & provisions"
-"FNST";"Créances Clients et Comptes rattachés";"false";"411, 413, 416, 418";;;"491";"false";"false";"Créances"
-"FNST";"Autres";"false";"4096, 4097, 4098, 425, 4287, 4387, 441, 4452, 4456, 44581, 44582, 44583, 44586, 4487, 462, 465, 467, 4687";"443, 444, 451, 455, 456, 458 -4562";"";"";"false";"false";"Créances"
-"FNST";"Capital souscrit et appelé, non versé";"false";"4562";"";"";"";"false";"false";"Créances"
-"FNST";"Autres";"false";"275, 2761, 27685, 27688";"";"";"2975, 2976";"false";"false";"Immobilisations financières"
-"FNST";"Autres";"false";"218";"";"";"2818";"false";"false";"Immobilisations corporelles"
-"FNST";"Autres";"false";"1068";"";"";"";"false";"false";"Réserves"
-"FNST";"Autres";"false";"";"";"";"";"false";"false";"AUTRES FONDS PROPRES"
-"FNST";"Avances et acomptes";"false";"238";"";"";"";"false";"false";"Immobilisations corporelles"
-"FNST";"Sur opérations de gestion";"false";"771";"";"";"";"false";"false";"Produits exceptionnels"
-"FNST";"Sur opérations en capital";"false";"775, 777, 778";"";"";"";"false";"false";"Produits exceptionnels"
-"FNST";"Dettes Fournisseurs et Comptes rattachés";"false";"401, 403, 4081, 4088";;;;"false";"false";"DETTES"
-"FNST";"Dettes fiscales et sociales";"false";"421, 422, 424, 427, 4282, 4286, 43, 442, 4455, 4457, 44584, 44587, 446, 447, 4482, 4486, 457 -4387";"";"443, 444";;"false";"false";"DETTES"
-"FNST";"Dettes sur immobilisations et Comptes rattachés";"false";"269, 279, 404, 405, 4084, 4088";;;;"false";"false";"DETTES"
-"FNST";"Autres dettes";"false";"4196, 4197, 4198, 464, 4686, 509";"";"467, 478";;"false";"false";"DETTES"
-"FNST";"Instruments de trésorerie";"false";;"";"52";;"false";"false";"DETTES"
-"FNST";"Produits constatés d'avance";"false";"487";;;;"false";"false";"DETTES"
+"FNST";"BILAN ACTIF";"true";"";"";"";"";"true";"false";"";"BOTH"
+"FNST";"Capital Souscrit non appelé";"false";"109";" ";" ";" ";"false";"false";"BILAN ACTIF";""
+"FNST";"BILAN PASSIF";"true";"";"";"";"";"true";"false";"";"BOTH"
+"FNST";"CAPITAUX PROPRES";"true";"";"";"";"";"true";"false";"BILAN PASSIF";"BOTH"
+"FNST";"COMPTE DE RESULTAT";"true";"";"";"";"";"false";"false";"";"BOTH"
+"FNST";"Capital (dont versé?)";"false";"101, 108";"";"";"";"false";"false";"CAPITAUX PROPRES";""
+"FNST";"CHARGES";"true";" ";" ";" ";" ";"true";"false";"COMPTE DE RESULTAT";"DEBIT"
+"FNST";"PRODUITS";"true";"";"";"";"";"true";"false";"COMPTE DE RESULTAT";"CREDIT"
+"FNST";"ACTIF IMMOBILISÉ";"true";" ";" ";" ";" ";"true";"false";"BILAN ACTIF";"BOTH"
+"FNST";"ACTIF CIRCULANT";"true";"";"";"";"";"true";"false";"BILAN ACTIF";"BOTH"
+"FNST";"CHARGES D'EXPLOITATION";"true";"";"";"";"";"true";"false";"CHARGES";"DEBIT"
+"FNST";"Coût d'achat des marchandises";"true";"";"";"";"";"false";"true";"CHARGES D'EXPLOITATION";"DEBIT"
+"FNST";"Stocks et en-cours";"true";"";"";"";"";"false";"true";"ACTIF CIRCULANT";"BOTH"
+"FNST";"Marchandises";"false";"37";"";"";"397";"false";"false";"Stocks et en-cours";""
+"FNST";"Variations de stocks de march.";"false";"6037";"";"";"";"false";"false";"Coût d'achat des marchandises";""
+"FNST";"Achat de marchandises";"false";"607, 6097";"";"";"";"false";"false";"Coût d'achat des marchandises";""
+"FNST";"Immobilisations incorporelles";"true";"";"";"";"";"false";"false";"ACTIF IMMOBILISÉ";"BOTH"
+"FNST";"Frais d'établissement";"false";"201";"";"";"2801";"false";"false";"Immobilisations incorporelles";""
+"FNST";"Frais de recherche et développement";"false";"203";"";"";"2803";"false";"false";"Immobilisations incorporelles";""
+"FNST";"Concessions, brevets, licences, marques, procédés, logiciels, droits et valeurs similaires";"false";"205";"";"";"2805, 2905";"false";"false";"Immobilisations incorporelles";""
+"FNST";"Fonds commercial";"false";"206, 207";"";"";"2807, 2906, 2907";"false";"false";"Immobilisations incorporelles";""
+"FNST";"Autres";"false";"208";"";"";"2808, 2908";"false";"false";"Immobilisations incorporelles";""
+"FNST";"Immobilisations incorporelles en cours";"false";"232";"";"";"2932";"false";"false";"Immobilisations incorporelles";""
+"FNST";"Avances et acomptes";"false";"237";"";"";"";"false";"false";"Immobilisations incorporelles";""
+"FNST";"Immobilisations corporelles";"true";"";"";"";"";"false";"false";"ACTIF IMMOBILISÉ";"BOTH"
+"FNST";"Terrains";"false";"211, 212";"";"";"2811, 2812, 2911";"false";"false";"Immobilisations corporelles";""
+"FNST";"Constructions";"false";"213, 214";"";"";"2813, 2814";"false";"false";"Immobilisations corporelles";""
+"FNST";"Installations techniques, matériels, et outillage industriels";"false";"215";"";"";"2815";"false";"false";"Immobilisations corporelles";""
+"FNST";"Immobilisations corporelles en cours";"false";"231";"";"";"2931";"false";"false";"Immobilisations corporelles";""
+"FNST";"Immobilisations financières";"true";"";"";"";"";"false";"false";"ACTIF IMMOBILISÉ";"BOTH"
+"FNST";"Participations";"false";"261, 266";"";"";"2961, 2966";"false";"false";"Immobilisations financières";""
+"FNST";"Créances rattachées à des participations";"false";"267, 268";"";"";"2967, 2968";"false";"false";"Immobilisations financières";""
+"FNST";"Titres immobilisés de l'activité de portefeuille";"false";"273";"";"";"2973";"false";"false";"Immobilisations financières";""
+"FNST";"Autres titres immobilisés";"false";"271, 272, 27682";"";"";"2971, 2972";"false";"false";"Immobilisations financières";""
+"FNST";"Prêts";"false";"274, 27684";"";"";"2974";"false";"false";"Immobilisations financières";""
+"FNST";"Matières premières et autres approvisionnements";"false";"31, 32";"";"";"391, 392";"false";"false";"Stocks et en-cours";""
+"FNST";"En cours de production (biens et services)";"false";"33, 34";"";"";"393, 394";"false";"false";"Stocks et en-cours";""
+"FNST";"Produits intermédiaires et finis";"false";"35";"";"";"395";"false";"false";"Stocks et en-cours";""
+"FNST";"Avances et acomptes versés sur commandes";"false";"4091";"";"";"";"false";"false";"ACTIF CIRCULANT";""
+"FNST";"Créances";"true";"";"";"";"";"false";"false";"ACTIF CIRCULANT";"BOTH"
+"FNST";"Valeurs mobilières de placement";"true";"";"";"";"";"false";"false";"ACTIF CIRCULANT";"BOTH"
+"FNST";"Actions propres";"false";"502";"";"";"59";"false";"false";"Valeurs mobilières de placement";""
+"FNST";"Autres titres";"false";"50 -502 -509";"";"";"59";"false";"false";"Valeurs mobilières de placement";""
+"FNST";"Disponibilités";"false";"53, 54";"51 -5181 -519";"";"";"false";"false";"ACTIF CIRCULANT";""
+"FNST";"Charges constatées d'avance";"false";"486";"";"";"";"false";"false";"ACTIF CIRCULANT";""
+"FNST";"Instrument de trésorerie";"false";"";"52";"";"";"false";"false";"Valeurs mobilières de placement";""
+"FNST";"Charges à répartir sur plusieurs exercices";"false";"481";"";"";"";"false";"false";"BILAN ACTIF";""
+"FNST";"Primes de remboursement des emprunts";"false";"169";"";"";"";"false";"false";"BILAN ACTIF";""
+"FNST";"Ecarts de conversion Actif";"false";"476";"";"";"";"false";"false";"BILAN ACTIF";""
+"FNST";"Primes d'émission, de fusion, d'apport";"false";"104";"";"";"";"false";"false";"CAPITAUX PROPRES";""
+"FNST";"Ecart de réévaluation";"false";"105";"";"";"";"false";"false";"CAPITAUX PROPRES";""
+"FNST";"Ecart d'équivalence";"false";"107";"";"";"";"false";"false";"CAPITAUX PROPRES";""
+"FNST";"Réserves";"true";"";"";"";"";"false";"false";"CAPITAUX PROPRES";"BOTH"
+"FNST";"Réserve légale";"false";"1061";"";"";"";"false";"false";"Réserves";""
+"FNST";"Réserves statutaires ou contractuelles";"false";"1063";"";"";"";"false";"false";"Réserves";""
+"FNST";"Réserves réglementées";"false";"1062, 1064";"";"";"";"false";"false";"Réserves";""
+"FNST";"Report à nouveau";"false";"110-119";"";"";"";"false";"false";"CAPITAUX PROPRES";""
+"FNST";"RÉSULTAT DE L'EXERCICE (BÉNÉFICE OU PERTE)";"false";"7-6";"";"";"";"false";"false";"CAPITAUX PROPRES";""
+"FNST";"Subventions d'investissement";"false";"13";"";"";"";"false";"false";"CAPITAUX PROPRES";""
+"FNST";"Provisions réglementées";"false";"14";"";"";"";"false";"false";"CAPITAUX PROPRES";""
+"FNST";"AUTRES FONDS PROPRES";"true";"";"";"";"";"true";"false";"BILAN PASSIF";"BOTH"
+"FNST";"Produits des émissions de titres participatifs";"false";"1671";"";"";"";"false";"false";"AUTRES FONDS PROPRES";""
+"FNST";"Avances conditionnées";"false";"1674";"";"";"";"false";"false";"AUTRES FONDS PROPRES";""
+"FNST";"PROVISIONS POUR RISQUES ET CHARGES";"true";"";"";"";"";"true";"false";"BILAN PASSIF";"BOTH"
+"FNST";"Provisions pour risques";"false";"151";"";"";"";"false";"false";"PROVISIONS POUR RISQUES ET CHARGES";""
+"FNST";"Provisions pour charges";"false";"15 -151";"";"";"";"false";"false";"PROVISIONS POUR RISQUES ET CHARGES";""
+"FNST";"DETTES";"true";"";"";"";"";"true";"false";"BILAN PASSIF";"BOTH"
+"FNST";"Emprunts obligataires convertibles";"false";"161, 16881";"";"";"";"false";"false";"DETTES";""
+"FNST";"Autres emprunts obligataires";"false";"163, 16683";"";"";"";"false";"false";"DETTES";""
+"FNST";"Emprunts et dettes auprès établissements de crédits";"false";"164, 16684, 5181, 519";"";"512, 514, 517";"";"false";"false";"DETTES";""
+"FNST";"Emprunts et dettes financières diverses";"false";"165, 166, 1675, 168, 16883, 17, 426 -16881 -457";"";"45";"";"false";"false";"DETTES";""
+"FNST";"Avances et acomptes reçues sur commandes en cours";"false";"4191";"";"";"";"false";"false";"DETTES";""
+"FNST";"Ecarts de conversion passif";"false";"477";"";"";"";"false";"false";"BILAN PASSIF";""
+"FNST";"Coût d'achats de matières premières et autres approvisionnements";"true";"";"";"";"";"false";"true";"CHARGES D'EXPLOITATION";"DEBIT"
+"FNST";"Achats de matières premières et autres approvisionnements";"false";"601, 602, 608, 6091, 6092";"";"";"";"false";"false";"Coût d'achats de matières premières et autres approvisionnements";""
+"FNST";"Variation des stock d'approv.";"false";"6031, 6032";"";"";"";"false";"false";"Coût d'achats de matières premières et autres approvisionnements";""
+"FNST";"Autres achats et charges externes";"false";"604, 605, 606, 6094, 6095, 6096, 61, 62";"";"";"";"false";"false";"CHARGES D'EXPLOITATION";""
+"FNST";"Impôts, taxes et versements assimilés";"false";"63";"";"";"";"false";"false";"CHARGES D'EXPLOITATION";""
+"FNST";"Salaires et traitements";"false";"641, 644, 648";"";"";"";"false";"false";"CHARGES D'EXPLOITATION";""
+"FNST";"Charges sociales";"false";"645, 646, 647, 648";"";"";"";"false";"false";"CHARGES D'EXPLOITATION";""
+"FNST";"Dotations aux amortis. & provisions";"true";" ";" ";" ";" ";"false";"true";"CHARGES D'EXPLOITATION";"DEBIT"
+"FNST";"Autres charges";"false";"65 -655";"";"";"";"false";"false";"CHARGES D'EXPLOITATION";""
+"FNST";"Quotes-parts de résultat sur opérations faites en commun";"false";"655";"";"";"";"false";"false";"CHARGES";""
+"FNST";"Charges financières";"true";"";"";"";"";"false";"true";"CHARGES";"DEBIT"
+"FNST";"Dotations aux amortissements et provisions";"false";"686";"";"";"";"false";"false";"Charges financières";""
+"FNST";"Intérêts et charges assimilées";"false";"661, 664, 665, 668";"";"";"";"false";"false";"Charges financières";""
+"FNST";"Différences négatives de change";"false";"666";"";"";"";"false";"false";"Charges financières";""
+"FNST";"Charges nettes sur cessions de valeurs mobilières de placement";"false";"667";"";"";"";"false";"false";"Charges financières";""
+"FNST";"Charges exceptionnelles";"true";"";"";"";"";"false";"true";"CHARGES";"DEBIT"
+"FNST";"Sur opérations de gestion";"false";"671";"";"";"";"false";"false";"Charges exceptionnelles";""
+"FNST";"Sur opérations en capital";"false";"675, 678";"";"";"";"false";"false";"Charges exceptionnelles";""
+"FNST";"Dotations aux amortissements et aux provisions";"false";"687";"";"";"";"false";"false";"Charges exceptionnelles";""
+"FNST";"Participation des salariés aux résultats";"false";"691";"";"";"";"false";"false";"CHARGES";""
+"FNST";"Impôts sur les bénéfices";"false";"695, 697, 689, 698, 699, 789";"";"";"";"false";"false";"CHARGES";""
+"FNST";"Produits d'exploitation";"true";"";"";"";"";"true";"false";"PRODUITS";"CREDIT"
+"FNST";"Montant net Chiffre d'affaires";"true";"";"";"";"";"false";"true";"Produits d'exploitation";"CREDIT"
+"FNST";"Production vendue (B&S)";"false";"70 -707 -708 -7097";"";"";"";"false";"false";"Montant net Chiffre d'affaires";""
+"FNST";"Ventes de marchandises";"false";"707, 708 -7097";"";"";"";"false";"false";"Montant net Chiffre d'affaires";""
+"FNST";"Autres produits d'exploitation";"true";"";"";"";"";"false";"true";"Produits d'exploitation";"CREDIT"
+"FNST";"Production stockée";"false";"713";"";"";"";"false";"false";"Autres produits d'exploitation";""
+"FNST";"Production immobilisée";"false";"72, 73";"";"";"";"false";"false";"Autres produits d'exploitation";""
+"FNST";"Subventions d'exploitation";"false";"74";"";"";"";"false";"false";"Autres produits d'exploitation";""
+"FNST";"Reprises sur provisions (et amortissements), transferts de charges";"false";"781, 791";"";"";"";"false";"false";"Autres produits d'exploitation";""
+"FNST";"Autres produits";"false";"75 -755";"";"";"";"false";"false";"Autres produits d'exploitation";""
+"FNST";"Quote-parts de résultat sur opérations faites en commun";"false";"755";"";"";"";"false";"false";"PRODUITS";""
+"FNST";"Produits financiers";"true";"";"";"";"";"false";"true";"PRODUITS";"CREDIT"
+"FNST";"De participations";"false";"761";"";"";"";"false";"false";"Produits financiers";""
+"FNST";"D'autres valeurs mobilières et créances de l'actif immobilisé";"false";"762";"";"";"";"false";"false";"Produits financiers";""
+"FNST";"Autres intérêts et produits assimilés";"false";"763, 764, 765, 768";"";"";"";"false";"false";"Produits financiers";""
+"FNST";"Reprises sur provisions et transfers de charges";"false";"786, 796";"";"";"";"false";"false";"Produits financiers";""
+"FNST";"Différences positives de change";"false";"766";"";"";"";"false";"false";"Produits financiers";""
+"FNST";"Produits nets sur cessions de valeurs mobilières de placement";"false";"767";"";"";"";"false";"false";"Produits financiers";""
+"FNST";"Produits exceptionnels";"true";"";"";"";"";"false";"true";"PRODUITS";"CREDIT"
+"FNST";"Reprises sur provisions et transferts de charges";"false";"787, 797";"";"";"";"false";"false";"Produits exceptionnels";""
+"FNST";"Sur immobilisations : dotations aux amortissements";"false";"6811, 6812";"";"";"";"false";"false";"Dotations aux amortis. & provisions";""
+"FNST";"Sur immobilisations : dotations aux provisions";"false";"6816";"";"";"";"false";"false";"Dotations aux amortis. & provisions";""
+"FNST";"Sur actif circulant : dotations aux provisions";"false";"6817";"";"";"";"false";"false";"Dotations aux amortis. & provisions";""
+"FNST";"Pour risques et charges : dotations aux provisions";"false";"6815";"";"";"";"false";"false";"Dotations aux amortis. & provisions";""
+"FNST";"Créances Clients et Comptes rattachés";"false";"410, 411, 413, 416, 418";"";"";"491";"false";"false";"Créances";""
+"FNST";"Capital souscrit et appelé, non versé";"false";"4562";"";"";"";"false";"false";"Créances";""
+"FNST";"Dettes Fournisseurs et Comptes rattachés";"false";"400, 401, 403, 4081, 4088";"";"";"";"false";"false";"DETTES";""
+"FNST";"Dettes fiscales et sociales";"false";"421, 422, 424, 427, 4282, 4286, 43, 442, 4455, 4457, 44584, 44587, 446, 447, 4482, 4486, 457 -4387";"";"443, 444";"";"false";"false";"DETTES";""
+"FNST";"Dettes sur immobilisations et Comptes rattachés";"false";"269, 279, 404, 405, 4084, 4088";"";"";"";"false";"false";"DETTES";""
+"FNST";"Autres dettes";"false";"4196, 4197, 4198, 464, 4686, 509";"";"467, 478";"";"false";"false";"DETTES";""
+"FNST";"Instruments de trésorerie";"false";"";"";"52";"";"false";"false";"DETTES";""
+"FNST";"Produits constatés d'avance";"false";"487";"";"";"";"false";"false";"DETTES";""
+"FNST";"Autres";"false";"4096, 4097, 4098, 425, 4287, 4387, 441, 4452, 4456, 44581, 44582, 44583, 44586, 4487, 462, 465, 467, 4687";"443, 444, 451, 455, 456, 458 -4562";"";"495, 496";"false";"false";"Créances";""
+"FNST";"Autres";"false";"275, 2761, 27685, 27688";"";"";"2975, 2976";"false";"false";"Immobilisations financières";""
+"FNST";"Autres";"false";"218";"";"";"2818";"false";"false";"Immobilisations corporelles";""
+"FNST";"Autres";"false";"1068";"";"";"";"false";"false";"Réserves";""
+"FNST";"Autres";"false";"";"";"";"";"false";"false";"AUTRES FONDS PROPRES";""
+"FNST";"Avances et acomptes";"false";"238";"";"";"";"false";"false";"Immobilisations corporelles";""
+"FNST";"Sur opérations de gestion";"false";"771";"";"";"";"false";"false";"Produits exceptionnels";""
+"FNST";"Sur opérations en capital";"false";"775, 777, 778";"";"";"";"false";"false";"Produits exceptionnels";""
Modified: trunk/lima-swing/src/main/resources/import/bcr_developed.csv
===================================================================
--- trunk/lima-swing/src/main/resources/import/bcr_developed.csv 2010-08-16 13:11:52 UTC (rev 3004)
+++ trunk/lima-swing/src/main/resources/import/bcr_developed.csv 2010-08-17 15:34:26 UTC (rev 3005)
@@ -1,138 +1,159 @@
-"FNST";"BILAN ACTIF";"true";"";"";"";"";"true";"false";""
-"FNST";"Capital Souscrit non appelé";"false";"109";" ";" ";" ";"false";"false";"BILAN ACTIF"
-"FNST";"BILAN PASSIF";"true";"";"";"";"";"true";"false";""
-"FNST";"CAPITAUX PROPRES";"true";"";"";"";"";"true";"false";"BILAN PASSIF"
-"FNST";"COMPTE DE RESULTAT";"true";"";"";"";"";"false";"false";""
-"FNST";"Capital (dont versé?)";"false";"101";"";"";"";"false";"false";"CAPITAUX PROPRES"
-"FNST";"CHARGES";"true";" ";" ";" ";" ";"true";"false";"COMPTE DE RESULTAT"
-"FNST";"PRODUITS";"true";"";"";"";"";"true";"false";"COMPTE DE RESULTAT"
-"FNST";"ACTIF IMMOBILISÉ";"true";" ";" ";" ";" ";"true";"false";"BILAN ACTIF"
-"FNST";"ACTIF CIRCULANT";"true";"";"";"";"";"true";"false";"BILAN ACTIF"
-"FNST";"CHARGES D'EXPLOITATION";"true";"";"";"";"";"true";"false";"CHARGES"
-"FNST";"Coût d'achat des marchandises";"true";"";"";"";"";"false";"true";"CHARGES D'EXPLOITATION"
-"FNST";"Stocks et en-cours";"true";"";"";"";"";"false";"true";"ACTIF CIRCULANT"
-"FNST";"Marchandises";"false";"37";"";"";"397";"false";"false";"Stocks et en-cours"
-"FNST";"Variations de stocks de march.";"false";"603";"";"";"";"false";"false";"Coût d'achat des marchandises"
-"FNST";"Achat de marchandises";"false";"607";"";"";"";"false";"false";"Coût d'achat des marchandises"
-"FNST";"Immobilisations incorporelles";"true";"";"";"";"";"false";"false";"ACTIF IMMOBILISÉ"
-"FNST";"Frais d'établissement";"false";"201";"";"";"2801";"false";"false";"Immobilisations incorporelles"
-"FNST";"Frais de recherche et développement";"false";"203";"";"";"2803";"false";"false";"Immobilisations incorporelles"
-"FNST";"Concessions, brevets, licences, marques, procédés, logiciels, droits et valeurs similaires";"false";"205";"";"";"2805, 2905";"false";"false";"Immobilisations incorporelles"
-"FNST";"Fonds commercial";"false";"206, 207";"";"";"2807, 2906, 2907";"false";"false";"Immobilisations incorporelles"
-"FNST";"Autres";"false";"208";"";"";"2808, 2908";"false";"false";"Immobilisations incorporelles"
-"FNST";"Immobilisations incorporelles en cours";"false";"232";"";"";"2932";"false";"false";"Immobilisations incorporelles"
-"FNST";"Avances et acomptes";"false";"237";"";"";"";"false";"false";"Immobilisations incorporelles"
-"FNST";"Immobilisations corporelles";"true";"";"";"";"";"false";"false";"ACTIF IMMOBILISÉ"
-"FNST";"Terrains";"false";"211, 212";"";"";"2811, 2812, 2911";"false";"false";"Immobilisations corporelles"
-"FNST";"Constructions";"false";"213, 214";"";"";"2813, 2814";"false";"false";"Immobilisations corporelles"
-"FNST";"Installations techniques, matériels, et outillage industriels";"false";"215";"";"";"2815";"false";"false";"Immobilisations corporelles"
-"FNST";"Immobilisations corporelles en cours";"false";"231";"";"";"2931";"false";"false";"Immobilisations corporelles"
-"FNST";"Immobilisations financières";"true";"";"";"";"";"false";"false";"ACTIF IMMOBILISÉ"
-"FNST";"Participations";"false";"261, 266";"";"";"2961, 2966";"false";"false";"Immobilisations financières"
-"FNST";"Créances rattachées à des participations";"false";"267, 268";"";"";"2967, 2968";"false";"false";"Immobilisations financières"
-"FNST";"Titres immobilisés de l'activité de portefeuille";"false";"273";"";"";"2973";"false";"false";"Immobilisations financières"
-"FNST";"Autres titres immobilisés";"false";"271, 272, 27682";"";"";"2971, 2972";"false";"false";"Immobilisations financières"
-"FNST";"Prêts";"false";"274, 27684";"";"";"2974";"false";"false";"Immobilisations financières"
-"FNST";"Matières premières et autres approvisionnements";"false";"31, 32";"";"";"391, 392";"false";"false";"Stocks et en-cours"
-"FNST";"En cours de production (biens et services)";"false";"33, 34";"";"";"393, 394";"false";"false";"Stocks et en-cours"
-"FNST";"Produits intermédiaires et finis";"false";"35";"";"";"395";"false";"false";"Stocks et en-cours"
-"FNST";"Avances et acomptes versés sur commandes";"false";"4091";"";"";"";"false";"false";"ACTIF CIRCULANT"
-"FNST";"Créances";"true";"";"";"";"";"false";"false";"ACTIF CIRCULANT"
-"FNST";"Valeurs mobilières de placement";"true";"";"";"";"";"false";"false";"ACTIF CIRCULANT"
-"FNST";"Actions propres";"false";"502";"";"";"59";"false";"false";"Valeurs mobilières de placement"
-"FNST";"Autres titres";"false";"50 -502 -509";"";"";"59";"false";"false";"Valeurs mobilières de placement"
-"FNST";"Disponibilités";"false";"53, 54 -5181 -519";"51";"";"";"false";"false";"ACTIF CIRCULANT"
-"FNST";"Charges constatées d'avance";"false";"486";"";"";"";"false";"false";"ACTIF CIRCULANT"
-"FNST";"Instrument de trésorerie";"false";"";"52";"";"";"false";"false";"Valeurs mobilières de placement"
-"FNST";"Charges à répartir sur plusieurs exercices";"false";"481";"";"";"";"false";"false";"BILAN ACTIF"
-"FNST";"Primes de remboursement des emprunts";"false";"169";"";"";"";"false";"false";"BILAN ACTIF"
-"FNST";"Ecarts de conversion Actif";"false";"476";"";"";"";"false";"false";"BILAN ACTIF"
-"FNST";"Primes d'émission, de fusion, d'apport";"false";"104";"";"";"";"false";"false";"CAPITAUX PROPRES"
-"FNST";"Ecart de réévaluation";"false";"105";"";"";"";"false";"false";"CAPITAUX PROPRES"
-"FNST";"Ecart d'équivalence";"false";"107";"";"";"";"false";"false";"CAPITAUX PROPRES"
-"FNST";"Réserves";"true";"";"";"";"";"false";"false";"CAPITAUX PROPRES"
-"FNST";"Réserve légale";"false";"1061";"";"";"";"false";"false";"Réserves"
-"FNST";"Réserves statutaires ou contractuelles";"false";"1063";"";"";"";"false";"false";"Réserves"
-"FNST";"Réserves réglementées";"false";"1062, 1064";"";"";"";"false";"false";"Réserves"
-"FNST";"Report à nouveau";"false";"11";"";"";"";"false";"false";"CAPITAUX PROPRES"
-"FNST";"RÉSULTAT DE L'EXERCICE (BÉNÉFICE OU PERTE)";"false";"12";"";"";"";"false";"false";"CAPITAUX PROPRES"
-"FNST";"Subventions d'investissement";"false";"13";"";"";"";"false";"false";"CAPITAUX PROPRES"
-"FNST";"Provisions réglementées";"false";"14";"";"";"";"false";"false";"CAPITAUX PROPRES"
-"FNST";"AUTRES FONDS PROPRES";"true";"";"";"";"";"true";"false";"BILAN PASSIF"
-"FNST";"Produits des émissions de titres participatifs";"false";"1671";"";"";"";"false";"false";"AUTRES FONDS PROPRES"
-"FNST";"Avances conditionnées";"false";"1674";"";"";"";"false";"false";"AUTRES FONDS PROPRES"
-"FNST";"PROVISIONS POUR RISQUES ET CHARGES";"true";"";"";"";"";"true";"false";"BILAN PASSIF"
-"FNST";"Provisions pour risques";"false";"151";"";"";"";"false";"false";"PROVISIONS POUR RISQUES ET CHARGES"
-"FNST";"Provisions pour charges";"false";"15 -151";"";"";"";"false";"false";"PROVISIONS POUR RISQUES ET CHARGES"
-"FNST";"DETTES";"true";"";"";"";"";"true";"false";"BILAN PASSIF"
-"FNST";"Emprunts obligataires convertibles";"false";"161, 16881";"";"";"";"false";"false";"DETTES"
-"FNST";"Autres emprunts obligataires";"false";"163, 16683";"";"";"";"false";"false";"DETTES"
-"FNST";"Emprunts et dettes auprès établissements de crédits";"false";"164, 16684, 5181, 519";"";"512, 514, 517";"";"false";"false";"DETTES"
-"FNST";"Emprunts et dettes financières diverses";"false";"165, 166, 1675, 168, 16883, 17, 426 -16881 -457";"";"45";"";"false";"false";"DETTES"
-"FNST";"Avances et acomptes reçues sur commandes en cours";"false";"4191";"";"";"";"false";"false";"DETTES"
-"FNST";"Ecarts de conversion passif";"false";"477";"";"";"";"false";"false";"BILAN PASSIF"
-"FNST";"Coût d'achats de matières premières et autres approvisionnements";"true";"";"";"";"";"false";"false";"CHARGES D'EXPLOITATION"
-"FNST";"Achats de matières premières et autres approvisionnements";"false";"601, 602, 6081, 6082, 6091, 6092";"";"";"";"false";"false";"Coût d'achats de matières premières et autres approvisionnements"
-"FNST";"Variation des stock";"false";"6037";"";"";"";"false";"false";"Coût d'achats de matières premières et autres approvisionnements"
-"FNST";"Autres achats et charges externes";"false";"604, 605, 606, 6084, 6085, 6086, 6094, 6095, 6096, 61, 62";"";"";"";"false";"false";"CHARGES D'EXPLOITATION"
-"FNST";"Impôts, taxes et versements assimilés";"false";"63";"";"";"";"false";"false";"CHARGES D'EXPLOITATION"
-"FNST";"Salaires et traitements";"false";"641, 644, 648";"";"";"";"false";"false";"CHARGES D'EXPLOITATION"
-"FNST";"Charges sociales";"false";"645, 646, 647, 648";"";"";"";"false";"false";"CHARGES D'EXPLOITATION"
-"FNST";"Dotations aux amortis. & provisions";"true";" ";" ";" ";" ";"false";"true";"CHARGES D'EXPLOITATION"
-"FNST";"Autres charges";"false";"65 -655";"";"";"";"false";"false";"CHARGES D'EXPLOITATION"
-"FNST";"Quotes-parts de résultat sur opérations faites en commun";"false";"655";"";"";"";"false";"false";"CHARGES"
-"FNST";"Charges financières";"true";"";"";"";"";"false";"true";"CHARGES"
-"FNST";"Dotations aux amortissements et provisions";"false";"686";"";"";"";"false";"false";"Charges financières"
-"FNST";"Intérêts et charges assimilées";"false";"661, 664, 665, 668";"";"";"";"false";"false";"Charges financières"
-"FNST";"Différences négatives de change";"false";"666";"";"";"";"false";"false";"Charges financières"
-"FNST";"Charges nettes sur cessions de valeurs mobilières de placement";"false";"667";"";"";"";"false";"false";"Charges financières"
-"FNST";"Charges exceptionnelles";"true";"";"";"";"";"false";"true";"CHARGES"
-"FNST";"Sur opérations de gestion";"false";"671";"";"";"";"false";"false";"Charges exceptionnelles"
-"FNST";"Sur opérations en capital";"false";"675, 678";"";"";"";"false";"false";"Charges exceptionnelles"
-"FNST";"Dotations aux amortissements et aux provisions";"false";"687";"";"";"";"false";"false";"Charges exceptionnelles"
-"FNST";"Participation des salariés aux résultats";"false";"691";"";"";"";"false";"false";"CHARGES"
-"FNST";"Impôts sur les bénéfices";"false";"695, 697, 689, 698, 699, 789";"";"";"";"false";"false";"CHARGES"
-"FNST";"Produits d'exploitation";"true";"";"";"";"";"true";"false";"PRODUITS"
-"FNST";"Montant net Chiffre d'affaires";"true";"";"";"";"";"false";"true";"Produits d'exploitation"
-"FNST";"Production vendue (B&S)";"false";"70 -707 -708-7097";"";"";"";"false";"false";"Montant net Chiffre d'affaires"
-"FNST";"Ventes de marchandises";"false";"707, 708 -7097";"";"";"";"false";"false";"Montant net Chiffre d'affaires"
-"FNST";"Autres produits d'exploitation";"true";"";"";"";"";"false";"true";"Produits d'exploitation"
-"FNST";"Production stockée";"false";"713";"";"";"";"false";"false";"Autres produits d'exploitation"
-"FNST";"Production immobilisée";"false";"72, 73";"";"";"";"false";"false";"Autres produits d'exploitation"
-"FNST";"Subventions d'exploitation";"false";"74";"";"";"";"false";"false";"Autres produits d'exploitation"
-"FNST";"Reprises sur provisions (et amortissements), transferts de charges";"false";"781, 791";"";"";"";"false";"false";"Autres produits d'exploitation"
-"FNST";"Autres produits";"false";"75 -755";"";"";"";"false";"false";"Autres produits d'exploitation"
-"FNST";"Quote-parts de résultat sur opérations faites en commun";"false";"755";"";"";"";"false";"false";"PRODUITS"
-"FNST";"Produits financiers";"true";"";"";"";"";"false";"true";"PRODUITS"
-"FNST";"De participations";"false";"761";"";"";"";"false";"false";"Produits financiers"
-"FNST";"D'autres valeurs mobilières et créances de l'actif immobilisé";"false";"762";"";"";"";"false";"false";"Produits financiers"
-"FNST";"Autres intérêts et produits assimilés";"false";"763, 764, 765, 768";"";"";"";"false";"false";"Produits financiers"
-"FNST";"Reprises sur provisions et transfers de charges";"false";"786, 796";"";"";"";"false";"false";"Produits financiers"
-"FNST";"Différences positives de change";"false";"766";"";"";"";"false";"false";"Produits financiers"
-"FNST";"Produits nets sur cessions de valeurs mobilières de placement";"false";"767";"";"";"";"false";"false";"Produits financiers"
-"FNST";"Produits exceptionnels";"true";"";"";"";"";"false";"true";"PRODUITS"
-"FNST";"Reprises sur provisions et transferts de charges";"false";"787, 797";"";"";"";"false";"false";"Produits exceptionnels"
-"FNST";"Sur immobilisations : dotations aux amortissements";"false";"6811, 6812";"";"";"";"false";"false";"Dotations aux amortis. & provisions"
-"FNST";"Sur immobilisations : dotations aux provisions";"false";"6816";"";"";"";"false";"false";"Dotations aux amortis. & provisions"
-"FNST";"Sur actif circulant : dotations aux provisions";"false";"6817";"";"";"";"false";"false";"Dotations aux amortis. & provisions"
-"FNST";"Pour risques et charges : dotations aux provisions";"false";"6815";"";"";"";"false";"false";"Dotations aux amortis. & provisions"
-"FNST";"Créance d'exploitation";"true";"";"";"";"";"false";"false";"Créances"
-"FNST";"Créances clients et Comptes rattachés";"false";"411, 413, 416, 418";"";"";"491";"false";"false";"Créance d'exploitation"
-"FNST";"Créances diverses";"false";"4411, 4418, 4487, 4456, 462, 465, 4687";"443, 444, 451, 456, 458, 467 -4562";"";"";"false";"false";"Créances"
-"FNST";"Capital souscrit et appelé, non versé";"false";"4562";"";"";"";"false";"false";"Créances"
-"FNST";"Dettes d'exploitation";"true";"";"";"";"";"false";"false";"DETTES"
-"FNST";"Dettes fournisseurs et comptes rattachés";"false";"401, 403, 4081";"";"";"";"false";"false";"Dettes d'exploitation"
-"FNST";"Dettes fiscales et sociales";"false";"421, 422, 424, 427, 4282, 4286, 431, 437, 4386, 4455, 446, 447, 4486";"";"4458";"";"false";"false";"Dettes d'exploitation"
-"FNST";"Dettes diverses";"true";"";"";"";"";"false";"false";"DETTES"
-"FNST";"Dettes sur immobilisations et Comptes rattachés";"false";"269, 279, 404, 405, 4084";"";"";"";"false";"false";"Dettes diverses"
-"FNST";"Dettes fiscales (impôts sur les bénéfices)";"false";"";"";"444";"";"false";"false";"Dettes diverses"
-"FNST";"Autres";"false";"275, 2761, 27685, 27688";"";"";"2975, 2976";"false";"false";"Immobilisations financières"
-"FNST";"Autres";"false";"218";"";"";"2818";"false";"false";"Immobilisations corporelles"
-"FNST";"Autres";"false";"1068";"";"";"";"false";"false";"Réserves"
-"FNST";"Autres";"false";"";"";"";"";"false";"false";"AUTRES FONDS PROPRES"
-"FNST";"Autres";"false";"4096, 4097, 4098, 425, 4287, 4387, 4417, 4456, 4487";"4458";"";"495, 496";"false";"false";"Créance d'exploitation"
-"FNST";"Autres";"false";"4196, 4197, 4198, 4419";"";"";"";"false";"false";"Dettes d'exploitation"
-"FNST";"Autres";"false";"424, 426, 4284, 4419, 442, 4486, 457, 464, 467, 4686, 509";"";"443, 451, 455, 456, 458";"";"false";"false";"Dettes diverses"
-"FNST";"Avances et acomptes";"false";"238";"";"";"";"false";"false";"Immobilisations corporelles"
-"FNST";"Sur opérations de gestion";"false";"771";"";"";"";"false";"false";"Produits exceptionnels"
-"FNST";"Sur opérations en capital";"false";"775, 777, 778";"";"";"";"false";"false";"Produits exceptionnels"
+"FNST";"BILAN ACTIF";"true";"";"";"";"";"true";"false";"";"BOTH"
+"FNST";"Capital Souscrit non appelé";"false";"109";" ";" ";" ";"false";"false";"BILAN ACTIF";""
+"FNST";"BILAN PASSIF";"true";"";"";"";"";"true";"false";"";"BOTH"
+"FNST";"CAPITAUX PROPRES";"true";"";"";"";"";"true";"false";"BILAN PASSIF";"BOTH"
+"FNST";"COMPTE DE RESULTAT";"true";"";"";"";"";"false";"false";"";"BOTH"
+"FNST";"Capital (dont versé?)";"false";"101, 108, 1013";"";"";"";"false";"false";"CAPITAUX PROPRES";""
+"FNST";"CHARGES";"true";" ";" ";" ";" ";"true";"false";"COMPTE DE RESULTAT";"DEBIT"
+"FNST";"PRODUITS";"true";"";"";"";"";"true";"false";"COMPTE DE RESULTAT";"CREDIT"
+"FNST";"ACTIF IMMOBILISÉ";"true";" ";" ";" ";" ";"true";"false";"BILAN ACTIF";"BOTH"
+"FNST";"ACTIF CIRCULANT";"true";"";"";"";"";"true";"false";"BILAN ACTIF";"BOTH"
+"FNST";"CHARGES D'EXPLOITATION";"true";"";"";"";"";"true";"false";"CHARGES";"DEBIT"
+"FNST";"Coût d'achat des marchandises";"true";"";"";"";"";"false";"true";"CHARGES D'EXPLOITATION";"DEBIT"
+"FNST";"Stocks et en-cours";"true";"";"";"";"";"false";"true";"ACTIF CIRCULANT";"BOTH"
+"FNST";"Marchandises";"false";"37";"";"";"397";"false";"false";"Stocks et en-cours";""
+"FNST";"Variations de stocks de march.";"false";"6037";"";"";"";"false";"false";"Coût d'achat des marchandises";""
+"FNST";"Achat de marchandises";"false";"607, 6087, 6097";"";"";"";"false";"false";"Coût d'achat des marchandises";""
+"FNST";"Immobilisations incorporelles";"true";"";"";"";"";"false";"false";"ACTIF IMMOBILISÉ";"BOTH"
+"FNST";"Frais d'établissement";"false";"201";"";"";"2801";"false";"false";"Immobilisations incorporelles";""
+"FNST";"Frais de recherche et développement";"false";"203";"";"";"2803";"false";"false";"Immobilisations incorporelles";""
+"FNST";"Concessions, brevets, licences, marques, procédés, logiciels, droits et valeurs similaires";"false";"205";"";"";"2805, 2905";"false";"false";"Immobilisations incorporelles";""
+"FNST";"Fonds commercial";"false";"206, 207";"";"";"2807, 2906, 2907";"false";"false";"Immobilisations incorporelles";""
+"FNST";"Autres";"false";"208";"";"";"2808, 2908";"false";"false";"Immobilisations incorporelles";""
+"FNST";"Immobilisations incorporelles en cours";"false";"232";"";"";"2932";"false";"false";"Immobilisations incorporelles";""
+"FNST";"Avances et acomptes";"false";"237";"";"";"";"false";"false";"Immobilisations incorporelles";""
+"FNST";"Immobilisations corporelles";"true";"";"";"";"";"false";"false";"ACTIF IMMOBILISÉ";"BOTH"
+"FNST";"Terrains";"false";"211, 212";"";"";"2811, 2812, 2911";"false";"false";"Immobilisations corporelles";""
+"FNST";"Constructions";"false";"213, 214";"";"";"2813, 2814";"false";"false";"Immobilisations corporelles";""
+"FNST";"Installations techniques, matériels, et outillage industriels";"false";"215";"";"";"2815";"false";"false";"Immobilisations corporelles";""
+"FNST";"Immobilisations corporelles en cours";"false";"231";"";"";"2931";"false";"false";"Immobilisations corporelles";""
+"FNST";"Immobilisations financières";"true";"";"";"";"";"false";"false";"ACTIF IMMOBILISÉ";"BOTH"
+"FNST";"Participations";"false";"261, 266";"";"";"2961, 2966";"false";"false";"Immobilisations financières";""
+"FNST";"Créances rattachées à des participations";"false";"267, 268";"";"";"2967, 2968";"false";"false";"Immobilisations financières";""
+"FNST";"Titres immobilisés de l'activité de portefeuille";"false";"273";"";"";"2973";"false";"false";"Immobilisations financières";""
+"FNST";"Autres titres immobilisés";"false";"271, 272, 27682";"";"";"2971, 2972";"false";"false";"Immobilisations financières";""
+"FNST";"Prêts";"false";"274, 27684";"";"";"2974";"false";"false";"Immobilisations financières";""
+"FNST";"Matières premières et autres approvisionnements";"false";"31, 32";"";"";"391, 392";"false";"false";"Stocks et en-cours";""
+"FNST";"En cours de production (biens et services)";"false";"33, 34";"";"";"393, 394";"false";"false";"Stocks et en-cours";""
+"FNST";"Produits intermédiaires et finis";"false";"35";"";"";"395";"false";"false";"Stocks et en-cours";""
+"FNST";"Avances et acomptes versés sur commandes";"false";"4091";"";"";"";"false";"false";"ACTIF CIRCULANT";""
+"FNST";"Créances";"true";"";"";"";"";"false";"false";"ACTIF CIRCULANT";"BOTH"
+"FNST";"Valeurs mobilières de placement";"true";"";"";"";"";"false";"false";"ACTIF CIRCULANT";"BOTH"
+"FNST";"Actions propres";"false";"502";"";"";"59";"false";"false";"Valeurs mobilières de placement";""
+"FNST";"Autres titres";"false";"50 -502 -509";"";"";"59";"false";"false";"Valeurs mobilières de placement";""
+"FNST";"Disponibilités";"false";"53, 54 -5181 -519";"51";"";"";"false";"false";"ACTIF CIRCULANT";""
+"FNST";"Charges constatées d'avance";"false";"486";"";"";"";"false";"false";"ACTIF CIRCULANT";""
+"FNST";"Instrument de trésorerie";"false";"";"52";"";"";"false";"false";"Valeurs mobilières de placement";""
+"FNST";"Charges à répartir sur plusieurs exercices";"false";"481";"";"";"";"false";"false";"BILAN ACTIF";""
+"FNST";"Primes de remboursement des emprunts";"false";"169";"";"";"";"false";"false";"BILAN ACTIF";""
+"FNST";"Ecarts de conversion Actif";"false";"476";"";"";"";"false";"false";"BILAN ACTIF";""
+"FNST";"Primes d'émission, de fusion, d'apport";"false";"104";"";"";"";"false";"false";"CAPITAUX PROPRES";""
+"FNST";"Ecart de réévaluation";"false";"105";"";"";"";"false";"false";"CAPITAUX PROPRES";""
+"FNST";"Ecart d'équivalence";"false";"107";"";"";"";"false";"false";"CAPITAUX PROPRES";""
+"FNST";"Réserves";"true";"";"";"";"";"false";"false";"CAPITAUX PROPRES";"BOTH"
+"FNST";"Réserve légale";"false";"1061";"";"";"";"false";"false";"Réserves";""
+"FNST";"Réserves statutaires ou contractuelles";"false";"1063";"";"";"";"false";"false";"Réserves";""
+"FNST";"Réserves réglementées";"false";"1062, 1064";"";"";"";"false";"false";"Réserves";""
+"FNST";"Report à nouveau";"false";"110-119";"";"";"";"false";"false";"CAPITAUX PROPRES";""
+"FNST";"RÉSULTAT DE L'EXERCICE (BÉNÉFICE OU PERTE)";"false";"7-6";"";"";"";"false";"false";"CAPITAUX PROPRES";""
+"FNST";"Subventions d'investissement";"false";"13";"";"";"";"false";"false";"CAPITAUX PROPRES";""
+"FNST";"Provisions réglementées";"false";"14";"";"";"";"false";"false";"CAPITAUX PROPRES";""
+"FNST";"AUTRES FONDS PROPRES";"true";"";"";"";"";"true";"false";"BILAN PASSIF";"BOTH"
+"FNST";"Produits des émissions de titres participatifs";"false";"1671";"";"";"";"false";"false";"AUTRES FONDS PROPRES";""
+"FNST";"Avances conditionnées";"false";"1674";"";"";"";"false";"false";"AUTRES FONDS PROPRES";""
+"FNST";"PROVISIONS POUR RISQUES ET CHARGES";"true";"";"";"";"";"true";"false";"BILAN PASSIF";"BOTH"
+"FNST";"Provisions pour risques";"false";"151";"";"";"";"false";"false";"PROVISIONS POUR RISQUES ET CHARGES";""
+"FNST";"Provisions pour charges";"false";"15 -151";"";"";"";"false";"false";"PROVISIONS POUR RISQUES ET CHARGES";""
+"FNST";"DETTES";"true";"";"";"";"";"true";"false";"BILAN PASSIF";"BOTH"
+"FNST";"Emprunts obligataires convertibles";"false";"161, 16881";"";"";"";"false";"false";"DETTES";""
+"FNST";"Autres emprunts obligataires";"false";"163, 16683";"";"";"";"false";"false";"DETTES";""
+"FNST";"Emprunts et dettes auprès établissements de crédits";"false";"164, 16684, 5181, 519";"";"512, 514, 517";"";"false";"false";"DETTES";""
+"FNST";"Emprunts et dettes financières diverses";"false";"165, 166, 1675, 168, 16883, 17, 426 -16881 -457";"";"45";"";"false";"false";"DETTES";""
+"FNST";"Avances et acomptes reçues sur commandes en cours";"false";"4191";"";"";"";"false";"false";"DETTES";""
+"FNST";"Ecarts de conversion passif";"false";"477";"";"";"";"false";"false";"BILAN PASSIF";""
+"FNST";"Coût d'achats de matières premières et autres approvisionnements";"true";"";"";"";"";"false";"false";"CHARGES D'EXPLOITATION";"DEBIT"
+"FNST";"Achats de matières premières et autres approvisionnements";"false";"601, 6081, 6091";"";"";"";"false";"false";"Coût d'achats de matières premières et autres approvisionnements";""
+"FNST";"Variation des stock";"false";"6031, 6032";"";"";"";"false";"false";"Coût d'achats de matières premières et autres approvisionnements";""
+"FNST";"Salaires et traitements";"false";"641, 644, 648";"";"";"";"false";"false";"CHARGES D'EXPLOITATION";""
+"FNST";"Charges sociales";"false";"645, 646, 647, 648";"";"";"";"false";"false";"CHARGES D'EXPLOITATION";""
+"FNST";"Dotations aux amortis. & provisions";"true";" ";" ";" ";" ";"false";"true";"CHARGES D'EXPLOITATION";"DEBIT"
+"FNST";"Autres charges";"false";"65 -655";"";"";"";"false";"false";"CHARGES D'EXPLOITATION";""
+"FNST";"Quotes-parts de résultat sur opérations faites en commun";"false";"655";"";"";"";"false";"false";"CHARGES";""
+"FNST";"Charges financières";"true";"";"";"";"";"false";"true";"CHARGES";"DEBIT"
+"FNST";"Dotations aux amortissements et provisions";"false";"686";"";"";"";"false";"false";"Charges financières";""
+"FNST";"Intérêts et charges assimilées";"false";"661, 664, 665, 668";"";"";"";"false";"false";"Charges financières";""
+"FNST";"Différences négatives de change";"false";"666";"";"";"";"false";"false";"Charges financières";""
+"FNST";"Charges nettes sur cessions de valeurs mobilières de placement";"false";"667";"";"";"";"false";"false";"Charges financières";""
+"FNST";"Charges exceptionnelles";"true";"";"";"";"";"false";"true";"CHARGES";"DEBIT"
+"FNST";"Sur opérations de gestion";"false";"671";"";"";"";"false";"false";"Charges exceptionnelles";""
+"FNST";"Participation des salariés aux résultats";"false";"691";"";"";"";"false";"false";"CHARGES";""
+"FNST";"Impôts sur les bénéfices";"false";"695, 697, 689, 698, 699, 789";"";"";"";"false";"false";"CHARGES";""
+"FNST";"Produits d'exploitation";"true";"";"";"";"";"true";"false";"PRODUITS";"CREDIT"
+"FNST";"Production vendue";"true";"";"";"";"";"false";"true";"Produits d'exploitation";"CREDIT"
+"FNST";"Ventes";"false";"701, 702, 703, 707, 708, 7091, 7092, 7097, 7098";"";"";"";"false";"false";"Production vendue";""
+"FNST";"Travaux";"false";"704, 708, 7094, 7098";"";"";"";"false";"false";"Production vendue";""
+"FNST";"Autres produits d'exploitation";"true";"";"";"";"";"false";"true";"Produits d'exploitation";"CREDIT"
+"FNST";"Quote-parts de résultat sur opérations faites en commun";"false";"755";"";"";"";"false";"false";"PRODUITS";""
+"FNST";"Produits financiers";"true";"";"";"";"";"false";"true";"PRODUITS";"CREDIT"
+"FNST";"De participations";"false";"761";"";"";"";"false";"false";"Produits financiers";""
+"FNST";"D'autres valeurs mobilières et créances de l'actif immobilisé";"false";"762";"";"";"";"false";"false";"Produits financiers";""
+"FNST";"Autres intérêts et produits assimilés";"false";"763, 764, 765, 768";"";"";"";"false";"false";"Produits financiers";""
+"FNST";"Reprises sur provisions et transfers de charges";"false";"786, 796";"";"";"";"false";"false";"Produits financiers";""
+"FNST";"Différences positives de change";"false";"766";"";"";"";"false";"false";"Produits financiers";""
+"FNST";"Produits nets sur cessions de valeurs mobilières de placement";"false";"767";"";"";"";"false";"false";"Produits financiers";""
+"FNST";"Produits exceptionnels";"true";"";"";"";"";"false";"true";"PRODUITS";"CREDIT"
+"FNST";"Reprises sur provisions et transferts de charges";"false";"787, 797";"";"";"";"false";"false";"Produits exceptionnels";""
+"FNST";"Sur immobilisations : dotations aux amortissements";"false";"6811, 6812";"";"";"";"false";"false";"Dotations aux amortis. & provisions";""
+"FNST";"Sur immobilisations : dotations aux provisions";"false";"6816";"";"";"";"false";"false";"Dotations aux amortis. & provisions";""
+"FNST";"Sur actif circulant : dotations aux provisions";"false";"6817";"";"";"";"false";"false";"Dotations aux amortis. & provisions";""
+"FNST";"Pour risques et charges : dotations aux provisions";"false";"6815";"";"";"";"false";"false";"Dotations aux amortis. & provisions";""
+"FNST";"Créance d'exploitation";"true";"";"";"";"";"false";"false";"Créances";"BOTH"
+"FNST";"Créances clients et Comptes rattachés";"false";"410, 411, 413, 416, 418";"";"";"491";"false";"false";"Créance d'exploitation";""
+"FNST";"Créances diverses";"false";"4411, 4418, 462, 465, 4687";"443, 444, 451, 456, 458, 467 -4562";"";"";"false";"false";"Créances";""
+"FNST";"Capital souscrit et appelé, non versé";"false";"4562";"";"";"";"false";"false";"Créances";""
+"FNST";"Dettes d'exploitation";"true";"";"";"";"";"false";"false";"DETTES";"BOTH"
+"FNST";"Dettes fournisseurs et comptes rattachés";"false";"400, 401, 403, 4081, 4088";"";"";"";"false";"false";"Dettes d'exploitation";""
+"FNST";"Dettes fiscales et sociales";"false";"421, 422, 424, 427, 4282, 4286, 431, 437, 4386, 4455, 4457, 446, 447, 4486";"";"4458";"";"false";"false";"Dettes d'exploitation";""
+"FNST";"Dettes diverses";"true";"";"";"";"";"false";"false";"DETTES";"BOTH"
+"FNST";"Dettes sur immobilisations et Comptes rattachés";"false";"269, 279, 404, 405, 4084";"";"";"";"false";"false";"Dettes diverses";""
+"FNST";"Dettes fiscales (impôts sur les bénéfices)";"false";"";"";"444";"";"false";"false";"Dettes diverses";""
+"FNST";"Sur opérations en capital";"false";"775, 777, 778";"";"";"";"false";"false";"Produits exceptionnels";""
+"FNST";"Prestation de services";"false";"705, 706, 708, 7095, 7096, 7098";"";"";"";"false";"false";"Production vendue";""
+"FNST";"Production stockée";"true";"";"";"";"";"false";"true";"Autres produits d'exploitation";"CREDIT"
+"FNST";"En-cours de production de biens";"false";"7133";"";"";"";"false";"false";"Production stockée";""
+"FNST";"En-cours de production de services";"false";"7134";"";"";"";"false";"false";"Production stockée";""
+"FNST";"Produits";"false";"7135";"";"";"";"false";"false";"Production stockée";""
+"FNST";"Reprises sur provisions (et amortissements), transferts de charges";"true";"";"";"";"";"false";"true";"Autres produits d'exploitation";"CREDIT"
+"FNST";"Reprises sur provisions (et amortissements)";"false";"781";"";"";"";"false";"false";"Reprises sur provisions (et amortissements), transferts de charges";""
+"FNST";"Transferts de charges";"false";"791";"";"";"";"false";"false";"Reprises sur provisions (et amortissements), transferts de charges";""
+"FNST";"Production exceptionnels sur opérations en capital";"true";"";"";"";"";"false";"true";"Autres produits d'exploitation";"CREDIT"
+"FNST";"Produits des cessions d'éléments d'actif";"false";"775";"";"";"";"false";"false";"Production exceptionnels sur opérations en capital";""
+"FNST";"Subvention d'investissement virées au résultat de l'exercice";"false";"778";"";"";"";"false";"false";"Production exceptionnels sur opérations en capital";""
+"FNST";"Autres approvisionnements";"false";"602, 6082, 6092";"";"";"";"false";"false";"Coût d'achats de matières premières et autres approvisionnements";""
+"FNST";"Autres charges et charges externes";"true";"";"";"";"";"false";"true";"CHARGES D'EXPLOITATION";"DEBIT"
+"FNST";"Achats de sous-traitance";"false";"604, 6084, 6094, 6095";"";"";"";"false";"false";"Autres charges et charges externes";""
+"FNST";"Achats non stockés de matières et fournitures";"false";"605, 606, 6085, 6086, 6096";"";"";"";"false";"false";"Autres charges et charges externes";""
+"FNST";"Services extérieurs";"true";"";"";"";"";"false";"true";"Autres charges et charges externes";"DEBIT"
+"FNST";"Personnel extérieur";"false";"621";"";"";"";"false";"false";"Services extérieurs";""
+"FNST";"Loyers en crédit-bail mobilier";"false";"6122";"";"";"";"false";"false";"Services extérieurs";""
+"FNST";"Loyers en crédit-bail immobilier";"false";"";"";"";"";"false";"false";"Services extérieurs";""
+"FNST";"Impôts, taxes et versements assimilés";"true";"";"";"";"";"false";"true";"CHARGES D'EXPLOITATION";"DEBIT"
+"FNST";"sur rémunérations";"false";"631, 633";"";"";"";"false";"false";"Impôts, taxes et versements assimilés";""
+"FNST";"autres";"false";"635, 637";"";"";"";"false";"false";"Impôts, taxes et versements assimilés";""
+"FNST";"sur opération en capital";"true";"";"";"";"";"false";"true";"Charges exceptionnelles";"DEBIT"
+"FNST";"valeurs comptables des éléments immobiliers et financiers cédés";"false";"675";"";"";"";"false";"false";"sur opération en capital";""
+"FNST";"Dotations aux amortissements et aux provisions";"true";"";"";"";"";"false";"true";"Charges exceptionnelles";"DEBIT"
+"FNST";"Dotations aux provisions réglementées";"false";"6872, 6873, 6874";"";"";"";"false";"false";"Dotations aux amortissements et aux provisions";""
+"FNST";"dotations aux amortissements et aux provisions";"false";"6871, 6875, 6876";"";"";"";"false";"false";"Dotations aux amortissements et aux provisions";""
+"FNST";"Produits constatés d'avance";"false";"487";"";"";"";"false";"false";"DETTES";""
+"FNST";"Autres";"false";"275, 2761, 27685, 27688";"";"";"2975, 2976";"false";"false";"Immobilisations financières";""
+"FNST";"Autres";"false";"218";"";"";"2818";"false";"false";"Immobilisations corporelles";""
+"FNST";"Autres";"false";"1068";"";"";"";"false";"false";"Réserves";""
+"FNST";"Autres";"false";"";"";"";"";"false";"false";"AUTRES FONDS PROPRES";""
+"FNST";"Autres";"false";"4096, 4097, 4098, 425, 4287, 4387, 4417, 4452, 4456, 4487";"4458";"";"495, 496";"false";"false";"Créance d'exploitation";""
+"FNST";"Autres";"false";"4196, 4197, 4198, 4419";"";"";"";"false";"false";"Dettes d'exploitation";""
+"FNST";"Autres";"false";"424, 426, 4284, 4419, 442, 4486, 457, 464, 467, 4686, 509";"";"443, 451, 455, 456, 458";"";"false";"false";"Dettes diverses";""
+"FNST";"Autres";"false";"61, 62 -6122 -6125 -621";"";"";"";"false";"false";"Services extérieurs";""
+"FNST";"Avances et acomptes";"false";"238";"";"";"";"false";"false";"Immobilisations corporelles";""
+"FNST";"Sur opérations de gestion";"false";"771";"";"";"";"false";"false";"Produits exceptionnels";""
+"FNST";"autres";"false";"678";"";"";"";"false";"false";"sur opération en capital";""
Modified: trunk/lima-swing/src/main/resources/import/bcr_shortened.csv
===================================================================
--- trunk/lima-swing/src/main/resources/import/bcr_shortened.csv 2010-08-16 13:11:52 UTC (rev 3004)
+++ trunk/lima-swing/src/main/resources/import/bcr_shortened.csv 2010-08-17 15:34:26 UTC (rev 3005)
@@ -1,68 +1,68 @@
-"FNST";"BILAN ACTIF";"true";"";"";"";"";"true";"false";""
-"FNST";"BILAN PASSIF";"true";"";"";"";"";"true";"false";""
-"FNST";"CAPITAUX PROPRES";"true";"";"";"";"";"true";"false";"BILAN PASSIF"
-"FNST";"COMPTE DE RESULTAT";"true";"";"";"";"";"false";"false";""
-"FNST";"Capital";"false";"101, 108";"";"";"";"false";"false";"CAPITAUX PROPRES"
-"FNST";"CHARGES";"true";" ";" ";" ";" ";"true";"false";"COMPTE DE RESULTAT"
-"FNST";"CHARGES D'EXPLOITATION ET FINANCIERES";"true";"";"";"";"";"true";"false";"CHARGES"
-"FNST";"PRODUITS";"true";"";"";"";"";"true";"false";"COMPTE DE RESULTAT"
-"FNST";"ACTIF IMMOBILISÉ";"true";" ";" ";" ";" ";"true";"false";"BILAN ACTIF"
-"FNST";"ACTIF CIRCULANT";"true";"";"";"";"";"true";"false";"BILAN ACTIF"
-"FNST";"Stocks et en-cours";"true";"";"";"";"";"false";"true";"ACTIF CIRCULANT"
-"FNST";"Marchandises";"false";"37";"";"";"397";"false";"false";"Stocks et en-cours"
-"FNST";"Immobilisations incorporelles";"true";"";"";"";"";"false";"false";"ACTIF IMMOBILISÉ"
-"FNST";"Fonds commercial";"false";"206, 207";"";"";"";"false";"false";"Immobilisations incorporelles"
-"FNST";"Autres";"false";"201, 208";"";"";"280, 290";"false";"false";"Immobilisations incorporelles"
-"FNST";"Autres";"false";"31, 32, 33, 34, 35";"";"";"391, 393, 394, 395";"false";"false";"Stocks et en-cours"
-"FNST";"Avances et acomptes versés sur commandes";"false";"409";"";"";"";"false";"false";"ACTIF CIRCULANT"
-"FNST";"Créances";"true";"";"";"";"";"false";"false";"ACTIF CIRCULANT"
-"FNST";"Charges constatées d'avance";"false";"486";"";"";"";"false";"false";"BILAN ACTIF"
-"FNST";"Ecart de réévaluation";"false";"105";"";"";"";"false";"false";"CAPITAUX PROPRES"
-"FNST";"Réserves";"true";"";"";"";"";"false";"false";"CAPITAUX PROPRES"
-"FNST";"Réserve légale";"false";"1061";"";"";"";"false";"false";"Réserves"
-"FNST";"Réserves réglementées";"false";"1064";"";"";"";"false";"false";"Réserves"
-"FNST";"Report à nouveau";"false";"110";"";"";"";"false";"false";"CAPITAUX PROPRES"
-"FNST";"RÉSULTAT DE L'EXERCICE (BÉNÉFICE OU PERTE)";"false";"7-6";"";"";"";"false";"false";"CAPITAUX PROPRES"
-"FNST";"Provisions réglementées";"false";"145, 146, 147, 148";"";"";"";"false";"false";"CAPITAUX PROPRES"
-"FNST";"Provisions pour risques et charges";"false";"15";"";"";"";"false";"false";"BILAN PASSIF"
-"FNST";"DETTES";"true";"";"";"";"";"true";"false";"BILAN PASSIF"
-"FNST";"Emprunts et dettes assimilées";"false";"16";"";"";"";"false";"false";"DETTES"
-"FNST";"Avances et acomptes reçues sur commandes en cours";"false";"419";"";"";"";"false";"false";"DETTES"
-"FNST";"Immobilisations corporelles";"false";"21, 23";"";"";"281, 291";"false";"false";"ACTIF IMMOBILISÉ"
-"FNST";"Immobilisations financières";"false";"27";"";"";"297";"false";"false";"ACTIF IMMOBILISÉ"
-"FNST";"Clients et comptes rattachés";"false";"410";"";"";"491";"false";"false";"Créances"
-"FNST";"Valeurs mobilières de placement";"false";"50";"";"";"590";"false";"false";"ACTIF CIRCULANT"
-"FNST";"Disponibilités (autres que caisse)";"false";"54, 58";"51";"";"";"false";"false";"ACTIF CIRCULANT"
-"FNST";"Caisse";"false";"53";"";"";"";"false";"false";"ACTIF CIRCULANT"
-"FNST";"Fournisseurs et comptes rattachés";"false";"400";"";"";"";"false";"false";"DETTES"
-"FNST";"Produits constatés d'avance";"false";"487";"";"";"";"false";"false";"BILAN PASSIF"
-"FNST";"Charges exceptionnelles";"false";"67, 687, 691";"";"";"";"false";"false";"CHARGES"
-"FNST";"Impôts sur les bénéfices";"false";"695, 697";"";"";"";"false";"false";"CHARGES"
-"FNST";"PRODUITS D'EXPLOITATION ET FINANCIERS";"true";"";"";"";"";"true";"false";"PRODUITS"
-"FNST";"Produits d'exploitation";"true";"";"";"";"";"false";"false";"PRODUITS D'EXPLOITATION ET FINANCIERS"
-"FNST";"Produits financiers";"false";"76, 786, 79";"";"";"";"false";"false";"PRODUITS D'EXPLOITATION ET FINANCIERS"
-"FNST";"Ventes de marchandises";"false";"707, 709";"";"";"";"false";"false";"Produits d'exploitation"
-"FNST";"Production vendue (bien et services)";"false";"701, 706, 708, 709";"";"";"";"false";"false";"Produits d'exploitation"
-"FNST";"Production stockée";"false";"713";"";"";"";"false";"false";"Produits d'exploitation"
-"FNST";"Production immobilisée";"false";"72";"";"";"";"false";"false";"Produits d'exploitation"
-"FNST";"Subventions d'exploitation";"false";"74";"";"";"";"false";"false";"Produits d'exploitation"
-"FNST";"Autres produits";"false";"75, 781, 79";"";"";"";"false";"false";"Produits d'exploitation"
-"FNST";"Produits exceptionnels";"false";"77, 787, 79";"";"";"";"false";"false";"PRODUITS"
-"FNST";"Charges d'exploitation";"true";"";"";"";"";"true";"false";"CHARGES D'EXPLOITATION ET FINANCIERES"
-"FNST";"Coût d'achat des marchandises";"true";"";"";"";"";"false";"true";"Charges d'exploitation"
-"FNST";"Variations de stocks de march.";"false";"6037";"";"";"";"false";"false";"Coût d'achat des marchandises"
-"FNST";"Achat de marchandises";"false";"607";"";"";"";"false";"false";"Coût d'achat des marchandises"
-"FNST";"Coût d'achats des approvisionnements";"true";"";"";"";"";"false";"false";"Charges d'exploitation"
-"FNST";"Achats d'approvisionnements";"false";"60 -607";"";"";"";"false";"false";"Coût d'achats des approvisionnements"
-"FNST";"Variation des stock (approvisionnements)";"false";"6031, 6032";"";"";"";"false";"false";"Coût d'achats des approvisionnements"
-"FNST";"Autres charges externes";"false";"61, 62";"";"";"";"false";"false";"Charges d'exploitation"
-"FNST";"Impôts, taxes et versements assimilés";"false";"63";"";"";"";"false";"false";"Charges d'exploitation"
-"FNST";"Rémunération du personnel";"false";"641, 644";"";"";"";"false";"false";"Charges d'exploitation"
-"FNST";"Charges sociales";"false";"645, 646";"";"";"";"false";"false";"Charges d'exploitation"
-"FNST";"Dotations aux amortissements";"false";"6811";"";"";"";"false";"false";"Charges d'exploitation"
-"FNST";"Dotations aux provisions";"false";"6815, 6816, 6817";"";"";"";"false";"false";"Charges d'exploitation"
-"FNST";"Autres charges";"false";"65";"";"";"";"false";"false";"Charges d'exploitation"
-"FNST";"Charges financières";"false";"66, 686";"";"";"";"false";"false";"CHARGES D'EXPLOITATION ET FINANCIERES"
-"FNST";"Autres";"false";"1063, 1068";"";"";"";"false";"false";"Réserves"
-"FNST";"Autres";"false";"409, 428, 46";"43, 444, 445, 455";"";"496";"false";"false";"Créances"
-"FNST";"Autres";"false";"419, 421, 428, 447, 46";"";"43, 444, 445, 455";"";"false";"false";"DETTES"
+"FNST";"BILAN ACTIF";"true";"";"";"";"";"true";"false";"";"BOTH"
+"FNST";"BILAN PASSIF";"true";"";"";"";"";"true";"false";"";"BOTH"
+"FNST";"CAPITAUX PROPRES";"true";"";"";"";"";"true";"false";"BILAN PASSIF";"BOTH"
+"FNST";"COMPTE DE RESULTAT";"true";"";"";"";"";"false";"false";"";"BOTH"
+"FNST";"Capital";"false";"101, 108";"";"";"";"false";"false";"CAPITAUX PROPRES";""
+"FNST";"CHARGES";"true";" ";" ";" ";" ";"true";"false";"COMPTE DE RESULTAT";"DEBIT"
+"FNST";"CHARGES D'EXPLOITATION ET FINANCIERES";"true";"";"";"";"";"true";"false";"CHARGES";"DEBIT"
+"FNST";"PRODUITS";"true";"";"";"";"";"true";"false";"COMPTE DE RESULTAT";"CREDIT"
+"FNST";"ACTIF IMMOBILISÉ";"true";" ";" ";" ";" ";"true";"false";"BILAN ACTIF";"BOTH"
+"FNST";"ACTIF CIRCULANT";"true";"";"";"";"";"true";"false";"BILAN ACTIF";"BOTH"
+"FNST";"Stocks et en-cours";"true";"";"";"";"";"false";"true";"ACTIF CIRCULANT";"BOTH"
+"FNST";"Marchandises";"false";"37";"";"";"397";"false";"false";"Stocks et en-cours";""
+"FNST";"Immobilisations incorporelles";"true";"";"";"";"";"false";"false";"ACTIF IMMOBILISÉ";"BOTH"
+"FNST";"Fonds commercial";"false";"206, 207";"";"";"";"false";"false";"Immobilisations incorporelles";""
+"FNST";"Autres";"false";"201, 208";"";"";"280, 290";"false";"false";"Immobilisations incorporelles";""
+"FNST";"Autres";"false";"31, 32, 33, 34, 35";"";"";"391, 393, 394, 395";"false";"false";"Stocks et en-cours";""
+"FNST";"Avances et acomptes versés sur commandes";"false";"409";"";"";"";"false";"false";"ACTIF CIRCULANT";""
+"FNST";"Créances";"true";"";"";"";"";"false";"false";"ACTIF CIRCULANT";"BOTH"
+"FNST";"Charges constatées d'avance";"false";"486";"";"";"";"false";"false";"BILAN ACTIF";""
+"FNST";"Ecart de réévaluation";"false";"105";"";"";"";"false";"false";"CAPITAUX PROPRES";""
+"FNST";"Réserves";"true";"";"";"";"";"false";"false";"CAPITAUX PROPRES";"BOTH"
+"FNST";"Réserve légale";"false";"1061";"";"";"";"false";"false";"Réserves";""
+"FNST";"Réserves réglementées";"false";"1064";"";"";"";"false";"false";"Réserves";""
+"FNST";"Report à nouveau";"false";"110-119";"";"";"";"false";"false";"CAPITAUX PROPRES";""
+"FNST";"RÉSULTAT DE L'EXERCICE (BÉNÉFICE OU PERTE)";"false";"7-6";"";"";"";"false";"false";"CAPITAUX PROPRES";""
+"FNST";"Provisions réglementées";"false";"145, 146, 147, 148";"";"";"";"false";"false";"CAPITAUX PROPRES";""
+"FNST";"Provisions pour risques et charges";"false";"15";"";"";"";"false";"false";"BILAN PASSIF";""
+"FNST";"DETTES";"true";"";"";"";"";"true";"false";"BILAN PASSIF";"BOTH"
+"FNST";"Emprunts et dettes assimilées";"false";"16";"";"";"";"false";"false";"DETTES";""
+"FNST";"Avances et acomptes reçues sur commandes en cours";"false";"419";"";"";"";"false";"false";"DETTES";""
+"FNST";"Immobilisations corporelles";"false";"21, 23";"";"";"281, 291";"false";"false";"ACTIF IMMOBILISÉ";""
+"FNST";"Immobilisations financières";"false";"27";"";"";"297";"false";"false";"ACTIF IMMOBILISÉ";""
+"FNST";"Clients et comptes rattachés";"false";"41 - 419";"";"";"491";"false";"false";"Créances";""
+"FNST";"Valeurs mobilières de placement";"false";"50";"";"";"590";"false";"false";"ACTIF CIRCULANT";""
+"FNST";"Disponibilités (autres que caisse)";"false";"54, 58";"51";"";"";"false";"false";"ACTIF CIRCULANT";""
+"FNST";"Caisse";"false";"53";"";"";"";"false";"false";"ACTIF CIRCULANT";""
+"FNST";"Fournisseurs et comptes rattachés";"false";"40";"";"";"";"false";"false";"DETTES";""
+"FNST";"Produits constatés d'avance";"false";"487";"";"";"";"false";"false";"BILAN PASSIF";""
+"FNST";"Charges exceptionnelles";"false";"67, 687, 691";"";"";"";"false";"false";"CHARGES";""
+"FNST";"Impôts sur les bénéfices";"false";"695, 697";"";"";"";"false";"false";"CHARGES";""
+"FNST";"PRODUITS D'EXPLOITATION ET FINANCIERS";"true";"";"";"";"";"true";"false";"PRODUITS";"CREDIT"
+"FNST";"Produits d'exploitation";"true";"";"";"";"";"false";"false";"PRODUITS D'EXPLOITATION ET FINANCIERS";"CREDIT"
+"FNST";"Produits financiers";"false";"76, 786, 79";"";"";"";"false";"false";"PRODUITS D'EXPLOITATION ET FINANCIERS";""
+"FNST";"Ventes de marchandises";"false";"707, 709";"";"";"";"false";"false";"Produits d'exploitation";""
+"FNST";"Production vendue (bien et services)";"false";"701, 706, 708, 709";"";"";"";"false";"false";"Produits d'exploitation";""
+"FNST";"Production stockée";"false";"713";"";"";"";"false";"false";"Produits d'exploitation";""
+"FNST";"Production immobilisée";"false";"72";"";"";"";"false";"false";"Produits d'exploitation";""
+"FNST";"Subventions d'exploitation";"false";"74";"";"";"";"false";"false";"Produits d'exploitation";""
+"FNST";"Autres produits";"false";"75, 781, 79";"";"";"";"false";"false";"Produits d'exploitation";""
+"FNST";"Produits exceptionnels";"false";"77, 787, 79";"";"";"";"false";"false";"PRODUITS";""
+"FNST";"Charges d'exploitation";"true";"";"";"";"";"true";"false";"CHARGES D'EXPLOITATION ET FINANCIERES";"DEBIT"
+"FNST";"Coût d'achat des marchandises";"true";"";"";"";"";"false";"true";"Charges d'exploitation";"DEBIT"
+"FNST";"Variations de stocks de march.";"false";"6037";"";"";"";"false";"false";"Coût d'achat des marchandises";""
+"FNST";"Achat de marchandises";"false";"607";"";"";"";"false";"false";"Coût d'achat des marchandises";""
+"FNST";"Coût d'achats des approvisionnements";"true";"";"";"";"";"false";"false";"Charges d'exploitation";"DEBIT"
+"FNST";"Achats d'approvisionnements";"false";"60 -603 -607";"";"";"";"false";"false";"Coût d'achats des approvisionnements";""
+"FNST";"Variation des stock (approvisionnements)";"false";"6031, 6032";"";"";"";"false";"false";"Coût d'achats des approvisionnements";""
+"FNST";"Autres charges externes";"false";"61, 62";"";"";"";"false";"false";"Charges d'exploitation";""
+"FNST";"Impôts, taxes et versements assimilés";"false";"63";"";"";"";"false";"false";"Charges d'exploitation";""
+"FNST";"Rémunération du personnel";"false";"641, 644";"";"";"";"false";"false";"Charges d'exploitation";""
+"FNST";"Charges sociales";"false";"645, 646";"";"";"";"false";"false";"Charges d'exploitation";""
+"FNST";"Dotations aux amortissements";"false";"6811";"";"";"";"false";"false";"Charges d'exploitation";""
+"FNST";"Dotations aux provisions";"false";"6815, 6816, 6817";"";"";"";"false";"false";"Charges d'exploitation";""
+"FNST";"Autres charges";"false";"65";"";"";"";"false";"false";"Charges d'exploitation";""
+"FNST";"Charges financières";"false";"66, 686";"";"";"";"false";"false";"CHARGES D'EXPLOITATION ET FINANCIERES";""
+"FNST";"Autres";"false";"1063, 1068";"";"";"";"false";"false";"Réserves";""
+"FNST";"Autres";"false";"409, 428, 46";"43, 444, 445, 455";"";"496";"false";"false";"Créances";""
+"FNST";"Autres";"false";"419, 421, 428, 447, 46";"";"43, 444, 445";"";"false";"false";"DETTES";""
Modified: trunk/lima-swing/src/main/resources/import/pcg_base.csv
===================================================================
--- trunk/lima-swing/src/main/resources/import/pcg_base.csv 2010-08-16 13:11:52 UTC (rev 3004)
+++ trunk/lima-swing/src/main/resources/import/pcg_base.csv 2010-08-17 15:34:26 UTC (rev 3005)
@@ -44,8 +44,6 @@
"ACCN";"164";"Emprunts auprès des établissements de crédit";"";"16";""
"ACCN";"165";"Dépôts et cautionnements reçus";"";"16";""
"ACCN";"166";"Participation des salariés aux résultats";"";"16";""
-"ACCN";"167";"Emprunts et dettes assortis de conditions particulières";"";"16";""
-"ACCN";"168";"Autres emprunts et dettes assimilées";"";"16";""
"ACCN";"16";"EMPRUNTS ET DETTES ASSIMILEES";"";"1";""
"ACCN";"169";"Primes de remboursement des obligations";"";"16";""
"ACCN";"171";"Dettes rattachées à des participations (groupe)";"";"17";""
@@ -53,11 +51,6 @@
"ACCN";"17";"DETTES RATTACHÉES À DES PARTICIPATIONS";"";"1";""
"ACCN";"178";"Dettes rattachées à des sociétés en participation";"";"17";""
"ACCN";"1";"COMPTES DE CAPITAUX";"";"";""
-"ACCN";"181";"Compte de liaison des établissements";"";"18";""
-"ACCN";"186";"Bien et prestations de services échangés entre établissements (charges)";"";"18";""
-"ACCN";"187";"Bien et prestations de services échangés entre établissements (produits)";"";"18";""
-"ACCN";"18";"COMPTES DE LIAISON DES ÉTABLISSEMENTS ET DES SOCIÉTÉS EN PARTICIPATION";"";"1";""
-"ACCN";"188";"Comptes de liaison des sociétés en participation";"";"18";""
"ACCN";"201";"Frais détablissement";"";"20";""
"ACCN";"203";"Frais de recherche et de développement";"";"20";""
"ACCN";"205";"Concessions et droits similaires";"";"20";""
@@ -72,13 +65,11 @@
"ACCN";"215";"Installations techniques; matériel et outillage industriels";"";"21";""
"ACCN";"21";"IMMOBlLlSATIONS CORPORELLES";"";"2";""
"ACCN";"218";"Autres immobilisations corporelles";"";"21";""
-"ACCN";"22";"IMMOBILISATIONS MISES EN CONCESSION";"";"2";""
"ACCN";"231";"Immobilisations corporelles en cours";"";"23";""
"ACCN";"232";"Immobilisations incorporelles en cours";"";"23";""
"ACCN";"237";"Avances et acomptes versés sur immobilisations incorporelles";"";"23";""
"ACCN";"23";"IMMOBILlSATlONS EN COURS";"";"2";""
"ACCN";"238";"Avances et acomptes versés sur immobilisations corporelles";"";"23";""
-"ACCN";"25";"ENTREPRISES LIÉES - PARTS ET CRÉANCES";"";"2";""
"ACCN";"261";"Titres de participation";"";"26";""
"ACCN";"266";"Autres formes de participation";"";"26";""
"ACCN";"267";"Créances rattachées à des participations";"";"26";""
@@ -90,20 +81,11 @@
"ACCN";"273";"Titres immobilisés de l'activité portefeuille";"";"27";""
"ACCN";"274";"Prêts";"";"27";""
"ACCN";"275";"Dépôts et cautionnements versés";"";"27";""
-"ACCN";"276";"Autres créances immobilisées";"";"27";""
-"ACCN";"277";"Actions propres ou parts propres";"";"27";""
"ACCN";"27";"AUTRES IMMOBILISATIONS FINANCIERES";"";"2";""
"ACCN";"279";"Versements restant à effectuer sur titres immobilisés non libérés";"";"27";""
-"ACCN";"280";"Amortissements des immobilisations incorporelles";"";"28";""
"ACCN";"28";"AMORTISSEMENTS DES IMMOBILISATIONS";"";"2";""
-"ACCN";"281";"Amortissements des immobilisations corporelles";"";"28";""
"ACCN";"2";"COMPTES D'IMMOBILISATIONS";"";"";""
-"ACCN";"290";"Provisions pour dépréciation immobilisations incorporelles";"";"29";""
-"ACCN";"291";"Provisions pour dépréciation immobilisations corporelles";"";"29";""
-"ACCN";"293";"Dépréciations des immobilisations en cours";"";"29";""
-"ACCN";"296";" Dépréciations des participations et créances rattachées à des participations";"";"29";""
"ACCN";"29";"PROVISIONS POUR DEPRECIATION DES IMMOBILISATIONS";"";"2";""
-"ACCN";"297";"Provisions pour dépréciation des immobilisations financières";"";"29";""
"ACCN";"311";"Matière (ou groupe) A";"";"31";""
"ACCN";"312";"Matières (ou groupe) B";"";"31";""
"ACCN";"31";"MATIERES PREMIERES (et fournitures)";"";"3";""
@@ -125,7 +107,6 @@
"ACCN";"371";"Marchandise (ou groupe) A";"";"37";""
"ACCN";"37";"STOCKS DE MARCHANDISES";"";"3";""
"ACCN";"372";"Marchandise (ou groupe) B";"";"37";""
-"ACCN";"38";"STOCKS EN VOIE D'ACHEMINEMENT, MIS EN DÉPOT OU DONNÉS EN CONSIGNATION";"";"3";""
"ACCN";"3";"COMPTES DE STOCKS ET D'EN-COURS";"";"";""
"ACCN";"391";"Provisions pour dépréciation des stocks dapprovisionnement";"";"39";""
"ACCN";"392";"Provisions pour dépréciation des autres approvisionnements";"";"39";""
@@ -139,9 +120,7 @@
"ACCN";"403";"Fournisseurs - Effets à payer";"";"40";""
"ACCN";"404";"Fournisseurs d'immobilisations";"";"40";""
"ACCN";"405";"Fournisseurs d'immobilisations - Effets à payer";"";"40";""
-"ACCN";"408";"Fournisseurs - Factures non parvenues";"";"40";""
"ACCN";"40";"FOURNISSEURS ET COMPTES RATTACHES";"";"4";""
-"ACCN";"409";"Fournisseurs débiteurs";"";"40";""
"ACCN";"410";"Clients et comptes rattachés";"";"41";""
"ACCN";"411";"Clients";"";"41";""
"ACCN";"413";"Clients - Effets a recevoir";"";"41";""
@@ -149,7 +128,6 @@
"ACCN";"417";"Créances sur travaux non encore facturables";"";"41";""
"ACCN";"418";"Clients - Produits non encore facturés";"";"41";""
"ACCN";"41";"CLIENTS ET COMPTES RATTACHES";"";"4";""
-"ACCN";"419";"Clients créditeurs";"";"41";""
"ACCN";"421";"Personnel - Rémunérations dues";"";"42";""
"ACCN";"422";"Comités d'entreprise, d'établissement...";"";"42";""
"ACCN";"424";"Participations des salariés aux résultats";"";"42";""
@@ -157,7 +135,6 @@
"ACCN";"426";"Personnel - Dépôts";"";"42";""
"ACCN";"427";"Personnel - Oppositions";"";"42";""
"ACCN";"42";"PERSONNEL ET COMPTES RATTACHES";"";"4";""
-"ACCN";"428";"Personnel - Charges à payer et produits à recevoir";"";"42";""
"ACCN";"431";"Sécurité sociale";"";"43";""
"ACCN";"437";"Autres organismes sociaux";"";"43";""
"ACCN";"43";"SECURITE SOCIALE - AUTRES ORGANISMES SOCIAUX";"";"4";""
@@ -181,6 +158,8 @@
"ACCN";"445711";"TVA collectée 19;6 % débits";"";"44571";""
"ACCN";"445712";"TVA collectée 5;5 % débits";"";"44571";""
"ACCN";"445714";"TVA collectée 19;6 % encaissements";"";"44571";""
+"ACCN";"44571";"TVA collectée";"";"4457";""
+"ACCN";"445715";"TVA collectée 5;5 % encaissements";"";"44571";""
"ACCN";"445";"Etat - Taxes sur le chiffre d'affaires";"";"44";""
"ACCN";"44583";"Remboursement de taxes sur le chiffre d'affaires demandé";"";"4458";""
"ACCN";"44584";"TVA récupérée d'avance";"";"4458";""
@@ -255,17 +234,12 @@
"ACCN";"59";"PROVISION POUR DÉPRÉCIATION DES COMPTES FINANCIERS";"";"5";""
"ACCN";"590";"Provisions pour dépréciation valeurs mobilières de placement";"";"59";""
"ACCN";"601";"Achats stockés - Matières premières (et fournitures)";"";"60";""
-"ACCN";"602";"Achats stockés - Autres approvisionnements";"";"60";""
-"ACCN";"6022";"Fournitures consommables";"";"60";""
-"ACCN";"6026";"Emballages";"";"60";""
-"ACCN";"603";"Variation des stocks (approvisionnements et marchandises)";"";"60";""
"ACCN";"604";"Achats d'études et prestations de services";"";"60";""
"ACCN";"605";"Achats de matériel, équipements et travaux";"";"60";""
"ACCN";"606";"Achats non stockés de matières et fournitures";"";"60";""
"ACCN";"607";"Achats de marchandises";"";"60";""
"ACCN";"608";"Frais accessoires d'achat";"";"60";""
"ACCN";"60";"ACHATS (sauf 603)";"";"6";""
-"ACCN";"609";"Rabais; remises et ristournes obtenus sur achats";"";"60";""
"ACCN";"611";"Sous-traitance générale";"";"61";""
"ACCN";"612";"Redevances de crédit-bail";"";"61";""
"ACCN";"613";"Locations";"";"61";""
@@ -405,5 +379,83 @@
"ACCN";"890";"Bilan d'ouverture";"";"89";""
"ACCN";"89";"BILAN";"";"8";""
"ACCN";"891";"Bilan de clôture";"";"89";""
-"ACCN";"44571";"TVA collectée";"";"4457";""
-"ACCN";"445715";"TVA collectée 5;5 % encaissements";"";"44571";""
+"ACCN";"6031";"Variation des stocks de matières premières (et fournitures)";;"603";""
+"ACCN";"6032";"Variation des stocks des autres approvisionnements";;"603";""
+"ACCN";"603";"Variation des stocks (approvisionnements et marchandises)";"";"60";""
+"ACCN";"2761";"Créances diverses";;"276";""
+"ACCN";"276";"Autres créances immobilisées";"";"27";""
+"ACCN";"27682";"Sur titres immobilisés (droits de créance)";;"2768";""
+"ACCN";"27684";"Sur prêts";;"2768";""
+"ACCN";"27685";"Sur dépôts et cautionnements";;"2768";""
+"ACCN";"27688";"Sur créances diverses";;"2768";""
+"ACCN";"2768";"Intérêts courus";;"276";""
+"ACCN";"2801";"Frais d'établissement (même ventilation que celle du compte 201)";;"280";""
+"ACCN";"2803";"Frais de recherche et développement";;"280";""
+"ACCN";"2805";"Concessions et droits similaires, brevets, licences, logiciels, droits et valeurs similaires";;"280";""
+"ACCN";"2807";"Fonds commercial";;"280";""
+"ACCN";"2808";"Autres immobilisations incorporelles";;"280";""
+"ACCN";"280";"Amortissements des immobilisations incorporelles";"";"28";""
+"ACCN";"2811";"Terrains de gisement";;"281";""
+"ACCN";"2812";"Agencements, aménagements de terrains (même ventilation que celle du compte 212)";;"281";""
+"ACCN";"2813";"Constructions (même ventilation que celle du compte 213)";;"281";""
+"ACCN";"2814";"Constructions sur sol d'autrui (même ventilation que celle du compte 214)";;"281";""
+"ACCN";"2815";"Installations techniques, matériel et outillage industriels (même ventilation que celle du compte 215)";;"281";""
+"ACCN";"2818";"Autres immobilisations corporelles (même ventilation que celle du compte 218)";;"281";""
+"ACCN";"281";"Amortissements des immobilisations corporelles";"";"28";""
+"ACCN";"2905";"Marques, procédés, droits, et valeurs similaires";;"290";""
+"ACCN";"2906";"Droit au bail";;"290";""
+"ACCN";"2907";"Fonds commercial";;"290";""
+"ACCN";"2908";"Autres immobilisations incorporelles";;"290";""
+"ACCN";"290";"Provisions pour dépréciation immobilisations incorporelles";"";"29";""
+"ACCN";"2911";"Terrains (autres que terrains de gisement)";;"291";""
+"ACCN";"291";"Provisions pour dépréciation immobilisations corporelles";"";"29";""
+"ACCN";"2931";"Immobilisations corporelles en cours";;"293";""
+"ACCN";"2932";"Immobilisations incorporelles en cours";;"293";""
+"ACCN";"293";"Dépréciations des immobilisations en cours";"";"29";""
+"ACCN";"2961";"Titres de participation";;"296";""
+"ACCN";"2966";"Autres formes de participation";;"296";""
+"ACCN";"2967";"Créances rattachées à des participations (même ventilation que celle du compte 267)";;"296";""
+"ACCN";"2968";"Créances rattachées à des sociétés en participation (même ventilation que celle du compte 268)";;"296";""
+"ACCN";"296";" Dépréciations des participations et créances rattachées à des participations";"";"29";""
+"ACCN";"2971";"Titres immobilisés autres que les titres immobilisés de l'activité portefeuille - droit de propriété (même ventilation que celle du compte 271)";;"297";""
+"ACCN";"2972";"Titres immobilisés - droit de créance (même ventilation que celle du compte 272)";;"297";""
+"ACCN";"2973";"Titres immobilisés de l'activité portefeuille";;"297";""
+"ACCN";"2974";"Prêts (même ventilation que celle du compte 274)";;"297";""
+"ACCN";"2975";"Dépôts et cautionnements versés (même ventilation que celle du compte 275)";;"297";""
+"ACCN";"2976";"Autres créances immobilisées (même ventilation que celle du compte 276)";;"297";""
+"ACCN";"297";"Provisions pour dépréciation des immobilisations financières";"";"29";""
+"ACCN";"1671";"Émissions de titres participatifs";;"167";""
+"ACCN";"1674";"Avances conditionnées de l'État";;"167";""
+"ACCN";"1675";"Emprunts participatifs";;"167";""
+"ACCN";"167";"Emprunts et dettes assortis de conditions particulières";"";"16";""
+"ACCN";"168";"Autres emprunts et dettes assimilées";"";"16";""
+"ACCN";"4081";"Fournisseurs";;"408";""
+"ACCN";"4084";"Fournisseurs d'immobilisations";;"408";""
+"ACCN";"4088";"Fournisseurs - Intérêts courus";;"408";""
+"ACCN";"408";"Fournisseurs - Factures non parvenues";"";"40";""
+"ACCN";"4091";"Fournisseurs - Avances et acomptes versés sur commandes";;"409";""
+"ACCN";"4096";"Fournisseurs - Créances pour emballages et matériel à rendre";;"409";""
+"ACCN";"4097";"Fournisseurs - Autres Avoirs";;"409";""
+"ACCN";"4098";"Rabais, remises, ristournes à obtenir et autres avoirs non encore reçus";;"409";""
+"ACCN";"409";"Fournisseurs débiteurs";"";"40";""
+"ACCN";"4191";"Clients - Avances et acomptes reçus sur commandes";;"419";""
+"ACCN";"4196";"Clients - Dettes pour emballages et matériels consignés";;"419";""
+"ACCN";"4197";"Clients - Autres avoirs";;"419";""
+"ACCN";"4198";"Rabais, remises, ristournes à accorder et autres avoirs à établir";;"419";""
+"ACCN";"419";"Clients créditeurs";"";"41";""
+"ACCN";"4282";"Dettes provisionnées pour congés à payer";;"428";""
+"ACCN";"4284";"Dettes provisionnées pour participation des salariés aux résultats";;"428";""
+"ACCN";"4286";"Autres charges à payer";;"428";""
+"ACCN";"4287";"Produits à recevoir";;"428";""
+"ACCN";"428";"Personnel - Charges à payer et produits à recevoir";"";"42";""
+"ACCN";"6022";"Fournitures consommables";;"602";""
+"ACCN";"602";"Achats stockés - Autres approvisionnements";"";"60";""
+"ACCN";"6026";"Emballages";;"602";""
+"ACCN";"6091";"de matières premières (et fournitures)";;"609";""
+"ACCN";"6092";"d'autres approvisionnements stockés";;"609";""
+"ACCN";"6094";"d'études et de prestations de services";;"609";""
+"ACCN";"6095";"de matériel, équipements et travaux";;"609";""
+"ACCN";"6096";"d'approvisionnements non stockés";;"609";""
+"ACCN";"6097";"de marchandises";;"609";""
+"ACCN";"6098";"Rabais, remises et ristournes non affectés";;"609";""
+"ACCN";"609";"Rabais; remises et ristournes obtenus sur achats";"";"60";""
1
0
r3004 - trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction
by jpepin@users.chorem.org Aug. 16, 2010
by jpepin@users.chorem.org Aug. 16, 2010
Aug. 16, 2010
Author: jpepin
Date: 2010-08-16 15:11:52 +0200 (Mon, 16 Aug 2010)
New Revision: 3004
Url: http://chorem.org/repositories/revision/lima/3004
Log:
KeyListerner sur la touche tab :
Saut automatique des cellules non ?\195?\169ditables.
Ajout d'une entr?\195?\169e en fin de ligne si la transaction est non ?\195?\169quilibr?\195?\169.
Ajout d'une nouvelle transaction en fin de ligne via tab si la derni?\195?\168re est ?\195?\169quilibr?\195?\169.
Added:
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionView.jaxx
Removed:
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionView.jaxx
Modified:
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTable.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTableModel.java
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTable.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTable.java 2010-08-13 15:27:33 UTC (rev 3003)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTable.java 2010-08-16 13:11:52 UTC (rev 3004)
@@ -28,7 +28,9 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.entity.Account;
+import org.chorem.lima.entity.Entry;
import org.chorem.lima.entity.EntryBook;
+import org.chorem.lima.entity.FinancialTransaction;
import org.chorem.lima.ui.celleditor.AccountTableCellEditor;
import org.chorem.lima.ui.celleditor.DateTableCellEditor;
import org.chorem.lima.ui.celleditor.EntryBookTableCellEditor;
@@ -164,37 +166,78 @@
/**
* Touche tab
+ * Incrémente le curseur de case tant que la case n'est pas editable
* Ajoute une entrée comptable si tab est sur
- * la dernière cellule.
+ * la dernière cellule et si la transaction est non équilibré
+ * sinon rajoute une transaction
*/
if (e.getKeyChar() == KeyEvent.VK_TAB) {
- // Vérifie si la cellule sélectionnée est la dernière
+ int max_x = this.getColumnCount();
+ int max_y = this.getRowCount();
+ int x_tab = this.getSelectedColumn();
+ int y_tab = this.getSelectedRow();
+
+ if (x_tab < max_x - 1){
+ x_tab++;
+ }
+ else {
+ y_tab++;
+ }
+ //skip all cell while not editable
+ while (!isCellEditable(y_tab, x_tab)){
- int x = this.getSelectedColumn();
- int y = this.getSelectedRow();
- int max_x = this.getColumnCount() - 1;
- int max_y = this.getRowCount() - 1;
- if (x == max_x && y == max_y) {
- handler.addEmptyEntry();
- // positionne la sélection sur la nouvelle ligne créée
- this.setColumnSelectionInterval(0, 0);
- this.setRowSelectionInterval(max_y + 1, max_y + 1);
- }
+ //if end of row
+ if (x_tab == max_x-1) {
+ Object object = this.handler.tableModel.getElementAt(y_tab);
+
+ //if transaction, add entry
+ if (object instanceof FinancialTransaction){
+ FinancialTransaction financialTransaction = (FinancialTransaction) object;
+ if (financialTransaction.getEntry().size() == 0){
+ handler.addEmptyEntry();
+ this.setColumnSelectionInterval(1, 1);
+ }
+ }
+ //if entry
+ else {
+ Entry entry = (Entry) object;
+ FinancialTransaction financialTransaction = entry.getFinancialTransaction();
+ Boolean balanced =
+ financialTransaction.getAmountCredit() ==
+ financialTransaction.getAmountDebit();
+ if (balanced){
+ if (y_tab == max_y-1){
+ handler.addFinancialTransaction();
+ this.setColumnSelectionInterval(0, 0);
+ }
+ }
+ else {
+ handler.addEmptyEntry();
+ this.setColumnSelectionInterval(1, 1);
+ }
+ }
+ y_tab++;
+ // positionne la sélection sur la nouvelle ligne créée
+ this.setRowSelectionInterval(y_tab, y_tab);
+ x_tab=0;
+ }
+ else {
+ if (x_tab < max_x){
+ this.setColumnSelectionInterval(x_tab, x_tab);
+ x_tab++;
+ }
+ }
+ }
}
-
}
- /*
- * @see java.awt.event.KeyListener#keyTyped(java.awt.event.KeyEvent)
- */
+
@Override
public void keyTyped(KeyEvent e) {
}
- /*
- * @see java.awt.event.KeyListener#keyReleased(java.awt.event.KeyEvent)
- */
+
@Override
public void keyReleased(KeyEvent e) {
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTableModel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTableModel.java 2010-08-13 15:27:33 UTC (rev 3003)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTableModel.java 2010-08-16 13:11:52 UTC (rev 3004)
@@ -327,7 +327,7 @@
boolean editableCell=false;
Object currentRow = cacheDataList.get(rowIndex);
// cells editable for the entry row, all cells exclude the date
- if ((currentRow instanceof Entry) && !((columnIndex==0) || (columnIndex==1))) {
+ if ((currentRow instanceof Entry) && !((columnIndex==0) || (columnIndex==1) || (columnIndex==8))) {
editableCell=true;
}
// cells editable for the financialtransaction row, no cells exclude the date
@@ -336,7 +336,9 @@
}
return editableCell;
}
+
+
/**
* @throws LimaException
*/
@@ -550,7 +552,7 @@
}
//on recharge la liste
cacheDataList = getDataList();
- fireTableRowsDeleted(row, getRowCount());
+ fireTableDataChanged();
}
@Override
Deleted: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionView.jaxx 2010-08-13 15:27:33 UTC (rev 3003)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionView.jaxx 2010-08-16 13:11:52 UTC (rev 3004)
@@ -1,104 +0,0 @@
-<!-- ##% Lima Swing
- Copyright (C) 2008 - 2010 CodeLutin
- This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License
- as published by the Free Software Foundation; either version 2
- of the License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- ##% -->
-
-<Table>
- <FinancialTransactionViewHandler id="handler" javaBean="new FinancialTransactionViewHandler(this)" />
- <Boolean id="selectedRow" javaBean="false" />
- <org.chorem.lima.ui.combobox.FinancialPeriodComboBoxModel id="modelFinancialPeriod"/>
- <org.chorem.lima.ui.combobox.FiscalPeriodComboBoxModel id="modelFiscalPeriod"/>
- <script>
- <![CDATA[
- import org.chorem.lima.entity.FiscalPeriod;
- import org.chorem.lima.entity.FinancialPeriod;
-
- void $afterCompleteSetup() {
- getHandler().refresh();
- }
-
- ]]>
- </script>
-
- <!-- <JPopupMenu id="MenuRightPanel">
- <JMenuItem text="lima.add.transaction" onActionPerformed='addEmptyTransaction()'/>
- <JMenuItem text="lima.print"/>
- </JPopupMenu>
- <JPopupMenu id="MenuRightTransaction">
- <JMenuItem text="lima.add" onActionPerformed='addEmptyTransaction()'/>
- <JMenuItem text="lima.print"/>
- </JPopupMenu> -->
-
- <row weightx="1" weighty="0" anchor="center">
- <cell anchor="east">
- <JLabel id="fiscalPeriodLabel" text="lima.charts.fiscalyear"/>
- </cell>
- <cell anchor="west">
- <JComboBox id="fiscalPeriodComboBox"
- model="{getModelFiscalPeriod()}"
- renderer="{new org.chorem.lima.ui.combobox.FiscalPeriodComboBoxRenderer()}"
- onActionPerformed="getModelFinancialPeriod().setFiscalPeriod( (FiscalPeriod) fiscalPeriodComboBox.getSelectedItem());
- getHandler().refresh()"
- editable="false"/>
- </cell>
- <cell anchor="east">
- <JLabel id="financialPeriodLabel" text="lima.transaction.period"
- />
- </cell>
- <cell anchor="west">
- <JComboBox id="financialPeriodComboBox"
- model="{getModelFinancialPeriod()}"
- renderer="{new org.chorem.lima.ui.combobox.FinancialPeriodComboBoxRenderer()}"
- onActionPerformed="getFinancialTransactionTableModel().setFinancialPeriod( (FinancialPeriod) financialPeriodComboBox.getSelectedItem());
- getHandler().refresh()"
- editable="false"
- />
- </cell>
- <cell>
- <JButton text="lima.common.copy"
- onActionPerformed="getHandler().copyRow()" enabled="{isSelectedRow()}"/>
- </cell>
- <cell>
- <JButton text="lima.common.paste"
- onActionPerformed="getHandler().pasteRow()" enabled="{isSelectedRow()}"/>
- </cell>
- <cell>
- <JButton text="lima.add.transaction"
- onActionPerformed="getHandler().addFinancialTransaction()"/>
- </cell>
- <cell>
- <JButton text="lima.add.entry" onActionPerformed="getHandler().addEmptyEntry()" enabled="{isSelectedRow()}"/>
- </cell>
- <cell>
- <JButton text="lima.common.remove"
- onActionPerformed="getHandler().deleteSelectedRow()"
- enabled="{isSelectedRow()}"/>
- </cell>
- </row>
- <row>
- <cell fill="both" weightx="1" weighty="1" rows="3" columns="9">
- <JScrollPane>
- <org.chorem.lima.ui.financialtransaction.FinancialTransactionTableModel
- id="financialTransactionTableModel"/>
- <org.chorem.lima.ui.financialtransaction.FinancialTransactionTable
- id="financialTransactionTable" sortable="false" rowHeight="22"
- constructorParams="getHandler()" model="{getFinancialTransactionTableModel()}"
- selectionMode="{ListSelectionModel.SINGLE_SELECTION}" />
- <javax.swing.ListSelectionModel javaBean="getFinancialTransactionTable().getSelectionModel()"
- onValueChanged="setSelectedRow(financialTransactionTable.getSelectedRow() != -1)"/>
- </JScrollPane>
- </cell>
- </row>
-</Table>
\ No newline at end of file
Copied: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionView.jaxx (from rev 3003, trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionView.jaxx)
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionView.jaxx (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionView.jaxx 2010-08-16 13:11:52 UTC (rev 3004)
@@ -0,0 +1,104 @@
+<!-- ##% Lima Swing
+ Copyright (C) 2008 - 2010 CodeLutin
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ as published by the Free Software Foundation; either version 2
+ of the License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ ##% -->
+
+<Table>
+ <FinancialTransactionViewHandler id="handler" javaBean="new FinancialTransactionViewHandler(this)" />
+ <Boolean id="selectedRow" javaBean="false" />
+ <org.chorem.lima.ui.combobox.FinancialPeriodComboBoxModel id="modelFinancialPeriod"/>
+ <org.chorem.lima.ui.combobox.FiscalPeriodComboBoxModel id="modelFiscalPeriod"/>
+ <script>
+ <![CDATA[
+ import org.chorem.lima.entity.FiscalPeriod;
+ import org.chorem.lima.entity.FinancialPeriod;
+
+ void $afterCompleteSetup() {
+ getHandler().refresh();
+ }
+
+ ]]>
+ </script>
+
+ <!-- <JPopupMenu id="MenuRightPanel">
+ <JMenuItem text="lima.add.transaction" onActionPerformed='addEmptyTransaction()'/>
+ <JMenuItem text="lima.print"/>
+ </JPopupMenu>
+ <JPopupMenu id="MenuRightTransaction">
+ <JMenuItem text="lima.add" onActionPerformed='addEmptyTransaction()'/>
+ <JMenuItem text="lima.print"/>
+ </JPopupMenu> -->
+
+ <row weightx="1" weighty="0" anchor="center">
+ <cell anchor="east">
+ <JLabel id="fiscalPeriodLabel" text="lima.charts.fiscalyear"/>
+ </cell>
+ <cell anchor="west">
+ <JComboBox id="fiscalPeriodComboBox"
+ model="{getModelFiscalPeriod()}"
+ renderer="{new org.chorem.lima.ui.combobox.FiscalPeriodComboBoxRenderer()}"
+ onActionPerformed="getModelFinancialPeriod().setFiscalPeriod( (FiscalPeriod) fiscalPeriodComboBox.getSelectedItem());
+ getHandler().refresh()"
+ editable="false"/>
+ </cell>
+ <cell anchor="east">
+ <JLabel id="financialPeriodLabel" text="lima.transaction.period"
+ />
+ </cell>
+ <cell anchor="west">
+ <JComboBox id="financialPeriodComboBox"
+ model="{getModelFinancialPeriod()}"
+ renderer="{new org.chorem.lima.ui.combobox.FinancialPeriodComboBoxRenderer()}"
+ onActionPerformed="getFinancialTransactionTableModel().setFinancialPeriod( (FinancialPeriod) financialPeriodComboBox.getSelectedItem());
+ getHandler().refresh()"
+ editable="false"
+ />
+ </cell>
+ <cell>
+ <JButton text="lima.common.copy"
+ onActionPerformed="getHandler().copyRow()" enabled="{isSelectedRow()}"/>
+ </cell>
+ <cell>
+ <JButton text="lima.common.paste"
+ onActionPerformed="getHandler().pasteRow()" enabled="{isSelectedRow()}"/>
+ </cell>
+ <cell>
+ <JButton text="lima.add.transaction"
+ onActionPerformed="getHandler().addFinancialTransaction()"/>
+ </cell>
+ <cell>
+ <JButton text="lima.add.entry" onActionPerformed="getHandler().addEmptyEntry()" enabled="{isSelectedRow()}"/>
+ </cell>
+ <cell>
+ <JButton text="lima.common.remove"
+ onActionPerformed="getHandler().deleteSelectedRow()"
+ enabled="{isSelectedRow()}"/>
+ </cell>
+ </row>
+ <row>
+ <cell fill="both" weightx="1" weighty="1" rows="3" columns="9">
+ <JScrollPane>
+ <org.chorem.lima.ui.financialtransaction.FinancialTransactionTableModel
+ id="financialTransactionTableModel"/>
+ <org.chorem.lima.ui.financialtransaction.FinancialTransactionTable
+ id="financialTransactionTable" sortable="false" rowHeight="22"
+ constructorParams="getHandler()" model="{getFinancialTransactionTableModel()}"
+ selectionMode="{ListSelectionModel.SINGLE_SELECTION}" />
+ <javax.swing.ListSelectionModel javaBean="getFinancialTransactionTable().getSelectionModel()"
+ onValueChanged="setSelectedRow(financialTransactionTable.getSelectedRow() != -1)"/>
+ </JScrollPane>
+ </cell>
+ </row>
+</Table>
\ No newline at end of file
1
0
Aug. 13, 2010
Author: jpepin
Date: 2010-08-13 17:27:33 +0200 (Fri, 13 Aug 2010)
New Revision: 3003
Url: http://chorem.org/repositories/revision/lima/3003
Log:
Modification de la fonction d'entr?\195?\169es non ?\195?\169quilibr?\195?\169s en entr?\195?\169es incorrectes : v?\195?\169rification suppl?\195?\169mentaire sur le journal et les comptes.
D?\195?\169bogue surlignage entr?\195?\169e non ?\195?\169quilibr?\195?\169.
Ajout fonction copie-colle d'entr?\195?\169es.
Modified:
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialTransactionService.java
trunk/lima-swing/src/main/java/org/chorem/lima/service/ServiceMonitorableHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTable.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTableModel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionViewHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedTable.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedTableModel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/FinancialTransactionsPane.java
trunk/lima-swing/src/main/resources/i18n/lima-swing-en_GB.properties
trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties
trunk/pom.xml
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java 2010-08-13 13:01:51 UTC (rev 3002)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java 2010-08-13 15:27:33 UTC (rev 3003)
@@ -408,7 +408,6 @@
.addParam("account", account);
Account master = accountDAO.findByQuery(query);
- log.debug(master);
accountingRules.updateAccountRules(master, account);
subAccount.setMasterAccount(account.getMasterAccount());
subAccount.setSubAccounts(account.getSubAccounts());
@@ -563,9 +562,6 @@
doCatch(topiaContext, ex, log);
}
}
- for (Account account : accounts) {
- log.debug("accounts " + account.getAccountNumber());
- }
return accounts;
}
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java 2010-08-13 13:01:51 UTC (rev 3002)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java 2010-08-13 15:27:33 UTC (rev 3003)
@@ -23,7 +23,10 @@
import java.math.BigDecimal;
import java.util.Date;
+import java.util.HashSet;
import java.util.List;
+import java.util.Set;
+
import javax.ejb.Stateless;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -46,6 +49,7 @@
import org.nuiton.topia.TopiaException;
import org.nuiton.topia.TopiaNotFoundException;
import org.nuiton.topia.framework.TopiaQuery;
+import org.nuiton.topia.framework.TopiaQuery.Op;
/**
* Cette classe permet la création d'une transaction comptable dans l'application.
@@ -182,21 +186,27 @@
* Get unbalanced financialtransaction from selected fiscalperiod
*/
@Override
- public List<FinancialTransaction> getAllFinancialTransactionsUnbalanced(FiscalPeriod fiscalPeriod) throws LimaException {
+ public Set<FinancialTransaction> getAllInexactFinancialTransactions(FiscalPeriod fiscalPeriod) throws LimaException {
TopiaContext topiaContext = null;
- List<FinancialTransaction> result = null;
+ Set<FinancialTransaction> result = new HashSet<FinancialTransaction>();
try {
topiaContext = beginTransaction();
FinancialTransactionDAO financialTransactionDAO =
LimaCallaoDAOHelper.getFinancialTransactionDAO(topiaContext);
-
TopiaQuery query = financialTransactionDAO.createQuery("E");
query.addFrom(FiscalPeriod.class, "F")
- .addWhere("E.amountCredit != E.amountDebit")
+ .addWhere("E.amountCredit != E.amountDebit OR E.entryBook = null")
.addInElements("E.financialPeriod", "F.financialPeriod")
.addEquals("F", fiscalPeriod);
- result = financialTransactionDAO.findAllByQuery(query);
+ result.addAll(financialTransactionDAO.findAllByQuery(query));
+
+ TopiaQuery query2 = financialTransactionDAO.createQuery("T");
+ query2.addFrom(Entry.class, "E")
+ .addWhere("E.account = null")
+ .addInElements("E", "T.entry");
+ result.addAll(financialTransactionDAO.findAllByQuery(query2));
+
/* Just for fun : IN HQL
result = topiaContext.find(
"FROM org.chorem.lima.entity.FinancialTransaction "+
@@ -391,6 +401,34 @@
EntryDAO entryDAO = LimaCallaoDAOHelper.getEntryDAO(topiaContext);
entryDAO.create(entry);
+
+ //get new entry amounts
+ BigDecimal entryAmount = entry.getAmount();
+ Boolean entryAmountIsDebit = entry.getDebit();
+ BigDecimal entryDebit = new BigDecimal(0), entryCredit = new BigDecimal(0);
+ if (entryAmountIsDebit){
+ entryDebit = entryAmount;
+ }
+ else {
+ entryCredit = entryAmount;
+ }
+
+ //calculate financial transaction amounts
+ FinancialTransaction financialTransaction =
+ entry.getFinancialTransaction();
+
+ BigDecimal amountDebit = financialTransaction.getAmountDebit();
+ amountDebit = amountDebit.add(entryDebit);
+ financialTransaction.setAmountDebit(amountDebit);
+
+ BigDecimal amountCredit = financialTransaction.getAmountCredit();
+ amountCredit = amountCredit.add(entryCredit);
+ financialTransaction.setAmountCredit(amountCredit);
+
+ //update financial transaction
+ updateFinancialTransactionWithTransaction(
+ financialTransaction, topiaContext);
+
commitTransaction(topiaContext);
}
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialTransactionService.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialTransactionService.java 2010-08-13 13:01:51 UTC (rev 3002)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialTransactionService.java 2010-08-13 15:27:33 UTC (rev 3003)
@@ -20,6 +20,8 @@
package org.chorem.lima.business.ejbinterface;
import java.util.List;
+import java.util.Set;
+
import javax.ejb.Remote;
import org.chorem.lima.business.LimaBusinessException;
import org.chorem.lima.business.LimaException;
@@ -57,7 +59,7 @@
List<FinancialTransaction> getAllFinancialTransactionsForEntryBookAndFinancialPeriod(
EntryBook entryBook, FinancialPeriod period) throws LimaException;
- List<FinancialTransaction> getAllFinancialTransactionsUnbalanced(FiscalPeriod fiscalPeriod) throws LimaException;
+ Set<FinancialTransaction> getAllInexactFinancialTransactions(FiscalPeriod fiscalPeriod) throws LimaException;
List<FinancialTransaction> getAllFinancialTransactionsBalanced(FiscalPeriod fiscalPeriod) throws LimaException;
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/service/ServiceMonitorableHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/service/ServiceMonitorableHandler.java 2010-08-13 13:01:51 UTC (rev 3002)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/service/ServiceMonitorableHandler.java 2010-08-13 15:27:33 UTC (rev 3003)
@@ -25,8 +25,6 @@
import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.chorem.lima.business.LimaBusinessException;
-import org.chorem.lima.business.LimaException;
import org.chorem.lima.business.ServiceListener;
public class ServiceMonitorableHandler implements InvocationHandler {
@@ -67,6 +65,7 @@
if (!method.getName().startsWith("get")){
for (ServiceListener serviceListener : listeners) {
serviceListener.notifyMethod(service.toString(), method.getName());
+ log.debug("proxy : " + service.toString() + " " + method.getName());
}
}
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTable.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTable.java 2010-08-13 13:01:51 UTC (rev 3002)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTable.java 2010-08-13 15:27:33 UTC (rev 3003)
@@ -22,7 +22,11 @@
import java.awt.Component;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
+import java.math.BigDecimal;
import java.util.Date;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.chorem.lima.entity.Account;
import org.chorem.lima.entity.EntryBook;
import org.chorem.lima.ui.celleditor.AccountTableCellEditor;
@@ -45,6 +49,10 @@
/** serialVersionUID. */
private static final long serialVersionUID = 3133690382049594727L;
+
+ /** log. */
+ private static final Log log = LogFactory
+ .getLog(FinancialTransactionTable.class);
protected FinancialTransactionViewHandler handler;
@@ -110,9 +118,9 @@
ComponentAdapter adapter) {
boolean isHighlighted = false;
Object value = adapter.getValueAt(adapter.row, 8);
- if (value instanceof Double) {
- Double currentBalance = (Double) value;
- if (currentBalance != 0) {
+ if (value instanceof BigDecimal) {
+ BigDecimal currentBalance = (BigDecimal) value;
+ if (currentBalance.doubleValue() != 0) {
isHighlighted = true;
}
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTableModel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTableModel.java 2010-08-13 13:01:51 UTC (rev 3002)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTableModel.java 2010-08-13 15:27:33 UTC (rev 3003)
@@ -413,12 +413,42 @@
fireTableDataChanged();
}
+ public void addEntry(Object value, Entry entry, int row) throws LimaException {
+ FinancialTransaction currentTransaction = null;
+ int financialTransactionRow = 0;
+ Object currentRow = cacheDataList.get(row);
+ //check if current row is a transaction or an entry
+ if (currentRow instanceof FinancialTransaction) {
+ currentTransaction = (FinancialTransaction)currentRow;
+ //update the financial transaction in entire
+ financialTransactionRow =
+ getDataList().indexOf(((FinancialTransaction) currentRow));
+ }
+ else if (currentRow instanceof Entry) {
+ Entry currentEntry = (Entry)currentRow;
+ //get back the parent transaction of the entry
+ currentTransaction = currentEntry.getFinancialTransaction();
+ //update the financial transaction in entire
+ financialTransactionRow =
+ getDataList().indexOf(((Entry) currentRow).
+ getFinancialTransaction());
+ }
+ //create it
+ entry.setFinancialTransaction(currentTransaction);
+ financialTransactionService.createEntry(entry);
+ fireTableRowsUpdated(financialTransactionRow, getRowCount()-1);
+
+ //on recharge la liste
+ cacheDataList = getDataList();
+ fireTableDataChanged();
+ }
+
/**
* to modifiy financialtransaction or entry
*/
@Override
public void setValueAt(Object value, int row, int column) {
- int financialTransactionRow=0;
+ int financialTransactionRow = 0;
if (cacheDataList != null) {
Object currentRow = cacheDataList.get(row);
if (currentRow instanceof FinancialTransaction) {
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionView.jaxx 2010-08-13 13:01:51 UTC (rev 3002)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionView.jaxx 2010-08-13 15:27:33 UTC (rev 3003)
@@ -67,11 +67,19 @@
/>
</cell>
<cell>
+ <JButton text="lima.common.copy"
+ onActionPerformed="getHandler().copyRow()" enabled="{isSelectedRow()}"/>
+ </cell>
+ <cell>
+ <JButton text="lima.common.paste"
+ onActionPerformed="getHandler().pasteRow()" enabled="{isSelectedRow()}"/>
+ </cell>
+ <cell>
<JButton text="lima.add.transaction"
onActionPerformed="getHandler().addFinancialTransaction()"/>
</cell>
<cell>
- <JButton text="lima.add.entry" onActionPerformed="getHandler().addEmptyEntry()"/>
+ <JButton text="lima.add.entry" onActionPerformed="getHandler().addEmptyEntry()" enabled="{isSelectedRow()}"/>
</cell>
<cell>
<JButton text="lima.common.remove"
@@ -80,7 +88,7 @@
</cell>
</row>
<row>
- <cell fill="both" weightx="1" weighty="1" rows="3" columns="8">
+ <cell fill="both" weightx="1" weighty="1" rows="3" columns="9">
<JScrollPane>
<org.chorem.lima.ui.financialtransaction.FinancialTransactionTableModel
id="financialTransactionTableModel"/>
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionViewHandler.java 2010-08-13 13:01:51 UTC (rev 3002)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionViewHandler.java 2010-08-13 15:27:33 UTC (rev 3003)
@@ -27,6 +27,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.business.LimaException;
+import org.chorem.lima.entity.Entry;
import org.chorem.lima.entity.FinancialTransaction;
import org.chorem.lima.ui.combobox.FinancialPeriodComboBoxModel;
import org.chorem.lima.ui.combobox.FiscalPeriodComboBoxModel;
@@ -57,11 +58,51 @@
protected FiscalPeriodComboBoxModel fiscalPeriodComboBoxModel;
protected FinancialPeriodComboBoxModel financialPeriodComboBoxModel;
+
+ protected Object clipBoard;
protected FinancialTransactionViewHandler(FinancialTransactionView view) {
this.view = view;
}
+ //copy entry
+ public void copyRow(){
+ int indexSelectedRow = table.getSelectedRow();
+
+ if (indexSelectedRow != -1) {
+ clipBoard = tableModel.getElementAt(indexSelectedRow);
+ }
+ }
+
+ //paste entry
+ public void pasteRow(){
+ int indexSelectedRow = table.getSelectedRow();
+
+ if (indexSelectedRow != -1) {
+ Object selectedValue = tableModel.getElementAt(indexSelectedRow);
+ if (clipBoard instanceof Entry) {
+ try {
+ tableModel.addEntry(selectedValue, (Entry) clipBoard, indexSelectedRow);
+ //select the new line
+ ListSelectionModel selectionModel =
+ table.getSelectionModel();
+ selectionModel.setSelectionInterval(
+ indexSelectedRow+1, indexSelectedRow+1);
+ //focus on second column
+ table.changeSelection(indexSelectedRow+1, 1, false, false);
+ table.requestFocusInWindow();
+ } catch (LimaException eee){
+ if (log.isErrorEnabled()) {
+ log.error("Can't past entry", eee);
+ }
+ DialogHelper.showMessageDialog(eee.getMessage());
+ }
+ }
+
+ }
+
+ }
+
//add a new transaction
public void addFinancialTransaction() {
table = view.getFinancialTransactionTable();
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedTable.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedTable.java 2010-08-13 13:01:51 UTC (rev 3002)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedTable.java 2010-08-13 15:27:33 UTC (rev 3003)
@@ -22,6 +22,7 @@
import java.awt.Component;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
+import java.math.BigDecimal;
import java.util.Date;
import org.chorem.lima.entity.Account;
import org.chorem.lima.entity.EntryBook;
@@ -113,9 +114,9 @@
ComponentAdapter adapter) {
boolean isHighlighted = false;
Object value = adapter.getValueAt(adapter.row, 8);
- if (value instanceof Double) {
- Double currentBalance = (Double) value;
- if (currentBalance != 0) {
+ if (value instanceof BigDecimal) {
+ BigDecimal currentBalance = (BigDecimal) value;
+ if (currentBalance.doubleValue() != 0) {
isHighlighted = true;
}
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedTableModel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedTableModel.java 2010-08-13 13:01:51 UTC (rev 3002)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedTableModel.java 2010-08-13 15:27:33 UTC (rev 3003)
@@ -25,6 +25,8 @@
import java.util.Collections;
import java.util.Date;
import java.util.List;
+import java.util.Set;
+
import javax.swing.table.AbstractTableModel;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -98,8 +100,8 @@
List<Object> results = new ArrayList<Object>();
if(selectedFiscalPeriod != null){
try {
- List<FinancialTransaction> financialtransactions =
- financialTransactionService.getAllFinancialTransactionsUnbalanced(selectedFiscalPeriod);
+ Set<FinancialTransaction> financialtransactions =
+ financialTransactionService.getAllInexactFinancialTransactions(selectedFiscalPeriod);
for (FinancialTransaction financialtransaction : financialtransactions) {
results.add(financialtransaction);
List<Entry> entries = (List<Entry>) financialtransaction.getEntry();
@@ -338,6 +340,7 @@
FinancialTransaction currentTransaction = null;
Object currentRow = cacheDataList.get(row);
Entry entry = new EntryImpl();
+ entry.setAmount(new BigDecimal(0));
//check if current row is a transaction or an entry
if (currentRow instanceof FinancialTransaction) {
currentTransaction = (FinancialTransaction)currentRow;
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/FinancialTransactionsPane.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/FinancialTransactionsPane.java 2010-08-13 13:01:51 UTC (rev 3002)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/FinancialTransactionsPane.java 2010-08-13 15:27:33 UTC (rev 3003)
@@ -21,6 +21,8 @@
import static org.nuiton.i18n.I18n._;
import java.awt.Color;
import java.util.List;
+import java.util.Set;
+
import javax.swing.JEditorPane;
import javax.swing.event.HyperlinkEvent;
import javax.swing.event.HyperlinkListener;
@@ -99,9 +101,9 @@
List<FiscalPeriod> unblockedFiscalPeriods =
fiscalPeriodService.getAllUnblockedFiscalPeriods();
if (unblockedFiscalPeriods.size() != 0){
- List<FinancialTransaction> financialTransactionsUnbal =
+ Set<FinancialTransaction> financialTransactionsUnbal =
financialTransactionService.
- getAllFinancialTransactionsUnbalanced(unblockedFiscalPeriods.get(0));
+ getAllInexactFinancialTransactions(unblockedFiscalPeriods.get(0));
if (financialTransactionsUnbal.size()>0){
setBackground(redBackground);
String transactionsString = financialTransactionsUnbal.size()
@@ -146,7 +148,7 @@
@Override
public void notifyMethod(String serviceName, String methodeName) {
- if (methodeName.contains("FiscalPeriod") || methodeName.contains("FinancialTransaction") || methodeName.contains("importEntries") || methodeName.contains("importAll")){
+ if (methodeName.contains("FiscalPeriod") || methodeName.contains("FinancialTransaction") || methodeName.contains("Entry") || methodeName.contains("importEntries") || methodeName.contains("importAll")){
refresh();
}
}
Modified: trunk/lima-swing/src/main/resources/i18n/lima-swing-en_GB.properties
===================================================================
--- trunk/lima-swing/src/main/resources/i18n/lima-swing-en_GB.properties 2010-08-13 13:01:51 UTC (rev 3002)
+++ trunk/lima-swing/src/main/resources/i18n/lima-swing-en_GB.properties 2010-08-13 15:27:33 UTC (rev 3003)
@@ -46,11 +46,13 @@
lima.common.addSubLedger=
lima.common.cancel=
lima.common.close=
+lima.common.copy=
lima.common.fin=
lima.common.import=
lima.common.importexport=Import/Export
lima.common.next=
lima.common.ok=
+lima.common.paste=
lima.common.print=
lima.common.quit=
lima.common.remove=
Modified: trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties
===================================================================
--- trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties 2010-08-13 13:01:51 UTC (rev 3002)
+++ trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties 2010-08-13 15:27:33 UTC (rev 3003)
@@ -43,10 +43,12 @@
lima.common.addSubLedger=Ajouter Compte Tiers
lima.common.cancel=Annuler
lima.common.close=Fermer
+lima.common.copy=Copier
lima.common.fin=Termin\u00E9
lima.common.importexport=Importer/Exporter
lima.common.next=Suivant
lima.common.ok=OK
+lima.common.paste=Coller
lima.common.print=
lima.common.quit=Quitter
lima.common.remove=Supprimer
@@ -72,7 +74,7 @@
lima.entries=Traitement
lima.entries.addtransaction=Saisir des \u00E9critures
lima.entries.lettering=Ajouter une lettre
-lima.entries.searchunbalancedtransaction=Entr\u00E9es non \u00E9quilibr\u00E9es
+lima.entries.searchunbalancedtransaction=Entr\u00E9es incorrect
lima.entrybook=Journal
lima.entrybook.add=Ajouter un journal
lima.entrybook.code=
@@ -241,7 +243,7 @@
limahome.transaction.balanced=transactions, toutes sont \u00E9quilibr\u00E9es
limahome.transaction.create=Ajouter des \u00E9critures
limahome.transaction.modifiy.balanced=Modifier les \u00E9critures
-limahome.transaction.modifiy.unbalanced=Modifier les \u00E9critures non \u00E9quilibr\u00E9es
+limahome.transaction.modifiy.unbalanced=Modifier les \u00E9critures incorrect
limahome.transaction.nothing=Aucune \u00E9criture
limahome.transaction.unbalanced=\u00E9critures ne sont pas \u00E9quilibr\u00E9es \!
update=
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2010-08-13 13:01:51 UTC (rev 3002)
+++ trunk/pom.xml 2010-08-13 15:27:33 UTC (rev 3003)
@@ -275,9 +275,9 @@
<projectId>lima</projectId>
<!-- customized libs version -->
- <nuiton-utils.version>1.3.2-SNAPSHOT</nuiton-utils.version>
+ <nuiton-utils.version>1.4</nuiton-utils.version>
<eugene.version>2.1.1</eugene.version>
- <topia.version>2.4.1-SNAPSHOT</topia.version>
+ <topia.version>2.4.2</topia.version>
<jaxx.version>2.1</jaxx.version>
<i18n.version>1.2.2</i18n.version>
1
0
r3002 - trunk/lima-business/src/main/java/org/chorem/lima/business/ejb
by jpepin@users.chorem.org Aug. 13, 2010
by jpepin@users.chorem.org Aug. 13, 2010
Aug. 13, 2010
Author: jpepin
Date: 2010-08-13 15:01:51 +0200 (Fri, 13 Aug 2010)
New Revision: 3002
Url: http://chorem.org/repositories/revision/lima/3002
Log:
Mise ?\195?\160 jour algo de calcul du bilan / compte de r?\195?\169sultat : probl?\195?\168me si regroupement de compte inexistant r?\195?\169solu.
Modified:
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java 2010-08-13 10:43:53 UTC (rev 3001)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java 2010-08-13 13:01:51 UTC (rev 3002)
@@ -491,7 +491,34 @@
}
//add all accounts
for (String accountNumber : accountNumbers) {
+ Account account = null;
if (subAccountsMode){
+ account = accountDAO.findSubAccountByNumber(accountNumber);
+ }
+ else {
+ account = accountDAO.findByAccountNumber(accountNumber);
+
+ }
+ //add account if exist
+ if (account != null){
+ accounts.add(account);
+ }
+ //search all account start with accountnumber
+ else {
+ TopiaQuery query = accountDAO.createQuery();
+ String subAccountsProperty = TopiaQuery.getProperty(Account.SUB_ACCOUNTS);
+ String subLedgersProperty = TopiaQuery.getProperty(Account.SUB_LEDGERS);
+ query.addWhere("not exists elements ("+subAccountsProperty+")")
+ //.addWhere("not exists elements ("+subLedgersProperty+")")
+ .addWhere(Account.ACCOUNT_NUMBER, Op.LIKE, accountNumber+"%");
+ List<Account> accountsResult = accountDAO.findAllByQuery(query);
+ if (accountsResult != null){
+ accounts.addAll(accountsResult);
+ }
+ }
+ }
+ /*for (String accountNumber : accountNumbers) {
+ if (subAccountsMode){
Account account = accountDAO.findSubAccountByNumber(accountNumber);
if (account == null){
TopiaQuery query = accountDAO.createQuery();
@@ -517,7 +544,7 @@
}
}
- }
+ }*/
//remove all accounts
for (String accountNumber : accountNumbersToRemove) {
Account account = null;
1
0
Author: jpepin
Date: 2010-08-13 12:43:53 +0200 (Fri, 13 Aug 2010)
New Revision: 3001
Url: http://chorem.org/repositories/revision/lima/3001
Log:
Ajout import compte tiers depuis EBP.
Mise ?\195?\160 jour algo de calcul du bilan / compte de r?\195?\169sultat : probl?\195?\168me avec les comptes tiers.
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/ImportService.java
trunk/lima-callao/src/main/java/org/chorem/lima/entity/AccountDAOImpl.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountViewHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookTableModel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartViewHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTableModel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/AccountsPane.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/EntryBooksPane.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java 2010-08-12 13:51:19 UTC (rev 3000)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java 2010-08-13 10:43:53 UTC (rev 3001)
@@ -490,7 +490,6 @@
first=false;
}
//add all accounts
- log.debug("accountNumbers "+accountNumbers);
for (String accountNumber : accountNumbers) {
if (subAccountsMode){
Account account = accountDAO.findSubAccountByNumber(accountNumber);
@@ -499,7 +498,7 @@
String subAccountsProperty = TopiaQuery.getProperty(Account.SUB_ACCOUNTS);
String subLedgersProperty = TopiaQuery.getProperty(Account.SUB_LEDGERS);
query.addWhere("not exists elements ("+subAccountsProperty+")")
- .addWhere("not exists elements ("+subLedgersProperty+")")
+ //.addWhere("not exists elements ("+subLedgersProperty+")")
.addWhere(Account.ACCOUNT_NUMBER, Op.LIKE, accountNumber+"%");
List<Account> accountsResult = accountDAO.findAllByQuery(query);
if (accountsResult != null){
@@ -520,7 +519,6 @@
}
//remove all accounts
- log.debug("accountNumbersToRemove "+accountNumbersToRemove);
for (String accountNumber : accountNumbersToRemove) {
Account account = null;
if (subAccountsMode){
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-12 13:51:19 UTC (rev 3000)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ExportServiceImpl.java 2010-08-13 10:43:53 UTC (rev 3001)
@@ -21,7 +21,6 @@
import java.io.IOException;
import java.io.StringWriter;
-import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.List;
import javax.ejb.Stateless;
@@ -435,7 +434,7 @@
/**
* Local methode, export accounts from database
- * Structure : TYPE | AccountNumber | Label | ThirdParty | MasteAccount | GeneralLedger
+ * Structure : TYPE | AccountNumber | Label | ThirdParty | MasterAccount | GeneralLedger
*/
public void exportAccountsChartAsCSV(CSVWriter csvWriter, TopiaContext topiaContext) throws LimaException {
try {
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-12 13:51:19 UTC (rev 3000)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialStatementServiceImpl.java 2010-08-13 10:43:53 UTC (rev 3001)
@@ -304,7 +304,9 @@
return result;
}
-
+ /**
+ * Créé la liste de postes contenant les calculs de comptes
+ */
public FinancialStatementDatas financialStatementReport(FinancialStatement financialStatement, Date selectedBeginDate, Date selectedEndDate,FinancialStatementDatas result, TopiaContext topiaContext) throws LimaException{
List<FinancialStatement> financialStatements =
@@ -405,20 +407,67 @@
}
/**
- * Permet de calculer tous les comptes contenu dans un mouvement
+ * Permet de calculer le montant de tous les comptes contenu dans un mouvement
*/
public FinancialStatementAmounts financialStatementAmounts(FinancialStatement financialStatement, Date selectedBeginDate, Date selectedEndDate, TopiaContext topiaContext) throws LimaException{
FinancialStatementAmounts financialStatementAmounts =
new FinancialStatementAmountsImpl();
+
+ FinancialStatement masterFinancialStatement = financialStatement.getMasterFinancialStatement();
+ FinancialStatementWayEnum financialStatementWayEnum = FinancialStatementWayEnum.BOTH;
+ if (masterFinancialStatement != null){
+ financialStatementWayEnum = masterFinancialStatement.getWay();
+ }
+
+ // DEBIT & CREDIT ACCOUNTS LIST
+ String accountsString = financialStatement.getAccounts();
+ BigDecimal amount = accountsNumberListToAmount(accountsString,
+ financialStatementWayEnum, FinancialStatementWayEnum.BOTH,
+ selectedBeginDate,selectedEndDate, topiaContext);
+ // DEBIT ACCOUNTS LIST
+ String debitAccountsString = financialStatement.getDebitAccounts();
+ BigDecimal debitAmount = accountsNumberListToAmount(debitAccountsString,
+ financialStatementWayEnum, FinancialStatementWayEnum.DEBIT,
+ selectedBeginDate, selectedEndDate, topiaContext);
+ //CREDIT ACCOUNTS LIST
+ String creditAccountsString = financialStatement.getCreditAccounts();
+ BigDecimal creditAmount = accountsNumberListToAmount(creditAccountsString,
+ financialStatementWayEnum, FinancialStatementWayEnum.CREDIT,
+ selectedBeginDate, selectedEndDate, topiaContext);
+ // PROVISION & DEPRECATION
+ String provisionDeprecationAccountsString =
+ financialStatement.getProvisionDeprecationAccounts();
+ BigDecimal provisionDeprecationAmount = accountsNumberListToAmount(
+ provisionDeprecationAccountsString, financialStatementWayEnum,
+ FinancialStatementWayEnum.BOTH, selectedBeginDate,
+ selectedEndDate, topiaContext);
+
+ // set result
+ amount = amount.add(creditAmount);
+ amount = amount.add(debitAmount);
+ financialStatementAmounts.setGrossAmount(amount);
+ financialStatementAmounts.setLabel(financialStatement.getLabel());
+ financialStatementAmounts.setProvisionDeprecationAmount(
+ provisionDeprecationAmount);
+ financialStatementAmounts.setLevel(
+ financialStatement.getLevel());
+ return financialStatementAmounts;
+ }
+
+ /**
+ * Calulate the amount of string contains a list of account
+ * account number seperate by ',' use methode stringToList from account service
+ * the list support '-' minus operation
+ * @return
+ */
+ public BigDecimal accountsNumberListToAmount (String accountsNumberList, FinancialStatementWayEnum financialStatementWayEnum, FinancialStatementWayEnum debitCredit, Date selectedBeginDate, Date selectedEndDate, TopiaContext topiaContext) throws LimaException{
+ BigDecimal amount = new BigDecimal(0);
try {
- // DEBIT & CREDIT
- String accountsString = financialStatement.getAccounts();
- BigDecimal amount = new BigDecimal(0);
- if (accountsString != null){
+ if (accountsNumberList != null){
//Remove Spaces
- accountsString = StringUtils.deleteWhitespace(accountsString);
- StringTokenizer stQuote = new StringTokenizer(accountsString, "-");
+ accountsNumberList = StringUtils.deleteWhitespace(accountsNumberList);
+ StringTokenizer stQuote = new StringTokenizer(accountsNumberList, "-");
while (stQuote.hasMoreTokens()) {
String s = stQuote.nextToken();
List<Account> accountsList = accountServiceLocal.
@@ -426,102 +475,59 @@
BigDecimal resAmount = new BigDecimal(0);
for (Account account : accountsList) {
- log.debug(account.getAccountNumber());
ReportsDatas reportsDatas = reportServiceLocal.
generateAccountReportsWithTransaction(account,
selectedBeginDate, selectedEndDate, topiaContext);
+ BigDecimal tempAmount = new BigDecimal(0);
//check the way of financialstatement amount
- FinancialStatementWayEnum financialStatementWayEnum =
- financialStatement.getMasterFinancialStatement().getWay();
+ //exemple compte de résultat : charge -> débit, produit -> crédit
switch (financialStatementWayEnum) {
case BOTH:
- resAmount = resAmount.add(reportsDatas.getAmountSolde());
+ tempAmount = tempAmount.add(reportsDatas.getAmountSolde());
break;
case DEBIT:
- resAmount = resAmount.add(reportsDatas.getAmountDebit());
- resAmount = resAmount.subtract(reportsDatas.getAmountCredit());
+ tempAmount = tempAmount.add(reportsDatas.getAmountDebit());
+ tempAmount = tempAmount.subtract(reportsDatas.getAmountCredit());
break;
case CREDIT:
- resAmount = resAmount.add(reportsDatas.getAmountCredit());
- resAmount = resAmount.subtract(reportsDatas.getAmountDebit());
+ tempAmount = tempAmount.add(reportsDatas.getAmountCredit());
+ tempAmount = tempAmount.subtract(reportsDatas.getAmountDebit());
break;
}
+
+ //add the calcul in function of list type: allaccounts, debit or credit
+ switch (debitCredit) {
+ case BOTH:
+ resAmount = resAmount.add(tempAmount);
+ break;
+ case DEBIT:
+ if (reportsDatas.getSoldeDebit()){
+ resAmount = resAmount.add(tempAmount);
+ }
+ break;
+ case CREDIT:
+ if (!reportsDatas.getSoldeDebit()){
+ resAmount = resAmount.add(tempAmount);
+ }
+ break;
+ }
}
if (amount.doubleValue() == 0){
amount = resAmount;
}
+ //compte(s) précédé du signe -
else {
amount = amount.subtract(resAmount);
}
}
- }
-
- // CREDIT
- String creditAccountsString = financialStatement.getCreditAccounts();
- BigDecimal creditAmount = new BigDecimal(0);
- if (creditAccountsString != null){
- List<Account> creditAccountsList = accountServiceLocal.
- stringToListAccountsWithTransaction(creditAccountsString, false, topiaContext);
- for (Account account : creditAccountsList) {
- ReportsDatas reportsDatas = reportServiceLocal.
- generateAccountReportsWithTransaction(account,
- selectedBeginDate, selectedEndDate, topiaContext);
- creditAmount = creditAmount.add(reportsDatas.getAmountCredit());
- }
- }
-
-
- // DEBIT
- String debitAccountsString = financialStatement.getDebitAccounts();
- BigDecimal debitAmount = new BigDecimal(0);
- if (debitAccountsString != null){
- List<Account> debitAccountsList = accountServiceLocal.
- stringToListAccountsWithTransaction(debitAccountsString, false, topiaContext);
- for (Account account : debitAccountsList) {
- ReportsDatas reportsDatas = reportServiceLocal.
- generateAccountReportsWithTransaction(account,
- selectedBeginDate, selectedEndDate, topiaContext);
- debitAmount = debitAmount.add(reportsDatas.getAmountDebit());
- }
- }
-
-
- // PROVISION & DEPRECATION
- String provisionDeprecationAccountsString =
- financialStatement.getProvisionDeprecationAccounts();
- BigDecimal provisionDeprecationAmount = new BigDecimal(0);
- if (provisionDeprecationAccountsString != null){
- List<Account> provisionDeprecationAccountsList =
- accountServiceLocal.stringToListAccountsWithTransaction(
- provisionDeprecationAccountsString, false, topiaContext);
- for (Account account : provisionDeprecationAccountsList) {
- ReportsDatas reportsDatas = reportServiceLocal.
- generateAccountReportsWithTransaction(account,
- selectedBeginDate, selectedEndDate, topiaContext);
- provisionDeprecationAmount = provisionDeprecationAmount.add(reportsDatas.getAmountSolde());
- }
- }
-
- // set result
- amount = amount.add(creditAmount);
- amount = amount.add(debitAmount);
- financialStatementAmounts.setGrossAmount(amount);
- financialStatementAmounts.setLabel(financialStatement.getLabel());
- financialStatementAmounts.setProvisionDeprecationAmount(
- provisionDeprecationAmount);
- financialStatementAmounts.setLevel(
- financialStatement.getLevel());
-
- }
- catch (LimaException ex) {
- doCatch(topiaContext, ex, log);
- }
-
- return financialStatementAmounts;
+ }
+ }catch (LimaException ex) {
+ doCatch(topiaContext, ex, log);
+ }
+ return amount;
}
-
@Override
public String checkFinancialStatementChart() throws LimaException {
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-12 13:51:19 UTC (rev 3000)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java 2010-08-13 10:43:53 UTC (rev 3001)
@@ -26,7 +26,6 @@
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
-import java.util.Calendar;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
@@ -37,6 +36,8 @@
import java.util.TreeMap;
import javax.ejb.EJB;
import javax.ejb.Stateless;
+
+import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.FinancialStatementWayEnum;
@@ -192,6 +193,7 @@
CsvToBean<EntryEBPImpl> csv = new CsvToBean<EntryEBPImpl>();
List<EntryEBPImpl> list = csv.parse(strat, csvReader);
Collections.sort(list, new EntryEBPComparator());
+ log.debug(list.size()+" list /n"+list);
// DAOs
AccountDAO accountDAO = LimaCallaoDAOHelper
@@ -364,14 +366,8 @@
account.setAccountNumber(accountNumber);
account.setLabel(label);
- // if account is class account : 1, 2, 3, 4, 5, 6, 7,…
- int nbCharAccountNumber = accountNumber.length();
- if (nbCharAccountNumber == 1) {
- accountService.createAccountWithTransaction(null,
- account, topiaContext);
- result += "SUCCES : Account" + accountNumber + " "
- + label + " added\n";
- } else {
+ // if is thirdPart account
+ if (!StringUtils.isNumeric(accountNumber)){
Account masterAccount = null;
int i = 1;
while (masterAccount == null) {
@@ -381,11 +377,37 @@
.findByAccountNumber(masterAccountNumber);
i++;
}
- accountService.createAccountWithTransaction(
+ accountService.createSubLedgerWithTransaction(
masterAccount, account, topiaContext);
result += "SUCCES : Account" + accountNumber + " "
+ label + " added\n";
}
+ // else is account
+ else {
+ // if account is class account : 1, 2, 3, 4, 5, 6, 7,…
+ int nbCharAccountNumber = accountNumber.length();
+ if (nbCharAccountNumber == 1) {
+ accountService.createAccountWithTransaction(null,
+ account, topiaContext);
+ result += "SUCCES : Account" + accountNumber + " "
+ + label + " added\n";
+ }
+ else {
+ Account masterAccount = null;
+ int i = 1;
+ while (masterAccount == null) {
+ String masterAccountNumber = accountNumber
+ .substring(0, accountNumber.length() - i);
+ masterAccount = accountDAO
+ .findByAccountNumber(masterAccountNumber);
+ i++;
+ }
+ accountService.createAccountWithTransaction(
+ masterAccount, account, topiaContext);
+ result += "SUCCES : Account" + accountNumber + " "
+ + label + " added\n";
+ }
+ }
}
}
} catch (TopiaException eeeTE) {
@@ -512,46 +534,27 @@
}
/**
- * Remote methode to call entrybooks import from UI
+ * Remote methode to call entity import from UI
+ * This methode let import just on type of entity
*/
@Override
- public String importEntryBooksChartAsCSV(String datas) throws LimaException {
+ public String importAsCSV(String datas, ImportExportEntityEnum importExportEntityEnum) throws LimaException {
String result = "";
- TopiaContext topiaContext = null;
- try {
- topiaContext = beginTransaction();
-
- String[] nextLine = new String[1];
- CSVReader csvReader = new CSVReader(new StringReader(datas), ';');
-
- while ((nextLine = csvReader.readNext()) != null) {
- if (ImportExportEntityEnum.valueOfLabel(nextLine[0]) == ImportExportEntityEnum.ENTRYBOOK) {
- result += importEntryBooksChartCSV(nextLine, topiaContext);
- }
- }
- } catch (TopiaException eeeTE) {
- doCatch(topiaContext, eeeTE, log);
- } catch (IOException eeeIO) {
- log.debug("Can't create new CSV Reader", eeeIO);
- } finally {
- doFinally(topiaContext, log);
- }
- return result;
- }
-
- /**
- * Remote methode to call financialStatements import from UI
- */
- @Override
- public String importFinancialStatementsChartAsCSV(String datas)
- throws LimaException {
- String result = "";
-
// FinancialStatements
- LinkedHashMap<String, ArrayList<FinancialStatementImport>> financialStatements =
- new LinkedHashMap<String, ArrayList<FinancialStatementImport>>();
-
+ LinkedHashMap<String, ArrayList<FinancialStatementImport>> financialStatements = null;
+ // Accounts
+ Map<String, AccountImport> accounts = null;
+
+ switch (importExportEntityEnum) {
+ case ACCOUNT:
+ accounts = new TreeMap<String, AccountImport>();
+ break;
+ case FINANCIALSTATEMENT:
+ financialStatements = new LinkedHashMap<String, ArrayList<FinancialStatementImport>>();
+ break;
+ }
+
TopiaContext topiaContext = null;
try {
topiaContext = beginTransaction();
@@ -560,51 +563,36 @@
CSVReader csvReader = new CSVReader(new StringReader(datas), ';');
while ((nextLine = csvReader.readNext()) != null) {
- if (ImportExportEntityEnum.valueOfLabel(nextLine[0]) == ImportExportEntityEnum.FINANCIALSTATEMENT) {
- result += importFinancialsStatementChartCSV(nextLine,
- financialStatements, topiaContext);
- }
- }
+ if (ImportExportEntityEnum.valueOfLabel(nextLine[0]) == importExportEntityEnum) {
+ switch (importExportEntityEnum) {
+ case ENTRYBOOK:
+ result += importEntryBooksChartCSV(nextLine, topiaContext);
+ break;
- // create financialStatements
- result += createFinancialStatements(financialStatements,
- topiaContext);
- } catch (TopiaException eeeTE) {
- doCatch(topiaContext, eeeTE, log);
- } catch (IOException eeeIO) {
- log.debug("Can't create new CSV Reader", eeeIO);
- } finally {
- doFinally(topiaContext, log);
- }
- return result;
- }
+ case ACCOUNT:
+ result += importAccountsChartsCSV(nextLine, accounts,
+ topiaContext);
+ break;
+ case FINANCIALSTATEMENT:
- /**
- * Remote methode to call accounts import from UI
- */
- @Override
- public String importAccountsChartAsCSV(String datas) throws LimaException {
- String result = "";
-
- // Accounts
- Map<String, AccountImport> accounts = new TreeMap<String, AccountImport>();
-
- TopiaContext topiaContext = null;
- try {
- topiaContext = beginTransaction();
-
- String[] nextLine = new String[1];
- CSVReader csvReader = new CSVReader(new StringReader(datas), ';');
-
- while ((nextLine = csvReader.readNext()) != null) {
- if (ImportExportEntityEnum.valueOfLabel(nextLine[0]) == ImportExportEntityEnum.ACCOUNT) {
- result += importAccountsChartsCSV(nextLine, accounts,
- topiaContext);
+ result += importFinancialsStatementChartCSV(nextLine,
+ financialStatements, topiaContext);
+ break;
+ }
}
}
- // create accounts
- result += createAccounts(accounts, topiaContext);
+ //create entity
+ switch (importExportEntityEnum) {
+ case ACCOUNT:
+ result += createAccounts(accounts, topiaContext);
+ break;
+ case FINANCIALSTATEMENT:
+ result += createFinancialStatements(financialStatements,
+ topiaContext);
+ break;
+ }
+
} catch (TopiaException eeeTE) {
doCatch(topiaContext, eeeTE, log);
} catch (IOException eeeIO) {
@@ -614,6 +602,7 @@
}
return result;
}
+
// ################ Import entities an put to lists ################
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-12 13:51:19 UTC (rev 3000)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java 2010-08-13 10:43:53 UTC (rev 3001)
@@ -97,9 +97,10 @@
* Recursiv
* List entries for a period and an account
* Calculate the amounts
- * Two case:
+ * 3 cases:
* - for subaccount
* - for a foldaccounts, contains many accounts
+ * - for a foldthirdparts accounts
*/
@Override
public ReportsDatas generateAccountReportsWithTransaction (Account account, Date beginDate, Date endDate, TopiaContext topiaContext) throws LimaException{
@@ -107,18 +108,28 @@
BigDecimal credit = new BigDecimal(0);
BigDecimal debit = new BigDecimal(0);
BigDecimal solde = new BigDecimal(0);
+ List<Entry> entries = new ArrayList<Entry>();
if (account != null){
- // First subaccount
+
+ //Get allsubaccounts and thirdParts accounts
List<Account> accounts = (List<Account>) account.getSubAccounts();
- accounts.addAll(account.getSubLedgers());
+ List<Account> thirdPartAccount = (List<Account>) account.getSubLedgers();
+ if (thirdPartAccount != null){
+ ReportsDatas subReportsDatas = generateSubAccountReportsWithTransaction(account,
+ beginDate, endDate, topiaContext);
+ entries.addAll(subReportsDatas.getListEntry());
+ debit = debit.add(subReportsDatas.getAmountDebit());
+ credit = credit.add(subReportsDatas.getAmountCredit());
+ accounts.addAll(thirdPartAccount);
+ }
+ // is already subaccount
if (accounts.size() == 0){
reportsDatas = generateSubAccountReportsWithTransaction(account,
beginDate, endDate, topiaContext);
}
- //Second many account
+ // else is folder accounts contains many subs and thirds accoutns
else {
- List<Entry> entries = new ArrayList<Entry>();
- for (Account subAccount : accounts) {
+ for (Account subAccount : accounts) {
ReportsDatas subReportsDatas =
generateAccountReportsWithTransaction(subAccount,
beginDate,endDate, topiaContext);
@@ -462,7 +473,7 @@
selectedAccounts = StringUtils.deleteWhitespace(selectedAccounts);
//if no filter account
if (selectedAccounts == null || selectedAccounts.equals("")){
- accounts = accountDAO.findAllSubAccounts();
+ accounts = accountDAO.findAll();
}
//build list account from selectedAccounts
else{
@@ -479,7 +490,7 @@
amount = new BigDecimal(0);
}
if (movementedFilter){
- if (amount.doubleValue() != 0){
+ if (reportsDatas.getAmountCredit().doubleValue() != 0 || reportsDatas.getAmountDebit().doubleValue() != 0){
// add balance sheet to balance trial
balanceTrial.addReportsDatas(reportsDatas);
}
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ImportService.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ImportService.java 2010-08-12 13:51:19 UTC (rev 3000)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ImportService.java 2010-08-13 10:43:53 UTC (rev 3001)
@@ -21,6 +21,7 @@
import javax.ejb.Remote;
import org.chorem.lima.business.LimaException;
+import org.chorem.lima.business.utils.ImportExportEntityEnum;
/**
* Import export service.
@@ -68,9 +69,5 @@
*/
public String importAllAsCSV(String path) throws LimaException;
- public String importAccountsChartAsCSV(String path) throws LimaException;
-
- public String importFinancialStatementsChartAsCSV(String path) throws LimaException;
-
- public String importEntryBooksChartAsCSV(String path) throws LimaException;
+ public String importAsCSV(String path, ImportExportEntityEnum importExportEntityEnum) throws LimaException;
}
Modified: trunk/lima-callao/src/main/java/org/chorem/lima/entity/AccountDAOImpl.java
===================================================================
--- trunk/lima-callao/src/main/java/org/chorem/lima/entity/AccountDAOImpl.java 2010-08-12 13:51:19 UTC (rev 3000)
+++ trunk/lima-callao/src/main/java/org/chorem/lima/entity/AccountDAOImpl.java 2010-08-13 10:43:53 UTC (rev 3001)
@@ -1,4 +1,4 @@
-/* *##% Lima Swing
+/* *##% Lima Callao
* Copyright (C) 2008 - 2010 CodeLutin
*
* This program is free software; you can redistribute it and/or
@@ -25,25 +25,16 @@
public class AccountDAOImpl <E extends Account> extends AccountDAOAbstract<E> {
/**
- * List all subaccounts (no folderaccounts)
+ * List all subaccounts (no folderaccounts, exclude accounts contains thirdpart accounts)
* Sort by accout number in lexicographical order
*/
@Override
public List<Account> findAllSubAccounts() throws TopiaException {
TopiaQuery query = createQuery();
String subAccountsProperty = TopiaQuery.getProperty(Account.SUB_ACCOUNTS);
- String subLedgersProperty = TopiaQuery.getProperty(Account.SUB_LEDGERS);
query.addWhere("not exists elements ("+subAccountsProperty+")")
- .addWhere("not exists elements ("+subLedgersProperty+")")
.addOrder(Account.ACCOUNT_NUMBER);
- /* alternative query
- * wich are the best ? exist or count ?
- *
- * query.addWhere("size ("+subAccountsProperty+") = 0")
- * .addWhere("size ("+subLedgersProperty+") = 0");
- *
- */
return (List<Account>) findAllByQuery(query);
}
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-08-12 13:51:19 UTC (rev 3000)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountViewHandler.java 2010-08-13 10:43:53 UTC (rev 3001)
@@ -269,23 +269,33 @@
//
form.setLocationRelativeTo(view);
form.setVisible(true);
+
+ ImportExport importExport = ImportExport.getInstance(view);
Object value = form.getRadioButtons().getSelectedValue();
// if action confirmed
if (value != null){
-
AccountsChartEnum defaultAccountsChartEnum =
(AccountsChartEnum) value;
- ImportExport importExport = ImportExport.getInstance(view);
- importExport.importExport(ImportExportEnum.CSV_ACCOUNTCHARTS_IMPORT,
- defaultAccountsChartEnum.getFilePath(), true);
+ //Import accounts chart
+ switch (defaultAccountsChartEnum) {
+ case IMPORTEBP:
+ importExport.importExport(ImportExportEnum.EBP_ACCOUNTCHARTS_IMPORT,
+ defaultAccountsChartEnum.getFilePath(), false);
+ break;
+
+ default:
+ importExport.importExport(ImportExportEnum.CSV_ACCOUNTCHARTS_IMPORT,
+ defaultAccountsChartEnum.getFilePath(), false);
+ break;
+ }
}
}
@Override
- public void notifyMethod(String serviceName, String methodName) {
+ public void notifyMethod(String serviceName, String methodeName) {
- if (methodName.contains("importAccounts") || methodName.contains("importAll")){
+ if (methodeName.contains("importAccounts") || methodeName.contains("importAll") || methodeName.contains("importAsCSV")){
refresh();
}
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookTableModel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookTableModel.java 2010-08-12 13:51:19 UTC (rev 3000)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookTableModel.java 2010-08-13 10:43:53 UTC (rev 3001)
@@ -173,10 +173,10 @@
}
@Override
- public void notifyMethod(String serviceName, String methodName) {
+ public void notifyMethod(String serviceName, String methodeName) {
//refresh on import datas
- if (methodName.contains("importEntryBooks") || methodName.contains("importAll")){
+ if (methodeName.contains("importEntryBooks") || methodeName.contains("importAll") || methodeName.contains("importAs")){
fireTableDataChanged();
}
}
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-12 13:51:19 UTC (rev 3000)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartViewHandler.java 2010-08-13 10:43:53 UTC (rev 3001)
@@ -317,7 +317,7 @@
@Override
public void notifyMethod(String serviceName, String methodName) {
- if (methodName.contains("importFinancialStatements") || methodName.contains("importAll")){
+ if (methodName.contains("importFinancialStatements") || methodName.contains("importAll") || methodName.contains("importAs")){
refresh();
}
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTableModel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTableModel.java 2010-08-12 13:51:19 UTC (rev 3000)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTableModel.java 2010-08-13 10:43:53 UTC (rev 3001)
@@ -343,6 +343,8 @@
public void addFinancialTransaction() throws LimaException{
/* Calling transaction service */
FinancialTransaction financialTransaction = new FinancialTransactionImpl();
+ financialTransaction.setAmountDebit(new BigDecimal(0));
+ financialTransaction.setAmountCredit(new BigDecimal(0));
//if a period is selected
if (selectedFinancialPeriod != null){
financialTransaction.setFinancialPeriod(selectedFinancialPeriod);
@@ -392,6 +394,7 @@
FinancialTransaction currentTransaction = null;
Object currentRow = cacheDataList.get(row);
Entry entry = new EntryImpl();
+ entry.setAmount(new BigDecimal(0));
//check if current row is a transaction or an entry
if (currentRow instanceof FinancialTransaction) {
currentTransaction = (FinancialTransaction)currentRow;
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/AccountsPane.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/AccountsPane.java 2010-08-12 13:51:19 UTC (rev 3000)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/AccountsPane.java 2010-08-13 10:43:53 UTC (rev 3001)
@@ -114,7 +114,7 @@
@Override
public void notifyMethod(String serviceName, String methodeName) {
- if (methodeName.contains("Account") || methodeName.contains("importAll")){
+ if (methodeName.contains("Account") || methodeName.contains("importAll") || methodeName.contains("importAsCSV")){
refresh();
}
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/EntryBooksPane.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/EntryBooksPane.java 2010-08-12 13:51:19 UTC (rev 3000)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/EntryBooksPane.java 2010-08-13 10:43:53 UTC (rev 3001)
@@ -131,7 +131,7 @@
@Override
public void notifyMethod(String serviceName, String methodeName) {
- if (methodeName.contains("EntryBook") || methodeName.contains("importAll")){
+ if (methodeName.contains("EntryBook") || methodeName.contains("importAll") || methodeName.contains("importAs")){
refresh();
}
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java 2010-08-12 13:51:19 UTC (rev 3000)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java 2010-08-13 10:43:53 UTC (rev 3001)
@@ -43,6 +43,7 @@
import org.chorem.lima.business.ExportServiceMonitorable;
import org.chorem.lima.business.ImportServiceMonitorable;
import org.chorem.lima.business.LimaException;
+import org.chorem.lima.business.utils.ImportExportEntityEnum;
import org.chorem.lima.enums.EncodingEnum;
import org.chorem.lima.enums.ImportExportEnum;
import org.chorem.lima.service.LimaServiceFactory;
@@ -138,15 +139,15 @@
break;
case CSV_ACCOUNTCHARTS_IMPORT:
datas = extractFile(filePath, charset.getEncoding());
- result = importService.importAccountsChartAsCSV(datas);
+ result = importService.importAsCSV(datas, ImportExportEntityEnum.ACCOUNT);
break;
case CSV_ENTRYBOOKS_IMPORT:
datas = extractFile(filePath, charset.getEncoding());
- result = importService.importEntryBooksChartAsCSV(datas);
+ result = importService.importAsCSV(datas, ImportExportEntityEnum.ENTRYBOOK);
break;
case CSV_FINANCIALSTATEMENTS_IMPORT:
datas = extractFile(filePath, charset.getEncoding());
- result = importService.importFinancialStatementsChartAsCSV(datas);
+ result = importService.importAsCSV(datas, ImportExportEntityEnum.FINANCIALSTATEMENT);
break;
case EBP_ACCOUNTCHARTS_IMPORT:
//For windows ebp
1
0
Author: jpepin
Date: 2010-08-12 15:51:19 +0200 (Thu, 12 Aug 2010)
New Revision: 3000
Url: http://chorem.org/repositories/revision/lima/3000
Log:
Ajout d'une fonction pour v?\195?\169rifier la concordance entre le plan BCR et le plan des comptes.
Refactor du type Double vers BigDecimal.
Added:
trunk/lima-business/src/main/java/org/chorem/lima/business/utils/EntryEBPComparator.java
Modified:
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/DocumentServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ExportServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialStatementServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/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/AccountServiceLocal.java
trunk/lima-callao/src/main/java/org/chorem/lima/entity/AccountDAOImpl.java
trunk/lima-callao/src/main/java/org/chorem/lima/entity/FinancialTransactionImpl.java
trunk/lima-callao/src/main/xmi/accounting.zargo
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/BalanceViewHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsTableModel.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/financialtransaction/FinancialTransactionTableModel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedTableModel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerTableModel.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/AccountServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java 2010-08-11 14:50:40 UTC (rev 2999)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java 2010-08-12 13:51:19 UTC (rev 3000)
@@ -38,7 +38,6 @@
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;
@@ -440,9 +439,10 @@
/**
* Convert string of extends number to list of accounts
* Example '22, 45..48, 67' -> [22, 45, 46, 47, 48, 67]
+ * SubAccountsMode return list of existing subaccounts ex 6 return : 61, 62, .., 69, 610, .., 619 etc
*/
@Override
- public List<Account> stringToListAccountsWithTransaction(String selectedAccounts, TopiaContext topiaContext) throws LimaException{
+ public List<Account> stringToListAccountsWithTransaction(String selectedAccounts, Boolean subAccountsMode, TopiaContext topiaContext) throws LimaException{
List<Account> accounts = new ArrayList<Account>();
if (selectedAccounts != null){
try {
@@ -452,45 +452,96 @@
selectedAccounts = StringUtils.deleteWhitespace(selectedAccounts);
//use hashset for delete duplicate numbers
HashSet<String> accountNumbers = new HashSet<String>();
- //Split comma
- StringTokenizer stComma = new StringTokenizer(selectedAccounts, ",");
- while (stComma.hasMoreTokens()) {
- String s = stComma.nextToken();
- if (s.contains("..")){
- //Split ..
- String stringDoubleDot[] = s.split("\\.\\.");
- int lowAccount=Integer.parseInt(stringDoubleDot[0]);
- int highAccount=Integer.parseInt(stringDoubleDot[1]);
- for (int i=lowAccount; i <= highAccount; i++) {
- accountNumbers.add(String.valueOf(i));
- }
- }
- else{
- accountNumbers.add(s);
- }
- }
-
+ HashSet<String> accountNumbersToRemove = new HashSet<String>();
+ Boolean first = true;
+ StringTokenizer stStar = new StringTokenizer(selectedAccounts, "-");
+ while (stStar.hasMoreTokens()) {
+ String subString = stStar.nextToken();
+
+ //Split comma
+ StringTokenizer stComma = new StringTokenizer(subString, ",");
+ while (stComma.hasMoreTokens()) {
+ String s = stComma.nextToken();
+ if (s.contains("..")){
+ //Split ..
+ String stringDoubleDot[] = s.split("\\.\\.");
+ int lowAccount=Integer.parseInt(stringDoubleDot[0]);
+ int highAccount=Integer.parseInt(stringDoubleDot[1]);
+ for (int i=lowAccount; i <= highAccount; i++) {
+ //if first add accounts, else remove
+ if (first){
+ accountNumbers.add(String.valueOf(i));
+ }
+ else {
+ accountNumbersToRemove.add(String.valueOf(i));
+ }
+ }
+ }
+ else{
+ //if first
+ if (first){
+ accountNumbers.add(s);
+ }
+ else {
+ accountNumbersToRemove.add(s);
+ }
+ }
+ }
+ first=false;
+ }
+ //add all accounts
+ log.debug("accountNumbers "+accountNumbers);
for (String accountNumber : accountNumbers) {
- 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);
+ if (subAccountsMode){
+ Account account = accountDAO.findSubAccountByNumber(accountNumber);
+ if (account == null){
+ TopiaQuery query = accountDAO.createQuery();
+ String subAccountsProperty = TopiaQuery.getProperty(Account.SUB_ACCOUNTS);
+ String subLedgersProperty = TopiaQuery.getProperty(Account.SUB_LEDGERS);
+ query.addWhere("not exists elements ("+subAccountsProperty+")")
+ .addWhere("not exists elements ("+subLedgersProperty+")")
+ .addWhere(Account.ACCOUNT_NUMBER, Op.LIKE, accountNumber+"%");
+ List<Account> accountsResult = accountDAO.findAllByQuery(query);
+ if (accountsResult != null){
+ accounts.addAll(accountsResult);
+ }
}
+ //add account if exist
+ else {
+ accounts.add(account);
+ }
}
- //add account if exist
else {
- accounts.add(account);
+ Account account = accountDAO.findByAccountNumber(accountNumber);
+ if (account != null){
+ accounts.add(account);
+ }
}
+
}
+ //remove all accounts
+ log.debug("accountNumbersToRemove "+accountNumbersToRemove);
+ for (String accountNumber : accountNumbersToRemove) {
+ Account account = null;
+ if (subAccountsMode){
+ account = accountDAO.findSubAccountByNumber(accountNumber);
+ }
+ else {
+ account = accountDAO.findByAccountNumber(accountNumber);
+ }
+ if (account != null) {
+ accounts.remove(account);
+ }
+ }
}
catch (TopiaException ex) {
doCatch(topiaContext, ex, log);
}
}
-
+ for (Account account : accounts) {
+ log.debug("accounts " + account.getAccountNumber());
+ }
+
return accounts;
}
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/DocumentServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/DocumentServiceImpl.java 2010-08-11 14:50:40 UTC (rev 2999)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/DocumentServiceImpl.java 2010-08-12 13:51:19 UTC (rev 3000)
@@ -24,6 +24,7 @@
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
+import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collections;
@@ -377,10 +378,16 @@
String label = financialStatementAmount.getLabel();
int level = financialStatementAmount.getLevel();
- Double grossAmount =
+ BigDecimal grossAmount =
financialStatementAmount.getGrossAmount();
- Double provisionDeprecationAmount =
+ if (grossAmount == null){
+ grossAmount = new BigDecimal(0);
+ }
+ BigDecimal provisionDeprecationAmount =
financialStatementAmount.getProvisionDeprecationAmount();
+ if (provisionDeprecationAmount == null){
+ provisionDeprecationAmount = new BigDecimal(0);
+ }
if (financialStatementAmount.getSubAmount() && level==1){
cell.setGrayFill(0.88f);
@@ -414,7 +421,7 @@
c.setHorizontalAlignment(Element.ALIGN_LEFT);
t.addCell(c);
//cell2
- if (grossAmount != 0.0){
+ if (grossAmount.doubleValue() != 0){
phrase = new Phrase(String.valueOf(
grossAmount), normalFont);
}
@@ -423,7 +430,7 @@
}
t.addCell(phrase);
//cell 3
- if (provisionDeprecationAmount != 0.0){
+ if (provisionDeprecationAmount.doubleValue() != 0){
phrase = new Phrase(String.valueOf(
provisionDeprecationAmount), normalFont);
}
@@ -432,9 +439,10 @@
}
t.addCell(phrase);
//cell 4
- if (grossAmount-provisionDeprecationAmount != 0.0){
- phrase = new Phrase(String.valueOf(
- grossAmount-provisionDeprecationAmount), normalFont);
+ BigDecimal solde = grossAmount;
+ solde = solde.subtract(provisionDeprecationAmount);
+ if (solde.doubleValue() != 0){
+ phrase = new Phrase(solde.toString(), normalFont);
}
else {
phrase = new Phrase("");
@@ -476,8 +484,8 @@
String dateS = dateFormat.format(newDate);
String hourS = hourFormat.format(newDate);
- Double currentAmountDebit = 0.0;
- Double currentAmountCredit = 0.0;
+ BigDecimal currentAmountDebit = new BigDecimal(0);
+ BigDecimal currentAmountCredit = new BigDecimal(0);
String accountcarry ="";
String filePath = path+File.separator+DocumentsEnum.LEDGER.getFileName();
@@ -537,8 +545,12 @@
for (Object object : subList) {
if (object instanceof Entry){
Entry entry = (Entry) object;
- currentAmountDebit += entry.getDebit() ? entry.getAmount() : 0;
- currentAmountCredit += entry.getDebit() ? 0 : entry.getAmount();
+ if (entry.getDebit()){
+ currentAmountDebit = currentAmountDebit.add(entry.getAmount());
+ }
+ else {
+ currentAmountCredit = currentAmountCredit.add(entry.getAmount());
+ }
}
else {
ReportsDatas reportsDatas = (ReportsDatas) object;
@@ -636,8 +648,8 @@
if (account != null){
accountS = account.getAccountNumber()+"\t"+account.getLabel();
}
- Double amountCredit = reportsDatas.getAmountCredit();
- Double amountDebit = reportsDatas.getAmountDebit();
+ BigDecimal amountCredit = reportsDatas.getAmountCredit();
+ BigDecimal amountDebit = reportsDatas.getAmountDebit();
Cell c = new Cell(new Phrase(accountS, boldFont));
c.setColspan(4);
@@ -645,7 +657,9 @@
t.addCell(c);
t.addCell(new Phrase(String.valueOf(amountDebit), boldFont));
t.addCell(new Phrase(String.valueOf(amountCredit), boldFont));
- t.addCell(new Phrase(String.valueOf(amountDebit-amountCredit), boldFont));
+ BigDecimal solde = amountDebit;
+ solde = solde.subtract(amountCredit);
+ t.addCell(new Phrase(String.valueOf(solde), boldFont));
}
else {
Entry entry = (Entry) object;
@@ -655,21 +669,27 @@
if (entryBook != null){
entryBookCode = entryBook.getCode();
}
+ BigDecimal amountDebit = new BigDecimal(0),
+ amountCredit = new BigDecimal(0);
+ if (entry.getDebit()){
+ amountDebit = entry.getAmount();
+ }
+ else {
+ amountCredit = entry.getAmount();
+ }
- 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(entryBookCode, normalFont));
t.addCell(new Phrase(entry.getVoucher(), normalFont));
t.addCell(new Phrase(entry.getDescription(), normalFont));
- t.addCell(new Phrase(String.valueOf(amountDebit),
+ t.addCell(new Phrase(amountDebit.toString(),
normalFont));
- t.addCell(new Phrase(String.valueOf(amountCredit),
+ t.addCell(new Phrase(amountCredit.toString(),
normalFont));
- t.addCell(new Phrase(String.valueOf(amountDebit-amountCredit),
+ BigDecimal solde = amountDebit.subtract(amountCredit);
+ t.addCell(new Phrase(solde.toString(),
normalFont));
}
@@ -681,7 +701,7 @@
return t;
}
- public Table createLedgerAmountTable(String account, String title, Double credit, Double debit){
+ public Table createLedgerAmountTable(String account, String title, BigDecimal debit, BigDecimal credit){
Table t = null;
try {
t = new Table(5,1);
@@ -695,7 +715,6 @@
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);
@@ -703,7 +722,7 @@
t.addCell(new Phrase(title, boldFont));
t.addCell(new Phrase(debit.toString(), boldFont));
t.addCell(new Phrase(credit.toString(), boldFont));
- Double solde = debit-credit;
+ BigDecimal solde = debit.subtract(credit);
t.addCell(new Phrase(solde.toString(), boldFont));
} catch (BadElementException eeBEE) {
log.error("Can't create table", eeBEE);
@@ -765,22 +784,22 @@
List<Entry> entries = entryDAO.findAllByQuery(query);
List<Object[]> results = new ArrayList<Object[]>();
- Double debit = 0.0;
- Double credit = 0.0;
+ BigDecimal debit = new BigDecimal(0);
+ BigDecimal credit = new BigDecimal(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];
+ debit = (BigDecimal)results.get(0)[1];
+ credit = (BigDecimal)results.get(1)[1];
}
if (nbAmount==1){
if ((Boolean)results.get(0)[0]){
- debit = (Double)results.get(0)[1];
+ debit = (BigDecimal)results.get(0)[1];
}
else {
- credit = (Double)results.get(0)[1];
+ credit = (BigDecimal)results.get(0)[1];
}
}
@@ -913,7 +932,7 @@
return t;
}
- public Table createEntryBooksAmountTable(String title, Double credit, Double debit){
+ public Table createEntryBooksAmountTable(String title, BigDecimal credit, BigDecimal debit){
Table t = null;
try {
t = new Table(3,1);
@@ -954,10 +973,10 @@
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;
+ BigDecimal currentAmountDebit = new BigDecimal(0);
+ BigDecimal currentAmountCredit = new BigDecimal(0);
+ BigDecimal currentSoldeDebit = new BigDecimal(0);
+ BigDecimal currentSoldeCredit = new BigDecimal(0);
String filePath = path+File.separator+DocumentsEnum.BALANCE.getFileName();
FileOutputStream fileOut = new FileOutputStream(filePath+format.getExtension());
@@ -1014,12 +1033,14 @@
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();
+ currentAmountDebit = currentAmountDebit.add(reportsDatas.getAmountDebit());
+ currentAmountCredit = currentAmountCredit.add(reportsDatas.getAmountCredit());
+ if (reportsDatas.getSoldeDebit()){
+ currentSoldeDebit = currentSoldeDebit.add(reportsDatas.getAmountSolde());
+ }
+ else {
+ currentSoldeCredit = currentSoldeCredit.add(reportsDatas.getAmountSolde());
+ }
}
//forward amounts
if (n > max && i <= n-max){
@@ -1118,7 +1139,7 @@
return t;
}
- public Table createBalanceAmountTable(String title, Double amountDebit, Double amountCredit, Double soldeDebit, Double soldeCredit ){
+ public Table createBalanceAmountTable(String title, BigDecimal amountDebit, BigDecimal amountCredit, BigDecimal soldeDebit, BigDecimal soldeCredit){
Table t = null;
try {
t = new Table(5,1);
@@ -1191,21 +1212,21 @@
financialPeriodDAO.findAllByQuery(financialPeriodsQuery);
List<GeneralEntryBooksDatas> list = new ArrayList<GeneralEntryBooksDatas>();
- Double amountDebit = 0.0;
- Double amountCredit = 0.0;
+ BigDecimal amountDebit = new BigDecimal(0);
+ BigDecimal amountCredit = new BigDecimal(0);
for (FinancialPeriod financialPeriod : financialPeriods) {
List<ClosedPeriodicEntryBook> closedPeriodicEntryBookList =
closedPeriodicEntryBookDAO.findAllByDates(
financialPeriod.getBeginDate(), financialPeriod.getEndDate());
- Double subAmountDebit = 0.0;
- Double subAmountCredit = 0.0;
+ BigDecimal subAmountDebit = new BigDecimal(0);
+ BigDecimal subAmountCredit = new BigDecimal(0);
for (ClosedPeriodicEntryBook closedPeriodicEntryBook : closedPeriodicEntryBookList) {
List<Object[]> results = new ArrayList<Object[]>();
TopiaQuery query = entryDAO.createQuery();
- Double debit = 0.0;
- Double credit = 0.0;
+ BigDecimal debit = new BigDecimal(0);
+ BigDecimal credit = new BigDecimal(0);
String financialPeriodProperty = TopiaQuery.getProperty(
Entry.FINANCIAL_TRANSACTION,
@@ -1223,15 +1244,15 @@
int nbAmount = results.size();
if(nbAmount == 2){
- debit = (Double)results.get(0)[1];
- credit = (Double)results.get(1)[1];
+ debit = (BigDecimal)results.get(0)[1];
+ credit = (BigDecimal)results.get(1)[1];
}
if (nbAmount == 1){
if ((Boolean)results.get(0)[0]){
- debit = (Double)results.get(0)[1];
+ debit = (BigDecimal)results.get(0)[1];
}
else {
- credit = (Double)results.get(0)[1];
+ credit = (BigDecimal)results.get(0)[1];
}
}
GeneralEntryBooksDatas generalEntryBooksDatas =
@@ -1245,8 +1266,8 @@
generalEntryBooksDatas.setCredit(credit);
generalEntryBooksDatas.setDebit(debit);
list.add(generalEntryBooksDatas);
- subAmountCredit += credit;
- subAmountDebit += debit;
+ subAmountCredit = subAmountCredit.add(credit);
+ subAmountDebit = subAmountDebit.add(debit);
}
GeneralEntryBooksDatas generalEntryBooksDatas =
new GeneralEntryBooksDatasImpl();
@@ -1256,8 +1277,8 @@
generalEntryBooksDatas.setPeriod(
monthYearFormat.format(financialPeriod.getBeginDate()));
list.add(generalEntryBooksDatas);
- amountCredit += subAmountCredit;
- amountDebit += subAmountDebit;
+ amountCredit = amountCredit.add(subAmountCredit);
+ amountDebit = amountDebit.add(subAmountDebit);
}
GeneralEntryBooksDatas generalEntryBooksDatas =
new GeneralEntryBooksDatasImpl();
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-11 14:50:40 UTC (rev 2999)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ExportServiceImpl.java 2010-08-12 13:51:19 UTC (rev 3000)
@@ -21,6 +21,7 @@
import java.io.IOException;
import java.io.StringWriter;
+import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.List;
import javax.ejb.Stateless;
@@ -140,7 +141,7 @@
nextLine[3] = accountNumber;
nextLine[5] = '"'+entry.getDescription()+'"';
nextLine[6] = '"'+entry.getVoucher()+'"';
- nextLine[7] = new Double(entry.getAmount()).toString();
+ nextLine[7] = entry.getAmount().toString();
nextLine[8] = debitcredit;
// Ajoute la ligne au fichier
@@ -492,10 +493,8 @@
nextLine[1] = String.valueOf(numTransaction);
nextLine[2] =
SDateFormat.format(financialTransaction.getTransactionDate());
- nextLine[3] = new Double(
- financialTransaction.getAmountDebit()).toString();
- nextLine[4] = new Double(
- financialTransaction.getAmountCredit()).toString();
+ nextLine[3] = financialTransaction.getAmountDebit().toString();
+ nextLine[4] = financialTransaction.getAmountCredit().toString();
nextLine[5] =
SDateFormat.format(financialTransaction.getFinancialPeriod().
getBeginDate());
@@ -514,7 +513,7 @@
nextLine[0] = ImportExportEntityEnum.ENTRY.getLabel();
nextLine[1] = String.valueOf(numTransaction);
nextLine[2] = entry.getDescription();
- nextLine[3] = new Double(entry.getAmount()).toString();
+ nextLine[3] = entry.getAmount().toString();
nextLine[4] = new Boolean(entry.getDebit()).toString();
nextLine[5] = entry.getLettering();
nextLine[6] = entry.getDetail();
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-11 14:50:40 UTC (rev 2999)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialStatementServiceImpl.java 2010-08-12 13:51:19 UTC (rev 3000)
@@ -20,6 +20,8 @@
package org.chorem.lima.business.ejb;
import static org.nuiton.i18n.I18n._;
+
+import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
@@ -308,7 +310,7 @@
List<FinancialStatement> financialStatements =
getChildrenFinancialStatement(financialStatement);
try {
- Double grossAmount = 0.0, provisionDeprecationAmount = 0.0;
+ BigDecimal grossAmount = new BigDecimal(0), provisionDeprecationAmount = new BigDecimal(0);
List<FinancialStatementAmounts> subResult =
new ArrayList<FinancialStatementAmounts>();
for (FinancialStatement subFinancialStatement : financialStatements) {
@@ -317,19 +319,20 @@
selectedBeginDate, selectedEndDate, topiaContext);
if (!subFinancialStatement.getHeader()){
//on calcul
- grossAmount += financialStatementAmounts.getGrossAmount();
- provisionDeprecationAmount +=
- financialStatementAmounts.getProvisionDeprecationAmount();
+ grossAmount = grossAmount.add(financialStatementAmounts.getGrossAmount());
+ provisionDeprecationAmount = provisionDeprecationAmount.add(
+ financialStatementAmounts.getProvisionDeprecationAmount());
subResult.add(financialStatementAmounts);
}
else {
FinancialStatementDatas financialStatementDatas =
financialStatementReport(subFinancialStatement,
selectedBeginDate, selectedEndDate, result, topiaContext);
- grossAmount += financialStatementDatas.
- getFinancialStatementAmounts().getGrossAmount();
- provisionDeprecationAmount += financialStatementDatas.
- getFinancialStatementAmounts().getProvisionDeprecationAmount();
+ grossAmount = grossAmount.add(financialStatementDatas.
+ getFinancialStatementAmounts().getGrossAmount());
+ provisionDeprecationAmount = provisionDeprecationAmount.
+ add(financialStatementDatas.getFinancialStatementAmounts().
+ getProvisionDeprecationAmount());
FinancialStatementAmounts headerfinancialStatementAmounts =
@@ -371,8 +374,8 @@
subResult.add(headerfinancialStatementAmounts);
}
else {
- headerfinancialStatementAmounts.setGrossAmount(0);
- headerfinancialStatementAmounts.setProvisionDeprecationAmount(0);
+ headerfinancialStatementAmounts.setGrossAmount(new BigDecimal(0));
+ headerfinancialStatementAmounts.setProvisionDeprecationAmount(new BigDecimal(0));
subResult.add(headerfinancialStatementAmounts);
}
//ajoute liste
@@ -411,8 +414,7 @@
try {
// DEBIT & CREDIT
String accountsString = financialStatement.getAccounts();
- log.debug("\n" + accountsString);
- Double amount = 0.0;
+ BigDecimal amount = new BigDecimal(0);
if (accountsString != null){
//Remove Spaces
accountsString = StringUtils.deleteWhitespace(accountsString);
@@ -420,8 +422,8 @@
while (stQuote.hasMoreTokens()) {
String s = stQuote.nextToken();
List<Account> accountsList = accountServiceLocal.
- stringToListAccountsWithTransaction(s, topiaContext);
- Double resAmount = 0.0;
+ stringToListAccountsWithTransaction(s, false, topiaContext);
+ BigDecimal resAmount = new BigDecimal(0);
for (Account account : accountsList) {
log.debug(account.getAccountNumber());
@@ -434,51 +436,53 @@
financialStatement.getMasterFinancialStatement().getWay();
switch (financialStatementWayEnum) {
case BOTH:
- resAmount += reportsDatas.getAmountSolde();
+ resAmount = resAmount.add(reportsDatas.getAmountSolde());
break;
case DEBIT:
- resAmount += reportsDatas.getAmountDebit()-reportsDatas.getAmountCredit();
+ resAmount = resAmount.add(reportsDatas.getAmountDebit());
+ resAmount = resAmount.subtract(reportsDatas.getAmountCredit());
break;
case CREDIT:
- resAmount += reportsDatas.getAmountCredit()-reportsDatas.getAmountDebit();
+ resAmount = resAmount.add(reportsDatas.getAmountCredit());
+ resAmount = resAmount.subtract(reportsDatas.getAmountDebit());
break;
}
}
- if (amount == 0){
- amount=resAmount;
+ if (amount.doubleValue() == 0){
+ amount = resAmount;
}
else {
- amount-=resAmount;
+ amount = amount.subtract(resAmount);
}
}
}
// CREDIT
String creditAccountsString = financialStatement.getCreditAccounts();
- Double creditAmount = 0.0;
+ BigDecimal creditAmount = new BigDecimal(0);
if (creditAccountsString != null){
List<Account> creditAccountsList = accountServiceLocal.
- stringToListAccountsWithTransaction(creditAccountsString, topiaContext);
+ stringToListAccountsWithTransaction(creditAccountsString, false, topiaContext);
for (Account account : creditAccountsList) {
ReportsDatas reportsDatas = reportServiceLocal.
generateAccountReportsWithTransaction(account,
selectedBeginDate, selectedEndDate, topiaContext);
- creditAmount += reportsDatas.getAmountCredit();
+ creditAmount = creditAmount.add(reportsDatas.getAmountCredit());
}
}
// DEBIT
String debitAccountsString = financialStatement.getDebitAccounts();
- Double debitAmount = 0.0;
+ BigDecimal debitAmount = new BigDecimal(0);
if (debitAccountsString != null){
List<Account> debitAccountsList = accountServiceLocal.
- stringToListAccountsWithTransaction(debitAccountsString, topiaContext);
+ stringToListAccountsWithTransaction(debitAccountsString, false, topiaContext);
for (Account account : debitAccountsList) {
ReportsDatas reportsDatas = reportServiceLocal.
generateAccountReportsWithTransaction(account,
selectedBeginDate, selectedEndDate, topiaContext);
- debitAmount += reportsDatas.getAmountDebit();
+ debitAmount = debitAmount.add(reportsDatas.getAmountDebit());
}
}
@@ -486,22 +490,23 @@
// PROVISION & DEPRECATION
String provisionDeprecationAccountsString =
financialStatement.getProvisionDeprecationAccounts();
- Double provisionDeprecationAmount = 0.0;
+ BigDecimal provisionDeprecationAmount = new BigDecimal(0);
if (provisionDeprecationAccountsString != null){
List<Account> provisionDeprecationAccountsList =
accountServiceLocal.stringToListAccountsWithTransaction(
- provisionDeprecationAccountsString, topiaContext);
+ provisionDeprecationAccountsString, false, topiaContext);
for (Account account : provisionDeprecationAccountsList) {
ReportsDatas reportsDatas = reportServiceLocal.
generateAccountReportsWithTransaction(account,
selectedBeginDate, selectedEndDate, topiaContext);
- provisionDeprecationAmount += reportsDatas.getAmountSolde();
+ provisionDeprecationAmount = provisionDeprecationAmount.add(reportsDatas.getAmountSolde());
}
}
// set result
- financialStatementAmounts.setGrossAmount(
- amount+creditAmount+debitAmount);
+ amount = amount.add(creditAmount);
+ amount = amount.add(debitAmount);
+ financialStatementAmounts.setGrossAmount(amount);
financialStatementAmounts.setLabel(financialStatement.getLabel());
financialStatementAmounts.setProvisionDeprecationAmount(
provisionDeprecationAmount);
@@ -520,36 +525,43 @@
@Override
public String checkFinancialStatementChart() throws LimaException {
- String result = "";
- List<Account> accountsList = new ArrayList<Account>();
-
+ String result ="";
TopiaContext transaction = null;
try {
transaction = beginTransaction();
AccountDAO accountDAO =
LimaCallaoDAOHelper.getAccountDAO(transaction);
+ FinancialStatementDAO financialStatementDAO =
+ LimaCallaoDAOHelper.getFinancialStatementDAO(transaction);
- accountsList = accountDAO.findAllSubAccounts();
- Collections.sort(accountsList, new AccountComparator());
-
+ List<Account> accountsList = accountDAO.findAllSubAccounts();
+
+ List<FinancialStatement> financialStatementsList =
+ financialStatementDAO.findAll();
+
+
+ for (FinancialStatement financialStatement : financialStatementsList) {
+
+ accountsList.removeAll(
+ accountServiceLocal.stringToListAccountsWithTransaction(
+ financialStatement.getAccounts(), true, transaction));
+
+ accountsList.removeAll(
+ accountServiceLocal.stringToListAccountsWithTransaction(
+ financialStatement.getCreditAccounts(), true, transaction));
+
+ accountsList.removeAll(
+ accountServiceLocal.stringToListAccountsWithTransaction(
+ financialStatement.getDebitAccounts(), true, transaction));
+
+ accountsList.removeAll(
+ accountServiceLocal.stringToListAccountsWithTransaction(
+ financialStatement.getProvisionDeprecationAccounts(), true, transaction));
+ }
+
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";
- }
- }
+
+ result += "NOT FOUND : "+account.getAccountNumber()+"\n";
}
}
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java 2010-08-11 14:50:40 UTC (rev 2999)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java 2010-08-12 13:51:19 UTC (rev 3000)
@@ -20,6 +20,8 @@
package org.chorem.lima.business.ejb;
import static org.nuiton.i18n.I18n._;
+
+import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import javax.ejb.Stateless;
@@ -80,6 +82,7 @@
public void createFinancialTransactionWithTransaction(
FinancialTransaction financialtransaction, TopiaContext topiaContext)
throws LimaException {
+ log.debug(financialtransaction);
try {
//check if the financial period is blocked
accountingRules.checkFinancialPeriodBlockedWithFinancialTransaction(
@@ -439,22 +442,32 @@
accountingRules.updateEntryRules(entry, entryOld, topiaContext);
//get new entry amounts
- Double entryAmount = entry.getAmount();
- Boolean entryAmountBool = entry.getDebit();
- Double entryDebit = entryAmountBool ? entryAmount : 0;
- Double entryCredit = entryAmountBool ? 0 : entryAmount;
+ BigDecimal entryAmount = entry.getAmount();
+ Boolean entryAmountIsDebit = entry.getDebit();
+ BigDecimal entryDebit = new BigDecimal(0), entryCredit = new BigDecimal(0);
+ if (entryAmountIsDebit){
+ entryDebit = entryAmount;
+ }
+ else {
+ entryCredit = entryAmount;
+ }
//get old entry amounts
- Double entryAmountOld = entryOld.getAmount();
- Boolean entryAmountBoolOld = entryOld.getDebit();
- Double entryDebitOld = entryAmountBoolOld ? entryAmountOld : 0;
- Double entryCreditOld = entryAmountBoolOld ? 0 : entryAmountOld;
+ BigDecimal entryAmountOld = entryOld.getAmount();
+ Boolean entryAmountOldIsDebit = entryOld.getDebit();
+ BigDecimal entryDebitOld = new BigDecimal(0), entryCreditOld = new BigDecimal(0);
+ if (entryAmountOldIsDebit){
+ entryDebitOld = entryAmountOld;
+ }
+ else {
+ entryCreditOld = entryAmountOld;
+ }
//FIXME PEPIN 20100520 conflict object already instanciate
// Exist best solution ?
entryOld.setAccount(entry.getAccount());
entryOld.setAmount(entryAmount);
- entryOld.setDebit(entryAmountBool);
+ entryOld.setDebit(entryAmountIsDebit);
entryOld.setDescription(entry.getDescription());
entryOld.setVoucher(entry.getVoucher());
entryOld.setFinancialTransaction(entry.getFinancialTransaction());
@@ -464,13 +477,17 @@
//calculate financial transaction amounts
FinancialTransaction financialTransaction =
entryOld.getFinancialTransaction();
- Double amountDebit = financialTransaction.getAmountDebit();
- Double amountCredit = financialTransaction.getAmountCredit();
- financialTransaction.setAmountDebit(
- amountDebit-entryDebitOld+entryDebit);
- financialTransaction.setAmountCredit(
- amountCredit-entryCreditOld+entryCredit);
+ BigDecimal amountDebit = financialTransaction.getAmountDebit();
+ amountDebit = amountDebit.subtract(entryDebitOld);
+ amountDebit = amountDebit.add(entryDebit);
+ financialTransaction.setAmountDebit(amountDebit);
+
+ BigDecimal amountCredit = financialTransaction.getAmountCredit();
+ amountCredit = amountCredit.subtract(entryCreditOld);
+ amountCredit = amountCredit.add(entryCredit);
+ financialTransaction.setAmountCredit(amountCredit);
+
//update financial transaction
updateFinancialTransactionWithTransaction(
financialTransaction, topiaContext);
@@ -503,18 +520,26 @@
entry.getFinancialTransaction(), topiaContext);
//get entry amounts
- Double entryAmount = entry.getAmount();
- Boolean entryAmountBool = entry.getDebit();
- Double entryDebit = entryAmountBool ? entryAmount : 0;
- Double entryCredit = entryAmountBool ? 0 : entryAmount;
+ BigDecimal entryAmount = entry.getAmount();
+ Boolean entryAmountIsDebit = entry.getDebit();
+ BigDecimal entryDebit = new BigDecimal(0), entryCredit = new BigDecimal(0);
+ if (entryAmountIsDebit){
+ entryDebit = entryAmount;
+ }
+ else {
+ entryCredit = entryAmount;
+ }
//calculate financial transaction amounts
FinancialTransaction financialTransaction =
entry.getFinancialTransaction();
- Double amountDebit = financialTransaction.getAmountDebit();
- Double amountCredit = financialTransaction.getAmountCredit();
- financialTransaction.setAmountDebit(amountDebit-entryDebit);
- financialTransaction.setAmountCredit(amountCredit-entryCredit);
+ BigDecimal amountDebit = financialTransaction.getAmountDebit();
+ amountDebit = amountDebit.subtract(entryDebit);
+ financialTransaction.setAmountDebit(amountDebit);
+
+ BigDecimal amountCredit = financialTransaction.getAmountCredit();
+ amountCredit = amountCredit.subtract(entryCredit);
+ financialTransaction.setAmountCredit(amountCredit);
//update financial transaction
updateFinancialTransactionWithTransaction(
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-11 14:50:40 UTC (rev 2999)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java 2010-08-12 13:51:19 UTC (rev 3000)
@@ -21,10 +21,12 @@
import java.io.IOException;
import java.io.StringReader;
+import java.math.BigDecimal;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Calendar;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
@@ -65,6 +67,7 @@
import org.chorem.lima.business.ejbinterface.ImportService;
import org.chorem.lima.business.ejbinterface.ImportServiceLocal;
import org.chorem.lima.business.utils.AccountEBPComparator;
+import org.chorem.lima.business.utils.EntryEBPComparator;
import org.chorem.lima.business.utils.FiscalPeriodComparator;
import org.chorem.lima.business.utils.ImportExportEntityEnum;
import org.chorem.lima.entity.Account;
@@ -188,16 +191,20 @@
CsvToBean<EntryEBPImpl> csv = new CsvToBean<EntryEBPImpl>();
List<EntryEBPImpl> list = csv.parse(strat, csvReader);
+ Collections.sort(list, new EntryEBPComparator());
// DAOs
AccountDAO accountDAO = LimaCallaoDAOHelper
.getAccountDAO(topiaContext);
EntryBookDAO entryBookDAO = LimaCallaoDAOHelper
.getEntryBookDAO(topiaContext);
+ List<FiscalPeriod> fiscalPeriods = fiscalPeriodService.getAllUnblockedFiscalPeriods();
+ Collections.sort(fiscalPeriods, new FiscalPeriodComparator());
+ int nbFiscalPeriods = fiscalPeriods.size();
FinancialPeriodDAO financialPeriodDAO = LimaCallaoDAOHelper
.getFinancialPeriodDAO(topiaContext);
- if (financialPeriodDAO.findAll().size() == 0) {
+ if (nbFiscalPeriods == 0) {
throw new LimaBusinessException(
"Can't import entries, no fiscalperiod is open");
}
@@ -208,18 +215,33 @@
Entry entry = new EntryImpl();
Account account = accountDAO.findByAccountNumber(entryEBP
.getCompte());
+
+ Date date = epbDateFormat.parse(entryEBP.getDatEcr());
+ Date beginDate = fiscalPeriods.get(0).getBeginDate();
+ Date endDate = fiscalPeriods.get(nbFiscalPeriods-1).getEndDate();
+
// if account not exist not export
if (account == null) {
throw new LimaBusinessException(
"FAILED : Account "
+ entryEBP.getCompte()
+ " not exist !\n"
- + "Import or create all accounts before import entries");
- } else {
+ + "Import aborted ! Create all accounts before import entries");
+ }
+
+ else if (date.compareTo(beginDate) < 0 || date.compareTo(endDate) > 0){
+
+ result += "WARNING : " + date + " entries is out of range of" +
+ " opened fiscal periods. "
+ + "Entry was skip !\n";
+ }
+ else {
entry.setAccount(account);
- Double debit = new Double(entryEBP.getDebit());
- Double credit = new Double(entryEBP.getCredit());
- if (debit == 0) {
+ BigDecimal debit = new BigDecimal(entryEBP.getDebit());
+ log.debug(debit);
+ BigDecimal credit = new BigDecimal(entryEBP.getCredit());
+ log.debug(credit);
+ if (debit.doubleValue() == 0) {
entry.setDebit(false);
entry.setAmount(credit);
} else {
@@ -229,7 +251,6 @@
entry.setDescription(entryEBP.getLibelle());
entry.setLettering(entryEBP.getLettre());
entry.setVoucher(entryEBP.getPiece());
- Date date = epbDateFormat.parse(entryEBP.getDatEcr());
String entryBookCode = entryEBP.getJournal();
EntryBook entryBook = entryBookDAO
.findByCode(entryBookCode);
@@ -245,11 +266,9 @@
}
if (financialTransaction == null
- || !(date.equals(financialTransaction
- .getTransactionDate()) && entryBook
- .getCode().equals(
- financialTransaction.getEntryBook()
- .getCode()))) {
+ || !(date.equals(financialTransaction.getTransactionDate())
+ && entryBook.getCode().equals(financialTransaction.getEntryBook().getCode()))) {
+
// update previous financial transaction before create
// new
if (financialTransaction != null) {
@@ -1085,9 +1104,9 @@
.parse(financialTransactionImport.getDate());
financialTransaction
.setTransactionDate(dateFinancialTransaction);
- financialTransaction.setAmountDebit(new Double(
+ financialTransaction.setAmountDebit(new BigDecimal(
financialTransactionImport.getAmountDebit()));
- financialTransaction.setAmountCredit(new Double(
+ financialTransaction.setAmountCredit(new BigDecimal(
financialTransactionImport.getAmountCredit()));
EntryBook entryBook = entryBookDAO
.findByCode(financialTransactionImport
@@ -1107,7 +1126,7 @@
.findByAccountNumber(entryImport.getAccount());
entry.setAccount(account);
entry.setDescription(entryImport.getDescription());
- entry.setAmount(new Double(entryImport.getAmount()));
+ entry.setAmount(new BigDecimal(entryImport.getAmount()));
entry.setDebit(new Boolean(entryImport.getDebit()));
entry.setLettering(entryImport.getLettering());
entry.setDetail(entryImport.getDetail());
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-11 14:50:40 UTC (rev 2999)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java 2010-08-12 13:51:19 UTC (rev 3000)
@@ -19,6 +19,7 @@
package org.chorem.lima.business.ejb;
+import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@@ -103,7 +104,9 @@
@Override
public ReportsDatas generateAccountReportsWithTransaction (Account account, Date beginDate, Date endDate, TopiaContext topiaContext) throws LimaException{
ReportsDatas reportsDatas = new ReportsDatasImpl();
- double credit = 0, debit = 0, solde = 0;
+ BigDecimal credit = new BigDecimal(0);
+ BigDecimal debit = new BigDecimal(0);
+ BigDecimal solde = new BigDecimal(0);
if (account != null){
// First subaccount
List<Account> accounts = (List<Account>) account.getSubAccounts();
@@ -119,15 +122,18 @@
ReportsDatas subReportsDatas =
generateAccountReportsWithTransaction(subAccount,
beginDate,endDate, topiaContext);
- debit += subReportsDatas.getAmountDebit();
- credit += subReportsDatas.getAmountCredit();
+ debit = debit.add(subReportsDatas.getAmountDebit());
+ credit = credit.add(subReportsDatas.getAmountCredit());
entries.addAll(subReportsDatas.getListEntry());
}
- solde = debit - credit;
- if (solde > 0){
+ //solde = debit - credit
+ solde = solde.add(debit);
+ solde = solde.subtract(credit);
+
+ if (solde.doubleValue() > 0){
reportsDatas.setSoldeDebit(true);
}
- solde = Math.abs(solde);
+ solde = solde.abs();
reportsDatas.setAmountCredit(credit);
reportsDatas.setAmountDebit(debit);
reportsDatas.setAmountSolde(solde);
@@ -170,7 +176,10 @@
@SuppressWarnings("unchecked")
protected ReportsDatas generateSubAccountReportsWithTransaction(Account account, Date beginDate, Date endDate, TopiaContext topiaContext) throws LimaException {
ReportsDatas reportsDatas = new ReportsDatasImpl();
- double credit = 0, debit = 0, solde = 0;
+ BigDecimal credit = new BigDecimal(0);
+ BigDecimal debit = new BigDecimal(0);
+ BigDecimal solde = new BigDecimal(0);
+
List<Object[]> results = new ArrayList<Object[]>();
String queryAlias = "E";
if (beginDate != null && endDate != null){
@@ -194,24 +203,27 @@
results = amountsQuery.execute(topiaContext);
int nbAmount = results.size();
if(nbAmount==2){
- debit = (Double)results.get(0)[1];
- credit = (Double)results.get(1)[1];
+ debit = (BigDecimal) results.get(0)[1];
+ credit = (BigDecimal)results.get(1)[1];
}
if (nbAmount==1){
if ((Boolean)results.get(0)[0]){
- debit = (Double)results.get(0)[1];
+ debit = (BigDecimal) results.get(0)[1];
}
else {
- credit = (Double)results.get(0)[1];
+ credit = (BigDecimal)results.get(0)[1];
}
}
// set the amounts and solde
- solde = debit - credit;
- if (solde > 0){
+ //solde = debit - credit
+ solde = solde.add(debit);
+ solde = solde.subtract(credit);
+
+ if (solde.doubleValue() > 0){
reportsDatas.setSoldeDebit(true);
}
- solde = Math.abs(solde);
+ solde = solde.abs();
reportsDatas.setAmountCredit(credit);
reportsDatas.setAmountDebit(debit);
@@ -235,10 +247,15 @@
@SuppressWarnings("unchecked")
protected ReportsDatas generateSubAccountBalanceWithTransaction(Account account, Date beginDate, Date endDate, Boolean getEntries, TopiaContext topiaContext) throws LimaException {
ReportsDatas reportsDatas = new ReportsDatasImpl();
- double credit = 0, debit = 0, solde = 0;
+ BigDecimal credit = new BigDecimal(0);
+ BigDecimal debit = new BigDecimal(0);
+ BigDecimal solde = new BigDecimal(0);
+
+
List<Object[]> results = new ArrayList<Object[]>();
String queryAlias = "E";
if (beginDate != null && endDate != null){
+ log.debug("solde 0 : "+solde);
try {
EntryDAO entryDAO= LimaCallaoDAOHelper.getEntryDAO(topiaContext);
@@ -261,24 +278,28 @@
results = amountsQuery.execute(topiaContext);
int nbAmount = results.size();
if(nbAmount==2){
- debit = (Double)results.get(0)[1];
- credit = (Double)results.get(1)[1];
+ debit = (BigDecimal)results.get(0)[1];
+ credit = (BigDecimal)results.get(1)[1];
}
if (nbAmount==1){
if ((Boolean)results.get(0)[0]){
- debit = (Double)results.get(0)[1];
+ debit = (BigDecimal)results.get(0)[1];
}
else {
- credit = (Double)results.get(0)[1];
+ credit = (BigDecimal)results.get(0)[1];
}
}
// set the amounts and solde
- solde = debit - credit;
- if (solde > 0){
+ //solde = debit - credit
+ solde = solde.add(debit);
+ solde = solde.subtract(credit);
+
+ if (solde.doubleValue() > 0){
reportsDatas.setSoldeDebit(true);
+
}
- solde = Math.abs(solde);
+ solde = solde.abs();
reportsDatas.setAmountCredit(credit);
reportsDatas.setAmountDebit(debit);
@@ -306,7 +327,10 @@
@Override
public ReportsDatas generateEntryBooksReports(EntryBook entryBook, Date beginDate, Date endDate) throws LimaException {
ReportsDatas reportsDatas = new ReportsDatasImpl();
- double credit = 0, debit = 0, solde = 0;
+ BigDecimal credit = new BigDecimal(0);
+ BigDecimal debit = new BigDecimal(0);
+ BigDecimal solde = new BigDecimal(0);
+
List<Object[]> results = new ArrayList<Object[]>();
if (entryBook != null && beginDate != null && endDate != null){
// Get all entries with a topia query
@@ -339,24 +363,26 @@
results = amountsQuery.execute(topiaTransaction);
int nbAmount = results.size();
if(nbAmount==2){
- debit = (Double)results.get(0)[1];
- credit = (Double)results.get(1)[1];
+ debit = (BigDecimal)results.get(0)[1];
+ credit = (BigDecimal)results.get(1)[1];
}
if (nbAmount==1){
if ((Boolean)results.get(0)[0]){
- debit = (Double)results.get(0)[1];
+ debit = (BigDecimal)results.get(0)[1];
}
else {
- credit = (Double)results.get(0)[1];
+ credit = (BigDecimal)results.get(0)[1];
}
}
// set the amounts and solde
- solde = debit - credit;
- if (solde > 0){
+ //solde = debit - credit;
+ solde = solde.add(debit);
+ solde = solde.subtract(credit);
+ if (solde.doubleValue() > 0){
reportsDatas.setSoldeDebit(true);
}
- solde = Math.abs(solde);
+ solde = solde.abs();
reportsDatas.setAmountCredit(credit);
reportsDatas.setAmountDebit(debit);
@@ -419,8 +445,9 @@
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;
-
+ BigDecimal credit = new BigDecimal(0);
+ BigDecimal debit = new BigDecimal(0);
+ BigDecimal solde = new BigDecimal(0);
TopiaContext topiaTransaction = null;
try {
topiaTransaction = beginTransaction();
@@ -439,16 +466,20 @@
}
//build list account from selectedAccounts
else{
- accounts=accountServiceLocal.stringToListAccountsWithTransaction(selectedAccounts, topiaTransaction);
+ accounts = accountServiceLocal.stringToListAccountsWithTransaction(
+ selectedAccounts, false, topiaTransaction);
}
for (Account account : accounts) {
ReportsDatas reportsDatas =
generateSubAccountBalanceWithTransaction(account, beginDate,
endDate, getEntries, topiaTransaction);
reportsDatas.setAccount(account);
- Double amount = reportsDatas.getAmountSolde();
+ BigDecimal amount = reportsDatas.getAmountSolde();
+ if (amount == null){
+ amount = new BigDecimal(0);
+ }
if (movementedFilter){
- if (amount != 0){
+ if (amount.doubleValue() != 0){
// add balance sheet to balance trial
balanceTrial.addReportsDatas(reportsDatas);
}
@@ -459,18 +490,20 @@
}
if (reportsDatas.getSoldeDebit()) {
- debit += amount;
+ debit = debit.add(amount);
}
else {
- credit += amount;
+ credit = credit.add(amount);
}
}
// set the amounts and solde
- solde = debit - credit;
- if (solde > 0){
+ //solde = debit - credit;
+ solde = solde.add(debit);
+ solde = solde.subtract(credit);
+ if (solde.doubleValue() > 0){
balanceTrial.setSoldeDebit(true);
}
- solde = Math.abs(solde);
+ solde = solde.abs();
balanceTrial.setAmountCredit(credit);
balanceTrial.setAmountDebit(debit);
balanceTrial.setAmountSolde(solde);
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/AccountServiceLocal.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/AccountServiceLocal.java 2010-08-11 14:50:40 UTC (rev 2999)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/AccountServiceLocal.java 2010-08-12 13:51:19 UTC (rev 3000)
@@ -40,7 +40,7 @@
@Local
public interface AccountServiceLocal extends AccountService{
- public List<Account> stringToListAccountsWithTransaction(String selectedAccounts, TopiaContext topiaContext) throws LimaException;
+ public List<Account> stringToListAccountsWithTransaction(String selectedAccounts, Boolean subAccountsMode, TopiaContext topiaContext) throws LimaException;
void createAccountWithTransaction(Account masterAccount, Account account, TopiaContext topiaContext) throws LimaException, LimaBusinessException;
void createSubLedgerWithTransaction(Account masterAccount, Account account, TopiaContext topiaContext) throws LimaException;
Added: trunk/lima-business/src/main/java/org/chorem/lima/business/utils/EntryEBPComparator.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/utils/EntryEBPComparator.java (rev 0)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/utils/EntryEBPComparator.java 2010-08-12 13:51:19 UTC (rev 3000)
@@ -0,0 +1,38 @@
+/* *##% 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 java.util.Comparator;
+import org.chorem.lima.beans.EntryEBP;
+
+public class EntryEBPComparator implements Comparator<EntryEBP>{
+
+ @Override
+ public int compare(EntryEBP o1, EntryEBP o2) {
+
+ int result = o1.getDatEcr().compareTo(o2.getDatEcr());
+
+ if(result==0)
+ result = o1.getJournal().compareTo(o2.getJournal());
+
+ return result;
+ }
+
+}
Modified: trunk/lima-callao/src/main/java/org/chorem/lima/entity/AccountDAOImpl.java
===================================================================
--- trunk/lima-callao/src/main/java/org/chorem/lima/entity/AccountDAOImpl.java 2010-08-11 14:50:40 UTC (rev 2999)
+++ trunk/lima-callao/src/main/java/org/chorem/lima/entity/AccountDAOImpl.java 2010-08-12 13:51:19 UTC (rev 3000)
@@ -47,4 +47,15 @@
return (List<Account>) findAllByQuery(query);
}
+ @Override
+ public Account findSubAccountByNumber(String number) throws TopiaException {
+ TopiaQuery query = createQuery();
+ String subAccountsProperty = TopiaQuery.getProperty(Account.SUB_ACCOUNTS);
+ String subLedgersProperty = TopiaQuery.getProperty(Account.SUB_LEDGERS);
+ query.addWhere("not exists elements ("+subAccountsProperty+")")
+ .addWhere("not exists elements ("+subLedgersProperty+")")
+ .addEquals(Account.ACCOUNT_NUMBER, number);
+ return findByQuery(query);
+ }
+
}
Modified: trunk/lima-callao/src/main/java/org/chorem/lima/entity/FinancialTransactionImpl.java
===================================================================
--- trunk/lima-callao/src/main/java/org/chorem/lima/entity/FinancialTransactionImpl.java 2010-08-11 14:50:40 UTC (rev 2999)
+++ trunk/lima-callao/src/main/java/org/chorem/lima/entity/FinancialTransactionImpl.java 2010-08-12 13:51:19 UTC (rev 3000)
@@ -1,17 +1,25 @@
package org.chorem.lima.entity;
+import java.math.BigDecimal;
+
public class FinancialTransactionImpl extends FinancialTransactionAbstract {
@Override
public void setAmounts() {
+ if (amountDebit == null){
+ amountDebit = new BigDecimal(0);
+ }
+ if (amountCredit == null){
+ amountCredit = new BigDecimal(0);
+ }
for (Entry entryFT : entry) {
if (entryFT.getDebit()){
- amountDebit += entryFT.getAmount();
+ amountDebit = amountDebit.add(entryFT.getAmount());
}
else {
- amountCredit += entryFT.getAmount();
+ amountCredit = amountCredit.add(entryFT.getAmount());
}
}
}
Modified: trunk/lima-callao/src/main/xmi/accounting.zargo
===================================================================
(Binary files differ)
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-11 14:50:40 UTC (rev 2999)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsView.jaxx 2010-08-12 13:51:19 UTC (rev 3000)
@@ -42,7 +42,7 @@
getEndDatePicker().setDate(endDate);
void $afterCompleteSetup() {
- getHandler().refresh();
+ //getHandler().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-11 14:50:40 UTC (rev 2999)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsViewHandler.java 2010-08-12 13:51:19 UTC (rev 3000)
@@ -19,6 +19,8 @@
package org.chorem.lima.ui.accountsreports;
import static org.nuiton.i18n.I18n._;
+
+import java.math.BigDecimal;
import java.util.Date;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -91,15 +93,18 @@
public ReportsDatas getDataList(){
ReportsDatas results = null;
- try {
- results = reportService.generateAccountsReports(selectedAccount,
- selectedBeginDate, selectedEndDate);
- }
- catch (LimaException eee) {
- if (log.isErrorEnabled()) {
- log.debug("Can't update model", eee);
+ //avoid unnecessary call to service
+ if (selectedAccount != null){
+ try {
+ results = reportService.generateAccountsReports(selectedAccount,
+ selectedBeginDate, selectedEndDate);
}
- ErrorHelper.showErrorDialog("Can't get entries list", eee);
+ catch (LimaException eee) {
+ if (log.isErrorEnabled()) {
+ log.debug("Can't update model", eee);
+ }
+ ErrorHelper.showErrorDialog("Can't get entries list", eee);
+ }
}
return results;
}
@@ -117,13 +122,13 @@
if (datasList != null){
// set amounts credit and debit and solde
- view.amountCreditLabel.setText(String.valueOf(datasList.getAmountCredit()));
- view.amountDebitLabel.setText(String.valueOf(datasList.getAmountDebit()));
- Double amountSolde = datasList.getAmountSolde();
- view.amountSoldeLabel.setText(String.valueOf(amountSolde));
+ view.amountCreditLabel.setText(datasList.getAmountCredit().toString());
+ view.amountDebitLabel.setText(datasList.getAmountDebit().toString());
+ BigDecimal amountSolde = datasList.getAmountSolde();
+ view.amountSoldeLabel.setText(amountSolde.toString());
- if (amountSolde == 0){
+ if (amountSolde.doubleValue() == 0){
view.soldeLabel.setText(_("lima.solde"));
}
else {
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-11 14:50:40 UTC (rev 2999)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceViewHandler.java 2010-08-12 13:51:19 UTC (rev 3000)
@@ -21,6 +21,7 @@
import static org.nuiton.i18n.I18n._;
import java.awt.Desktop;
import java.io.IOException;
+import java.math.BigDecimal;
import java.net.URI;
import java.net.URISyntaxException;
import java.text.SimpleDateFormat;
@@ -134,11 +135,11 @@
// set amounts credit, debit and solde
view.amountCreditLabel.setText(String.valueOf(datasList.getAmountCredit()));
view.amountDebitLabel.setText(String.valueOf(datasList.getAmountDebit()));
- Double amountSolde = datasList.getAmountSolde();
+ BigDecimal amountSolde = datasList.getAmountSolde();
view.amountSoldeLabel.setText(String.valueOf(amountSolde));
- if (amountSolde == 0){
+ if (amountSolde.doubleValue() == 0){
view.soldeLabel.setText(_("lima.solde"));
}
else {
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsTableModel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsTableModel.java 2010-08-11 14:50:40 UTC (rev 2999)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsTableModel.java 2010-08-12 13:51:19 UTC (rev 3000)
@@ -48,7 +48,7 @@
int result = 0;
// just prevent too much result
- if (cacheDataList.getListEntry() != null) {
+ if (cacheDataList != null && cacheDataList.getListEntry() != null) {
result = cacheDataList.getListEntry().size();
}
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-11 14:50:40 UTC (rev 2999)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsView.jaxx 2010-08-12 13:51:19 UTC (rev 3000)
@@ -43,7 +43,7 @@
getEndDatePicker().setDate(endDate);
void $afterCompleteSetup() {
- getHandler().refresh();
+ //getHandler().refresh();
}
]]>
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-11 14:50:40 UTC (rev 2999)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsViewHandler.java 2010-08-12 13:51:19 UTC (rev 3000)
@@ -22,6 +22,7 @@
import java.awt.Desktop;
import java.io.IOException;
+import java.math.BigDecimal;
import java.net.URI;
import java.net.URISyntaxException;
import java.text.SimpleDateFormat;
@@ -43,7 +44,6 @@
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;
import org.chorem.lima.util.ErrorHelper;
@@ -114,16 +114,18 @@
}
public ReportsDatas getDataList(){
- ReportsDatas results = new ReportsDatasImpl();
- try {
- results =
- reportService.generateEntryBooksReports(selectedEntryBook, selectedBeginDate, selectedEndDate);
- }
- catch (LimaException eee) {
- if (log.isErrorEnabled()) {
- log.debug("Can't update model", eee);
+ ReportsDatas results = null;
+ if (selectedEntryBook != null){
+ try {
+ results =
+ reportService.generateEntryBooksReports(selectedEntryBook, selectedBeginDate, selectedEndDate);
}
- ErrorHelper.showErrorDialog("Can't get entries list", eee);
+ catch (LimaException eee) {
+ if (log.isErrorEnabled()) {
+ log.debug("Can't update model", eee);
+ }
+ ErrorHelper.showErrorDialog("Can't get entries list", eee);
+ }
}
return results;
}
@@ -143,11 +145,10 @@
// set amounts credit, debit and solde
view.amountCreditLabel.setText(String.valueOf(datasList.getAmountCredit()));
view.amountDebitLabel.setText(String.valueOf(datasList.getAmountDebit()));
- Double amountSolde = datasList.getAmountSolde();
+ BigDecimal amountSolde = datasList.getAmountSolde();
view.amountSoldeLabel.setText(String.valueOf(amountSolde));
-
- if (amountSolde == 0){
+ if (amountSolde.doubleValue() == 0){
view.soldeLabel.setText(_("lima.solde"));
}
else {
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-11 14:50:40 UTC (rev 2999)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportTableModel.java 2010-08-12 13:51:19 UTC (rev 3000)
@@ -23,6 +23,7 @@
import java.awt.Desktop;
import java.io.IOException;
+import java.math.BigDecimal;
import java.net.URI;
import java.net.URISyntaxException;
import java.text.SimpleDateFormat;
@@ -145,8 +146,15 @@
//get entries for the period for the current row
if (result instanceof FinancialStatementAmounts) {
FinancialStatementAmounts currentRow = (FinancialStatementAmounts) result;
- Double grossAmount = currentRow.getGrossAmount();
- Double provisionDeprecationAmount = currentRow.getProvisionDeprecationAmount();
+ BigDecimal grossAmount = currentRow.getGrossAmount();
+ if (grossAmount == null ){
+ grossAmount = new BigDecimal(0);
+ }
+
+ BigDecimal provisionDeprecationAmount = currentRow.getProvisionDeprecationAmount();
+ if (provisionDeprecationAmount == null ){
+ provisionDeprecationAmount = new BigDecimal(0);
+ }
switch (column) {
case 0:
result = "";
@@ -159,7 +167,7 @@
}
break;
case 1:
- if (grossAmount == 0){
+ if (grossAmount.doubleValue() == 0){
result = null;
}
else {
@@ -167,7 +175,7 @@
}
break;
case 2:
- if (provisionDeprecationAmount == 0){
+ if (provisionDeprecationAmount.doubleValue() == 0){
result = null;
}
else {
@@ -175,11 +183,12 @@
}
break;
case 3:
- if (grossAmount-provisionDeprecationAmount == 0){
+ BigDecimal solde = grossAmount.subtract(provisionDeprecationAmount);
+ if (solde.doubleValue() == 0){
result = null;
}
else {
- result = grossAmount-provisionDeprecationAmount;
+ result = solde;
}
break;
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTableModel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTableModel.java 2010-08-11 14:50:40 UTC (rev 2999)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTableModel.java 2010-08-12 13:51:19 UTC (rev 3000)
@@ -19,6 +19,8 @@
package org.chorem.lima.ui.financialtransaction;
import static org.nuiton.i18n.I18n._;
+
+import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collections;
@@ -160,13 +162,13 @@
result = String.class;
break;
case 6:
- result = Double.class;
+ result = BigDecimal.class;
break;
case 7:
- result = Double.class;
+ result = BigDecimal.class;
break;
case 8:
- result = Double.class;
+ result = BigDecimal.class;
break;
}
@@ -231,8 +233,8 @@
if (result instanceof FinancialTransaction) {
FinancialTransaction currentRow = (FinancialTransaction)result;
- Double amountDebit = currentRow.getAmountDebit();
- Double amountCredit = currentRow.getAmountCredit();
+ BigDecimal amountDebit = currentRow.getAmountDebit();
+ BigDecimal amountCredit = currentRow.getAmountCredit();
switch (column) {
case 0:
@@ -265,7 +267,7 @@
result = amountCredit;
break;
case 8:
- result = amountDebit - amountCredit;
+ result = amountDebit.subtract(amountCredit);
break;
}
}
@@ -458,11 +460,11 @@
currentEntry.setPosition((String)value);
break;
case 6:
- currentEntry.setAmount((Double)value);
+ currentEntry.setAmount((BigDecimal)value);
currentEntry.setDebit(true);
break;
case 7:
- currentEntry.setAmount((Double)value);
+ currentEntry.setAmount((BigDecimal)value);
currentEntry.setDebit(false);
break;
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedTableModel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedTableModel.java 2010-08-11 14:50:40 UTC (rev 2999)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedTableModel.java 2010-08-12 13:51:19 UTC (rev 3000)
@@ -19,6 +19,8 @@
package org.chorem.lima.ui.financialtransactionunbalanced;
import static org.nuiton.i18n.I18n._;
+
+import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
@@ -152,13 +154,13 @@
result = String.class;
break;
case 6:
- result = Double.class;
+ result = BigDecimal.class;
break;
case 7:
- result = Double.class;
+ result = BigDecimal.class;
break;
case 8:
- result = Double.class;
+ result = BigDecimal.class;
break;
}
@@ -224,8 +226,8 @@
if (result instanceof FinancialTransaction) {
FinancialTransaction currentRow = (FinancialTransaction)result;
- Double amountDebit = currentRow.getAmountDebit();
- Double amountCredit = currentRow.getAmountCredit();
+ BigDecimal amountDebit = currentRow.getAmountDebit();
+ BigDecimal amountCredit = currentRow.getAmountCredit();
switch (column) {
case 0:
@@ -258,7 +260,7 @@
result = amountCredit;
break;
case 8:
- result = amountDebit - amountCredit;
+ result = amountDebit.subtract(amountCredit);
break;
}
}
@@ -403,11 +405,11 @@
currentEntry.setPosition((String)value);
break;
case 6:
- currentEntry.setAmount((Double)value);
+ currentEntry.setAmount((BigDecimal)value);
currentEntry.setDebit(true);
break;
case 7:
- currentEntry.setAmount((Double)value);
+ currentEntry.setAmount((BigDecimal)value);
currentEntry.setDebit(false);
break;
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerTableModel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerTableModel.java 2010-08-11 14:50:40 UTC (rev 2999)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerTableModel.java 2010-08-12 13:51:19 UTC (rev 3000)
@@ -20,6 +20,8 @@
package org.chorem.lima.ui.ledger;
import static org.nuiton.i18n.I18n._;
+
+import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.List;
import javax.swing.table.AbstractTableModel;
@@ -110,8 +112,8 @@
if (result instanceof ReportsDatas) {
ReportsDatas currentRow = (ReportsDatas)result;
- Double amountDebit = currentRow.getAmountDebit();
- Double amountCredit = currentRow.getAmountCredit();
+ BigDecimal amountDebit = currentRow.getAmountDebit();
+ BigDecimal amountCredit = currentRow.getAmountCredit();
switch (column) {
case 0:
@@ -141,15 +143,21 @@
result = amountCredit;
break;
case 7:
- result = amountDebit - amountCredit;
+ result = amountDebit.subtract(amountCredit);
break;
}
}
else if (result instanceof Entry) {
Entry currentRow = (Entry)result;
- Double amountDebit = currentRow.getDebit() ? currentRow.getAmount() : 0;
- Double amountCredit = currentRow.getDebit() ? 0 : currentRow.getAmount();
-
+ BigDecimal amountDebit = new BigDecimal(0),
+ amountCredit = new BigDecimal(0);
+ if (currentRow.getDebit()){
+ amountDebit = currentRow.getAmount();
+ }
+ else {
+ amountCredit = currentRow.getAmount();
+ }
+
switch (column) {
case 0:
result = null; // account
@@ -179,7 +187,7 @@
result = amountCredit;
break;
case 7:
- result = amountDebit - amountCredit;
+ result = amountDebit.subtract(amountCredit);
break;
}
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-11 14:50:40 UTC (rev 2999)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerViewHandler.java 2010-08-12 13:51:19 UTC (rev 3000)
@@ -22,6 +22,7 @@
import java.awt.Desktop;
import java.io.IOException;
+import java.math.BigDecimal;
import java.net.URI;
import java.net.URISyntaxException;
import java.text.SimpleDateFormat;
@@ -164,11 +165,11 @@
String.valueOf(balanceTrialCache.getAmountCredit()));
view.amountDebitLabel.setText(
String.valueOf(balanceTrialCache.getAmountDebit()));
- Double amountSolde = balanceTrialCache.getAmountSolde();
+ BigDecimal amountSolde = balanceTrialCache.getAmountSolde();
view.amountSoldeLabel.setText(
String.valueOf(amountSolde));
- if (amountSolde == 0){
+ if (amountSolde.doubleValue() == 0){
view.soldeLabel.setText(_("lima.solde"));
}
else {
1
0
Author: tchemit
Date: 2010-08-11 16:50:40 +0200 (Wed, 11 Aug 2010)
New Revision: 2999
Url: http://chorem.org/repositories/revision/lima/2999
Log:
Utilisation de mavenpom4redmine 2.2.3
Modified:
trunk/pom.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2010-08-06 15:10:31 UTC (rev 2998)
+++ trunk/pom.xml 2010-08-11 14:50:40 UTC (rev 2999)
@@ -10,7 +10,7 @@
<parent>
<groupId>org.nuiton</groupId>
<artifactId>mavenpom4redmine</artifactId>
- <version>2.2.2.1</version>
+ <version>2.2.3</version>
</parent>
<groupId>org.chorem</groupId>
1
0
r2998 - in trunk/lima-swing/src/main/java/org/chorem/lima/ui: accountsreports celleditor combobox entrybooksreports financialtransaction
by jpepin@users.chorem.org Aug. 6, 2010
by jpepin@users.chorem.org Aug. 6, 2010
Aug. 6, 2010
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
Aug. 3, 2010
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 Aug. 3, 2010
by jpepin@users.chorem.org Aug. 3, 2010
Aug. 3, 2010
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 Aug. 2, 2010
by jpepin@users.chorem.org Aug. 2, 2010
Aug. 2, 2010
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