Lima-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
July 2010
- 3 participants
- 34 discussions
Author: jpepin
Date: 2010-07-29 14:51:43 +0200 (Thu, 29 Jul 2010)
New Revision: 2989
Url: http://chorem.org/repositories/revision/lima/2989
Log:
Ajout dans l'import/export d'une option de s?\195?\169lection de l'encodage du fichier CSV, d?\195?\169sormais compatible avec Excel.
Added:
trunk/lima-swing/src/main/java/org/chorem/lima/enums/EncodingEnum.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExportFileChooser.java
Modified:
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialStatementServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialStatementService.java
trunk/lima-swing/src/main/java/org/chorem/lima/enums/AccountsChartEnum.java
trunk/lima-swing/src/main/java/org/chorem/lima/enums/EntryBooksChartEnum.java
trunk/lima-swing/src/main/java/org/chorem/lima/enums/FinancialStatementsChartEnum.java
trunk/lima-swing/src/main/java/org/chorem/lima/enums/ImportExportEnum.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountViewHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookViewHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartViewHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementImportForm.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/OpeningViewHandler.java
trunk/lima-swing/src/main/resources/i18n/lima-swing-en_GB.properties
trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialStatementServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialStatementServiceImpl.java 2010-07-28 18:53:39 UTC (rev 2988)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialStatementServiceImpl.java 2010-07-29 12:51:43 UTC (rev 2989)
@@ -186,7 +186,17 @@
}
}
+
+
@Override
+ public void removeAllFinancialStatement() throws LimaException,
+ LimaBusinessException {
+ for (FinancialStatement financialStatement : getChildrenFinancialStatement(null)) {
+ removeFinancialStatement(financialStatement);
+ }
+ }
+
+ @Override
public List<FinancialStatement> getAllFinancialStatements() throws LimaException {
TopiaContext transaction = null;
List<FinancialStatement> financialStatements = null;
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialStatementService.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialStatementService.java 2010-07-28 18:53:39 UTC (rev 2988)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialStatementService.java 2010-07-29 12:51:43 UTC (rev 2989)
@@ -34,7 +34,8 @@
public void createFinancialStatement(FinancialStatement masterFinancialStatement, FinancialStatement financialStatement) throws LimaException, LimaBusinessException;
public void updateFinancialStatement(FinancialStatement financialStatement) throws LimaException, LimaBusinessException;
public void removeFinancialStatement(FinancialStatement financialStatement) throws LimaException, LimaBusinessException;
-
+ public void removeAllFinancialStatement() throws LimaException, LimaBusinessException;
+
public List<FinancialStatement> getAllFinancialStatements() throws LimaException;
public List<FinancialStatement> getChildrenFinancialStatement(FinancialStatement financialStatement) throws LimaException;
public List<FinancialStatement> getAllChildrenFinancialStatement(FinancialStatement financialStatement, List<FinancialStatement> financialStatements) throws LimaException, LimaBusinessException;
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/enums/AccountsChartEnum.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/enums/AccountsChartEnum.java 2010-07-28 18:53:39 UTC (rev 2988)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/enums/AccountsChartEnum.java 2010-07-29 12:51:43 UTC (rev 2989)
@@ -1,3 +1,21 @@
+/* *##% Lima Swing
+ * Copyright (C) 2008 - 2010 CodeLutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * ##%*/
+
package org.chorem.lima.enums;
public enum AccountsChartEnum {
Added: trunk/lima-swing/src/main/java/org/chorem/lima/enums/EncodingEnum.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/enums/EncodingEnum.java (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/enums/EncodingEnum.java 2010-07-29 12:51:43 UTC (rev 2989)
@@ -0,0 +1,63 @@
+/* *##% Lima Swing
+ * Copyright (C) 2008 - 2010 CodeLutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * ##%*/
+
+package org.chorem.lima.enums;
+
+public enum EncodingEnum {
+
+ UTF8("UTF-8", "UTF-8 Lima"), ISOLATIN1("ISO-8859-1", "ISO-Latin-1 Excel / Windows");
+
+ private final String encoding;
+ private final String description;
+
+ private EncodingEnum(String encoding, String description) {
+ this.encoding = encoding;
+ this.description = description;
+ }
+
+ public String getEncoding() {
+ return this.encoding;
+ }
+
+ public String getDescription(){
+ return this.description;
+ }
+
+ public static String[] descriptions(){
+ int nbElts = EncodingEnum.values().length;
+ String[] descriptions = new String[nbElts];
+ EncodingEnum[] encodingEnums = EncodingEnum.values();
+ for (int i = 0; i < nbElts; i++) {
+ descriptions[i] = encodingEnums[i].getDescription();
+ }
+ return descriptions;
+ }
+
+ public static EncodingEnum valueOfDescription(String description){
+ EncodingEnum value = null;
+
+ for (EncodingEnum encodingEnum : EncodingEnum.values()) {
+ if (description.equals(encodingEnum.description)){
+ value = encodingEnum;
+ break;
+ }
+ }
+ return value;
+ }
+
+}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/enums/EntryBooksChartEnum.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/enums/EntryBooksChartEnum.java 2010-07-28 18:53:39 UTC (rev 2988)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/enums/EntryBooksChartEnum.java 2010-07-29 12:51:43 UTC (rev 2989)
@@ -1,3 +1,21 @@
+/* *##% Lima Swing
+ * Copyright (C) 2008 - 2010 CodeLutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * ##%*/
+
package org.chorem.lima.enums;
public enum EntryBooksChartEnum {
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/enums/FinancialStatementsChartEnum.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/enums/FinancialStatementsChartEnum.java 2010-07-28 18:53:39 UTC (rev 2988)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/enums/FinancialStatementsChartEnum.java 2010-07-29 12:51:43 UTC (rev 2989)
@@ -1,3 +1,21 @@
+/* *##% Lima Swing
+ * Copyright (C) 2008 - 2010 CodeLutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * ##%*/
+
package org.chorem.lima.enums;
public enum FinancialStatementsChartEnum {
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/enums/ImportExportEnum.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/enums/ImportExportEnum.java 2010-07-28 18:53:39 UTC (rev 2988)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/enums/ImportExportEnum.java 2010-07-29 12:51:43 UTC (rev 2989)
@@ -1,3 +1,21 @@
+/* *##% Lima Swing
+ * Copyright (C) 2008 - 2010 CodeLutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * ##%*/
+
package org.chorem.lima.enums;
@@ -6,18 +24,32 @@
*
*/
public enum ImportExportEnum {
- LIMA_ALL_EXPORT(false), LIMA_ALL_IMPORT(true),
- LIMA_ACCOUNTCHARTS_EXPORT(false), LIMA_ENTRYBOOKS_EXPORT(false), LIMA_FINANCIALSTATEMENTS_EXPORT(false),
- LIMA_ACCOUNTCHARTS_IMPORT(true), LIMA_ENTRYBOOKS_IMPORT(true), LIMA_FINANCIALSTATEMENTS_IMPORT(true),
- EBP_ACCOUNTCHARTS_EXPORT(false), EBP_ENTRIES_EXPORT(false),
- EBP_ACCOUNTCHARTS_IMPORT(true), EBP_ENTRIES_IMPORT(true);
+ CSV_ALL_EXPORT(false, true), CSV_ALL_IMPORT(true, true),
+ CSV_ACCOUNTCHARTS_EXPORT(false, true), CSV_ENTRYBOOKS_EXPORT(false, true), CSV_FINANCIALSTATEMENTS_EXPORT(false, true),
+ CSV_ACCOUNTCHARTS_IMPORT(true, true), CSV_ENTRYBOOKS_IMPORT(true, true), CSV_FINANCIALSTATEMENTS_IMPORT(true, true),
+ EBP_ACCOUNTCHARTS_EXPORT(false, false), EBP_ENTRIES_EXPORT(false, false),
+ EBP_ACCOUNTCHARTS_IMPORT(true, false), EBP_ENTRIES_IMPORT(true, false);
private final Boolean importMode;
+ private final Boolean encodingOption;
- private ImportExportEnum(Boolean importMode) {
+ /**
+ * import mode :
+ * true if import, false if export
+ */
+ private ImportExportEnum(Boolean importMode, Boolean encodingOption) {
this.importMode = importMode;
+ this.encodingOption = encodingOption;
}
+ /**
+ * encoding choice
+ * true if import or export methode let encoding option
+ */
+ public Boolean getEncodingOption(){
+ return this.encodingOption;
+ }
+
public Boolean getImportMode() {
return this.importMode;
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainView.jaxx 2010-07-28 18:53:39 UTC (rev 2988)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainView.jaxx 2010-07-29 12:51:43 UTC (rev 2989)
@@ -85,16 +85,16 @@
<JMenu text="lima.menu.file">
<JMenu text="lima.importexport.lima">
<JMenu text="lima.importexport.import" actionIcon='import-element'>
- <JMenuItem text="lima.importexport.all" onActionPerformed='getHandler().showImportExportView(this, ImportExportEnum.LIMA_ALL_IMPORT)'/>
- <JMenuItem text="lima.importexport.accountcharts" onActionPerformed='getHandler().showImportExportView(this, ImportExportEnum.LIMA_ACCOUNTCHARTS_IMPORT)'/>
- <JMenuItem text="lima.importexport.entrybooks" onActionPerformed='getHandler().showImportExportView(this, ImportExportEnum.LIMA_ENTRYBOOKS_IMPORT)'/>
- <JMenuItem text="lima.importexport.financialstatements" onActionPerformed='getHandler().showImportExportView(this, ImportExportEnum.LIMA_FINANCIALSTATEMENTS_IMPORT)'/>
+ <JMenuItem text="lima.importexport.all" onActionPerformed='getHandler().showImportExportView(this, ImportExportEnum.CSV_ALL_IMPORT)'/>
+ <JMenuItem text="lima.importexport.accountcharts" onActionPerformed='getHandler().showImportExportView(this, ImportExportEnum.CSV_ACCOUNTCHARTS_IMPORT)'/>
+ <JMenuItem text="lima.importexport.entrybooks" onActionPerformed='getHandler().showImportExportView(this, ImportExportEnum.CSV_ENTRYBOOKS_IMPORT)'/>
+ <JMenuItem text="lima.importexport.financialstatements" onActionPerformed='getHandler().showImportExportView(this, ImportExportEnum.CSV_FINANCIALSTATEMENTS_IMPORT)'/>
</JMenu>
<JMenu text="lima.importexport.export" actionIcon='export-element'>
- <JMenuItem text="lima.importexport.all" onActionPerformed='getHandler().showImportExportView(this, ImportExportEnum.LIMA_ALL_EXPORT)'/>
- <JMenuItem text="lima.importexport.accountcharts" onActionPerformed='getHandler().showImportExportView(this, ImportExportEnum.LIMA_ACCOUNTCHARTS_EXPORT)'/>
- <JMenuItem text="lima.importexport.entrybooks" onActionPerformed='getHandler().showImportExportView(this, ImportExportEnum.LIMA_ENTRYBOOKS_EXPORT)'/>
- <JMenuItem text="lima.importexport.financialstatements" onActionPerformed='getHandler().showImportExportView(this, ImportExportEnum.LIMA_FINANCIALSTATEMENTS_EXPORT)'/>
+ <JMenuItem text="lima.importexport.all" onActionPerformed='getHandler().showImportExportView(this, ImportExportEnum.CSV_ALL_EXPORT)'/>
+ <JMenuItem text="lima.importexport.accountcharts" onActionPerformed='getHandler().showImportExportView(this, ImportExportEnum.CSV_ACCOUNTCHARTS_EXPORT)'/>
+ <JMenuItem text="lima.importexport.entrybooks" onActionPerformed='getHandler().showImportExportView(this, ImportExportEnum.CSV_ENTRYBOOKS_EXPORT)'/>
+ <JMenuItem text="lima.importexport.financialstatements" onActionPerformed='getHandler().showImportExportView(this, ImportExportEnum.CSV_FINANCIALSTATEMENTS_EXPORT)'/>
</JMenu>
</JMenu>
<JMenu text="lima.importexport.ebp">
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountViewHandler.java 2010-07-28 18:53:39 UTC (rev 2988)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountViewHandler.java 2010-07-29 12:51:43 UTC (rev 2989)
@@ -277,7 +277,7 @@
AccountsChartEnum defaultAccountsChartEnum =
(AccountsChartEnum) value;
ImportExport importExport = ImportExport.getInstance(view);
- importExport.importExport(ImportExportEnum.LIMA_ACCOUNTCHARTS_IMPORT,
+ importExport.importExport(ImportExportEnum.CSV_ACCOUNTCHARTS_IMPORT,
defaultAccountsChartEnum.getFilePath(), true);
}
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookViewHandler.java 2010-07-28 18:53:39 UTC (rev 2988)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookViewHandler.java 2010-07-29 12:51:43 UTC (rev 2989)
@@ -30,7 +30,6 @@
import org.chorem.lima.enums.EntryBooksChartEnum;
import org.chorem.lima.enums.ImportExportEnum;
import org.chorem.lima.service.LimaServiceFactory;
-import org.chorem.lima.ui.MainView;
import org.chorem.lima.ui.importexport.ImportExport;
import org.chorem.lima.util.DialogHelper;
import org.jdesktop.swingx.JXTable;
@@ -149,30 +148,21 @@
public void importEntryBooks(){
-
- try {
- if (entryBookService.getAllEntryBooks().size() == 0){
- EntryBookImportForm form =
- new EntryBookImportForm();
- form.setLocationRelativeTo(view);
- form.setVisible(true);
+ EntryBookImportForm form =
+ new EntryBookImportForm();
+ form.setLocationRelativeTo(view);
+ form.setVisible(true);
- Object value = form.getRadioButtons().getSelectedValue();
- // if action confirmed
- if (value != null){
- EntryBooksChartEnum defaultEntryBooksEnum =
- (EntryBooksChartEnum) value;
- ImportExport importExport = ImportExport.getInstance(view);
- importExport.importExport(ImportExportEnum.LIMA_ENTRYBOOKS_IMPORT,
- defaultEntryBooksEnum.getFilePath(), true);
- }
- }
- } catch (LimaException eee) {
- if (log.isErrorEnabled()) {
- log.error("Can't get default accounts chart", eee);
- }
- }
+ Object value = form.getRadioButtons().getSelectedValue();
+ // if action confirmed
+ if (value != null){
+ EntryBooksChartEnum defaultEntryBooksEnum =
+ (EntryBooksChartEnum) value;
+ ImportExport importExport = ImportExport.getInstance(view);
+ importExport.importExport(ImportExportEnum.CSV_ENTRYBOOKS_IMPORT,
+ defaultEntryBooksEnum.getFilePath(), true);
+ }
}
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartViewHandler.java 2010-07-28 18:53:39 UTC (rev 2988)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartViewHandler.java 2010-07-29 12:51:43 UTC (rev 2989)
@@ -23,7 +23,6 @@
import javax.swing.tree.TreePath;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.chorem.lima.beans.FinancialStatementImport;
import org.chorem.lima.business.FinancialStatementServiceMonitorable;
import org.chorem.lima.business.ImportServiceMonitorable;
import org.chorem.lima.business.LimaBusinessException;
@@ -34,7 +33,6 @@
import org.chorem.lima.enums.FinancialStatementsChartEnum;
import org.chorem.lima.enums.ImportExportEnum;
import org.chorem.lima.service.LimaServiceFactory;
-import org.chorem.lima.ui.MainView;
import org.chorem.lima.ui.financialstatementchart.FinancialStatementHeaderForm;
import org.chorem.lima.ui.financialstatementchart.FinancialStatementMovementForm;
import org.chorem.lima.ui.importexport.ImportExport;
@@ -277,30 +275,33 @@
}
public void importFinancialStatementChart(){
- try {
- if (financialStatementService.getAllFinancialStatements().size() == 0){
- FinancialStatementImportForm form =
- new FinancialStatementImportForm();
- form.setLocationRelativeTo(view);
- form.setVisible(true);
+ FinancialStatementImportForm form =
+ new FinancialStatementImportForm();
+ form.setLocationRelativeTo(view);
+ form.setVisible(true);
- Object value = form.getRadioButtons().getSelectedValue();
- // if action confirmed
- if (value != null){
- FinancialStatementsChartEnum defaultFinancialStatementsEnum =
- (FinancialStatementsChartEnum) value;
- ImportExport importExport = ImportExport.getInstance(view);
- importExport.importExport(ImportExportEnum.LIMA_FINANCIALSTATEMENTS_IMPORT,
- defaultFinancialStatementsEnum.getFilePath(), true);
+ Object value = form.getRadioButtons().getSelectedValue();
+ // if action confirmed
+ if (value != null){
+ if (form.getDeleteFinancialStatementChart().isSelected()){
+ try {
+ financialStatementService.removeAllFinancialStatement();
+
+ } catch (LimaException eee) {
+ if (log.isDebugEnabled()){
+ log.debug("Can't delete financial statement chart", eee);
+ }
}
- }
- } catch (LimaException eee) {
- if (log.isErrorEnabled()) {
- log.error("Can't get default accounts chart", eee);
- }
+ }
+ FinancialStatementsChartEnum defaultFinancialStatementsEnum =
+ (FinancialStatementsChartEnum) value;
+ ImportExport importExport = ImportExport.getInstance(view);
+ importExport.importExport(ImportExportEnum.CSV_FINANCIALSTATEMENTS_IMPORT,
+ defaultFinancialStatementsEnum.getFilePath(), true);
}
- }
+ }
+
@Override
public void notifyMethod(String serviceName, String methodName) {
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementImportForm.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementImportForm.jaxx 2010-07-28 18:53:39 UTC (rev 2988)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementImportForm.jaxx 2010-07-29 12:51:43 UTC (rev 2989)
@@ -59,6 +59,11 @@
</cell>
</row>
<row>
+ <cell>
+ <JCheckBox id='deleteFinancialStatementChart' text='lima.financialstatement.delete' selected='false'/>
+ </cell>
+ </row>
+ <row>
<cell>
<Table>
<row>
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java 2010-07-28 18:53:39 UTC (rev 2988)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java 2010-07-29 12:51:43 UTC (rev 2989)
@@ -20,8 +20,10 @@
package org.chorem.lima.ui.importexport;
import static org.nuiton.i18n.I18n._;
+import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
+import java.awt.Container;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
@@ -31,15 +33,17 @@
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.util.concurrent.ExecutionException;
+import javax.swing.JComboBox;
import javax.swing.JFileChooser;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
import javax.swing.SwingWorker;
-import javax.swing.text.StyledEditorKit.BoldAction;
-
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.business.ExportServiceMonitorable;
import org.chorem.lima.business.ImportServiceMonitorable;
import org.chorem.lima.business.LimaException;
+import org.chorem.lima.enums.EncodingEnum;
import org.chorem.lima.enums.ImportExportEnum;
import org.chorem.lima.service.LimaServiceFactory;
import org.chorem.lima.ui.account.AccountViewHandler;
@@ -54,6 +58,8 @@
private static final Log log = LogFactory.getLog(AccountViewHandler.class);
protected static Component viewComponent;
+
+ protected EncodingEnum encodingEnum;
protected ImportServiceMonitorable importService;
@@ -87,71 +93,69 @@
*/
public void importExport(ImportExportEnum importExportMethode, String file, Boolean verbose){
final ImportExportEnum importExportMethodeF = importExportMethode;
+ encodingEnum = EncodingEnum.UTF8;
if (file.equals("")){
- file = chooseFile(importExportMethode.getImportMode());
+ file = chooseFile(importExportMethode.getImportMode(), importExportMethode);
+ log.debug(encodingEnum.getEncoding());
}
+ final EncodingEnum charset = encodingEnum;
final String filePath = file;
final Boolean verboseMode = verbose;
new SwingWorker<String,Void>() {
@Override protected String doInBackground() throws LimaException {
- String charset = "UTF-8";
String datas = "";
String result = "";
switch (importExportMethodeF) {
- case LIMA_ALL_EXPORT:
+ case CSV_ALL_EXPORT:
datas = exportService.exportAsCSV();
- createFile(filePath, charset, datas);
+ createFile(filePath, charset.getEncoding(), datas);
break;
- case LIMA_ACCOUNTCHARTS_EXPORT:
+ case CSV_ACCOUNTCHARTS_EXPORT:
datas = exportService.exportAccountsChartAsCSV();
- createFile(filePath, charset, datas);
+ createFile(filePath, charset.getEncoding(), datas);
break;
- case LIMA_ENTRYBOOKS_EXPORT:
+ case CSV_ENTRYBOOKS_EXPORT:
datas = exportService.exportEntryBookChartAsCSV();
- createFile(filePath, charset, datas);
+ createFile(filePath, charset.getEncoding(), datas);
break;
- case LIMA_FINANCIALSTATEMENTS_EXPORT:
+ case CSV_FINANCIALSTATEMENTS_EXPORT:
datas = exportService.exportFinancialStatementChartAsCSV();
- createFile(filePath, charset, datas);
+ createFile(filePath, charset.getEncoding(), datas);
break;
case EBP_ACCOUNTCHARTS_EXPORT:
//For windows ebp
- charset = "ISO-8859-1";
datas = exportService.exportAccountsAsEBP();
- createFile(filePath, charset, datas);
+ createFile(filePath, EncodingEnum.ISOLATIN1.getEncoding(), datas);
break;
case EBP_ENTRIES_EXPORT:
//For windows ebp
- charset = "ISO-8859-1";
datas = exportService.exportEntriesAsEBP();
- createFile(filePath, charset, datas);
+ createFile(filePath, EncodingEnum.ISOLATIN1.getEncoding(), datas);
break;
- case LIMA_ALL_IMPORT:
- datas = extractFile(filePath, charset);
+ case CSV_ALL_IMPORT:
+ datas = extractFile(filePath, charset.getEncoding());
result = importService.importAllAsCSV(datas);
break;
- case LIMA_ACCOUNTCHARTS_IMPORT:
- datas = extractFile(filePath, charset);
+ case CSV_ACCOUNTCHARTS_IMPORT:
+ datas = extractFile(filePath, charset.getEncoding());
result = importService.importAccountsChartAsCSV(datas);
break;
- case LIMA_ENTRYBOOKS_IMPORT:
- datas = extractFile(filePath, charset);
+ case CSV_ENTRYBOOKS_IMPORT:
+ datas = extractFile(filePath, charset.getEncoding());
result = importService.importEntryBooksChartAsCSV(datas);
break;
- case LIMA_FINANCIALSTATEMENTS_IMPORT:
- datas = extractFile(filePath, charset);
+ case CSV_FINANCIALSTATEMENTS_IMPORT:
+ datas = extractFile(filePath, charset.getEncoding());
result = importService.importFinancialStatementsChartAsCSV(datas);
break;
case EBP_ACCOUNTCHARTS_IMPORT:
//For windows ebp
- charset = "ISO-8859-1";
- datas = extractFile(filePath, charset);
+ datas = extractFile(filePath, EncodingEnum.ISOLATIN1.getEncoding());
result = importService.importAccountsChartFromEbp(datas);
break;
case EBP_ENTRIES_IMPORT:
//For windows ebp
- charset = "ISO-8859-1";
- datas = extractFile(filePath, charset);
+ datas = extractFile(filePath, EncodingEnum.ISOLATIN1.getEncoding());
result = importService.importEntriesFromEbp(datas);
break;
}
@@ -192,25 +196,37 @@
* @param importMode
* @return
*/
- public String chooseFile(Boolean importMode){
+ public String chooseFile(Boolean importMode, ImportExportEnum importExportMethode){
String filePath = "";
FileChooseView fileChooseView = new FileChooseView();
JFileChooser chooser = fileChooseView.getChooser();
-
+ //Encoding option
+
+ JComboBox comboBox = new JComboBox(EncodingEnum.descriptions());
+ if (importExportMethode.getEncodingOption()){
+ JPanel panel = new JPanel();
+ panel.setLayout(new BorderLayout());
+ panel.add(new JLabel(_("lima.importexport.choiceencoding")), BorderLayout.WEST);
+ panel.add(comboBox, BorderLayout.CENTER);
+ ((Container)chooser.getComponent(2)).add(panel, BorderLayout.SOUTH);
+ }
+
if (importMode){
chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
- if (chooser.showOpenDialog(viewComponent) == JFileChooser.APPROVE_OPTION) {
- filePath = chooser.getSelectedFile().getAbsolutePath();
- }
}
else {
chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
- if (chooser.showOpenDialog(viewComponent) == JFileChooser.APPROVE_OPTION) {
- filePath = chooser.getSelectedFile().getAbsolutePath();
- filePath = chooser.getSelectedFile().getAbsolutePath();
+ }
+ if (chooser.showOpenDialog(viewComponent) == JFileChooser.APPROVE_OPTION) {
+ filePath = chooser.getSelectedFile().getAbsolutePath();
+
+ if (importExportMethode.getEncodingOption()){
+ encodingEnum = EncodingEnum.valueOfDescription((String) comboBox.getSelectedItem());
}
- }
- log.debug(filePath);
+ log.debug(encodingEnum.getEncoding());
+ log.debug(filePath);
+ }
+
return filePath;
}
Added: trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExportFileChooser.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExportFileChooser.java (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExportFileChooser.java 2010-07-29 12:51:43 UTC (rev 2989)
@@ -0,0 +1,34 @@
+package org.chorem.lima.ui.importexport;
+
+import java.awt.BorderLayout;
+import java.awt.Component;
+
+import javax.swing.JPanel;
+
+public class ImportExportFileChooser extends JPanel {
+
+ private static final long serialVersionUID = 1L;
+
+ public ImportExportFileChooser() {
+
+ setLayout(new BorderLayout());
+ // il y a 4 composants dans le JFileChooser, on les retire un par un pour les replacer comme on le souhaite
+ Component navigationBar = getComponent(0);
+ remove(0);
+ // on retire un JPanel qui n'est pas utile
+ remove(0);
+ add(navigationBar, BorderLayout.NORTH);
+ Component panelFiles = getComponent(0);
+ remove(0);
+ add(panelFiles, BorderLayout.CENTER);
+ Component buttons = getComponent(0);
+ remove(0);
+ add(buttons, BorderLayout.SOUTH);
+
+ //this.add(panelFileChooser);
+ //this.add(panelOptions, BorderLayout.SOUTH);
+
+ }
+
+
+}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/OpeningViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/OpeningViewHandler.java 2010-07-28 18:53:39 UTC (rev 2988)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/OpeningViewHandler.java 2010-07-29 12:51:43 UTC (rev 2989)
@@ -104,22 +104,22 @@
break;
default:
- importExport.importExport(ImportExportEnum.LIMA_ACCOUNTCHARTS_IMPORT,
+ importExport.importExport(ImportExportEnum.CSV_ACCOUNTCHARTS_IMPORT,
defaultAccountsChartEnum.getFilePath(), false);
break;
}
//Import financialstatement
switch (defaultAccountsChartEnum) {
case SHORTENED:
- importExport.importExport(ImportExportEnum.LIMA_FINANCIALSTATEMENTS_IMPORT,
+ importExport.importExport(ImportExportEnum.CSV_FINANCIALSTATEMENTS_IMPORT,
FinancialStatementsChartEnum.SHORTENED.getFilePath(), false);
break;
case DEVELOPED:
- importExport.importExport(ImportExportEnum.LIMA_FINANCIALSTATEMENTS_IMPORT,
+ importExport.importExport(ImportExportEnum.CSV_FINANCIALSTATEMENTS_IMPORT,
FinancialStatementsChartEnum.DEVELOPED.getFilePath(), false);
break;
default:
- importExport.importExport(ImportExportEnum.LIMA_FINANCIALSTATEMENTS_IMPORT,
+ importExport.importExport(ImportExportEnum.CSV_FINANCIALSTATEMENTS_IMPORT,
FinancialStatementsChartEnum.BASE.getFilePath(), false);
break;
}
@@ -134,7 +134,7 @@
case 3 :
if (ebPanel.getImportEntryBook().isSelected()){
- importExport.importExport(ImportExportEnum.LIMA_ENTRYBOOKS_IMPORT,
+ importExport.importExport(ImportExportEnum.CSV_ENTRYBOOKS_IMPORT,
EntryBooksChartEnum.DEFAULT.getFilePath(), false);
}
view.getEntrybooksIcon().setBorder(noBorder);
Modified: trunk/lima-swing/src/main/resources/i18n/lima-swing-en_GB.properties
===================================================================
--- trunk/lima-swing/src/main/resources/i18n/lima-swing-en_GB.properties 2010-07-28 18:53:39 UTC (rev 2988)
+++ trunk/lima-swing/src/main/resources/i18n/lima-swing-en_GB.properties 2010-07-29 12:51:43 UTC (rev 2989)
@@ -93,6 +93,7 @@
lima.financialstatement.accounts=
lima.financialstatement.creditaccounts=
lima.financialstatement.debitaccounts=
+lima.financialstatement.delete=
lima.financialstatement.formula=
lima.financialstatement.header.add=
lima.financialstatement.headeramount=
@@ -123,6 +124,7 @@
lima.import.journal=Import journal
lima.importexport.accountcharts=
lima.importexport.all=
+lima.importexport.choiceencoding=
lima.importexport.ebp=
lima.importexport.entries=
lima.importexport.entrybooks=
Modified: trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties
===================================================================
--- trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties 2010-07-28 18:53:39 UTC (rev 2988)
+++ trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties 2010-07-29 12:51:43 UTC (rev 2989)
@@ -90,6 +90,7 @@
lima.financialstatement.accounts=Liste de comptes au cr\u00E9dit et au d\u00E9bit
lima.financialstatement.creditaccounts=Liste de comptes au cr\u00E9dit
lima.financialstatement.debitaccounts=Liste de comptes au d\u00E9bit
+lima.financialstatement.delete=Supprimer le plan BCR actuel avant d'importer
lima.financialstatement.formula=Formule de compte, ex \: '7'-'6'+'510-520'
lima.financialstatement.header.add=Ajouter une cat\u00E9gorie
lima.financialstatement.headeramount=Calculer le total en en-tete
@@ -115,6 +116,7 @@
lima.import.journal=
lima.importexport.accountcharts=Plan des comptes
lima.importexport.all=Tout
+lima.importexport.choiceencoding=Choisir encodage \:
lima.importexport.ebp=Import/Export EBP
lima.importexport.entries=\u00C9critures
lima.importexport.entrybooks=Journaux
1
0
Author: jpepin
Date: 2010-07-28 20:53:39 +0200 (Wed, 28 Jul 2010)
New Revision: 2988
Url: http://chorem.org/repositories/revision/lima/2988
Log:
Ajout d'un assistant au d?\195?\169marrage pour la premi?\195?\168re ouverture de LIMA : cr?\195?\169ation fiche d'identit?\195?\169, comptes, journaux, exercice.
Added:
trunk/lima-swing/src/main/java/org/chorem/lima/enums/
trunk/lima-swing/src/main/java/org/chorem/lima/enums/AccountsChartEnum.java
trunk/lima-swing/src/main/java/org/chorem/lima/enums/EntryBooksChartEnum.java
trunk/lima-swing/src/main/java/org/chorem/lima/enums/FinancialStatementsChartEnum.java
trunk/lima-swing/src/main/java/org/chorem/lima/enums/ImportExportEnum.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountImportForm.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/FinancialStatementImportForm.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/
trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/CreateAccountsPanel.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/CreateEntryBookPanel.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/CreateFiscalPeriodPanel.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/CreateIdentityPanel.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/OpeningView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/OpeningViewHandler.java
trunk/lima-swing/src/main/resources/images/identity.png
trunk/lima-swing/src/main/resources/import/eb_default.csv
Removed:
trunk/lima-swing/src/main/java/org/chorem/lima/enumeration/
trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/DefaultAccountsChartEnum.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/DefaultAccountsChartForm.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/DefaultEntryBooksEnum.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/DefaultEntryBooksForm.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/DefaultFinancialStatementChartForm.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/DefaultFinancialStatementsEnum.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExportEnum.java
Modified:
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FiscalPeriodServiceImpl.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/MainViewHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountViewHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookViewHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/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/fiscalperiod/AddPeriod.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/FiscalPeriodViewHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/identity/IdentityHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java
trunk/lima-swing/src/main/resources/i18n/lima-swing-en_GB.properties
trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FiscalPeriodServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FiscalPeriodServiceImpl.java 2010-07-28 09:02:22 UTC (rev 2987)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FiscalPeriodServiceImpl.java 2010-07-28 18:53:39 UTC (rev 2988)
@@ -20,9 +20,12 @@
package org.chorem.lima.business.ejb;
import static org.nuiton.i18n.I18n._;
+import java.util.Calendar;
+import java.util.Date;
import java.util.List;
import javax.ejb.EJB;
import javax.ejb.Stateless;
+import org.apache.commons.lang.time.DateUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.business.AccountingRules;
@@ -79,6 +82,16 @@
public void createFiscalPeriodWithTransaction(FiscalPeriod fiscalPeriod, TopiaContext topiaContext) throws LimaException {
try {
+ Date beginDate = fiscalPeriod.getBeginDate();
+ beginDate = DateUtils.truncate(beginDate, Calendar.DATE);
+ Date endDate = fiscalPeriod.getEndDate();
+ endDate = DateUtils.addDays(endDate, 1);
+ endDate = DateUtils.truncate(endDate, Calendar.DATE);
+ endDate = DateUtils.addMilliseconds(endDate,-1);
+
+ fiscalPeriod.setBeginDate(beginDate);
+ fiscalPeriod.setEndDate(endDate);
+
//check rules before create the account
List<FinancialPeriod> financialPeriods =
accountingRules.createFiscalPeriodRules(fiscalPeriod, topiaContext);
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/LimaMain.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/LimaMain.java 2010-07-28 09:02:22 UTC (rev 2987)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/LimaMain.java 2010-07-28 18:53:39 UTC (rev 2988)
@@ -36,6 +36,8 @@
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;
@@ -137,7 +139,7 @@
}
}
- // init date converter
+ /* init date converter
Converter converter = ConverterUtil.getConverter(java.util.Date.class);
if (converter != null) {
ConvertUtils.deregister(java.util.Date.class);
@@ -148,7 +150,7 @@
if (log.isDebugEnabled()) {
log.debug("Context init done in " + (StringUtil.convertTime(t0, System.nanoTime())));
- }
+ }*/
return context;
}
@@ -167,37 +169,25 @@
// defaut display home view (not closeable, but might be !)
uiHandler.showHomeView(context);
- // put services into context (or not...)
- //context.setContextValue(LimaServiceFactory.getInstance().getAccountService());
- //context.setContextValue(LimaServiceFactory.getInstance().getAccountService());
-
- // TODO EC-20100409 load accounts and test if there is an account plan defined
+ // load accounts and test if there is an account plan defined
// if not, call #loadDefaultAccount()
splash.updateProgression(0.5, _("Loading accounting..."));
- //AccountService accountService = LimaServiceFactory.getInstance().getAccountService();
AccountService accountService =
LimaServiceFactory.getInstance().getService(
AccountServiceMonitorable.class);
- List<Account> account = accountService.getChildrenAccounts(null);
- if (CollectionUtils.isEmpty(account)) {
+
+ List<Account> accounts = accountService.getChildrenAccounts(null);
+ if (accounts.isEmpty()) {
if (log.isInfoEnabled()) {
- log.info("TODO : Propose for defaut account loading");
+ log.info("Propose for defaut account loading");
}
+ OpeningView openingView = new OpeningView();
+ openingView.setSize(800, 400);
+ openingView.setLocationRelativeTo(null);
+ openingView.setVisible(true);
}
-
- /*try {
- if (log.isInfoEnabled()) {
- log.info("Loading lima data...");
- }
- loadData(context);
- }
- catch (Exception eee) {
- if (log.isErrorEnabled()) {
- log.error("Error durring data loading", eee);
- }
- }*/
-
+
// show ui
SwingUtilities.invokeLater(new Runnable() {
@Override
@@ -205,6 +195,7 @@
ui.setVisible(true);
}
});
+
}
public static class ShutdownHook extends Thread {
@@ -234,41 +225,4 @@
}
}
}
-
- /**
- * This method ask for user to load a default account plan.
- *
- * @param accountRoot database accounts
- */
- public static void loadDefaultAccount(Account accountRoot) {
- if (log.isDebugEnabled()) {
- log.debug("Account root : " + accountRoot);
- }
- if (accountRoot.getSubAccounts().isEmpty()) {
- if (log.isDebugEnabled()) {
- log.debug("No existing accounts");
- }
-
- String[] response = {_("lima.response.yes"), _("lima.response.no")};
- int n = JOptionPane.showOptionDialog(null,
- _("lima.question.load.accounts"),
- _("lima.question"),
- JOptionPane.YES_NO_OPTION,
- JOptionPane.QUESTION_MESSAGE,
- null, //do not use a custom Icon
- response, //the titles of buttons
- response[1]); //default button title
- if (n == JOptionPane.YES_OPTION) {
- /*XMLImport imports = new XMLImport();
- URL urlFile = LimaMain.class.getResource("/import/default_pcg.xml");
- try {
- imports.importAccount(urlFile.openStream());
- } catch (IOException eee) {
- log.error("Erreur chargement du fichier 'default_pcg.xml'", eee);
- }*/
- } else {
- //LimaContext.getContext().getDataManager().resetAccountModel();
- }
- }
- }
}
Copied: trunk/lima-swing/src/main/java/org/chorem/lima/enums/AccountsChartEnum.java (from rev 2986, trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/DefaultAccountsChartEnum.java)
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/enums/AccountsChartEnum.java (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/enums/AccountsChartEnum.java 2010-07-28 18:53:39 UTC (rev 2988)
@@ -0,0 +1,20 @@
+package org.chorem.lima.enums;
+
+public enum AccountsChartEnum {
+
+ IMPORT(""), IMPORTEBP(""), SHORTENED("pcg_shortened.csv"), BASE("pcg_base.csv"), DEVELOPED("pcg_developed.csv");
+
+ private final String filePath;
+
+ private AccountsChartEnum(String filePath) {
+ this.filePath = filePath;
+ }
+
+ public String getFilePath() {
+ String result = "";
+ if (!this.filePath.equals("")){
+ result=getClass().getResource("/import/"+this.filePath).getPath();
+ }
+ return result;
+ }
+}
Copied: trunk/lima-swing/src/main/java/org/chorem/lima/enums/EntryBooksChartEnum.java (from rev 2986, trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/DefaultEntryBooksEnum.java)
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/enums/EntryBooksChartEnum.java (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/enums/EntryBooksChartEnum.java 2010-07-28 18:53:39 UTC (rev 2988)
@@ -0,0 +1,19 @@
+package org.chorem.lima.enums;
+
+public enum EntryBooksChartEnum {
+
+ IMPORT(""), DEFAULT("eb_default.csv");
+
+ private final String filePath;
+
+ private EntryBooksChartEnum(String filePath) {
+ this.filePath = filePath;
+ }
+
+ public String getFilePath() {
+ String result = "";
+ if (!this.filePath.equals("")){
+ result=getClass().getResource("/import/"+this.filePath).getPath();
+ }
+ return result; }
+}
Copied: trunk/lima-swing/src/main/java/org/chorem/lima/enums/FinancialStatementsChartEnum.java (from rev 2986, trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/DefaultFinancialStatementsEnum.java)
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/enums/FinancialStatementsChartEnum.java (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/enums/FinancialStatementsChartEnum.java 2010-07-28 18:53:39 UTC (rev 2988)
@@ -0,0 +1,21 @@
+package org.chorem.lima.enums;
+
+public enum FinancialStatementsChartEnum {
+
+ IMPORT(""), SHORTENED(""), BASE(""), DEVELOPED("");
+
+ private final String filePath;
+
+ private FinancialStatementsChartEnum(String filePath) {
+ this.filePath = filePath;
+
+ }
+
+ public String getFilePath() {
+ String result = "";
+ if (!this.filePath.equals("")){
+ result=getClass().getResource("/import/"+this.filePath).getPath();
+ }
+ return result;
+ }
+}
Copied: trunk/lima-swing/src/main/java/org/chorem/lima/enums/ImportExportEnum.java (from rev 2986, trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExportEnum.java)
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/enums/ImportExportEnum.java (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/enums/ImportExportEnum.java 2010-07-28 18:53:39 UTC (rev 2988)
@@ -0,0 +1,24 @@
+package org.chorem.lima.enums;
+
+
+/**
+ * Boolean importMode define if it's a import (true) or an export (false)
+ *
+ */
+public enum ImportExportEnum {
+ LIMA_ALL_EXPORT(false), LIMA_ALL_IMPORT(true),
+ LIMA_ACCOUNTCHARTS_EXPORT(false), LIMA_ENTRYBOOKS_EXPORT(false), LIMA_FINANCIALSTATEMENTS_EXPORT(false),
+ LIMA_ACCOUNTCHARTS_IMPORT(true), LIMA_ENTRYBOOKS_IMPORT(true), LIMA_FINANCIALSTATEMENTS_IMPORT(true),
+ EBP_ACCOUNTCHARTS_EXPORT(false), EBP_ENTRIES_EXPORT(false),
+ EBP_ACCOUNTCHARTS_IMPORT(true), EBP_ENTRIES_IMPORT(true);
+
+ private final Boolean importMode;
+
+ private ImportExportEnum(Boolean importMode) {
+ this.importMode = importMode;
+ }
+
+ public Boolean getImportMode() {
+ return this.importMode;
+ }
+}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainView.jaxx 2010-07-28 09:02:22 UTC (rev 2987)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainView.jaxx 2010-07-28 18:53:39 UTC (rev 2988)
@@ -20,11 +20,13 @@
undecorated='{getConfig().isFullScreen()}'
resizable="true" width="800" height="600"
extendedState='{this.MAXIMIZED_BOTH}'>
+
+
<script><![CDATA[
import java.util.Locale;
import org.chorem.lima.LimaConfig;
-import org.chorem.lima.ui.importexport.ImportExportEnum;
+import org.chorem.lima.enums.ImportExportEnum;
public LimaConfig getConfig() {
return getContextValue(LimaConfig.class);
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-07-28 09:02:22 UTC (rev 2987)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainViewHandler.java 2010-07-28 18:53:39 UTC (rev 2988)
@@ -31,7 +31,7 @@
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.LimaConfig;
import org.chorem.lima.LimaContext;
-import org.chorem.lima.entity.Identity;
+import org.chorem.lima.enums.ImportExportEnum;
import org.chorem.lima.ui.account.AccountView;
import org.chorem.lima.ui.accountsreports.AccountsReportsView;
import org.chorem.lima.ui.balance.BalanceView;
@@ -47,7 +47,6 @@
import org.chorem.lima.ui.home.HomeView;
import org.chorem.lima.ui.identity.IdentityForm;
import org.chorem.lima.ui.importexport.ImportExport;
-import org.chorem.lima.ui.importexport.ImportExportEnum;
import org.chorem.lima.ui.ledger.LedgerView;
import org.chorem.lima.util.ErrorHelper;
@@ -299,7 +298,6 @@
MainView mainView = getUI(rootContext);
AccountView accountView = new AccountView(mainView);
mainView.showTab(_("lima.charts.account"), accountView);
- accountView.getHandler().defaultAccountsChart(mainView);
}
/**
* Show account tree table view to create or modify accounts
@@ -312,7 +310,6 @@
MainView mainView = getUI(rootContext);
EntryBookView entryBookView= new EntryBookView(mainView);
mainView.showTab(_("lima.charts.entrybook"), entryBookView);
- entryBookView.getHandler().defaultEntryBooks(mainView);
}
/**
@@ -345,7 +342,6 @@
FinancialStatementChartView financialStatementView =
new FinancialStatementChartView(mainView);
mainView.showTab(_("lima.charts.financialstatement"), financialStatementView);
- financialStatementView.getHandler().defaultFinancialStatementChart(mainView);
}
/**
@@ -407,7 +403,7 @@
public void showImportExportView(JAXXContext rootContext, ImportExportEnum type) {
MainView mainView = getUI(rootContext);
ImportExport importExport = ImportExport.getInstance(mainView);
- importExport.importExport(type, "");
+ importExport.importExport(type, "", true);
}
public void showExportView(String type) {
Added: 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 (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountImportForm.jaxx 2010-07-28 18:53:39 UTC (rev 2988)
@@ -0,0 +1,82 @@
+<!-- ##% 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[
+ import org.chorem.lima.enums.AccountsChartEnum;
+ protected void performCancel() {
+ getRadioButtons().setSelectedValue(null);
+ dispose();
+ }
+ ]]>
+ </script>
+
+ <Table>
+ <row>
+ <cell><JLabel text='lima.opening.accounts' /></cell>
+ </row>
+ <row>
+ <cell>
+ <JRadioButton text='lima.charts.account.shortened' value='{AccountsChartEnum.SHORTENED}' buttonGroup="{getRadioButtons()}"
+ selected='true'/>
+ </cell>
+ </row>
+ <row>
+ <cell>
+ <JRadioButton text='lima.charts.account.base' value='{AccountsChartEnum.BASE}' buttonGroup="{getRadioButtons()}"
+ selected='true'/>
+ </cell>
+ </row>
+ <row>
+ <cell>
+ <JRadioButton text='lima.charts.account.developed' value='{AccountsChartEnum.DEVELOPED}' buttonGroup="{getRadioButtons()}"
+ selected='true'/>
+ </cell>
+ </row>
+ <row>
+ <cell>
+ <JRadioButton text='lima.importexport.importcsv' value='{AccountsChartEnum.IMPORT}' buttonGroup="{getRadioButtons()}"
+ selected='true'/>
+ </cell>
+ </row>
+ <row>
+ <cell>
+ <JRadioButton text='lima.importexport.importebp' value='{AccountsChartEnum.IMPORTEBP}' buttonGroup="{getRadioButtons()}"
+ selected='true'/>
+ </cell>
+ </row>
+ <row>
+ <cell>
+ <Table>
+ <row>
+ <cell fill="none">
+ <JButton text="lima.common.cancel" onActionPerformed="performCancel()"/>
+ </cell>
+ <cell fill="none">
+ <JButton text="lima.common.ok" onActionPerformed="dispose()"/>
+ </cell>
+ </row>
+ </Table>
+ </cell>
+ </row>
+ </Table>
+</JDialog>
\ No newline at end of file
Property changes on: trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountImportForm.jaxx
___________________________________________________________________
Added: svn:executable
+ *
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountView.jaxx 2010-07-28 09:02:22 UTC (rev 2987)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountView.jaxx 2010-07-28 18:53:39 UTC (rev 2988)
@@ -64,4 +64,10 @@
enabled="{isSelectedRow()}"/>
</cell>
</row>
+ <row>
+ <cell fill="horizontal">
+ <JButton id="importButton" text="lima.importexport.import"
+ onActionPerformed="getHandler().importAccountsChart()"/>
+ </cell>
+ </row>
</Table>
\ No newline at end of file
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountViewHandler.java 2010-07-28 09:02:22 UTC (rev 2987)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountViewHandler.java 2010-07-28 18:53:39 UTC (rev 2988)
@@ -23,20 +23,19 @@
import javax.swing.tree.TreePath;
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.LimaBusinessException;
import org.chorem.lima.business.LimaException;
import org.chorem.lima.business.ServiceListener;
import org.chorem.lima.entity.Account;
import org.chorem.lima.entity.AccountImpl;
+import org.chorem.lima.enums.AccountsChartEnum;
+import org.chorem.lima.enums.ImportExportEnum;
import org.chorem.lima.service.LimaServiceFactory;
-import org.chorem.lima.ui.MainView;
import org.chorem.lima.ui.account.AccountForm;
import org.chorem.lima.ui.account.AccountView;
import org.chorem.lima.ui.account.SubLedgerForm;
import org.chorem.lima.ui.importexport.ImportExport;
-import org.chorem.lima.ui.importexport.ImportExportEnum;
import org.chorem.lima.util.DialogHelper;
import org.chorem.lima.util.ErrorHelper;
import org.jdesktop.swingx.JXTreeTable;
@@ -57,14 +56,11 @@
protected AccountView view;
- protected AccountServiceMonitorable accountService;
+ //protected AccountServiceMonitorable accountService;
protected AccountViewHandler(AccountView view) {
this.view = view;
// Gets factory service
- accountService =
- LimaServiceFactory.getInstance().getService(
- AccountServiceMonitorable.class);
LimaServiceFactory.getInstance().getService(
ImportServiceMonitorable.class).addListener(this);
}
@@ -267,31 +263,23 @@
view.repaint();
}
- public void defaultAccountsChart(MainView mainView){
+ public void importAccountsChart(){
- try {
- if (accountService.getAllAccounts().size() == 0){
- DefaultAccountsChartForm form = new DefaultAccountsChartForm();
+ AccountImportForm form = new AccountImportForm();
//
- form.setLocationRelativeTo(mainView);
+ form.setLocationRelativeTo(view);
form.setVisible(true);
Object value = form.getRadioButtons().getSelectedValue();
// if action confirmed
if (value != null){
- DefaultAccountsChartEnum defaultAccountsChartEnum =
- (DefaultAccountsChartEnum) value;
+ AccountsChartEnum defaultAccountsChartEnum =
+ (AccountsChartEnum) value;
ImportExport importExport = ImportExport.getInstance(view);
importExport.importExport(ImportExportEnum.LIMA_ACCOUNTCHARTS_IMPORT,
- defaultAccountsChartEnum.getFilePath());
- }
- }
- } catch (LimaException eee) {
- if (log.isErrorEnabled()) {
- log.error("Can't get default accounts chart", eee);
- }
- }
+ defaultAccountsChartEnum.getFilePath(), true);
+ }
}
@Override
Deleted: trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/DefaultAccountsChartEnum.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/DefaultAccountsChartEnum.java 2010-07-28 09:02:22 UTC (rev 2987)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/DefaultAccountsChartEnum.java 2010-07-28 18:53:39 UTC (rev 2988)
@@ -1,20 +0,0 @@
-package org.chorem.lima.ui.account;
-
-public enum DefaultAccountsChartEnum {
-
- IMPORT(""), SHORTENED("pcg_shortened.csv"), BASE("pcg_base.csv"), DEVELOPED("pcg_developed.csv");
-
- private final String filePath;
-
- private DefaultAccountsChartEnum(String filePath) {
- this.filePath = filePath;
- }
-
- public String getFilePath() {
- String result = "";
- if (!this.filePath.equals("")){
- result=getClass().getResource("/import/"+this.filePath).getPath();
- }
- return result;
- }
-}
Deleted: trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/DefaultAccountsChartForm.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/DefaultAccountsChartForm.jaxx 2010-07-28 09:02:22 UTC (rev 2987)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/DefaultAccountsChartForm.jaxx 2010-07-28 18:53:39 UTC (rev 2988)
@@ -1,72 +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[
- import org.chorem.lima.ui.account.DefaultAccountsChartEnum;
- protected void performCancel() {
- getRadioButtons().setSelectedValue(null);
- dispose();
- }
- ]]>
- </script>
-
- <Table>
- <row>
- <cell><JLabel text='lima.charts.account.nothing' /></cell>
- </row>
- <row>
- <cell>
- <JRadioButton text='lima.charts.account.shortened' value='{DefaultAccountsChartEnum.SHORTENED}' buttonGroup="{getRadioButtons()}"
- selected='true'/>
- </cell>
- </row>
- <row>
- <cell>
- <JRadioButton text='lima.charts.account.base' value='{DefaultAccountsChartEnum.BASE}' buttonGroup="{getRadioButtons()}"
- selected='true'/>
- </cell>
- </row>
- <row>
- <cell>
- <JRadioButton text='lima.charts.account.developed' value='{DefaultAccountsChartEnum.DEVELOPED}' buttonGroup="{getRadioButtons()}"
- selected='true'/>
- </cell>
- </row>
- <row>
- <cell>
- <JRadioButton text='lima.importexport.import' value='{DefaultAccountsChartEnum.IMPORT}' buttonGroup="{getRadioButtons()}"
- selected='true'/>
- </cell>
- </row>
- <row>
- <cell fill="none">
- <JButton text="lima.common.ok" onActionPerformed="dispose()"/>
- </cell>
- </row>
- <row>
- <cell fill="none">
- <JButton text="lima.common.cancel" onActionPerformed="performCancel()"/>
- </cell>
- </row>
- </Table>
-</JDialog>
\ No newline at end of file
Deleted: trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/DefaultEntryBooksEnum.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/DefaultEntryBooksEnum.java 2010-07-28 09:02:22 UTC (rev 2987)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/DefaultEntryBooksEnum.java 2010-07-28 18:53:39 UTC (rev 2988)
@@ -1,19 +0,0 @@
-package org.chorem.lima.ui.entrybook;
-
-public enum DefaultEntryBooksEnum {
-
- IMPORT(""), DEFAULT("");
-
- private final String filePath;
-
- private DefaultEntryBooksEnum(String filePath) {
- this.filePath = filePath;
- }
-
- public String getFilePath() {
- String result = "";
- if (!this.filePath.equals("")){
- result=getClass().getResource("/import/"+this.filePath).getPath();
- }
- return result; }
-}
Deleted: trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/DefaultEntryBooksForm.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/DefaultEntryBooksForm.jaxx 2010-07-28 09:02:22 UTC (rev 2987)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/DefaultEntryBooksForm.jaxx 2010-07-28 18:53:39 UTC (rev 2988)
@@ -1,51 +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[
- import org.chorem.lima.ui.entrybook.DefaultEntryBooksEnum;
- protected void performCancel() {
- getRadioButtons().setSelectedValue(null);
- dispose();
- }
- ]]>
- </script>
-
- <Table>
- <row>
- <cell>
- <JRadioButton text='lima.charts.entrybook.default' value='{DefaultEntryBooksEnum.DEFAULT}' buttonGroup="{getRadioButtons()}"
- selected='true'/>
- </cell>
- <cell>
- <JRadioButton text='lima.charts.entrybook.import' value='{DefaultEntryBooksEnum.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
Copied: trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookImportForm.jaxx (from rev 2986, trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/DefaultEntryBooksForm.jaxx)
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookImportForm.jaxx (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookImportForm.jaxx 2010-07-28 18:53:39 UTC (rev 2988)
@@ -0,0 +1,59 @@
+<!-- ##% 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[
+ import org.chorem.lima.enums.EntryBooksChartEnum;
+ protected void performCancel() {
+ getRadioButtons().setSelectedValue(null);
+ dispose();
+ }
+ ]]>
+ </script>
+
+ <Table>
+ <row>
+ <cell>
+ <JRadioButton text='lima.charts.entrybook.default' value='{EntryBooksChartEnum.DEFAULT}' buttonGroup="{getRadioButtons()}"
+ selected='true'/>
+ </cell>
+ <cell>
+ <JRadioButton text='lima.charts.entrybook.import' value='{EntryBooksChartEnum.IMPORT}' buttonGroup="{getRadioButtons()}"
+ selected='true'/>
+ </cell>
+ </row>
+ <row>
+ <cell>
+ <Table>
+ <row>
+ <cell fill="none">
+ <JButton text="lima.common.cancel" onActionPerformed="performCancel()"/>
+ </cell>
+ <cell fill="none">
+ <JButton text="lima.common.ok" onActionPerformed="dispose()"/>
+ </cell>
+ </row>
+ </Table>
+ </cell>
+ </row>
+ </Table>
+</JDialog>
\ No newline at end of file
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookView.jaxx 2010-07-28 09:02:22 UTC (rev 2987)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookView.jaxx 2010-07-28 18:53:39 UTC (rev 2988)
@@ -58,4 +58,10 @@
onActionPerformed="getHandler().deleteEntryBook()"/>
</cell>
</row>
+ <row>
+ <cell fill="horizontal">
+ <JButton id="importButton" text="lima.importexport.import"
+ onActionPerformed="getHandler().importEntryBooks()"/>
+ </cell>
+ </row>
</Table>
\ No newline at end of file
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookViewHandler.java 2010-07-28 09:02:22 UTC (rev 2987)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookViewHandler.java 2010-07-28 18:53:39 UTC (rev 2988)
@@ -27,10 +27,11 @@
import org.chorem.lima.business.ejbinterface.EntryBookService;
import org.chorem.lima.entity.EntryBook;
import org.chorem.lima.entity.EntryBookImpl;
+import org.chorem.lima.enums.EntryBooksChartEnum;
+import org.chorem.lima.enums.ImportExportEnum;
import org.chorem.lima.service.LimaServiceFactory;
import org.chorem.lima.ui.MainView;
import org.chorem.lima.ui.importexport.ImportExport;
-import org.chorem.lima.ui.importexport.ImportExportEnum;
import org.chorem.lima.util.DialogHelper;
import org.jdesktop.swingx.JXTable;
@@ -147,24 +148,24 @@
}
- public void defaultEntryBooks(MainView mainView){
+ public void importEntryBooks(){
try {
if (entryBookService.getAllEntryBooks().size() == 0){
- DefaultEntryBooksForm form =
- new DefaultEntryBooksForm();
- form.setLocationRelativeTo(mainView);
+ EntryBookImportForm form =
+ new EntryBookImportForm();
+ form.setLocationRelativeTo(view);
form.setVisible(true);
Object value = form.getRadioButtons().getSelectedValue();
// if action confirmed
if (value != null){
- DefaultEntryBooksEnum defaultEntryBooksEnum =
- (DefaultEntryBooksEnum) value;
+ EntryBooksChartEnum defaultEntryBooksEnum =
+ (EntryBooksChartEnum) value;
ImportExport importExport = ImportExport.getInstance(view);
importExport.importExport(ImportExportEnum.LIMA_ENTRYBOOKS_IMPORT,
- defaultEntryBooksEnum.getFilePath());
+ defaultEntryBooksEnum.getFilePath(), true);
}
}
} catch (LimaException eee) {
Deleted: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/DefaultFinancialStatementChartForm.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/DefaultFinancialStatementChartForm.jaxx 2010-07-28 09:02:22 UTC (rev 2987)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/DefaultFinancialStatementChartForm.jaxx 2010-07-28 18:53:39 UTC (rev 2988)
@@ -1,72 +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[
- import org.chorem.lima.ui.financialstatementchart.DefaultFinancialStatementsEnum;
- protected void performCancel() {
- getRadioButtons().setSelectedValue(null);
- dispose();
- }
- ]]>
- </script>
-
- <Table>
- <row>
- <cell><JLabel text='lima.charts.financialstatement.nothing' /></cell>
- </row>
- <row>
- <cell>
- <JRadioButton text='lima.charts.financialstatement.shortened' value='{DefaultFinancialStatementsEnum.SHORTENED}' buttonGroup="{getRadioButtons()}"
- selected='true'/>
- </cell>
- </row>
- <row>
- <cell>
- <JRadioButton text='lima.charts.financialstatement.base' value='{DefaultFinancialStatementsEnum.BASE}' buttonGroup="{getRadioButtons()}"
- selected='true'/>
- </cell>
- </row>
- <row>
- <cell>
- <JRadioButton text='lima.charts.financialstatement.developed' value='{DefaultFinancialStatementsEnum.DEVELOPED}' buttonGroup="{getRadioButtons()}"
- selected='true'/>
- </cell>
- </row>
- <row>
- <cell>
- <JRadioButton text='lima.importexport.import' value='{DefaultFinancialStatementsEnum.IMPORT}' buttonGroup="{getRadioButtons()}"
- selected='true'/>
- </cell>
- </row>
- <row>
- <cell fill="none">
- <JButton text="lima.common.ok" onActionPerformed="dispose()"/>
- </cell>
- </row>
- <row>
- <cell fill="none">
- <JButton text="lima.common.cancel" onActionPerformed="performCancel()"/>
- </cell>
- </row>
- </Table>
-</JDialog>
\ No newline at end of file
Deleted: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/DefaultFinancialStatementsEnum.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/DefaultFinancialStatementsEnum.java 2010-07-28 09:02:22 UTC (rev 2987)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/DefaultFinancialStatementsEnum.java 2010-07-28 18:53:39 UTC (rev 2988)
@@ -1,21 +0,0 @@
-package org.chorem.lima.ui.financialstatementchart;
-
-public enum DefaultFinancialStatementsEnum {
-
- IMPORT(""), SHORTENED(""), BASE(""), DEVELOPED("");
-
- private final String filePath;
-
- private DefaultFinancialStatementsEnum(String filePath) {
- this.filePath = filePath;
-
- }
-
- public String getFilePath() {
- String result = "";
- if (!this.filePath.equals("")){
- result=getClass().getResource("/import/"+this.filePath).getPath();
- }
- return result;
- }
-}
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-07-28 09:02:22 UTC (rev 2987)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartView.jaxx 2010-07-28 18:53:39 UTC (rev 2988)
@@ -64,4 +64,10 @@
enabled="{isSelectedRow()}"/>
</cell>
</row>
+ <row>
+ <cell fill="horizontal">
+ <JButton id="importButton" text="lima.importexport.import"
+ onActionPerformed="getHandler().importFinancialStatementChart()"/>
+ </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-07-28 09:02:22 UTC (rev 2987)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartViewHandler.java 2010-07-28 18:53:39 UTC (rev 2988)
@@ -23,6 +23,7 @@
import javax.swing.tree.TreePath;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.chorem.lima.beans.FinancialStatementImport;
import org.chorem.lima.business.FinancialStatementServiceMonitorable;
import org.chorem.lima.business.ImportServiceMonitorable;
import org.chorem.lima.business.LimaBusinessException;
@@ -30,12 +31,13 @@
import org.chorem.lima.business.ServiceListener;
import org.chorem.lima.entity.FinancialStatement;
import org.chorem.lima.entity.FinancialStatementImpl;
+import org.chorem.lima.enums.FinancialStatementsChartEnum;
+import org.chorem.lima.enums.ImportExportEnum;
import org.chorem.lima.service.LimaServiceFactory;
import org.chorem.lima.ui.MainView;
import org.chorem.lima.ui.financialstatementchart.FinancialStatementHeaderForm;
import org.chorem.lima.ui.financialstatementchart.FinancialStatementMovementForm;
import org.chorem.lima.ui.importexport.ImportExport;
-import org.chorem.lima.ui.importexport.ImportExportEnum;
import org.chorem.lima.util.DialogHelper;
import org.chorem.lima.util.ErrorHelper;
import org.jdesktop.swingx.JXTreeTable;
@@ -274,22 +276,22 @@
view.repaint();
}
- public void defaultFinancialStatementChart(MainView mainView){
+ public void importFinancialStatementChart(){
try {
if (financialStatementService.getAllFinancialStatements().size() == 0){
- DefaultFinancialStatementChartForm form =
- new DefaultFinancialStatementChartForm();
- form.setLocationRelativeTo(mainView);
+ FinancialStatementImportForm form =
+ new FinancialStatementImportForm();
+ form.setLocationRelativeTo(view);
form.setVisible(true);
Object value = form.getRadioButtons().getSelectedValue();
// if action confirmed
if (value != null){
- DefaultFinancialStatementsEnum defaultFinancialStatementsEnum =
- (DefaultFinancialStatementsEnum) value;
+ FinancialStatementsChartEnum defaultFinancialStatementsEnum =
+ (FinancialStatementsChartEnum) value;
ImportExport importExport = ImportExport.getInstance(view);
importExport.importExport(ImportExportEnum.LIMA_FINANCIALSTATEMENTS_IMPORT,
- defaultFinancialStatementsEnum.getFilePath());
+ defaultFinancialStatementsEnum.getFilePath(), true);
}
}
} catch (LimaException eee) {
Copied: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementImportForm.jaxx (from rev 2986, trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/DefaultFinancialStatementChartForm.jaxx)
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementImportForm.jaxx (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementImportForm.jaxx 2010-07-28 18:53:39 UTC (rev 2988)
@@ -0,0 +1,76 @@
+<!-- ##% 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[
+ import org.chorem.lima.enums.FinancialStatementsChartEnum;
+ protected void performCancel() {
+ getRadioButtons().setSelectedValue(null);
+ dispose();
+ }
+ ]]>
+ </script>
+
+ <Table>
+ <row>
+ <cell><JLabel text='lima.charts.financialstatement.nothing' /></cell>
+ </row>
+ <row>
+ <cell>
+ <JRadioButton text='lima.charts.financialstatement.shortened' value='{FinancialStatementsChartEnum.SHORTENED}' buttonGroup="{getRadioButtons()}"
+ selected='true'/>
+ </cell>
+ </row>
+ <row>
+ <cell>
+ <JRadioButton text='lima.charts.financialstatement.base' value='{FinancialStatementsChartEnum.BASE}' buttonGroup="{getRadioButtons()}"
+ selected='true'/>
+ </cell>
+ </row>
+ <row>
+ <cell>
+ <JRadioButton text='lima.charts.financialstatement.developed' value='{FinancialStatementsChartEnum.DEVELOPED}' buttonGroup="{getRadioButtons()}"
+ selected='true'/>
+ </cell>
+ </row>
+ <row>
+ <cell>
+ <JRadioButton text='lima.importexport.import' value='{FinancialStatementsChartEnum.IMPORT}' buttonGroup="{getRadioButtons()}"
+ selected='true'/>
+ </cell>
+ </row>
+ <row>
+ <cell>
+ <Table>
+ <row>
+ <cell fill="none">
+ <JButton text="lima.common.cancel" onActionPerformed="performCancel()"/>
+ </cell>
+ <cell fill="none">
+ <JButton text="lima.common.ok" onActionPerformed="dispose()"/>
+ </cell>
+ </row>
+ </Table>
+ </cell>
+ </row>
+ </Table>
+</JDialog>
\ No newline at end of file
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-28 09:02:22 UTC (rev 2987)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/AddPeriod.jaxx 2010-07-28 18:53:39 UTC (rev 2988)
@@ -55,27 +55,14 @@
endDate = DateUtils.addDays(endDate, -1);
getEndDatePicker().setDate(endDate);
+
protected void performOk() {
if (period == null) {
// FIXME never ever use IMPL !!!
setPeriod(new FiscalPeriodImpl());
}
-
- // get begin date
- beginDate = beginDatePicker.getDate();
- // set begindate to 0:00.000
- beginDate = DateUtils.truncate(beginDate, Calendar.DATE);
-
- // get end date
- endDate = endDatePicker.getDate();
- //set time to max 23:59.999
- endDate = DateUtils.addDays(endDate, 1);
- endDate = DateUtils.truncate(endDate, Calendar.DATE);
- endDate = DateUtils.addMilliseconds(endDate,-1);
-
- getPeriod().setBeginDate(beginDate);
- getPeriod().setEndDate(endDate);
-
+ getPeriod().setBeginDate(beginDatePicker.getDate());
+ getPeriod().setEndDate(endDatePicker.getDate());
dispose();
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/FiscalPeriodViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/FiscalPeriodViewHandler.java 2010-07-28 09:02:22 UTC (rev 2987)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/FiscalPeriodViewHandler.java 2010-07-28 18:53:39 UTC (rev 2988)
@@ -60,7 +60,6 @@
addPeriodDialog.setVisible(true);
FiscalPeriod fiscalPeriod = addPeriodDialog.getPeriod();
- log.debug(fiscalPeriod);
// null = cancel
if (fiscalPeriod!= null) {
//check if fiscalperiod have 12 months, ask a confirmation
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/identity/IdentityHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/identity/IdentityHandler.java 2010-07-28 09:02:22 UTC (rev 2987)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/identity/IdentityHandler.java 2010-07-28 18:53:39 UTC (rev 2988)
@@ -30,7 +30,7 @@
public class IdentityHandler {
protected IdentityService identityService;
-
+
private static final Log log = LogFactory.getLog(IdentityHandler.class);
@@ -65,5 +65,4 @@
}
}
}
-
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java 2010-07-28 09:02:22 UTC (rev 2987)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java 2010-07-28 18:53:39 UTC (rev 2988)
@@ -33,11 +33,14 @@
import java.util.concurrent.ExecutionException;
import javax.swing.JFileChooser;
import javax.swing.SwingWorker;
+import javax.swing.text.StyledEditorKit.BoldAction;
+
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.business.ExportServiceMonitorable;
import org.chorem.lima.business.ImportServiceMonitorable;
import org.chorem.lima.business.LimaException;
+import org.chorem.lima.enums.ImportExportEnum;
import org.chorem.lima.service.LimaServiceFactory;
import org.chorem.lima.ui.account.AccountViewHandler;
import org.chorem.lima.util.DialogHelper;
@@ -82,12 +85,13 @@
* Call the appropriate methode in business service
* @param importExportMethode
*/
- public void importExport(ImportExportEnum importExportMethode, String file){
+ public void importExport(ImportExportEnum importExportMethode, String file, Boolean verbose){
final ImportExportEnum importExportMethodeF = importExportMethode;
if (file.equals("")){
file = chooseFile(importExportMethode.getImportMode());
}
final String filePath = file;
+ final Boolean verboseMode = verbose;
new SwingWorker<String,Void>() {
@Override protected String doInBackground() throws LimaException {
String charset = "UTF-8";
@@ -158,13 +162,15 @@
//hidde wait dialog panel
waitView.setVisible(false);
// display result dialog
- String result = get();
- if (!result.equals("")){
- DialogHelper.showReportDialog(result, _("lima.importexport.import"), viewComponent);
- }
- else {
- DialogHelper.showMessageDialog(_("lima.importexport.import.terminated"));
- }
+ if (verboseMode){
+ String result = get();
+ if (!result.equals("")){
+ DialogHelper.showReportDialog(result, _("lima.importexport.import"), viewComponent);
+ }
+ else {
+ DialogHelper.showMessageDialog(_("lima.importexport.import.terminated"));
+ }
+ }
} catch (InterruptedException eeeIE) {
if (log.isDebugEnabled()){
log.debug("Can't get result message", eeeIE);
Deleted: trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExportEnum.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExportEnum.java 2010-07-28 09:02:22 UTC (rev 2987)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExportEnum.java 2010-07-28 18:53:39 UTC (rev 2988)
@@ -1,24 +0,0 @@
-package org.chorem.lima.ui.importexport;
-
-
-/**
- * Boolean importMode define if it's a import (true) or an export (false)
- *
- */
-public enum ImportExportEnum {
- LIMA_ALL_EXPORT(false), LIMA_ALL_IMPORT(true),
- LIMA_ACCOUNTCHARTS_EXPORT(false), LIMA_ENTRYBOOKS_EXPORT(false), LIMA_FINANCIALSTATEMENTS_EXPORT(false),
- LIMA_ACCOUNTCHARTS_IMPORT(true), LIMA_ENTRYBOOKS_IMPORT(true), LIMA_FINANCIALSTATEMENTS_IMPORT(true),
- EBP_ACCOUNTCHARTS_EXPORT(false), EBP_ENTRIES_EXPORT(false),
- EBP_ACCOUNTCHARTS_IMPORT(true), EBP_ENTRIES_IMPORT(true);
-
- private final Boolean importMode;
-
- private ImportExportEnum(Boolean importMode) {
- this.importMode = importMode;
- }
-
- public Boolean getImportMode() {
- return this.importMode;
- }
-}
Added: trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/CreateAccountsPanel.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/CreateAccountsPanel.jaxx (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/CreateAccountsPanel.jaxx 2010-07-28 18:53:39 UTC (rev 2988)
@@ -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.
+ ##% -->
+
+<JPanel>
+ <jaxx.runtime.swing.JAXXButtonGroup id="radioButtons" javaBean='new JAXXButtonGroup()'/>
+
+
+ <script>
+ <![CDATA[
+ import org.chorem.lima.enums.AccountsChartEnum;
+ ]]>
+ </script>
+ <Table>
+ <row>
+ <cell><JLabel text='lima.opening.accounts' /></cell>
+ </row>
+ <row>
+ <cell>
+ <JRadioButton text='lima.charts.account.shortened' value='{AccountsChartEnum.SHORTENED}' buttonGroup="{getRadioButtons()}"
+ selected='true'/>
+ </cell>
+ </row>
+ <row>
+ <cell>
+ <JRadioButton text='lima.charts.account.base' value='{AccountsChartEnum.BASE}' buttonGroup="{getRadioButtons()}"
+ selected='true'/>
+ </cell>
+ </row>
+ <row>
+ <cell>
+ <JRadioButton text='lima.charts.account.developed' value='{AccountsChartEnum.DEVELOPED}' buttonGroup="{getRadioButtons()}"
+ selected='true'/>
+ </cell>
+ </row>
+ <row>
+ <cell>
+ <JRadioButton text='lima.importexport.importcsv' value='{AccountsChartEnum.IMPORT}' buttonGroup="{getRadioButtons()}"
+ selected='true'/>
+ </cell>
+ </row>
+ <row>
+ <cell>
+ <JRadioButton text='lima.importexport.importebp' value='{AccountsChartEnum.IMPORTEBP}' buttonGroup="{getRadioButtons()}"
+ selected='true'/>
+ </cell>
+ </row>
+ </Table>
+</JPanel>
\ No newline at end of file
Property changes on: trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/CreateAccountsPanel.jaxx
___________________________________________________________________
Added: svn:executable
+ *
Added: trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/CreateEntryBookPanel.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/CreateEntryBookPanel.jaxx (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/CreateEntryBookPanel.jaxx 2010-07-28 18:53:39 UTC (rev 2988)
@@ -0,0 +1,33 @@
+<!-- ##% 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.
+ ##% -->
+
+<JPanel>
+ <script>
+ <![CDATA[
+ ]]>
+ </script>
+ <Table>
+ <row>
+ <cell><JLabel text='lima.opening.entrybook' /></cell>
+ </row>
+ <row>
+ <cell>
+ <JCheckBox id='importEntryBook' text='lima.import.journal' selected='false'/>
+ </cell>
+ </row>
+ </Table>
+</JPanel>
\ No newline at end of file
Property changes on: trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/CreateEntryBookPanel.jaxx
___________________________________________________________________
Added: svn:executable
+ *
Added: trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/CreateFiscalPeriodPanel.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/CreateFiscalPeriodPanel.jaxx (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/CreateFiscalPeriodPanel.jaxx 2010-07-28 18:53:39 UTC (rev 2988)
@@ -0,0 +1,80 @@
+<!-- ##% 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.
+ ##% -->
+<JPanel>
+ <script>
+ <![CDATA[
+ import org.chorem.lima.entity.FiscalPeriod;
+ import org.chorem.lima.business.FiscalPeriodServiceMonitorable;
+ import org.chorem.lima.service.LimaServiceFactory;
+ import org.chorem.lima.business.LimaException;
+ import org.apache.commons.lang.time.DateUtils;
+
+ protected FiscalPeriodServiceMonitorable fiscalPeriodService =
+ LimaServiceFactory.getInstance().getService(
+ FiscalPeriodServiceMonitorable.class);
+
+ // set begin date picker
+ Date endDate = null;
+ Calendar calendarBegin = Calendar.getInstance();
+ // set begindate to JAN 1 - 0:00.000 of this years
+ Date beginDate = calendarBegin.getTime();
+ beginDate = DateUtils.truncate(beginDate, Calendar.DATE);
+ try {
+ FiscalPeriod result = fiscalPeriodService.getLastFiscalPeriod();
+ if (result != null){
+ beginDate = result.getEndDate();
+ }
+ }
+ catch (LimaException eee){
+ if(log.isDebugEnabled()){
+ log.debug("Can't get last fiscal period", eee);
+ }
+ }
+ beginDate = DateUtils.addDays(beginDate, 1);
+ getBeginDatePicker().setDate(beginDate);
+
+ // get end date
+ Calendar calendarEnd = Calendar.getInstance();
+ endDate = DateUtils.addYears(beginDate, 1);
+ endDate = DateUtils.addDays(endDate, -1);
+ getEndDatePicker().setDate(endDate);
+
+ ]]>
+ </script>
+
+ <Table fill="both">
+ <row>
+ <cell columns ="3">
+ <JLabel text="lima.period.create"/>
+ </cell>
+ </row>
+ <row>
+ <cell>
+ <JLabel text="lima.period.begindate"/>
+ </cell>
+ <cell>
+ <org.jdesktop.swingx.JXDatePicker id="beginDatePicker"/>
+ </cell>
+ <cell>
+ <JLabel text="lima.period.enddate"/>
+ </cell>
+ <cell>
+ <org.jdesktop.swingx.JXDatePicker id="endDatePicker"/>
+ </cell>
+ </row>
+ </Table>
+</JPanel>
\ No newline at end of file
Property changes on: trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/CreateFiscalPeriodPanel.jaxx
___________________________________________________________________
Added: svn:executable
+ *
Added: trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/CreateIdentityPanel.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/CreateIdentityPanel.jaxx (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/CreateIdentityPanel.jaxx 2010-07-28 18:53:39 UTC (rev 2988)
@@ -0,0 +1,139 @@
+<!-- ##% 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.
+ ##% -->
+
+<JPanel>
+ <org.chorem.lima.ui.identity.IdentityHandler id="handler" javaBean="new org.chorem.lima.ui.identity.IdentityHandler()" />
+ <org.chorem.lima.entity.Identity id="identity" javaBean='handler.getIdentity()'/>
+
+ <script>
+ <![CDATA[
+ ]]>
+ </script>
+<Table>
+ <row>
+ <cell fill="horizontal">
+ <JLabel text="lima.identity.name"/>
+ </cell>
+ <cell fill="horizontal">
+ <JTextField id="nameTextField" text="{getIdentity().getName()}"/>
+ <javax.swing.text.Document javaBean="getNameTextField().getDocument()"
+ onInsertUpdate='getIdentity().setName(getNameTextField().getText())'
+ onRemoveUpdate='getIdentity().setName(getNameTextField().getText())' />
+ </cell>
+ <cell fill="horizontal">
+ <JLabel text="lima.identity.description"/>
+ </cell>
+ <cell fill="horizontal">
+ <JTextField id="descriptionTextField" text="{getIdentity().getDescription()}"/>
+ <javax.swing.text.Document javaBean="getDescriptionTextField().getDocument()"
+ onInsertUpdate='getIdentity().setDescription(getDescriptionTextField().getText())'
+ onRemoveUpdate='getIdentity().setDescription(getDescriptionTextField().getText())' />
+ </cell>
+ </row>
+ <row>
+ <cell fill="horizontal">
+ <JLabel text="lima.identity.address"/>
+ </cell>
+ <cell fill="horizontal">
+ <JTextField id="addressTextField" text="{getIdentity().getAddress()}"/>
+ <javax.swing.text.Document javaBean="getAddressTextField().getDocument()"
+ onInsertUpdate='getIdentity().setAddress(getAddressTextField().getText())'
+ onRemoveUpdate='getIdentity().setAddress(getAddressTextField().getText())' />
+ </cell>
+ <cell fill="horizontal">
+ <JLabel text="lima.identity.address2"/>
+ </cell>
+ <cell fill="horizontal">
+ <JTextField id="address2TextField" text="{getIdentity().getAddress2()}"/>
+ <javax.swing.text.Document javaBean="getAddress2TextField().getDocument()"
+ onInsertUpdate='getIdentity().setAddress2(getAddress2TextField().getText())'
+ onRemoveUpdate='getIdentity().setAddress2(getAddress2TextField().getText())' />
+ </cell>
+ </row>
+ <row>
+ <cell fill="horizontal">
+ <JLabel text="lima.identity.zipCode"/>
+ </cell>
+ <cell fill="horizontal">
+ <JTextField id="zipCodeTextField" text="{getIdentity().getZipCode()}"/>
+ <javax.swing.text.Document javaBean="getZipCodeTextField().getDocument()"
+ onInsertUpdate='getIdentity().setZipCode(getZipCodeTextField().getText())'
+ onRemoveUpdate='getIdentity().setZipCode(getZipCodeTextField().getText())' />
+ </cell>
+ <cell fill="horizontal">
+ <JLabel text="lima.identity.city"/>
+ </cell>
+ <cell fill="horizontal">
+ <JTextField id="cityTextField" text="{getIdentity().getCity()}"/>
+ <javax.swing.text.Document javaBean="getCityTextField().getDocument()"
+ onInsertUpdate='getIdentity().setCity(getCityTextField().getText())'
+ onRemoveUpdate='getIdentity().setCity(getCityTextField().getText())' />
+ </cell>
+ </row>
+ <row>
+ <cell fill="horizontal">
+ <JLabel text="lima.identity.businessNumber"/>
+ </cell>
+ <cell fill="horizontal">
+ <JTextField id="businessNumberTextField" text="{getIdentity().getBusinessNumber()}"/>
+ <javax.swing.text.Document javaBean="getBusinessNumberTextField().getDocument()"
+ onInsertUpdate='getIdentity().setBusinessNumber(getBusinessNumberTextField().getText())'
+ onRemoveUpdate='getIdentity().setBusinessNumber(getBusinessNumberTextField().getText())' />
+ </cell>
+ <cell fill="horizontal">
+ <JLabel text="lima.identity.vatNumber"/>
+ </cell>
+ <cell fill="horizontal">
+ <JTextField id="vatNumberTextField" text="{getIdentity().getVatNumber()}"/>
+ <javax.swing.text.Document javaBean="getVatNumberTextField().getDocument()"
+ onInsertUpdate='getIdentity().setVatNumber(getVatNumberTextField().getText())'
+ onRemoveUpdate='getIdentity().setVatNumber(getVatNumberTextField().getText())' />
+ </cell>
+ </row>
+ <row>
+ <cell fill="horizontal">
+ <JLabel text="lima.identity.classificationCode"/>
+ </cell>
+ <cell fill="horizontal">
+ <JTextField id="classificationCodeTextField" text="{getIdentity().getClassificationCode()}"/>
+ <javax.swing.text.Document javaBean="getClassificationCodeTextField().getDocument()"
+ onInsertUpdate='getIdentity().setClassificationCode(getClassificationCodeTextField().getText())'
+ onRemoveUpdate='getIdentity().setClassificationCode(getClassificationCodeTextField().getText())' />
+ </cell>
+ </row>
+ <row>
+ <cell fill="horizontal">
+ <JLabel text="lima.identity.phoneNumber"/>
+ </cell>
+ <cell fill="horizontal">
+ <JTextField id="phoneNumberTextField" text="{getIdentity().getPhoneNumber()}"/>
+ <javax.swing.text.Document javaBean="getPhoneNumberTextField().getDocument()"
+ onInsertUpdate='getIdentity().setPhoneNumber(getPhoneNumberTextField().getText())'
+ onRemoveUpdate='getIdentity().setPhoneNumber(getPhoneNumberTextField().getText())' />
+ </cell>
+ <cell fill="horizontal">
+ <JLabel text="lima.identity.email"/>
+ </cell>
+ <cell fill="horizontal">
+ <JTextField id="emailTextField" text="{getIdentity().getEmail()}"/>
+ <javax.swing.text.Document javaBean="getEmailTextField().getDocument()"
+ onInsertUpdate='getIdentity().setEmail(getEmailTextField().getText())'
+ onRemoveUpdate='getIdentity().setEmail(getEmailTextField().getText())' />
+ </cell>
+ </row>
+ </Table>
+</JPanel>
\ No newline at end of file
Property changes on: trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/CreateIdentityPanel.jaxx
___________________________________________________________________
Added: svn:executable
+ *
Added: 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 (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/OpeningView.jaxx 2010-07-28 18:53:39 UTC (rev 2988)
@@ -0,0 +1,73 @@
+<!-- ##% 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">
+ <OpeningViewHandler id="handler" javaBean="new OpeningViewHandler(this)" />
+
+ <script>
+ <![CDATA[
+ import javax.swing.BorderFactory;
+ getRootPane().setDefaultButton(ok);
+ protected void performNext() {
+ dispose();
+ }
+ protected void performCancel() {
+ dispose();
+ }
+ ]]>
+ </script>
+
+ <Table>
+ <row weighty="0.9">
+ <cell columns="3" fill="both">
+ <Table>
+ <row>
+ <cell weightx="0.1"><JLabel id='identityIcon'
+ icon='{new ImageIcon(getClass().getResource("/images/identity.png"))}'/></cell>
+ <cell weightx="0.9" rows="4" fill="both">
+ <JPanel id='panel'>
+ <JLabel text='lima.opening.welcome' />
+ </JPanel>
+ </cell>
+ </row>
+ <row>
+ <cell><JLabel id='accountsIcon'
+ icon='{new ImageIcon(getClass().getResource("/images/accounts.png"))}'/></cell>
+ </row>
+ <row>
+ <cell><JLabel id='entrybooksIcon'
+ icon='{new ImageIcon(getClass().getResource("/images/entrybooks.png"))}'/></cell>
+ </row>
+ <row>
+ <cell><JLabel id='fiscalperiodsIcon'
+ icon='{new ImageIcon(getClass().getResource("/images/fiscalperiods.png"))}'/></cell>
+ </row>
+ </Table>
+ </cell>
+ </row>
+ <row weighty="0.1">
+ <cell weightx="0.8"><JLabel text=''/>
+ </cell>
+ <cell weightx="0.1" fill="none">
+ <JButton text="lima.common.cancel" onActionPerformed="performCancel()"/>
+ </cell>
+ <cell weightx="0.1" fill="none">
+ <JButton id="ok" text="lima.common.next" onActionPerformed="handler.next()"/>
+ </cell>
+ </row>
+ </Table>
+</JDialog>
\ No newline at end of file
Property changes on: trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/OpeningView.jaxx
___________________________________________________________________
Added: svn:executable
+ *
Added: 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 (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/OpeningViewHandler.java 2010-07-28 18:53:39 UTC (rev 2988)
@@ -0,0 +1,168 @@
+package org.chorem.lima.ui.opening;
+/* *##% 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.
+ * ##%*/
+
+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;
+import org.chorem.lima.business.LimaException;
+import org.chorem.lima.entity.FiscalPeriod;
+import org.chorem.lima.entity.FiscalPeriodImpl;
+import org.chorem.lima.enums.AccountsChartEnum;
+import org.chorem.lima.enums.EntryBooksChartEnum;
+import org.chorem.lima.enums.FinancialStatementsChartEnum;
+import org.chorem.lima.enums.ImportExportEnum;
+import org.chorem.lima.service.LimaServiceFactory;
+import org.chorem.lima.ui.identity.IdentityHandler;
+import org.chorem.lima.ui.importexport.ImportExport;
+
+public class OpeningViewHandler {
+
+ private static final Log log = LogFactory.getLog(OpeningViewHandler.class);
+
+ private static Border noBorder = new EmptyBorder(0,0,0,0);
+ private static Color green = new Color(0x66, 0xcc, 0x00);
+
+ protected int step;
+ protected OpeningView view;
+
+ //Panels
+ private CreateAccountsPanel caPanel;
+ private CreateIdentityPanel idPanel;
+ private CreateEntryBookPanel ebPanel;
+ private CreateFiscalPeriodPanel fsPanel;
+
+ public OpeningViewHandler(OpeningView view) {
+ this.view = view;
+ caPanel = new CreateAccountsPanel();
+ idPanel = new CreateIdentityPanel();
+ ebPanel = new CreateEntryBookPanel();
+ fsPanel = new CreateFiscalPeriodPanel();
+ step = 0;
+ }
+
+ public void next(){
+ ImportExport importExport = ImportExport.getInstance(view);
+ JPanel panel = view.getPanel();
+ panel.removeAll();
+ switch (step) {
+ case 0:
+ //refresh UI
+ view.getIdentityIcon().setBorder(BorderFactory.createLineBorder(green, 2));
+ panel.add(idPanel);
+ panel.validate();
+ view.repaint();
+ step++;
+ break;
+ case 1:
+ IdentityHandler identityHandler = new IdentityHandler();
+ identityHandler.updateIdentity(idPanel.getIdentity());
+ //refresh UI
+ view.getIdentityIcon().setBorder(noBorder);
+ view.getAccountsIcon().setBorder(BorderFactory.createLineBorder(green, 2));
+ panel.add(caPanel);
+ panel.validate();
+ view.repaint();
+ step++;
+ break;
+
+ case 2 :
+ Object value = caPanel.getRadioButtons().getSelectedValue();
+ // if action confirmed
+ if (value != null){
+ AccountsChartEnum defaultAccountsChartEnum =
+ (AccountsChartEnum) value;
+ //Import accounts chart
+ switch (defaultAccountsChartEnum) {
+ case IMPORTEBP:
+ importExport.importExport(ImportExportEnum.EBP_ACCOUNTCHARTS_IMPORT,
+ defaultAccountsChartEnum.getFilePath(), false);
+ break;
+
+ default:
+ importExport.importExport(ImportExportEnum.LIMA_ACCOUNTCHARTS_IMPORT,
+ defaultAccountsChartEnum.getFilePath(), false);
+ break;
+ }
+ //Import financialstatement
+ switch (defaultAccountsChartEnum) {
+ case SHORTENED:
+ importExport.importExport(ImportExportEnum.LIMA_FINANCIALSTATEMENTS_IMPORT,
+ FinancialStatementsChartEnum.SHORTENED.getFilePath(), false);
+ break;
+ case DEVELOPED:
+ importExport.importExport(ImportExportEnum.LIMA_FINANCIALSTATEMENTS_IMPORT,
+ FinancialStatementsChartEnum.DEVELOPED.getFilePath(), false);
+ break;
+ default:
+ importExport.importExport(ImportExportEnum.LIMA_FINANCIALSTATEMENTS_IMPORT,
+ FinancialStatementsChartEnum.BASE.getFilePath(), false);
+ break;
+ }
+ }
+ view.getAccountsIcon().setBorder(noBorder);
+ view.getEntrybooksIcon().setBorder(BorderFactory.createLineBorder(green, 2));
+ panel.add(ebPanel);
+ panel.validate();
+ view.repaint();
+ step++;
+ break;
+
+ case 3 :
+ if (ebPanel.getImportEntryBook().isSelected()){
+ importExport.importExport(ImportExportEnum.LIMA_ENTRYBOOKS_IMPORT,
+ EntryBooksChartEnum.DEFAULT.getFilePath(), false);
+ }
+ view.getEntrybooksIcon().setBorder(noBorder);
+ view.getFiscalperiodsIcon().setBorder(BorderFactory.createLineBorder(green, 2));
+ panel.add(fsPanel);
+ panel.validate();
+ view.getOk().setText(_("lima.common.fin"));
+ view.repaint();
+ step++;
+ break;
+ case 4 :
+ try {
+ FiscalPeriod fiscalPeriod = new FiscalPeriodImpl();
+ fiscalPeriod.setBeginDate(fsPanel.getBeginDatePicker().getDate());
+ fiscalPeriod.setEndDate(fsPanel.getEndDatePicker().getDate());
+
+ LimaServiceFactory.getInstance().getService(
+ FiscalPeriodServiceMonitorable.class).
+ createFiscalPeriod(fiscalPeriod);
+
+ } catch (LimaException e) {
+ if (log.isDebugEnabled()){
+ log.debug("Can't create fiscal period");
+ }
+ }
+ view.dispose();
+ }
+ }
+
+
+}
Modified: trunk/lima-swing/src/main/resources/i18n/lima-swing-en_GB.properties
===================================================================
--- trunk/lima-swing/src/main/resources/i18n/lima-swing-en_GB.properties 2010-07-28 09:02:22 UTC (rev 2987)
+++ trunk/lima-swing/src/main/resources/i18n/lima-swing-en_GB.properties 2010-07-28 18:53:39 UTC (rev 2988)
@@ -4,6 +4,7 @@
Global\ lima\ exception=
LIMA=
Loading\ accounting...=
+blabla=
export=
hello\ world=
import=
@@ -43,7 +44,10 @@
lima.common.add=
lima.common.addSubLedger=
lima.common.cancel=
+lima.common.fin=
+lima.common.import=
lima.common.importexport=Import/Export
+lima.common.next=
lima.common.ok=
lima.common.print=
lima.common.quit=
@@ -126,6 +130,8 @@
lima.importexport.financialstatements=
lima.importexport.import=Import
lima.importexport.import.terminated=
+lima.importexport.importcsv=
+lima.importexport.importebp=
lima.importexport.lima=
lima.importexport.wait=
lima.init.closed=Lima closed at %1$s
@@ -151,7 +157,11 @@
lima.misc.supportemail.description=
lima.open=Open
lima.openejb.remotemode.description=
+lima.opening.accounts=
+lima.opening.entrybook=
+lima.opening.welcome=
lima.period.begindate=
+lima.period.create=
lima.period.enddate=
lima.preferences=Preferences
lima.question=Question
@@ -209,6 +219,7 @@
lima.transaction.period=Period
lima.voucher=Voucher
lima.warning.nimbus.landf=Could not find Numbus Look&Feel
+lima.welcome=
limahome.chartaccounts.create=
limahome.chartaccounts.modify=
limahome.chartaccounts.nothing=
Modified: trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties
===================================================================
--- trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties 2010-07-28 09:02:22 UTC (rev 2987)
+++ trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties 2010-07-28 18:53:39 UTC (rev 2988)
@@ -4,9 +4,9 @@
Global\ lima\ exception=
LIMA=
Loading\ accounting...=
+blabla=
export=
hello\ world=
-import=
lima.about.message=\u00C0 propos de Lima
lima.account=Compte
lima.account.label=
@@ -27,7 +27,6 @@
lima.charts.account=Plan comptable
lima.charts.account.base=Plan comptable de base
lima.charts.account.developed=Plan comptable d\u00E9velopp\u00E9
-lima.charts.account.nothing=<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.charts.account.shortened=Plan comptable abr\u00E9g\u00E9
lima.charts.entrybook=Journaux
lima.charts.entrybook.default=Journaux par d\u00E9fault
@@ -43,7 +42,9 @@
lima.common.add=Ajout Compte G\u00E9n\u00E9ral
lima.common.addSubLedger=Ajouter Compte Tiers
lima.common.cancel=Annuler
+lima.common.fin=Termin\u00E9
lima.common.importexport=Importer/Exporter
+lima.common.next=Suivant
lima.common.ok=OK
lima.common.print=
lima.common.quit=Quitter
@@ -111,12 +112,7 @@
lima.identity.phoneNumber=n\u00B0 Tel
lima.identity.vatNumber=n\u00B0 TVA
lima.identity.zipCode=Code Postal
-lima.import=Import
-lima.import.account=Importer le PCG
-lima.import.all=Importer une nouvelle base (XML)
-lima.import.all.csv=Importer une nouvelle base (CSV)
-lima.import.all.csv.ebp=Importer des donn\u00E9es de EBP
-lima.import.journal=Importer le journal
+lima.import.journal=
lima.importexport.accountcharts=Plan des comptes
lima.importexport.all=Tout
lima.importexport.ebp=Import/Export EBP
@@ -126,6 +122,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.lima=Import/Export Lima
lima.importexport.wait=Traitement en cours \u2026
lima.init.closed=Lima ferm\u00E9 \u00E0 %1$s
@@ -151,7 +149,11 @@
lima.misc.supportemail.description=
lima.open=Ouvert
lima.openejb.remotemode.description=
+lima.opening.accounts=<html><center>Aucun plan comptable charg\u00E9<br/>Veuillez s\u00E9lectionner un plan par d\u00E9fault, <br/>importer un plan personnalis\u00E9<br/> ou annuler pour cr\u00E9er votre propre plan.</center></html>
+lima.opening.entrybook=<html>Cochez la case pour importer les journaux par d\u00E9faut \:<br/> Achats, Ventes, Tr\u00E9sorerie, Op\u00E9ration diverses</html>
+lima.opening.welcome=<html><center>Bienvenue dans Lima<br/>Laissez vous guider par cet assistant pour d\u00E9marrer votre comptabilit\u00E9 en quelques instants\u0085</center></html>
lima.period.begindate=D\u00E9but
+lima.period.create=Choisissez la date de d\u00E9but et de fin du nouvel exercice
lima.period.enddate=Fin
lima.preferences=Pr\u00E9f\u00E9rences
lima.question=Question
Added: trunk/lima-swing/src/main/resources/images/identity.png
===================================================================
(Binary files differ)
Property changes on: trunk/lima-swing/src/main/resources/images/identity.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/lima-swing/src/main/resources/import/eb_default.csv
===================================================================
--- trunk/lima-swing/src/main/resources/import/eb_default.csv (rev 0)
+++ trunk/lima-swing/src/main/resources/import/eb_default.csv 2010-07-28 18:53:39 UTC (rev 2988)
@@ -0,0 +1,4 @@
+"ENBK";"ACH";"Journal des achats";"Achats"
+"ENBK";"VTE";"Journal des ventes";"Ventes"
+"ENBK";"ODT";"Journal des opérations diverses";"Général"
+"ENBK";"BQE";"Journal de trésorerie";"Trésorerie"
1
0
r2987 - in trunk: lima-business/src/main/java/org/chorem/lima/business/ejb lima-swing/src/main/java/org/chorem/lima/service
by jpepin@users.chorem.org 28 Jul '10
by jpepin@users.chorem.org 28 Jul '10
28 Jul '10
Author: jpepin
Date: 2010-07-28 11:02:22 +0200 (Wed, 28 Jul 2010)
New Revision: 2987
Url: http://chorem.org/repositories/revision/lima/2987
Log:
Debug export financial statement, fichi?\195?\169 tri?\195?\169 en ordre
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/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-swing/src/main/java/org/chorem/lima/service/LimaServiceFactory.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-07-26 16:32:09 UTC (rev 2986)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/DocumentServiceImpl.java 2010-07-28 09:02:22 UTC (rev 2987)
@@ -212,7 +212,7 @@
int i=0;
int n=list.size();
while (i<n){
- int j=i+40;
+ int j=i+35;
if (j>n){
j = n;
}
@@ -252,7 +252,7 @@
chapter.add(paragraphTable);
//add page
document.add(chapter);
- i=i+40;
+ i=i+35;
nbpages++;
}
}
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-07-26 16:32:09 UTC (rev 2986)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ExportServiceImpl.java 2010-07-28 09:02:22 UTC (rev 2987)
@@ -52,6 +52,8 @@
import org.nuiton.topia.TopiaContextFactory;
import org.nuiton.topia.TopiaException;
import org.nuiton.topia.TopiaNotFoundException;
+import org.nuiton.topia.framework.TopiaQuery;
+
import au.com.bytecode.opencsv.CSVWriter;
/**
@@ -297,8 +299,12 @@
// Get all Financialstatements
FinancialStatementDAO financialStatementDAO =
LimaCallaoDAOHelper.getFinancialStatementDAO(topiaContext);
+
+ TopiaQuery query = financialStatementDAO.createQuery();
+ query.addOrder(FinancialStatement.TOPIA_CREATE_DATE);
List<FinancialStatement> listFinancialStatements =
- financialStatementDAO.findAll();
+ financialStatementDAO.findAllByQuery(query);
+
// For all Financialstatements
for (FinancialStatement financialStatement : listFinancialStatements) {
nextLine[0] = ImportExportEntityEnum.FINANCIALSTATEMENT.getLabel();
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialStatementServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialStatementServiceImpl.java 2010-07-26 16:32:09 UTC (rev 2986)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialStatementServiceImpl.java 2010-07-28 09:02:22 UTC (rev 2987)
@@ -88,18 +88,21 @@
try {
- // check if FinancialStatementHeader label already exist
FinancialStatementDAO financialStatementDAO =
LimaCallaoDAOHelper.getFinancialStatementDAO(topiaContext);
- FinancialStatement existFinancialStatementHeader =
+ /* check if FinancialStatementHeader label already exist
+ * too much strict check, many financialstatement can have the same name
+ *
+ * FinancialStatement existFinancialStatementHeader =
financialStatementDAO.findByLabel(financialStatement.getLabel());
+
if (existFinancialStatementHeader != null) {
throw new LimaBusinessException(_(
"An financialStatement already exists with this label : %s",
financialStatement.getLabel()));
- }
+ }*/
financialStatementDAO.create(financialStatement);
@@ -223,7 +226,7 @@
TopiaQuery query = financialStatementDAO.createQuery();
query.addEquals("masterFinancialStatement", masterFinancialStatement)
- .addOrder(FinancialStatement.LABEL);
+ .addOrder(FinancialStatement.TOPIA_CREATE_DATE);
financialStatements = financialStatementDAO.findAllByQuery(query);
}
catch (TopiaException ex) {
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-07-26 16:32:09 UTC (rev 2986)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java 2010-07-28 09:02:22 UTC (rev 2987)
@@ -29,6 +29,7 @@
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
+import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
@@ -103,919 +104,997 @@
*
* @version $Revision$
*
- * Last update : $Date$
- * By : $Author$
+ * Last update : $Date: 2010-07-26 18:32:09 +0200 (lun., 26 juil. 2010)
+ * $ By : $Author$
*/
@Stateless
-public class ImportServiceImpl extends AbstractLimaService implements ImportService, ImportServiceLocal {
+public class ImportServiceImpl extends AbstractLimaService implements
+ ImportService, ImportServiceLocal {
- private static final Log log =
- LogFactory.getLog(ImportServiceImpl.class);
-
- private TopiaContext rootContext;
-
- //Services
-
- @EJB
- AccountServiceLocal accountService;
-
- @EJB
- FiscalPeriodServiceLocal fiscalPeriodService;
-
- @EJB
- FinancialPeriodServiceLocal financialPeriodService;
-
- @EJB
- FinancialTransactionServiceLocal financialTransactionService;
+ private static final Log log = LogFactory.getLog(ImportServiceImpl.class);
- @EJB
- FinancialStatementServiceLocal financialStatementService;
-
- @EJB
- EntryBookServiceLocal entryBookService;
-
- @EJB
- IdentityServiceLocal identityService;
-
- private static final SimpleDateFormat SDateFormat = new SimpleDateFormat("dd,MM,yyyy HH:mm:ss");
-
+ private TopiaContext rootContext;
- public ImportServiceImpl() {
- LimaConfig config = LimaConfig.getInstance();
- try {
- rootContext = TopiaContextFactory.getContext(config.getOptions());
- } catch (TopiaNotFoundException ex) {
- if (log.isErrorEnabled()) {
- log.error("Can't init topia context", ex);
- }
- }
- }
+ // Services
- //################ IMPORT THIRD PART ACCOUNTING SOFTWARE ################
-
- @Override
- public String importEntriesFromEbp(String datas) throws LimaException {
+ @EJB
+ AccountServiceLocal accountService;
+
+ @EJB
+ FiscalPeriodServiceLocal fiscalPeriodService;
+
+ @EJB
+ FinancialPeriodServiceLocal financialPeriodService;
+
+ @EJB
+ FinancialTransactionServiceLocal financialTransactionService;
+
+ @EJB
+ FinancialStatementServiceLocal financialStatementService;
+
+ @EJB
+ EntryBookServiceLocal entryBookService;
+
+ @EJB
+ IdentityServiceLocal identityService;
+
+ private static final SimpleDateFormat SDateFormat = new SimpleDateFormat(
+ "dd,MM,yyyy HH:mm:ss");
+
+ public ImportServiceImpl() {
+ LimaConfig config = LimaConfig.getInstance();
+ try {
+ rootContext = TopiaContextFactory.getContext(config.getOptions());
+ } catch (TopiaNotFoundException ex) {
+ if (log.isErrorEnabled()) {
+ log.error("Can't init topia context", ex);
+ }
+ }
+ }
+
+ // ################ IMPORT THIRD PART ACCOUNTING SOFTWARE ################
+
+ @Override
+ public String importEntriesFromEbp(String datas) throws LimaException {
SimpleDateFormat epbDateFormat = new SimpleDateFormat("dd/MM/yyyy");
- String result = "";
+ String result = "";
- TopiaContext topiaContext = null;
- try {
- topiaContext = beginTransaction();
-
- CSVReader csvReader = new CSVReader(new StringReader(datas));
- ColumnPositionMappingStrategy<EntryEBPImpl> strat = new ColumnPositionMappingStrategy<EntryEBPImpl>();
- strat.setType(EntryEBPImpl.class);
- //read header to set strategy mapping
- strat.setColumnMapping(csvReader.readNext());
-
- //check if file have a good header
- List<String> headAccount = new ArrayList<String>();
- headAccount.add("Journal");
- headAccount.add("Compte");
- headAccount.add("DatEcr");
- headAccount.add("Piece");
- headAccount.add("Libelle");
- headAccount.add("Debit");
- headAccount.add("Credit");
- headAccount.add("Lettre");
- if (!Arrays.asList(strat.getColumnMapping()).containsAll(headAccount)){
- throw new LimaBusinessException("ERROR : This file contains no entries");
- }
-
- CsvToBean<EntryEBPImpl> csv = new CsvToBean<EntryEBPImpl>();
- List<EntryEBPImpl> list = csv.parse(strat, csvReader);
-
- //DAOs
- AccountDAO accountDAO =
- LimaCallaoDAOHelper.getAccountDAO(topiaContext);
- EntryBookDAO entryBookDAO =
- LimaCallaoDAOHelper.getEntryBookDAO(topiaContext);
- FinancialPeriodDAO financialPeriodDAO =
- LimaCallaoDAOHelper.getFinancialPeriodDAO(topiaContext);
-
- if (financialPeriodDAO.findAll().size() == 0){
- throw new LimaBusinessException("Can't import entries, no fiscalperiod is open");
- }
-
- FinancialTransaction financialTransaction = null;
- for (EntryEBP entryEBP : list) {
- //create entry
- Entry entry = new EntryImpl();
- Account account = accountDAO.findByAccountNumber(entryEBP.getCompte());
- //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 {
- entry.setAccount(account);
- Double debit = new Double(entryEBP.getDebit());
- Double credit = new Double(entryEBP.getCredit());
- if (debit == 0){
- entry.setDebit(false);
- entry.setAmount(credit);
- }
- else {
- entry.setDebit(true);
- entry.setAmount(debit);
- }
- 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);
-
- //if entrybook not exist create it !
- if (entryBook==null){
- entryBook = new EntryBookImpl();
- entryBook.setCode(entryBookCode);
- //create it
- entryBookService.createEntryBook(entryBook);
- result += "WARNING : Entrybook " + entryBook + "not exist was created !\n";
- }
+ TopiaContext topiaContext = null;
+ try {
+ topiaContext = beginTransaction();
-
- if (financialTransaction == null || !(date.equals(financialTransaction.getTransactionDate()) && entryBook.getCode().equals(financialTransaction.getEntryBook().getCode()))){
- //update previous financial transaction before create new
- if (financialTransaction != null){
- financialTransaction.setAmounts();
- financialTransactionService.updateFinancialTransactionWithTransaction(financialTransaction, topiaContext);
- }
- //create financial transaction
- financialTransaction = new FinancialTransactionImpl();
- financialTransaction.setEntryBook(entryBook);
- financialTransaction.setTransactionDate(date);
- FinancialPeriod financialPeriod = financialPeriodDAO.findByDate(date);
- financialTransaction.setFinancialPeriod(financialPeriod);
- financialTransactionService.createFinancialTransactionWithTransaction(financialTransaction, topiaContext);
- result += "SUCCES : FinancialTransaction" + date + " " + entryBook.getCode() + " added\n";
+ CSVReader csvReader = new CSVReader(new StringReader(datas));
+ ColumnPositionMappingStrategy<EntryEBPImpl> strat = new ColumnPositionMappingStrategy<EntryEBPImpl>();
+ strat.setType(EntryEBPImpl.class);
+ // read header to set strategy mapping
+ strat.setColumnMapping(csvReader.readNext());
- }
- financialTransaction.addEntry(entry);
- financialTransactionService.createEntryWithTransaction(entry, topiaContext);
- result += "SUCCES : Entry" + entry.getDescription() + " " + entry.getAmount() + " added\n";
- }
- }
- //update last financial transaction
- if (financialTransaction != null){
- financialTransaction.setAmounts();
- financialTransactionService.updateFinancialTransactionWithTransaction(financialTransaction, topiaContext);
- }
- //commit
- commitTransaction(topiaContext);
- }
- catch (TopiaException eeeTE){
- doCatch(topiaContext, eeeTE, log);
- }
- catch (IOException eeeIO) {
- if (log.isDebugEnabled()){
+ // check if file have a good header
+ List<String> headAccount = new ArrayList<String>();
+ headAccount.add("Journal");
+ headAccount.add("Compte");
+ headAccount.add("DatEcr");
+ headAccount.add("Piece");
+ headAccount.add("Libelle");
+ headAccount.add("Debit");
+ headAccount.add("Credit");
+ headAccount.add("Lettre");
+ if (!Arrays.asList(strat.getColumnMapping()).containsAll(
+ headAccount)) {
+ throw new LimaBusinessException(
+ "ERROR : This file contains no entries");
+ }
+
+ CsvToBean<EntryEBPImpl> csv = new CsvToBean<EntryEBPImpl>();
+ List<EntryEBPImpl> list = csv.parse(strat, csvReader);
+
+ // DAOs
+ AccountDAO accountDAO = LimaCallaoDAOHelper
+ .getAccountDAO(topiaContext);
+ EntryBookDAO entryBookDAO = LimaCallaoDAOHelper
+ .getEntryBookDAO(topiaContext);
+ FinancialPeriodDAO financialPeriodDAO = LimaCallaoDAOHelper
+ .getFinancialPeriodDAO(topiaContext);
+
+ if (financialPeriodDAO.findAll().size() == 0) {
+ throw new LimaBusinessException(
+ "Can't import entries, no fiscalperiod is open");
+ }
+
+ FinancialTransaction financialTransaction = null;
+ for (EntryEBP entryEBP : list) {
+ // create entry
+ Entry entry = new EntryImpl();
+ Account account = accountDAO.findByAccountNumber(entryEBP
+ .getCompte());
+ // 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 {
+ entry.setAccount(account);
+ Double debit = new Double(entryEBP.getDebit());
+ Double credit = new Double(entryEBP.getCredit());
+ if (debit == 0) {
+ entry.setDebit(false);
+ entry.setAmount(credit);
+ } else {
+ entry.setDebit(true);
+ entry.setAmount(debit);
+ }
+ 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);
+
+ // if entrybook not exist create it !
+ if (entryBook == null) {
+ entryBook = new EntryBookImpl();
+ entryBook.setCode(entryBookCode);
+ // create it
+ entryBookService.createEntryBook(entryBook);
+ result += "WARNING : Entrybook " + entryBook
+ + "not exist was created !\n";
+ }
+
+ if (financialTransaction == null
+ || !(date.equals(financialTransaction
+ .getTransactionDate()) && entryBook
+ .getCode().equals(
+ financialTransaction.getEntryBook()
+ .getCode()))) {
+ // update previous financial transaction before create
+ // new
+ if (financialTransaction != null) {
+ financialTransaction.setAmounts();
+ financialTransactionService
+ .updateFinancialTransactionWithTransaction(
+ financialTransaction, topiaContext);
+ }
+ // create financial transaction
+ financialTransaction = new FinancialTransactionImpl();
+ financialTransaction.setEntryBook(entryBook);
+ financialTransaction.setTransactionDate(date);
+ FinancialPeriod financialPeriod = financialPeriodDAO
+ .findByDate(date);
+ financialTransaction
+ .setFinancialPeriod(financialPeriod);
+ financialTransactionService
+ .createFinancialTransactionWithTransaction(
+ financialTransaction, topiaContext);
+ result += "SUCCES : FinancialTransaction" + date + " "
+ + entryBook.getCode() + " added\n";
+
+ }
+ financialTransaction.addEntry(entry);
+ financialTransactionService.createEntryWithTransaction(
+ entry, topiaContext);
+ result += "SUCCES : Entry" + entry.getDescription() + " "
+ + entry.getAmount() + " added\n";
+ }
+ }
+ // update last financial transaction
+ if (financialTransaction != null) {
+ financialTransaction.setAmounts();
+ financialTransactionService
+ .updateFinancialTransactionWithTransaction(
+ financialTransaction, topiaContext);
+ }
+ // commit
+ commitTransaction(topiaContext);
+ } catch (TopiaException eeeTE) {
+ doCatch(topiaContext, eeeTE, log);
+ } catch (IOException eeeIO) {
+ if (log.isDebugEnabled()) {
log.debug("Can't read string", eeeIO);
}
- }
- catch (ParseException eeePE) {
- if (log.isDebugEnabled()){
+ } catch (ParseException eeePE) {
+ if (log.isDebugEnabled()) {
log.debug("Can't parse date", eeePE);
}
+ } finally {
+ doFinally(topiaContext, log);
}
- finally {
- doFinally(topiaContext, log);
- }
return result;
- }
+ }
- @Override
- public String importAccountsChartFromEbp(String datas) throws LimaException{
+ @Override
+ public String importAccountsChartFromEbp(String datas) throws LimaException {
String result = "";
- TopiaContext topiaContext = null;
-
- try {
- topiaContext = beginTransaction();
- CSVReader csvReader = new CSVReader(new StringReader(datas));
- ColumnPositionMappingStrategy<AccountEBPImpl> strat = new ColumnPositionMappingStrategy<AccountEBPImpl>();
- strat.setType(AccountEBPImpl.class);
- //read header to set strategy mapping
- strat.setColumnMapping(csvReader.readNext());
-
- //check if file have a good header
- List<String> headAccount = new ArrayList<String>();
- headAccount.add("Numero");
- headAccount.add("Intitule");
- if (!Arrays.asList(strat.getColumnMapping()).containsAll(headAccount)){
- throw new LimaBusinessException("ERROR : This file contains no account");
- }
-
- CsvToBean<AccountEBPImpl> csv = new CsvToBean<AccountEBPImpl>();
- List<AccountEBPImpl> list = csv.parse(strat, csvReader);
- Collections.sort(list, new AccountEBPComparator());
-
- AccountDAO accountDAO = LimaCallaoDAOHelper.getAccountDAO(topiaContext);
+ TopiaContext topiaContext = null;
+
+ try {
+ topiaContext = beginTransaction();
+ CSVReader csvReader = new CSVReader(new StringReader(datas));
+ ColumnPositionMappingStrategy<AccountEBPImpl> strat = new ColumnPositionMappingStrategy<AccountEBPImpl>();
+ strat.setType(AccountEBPImpl.class);
+ // read header to set strategy mapping
+ strat.setColumnMapping(csvReader.readNext());
+
+ // check if file have a good header
+ List<String> headAccount = new ArrayList<String>();
+ headAccount.add("Numero");
+ headAccount.add("Intitule");
+ if (!Arrays.asList(strat.getColumnMapping()).containsAll(
+ headAccount)) {
+ throw new LimaBusinessException(
+ "ERROR : This file contains no account");
+ }
+
+ CsvToBean<AccountEBPImpl> csv = new CsvToBean<AccountEBPImpl>();
+ List<AccountEBPImpl> list = csv.parse(strat, csvReader);
+ Collections.sort(list, new AccountEBPComparator());
+
+ AccountDAO accountDAO = LimaCallaoDAOHelper
+ .getAccountDAO(topiaContext);
for (AccountEBP accountEBP : list) {
String accountNumber = accountEBP.getNumero();
- if (accountDAO.findByAccountNumber(accountNumber) != null){
- result += "FAILED : Account" + accountNumber + " already exist \n";
- }
- else {
+ if (accountDAO.findByAccountNumber(accountNumber) != null) {
+ result += "FAILED : Account" + accountNumber
+ + " already exist \n";
+ } else {
String label = accountEBP.getIntitule();
Account account = new AccountImpl();
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 (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);
+ 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";
+ accountService.createAccountWithTransaction(
+ masterAccount, account, topiaContext);
+ result += "SUCCES : Account" + accountNumber + " "
+ + label + " added\n";
}
- }
+ }
}
- }
- catch (TopiaException eeeTE){
- doCatch(topiaContext, eeeTE, log);
- }
- catch (IOException eeeIO) {
- if (log.isDebugEnabled()){
+ } catch (TopiaException eeeTE) {
+ doCatch(topiaContext, eeeTE, log);
+ } catch (IOException eeeIO) {
+ if (log.isDebugEnabled()) {
log.debug("Can't read string", eeeIO);
}
+ } finally {
+ doFinally(topiaContext, log);
}
- finally {
- doFinally(topiaContext, log);
- }
-
- return result;
+
+ return result;
}
-
@Override
public void importAsCiel(byte[] data) throws LimaException {
// TODO Auto-generated method stub
-
+
}
@Override
public void importAsSage(byte[] data) throws LimaException {
// TODO Auto-generated method stub
-
+
}
-
- //################ IMPORT ################
+ // ################ IMPORT ################
/**
* Remote methode to call all entities import from UI
*/
@Override
public String importAllAsCSV(String datas) throws LimaException {
- String result = "";
-
- Map<String, AccountImport> accounts = new TreeMap<String, AccountImport>();
-
- Map<String, FinancialStatementImport> financialStatements = new TreeMap<String, FinancialStatementImport>();
-
- List<FiscalPeriod> fiscalPeriods = new ArrayList<FiscalPeriod>();
-
- List<ClosedPeriodicEntryBookImport> closedPeriodicEntryBooks = new ArrayList<ClosedPeriodicEntryBookImport>();
-
- Map<Integer, FinancialTransactionImport> financialTransactions = new HashMap<Integer,FinancialTransactionImport>();
-
- Map<Integer, List<EntryImport>> entries = new HashMap<Integer, List<EntryImport>>();
-
-
- TopiaContext topiaContext = null;
- try {
- topiaContext = beginTransaction();
-
- String[] nextLine = new String[1];
- CSVReader csvReader = new CSVReader(new StringReader(datas), ';');
-
- while ((nextLine = csvReader.readNext()) != null) {
- ImportExportEntityEnum importExportEntityEnum = ImportExportEntityEnum.valueOfLabel(nextLine[0]);
- if (importExportEntityEnum != null){
- switch (importExportEntityEnum) {
- case ACCOUNT:
- result += importAccountsChartsCSV(nextLine, accounts, topiaContext);
- break;
- case ENTRYBOOK:
- result += importEntryBooksChartCSV(nextLine, topiaContext);
- break;
- case FINANCIALSTATEMENT:
- result += importFinancialsStatementChartCSV(nextLine, financialStatements, topiaContext);
- break;
- case FISCALPERIOD:
- result += importFiscalPeriodCSV(nextLine, fiscalPeriods, topiaContext);
- break;
- case CLOSEDPERIODICENTRYBOOK:
- importClosedPeriodicEntryBookCSV(nextLine, closedPeriodicEntryBooks, topiaContext);
- break;
- case FINANCIALTRANSACTION:
- importFinancialTransactionsCSV(nextLine, financialTransactions, topiaContext);
- break;
- case ENTRY:
- importEntriesCSV(nextLine, entries, topiaContext);
- break;
- case IDENTITY:
- importIdentity(nextLine, topiaContext);
- break;
- }
- }
- }
-
- //create accounts
- result += createAccounts(accounts, topiaContext);
- //create financialStatements
- result += createFinancialStatements(financialStatements, topiaContext);
- //create fiscalperiod
- Collections.sort(fiscalPeriods, new FiscalPeriodComparator());
- result += createFiscalPeriod(fiscalPeriods, topiaContext);
- //update closedperiodicentrybooks
- result += updateClosedPeriodicEntryBooks(closedPeriodicEntryBooks, topiaContext);
- //create financialtransaction and entries
- result += createFinancialTransactionsAndEntries(financialTransactions, entries, topiaContext);
-
- commitTransaction(topiaContext);
+ String result = "";
- }
- catch (TopiaException eeeTE){
- doCatch(topiaContext, eeeTE, log);
+ Map<String, AccountImport> accounts = new TreeMap<String, AccountImport>();
+
+ LinkedHashMap<String, ArrayList<FinancialStatementImport>> financialStatements =
+ new LinkedHashMap<String, ArrayList<FinancialStatementImport>>();
+
+ List<FiscalPeriod> fiscalPeriods = new ArrayList<FiscalPeriod>();
+
+ List<ClosedPeriodicEntryBookImport> closedPeriodicEntryBooks =
+ new ArrayList<ClosedPeriodicEntryBookImport>();
+
+ Map<Integer, FinancialTransactionImport> financialTransactions =
+ new HashMap<Integer, FinancialTransactionImport>();
+
+ Map<Integer, List<EntryImport>> entries =
+ new HashMap<Integer, List<EntryImport>>();
+
+ TopiaContext topiaContext = null;
+ try {
+ topiaContext = beginTransaction();
+
+ String[] nextLine = new String[1];
+ CSVReader csvReader = new CSVReader(new StringReader(datas), ';');
+
+ while ((nextLine = csvReader.readNext()) != null) {
+ ImportExportEntityEnum importExportEntityEnum = ImportExportEntityEnum
+ .valueOfLabel(nextLine[0]);
+ if (importExportEntityEnum != null) {
+ switch (importExportEntityEnum) {
+ case ACCOUNT:
+ result += importAccountsChartsCSV(nextLine, accounts,
+ topiaContext);
+ break;
+ case ENTRYBOOK:
+ result += importEntryBooksChartCSV(nextLine,
+ topiaContext);
+ break;
+ case FINANCIALSTATEMENT:
+ result += importFinancialsStatementChartCSV(nextLine,
+ financialStatements, topiaContext);
+ break;
+ case FISCALPERIOD:
+ result += importFiscalPeriodCSV(nextLine,
+ fiscalPeriods, topiaContext);
+ break;
+ case CLOSEDPERIODICENTRYBOOK:
+ importClosedPeriodicEntryBookCSV(nextLine,
+ closedPeriodicEntryBooks, topiaContext);
+ break;
+ case FINANCIALTRANSACTION:
+ importFinancialTransactionsCSV(nextLine,
+ financialTransactions, topiaContext);
+ break;
+ case ENTRY:
+ importEntriesCSV(nextLine, entries, topiaContext);
+ break;
+ case IDENTITY:
+ importIdentity(nextLine, topiaContext);
+ break;
+ }
+ }
+ }
+
+ // create accounts
+ result += createAccounts(accounts, topiaContext);
+ // create financialStatements
+ result += createFinancialStatements(financialStatements,
+ topiaContext);
+ // create fiscalperiod
+ Collections.sort(fiscalPeriods, new FiscalPeriodComparator());
+ result += createFiscalPeriod(fiscalPeriods, topiaContext);
+ // update closedperiodicentrybooks
+ result += updateClosedPeriodicEntryBooks(closedPeriodicEntryBooks,
+ topiaContext);
+ // create financialtransaction and entries
+ result += createFinancialTransactionsAndEntries(
+ financialTransactions, entries, topiaContext);
+
+ commitTransaction(topiaContext);
+
+ } catch (TopiaException eeeTE) {
+ doCatch(topiaContext, eeeTE, log);
+ } catch (IOException eeeIO) {
+ log.debug("Can't create new CSV Reader", eeeIO);
+ } finally {
+ doFinally(topiaContext, log);
}
- catch (IOException eeeIO) {
- log.debug("Can't create new CSV Reader",eeeIO);
- }
- finally {
- doFinally(topiaContext, log);
- }
return result;
}
-
-
+
/**
* Remote methode to call entrybooks import from UI
*/
@Override
- public String importEntryBooksChartAsCSV(String datas) throws LimaException{
- String result = "";
+ public String importEntryBooksChartAsCSV(String datas) 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);
+ 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);
}
- 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
- Map<String, FinancialStatementImport> financialStatements =
- new TreeMap<String, FinancialStatementImport>();
+ public String importFinancialStatementsChartAsCSV(String datas)
+ 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.FINANCIALSTATEMENT){
- result += importFinancialsStatementChartCSV(nextLine, financialStatements, topiaContext);
- }
- }
-
- //create financialStatements
- result += createFinancialStatements(financialStatements, topiaContext);
- }
- catch (TopiaException eeeTE){
- doCatch(topiaContext, eeeTE, log);
+ // FinancialStatements
+ LinkedHashMap<String, ArrayList<FinancialStatementImport>> financialStatements =
+ new LinkedHashMap<String, ArrayList<FinancialStatementImport>>();
+
+ 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.FINANCIALSTATEMENT) {
+ result += importFinancialsStatementChartCSV(nextLine,
+ financialStatements, topiaContext);
+ }
+ }
+
+ // 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);
}
- catch (IOException eeeIO) {
- log.debug("Can't create new CSV Reader",eeeIO);
- }
- finally {
- doFinally(topiaContext, log);
- }
return result;
}
-
-
+
/**
* 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>();
+ 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.ACCOUNT){
- result += importAccountsChartsCSV(nextLine, accounts, topiaContext);
- }
- }
-
- //create accounts
- result += createAccounts(accounts, topiaContext);
- }
- catch (TopiaException eeeTE){
- doCatch(topiaContext, eeeTE, log);
+ // 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);
+ }
+ }
+
+ // create accounts
+ result += createAccounts(accounts, topiaContext);
+ } catch (TopiaException eeeTE) {
+ doCatch(topiaContext, eeeTE, log);
+ } catch (IOException eeeIO) {
+ log.debug("Can't create new CSV Reader", eeeIO);
+ } finally {
+ doFinally(topiaContext, log);
}
- catch (IOException eeeIO) {
- log.debug("Can't create new CSV Reader",eeeIO);
- }
- finally {
- doFinally(topiaContext, log);
- }
return result;
}
-
-
- //################ Import entities an put to lists ################
-
+
+ // ################ Import entities an put to lists ################
+
/**
- * Import and create accounts
- * Structure : TYPE | accountNumber | label | thirdparty | masterAccountNumber | generalLedgerNumber
+ * Import and create accounts Structure : TYPE | accountNumber | label
+ * | thirdparty | masterAccountNumber | generalLedgerNumber
*/
- public String importAccountsChartsCSV(String[] nextLine, Map<String, AccountImport> accounts, TopiaContext topiaContext) throws LimaException{
+ public String importAccountsChartsCSV(String[] nextLine,
+ Map<String, AccountImport> accounts, TopiaContext topiaContext)
+ throws LimaException {
String result = "";
- String accountNumber = nextLine[1];
- String label = nextLine[2];
- String thirdParty = nextLine[3];
- String masterAccountNumber = nextLine[4];
- String generalLedgerNumber = nextLine[5];
-
- try {
- AccountDAO accountDAO =
- LimaCallaoDAOHelper.getAccountDAO(topiaContext);
-
- //if not exist, create it
- if (accountDAO.findByAccountNumber(accountNumber) == null){
- //create it
- AccountImport accountImport = new AccountImportImpl();
- accountImport.setAccountNumber(accountNumber);
- accountImport.setLabel(label);
- accountImport.setThirdParty(thirdParty);
- accountImport.setMasterAccount(masterAccountNumber);
- accountImport.setGeneralLedger(generalLedgerNumber);
- // put it in hashset
- accounts.put(accountNumber, accountImport);
- }
- else {
- result += "FAILED : The account "
- + accountNumber + " already exists !\n";
- }
- }
- catch (TopiaException eeeTE){
- doCatch(topiaContext, eeeTE, log);
+ String accountNumber = nextLine[1];
+ String label = nextLine[2];
+ String thirdParty = nextLine[3];
+ String masterAccountNumber = nextLine[4];
+ String generalLedgerNumber = nextLine[5];
+
+ try {
+ AccountDAO accountDAO = LimaCallaoDAOHelper
+ .getAccountDAO(topiaContext);
+
+ // if not exist, create it
+ if (accountDAO.findByAccountNumber(accountNumber) == null) {
+ // create it
+ AccountImport accountImport = new AccountImportImpl();
+ accountImport.setAccountNumber(accountNumber);
+ accountImport.setLabel(label);
+ accountImport.setThirdParty(thirdParty);
+ accountImport.setMasterAccount(masterAccountNumber);
+ accountImport.setGeneralLedger(generalLedgerNumber);
+ // put it in hashset
+ accounts.put(accountNumber, accountImport);
+ } else {
+ result += "FAILED : The account " + accountNumber
+ + " already exists !\n";
+ }
+ } catch (TopiaException eeeTE) {
+ doCatch(topiaContext, eeeTE, log);
}
return result;
}
-
-
+
/**
- * Import and create fiscal period
- * Structure : TYPE | BeginDate | EndDate | Locked
+ * Import and create fiscal period Structure : TYPE | BeginDate | EndDate
+ * | Locked
*/
- public String importFiscalPeriodCSV(String[] nextLine, List<FiscalPeriod> fiscalPeriods, TopiaContext topiaContext) throws LimaException {
- String result ="";
+ public String importFiscalPeriodCSV(String[] nextLine,
+ List<FiscalPeriod> fiscalPeriods, TopiaContext topiaContext)
+ throws LimaException {
+ String result = "";
try {
- FiscalPeriodDAO fiscalPeriodDAO =
- LimaCallaoDAOHelper.getFiscalPeriodDAO(topiaContext);
-
- FiscalPeriod fiscalPeriod = new FiscalPeriodImpl();
- Date beginDate = SDateFormat.parse(nextLine[1]);
- fiscalPeriod.setBeginDate(beginDate);
- Date endDate = SDateFormat.parse(nextLine[2]);
- fiscalPeriod.setEndDate(endDate);
- fiscalPeriod.setLocked(new Boolean(nextLine[3]));
+ FiscalPeriodDAO fiscalPeriodDAO = LimaCallaoDAOHelper
+ .getFiscalPeriodDAO(topiaContext);
- //if not exist, skip
- if (fiscalPeriodDAO.findByNaturalId(beginDate, endDate) == null){
- fiscalPeriods.add(fiscalPeriod);
- }
- else {
- result += "FAILED : The fiscalperiod "
- + beginDate + "-" + endDate + " already exists !\n";
- }
- }
- catch (ParseException eeePE) {
- if(log.isDebugEnabled()){
+ FiscalPeriod fiscalPeriod = new FiscalPeriodImpl();
+ Date beginDate = SDateFormat.parse(nextLine[1]);
+ fiscalPeriod.setBeginDate(beginDate);
+ Date endDate = SDateFormat.parse(nextLine[2]);
+ fiscalPeriod.setEndDate(endDate);
+ fiscalPeriod.setLocked(new Boolean(nextLine[3]));
+
+ // if not exist, skip
+ if (fiscalPeriodDAO.findByNaturalId(beginDate, endDate) == null) {
+ fiscalPeriods.add(fiscalPeriod);
+ } else {
+ result += "FAILED : The fiscalperiod " + beginDate + "-"
+ + endDate + " already exists !\n";
+ }
+ } catch (ParseException eeePE) {
+ if (log.isDebugEnabled()) {
log.debug("Can't parse date", eeePE);
}
+ } catch (TopiaException eeeTE) {
+ doCatch(topiaContext, eeeTE, log);
}
- catch (TopiaException eeeTE){
- doCatch(topiaContext, eeeTE, log);
- }
return result;
}
-
-
+
/**
- * Import and create entrybooks
- * Structure : TYPE | Code | Label | Type
+ * Import and create entrybooks Structure : TYPE | Code | Label | Type
*/
- public String importEntryBooksChartCSV(String[] nextLine, TopiaContext topiaContext) throws LimaException {
- String result ="";
- try {
-
- EntryBookDAO entryBookDAO =
- LimaCallaoDAOHelper.getEntryBookDAO(topiaContext);
-
- EntryBook entryBook = new EntryBookImpl();
- entryBook.setCode(nextLine[1]);
- entryBook.setLabel(nextLine[2]);
- entryBook.setType(nextLine[3]);
+ public String importEntryBooksChartCSV(String[] nextLine,
+ TopiaContext topiaContext) throws LimaException {
+ String result = "";
+ try {
- //if exist, skip
- if (entryBookDAO.findByCode(entryBook.getCode()) != null){
- result += "FAILED : The entrybook "
- + entryBook.getLabel() + " already exists !\n";
- }
- else {
- //create it
- entryBookService.createEntryBook(entryBook);
- result += "SUCCESS : The financialStatement " +
- entryBook.getLabel() + " is created ! \n";
- }
- }
- catch (TopiaException eeeTE){
- doCatch(topiaContext, eeeTE, log);
+ EntryBookDAO entryBookDAO = LimaCallaoDAOHelper
+ .getEntryBookDAO(topiaContext);
+
+ EntryBook entryBook = new EntryBookImpl();
+ entryBook.setCode(nextLine[1]);
+ entryBook.setLabel(nextLine[2]);
+ entryBook.setType(nextLine[3]);
+
+ // if exist, skip
+ if (entryBookDAO.findByCode(entryBook.getCode()) != null) {
+ result += "FAILED : The entrybook " + entryBook.getLabel()
+ + " already exists !\n";
+ } else {
+ // create it
+ entryBookService.createEntryBook(entryBook);
+ result += "SUCCESS : The financialStatement "
+ + entryBook.getLabel() + " is created ! \n";
+ }
+ } catch (TopiaException eeeTE) {
+ doCatch(topiaContext, eeeTE, log);
}
return result;
}
-
-
+
/**
- * Import and create closedperiodicentrybook import
- * Structure : TYPE | BeginDate | EndDate | Locked
+ * Import and create closedperiodicentrybook import Structure : TYPE |
+ * BeginDate | EndDate | Locked
*/
- public void importClosedPeriodicEntryBookCSV(String[] nextLine, List<ClosedPeriodicEntryBookImport> closedPeriodicEntryBooks, TopiaContext topiaContext) throws LimaException {
- String locked = nextLine[1];
- String beginDate = nextLine[2];
- String endDate = nextLine[3];
- String entryBookCode = nextLine[4];
-
- if (new Boolean(locked)){
- ClosedPeriodicEntryBookImport closedPeriodicEntryBookImport = new ClosedPeriodicEntryBookImportImpl();
- closedPeriodicEntryBookImport.setLocked(locked);
- closedPeriodicEntryBookImport.setBeginDateFinancialPeriod(beginDate);
- closedPeriodicEntryBookImport.setEndDateFinancialPeriod(endDate);
- closedPeriodicEntryBookImport.setCodeEntryBook(entryBookCode);
+ public void importClosedPeriodicEntryBookCSV(String[] nextLine,
+ List<ClosedPeriodicEntryBookImport> closedPeriodicEntryBooks,
+ TopiaContext topiaContext) throws LimaException {
+ String locked = nextLine[1];
+ String beginDate = nextLine[2];
+ String endDate = nextLine[3];
+ String entryBookCode = nextLine[4];
- closedPeriodicEntryBooks.add(closedPeriodicEntryBookImport);
- }
+ if (new Boolean(locked)) {
+ ClosedPeriodicEntryBookImport closedPeriodicEntryBookImport = new ClosedPeriodicEntryBookImportImpl();
+ closedPeriodicEntryBookImport.setLocked(locked);
+ closedPeriodicEntryBookImport
+ .setBeginDateFinancialPeriod(beginDate);
+ closedPeriodicEntryBookImport.setEndDateFinancialPeriod(endDate);
+ closedPeriodicEntryBookImport.setCodeEntryBook(entryBookCode);
+
+ closedPeriodicEntryBooks.add(closedPeriodicEntryBookImport);
+ }
}
-
-
+
/**
- * Import and create financialstatement
- * Structure : TYPE | label | header | accounts | debitAccount | creditAccount
- * | provisitionDeprecationAccounts | subAmount | headerAmount | masterFinancialStatement
- */
- public String importFinancialsStatementChartCSV(String[] nextLine, Map<String, FinancialStatementImport> financialStatements, TopiaContext topiaContext) throws LimaException {
+ * Import and create financialstatement Structure : TYPE | label | header
+ * | accounts | debitAccount | creditAccount |
+ * provisitionDeprecationAccounts | subAmount | headerAmount
+ * | masterFinancialStatement
+ */
+
+ public String importFinancialsStatementChartCSV(String[] nextLine,
+ LinkedHashMap<String, ArrayList<FinancialStatementImport>> financialStatements,
+ TopiaContext topiaContext) throws LimaException {
String result = "";
-
- String label = nextLine[1];
- String header = nextLine[2];
- String accounts = nextLine[3];
- String debitAccounts = nextLine[4];
- String creditAccounts = nextLine[5];
- String provisionDeprecationAccounts = nextLine[6];
- String subAmount = nextLine[7];
- String headerAmount = nextLine[8];
- String masterFinancialStatement = nextLine[9];
-
- try {
- FinancialStatementDAO financialStatementDAO =
- LimaCallaoDAOHelper.getFinancialStatementDAO(topiaContext);
-
- //if exist, skip
- if (financialStatementDAO.findByLabel(label) == null){
- //create it
- FinancialStatementImport financialStatementImport =
- new FinancialStatementImportImpl();
- financialStatementImport.setLabel(label);
- financialStatementImport.setHeader(header);
- financialStatementImport.setAccounts(accounts);
- financialStatementImport.setCreditAccounts(creditAccounts);
- financialStatementImport.setDebitAccounts(debitAccounts);
- financialStatementImport.setHeaderAmount(headerAmount);
- financialStatementImport.setProvisionDeprecationAccounts(
- provisionDeprecationAccounts);
- financialStatementImport.setSubAmount(subAmount);
- financialStatementImport.setMasterFinancialStatement(
- masterFinancialStatement);
-
- // put it in hashset
- financialStatements.put(label, financialStatementImport);
- }
- else {
- result += "FAILED : The financialstatement "
- + label + " already exists !\n";
- }
- }
- catch (TopiaException eeeTE){
- doCatch(topiaContext, eeeTE, log);
+
+ String label = nextLine[1];
+ String header = nextLine[2];
+ String accounts = nextLine[3];
+ String debitAccounts = nextLine[4];
+ String creditAccounts = nextLine[5];
+ String provisionDeprecationAccounts = nextLine[6];
+ String subAmount = nextLine[7];
+ String headerAmount = nextLine[8];
+ String masterFinancialStatement = nextLine[9];
+
+ try {
+ FinancialStatementDAO financialStatementDAO = LimaCallaoDAOHelper
+ .getFinancialStatementDAO(topiaContext);
+
+ // if exist, skip
+ if (financialStatementDAO.findByLabel(label) == null) {
+ // create it
+ FinancialStatementImport financialStatementImport = new FinancialStatementImportImpl();
+ financialStatementImport.setLabel(label);
+ financialStatementImport.setHeader(header);
+ financialStatementImport.setAccounts(accounts);
+ financialStatementImport.setCreditAccounts(creditAccounts);
+ financialStatementImport.setDebitAccounts(debitAccounts);
+ financialStatementImport.setHeaderAmount(headerAmount);
+ financialStatementImport
+ .setProvisionDeprecationAccounts(provisionDeprecationAccounts);
+ financialStatementImport.setSubAmount(subAmount);
+ financialStatementImport
+ .setMasterFinancialStatement(masterFinancialStatement);
+
+ // put it in hashlinkedlist
+ if (financialStatements.containsKey(label)){
+ financialStatements.get(label).add(financialStatementImport);
+ }
+ else {
+ List<FinancialStatementImport> list = new ArrayList<FinancialStatementImport>();
+ list.add(financialStatementImport);
+ financialStatements.put(label, (ArrayList<FinancialStatementImport>) list);
+ }
+ } else {
+ result += "FAILED : The financialstatement " + label
+ + " already exists !\n";
+ }
+ } catch (TopiaException eeeTE) {
+ doCatch(topiaContext, eeeTE, log);
}
return result;
}
-
/**
- * Import and create financialtransactions
- * Structue : TYPE | NumTransac | TransactionDate | AmountDebit | AmountCredit
- * | FinancialPeriod BeginDate | FinancialPeriod EndDate | EntryBook Code
+ * Import and create financialtransactions Structue : TYPE | NumTransac |
+ * TransactionDate | AmountDebit | AmountCredit | FinancialPeriod BeginDate
+ * | FinancialPeriod EndDate | EntryBook Code
*/
- public void importFinancialTransactionsCSV(String[] nextLine, Map<Integer, FinancialTransactionImport> financialTransactions, TopiaContext topiaContext) throws LimaException {
- int num = new Integer(nextLine[1]);
- FinancialTransactionImport financialTransactionImport = new FinancialTransactionImportImpl();
- financialTransactionImport.setDate(nextLine[2]);
- financialTransactionImport.setAmountDebit(nextLine[3]);
- financialTransactionImport.setAmountCredit(nextLine[4]);
- financialTransactionImport.setBeginDateFinancialPeriod(nextLine[5]);
- financialTransactionImport.setEndDateFinancialPeriod(nextLine[6]);
- financialTransactionImport.setCodeEntryBook(nextLine[7]);
-
- financialTransactions.put(num, financialTransactionImport);
+ public void importFinancialTransactionsCSV(String[] nextLine,
+ Map<Integer, FinancialTransactionImport> financialTransactions,
+ TopiaContext topiaContext) throws LimaException {
+ int num = new Integer(nextLine[1]);
+ FinancialTransactionImport financialTransactionImport = new FinancialTransactionImportImpl();
+ financialTransactionImport.setDate(nextLine[2]);
+ financialTransactionImport.setAmountDebit(nextLine[3]);
+ financialTransactionImport.setAmountCredit(nextLine[4]);
+ financialTransactionImport.setBeginDateFinancialPeriod(nextLine[5]);
+ financialTransactionImport.setEndDateFinancialPeriod(nextLine[6]);
+ financialTransactionImport.setCodeEntryBook(nextLine[7]);
+
+ financialTransactions.put(num, financialTransactionImport);
}
-
-
+
/**
- * Import and create entries
- * Structure : TYPE | NumTransac | Description | Amount | Debit | Lettering | Detail |
- * Voucher | Position | FinancialTransaction Date | FinancialTransaction EntryBookCode |
+ * Import and create entries Structure : TYPE | NumTransac | Description |
+ * Amount | Debit | Lettering | Detail | Voucher | Position
+ * | FinancialTransaction Date | FinancialTransaction EntryBookCode |
* FinancialTransaction AmountDebit | FinancialTransaction AmountCredit
*/
- public void importEntriesCSV(String[] nextLine, Map<Integer, List<EntryImport>> entries, TopiaContext topiaContext) throws LimaException {
- int num = new Integer(nextLine[1]);
-
- EntryImport entryImport = new EntryImportImpl();
- entryImport.setDescription(nextLine[2]);
- entryImport.setAmount(nextLine[3]);
- entryImport.setDebit(nextLine[4]);
- entryImport.setLettering(nextLine[5]);
- entryImport.setDetail(nextLine[6]);
- entryImport.setVoucher(nextLine[7]);
- entryImport.setPosition(nextLine[8]);
- entryImport.setAccount(nextLine[9]);
-
- if (entries.containsKey(num)){
- List<EntryImport> entryImports = entries.get(num);
- entryImports.add(entryImport);
- }
- else {
- List<EntryImport> entryImports = new ArrayList<EntryImport>();
- entryImports.add(entryImport);
- entries.put(num, entryImports);
- }
- }
-
-
- //################ CREATE ENTITY IN DB FOR IMPORT ################
-
-
- public String createFinancialStatements(Map<String, FinancialStatementImport> financialStatements, TopiaContext topiaContext) throws LimaException {
- String result = "";
- try {
-
- FinancialStatementDAO financialStatementDAO =
- LimaCallaoDAOHelper.getFinancialStatementDAO(topiaContext);
-
- while (financialStatements.size() > 0){
- for (Iterator<FinancialStatementImport> itr = financialStatements.values().iterator(); itr.hasNext();){
- FinancialStatementImport financialStatementImport = itr.next();
- String masterFinancialStatementLabel =
- financialStatementImport.getMasterFinancialStatement();
- FinancialStatement masterFinancialStatement =
- financialStatementDAO.findByLabel(
- masterFinancialStatementLabel);
-
- if (masterFinancialStatementLabel.equals("")
- || masterFinancialStatement != null){
- //create it
- FinancialStatement financialStatement =
- new FinancialStatementImpl();
- financialStatement.setLabel(
- financialStatementImport.getLabel());
- financialStatement.setHeader(Boolean.parseBoolean(
- financialStatementImport.getHeader()));
- financialStatement.setAccounts(
- financialStatementImport.getAccounts());
- financialStatement.setDebitAccounts(
- financialStatementImport.getDebitAccounts());
- financialStatement.setCreditAccounts(
- financialStatementImport.getCreditAccounts());
- financialStatement.setProvisionDeprecationAccounts(
- financialStatementImport.
- getProvisionDeprecationAccounts());
- financialStatement.setSubAmount(Boolean.parseBoolean(
- financialStatementImport.getSubAmount()));
- financialStatement.setHeaderAmount(Boolean.parseBoolean(
- financialStatementImport.getHeaderAmount()));
+ public void importEntriesCSV(String[] nextLine,
+ Map<Integer, List<EntryImport>> entries, TopiaContext topiaContext)
+ throws LimaException {
+ int num = new Integer(nextLine[1]);
- financialStatementService.createFinancialStatementWithTransaction(
- masterFinancialStatement, financialStatement, topiaContext);
-
- result += "SUCCESS : The financialStatement " +
- financialStatementImport.getLabel() + " is created ! \n";
- itr.remove();
- }
- else if (!financialStatements.containsKey(masterFinancialStatementLabel)){
- result += "FAILED : The financialStatement " +
- financialStatementImport.getLabel() +
- " have masterFinancialStatement : " +
- masterFinancialStatementLabel + "which not exist \n";
- itr.remove();
- }
- }
- }
- }
- catch (TopiaException eeeTE){
- doCatch(topiaContext, eeeTE, log);
+ EntryImport entryImport = new EntryImportImpl();
+ entryImport.setDescription(nextLine[2]);
+ entryImport.setAmount(nextLine[3]);
+ entryImport.setDebit(nextLine[4]);
+ entryImport.setLettering(nextLine[5]);
+ entryImport.setDetail(nextLine[6]);
+ entryImport.setVoucher(nextLine[7]);
+ entryImport.setPosition(nextLine[8]);
+ entryImport.setAccount(nextLine[9]);
+
+ if (entries.containsKey(num)) {
+ List<EntryImport> entryImports = entries.get(num);
+ entryImports.add(entryImport);
+ } else {
+ List<EntryImport> entryImports = new ArrayList<EntryImport>();
+ entryImports.add(entryImport);
+ entries.put(num, entryImports);
}
- return result;
}
-
- public String createFiscalPeriod(List<FiscalPeriod> fiscalPeriods, TopiaContext topiaContext){
+
+ // ################ CREATE ENTITY IN DB FOR IMPORT ################
+
+ public String createFinancialStatements(LinkedHashMap<String, ArrayList<FinancialStatementImport>> financialStatements,
+ TopiaContext topiaContext) throws LimaException {
String result = "";
- for (FiscalPeriod fiscalPeriod : fiscalPeriods) {
- //create fiscalPeriod
- try {
- fiscalPeriodService.createFiscalPeriodWithTransaction(fiscalPeriod, topiaContext);
- result += "SUCCESS : The fiscalPeriod " +
- fiscalPeriod.getBeginDate()+"-"+fiscalPeriod.getEndDate() + " is created ! \n";
+ try {
+
+ FinancialStatementDAO financialStatementDAO = LimaCallaoDAOHelper
+ .getFinancialStatementDAO(topiaContext);
+
+ while (financialStatements.size() > 0) {
+ for (Iterator<ArrayList<FinancialStatementImport>> itr = financialStatements
+ .values().iterator(); itr.hasNext();) {
+ List<FinancialStatementImport> financialStatementImports =
+ itr.next();
+
+ for (Iterator<FinancialStatementImport> itr2 = financialStatementImports.iterator(); itr2.hasNext();) {
+ FinancialStatementImport financialStatementImport =
+ itr2.next();
+ log.debug(financialStatementImport.getLabel());
+ String masterFinancialStatementLabel = financialStatementImport
+ .getMasterFinancialStatement();
+ FinancialStatement masterFinancialStatement = financialStatementDAO
+ .findByLabel(masterFinancialStatementLabel);
+
+ if (masterFinancialStatementLabel.equals("")
+ || masterFinancialStatement != null) {
+ // create it
+ FinancialStatement financialStatement = new FinancialStatementImpl();
+ financialStatement.setLabel(financialStatementImport
+ .getLabel());
+ financialStatement.setHeader(Boolean
+ .parseBoolean(financialStatementImport
+ .getHeader()));
+ financialStatement.setAccounts(financialStatementImport
+ .getAccounts());
+ financialStatement
+ .setDebitAccounts(financialStatementImport
+ .getDebitAccounts());
+ financialStatement
+ .setCreditAccounts(financialStatementImport
+ .getCreditAccounts());
+ financialStatement
+ .setProvisionDeprecationAccounts(financialStatementImport
+ .getProvisionDeprecationAccounts());
+ financialStatement.setSubAmount(Boolean
+ .parseBoolean(financialStatementImport
+ .getSubAmount()));
+ financialStatement.setHeaderAmount(Boolean
+ .parseBoolean(financialStatementImport
+ .getHeaderAmount()));
+
+ financialStatementService
+ .createFinancialStatementWithTransaction(
+ masterFinancialStatement,
+ financialStatement, topiaContext);
+
+ result += "SUCCESS : The financialStatement "
+ + financialStatementImport.getLabel()
+ + " is created ! \n";
+
+ itr2.remove();
+ } else if (!financialStatements
+ .containsKey(masterFinancialStatementLabel)) {
+ result += "FAILED : The financialStatement "
+ + financialStatementImport.getLabel()
+ + " have masterFinancialStatement : "
+ + masterFinancialStatementLabel
+ + "which not exist \n";
+ itr2.remove();
+ }
+ }
+ if (financialStatementImports.isEmpty()){
+ itr.remove();
+ }
}
- catch (LimaException eee){
- result += "FAILED : "+eee+" \n";
- }
}
+ } catch (TopiaException eeeTE) {
+ doCatch(topiaContext, eeeTE, log);
+ }
return result;
}
- public String createAccounts(Map<String, AccountImport> accounts, TopiaContext topiaContext) throws LimaException {
- String result = "";
+ public String createFiscalPeriod(List<FiscalPeriod> fiscalPeriods,
+ TopiaContext topiaContext) {
+ String result = "";
+ for (FiscalPeriod fiscalPeriod : fiscalPeriods) {
+ // create fiscalPeriod
+ try {
+ fiscalPeriodService.createFiscalPeriodWithTransaction(
+ fiscalPeriod, topiaContext);
+ result += "SUCCESS : The fiscalPeriod "
+ + fiscalPeriod.getBeginDate() + "-"
+ + fiscalPeriod.getEndDate() + " is created ! \n";
+ } catch (LimaException eee) {
+ result += "FAILED : " + eee + " \n";
+ }
+ }
+ return result;
+ }
- try {
- AccountDAO accountDAO = LimaCallaoDAOHelper.getAccountDAO(topiaContext);
-
- while (accounts.size() > 0){
- for (Iterator<AccountImport> itr = accounts.values().iterator(); itr.hasNext();){
- AccountImport accountImport = itr.next();
- String masterAccountNumber = accountImport.getMasterAccount();
- String generalLedgerNumber = accountImport.getGeneralLedger();
- Account masterAccount =
- accountDAO.findByAccountNumber(masterAccountNumber);
- Account generalLedger =
- accountDAO.findByAccountNumber(generalLedgerNumber);
-
- if ((masterAccountNumber.equals("") && generalLedgerNumber.equals(""))
- || masterAccount != null || generalLedger != null){
- //create it
- Account account = new AccountImpl();
- account.setAccountNumber(accountImport.getAccountNumber());
- account.setLabel(accountImport.getLabel());
- account.setThirdParty(accountImport.getThirdParty());
-
- if (generalLedger != null){
- accountService.createSubLedgerWithTransaction(generalLedger, account, topiaContext);
- }
- else {
- accountService.createAccountWithTransaction(masterAccount, account, topiaContext);
- }
- result += "SUCCESS : The account " +
- accountImport.getAccountNumber() + " is created ! \n";
- itr.remove();
- }
- else if (!accounts.containsKey(masterAccountNumber)
- && !accounts.containsKey(generalLedgerNumber) ){
- result += "FAILED : The account " +
- accountImport.getAccountNumber() + " have masterAccount : " +
- masterAccountNumber + "which not exist \n";
- itr.remove();
- }
- }
- }
- }
- catch (TopiaException eeeTE){
- doCatch(topiaContext, eeeTE, log);
+ public String createAccounts(Map<String, AccountImport> accounts,
+ TopiaContext topiaContext) throws LimaException {
+ String result = "";
+
+ try {
+ AccountDAO accountDAO = LimaCallaoDAOHelper
+ .getAccountDAO(topiaContext);
+
+ while (accounts.size() > 0) {
+ for (Iterator<AccountImport> itr = accounts.values().iterator(); itr
+ .hasNext();) {
+ AccountImport accountImport = itr.next();
+ String masterAccountNumber = accountImport
+ .getMasterAccount();
+ String generalLedgerNumber = accountImport
+ .getGeneralLedger();
+ Account masterAccount = accountDAO
+ .findByAccountNumber(masterAccountNumber);
+ Account generalLedger = accountDAO
+ .findByAccountNumber(generalLedgerNumber);
+
+ if ((masterAccountNumber.equals("") && generalLedgerNumber
+ .equals(""))
+ || masterAccount != null || generalLedger != null) {
+ // create it
+ Account account = new AccountImpl();
+ account.setAccountNumber(accountImport
+ .getAccountNumber());
+ account.setLabel(accountImport.getLabel());
+ account.setThirdParty(accountImport.getThirdParty());
+
+ if (generalLedger != null) {
+ accountService.createSubLedgerWithTransaction(
+ generalLedger, account, topiaContext);
+ } else {
+ accountService.createAccountWithTransaction(
+ masterAccount, account, topiaContext);
+ }
+ result += "SUCCESS : The account "
+ + accountImport.getAccountNumber()
+ + " is created ! \n";
+ itr.remove();
+ } else if (!accounts.containsKey(masterAccountNumber)
+ && !accounts.containsKey(generalLedgerNumber)) {
+ result += "FAILED : The account "
+ + accountImport.getAccountNumber()
+ + " have masterAccount : "
+ + masterAccountNumber + "which not exist \n";
+ itr.remove();
+ }
+ }
+ }
+ } catch (TopiaException eeeTE) {
+ doCatch(topiaContext, eeeTE, log);
}
return result;
}
- public String updateClosedPeriodicEntryBooks (List<ClosedPeriodicEntryBookImport> closedPeriodicEntryBooks, TopiaContext topiaContext) throws LimaException {
- String result="";
-
+ public String updateClosedPeriodicEntryBooks(
+ List<ClosedPeriodicEntryBookImport> closedPeriodicEntryBooks,
+ TopiaContext topiaContext) throws LimaException {
+ String result = "";
+
try {
- FinancialPeriodDAO financialPeriodDAO =
- LimaCallaoDAOHelper.getFinancialPeriodDAO(topiaContext);
- EntryBookDAO entryBookDAO =
- LimaCallaoDAOHelper.getEntryBookDAO(topiaContext);
- ClosedPeriodicEntryBookDAO closedPeriodicEntryBookDAO =
- LimaCallaoDAOHelper.getClosedPeriodicEntryBookDAO(topiaContext);
+ FinancialPeriodDAO financialPeriodDAO = LimaCallaoDAOHelper
+ .getFinancialPeriodDAO(topiaContext);
+ EntryBookDAO entryBookDAO = LimaCallaoDAOHelper
+ .getEntryBookDAO(topiaContext);
+ ClosedPeriodicEntryBookDAO closedPeriodicEntryBookDAO = LimaCallaoDAOHelper
+ .getClosedPeriodicEntryBookDAO(topiaContext);
for (ClosedPeriodicEntryBookImport closedPeriodicEntryBookImport : closedPeriodicEntryBooks) {
- //update closedPeriodicEntryBook
- Date beginDateFinancialPeriod =
- SDateFormat.parse(closedPeriodicEntryBookImport.getBeginDateFinancialPeriod());
- Date endDateFinancialPeriod =
- SDateFormat.parse(closedPeriodicEntryBookImport.getEndDateFinancialPeriod());
- FinancialPeriod financialPeriod =
- financialPeriodDAO.findByNaturalId(beginDateFinancialPeriod, endDateFinancialPeriod);
- String codeEntryBook = closedPeriodicEntryBookImport.getCodeEntryBook();
- EntryBook entryBook = entryBookDAO.findByCode(codeEntryBook);
- ClosedPeriodicEntryBook closedPeriodicEntryBook =
- closedPeriodicEntryBookDAO.findbyEntryBookAndFinancialPeriod(entryBook, financialPeriod);
- try {
- financialPeriodService.blockClosedPeriodicEntryBookWithTransaction(closedPeriodicEntryBook, topiaContext);
- result += "SUCCESS : The blockClosedPeriodicEntryBook " +
- beginDateFinancialPeriod + "-" + endDateFinancialPeriod + ", " +
- codeEntryBook + " is updated ! \n";
- }
- catch (LimaException eee){
- result += "FAILED : "+eee+" \n";
- }
+ // update closedPeriodicEntryBook
+ Date beginDateFinancialPeriod = SDateFormat
+ .parse(closedPeriodicEntryBookImport
+ .getBeginDateFinancialPeriod());
+ Date endDateFinancialPeriod = SDateFormat
+ .parse(closedPeriodicEntryBookImport
+ .getEndDateFinancialPeriod());
+ FinancialPeriod financialPeriod = financialPeriodDAO
+ .findByNaturalId(beginDateFinancialPeriod,
+ endDateFinancialPeriod);
+ String codeEntryBook = closedPeriodicEntryBookImport
+ .getCodeEntryBook();
+ EntryBook entryBook = entryBookDAO.findByCode(codeEntryBook);
+ ClosedPeriodicEntryBook closedPeriodicEntryBook = closedPeriodicEntryBookDAO
+ .findbyEntryBookAndFinancialPeriod(entryBook,
+ financialPeriod);
+ try {
+ financialPeriodService
+ .blockClosedPeriodicEntryBookWithTransaction(
+ closedPeriodicEntryBook, topiaContext);
+ result += "SUCCESS : The blockClosedPeriodicEntryBook "
+ + beginDateFinancialPeriod + "-"
+ + endDateFinancialPeriod + ", " + codeEntryBook
+ + " is updated ! \n";
+ } catch (LimaException eee) {
+ result += "FAILED : " + eee + " \n";
+ }
}
- }
- catch (TopiaException eeeTE){
- doCatch(topiaContext, eeeTE, log);
- }
- catch (ParseException eeePE) {
- if(log.isDebugEnabled()){
+ } catch (TopiaException eeeTE) {
+ doCatch(topiaContext, eeeTE, log);
+ } catch (ParseException eeePE) {
+ if (log.isDebugEnabled()) {
log.debug("Can't parse date", eeePE);
}
}
return result;
}
- public String createFinancialTransactionsAndEntries (Map<Integer, FinancialTransactionImport> financialTransactions, Map<Integer, List<EntryImport>> entries, TopiaContext topiaContext) throws LimaException {
+ public String createFinancialTransactionsAndEntries(
+ Map<Integer, FinancialTransactionImport> financialTransactions,
+ Map<Integer, List<EntryImport>> entries, TopiaContext topiaContext)
+ throws LimaException {
String result = "";
try {
- EntryBookDAO entryBookDAO = LimaCallaoDAOHelper.getEntryBookDAO(topiaContext);
+ EntryBookDAO entryBookDAO = LimaCallaoDAOHelper
+ .getEntryBookDAO(topiaContext);
EntryDAO entryDAO = LimaCallaoDAOHelper.getEntryDAO(topiaContext);
- FinancialPeriodDAO financialPeriodDAO = LimaCallaoDAOHelper.getFinancialPeriodDAO(topiaContext);
- FinancialTransactionDAO financialTransactionDAO = LimaCallaoDAOHelper.getFinancialTransactionDAO(topiaContext);
- AccountDAO accountDAO = LimaCallaoDAOHelper.getAccountDAO(topiaContext);
-
- for (Map.Entry<Integer, FinancialTransactionImport> map : financialTransactions.entrySet() ){
- FinancialTransactionImport financialTransactionImport = map.getValue();
+ FinancialPeriodDAO financialPeriodDAO = LimaCallaoDAOHelper
+ .getFinancialPeriodDAO(topiaContext);
+ FinancialTransactionDAO financialTransactionDAO = LimaCallaoDAOHelper
+ .getFinancialTransactionDAO(topiaContext);
+ AccountDAO accountDAO = LimaCallaoDAOHelper
+ .getAccountDAO(topiaContext);
+
+ for (Map.Entry<Integer, FinancialTransactionImport> map : financialTransactions
+ .entrySet()) {
+ FinancialTransactionImport financialTransactionImport = map
+ .getValue();
FinancialTransaction financialTransaction = new FinancialTransactionImpl();
- Date dateFinancialTransaction = SDateFormat.parse(financialTransactionImport.getDate());
- financialTransaction.setTransactionDate(dateFinancialTransaction);
- financialTransaction.setAmountDebit(new Double(financialTransactionImport.getAmountDebit()));
- financialTransaction.setAmountCredit(new Double(financialTransactionImport.getAmountCredit()));
- EntryBook entryBook = entryBookDAO.findByCode(financialTransactionImport.getCodeEntryBook());
+ Date dateFinancialTransaction = SDateFormat
+ .parse(financialTransactionImport.getDate());
+ financialTransaction
+ .setTransactionDate(dateFinancialTransaction);
+ financialTransaction.setAmountDebit(new Double(
+ financialTransactionImport.getAmountDebit()));
+ financialTransaction.setAmountCredit(new Double(
+ financialTransactionImport.getAmountCredit()));
+ EntryBook entryBook = entryBookDAO
+ .findByCode(financialTransactionImport
+ .getCodeEntryBook());
financialTransaction.setEntryBook(entryBook);
-
- FinancialPeriod financialPeriod = financialPeriodDAO.findByDate(dateFinancialTransaction);
-
+
+ FinancialPeriod financialPeriod = financialPeriodDAO
+ .findByDate(dateFinancialTransaction);
+
financialTransactionDAO.create(financialTransaction);
financialPeriod.addFinancialTransaction(financialTransaction);
-
+
List<EntryImport> entryImports = entries.get(map.getKey());
for (EntryImport entryImport : entryImports) {
Entry entry = new EntryImpl();
- Account account = accountDAO.findByAccountNumber(entryImport.getAccount());
+ Account account = accountDAO
+ .findByAccountNumber(entryImport.getAccount());
entry.setAccount(account);
entry.setDescription(entryImport.getDescription());
entry.setAmount(new Double(entryImport.getAmount()));
@@ -1028,60 +1107,60 @@
financialTransaction.addEntry(entry);
}
}
- }
- catch (TopiaException eeeTE){
- doCatch(topiaContext, eeeTE, log);
- }
- catch (ParseException eeePE) {
- if(log.isDebugEnabled()){
+ } catch (TopiaException eeeTE) {
+ doCatch(topiaContext, eeeTE, log);
+ } catch (ParseException eeePE) {
+ if (log.isDebugEnabled()) {
log.debug("Can't parse date", eeePE);
}
}
return result;
}
-
- public String importIdentity(String[] nextLine, TopiaContext topiaContext) throws LimaException {
+
+ public String importIdentity(String[] nextLine, TopiaContext topiaContext)
+ throws LimaException {
String result = "";
-
- Identity identity = new IdentityImpl();
- nextLine[0] = ImportExportEntityEnum.IDENTITY.getLabel();
- identity.setName(nextLine[1]);
- identity.setDescription(nextLine[2]);
- identity.setAddress(nextLine[3]);
- identity.setAddress2(nextLine[4]);
- identity.setCity(nextLine[5]);
- identity.setPhoneNumber(nextLine[6]);
- identity.setEmail(nextLine[7]);
- identity.setZipCode(nextLine[8]);
- identity.setVatNumber(nextLine[9]);
- identity.setClassificationCode(nextLine[10]);
- identity.setBusinessNumber(nextLine[11]);
-
- identityService.updateIdentityWithTransaction(identity, topiaContext);
- //create it
- result += "SUCCESS : The identity " +
- identity.getName() + " is created ! \n";
+ Identity identity = new IdentityImpl();
+ nextLine[0] = ImportExportEntityEnum.IDENTITY.getLabel();
+ identity.setName(nextLine[1]);
+ identity.setDescription(nextLine[2]);
+ identity.setAddress(nextLine[3]);
+ identity.setAddress2(nextLine[4]);
+ identity.setCity(nextLine[5]);
+ identity.setPhoneNumber(nextLine[6]);
+ identity.setEmail(nextLine[7]);
+ identity.setZipCode(nextLine[8]);
+ identity.setVatNumber(nextLine[9]);
+ identity.setClassificationCode(nextLine[10]);
+ identity.setBusinessNumber(nextLine[11]);
+
+ identityService.updateIdentityWithTransaction(identity, topiaContext);
+ // create it
+ result += "SUCCESS : The identity " + identity.getName()
+ + " is created ! \n";
+
return result;
}
-
- protected TopiaContext beginTransaction() throws TopiaException {
- // basic check done, make check in database
- // TODO move it into JTA
- TopiaContext topiaTransaction;
- topiaTransaction = rootContext.beginTransaction();
- log.trace("beginTransaction"+topiaTransaction);
- return topiaTransaction;
- }
-
- protected void commitTransaction(TopiaContext topiaTransaction) throws TopiaException {
- try {
- topiaTransaction.commitTransaction();
- } catch (TopiaException eee) {
- if (log.isErrorEnabled()) {
- log.error("Error during commit context", eee);
- }
- throw eee;
- }
- }
+
+ protected TopiaContext beginTransaction() throws TopiaException {
+ // basic check done, make check in database
+ // TODO move it into JTA
+ TopiaContext topiaTransaction;
+ topiaTransaction = rootContext.beginTransaction();
+ log.trace("beginTransaction" + topiaTransaction);
+ return topiaTransaction;
+ }
+
+ protected void commitTransaction(TopiaContext topiaTransaction)
+ throws TopiaException {
+ try {
+ topiaTransaction.commitTransaction();
+ } catch (TopiaException eee) {
+ if (log.isErrorEnabled()) {
+ log.error("Error during commit context", eee);
+ }
+ throw eee;
+ }
+ }
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/service/LimaServiceFactory.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/service/LimaServiceFactory.java 2010-07-26 16:32:09 UTC (rev 2986)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/service/LimaServiceFactory.java 2010-07-28 09:02:22 UTC (rev 2987)
@@ -32,6 +32,8 @@
import org.apache.openejb.assembler.classic.Assembler;
import org.apache.openejb.loader.SystemInstance;
import org.chorem.lima.LimaMain;
+import org.chorem.lima.business.ServiceMonitorable;
+import org.chorem.lima.business.ejb.AbstractLimaService;
/**
* This class is a service factory based on embedded openejb container.
@@ -87,8 +89,8 @@
return instance;
}
- public <M> M getService(Class<M> serviceMonitorableClass){
- M result = (M)services.get(serviceMonitorableClass);
+ public <M> M getService(Class<M> serviceMonitorableClass){
+ M result = (M) services.get(serviceMonitorableClass);
if (result == null) {
Object ejbHome = null;
String serviceName = serviceMonitorableClass.getSimpleName().replace("Monitorable", "ImplRemote");
@@ -100,9 +102,8 @@
}
}
InvocationHandler handler = new ServiceMonitorableHandler(ejbHome);
- result = (M) Proxy.newProxyInstance(
- serviceMonitorableClass.getClassLoader(),
- new Class[]{serviceMonitorableClass}, handler);
+ result = (M) Proxy.newProxyInstance( serviceMonitorableClass.getClassLoader(), new Class[]{serviceMonitorableClass}, handler);
+
services.put(serviceMonitorableClass, result);
}
return result;
1
0
Author: jpepin
Date: 2010-07-26 18:32:09 +0200 (Mon, 26 Jul 2010)
New Revision: 2986
Url: http://chorem.org/repositories/revision/lima/2986
Log:
Ajout des plans comptables par d?\195?\169faut.
Added:
trunk/lima-swing/src/main/resources/import/pcg_base.csv
trunk/lima-swing/src/main/resources/import/pcg_developed.csv
trunk/lima-swing/src/main/resources/import/pcg_shortened.csv
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/IdentityServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/AccountService.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/IdentityService.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/IdentityServiceLocal.java
trunk/lima-swing/src/main/java/org/chorem/lima/service/ServiceMonitorableHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/DefaultAccountsChartEnum.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/DefaultEntryBooksEnum.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/DefaultFinancialStatementsEnum.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.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
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-07-23 10:42:24 UTC (rev 2985)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/DocumentServiceImpl.java 2010-07-26 16:32:09 UTC (rev 2986)
@@ -27,18 +27,22 @@
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;
import org.apache.commons.logging.LogFactory;
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.IdentityService;
+import org.chorem.lima.entity.Account;
+import org.chorem.lima.entity.Entry;
+import org.chorem.lima.entity.EntryBook;
import org.chorem.lima.entity.Identity;
-import org.chorem.lima.entity.IdentityDAO;
-import org.chorem.lima.entity.IdentityImpl;
-import org.chorem.lima.entity.LimaCallaoDAOHelper;
import org.nuiton.topia.TopiaContext;
import org.nuiton.topia.TopiaContextFactory;
import org.nuiton.topia.TopiaException;
@@ -57,6 +61,9 @@
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
@@ -67,6 +74,32 @@
private TopiaContext rootContext;
+ //Service
+ @EJB
+ IdentityService identityService;
+
+ //SDFs
+ private static SimpleDateFormat dateFormat =
+ new SimpleDateFormat("dd/MM/yyyy");
+ private static SimpleDateFormat hourFormat =
+ new SimpleDateFormat("HH:mm");
+ private static SimpleDateFormat filedateFormat =
+ new SimpleDateFormat("dd-MM-yyyy_HH-mm");
+
+ //FONTs
+ private static Font titleFont =
+ new Font(Font.HELVETICA, 14, Font.BOLD, Color.BLACK);
+ private static Font normalFont =
+ new Font(Font.HELVETICA, 9, Font.NORMAL, Color.BLACK);
+ private static Font boldFont =
+ new Font(Font.HELVETICA, 9, Font.BOLD, Color.BLACK);
+ private static Font italicFont =
+ new Font(Font.HELVETICA, 9, Font.ITALIC, Color.BLACK);
+ private static Font bolditalicFont =
+ new Font(Font.HELVETICA, 9, Font.BOLDITALIC, Color.BLACK);
+
+
+
public DocumentServiceImpl() {
LimaConfig config = LimaConfig.getInstance();
try {
@@ -78,33 +111,81 @@
}
}
+
+
+ public Table createHeaderPage(String title, Identity identity, String beginDate, String endDate){
+ Table t = null;
+ try {
+
+ //define table
+ t = new Table(4, 5);
+ t.setWidth(100f);
+ float[] widths = {0.25f, 0.45f, 0.12f, 0.18f};
+ t.setWidths(widths);
+ t.setPadding(1.5f);
+
+ //defaut cell
+ Cell cell = new Cell();
+ cell.setBorder(Rectangle.NO_BORDER);
+ t.setDefaultCell(cell);
+
+ //line 1
+ t.addCell(new Phrase(identity.getName(), bolditalicFont));
+ Cell titleCell = new Cell(new Phrase(title, titleFont));
+ titleCell.setVerticalAlignment(Element.ALIGN_MIDDLE);
+ titleCell.setHorizontalAlignment(Element.ALIGN_CENTER);
+ titleCell.setRowspan(2);
+ t.addCell(titleCell);
+ t.addCell(new Phrase("N° Siret", 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.getClassificationCode(), italicFont));
+ //line 3
+ t.addCell(new Phrase(identity.getAddress(), italicFont));
+ t.addCell("");
+ t.addCell(new Phrase("n°TVA", 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(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(endDate, italicFont));
+ } catch (BadElementException eeBEE) {
+ log.error("Can't create table", eeBEE);
+ }
+ return t;
+ }
+
+
+ //############## FinancialStatements
+
+
@Override
public void createFinancialStatementsDocuments(List<FinancialStatementAmounts> financialStatementAmounts, Date beginDate, Date endDate) throws LimaException {
Document document = new Document(PageSize.A4, 8, 8, 8, 8);
- TopiaContext topiaContext = null;
try {
- topiaContext = beginTransaction();
-
- SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
- SimpleDateFormat hourFormat = new SimpleDateFormat("HH:mm");
-
+ 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("/test_lima.pdf"));
+ new FileOutputStream("/lima_bcr"+fileDateS+".pdf"));
HtmlWriter htmlWriter = HtmlWriter.getInstance(document,
- new FileOutputStream("/test_lima.html"));
- Font numpageFont = new Font(Font.HELVETICA, 9, Font.NORMAL, Color.BLACK);
+ new FileOutputStream("/lima_bcr"+fileDateS+".html"));
document.open();
int nbpages = 1;
- Identity identity = new IdentityImpl();
+ Identity identity = identityService.getIdentity();
- IdentityDAO identityDAO = LimaCallaoDAOHelper.getIdentityDAO(topiaContext);
- List<Identity> identities = identityDAO.findAll();
- if (identities.size() !=0){
- identity = identities.get(0);
- }
-
//Split list by financialstatement type
List<List<FinancialStatementAmounts>> listList = new ArrayList<List<FinancialStatementAmounts>>();
Boolean first = true;
@@ -139,8 +220,8 @@
list.subList(i, j);
//create page : header + table + footer
Table headerPage = createHeaderPage(title, identity, dateFormat.format(beginDate), dateFormat.format(endDate));
- Table headerTable = createHeaderTable();
- Table table = createTable(subFinancialStatementAmounts);
+ Table headerTable = createHeaderTableFinancialStatement();
+ Table table = createFinancialStatementTable(subFinancialStatementAmounts);
//new page
Chapter chapter = new Chapter(0);
//headerPage
@@ -157,9 +238,8 @@
c.setBorder(Rectangle.NO_BORDER);
c.setHorizontalAlignment(Element.ALIGN_CENTER);
infos.setDefaultCell(c);
- Date newDate = new Date();
- infos.addCell(new Phrase("Date de tirage " + dateFormat.format(newDate) + " à " + hourFormat.format(newDate), numpageFont));
- infos.addCell(new Phrase("Page n° "+nbpages, numpageFont));
+ infos.addCell(new Phrase("Date de tirage " + dateS + " à " + hourS, normalFont));
+ infos.addCell(new Phrase("Page n° "+nbpages, normalFont));
paragraphPage.add(infos);
chapter.add(paragraphPage);
//headerTable
@@ -183,64 +263,10 @@
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 topiaContext", eeTE);
- }
- }
-
- public Table createHeaderPage(String title, Identity identity, String beginDate, String endDate){
- Table t = null;
- try {
-
- //define table
- t = new Table(4, 5);
- t.setWidth(100f);
- float[] widths = {0.25f, 0.45f, 0.12f, 0.18f};
- t.setWidths(widths);
- t.setPadding(1.5f);
- //define font
- Font headerFont = new Font(Font.HELVETICA, 9, Font.ITALIC, Color.BLACK);
- Font headerFontB = new Font(Font.HELVETICA, 9, Font.BOLDITALIC, Color.BLACK);
- //defaut cell
- Cell cell = new Cell();
- cell.setBorder(Rectangle.NO_BORDER);
- t.setDefaultCell(cell);
-
- //line 1
- t.addCell(new Phrase(identity.getName(), headerFontB));
- Cell titleCell = new Cell(new Phrase(title, new Font(Font.HELVETICA, 14, Font.BOLD, Color.BLACK)));
- titleCell.setVerticalAlignment(Element.ALIGN_MIDDLE);
- titleCell.setHorizontalAlignment(Element.ALIGN_CENTER);
- titleCell.setRowspan(2);
- t.addCell(titleCell);
- t.addCell(new Phrase("N° Siret", headerFontB));
- t.addCell(new Phrase(identity.getBusinessNumber(), headerFont));
- //line 2
- t.addCell(new Phrase("SSL", headerFont));
- t.addCell(new Phrase("NAF :", headerFontB));
- t.addCell(new Phrase(identity.getClassificationCode(), headerFont));
- //line 3
- t.addCell(new Phrase(identity.getAddress(), headerFont));
- t.addCell("");
- t.addCell(new Phrase("n°TVA", headerFontB));
- t.addCell(new Phrase(identity.getVatNumber(), headerFont));
- //line 4
- t.addCell(new Phrase(identity.getAddress2(), headerFont));
- t.addCell("");
- t.addCell(new Phrase("Période du", headerFontB));
- t.addCell(new Phrase(beginDate, headerFont));
- //line 5
- t.addCell(new Phrase(identity.getZipCode() + " " + identity.getCity(), headerFont));
- t.addCell("");
- t.addCell(new Phrase("au", headerFontB));
- t.addCell(new Phrase(endDate, headerFont));
- } catch (BadElementException eeBEE) {
- log.error("Can't create table", eeBEE);
}
- return t;
}
- public Table createHeaderTable(){
+ public Table createHeaderTableFinancialStatement(){
Table t = null;
try {
t = new Table(4,1);
@@ -254,11 +280,10 @@
cell.setHorizontalAlignment(Element.ALIGN_CENTER);
t.setDefaultCell(cell);
t.setOffset(8);
- Font headerFont = new Font(Font.HELVETICA, 9, Font.BOLD, Color.BLACK);
- t.addCell(new Phrase(_("lima.table.label"), headerFont));
- t.addCell(new Phrase(_("lima.table.grossamount"), headerFont));
- t.addCell(new Phrase(_("lima.table.provisiondeprecationamount"), headerFont));
- t.addCell(new Phrase(_("lima.table.netamount"), headerFont));
+ 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));
} catch (BadElementException eeBEE) {
log.error("Can't create table", eeBEE);
@@ -267,7 +292,7 @@
}
- public Table createTable(List<FinancialStatementAmounts> financialStatementAmounts){
+ public Table createFinancialStatementTable(List<FinancialStatementAmounts> financialStatementAmounts){
int nbrow = financialStatementAmounts.size();
Table t = null;
try {
@@ -284,9 +309,6 @@
cell.setBorder(Rectangle.LEFT);
cell.setHorizontalAlignment(Element.ALIGN_RIGHT);
t.setDefaultCell(cell);
-
- Font tabFontBold = new Font(Font.HELVETICA, 9, Font.BOLD, Color.BLACK);
- Font tabFont = new Font(Font.HELVETICA, 9, Font.NORMAL, Color.BLACK);
for (FinancialStatementAmounts financialStatementAmount : financialStatementAmounts) {
@@ -319,17 +341,17 @@
}
Phrase phrase = null;
if (financialStatementAmount.getHeader()){
- phrase = new Phrase(tab+label, tabFontBold);
+ phrase = new Phrase(tab+label, boldFont);
}
else {
- phrase = new Phrase(tab+label, tabFont);
+ phrase = new Phrase(tab+label, normalFont);
}
Cell c = new Cell(phrase);
c.setHorizontalAlignment(Element.ALIGN_LEFT);
t.addCell(c);
//cell2
if (grossAmount != 0.0){
- phrase = new Phrase(String.valueOf(grossAmount), tabFont);
+ phrase = new Phrase(String.valueOf(grossAmount), normalFont);
}
else {
phrase = new Phrase("");
@@ -337,7 +359,7 @@
t.addCell(phrase);
//cell 3
if (provisionDeprecationAmount != 0.0){
- phrase = new Phrase(String.valueOf(provisionDeprecationAmount), tabFont);
+ phrase = new Phrase(String.valueOf(provisionDeprecationAmount), normalFont);
}
else {
phrase = new Phrase("");
@@ -345,7 +367,7 @@
t.addCell(phrase);
//cell 4
if (grossAmount-provisionDeprecationAmount != 0.0){
- phrase = new Phrase(String.valueOf(grossAmount-provisionDeprecationAmount), tabFont);
+ phrase = new Phrase(String.valueOf(grossAmount-provisionDeprecationAmount), normalFont);
}
else {
phrase = new Phrase("");
@@ -360,7 +382,210 @@
return t;
}
+ //############## Ledger
+
+ @Override
+ public void createLedgerDocuments(List<Object> list, Date beginDate,
+ Date endDate) throws LimaException {
+ Document document = new Document(PageSize.A4, 8, 8, 8, 8);
+
+ try {
+ Date newDate = new Date();
+ String dateS = dateFormat.format(newDate);
+ String hourS = hourFormat.format(newDate);
+ String fileDateS = filedateFormat.format(newDate);
+
+ Double currentAmountDebit = 0.0;
+
+ PdfWriter pdfWriter = PdfWriter.getInstance(document,
+ new FileOutputStream("/ledger_lima"+fileDateS+".pdf"));
+ HtmlWriter htmlWriter = HtmlWriter.getInstance(document,
+ new FileOutputStream("/ledger_lima"+fileDateS+".html"));
+ document.open();
+ int nbpages = 1;
+ Identity identity = identityService.getIdentity();
+
+ //create pages
+ String title = "Ledger";
+ int i=0;
+ int n=list.size();
+ int max=n;
+ while (i<n){
+ 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);
+ //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("Date de tirage " + dateS + " à " + hourS, normalFont));
+ infos.addCell(new Phrase("Page n° "+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("");
+ chapter.add(backwardParagraph);
+ }
+
+ //table
+ Paragraph paragraphTable = new Paragraph();
+ paragraphTable.add(table);
+ chapter.add(paragraphTable);
+ //forward amounts
+ if (n>max){
+ Paragraph forwardParagraph = new Paragraph();
+ forwardParagraph.add("");
+ chapter.add(forwardParagraph);
+ }
+ //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 createHeaderTableLedger(){
+ 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);
+ //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));
+
+ } catch (BadElementException eeBEE) {
+ log.error("Can't create table", eeBEE);
+ }
+ return t;
+
+ }
+
+ public PdfPTable createTableLedger(List<Object> subList){
+ int nbrow = subList.size();
+ PdfPTable t = null;
+ try {
+ //define table
+ t = new PdfPTable(7);
+ t.setWidthPercentage(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);
+ //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);
+
+ for (Object object : subList) {
+ if (object instanceof ReportsDatas) {
+
+ ReportsDatas reportsDatas = (ReportsDatas) object;
+
+ String accountS = "";
+ Account account = reportsDatas.getAccount();
+ if (account != null){
+ accountS = account.getAccountNumber()+"\t"+account.getLabel();
+ }
+ Double amountCredit = reportsDatas.getAmountCredit();
+ Double amountDebit = reportsDatas.getAmountDebit();
+
+ PdfPCell c = new PdfPCell(new Phrase(accountS, boldFont));
+ c.setColspan(4);
+ c.setHorizontalAlignment(Element.ALIGN_LEFT);
+ 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));
+ }
+ else {
+ Entry entry = (Entry) object;
+
+ String entryBookCode = "";
+ EntryBook entryBook = entry.getFinancialTransaction().getEntryBook();
+ if (entryBook != null){
+ entryBookCode = entryBook.getCode();
+ }
+
+ 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), normalFont));
+ t.addCell(new Phrase(String.valueOf(amountCredit), normalFont));
+ t.addCell(new Phrase(String.valueOf(amountDebit-amountCredit), normalFont));
+
+ }
+ }
+ } catch (DocumentException eeDE) {
+ log.error("Can't create table", eeDE);
+
+ }
+ 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/ejb/IdentityServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/IdentityServiceImpl.java 2010-07-23 10:42:24 UTC (rev 2985)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/IdentityServiceImpl.java 2010-07-26 16:32:09 UTC (rev 2986)
@@ -56,12 +56,12 @@
}
}
+
@Override
- public Identity getIdentity() throws LimaException {
- TopiaContext topiaContext = null;
+ public Identity getIdentityWithTransaction(TopiaContext topiaContext)
+ throws LimaException {
Identity identity = null;
try {
- topiaContext = beginTransaction();
IdentityDAO identityDAO = LimaCallaoDAOHelper.getIdentityDAO(topiaContext);
List<Identity> identities = identityDAO.findAll();
@@ -72,6 +72,21 @@
catch (TopiaException ex) {
doCatch(topiaContext, ex, log);
}
+ return identity;
+ }
+
+ @Override
+ public Identity getIdentity() throws LimaException {
+ TopiaContext topiaContext = null;
+ Identity identity = null;
+ try {
+ topiaContext = beginTransaction();
+
+ identity = getIdentityWithTransaction(topiaContext);
+ }
+ catch (TopiaException ex) {
+ doCatch(topiaContext, ex, log);
+ }
finally {
doFinally(topiaContext, 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-07-23 10:42:24 UTC (rev 2985)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java 2010-07-26 16:32:09 UTC (rev 2986)
@@ -550,7 +550,6 @@
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);
@@ -581,7 +580,6 @@
*/
public String importAccountsChartsCSV(String[] nextLine, Map<String, AccountImport> accounts, TopiaContext topiaContext) throws LimaException{
String result = "";
-
String accountNumber = nextLine[1];
String label = nextLine[2];
String thirdParty = nextLine[3];
@@ -998,8 +996,9 @@
FinancialPeriodDAO financialPeriodDAO = LimaCallaoDAOHelper.getFinancialPeriodDAO(topiaContext);
FinancialTransactionDAO financialTransactionDAO = LimaCallaoDAOHelper.getFinancialTransactionDAO(topiaContext);
AccountDAO accountDAO = LimaCallaoDAOHelper.getAccountDAO(topiaContext);
- for (int num : financialTransactions.keySet()) {
- FinancialTransactionImport financialTransactionImport = financialTransactions.get(num);
+
+ for (Map.Entry<Integer, FinancialTransactionImport> map : financialTransactions.entrySet() ){
+ FinancialTransactionImport financialTransactionImport = map.getValue();
FinancialTransaction financialTransaction = new FinancialTransactionImpl();
Date dateFinancialTransaction = SDateFormat.parse(financialTransactionImport.getDate());
financialTransaction.setTransactionDate(dateFinancialTransaction);
@@ -1013,7 +1012,7 @@
financialTransactionDAO.create(financialTransaction);
financialPeriod.addFinancialTransaction(financialTransaction);
- List<EntryImport> entryImports = entries.get(num);
+ List<EntryImport> entryImports = entries.get(map.getKey());
for (EntryImport entryImport : entryImports) {
Entry entry = new EntryImpl();
Account account = accountDAO.findByAccountNumber(entryImport.getAccount());
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/AccountService.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/AccountService.java 2010-07-23 10:42:24 UTC (rev 2985)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/AccountService.java 2010-07-26 16:32:09 UTC (rev 2986)
@@ -53,11 +53,11 @@
//EJB Remote
void createAccount(Account masterAccount, Account account) throws LimaException, LimaBusinessException;
- void createSubLedger(Account masterAccount, Account account) throws LimaException;
+ void createSubLedger(Account masterAccount, Account account) throws LimaException, LimaBusinessException;
- void updateAccount(Account account) throws LimaException;
+ void updateAccount(Account account) throws LimaException, LimaBusinessException;
- void removeAccount(Account account) throws LimaException;
+ void removeAccount(Account account) throws LimaException, LimaBusinessException;
void removeAllAccount() throws LimaException;
List<Account> getAllChildrenAccounts(Account masterAccount, List<Account> accounts) throws LimaException;
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/DocumentService.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/DocumentService.java 2010-07-23 10:42:24 UTC (rev 2985)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/DocumentService.java 2010-07-26 16:32:09 UTC (rev 2986)
@@ -37,5 +37,5 @@
public interface DocumentService {
public void createFinancialStatementsDocuments(List<FinancialStatementAmounts> financialStatementAmounts, Date beginDate, Date endDate) throws LimaException;
-
+ public void createLedgerDocuments(List<Object> objects, Date beginDate, Date endDate) throws LimaException;
}
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-07-23 10:42:24 UTC (rev 2985)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/IdentityService.java 2010-07-26 16:32:09 UTC (rev 2986)
@@ -23,6 +23,7 @@
import org.chorem.lima.business.LimaException;
import org.chorem.lima.entity.Identity;
+import org.nuiton.topia.TopiaContext;
@Remote
public interface IdentityService {
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/IdentityServiceLocal.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/IdentityServiceLocal.java 2010-07-23 10:42:24 UTC (rev 2985)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/IdentityServiceLocal.java 2010-07-26 16:32:09 UTC (rev 2986)
@@ -29,6 +29,6 @@
public interface IdentityServiceLocal {
public void updateIdentityWithTransaction(Identity identity, TopiaContext topiaContext) throws LimaException;
-
+ public Identity getIdentityWithTransaction(TopiaContext topiaContext) 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-07-23 10:42:24 UTC (rev 2985)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/service/ServiceMonitorableHandler.java 2010-07-26 16:32:09 UTC (rev 2986)
@@ -24,6 +24,8 @@
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 {
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/DefaultAccountsChartEnum.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/DefaultAccountsChartEnum.java 2010-07-23 10:42:24 UTC (rev 2985)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/DefaultAccountsChartEnum.java 2010-07-26 16:32:09 UTC (rev 2986)
@@ -2,7 +2,7 @@
public enum DefaultAccountsChartEnum {
- IMPORT(""), SHORTENED(""), BASE(""), DEVELOPED("");
+ IMPORT(""), SHORTENED("pcg_shortened.csv"), BASE("pcg_base.csv"), DEVELOPED("pcg_developed.csv");
private final String filePath;
@@ -11,6 +11,10 @@
}
public String getFilePath() {
- return this.filePath;
+ String result = "";
+ if (!this.filePath.equals("")){
+ result=getClass().getResource("/import/"+this.filePath).getPath();
+ }
+ return result;
}
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/DefaultEntryBooksEnum.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/DefaultEntryBooksEnum.java 2010-07-23 10:42:24 UTC (rev 2985)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/DefaultEntryBooksEnum.java 2010-07-26 16:32:09 UTC (rev 2986)
@@ -11,6 +11,9 @@
}
public String getFilePath() {
- return this.filePath;
- }
+ String result = "";
+ if (!this.filePath.equals("")){
+ result=getClass().getResource("/import/"+this.filePath).getPath();
+ }
+ return result; }
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/DefaultFinancialStatementsEnum.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/DefaultFinancialStatementsEnum.java 2010-07-23 10:42:24 UTC (rev 2985)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/DefaultFinancialStatementsEnum.java 2010-07-26 16:32:09 UTC (rev 2986)
@@ -8,9 +8,14 @@
private DefaultFinancialStatementsEnum(String filePath) {
this.filePath = filePath;
+
}
public String getFilePath() {
- return this.filePath;
+ String result = "";
+ if (!this.filePath.equals("")){
+ result=getClass().getResource("/import/"+this.filePath).getPath();
+ }
+ return result;
}
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java 2010-07-23 10:42:24 UTC (rev 2985)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java 2010-07-26 16:32:09 UTC (rev 2986)
@@ -201,8 +201,10 @@
chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
if (chooser.showOpenDialog(viewComponent) == JFileChooser.APPROVE_OPTION) {
filePath = chooser.getSelectedFile().getAbsolutePath();
+ filePath = chooser.getSelectedFile().getAbsolutePath();
}
}
+ log.debug(filePath);
return filePath;
}
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-23 10:42:24 UTC (rev 2985)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerView.jaxx 2010-07-26 16:32:09 UTC (rev 2986)
@@ -62,9 +62,12 @@
<org.jdesktop.swingx.JXDatePicker id="endDatePicker"
onActionPerformed="getHandler().setEndDate(endDatePicker.getDate())"/>
</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.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-23 10:42:24 UTC (rev 2985)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerViewHandler.java 2010-07-26 16:32:09 UTC (rev 2986)
@@ -29,6 +29,7 @@
import org.apache.commons.logging.LogFactory;
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.ImportServiceMonitorable;
import org.chorem.lima.business.LimaException;
@@ -56,6 +57,7 @@
/** Services. */
protected ReportServiceMonitorable reportService;
+ protected DocumentServiceMonitorable documentService;
/** Account. */
protected EntryBook selectedEntryBook;
@@ -67,6 +69,8 @@
protected Date selectedEndDate;
protected BalanceTrial balanceTrialCache;
+
+ protected List<Object> cachedatasList;
protected LedgerViewHandler(LedgerView view) {
this.view = view;
@@ -75,6 +79,9 @@
LimaServiceFactory.getInstance().getService(
ReportServiceMonitorable.class);
reportService.addListener(this);
+ documentService =
+ LimaServiceFactory.getInstance().getService(
+ DocumentServiceMonitorable.class);
LimaServiceFactory.getInstance().getService(
ImportServiceMonitorable.class).addListener(this);
LimaServiceFactory.getInstance().getService(
@@ -119,8 +126,8 @@
public void refresh(){
model = view.getModelTable();
- List<Object> datasList = getDataList();
- model.refresh(datasList);
+ cachedatasList = getDataList();
+ model.refresh(cachedatasList);
/**
* set text and amounts of labels credit, debit, solde
@@ -151,6 +158,16 @@
}
}
+ public void createPdf() {
+ try {
+ documentService.createLedgerDocuments(cachedatasList, 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")){
Added: trunk/lima-swing/src/main/resources/import/pcg_base.csv
===================================================================
--- trunk/lima-swing/src/main/resources/import/pcg_base.csv (rev 0)
+++ trunk/lima-swing/src/main/resources/import/pcg_base.csv 2010-07-26 16:32:09 UTC (rev 2986)
@@ -0,0 +1,409 @@
+"ACCN";"101";"Capital";"";"10";""
+"ACCN";"104";"Primes liées au capital social";"";"10";""
+"ACCN";"105";"Ecarts de réévaluation";"";"10";""
+"ACCN";"1061";"Réserve légale";"";"106";""
+"ACCN";"1062";"Réserves indisponibles";"";"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";"107";"Ecart d'équivalence";"";"10";""
+"ACCN";"108";"Compte de l'exploitant";"";"10";""
+"ACCN";"10";"CAPITAL ET RESERVE";"";"1";""
+"ACCN";"109";"Actionnaires : capital souscrit - non appelé";"";"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";"131";"Subvention d'équipement";"";"13";""
+"ACCN";"138";"Autres subventions d'investissement";"";"13";""
+"ACCN";"13";"SUBVENTION D'NVESTISSEMENT";"";"1";""
+"ACCN";"1391";"Subventions d'équipement";"";"139";""
+"ACCN";"139";"Subventions d'investissement inscrites au compte de résultat";"";"13";""
+"ACCN";"1398";"Autres subventions d'investissement";"";"139";""
+"ACCN";"142";"Provisions réglementées relatives aux immobilisations";"";"14";""
+"ACCN";"143";"Provisions réglementées relatives aux stocks";"";"14";""
+"ACCN";"144";"Provisions réglementées relatives aux autres éléments de l'actif";"";"14";""
+"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";"153";"Provisions pour pensions et obligations similaires";"";"15";""
+"ACCN";"154";"Provisions pour restructurations";"";"15";""
+"ACCN";"155";"Provisions pour impôts";"";"15";""
+"ACCN";"156";"Provisions pour renouvellement des immobilisations (entreprises concessionnaires)";"";"15";""
+"ACCN";"157";"Provisions pour charges à répartir sur plusieurs exercices";"";"15";""
+"ACCN";"15";"PROVlSlONS POUR RISQUES ET CHARGES";"";"1";""
+"ACCN";"158";"Autres provisions pour charges";"";"15";""
+"ACCN";"161";"Emprunt obligataires convertibles";"";"16";""
+"ACCN";"163";"Autres emprunts obligataires";"";"16";""
+"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";""
+"ACCN";"174";"Dettes rattachées à des participations (hors groupe)";"";"17";""
+"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";""
+"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";"212";"Agencements et aménagements de terrains";"";"21";""
+"ACCN";"213";"Constructions";"";"21";""
+"ACCN";"214";"Constructions sur sol d'autrui";"";"21";""
+"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";""
+"ACCN";"268";"Créances rattachées à des sociétés en participation";"";"26";""
+"ACCN";"26";"PARTICIPATIONS ET CRÉANCES RATTACHÉES À DES PARTICIPATIONS";"";"2";""
+"ACCN";"269";"Versements restant à effectuer sur titres de participation non libérés";"";"26";""
+"ACCN";"271";"Titres immobilisés autres que les titres immobilisés de l'activité portefeuille (droit de propriété)";"";"27";""
+"ACCN";"272";"Titres immobilisés (droits de créance)";"";"27";""
+"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";""
+"ACCN";"317";"Fournitures A, B, C...";"";"31";""
+"ACCN";"321";"Matières consommables";"";"32";""
+"ACCN";"322";"Fournitures consommables";"";"32";""
+"ACCN";"32";"AUTRES APPROVISIONNEMENTS";"";"3";""
+"ACCN";"326";"Emballages";"";"32";""
+"ACCN";"331";"Produits en cours";"";"33";""
+"ACCN";"33";"EN-COURS DE PRODUCTION DE BIENS";"";"3";""
+"ACCN";"335";"Travaux en cours";"";"33";""
+"ACCN";"341";"Etudes en cours";"";"34";""
+"ACCN";"34";"EN-COURS DE PRODUCTION DE SERVICES";"";"3";""
+"ACCN";"345";"Prestations de services en cours";"";"34";""
+"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";"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";""
+"ACCN";"393";"Provisions pour dépréciation en-cours de production de biens";"";"39";""
+"ACCN";"394";"Provisions pour dépréciation en-cours de prod. de services";"";"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";"401";"Fournisseurs";"";"40";""
+"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";""
+"ACCN";"416";"Clients douteux ou litigieux";"";"41";""
+"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";""
+"ACCN";"425";"Personnel - Avances et acomptes";"";"42";""
+"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";""
+"ACCN";"438";"Organismes sociaux - Charges à payer et produits à recevoir";"";"43";""
+"ACCN";"441";"État - Subventions à recevoir";"";"44";""
+"ACCN";"442";"État - Impôts et taxes recouvrables sur des tiers";"";"44";""
+"ACCN";"443";"Opérations particulières avec l'état, les collectivités publiques, les organismes internationaux";"";"44";""
+"ACCN";"444";"Etat - Impôts sur les bénéfices";"";"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";"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";"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";""
+"ACCN";"446";"Obligations cautionnées";"";"44";""
+"ACCN";"44";"ETAT ET AUTRES COLLECTIVITES PUBLIQUES";"";"4";""
+"ACCN";"447";"Autres impôts; taxes et versements assimilés";"";"44";""
+"ACCN";"451";"Groupe";"";"45";""
+"ACCN";"455";"Associés - Comptes courants";"";"45";""
+"ACCN";"456";"Associés - Opérations sur le capital";"";"45";""
+"ACCN";"457";"Associés - Dividendes à payer";"";"45";""
+"ACCN";"45";"GROUPES ET ASSOCIES";"";"4";""
+"ACCN";"458";"Associés - Opérations faites en commun et en G.I.E.";"";"45";""
+"ACCN";"462";"Créances sur cessions d'immobilisations";"";"46";""
+"ACCN";"464";"Dettes sur acquisitions de valeurs mobilières de placement";"";"46";""
+"ACCN";"465";"Créances sur cessions de valeurs mobilières de placement";"";"46";""
+"ACCN";"467";"Autres comptes débiteurs ou créditeurs";"";"46";""
+"ACCN";"46";"DEBITEURS ET CREDITEURS DIVERS";"";"4";""
+"ACCN";"4686";"Charges à payer";"";"468";""
+"ACCN";"468";"Divers - Charges à payer et Produits à recevoir";"";"46";""
+"ACCN";"4687";"Produits à recevoir";"";"468";""
+"ACCN";"470";"Compte d'attente";"";"47";""
+"ACCN";"476";"Différence de conversion - Actif";"";"47";""
+"ACCN";"477";"Différences de conversion - Passif";"";"47";""
+"ACCN";"47";"COMPTES TRANSITOIRES OU D'ATTENTE";"";"4";""
+"ACCN";"478";"Autres comptes transitoires";"";"47";""
+"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";"48";"COMPTE DE REGULARISATION";"";"4";""
+"ACCN";"488";"Comptes de répartition périodique des charges et des produits";"";"48";""
+"ACCN";"4";"COMPTES DE TIERS";"";"";""
+"ACCN";"491";"Provisions pour dépréciation des comptes de clients";"";"49";""
+"ACCN";"495";"Dépréciations des comptes du groupe et des associés";"";"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";"501";"Parts dans des entreprises liées";"";"50";""
+"ACCN";"502";"Actions propres";"";"50";""
+"ACCN";"503";"Actions";"";"50";""
+"ACCN";"504";"Autres titres conférant un droit de propriété";"";"50";""
+"ACCN";"505";"Obligations et bons émis par la société et rachetés par elle";"";"50";""
+"ACCN";"506";"Obligations";"";"50";""
+"ACCN";"507";"Bons du Trésor et bons de caisse à court terme";"";"50";""
+"ACCN";"508";"Autres valeurs mobilières de placement et autres créances assimilées";"";"50";""
+"ACCN";"50";"VALEURS MOBILIERES DE PLACEMENT";"";"5";""
+"ACCN";"509";"Versements restant à effectuer sur valeurs mobilières de placement non libérées";"";"50";""
+"ACCN";"5111";"Espèces";"";"511";""
+"ACCN";"5112";"Chèques";"";"511";""
+"ACCN";"5113";"Cartes bancaires";"";"511";""
+"ACCN";"511";"Valeurs à I'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";"515";"“ Caisses ” du Trésor et des établissements publics";"";"51";""
+"ACCN";"516";"Sociétés de bourse";"";"51";""
+"ACCN";"517";"Autres organismes financiers";"";"51";""
+"ACCN";"518";"Intérêts courus";"";"51";""
+"ACCN";"51";"BANQUES; ETABLISSEMENTS FINANCIERS ET ASSIMILES";"";"5";""
+"ACCN";"519";"Concours bancaires courants";"";"51";""
+"ACCN";"52";"INSTRUMENTS DE TRÉSORIE";"";"5";""
+"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";"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";""
+"ACCN";"614";"Charges locatives et de copropriété";"";"61";""
+"ACCN";"615";"Entretien et réparations";"";"61";""
+"ACCN";"616";"Primes d'assurance";"";"61";""
+"ACCN";"617";"Études et recherches";"";"61";""
+"ACCN";"618";"Divers";"";"61";""
+"ACCN";"61";"SERVICES EXTERIEURS";"";"6";""
+"ACCN";"619";"Rabais, remises et ristournes obtenus sur services extérieurs";"";"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";"627";"Services bancaires et assimiles";"";"62";""
+"ACCN";"628";"Divers";"";"62";""
+"ACCN";"62";"AUTRES SERVICES EXTERIEURS";"";"6";""
+"ACCN";"629";"Rabais, remises et ristournes obtenus sur autres services extérieurs";"";"62";""
+"ACCN";"631";"Impôts, taxes et versements assimilés sur rémunérations (administrations des impôts)";"";"63";""
+"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";"637";"Autres impôts, taxes et versements assimilés (autres organismes)";"";"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";"646";"Cotisations sociales personnelles de l'exploitant";"";"64";""
+"ACCN";"647";"Autres charges sociales";"";"64";""
+"ACCN";"64";"CHARGES DE PERSONNEL";"";"6";""
+"ACCN";"648";"Autres charges de personnel";"";"64";""
+"ACCN";"651";"Redevances pour concessions; brevets; licences; etc.";"";"65";""
+"ACCN";"653";"Jetons de présence";"";"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";"664";"Pertes sur créances liées à des participations";"";"66";""
+"ACCN";"665";"Escomptes accordés";"";"66";""
+"ACCN";"667";"Charges nettes sur cessions de valeurs mobilières de placement";"";"66";""
+"ACCN";"66";"CHARGES FINANCIERES";"";"6";""
+"ACCN";"668";"Autres charges financières";"";"66";""
+"ACCN";"6688";"Pertes de change ou de conversion";"";"668";""
+"ACCN";"671";"Charges exceptionnelles sur opérations de gestion";"";"67";""
+"ACCN";"672";"Compte à la disposition des entités pour enregistrer, en cours d'exercice, les charges sur exercices antérieurs";"";"67";""
+"ACCN";"675";"Valeurs comptables des éléments d'actif cédés";"";"67";""
+"ACCN";"67";"CHARGES EXCEPTIONNELLES";"";"6";""
+"ACCN";"678";"Autres charges exceptionnelles";"";"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";"696";"Suppléments d'impôt sur les sociétés, liés aux distributions";"";"69";""
+"ACCN";"697";"Imposition forfaitaire annuelle des sociétés";"";"69";""
+"ACCN";"698";"Contribution additionnelle";"";"69";""
+"ACCN";"69";"PARTICIPATION DES SALARIES - IMPOTS SUR LES BENEFICES";"";"6";""
+"ACCN";"699";"Produits - Reports en arrière des déficits";"";"69";""
+"ACCN";"701";"Ventes de produits finis";"";"70";""
+"ACCN";"702";"Ventes de produits intermédiaires";"";"70";""
+"ACCN";"703";"Ventes de produits résiduels";"";"70";""
+"ACCN";"704";"Travaux";"";"70";""
+"ACCN";"705";"études";"";"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";"751";"Redevances pour concessions, brevets, licences, marques, procédés, logiciels, droits et valeurs similaires";"";"75";""
+"ACCN";"752";"Revenus des immeubles non affectés à des activités professionnelles";"";"75";""
+"ACCN";"753";"Jetons de présence et rémunérations d'administrateurs, gérants";"";"75";""
+"ACCN";"754";"Ristournes perçues des coopératives (provenant des excédents)";"";"75";""
+"ACCN";"755";"Quotes-parts de résultat sur opérations faites en commun";"";"75";""
+"ACCN";"75";"AUTRES PRODUITS DE GESTION COURANTE";"";"7";""
+"ACCN";"758";"Produits divers de gestion courante";"";"75";""
+"ACCN";"761";"Produits de participations";"";"76";""
+"ACCN";"762";"Produits des autres immobilisations financières";"";"76";""
+"ACCN";"763";"Revenus des autres créances";"";"76";""
+"ACCN";"764";"Revenus des valeurs mobilières de placement";"";"76";""
+"ACCN";"765";"Escomptes obtenus";"";"76";""
+"ACCN";"766";"Gains de change";"";"76";""
+"ACCN";"767";"Produits nets sur cessions de valeurs mobilières de placement";"";"76";""
+"ACCN";"768";"Autres produits financiers";"";"76";""
+"ACCN";"76";"PRODUITS FINANCIERS";"";"7";""
+"ACCN";"7688";"Gains de change ou de conversion";"";"76";""
+"ACCN";"771";"Produits exceptionnels sur opérations de gestion";"";"77";""
+"ACCN";"772";"Compte à la disposition des entités pour enregistrer, en cours d'exercice, les produits sur exercices ant�rieurs";"";"77";""
+"ACCN";"775";"Produits des cessions d'éléments d'actif";"";"77";""
+"ACCN";"777";"Quote-part des subventions d'investissement virée au résultat de l'exercice";"";"77";""
+"ACCN";"77";"PRODUITS EXCEPTIONNELS";"";"7";""
+"ACCN";"778";"Autres produits exceptionnels";"";"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";"801";"Engagements donnés par l'entreprise";"";"80";""
+"ACCN";"802";"Engagements reçus par l'entreprise";"";"80";""
+"ACCN";"80";"ENGAGEMENTS";"";"8";""
+"ACCN";"809";"Contrepartie des engagements";"";"80";""
+"ACCN";"88";"RESULTAT EN INSTANCE DAFFECTATION";"";"8";""
+"ACCN";"8";"COMPTES SPECIAUX";"";"";""
+"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";""
Added: trunk/lima-swing/src/main/resources/import/pcg_developed.csv
===================================================================
--- trunk/lima-swing/src/main/resources/import/pcg_developed.csv (rev 0)
+++ trunk/lima-swing/src/main/resources/import/pcg_developed.csv 2010-07-26 16:32:09 UTC (rev 2986)
@@ -0,0 +1,992 @@
+"ACCN";"1011";"Capital souscrit - non appelé";"";"101";""
+"ACCN";"1012";"Capital souscrit - appelé; non versé";"";"101";""
+"ACCN";"10131";"Capital non amorti";"";"1013";""
+"ACCN";"1013";"Capital souscrit - appelé; versé";"";"101";""
+"ACCN";"10132";"Capital amorti";"";"1013";""
+"ACCN";"101";"Capital";"";"10";""
+"ACCN";"1018";"Capital souscrit soumis a des réglementations particulières";"";"101";""
+"ACCN";"1041";"Primes d'émission";"";"104";""
+"ACCN";"1042";"Primes de fusion";"";"104";""
+"ACCN";"1043";"Primes d'apport";"";"104";""
+"ACCN";"1044";"Primes de conversion d'obligations en actions";"";"104";""
+"ACCN";"104";"Primes liées au capital social";"";"10";""
+"ACCN";"1045";"Bons de souscription d'actions";"";"104";""
+"ACCN";"1051";"Réserve spéciale de réévaluation";"";"105";""
+"ACCN";"1052";"Ecart de réévaluation libre";"";"105";""
+"ACCN";"1053";"Réserve de réévaluation";"";"105";""
+"ACCN";"1055";"Ecarts de réévaluation (autres opérations légales)";"";"105";""
+"ACCN";"1057";"Autres écarts de réévaluation en France";"";"105";""
+"ACCN";"105";"Ecarts de réévaluation";"";"10";""
+"ACCN";"1058";"Autres écarts de réévaluation a l'étranger";"";"105";""
+"ACCN";"10611";"Réserve légale proprement dite";"";"1061";""
+"ACCN";"1061";"Réserve légale";"";"106";""
+"ACCN";"10612";"Plus-value nette à long terme";"";"1061";""
+"ACCN";"1062";"Réserves indisponibles";"";"106";""
+"ACCN";"1063";"Réserves statutaires ou contractuelles";"";"106";""
+"ACCN";"10641";"Plus-values nettes a long terme";"";"1064";""
+"ACCN";"10643";"Réserves consécutives a l'octroi de subventions d'invest.";"";"1064";""
+"ACCN";"1064";"Réserves réglementées";"";"106";""
+"ACCN";"10648";"Autres réserves réglementées";"";"1064";""
+"ACCN";"106";"Réserves";"";"10";""
+"ACCN";"10681";"Réserve de propre assureur";"";"1068";""
+"ACCN";"1068";"Autres réserves";"";"106";""
+"ACCN";"10688";"Réserves diverses";"";"1068";""
+"ACCN";"107";"Ecart d'équivalence";"";"10";""
+"ACCN";"108";"Compte de l'exploitant";"";"10";""
+"ACCN";"10";"CAPITAL ET RESERVE";"";"1";""
+"ACCN";"109";"Actionnaires: capital souscrit - non appelé";"";"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";"1311";"Etat";"";"131";""
+"ACCN";"1312";"Régions";"";"131";""
+"ACCN";"1313";"Départements";"";"131";""
+"ACCN";"1314";"Communes";"";"131";""
+"ACCN";"1315";"Collectivités publiques";"";"131";""
+"ACCN";"1316";"Entreprises publiques";"";"131";""
+"ACCN";"1317";"Entreprises et organismes privés";"";"131";""
+"ACCN";"131";"Subventions d'équipement";"";"13";""
+"ACCN";"1318";"Autres";"";"131";""
+"ACCN";"138";"Autres subventions d'investissement";"";"13";""
+"ACCN";"13";"SUBVENTIONS D'INVESTISSEMENT";"";"1";""
+"ACCN";"13911";"Etat";"";"1391";""
+"ACCN";"13912";"Régions";"";"1391";""
+"ACCN";"13913";"Départements";"";"1391";""
+"ACCN";"13914";"Communes";"";"1391";""
+"ACCN";"13915";"Collectivités publiques";"";"1391";""
+"ACCN";"13916";"Entreprises publiques";"";"1391";""
+"ACCN";"13917";"Entreprises et organismes privés";"";"1391";""
+"ACCN";"1391";"Subventions d'équipement";"";"139";""
+"ACCN";"13918";"Autres";"";"1391";""
+"ACCN";"139";"Subventions d'investissement inscrites au compte de résultat";"";"13";""
+"ACCN";"1398";"Autres subventions d'investissement";"";"139";""
+"ACCN";"1423";"Provisions pour reconstitution des gisements pétroliers";"";"142";""
+"ACCN";"142";"Provisions réglementées relatives aux immobilisations";"";"14";""
+"ACCN";"1424";"Provisions pour investissement (participation des salariés)";"";"142";""
+"ACCN";"1431";"Hausse des prix";"";"143";""
+"ACCN";"143";"Provisions réglementées relatives aux stocks";"";"14";""
+"ACCN";"1432";"Fluctuation des cours";"";"143";""
+"ACCN";"144";"Provisions réglementées relatives autres éléments de l'actif";"";"14";""
+"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";"1511";"Provisions pour litiges";"";"151";""
+"ACCN";"1512";"Provisions pour garanties données aux clients";"";"151";""
+"ACCN";"1513";"Provisions pour pertes sur marches à terme";"";"151";""
+"ACCN";"1514";"Provisions pour amendes et pénalités";"";"151";""
+"ACCN";"1515";"Provisions pour pertes de change";"";"151";""
+"ACCN";"151";"Provisions pour risques";"";"15";""
+"ACCN";"1518";"Autres provisions pour risques";"";"151";""
+"ACCN";"153";"Provisions pour pensions et obligations similaires";"";"15";""
+"ACCN";"154";"Provisions pour restructurations";"";"15";""
+"ACCN";"155";"Provisions pour impôts";"";"15";""
+"ACCN";"156";"Provisions pour renouvellement des immobilisations";"";"15";""
+"ACCN";"157";"Provisions pour charges à répartir sur plusieurs exercices";"";"15";""
+"ACCN";"1572";"Provisions pour grosses réparations";"";"157";""
+"ACCN";"15";"PROVlSlONS POUR RISQUES ET CHARGES";"";"1";""
+"ACCN";"158";"Autres provisions pour charges";"";"15";""
+"ACCN";"1582";"Provisions pour charges sociales et fisc. sur congés à payer";"";"158";""
+"ACCN";"161";"Emprunts obligataires convertibles";"";"16";""
+"ACCN";"163";"Autres emprunts obligataires";"";"16";""
+"ACCN";"164";"Emprunts auprès des établissements de crédit";"";"16";""
+"ACCN";"1651";"Dépôts";"";"165";""
+"ACCN";"165";"Dépôts et cautionnements reçus";"";"16";""
+"ACCN";"1655";"Cautionnements";"";"165";""
+"ACCN";"1661";"Comptes bloqués";"";"166";""
+"ACCN";"166";"Participation des salariés aux résultats";"";"16";""
+"ACCN";"1662";"Fonds de participation";"";"166";""
+"ACCN";"1671";"Emissions de titres participatifs";"";"167";""
+"ACCN";"1674";"Avances conditionnées de l'Etat";"";"167";""
+"ACCN";"167";"Emprunts et dettes assortis de conditions particulières";"";"16";""
+"ACCN";"1675";"Emprunts participatifs";"";"167";""
+"ACCN";"1681";"Autres emprunts";"";"168";""
+"ACCN";"1685";"Rentes viagères capitalisées";"";"168";""
+"ACCN";"1687";"Autres dettes";"";"168";""
+"ACCN";"168";"Autres emprunts et dettes assimilées";"";"16";""
+"ACCN";"16881";"Sur emprunts obligataires convertibles";"";"1688";""
+"ACCN";"16883";"Sur autres emprunts obligataires";"";"1688";""
+"ACCN";"16884";"Sur emprunts auprès des établissements de crédit";"";"1688";""
+"ACCN";"16885";"Sur dépôts et cautionnements reçus";"";"1688";""
+"ACCN";"16886";"Sur participation des salariés aux résultats";"";"1688";""
+"ACCN";"16887";"Sur emprunts et dettes assortis de conditions particulières";"";"1688";""
+"ACCN";"1688";"Intérêts courus";"";"168";""
+"ACCN";"16888";"Sur autres emprunts et dettes assimilées";"";"1688";""
+"ACCN";"16";"EMPRUNTS ET DETTES ASSIMILEES";"";"1";""
+"ACCN";"169";"Primes de remboursement des obligations";"";"16";""
+"ACCN";"171";"Dettes rattachées à des participations (groupe)";"";"17";""
+"ACCN";"174";"Dettes rattachées à des participations (hors groupe)";"";"17";""
+"ACCN";"17";"DETTES RATTACHEES A DES PARTICIPATIONS";"";"1";""
+"ACCN";"1781";"Principal";"";"178";""
+"ACCN";"178";"Dettes rattachées à des sociétés en participation";"";"17";""
+"ACCN";"1788";"Intérêts courus";"";"178";""
+"ACCN";"1";"COMPTES DE CAPITAUX";"";"";""
+"ACCN";"181";"Comptes de liaison des établissements";"";"18";""
+"ACCN";"186";"Biens et prestations échangés entre établissement (charges)";"";"18";""
+"ACCN";"187";"Biens et prestations échangés entre établissement (produits)";"";"18";""
+"ACCN";"18";"COMPTES DE LIAISON DES ETABLISS. ET STES EN PARTICIPATION";"";"1";""
+"ACCN";"188";"Comptes de liaison des sociétés en participation";"";"18";""
+"ACCN";"2011";"Frais de constitution";"";"201";""
+"ACCN";"20121";"Frais de prospection";"";"2012";""
+"ACCN";"2012";"Frais de premier établissement";"";"201";""
+"ACCN";"20122";"Frais de publicité";"";"2012";""
+"ACCN";"201";"Frais détablissement";"";"20";""
+"ACCN";"2013";"Frais d'augmentation de capital et d'opérations diverses";"";"201";""
+"ACCN";"203";"Frais de recherche et de développement";"";"20";""
+"ACCN";"205";"Concessions et droits similaires";"";"20";""
+"ACCN";"206";"Droit au bail";"";"20";""
+"ACCN";"207";"Fonds commercial";"";"20";""
+"ACCN";"20";"IMMOBILISATIONS INCORPORELLES";"";"2";""
+"ACCN";"208";"Autres immobilisations incorporelles";"";"20";""
+"ACCN";"2111";"Terrains nus";"";"211";""
+"ACCN";"2112";"Terrains aménagés";"";"211";""
+"ACCN";"2113";"Sous-sols et sur-sols";"";"211";""
+"ACCN";"2114";"Terrains de gisement";"";"211";""
+"ACCN";"21141";"Carrières";"";"2114";""
+"ACCN";"21151";"Ensembles immobiliers industriels";"";"2115";""
+"ACCN";"21155";"Ensembles immobiliers administratifs et commerciaux";"";"2115";""
+"ACCN";"2115";"Terrains bâtis";"";"211";""
+"ACCN";"211581";"- Affectés aux opérations professionnelles";"";"21158";""
+"ACCN";"21158";"Autres ensembles immobiliers";"";"2115";""
+"ACCN";"211588";"- Affectés aux opérations non professionnelles";"";"21158";""
+"ACCN";"211";"Terrains";"";"21";""
+"ACCN";"2116";"Comptes d'ordre sur immobilisations";"";"211";""
+"ACCN";"212";"Agencements et aménagements de terrain";"";"21";""
+"ACCN";"21311";"Ensembles immobiliers industriels";"";"2131";""
+"ACCN";"21315";"Ensembles immobiliers administratifs et commerciaux";"";"2131";""
+"ACCN";"2131";"Bâtiments";"";"213";""
+"ACCN";"213181";"- Affectés aux opérations professionnelles";"";"21318";""
+"ACCN";"21318";"Autres ensembles immobiliers";"";"2131";""
+"ACCN";"213188";"- Affectés aux opérations non professionnelles";"";"21318";""
+"ACCN";"2135";"Installations générales; agencements; aménagements";"";"213";""
+"ACCN";"213";"Constructions";"";"21";""
+"ACCN";"21381";"Voies de terre";"";"2138";""
+"ACCN";"21382";"Voies de fer";"";"2138";""
+"ACCN";"21383";"Voies d'eau";"";"2138";""
+"ACCN";"21384";"Barrages";"";"2138";""
+"ACCN";"2138";"Ouvrages d'infrastructure";"";"213";""
+"ACCN";"21385";"Pistes daérodromes";"";"2138";""
+"ACCN";"214";"Constructions sur sol dautrui";"";"21";""
+"ACCN";"21511";"#NOM?";"";"2151";""
+"ACCN";"2151";"Installations complexes spécialisées";"";"215";""
+"ACCN";"21514";"- sur sol d'autrui";"";"2151";""
+"ACCN";"21531";"#NOM?";"";"2153";""
+"ACCN";"2153";"Installations à caractère spécifique";"";"215";""
+"ACCN";"21534";"- sur sol d'autrui";"";"2153";""
+"ACCN";"2154";"Matériel industriel";"";"215";""
+"ACCN";"2155";"Outillage industriel";"";"215";""
+"ACCN";"215";"Installations techniques; matériel et outillage industriels";"";"21";""
+"ACCN";"2157";"Agencements et aménagements du matériel et outillages ind.";"";"215";""
+"ACCN";"21";"IMMOBlLlSATIONS CORPORELLES";"";"2";""
+"ACCN";"2181";"Installations générales; agencements; aménagements divers";"";"218";""
+"ACCN";"2182";"Matériel de transport";"";"218";""
+"ACCN";"2183";"Matériel de bureau et matériel informatique";"";"218";""
+"ACCN";"2184";"Mobilier";"";"218";""
+"ACCN";"2185";"Cheptel";"";"218";""
+"ACCN";"218";"Autres immobilisations corporelles";"";"21";""
+"ACCN";"2186";"Emballages récupérables";"";"218";""
+"ACCN";"22";"IMMOBILISATIONS MISES EN CONCESSION";"";"2";""
+"ACCN";"2312";"Terrains";"";"231";""
+"ACCN";"2313";"Constructions";"";"231";""
+"ACCN";"2315";"Installations techniques; matériel et outillage industriel";"";"231";""
+"ACCN";"231";"Immobilisations corporelles en cours";"";"23";""
+"ACCN";"2318";"Autres immobilisations corporelles";"";"231";""
+"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";"2382";"Terrains";"";"238";""
+"ACCN";"2383";"Constructions";"";"238";""
+"ACCN";"2385";"Installations techniques; matériel et outillage industriel";"";"238";""
+"ACCN";"238";"Avances et acomptes versés sur immobilisations corporelles";"";"23";""
+"ACCN";"2388";"Autres immobilisations corporelles";"";"238";""
+"ACCN";"25";"ENTREPRISES LIEES - PARTS ET CREANCES";"";"2";""
+"ACCN";"2611";"Actions";"";"261";""
+"ACCN";"261";"Titres de participation";"";"26";""
+"ACCN";"2618";"Autres titres";"";"261";""
+"ACCN";"266";"Autres formes de participation";"";"26";""
+"ACCN";"2671";"Créances rattachées à des participations (groupe)";"";"267";""
+"ACCN";"2674";"Créances rattachées à des participations (hors groupe)";"";"267";""
+"ACCN";"2675";"Versements représentatifs d'apports non capitalisés";"";"267";""
+"ACCN";"2676";"Avances consolidables";"";"267";""
+"ACCN";"2677";"Autres créances rattachées à des participations";"";"267";""
+"ACCN";"267";"Créances rattachées à des participations";"";"26";""
+"ACCN";"2678";"Intérêts courus";"";"267";""
+"ACCN";"2681";"Principal";"";"268";""
+"ACCN";"268";"Créances rattachées à des sociétés en participation";"";"26";""
+"ACCN";"2688";"Intérêts courus";"";"268";""
+"ACCN";"26";"PARTICIPATIONS ET CREANCES RATTACHEES A DES PARTICIPATIONS";"";"2";""
+"ACCN";"269";"Versements restant sur titres de participation non libérés";"";"26";""
+"ACCN";"2711";"Actions";"";"271";""
+"ACCN";"271";"Titres immobilisés autres que les titres immobilisés de l'ac";"";"27";""
+"ACCN";"2718";"Autres titres";"";"271";""
+"ACCN";"2721";"Obligations";"";"272";""
+"ACCN";"272";"Titres immobilisés (droit de créance)";"";"27";""
+"ACCN";"2722";"Bons";"";"272";""
+"ACCN";"273";"Titres immobilisés de l'activité de portefeuille";"";"27";""
+"ACCN";"2741";"Prêts participatifs";"";"274";""
+"ACCN";"2742";"Prêts aux associés";"";"274";""
+"ACCN";"2743";"Prêts au personnel";"";"274";""
+"ACCN";"274";"Prêts";"";"27";""
+"ACCN";"2748";"Autres prêts";"";"274";""
+"ACCN";"2751";"Dépôts";"";"275";""
+"ACCN";"275";"Dépôts et cautionnements versés";"";"27";""
+"ACCN";"2755";"Cautionnements";"";"275";""
+"ACCN";"2761";"Créances diverses";"";"276";""
+"ACCN";"276";"Autres créances immobilisées";"";"27";""
+"ACCN";"27682";"Sur titres immobilises (droit de créance)";"";"2768";""
+"ACCN";"27684";"Sur prêts";"";"2768";""
+"ACCN";"27685";"Sur dépôts et cautionnements";"";"2768";""
+"ACCN";"2768";"Intérêts courus";"";"276";""
+"ACCN";"27688";"Sur créances diverses";"";"2768";""
+"ACCN";"2771";"Actions propres ou parts propres";"";"277";""
+"ACCN";"277";"Actions propres ou parts propres";"";"27";""
+"ACCN";"2772";"Actions propres ou parts propres en voie d'annulation";"";"277";""
+"ACCN";"27";"AUTRES IMMOBILISATIONS FINANCIERES";"";"2";""
+"ACCN";"279";"Versements restantsur titres immobilisés non libérés";"";"27";""
+"ACCN";"2801";"Frais d'établissement";"";"280";""
+"ACCN";"2803";"Frais de recherche et de développement";"";"280";""
+"ACCN";"2805";"Concessions et droits similaires; brevets; licences; logicie";"";"280";""
+"ACCN";"2807";"Fonds commercial";"";"280";""
+"ACCN";"280";"Amortissements des immobilisations incorporelles";"";"28";""
+"ACCN";"2808";"Autres immobilisations incorporelles";"";"280";""
+"ACCN";"2811";"Terrains de gisement";"";"281";""
+"ACCN";"2812";"Agencements; aménagements de terrains";"";"281";""
+"ACCN";"2813";"Constructions";"";"281";""
+"ACCN";"2814";"Constructions sur sol d'autrui";"";"281";""
+"ACCN";"2815";"Installations techniques; matériel et outillage industriels";"";"281";""
+"ACCN";"281";"Amortissements des immobilisations corporelles";"";"28";""
+"ACCN";"2818";"Autres immobilisations corporelles";"";"281";""
+"ACCN";"28";"AMORTISSEMENTS DES IMMOBILISATIONS";"";"2";""
+"ACCN";"282";"Amortissements des immobilisations mises en concession";"";"28";""
+"ACCN";"2";"COMPTES D'IMMOBILISATIONS";"";"";""
+"ACCN";"2905";"Marques; procédes; droits et valeurs similaires";"";"290";""
+"ACCN";"2906";"Droit au bail";"";"290";""
+"ACCN";"2907";"Fonds commercial";"";"290";""
+"ACCN";"290";"Provisions pour dépréciation immobilisations incorporelles";"";"29";""
+"ACCN";"2908";"Autres immobilisations incorporelles";"";"290";""
+"ACCN";"291";"Provisions pour dépréciation immobilisations corporelles";"";"29";""
+"ACCN";"2911";"Terrains (autres que terrains de gisement)";"";"291";""
+"ACCN";"292";"Provisions pour dépréciation des immos mises en concession";"";"29";""
+"ACCN";"293";"Provisions pour dépréciation des immobilisations en cours";"";"29";""
+"ACCN";"2931";"Immobilisations corporelles en cours";"";"293";""
+"ACCN";"2961";"Titres de participation";"";"296";""
+"ACCN";"2966";"Autres formes de participation";"";"296";""
+"ACCN";"2967";"Créances rattachées à des participations";"";"296";""
+"ACCN";"296";"Provisions pour dépréciation des participations et créances";"";"29";""
+"ACCN";"2968";"Créances rattachées à des sociétés en participation";"";"296";""
+"ACCN";"29";"PROVISIONS POUR DEPRECIATION DES IMMOBILISATIONS";"";"2";""
+"ACCN";"2971";"Titres immobilisés autres que les titres du portefeuille- dr";"";"297";""
+"ACCN";"2972";"Titres immobilisés - droit de créance";"";"297";""
+"ACCN";"2973";"Titres immobilisés de l'activité du portefeuille";"";"297";""
+"ACCN";"2974";"Prêts";"";"297";""
+"ACCN";"2975";"Dépôts et cautionnements versés";"";"297";""
+"ACCN";"297";"Provisions pour dépréciation des immobilisations financières";"";"29";""
+"ACCN";"2976";"Autres créances immobilisées";"";"297";""
+"ACCN";"310";"Stocks dapprovisionnement";"";"31";""
+"ACCN";"311";"Matière (ou groupe) A";"";"31";""
+"ACCN";"312";"Matière (ou groupe) B";"";"31";""
+"ACCN";"31";"MATIERES PREMIERES (et fournitures)";"";"3";""
+"ACCN";"317";"Fournitures A; B; C ...";"";"31";""
+"ACCN";"3211";"Matière (ou groupe) C";"";"321";""
+"ACCN";"321";"Matières consommables";"";"32";""
+"ACCN";"3212";"Matière (ou groupe) D";"";"321";""
+"ACCN";"3221";"Combustibles";"";"322";""
+"ACCN";"3222";"Produits d'entretien";"";"322";""
+"ACCN";"3223";"Fournitures d'atelier et d'usine";"";"322";""
+"ACCN";"3224";"Fournitures de magasin";"";"322";""
+"ACCN";"322";"Fournitures consommables";"";"32";""
+"ACCN";"3225";"Fournitures de bureau";"";"322";""
+"ACCN";"32";"AUTRES APPROVISIONNEMENTS";"";"3";""
+"ACCN";"3261";"Emballages perdus";"";"326";""
+"ACCN";"3265";"Emballages récupérables non identifiables";"";"326";""
+"ACCN";"326";"Emballages";"";"32";""
+"ACCN";"3267";"Emballages à usage mixte";"";"326";""
+"ACCN";"3311";"Produit en cours P 1";"";"331";""
+"ACCN";"331";"Produits en cours";"";"33";""
+"ACCN";"3312";"Produit en cours P 2";"";"331";""
+"ACCN";"33";"EN-COURS DE PRODUCTION DE BIENS";"";"3";""
+"ACCN";"3351";"Travaux en cours T 1";"";"335";""
+"ACCN";"335";"Travaux en cours";"";"33";""
+"ACCN";"3352";"Travaux en cours T 2";"";"335";""
+"ACCN";"3411";"Etude en cours E 1";"";"341";""
+"ACCN";"341";"Etudes en cours";"";"34";""
+"ACCN";"3412";"Etude en cours E 2";"";"341";""
+"ACCN";"34";"EN-COURS DE PRODUCTION DE SERVICES";"";"3";""
+"ACCN";"3451";"Prestation de services S 1";"";"345";""
+"ACCN";"345";"Prestations de services en cours";"";"34";""
+"ACCN";"3452";"Prestation de services S 2";"";"345";""
+"ACCN";"3511";"Produit intermédiaire (ou groupe ) A";"";"351";""
+"ACCN";"351";"Produits intermédiaires";"";"35";""
+"ACCN";"3512";"Produit intermédiaire (ou groupe) B";"";"351";""
+"ACCN";"3551";"Produit fini (ou groupe) A";"";"355";""
+"ACCN";"355";"Produits finis";"";"35";""
+"ACCN";"3552";"Produit fini (ou groupe) B";"";"355";""
+"ACCN";"35";"STOCKS DE PRODUITS";"";"3";""
+"ACCN";"3581";"Déchets";"";"358";""
+"ACCN";"3585";"Rebuts";"";"358";""
+"ACCN";"358";"Produits résiduels (ou matières de récupérations)";"";"35";""
+"ACCN";"3586";"Matières de récupération";"";"358";""
+"ACCN";"36";"STOCKS PROVENANT D'IMMOBILISATIONS";"";"3";""
+"ACCN";"370";"Stocks de marchandises";"";"37";""
+"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 DEPOT OU CONSIGNES";"";"3";""
+"ACCN";"3";"COMPTES DE STOCKS ET D'EN-COURS";"";"";""
+"ACCN";"3911";"Matière (ou groupe A)";"";"391";""
+"ACCN";"3912";"Matière (ou groupe B)";"";"391";""
+"ACCN";"391";"Provisions pour dépréciation des stocks dapprovisionnement";"";"39";""
+"ACCN";"3917";"Fourniture A; B; C ...";"";"391";""
+"ACCN";"3921";"Matières consommables (même ventilation que celle du compte";"";"392";""
+"ACCN";"3922";"Fournitures consommables";"";"392";""
+"ACCN";"392";"Provisions pour dépréciation des autres approvisionnements";"";"39";""
+"ACCN";"3926";"Emballages";"";"392";""
+"ACCN";"3931";"Produits en cours";"";"393";""
+"ACCN";"393";"Provisions pour dépréciation en-cours de production de biens";"";"39";""
+"ACCN";"3935";"Travaux en cours";"";"393";""
+"ACCN";"3941";"Etudes en cours";"";"394";""
+"ACCN";"394";"Provisions pour dépréciation en-cours de prod. de services";"";"39";""
+"ACCN";"3945";"Prestations de services en cours";"";"394";""
+"ACCN";"3951";"Produits intermédiaires";"";"395";""
+"ACCN";"395";"Provisions pour dépréciation des stocks de produits";"";"39";""
+"ACCN";"3955";"Produits finis";"";"395";""
+"ACCN";"39";"PROVISIONS POUR DEPRECIATION DES STOCKS ET EN-COURS";"";"3";""
+"ACCN";"3971";"Marchandise (ou groupe) A";"";"397";""
+"ACCN";"397";"Provisions pour dépréciation des stocks de marchandises";"";"39";""
+"ACCN";"3972";"Marchandise (ou groupe) B";"";"397";""
+"ACCN";"400";"Fournisseurs et comptes rattachés";"";"40";""
+"ACCN";"4011";"Fournisseurs - Achats de biens ou de prestations de services";"";"401";""
+"ACCN";"401";"Fournisseurs";"";"40";""
+"ACCN";"4017";"Fournisseurs - Retenue de garantie";"";"401";""
+"ACCN";"403";"Fournisseurs - Effets à payer";"";"40";""
+"ACCN";"4041";"Fournisseurs - Achats d'immobilisations";"";"404";""
+"ACCN";"404";"Fournisseurs d'immobilisations";"";"40";""
+"ACCN";"4047";"Fournisseurs d'immobilisations - Retenues de garantie";"";"404";""
+"ACCN";"405";"Fournisseurs d'immobilisations - Effets a payer";"";"40";""
+"ACCN";"4081";"Fournisseurs";"";"408";""
+"ACCN";"4084";"Fournisseurs d'immobilisations";"";"408";""
+"ACCN";"408";"Fournisseurs - Factures non parvenues";"";"40";""
+"ACCN";"4088";"Fournisseurs - Intérêts courus";"";"408";""
+"ACCN";"40";"FOURNISSEURS ET COMPTES RATTACHES";"";"4";""
+"ACCN";"4091";"Fournisseurs - Avances et acomptes versés sur commandes";"";"409";""
+"ACCN";"4096";"Fournisseurs - Créances pour emballages et matériel à rendre";"";"409";""
+"ACCN";"40971";"Fournisseurs d'exploitation";"";"4097";""
+"ACCN";"4097";"Fournisseurs - Autres avoirs";"";"409";""
+"ACCN";"40974";"Fournisseurs d'immobilisations";"";"4097";""
+"ACCN";"409";"Fournisseurs débiteurs";"";"40";""
+"ACCN";"4098";"Rabais; remises; ristournes à obtenir";"";"409";""
+"ACCN";"410";"Clients et comptes rattachés";"";"41";""
+"ACCN";"4111";"Clients - Ventes de biens ou de prestations de services";"";"411";""
+"ACCN";"411";"Clients";"";"41";""
+"ACCN";"4117";"Clients - Retenues de garanties";"";"411";""
+"ACCN";"413";"Clients - Effets a recevoir";"";"41";""
+"ACCN";"416";"Clients douteux ou litigieux";"";"41";""
+"ACCN";"417";"Créances sur travaux non encore facturables";"";"41";""
+"ACCN";"4181";"Clients - Factures à établir";"";"418";""
+"ACCN";"418";"Clients - Produits non encore facturés";"";"41";""
+"ACCN";"4188";"Clients - Intérêts courus";"";"418";""
+"ACCN";"41";"CLIENTS ET COMPTES RATTACHES";"";"4";""
+"ACCN";"4191";"Clients - Avances et acomptes reçus sur commandes";"";"419";""
+"ACCN";"4196";"Clients - Dettes pour emballages et matériel consignés";"";"419";""
+"ACCN";"4197";"Clients - Autres avoirs";"";"419";""
+"ACCN";"419";"Clients créditeurs";"";"41";""
+"ACCN";"4198";"Rabais; remises; ristournes à accorder";"";"419";""
+"ACCN";"421";"Personnel - Rémunérations dues";"";"42";""
+"ACCN";"422";"Comités d'entreprise; d'établissement";"";"42";""
+"ACCN";"4246";"Réserve spéciale (art. L442-2 du Code du Travail)";"";"424";""
+"ACCN";"424";"Participation des salariés aux fruits de l'expansion";"";"42";""
+"ACCN";"4248";"Comptes courants";"";"424";""
+"ACCN";"425";"Personnel - Avances et acomptes";"";"42";""
+"ACCN";"426";"Personnel - Dépôts";"";"42";""
+"ACCN";"427";"Personnel - Oppositions";"";"42";""
+"ACCN";"42";"PERSONNEL ET COMPTES RATTACHES";"";"4";""
+"ACCN";"4282";"Dettes provisionnées pour congés à payer";"";"428";""
+"ACCN";"4284";"Dettes provisionnées pour participation des salariés aux rés";"";"428";""
+"ACCN";"4286";"Autres charges à payer";"";"428";""
+"ACCN";"428";"Personnel - Charges à payer et produits à recevoir";"";"42";""
+"ACCN";"4287";"Produits à recevoir";"";"428";""
+"ACCN";"431";"Sécurité sociale";"";"43";""
+"ACCN";"437";"Autres organismes sociaux";"";"43";""
+"ACCN";"43";"SECURITE SOCIALE - AUTRES ORGANISMES SOCIAUX";"";"4";""
+"ACCN";"4382";"Charges sociales sur congés à payer";"";"438";""
+"ACCN";"4386";"Autres charges à payer";"";"438";""
+"ACCN";"438";"Organismes sociaux - Charges à payer et produits à recevoir";"";"43";""
+"ACCN";"4387";"Produits à recevoir";"";"438";""
+"ACCN";"4411";"Subventions d'investissement";"";"441";""
+"ACCN";"4417";"Subventions d'exploitation";"";"441";""
+"ACCN";"4418";"Subventions d'équilibre";"";"441";""
+"ACCN";"441";"Etat - Subventions à recevoir";"";"44";""
+"ACCN";"4419";"Avances sur subventions";"";"441";""
+"ACCN";"4424";"Obligataires";"";"442";""
+"ACCN";"442";"Etat - Impôts et taxes recouvrables sur des tiers";"";"44";""
+"ACCN";"4425";"Associés";"";"442";""
+"ACCN";"443";"Opérations particulières avec l'Etat; les collectivités";"";"44";""
+"ACCN";"444";"Etat - Impôts sur les bénéfices";"";"44";""
+"ACCN";"4452";"TVA due intracommunautaire";"";"445";""
+"ACCN";"44551";"TVA à décaisser";"";"4455";""
+"ACCN";"4455";"Taxes sur le chiffre d'affaires à décaisser";"";"445";""
+"ACCN";"44558";"Taxes assimilées à la TVA";"";"4455";""
+"ACCN";"44562";"TVA sur immobilisations";"";"4456";""
+"ACCN";"44563";"TVA transférée par d'autres entreprises";"";"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";"44567";"Crédit de TVA à reporter";"";"4456";""
+"ACCN";"4456";"Taxes sur le chiffre d'affaires déductible";"";"445";""
+"ACCN";"44568";"Taxes assimilées à la TVA";"";"4456";""
+"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";"4457";"Taxes sur le chiffre d'affaires collectées par l'entreprise";"";"445";""
+"ACCN";"44578";"Taxes assimilées à la TVA";"";"4457";""
+"ACCN";"445";"Etat - Taxes sur le chiffre d'affaires";"";"44";""
+"ACCN";"44581";"Acomptes - Régime simplifié d'imposition";"";"4458";""
+"ACCN";"44582";"Acomptes - Régime du forfait";"";"4458";""
+"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";""
+"ACCN";"446";"Obligations cautionnées";"";"44";""
+"ACCN";"447";"Autres impôts; taxes et versements assimilés";"";"44";""
+"ACCN";"44";"ETAT ET AUTRES COLLECTIVITES PUBLIQUES";"";"4";""
+"ACCN";"4482";"Charges fiscales sur congés à payer";"";"448";""
+"ACCN";"4486";"Autres charges à payer";"";"448";""
+"ACCN";"448";"Etat - Charges à payer et produits à recevoir";"";"44";""
+"ACCN";"4487";"Produits à recevoir";"";"448";""
+"ACCN";"451";"Groupe";"";"45";""
+"ACCN";"4551";"Principal";"";"455";""
+"ACCN";"455";"Associés - Comptes courants";"";"45";""
+"ACCN";"4558";"Intérêts courus";"";"455";""
+"ACCN";"45611";"Apports en nature";"";"4561";""
+"ACCN";"4561";"Associés - Comptes d'apport en société";"";"456";""
+"ACCN";"45615";"Apports en numéraire";"";"4561";""
+"ACCN";"45621";"Actionnaires - Capital souscrit et appelé; non versé";"";"4562";""
+"ACCN";"4562";"Apporteurs - Capital appelé; non versé";"";"456";""
+"ACCN";"45625";"Associés - Capital appelé; non versé";"";"4562";""
+"ACCN";"4563";"Associés - Versements reçus sur augmentation de capital";"";"456";""
+"ACCN";"4564";"Associés - Versements anticipés";"";"456";""
+"ACCN";"4566";"Actionnaires défaillants";"";"456";""
+"ACCN";"456";"Associés - Opérations sur le capital";"";"45";""
+"ACCN";"4567";"Associés - Capital à rembourser";"";"456";""
+"ACCN";"457";"Associés - Dividendes à payer";"";"45";""
+"ACCN";"45";"GROUPES ET ASSOCIES";"";"4";""
+"ACCN";"4581";"Opérations courantes";"";"458";""
+"ACCN";"458";"Associés - Opérations faites en commun et en G.I.E.";"";"45";""
+"ACCN";"4588";"Intérêts courus";"";"458";""
+"ACCN";"462";"Créances sur cessions d'immobilisations";"";"46";""
+"ACCN";"464";"Dettes sur acquisition de valeurs mobilières de placement";"";"46";""
+"ACCN";"465";"Créances sur cessions de valeurs mobilières de placement";"";"46";""
+"ACCN";"467";"Autres comptes débiteurs ou créditeurs";"";"46";""
+"ACCN";"46";"DEBITEURS ET CREDITEURS DIVERS";"";"4";""
+"ACCN";"4686";"Charges à payer";"";"468";""
+"ACCN";"468";"Divers - Charges à payer et Produits à recevoir";"";"46";""
+"ACCN";"4687";"Produits à recevoir";"";"468";""
+"ACCN";"470";"Compte d'attente";"";"47";""
+"ACCN";"471";"Compte d'attente";"";"47";""
+"ACCN";"4761";"Diminution des créances";"";"476";""
+"ACCN";"4762";"Augmentation des dettes";"";"476";""
+"ACCN";"476";"Différences de conversion - Actif";"";"47";""
+"ACCN";"4768";"Différences compensées par couverture de change";"";"476";""
+"ACCN";"4771";"Augmentation des créances";"";"477";""
+"ACCN";"4772";"Diminution des dettes";"";"477";""
+"ACCN";"477";"Différences de conversion - Passif";"";"47";""
+"ACCN";"4778";"Différences compensées par couverture de change";"";"477";""
+"ACCN";"47";"COMPTES TRANSITOIRES OU D'ATTENTE";"";"4";""
+"ACCN";"478";"Autres comptes transitoires";"";"47";""
+"ACCN";"4811";"Charges différées";"";"481";""
+"ACCN";"4812";"Frais d'acquisition des immobilisations";"";"481";""
+"ACCN";"4816";"Frais démission des emprunts";"";"481";""
+"ACCN";"481";"Charges à repartir sur plusieurs exercices";"";"48";""
+"ACCN";"4818";"Charges à étaler";"";"481";""
+"ACCN";"486";"Charges constatées d'avance";"";"48";""
+"ACCN";"487";"Produits constatés d'avance";"";"48";""
+"ACCN";"48";"COMPTE DE REGULARISATION";"";"4";""
+"ACCN";"4886";"Charges";"";"488";""
+"ACCN";"488";"Comptes de répartition périodique des charges et produits";"";"48";""
+"ACCN";"4887";"Produits";"";"488";""
+"ACCN";"4";"COMPTES DE TIERS";"";"";""
+"ACCN";"491";"Provisions pour dépréciation des comptes de clients";"";"49";""
+"ACCN";"4951";"Comptes du groupe";"";"495";""
+"ACCN";"4955";"Comptes courants des associés";"";"495";""
+"ACCN";"495";"Provisions pour dépréciation comptes du groupe et associés";"";"49";""
+"ACCN";"4958";"Opérations faites en commun et en G.I.E.";"";"495";""
+"ACCN";"49";"PROVISIONS POUR DEPRECIATION DES COMPTES DE TIERS";"";"4";""
+"ACCN";"4962";"Créances sur cessions d'immobilisations";"";"496";""
+"ACCN";"4965";"Créances sur cessions de valeurs mobilières de placement";"";"496";""
+"ACCN";"496";"Provisions pour dépréciation des comptes de débiteurs divers";"";"49";""
+"ACCN";"4967";"Autres comptes débiteurs";"";"496";""
+"ACCN";"501";"Parts dans des entreprises liées";"";"50";""
+"ACCN";"502";"Actions propres";"";"50";""
+"ACCN";"5031";"Titres cotés";"";"503";""
+"ACCN";"503";"Actions";"";"50";""
+"ACCN";"5035";"Titres non cotés";"";"503";""
+"ACCN";"504";"Autres titres conférant un droit de propriété";"";"50";""
+"ACCN";"505";"Obligations et bons émis par la société et rachetés par elle";"";"50";""
+"ACCN";"5061";"Titres cotés";"";"506";""
+"ACCN";"506";"Obligations";"";"50";""
+"ACCN";"5065";"Titres non cotés";"";"506";""
+"ACCN";"507";"Bons du Trésor et bons de caisse à court terme";"";"50";""
+"ACCN";"5081";"Autres valeurs mobilières";"";"508";""
+"ACCN";"5082";"Bons de souscription";"";"508";""
+"ACCN";"508";"Autres valeurs mobilières de placement et autres créances as";"";"50";""
+"ACCN";"5088";"Intérêts courus sur obligations; bons et valeurs assimilées";"";"508";""
+"ACCN";"50";"VALEURS MOBILIERES DE PLACEMENT";"";"5";""
+"ACCN";"509";"Versements restant sur valeurs mobilières de placement";"";"50";""
+"ACCN";"5111";"Espèces";"";"511";""
+"ACCN";"5112";"Chèques";"";"511";""
+"ACCN";"5113";"Cartes bancaires";"";"511";""
+"ACCN";"511";"Valeurs à I'encaissement";"";"51";""
+"ACCN";"5114";"Autres paiements";"";"511";""
+"ACCN";"5121";"Banque principale";"";"512";""
+"ACCN";"5122";"Banque secondaire";"";"512";""
+"ACCN";"512";"Banques";"";"51";""
+"ACCN";"5124";"Comptes en devises";"";"512";""
+"ACCN";"514";"Chèques postaux";"";"51";""
+"ACCN";"515";"Caisses du Trésor et des établissements publics";"";"51";""
+"ACCN";"516";"Sociétés de bourse";"";"51";""
+"ACCN";"517";"Autres organismes financiers";"";"51";""
+"ACCN";"5186";"Intérêts courus à payer";"";"518";""
+"ACCN";"518";"Intérêts courus";"";"51";""
+"ACCN";"5187";"Intérêts courus à recevoir";"";"518";""
+"ACCN";"51";"BANQUES; ETABLISSEMENTS FINANCIERS ET ASSIMILES";"";"5";""
+"ACCN";"5191";"Crédit de mobilisation de créances commerciales (CMCC)";"";"519";""
+"ACCN";"5193";"Mobilisation de créances nées à létranger";"";"519";""
+"ACCN";"519";"Concours bancaires courants";"";"51";""
+"ACCN";"5198";"Intérêts courus sur concours bancaires courants";"";"519";""
+"ACCN";"52";"Instruments de trésorerie";"";"5";""
+"ACCN";"530";"Caisse";"";"53";""
+"ACCN";"5311";"Caisse en monnaie nationale";"";"531";""
+"ACCN";"531";"Caisse siège social";"";"53";""
+"ACCN";"5314";"Caisse en devises";"";"531";""
+"ACCN";"532";"Caisse succursale (ou usine) A";"";"53";""
+"ACCN";"53";"CAISSE";"";"5";""
+"ACCN";"533";"Caisse succursale (ou usine) B";"";"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";"5903";"Actions";"";"590";""
+"ACCN";"5904";"Autres titres conférant un droit de propriété";"";"590";""
+"ACCN";"5906";"Obligations";"";"590";""
+"ACCN";"590";"Provisions pour dépréciation valeurs mobilières de placement";"";"59";""
+"ACCN";"5908";"Autres valeurs mobilières de placement et créances assimilée";"";"590";""
+"ACCN";"6011";"Matière (ou groupe) A";"";"601";""
+"ACCN";"6012";"Matière (ou groupe) B";"";"601";""
+"ACCN";"601";"Achats stockés - Matières premières (et fournitures)";"";"60";""
+"ACCN";"6017";"Fournitures A; B; C ...";"";"601";""
+"ACCN";"60211";"Matière (ou groupe) C";"";"6021";""
+"ACCN";"6021";"Matières consommables";"";"602";""
+"ACCN";"60212";"Matière (ou groupe) D";"";"6021";""
+"ACCN";"60221";"Combustibles";"";"6022";""
+"ACCN";"60222";"Produits d'entretien";"";"6022";""
+"ACCN";"60223";"Fournitures d'atelier et d'usine";"";"6022";""
+"ACCN";"60224";"Fournitures de magasin";"";"6022";""
+"ACCN";"6022";"Fournitures consommables";"";"602";""
+"ACCN";"60225";"Fournitures de bureau";"";"6022";""
+"ACCN";"602";"Achats stockés - Autres approvisionnements";"";"60";""
+"ACCN";"60261";"Emballages perdus";"";"6026";""
+"ACCN";"60265";"Emballages récupérables non identifiables";"";"6026";""
+"ACCN";"6026";"Emballages";"";"602";""
+"ACCN";"60267";"Emballages à usage mixte";"";"6026";""
+"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";"6037";"Variation des stocks de marchandises";"";"603";""
+"ACCN";"604";"Achats détudes et prestations de service";"";"60";""
+"ACCN";"605";"Achats de matériel; équipements et travaux";"";"60";""
+"ACCN";"6061";"Fournitures non stockables (eau; énergie; ...)";"";"606";""
+"ACCN";"6063";"Fournitures d'entretien et de petit équipement";"";"606";""
+"ACCN";"6064";"Fournitures administratives";"";"606";""
+"ACCN";"606";"Achats non stockés de matières et fournitures";"";"60";""
+"ACCN";"6068";"Autres matières et fournitures";"";"606";""
+"ACCN";"6071";"Marchandise (ou groupe) A";"";"607";""
+"ACCN";"607";"Achats de marchandises";"";"60";""
+"ACCN";"6072";"Marchandise (ou groupe ) B";"";"607";""
+"ACCN";"608";"Frais accessoires d'achat";"";"60";""
+"ACCN";"60";"ACHATS (sauf 603)";"";"6";""
+"ACCN";"6091";"- de matières premières (et fournitures)";"";"609";""
+"ACCN";"6092";"- d'autres approvisionnements stockés";"";"609";""
+"ACCN";"6094";"- détudes et prestations de services";"";"609";""
+"ACCN";"6095";"- de matériel; équipements et travaux";"";"609";""
+"ACCN";"6096";"- d'approvisionnements non stockés";"";"609";""
+"ACCN";"609";"Rabais; remises et ristournes obtenus sur achats";"";"60";""
+"ACCN";"6097";"#NOM?";"";"609";""
+"ACCN";"611";"Sous-traitance générale";"";"61";""
+"ACCN";"6122";"Crédit-bail mobilier";"";"612";""
+"ACCN";"612";"Redevances de crédit-bail";"";"61";""
+"ACCN";"6125";"Crédit-bail immobilier";"";"612";""
+"ACCN";"6132";"Locations immobilières";"";"613";""
+"ACCN";"6135";"Locations mobilières";"";"613";""
+"ACCN";"613";"Locations";"";"61";""
+"ACCN";"6136";"Malis sur emballages";"";"613";""
+"ACCN";"614";"Charges locatives et de copropriété";"";"61";""
+"ACCN";"6152";"#NOM?";"";"615";""
+"ACCN";"6155";"#NOM?";"";"615";""
+"ACCN";"615";"Entretien et réparations";"";"61";""
+"ACCN";"6156";"Maintenance";"";"615";""
+"ACCN";"6161";"Multirisques";"";"616";""
+"ACCN";"6162";"Assurance obligatoire dommage - construction";"";"616";""
+"ACCN";"61636";"#NOM?";"";"6163";""
+"ACCN";"61637";"#NOM?";"";"6163";""
+"ACCN";"6163";"Assurance - transport";"";"616";""
+"ACCN";"61638";"#NOM?";"";"6163";""
+"ACCN";"6164";"Risques d'exploitation";"";"616";""
+"ACCN";"616";"Primes d'assurance";"";"61";""
+"ACCN";"6165";"Insolvabilité clients";"";"616";""
+"ACCN";"617";"Etudes et recherches";"";"61";""
+"ACCN";"6181";"Documentation générale";"";"618";""
+"ACCN";"6183";"Documentation technique";"";"618";""
+"ACCN";"618";"Divers";"";"61";""
+"ACCN";"6185";"Frais de colloques; séminaires; conférences";"";"618";""
+"ACCN";"61";"SERVICES EXTERIEURS";"";"6";""
+"ACCN";"619";"Rabais remises et ristournes obtenus sur services extérieurs";"";"61";""
+"ACCN";"6211";"Personnel intérimaire";"";"621";""
+"ACCN";"621";"Personnel extérieur à l'entreprise";"";"62";""
+"ACCN";"6214";"Personnel détaché ou prêté à l'entreprise";"";"621";""
+"ACCN";"6221";"Commissions et courtages sur achats";"";"622";""
+"ACCN";"6222";"Commissions et courtages sur ventes";"";"622";""
+"ACCN";"6224";"Rémunérations des transitaires";"";"622";""
+"ACCN";"6225";"Rémunérations d'affacturage";"";"622";""
+"ACCN";"6226";"Honoraires";"";"622";""
+"ACCN";"6227";"Frais d'actes et de contentieux";"";"622";""
+"ACCN";"622";"Rémunérations dintermédiaires et honoraires";"";"62";""
+"ACCN";"6228";"Divers";"";"622";""
+"ACCN";"6231";"Annonces et insertions";"";"623";""
+"ACCN";"6232";"Echantillons";"";"623";""
+"ACCN";"6233";"Foires et expositions";"";"623";""
+"ACCN";"6234";"Cadeaux à la clientèle";"";"623";""
+"ACCN";"6235";"Primes";"";"623";""
+"ACCN";"6236";"Catalogues et imprimés";"";"623";""
+"ACCN";"6237";"Publications";"";"623";""
+"ACCN";"623";"Publicité; publications; relations publiques";"";"62";""
+"ACCN";"6238";"Divers (pourboires; dons courants; ...)";"";"623";""
+"ACCN";"6241";"Transports sur achats";"";"624";""
+"ACCN";"6242";"Transports sur ventes";"";"624";""
+"ACCN";"6243";"Transports entre établissements ou chantiers";"";"624";""
+"ACCN";"6244";"Transports administratifs";"";"624";""
+"ACCN";"6247";"Transports collectifs du personnel";"";"624";""
+"ACCN";"624";"Transports de biens et transports collectifs du personnel";"";"62";""
+"ACCN";"6248";"Divers";"";"624";""
+"ACCN";"6251";"Voyages et déplacements";"";"625";""
+"ACCN";"6255";"Frais de déménagement";"";"625";""
+"ACCN";"6256";"Missions";"";"625";""
+"ACCN";"625";"Déplacements; missions et réceptions";"";"62";""
+"ACCN";"6257";"Réceptions";"";"625";""
+"ACCN";"626";"Frais postaux et frais de télécommunications";"";"62";""
+"ACCN";"6271";"Frais sur titres (achat; vente; garde)";"";"627";""
+"ACCN";"6272";"Commissions et frais sur émission d'emprunts";"";"627";""
+"ACCN";"6275";"Frais sur effets (commissions d'endos; ...)";"";"627";""
+"ACCN";"6276";"Location de coffres";"";"627";""
+"ACCN";"627";"Services bancaires et assimiles";"";"62";""
+"ACCN";"6278";"Autres frais et commissions sur prestations de services";"";"627";""
+"ACCN";"6281";"Concours divers (cotisations; ...)";"";"628";""
+"ACCN";"628";"Divers";"";"62";""
+"ACCN";"6284";"Frais de recrutement de personnel";"";"628";""
+"ACCN";"62";"AUTRES SERVICES EXTERIEURS";"";"6";""
+"ACCN";"629";"Rabais; remises et ristournes obtenus sur services ext.";"";"62";""
+"ACCN";"6311";"Taxe sur les salaires";"";"631";""
+"ACCN";"6312";"Taxe d'apprentissage";"";"631";""
+"ACCN";"6313";"Participation des employeurs à la formation professionnelle";"";"631";""
+"ACCN";"6314";"Cotisation pour défaut d'investissement obligatoire";"";"631";""
+"ACCN";"631";"Impôts; taxes sur rémunérations (administration)";"";"63";""
+"ACCN";"6318";"Autres";"";"631";""
+"ACCN";"6331";"Versement de transport";"";"633";""
+"ACCN";"6332";"Allocation logement";"";"633";""
+"ACCN";"6333";"Participation des employeurs à la formation professionnelle";"";"633";""
+"ACCN";"6334";"Participation des employeurs à l'effort de construction";"";"633";""
+"ACCN";"6335";"Versements libératoires (exonération taxe apprentissage)";"";"633";""
+"ACCN";"633";"Impôts; taxes et versements sur rémunérations (autres org.)";"";"63";""
+"ACCN";"6338";"Autres";"";"633";""
+"ACCN";"63511";"Taxe professionnelle";"";"6351";""
+"ACCN";"63512";"Taxes foncières";"";"6351";""
+"ACCN";"63513";"Autres impôts locaux";"";"6351";""
+"ACCN";"6351";"Impôts directs (sauf impôts sur les bénéfices)";"";"635";""
+"ACCN";"63514";"Taxes sur les véhicules des sociétés";"";"6351";""
+"ACCN";"6352";"Taxes sur le chiffre d'affaires non récupérables";"";"635";""
+"ACCN";"6353";"Impôts indirects";"";"635";""
+"ACCN";"6354";"Droits d'enregistrement et de timbre";"";"635";""
+"ACCN";"63541";"Droits de mutation";"";"6354";""
+"ACCN";"635";"Autres impôts; taxes et versements (administration)";"";"63";""
+"ACCN";"6358";"Autres droits";"";"635";""
+"ACCN";"63";"IMPOTS; TAXES ET VERSEMENTS";"";"6";""
+"ACCN";"6371";"Contribution sociale de solidarité à la charge des sociétés";"";"637";""
+"ACCN";"6372";"Taxes perçues par les organismes publics internationaux";"";"637";""
+"ACCN";"6374";"Impôts et taxes exigibles à l'étranger";"";"637";""
+"ACCN";"637";"Autres impôts et taxes (autres organismes)";"";"63";""
+"ACCN";"6378";"Taxes diverses";"";"637";""
+"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";"641";"Rémunérations du personnel";"";"64";""
+"ACCN";"6415";"Supplément familial";"";"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";"6454";"Cotisations aux ASSEDIC";"";"645";""
+"ACCN";"645";"Charges de sécurité sociale et de prévoyance";"";"64";""
+"ACCN";"6458";"Cotisations aux autres organismes sociaux";"";"645";""
+"ACCN";"646";"Cotisations sociales personnelles de l'exploitant";"";"64";""
+"ACCN";"6471";"Prestations directes";"";"647";""
+"ACCN";"6472";"Versements aux comités d'entreprise et d'établissement";"";"647";""
+"ACCN";"6473";"Versements aux comités dhygiène et de sécurité";"";"647";""
+"ACCN";"6474";"Versement aux autres oeuvres sociales";"";"647";""
+"ACCN";"647";"Autres charges sociales";"";"64";""
+"ACCN";"6475";"Médecine du travail; pharmacie";"";"647";""
+"ACCN";"64";"CHARGES DE PERSONNEL";"";"6";""
+"ACCN";"648";"Autres charges de personnel";"";"64";""
+"ACCN";"6511";"Redevances pour concessions; brevets; licences; marques; log";"";"651";""
+"ACCN";"6516";"Droits d'auteur et de reproduction";"";"651";""
+"ACCN";"651";"Redevances pour concessions; brevets; licences; etc.";"";"65";""
+"ACCN";"6518";"Autres droits et valeurs similaires";"";"651";""
+"ACCN";"653";"Jetons de présence";"";"65";""
+"ACCN";"6541";"Créances de l'exercice";"";"654";""
+"ACCN";"654";"Pertes sur créances irrécouvrables";"";"65";""
+"ACCN";"6544";"Créances des exercices antérieurs";"";"654";""
+"ACCN";"6551";"Quote-part de bénéfice transférée (comptabilité du gérant)";"";"655";""
+"ACCN";"655";"Quote-part de résultat sur opérations faites en commun";"";"65";""
+"ACCN";"6555";"Quote-part de perte supportée (comptabilité des associés)";"";"655";""
+"ACCN";"65";"AUTRES CHARGES DE GESTION COURANTE";"";"6";""
+"ACCN";"658";"Autres charges de gestion courante";"";"65";""
+"ACCN";"66116";"- des emprunts et dettes assimilées";"";"6611";""
+"ACCN";"6611";"Intérêts des emprunts et dettes";"";"661";""
+"ACCN";"66117";"- des dettes rattachées à des participations";"";"6611";""
+"ACCN";"6615";"Intérêts des comptes courants et des dépôts créditeurs";"";"661";""
+"ACCN";"6616";"Intérêts bancaires et sur opérations de financement";"";"661";""
+"ACCN";"6617";"Intérêts des obligations cautionnées";"";"661";""
+"ACCN";"661";"Charges dintérêt";"";"66";""
+"ACCN";"66181";"#NOM?";"";"6618";""
+"ACCN";"6618";"Intérêts des autres dettes";"";"661";""
+"ACCN";"66188";"#NOM?";"";"6618";""
+"ACCN";"664";"Pertes sur créances liées à des participations";"";"66";""
+"ACCN";"665";"Escomptes accordés";"";"66";""
+"ACCN";"666";"Pertes de change";"";"66";""
+"ACCN";"667";"Charges nettes sur cession valeurs mobilières de placement";"";"66";""
+"ACCN";"66";"CHARGES FINANCIERES";"";"6";""
+"ACCN";"668";"Autres charges financières";"";"66";""
+"ACCN";"6688";"Pertes de change ou de conversion";"";"668";""
+"ACCN";"670";"Charges exceptionnelles";"";"67";""
+"ACCN";"6711";"Pénalités sur marchés (et dédits payés sur achats et ventes)";"";"671";""
+"ACCN";"6712";"Pénalités et amendes fiscales et pénales";"";"671";""
+"ACCN";"6713";"Dons; libéralités";"";"671";""
+"ACCN";"6714";"Créances devenues irrécouvrables dans l'exercice";"";"671";""
+"ACCN";"6715";"Subventions accordées";"";"671";""
+"ACCN";"6717";"Rappels d'impôts (autres impôts sur les bénéfices)";"";"671";""
+"ACCN";"671";"Charges exceptionnelles sur opérations de gestion";"";"67";""
+"ACCN";"6718";"Autres charges exceptionnelles sur opérations de gestion";"";"671";""
+"ACCN";"672";"Charges exceptionnelles sur exercices antérieurs";"";"67";""
+"ACCN";"6751";"Immobilisations incorporelles";"";"675";""
+"ACCN";"6752";"Immobilisations corporelles";"";"675";""
+"ACCN";"6756";"Immobilisations financières";"";"675";""
+"ACCN";"675";"Valeurs comptables des éléments d'actif cédés";"";"67";""
+"ACCN";"6758";"Autres éléments d'actif";"";"675";""
+"ACCN";"67";"CHARGES EXCEPTIONNELLES";"";"6";""
+"ACCN";"6781";"Malis provenant de clauses d'indexation";"";"678";""
+"ACCN";"6782";"Lots";"";"678";""
+"ACCN";"6783";"Malis provenant du rachat par l'entreprise d'actions";"";"678";""
+"ACCN";"678";"Autres charges exceptionnelles";"";"67";""
+"ACCN";"6788";"Charges exceptionnelles diverses";"";"678";""
+"ACCN";"68111";"Dotations aux amort. immobilisations incorporelles";"";"6811";""
+"ACCN";"6811";"Dotations sur immobilisations";"";"681";""
+"ACCN";"68112";"Dotations aux amort. immobilisations corporelles";"";"6811";""
+"ACCN";"6812";"Dotations aux amortissements des charges d'exploitation";"";"681";""
+"ACCN";"6815";"Dotations aux provisions pour risques d'exploitation";"";"681";""
+"ACCN";"68161";"Dotations provisions dépréc. immos incorporelles";"";"6816";""
+"ACCN";"6816";"Dotation aux provisions pour dépréciation des immos";"";"681";""
+"ACCN";"68162";"Dotations provisions dépréc. immos corporelles";"";"6816";""
+"ACCN";"681";"Dotations aux amortissements - Charges d'exploitation";"";"68";""
+"ACCN";"68173";"Stocks et en-cours";"";"6817";""
+"ACCN";"6817";"Dotations aux provisions dépréciation des actifs circulant";"";"681";""
+"ACCN";"68174";"Créances";"";"6817";""
+"ACCN";"6861";"Dotations aux amortissements des primes de remboursement";"";"686";""
+"ACCN";"6865";"Dotations aux provisions pour risques et charges financiers";"";"686";""
+"ACCN";"686";"Dotations aux amort. et provisions - Charges financières";"";"68";""
+"ACCN";"68662";"Immobilisations financières";"";"6866";""
+"ACCN";"6866";"Dotation pour dépréciation des éléments financiers";"";"686";""
+"ACCN";"68665";"Valeurs mobilières de placement";"";"6866";""
+"ACCN";"68";"DOTATIONS AUX AMORTISSEMENTS ET AUX PROVISIONS";"";"6";""
+"ACCN";"6871";"Dotations aux amortissements exceptionnels sur immos";"";"687";""
+"ACCN";"6872";"Dotations aux provisions réglementées (immobilisations)";"";"687";""
+"ACCN";"68725";"Dotations provisions réglementées - Amort. dérogatoires";"";"6872";""
+"ACCN";"6873";"Dotations aux provisions réglementées (stocks)";"";"687";""
+"ACCN";"6874";"Dotations aux autres provisions réglementées";"";"687";""
+"ACCN";"6875";"Dotations aux provisions pour charges exceptionnelles";"";"687";""
+"ACCN";"687";"Dotations aux amort. et provisions - Charges exceptionnelles";"";"68";""
+"ACCN";"6876";"Dotations aux provisions pour dépréciation exceptionnelle";"";"687";""
+"ACCN";"6";"COMPTES DE CHARGES";"";"";""
+"ACCN";"691";"Participation des salaries aux résultats de lentreprise";"";"69";""
+"ACCN";"6951";"Impôts dus en France";"";"695";""
+"ACCN";"6952";"Contribution additionnelle à l'impôt sur les bénéfices";"";"695";""
+"ACCN";"695";"Impôts sur les bénéfices";"";"69";""
+"ACCN";"6954";"Impôts dus à l'étranger";"";"695";""
+"ACCN";"696";"Suppléments d'impôt sur les sociétés liés aux distributions";"";"69";""
+"ACCN";"697";"Imposition forfaitaire annuelle des sociétés";"";"69";""
+"ACCN";"698";"Contribution additionnelle";"";"69";""
+"ACCN";"69";"PARTICIPATION DES SALARIES - IMPOTS SUR LES BENEFICES";"";"6";""
+"ACCN";"699";"Produits - Reports en arrière des déficits";"";"69";""
+"ACCN";"7011";"Produit fini (ou groupe) A";"";"701";""
+"ACCN";"701";"Ventes de produits finis";"";"70";""
+"ACCN";"7012";"Produit fini (ou groupe) B";"";"701";""
+"ACCN";"702";"Ventes de produits intermédiaires";"";"70";""
+"ACCN";"703";"Ventes de produits résiduels";"";"70";""
+"ACCN";"7041";"Travaux de catégorie (ou activité) A";"";"704";""
+"ACCN";"704";"Travaux";"";"70";""
+"ACCN";"7042";"Travaux de catégorie (ou activité) B";"";"704";""
+"ACCN";"705";"Etudes";"";"70";""
+"ACCN";"706";"Travaux et prestations de services";"";"70";""
+"ACCN";"7071";"Marchandise (ou groupe) A";"";"707";""
+"ACCN";"707";"Ventes de marchandises";"";"70";""
+"ACCN";"7072";"Marchandise (ou groupe) B";"";"707";""
+"ACCN";"7081";"Produits des services exploités dans lintérêt du personnel";"";"708";""
+"ACCN";"7082";"Commissions et courtages";"";"708";""
+"ACCN";"7083";"Locations diverses";"";"708";""
+"ACCN";"7084";"Mise à disposition de personnel facturée";"";"708";""
+"ACCN";"7085";"Ports et frais accessoires facturés";"";"708";""
+"ACCN";"7086";"Bonis sur reprises d'emballages consignés";"";"708";""
+"ACCN";"7087";"Bonifications obtenues des clients et primes sur ventes";"";"708";""
+"ACCN";"708";"Produits des activités annexes";"";"70";""
+"ACCN";"7088";"Autres produits activités annexes";"";"708";""
+"ACCN";"70";"VENTES DE PRODUITS; PRESTATIONS DE SERVICES; MARCHANDISES";"";"7";""
+"ACCN";"7091";"#NOM?";"";"709";""
+"ACCN";"7092";"- sur ventes de produits intermédiaires";"";"709";""
+"ACCN";"7094";"#NOM?";"";"709";""
+"ACCN";"7095";"- sur études";"";"709";""
+"ACCN";"7096";"#NOM?";"";"709";""
+"ACCN";"7097";"#NOM?";"";"709";""
+"ACCN";"709";"Rabais; remises et ristournes accordées par l'entreprise";"";"70";""
+"ACCN";"7098";"- sur produits des activités annexes";"";"709";""
+"ACCN";"71";"PRODUCTION STOCKEE (ou déstockage)";"";"7";""
+"ACCN";"71331";"Produits en cours";"";"7133";""
+"ACCN";"7133";"Variation des en-cours de production de biens";"";"713";""
+"ACCN";"71335";"Travaux en cours";"";"7133";""
+"ACCN";"71341";"Etudes en cours";"";"7134";""
+"ACCN";"7134";"Variation des en-cours de production de services";"";"713";""
+"ACCN";"71345";"Prestations des services en cours";"";"7134";""
+"ACCN";"713";"VARIATION DES STOCKS (en-cours de production; produits)";"";"71";""
+"ACCN";"71351";"Produits intermédiaires";"";"7135";""
+"ACCN";"71355";"Produits finis";"";"7135";""
+"ACCN";"7135";"Variation des stocks de produits";"";"713";""
+"ACCN";"71358";"Produits résiduels";"";"7135";""
+"ACCN";"721";"Immobilisations incorporelles";"";"72";""
+"ACCN";"72";"PRODUCTION IMMOBILISEE";"";"7";""
+"ACCN";"722";"Immobilisations corporelles";"";"72";""
+"ACCN";"731";"Produits nets partiels sur opérations en cours";"";"73";""
+"ACCN";"73";"PRODUITS NETS PARTIELS SUR OPERATIONS A LONG TERME";"";"7";""
+"ACCN";"739";"Produits nets partiels sur opérations terminées";"";"73";""
+"ACCN";"74";"SUBVENTlONS D'EXPLOITATION";"";"7";""
+"ACCN";"740";"Subventions dexploitation";"";"74";""
+"ACCN";"7511";"Redevances pour concessions; brevets; licences; marques; log";"";"751";""
+"ACCN";"7516";"Droits d'auteur et de reproduction";"";"751";""
+"ACCN";"751";"Redevances pour concessions; brevets; licences; marques; log";"";"75";""
+"ACCN";"7518";"Autres droits et valeurs similaires";"";"751";""
+"ACCN";"752";"Revenus des immeubles non affectes aux activités prof.";"";"75";""
+"ACCN";"753";"Jetons de présence et rémunérations d'administrateurs";"";"75";""
+"ACCN";"754";"Ristournes perçues des coopératives";"";"75";""
+"ACCN";"7551";"Quote-part de perte transférée (comptabilité du gérant)";"";"755";""
+"ACCN";"755";"Quotes-parts de résultat sur opérations faites en commun";"";"75";""
+"ACCN";"7555";"Quote-part de bénéfice attribué (comptabilité des associés)";"";"755";""
+"ACCN";"75";"AUTRES PRODUITS DE GESTION COURANTE";"";"7";""
+"ACCN";"758";"Produits divers de gestion courante";"";"75";""
+"ACCN";"7611";"Revenus des titres de participation";"";"761";""
+"ACCN";"7616";"Revenus sur autres formes de participation";"";"761";""
+"ACCN";"761";"Produits de participations";"";"76";""
+"ACCN";"7617";"Revenus des créances rattachées à des participations";"";"761";""
+"ACCN";"7621";"Revenus des titres immobilisés";"";"762";""
+"ACCN";"7624";"Revenus des prêts";"";"762";""
+"ACCN";"762";"Produits des autres immobilisations financières";"";"76";""
+"ACCN";"7627";"Revenus des créances immobilisées";"";"762";""
+"ACCN";"7631";"Revenus sur créances commerciales";"";"763";""
+"ACCN";"763";"Revenus des autres créances";"";"76";""
+"ACCN";"7638";"Revenus sur créances diverses";"";"763";""
+"ACCN";"764";"Revenus des valeurs mobilières de placement";"";"76";""
+"ACCN";"765";"Escomptes obtenus";"";"76";""
+"ACCN";"766";"Gains de change";"";"76";""
+"ACCN";"767";"Produits nets sur cession de valeurs mobilières de placement";"";"76";""
+"ACCN";"76";"PRODUITS FINANCIERS";"";"7";""
+"ACCN";"768";"Autres produits financiers";"";"76";""
+"ACCN";"7688";"Gains de change ou de conversion";"";"768";""
+"ACCN";"770";"Produits exceptionnels";"";"77";""
+"ACCN";"7711";"Dédits et pénalités perçus sur achats et sur ventes";"";"771";""
+"ACCN";"7713";"Libéralités reçues";"";"771";""
+"ACCN";"7714";"Rentrées sur créances amorties";"";"771";""
+"ACCN";"7715";"Subventions d'équilibre";"";"771";""
+"ACCN";"7717";"Dégrèvements impôts (autres impôts sur les bénéfices)";"";"771";""
+"ACCN";"771";"Produits exceptionnels sur opérations de gestion";"";"77";""
+"ACCN";"7718";"Autres produits exceptionnels sur opérations de gestion";"";"771";""
+"ACCN";"772";"Produits exceptionnels sur exercices antérieurs";"";"77";""
+"ACCN";"7751";"Immobilisations incorporelles";"";"775";""
+"ACCN";"7752";"Immobilisations corporelles";"";"775";""
+"ACCN";"7756";"Immobilisations financières";"";"775";""
+"ACCN";"775";"Produits des cessions d'éléments d'actif";"";"77";""
+"ACCN";"7758";"Autres éléments d'actif";"";"775";""
+"ACCN";"777";"Quote-part des subventions d'invest. virée au résultat";"";"77";""
+"ACCN";"77";"PRODUITS EXCEPTIONNELS";"";"7";""
+"ACCN";"7781";"Bonis provenant de clauses d'indexation";"";"778";""
+"ACCN";"7782";"Lots";"";"778";""
+"ACCN";"7783";"Bonis provenant du rachat par l'entreprise d'actions";"";"778";""
+"ACCN";"778";"Autres produits exceptionnels";"";"77";""
+"ACCN";"7788";"Produits exceptionnels divers";"";"778";""
+"ACCN";"78111";"Immobilisations incorporelles";"";"7811";""
+"ACCN";"7811";"Reprises sur amortissements des immobilisations";"";"781";""
+"ACCN";"78112";"Immobilisations corporelles";"";"7811";""
+"ACCN";"7815";"Reprises sur provisions pour charges d'exploitation";"";"781";""
+"ACCN";"78161";"Reprises prov. dépréc. immos incorporelles";"";"7816";""
+"ACCN";"7816";"Reprises sur provisions pour dépréciation des immos";"";"781";""
+"ACCN";"78162";"Reprises prov. dépréc. immos corporelles";"";"7816";""
+"ACCN";"781";"Reprises sur amortissements et provisions";"";"78";""
+"ACCN";"78173";"Stocks et en-cours";"";"7817";""
+"ACCN";"7817";"Reprises pour dépréciation des actifs circulant";"";"781";""
+"ACCN";"78174";"Créances";"";"7817";""
+"ACCN";"7865";"Reprises sur provisions pour risques et charges financiers";"";"786";""
+"ACCN";"786";"Reprises sur provisions pour risques";"";"78";""
+"ACCN";"78662";"Immobilisations financières";"";"7866";""
+"ACCN";"7866";"Reprises pour dépréciation des éléments financiers";"";"786";""
+"ACCN";"78665";"Valeurs mobilières de placement";"";"7866";""
+"ACCN";"78";"REPRISES SUR AMORTISSEMENTS ET PROVISIONS";"";"7";""
+"ACCN";"78725";"Reprises sur provisions - Amort. dérogatoires";"";"7872";""
+"ACCN";"78726";"Provision spéciale de réévaluation";"";"7872";""
+"ACCN";"7872";"Reprises sur provisions réglementées (immobilisations)";"";"787";""
+"ACCN";"78727";"Plus-values réinvesties";"";"7872";""
+"ACCN";"7873";"Reprises sur provisions réglementées (stock)";"";"787";""
+"ACCN";"7874";"Reprises sur autres provisions réglementées";"";"787";""
+"ACCN";"7875";"Reprises sur provisions pour charges exceptionnelles";"";"787";""
+"ACCN";"787";"Reprises sur provisions";"";"78";""
+"ACCN";"7876";"Reprises sur provisions pour dépréciation exceptionnelle";"";"787";""
+"ACCN";"7";"COMPTES DE PRODUITS";"";"";""
+"ACCN";"791";"Transfert de charges d'exploitation";"";"79";""
+"ACCN";"796";"Transfert de charges financières";"";"79";""
+"ACCN";"79";"TRANSFERTS DE CHARGES";"";"7";""
+"ACCN";"797";"Transferts de charges exceptionnelles";"";"79";""
+"ACCN";"8011";"Avals; cautions; garanties";"";"801";""
+"ACCN";"8014";"Effets circulant sous l'endos de l'entreprise";"";"801";""
+"ACCN";"80161";"Crédit-bail mobilier";"";"8016";""
+"ACCN";"8016";"Redevances crédit-bail restant à courir";"";"801";""
+"ACCN";"80165";"Crédit-bail immobilier";"";"8016";""
+"ACCN";"801";"Engagements donnés par l'entreprise";"";"80";""
+"ACCN";"8018";"Autres engagements donnés";"";"801";""
+"ACCN";"8021";"Avals; cautions; garanties";"";"802";""
+"ACCN";"8024";"Créances escomptées non échues";"";"802";""
+"ACCN";"80261";"Crédit-bail mobilier";"";"8026";""
+"ACCN";"8026";"Engagements reçus pour utilisation en crédit-bail";"";"802";""
+"ACCN";"80265";"Crédit-bail immobilier";"";"8026";""
+"ACCN";"802";"Engagements reçus par l'entreprise";"";"80";""
+"ACCN";"8028";"Autres engagements reçus";"";"802";""
+"ACCN";"80";"ENGAGEMENTS";"";"8";""
+"ACCN";"8091";"Contrepartie 801";"";"809";""
+"ACCN";"809";"Contrepartie des engagements";"";"80";""
+"ACCN";"8092";"Contrepartie 802";"";"809";""
+"ACCN";"88";"RESULTAT EN INSTANCE DAFFECTATION";"";"8";""
+"ACCN";"8";"COMPTES SPECIAUX";"";"";""
+"ACCN";"89";"BILAN";"";"8";""
Added: trunk/lima-swing/src/main/resources/import/pcg_shortened.csv
===================================================================
--- trunk/lima-swing/src/main/resources/import/pcg_shortened.csv (rev 0)
+++ trunk/lima-swing/src/main/resources/import/pcg_shortened.csv 2010-07-26 16:32:09 UTC (rev 2986)
@@ -0,0 +1,266 @@
+"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
1
0
r2985 - in trunk: lima-business/src/main/java/org/chorem/lima/business/ejb lima-business/src/main/java/org/chorem/lima/business/ejbinterface lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport
by jpepin@users.chorem.org 23 Jul '10
by jpepin@users.chorem.org 23 Jul '10
23 Jul '10
Author: jpepin
Date: 2010-07-23 12:42:24 +0200 (Fri, 23 Jul 2010)
New Revision: 2985
Url: http://chorem.org/repositories/revision/lima/2985
Log:
Mise ?\195?\160 jour formattage du pdf, ajout date et identit?\195?\169.
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-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportTableModel.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-07-22 16:25:57 UTC (rev 2984)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/DocumentServiceImpl.java 2010-07-23 10:42:24 UTC (rev 2985)
@@ -23,7 +23,9 @@
import java.awt.Color;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
+import java.text.SimpleDateFormat;
import java.util.ArrayList;
+import java.util.Date;
import java.util.List;
import javax.ejb.Stateless;
import org.apache.commons.logging.Log;
@@ -77,18 +79,21 @@
}
@Override
- public void createFinancialStatementsDocuments(List<FinancialStatementAmounts> financialStatementAmounts) throws LimaException {
- Document document = new Document(PageSize.A4, 5, 5, 5, 5);
+ public void createFinancialStatementsDocuments(List<FinancialStatementAmounts> financialStatementAmounts, Date beginDate, Date endDate) throws LimaException {
+ Document document = new Document(PageSize.A4, 8, 8, 8, 8);
TopiaContext topiaContext = null;
try {
topiaContext = beginTransaction();
- PdfWriter pdfWriter = PdfWriter.getInstance(document,
+ SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
+ SimpleDateFormat hourFormat = new SimpleDateFormat("HH:mm");
+
+ PdfWriter pdfWriter = PdfWriter.getInstance(document,
new FileOutputStream("/test_lima.pdf"));
HtmlWriter htmlWriter = HtmlWriter.getInstance(document,
new FileOutputStream("/test_lima.html"));
- Font numpageFont = new Font(Font.HELVETICA, 9, Font.BOLD, Color.BLACK);
+ Font numpageFont = new Font(Font.HELVETICA, 9, Font.NORMAL, Color.BLACK);
document.open();
int nbpages = 1;
@@ -106,21 +111,23 @@
int min=0;
int size = financialStatementAmounts.size();
for (int i=0;i<size;i++) {
- if (financialStatementAmounts.get(i).getLevel()==1){
+ FinancialStatementAmounts fStatementAmounts = financialStatementAmounts.get(i);
+ if (fStatementAmounts.getLevel() == 1 && fStatementAmounts.getSubAmount() == false){
if (first){
first=false;
}
else{
- listList.add(financialStatementAmounts.subList(min+1, i-1));
+ listList.add(financialStatementAmounts.subList(min, i-1));
}
min=i;
}
}
- listList.add(financialStatementAmounts.subList(min+1, size));
+ listList.add(financialStatementAmounts.subList(min, size));
//create pages
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){
@@ -131,19 +138,34 @@
List <FinancialStatementAmounts> subFinancialStatementAmounts =
list.subList(i, j);
//create page : header + table + footer
- Table header = createHeader(title, identity, "01/01/2010", "31/12/2010");
+ Table headerPage = createHeaderPage(title, identity, dateFormat.format(beginDate), dateFormat.format(endDate));
+ Table headerTable = createHeaderTable();
Table table = createTable(subFinancialStatementAmounts);
//new page
Chapter chapter = new Chapter(0);
+ //headerPage
+ Paragraph paragraphHeaderPage = new Paragraph();
+ paragraphHeaderPage.add(headerPage);
+ chapter.add(paragraphHeaderPage);
//n° page
Paragraph paragraphPage = new Paragraph();
- paragraphPage.setAlignment(Element.ALIGN_RIGHT);
- paragraphPage.add(new Phrase("Page n° "+nbpages, numpageFont));
+ 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);
+ Date newDate = new Date();
+ infos.addCell(new Phrase("Date de tirage " + dateFormat.format(newDate) + " à " + hourFormat.format(newDate), numpageFont));
+ infos.addCell(new Phrase("Page n° "+nbpages, numpageFont));
+ paragraphPage.add(infos);
chapter.add(paragraphPage);
- //header
- Paragraph paragraphHeader = new Paragraph();
- paragraphHeader.add(header);
- chapter.add(paragraphHeader);
+ //headerTable
+ Paragraph paragraphHeaderTable = new Paragraph();
+ paragraphHeaderTable.add(headerTable);
+ chapter.add(paragraphHeaderTable);
//table
Paragraph paragraphTable = new Paragraph();
paragraphTable.add(table);
@@ -166,15 +188,16 @@
}
}
- public Table createHeader(String title, Identity identity, String beginDate, String endDate){
+ public Table createHeaderPage(String title, Identity identity, String beginDate, String endDate){
Table t = null;
try {
//define table
t = new Table(4, 5);
+ t.setWidth(100f);
float[] widths = {0.25f, 0.45f, 0.12f, 0.18f};
t.setWidths(widths);
- t.setPadding(3);
+ t.setPadding(1.5f);
//define font
Font headerFont = new Font(Font.HELVETICA, 9, Font.ITALIC, Color.BLACK);
Font headerFontB = new Font(Font.HELVETICA, 9, Font.BOLDITALIC, Color.BLACK);
@@ -207,7 +230,7 @@
t.addCell(new Phrase("Période du", headerFontB));
t.addCell(new Phrase(beginDate, headerFont));
//line 5
- t.addCell(new Phrase(identity.getCity(), headerFont));
+ t.addCell(new Phrase(identity.getZipCode() + " " + identity.getCity(), headerFont));
t.addCell("");
t.addCell(new Phrase("au", headerFontB));
t.addCell(new Phrase(endDate, headerFont));
@@ -217,37 +240,54 @@
return t;
}
+ public Table createHeaderTable(){
+ Table t = null;
+ try {
+ t = new Table(4,1);
+ float[] widths = {0.4f, 0.2f, 0.2f, 0.2f};
+ 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);
+ Font headerFont = new Font(Font.HELVETICA, 9, Font.BOLD, Color.BLACK);
+ t.addCell(new Phrase(_("lima.table.label"), headerFont));
+ t.addCell(new Phrase(_("lima.table.grossamount"), headerFont));
+ t.addCell(new Phrase(_("lima.table.provisiondeprecationamount"), headerFont));
+ t.addCell(new Phrase(_("lima.table.netamount"), headerFont));
+
+ } catch (BadElementException eeBEE) {
+ log.error("Can't create table", eeBEE);
+ }
+ return t;
+
+ }
+
public Table createTable(List<FinancialStatementAmounts> financialStatementAmounts){
int nbrow = financialStatementAmounts.size();
Table t = null;
try {
//define table
t = new Table(4,nbrow);
+ t.setWidth(100f);
float[] widths = {0.4f, 0.2f, 0.2f, 0.2f};
t.setWidths(widths);
- t.setPadding(0.5f);
- t.setSpacing(0);
+ t.setPadding(1.5f);
t.setBorderWidth(1);
- t.setBorder(Rectangle.BOTTOM);
+ t.setOffset(0);
//define default cell
Cell cell = new Cell();
cell.setBorder(Rectangle.LEFT);
+ cell.setHorizontalAlignment(Element.ALIGN_RIGHT);
t.setDefaultCell(cell);
- Font headerFont = new Font(Font.HELVETICA, 9, Font.BOLD, Color.BLACK);
+ Font tabFontBold = new Font(Font.HELVETICA, 9, Font.BOLD, Color.BLACK);
Font tabFont = new Font(Font.HELVETICA, 9, Font.NORMAL, Color.BLACK);
- Cell headerCell = new Cell(new Phrase(_("lima.table.label"), headerFont));
- headerCell.setBorderWidth(1);
- headerCell.setHeader(true);
- t.addCell(headerCell);
- headerCell = new Cell(new Phrase(_("lima.table.grossamount"), headerFont));
- t.addCell(headerCell);
- headerCell = new Cell(new Phrase(_("lima.table.provisiondeprecationamount"), headerFont));
- t.addCell(headerCell);
- headerCell = new Cell(new Phrase(_("lima.table.netamount"), headerFont));
- t.addCell(headerCell);
-
for (FinancialStatementAmounts financialStatementAmount : financialStatementAmounts) {
String label = financialStatementAmount.getLabel();
@@ -255,13 +295,16 @@
Double grossAmount = financialStatementAmount.getGrossAmount();
Double provisionDeprecationAmount = financialStatementAmount.getProvisionDeprecationAmount();
- if (financialStatementAmount.getSubAmount()){
- cell.setGrayFill(0.9f);
+ log.debug(label +" "+ level);
+ if (financialStatementAmount.getSubAmount() && level==1){
+ cell.setGrayFill(0.88f);
}
+ else if (financialStatementAmount.getSubAmount()){
+ cell.setGrayFill(0.94f);
+ }
else {
cell.setGrayFill(1f);
}
-
if (label == null){
t.addCell("");
t.addCell("");
@@ -276,12 +319,14 @@
}
Phrase phrase = null;
if (financialStatementAmount.getHeader()){
- phrase = new Phrase(tab+label, headerFont);
+ phrase = new Phrase(tab+label, tabFontBold);
}
else {
phrase = new Phrase(tab+label, tabFont);
}
- t.addCell(phrase);
+ Cell c = new Cell(phrase);
+ c.setHorizontalAlignment(Element.ALIGN_LEFT);
+ t.addCell(c);
//cell2
if (grossAmount != 0.0){
phrase = new Phrase(String.valueOf(grossAmount), tabFont);
@@ -315,51 +360,6 @@
return t;
}
- public void example (){
- //FIRST PAGE
- /*document.add(new Paragraph("First page of the document."));
- document.add(new Paragraph("Some more text on the \n"
- + "first page with different color and font type.",
- FontFactory.getFont(FontFactory.COURIER, 14, Font.BOLD,
- new Color(255, 150, 200))));
-
- //SECOND PAGE
- Paragraph title1 = new Paragraph("Chapter 1",
- FontFactory.getFont(FontFactory.HELVETICA, 18,
- Font.BOLDITALIC, new Color(0, 0, 255)));
- Chapter chapter1 = new Chapter(title1, 1);
- chapter1.setNumberDepth(0);
- //SECTION 1
- Paragraph title11 = new Paragraph("This is Section 1 in Chapter 1",
- FontFactory.getFont(FontFactory.HELVETICA, 16,
- Font.BOLD, new Color(255, 0, 0)));
- Section section1 = chapter1.addSection(title11);
- Paragraph someSectionText = new Paragraph("This text comes as part of section 1 of chapter 1.");
- section1.add(someSectionText);
- someSectionText = new Paragraph("Following is a 3 X 2 table.");
- section1.add(someSectionText);
- //TABLE
- Table t = new Table(3,2);
- t.setBorderColor(new Color(220, 255, 100));
- t.setPadding(5);
- t.setSpacing(5);
- t.setBorderWidth(1);
- Cell c1 = new Cell("header1");
- c1.setHeader(true);
- t.addCell(c1);
- c1 = new Cell("Header2");
- t.addCell(c1);
- c1 = new Cell("Header3");
- t.addCell(c1);
- t.endHeaders();
- t.addCell("1.1");
- t.addCell("1.2");
- t.addCell("1.3");
-
- section1.add(t);
-
- document.add(chapter1);*/
- }
protected TopiaContext beginTransaction() throws TopiaException {
// basic check done, make check in database
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-07-22 16:25:57 UTC (rev 2984)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/DocumentService.java 2010-07-23 10:42:24 UTC (rev 2985)
@@ -19,6 +19,7 @@
package org.chorem.lima.business.ejbinterface;
+import java.util.Date;
import java.util.List;
import javax.ejb.Remote;
@@ -35,6 +36,6 @@
@Remote
public interface DocumentService {
- public void createFinancialStatementsDocuments(List<FinancialStatementAmounts> financialStatementAmounts) throws LimaException;
+ public void createFinancialStatementsDocuments(List<FinancialStatementAmounts> financialStatementAmounts, Date beginDate, Date endDate) throws LimaException;
}
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-07-22 16:25:57 UTC (rev 2984)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportTableModel.java 2010-07-23 10:42:24 UTC (rev 2985)
@@ -210,7 +210,7 @@
public void createDocuments(){
try {
- documentService.createFinancialStatementsDocuments(cacheDataList);
+ documentService.createFinancialStatementsDocuments(cacheDataList, selectedBeginDate, selectedEndDate);
} catch (LimaException e) {
if (log.isDebugEnabled()){
log.debug("Error on create document",e);
1
0
Author: jpepin
Date: 2010-07-22 18:25:57 +0200 (Thu, 22 Jul 2010)
New Revision: 2984
Url: http://chorem.org/repositories/revision/lima/2984
Log:
Cr?\195?\169ation d'une fiche d'identit?\195?\169 en base pour l'export des documents html et pdf.
Added:
trunk/lima-business/src/main/java/org/chorem/lima/business/IdentityServiceMonitorable.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/IdentityServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/IdentityService.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/IdentityServiceLocal.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/identity/
trunk/lima-swing/src/main/java/org/chorem/lima/ui/identity/IdentityForm.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/identity/IdentityHandler.java
trunk/lima-swing/src/main/resources/icons/action-identity.png
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/ExportServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/DocumentService.java
trunk/lima-business/src/main/java/org/chorem/lima/business/utils/ImportExportEntityEnum.java
trunk/lima-callao/src/main/xmi/accounting.zargo
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/financialstatementreport/FinancialStatementReportTableModel.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-config.png
Added: trunk/lima-business/src/main/java/org/chorem/lima/business/IdentityServiceMonitorable.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/IdentityServiceMonitorable.java (rev 0)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/IdentityServiceMonitorable.java 2010-07-22 16:25:57 UTC (rev 2984)
@@ -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.IdentityService;
+
+public interface IdentityServiceMonitorable extends IdentityService, ServiceMonitorable {
+
+}
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-07-22 10:36:21 UTC (rev 2983)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/DocumentServiceImpl.java 2010-07-22 16:25:57 UTC (rev 2984)
@@ -20,20 +20,27 @@
package org.chorem.lima.business.ejb;
import static org.nuiton.i18n.I18n._;
-
import java.awt.Color;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.util.ArrayList;
import java.util.List;
-
import javax.ejb.Stateless;
-
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.beans.FinancialStatementAmounts;
+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.entity.Identity;
+import org.chorem.lima.entity.IdentityDAO;
+import org.chorem.lima.entity.IdentityImpl;
+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 com.lowagie.text.BadElementException;
import com.lowagie.text.Cell;
@@ -55,14 +62,29 @@
private static final Log log =
LogFactory.getLog(DocumentServiceImpl.class);
+
+ private TopiaContext rootContext;
+
+ public DocumentServiceImpl() {
+ LimaConfig config = LimaConfig.getInstance();
+ try {
+ rootContext = TopiaContextFactory.getContext(config.getOptions());
+ } catch (TopiaNotFoundException ex) {
+ if (log.isErrorEnabled()) {
+ log.error("Can't init topia context", ex);
+ }
+ }
+ }
@Override
- public void createDocuments(List<FinancialStatementAmounts> financialStatementAmounts) {
+ public void createFinancialStatementsDocuments(List<FinancialStatementAmounts> financialStatementAmounts) throws LimaException {
Document document = new Document(PageSize.A4, 5, 5, 5, 5);
- try {
-
- PdfWriter pdfWriter = PdfWriter.getInstance(document,
+ TopiaContext topiaContext = null;
+ try {
+ topiaContext = beginTransaction();
+
+ PdfWriter pdfWriter = PdfWriter.getInstance(document,
new FileOutputStream("/test_lima.pdf"));
HtmlWriter htmlWriter = HtmlWriter.getInstance(document,
new FileOutputStream("/test_lima.html"));
@@ -70,7 +92,14 @@
document.open();
int nbpages = 1;
+ Identity identity = new IdentityImpl();
+ IdentityDAO identityDAO = LimaCallaoDAOHelper.getIdentityDAO(topiaContext);
+ List<Identity> identities = identityDAO.findAll();
+ if (identities.size() !=0){
+ identity = identities.get(0);
+ }
+
//Split list by financialstatement type
List<List<FinancialStatementAmounts>> listList = new ArrayList<List<FinancialStatementAmounts>>();
Boolean first = true;
@@ -102,7 +131,7 @@
List <FinancialStatementAmounts> subFinancialStatementAmounts =
list.subList(i, j);
//create page : header + table + footer
- Table header = createHeader(title, "01/01/2010", "31/12/2010");
+ Table header = createHeader(title, identity, "01/01/2010", "31/12/2010");
Table table = createTable(subFinancialStatementAmounts);
//new page
Chapter chapter = new Chapter(0);
@@ -132,12 +161,15 @@
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 topiaContext", eeTE);
+ }
}
- public Table createHeader(String title, String beginDate, String endDate){
+ public Table createHeader(String title, Identity identity, String beginDate, String endDate){
Table t = null;
try {
+
//define table
t = new Table(4, 5);
float[] widths = {0.25f, 0.45f, 0.12f, 0.18f};
@@ -152,31 +184,31 @@
t.setDefaultCell(cell);
//line 1
- t.addCell(new Phrase("Code Lutin SA", headerFontB));
+ t.addCell(new Phrase(identity.getName(), headerFontB));
Cell titleCell = new Cell(new Phrase(title, new Font(Font.HELVETICA, 14, Font.BOLD, Color.BLACK)));
titleCell.setVerticalAlignment(Element.ALIGN_MIDDLE);
titleCell.setHorizontalAlignment(Element.ALIGN_CENTER);
titleCell.setRowspan(2);
t.addCell(titleCell);
t.addCell(new Phrase("N° Siret", headerFontB));
- t.addCell(new Phrase("442116703", headerFont));
+ t.addCell(new Phrase(identity.getBusinessNumber(), headerFont));
//line 2
t.addCell(new Phrase("SSL", headerFont));
t.addCell(new Phrase("NAF :", headerFontB));
- t.addCell(new Phrase("6201Z", headerFont));
+ t.addCell(new Phrase(identity.getClassificationCode(), headerFont));
//line 3
- t.addCell(new Phrase("44 bd des Pas Enchantés", headerFont));
+ t.addCell(new Phrase(identity.getAddress(), headerFont));
t.addCell("");
t.addCell(new Phrase("n°TVA", headerFontB));
- t.addCell(new Phrase("FR 57 442116703", headerFont));
+ t.addCell(new Phrase(identity.getVatNumber(), headerFont));
//line 4
- t.addCell(new Phrase("44230 St Séb/Loire", headerFont));
+ t.addCell(new Phrase(identity.getAddress2(), headerFont));
t.addCell("");
t.addCell(new Phrase("Période du", headerFontB));
t.addCell(new Phrase(beginDate, headerFont));
//line 5
+ t.addCell(new Phrase(identity.getCity(), headerFont));
t.addCell("");
- t.addCell("");
t.addCell(new Phrase("au", headerFontB));
t.addCell(new Phrase(endDate, headerFont));
} catch (BadElementException eeBEE) {
@@ -328,5 +360,13 @@
document.add(chapter1);*/
}
-
+
+ protected TopiaContext beginTransaction() throws TopiaException {
+ // basic check done, make check in database
+ // TODO move it into JTA
+ TopiaContext topiaTransaction;
+ topiaTransaction = rootContext.beginTransaction();
+ log.trace("beginTransaction"+topiaTransaction);
+ return topiaTransaction;
+ }
}
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ExportServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ExportServiceImpl.java 2010-07-22 10:36:21 UTC (rev 2983)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ExportServiceImpl.java 2010-07-22 16:25:57 UTC (rev 2984)
@@ -45,6 +45,8 @@
import org.chorem.lima.entity.FinancialTransactionDAO;
import org.chorem.lima.entity.FiscalPeriod;
import org.chorem.lima.entity.FiscalPeriodDAO;
+import org.chorem.lima.entity.Identity;
+import org.chorem.lima.entity.IdentityDAO;
import org.chorem.lima.entity.LimaCallaoDAOHelper;
import org.nuiton.topia.TopiaContext;
import org.nuiton.topia.TopiaContextFactory;
@@ -235,6 +237,7 @@
exportFiscalPeriodAsCSV(csvWriter, topiaContext);
exportClosedPeriodicEntryBooksAsCSV(csvWriter, topiaContext);
exportFinancialTransactionsAndEntriesAsCSV(csvWriter, topiaContext);
+ exportIdentityAsCSV(csvWriter, topiaContext);
// Write cache in string
csvWriter.flush();
csvWriter.close();
@@ -523,7 +526,7 @@
*/
public void exportFiscalPeriodAsCSV(CSVWriter csvWriter, TopiaContext topiaContext) throws LimaException {
try {
- String[] nextLine = new String[5];
+ String[] nextLine = new String[4];
// Get all fiscalperiod
FiscalPeriodDAO fiscalPeriodDAO =
LimaCallaoDAOHelper.getFiscalPeriodDAO(topiaContext);
@@ -577,6 +580,36 @@
doCatch(topiaContext, eeeTE, log);
}
}
+
+ public void exportIdentityAsCSV(CSVWriter csvWriter, TopiaContext topiaContext) throws LimaException{
+ try {
+ String[] nextLine = new String[12];
+ // Get identity
+ IdentityDAO identityDAO = LimaCallaoDAOHelper.getIdentityDAO(topiaContext);
+ List<Identity> identities = identityDAO.findAll();
+ if (identities.size() != 0){
+
+ Identity identity = identities.get(0);
+ nextLine[0] = ImportExportEntityEnum.IDENTITY.getLabel();
+ nextLine[1] = identity.getName();
+ nextLine[2] = identity.getDescription();
+ nextLine[3] = identity.getAddress();
+ nextLine[4] = identity.getAddress2();
+ nextLine[5] = identity.getCity();
+ nextLine[6] = identity.getPhoneNumber();
+ nextLine[7] = identity.getEmail();
+ nextLine[8] = identity.getZipCode();
+ nextLine[9] = identity.getVatNumber();
+ nextLine[10] = identity.getClassificationCode();
+ nextLine[11] = identity.getBusinessNumber();
+ // Ajoute la ligne au fichier
+ csvWriter.writeNext(nextLine);
+ }
+ }
+ catch (TopiaException eeeTE){
+ doCatch(topiaContext, eeeTE, log);
+ }
+ }
protected TopiaContext beginTransaction() throws TopiaException {
// basic check done, make check in database
Added: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/IdentityServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/IdentityServiceImpl.java (rev 0)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/IdentityServiceImpl.java 2010-07-22 16:25:57 UTC (rev 2984)
@@ -0,0 +1,138 @@
+/* *##% Lima Business
+ * Copyright (C) 2008 - 2010 CodeLutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * ##%*
+ */
+
+package org.chorem.lima.business.ejb;
+
+import java.util.List;
+
+import javax.ejb.Stateless;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.chorem.lima.business.LimaConfig;
+import org.chorem.lima.business.LimaException;
+import org.chorem.lima.business.ejbinterface.IdentityService;
+import org.chorem.lima.business.ejbinterface.IdentityServiceLocal;
+import org.chorem.lima.entity.Identity;
+import org.chorem.lima.entity.IdentityDAO;
+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;
+
+@Stateless
+public class IdentityServiceImpl extends AbstractLimaService implements IdentityService, IdentityServiceLocal {
+
+ private static final Log log =
+ LogFactory.getLog(AccountServiceImpl.class);
+
+ private TopiaContext rootContext;
+
+ public IdentityServiceImpl() {
+ LimaConfig config = LimaConfig.getInstance();
+ try {
+ rootContext = TopiaContextFactory.getContext(config.getOptions());
+ } catch (TopiaNotFoundException ex) {
+ if (log.isErrorEnabled()) {
+ log.error("Can't init topia context", ex);
+ }
+ }
+ }
+
+ @Override
+ public Identity getIdentity() throws LimaException {
+ TopiaContext topiaContext = null;
+ Identity identity = null;
+ try {
+ topiaContext = beginTransaction();
+
+ IdentityDAO identityDAO = LimaCallaoDAOHelper.getIdentityDAO(topiaContext);
+ List<Identity> identities = identityDAO.findAll();
+ if (identities.size() != 0){
+ identity = identities.get(0);
+ }
+ }
+ catch (TopiaException ex) {
+ doCatch(topiaContext, ex, log);
+ }
+ finally {
+ doFinally(topiaContext, log);
+ }
+ return identity;
+ }
+
+
+ @Override
+ public void updateIdentityWithTransaction(Identity identity,
+ TopiaContext topiaContext) throws LimaException {
+ try {
+ IdentityDAO identityDAO = LimaCallaoDAOHelper.getIdentityDAO(topiaContext);
+ List<Identity> identities = identityDAO.findAll();
+ if (identities.size() != 0){
+ identityDAO.delete(identities.get(0));
+ }
+ identityDAO.create(identity);
+
+ commitTransaction(topiaContext);
+ }
+ catch (TopiaException ex) {
+ doCatch(topiaContext, ex, log);
+ }
+ }
+
+ @Override
+ public void updateIdentity(Identity identity) throws LimaException {
+ TopiaContext topiaContext = null;
+ try {
+ topiaContext = beginTransaction();
+
+ updateIdentityWithTransaction(identity, topiaContext);
+
+ commitTransaction(topiaContext);
+ }
+ catch (TopiaException ex) {
+ doCatch(topiaContext, ex, log);
+ }
+ finally {
+ doFinally(topiaContext, log);
+ }
+ }
+
+ protected TopiaContext beginTransaction() throws TopiaException {
+ // basic check done, make check in database
+ // TODO move it into JTA
+ TopiaContext topiaContext;
+ topiaContext = rootContext.beginTransaction();
+ log.trace("beginTransaction"+topiaContext);
+ return topiaContext;
+ }
+
+ protected void commitTransaction(TopiaContext topiaContext) throws TopiaException {
+ try {
+ topiaContext.commitTransaction();
+ } catch (TopiaException eee) {
+ if (log.isErrorEnabled()) {
+ log.error("Error during commit context", eee);
+ }
+ throw eee;
+ }
+ }
+
+}
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-07-22 10:36:21 UTC (rev 2983)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java 2010-07-22 16:25:57 UTC (rev 2984)
@@ -59,6 +59,7 @@
import org.chorem.lima.business.ejbinterface.FinancialStatementServiceLocal;
import org.chorem.lima.business.ejbinterface.FinancialTransactionServiceLocal;
import org.chorem.lima.business.ejbinterface.FiscalPeriodServiceLocal;
+import org.chorem.lima.business.ejbinterface.IdentityServiceLocal;
import org.chorem.lima.business.ejbinterface.ImportService;
import org.chorem.lima.business.ejbinterface.ImportServiceLocal;
import org.chorem.lima.business.utils.AccountEBPComparator;
@@ -86,6 +87,8 @@
import org.chorem.lima.entity.FiscalPeriod;
import org.chorem.lima.entity.FiscalPeriodDAO;
import org.chorem.lima.entity.FiscalPeriodImpl;
+import org.chorem.lima.entity.Identity;
+import org.chorem.lima.entity.IdentityImpl;
import org.chorem.lima.entity.LimaCallaoDAOHelper;
import org.nuiton.topia.TopiaContext;
import org.nuiton.topia.TopiaContextFactory;
@@ -131,6 +134,8 @@
@EJB
EntryBookServiceLocal entryBookService;
+ @EJB
+ IdentityServiceLocal identityService;
private static final SimpleDateFormat SDateFormat = new SimpleDateFormat("dd,MM,yyyy HH:mm:ss");
@@ -419,6 +424,9 @@
case ENTRY:
importEntriesCSV(nextLine, entries, topiaContext);
break;
+ case IDENTITY:
+ importIdentity(nextLine, topiaContext);
+ break;
}
}
}
@@ -1033,6 +1041,31 @@
return result;
}
+ public String importIdentity(String[] nextLine, TopiaContext topiaContext) throws LimaException {
+ String result = "";
+
+ Identity identity = new IdentityImpl();
+ nextLine[0] = ImportExportEntityEnum.IDENTITY.getLabel();
+ identity.setName(nextLine[1]);
+ identity.setDescription(nextLine[2]);
+ identity.setAddress(nextLine[3]);
+ identity.setAddress2(nextLine[4]);
+ identity.setCity(nextLine[5]);
+ identity.setPhoneNumber(nextLine[6]);
+ identity.setEmail(nextLine[7]);
+ identity.setZipCode(nextLine[8]);
+ identity.setVatNumber(nextLine[9]);
+ identity.setClassificationCode(nextLine[10]);
+ identity.setBusinessNumber(nextLine[11]);
+
+ identityService.updateIdentityWithTransaction(identity, topiaContext);
+ //create it
+ result += "SUCCESS : The identity " +
+ identity.getName() + " is created ! \n";
+
+ return result;
+ }
+
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-07-22 10:36:21 UTC (rev 2983)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/DocumentService.java 2010-07-22 16:25:57 UTC (rev 2984)
@@ -24,6 +24,7 @@
import javax.ejb.Remote;
import org.chorem.lima.beans.FinancialStatementAmounts;
+import org.chorem.lima.business.LimaException;
/**
* Interface to create pdf and html docs
@@ -34,6 +35,6 @@
@Remote
public interface DocumentService {
- public void createDocuments(List<FinancialStatementAmounts> financialStatementAmounts);
+ public void createFinancialStatementsDocuments(List<FinancialStatementAmounts> financialStatementAmounts) throws LimaException;
}
Added: 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 (rev 0)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/IdentityService.java 2010-07-22 16:25:57 UTC (rev 2984)
@@ -0,0 +1,33 @@
+/* *##% 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;
+
+import org.chorem.lima.business.LimaException;
+import org.chorem.lima.entity.Identity;
+
+@Remote
+public interface IdentityService {
+
+ public Identity getIdentity() throws LimaException;
+ public void updateIdentity(Identity identity) throws LimaException;
+
+}
Added: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/IdentityServiceLocal.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/IdentityServiceLocal.java (rev 0)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/IdentityServiceLocal.java 2010-07-22 16:25:57 UTC (rev 2984)
@@ -0,0 +1,34 @@
+/* *##% 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;
+
+import org.chorem.lima.business.LimaException;
+import org.chorem.lima.entity.Identity;
+import org.nuiton.topia.TopiaContext;
+
+@Local
+public interface IdentityServiceLocal {
+
+ public void updateIdentityWithTransaction(Identity identity, TopiaContext topiaContext) throws LimaException;
+
+
+}
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/utils/ImportExportEntityEnum.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/utils/ImportExportEntityEnum.java 2010-07-22 10:36:21 UTC (rev 2983)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/utils/ImportExportEntityEnum.java 2010-07-22 16:25:57 UTC (rev 2984)
@@ -2,7 +2,10 @@
public enum ImportExportEntityEnum {
- ACCOUNT("ACCN"), ENTRYBOOK("ENBK"), FINANCIALSTATEMENT("FNST"), FISCALPERIOD("FSCP"), CLOSEDPERIODICENTRYBOOK("CPEB"), FINANCIALTRANSACTION("FTRC"), ENTRY("NTRY");
+ ACCOUNT("ACCN"), ENTRYBOOK("ENBK"), FINANCIALSTATEMENT("FNST"),
+ FISCALPERIOD("FSCP"), CLOSEDPERIODICENTRYBOOK("CPEB"),
+ FINANCIALTRANSACTION("FTRC"), ENTRY("NTRY"),
+ IDENTITY("IDNT");
private final String label;
private ImportExportEntityEnum(String label) {
Modified: trunk/lima-callao/src/main/xmi/accounting.zargo
===================================================================
(Binary files differ)
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainView.jaxx 2010-07-22 10:36:21 UTC (rev 2983)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainView.jaxx 2010-07-22 16:25:57 UTC (rev 2984)
@@ -106,31 +106,17 @@
</JMenu>
</JMenu>
<JSeparator/>
- <JMenuItem text="lima.common.print" actionIcon='print'/>
- <JSeparator/>
- <JMenuItem id='menuFileFullscreen'
- text="lima.action.fullscreen"
- toolTipText="lima.action.fullscreen.tip"
- actionIcon="fullscreen"
- mnemonic="P"
- visible="{!isUndecorated()}"
- onActionPerformed="getHandler().changeScreen(this, true)"/>
+ <JMenuItem text="lima.identity"
+ actionIcon="identity" onActionPerformed="getHandler().showIdentity(this)"/>
<JMenuItem text="lima.preferences"
- actionIcon="config" onActionPerformed="getHandler().showConfig(this)"/>
- <JMenuItem id='menuFileNormalscreen'
- text="lima.action.normalscreen"
- toolTipText="lima.action.normalscreen.tip"
- actionIcon="leave-fullscreen"
- mnemonic="N"
- visible="{isUndecorated()}"
- onActionPerformed="getHandler().changeScreen(this, false)"/>
+ actionIcon="config" onActionPerformed="getHandler().showConfig(this)"/>
<JSeparator/>
<JMenuItem mnemonic="{'Q'}"
actionIcon='quit'
text="lima.common.quit" onActionPerformed='getHandler().close(this)'/>
</JMenu>
- <JMenu text="lima.structure">
+ <JMenu text="lima.structure" mnemonic="{'S'}">
<JMenuItem text="lima.charts.account" onActionPerformed='getHandler().showAccountView(this)'
actionIcon='charts-accounts'/>
<JMenuItem text="lima.charts.entrybook" onActionPerformed='getHandler().showEntryBookView(this)'
@@ -143,7 +129,7 @@
actionIcon='charts-financialstatements'/>
</JMenu>
- <JMenu text="lima.entries">
+ <JMenu text="lima.entries" mnemonic="{'E'}">
<JMenuItem text="lima.entries.addtransaction" onActionPerformed='getHandler().showTransactionView(this)'
actionIcon='entries-balanced'/>
<JMenuItem text="lima.entries.searchunbalancedtransaction" onActionPerformed='getHandler().showTransactionUnbalancedView(this)'
@@ -158,7 +144,7 @@
selected="false" actionIcon='view'/>
</JMenu>
-->
- <JMenu text="lima.reports">
+ <JMenu text="lima.reports" mnemonic="{'R'}">
<JMenuItem text="lima.reports.accounts" onActionPerformed='getHandler().showAccountReports(this)'
actionIcon='reports-account'/>
<JMenuItem text="lima.reports.entrybooks" onActionPerformed='getHandler().showEntryBookReports(this)'
@@ -172,6 +158,22 @@
</JMenu>
+ <JMenu text="lima.menu.window" mnemonic="{'W'}">
+ <JMenuItem id='menuFileFullscreen'
+ text="lima.action.fullscreen"
+ toolTipText="lima.action.fullscreen.tip"
+ actionIcon="fullscreen"
+ mnemonic="P"
+ visible="{!isUndecorated()}"
+ onActionPerformed="getHandler().changeScreen(this, true)"/>
+ <JMenuItem id='menuFileNormalscreen'
+ text="lima.action.normalscreen"
+ toolTipText="lima.action.normalscreen.tip"
+ actionIcon="leave-fullscreen"
+ mnemonic="N"
+ visible="{isUndecorated()}"
+ onActionPerformed="getHandler().changeScreen(this, false)"/>
+ </JMenu>
<JMenu text="lima.menu.help" mnemonic="{'H'}">
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-07-22 10:36:21 UTC (rev 2983)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainViewHandler.java 2010-07-22 16:25:57 UTC (rev 2984)
@@ -31,6 +31,7 @@
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.LimaConfig;
import org.chorem.lima.LimaContext;
+import org.chorem.lima.entity.Identity;
import org.chorem.lima.ui.account.AccountView;
import org.chorem.lima.ui.accountsreports.AccountsReportsView;
import org.chorem.lima.ui.balance.BalanceView;
@@ -44,6 +45,7 @@
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;
import org.chorem.lima.ui.importexport.ImportExport;
import org.chorem.lima.ui.importexport.ImportExportEnum;
import org.chorem.lima.ui.ledger.LedgerView;
@@ -281,6 +283,14 @@
HomeView homeView = new HomeView(mainView);
mainView.showTab(_("lima.tab.home"), homeView, false);
}
+
+ public void showIdentity(JAXXContext rootContext) {
+ MainView mainView = getUI(rootContext);
+ IdentityForm identityForm = new IdentityForm();
+ identityForm.setLocationRelativeTo(mainView);
+ identityForm.setVisible(true);
+ }
+
/**
* Show account tree table view to create or modify accounts
* @param rootContext
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-07-22 10:36:21 UTC (rev 2983)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportTableModel.java 2010-07-22 16:25:57 UTC (rev 2984)
@@ -32,7 +32,6 @@
import org.chorem.lima.business.ImportServiceMonitorable;
import org.chorem.lima.business.LimaException;
import org.chorem.lima.business.ServiceListener;
-import org.chorem.lima.business.ejbinterface.DocumentService;
import org.chorem.lima.service.LimaServiceFactory;
import org.chorem.lima.util.ErrorHelper;
@@ -210,7 +209,13 @@
}
public void createDocuments(){
- documentService.createDocuments(cacheDataList);
+ try {
+ documentService.createFinancialStatementsDocuments(cacheDataList);
+ } catch (LimaException e) {
+ if (log.isDebugEnabled()){
+ log.debug("Error on create document",e);
+ }
+ }
}
@Override
Added: 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 (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/identity/IdentityForm.jaxx 2010-07-22 16:25:57 UTC (rev 2984)
@@ -0,0 +1,165 @@
+<!-- ##% 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">
+
+ <IdentityHandler id="handler" javaBean="new IdentityHandler()" />
+ <org.chorem.lima.entity.Identity id="identity" javaBean='handler.getIdentity()'/>
+
+ <script>
+ <![CDATA[
+
+ protected void performCancel() {
+ setIdentity(null);
+ dispose();
+ }
+ ]]>
+ </script>
+
+ <Table>
+ <row>
+ <cell fill="horizontal">
+ <JLabel text="lima.identity.name"/>
+ </cell>
+ <cell fill="horizontal">
+ <JTextField id="nameTextField" text="{getIdentity().getName()}"/>
+ <javax.swing.text.Document javaBean="getNameTextField().getDocument()"
+ onInsertUpdate='getIdentity().setName(getNameTextField().getText())'
+ onRemoveUpdate='getIdentity().setName(getNameTextField().getText())' />
+ </cell>
+ </row>
+ <row>
+ <cell fill="horizontal">
+ <JLabel text="lima.identity.description"/>
+ </cell>
+ <cell fill="horizontal">
+ <JTextField id="descriptionTextField" text="{getIdentity().getDescription()}"/>
+ <javax.swing.text.Document javaBean="getDescriptionTextField().getDocument()"
+ onInsertUpdate='getIdentity().setDescription(getDescriptionTextField().getText())'
+ onRemoveUpdate='getIdentity().setDescription(getDescriptionTextField().getText())' />
+ </cell>
+ </row>
+ <row>
+ <cell fill="horizontal">
+ <JLabel text="lima.identity.address"/>
+ </cell>
+ <cell fill="horizontal">
+ <JTextField id="addressTextField" text="{getIdentity().getAddress()}"/>
+ <javax.swing.text.Document javaBean="getAddressTextField().getDocument()"
+ onInsertUpdate='getIdentity().setAddress(getAddressTextField().getText())'
+ onRemoveUpdate='getIdentity().setAddress(getAddressTextField().getText())' />
+ </cell>
+ </row>
+ <row>
+ <cell fill="horizontal">
+ <JLabel text="lima.identity.address2"/>
+ </cell>
+ <cell fill="horizontal">
+ <JTextField id="address2TextField" text="{getIdentity().getAddress2()}"/>
+ <javax.swing.text.Document javaBean="getAddress2TextField().getDocument()"
+ onInsertUpdate='getIdentity().setAddress2(getAddress2TextField().getText())'
+ onRemoveUpdate='getIdentity().setAddress2(getAddress2TextField().getText())' />
+ </cell>
+ </row>
+ <row>
+ <cell fill="horizontal">
+ <JLabel text="lima.identity.zipCode"/>
+ </cell>
+ <cell fill="horizontal">
+ <JTextField id="zipCodeTextField" text="{getIdentity().getZipCode()}"/>
+ <javax.swing.text.Document javaBean="getZipCodeTextField().getDocument()"
+ onInsertUpdate='getIdentity().setZipCode(getZipCodeTextField().getText())'
+ onRemoveUpdate='getIdentity().setZipCode(getZipCodeTextField().getText())' />
+ </cell>
+ </row>
+ <row>
+ <cell fill="horizontal">
+ <JLabel text="lima.identity.city"/>
+ </cell>
+ <cell fill="horizontal">
+ <JTextField id="cityTextField" text="{getIdentity().getCity()}"/>
+ <javax.swing.text.Document javaBean="getCityTextField().getDocument()"
+ onInsertUpdate='getIdentity().setCity(getCityTextField().getText())'
+ onRemoveUpdate='getIdentity().setCity(getCityTextField().getText())' />
+ </cell>
+ </row>
+ <row>
+ <cell fill="horizontal">
+ <JLabel text="lima.identity.businessNumber"/>
+ </cell>
+ <cell fill="horizontal">
+ <JTextField id="businessNumberTextField" text="{getIdentity().getBusinessNumber()}"/>
+ <javax.swing.text.Document javaBean="getBusinessNumberTextField().getDocument()"
+ onInsertUpdate='getIdentity().setBusinessNumber(getBusinessNumberTextField().getText())'
+ onRemoveUpdate='getIdentity().setBusinessNumber(getBusinessNumberTextField().getText())' />
+ </cell>
+ </row>
+ <row>
+ <cell fill="horizontal">
+ <JLabel text="lima.identity.vatNumber"/>
+ </cell>
+ <cell fill="horizontal">
+ <JTextField id="vatNumberTextField" text="{getIdentity().getVatNumber()}"/>
+ <javax.swing.text.Document javaBean="getVatNumberTextField().getDocument()"
+ onInsertUpdate='getIdentity().setVatNumber(getVatNumberTextField().getText())'
+ onRemoveUpdate='getIdentity().setVatNumber(getVatNumberTextField().getText())' />
+ </cell>
+ </row>
+ <row>
+ <cell fill="horizontal">
+ <JLabel text="lima.identity.classificationCode"/>
+ </cell>
+ <cell fill="horizontal">
+ <JTextField id="classificationCodeTextField" text="{getIdentity().getClassificationCode()}"/>
+ <javax.swing.text.Document javaBean="getClassificationCodeTextField().getDocument()"
+ onInsertUpdate='getIdentity().setClassificationCode(getClassificationCodeTextField().getText())'
+ onRemoveUpdate='getIdentity().setClassificationCode(getClassificationCodeTextField().getText())' />
+ </cell>
+ </row>
+ <row>
+ <cell fill="horizontal">
+ <JLabel text="lima.identity.phoneNumber"/>
+ </cell>
+ <cell fill="horizontal">
+ <JTextField id="phoneNumberTextField" text="{getIdentity().getPhoneNumber()}"/>
+ <javax.swing.text.Document javaBean="getPhoneNumberTextField().getDocument()"
+ onInsertUpdate='getIdentity().setPhoneNumber(getPhoneNumberTextField().getText())'
+ onRemoveUpdate='getIdentity().setPhoneNumber(getPhoneNumberTextField().getText())' />
+ </cell>
+ </row>
+ <row>
+ <cell fill="horizontal">
+ <JLabel text="lima.identity.email"/>
+ </cell>
+ <cell fill="horizontal">
+ <JTextField id="emailTextField" text="{getIdentity().getEmail()}"/>
+ <javax.swing.text.Document javaBean="getEmailTextField().getDocument()"
+ onInsertUpdate='getIdentity().setEmail(getEmailTextField().getText())'
+ onRemoveUpdate='getIdentity().setEmail(getEmailTextField().getText())' />
+ </cell>
+ </row>
+ <row>
+ <cell fill="none">
+ <JButton text="lima.common.ok" onActionPerformed="handler.updateIdentity(getIdentity());
+ dispose()"/>
+ </cell>
+ <cell fill="none">
+ <JButton text="lima.common.cancel" onActionPerformed="performCancel()"/>
+ </cell>
+ </row>
+ </Table>
+</JDialog>
\ No newline at end of file
Property changes on: trunk/lima-swing/src/main/java/org/chorem/lima/ui/identity/IdentityForm.jaxx
___________________________________________________________________
Added: svn:executable
+ *
Added: trunk/lima-swing/src/main/java/org/chorem/lima/ui/identity/IdentityHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/identity/IdentityHandler.java (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/identity/IdentityHandler.java 2010-07-22 16:25:57 UTC (rev 2984)
@@ -0,0 +1,69 @@
+/* *##% 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.identity;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.chorem.lima.business.IdentityServiceMonitorable;
+import org.chorem.lima.business.LimaException;
+import org.chorem.lima.business.ejbinterface.IdentityService;
+import org.chorem.lima.entity.Identity;
+import org.chorem.lima.entity.IdentityImpl;
+import org.chorem.lima.service.LimaServiceFactory;
+
+public class IdentityHandler {
+
+ protected IdentityService identityService;
+
+ private static final Log log = LogFactory.getLog(IdentityHandler.class);
+
+
+ public IdentityHandler() {
+ identityService =
+ LimaServiceFactory.getInstance().getService(
+ IdentityServiceMonitorable.class);
+ }
+
+ public Identity getIdentity(){
+ Identity identity = null;
+ try {
+ identity = identityService.getIdentity();
+ } catch (LimaException eee) {
+ if (log.isDebugEnabled()){
+ log.debug("Can't get Identity", eee);
+ }
+ }
+ if (identity == null){
+ identity = new IdentityImpl();
+ }
+ return identity;
+ }
+
+ public void updateIdentity(Identity identity){
+
+ try {
+ identityService.updateIdentity(identity);
+ } catch (LimaException eee) {
+ if (log.isDebugEnabled()){
+ log.debug("Can't update Identity", eee);
+ }
+ }
+ }
+
+}
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-22 10:36:21 UTC (rev 2983)
+++ trunk/lima-swing/src/main/resources/i18n/lima-swing-en_GB.properties 2010-07-22 16:25:57 UTC (rev 2984)
@@ -98,7 +98,19 @@
lima.financialstatement.subamount=
lima.fiscalperiod.addFiscalPeriod=
lima.fiscalperiod.block=
+lima.identity=
+lima.identity.address=
+lima.identity.address2=
+lima.identity.businessNumber=
+lima.identity.city=
+lima.identity.classificationCode=
lima.identity.contact=
+lima.identity.description=
+lima.identity.email=
+lima.identity.name=
+lima.identity.phoneNumber=
+lima.identity.vatNumber=
+lima.identity.zipCode=
lima.import=Import
lima.import.account=Import PCG
lima.import.all=Import all datas
@@ -134,6 +146,7 @@
lima.menu.help.i18n.fr=French
lima.menu.help.i18n.uk=English
lima.menu.help.site=WebSite
+lima.menu.window=
lima.message.help.usage=
lima.misc.supportemail.description=
lima.open=Open
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-22 10:36:21 UTC (rev 2983)
+++ trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties 2010-07-22 16:25:57 UTC (rev 2984)
@@ -98,7 +98,19 @@
lima.financialstatement.subamount=Calculer un sous-total
lima.fiscalperiod.addFiscalPeriod=Nouvel exercice
lima.fiscalperiod.block=Cloturer un exercice
+lima.identity=Identit\u00E9
+lima.identity.address=Adresse
+lima.identity.address2=Adresse (suite)
+lima.identity.businessNumber=SIRET
+lima.identity.city=Ville
+lima.identity.classificationCode=Code NAF
lima.identity.contact=Contact
+lima.identity.description=Description
+lima.identity.email=Courriel
+lima.identity.name=Nom
+lima.identity.phoneNumber=n\u00B0 Tel
+lima.identity.vatNumber=n\u00B0 TVA
+lima.identity.zipCode=Code Postal
lima.import=Import
lima.import.account=Importer le PCG
lima.import.all=Importer une nouvelle base (XML)
@@ -134,6 +146,7 @@
lima.menu.help.i18n.fr=Fran\u00E7ais
lima.menu.help.i18n.uk=Anglais
lima.menu.help.site=Acc\u00E9der au site de Lima
+lima.menu.window=Fen\u00EAtre
lima.message.help.usage=
lima.misc.supportemail.description=
lima.open=Ouvert
Modified: trunk/lima-swing/src/main/resources/icons/action-config.png
===================================================================
(Binary files differ)
Added: trunk/lima-swing/src/main/resources/icons/action-identity.png
===================================================================
(Binary files differ)
Property changes on: trunk/lima-swing/src/main/resources/icons/action-identity.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
1
0
Author: jpepin
Date: 2010-07-22 12:36:21 +0200 (Thu, 22 Jul 2010)
New Revision: 2983
Url: http://chorem.org/repositories/revision/lima/2983
Log:
D?\195?\169placement cr?\195?\169ation de document pdf et html dans un nouveau service du business.
Added:
trunk/lima-business/src/main/java/org/chorem/lima/business/DocumentServiceMonitorable.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/
trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/AccountService.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/AccountServiceLocal.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/DocumentService.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/DocumentServiceLocal.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/EntryBookService.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/EntryBookServiceLocal.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ExportService.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ExportServiceLocal.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialPeriodService.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialPeriodServiceLocal.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialStatementService.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialStatementServiceLocal.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialTransactionService.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialTransactionServiceLocal.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FiscalPeriodService.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FiscalPeriodServiceLocal.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ImportService.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ImportServiceLocal.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/RecordService.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/RecordServiceLocal.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
Removed:
trunk/lima-business/src/main/java/org/chorem/lima/business/AccountService.java
trunk/lima-business/src/main/java/org/chorem/lima/business/AccountServiceLocal.java
trunk/lima-business/src/main/java/org/chorem/lima/business/EntryBookService.java
trunk/lima-business/src/main/java/org/chorem/lima/business/EntryBookServiceLocal.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ExportService.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ExportServiceLocal.java
trunk/lima-business/src/main/java/org/chorem/lima/business/FinancialPeriodService.java
trunk/lima-business/src/main/java/org/chorem/lima/business/FinancialPeriodServiceLocal.java
trunk/lima-business/src/main/java/org/chorem/lima/business/FinancialStatementService.java
trunk/lima-business/src/main/java/org/chorem/lima/business/FinancialStatementServiceLocal.java
trunk/lima-business/src/main/java/org/chorem/lima/business/FinancialTransactionService.java
trunk/lima-business/src/main/java/org/chorem/lima/business/FinancialTransactionServiceLocal.java
trunk/lima-business/src/main/java/org/chorem/lima/business/FiscalPeriodService.java
trunk/lima-business/src/main/java/org/chorem/lima/business/FiscalPeriodServiceLocal.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ImportService.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ImportServiceLocal.java
trunk/lima-business/src/main/java/org/chorem/lima/business/RecordService.java
trunk/lima-business/src/main/java/org/chorem/lima/business/RecordServiceLocal.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ReportService.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ReportServiceLocal.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/xml/
Modified:
trunk/lima-business/pom.xml
trunk/lima-business/src/main/java/org/chorem/lima/business/AccountServiceMonitorable.java
trunk/lima-business/src/main/java/org/chorem/lima/business/EntryBookServiceMonitorable.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ExportServiceMonitorable.java
trunk/lima-business/src/main/java/org/chorem/lima/business/FinancialPeriodServiceMonitorable.java
trunk/lima-business/src/main/java/org/chorem/lima/business/FinancialStatementServiceMonitorable.java
trunk/lima-business/src/main/java/org/chorem/lima/business/FinancialTransactionServiceMonitorable.java
trunk/lima-business/src/main/java/org/chorem/lima/business/FiscalPeriodServiceMonitorable.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ImportServiceMonitorable.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ReportServiceMonitorable.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ServiceListener.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ServiceMonitorable.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/EntryBookServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ExportServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialPeriodServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialStatementServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FiscalPeriodServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/RecordServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java
trunk/lima-swing/pom.xml
trunk/lima-swing/src/main/java/org/chorem/lima/LimaMain.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookViewHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialperiod/FinancialPeriodTable.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementDocument.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportTableModel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedTableModel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/AddPeriod.jaxx
Modified: trunk/lima-business/pom.xml
===================================================================
--- trunk/lima-business/pom.xml 2010-07-22 09:10:03 UTC (rev 2982)
+++ trunk/lima-business/pom.xml 2010-07-22 10:36:21 UTC (rev 2983)
@@ -28,6 +28,10 @@
<groupId>net.sf.opencsv</groupId>
<artifactId>opencsv</artifactId>
</dependency>
+ <dependency>
+ <groupId>com.lowagie</groupId>
+ <artifactId>itext</artifactId>
+ </dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
Deleted: trunk/lima-business/src/main/java/org/chorem/lima/business/AccountService.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/AccountService.java 2010-07-22 09:10:03 UTC (rev 2982)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/AccountService.java 2010-07-22 10:36:21 UTC (rev 2983)
@@ -1,65 +0,0 @@
-/* *##% Lima Business
- * Copyright (C) 2008 - 2010 CodeLutin
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- * ##%*
- */
-
-package org.chorem.lima.business;
-
-import java.util.List;
-import javax.ejb.Remote;
-import org.chorem.lima.entity.Account;
-
-/**
- * Account service.
- *
- * @author chatellier
- * @version $Revision$
- *
- * Last update : $Date$
- * By : $Author$
- */
-
-@Remote
-public interface AccountService {
-
- List<Account> getAllAccounts() throws LimaException;
-
- List<Account> getAllSubAccounts() throws LimaException;
-
- /**
- * Create new account. If {@code masterAccount} is not null, {@code account}
- * is added in {@code masterAccount}'s subAccounts.
- *
- * @param masterAccount master account (can be null)
- * @param account account
- * @throws LimaException
- */
- //EJB Remote
- void createAccount(Account masterAccount, Account account) throws LimaException, LimaBusinessException;
-
- void createSubLedger(Account masterAccount, Account account) throws LimaException;
-
- void updateAccount(Account account) throws LimaException;
-
- void removeAccount(Account account) throws LimaException;
- void removeAllAccount() throws LimaException;
-
- List<Account> getAllChildrenAccounts(Account masterAccount, List<Account> accounts) throws LimaException;
-
- //EJB Remote et local
- List<Account> getChildrenAccounts(Account masterAccount) throws LimaException;
-}
Deleted: trunk/lima-business/src/main/java/org/chorem/lima/business/AccountServiceLocal.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/AccountServiceLocal.java 2010-07-22 09:10:03 UTC (rev 2982)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/AccountServiceLocal.java 2010-07-22 10:36:21 UTC (rev 2983)
@@ -1,44 +0,0 @@
-/* *##% Lima Business
- * Copyright (C) 2008 - 2010 CodeLutin
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- * ##%*
- */
-
-package org.chorem.lima.business;
-
-import java.util.List;
-
-import javax.ejb.Local;
-
-import org.chorem.lima.entity.Account;
-import org.nuiton.topia.TopiaContext;
-
-/**
- * Account service.
- *
- * @author chatellier
- * @version $Revision: 2917 $
- *
- * Last update : $Date: 2010-05-31 15:11:26 +0200 (lun. 31 mai 2010) $
- * By : $Author: jpepin $
- */
-
-@Local
-public interface AccountServiceLocal extends AccountService{
-
- public List<Account> stringToListAccountsWithTransaction(String selectedAccounts, TopiaContext topiaContext) throws LimaException;
-
-}
\ No newline at end of file
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/AccountServiceMonitorable.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/AccountServiceMonitorable.java 2010-07-22 09:10:03 UTC (rev 2982)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/AccountServiceMonitorable.java 2010-07-22 10:36:21 UTC (rev 2983)
@@ -1,5 +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.AccountService;
+
public interface AccountServiceMonitorable extends AccountService, ServiceMonitorable {
}
Added: trunk/lima-business/src/main/java/org/chorem/lima/business/DocumentServiceMonitorable.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/DocumentServiceMonitorable.java (rev 0)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/DocumentServiceMonitorable.java 2010-07-22 10:36:21 UTC (rev 2983)
@@ -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.DocumentService;
+
+public interface DocumentServiceMonitorable extends DocumentService, ServiceMonitorable {
+
+}
Deleted: trunk/lima-business/src/main/java/org/chorem/lima/business/EntryBookService.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/EntryBookService.java 2010-07-22 09:10:03 UTC (rev 2982)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/EntryBookService.java 2010-07-22 10:36:21 UTC (rev 2983)
@@ -1,46 +0,0 @@
-/* *##% Lima Business
- * Copyright (C) 2008 - 2010 CodeLutin
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- * ##%*
- */
-
-package org.chorem.lima.business;
-
-import java.util.List;
-import javax.ejb.Remote;
-import org.chorem.lima.entity.EntryBook;
-
-/**
- * Entry book service.
- *
- * @author chatellier
- * @version $Revision$
- *
- * Last update : $Date$
- * By : $Author$
- */
-
-@Remote
-public interface EntryBookService {
-
- List<EntryBook> getAllEntryBooks() throws LimaException;
-
- void createEntryBook(EntryBook entryBook) throws LimaException;
-
- void updateEntryBook(EntryBook entryBook) throws LimaException;
-
- void removeEntryBook(EntryBook entryBook) throws LimaException;
-}
Deleted: trunk/lima-business/src/main/java/org/chorem/lima/business/EntryBookServiceLocal.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/EntryBookServiceLocal.java 2010-07-22 09:10:03 UTC (rev 2982)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/EntryBookServiceLocal.java 2010-07-22 10:36:21 UTC (rev 2983)
@@ -1,38 +0,0 @@
-/* *##% Lima Business
- * Copyright (C) 2008 - 2010 CodeLutin
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- * ##%*
- */
-
-package org.chorem.lima.business;
-
-import javax.ejb.Local;
-
-
-/**
- * Entry book service.
- *
- * @author chatellier
- * @version $Revision: 2889 $
- *
- * Last update : $Date: 2010-05-10 15:13:56 +0200 (lun. 10 mai 2010) $
- * By : $Author: jpepin $
- */
-
-@Local
-public interface EntryBookServiceLocal extends EntryBookService {
-
-}
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/EntryBookServiceMonitorable.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/EntryBookServiceMonitorable.java 2010-07-22 09:10:03 UTC (rev 2982)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/EntryBookServiceMonitorable.java 2010-07-22 10:36:21 UTC (rev 2983)
@@ -1,5 +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.EntryBookService;
+
public interface EntryBookServiceMonitorable extends EntryBookService, ServiceMonitorable {
}
Deleted: trunk/lima-business/src/main/java/org/chorem/lima/business/ExportService.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ExportService.java 2010-07-22 09:10:03 UTC (rev 2982)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ExportService.java 2010-07-22 10:36:21 UTC (rev 2983)
@@ -1,73 +0,0 @@
-/* *##% Lima Business
- * Copyright (C) 2008 - 2010 CodeLutin
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- * ##%*
- */
-
-package org.chorem.lima.business;
-
-import javax.ejb.Remote;
-
-/**
- * Import export service.
- *
- * Currently import and export as XML.
- *
- * @author chatellier
- * @version $Revision: 2962 $
- *
- * Last update : $Date: 2010-07-05 16:59:28 +0200 (lun., 05 juil. 2010) $
- * By : $Author: jpepin $
- */
-@Remote
-public interface ExportService {
-
-
- /**
- * Get database export as CSV;
- *
- * @return export as byte array
- * @throws LimaException
- */
- public String exportAsCSV() throws LimaException;
-
- /**
- * export entrybook chart as CSV.
- */
- public String exportEntryBookChartAsCSV() throws LimaException;
-
- /**
- * export financialstatement chart as CSV.
- */
- public String exportFinancialStatementChartAsCSV() throws LimaException;
-
- /**
- * export accounts chart as CSV.
- */
- public String exportAccountsChartAsCSV() throws LimaException;
-
- /**
- * export entries as EBP
- */
- public String exportEntriesAsEBP() throws LimaException;
-
- /**
- * export accounts as EBP
- */
- public String exportAccountsAsEBP() throws LimaException;
-
-
-}
Deleted: trunk/lima-business/src/main/java/org/chorem/lima/business/ExportServiceLocal.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ExportServiceLocal.java 2010-07-22 09:10:03 UTC (rev 2982)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ExportServiceLocal.java 2010-07-22 10:36:21 UTC (rev 2983)
@@ -1,38 +0,0 @@
-/* *##% Lima Business
- * Copyright (C) 2008 - 2010 CodeLutin
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- * ##%*
- */
-
-package org.chorem.lima.business;
-
-import javax.ejb.Local;
-
-/**
- * Import export service.
- *
- * Currently import and export as XML.
- *
- * @author chatellier
- * @version $Revision: 2824 $
- *
- * Last update : $Date: 2010-04-02 18:55:19 +0200 (ven. 02 avril 2010) $
- * By : $Author: echatellier $
- */
-@Local
-public interface ExportServiceLocal extends ExportService {
-
-}
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ExportServiceMonitorable.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ExportServiceMonitorable.java 2010-07-22 09:10:03 UTC (rev 2982)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ExportServiceMonitorable.java 2010-07-22 10:36:21 UTC (rev 2983)
@@ -1,5 +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.ExportService;
+
public interface ExportServiceMonitorable extends ExportService, ServiceMonitorable {
}
Deleted: trunk/lima-business/src/main/java/org/chorem/lima/business/FinancialPeriodService.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/FinancialPeriodService.java 2010-07-22 09:10:03 UTC (rev 2982)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/FinancialPeriodService.java 2010-07-22 10:36:21 UTC (rev 2983)
@@ -1,53 +0,0 @@
-/* *##% Lima Business
- * Copyright (C) 2008 - 2010 CodeLutin
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- * ##%*
- */
-
-package org.chorem.lima.business;
-
-import java.util.List;
-import javax.ejb.Remote;
-import org.chorem.lima.entity.ClosedPeriodicEntryBook;
-import org.chorem.lima.entity.EntryBook;
-import org.chorem.lima.entity.FinancialPeriod;
-
-/**
- * Financial period service.
- *
- * @author chatellier
- * @version $Revision$
- *
- * Last update : $Date$
- * By : $Author$
- */
-
-@Remote
-public interface FinancialPeriodService {
-
- List<FinancialPeriod> getUnblockedFinancialPeriods() throws LimaException;
-
-
- void createFinancialPeriods(List<FinancialPeriod> financialPeriods) throws LimaException;
-
- /** Methodes for closedperiodicentrybook */
-
- ClosedPeriodicEntryBook getClosedPeriodicEntryBook(EntryBook entryBook, FinancialPeriod financialPeriod) throws LimaException;
-
- List<ClosedPeriodicEntryBook> getAllClosedPeriodicEntryBooksFromUnblockedFiscalPeriod() throws LimaException;
-
- void blockClosedPeriodicEntryBook(ClosedPeriodicEntryBook closedPeriodicEntryBook) throws LimaException;
-}
Deleted: trunk/lima-business/src/main/java/org/chorem/lima/business/FinancialPeriodServiceLocal.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/FinancialPeriodServiceLocal.java 2010-07-22 09:10:03 UTC (rev 2982)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/FinancialPeriodServiceLocal.java 2010-07-22 10:36:21 UTC (rev 2983)
@@ -1,46 +0,0 @@
-/* *##% Lima Business
- * Copyright (C) 2008 - 2010 CodeLutin
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- * ##%*
- */
-
-package org.chorem.lima.business;
-
-import java.util.List;
-
-import javax.ejb.Local;
-
-import org.chorem.lima.entity.FinancialPeriod;
-import org.nuiton.topia.TopiaContext;
-
-
-/**
- * Financial period service.
- *
- * @author chatellier
- * @version $Revision: 2913 $
- *
- * Last update : $Date: 2010-05-27 16:36:34 +0200 (jeu. 27 mai 2010) $
- * By : $Author: jpepin $
- */
-
-@Local
-public interface FinancialPeriodServiceLocal extends FinancialPeriodService {
-
- void createFinancialPeriodsWithTransaction(List<FinancialPeriod> financialPeriods, TopiaContext topiaContext) throws LimaException;
-
-
-}
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/FinancialPeriodServiceMonitorable.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/FinancialPeriodServiceMonitorable.java 2010-07-22 09:10:03 UTC (rev 2982)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/FinancialPeriodServiceMonitorable.java 2010-07-22 10:36:21 UTC (rev 2983)
@@ -1,5 +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.FinancialPeriodService;
+
public interface FinancialPeriodServiceMonitorable extends FinancialPeriodService, ServiceMonitorable {
}
Deleted: trunk/lima-business/src/main/java/org/chorem/lima/business/FinancialStatementService.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/FinancialStatementService.java 2010-07-22 09:10:03 UTC (rev 2982)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/FinancialStatementService.java 2010-07-22 10:36:21 UTC (rev 2983)
@@ -1,44 +0,0 @@
-/* *##% Lima Business
- * Copyright (C) 2008 - 2010 CodeLutin
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- * ##%*
- */
-
-package org.chorem.lima.business;
-
-import java.util.Date;
-import java.util.List;
-
-import javax.ejb.Remote;
-
-import org.chorem.lima.beans.FinancialStatementAmounts;
-import org.chorem.lima.entity.FinancialStatement;
-
-@Remote
-public interface FinancialStatementService {
-
-
- public void createFinancialStatement(FinancialStatement masterFinancialStatement, FinancialStatement financialStatement) throws LimaException, LimaBusinessException;
- public void updateFinancialStatement(FinancialStatement financialStatement) throws LimaException, LimaBusinessException;
- public void removeFinancialStatement(FinancialStatement financialStatement) throws LimaException, LimaBusinessException;
-
- public List<FinancialStatement> getAllFinancialStatements() throws LimaException;
- public List<FinancialStatement> getChildrenFinancialStatement(FinancialStatement financialStatement) throws LimaException;
- public List<FinancialStatement> getAllChildrenFinancialStatement(FinancialStatement financialStatement, List<FinancialStatement> financialStatements) throws LimaException, LimaBusinessException;
-
- public List<FinancialStatementAmounts> financialStatementReport(Date selectedBeginDate, Date selectedEndDate) throws LimaException;
-
-}
Deleted: trunk/lima-business/src/main/java/org/chorem/lima/business/FinancialStatementServiceLocal.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/FinancialStatementServiceLocal.java 2010-07-22 09:10:03 UTC (rev 2982)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/FinancialStatementServiceLocal.java 2010-07-22 10:36:21 UTC (rev 2983)
@@ -1,27 +0,0 @@
-/* *##% Lima Business
- * Copyright (C) 2008 - 2010 CodeLutin
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- * ##%*
- */
-
-package org.chorem.lima.business;
-
-import javax.ejb.Local;
-
-@Local
-public interface FinancialStatementServiceLocal extends FinancialStatementService {
-
-}
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/FinancialStatementServiceMonitorable.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/FinancialStatementServiceMonitorable.java 2010-07-22 09:10:03 UTC (rev 2982)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/FinancialStatementServiceMonitorable.java 2010-07-22 10:36:21 UTC (rev 2983)
@@ -1,5 +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.FinancialStatementService;
+
public interface FinancialStatementServiceMonitorable extends FinancialStatementService, ServiceMonitorable {
}
Deleted: trunk/lima-business/src/main/java/org/chorem/lima/business/FinancialTransactionService.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/FinancialTransactionService.java 2010-07-22 09:10:03 UTC (rev 2982)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/FinancialTransactionService.java 2010-07-22 10:36:21 UTC (rev 2983)
@@ -1,80 +0,0 @@
-/* *##% Lima Business
- * Copyright (C) 2008 - 2010 CodeLutin
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- * ##%*
- */
-
-package org.chorem.lima.business;
-
-import java.util.List;
-
-import javax.ejb.Remote;
-
-import org.chorem.lima.entity.Entry;
-import org.chorem.lima.entity.EntryBook;
-import org.chorem.lima.entity.FinancialPeriod;
-import org.chorem.lima.entity.FinancialTransaction;
-import org.chorem.lima.entity.FiscalPeriod;
-
-/**
- * Transaction service.
- *
- * @author chatellier
- * @version $Revision$
- *
- * Last update : $Date$
- * By : $Author$
- */
-
-@Remote
-public interface FinancialTransactionService {
-
-
- /**
- * Find all transaction for an entry book and a financial period.
- *
- * @param entryBook entry book
- * @param period financial period
- * @return all transaction for entry book and period
- * @throws LimaException
- */
- List<FinancialTransaction> getAllFinancialTransactionsForFinancialPeriod(
- FinancialPeriod period) throws LimaException;
-
- List<FinancialTransaction> getAllFinancialTransactionsForEntryBookAndFinancialPeriod(
- EntryBook entryBook, FinancialPeriod period) throws LimaException;
-
- List<FinancialTransaction> getAllFinancialTransactionsUnbalanced(FiscalPeriod fiscalPeriod) throws LimaException;
-
- void createFinancialTransaction(FinancialTransaction financialtransaction) throws LimaException;
-
- void updateFinancialTransaction(FinancialTransaction financialtransaction) throws LimaException, LimaBusinessException;
-
- void removeFinancialTransaction(FinancialTransaction financialtransaction) throws LimaException;
-
- /**
- * Methodes for create, update and remove the entry
- * @param entry
- * @throws LimaException
- */
-
- void createEntry(Entry entry) throws LimaException;
-
- void updateEntry(Entry entry) throws LimaException;
-
- void removeEntry(Entry entry) throws LimaException;
-
-}
Deleted: trunk/lima-business/src/main/java/org/chorem/lima/business/FinancialTransactionServiceLocal.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/FinancialTransactionServiceLocal.java 2010-07-22 09:10:03 UTC (rev 2982)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/FinancialTransactionServiceLocal.java 2010-07-22 10:36:21 UTC (rev 2983)
@@ -1,42 +0,0 @@
-/* *##% Lima Business
- * Copyright (C) 2008 - 2010 CodeLutin
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- * ##%*
- */
-
-package org.chorem.lima.business;
-
-import java.util.List;
-import javax.ejb.Local;
-import org.chorem.lima.entity.FinancialTransaction;
-import org.nuiton.topia.TopiaContext;
-
-/**
- * Transaction service.
- *
- * @author chatellier
- * @version $Revision: 2917 $
- *
- * Last update : $Date: 2010-05-31 15:11:26 +0200 (lun. 31 mai 2010) $
- * By : $Author: jpepin $
- */
-
-@Local
-public interface FinancialTransactionServiceLocal extends FinancialTransactionService {
-
- public List<FinancialTransaction> getAllFinancialTransactionsBalanced(TopiaContext topiaContext) throws LimaException;
-
-}
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/FinancialTransactionServiceMonitorable.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/FinancialTransactionServiceMonitorable.java 2010-07-22 09:10:03 UTC (rev 2982)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/FinancialTransactionServiceMonitorable.java 2010-07-22 10:36:21 UTC (rev 2983)
@@ -1,5 +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.FinancialTransactionService;
+
public interface FinancialTransactionServiceMonitorable extends FinancialTransactionService, ServiceMonitorable {
}
Deleted: trunk/lima-business/src/main/java/org/chorem/lima/business/FiscalPeriodService.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/FiscalPeriodService.java 2010-07-22 09:10:03 UTC (rev 2982)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/FiscalPeriodService.java 2010-07-22 10:36:21 UTC (rev 2983)
@@ -1,51 +0,0 @@
-/* *##% Lima Business
- * Copyright (C) 2008 - 2010 CodeLutin
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- * ##%*
- */
-
-package org.chorem.lima.business;
-
-import java.util.List;
-
-import javax.ejb.Remote;
-
-import org.chorem.lima.entity.FiscalPeriod;
-
-/**
- * Fiscal period service.
- *
- * @author chatellier
- * @version $Revision$
- *
- * Last update : $Date$
- * By : $Author$
- */
-@Remote
-public interface FiscalPeriodService {
-
- List<FiscalPeriod> getAllFiscalPeriods() throws LimaException;
-
- List<FiscalPeriod> getAllUnblockedFiscalPeriods() throws LimaException;
-
- FiscalPeriod getLastFiscalPeriod() throws LimaException;
-
- void createFiscalPeriod(FiscalPeriod fiscalPeriod) throws LimaException;
-
- void blockFiscalPeriod(FiscalPeriod fiscalPeriod) throws LimaException;
-
- void removeAllFiscalPeriods() throws LimaException;
-}
Deleted: trunk/lima-business/src/main/java/org/chorem/lima/business/FiscalPeriodServiceLocal.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/FiscalPeriodServiceLocal.java 2010-07-22 09:10:03 UTC (rev 2982)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/FiscalPeriodServiceLocal.java 2010-07-22 10:36:21 UTC (rev 2983)
@@ -1,36 +0,0 @@
-/* *##% Lima Business
- * Copyright (C) 2008 - 2010 CodeLutin
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- * ##%*
- */
-
-package org.chorem.lima.business;
-
-import javax.ejb.Local;
-
-/**
- * Fiscal period service.
- *
- * @author chatellier
- * @version $Revision: 2910 $
- *
- * Last update : $Date: 2010-05-26 20:37:42 +0200 (mer. 26 mai 2010) $
- * By : $Author: jpepin $
- */
-@Local
-public interface FiscalPeriodServiceLocal extends FiscalPeriodService {
-
-}
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/FiscalPeriodServiceMonitorable.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/FiscalPeriodServiceMonitorable.java 2010-07-22 09:10:03 UTC (rev 2982)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/FiscalPeriodServiceMonitorable.java 2010-07-22 10:36:21 UTC (rev 2983)
@@ -1,5 +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.FiscalPeriodService;
+
public interface FiscalPeriodServiceMonitorable extends FiscalPeriodService, ServiceMonitorable {
}
Deleted: trunk/lima-business/src/main/java/org/chorem/lima/business/ImportService.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ImportService.java 2010-07-22 09:10:03 UTC (rev 2982)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ImportService.java 2010-07-22 10:36:21 UTC (rev 2983)
@@ -1,75 +0,0 @@
-/* *##% Lima Business
- * Copyright (C) 2008 - 2010 CodeLutin
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- * ##%*
- */
-
-package org.chorem.lima.business;
-
-import javax.ejb.Remote;
-
-/**
- * Import export service.
- *
- * Currently import and export as XML.
- *
- * @author chatellier
- * @version $Revision$
- *
- * Last update : $Date$
- * By : $Author$
- */
-@Remote
-public interface ImportService {
-
- /**
- * Import data as EBP CSV export.
- *
- * @param data
- * @throws LimaException
- */
- public String importEntriesFromEbp(String datas) throws LimaException;
- public String importAccountsChartFromEbp(String datas) throws LimaException;
-
-
- /**
- * Import data as Sage Maestria export.
- *
- * @param data
- * @throws LimaException
- */
- public void importAsSage(byte[] data) throws LimaException;
-
- /**
- * Import data as Ciel Compta export.
- *
- * @param data
- * @throws LimaException
- */
- public void importAsCiel(byte[] data) throws LimaException;
-
- /**
- * import CSV.
- * Return result log
- */
- 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;
-}
Deleted: trunk/lima-business/src/main/java/org/chorem/lima/business/ImportServiceLocal.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ImportServiceLocal.java 2010-07-22 09:10:03 UTC (rev 2982)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ImportServiceLocal.java 2010-07-22 10:36:21 UTC (rev 2983)
@@ -1,38 +0,0 @@
-/* *##% Lima Business
- * Copyright (C) 2008 - 2010 CodeLutin
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- * ##%*
- */
-
-package org.chorem.lima.business;
-
-import javax.ejb.Local;
-
-/**
- * Import export service.
- *
- * Currently import and export as XML.
- *
- * @author chatellier
- * @version $Revision: 2824 $
- *
- * Last update : $Date: 2010-04-02 18:55:19 +0200 (ven. 02 avril 2010) $
- * By : $Author: echatellier $
- */
-@Local
-public interface ImportServiceLocal extends ImportService {
-
-}
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ImportServiceMonitorable.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ImportServiceMonitorable.java 2010-07-22 09:10:03 UTC (rev 2982)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ImportServiceMonitorable.java 2010-07-22 10:36:21 UTC (rev 2983)
@@ -1,5 +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.ImportService;
+
public interface ImportServiceMonitorable extends ImportService, ServiceMonitorable {
}
Deleted: trunk/lima-business/src/main/java/org/chorem/lima/business/RecordService.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/RecordService.java 2010-07-22 09:10:03 UTC (rev 2982)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/RecordService.java 2010-07-22 10:36:21 UTC (rev 2983)
@@ -1,44 +0,0 @@
-/* *##% Lima Business
- * Copyright (C) 2008 - 2010 CodeLutin
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- * ##%*
- */
-
-package org.chorem.lima.business;
-
-import javax.ejb.Remote;
-
-/**
- * Fiscal period service.
- *
- * @author chatellier
- * @version $Revision$
- *
- * Last update : $Date$
- * By : $Author$
- */
-
-@Remote
-public interface RecordService {
-
- //List<FiscalPeriod> getAllFiscalPeriods() throws LimaException;
-
- //void createFiscalPeriod(FiscalPeriod fiscalPeriod) throws LimaException;
-
- //void updateFiscalPeriod(FiscalPeriod fiscalPeriod) throws LimaException;
-
- //void removeFiscalPeriod(FiscalPeriod fiscalPeriod) throws LimaException;
-}
Deleted: trunk/lima-business/src/main/java/org/chorem/lima/business/RecordServiceLocal.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/RecordServiceLocal.java 2010-07-22 09:10:03 UTC (rev 2982)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/RecordServiceLocal.java 2010-07-22 10:36:21 UTC (rev 2983)
@@ -1,37 +0,0 @@
-/* *##% Lima Business
- * Copyright (C) 2008 - 2010 CodeLutin
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- * ##%*
- */
-
-package org.chorem.lima.business;
-
-import javax.ejb.Local;
-
-/**
- * Fiscal period service.
- *
- * @author chatellier
- * @version $Revision: 2902 $
- *
- * Last update : $Date: 2010-05-19 18:38:02 +0200 (mer. 19 mai 2010) $
- * By : $Author: jpepin $
- */
-
-@Local
-public interface RecordServiceLocal extends RecordService {
-
-}
Deleted: trunk/lima-business/src/main/java/org/chorem/lima/business/ReportService.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ReportService.java 2010-07-22 09:10:03 UTC (rev 2982)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ReportService.java 2010-07-22 10:36:21 UTC (rev 2983)
@@ -1,85 +0,0 @@
-/* *##% Lima Business
- * Copyright (C) 2008 - 2010 CodeLutin
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- * ##%*
- */
-
-package org.chorem.lima.business;
-
-import java.util.Date;
-
-import javax.ejb.Remote;
-
-import org.chorem.lima.beans.BalanceTrial;
-import org.chorem.lima.beans.ReportsDatas;
-import org.chorem.lima.entity.Account;
-import org.chorem.lima.entity.EntryBook;
-
-/**
- * Service de generation des rapports.
- *
- * Actuellement:
- * <ul>
- * <li>Balance</li>
- * <li>Bilan</li>
- * </ul>
- *
- * @author chatellier
- * @version $Revision$
- *
- * Last update : $Date$
- * By : $Author$
- */
-
-@Remote
-public interface ReportService {
-
- /**
- * Generation du bilan.
- *
- * @param fiscalPeriod exercice
- * @return le bilan
- * @throws LimaException
- * BalanceSheet generateBalanceSheet(FiscalPeriod fiscalPeriod) throws LimaException;
- */
-
- /**
- * Generation de la balance.
- *
- * @return la balance
- * @throws LimaException
- */
- BalanceTrial generateBalanceTrial(Date beginDate, Date endDate, String selectedAccounts, Boolean getEntries) throws LimaException;
-
- /**
- * Generation du grand-livre
- *
- * @throws LimaException
- */
- BalanceTrial generateLedger(Date beginDate, Date endDate) throws LimaException;
-
-
- /**
- * Generation du rapports des comptes
- */
- ReportsDatas generateAccountsReports(Account account, Date beginDate, Date endDate) throws LimaException;
-
- /**
- * Generation du rapports des journaux
- */
- ReportsDatas generateEntryBooksReports(EntryBook entryBook, Date beginDate, Date endDate) throws LimaException;
-
-}
Deleted: trunk/lima-business/src/main/java/org/chorem/lima/business/ReportServiceLocal.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ReportServiceLocal.java 2010-07-22 09:10:03 UTC (rev 2982)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ReportServiceLocal.java 2010-07-22 10:36:21 UTC (rev 2983)
@@ -1,52 +0,0 @@
-/* *##% Lima Business
- * Copyright (C) 2008 - 2010 CodeLutin
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- * ##%*
- */
-
-package org.chorem.lima.business;
-
-import java.util.Date;
-
-import javax.ejb.Local;
-
-import org.chorem.lima.beans.ReportsDatas;
-import org.chorem.lima.entity.Account;
-import org.nuiton.topia.TopiaContext;
-
-
-/**
- * Service de generation des rapports.
- *
- * Actuellement:
- * <ul>
- * <li>Balance</li>
- * <li>Bilan</li>
- * </ul>
- *
- * @author chatellier
- * @version $Revision: 2902 $
- *
- * Last update : $Date: 2010-05-19 18:38:02 +0200 (mer. 19 mai 2010) $
- * By : $Author: jpepin $
- */
-
-@Local
-public interface ReportServiceLocal extends ReportService {
-
- public ReportsDatas generateAccountReportsWithTransaction (Account account, Date beginDate, Date endDate, TopiaContext topiaContext) throws LimaException;
-
-}
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ReportServiceMonitorable.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ReportServiceMonitorable.java 2010-07-22 09:10:03 UTC (rev 2982)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ReportServiceMonitorable.java 2010-07-22 10:36:21 UTC (rev 2983)
@@ -1,5 +1,7 @@
package org.chorem.lima.business;
+import org.chorem.lima.business.ejbinterface.ReportService;
+
public interface ReportServiceMonitorable extends ReportService, ServiceMonitorable {
}
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ServiceListener.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ServiceListener.java 2010-07-22 09:10:03 UTC (rev 2982)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ServiceListener.java 2010-07-22 10:36:21 UTC (rev 2983)
@@ -1,3 +1,22 @@
+/* *##% 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;
public interface ServiceListener {
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ServiceMonitorable.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ServiceMonitorable.java 2010-07-22 09:10:03 UTC (rev 2982)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ServiceMonitorable.java 2010-07-22 10:36:21 UTC (rev 2983)
@@ -1,3 +1,22 @@
+/* *##% 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;
public interface ServiceMonitorable {
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-07-22 09:10:03 UTC (rev 2982)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java 2010-07-22 10:36:21 UTC (rev 2983)
@@ -29,12 +29,12 @@
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.chorem.lima.business.AccountService;
-import org.chorem.lima.business.AccountServiceLocal;
import org.chorem.lima.business.AccountingRules;
import org.chorem.lima.business.LimaBusinessException;
import org.chorem.lima.business.LimaConfig;
import org.chorem.lima.business.LimaException;
+import org.chorem.lima.business.ejbinterface.AccountService;
+import org.chorem.lima.business.ejbinterface.AccountServiceLocal;
import org.chorem.lima.business.utils.AccountComparator;
import org.chorem.lima.entity.Account;
import org.chorem.lima.entity.AccountDAO;
@@ -75,6 +75,46 @@
accountingRules = config.getAccountingRules();
}
+
+ @Override
+ public void createAccountWithTransaction(Account masterAccount, Account account, TopiaContext topiaContext) throws LimaException,
+ LimaBusinessException {
+
+ try {
+ // check if account number already exist
+ AccountDAO accountDAO =
+ LimaCallaoDAOHelper.getAccountDAO(topiaContext);
+
+ Account existAccount =
+ accountDAO.findByAccountNumber(account.getAccountNumber());
+ if (existAccount != null) {
+ throw new LimaBusinessException(_(
+ "An account already exists with this number : %s",
+ account.getAccountNumber()));
+ }
+
+ //create it
+ accountDAO.create(account);
+
+ Account masterAccountUpdate = null;
+ if (masterAccount != null){
+ masterAccountUpdate = accountDAO.findByAccountNumber(masterAccount.getAccountNumber());
+ }
+
+ // check if parent account exist;
+ if (masterAccountUpdate != null) {
+ masterAccountUpdate.addSubAccounts(account);
+ accountDAO.update(masterAccountUpdate);
+ }
+
+ commitTransaction(topiaContext);
+ }
+ catch (TopiaException ex) {
+ doCatch(topiaContext, ex, log);
+ }
+ }
+
+
/**
* Permet de créer un nouveau compte dans le PCG de l'application.
* ATTENTION : le compte masterAccount, c'est à dire le compte père, doit
@@ -94,35 +134,10 @@
try {
transaction = beginTransaction();
- // check if account number already exist
- AccountDAO accountDAO =
- LimaCallaoDAOHelper.getAccountDAO(transaction);
-
- Account existAccount =
- accountDAO.findByAccountNumber(account.getAccountNumber());
- if (existAccount != null) {
- throw new LimaBusinessException(_(
- "An account already exists with this number : %s",
- account.getAccountNumber()));
- }
-
- //create it
- accountDAO.create(account);
+ createAccountWithTransaction(masterAccount, account, transaction);
- Account masterAccountUpdate = null;
- if (masterAccount != null){
- masterAccountUpdate = accountDAO.findByAccountNumber(masterAccount.getAccountNumber());
- }
-
- // check if parent account exist;
- if (masterAccountUpdate != null) {
- masterAccountUpdate.addSubAccounts(account);
- accountDAO.update(masterAccountUpdate);
- }
-
- commitTransaction(transaction);
}
- catch (Exception ex) {
+ catch (TopiaException ex) {
doCatch(transaction, ex, log);
}
finally {
@@ -130,23 +145,14 @@
}
}
- /**
- * Permet de créer des comptes tiers
- */
+
@Override
- public void createSubLedger(Account masterAccount, Account account)
- throws LimaException {
+ public void createSubLedgerWithTransaction(Account masterAccount, Account account, TopiaContext topiaContext) throws LimaException {
- //check rules before create the account
- accountingRules.createSubLedgerRules(masterAccount, account);
-
- TopiaContext transaction = null;
- try {
- transaction = beginTransaction();
-
- // check if the accountnumber already exist
+ try {
+ // check if the accountnumber already exist
AccountDAO accountDAO =
- LimaCallaoDAOHelper.getAccountDAO(transaction);
+ LimaCallaoDAOHelper.getAccountDAO(topiaContext);
Account existAccount =
accountDAO.findByAccountNumber(account.getAccountNumber());
if (existAccount != null) {
@@ -169,9 +175,30 @@
accountDAO.update(masterAccountUpdate);
}
- commitTransaction(transaction);
+ commitTransaction(topiaContext);
}
catch (TopiaException ex) {
+ doCatch(topiaContext, ex, log);
+ }
+ }
+
+ /**
+ * Permet de créer des comptes tiers
+ */
+ @Override
+ public void createSubLedger(Account masterAccount, Account account)
+ throws LimaException {
+
+ //check rules before create the account
+ accountingRules.createSubLedgerRules(masterAccount, account);
+
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ createSubLedgerWithTransaction(masterAccount, account, transaction);
+ }
+ catch (TopiaException ex) {
doCatch(transaction, ex, log);
}
finally {
@@ -477,5 +504,6 @@
throw eee;
}
}
+
}
\ No newline at end of file
Added: 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 (rev 0)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/DocumentServiceImpl.java 2010-07-22 10:36:21 UTC (rev 2983)
@@ -0,0 +1,332 @@
+/* *##% 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.Color;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.ejb.Stateless;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.chorem.lima.beans.FinancialStatementAmounts;
+import org.chorem.lima.business.ejbinterface.DocumentService;
+import org.chorem.lima.business.ejbinterface.DocumentServiceLocal;
+
+import com.lowagie.text.BadElementException;
+import com.lowagie.text.Cell;
+import com.lowagie.text.Chapter;
+import com.lowagie.text.Document;
+import com.lowagie.text.DocumentException;
+import com.lowagie.text.Element;
+import com.lowagie.text.Font;
+import com.lowagie.text.PageSize;
+import com.lowagie.text.Paragraph;
+import com.lowagie.text.Phrase;
+import com.lowagie.text.Rectangle;
+import com.lowagie.text.Table;
+import com.lowagie.text.html.HtmlWriter;
+import com.lowagie.text.pdf.PdfWriter;
+
+@Stateless
+public class DocumentServiceImpl implements DocumentService, DocumentServiceLocal {
+
+ private static final Log log =
+ LogFactory.getLog(DocumentServiceImpl.class);
+
+ @Override
+ public void createDocuments(List<FinancialStatementAmounts> financialStatementAmounts) {
+ Document document = new Document(PageSize.A4, 5, 5, 5, 5);
+
+ try {
+
+ PdfWriter pdfWriter = PdfWriter.getInstance(document,
+ new FileOutputStream("/test_lima.pdf"));
+ HtmlWriter htmlWriter = HtmlWriter.getInstance(document,
+ new FileOutputStream("/test_lima.html"));
+ Font numpageFont = new Font(Font.HELVETICA, 9, Font.BOLD, Color.BLACK);
+ document.open();
+ int nbpages = 1;
+
+
+ //Split list by financialstatement type
+ 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++) {
+ if (financialStatementAmounts.get(i).getLevel()==1){
+ if (first){
+ first=false;
+ }
+ else{
+ listList.add(financialStatementAmounts.subList(min+1, i-1));
+ }
+ min=i;
+ }
+ }
+ listList.add(financialStatementAmounts.subList(min+1, size));
+
+ //create pages
+ for (List<FinancialStatementAmounts> list : listList) {
+ String title = list.get(0).getLabel();
+ int i=0;
+ int n=list.size();
+ while (i<n){
+ int j=i+40;
+ if (j>n){
+ j = n;
+ }
+ List <FinancialStatementAmounts> subFinancialStatementAmounts =
+ list.subList(i, j);
+ //create page : header + table + footer
+ Table header = createHeader(title, "01/01/2010", "31/12/2010");
+ Table table = createTable(subFinancialStatementAmounts);
+ //new page
+ Chapter chapter = new Chapter(0);
+ //n° page
+ Paragraph paragraphPage = new Paragraph();
+ paragraphPage.setAlignment(Element.ALIGN_RIGHT);
+ paragraphPage.add(new Phrase("Page n° "+nbpages, numpageFont));
+ chapter.add(paragraphPage);
+ //header
+ Paragraph paragraphHeader = new Paragraph();
+ paragraphHeader.add(header);
+ chapter.add(paragraphHeader);
+ //table
+ Paragraph paragraphTable = new Paragraph();
+ paragraphTable.add(table);
+ chapter.add(paragraphTable);
+ //add page
+ document.add(chapter);
+ i=i+40;
+ 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 createHeader(String title, String beginDate, String endDate){
+ Table t = null;
+ try {
+ //define table
+ t = new Table(4, 5);
+ float[] widths = {0.25f, 0.45f, 0.12f, 0.18f};
+ t.setWidths(widths);
+ t.setPadding(3);
+ //define font
+ Font headerFont = new Font(Font.HELVETICA, 9, Font.ITALIC, Color.BLACK);
+ Font headerFontB = new Font(Font.HELVETICA, 9, Font.BOLDITALIC, Color.BLACK);
+ //defaut cell
+ Cell cell = new Cell();
+ cell.setBorder(Rectangle.NO_BORDER);
+ t.setDefaultCell(cell);
+
+ //line 1
+ t.addCell(new Phrase("Code Lutin SA", headerFontB));
+ Cell titleCell = new Cell(new Phrase(title, new Font(Font.HELVETICA, 14, Font.BOLD, Color.BLACK)));
+ titleCell.setVerticalAlignment(Element.ALIGN_MIDDLE);
+ titleCell.setHorizontalAlignment(Element.ALIGN_CENTER);
+ titleCell.setRowspan(2);
+ t.addCell(titleCell);
+ t.addCell(new Phrase("N° Siret", headerFontB));
+ t.addCell(new Phrase("442116703", headerFont));
+ //line 2
+ t.addCell(new Phrase("SSL", headerFont));
+ t.addCell(new Phrase("NAF :", headerFontB));
+ t.addCell(new Phrase("6201Z", headerFont));
+ //line 3
+ t.addCell(new Phrase("44 bd des Pas Enchantés", headerFont));
+ t.addCell("");
+ t.addCell(new Phrase("n°TVA", headerFontB));
+ t.addCell(new Phrase("FR 57 442116703", headerFont));
+ //line 4
+ t.addCell(new Phrase("44230 St Séb/Loire", headerFont));
+ t.addCell("");
+ t.addCell(new Phrase("Période du", headerFontB));
+ t.addCell(new Phrase(beginDate, headerFont));
+ //line 5
+ t.addCell("");
+ t.addCell("");
+ t.addCell(new Phrase("au", headerFontB));
+ t.addCell(new Phrase(endDate, headerFont));
+ } catch (BadElementException eeBEE) {
+ log.error("Can't create table", eeBEE);
+ }
+ return t;
+ }
+
+ public Table createTable(List<FinancialStatementAmounts> financialStatementAmounts){
+ int nbrow = financialStatementAmounts.size();
+ Table t = null;
+ try {
+ //define table
+ t = new Table(4,nbrow);
+ float[] widths = {0.4f, 0.2f, 0.2f, 0.2f};
+ t.setWidths(widths);
+ t.setPadding(0.5f);
+ t.setSpacing(0);
+ t.setBorderWidth(1);
+ t.setBorder(Rectangle.BOTTOM);
+ //define default cell
+ Cell cell = new Cell();
+ cell.setBorder(Rectangle.LEFT);
+ t.setDefaultCell(cell);
+
+ Font headerFont = new Font(Font.HELVETICA, 9, Font.BOLD, Color.BLACK);
+ Font tabFont = new Font(Font.HELVETICA, 9, Font.NORMAL, Color.BLACK);
+
+ Cell headerCell = new Cell(new Phrase(_("lima.table.label"), headerFont));
+ headerCell.setBorderWidth(1);
+ headerCell.setHeader(true);
+ t.addCell(headerCell);
+ headerCell = new Cell(new Phrase(_("lima.table.grossamount"), headerFont));
+ t.addCell(headerCell);
+ headerCell = new Cell(new Phrase(_("lima.table.provisiondeprecationamount"), headerFont));
+ t.addCell(headerCell);
+ headerCell = new Cell(new Phrase(_("lima.table.netamount"), headerFont));
+ t.addCell(headerCell);
+
+ for (FinancialStatementAmounts financialStatementAmount : financialStatementAmounts) {
+
+ String label = financialStatementAmount.getLabel();
+ int level = financialStatementAmount.getLevel();
+ Double grossAmount = financialStatementAmount.getGrossAmount();
+ Double provisionDeprecationAmount = financialStatementAmount.getProvisionDeprecationAmount();
+
+ if (financialStatementAmount.getSubAmount()){
+ cell.setGrayFill(0.9f);
+ }
+ else {
+ cell.setGrayFill(1f);
+ }
+
+ if (label == null){
+ t.addCell("");
+ t.addCell("");
+ t.addCell("");
+ t.addCell("");
+ }
+ else {
+ //cell1
+ String tab = "";
+ for (int i = 0; i < level; i++) {
+ tab += "\t";
+ }
+ Phrase phrase = null;
+ if (financialStatementAmount.getHeader()){
+ phrase = new Phrase(tab+label, headerFont);
+ }
+ else {
+ phrase = new Phrase(tab+label, tabFont);
+ }
+ t.addCell(phrase);
+ //cell2
+ if (grossAmount != 0.0){
+ phrase = new Phrase(String.valueOf(grossAmount), tabFont);
+ }
+ else {
+ phrase = new Phrase("");
+ }
+ t.addCell(phrase);
+ //cell 3
+ if (provisionDeprecationAmount != 0.0){
+ phrase = new Phrase(String.valueOf(provisionDeprecationAmount), tabFont);
+ }
+ else {
+ phrase = new Phrase("");
+ }
+ t.addCell(phrase);
+ //cell 4
+ if (grossAmount-provisionDeprecationAmount != 0.0){
+ phrase = new Phrase(String.valueOf(grossAmount-provisionDeprecationAmount), tabFont);
+ }
+ else {
+ phrase = new Phrase("");
+ }
+ t.addCell(phrase);
+ }
+ }
+
+ } catch (BadElementException eeBEE) {
+ log.error("Can't create table", eeBEE);
+ }
+ return t;
+ }
+
+ public void example (){
+ //FIRST PAGE
+ /*document.add(new Paragraph("First page of the document."));
+ document.add(new Paragraph("Some more text on the \n"
+ + "first page with different color and font type.",
+ FontFactory.getFont(FontFactory.COURIER, 14, Font.BOLD,
+ new Color(255, 150, 200))));
+
+ //SECOND PAGE
+ Paragraph title1 = new Paragraph("Chapter 1",
+ FontFactory.getFont(FontFactory.HELVETICA, 18,
+ Font.BOLDITALIC, new Color(0, 0, 255)));
+ Chapter chapter1 = new Chapter(title1, 1);
+ chapter1.setNumberDepth(0);
+ //SECTION 1
+ Paragraph title11 = new Paragraph("This is Section 1 in Chapter 1",
+ FontFactory.getFont(FontFactory.HELVETICA, 16,
+ Font.BOLD, new Color(255, 0, 0)));
+ Section section1 = chapter1.addSection(title11);
+ Paragraph someSectionText = new Paragraph("This text comes as part of section 1 of chapter 1.");
+ section1.add(someSectionText);
+ someSectionText = new Paragraph("Following is a 3 X 2 table.");
+ section1.add(someSectionText);
+ //TABLE
+ Table t = new Table(3,2);
+ t.setBorderColor(new Color(220, 255, 100));
+ t.setPadding(5);
+ t.setSpacing(5);
+ t.setBorderWidth(1);
+ Cell c1 = new Cell("header1");
+ c1.setHeader(true);
+ t.addCell(c1);
+ c1 = new Cell("Header2");
+ t.addCell(c1);
+ c1 = new Cell("Header3");
+ t.addCell(c1);
+ t.endHeaders();
+ t.addCell("1.1");
+ t.addCell("1.2");
+ t.addCell("1.3");
+
+ section1.add(t);
+
+ document.add(chapter1);*/
+ }
+
+}
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/EntryBookServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/EntryBookServiceImpl.java 2010-07-22 09:10:03 UTC (rev 2982)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/EntryBookServiceImpl.java 2010-07-22 10:36:21 UTC (rev 2983)
@@ -26,11 +26,11 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.business.AccountingRules;
-import org.chorem.lima.business.EntryBookService;
-import org.chorem.lima.business.EntryBookServiceLocal;
import org.chorem.lima.business.LimaBusinessException;
import org.chorem.lima.business.LimaConfig;
import org.chorem.lima.business.LimaException;
+import org.chorem.lima.business.ejbinterface.EntryBookService;
+import org.chorem.lima.business.ejbinterface.EntryBookServiceLocal;
import org.chorem.lima.entity.ClosedPeriodicEntryBook;
import org.chorem.lima.entity.ClosedPeriodicEntryBookDAO;
import org.chorem.lima.entity.ClosedPeriodicEntryBookImpl;
@@ -71,21 +71,16 @@
accountingRules = config.getAccountingRules();
}
- /**
- * Création d'un EntryBook. Il peut être unique sur son label (au choix).
- *
- * @param EntryBook EntryBook
- * @throws LimaException
- */
- public void createEntryBook(EntryBook entryBook) throws LimaException {
-
- TopiaContext transaction = null;
- try {
- transaction = beginTransaction();
+
+ @Override
+ public void createEntryBookWithTransaction(EntryBook entryBook, TopiaContext topiaContext)
+ throws LimaException {
+ try {
+
// check if entrybook with is name already exist
EntryBookDAO entryBookDAO =
- LimaCallaoDAOHelper.getEntryBookDAO(transaction);
+ LimaCallaoDAOHelper.getEntryBookDAO(topiaContext);
EntryBook existingEntryBook =
entryBookDAO.findByLabel(entryBook.getCode());
if (existingEntryBook != null) {
@@ -99,9 +94,9 @@
//create ClosedPeriodicEntryBook for all unblocked financial period
ClosedPeriodicEntryBookDAO closedPeriodicEntryBookDAO =
- LimaCallaoDAOHelper.getClosedPeriodicEntryBookDAO(transaction);
+ LimaCallaoDAOHelper.getClosedPeriodicEntryBookDAO(topiaContext);
FinancialPeriodDAO financialPeriodDAO =
- LimaCallaoDAOHelper.getFinancialPeriodDAO(transaction);
+ LimaCallaoDAOHelper.getFinancialPeriodDAO(topiaContext);
// for all unblocked financialperiod
for (FinancialPeriod financialPeriod : financialPeriodDAO.findAllByLocked(false)) {
@@ -116,9 +111,29 @@
closedPeriodicEntryBookDAO.create(closedPeriodicEntryBook);
}
- commitTransaction(transaction);
+ commitTransaction(topiaContext);
}
catch (TopiaException ex) {
+ doCatch(topiaContext, ex, log);
+ }
+
+ }
+
+ /**
+ * Création d'un EntryBook. Il peut être unique sur son label (au choix).
+ *
+ * @param EntryBook EntryBook
+ * @throws LimaException
+ */
+ public void createEntryBook(EntryBook entryBook) throws LimaException {
+
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ createEntryBookWithTransaction(entryBook, transaction);
+ }
+ catch (TopiaException ex) {
doCatch(transaction, ex, log);
}
finally {
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-07-22 09:10:03 UTC (rev 2982)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ExportServiceImpl.java 2010-07-22 10:36:21 UTC (rev 2983)
@@ -27,10 +27,10 @@
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.chorem.lima.business.ExportService;
-import org.chorem.lima.business.ExportServiceLocal;
import org.chorem.lima.business.LimaConfig;
import org.chorem.lima.business.LimaException;
+import org.chorem.lima.business.ejbinterface.ExportService;
+import org.chorem.lima.business.ejbinterface.ExportServiceLocal;
import org.chorem.lima.business.utils.ImportExportEntityEnum;
import org.chorem.lima.entity.Account;
import org.chorem.lima.entity.AccountDAO;
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialPeriodServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialPeriodServiceImpl.java 2010-07-22 09:10:03 UTC (rev 2982)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialPeriodServiceImpl.java 2010-07-22 10:36:21 UTC (rev 2983)
@@ -24,10 +24,10 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.business.AccountingRules;
-import org.chorem.lima.business.FinancialPeriodService;
-import org.chorem.lima.business.FinancialPeriodServiceLocal;
import org.chorem.lima.business.LimaConfig;
import org.chorem.lima.business.LimaException;
+import org.chorem.lima.business.ejbinterface.FinancialPeriodService;
+import org.chorem.lima.business.ejbinterface.FinancialPeriodServiceLocal;
import org.chorem.lima.entity.ClosedPeriodicEntryBook;
import org.chorem.lima.entity.ClosedPeriodicEntryBookDAO;
import org.chorem.lima.entity.ClosedPeriodicEntryBookImpl;
@@ -166,13 +166,12 @@
return result;
}
- @Override
- public void blockClosedPeriodicEntryBook(ClosedPeriodicEntryBook closedPeriodicEntryBook) throws LimaException {
-
- TopiaContext topiaContext = null;
- try {
- topiaContext = beginTransaction();
-
+
+ @Override
+ public void blockClosedPeriodicEntryBookWithTransaction(
+ ClosedPeriodicEntryBook closedPeriodicEntryBook,
+ TopiaContext topiaContext) throws LimaException {
+ try {
//check rules before create the account
accountingRules.blockClosedPeriodicEntryBookRules(
closedPeriodicEntryBook, topiaContext);
@@ -191,7 +190,23 @@
}
catch (TopiaException ex) {
doCatch(topiaContext, ex, log);
+ }
+ }
+
+ @Override
+ public void blockClosedPeriodicEntryBook(ClosedPeriodicEntryBook closedPeriodicEntryBook) throws LimaException {
+
+ TopiaContext topiaContext = null;
+ try {
+ topiaContext = beginTransaction();
+
+ blockClosedPeriodicEntryBookWithTransaction(closedPeriodicEntryBook, topiaContext);
+
+ commitTransaction(topiaContext);
}
+ catch (TopiaException ex) {
+ doCatch(topiaContext, ex, log);
+ }
finally {
doFinally(topiaContext, log);
}
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialStatementServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialStatementServiceImpl.java 2010-07-22 09:10:03 UTC (rev 2982)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialStatementServiceImpl.java 2010-07-22 10:36:21 UTC (rev 2983)
@@ -34,14 +34,14 @@
import org.chorem.lima.beans.FinancialStatementDatas;
import org.chorem.lima.beans.FinancialStatementDatasImpl;
import org.chorem.lima.beans.ReportsDatas;
-import org.chorem.lima.business.AccountServiceLocal;
import org.chorem.lima.business.AccountingRules;
-import org.chorem.lima.business.FinancialStatementService;
-import org.chorem.lima.business.FinancialStatementServiceLocal;
import org.chorem.lima.business.LimaBusinessException;
import org.chorem.lima.business.LimaConfig;
import org.chorem.lima.business.LimaException;
-import org.chorem.lima.business.ReportServiceLocal;
+import org.chorem.lima.business.ejbinterface.AccountServiceLocal;
+import org.chorem.lima.business.ejbinterface.FinancialStatementService;
+import org.chorem.lima.business.ejbinterface.FinancialStatementServiceLocal;
+import org.chorem.lima.business.ejbinterface.ReportServiceLocal;
import org.chorem.lima.entity.Account;
import org.chorem.lima.entity.FinancialStatement;
import org.chorem.lima.entity.FinancialStatementDAO;
@@ -80,17 +80,17 @@
accountingRules = config.getAccountingRules();
}
-
@Override
- public void createFinancialStatement(FinancialStatement masterFinancialStatement, FinancialStatement financialStatement) throws LimaException, LimaBusinessException {
-
- TopiaContext transaction = null;
- try {
- transaction = beginTransaction();
+ public void createFinancialStatementWithTransaction(
+ FinancialStatement masterFinancialStatement,
+ FinancialStatement financialStatement, TopiaContext topiaContext)
+ throws LimaException, LimaBusinessException {
+ try {
+
// check if FinancialStatementHeader label already exist
FinancialStatementDAO financialStatementDAO =
- LimaCallaoDAOHelper.getFinancialStatementDAO(transaction);
+ LimaCallaoDAOHelper.getFinancialStatementDAO(topiaContext);
FinancialStatement existFinancialStatementHeader =
financialStatementDAO.findByLabel(financialStatement.getLabel());
@@ -114,8 +114,23 @@
financialStatementDAO.update(masterfinancialStatementUpdate);
}
- commitTransaction(transaction);
+ commitTransaction(topiaContext);
}
+ catch (TopiaException ex) {
+ doCatch(topiaContext, ex, log);
+ }
+
+ }
+
+ @Override
+ public void createFinancialStatement(FinancialStatement masterFinancialStatement, FinancialStatement financialStatement) throws LimaException, LimaBusinessException {
+
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ createFinancialStatementWithTransaction(masterFinancialStatement, financialStatement, transaction);
+ }
catch (Exception ex) {
doCatch(transaction, ex, log);
}
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-22 09:10:03 UTC (rev 2982)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java 2010-07-22 10:36:21 UTC (rev 2983)
@@ -26,10 +26,10 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.business.AccountingRules;
-import org.chorem.lima.business.FinancialTransactionService;
-import org.chorem.lima.business.FinancialTransactionServiceLocal;
import org.chorem.lima.business.LimaConfig;
import org.chorem.lima.business.LimaException;
+import org.chorem.lima.business.ejbinterface.FinancialTransactionService;
+import org.chorem.lima.business.ejbinterface.FinancialTransactionServiceLocal;
import org.chorem.lima.entity.Entry;
import org.chorem.lima.entity.EntryBook;
import org.chorem.lima.entity.EntryDAO;
@@ -76,6 +76,27 @@
accountingRules = config.getAccountingRules();
}
+ @Override
+ public void createFinancialTransactionWithTransaction(
+ FinancialTransaction financialtransaction, TopiaContext topiaContext)
+ throws LimaException {
+ try {
+ //check if the financial period is blocked
+ accountingRules.checkFinancialPeriodBlockedWithFinancialTransaction(
+ financialtransaction, topiaContext);
+
+ FinancialTransactionDAO financialtransactionDAO =
+ LimaCallaoDAOHelper.getFinancialTransactionDAO(topiaContext);
+
+ financialtransactionDAO.create(financialtransaction);
+
+ commitTransaction(topiaContext);
+ }
+ catch (TopiaException ex) {
+ doCatch(topiaContext, ex, log);
+ }
+ }
+
/**
* Permet de créer une transaction comptable contenant des entrées
*
@@ -87,16 +108,7 @@
try {
topiaContext = beginTransaction();
- //check if the financial period is blocked
- accountingRules.checkFinancialPeriodBlockedWithFinancialTransaction(
- financialtransaction, topiaContext);
-
- FinancialTransactionDAO financialtransactionDAO =
- LimaCallaoDAOHelper.getFinancialTransactionDAO(topiaContext);
-
- financialtransactionDAO.create(financialtransaction);
-
- commitTransaction(topiaContext);
+ createFinancialTransactionWithTransaction(financialtransaction, topiaContext);
}
catch (TopiaException ex) {
doCatch(topiaContext, ex, log);
@@ -271,6 +283,7 @@
/**
* Method used by update entry and remove entry for update amounts
*/
+ @Override
public void updateFinancialTransactionWithTransaction(FinancialTransaction financialtransaction, TopiaContext topiaContext) throws LimaException{
try {
FinancialTransactionDAO transactionDAO =
@@ -345,6 +358,27 @@
}
+ @Override
+ public void createEntryWithTransaction(Entry entry,
+ TopiaContext topiaContext) throws LimaException {
+
+ try {
+
+ //check if the financial period is blocked
+ accountingRules.checkFinancialPeriodBlockedWithFinancialTransaction(
+ entry.getFinancialTransaction(), topiaContext);
+
+
+ EntryDAO entryDAO = LimaCallaoDAOHelper.getEntryDAO(topiaContext);
+ entryDAO.create(entry);
+
+ commitTransaction(topiaContext);
+ }
+ catch (TopiaException ex) {
+ doCatch(topiaContext, ex, log);
+ }
+ }
+
/**
* Create new entry
* the period mus not be blocked, call accounting rules
@@ -359,15 +393,7 @@
try {
topiaContext = beginTransaction();
- //check if the financial period is blocked
- accountingRules.checkFinancialPeriodBlockedWithFinancialTransaction(
- entry.getFinancialTransaction(), topiaContext);
-
-
- EntryDAO entryDAO = LimaCallaoDAOHelper.getEntryDAO(topiaContext);
- entryDAO.create(entry);
-
- commitTransaction(topiaContext);
+ createEntryWithTransaction(entry, topiaContext);
}
catch (TopiaException ex) {
doCatch(topiaContext, ex, log);
@@ -512,4 +538,5 @@
throw eee;
}
}
+
}
\ No newline at end of file
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FiscalPeriodServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FiscalPeriodServiceImpl.java 2010-07-22 09:10:03 UTC (rev 2982)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FiscalPeriodServiceImpl.java 2010-07-22 10:36:21 UTC (rev 2983)
@@ -26,12 +26,12 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.business.AccountingRules;
-import org.chorem.lima.business.FinancialPeriodServiceLocal;
-import org.chorem.lima.business.FiscalPeriodService;
-import org.chorem.lima.business.FiscalPeriodServiceLocal;
import org.chorem.lima.business.LimaBusinessException;
import org.chorem.lima.business.LimaConfig;
import org.chorem.lima.business.LimaException;
+import org.chorem.lima.business.ejbinterface.FinancialPeriodServiceLocal;
+import org.chorem.lima.business.ejbinterface.FiscalPeriodService;
+import org.chorem.lima.business.ejbinterface.FiscalPeriodServiceLocal;
import org.chorem.lima.entity.FinancialPeriod;
import org.chorem.lima.entity.FinancialPeriodDAO;
import org.chorem.lima.entity.FiscalPeriod;
@@ -74,32 +74,44 @@
accountingRules = config.getAccountingRules();
}
- /**
- * To create a fiscalperiod
- * Check localized rules before create
- */
- @Override
- public void createFiscalPeriod(FiscalPeriod fiscalPeriod) throws LimaException {
-
- TopiaContext transaction = null;
+
+ @Override
+ public void createFiscalPeriodWithTransaction(FiscalPeriod fiscalPeriod, TopiaContext topiaContext) throws LimaException {
try {
- transaction = beginTransaction();
//check rules before create the account
List<FinancialPeriod> financialPeriods =
- accountingRules.createFiscalPeriodRules(fiscalPeriod, transaction);
+ accountingRules.createFiscalPeriodRules(fiscalPeriod, topiaContext);
financialPeriodService.
- createFinancialPeriodsWithTransaction(financialPeriods, transaction);
+ createFinancialPeriodsWithTransaction(financialPeriods, topiaContext);
FiscalPeriodDAO fiscalPeriodDAO =
- LimaCallaoDAOHelper.getFiscalPeriodDAO(transaction);
+ LimaCallaoDAOHelper.getFiscalPeriodDAO(topiaContext);
//create
fiscalPeriodDAO.create(fiscalPeriod);
- commitTransaction(transaction);
+ commitTransaction(topiaContext);
}
catch (TopiaException ex) {
+ doCatch(topiaContext, ex, log);
+ }
+ }
+
+ /**
+ * To create a fiscalperiod
+ * Check localized rules before create
+ */
+ @Override
+ public void createFiscalPeriod(FiscalPeriod fiscalPeriod) throws LimaException {
+
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ createFiscalPeriodWithTransaction(fiscalPeriod, transaction);
+ }
+ catch (TopiaException ex) {
doCatch(transaction, ex, log);
}
finally {
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-07-22 09:10:03 UTC (rev 2982)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java 2010-07-22 10:36:21 UTC (rev 2983)
@@ -50,17 +50,17 @@
import org.chorem.lima.beans.FinancialStatementImportImpl;
import org.chorem.lima.beans.FinancialTransactionImport;
import org.chorem.lima.beans.FinancialTransactionImportImpl;
-import org.chorem.lima.business.AccountServiceLocal;
-import org.chorem.lima.business.EntryBookServiceLocal;
-import org.chorem.lima.business.FinancialPeriodServiceLocal;
-import org.chorem.lima.business.FinancialStatementServiceLocal;
-import org.chorem.lima.business.FinancialTransactionServiceLocal;
-import org.chorem.lima.business.FiscalPeriodServiceLocal;
-import org.chorem.lima.business.ImportService;
-import org.chorem.lima.business.ImportServiceLocal;
import org.chorem.lima.business.LimaBusinessException;
import org.chorem.lima.business.LimaConfig;
import org.chorem.lima.business.LimaException;
+import org.chorem.lima.business.ejbinterface.AccountServiceLocal;
+import org.chorem.lima.business.ejbinterface.EntryBookServiceLocal;
+import org.chorem.lima.business.ejbinterface.FinancialPeriodServiceLocal;
+import org.chorem.lima.business.ejbinterface.FinancialStatementServiceLocal;
+import org.chorem.lima.business.ejbinterface.FinancialTransactionServiceLocal;
+import org.chorem.lima.business.ejbinterface.FiscalPeriodServiceLocal;
+import org.chorem.lima.business.ejbinterface.ImportService;
+import org.chorem.lima.business.ejbinterface.ImportServiceLocal;
import org.chorem.lima.business.utils.AccountEBPComparator;
import org.chorem.lima.business.utils.FiscalPeriodComparator;
import org.chorem.lima.business.utils.ImportExportEntityEnum;
@@ -235,7 +235,7 @@
//update previous financial transaction before create new
if (financialTransaction != null){
financialTransaction.setAmounts();
- financialTransactionService.updateFinancialTransaction(financialTransaction);
+ financialTransactionService.updateFinancialTransactionWithTransaction(financialTransaction, topiaContext);
}
//create financial transaction
financialTransaction = new FinancialTransactionImpl();
@@ -243,19 +243,19 @@
financialTransaction.setTransactionDate(date);
FinancialPeriod financialPeriod = financialPeriodDAO.findByDate(date);
financialTransaction.setFinancialPeriod(financialPeriod);
- financialTransactionService.createFinancialTransaction(financialTransaction);
+ financialTransactionService.createFinancialTransactionWithTransaction(financialTransaction, topiaContext);
result += "SUCCES : FinancialTransaction" + date + " " + entryBook.getCode() + " added\n";
}
financialTransaction.addEntry(entry);
- financialTransactionService.createEntry(entry);
+ financialTransactionService.createEntryWithTransaction(entry, topiaContext);
result += "SUCCES : Entry" + entry.getDescription() + " " + entry.getAmount() + " added\n";
}
}
//update last financial transaction
if (financialTransaction != null){
financialTransaction.setAmounts();
- financialTransactionService.updateFinancialTransaction(financialTransaction);
+ financialTransactionService.updateFinancialTransactionWithTransaction(financialTransaction, topiaContext);
}
//commit
commitTransaction(topiaContext);
@@ -319,7 +319,7 @@
// if account is class account : 1, 2, 3, 4, 5, 6, 7,…
int nbCharAccountNumber = accountNumber.length();
if (nbCharAccountNumber == 1){
- accountService.createAccount(null, account);
+ accountService.createAccountWithTransaction(null, account, topiaContext);
result += "SUCCES : Account" + accountNumber + " " + label + " added\n";
}
else {
@@ -330,7 +330,7 @@
masterAccount = accountDAO.findByAccountNumber(masterAccountNumber);
i++;
}
- accountService.createAccount(masterAccount, account);
+ accountService.createAccountWithTransaction(masterAccount, account, topiaContext);
result += "SUCCES : Account" + accountNumber + " " + label + " added\n";
}
}
@@ -849,8 +849,8 @@
financialStatement.setHeaderAmount(Boolean.parseBoolean(
financialStatementImport.getHeaderAmount()));
- financialStatementService.createFinancialStatement(
- masterFinancialStatement, financialStatement);
+ financialStatementService.createFinancialStatementWithTransaction(
+ masterFinancialStatement, financialStatement, topiaContext);
result += "SUCCESS : The financialStatement " +
financialStatementImport.getLabel() + " is created ! \n";
@@ -877,7 +877,7 @@
for (FiscalPeriod fiscalPeriod : fiscalPeriods) {
//create fiscalPeriod
try {
- fiscalPeriodService.createFiscalPeriod(fiscalPeriod);
+ fiscalPeriodService.createFiscalPeriodWithTransaction(fiscalPeriod, topiaContext);
result += "SUCCESS : The fiscalPeriod " +
fiscalPeriod.getBeginDate()+"-"+fiscalPeriod.getEndDate() + " is created ! \n";
}
@@ -913,10 +913,10 @@
account.setThirdParty(accountImport.getThirdParty());
if (generalLedger != null){
- accountService.createSubLedger(generalLedger, account);
+ accountService.createSubLedgerWithTransaction(generalLedger, account, topiaContext);
}
else {
- accountService.createAccount(masterAccount, account);
+ accountService.createAccountWithTransaction(masterAccount, account, topiaContext);
}
result += "SUCCESS : The account " +
accountImport.getAccountNumber() + " is created ! \n";
@@ -961,7 +961,7 @@
ClosedPeriodicEntryBook closedPeriodicEntryBook =
closedPeriodicEntryBookDAO.findbyEntryBookAndFinancialPeriod(entryBook, financialPeriod);
try {
- financialPeriodService.blockClosedPeriodicEntryBook(closedPeriodicEntryBook);
+ financialPeriodService.blockClosedPeriodicEntryBookWithTransaction(closedPeriodicEntryBook, topiaContext);
result += "SUCCESS : The blockClosedPeriodicEntryBook " +
beginDateFinancialPeriod + "-" + endDateFinancialPeriod + ", " +
codeEntryBook + " is updated ! \n";
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/RecordServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/RecordServiceImpl.java 2010-07-22 09:10:03 UTC (rev 2982)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/RecordServiceImpl.java 2010-07-22 10:36:21 UTC (rev 2983)
@@ -28,8 +28,8 @@
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.business.LimaConfig;
import org.chorem.lima.business.LimaException;
-import org.chorem.lima.business.RecordService;
-import org.chorem.lima.business.RecordServiceLocal;
+import org.chorem.lima.business.ejbinterface.RecordService;
+import org.chorem.lima.business.ejbinterface.RecordServiceLocal;
import org.chorem.lima.entity.LimaCallaoDAOHelper;
import org.chorem.lima.entity.Record;
import org.chorem.lima.entity.RecordDAO;
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-22 09:10:03 UTC (rev 2982)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java 2010-07-22 10:36:21 UTC (rev 2983)
@@ -31,11 +31,11 @@
import org.chorem.lima.beans.BalanceTrialImpl;
import org.chorem.lima.beans.ReportsDatas;
import org.chorem.lima.beans.ReportsDatasImpl;
-import org.chorem.lima.business.AccountServiceLocal;
import org.chorem.lima.business.LimaConfig;
import org.chorem.lima.business.LimaException;
-import org.chorem.lima.business.ReportService;
-import org.chorem.lima.business.ReportServiceLocal;
+import org.chorem.lima.business.ejbinterface.AccountServiceLocal;
+import org.chorem.lima.business.ejbinterface.ReportService;
+import org.chorem.lima.business.ejbinterface.ReportServiceLocal;
import org.chorem.lima.entity.Account;
import org.chorem.lima.entity.AccountDAO;
import org.chorem.lima.entity.Entry;
Added: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/AccountService.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/AccountService.java (rev 0)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/AccountService.java 2010-07-22 10:36:21 UTC (rev 2983)
@@ -0,0 +1,67 @@
+/* *##% 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 java.util.List;
+import javax.ejb.Remote;
+import org.chorem.lima.business.LimaBusinessException;
+import org.chorem.lima.business.LimaException;
+import org.chorem.lima.entity.Account;
+
+/**
+ * Account service.
+ *
+ * @author chatellier
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author$
+ */
+
+@Remote
+public interface AccountService {
+
+ List<Account> getAllAccounts() throws LimaException;
+
+ List<Account> getAllSubAccounts() throws LimaException;
+
+ /**
+ * Create new account. If {@code masterAccount} is not null, {@code account}
+ * is added in {@code masterAccount}'s subAccounts.
+ *
+ * @param masterAccount master account (can be null)
+ * @param account account
+ * @throws LimaException
+ */
+ //EJB Remote
+ void createAccount(Account masterAccount, Account account) throws LimaException, LimaBusinessException;
+
+ void createSubLedger(Account masterAccount, Account account) throws LimaException;
+
+ void updateAccount(Account account) throws LimaException;
+
+ void removeAccount(Account account) throws LimaException;
+ void removeAllAccount() throws LimaException;
+
+ List<Account> getAllChildrenAccounts(Account masterAccount, List<Account> accounts) throws LimaException;
+
+ //EJB Remote et local
+ List<Account> getChildrenAccounts(Account masterAccount) throws LimaException;
+}
Property changes on: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/AccountService.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: 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 (rev 0)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/AccountServiceLocal.java 2010-07-22 10:36:21 UTC (rev 2983)
@@ -0,0 +1,47 @@
+/* *##% 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 java.util.List;
+import javax.ejb.Local;
+
+import org.chorem.lima.business.LimaBusinessException;
+import org.chorem.lima.business.LimaException;
+import org.chorem.lima.entity.Account;
+import org.nuiton.topia.TopiaContext;
+
+/**
+ * Account service.
+ *
+ * @author chatellier
+ * @version $Revision: 2917 $
+ *
+ * Last update : $Date: 2010-05-31 15:11:26 +0200 (lun. 31 mai 2010) $
+ * By : $Author: jpepin $
+ */
+
+@Local
+public interface AccountServiceLocal extends AccountService{
+
+ public List<Account> stringToListAccountsWithTransaction(String selectedAccounts, 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;
+
+}
\ No newline at end of file
Added: 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 (rev 0)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/DocumentService.java 2010-07-22 10:36:21 UTC (rev 2983)
@@ -0,0 +1,39 @@
+/* *##% 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 java.util.List;
+
+import javax.ejb.Remote;
+
+import org.chorem.lima.beans.FinancialStatementAmounts;
+
+/**
+ * Interface to create pdf and html docs
+ * @author john
+ *
+ */
+
+@Remote
+public interface DocumentService {
+
+ public void createDocuments(List<FinancialStatementAmounts> financialStatementAmounts);
+
+}
Added: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/DocumentServiceLocal.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/DocumentServiceLocal.java (rev 0)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/DocumentServiceLocal.java 2010-07-22 10:36:21 UTC (rev 2983)
@@ -0,0 +1,34 @@
+/* *##% 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;
+
+/**
+ * Interface to create pdf and html docs
+ * @author john
+ *
+ */
+
+@Local
+public interface DocumentServiceLocal {
+
+
+}
Added: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/EntryBookService.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/EntryBookService.java (rev 0)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/EntryBookService.java 2010-07-22 10:36:21 UTC (rev 2983)
@@ -0,0 +1,47 @@
+/* *##% 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 java.util.List;
+import javax.ejb.Remote;
+import org.chorem.lima.business.LimaException;
+import org.chorem.lima.entity.EntryBook;
+
+/**
+ * Entry book service.
+ *
+ * @author chatellier
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author$
+ */
+
+@Remote
+public interface EntryBookService {
+
+ List<EntryBook> getAllEntryBooks() throws LimaException;
+
+ void createEntryBook(EntryBook entryBook) throws LimaException;
+
+ void updateEntryBook(EntryBook entryBook) throws LimaException;
+
+ void removeEntryBook(EntryBook entryBook) throws LimaException;
+}
Property changes on: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/EntryBookService.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/EntryBookServiceLocal.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/EntryBookServiceLocal.java (rev 0)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/EntryBookServiceLocal.java 2010-07-22 10:36:21 UTC (rev 2983)
@@ -0,0 +1,44 @@
+/* *##% 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;
+
+import org.chorem.lima.business.LimaException;
+import org.chorem.lima.entity.EntryBook;
+import org.nuiton.topia.TopiaContext;
+
+
+/**
+ * Entry book service.
+ *
+ * @author chatellier
+ * @version $Revision: 2889 $
+ *
+ * Last update : $Date: 2010-05-10 15:13:56 +0200 (lun. 10 mai 2010) $
+ * By : $Author: jpepin $
+ */
+
+@Local
+public interface EntryBookServiceLocal extends EntryBookService {
+
+ public void createEntryBookWithTransaction(EntryBook entryBook, TopiaContext topiaContext) throws LimaException;
+
+}
Added: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ExportService.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ExportService.java (rev 0)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ExportService.java 2010-07-22 10:36:21 UTC (rev 2983)
@@ -0,0 +1,74 @@
+/* *##% 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;
+import org.chorem.lima.business.LimaException;
+
+/**
+ * Import export service.
+ *
+ * Currently import and export as XML.
+ *
+ * @author chatellier
+ * @version $Revision: 2962 $
+ *
+ * Last update : $Date: 2010-07-05 16:59:28 +0200 (lun., 05 juil. 2010) $
+ * By : $Author: jpepin $
+ */
+@Remote
+public interface ExportService {
+
+
+ /**
+ * Get database export as CSV;
+ *
+ * @return export as byte array
+ * @throws LimaException
+ */
+ public String exportAsCSV() throws LimaException;
+
+ /**
+ * export entrybook chart as CSV.
+ */
+ public String exportEntryBookChartAsCSV() throws LimaException;
+
+ /**
+ * export financialstatement chart as CSV.
+ */
+ public String exportFinancialStatementChartAsCSV() throws LimaException;
+
+ /**
+ * export accounts chart as CSV.
+ */
+ public String exportAccountsChartAsCSV() throws LimaException;
+
+ /**
+ * export entries as EBP
+ */
+ public String exportEntriesAsEBP() throws LimaException;
+
+ /**
+ * export accounts as EBP
+ */
+ public String exportAccountsAsEBP() throws LimaException;
+
+
+}
Added: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ExportServiceLocal.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ExportServiceLocal.java (rev 0)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ExportServiceLocal.java 2010-07-22 10:36:21 UTC (rev 2983)
@@ -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.ejbinterface;
+
+import javax.ejb.Local;
+
+/**
+ * Import export service.
+ *
+ * Currently import and export as XML.
+ *
+ * @author chatellier
+ * @version $Revision: 2824 $
+ *
+ * Last update : $Date: 2010-04-02 18:55:19 +0200 (ven. 02 avril 2010) $
+ * By : $Author: echatellier $
+ */
+@Local
+public interface ExportServiceLocal extends ExportService {
+
+}
Added: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialPeriodService.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialPeriodService.java (rev 0)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialPeriodService.java 2010-07-22 10:36:21 UTC (rev 2983)
@@ -0,0 +1,54 @@
+/* *##% 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 java.util.List;
+import javax.ejb.Remote;
+import org.chorem.lima.business.LimaException;
+import org.chorem.lima.entity.ClosedPeriodicEntryBook;
+import org.chorem.lima.entity.EntryBook;
+import org.chorem.lima.entity.FinancialPeriod;
+
+/**
+ * Financial period service.
+ *
+ * @author chatellier
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author$
+ */
+
+@Remote
+public interface FinancialPeriodService {
+
+ List<FinancialPeriod> getUnblockedFinancialPeriods() throws LimaException;
+
+
+ void createFinancialPeriods(List<FinancialPeriod> financialPeriods) throws LimaException;
+
+ /** Methodes for closedperiodicentrybook */
+
+ ClosedPeriodicEntryBook getClosedPeriodicEntryBook(EntryBook entryBook, FinancialPeriod financialPeriod) throws LimaException;
+
+ List<ClosedPeriodicEntryBook> getAllClosedPeriodicEntryBooksFromUnblockedFiscalPeriod() throws LimaException;
+
+ void blockClosedPeriodicEntryBook(ClosedPeriodicEntryBook closedPeriodicEntryBook) throws LimaException;
+}
Property changes on: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialPeriodService.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialPeriodServiceLocal.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialPeriodServiceLocal.java (rev 0)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialPeriodServiceLocal.java 2010-07-22 10:36:21 UTC (rev 2983)
@@ -0,0 +1,47 @@
+/* *##% 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 java.util.List;
+import javax.ejb.Local;
+import org.chorem.lima.business.LimaException;
+import org.chorem.lima.entity.ClosedPeriodicEntryBook;
+import org.chorem.lima.entity.FinancialPeriod;
+import org.nuiton.topia.TopiaContext;
+
+
+/**
+ * Financial period service.
+ *
+ * @author chatellier
+ * @version $Revision: 2913 $
+ *
+ * Last update : $Date: 2010-05-27 16:36:34 +0200 (jeu. 27 mai 2010) $
+ * By : $Author: jpepin $
+ */
+
+@Local
+public interface FinancialPeriodServiceLocal extends FinancialPeriodService {
+
+ void createFinancialPeriodsWithTransaction(List<FinancialPeriod> financialPeriods, TopiaContext topiaContext) throws LimaException;
+ public void blockClosedPeriodicEntryBookWithTransaction(ClosedPeriodicEntryBook closedPeriodicEntryBook, TopiaContext topiaContext) throws LimaException;
+
+
+}
Added: 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 (rev 0)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialStatementService.java 2010-07-22 10:36:21 UTC (rev 2983)
@@ -0,0 +1,44 @@
+/* *##% 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 java.util.Date;
+import java.util.List;
+import javax.ejb.Remote;
+import org.chorem.lima.beans.FinancialStatementAmounts;
+import org.chorem.lima.business.LimaBusinessException;
+import org.chorem.lima.business.LimaException;
+import org.chorem.lima.entity.FinancialStatement;
+
+@Remote
+public interface FinancialStatementService {
+
+
+ public void createFinancialStatement(FinancialStatement masterFinancialStatement, FinancialStatement financialStatement) throws LimaException, LimaBusinessException;
+ public void updateFinancialStatement(FinancialStatement financialStatement) throws LimaException, LimaBusinessException;
+ public void removeFinancialStatement(FinancialStatement financialStatement) throws LimaException, LimaBusinessException;
+
+ public List<FinancialStatement> getAllFinancialStatements() throws LimaException;
+ public List<FinancialStatement> getChildrenFinancialStatement(FinancialStatement financialStatement) throws LimaException;
+ public List<FinancialStatement> getAllChildrenFinancialStatement(FinancialStatement financialStatement, List<FinancialStatement> financialStatements) throws LimaException, LimaBusinessException;
+
+ public List<FinancialStatementAmounts> financialStatementReport(Date selectedBeginDate, Date selectedEndDate) throws LimaException;
+
+}
Added: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialStatementServiceLocal.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialStatementServiceLocal.java (rev 0)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialStatementServiceLocal.java 2010-07-22 10:36:21 UTC (rev 2983)
@@ -0,0 +1,36 @@
+/* *##% 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;
+
+import org.chorem.lima.business.LimaBusinessException;
+import org.chorem.lima.business.LimaException;
+import org.chorem.lima.entity.FinancialStatement;
+import org.nuiton.topia.TopiaContext;
+
+@Local
+public interface FinancialStatementServiceLocal extends FinancialStatementService {
+
+ public void createFinancialStatementWithTransaction(FinancialStatement masterFinancialStatement,
+ FinancialStatement financialStatement, TopiaContext topiaContext) throws LimaException, LimaBusinessException;
+
+
+}
Added: 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 (rev 0)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialTransactionService.java 2010-07-22 10:36:21 UTC (rev 2983)
@@ -0,0 +1,80 @@
+/* *##% 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 java.util.List;
+import javax.ejb.Remote;
+import org.chorem.lima.business.LimaBusinessException;
+import org.chorem.lima.business.LimaException;
+import org.chorem.lima.entity.Entry;
+import org.chorem.lima.entity.EntryBook;
+import org.chorem.lima.entity.FinancialPeriod;
+import org.chorem.lima.entity.FinancialTransaction;
+import org.chorem.lima.entity.FiscalPeriod;
+
+/**
+ * Transaction service.
+ *
+ * @author chatellier
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author$
+ */
+
+@Remote
+public interface FinancialTransactionService {
+
+
+ /**
+ * Find all transaction for an entry book and a financial period.
+ *
+ * @param entryBook entry book
+ * @param period financial period
+ * @return all transaction for entry book and period
+ * @throws LimaException
+ */
+ List<FinancialTransaction> getAllFinancialTransactionsForFinancialPeriod(
+ FinancialPeriod period) throws LimaException;
+
+ List<FinancialTransaction> getAllFinancialTransactionsForEntryBookAndFinancialPeriod(
+ EntryBook entryBook, FinancialPeriod period) throws LimaException;
+
+ List<FinancialTransaction> getAllFinancialTransactionsUnbalanced(FiscalPeriod fiscalPeriod) throws LimaException;
+
+ void createFinancialTransaction(FinancialTransaction financialtransaction) throws LimaException;
+
+ void updateFinancialTransaction(FinancialTransaction financialtransaction) throws LimaException, LimaBusinessException;
+
+ void removeFinancialTransaction(FinancialTransaction financialtransaction) throws LimaException;
+
+ /**
+ * Methodes for create, update and remove the entry
+ * @param entry
+ * @throws LimaException
+ */
+
+ void createEntry(Entry entry) throws LimaException;
+
+ void updateEntry(Entry entry) throws LimaException;
+
+ void removeEntry(Entry entry) throws LimaException;
+
+}
Property changes on: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialTransactionService.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialTransactionServiceLocal.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialTransactionServiceLocal.java (rev 0)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialTransactionServiceLocal.java 2010-07-22 10:36:21 UTC (rev 2983)
@@ -0,0 +1,52 @@
+/* *##% 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 java.util.List;
+import javax.ejb.Local;
+
+import org.chorem.lima.business.LimaBusinessException;
+import org.chorem.lima.business.LimaException;
+import org.chorem.lima.entity.Entry;
+import org.chorem.lima.entity.FinancialTransaction;
+import org.nuiton.topia.TopiaContext;
+
+/**
+ * Transaction service.
+ *
+ * @author chatellier
+ * @version $Revision: 2917 $
+ *
+ * Last update : $Date: 2010-05-31 15:11:26 +0200 (lun. 31 mai 2010) $
+ * By : $Author: jpepin $
+ */
+
+@Local
+public interface FinancialTransactionServiceLocal extends FinancialTransactionService {
+
+ public List<FinancialTransaction> getAllFinancialTransactionsBalanced(TopiaContext topiaContext) throws LimaException;
+
+ void createFinancialTransactionWithTransaction(FinancialTransaction financialtransaction, TopiaContext topiaContext) throws LimaException;
+
+ void updateFinancialTransactionWithTransaction(FinancialTransaction financialtransaction, TopiaContext topiaContext) throws LimaException, LimaBusinessException;
+
+ void createEntryWithTransaction(Entry entry, TopiaContext topiaContext) throws LimaException;
+
+}
Added: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FiscalPeriodService.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FiscalPeriodService.java (rev 0)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FiscalPeriodService.java 2010-07-22 10:36:21 UTC (rev 2983)
@@ -0,0 +1,50 @@
+/* *##% 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 java.util.List;
+import javax.ejb.Remote;
+import org.chorem.lima.business.LimaException;
+import org.chorem.lima.entity.FiscalPeriod;
+
+/**
+ * Fiscal period service.
+ *
+ * @author chatellier
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author$
+ */
+@Remote
+public interface FiscalPeriodService {
+
+ List<FiscalPeriod> getAllFiscalPeriods() throws LimaException;
+
+ List<FiscalPeriod> getAllUnblockedFiscalPeriods() throws LimaException;
+
+ FiscalPeriod getLastFiscalPeriod() throws LimaException;
+
+ void createFiscalPeriod(FiscalPeriod fiscalPeriod) throws LimaException;
+
+ void blockFiscalPeriod(FiscalPeriod fiscalPeriod) throws LimaException;
+
+ void removeAllFiscalPeriods() throws LimaException;
+}
Property changes on: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FiscalPeriodService.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FiscalPeriodServiceLocal.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FiscalPeriodServiceLocal.java (rev 0)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FiscalPeriodServiceLocal.java 2010-07-22 10:36:21 UTC (rev 2983)
@@ -0,0 +1,42 @@
+/* *##% 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;
+import org.chorem.lima.business.LimaException;
+import org.chorem.lima.entity.FiscalPeriod;
+import org.nuiton.topia.TopiaContext;
+
+/**
+ * Fiscal period service.
+ *
+ * @author chatellier
+ * @version $Revision: 2910 $
+ *
+ * Last update : $Date: 2010-05-26 20:37:42 +0200 (mer. 26 mai 2010) $
+ * By : $Author: jpepin $
+ */
+@Local
+public interface FiscalPeriodServiceLocal extends FiscalPeriodService {
+
+ void createFiscalPeriodWithTransaction(FiscalPeriod fiscalPeriod, TopiaContext topiaContext) throws LimaException;
+
+
+}
Added: 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 (rev 0)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ImportService.java 2010-07-22 10:36:21 UTC (rev 2983)
@@ -0,0 +1,76 @@
+/* *##% 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;
+import org.chorem.lima.business.LimaException;
+
+/**
+ * Import export service.
+ *
+ * Currently import and export as XML.
+ *
+ * @author chatellier
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author$
+ */
+@Remote
+public interface ImportService {
+
+ /**
+ * Import data as EBP CSV export.
+ *
+ * @param data
+ * @throws LimaException
+ */
+ public String importEntriesFromEbp(String datas) throws LimaException;
+ public String importAccountsChartFromEbp(String datas) throws LimaException;
+
+
+ /**
+ * Import data as Sage Maestria export.
+ *
+ * @param data
+ * @throws LimaException
+ */
+ public void importAsSage(byte[] data) throws LimaException;
+
+ /**
+ * Import data as Ciel Compta export.
+ *
+ * @param data
+ * @throws LimaException
+ */
+ public void importAsCiel(byte[] data) throws LimaException;
+
+ /**
+ * import CSV.
+ * Return result log
+ */
+ 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;
+}
Property changes on: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ImportService.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ImportServiceLocal.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ImportServiceLocal.java (rev 0)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ImportServiceLocal.java 2010-07-22 10:36:21 UTC (rev 2983)
@@ -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.ejbinterface;
+
+import javax.ejb.Local;
+
+/**
+ * Import export service.
+ *
+ * Currently import and export as XML.
+ *
+ * @author chatellier
+ * @version $Revision: 2824 $
+ *
+ * Last update : $Date: 2010-04-02 18:55:19 +0200 (ven. 02 avril 2010) $
+ * By : $Author: echatellier $
+ */
+@Local
+public interface ImportServiceLocal extends ImportService {
+
+}
Added: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/RecordService.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/RecordService.java (rev 0)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/RecordService.java 2010-07-22 10:36:21 UTC (rev 2983)
@@ -0,0 +1,44 @@
+/* *##% Lima Business
+ * Copyright (C) 2008 - 2010 CodeLutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * ##%*
+ */
+
+package org.chorem.lima.business.ejbinterface;
+
+import javax.ejb.Remote;
+
+/**
+ * Fiscal period service.
+ *
+ * @author chatellier
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author$
+ */
+
+@Remote
+public interface RecordService {
+
+ //List<FiscalPeriod> getAllFiscalPeriods() throws LimaException;
+
+ //void createFiscalPeriod(FiscalPeriod fiscalPeriod) throws LimaException;
+
+ //void updateFiscalPeriod(FiscalPeriod fiscalPeriod) throws LimaException;
+
+ //void removeFiscalPeriod(FiscalPeriod fiscalPeriod) throws LimaException;
+}
Property changes on: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/RecordService.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/RecordServiceLocal.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/RecordServiceLocal.java (rev 0)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/RecordServiceLocal.java 2010-07-22 10:36:21 UTC (rev 2983)
@@ -0,0 +1,37 @@
+/* *##% Lima Business
+ * Copyright (C) 2008 - 2010 CodeLutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * ##%*
+ */
+
+package org.chorem.lima.business.ejbinterface;
+
+import javax.ejb.Local;
+
+/**
+ * Fiscal period service.
+ *
+ * @author chatellier
+ * @version $Revision: 2902 $
+ *
+ * Last update : $Date: 2010-05-19 18:38:02 +0200 (mer. 19 mai 2010) $
+ * By : $Author: jpepin $
+ */
+
+@Local
+public interface RecordServiceLocal extends RecordService {
+
+}
Added: 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 (rev 0)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ReportService.java 2010-07-22 10:36:21 UTC (rev 2983)
@@ -0,0 +1,84 @@
+/* *##% 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 java.util.Date;
+import javax.ejb.Remote;
+import org.chorem.lima.beans.BalanceTrial;
+import org.chorem.lima.beans.ReportsDatas;
+import org.chorem.lima.business.LimaException;
+import org.chorem.lima.entity.Account;
+import org.chorem.lima.entity.EntryBook;
+
+/**
+ * Service de generation des rapports.
+ *
+ * Actuellement:
+ * <ul>
+ * <li>Balance</li>
+ * <li>Bilan</li>
+ * </ul>
+ *
+ * @author chatellier
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author$
+ */
+
+@Remote
+public interface ReportService {
+
+ /**
+ * Generation du bilan.
+ *
+ * @param fiscalPeriod exercice
+ * @return le bilan
+ * @throws LimaException
+ * BalanceSheet generateBalanceSheet(FiscalPeriod fiscalPeriod) throws LimaException;
+ */
+
+ /**
+ * Generation de la balance.
+ *
+ * @return la balance
+ * @throws LimaException
+ */
+ BalanceTrial generateBalanceTrial(Date beginDate, Date endDate, String selectedAccounts, Boolean getEntries) throws LimaException;
+
+ /**
+ * Generation du grand-livre
+ *
+ * @throws LimaException
+ */
+ BalanceTrial generateLedger(Date beginDate, Date endDate) throws LimaException;
+
+
+ /**
+ * Generation du rapports des comptes
+ */
+ ReportsDatas generateAccountsReports(Account account, Date beginDate, Date endDate) throws LimaException;
+
+ /**
+ * Generation du rapports des journaux
+ */
+ ReportsDatas generateEntryBooksReports(EntryBook entryBook, Date beginDate, Date endDate) throws LimaException;
+
+}
Property changes on: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ReportService.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: 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 (rev 0)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ReportServiceLocal.java 2010-07-22 10:36:21 UTC (rev 2983)
@@ -0,0 +1,51 @@
+/* *##% 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 java.util.Date;
+import javax.ejb.Local;
+import org.chorem.lima.beans.ReportsDatas;
+import org.chorem.lima.business.LimaException;
+import org.chorem.lima.entity.Account;
+import org.nuiton.topia.TopiaContext;
+
+
+/**
+ * Service de generation des rapports.
+ *
+ * Actuellement:
+ * <ul>
+ * <li>Balance</li>
+ * <li>Bilan</li>
+ * </ul>
+ *
+ * @author chatellier
+ * @version $Revision: 2902 $
+ *
+ * Last update : $Date: 2010-05-19 18:38:02 +0200 (mer. 19 mai 2010) $
+ * By : $Author: jpepin $
+ */
+
+@Local
+public interface ReportServiceLocal extends ReportService {
+
+ public ReportsDatas generateAccountReportsWithTransaction (Account account, Date beginDate, Date endDate, TopiaContext topiaContext) throws LimaException;
+
+}
Modified: trunk/lima-swing/pom.xml
===================================================================
--- trunk/lima-swing/pom.xml 2010-07-22 09:10:03 UTC (rev 2982)
+++ trunk/lima-swing/pom.xml 2010-07-22 10:36:21 UTC (rev 2983)
@@ -48,11 +48,6 @@
<groupId>net.sf.opencsv</groupId>
<artifactId>opencsv</artifactId>
</dependency>
-
- <dependency>
- <groupId>com.lowagie</groupId>
- <artifactId>itext</artifactId>
- </dependency>
<dependency>
<groupId>org.swinglabs</groupId>
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/LimaMain.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/LimaMain.java 2010-07-22 09:10:03 UTC (rev 2982)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/LimaMain.java 2010-07-22 10:36:21 UTC (rev 2983)
@@ -30,8 +30,8 @@
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.chorem.lima.business.AccountService;
import org.chorem.lima.business.AccountServiceMonitorable;
+import org.chorem.lima.business.ejbinterface.AccountService;
import org.chorem.lima.entity.Account;
import org.chorem.lima.service.LimaServiceFactory;
import org.chorem.lima.ui.MainView;
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookViewHandler.java 2010-07-22 09:10:03 UTC (rev 2982)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookViewHandler.java 2010-07-22 10:36:21 UTC (rev 2983)
@@ -22,9 +22,9 @@
import javax.swing.JOptionPane;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.chorem.lima.business.EntryBookService;
import org.chorem.lima.business.EntryBookServiceMonitorable;
import org.chorem.lima.business.LimaException;
+import org.chorem.lima.business.ejbinterface.EntryBookService;
import org.chorem.lima.entity.EntryBook;
import org.chorem.lima.entity.EntryBookImpl;
import org.chorem.lima.service.LimaServiceFactory;
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialperiod/FinancialPeriodTable.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialperiod/FinancialPeriodTable.java 2010-07-22 09:10:03 UTC (rev 2982)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialperiod/FinancialPeriodTable.java 2010-07-22 10:36:21 UTC (rev 2983)
@@ -24,9 +24,9 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.chorem.lima.business.FinancialPeriodService;
import org.chorem.lima.business.FinancialPeriodServiceMonitorable;
import org.chorem.lima.business.LimaException;
+import org.chorem.lima.business.ejbinterface.FinancialPeriodService;
import org.chorem.lima.entity.ClosedPeriodicEntryBook;
import org.chorem.lima.entity.ClosedPeriodicEntryBookImpl;
import org.chorem.lima.service.LimaServiceFactory;
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementDocument.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementDocument.java 2010-07-22 09:10:03 UTC (rev 2982)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementDocument.java 2010-07-22 10:36:21 UTC (rev 2983)
@@ -48,276 +48,6 @@
private static final Log log =
LogFactory.getLog(FinancialStatementReportTable.class);
- public void createDocuments(List<FinancialStatementAmounts> financialStatementAmounts) {
- Document document = new Document(PageSize.A4, 5, 5, 5, 5);
-
- try {
-
- PdfWriter pdfWriter = PdfWriter.getInstance(document,
- new FileOutputStream("/test_lima.pdf"));
- HtmlWriter htmlWriter = HtmlWriter.getInstance(document,
- new FileOutputStream("/test_lima.html"));
- Font numpageFont = new Font(Font.HELVETICA, 9, Font.BOLD, Color.BLACK);
- document.open();
- int nbpages = 1;
-
-
- //Split list by financialstatement type
- 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++) {
- if (financialStatementAmounts.get(i).getLevel()==1){
- if (first){
- first=false;
- }
- else{
- listList.add(financialStatementAmounts.subList(min+1, i-1));
- }
- min=i;
- }
- }
- listList.add(financialStatementAmounts.subList(min+1, size));
-
- //create pages
- for (List<FinancialStatementAmounts> list : listList) {
- String title = list.get(0).getLabel();
- int i=0;
- int n=list.size();
- while (i<n){
- int j=i+40;
- if (j>n){
- j = n;
- }
- List <FinancialStatementAmounts> subFinancialStatementAmounts =
- list.subList(i, j);
- //create page : header + table + footer
- Table header = createHeader(title, "01/01/2010", "31/12/2010");
- Table table = createTable(subFinancialStatementAmounts);
- //new page
- Chapter chapter = new Chapter(0);
- //n° page
- Paragraph paragraphPage = new Paragraph();
- paragraphPage.setAlignment(Element.ALIGN_RIGHT);
- paragraphPage.add(new Phrase("Page n° "+nbpages, numpageFont));
- chapter.add(paragraphPage);
- //header
- Paragraph paragraphHeader = new Paragraph();
- paragraphHeader.add(header);
- chapter.add(paragraphHeader);
- //table
- Paragraph paragraphTable = new Paragraph();
- paragraphTable.add(table);
- chapter.add(paragraphTable);
- //add page
- document.add(chapter);
- i=i+40;
- 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 createHeader(String title, String beginDate, String endDate){
- Table t = null;
- try {
- //define table
- t = new Table(4, 5);
- float[] widths = {0.25f, 0.45f, 0.12f, 0.18f};
- t.setWidths(widths);
- t.setPadding(3);
- //define font
- Font headerFont = new Font(Font.HELVETICA, 9, Font.ITALIC, Color.BLACK);
- Font headerFontB = new Font(Font.HELVETICA, 9, Font.BOLDITALIC, Color.BLACK);
- //defaut cell
- Cell cell = new Cell();
- cell.setBorder(Rectangle.NO_BORDER);
- t.setDefaultCell(cell);
-
- //line 1
- t.addCell(new Phrase("Code Lutin SA", headerFontB));
- Cell titleCell = new Cell(new Phrase(title, new Font(Font.HELVETICA, 14, Font.BOLD, Color.BLACK)));
- titleCell.setVerticalAlignment(Element.ALIGN_MIDDLE);
- titleCell.setHorizontalAlignment(Element.ALIGN_CENTER);
- titleCell.setRowspan(2);
- t.addCell(titleCell);
- t.addCell(new Phrase("N° Siret", headerFontB));
- t.addCell(new Phrase("442116703", headerFont));
- //line 2
- t.addCell(new Phrase("SSL", headerFont));
- t.addCell(new Phrase("NAF :", headerFontB));
- t.addCell(new Phrase("6201Z", headerFont));
- //line 3
- t.addCell(new Phrase("44 bd des Pas Enchantés", headerFont));
- t.addCell("");
- t.addCell(new Phrase("n°TVA", headerFontB));
- t.addCell(new Phrase("FR 57 442116703", headerFont));
- //line 4
- t.addCell(new Phrase("44230 St Séb/Loire", headerFont));
- t.addCell("");
- t.addCell(new Phrase("Période du", headerFontB));
- t.addCell(new Phrase(beginDate, headerFont));
- //line 5
- t.addCell("");
- t.addCell("");
- t.addCell(new Phrase("au", headerFontB));
- t.addCell(new Phrase(endDate, headerFont));
- } catch (BadElementException eeBEE) {
- log.error("Can't create table", eeBEE);
- }
- return t;
- }
- public Table createTable(List<FinancialStatementAmounts> financialStatementAmounts){
- int nbrow = financialStatementAmounts.size();
- Table t = null;
- try {
- //define table
- t = new Table(4,nbrow);
- float[] widths = {0.4f, 0.2f, 0.2f, 0.2f};
- t.setWidths(widths);
- t.setPadding(0.5f);
- t.setSpacing(0);
- t.setBorderWidth(1);
- t.setBorder(Rectangle.BOTTOM);
- //define default cell
- Cell cell = new Cell();
- cell.setBorder(Rectangle.LEFT);
- t.setDefaultCell(cell);
-
- Font headerFont = new Font(Font.HELVETICA, 9, Font.BOLD, Color.BLACK);
- Font tabFont = new Font(Font.HELVETICA, 9, Font.NORMAL, Color.BLACK);
-
- Cell headerCell = new Cell(new Phrase(_("lima.table.label"), headerFont));
- headerCell.setBorderWidth(1);
- headerCell.setHeader(true);
- t.addCell(headerCell);
- headerCell = new Cell(new Phrase(_("lima.table.grossamount"), headerFont));
- t.addCell(headerCell);
- headerCell = new Cell(new Phrase(_("lima.table.provisiondeprecationamount"), headerFont));
- t.addCell(headerCell);
- headerCell = new Cell(new Phrase(_("lima.table.netamount"), headerFont));
- t.addCell(headerCell);
-
- for (FinancialStatementAmounts financialStatementAmount : financialStatementAmounts) {
-
- String label = financialStatementAmount.getLabel();
- int level = financialStatementAmount.getLevel();
- Double grossAmount = financialStatementAmount.getGrossAmount();
- Double provisionDeprecationAmount = financialStatementAmount.getProvisionDeprecationAmount();
-
- if (financialStatementAmount.getSubAmount()){
- cell.setGrayFill(0.9f);
- }
- else {
- cell.setGrayFill(1f);
- }
-
- if (label == null){
- t.addCell("");
- t.addCell("");
- t.addCell("");
- t.addCell("");
- }
- else {
- //cell1
- String tab = "";
- for (int i = 0; i < level; i++) {
- tab += "\t";
- }
- Phrase phrase = null;
- if (financialStatementAmount.getHeader()){
- phrase = new Phrase(tab+label, headerFont);
- }
- else {
- phrase = new Phrase(tab+label, tabFont);
- }
- t.addCell(phrase);
- //cell2
- if (grossAmount != 0.0){
- phrase = new Phrase(String.valueOf(grossAmount), tabFont);
- }
- else {
- phrase = new Phrase("");
- }
- t.addCell(phrase);
- //cell 3
- if (provisionDeprecationAmount != 0.0){
- phrase = new Phrase(String.valueOf(provisionDeprecationAmount), tabFont);
- }
- else {
- phrase = new Phrase("");
- }
- t.addCell(phrase);
- //cell 4
- if (grossAmount-provisionDeprecationAmount != 0.0){
- phrase = new Phrase(String.valueOf(grossAmount-provisionDeprecationAmount), tabFont);
- }
- else {
- phrase = new Phrase("");
- }
- t.addCell(phrase);
- }
- }
-
- } catch (BadElementException eeBEE) {
- log.error("Can't create table", eeBEE);
- }
- return t;
- }
-
- public void example (){
- //FIRST PAGE
- /*document.add(new Paragraph("First page of the document."));
- document.add(new Paragraph("Some more text on the \n"
- + "first page with different color and font type.",
- FontFactory.getFont(FontFactory.COURIER, 14, Font.BOLD,
- new Color(255, 150, 200))));
-
- //SECOND PAGE
- Paragraph title1 = new Paragraph("Chapter 1",
- FontFactory.getFont(FontFactory.HELVETICA, 18,
- Font.BOLDITALIC, new Color(0, 0, 255)));
- Chapter chapter1 = new Chapter(title1, 1);
- chapter1.setNumberDepth(0);
- //SECTION 1
- Paragraph title11 = new Paragraph("This is Section 1 in Chapter 1",
- FontFactory.getFont(FontFactory.HELVETICA, 16,
- Font.BOLD, new Color(255, 0, 0)));
- Section section1 = chapter1.addSection(title11);
- Paragraph someSectionText = new Paragraph("This text comes as part of section 1 of chapter 1.");
- section1.add(someSectionText);
- someSectionText = new Paragraph("Following is a 3 X 2 table.");
- section1.add(someSectionText);
- //TABLE
- Table t = new Table(3,2);
- t.setBorderColor(new Color(220, 255, 100));
- t.setPadding(5);
- t.setSpacing(5);
- t.setBorderWidth(1);
- Cell c1 = new Cell("header1");
- c1.setHeader(true);
- t.addCell(c1);
- c1 = new Cell("Header2");
- t.addCell(c1);
- c1 = new Cell("Header3");
- t.addCell(c1);
- t.endHeaders();
- t.addCell("1.1");
- t.addCell("1.2");
- t.addCell("1.3");
-
- section1.add(t);
-
- document.add(chapter1);*/
- }
-
}
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-07-22 09:10:03 UTC (rev 2982)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportTableModel.java 2010-07-22 10:36:21 UTC (rev 2983)
@@ -26,11 +26,13 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
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.ImportServiceMonitorable;
import org.chorem.lima.business.LimaException;
import org.chorem.lima.business.ServiceListener;
+import org.chorem.lima.business.ejbinterface.DocumentService;
import org.chorem.lima.service.LimaServiceFactory;
import org.chorem.lima.util.ErrorHelper;
@@ -54,6 +56,7 @@
/** Services. */
protected FinancialStatementServiceMonitorable financialStatementService;
+ protected DocumentServiceMonitorable documentService;
/** DatePicker Begin Date. */
protected Date selectedBeginDate;
@@ -76,6 +79,7 @@
ImportServiceMonitorable.class).addListener(this);
LimaServiceFactory.getInstance().getService(
FinancialTransactionServiceMonitorable.class).addListener(this);
+ documentService = LimaServiceFactory.getInstance().getService(DocumentServiceMonitorable.class);
}
@Override
@@ -206,8 +210,7 @@
}
public void createDocuments(){
- FinancialStatementDocument financialStatementDocument = new FinancialStatementDocument();
- financialStatementDocument.createDocuments(cacheDataList);
+ documentService.createDocuments(cacheDataList);
}
@Override
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-07-22 09:10:03 UTC (rev 2982)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedTableModel.java 2010-07-22 10:36:21 UTC (rev 2983)
@@ -28,7 +28,7 @@
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.business.FinancialTransactionServiceMonitorable;
import org.chorem.lima.business.LimaException;
-import org.chorem.lima.business.FinancialTransactionService;
+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;
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-22 09:10:03 UTC (rev 2982)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/AddPeriod.jaxx 2010-07-22 10:36:21 UTC (rev 2983)
@@ -19,14 +19,13 @@
<script>
<![CDATA[
import org.chorem.lima.entity.FiscalPeriod;
- import org.chorem.lima.business.FiscalPeriodService;
import org.chorem.lima.business.FiscalPeriodServiceMonitorable;
import org.chorem.lima.service.LimaServiceFactory;
import org.chorem.lima.business.LimaException;
import org.apache.commons.lang.time.DateUtils;
import org.chorem.lima.entity.FiscalPeriodImpl;
- protected FiscalPeriodService fiscalPeriodService =
+ protected FiscalPeriodServiceMonitorable fiscalPeriodService =
LimaServiceFactory.getInstance().getService(
FiscalPeriodServiceMonitorable.class);
1
0
r2982 - in trunk/lima-swing/src/main/java/org/chorem/lima/ui: accountsreports balance entrybooksreports financialstatementreport importexport ledger
by jpepin@users.chorem.org 22 Jul '10
by jpepin@users.chorem.org 22 Jul '10
22 Jul '10
Author: jpepin
Date: 2010-07-22 11:10:03 +0200 (Thu, 22 Jul 2010)
New Revision: 2982
Url: http://chorem.org/repositories/revision/lima/2982
Log:
D?\195?\169placement dans les rapports de la r?\195?\169cup?\195?\169ration des donn?\195?\169es aux services dans le handler au lieu du mod?\195?\168le.
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/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/balance/BalanceViewHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsTable.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/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/importexport/ImportExport.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/LedgerView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerViewHandler.java
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-07-21 16:46:42 UTC (rev 2981)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsTableModel.java 2010-07-22 09:10:03 UTC (rev 2982)
@@ -21,67 +21,27 @@
import static org.nuiton.i18n.I18n._;
import java.text.SimpleDateFormat;
-import java.util.Date;
import javax.swing.table.AbstractTableModel;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.beans.ReportsDatas;
-import org.chorem.lima.business.FinancialTransactionServiceMonitorable;
-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.entity.Account;
import org.chorem.lima.entity.Entry;
-import org.chorem.lima.service.LimaServiceFactory;
-import org.chorem.lima.util.ErrorHelper;
/**
* Entry book table model.
- *
- * @author ore
- * @author chatellier
- * @version $Revision: 2865 $
- *
- * Last update : $Date: 2010-04-19 15:19:30 +0200 (lun. 19 avril 2010) $
* By : $Author: jpepin $
*/
-public class AccountsReportsTableModel extends AbstractTableModel implements ServiceListener {
+public class AccountsReportsTableModel extends AbstractTableModel{
/** serialVersionUID. */
private static final long serialVersionUID = 1L;
/** log. */
private static final Log log = LogFactory.getLog(AccountsReportsTableModel.class);
-
- /** Services. */
- protected ReportServiceMonitorable reportService;
- /** Account. */
- protected Account selectedAccount;
-
- /** Begin Date. */
- protected Date selectedBeginDate;
-
- /** EndDate. */
- protected Date selectedEndDate;
-
/** data cache */
protected ReportsDatas cacheDataList;
- /**
- * Constructor.
- */
- public AccountsReportsTableModel() {
-
- reportService =
- LimaServiceFactory.getInstance().getService(
- ReportServiceMonitorable.class);
- LimaServiceFactory.getInstance().getService(
- ImportServiceMonitorable.class).addListener(this);
- LimaServiceFactory.getInstance().getService(
- FinancialTransactionServiceMonitorable.class).addListener(this);
- }
@Override
public int getRowCount() {
@@ -178,45 +138,10 @@
// Just read, no write
return false;
}
-
- public void setBeginDate(Date date){
- selectedBeginDate = date;
- }
- public void setEndDate(Date date){
- selectedEndDate = date;
- }
-
-
- public void setAccount(Account account) {
- selectedAccount = account;
- }
-
- 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);
- }
- ErrorHelper.showErrorDialog("Can't get entries list", eee);
- }
- return results;
- }
-
- public void refresh(){
- cacheDataList = getDataList();
+ public void refresh(ReportsDatas datasList){
+ cacheDataList = datasList;
fireTableDataChanged();
}
-
- @Override
- public void notifyMethod(String serviceName, String methodeName) {
- if (serviceName.contains("FinancialTransaction") || methodeName.contains("importAccount") || methodeName.contains("importAll")){
- refresh();
- }
- }
}
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-07-21 16:46:42 UTC (rev 2981)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsView.jaxx 2010-07-22 09:10:03 UTC (rev 2982)
@@ -32,12 +32,12 @@
// set begindate to JAN 1 - 0:00.000 of this years
Date beginDate = calendarBegin.getTime();
beginDate = DateUtils.truncate(beginDate, Calendar.YEAR);
- getModelAccountsReportsTable().setBeginDate(beginDate);
+ getHandler().setBeginDate(beginDate);
// get end date
Calendar calendarEnd = Calendar.getInstance();
Date endDate = calendarEnd.getTime();
- getModelAccountsReportsTable().setEndDate(endDate);
+ getHandler().setEndDate(endDate);
getBeginDatePicker().setDate(beginDate);
getEndDatePicker().setDate(endDate);
@@ -54,16 +54,14 @@
</cell>
<cell anchor="west">
<org.jdesktop.swingx.JXDatePicker id="beginDatePicker"
- onActionPerformed="getModelAccountsReportsTable().setBeginDate(beginDatePicker.getDate());
- getHandler().refresh()" />
+ onActionPerformed="getHandler().setBeginDate(beginDatePicker.getDate())" />
</cell>
<cell anchor="east">
<JLabel id="endCalendarPanelLabel" text="lima.accountsreports.endcalendar"/>
</cell>
<cell anchor="west">
<org.jdesktop.swingx.JXDatePicker id="endDatePicker"
- onActionPerformed="getModelAccountsReportsTable().setEndDate(endDatePicker.getDate());
- getHandler().refresh()"/>
+ onActionPerformed="getHandler().setEndDate(endDatePicker.getDate())"/>
</cell>
<cell anchor="east">
<JLabel id="accountSelectorLabel" text="lima.account"/>
@@ -72,8 +70,7 @@
<JComboBox id="accountSelectorComboBox"
model="{getModelAccounts()}"
renderer="{new org.chorem.lima.ui.combobox.AccountRenderer()}"
- onActionPerformed="getModelAccountsReportsTable().setAccount((Account) accountSelectorComboBox.getSelectedItem());
- getHandler().refresh()"
+ onActionPerformed="getHandler().setAccount((Account) accountSelectorComboBox.getSelectedItem())"
editable="false"
/>
</cell>
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-07-21 16:46:42 UTC (rev 2981)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsViewHandler.java 2010-07-22 09:10:03 UTC (rev 2982)
@@ -19,45 +19,107 @@
package org.chorem.lima.ui.accountsreports;
import static org.nuiton.i18n.I18n._;
+import java.util.Date;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.chorem.lima.beans.ReportsDatas;
+import org.chorem.lima.business.FinancialTransactionServiceMonitorable;
+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.entity.Account;
+import org.chorem.lima.service.LimaServiceFactory;
import org.chorem.lima.ui.combobox.AccountComboBoxModel;
+import org.chorem.lima.util.ErrorHelper;
/**
* Handler associated with accounts reports view.
- *
- * @author chatellier
- * @version $Revision: 2884 $
- *
- * Last update : $Date: 2010-05-06 11:57:19 +0200 (jeu. 06 mai 2010) $
* By : $Author: jpepin $
*/
-public class AccountsReportsViewHandler {
+public class AccountsReportsViewHandler implements ServiceListener {
protected AccountsReportsView view;
protected AccountsReportsTableModel tableModel;
protected AccountComboBoxModel comboBoxModel;
+
+ /** log. */
+ private static final Log log = LogFactory.getLog(AccountsReportsViewHandler.class);
+
+ /** Account. */
+ protected Account selectedAccount;
+
+ /** Begin Date. */
+ protected Date selectedBeginDate;
+
+ /** EndDate. */
+ protected Date selectedEndDate;
+
+ /** Services. */
+ protected ReportServiceMonitorable reportService;
protected AccountsReportsViewHandler(AccountsReportsView view) {
this.view = view;
+
+ reportService =
+ LimaServiceFactory.getInstance().getService(
+ ReportServiceMonitorable.class);
+ LimaServiceFactory.getInstance().getService(
+ ImportServiceMonitorable.class).addListener(this);
+ LimaServiceFactory.getInstance().getService(
+ FinancialTransactionServiceMonitorable.class).addListener(this);
}
+ public void setBeginDate(Date date){
+ selectedBeginDate = date;
+ refresh();
+ }
+
+ public void setEndDate(Date date){
+ selectedEndDate = date;
+ refresh();
+ }
+
+
+ public void setAccount(Account account) {
+ selectedAccount = account;
+ refresh();
+ }
+
+ 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);
+ }
+ ErrorHelper.showErrorDialog("Can't get entries list", eee);
+ }
+ return results;
+ }
+
public void refresh(){
+
+ ReportsDatas datasList = getDataList();
+
tableModel = view.getModelAccountsReportsTable();
- tableModel.refresh();
+ tableModel.refresh(datasList);
/**
* set text and amounts of labels credit, debit, solde
*/
- ReportsDatas cacheDataList = tableModel.cacheDataList;
- if (cacheDataList != null){
+ if (datasList != null){
// set amounts credit and debit and solde
- view.amountCreditLabel.setText(String.valueOf(cacheDataList.getAmountCredit()));
- view.amountDebitLabel.setText(String.valueOf(cacheDataList.getAmountDebit()));
- Double amountSolde = cacheDataList.getAmountSolde();
+ view.amountCreditLabel.setText(String.valueOf(datasList.getAmountCredit()));
+ view.amountDebitLabel.setText(String.valueOf(datasList.getAmountDebit()));
+ Double amountSolde = datasList.getAmountSolde();
view.amountSoldeLabel.setText(String.valueOf(amountSolde));
@@ -66,7 +128,7 @@
}
else {
// set label solde: credit or debit
- if (cacheDataList.getSoldeDebit()) {
+ if (datasList.getSoldeDebit()) {
view.soldeLabel.setText(_("lima.soldedebit"));
}
else {
@@ -76,4 +138,11 @@
}
}
+ @Override
+ public void notifyMethod(String serviceName, String methodeName) {
+ if (serviceName.contains("FinancialTransaction") || methodeName.contains("importAccount") || methodeName.contains("importAll")){
+ refresh();
+ }
+ }
+
}
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-07-21 16:46:42 UTC (rev 2981)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceTableModel.java 2010-07-22 09:10:03 UTC (rev 2982)
@@ -20,66 +20,28 @@
package org.chorem.lima.ui.balance;
import static org.nuiton.i18n.I18n._;
-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.beans.BalanceTrial;
import org.chorem.lima.beans.ReportsDatas;
-import org.chorem.lima.business.FinancialTransactionServiceMonitorable;
-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.service.LimaServiceFactory;
-import org.chorem.lima.util.ErrorHelper;
+
/**
* Entry book table model.
- *
- * @author ore
- * @author chatellier
- * @version $Revision: 2865 $
- *
- * Last update : $Date: 2010-04-19 15:19:30 +0200 (lun. 19 avril 2010) $
* By : $Author: jpepin $
*/
-public class BalanceTableModel extends AbstractTableModel implements ServiceListener {
+public class BalanceTableModel extends AbstractTableModel {
/** serialVersionUID. */
- private static final long serialVersionUID = 7578692417919755647L;
+ private static final long serialVersionUID = 1L;
/** log. */
private static final Log log = LogFactory.getLog(BalanceTableModel.class);
-
- /** Services. */
- protected ReportServiceMonitorable reportService;
- /** DatePicker Begin Date. */
- protected Date selectedBeginDate;
-
- /** DatePicker EndDate. */
- protected Date selectedEndDate;
-
- /** Text field Accounts */
- protected String selectedAccounts;
-
/** data cache */
protected BalanceTrial cacheDataList;
-
- /**
- * Constructor.
- */
- public BalanceTableModel() {
- reportService =
- LimaServiceFactory.getInstance().getService(
- ReportServiceMonitorable.class);
- LimaServiceFactory.getInstance().getService(
- ImportServiceMonitorable.class).addListener(this);
- LimaServiceFactory.getInstance().getService(
- FinancialTransactionServiceMonitorable.class).addListener(this);
- }
@Override
public int getRowCount() {
@@ -171,47 +133,11 @@
// Just read, no write
return false;
}
-
- public void setBeginDate(Date date){
- selectedBeginDate = date;
- }
- public void setEndDate(Date date){
- selectedEndDate = date;
- }
- public void setAccountFilter(String accounts) {
- selectedAccounts = accounts;
- }
-
- /**
- * get all account fot the selected period
- * @return
- */
- public BalanceTrial getDataList(){
- BalanceTrial results = null;
-
- try {
- results = reportService.generateBalanceTrial(selectedBeginDate, selectedEndDate, selectedAccounts, false);
- }
- catch (LimaException eee) {
- if (log.isErrorEnabled()) {
- log.debug("Can't update model", eee);
- }
- ErrorHelper.showErrorDialog("Can't get entries list", eee);
- }
- return results;
- }
-
- public void refresh(){
- cacheDataList = getDataList();
+ public void refresh(BalanceTrial datasList){
+ cacheDataList = datasList;
fireTableDataChanged();
}
- @Override
- public void notifyMethod(String serviceName, String methodeName) {
- if (serviceName.contains("FinancialTransaction") || methodeName.contains("importAccount") || methodeName.contains("importAll")){
- refresh();
- }
- }
}
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-21 16:46:42 UTC (rev 2981)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceView.jaxx 2010-07-22 09:10:03 UTC (rev 2982)
@@ -38,8 +38,8 @@
getBeginDatePicker().setDate(beginDate);
getEndDatePicker().setDate(endDate);
- getModelBalanceTable().setBeginDate(beginDate);
- getModelBalanceTable().setEndDate(endDate);
+ getHandler().setBeginDate(beginDate);
+ getHandler().setEndDate(endDate);
void $afterCompleteSetup() {
getHandler().refresh();
@@ -54,24 +54,21 @@
</cell>
<cell anchor="west">
<org.jdesktop.swingx.JXDatePicker id="beginDatePicker"
- onActionPerformed="getModelBalanceTable().setBeginDate(beginDatePicker.getDate());
- getHandler().refresh()" />
+ onActionPerformed="getHandler().setBeginDate(beginDatePicker.getDate())"/>
</cell>
<cell anchor="east">
<JLabel id="endCalendarPanelLabel" text="lima.accountsreports.endcalendar"/>
</cell>
<cell anchor="west">
<org.jdesktop.swingx.JXDatePicker id="endDatePicker"
- onActionPerformed="getModelBalanceTable().setEndDate(endDatePicker.getDate());
- getHandler().refresh()"/>
+ onActionPerformed="getHandler().setEndDate(endDatePicker.getDate())"/>
</cell>
<cell anchor="east">
<JTextField id="accountFilter"/>
</cell>
<cell anchor="west">
<JButton text="lima.accountsreports.accountfilter"
- onActionPerformed="getModelBalanceTable().setAccountFilter(accountFilter.getText());
- getHandler().refresh()"/>
+ onActionPerformed="getHandler().setAccountFilter(accountFilter.getText())"/>
</cell>
</row>
<row>
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-21 16:46:42 UTC (rev 2981)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceViewHandler.java 2010-07-22 09:10:03 UTC (rev 2982)
@@ -19,52 +19,105 @@
package org.chorem.lima.ui.balance;
import static org.nuiton.i18n.I18n._;
+import java.util.Date;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.chorem.lima.beans.BalanceTrial;
-import org.chorem.lima.business.FinancialTransactionService;
import org.chorem.lima.business.FinancialTransactionServiceMonitorable;
+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.service.LimaServiceFactory;
+import org.chorem.lima.util.ErrorHelper;
/**
* Handler associated with accounts reports view.
- *
- * @author chatellier
- * @version $Revision: 2884 $
- *
- * Last update : $Date: 2010-05-06 11:57:19 +0200 (jeu. 06 mai 2010) $
* By : $Author: jpepin $
*/
-public class BalanceViewHandler {
+public class BalanceViewHandler implements ServiceListener {
protected BalanceView view;
- /** service **/
- protected FinancialTransactionService financialTransactionService;
+ /** log. */
+ private static final Log log = LogFactory.getLog(BalanceViewHandler.class);
+
+ /** Services. */
+ protected ReportServiceMonitorable reportService;
+
+ /** DatePicker Begin Date. */
+ protected Date selectedBeginDate;
+
+ /** DatePicker EndDate. */
+ protected Date selectedEndDate;
+
+ /** Text field Accounts */
+ protected String selectedAccounts;
protected BalanceTableModel model;
protected BalanceViewHandler(BalanceView view) {
this.view = view;
- financialTransactionService =
+
+ reportService =
LimaServiceFactory.getInstance().getService(
- FinancialTransactionServiceMonitorable.class);
+ ReportServiceMonitorable.class);
+ LimaServiceFactory.getInstance().getService(
+ ImportServiceMonitorable.class).addListener(this);
+ LimaServiceFactory.getInstance().getService(
+ FinancialTransactionServiceMonitorable.class).addListener(this);
}
+ public void setBeginDate(Date date){
+ selectedBeginDate = date;
+ refresh();
+ }
+
+ public void setEndDate(Date date){
+ selectedEndDate = date;
+ refresh();
+ }
+
+ public void setAccountFilter(String accounts) {
+ selectedAccounts = accounts;
+ refresh();
+ }
+
+ /**
+ * get all account fot the selected period
+ * @return
+ */
+ public BalanceTrial getDataList(){
+ BalanceTrial results = null;
+
+ try {
+ results = reportService.generateBalanceTrial(selectedBeginDate, selectedEndDate, selectedAccounts, false);
+ }
+ catch (LimaException eee) {
+ if (log.isErrorEnabled()) {
+ log.debug("Can't update model", eee);
+ }
+ ErrorHelper.showErrorDialog("Can't get entries list", eee);
+ }
+ return results;
+ }
+
public void refresh(){
model = view.getModelBalanceTable();
- model.refresh();
+ BalanceTrial datasList = getDataList();
+ model.refresh(datasList);
/**
* update the labels credit, debit, solde on the footer
* get all entries for all accounts on the selected period
*/
- BalanceTrial cacheDataList = model.cacheDataList;
- if (cacheDataList != null){
+ if (datasList != null){
// set amounts credit, debit and solde
- view.amountCreditLabel.setText(String.valueOf(cacheDataList.getAmountCredit()));
- view.amountDebitLabel.setText(String.valueOf(cacheDataList.getAmountDebit()));
- Double amountSolde = cacheDataList.getAmountSolde();
+ view.amountCreditLabel.setText(String.valueOf(datasList.getAmountCredit()));
+ view.amountDebitLabel.setText(String.valueOf(datasList.getAmountDebit()));
+ Double amountSolde = datasList.getAmountSolde();
view.amountSoldeLabel.setText(String.valueOf(amountSolde));
@@ -73,7 +126,7 @@
}
else {
// set label solde: credit or debit
- if (cacheDataList.getSoldeDebit()) {
+ if (datasList.getSoldeDebit()) {
view.soldeLabel.setText(_("lima.soldedebit"));
}
else {
@@ -83,4 +136,10 @@
}
}
+ @Override
+ public void notifyMethod(String serviceName, String methodeName) {
+ if (serviceName.contains("FinancialTransaction") || methodeName.contains("importAccount") || methodeName.contains("importAll")){
+ refresh();
+ }
+ }
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsTable.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsTable.java 2010-07-21 16:46:42 UTC (rev 2981)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsTable.java 2010-07-22 09:10:03 UTC (rev 2982)
@@ -29,16 +29,10 @@
import org.jdesktop.swingx.decorator.Highlighter;
-/**
- * Table des transaction qui ajoute des comportement (keys).
- *
- * @author ore
- * @author Rémi Chapelet
- */
public class EntryBooksReportsTable extends JXTable {
/** serialVersionUID. */
- private static final long serialVersionUID = 3133690382049594727L;
+ private static final long serialVersionUID = 1L;
protected EntryBooksReportsViewHandler handler;
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-07-21 16:46:42 UTC (rev 2981)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsTableModel.java 2010-07-22 09:10:03 UTC (rev 2982)
@@ -21,74 +21,34 @@
import static org.nuiton.i18n.I18n._;
import java.text.SimpleDateFormat;
-import java.util.Date;
import javax.swing.table.AbstractTableModel;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.beans.ReportsDatas;
-import org.chorem.lima.beans.ReportsDatasImpl;
-import org.chorem.lima.business.FinancialTransactionServiceMonitorable;
-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.entity.Entry;
-import org.chorem.lima.entity.EntryBook;
-import org.chorem.lima.service.LimaServiceFactory;
-import org.chorem.lima.util.ErrorHelper;
+
/**
* Entry book table model.
- *
- * @author ore
- * @author chatellier
- * @version $Revision: 2865 $
- *
- * Last update : $Date: 2010-04-19 15:19:30 +0200 (lun. 19 avril 2010) $
* By : $Author: jpepin $
*/
-public class EntryBooksReportsTableModel extends AbstractTableModel implements ServiceListener {
+public class EntryBooksReportsTableModel extends AbstractTableModel {
/** serialVersionUID. */
private static final long serialVersionUID = 1L;
/** log. */
private static final Log log = LogFactory.getLog(EntryBooksReportsTableModel.class);
-
- /** Services. */
- protected ReportServiceMonitorable reportService;
- /** Account. */
- protected EntryBook selectedEntryBook;
-
- /** Begin Date. */
- protected Date selectedBeginDate;
-
- /** EndDate. */
- protected Date selectedEndDate;
-
/** data cache */
protected ReportsDatas cacheDataList;
-
- /**
- * Constructor.
- */
- public EntryBooksReportsTableModel() {
- reportService =
- LimaServiceFactory.getInstance().getService(
- ReportServiceMonitorable.class);
- LimaServiceFactory.getInstance().getService(
- ImportServiceMonitorable.class).addListener(this);
- LimaServiceFactory.getInstance().getService(
- FinancialTransactionServiceMonitorable.class).addListener(this);
- }
@Override
public int getRowCount() {
int result = 0;
// just prevent too much result
- if (selectedEntryBook != null) {
+ if (cacheDataList.getListEntry() != null) {
result = cacheDataList.getListEntry().size();
}
@@ -129,7 +89,7 @@
@Override
public Object getValueAt(int row, int column) {
Object result = null;
- if(selectedEntryBook != null) {
+ if(cacheDataList.getListEntry() != null) {
Entry currentRow = cacheDataList.getListEntry().get(row);
SimpleDateFormat simpleDateFormat =
new SimpleDateFormat("dd MMMMM yyyy");
@@ -180,45 +140,10 @@
// Just read, no write
return false;
}
-
- public void setBeginDate(Date date){
- selectedBeginDate = date;
- }
- public void setEndDate(Date date){
- selectedEndDate = date;
- }
-
-
- public void setEntryBook(EntryBook entryBook) {
- selectedEntryBook = entryBook;
- }
-
- 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);
- }
- ErrorHelper.showErrorDialog("Can't get entries list", eee);
- }
- return results;
- }
-
- public void refresh(){
- cacheDataList = getDataList();
+ public void refresh(ReportsDatas datasList){
+ cacheDataList = datasList;
fireTableDataChanged();
}
-
- @Override
- public void notifyMethod(String serviceName, String methodeName) {
- if (serviceName.contains("FinancialTransaction") || methodeName.contains("importEntryBook") || methodeName.contains("importAll")){
- refresh();
- }
- }
}
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-07-21 16:46:42 UTC (rev 2981)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsView.jaxx 2010-07-22 09:10:03 UTC (rev 2982)
@@ -32,12 +32,12 @@
// set begindate to JAN 1 - 0:00.000 of this years
Date beginDate = calendarBegin.getTime();
beginDate = DateUtils.truncate(beginDate, Calendar.YEAR);
- getModelTable().setBeginDate(beginDate);
+ getHandler().setBeginDate(beginDate);
// get end date
Calendar calendarEnd = Calendar.getInstance();
Date endDate = calendarEnd.getTime();
- getModelTable().setEndDate(endDate);
+ getHandler().setEndDate(endDate);
getBeginDatePicker().setDate(beginDate);
getEndDatePicker().setDate(endDate);
@@ -54,16 +54,14 @@
</cell>
<cell anchor="west">
<org.jdesktop.swingx.JXDatePicker id="beginDatePicker"
- onActionPerformed="getModelTable().setBeginDate(beginDatePicker.getDate());
- getHandler().refresh()" />
+ onActionPerformed="getHandler().setBeginDate(beginDatePicker.getDate())" />
</cell>
<cell anchor="east">
<JLabel id="endCalendarPanelLabel" text="lima.accountsreports.endcalendar"/>
</cell>
<cell anchor="west">
<org.jdesktop.swingx.JXDatePicker id="endDatePicker"
- onActionPerformed="getModelTable().setEndDate(endDatePicker.getDate());
- getHandler().refresh()"/>
+ onActionPerformed="getHandler().setEndDate(endDatePicker.getDate())"/>
</cell>
<cell anchor="east">
<JLabel id="entryBookSelectorLabel" text="lima.entrybook"/>
@@ -72,8 +70,7 @@
<JComboBox id="entryBookComboBox"
model="{getModelEntryBook()}"
renderer="{new org.chorem.lima.ui.combobox.EntryBookRenderer()}"
- onActionPerformed="getModelTable().setEntryBook((EntryBook) entryBookComboBox.getSelectedItem());
- getHandler().refresh()"
+ onActionPerformed="getHandler().setEntryBook((EntryBook) entryBookComboBox.getSelectedItem())"
editable="false"
/>
</cell>
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-07-21 16:46:42 UTC (rev 2981)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsViewHandler.java 2010-07-22 09:10:03 UTC (rev 2982)
@@ -19,20 +19,29 @@
package org.chorem.lima.ui.entrybooksreports;
import static org.nuiton.i18n.I18n._;
+
+import java.util.Date;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.chorem.lima.beans.ReportsDatas;
+import org.chorem.lima.beans.ReportsDatasImpl;
+import org.chorem.lima.business.FinancialTransactionServiceMonitorable;
+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.entity.EntryBook;
+import org.chorem.lima.service.LimaServiceFactory;
import org.chorem.lima.ui.combobox.EntryBookComboBoxModel;
+import org.chorem.lima.util.ErrorHelper;
/**
* Handler associated with accounts reports view.
- *
- * @author chatellier
- * @version $Revision: 2884 $
- *
- * Last update : $Date: 2010-05-06 11:57:19 +0200 (jeu. 06 mai 2010) $
* By : $Author: jpepin $
*/
-public class EntryBooksReportsViewHandler {
+public class EntryBooksReportsViewHandler implements ServiceListener {
protected EntryBooksReportsView view;
@@ -41,28 +50,81 @@
protected EntryBooksReportsTableModel tableModel;
protected EntryBookComboBoxModel comboBoxModel;
+
+ /** log. */
+ private static final Log log = LogFactory.getLog(EntryBooksReportsViewHandler.class);
+
+ /** Services. */
+ protected ReportServiceMonitorable reportService;
+
+ /** Account. */
+ protected EntryBook selectedEntryBook;
+
+ /** Begin Date. */
+ protected Date selectedBeginDate;
+
+ /** EndDate. */
+ protected Date selectedEndDate;
protected EntryBooksReportsViewHandler(EntryBooksReportsView view) {
this.view = view;
+
+ reportService =
+ LimaServiceFactory.getInstance().getService(
+ ReportServiceMonitorable.class);
+ LimaServiceFactory.getInstance().getService(
+ ImportServiceMonitorable.class).addListener(this);
+ LimaServiceFactory.getInstance().getService(
+ FinancialTransactionServiceMonitorable.class).addListener(this);
}
+ public void setBeginDate(Date date){
+ selectedBeginDate = date;
+ refresh();
+ }
+
+ public void setEndDate(Date date){
+ selectedEndDate = date;
+ refresh();
+ }
+
+
+ public void setEntryBook(EntryBook entryBook) {
+ selectedEntryBook = entryBook;
+ refresh();
+ }
+
+ 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);
+ }
+ ErrorHelper.showErrorDialog("Can't get entries list", eee);
+ }
+ return results;
+ }
+
public void refresh(){
tableModel = view.getModelTable();
- tableModel.refresh();
- // comboBoxModel = view.getModelEntryBook();
- // comboBoxModel.refresh();
+ ReportsDatas datasList = getDataList();
+ tableModel.refresh(datasList);
+
/**
* set text and amounts of labels credit, debit, solde
*/
- ReportsDatas cacheDataList = tableModel.cacheDataList;
- if (cacheDataList != null){
+ if (datasList != null){
// set amounts credit, debit and solde
- view.amountCreditLabel.setText(String.valueOf(cacheDataList.getAmountCredit()));
- view.amountDebitLabel.setText(String.valueOf(cacheDataList.getAmountDebit()));
- Double amountSolde = cacheDataList.getAmountSolde();
+ view.amountCreditLabel.setText(String.valueOf(datasList.getAmountCredit()));
+ view.amountDebitLabel.setText(String.valueOf(datasList.getAmountDebit()));
+ Double amountSolde = datasList.getAmountSolde();
view.amountSoldeLabel.setText(String.valueOf(amountSolde));
@@ -71,7 +133,7 @@
}
else {
// set label solde: credit or debit
- if (cacheDataList.getSoldeDebit()) {
+ if (datasList.getSoldeDebit()) {
view.soldeLabel.setText(_("lima.soldedebit"));
}
else {
@@ -81,4 +143,11 @@
}
}
+ @Override
+ public void notifyMethod(String serviceName, String methodeName) {
+ if (serviceName.contains("FinancialTransaction") || methodeName.contains("importEntryBook") || methodeName.contains("importAll")){
+ refresh();
+ }
+ }
+
}
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-07-21 16:46:42 UTC (rev 2981)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportView.jaxx 2010-07-22 09:10:03 UTC (rev 2982)
@@ -80,24 +80,4 @@
</JScrollPane>
</cell>
</row>
- <row fill="horizontal" anchor="center">
- <cell>
- <JLabel text="lima.amountdebit" />
- </cell>
- <cell>
- <JLabel id="amountDebitLabel" />
- </cell>
- <cell>
- <JLabel text="lima.amountcredit"/>
- </cell>
- <cell>
- <JLabel id="amountCreditLabel" />
- </cell>
- <cell>
- <JLabel id="soldeLabel" text="lima.solde"/>
- </cell>
- <cell>
- <JLabel id="amountSoldeLabel"/>
- </cell>
- </row>
</Table>
\ No newline at end of file
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-07-21 16:46:42 UTC (rev 2981)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportViewHandler.java 2010-07-22 09:10:03 UTC (rev 2982)
@@ -42,34 +42,6 @@
public void refresh(){
model = view.getModelTable();
model.refresh();
-
- /**
- * update the labels credit, debit, solde on the footer
- * get all entries for all accounts on the selected period
- *
- BalanceTrial cacheDataList = model.cacheDataList;
-
- if (cacheDataList != null){
- // set amounts credit, debit and solde
- view.amountCreditLabel.setText(String.valueOf(cacheDataList.getAmountCredit()));
- view.amountDebitLabel.setText(String.valueOf(cacheDataList.getAmountDebit()));
- Double amountSolde = cacheDataList.getAmountSolde();
- view.amountSoldeLabel.setText(String.valueOf(amountSolde));
-
-
- if (amountSolde == 0){
- view.soldeLabel.setText(_("lima.solde"));
- }
- else {
- // set label solde: credit or debit
- if (cacheDataList.getSoldeDebit()) {
- view.soldeLabel.setText(_("lima.soldedebit"));
- }
- else {
- view.soldeLabel.setText(_("lima.soldecredit"));
- }
- }
- }*/
}
public FinancialStatementReportView getView() {
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java 2010-07-21 16:46:42 UTC (rev 2981)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java 2010-07-22 09:10:03 UTC (rev 2982)
@@ -177,7 +177,6 @@
}
}.execute();
waitView.setVisible(true);
- //TODO refresh the view
}
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-07-21 16:46:42 UTC (rev 2981)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerTableModel.java 2010-07-22 09:10:03 UTC (rev 2982)
@@ -21,25 +21,12 @@
import static org.nuiton.i18n.I18n._;
import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Collections;
-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.beans.BalanceTrial;
import org.chorem.lima.beans.ReportsDatas;
-import org.chorem.lima.business.FinancialTransactionServiceMonitorable;
-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.EntryComparator;
import org.chorem.lima.entity.Entry;
-import org.chorem.lima.entity.EntryBook;
-import org.chorem.lima.service.LimaServiceFactory;
-import org.chorem.lima.util.ErrorHelper;
/**
* Entry book table model.
@@ -51,43 +38,16 @@
* Last update : $Date: 2010-04-19 15:19:30 +0200 (lun. 19 avril 2010) $
* By : $Author: jpepin $
*/
-public class LedgerTableModel extends AbstractTableModel implements ServiceListener {
+public class LedgerTableModel extends AbstractTableModel {
/** serialVersionUID. */
- private static final long serialVersionUID = 7578692417919755647L;
+ private static final long serialVersionUID = 1L;
/** log. */
private static final Log log = LogFactory.getLog(LedgerTableModel.class);
-
- /** Services. */
- protected ReportServiceMonitorable reportService;
- /** Account. */
- protected EntryBook selectedEntryBook;
-
- /** Begin Date. */
- protected Date selectedBeginDate;
-
- /** EndDate. */
- protected Date selectedEndDate;
-
/** data cache */
protected List<Object> cacheDataList;
- protected BalanceTrial balanceTrialCache;
-
- /**
- * Constructor.
- */
- public LedgerTableModel() {
- reportService =
- LimaServiceFactory.getInstance().getService(
- ReportServiceMonitorable.class);
- reportService.addListener(this);
- LimaServiceFactory.getInstance().getService(
- ImportServiceMonitorable.class).addListener(this);
- LimaServiceFactory.getInstance().getService(
- FinancialTransactionServiceMonitorable.class).addListener(this);
- }
@Override
public int getRowCount() {
@@ -225,7 +185,6 @@
}
}
-
return result;
}
@@ -235,52 +194,11 @@
// Just read, no write
return false;
}
-
- public void setBeginDate(Date date){
- selectedBeginDate = date;
- }
- public void setEndDate(Date date){
- selectedEndDate = date;
- }
- /**
- * get all account fot the selected period
- * @return
- */
- public List<Object> getDataList(){
- List<Object> results = new ArrayList<Object>();
-
- try {
- balanceTrialCache = reportService.generateLedger(selectedBeginDate, selectedEndDate);
- }
- catch (LimaException eee) {
- if (log.isErrorEnabled()) {
- log.debug("Can't update model", eee);
- }
- ErrorHelper.showErrorDialog("Can't get entries list", eee);
- }
- for (ReportsDatas reportsDatas : balanceTrialCache.getReportsDatas()) {
- results.add(reportsDatas);
- List<Entry> entries = (List<Entry>) reportsDatas.getListEntry();
- if (entries != null){
- Collections.sort(entries, new EntryComparator());
- results.addAll(entries);
- }
- }
- return results;
- }
-
- public void refresh(){
- cacheDataList = getDataList();
+ public void refresh(List<Object> datasList){
+ cacheDataList = datasList;
fireTableDataChanged();
}
- @Override
- public void notifyMethod(String serviceName, String methodeName) {
- if (serviceName.contains("FinancialTransaction") || methodeName.contains("importAccount") || methodeName.contains("importAll")){
- refresh();
- }
- }
-
}
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-21 16:46:42 UTC (rev 2981)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerView.jaxx 2010-07-22 09:10:03 UTC (rev 2982)
@@ -31,12 +31,12 @@
// set begindate to JAN 1 - 0:00.000 of this years
Date beginDate = calendarBegin.getTime();
beginDate = DateUtils.truncate(beginDate, Calendar.YEAR);
- getModelTable().setBeginDate(beginDate);
+ getHandler().setBeginDate(beginDate);
// get end date
Calendar calendarEnd = Calendar.getInstance();
Date endDate = calendarEnd.getTime();
- getModelTable().setEndDate(endDate);
+ getHandler().setEndDate(endDate);
getBeginDatePicker().setDate(beginDate);
getEndDatePicker().setDate(endDate);
@@ -53,16 +53,14 @@
</cell>
<cell anchor="west">
<org.jdesktop.swingx.JXDatePicker id="beginDatePicker"
- onActionPerformed="getModelTable().setBeginDate(beginDatePicker.getDate());
- getHandler().refresh()" />
+ onActionPerformed="getHandler().setBeginDate(beginDatePicker.getDate())" />
</cell>
<cell anchor="east">
<JLabel id="endCalendarPanelLabel" text="lima.accountsreports.endcalendar"/>
</cell>
<cell anchor="west">
<org.jdesktop.swingx.JXDatePicker id="endDatePicker"
- onActionPerformed="getModelTable().setEndDate(endDatePicker.getDate());
- getHandler().refresh()"/>
+ onActionPerformed="getHandler().setEndDate(endDatePicker.getDate())"/>
</cell>
</row>
<row>
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-21 16:46:42 UTC (rev 2981)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerViewHandler.java 2010-07-22 09:10:03 UTC (rev 2982)
@@ -19,44 +19,120 @@
package org.chorem.lima.ui.ledger;
import static org.nuiton.i18n.I18n._;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Date;
+import java.util.List;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.chorem.lima.beans.BalanceTrial;
+import org.chorem.lima.beans.ReportsDatas;
+import org.chorem.lima.business.FinancialTransactionServiceMonitorable;
+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.EntryComparator;
+import org.chorem.lima.entity.Entry;
+import org.chorem.lima.entity.EntryBook;
+import org.chorem.lima.service.LimaServiceFactory;
+import org.chorem.lima.util.ErrorHelper;
/**
* Handler associated with accounts reports view.
- *
- * @author chatellier
- * @version $Revision: 2884 $
- *
- * Last update : $Date: 2010-05-06 11:57:19 +0200 (jeu. 06 mai 2010) $
* By : $Author: jpepin $
*/
-public class LedgerViewHandler {
+public class LedgerViewHandler implements ServiceListener {
protected LedgerView view;
protected LedgerTableModel model;
+
+ /** log. */
+ private static final Log log = LogFactory.getLog(LedgerTableModel.class);
+
+ /** Services. */
+ protected ReportServiceMonitorable reportService;
+
+ /** Account. */
+ protected EntryBook selectedEntryBook;
+
+ /** Begin Date. */
+ protected Date selectedBeginDate;
+
+ /** EndDate. */
+ protected Date selectedEndDate;
+
+ protected BalanceTrial balanceTrialCache;
protected LedgerViewHandler(LedgerView view) {
this.view = view;
+
+ reportService =
+ LimaServiceFactory.getInstance().getService(
+ ReportServiceMonitorable.class);
+ reportService.addListener(this);
+ LimaServiceFactory.getInstance().getService(
+ ImportServiceMonitorable.class).addListener(this);
+ LimaServiceFactory.getInstance().getService(
+ FinancialTransactionServiceMonitorable.class).addListener(this);
}
+ public void setBeginDate(Date date){
+ selectedBeginDate = date;
+ }
+
+ public void setEndDate(Date date){
+ selectedEndDate = date;
+ }
+
+ /**
+ * get all account fot the selected period
+ * @return
+ */
+ public List<Object> getDataList(){
+ List<Object> results = new ArrayList<Object>();
+ try {
+ balanceTrialCache = reportService.generateLedger(selectedBeginDate, selectedEndDate);
+ if (balanceTrialCache.getReportsDatas() != null){
+ for (ReportsDatas reportsDatas : balanceTrialCache.getReportsDatas()) {
+ results.add(reportsDatas);
+ List<Entry> entries = (List<Entry>) reportsDatas.getListEntry();
+ if (entries != null){
+ 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 entries list", eee);
+ }
+ return results;
+ }
+
public void refresh(){
model = view.getModelTable();
- model.refresh();
+ List<Object> datasList = getDataList();
+ model.refresh(datasList);
/**
* set text and amounts of labels credit, debit, solde
*/
- BalanceTrial cacheDataList = model.balanceTrialCache;
- if (cacheDataList != null){
+ if (balanceTrialCache != null){
// set amounts credit, debit and solde
view.amountCreditLabel.setText(
- String.valueOf(cacheDataList.getAmountCredit()));
+ String.valueOf(balanceTrialCache.getAmountCredit()));
view.amountDebitLabel.setText(
- String.valueOf(cacheDataList.getAmountDebit()));
- Double amountSolde = cacheDataList.getAmountSolde();
+ String.valueOf(balanceTrialCache.getAmountDebit()));
+ Double amountSolde = balanceTrialCache.getAmountSolde();
view.amountSoldeLabel.setText(
String.valueOf(amountSolde));
@@ -65,7 +141,7 @@
}
else {
// set label solde: credit or debit
- if (cacheDataList.getSoldeDebit()) {
+ if (balanceTrialCache.getSoldeDebit()) {
view.soldeLabel.setText(_("lima.soldedebit"));
}
else {
@@ -75,4 +151,11 @@
}
}
+ @Override
+ public void notifyMethod(String serviceName, String methodeName) {
+ if (serviceName.contains("FinancialTransaction") || methodeName.contains("importAccount") || methodeName.contains("importAll")){
+ refresh();
+ }
+ }
+
}
1
0
r2981 - in trunk/lima-swing/src/main/java/org/chorem/lima: service ui ui/accountsreports ui/combobox ui/entrybooksreports ui/financialstatementreport ui/financialtransaction ui/financialtransactionunbalanced ui/home ui/importexport ui/ledger
by jpepin@users.chorem.org 21 Jul '10
by jpepin@users.chorem.org 21 Jul '10
21 Jul '10
Author: jpepin
Date: 2010-07-21 18:46:42 +0200 (Wed, 21 Jul 2010)
New Revision: 2981
Url: http://chorem.org/repositories/revision/lima/2981
Log:
Refactor page d'accueil, ajout de listeners pour le rafraichissement.
Added:
trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/AccountsPane.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/EntryBooksPane.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/FinancialTransactionsPane.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/FiscalPeriodsPane.java
Removed:
trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/HomeViewHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/HomeViewListener.java
Modified:
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/java/org/chorem/lima/ui/accountsreports/AccountsReportsTableModel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/AccountComboBoxModel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/EntryBookComboBoxModel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsTableModel.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/home/HomeView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerTableModel.java
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-07-21 15:04:34 UTC (rev 2980)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/service/ServiceMonitorableHandler.java 2010-07-21 16:46:42 UTC (rev 2981)
@@ -51,7 +51,6 @@
Object result = null;
if (method.getName().equals("addListener")){
addServiceListener((ServiceListener) args[0]);
- log.debug("addListener");
}
else if (method.getName().equals("removeListener")){
removeServiceListener((ServiceListener) args[0]);
@@ -59,7 +58,6 @@
else {
result = method.invoke(service, args);
if (!method.getName().startsWith("get")){
- log.debug(service.toString()+" "+method.getName());
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-07-21 15:04:34 UTC (rev 2980)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainView.jaxx 2010-07-21 16:46:42 UTC (rev 2981)
@@ -14,6 +14,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
##% -->
+
<JFrame title="lima.title" onWindowClosing="getHandler().close(this)"
defaultCloseOperation="do_nothing_on_close"
undecorated='{getConfig().isFullScreen()}'
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-07-21 15:04:34 UTC (rev 2980)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainViewHandler.java 2010-07-21 16:46:42 UTC (rev 2981)
@@ -44,7 +44,6 @@
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.home.HomeViewListener;
import org.chorem.lima.ui.importexport.ImportExport;
import org.chorem.lima.ui.importexport.ImportExportEnum;
import org.chorem.lima.ui.ledger.LedgerView;
@@ -280,7 +279,6 @@
public void showHomeView(JAXXContext rootContext) {
MainView mainView = getUI(rootContext);
HomeView homeView = new HomeView(mainView);
- homeView.addComponentListener(new HomeViewListener(homeView));
mainView.showTab(_("lima.tab.home"), homeView, false);
}
/**
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-07-21 15:04:34 UTC (rev 2980)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsTableModel.java 2010-07-21 16:46:42 UTC (rev 2981)
@@ -93,11 +93,6 @@
result = cacheDataList.getListEntry().size();
}
}
- else {
- if (log.isDebugEnabled()) {
- log.debug("No account selected skip table model update");
- }
- }
return result;
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/AccountComboBoxModel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/AccountComboBoxModel.java 2010-07-21 15:04:34 UTC (rev 2980)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/AccountComboBoxModel.java 2010-07-21 16:46:42 UTC (rev 2981)
@@ -101,7 +101,7 @@
@Override
public void notifyMethod(String serviceName, String methodeName) {
- if (serviceName.contains("Account") || methodeName.contains("importAll")){
+ 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-07-21 15:04:34 UTC (rev 2980)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/EntryBookComboBoxModel.java 2010-07-21 16:46:42 UTC (rev 2981)
@@ -105,7 +105,7 @@
@Override
public void notifyMethod(String serviceName, String methodeName) {
- if (serviceName.contains("EntryBook") || methodeName.contains("importAll")){
+ if (methodeName.contains("EntryBook") || methodeName.contains("importAll")){
refresh();
}
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsTableModel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsTableModel.java 2010-07-21 15:04:34 UTC (rev 2980)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsTableModel.java 2010-07-21 16:46:42 UTC (rev 2981)
@@ -91,11 +91,6 @@
if (selectedEntryBook != null) {
result = cacheDataList.getListEntry().size();
}
- else {
- if (log.isDebugEnabled()) {
- log.debug("No account selected skip table model update");
- }
- }
return result;
}
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-07-21 15:04:34 UTC (rev 2980)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportTableModel.java 2010-07-21 16:46:42 UTC (rev 2981)
@@ -197,7 +197,6 @@
}
ErrorHelper.showErrorDialog("Can't get entries list", eee);
}
- log.debug(results);
return results;
}
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-21 15:04:34 UTC (rev 2980)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTableModel.java 2010-07-21 16:46:42 UTC (rev 2981)
@@ -215,14 +215,8 @@
int result = 0;
if (cacheDataList != null) {
- //cacheDataList = getDataList();
result = cacheDataList.size();
}
- else {
- if (log.isDebugEnabled()) {
- log.debug("No fiscalPeriod selected skip table model update");
- }
- }
return result;
}
@@ -314,12 +308,6 @@
}
}
- else {
- if (log.isDebugEnabled()) {
- log.debug("No fiscalPeriod selected skip table model update");
- }
- }
-
return result;
}
@@ -482,11 +470,6 @@
cacheDataList = getDataList();
fireTableRowsUpdated(financialTransactionRow, getRowCount()-1);
}
- else {
- if (log.isDebugEnabled()) {
- log.debug("No fiscalPeriod selected skip table model update");
- }
- }
}
public Object getElementAt(int row){
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedTableModel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedTableModel.java 2010-07-21 15:04:34 UTC (rev 2980)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedTableModel.java 2010-07-21 16:46:42 UTC (rev 2981)
@@ -210,11 +210,6 @@
if (cacheDataList != null) {
result = cacheDataList.size();
}
- else {
- if (log.isDebugEnabled()) {
- log.debug("No fiscalPeriod selected skip table model update");
- }
- }
return result;
}
@@ -306,11 +301,6 @@
}
}
- else {
- if (log.isDebugEnabled()) {
- log.debug("No fiscalPeriod selected skip table model update");
- }
- }
return result;
}
@@ -438,11 +428,6 @@
//TODO PEPIN 20100607 Get financial transaction of cachedatelist on replace it
fireTableRowsUpdated(financialTransactionRow, getRowCount()-1);
}
- else {
- if (log.isDebugEnabled()) {
- log.debug("No fiscalPeriod selected skip table model update");
- }
- }
}
public Object getElementAt(int row){
Added: 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 (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/AccountsPane.java 2010-07-21 16:46:42 UTC (rev 2981)
@@ -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.home;
+
+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 AccountsPane extends JEditorPane implements HyperlinkListener, ServiceListener {
+
+ private static final long serialVersionUID = 1L;
+
+ private static final Log log = LogFactory.getLog(AccountsPane.class);
+
+ protected HomeView view;
+
+ protected AccountServiceMonitorable accountService;
+
+ private static Color redBackground = new Color(0xff, 0xee, 0xee);
+ private static Color greenBackground = new Color(0xee, 0xff, 0xee);
+
+
+
+ public AccountsPane(HomeView view) {
+ this.view=view;
+ accountService =
+ LimaServiceFactory.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/home/EntryBooksPane.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/EntryBooksPane.java (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/EntryBooksPane.java 2010-07-21 16:46:42 UTC (rev 2981)
@@ -0,0 +1,138 @@
+/* *##% 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.home;
+
+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.EntryBookServiceMonitorable;
+import org.chorem.lima.business.ImportServiceMonitorable;
+import org.chorem.lima.business.LimaException;
+import org.chorem.lima.business.ServiceListener;
+import org.chorem.lima.entity.EntryBook;
+import org.chorem.lima.service.LimaServiceFactory;
+import org.chorem.lima.ui.MainView;
+
+public class EntryBooksPane extends JEditorPane implements HyperlinkListener, ServiceListener {
+
+ private static final long serialVersionUID = 1L;
+
+ private static final Log log = LogFactory.getLog(EntryBooksPane.class);
+
+ protected HomeView view;
+
+ protected EntryBookServiceMonitorable entryBookService;
+
+ private static Color redBackground = new Color(0xff, 0xee, 0xee);
+ private static Color greenBackground = new Color(0xee, 0xff, 0xee);
+
+ public EntryBooksPane(HomeView view) {
+ this.view=view;
+
+ entryBookService =
+ LimaServiceFactory.getInstance().getService(
+ EntryBookServiceMonitorable.class);
+ entryBookService.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("#entrybookschart")) {
+ MainView ui = LimaContext.MAIN_UI_ENTRY_DEF.getContextValue(view);
+ ui.getHandler().showEntryBookView(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<EntryBook> entryBooks = entryBookService.getAllEntryBooks();
+ int ebSize = entryBooks.size();
+ if (ebSize>0){
+ setBackground(greenBackground);
+ String entryBooksString="";
+ if (ebSize == 1){
+ entryBooksString = _("limahome.entrybooks.state.single")
+ + "<br/>" + entryBooks.get(0)
+ + "<br/><br/><a href='#entrybookschart'>"
+ + _("limahome.entrybooks.modify") + "</a>";
+
+ }
+ else {
+ entryBooksString = _("limahome.entrybooks.state1_2.plural")
+ + " " + entryBooks.size() + " "
+ + _("limahome.entrybooks.state2_2.plural") + "<ul>";
+ for (EntryBook entryBook : entryBooks) {
+ entryBooksString += "<li>"+entryBook.getCode() +
+ " - "+entryBook.getLabel()+"</li>";
+ }
+ entryBooksString += "</ul></p><p horizontal-align:'center'>"
+ + "<a href='#entrybookschart'>"
+ + _("limahome.entrybooks.modify") + "</a>";
+ }
+ //set Text
+ setText(htmlBegin + entryBooksString + htmlEnd);
+ }
+ else {
+ setBackground(redBackground);
+ //set Text
+ setText(htmlBegin
+ + _("limahome.entrybooks.nothing")
+ + "<br/><br/><a href='#entrybookschart'>"
+ + _("limahome.entrybooks.create") +"</a>" + 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("EntryBook") || methodeName.contains("importAll")){
+ refresh();
+ }
+ }
+}
Added: 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 (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/FinancialTransactionsPane.java 2010-07-21 16:46:42 UTC (rev 2981)
@@ -0,0 +1,139 @@
+/* *##% 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.home;
+
+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.FinancialTransactionServiceMonitorable;
+import org.chorem.lima.business.FiscalPeriodServiceMonitorable;
+import org.chorem.lima.business.ImportServiceMonitorable;
+import org.chorem.lima.business.LimaException;
+import org.chorem.lima.business.ServiceListener;
+import org.chorem.lima.entity.FinancialTransaction;
+import org.chorem.lima.entity.FiscalPeriod;
+import org.chorem.lima.service.LimaServiceFactory;
+import org.chorem.lima.ui.MainView;
+
+public class FinancialTransactionsPane extends JEditorPane implements HyperlinkListener, ServiceListener {
+
+ private static final long serialVersionUID = 1L;
+
+ private static final Log log = LogFactory.getLog(FinancialTransactionsPane.class);
+
+ protected HomeView view;
+
+ protected FinancialTransactionServiceMonitorable financialTransactionService;
+ protected FiscalPeriodServiceMonitorable fiscalPeriodService;
+
+ private static Color redBackground = new Color(0xff, 0xee, 0xee);
+ private static Color greenBackground = new Color(0xee, 0xff, 0xee);
+
+ public FinancialTransactionsPane(HomeView view) {
+ this.view = view;
+
+ financialTransactionService =
+ LimaServiceFactory.getInstance().getService(FinancialTransactionServiceMonitorable.class);
+ financialTransactionService.addListener(this);
+ fiscalPeriodService =
+ LimaServiceFactory.getInstance().getService(FiscalPeriodServiceMonitorable.class);
+ fiscalPeriodService.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("#financialtransactionunbalanced")) {
+ MainView ui = LimaContext.MAIN_UI_ENTRY_DEF.getContextValue(view);
+ ui.getHandler().showTransactionUnbalancedView(ui);
+ }
+ else if (e.getDescription().equals("#financialtransactionbalanced")) {
+ MainView ui = LimaContext.MAIN_UI_ENTRY_DEF.getContextValue(view);
+ ui.getHandler().showTransactionView(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<FiscalPeriod> unblockedFiscalPeriods =
+ fiscalPeriodService.getAllUnblockedFiscalPeriods();
+ if (unblockedFiscalPeriods.size() != 0){
+ List<FinancialTransaction> financialTransactions =
+ financialTransactionService.
+ getAllFinancialTransactionsUnbalanced(unblockedFiscalPeriods.get(0));
+ if (financialTransactions.size()>0){
+ setBackground(redBackground);
+ String transactionsString = financialTransactions.size()
+ + " " + _("limahome.transaction.unbalanced")
+ + "<br/><br/><a href='#financialtransactionunbalanced'>"
+ + _("limahome.transaction.modifiy") + "</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);
+ }
+ }
+ else {
+ setBackground(redBackground);
+ }
+
+ } 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("FiscalPeriod") || methodeName.contains("FinancialTransaction") || methodeName.contains("importAll")){
+ refresh();
+ }
+ }
+
+}
Added: trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/FiscalPeriodsPane.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/FiscalPeriodsPane.java (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/FiscalPeriodsPane.java 2010-07-21 16:46:42 UTC (rev 2981)
@@ -0,0 +1,131 @@
+/* *##% 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.home;
+
+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.FiscalPeriodServiceMonitorable;
+import org.chorem.lima.business.ImportServiceMonitorable;
+import org.chorem.lima.business.LimaException;
+import org.chorem.lima.business.ServiceListener;
+import org.chorem.lima.entity.FiscalPeriod;
+import org.chorem.lima.service.LimaServiceFactory;
+import org.chorem.lima.ui.MainView;
+
+public class FiscalPeriodsPane extends JEditorPane implements HyperlinkListener, ServiceListener {
+
+ private static final long serialVersionUID = 1L;
+
+ private static final Log log = LogFactory.getLog(FiscalPeriodsPane.class);
+
+ protected HomeView view;
+
+ protected FiscalPeriodServiceMonitorable fiscalPeriodService;
+
+ private static Color redBackground = new Color(0xff, 0xee, 0xee);
+ private static Color greenBackground = new Color(0xee, 0xff, 0xee);
+
+ public FiscalPeriodsPane(HomeView view) {
+ this.view = view;
+
+ fiscalPeriodService =
+ LimaServiceFactory.getInstance().getService(FiscalPeriodServiceMonitorable.class);
+ fiscalPeriodService.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("#fiscalperiodschart")) {
+ MainView ui = LimaContext.MAIN_UI_ENTRY_DEF.getContextValue(view);
+ ui.getHandler().showFiscalPeriodView(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 {
+
+ //FISCAL PERIOD
+ List<FiscalPeriod> fiscalPeriods =
+ fiscalPeriodService.getAllFiscalPeriods();
+ List<FiscalPeriod> unblockedFiscalPeriods =
+ fiscalPeriodService.getAllUnblockedFiscalPeriods();
+ if (unblockedFiscalPeriods.size()>0){
+ setBackground(greenBackground);
+ String fiscalString = unblockedFiscalPeriods.size() + " "
+ + _("limahome.fiscalperiod.opened") + "<br/>"
+ + (fiscalPeriods.size()-unblockedFiscalPeriods.size())
+ + " " + _("limahome.fiscalperiod.closed")
+ + "<br/><br/><a href='#fiscalperiodschart'>"
+ + _("limahome.fiscalperiod.modify") + "</a>";
+ //set Text
+ setText(htmlBegin + fiscalString + htmlEnd);
+
+
+ }
+ else {
+ setBackground(redBackground);
+ String fiscalString = _("limahome.fiscalperiod.noopen");
+ if (fiscalPeriods.size()>0){
+ fiscalString += "<br/>" + fiscalPeriods.size() + " "
+ + _("limahome.fiscalperiod.closed");
+ }
+ fiscalString += "<br/><br/><a href='#fiscalperiodschart'>"
+ + _("limahome.fiscalperiod.create") + "</a>";
+ //set Text
+ setText(htmlBegin + fiscalString + htmlEnd);
+
+ }
+ } catch (LimaException eee) {
+ log.debug("Can't get datas home", eee);
+ }
+ }
+
+ @Override
+ public void notifyMethod(String serviceName, String methodeName) {
+ if (methodeName.contains("FiscalPeriod") || methodeName.contains("importAll")){
+ refresh();
+ }
+ }
+
+}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/HomeView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/HomeView.jaxx 2010-07-21 15:04:34 UTC (rev 2980)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/HomeView.jaxx 2010-07-21 16:46:42 UTC (rev 2981)
@@ -1,8 +1,23 @@
+<!-- ##% 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>
- <HomeViewHandler id="handler" javaBean='new HomeViewHandler(this)' />
<Dimension id="fixedSize" javaBean='new Dimension(500,200)' />
<Dimension id="miniSize" javaBean='new Dimension(300,150)' />
- <Color id="green" javaBean='new Color(0xee, 0xff, 0xee)'/>
@@ -12,18 +27,16 @@
import java.awt.Color;
import java.awt.Font;
- void $afterCompleteSetup() {
- getHandler().refresh();
- }
]]>
</script>
<row>
<cell anchor="southeast">
- <JPanel id="limaHomeChartAccount"
+ <JPanel
+ id = 'accountPanel'
border='{BorderFactory.createEtchedBorder(EtchedBorder.LOWERED)}'
minimumSize='{getMiniSize()}'
preferredSize='{getFixedSize()}'
- layout='{new BoxLayout(limaHomeChartAccount,BoxLayout.X_AXIS)}'>
+ layout='{new BoxLayout(accountPanel, BoxLayout.X_AXIS)}'>
<Table>
<row>
<cell weightx="0" weighty="0.1" anchor="northwest"><JLabel icon='{new ImageIcon(getClass().getResource("/images/accounts.png"))}'/></cell>
@@ -31,19 +44,19 @@
</row>
<row fill="both">
<cell columns="2" weightx="1" weighty="0.9">
- <JEditorPane id="textHomeAccount"
- opaque="true" contentType="text/html" editable="false" UI="{new javax.swing.plaf.basic.BasicEditorPaneUI()}" background="{getGreen()}"/>
+ <JEditorPane javaBean='new org.chorem.lima.ui.home.AccountsPane(this)' />
</cell>
</row>
</Table>
</JPanel>
</cell>
<cell anchor="southwest">
- <JPanel id="limaHomeEntryBook"
+ <JPanel
+ id = 'entryBookPanel'
border='{BorderFactory.createEtchedBorder(EtchedBorder.LOWERED)}'
minimumSize='{getMiniSize()}'
preferredSize='{getFixedSize()}'
- layout='{new BoxLayout(limaHomeEntryBook,BoxLayout.X_AXIS)}'>
+ layout='{new BoxLayout(entryBookPanel, BoxLayout.X_AXIS)}'>
<Table>
<row>
<cell weightx="0" weighty="0.1" anchor="northwest"><JLabel icon='{new ImageIcon(getClass().getResource("/images/entrybooks.png"))}'/></cell>
@@ -51,8 +64,7 @@
</row>
<row fill="both">
<cell columns="2" weightx="1" weighty="0.9">
- <JEditorPane id="textHomeEntryBook"
- opaque="true" contentType="text/html" editable="false" UI="{new javax.swing.plaf.basic.BasicEditorPaneUI()}" background="{getGreen()}"/>
+ <JEditorPane javaBean='new org.chorem.lima.ui.home.EntryBooksPane(this)' />
</cell>
</row>
</Table>
@@ -61,11 +73,12 @@
</row>
<row>
<cell anchor="northeast">
- <JPanel id="limaHomeFiscalYear"
+ <JPanel
+ id = 'fiscalPeriodPanel'
border='{BorderFactory.createEtchedBorder(EtchedBorder.LOWERED)}'
minimumSize='{getMiniSize()}'
preferredSize='{getFixedSize()}'
- layout='{new BoxLayout(limaHomeFiscalYear,BoxLayout.X_AXIS)}'>
+ layout='{new BoxLayout(fiscalPeriodPanel, BoxLayout.X_AXIS)}'>
<Table>
<row>
<cell weightx="0" weighty="0.1" anchor="northwest"><JLabel icon='{new ImageIcon(getClass().getResource("/images/fiscalperiods.png"))}'/></cell>
@@ -73,19 +86,19 @@
</row>
<row fill="both">
<cell columns="2" weightx="1" weighty="0.9">
- <JEditorPane id="textHomeFiscalYear"
- opaque="true" contentType="text/html" editable="false" UI="{new javax.swing.plaf.basic.BasicEditorPaneUI()}" background="{getGreen()}"/>
+ <JEditorPane javaBean='new org.chorem.lima.ui.home.FiscalPeriodsPane(this)' />
</cell>
</row>
</Table>
</JPanel>
</cell>
<cell anchor="northwest">
- <JPanel id="limaHomeDaily"
+ <JPanel
+ id = 'financialTransactionPanel'
border='{BorderFactory.createEtchedBorder(EtchedBorder.LOWERED)}'
minimumSize='{getMiniSize()}'
preferredSize='{getFixedSize()}'
- layout='{new BoxLayout(limaHomeDaily,BoxLayout.X_AXIS)}'>
+ layout='{new BoxLayout(financialTransactionPanel, BoxLayout.X_AXIS)}'>
<Table>
<row>
<cell weightx="0" weighty="0.1" anchor="northwest"><JLabel icon='{new ImageIcon(getClass().getResource("/images/entries.png"))}'/></cell>
@@ -93,8 +106,7 @@
</row>
<row fill="both">
<cell columns="2" weightx="1" weighty="0.9">
- <JEditorPane id="textHomeDaily"
- opaque="true" contentType="text/html" editable="false" UI="{new javax.swing.plaf.basic.BasicEditorPaneUI()}" background="{getGreen()}"/>
+ <JEditorPane javaBean='new org.chorem.lima.ui.home.FinancialTransactionsPane(this)' />
</cell>
</row>
</Table>
Deleted: trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/HomeViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/HomeViewHandler.java 2010-07-21 15:04:34 UTC (rev 2980)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/HomeViewHandler.java 2010-07-21 16:46:42 UTC (rev 2981)
@@ -1,226 +0,0 @@
-package org.chorem.lima.ui.home;
-
-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 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.EntryBookServiceMonitorable;
-import org.chorem.lima.business.FinancialTransactionServiceMonitorable;
-import org.chorem.lima.business.FiscalPeriodServiceMonitorable;
-import org.chorem.lima.business.LimaException;
-import org.chorem.lima.entity.Account;
-import org.chorem.lima.entity.EntryBook;
-import org.chorem.lima.entity.FinancialTransaction;
-import org.chorem.lima.entity.FiscalPeriod;
-import org.chorem.lima.service.LimaServiceFactory;
-import org.chorem.lima.ui.MainView;
-
-
-public class HomeViewHandler implements HyperlinkListener {
-
- private static final Log log = LogFactory.getLog(HomeViewHandler.class);
-
- protected HomeView view;
-
- /* Services */
- protected AccountServiceMonitorable accountService;
- protected EntryBookServiceMonitorable entryBookService;
- protected FinancialTransactionServiceMonitorable financialTransactionService;
- protected FiscalPeriodServiceMonitorable fiscalPeriodService;
-
- /* Editorpane*/
- protected JEditorPane accountPane;
- protected JEditorPane entryBookPane;
- protected JEditorPane fiscalYearPane;
- protected JEditorPane dailyPane;
-
- private static Color redBackground = new Color(0xff, 0xee, 0xee);
-
- protected HomeViewHandler(HomeView view) {
- this.view=view;
-
- accountService =
- LimaServiceFactory.getInstance().getService(AccountServiceMonitorable.class);
- entryBookService =
- LimaServiceFactory.getInstance().getService(EntryBookServiceMonitorable.class);
- financialTransactionService =
- LimaServiceFactory.getInstance().getService(FinancialTransactionServiceMonitorable.class);
- fiscalPeriodService =
- LimaServiceFactory.getInstance().getService(FiscalPeriodServiceMonitorable.class);
-
- }
-
-
- public void setEditorPanes() {
- //Get all editorpanes
- accountPane = view.getTextHomeAccount();
- entryBookPane = view.getTextHomeEntryBook();
- fiscalYearPane = view.getTextHomeFiscalYear();
- dailyPane = view.getTextHomeDaily();
-
- //add hyperlink listener
- accountPane.addHyperlinkListener(this);
- entryBookPane.addHyperlinkListener(this);
- fiscalYearPane.addHyperlinkListener(this);
- dailyPane.addHyperlinkListener(this);
- }
-
-
- @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);
- }
- else if (e.getDescription().equals("#entrybookschart")) {
- MainView ui = LimaContext.MAIN_UI_ENTRY_DEF.getContextValue(view);
- ui.getHandler().showEntryBookView(ui);
- }
- else if (e.getDescription().equals("#fiscalperiodschart")) {
- MainView ui = LimaContext.MAIN_UI_ENTRY_DEF.getContextValue(view);
- ui.getHandler().showFiscalPeriodView(ui);
- }
- else if (e.getDescription().equals("#financialtransactionunbalanced")) {
- MainView ui = LimaContext.MAIN_UI_ENTRY_DEF.getContextValue(view);
- ui.getHandler().showTransactionUnbalancedView(ui);
- }
- else if (e.getDescription().equals("#financialtransactionbalanced")) {
- MainView ui = LimaContext.MAIN_UI_ENTRY_DEF.getContextValue(view);
- ui.getHandler().showTransactionView(ui);
- }
- }
-
- }
-
-
- public void refresh(){
-
- if (accountPane ==null){
- setEditorPanes();
- }
-
- String htmlBegin = "<font face='sans-serif' size=3>"
- + "<p style=vertical-align:'bottom', horizontal-align:'center'>";
- String htmlEnd = "</p></font>";
-
- try {
-
- //ACCOUNTS CHART
- List<Account> accounts = accountService.getAllAccounts();
- if (accounts.size()>0){
- String accountsString = _("limahome.chartaccounts.state1_2") + " "
- + accounts.size() + " " + _("limahome.chartaccounts.state2_2")
- + "<br/><br/><a href='#accountschart'>"
- + _("limahome.chartaccounts.modify") + "</a>";
- //set Text
- accountPane.setText(htmlBegin + accountsString + htmlEnd);
- }
- else {
- accountPane.setBackground(redBackground);
- String accountsString = _("limahome.chartaccounts.nothing")
- + "<br/><br/><a href='#accountschart'>"
- + _("limahome.chartaccounts.create") + "</a>";
- //set Text
- accountPane.setText(htmlBegin + accountsString + htmlEnd);
- }
-
- //ENTRYBOOKS
- List<EntryBook> entryBooks = entryBookService.getAllEntryBooks();
- int ebSize = entryBooks.size();
- if (ebSize>0){
- String entryBooksString="";
- if (ebSize == 1){
- entryBooksString = _("limahome.entrybooks.state.single")
- + "<br/>" + entryBooks.get(0)
- + "<br/><br/><a href='#entrybookschart'>"
- + _("limahome.entrybooks.modify") + "</a>";
-
- }
- else {
- entryBooksString = _("limahome.entrybooks.state1_2.plural")
- + " " + entryBooks.size() + " "
- + _("limahome.entrybooks.state2_2.plural") + "<ul>";
- for (EntryBook entryBook : entryBooks) {
- entryBooksString += "<li>"+entryBook.getCode() +
- " - "+entryBook.getLabel()+"</li>";
- }
- entryBooksString += "</ul></p><p horizontal-align:'center'>"
- + "<a href='#entrybookschart'>"
- + _("limahome.entrybooks.modify") + "</a>";
- }
- //set Text
- entryBookPane.setText(htmlBegin + entryBooksString + htmlEnd);
- }
- else {
- entryBookPane.setBackground(redBackground);
- //set Text
- entryBookPane.setText(htmlBegin
- + _("limahome.entrybooks.nothing")
- + "<br/><br/><a href='#entrybookschart'>"
- + _("limahome.entrybooks.create") +"</a>" + htmlEnd);
- }
-
- //FISCAL PERIOD
- List<FiscalPeriod> fiscalPeriods =
- fiscalPeriodService.getAllFiscalPeriods();
- List<FiscalPeriod> unblockedFiscalPeriods =
- fiscalPeriodService.getAllUnblockedFiscalPeriods();
- if (unblockedFiscalPeriods.size()>0){
- String fiscalString = unblockedFiscalPeriods.size() + " "
- + _("limahome.fiscalperiod.opened") + "<br/>"
- + (fiscalPeriods.size()-unblockedFiscalPeriods.size())
- + " " + _("limahome.fiscalperiod.closed")
- + "<br/><br/><a href='#fiscalperiodschart'>"
- + _("limahome.fiscalperiod.modify") + "</a>";
- //set Text
- fiscalYearPane.setText(htmlBegin + fiscalString + htmlEnd);
-
- //FINANCIAL TRANSACTION
- List<FinancialTransaction> financialTransactions =
- financialTransactionService.
- getAllFinancialTransactionsUnbalanced(fiscalPeriods.get(0));
- if (financialTransactions.size()>0){
- dailyPane.setBackground(redBackground);
- String transactionsString = financialTransactions.size()
- + " " + _("limahome.transaction.unbalanced")
- + "<br/><br/><a href='#financialtransactionunbalanced'>"
- + _("limahome.transaction.modifiy") + "</a>";
- //set Text
- dailyPane.setText(htmlBegin + transactionsString + htmlEnd);
- }
- else {
- String transactionsString = _("limahome.transaction.balanced")
- + "<br/><br/><a href='#financialtransactionbalanced'>"
- + _("limahome.transaction.create") + "</a>";
- //set Text
- dailyPane.setText(htmlBegin + transactionsString + htmlEnd);
- }
- }
- else {
- fiscalYearPane.setBackground(redBackground);
- dailyPane.setBackground(redBackground);
- String fiscalString = _("limahome.fiscalperiod.noopen");
- if (fiscalPeriods.size()>0){
- fiscalString += "<br/>" + fiscalPeriods.size() + " "
- + _("limahome.fiscalperiod.closed");
- }
- fiscalString += "<br/><br/><a href='#fiscalperiodschart'>"
- + _("limahome.fiscalperiod.create") + "</a>";
- //set Text
- fiscalYearPane.setText(htmlBegin + fiscalString + htmlEnd);
-
- }
- } catch (LimaException eee) {
- log.debug("Can't get datas home", eee);
- }
- }
-}
Deleted: trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/HomeViewListener.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/HomeViewListener.java 2010-07-21 15:04:34 UTC (rev 2980)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/HomeViewListener.java 2010-07-21 16:46:42 UTC (rev 2981)
@@ -1,60 +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.home;
-
-import java.awt.event.ComponentEvent;
-import java.awt.event.ComponentListener;
-
-/**
- * Listener refresh home datas when tab home is on front
- */
-public class HomeViewListener implements ComponentListener {
-
-
- private HomeView view;
-
- public HomeViewListener(HomeView view) {
- this.view = view;
- // TODO Auto-generated constructor stub
- }
-
- @Override
- public void componentHidden(ComponentEvent e) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public void componentMoved(ComponentEvent e) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public void componentResized(ComponentEvent e) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public void componentShown(ComponentEvent e) {
- view.getHandler().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-07-21 15:04:34 UTC (rev 2980)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java 2010-07-21 16:46:42 UTC (rev 2981)
@@ -38,7 +38,6 @@
import org.chorem.lima.business.ExportServiceMonitorable;
import org.chorem.lima.business.ImportServiceMonitorable;
import org.chorem.lima.business.LimaException;
-import org.chorem.lima.business.ServiceListener;
import org.chorem.lima.service.LimaServiceFactory;
import org.chorem.lima.ui.account.AccountViewHandler;
import org.chorem.lima.util.DialogHelper;
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-07-21 15:04:34 UTC (rev 2980)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerTableModel.java 2010-07-21 16:46:42 UTC (rev 2981)
@@ -97,11 +97,6 @@
if (cacheDataList != null) {
result = cacheDataList.size();
}
- else {
- if (log.isDebugEnabled()) {
- log.debug("No period selected skip table model update");
- }
- }
return result;
}
@@ -230,11 +225,6 @@
}
}
- else {
- if (log.isDebugEnabled()) {
- log.debug("No fiscalPeriod selected skip table model update");
- }
- }
return result;
}
1
0
r2980 - in trunk/lima-swing/src/main/java/org/chorem/lima/ui: account accountsreports balance entrybook entrybooksreports financialperiod financialstatementchart financialstatementreport financialtransaction ledger
by jpepin@users.chorem.org 21 Jul '10
by jpepin@users.chorem.org 21 Jul '10
21 Jul '10
Author: jpepin
Date: 2010-07-21 17:04:34 +0200 (Wed, 21 Jul 2010)
New Revision: 2980
Url: http://chorem.org/repositories/revision/lima/2980
Log:
Impl?\195?\169mentation de ServiceListener dans les rapports + debug.
Modified:
trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountViewHandler.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/entrybook/EntryBookTableModel.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/financialperiod/FinancialPeriodTableModel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartViewHandler.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/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/ledger/LedgerTableModel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerView.jaxx
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountViewHandler.java 2010-07-21 14:02:18 UTC (rev 2979)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountViewHandler.java 2010-07-21 15:04:34 UTC (rev 2980)
@@ -65,7 +65,6 @@
accountService =
LimaServiceFactory.getInstance().getService(
AccountServiceMonitorable.class);
- accountService.addListener(this);
LimaServiceFactory.getInstance().getService(
ImportServiceMonitorable.class).addListener(this);
}
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-07-21 14:02:18 UTC (rev 2979)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsTableModel.java 2010-07-21 15:04:34 UTC (rev 2980)
@@ -26,9 +26,11 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.beans.ReportsDatas;
+import org.chorem.lima.business.FinancialTransactionServiceMonitorable;
+import org.chorem.lima.business.ImportServiceMonitorable;
import org.chorem.lima.business.LimaException;
-import org.chorem.lima.business.ReportService;
import org.chorem.lima.business.ReportServiceMonitorable;
+import org.chorem.lima.business.ServiceListener;
import org.chorem.lima.entity.Account;
import org.chorem.lima.entity.Entry;
import org.chorem.lima.service.LimaServiceFactory;
@@ -44,16 +46,16 @@
* Last update : $Date: 2010-04-19 15:19:30 +0200 (lun. 19 avril 2010) $
* By : $Author: jpepin $
*/
-public class AccountsReportsTableModel extends AbstractTableModel {
+public class AccountsReportsTableModel extends AbstractTableModel implements ServiceListener {
/** serialVersionUID. */
- private static final long serialVersionUID = 7578692417919755647L;
+ private static final long serialVersionUID = 1L;
/** log. */
private static final Log log = LogFactory.getLog(AccountsReportsTableModel.class);
/** Services. */
- protected ReportService reportService;
+ protected ReportServiceMonitorable reportService;
/** Account. */
protected Account selectedAccount;
@@ -75,6 +77,10 @@
reportService =
LimaServiceFactory.getInstance().getService(
ReportServiceMonitorable.class);
+ LimaServiceFactory.getInstance().getService(
+ ImportServiceMonitorable.class).addListener(this);
+ LimaServiceFactory.getInstance().getService(
+ FinancialTransactionServiceMonitorable.class).addListener(this);
}
@Override
@@ -210,5 +216,12 @@
cacheDataList = getDataList();
fireTableDataChanged();
}
+
+ @Override
+ public void notifyMethod(String serviceName, String methodeName) {
+ if (serviceName.contains("FinancialTransaction") || methodeName.contains("importAccount") || methodeName.contains("importAll")){
+ refresh();
+ }
+ }
}
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-07-21 14:02:18 UTC (rev 2979)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsView.jaxx 2010-07-21 15:04:34 UTC (rev 2980)
@@ -49,9 +49,6 @@
]]>
</script>
<row weightx="1" weighty="0" anchor="center">
- <cell anchor="west">
- <JButton text="lima.refresh" onActionPerformed="getHandler().refresh()"/>
- </cell>
<cell anchor="east">
<JLabel id="beginCalendarPanelLabel" text="lima.accountsreports.begincalendar"/>
</cell>
@@ -73,7 +70,7 @@
</cell>
<cell anchor="west">
<JComboBox id="accountSelectorComboBox"
- model="{modelAccounts}"
+ model="{getModelAccounts()}"
renderer="{new org.chorem.lima.ui.combobox.AccountRenderer()}"
onActionPerformed="getModelAccountsReportsTable().setAccount((Account) accountSelectorComboBox.getSelectedItem());
getHandler().refresh()"
@@ -82,7 +79,7 @@
</cell>
</row>
<row>
- <cell fill="both" weightx="1" weighty="1" columns="7">
+ <cell fill="both" weightx="1" weighty="1" columns="6">
<JScrollPane>
<org.jdesktop.swingx.JXTable id="accountsReportsTable" rowHeight="24"
model="{getModelAccountsReportsTable()}"
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-07-21 14:02:18 UTC (rev 2979)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsViewHandler.java 2010-07-21 15:04:34 UTC (rev 2980)
@@ -47,9 +47,6 @@
public void refresh(){
tableModel = view.getModelAccountsReportsTable();
tableModel.refresh();
-
- //comboBoxModel = view.getModelAccounts();
- //comboBoxModel.refresh();
/**
* set text and amounts of labels credit, debit, solde
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-07-21 14:02:18 UTC (rev 2979)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceTableModel.java 2010-07-21 15:04:34 UTC (rev 2980)
@@ -27,9 +27,11 @@
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.beans.BalanceTrial;
import org.chorem.lima.beans.ReportsDatas;
+import org.chorem.lima.business.FinancialTransactionServiceMonitorable;
+import org.chorem.lima.business.ImportServiceMonitorable;
import org.chorem.lima.business.LimaException;
-import org.chorem.lima.business.ReportService;
import org.chorem.lima.business.ReportServiceMonitorable;
+import org.chorem.lima.business.ServiceListener;
import org.chorem.lima.service.LimaServiceFactory;
import org.chorem.lima.util.ErrorHelper;
@@ -43,7 +45,7 @@
* Last update : $Date: 2010-04-19 15:19:30 +0200 (lun. 19 avril 2010) $
* By : $Author: jpepin $
*/
-public class BalanceTableModel extends AbstractTableModel {
+public class BalanceTableModel extends AbstractTableModel implements ServiceListener {
/** serialVersionUID. */
private static final long serialVersionUID = 7578692417919755647L;
@@ -52,7 +54,7 @@
private static final Log log = LogFactory.getLog(BalanceTableModel.class);
/** Services. */
- protected ReportService reportService;
+ protected ReportServiceMonitorable reportService;
/** DatePicker Begin Date. */
protected Date selectedBeginDate;
@@ -73,6 +75,10 @@
reportService =
LimaServiceFactory.getInstance().getService(
ReportServiceMonitorable.class);
+ LimaServiceFactory.getInstance().getService(
+ ImportServiceMonitorable.class).addListener(this);
+ LimaServiceFactory.getInstance().getService(
+ FinancialTransactionServiceMonitorable.class).addListener(this);
}
@Override
@@ -202,4 +208,10 @@
fireTableDataChanged();
}
+ @Override
+ public void notifyMethod(String serviceName, String methodeName) {
+ if (serviceName.contains("FinancialTransaction") || methodeName.contains("importAccount") || methodeName.contains("importAll")){
+ refresh();
+ }
+ }
}
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-21 14:02:18 UTC (rev 2979)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceView.jaxx 2010-07-21 15:04:34 UTC (rev 2980)
@@ -49,9 +49,6 @@
]]>
</script>
<row weightx="1" weighty="0" anchor="center">
- <cell anchor="west">
- <JButton text="lima.refresh" onActionPerformed="getHandler().refresh()"/>
- </cell>
<cell anchor="east">
<JLabel id="beginCalendarPanelLabel" text="lima.accountsreports.begincalendar"/>
</cell>
@@ -78,7 +75,7 @@
</cell>
</row>
<row>
- <cell fill="both" weightx="1" weighty="1" columns="7">
+ <cell fill="both" weightx="1" weighty="1" columns="6">
<JScrollPane>
<org.jdesktop.swingx.JXTable id="balanceTable" rowHeight="24"
model="{getModelBalanceTable()}"
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-07-21 14:02:18 UTC (rev 2979)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookTableModel.java 2010-07-21 15:04:34 UTC (rev 2980)
@@ -58,7 +58,6 @@
entryBookService =
LimaServiceFactory.getInstance().getService(
EntryBookServiceMonitorable.class);
- entryBookService.addListener(this);
LimaServiceFactory.getInstance().getService(ImportServiceMonitorable.class).addListener(this);
}
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-07-21 14:02:18 UTC (rev 2979)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsTableModel.java 2010-07-21 15:04:34 UTC (rev 2980)
@@ -27,9 +27,11 @@
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.beans.ReportsDatas;
import org.chorem.lima.beans.ReportsDatasImpl;
+import org.chorem.lima.business.FinancialTransactionServiceMonitorable;
+import org.chorem.lima.business.ImportServiceMonitorable;
import org.chorem.lima.business.LimaException;
-import org.chorem.lima.business.ReportService;
import org.chorem.lima.business.ReportServiceMonitorable;
+import org.chorem.lima.business.ServiceListener;
import org.chorem.lima.entity.Entry;
import org.chorem.lima.entity.EntryBook;
import org.chorem.lima.service.LimaServiceFactory;
@@ -45,16 +47,16 @@
* Last update : $Date: 2010-04-19 15:19:30 +0200 (lun. 19 avril 2010) $
* By : $Author: jpepin $
*/
-public class EntryBooksReportsTableModel extends AbstractTableModel {
+public class EntryBooksReportsTableModel extends AbstractTableModel implements ServiceListener {
/** serialVersionUID. */
- private static final long serialVersionUID = 7578692417919755647L;
+ private static final long serialVersionUID = 1L;
/** log. */
private static final Log log = LogFactory.getLog(EntryBooksReportsTableModel.class);
/** Services. */
- protected ReportService reportService;
+ protected ReportServiceMonitorable reportService;
/** Account. */
protected EntryBook selectedEntryBook;
@@ -75,6 +77,10 @@
reportService =
LimaServiceFactory.getInstance().getService(
ReportServiceMonitorable.class);
+ LimaServiceFactory.getInstance().getService(
+ ImportServiceMonitorable.class).addListener(this);
+ LimaServiceFactory.getInstance().getService(
+ FinancialTransactionServiceMonitorable.class).addListener(this);
}
@Override
@@ -212,5 +218,12 @@
cacheDataList = getDataList();
fireTableDataChanged();
}
+
+ @Override
+ public void notifyMethod(String serviceName, String methodeName) {
+ if (serviceName.contains("FinancialTransaction") || methodeName.contains("importEntryBook") || methodeName.contains("importAll")){
+ refresh();
+ }
+ }
}
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-07-21 14:02:18 UTC (rev 2979)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsView.jaxx 2010-07-21 15:04:34 UTC (rev 2980)
@@ -49,9 +49,6 @@
]]>
</script>
<row weightx="1" weighty="0" anchor="center">
- <cell anchor="west">
- <JButton text="lima.refresh" onActionPerformed="getHandler().refresh()"/>
- </cell>
<cell anchor="east">
<JLabel id="beginCalendarPanelLabel" text="lima.accountsreports.begincalendar"/>
</cell>
@@ -82,7 +79,7 @@
</cell>
</row>
<row>
- <cell fill="both" weightx="1" weighty="1" columns="7">
+ <cell fill="both" weightx="1" weighty="1" columns="6">
<JScrollPane>
<org.chorem.lima.ui.entrybooksreports.EntryBooksReportsTable
id="table" sortable="false" rowHeight="24"
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialperiod/FinancialPeriodTableModel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialperiod/FinancialPeriodTableModel.java 2010-07-21 14:02:18 UTC (rev 2979)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialperiod/FinancialPeriodTableModel.java 2010-07-21 15:04:34 UTC (rev 2980)
@@ -62,7 +62,6 @@
financialPeriodService =
LimaServiceFactory.getInstance().getService(
FinancialPeriodServiceMonitorable.class);
- financialPeriodService.addListener(this);
LimaServiceFactory.getInstance().getService(
ImportServiceMonitorable.class).addListener(this);
LimaServiceFactory.getInstance().getService(
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartViewHandler.java 2010-07-21 14:02:18 UTC (rev 2979)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartViewHandler.java 2010-07-21 15:04:34 UTC (rev 2980)
@@ -64,7 +64,6 @@
financialStatementService =
LimaServiceFactory.getInstance().getService(
FinancialStatementServiceMonitorable.class);
- financialStatementService.addListener(this);
LimaServiceFactory.getInstance().getService(
ImportServiceMonitorable.class).addListener(this);
}
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-07-21 14:02:18 UTC (rev 2979)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportTableModel.java 2010-07-21 15:04:34 UTC (rev 2980)
@@ -26,9 +26,11 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.beans.FinancialStatementAmounts;
-import org.chorem.lima.business.FinancialStatementService;
import org.chorem.lima.business.FinancialStatementServiceMonitorable;
+import org.chorem.lima.business.FinancialTransactionServiceMonitorable;
+import org.chorem.lima.business.ImportServiceMonitorable;
import org.chorem.lima.business.LimaException;
+import org.chorem.lima.business.ServiceListener;
import org.chorem.lima.service.LimaServiceFactory;
import org.chorem.lima.util.ErrorHelper;
@@ -42,16 +44,16 @@
* Last update : $Date: 2010-04-19 15:19:30 +0200 (lun. 19 avril 2010) $
* By : $Author: jpepin $
*/
-public class FinancialStatementReportTableModel extends AbstractTableModel {
+public class FinancialStatementReportTableModel extends AbstractTableModel implements ServiceListener {
/** serialVersionUID. */
- private static final long serialVersionUID = 7578692417919755647L;
+ private static final long serialVersionUID = 1L;
/** log. */
private static final Log log = LogFactory.getLog(FinancialStatementReportTableModel.class);
/** Services. */
- protected FinancialStatementService financialStatementService;
+ protected FinancialStatementServiceMonitorable financialStatementService;
/** DatePicker Begin Date. */
protected Date selectedBeginDate;
@@ -69,6 +71,11 @@
financialStatementService =
LimaServiceFactory.getInstance().getService(
FinancialStatementServiceMonitorable.class);
+ financialStatementService.addListener(this);
+ LimaServiceFactory.getInstance().getService(
+ ImportServiceMonitorable.class).addListener(this);
+ LimaServiceFactory.getInstance().getService(
+ FinancialTransactionServiceMonitorable.class).addListener(this);
}
@Override
@@ -203,5 +210,12 @@
FinancialStatementDocument financialStatementDocument = new FinancialStatementDocument();
financialStatementDocument.createDocuments(cacheDataList);
}
+
+ @Override
+ public void notifyMethod(String serviceName, String methodeName) {
+ if (serviceName.contains("FinancialTransaction") || methodeName.contains("FinancialStatement") || methodeName.contains("importAll")){
+ refresh();
+ }
+ }
}
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-07-21 14:02:18 UTC (rev 2979)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportView.jaxx 2010-07-21 15:04:34 UTC (rev 2980)
@@ -49,9 +49,6 @@
]]>
</script>
<row weightx="1" weighty="0" anchor="center">
- <cell anchor="west">
- <JButton text="lima.refresh" onActionPerformed="getHandler().refresh()"/>
- </cell>
<cell anchor="east">
<JLabel id="beginCalendarPanelLabel" text="lima.accountsreports.begincalendar"/>
</cell>
@@ -73,7 +70,7 @@
</cell>
</row>
<row>
- <cell fill="both" weightx="1" weighty="1" columns="8">
+ <cell fill="both" weightx="1" weighty="1" columns="7">
<JScrollPane>
<org.chorem.lima.ui.financialstatementreport.FinancialStatementReportTable id="table" rowHeight="24"
constructorParams="getHandler()"
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-21 14:02:18 UTC (rev 2979)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTableModel.java 2010-07-21 15:04:34 UTC (rev 2980)
@@ -19,7 +19,6 @@
package org.chorem.lima.ui.financialtransaction;
import static org.nuiton.i18n.I18n._;
-
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collections;
@@ -29,14 +28,11 @@
import org.apache.commons.lang.time.DateUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.chorem.lima.business.EntryBookService;
-import org.chorem.lima.business.EntryBookServiceMonitorable;
-import org.chorem.lima.business.FinancialPeriodService;
-import org.chorem.lima.business.FinancialPeriodServiceMonitorable;
import org.chorem.lima.business.FinancialTransactionServiceMonitorable;
+import org.chorem.lima.business.ImportServiceMonitorable;
import org.chorem.lima.business.LimaBusinessException;
import org.chorem.lima.business.LimaException;
-import org.chorem.lima.business.FinancialTransactionService;
+import org.chorem.lima.business.ServiceListener;
import org.chorem.lima.business.utils.EntryComparator;
import org.chorem.lima.entity.Account;
import org.chorem.lima.entity.Entry;
@@ -63,24 +59,18 @@
* Last update : $Date: 2010-05-14 13:22:26 +0200 (ven. 14 mai 2010) $
* By : $Author: jpepin $
*/
-public class FinancialTransactionTableModel extends AbstractTableModel {
+public class FinancialTransactionTableModel extends AbstractTableModel implements ServiceListener{
/** serialVersionUID. */
- private static final long serialVersionUID = 3914954536809622358L;
+ private static final long serialVersionUID = 1L;
/** log. */
private static final Log log = LogFactory
.getLog(FinancialTransactionTableModel.class);
/** Transaction service. */
- protected final FinancialTransactionService financialTransactionService;
+ protected final FinancialTransactionServiceMonitorable financialTransactionService;
- /** EntryBook service. */
- protected final EntryBookService entryBookService;
-
- /** FinancialPeriod service. */
- protected final FinancialPeriodService financialPeriodService;
-
/** selected financial period */
protected FinancialPeriod selectedFinancialPeriod;
@@ -100,12 +90,9 @@
financialTransactionService =
LimaServiceFactory.getInstance().getService(
FinancialTransactionServiceMonitorable.class);
- entryBookService =
- LimaServiceFactory.getInstance().getService(
- EntryBookServiceMonitorable.class);
- financialPeriodService =
- LimaServiceFactory.getInstance().getService(
- FinancialPeriodServiceMonitorable.class);
+ financialTransactionService.addListener(this);
+ LimaServiceFactory.getInstance().getService(
+ ImportServiceMonitorable.class).addListener(this);
}
/**
@@ -533,5 +520,12 @@
cacheDataList = getDataList();
fireTableRowsDeleted(row, getRowCount());
}
+
+ @Override
+ public void notifyMethod(String serviceName, String methodeName) {
+ if (serviceName.contains("FinancialTransaction") || methodeName.contains("importEntries") || methodeName.contains("importAll")){
+ refresh();
+ }
+ }
}
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-07-21 14:02:18 UTC (rev 2979)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionView.jaxx 2010-07-21 15:04:34 UTC (rev 2980)
@@ -42,9 +42,6 @@
</JPopupMenu> -->
<row weightx="1" weighty="0" anchor="center">
- <cell anchor="west">
- <JButton text="lima.refresh" onActionPerformed="getHandler().refresh()"/>
- </cell>
<cell anchor="east">
<JLabel id="fiscalPeriodLabel" text="lima.charts.fiscalyear"/>
</cell>
@@ -83,7 +80,7 @@
</cell>
</row>
<row>
- <cell fill="both" weightx="1" weighty="1" rows="3" columns="9">
+ <cell fill="both" weightx="1" weighty="1" rows="3" columns="8">
<JScrollPane>
<org.chorem.lima.ui.financialtransaction.FinancialTransactionTableModel
id="financialTransactionTableModel"/>
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-07-21 14:02:18 UTC (rev 2979)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerTableModel.java 2010-07-21 15:04:34 UTC (rev 2980)
@@ -30,9 +30,11 @@
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.beans.BalanceTrial;
import org.chorem.lima.beans.ReportsDatas;
+import org.chorem.lima.business.FinancialTransactionServiceMonitorable;
+import org.chorem.lima.business.ImportServiceMonitorable;
import org.chorem.lima.business.LimaException;
-import org.chorem.lima.business.ReportService;
import org.chorem.lima.business.ReportServiceMonitorable;
+import org.chorem.lima.business.ServiceListener;
import org.chorem.lima.business.utils.EntryComparator;
import org.chorem.lima.entity.Entry;
import org.chorem.lima.entity.EntryBook;
@@ -49,7 +51,7 @@
* Last update : $Date: 2010-04-19 15:19:30 +0200 (lun. 19 avril 2010) $
* By : $Author: jpepin $
*/
-public class LedgerTableModel extends AbstractTableModel {
+public class LedgerTableModel extends AbstractTableModel implements ServiceListener {
/** serialVersionUID. */
private static final long serialVersionUID = 7578692417919755647L;
@@ -58,7 +60,7 @@
private static final Log log = LogFactory.getLog(LedgerTableModel.class);
/** Services. */
- protected ReportService reportService;
+ protected ReportServiceMonitorable reportService;
/** Account. */
protected EntryBook selectedEntryBook;
@@ -78,8 +80,13 @@
*/
public LedgerTableModel() {
reportService =
- LimaServiceFactory.getInstance().getService(
- ReportServiceMonitorable.class);
+ LimaServiceFactory.getInstance().getService(
+ ReportServiceMonitorable.class);
+ reportService.addListener(this);
+ LimaServiceFactory.getInstance().getService(
+ ImportServiceMonitorable.class).addListener(this);
+ LimaServiceFactory.getInstance().getService(
+ FinancialTransactionServiceMonitorable.class).addListener(this);
}
@Override
@@ -279,4 +286,11 @@
fireTableDataChanged();
}
+ @Override
+ public void notifyMethod(String serviceName, String methodeName) {
+ if (serviceName.contains("FinancialTransaction") || methodeName.contains("importAccount") || methodeName.contains("importAll")){
+ refresh();
+ }
+ }
+
}
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-21 14:02:18 UTC (rev 2979)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerView.jaxx 2010-07-21 15:04:34 UTC (rev 2980)
@@ -48,9 +48,6 @@
]]>
</script>
<row weightx="1" weighty="0" anchor="center">
- <cell anchor="west">
- <JButton text="lima.refresh" onActionPerformed="getHandler().refresh()"/>
- </cell>
<cell anchor="east">
<JLabel id="beginCalendarPanelLabel" text="lima.accountsreports.begincalendar"/>
</cell>
@@ -69,7 +66,7 @@
</cell>
</row>
<row>
- <cell fill="both" weightx="1" weighty="1" columns="7">
+ <cell fill="both" weightx="1" weighty="1" columns="6">
<JScrollPane>
<org.chorem.lima.ui.ledger.LedgerTable
id="table" sortable="false" rowHeight="24"
1
0