Lima-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
August 2011
- 3 participants
- 49 discussions
04 Aug '11
Author: vsalaun
Date: 2011-08-04 12:31:43 +0200 (Thu, 04 Aug 2011)
New Revision: 3246
Url: http://chorem.org/repositories/revision/lima/3246
Log:
add i18n:bundle
Modified:
trunk/lima-swing/pom.xml
trunk/lima-swing/src/main/java/org/chorem/lima/LimaConfig.java
trunk/lima-swing/src/main/java/org/chorem/lima/LimaContext.java
trunk/lima-swing/src/main/java/org/chorem/lima/LimaMain.java
Modified: trunk/lima-swing/pom.xml
===================================================================
--- trunk/lima-swing/pom.xml 2011-08-04 09:52:55 UTC (rev 3245)
+++ trunk/lima-swing/pom.xml 2011-08-04 10:31:43 UTC (rev 3246)
@@ -136,6 +136,9 @@
<license.generateBundle>true</license.generateBundle>
<license.bundleLicensePath>META-INF/lima-swing-LICENSE.txt</license.bundleLicensePath>
<license.bundleThirdPartyPath>META-INF/lima-swing-THIRD-PARTY.txt</license.bundleThirdPartyPath>
+
+ <i18n.bundles>fr_FR,en_GB</i18n.bundles>
+ <i18n.bundleOutputName>lima</i18n.bundleOutputName>
</properties>
@@ -175,22 +178,29 @@
</execution>
</executions>
</plugin>
-
+
<plugin>
<groupId>org.nuiton.i18n</groupId>
<artifactId>maven-i18n-plugin</artifactId>
<executions>
<execution>
+ <id>scan-sources</id>
+ <goals>
+ <goal>parserJava</goal>
+ <goal>gen</goal>
+ </goals>
<configuration>
<entries>
<entry>
- <basedir>${maven.gen.dir}/java</basedir>
+ <basedir>${maven.gen.dir}/java/</basedir>
</entry>
</entries>
</configuration>
+ </execution>
+ <execution>
+ <id>make-bundle</id>
<goals>
- <goal>parserJava</goal>
- <goal>gen</goal>
+ <goal>bundle</goal>
</goals>
</execution>
</executions>
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/LimaConfig.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/LimaConfig.java 2011-08-04 09:52:55 UTC (rev 3245)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/LimaConfig.java 2011-08-04 10:31:43 UTC (rev 3246)
@@ -38,12 +38,18 @@
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.actions.MiscAction;
import org.chorem.lima.business.OptionsServiceMonitorable;
+import org.chorem.lima.business.LimaConfig.Option;
import org.chorem.lima.entity.LimaCallaoDAOHelper;
import org.chorem.lima.service.LimaServiceFactory;
+import org.nuiton.i18n.I18n;
+import org.nuiton.i18n.init.DefaultI18nInitializer;
+import org.nuiton.i18n.init.I18nInitializer;
+import org.nuiton.i18n.init.UserI18nInitializer;
import org.nuiton.util.ApplicationConfig;
import org.nuiton.util.ArgumentsParserException;
import org.nuiton.util.FileUtil;
import org.nuiton.util.SortedProperties;
+import org.nuiton.util.StringUtil;
import org.nuiton.util.Version;
import org.nuiton.util.VersionUtil;
import org.nuiton.util.converter.ConverterUtil;
@@ -68,9 +74,6 @@
private static final String configFile = "lima-config.properties";
- //used for services
- protected static final String SERVICECONFIGFILE = "lima.properties";
-
protected OptionsServiceMonitorable optionsService;
/**
@@ -337,6 +340,16 @@
return result;
}
+ public String getVersionDirectory() {
+ String result = getOption(Option.VERSION_DIRECTORY.key);
+ return result;
+ }
+
+ public String getI18nDirectory() {
+ String result = getOption(Option.I18N_DIRECTORY.key);
+ return result;
+ }
+
public String getHostAdress() {
return getOption(Option.LIMA_HOST_ADDRESS.key);
}
@@ -377,6 +390,8 @@
public static enum Option implements OptionDef {
CONFIG_FILE(CONFIG_FILE_NAME, _("lima.config.configFileName.description"), "lima-config.properties", String.class, true, true),
+ VERSION_DIRECTORY("lima.version.dir", _("lima.config.versiondir"), "", String.class, false, false),
+ I18N_DIRECTORY("lima.i18n.dir", _("lima.config.i18ndir"), "", String.class, false, false),
LOCALE("locale", _("lima.config.locale.description"), "fr_FR", Locale.class, false, false),
DECIMAL_SEPARATOR("lima.config.decimalseparator", _("lima.config.decimalseparator.description"), ",", String.class, false, false),
SCALE("scale", _("lima.config.scale.description"), "2", Integer.class, false, false),
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/LimaContext.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/LimaContext.java 2011-08-04 09:52:55 UTC (rev 3245)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/LimaContext.java 2011-08-04 10:31:43 UTC (rev 3246)
@@ -32,8 +32,15 @@
import org.chorem.lima.ui.MainView;
import org.chorem.lima.ui.MainViewHandler;
import org.nuiton.i18n.I18n;
+import org.nuiton.i18n.init.DefaultI18nInitializer;
+import org.nuiton.i18n.init.I18nInitializer;
+import org.nuiton.i18n.init.UserI18nInitializer;
import org.nuiton.i18n.init.ClassPathI18nInitializer;
+import org.nuiton.util.FileUtil;
+import org.nuiton.util.StringUtil;
+import java.io.File;
+import java.io.IOException;
import java.util.Locale;
/**
@@ -78,7 +85,7 @@
instance = new LimaContext();
instance.setContextValue(new LimaConfig());
instance.setContextValue(new MainViewHandler());
-
+
return instance;
}
@@ -100,12 +107,51 @@
return getContextValue(LimaConfig.class);
}
- public void initI18n() {
+ public void initI18n(LimaConfig config) {
+
+ I18n.close();
+
+ File versionDirectory = new File(config.getVersionDirectory());
+ File i18nDirectory = new File(config.getI18nDirectory());
+ //create directory to store files for the current version only
+ try {
+ FileUtil.createDirectoryIfNecessary(versionDirectory);
+ //create directory to store i18n files
+ FileUtil.createDirectoryIfNecessary(i18nDirectory);
+ }
+ catch (IOException eee) {
+ throw new RuntimeException("Could not create directory ", eee);
+ }
+ UserI18nInitializer i18nInitializer =
+ new UserI18nInitializer(
+ i18nDirectory,
+ new DefaultI18nInitializer("lima")
+ );
+
+ //I18nInitializer i18nInitializer = new DefaultI18nInitializer("lima-config");
+
+ Locale locale = config.getLocale();
+
+ //I18n.init(new ClassPathI18nInitializer(), locale);
+ I18n.init(i18nInitializer, locale);
+
+ // Default Locale for DatePicker
+ Locale.setDefault(locale);
+
+ long t00 = System.nanoTime();
+
+ if (log.isDebugEnabled()) {
+ log.debug("i18n language : " + locale);
+ log.debug("i18n loading time : " +
+ StringUtil.convertTime(t00, System.nanoTime()));
+ }
+
+ /*
Locale locale = getConfig().getLocale();
I18n.init(new ClassPathI18nInitializer(), locale);
// Default Locale for DatePicker
- Locale.setDefault(locale);
+ Locale.setDefault(locale);*/
}
public MainView getMainUI() {
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/LimaMain.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/LimaMain.java 2011-08-04 09:52:55 UTC (rev 3245)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/LimaMain.java 2011-08-04 10:31:43 UTC (rev 3246)
@@ -27,7 +27,6 @@
import static org.nuiton.i18n.I18n._;
import java.util.List;
-import java.util.Locale;
import javax.swing.SwingUtilities;
import jaxx.runtime.SwingUtil;
import org.apache.commons.logging.Log;
@@ -41,8 +40,6 @@
import org.chorem.lima.ui.MainViewHandler;
import org.chorem.lima.ui.opening.OpeningView;
import org.chorem.lima.util.ErrorHelper;
-import org.nuiton.i18n.I18n;
-import org.nuiton.util.StringUtil;
/**
* Lima main.
@@ -138,7 +135,7 @@
LimaConfig config = context.getContextValue(LimaConfig.class);
config.parse(args);
- context.initI18n();
+ context.initI18n(config);
// prepare ui look&feel and load ui properties
try {
1
0
Author: tchemit
Date: 2011-08-04 11:52:55 +0200 (Thu, 04 Aug 2011)
New Revision: 3245
Url: http://chorem.org/repositories/revision/lima/3245
Log:
Update mavenpom4redmine to 3.0.
Modified:
trunk/pom.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2011-08-04 08:41:56 UTC (rev 3244)
+++ trunk/pom.xml 2011-08-04 09:52:55 UTC (rev 3245)
@@ -10,7 +10,7 @@
<parent>
<groupId>org.nuiton</groupId>
<artifactId>mavenpom4redmine</artifactId>
- <version>2.5.5</version>
+ <version>3.0</version>
</parent>
<groupId>org.chorem</groupId>
1
0
r3244 - in trunk/lima-swing/src/main/java/org/chorem/lima/ui: vatchart vatreports
by vsalaun@users.chorem.org 04 Aug '11
by vsalaun@users.chorem.org 04 Aug '11
04 Aug '11
Author: vsalaun
Date: 2011-08-04 10:41:56 +0200 (Thu, 04 Aug 2011)
New Revision: 3244
Url: http://chorem.org/repositories/revision/lima/3244
Log:
#347 add headers
Modified:
trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatchart/VatChartImportForm.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatchart/VatChartMovementForm.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatreports/VatReportPeriodSearchPanel.java
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatchart/VatChartImportForm.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatchart/VatChartImportForm.jaxx 2011-08-02 14:26:15 UTC (rev 3243)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatchart/VatChartImportForm.jaxx 2011-08-04 08:41:56 UTC (rev 3244)
@@ -1,3 +1,27 @@
+<!--
+ #%L
+ Lima :: Swing
+
+ $Id$
+ $HeadURL$
+ %%
+ Copyright (C) 2008 - 2011 CodeLutin
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as
+ published by the Free Software Foundation, either version 3 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public
+ License along with this program. If not, see
+ <http://www.gnu.org/licenses/gpl-3.0.html>.
+ #L%
+ -->
<JDialog modal="true"
defaultCloseOperation="{JDialog.DO_NOTHING_ON_CLOSE}"
onWindowClosing="performCancel();">
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatchart/VatChartMovementForm.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatchart/VatChartMovementForm.jaxx 2011-08-02 14:26:15 UTC (rev 3243)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatchart/VatChartMovementForm.jaxx 2011-08-04 08:41:56 UTC (rev 3244)
@@ -1,3 +1,27 @@
+<!--
+ #%L
+ Lima :: Swing
+
+ $Id$
+ $HeadURL$
+ %%
+ Copyright (C) 2008 - 2011 CodeLutin
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as
+ published by the Free Software Foundation, either version 3 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public
+ License along with this program. If not, see
+ <http://www.gnu.org/licenses/gpl-3.0.html>.
+ #L%
+ -->
<JDialog modal="true"
defaultCloseOperation="{JDialog.DO_NOTHING_ON_CLOSE}"
onWindowClosing="performCancel();">
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatreports/VatReportPeriodSearchPanel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatreports/VatReportPeriodSearchPanel.java 2011-08-02 14:26:15 UTC (rev 3243)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatreports/VatReportPeriodSearchPanel.java 2011-08-04 08:41:56 UTC (rev 3244)
@@ -1,3 +1,27 @@
+/*
+ * #%L
+ * Lima :: Swing
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2008 - 2011 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
package org.chorem.lima.ui.vatreports;
import static org.nuiton.i18n.I18n._;
1
0
r3243 - trunk/lima-business/src/main/java/org/chorem/lima/business/ejb
by vsalaun@users.chorem.org 02 Aug '11
by vsalaun@users.chorem.org 02 Aug '11
02 Aug '11
Author: vsalaun
Date: 2011-08-02 16:26:15 +0200 (Tue, 02 Aug 2011)
New Revision: 3243
Url: http://chorem.org/repositories/revision/lima/3243
Log:
#347 display PDF boxes inside the pdf
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/ImportServiceImpl.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 2011-08-02 11:39:58 UTC (rev 3242)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/DocumentServiceImpl.java 2011-08-02 14:26:15 UTC (rev 3243)
@@ -36,7 +36,6 @@
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.Calendar;
import java.util.Collections;
import java.util.Date;
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 2011-08-02 11:39:58 UTC (rev 3242)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java 2011-08-02 14:26:15 UTC (rev 3243)
@@ -53,6 +53,7 @@
import org.apache.commons.logging.LogFactory;
import org.apache.pdfbox.exceptions.COSVisitorException;
import org.apache.pdfbox.pdmodel.PDDocument;
+import org.apache.pdfbox.pdmodel.interactive.form.PDField;
import org.chorem.lima.FinancialStatementWayEnum;
import org.chorem.lima.beans.AccountEBP;
import org.chorem.lima.beans.AccountEBPImpl;
@@ -650,7 +651,7 @@
String path = LimaConfig.getInstance().getReportsDir();
String filePath =
- path+File.separator+DocumentsEnum.VAT.getFileName()+".pdf";
+ path+File.separator + DocumentsEnum.VAT.getFileName() + "_structure.pdf";
PDDocument doc = null;
InputStream reportsStream = new FileInputStream(datas);
@@ -658,6 +659,15 @@
//DocumentServiceImpl.class.getResourceAsStream("~"+datas);
// load the document
doc = PDDocument.load(reportsStream);
+
+ //search for all PDFBox
+ List<PDField> FieldList = doc.getDocumentCatalog().getAcroForm().getFields();
+
+ //display inside each box their name
+ for (PDField pdField : FieldList) {
+ pdField.setValue(pdField.getFullyQualifiedName());
+ }
+
// save the updated document to the new file and close
if (saveMode) {
doc.save(filePath);
1
0
r3242 - in trunk: lima-business/src/main/java/org/chorem/lima/business/ejb lima-business/src/main/java/org/chorem/lima/business/ejbinterface lima-business/src/main/java/org/chorem/lima/business/utils lima-callao/src/main/xmi
by vsalaun@users.chorem.org 02 Aug '11
by vsalaun@users.chorem.org 02 Aug '11
02 Aug '11
Author: vsalaun
Date: 2011-08-02 13:39:58 +0200 (Tue, 02 Aug 2011)
New Revision: 3242
Url: http://chorem.org/repositories/revision/lima/3242
Log:
#347 update accounting.zargo for vat + vat services
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/HttpServerServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/VatStatementServiceImpl.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/ImportService.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/VatStatementService.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/VatStatementServiceLocal.java
trunk/lima-business/src/main/java/org/chorem/lima/business/utils/ImportExportEntityEnum.java
trunk/lima-callao/src/main/xmi/accounting.zargo
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 2011-08-02 11:39:02 UTC (rev 3241)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/DocumentServiceImpl.java 2011-08-02 11:39:58 UTC (rev 3242)
@@ -77,6 +77,7 @@
import org.chorem.lima.entity.FinancialTransaction;
import org.chorem.lima.entity.Identity;
import org.chorem.lima.entity.LimaCallaoDAOHelper;
+import org.chorem.lima.entity.VatStatement;
import org.nuiton.topia.TopiaContext;
import org.nuiton.topia.TopiaContextFactory;
import org.nuiton.topia.TopiaException;
@@ -1458,17 +1459,22 @@
//############## VAT ##############
@Override
- public void createVatDocuments(Date beginDate, Date endDate, FormatsEnum format, String autocomplete, String datas)
+ public void createVatDocuments(Date beginDate, Date endDate, FormatsEnum format, String autocomplete)
throws LimaException, IOException, COSVisitorException {
+ TopiaContext transaction = null;
+
+ String filePath =
+ path+File.separator+DocumentsEnum.VAT.getFileName()+format.getExtension();
+
+ PDDocument doc = null;
+ InputStream reportsStream =
+ DocumentServiceImpl.class.getResourceAsStream("/reports/vat_form_fr.pdf");
+
try {
- String filePath =
- path+File.separator+DocumentsEnum.VAT.getFileName()+format.getExtension();
+ transaction = beginTransaction();
- PDDocument doc = null;
- InputStream reportsStream =
- DocumentServiceImpl.class.getResourceAsStream("/reports/vat_form_fr.pdf");
// load the document
doc = PDDocument.load(reportsStream);
@@ -1556,75 +1562,15 @@
//end of page one
//page two
-
- String[] bigDecimalList = datas.split("_");
-
- //sets parameters to use for each TextField
- ArrayList<ArrayList<String>> listOfLists = new ArrayList<ArrayList<String>>();
- // Structure : box name on the pdf | text showed on the pdf | amount
- listOfLists.add(new ArrayList<String>(Arrays.asList("b1.b1", "Ventes, prestations de services", bigDecimalList[2])));
- listOfLists.add(new ArrayList<String>(Arrays.asList("b2.b2", "Autres opérations imposables", bigDecimalList[3])));
- listOfLists.add(new ArrayList<String>(Arrays.asList("b3.b3", "Achats de prestations de services intracommunautaires", bigDecimalList[4])));
- listOfLists.add(new ArrayList<String>(Arrays.asList("b4.b4", "Acquisitions intracommunautaires", bigDecimalList[5])));
- listOfLists.add(new ArrayList<String>(Arrays.asList("b5.b5", "Livraisons de gaz naturel ou d'électricité imposables en France", bigDecimalList[6])));
- listOfLists.add(new ArrayList<String>(Arrays.asList("b6.b6", "Achats de biens ou de prestations de services réalisées auprès d'un assujetti non établi en France", bigDecimalList[7])));
- listOfLists.add(new ArrayList<String>(Arrays.asList("b7.b7", "Régularisations (imposables)", bigDecimalList[8])));
-
-
- listOfLists.add(new ArrayList<String>(Arrays.asList("b8.b8", "Exportations hors CE", bigDecimalList[11])));
- listOfLists.add(new ArrayList<String>(Arrays.asList("b9.b9", "Autres opérations non imposables", bigDecimalList[12])));
- listOfLists.add(new ArrayList<String>(Arrays.asList("b10.b10", "Livraisons intracommunautaires", bigDecimalList[13])));
- listOfLists.add(new ArrayList<String>(Arrays.asList("b11.b11", "Livraisons de gaz naturel ou d'électricité non imposables en France", bigDecimalList[14])));
- listOfLists.add(new ArrayList<String>(Arrays.asList("b12.b12", "Achats de franchise", bigDecimalList[15])));
- listOfLists.add(new ArrayList<String>(Arrays.asList("b13.b13", "Ventes de biens ou prestations de services réalisées aurpès d'un assujetti non établi en France", bigDecimalList[16])));
- listOfLists.add(new ArrayList<String>(Arrays.asList("b14.b14", "Régularisations (non imposables)", bigDecimalList[17])));
-
-
-
- listOfLists.add(new ArrayList<String>(Arrays.asList("b15.b15", "Taux normal 19,6% (Base hors taxe)", bigDecimalList[23])));
- listOfLists.add(new ArrayList<String>(Arrays.asList("b23.b23", "Taux normal 19,6% (Taxe due)", bigDecimalList[24])));
-
- listOfLists.add(new ArrayList<String>(Arrays.asList("b16.b16", "Taux réduit 5,5% (Base hors taxe)", bigDecimalList[25])));
- listOfLists.add(new ArrayList<String>(Arrays.asList("b24.b24", "Taux réduit 5,5% (Taxe due)", bigDecimalList[26])));
-
- listOfLists.add(new ArrayList<String>(Arrays.asList("b18.b18", "Taux normal 8,5% (Base hors taxe)", bigDecimalList[29])));
- listOfLists.add(new ArrayList<String>(Arrays.asList("b26.b26", "Taux normal 8,5% (Taxe due)", bigDecimalList[30])));
-
- listOfLists.add(new ArrayList<String>(Arrays.asList("b19.b19", "Taux réduit 2,1% (Base hors taxe)", bigDecimalList[31])));
- listOfLists.add(new ArrayList<String>(Arrays.asList("b27.b27", "Taux réduit 2,1% (Taxe due)", bigDecimalList[32])));
-
- listOfLists.add(new ArrayList<String>(Arrays.asList("b21.b21", "Ancien taux (Base hors taxe)", bigDecimalList[35])));
- listOfLists.add(new ArrayList<String>(Arrays.asList("b29.b29", "Ancien taux (Taxe due)", bigDecimalList[36])));
-
- listOfLists.add(new ArrayList<String>(Arrays.asList("b22.b22", "Opérations imposables à un autre taux (France métropolitaine ou DOM) (Base hors taxe)", bigDecimalList[37])));
- listOfLists.add(new ArrayList<String>(Arrays.asList("b30.b30", "Opérations imposables à un autre taux (France métropolitaine ou DOM) (Taxe due)", bigDecimalList[38])));
-
- listOfLists.add(new ArrayList<String>(Arrays.asList("b31.b31", "TVA antérieurement déduite à reverser", bigDecimalList[40])));
- listOfLists.add(new ArrayList<String>(Arrays.asList("b32.b32", "Total de la TVA brute due (lignes 08 à 15)", bigDecimalList[41])));
- listOfLists.add(new ArrayList<String>(Arrays.asList("b33.b33", "Dont TVA sur acquisitions intracommunautaires", bigDecimalList[42])));
- listOfLists.add(new ArrayList<String>(Arrays.asList("b34.b34", "Dont TVA sur opérations à destination de Monaco", bigDecimalList[43])));
-
-
- listOfLists.add(new ArrayList<String>(Arrays.asList("b35.b35", "Biens constituant des immobilisations", bigDecimalList[46])));
- listOfLists.add(new ArrayList<String>(Arrays.asList("b36.b36", "Autres biens et services", bigDecimalList[47])));
- listOfLists.add(new ArrayList<String>(Arrays.asList("b37.b37", "Autre TVA à déduire", bigDecimalList[48])));
- listOfLists.add(new ArrayList<String>(Arrays.asList("b38.b38", "Report du crédit apparaissant ligne 27 de la précédente déclaration", bigDecimalList[49])));
- listOfLists.add(new ArrayList<String>(Arrays.asList("total1.total1", "Total TVA déductible (lignes 19 à 22)", bigDecimalList[50])));
- listOfLists.add(new ArrayList<String>(Arrays.asList("b39.b39", "Dont TVA non perçue récupérable par les assujettis disposant d’un établissement stable dans les DOM", bigDecimalList[51])));
-
- listOfLists.add(new ArrayList<String>(Arrays.asList("b40.b40", "Crédit de TVA", bigDecimalList[55])));
- listOfLists.add(new ArrayList<String>(Arrays.asList("b41.b41", "Remboursement demandé sur formulaire", bigDecimalList[56])));
- listOfLists.add(new ArrayList<String>(Arrays.asList("b42.b42", "Crédit à reporter", bigDecimalList[57])));
-
- listOfLists.add(new ArrayList<String>(Arrays.asList("b43.b43", "TVA nette due", bigDecimalList[60])));
- listOfLists.add(new ArrayList<String>(Arrays.asList("b44.b44", "Taxes assimilées calculées sur annexe no 3310 A", bigDecimalList[61])));
- listOfLists.add(new ArrayList<String>(Arrays.asList("b45.b45", "Sommes à imputer, exprimées en euros, y compris acompte congés", bigDecimalList[62])));
- listOfLists.add(new ArrayList<String>(Arrays.asList("b46.b46", "Sommes à ajouter, exprimées en euros, y compris acompte congés", bigDecimalList[63])));
- listOfLists.add(new ArrayList<String>(Arrays.asList("b47.b47", "Total à payer", bigDecimalList[64])));
-
-
- for (List<String> list : listOfLists) {
- fields.setField(doc, list.get(0), list.get(2));
+
+ List<VatStatement> vatStatementsList = vatStatementService.getAllVatStatements();
+ for (VatStatement vatStatement: vatStatementsList) {
+ //search for amount to display
+ BigDecimal amount = vatStatementService.vatStatementAmounts(vatStatement, beginDate, endDate).getAmount();
+ //display amount only if it is a child and has a BoxName
+ if (vatStatement.getBoxName() != null && !vatStatement.isHeader()) {
+ fields.setField(doc, vatStatement.getBoxName(), amount.toString());
+ }
}
//end of page two
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 2011-08-02 11:39:02 UTC (rev 3241)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ExportServiceImpl.java 2011-08-02 11:39:58 UTC (rev 3242)
@@ -386,11 +386,11 @@
/**
* Local methode, export vatstatements from database
* vatstatement Structure : TYPE | label | header |
- * | accounts | subAmount | headerAmount | masterVatStatement | editable
+ * | accounts | subAmount | headerAmount | masterVatStatement
*/
public void exportVatStatementChartAsCSV(CSVWriter csvWriter, TopiaContext topiaContext) throws LimaException {
try {
- String[] nextLine = new String[9];
+ String[] nextLine = new String[8];
// Get all Vatstatements
VatStatementDAO vatStatementDAO =
LimaCallaoDAOHelper.getVatStatementDAO(topiaContext);
@@ -420,8 +420,6 @@
masterVatStatement.getLabel();
}
nextLine[7] = masterVatStatementString;
- nextLine[8] = Boolean.toString(
- vatStatement.getEditable());
csvWriter.writeNext(nextLine);
}
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/HttpServerServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/HttpServerServiceImpl.java 2011-08-02 11:39:02 UTC (rev 3241)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/HttpServerServiceImpl.java 2011-08-02 11:39:58 UTC (rev 3242)
@@ -128,7 +128,6 @@
String beginDate = req.getParameter("beginDate");
String endDate = req.getParameter("endDate");
String autocomplete = req.getParameter("autocomplete");
- String datas = req.getParameter("datas");
//if image
if (imageParam != null){
@@ -174,7 +173,7 @@
case VAT:
documentService.createVatDocuments(
beginDateFormat, endDateFormat, formatsEnum,
- autocomplete, datas);
+ autocomplete);
break;
}
} catch (LimaException eeeLE) {
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 2011-08-02 11:39:02 UTC (rev 3241)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java 2011-08-02 11:39:58 UTC (rev 3242)
@@ -26,7 +26,11 @@
package org.chorem.lima.business.ejb;
import static org.nuiton.i18n.I18n._;
+
+import java.io.File;
+import java.io.FileInputStream;
import java.io.IOException;
+import java.io.InputStream;
import java.io.StringReader;
import java.math.BigDecimal;
import java.text.ParseException;
@@ -43,9 +47,12 @@
import java.util.TreeMap;
import javax.ejb.EJB;
import javax.ejb.Stateless;
+
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.apache.pdfbox.exceptions.COSVisitorException;
+import org.apache.pdfbox.pdmodel.PDDocument;
import org.chorem.lima.FinancialStatementWayEnum;
import org.chorem.lima.beans.AccountEBP;
import org.chorem.lima.beans.AccountEBPImpl;
@@ -77,6 +84,7 @@
import org.chorem.lima.business.ejbinterface.ImportServiceLocal;
import org.chorem.lima.business.ejbinterface.VatStatementServiceLocal;
import org.chorem.lima.business.utils.AccountEBPComparator;
+import org.chorem.lima.business.utils.DocumentsEnum;
import org.chorem.lima.business.utils.EntryEBPComparator;
import org.chorem.lima.business.utils.FiscalPeriodComparator;
import org.chorem.lima.business.utils.ImportExportEntityEnum;
@@ -627,7 +635,47 @@
return result.toString();
}
+ /**
+ * Remote method to call entity import from UI
+ * This method let import just on type of entity
+ * @throws IOException
+ * @throws COSVisitorException
+ */
+ @Override
+ public String importAsPDF(String datas, ImportExportEntityEnum importExportEntityEnum, boolean saveMode) throws LimaException {
+ StringBuffer result = new StringBuffer();
+
+ try {
+ String path = LimaConfig.getInstance().getReportsDir();
+
+ String filePath =
+ path+File.separator+DocumentsEnum.VAT.getFileName()+".pdf";
+
+ PDDocument doc = null;
+ InputStream reportsStream = new FileInputStream(datas);
+ //DocumentServiceImpl.class.getResourceAsStream("/reports/vat_form_fr.pdf");
+ //DocumentServiceImpl.class.getResourceAsStream("~"+datas);
+ // load the document
+ doc = PDDocument.load(reportsStream);
+ // save the updated document to the new file and close
+ if (saveMode) {
+ doc.save(filePath);
+ }
+ doc.close();
+ }
+ catch (IOException eee) {
+ log.error("Can't read vat pdf", eee);
+ result.append("Can't read vat pdf");
+ }
+ catch (COSVisitorException eee) {
+ log.error("Can't save vat pdf", eee);
+ result.append("Can't save vat pdf");
+ }
+ return result.toString();
+ }
+
+
// ################ Import entities an put to lists ################
/**
@@ -848,7 +896,7 @@
/**
* Import and create vatstatement Structure : TYPE | boxName | label | header
- * | accounts | subAmount | headerAmount | masterVatStatement | editable
+ * | accounts | subAmount | headerAmount | masterVatStatement
*/
public String importVatStatementChartCSV(String[] nextLine,
@@ -864,7 +912,6 @@
String subAmount = nextLine[5];
String headerAmount = nextLine[6];
String masterVatStatement = nextLine[7];
- String editable = nextLine[8];
try {
@@ -882,7 +929,6 @@
vatStatementImport.setSubAmount(subAmount);
vatStatementImport.setHeaderAmount(headerAmount);
vatStatementImport.setMasterVatStatement(masterVatStatement);
- vatStatementImport.setEditable(editable);
// put it in hashlinkedlist
if (vatStatements.containsKey(label)){
@@ -1080,9 +1126,7 @@
.getSubAmount()));
vatStatement.setHeaderAmount(vatStatement
.getHeaderAmount());
- vatStatement.setEditable(Boolean
- .parseBoolean(vatStatementImport
- .getEditable()));
+ vatStatement.setAmount(BigDecimal.ZERO);
vatStatementService
.createVatStatementWithTransaction(
masterVatStatement,
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/VatStatementServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/VatStatementServiceImpl.java 2011-08-02 11:39:02 UTC (rev 3241)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/VatStatementServiceImpl.java 2011-08-02 11:39:58 UTC (rev 3242)
@@ -442,6 +442,7 @@
vatStatementAmounts(subVatStatement,
selectedBeginDate, selectedEndDate, topiaContext);
vatStatementAmounts.setLabel(subVatStatement.getLabel());
+ vatStatementAmounts.setAmount(subVatStatement.getAmount());
if (!subVatStatement.getHeader()){
//on calcul
amount =
@@ -464,6 +465,7 @@
new VatStatementAmountsImpl();
header.setLabel(headerVatStatementAmounts.getLabel());
header.setLevel(headerVatStatementAmounts.getLevel());
+ header.setAmount(headerVatStatementAmounts.getAmount());
header.setHeader(true);
//ajoute header
subResult.add(header);
@@ -498,6 +500,7 @@
vatStatementAmounts.setLabel(vatStatement.getLabel());
vatStatementAmounts.setHeader(vatStatement.getHeader());
vatStatementAmounts.setLevel(vatStatement.getLevel());
+ vatStatementAmounts.setAmount(vatStatement.getAmount());
}
result.setVatStatementAmounts(vatStatementAmounts);
result.setListResult(subResult);
@@ -507,7 +510,57 @@
}
return result;
}
+
+ @Override
+ public void removeVatStatement(VatStatement vatStatement) throws LimaException {
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+ VatStatementDAO vatStatementDAO =
+ LimaCallaoDAOHelper.getVatStatementDAO(transaction);
+
+
+ // remove vatstatement
+ VatStatement vatStatementToDelete =
+ vatStatementDAO.findByTopiaId(
+ vatStatement.getTopiaId());
+ vatStatementDAO.delete(vatStatementToDelete);
+
+ //get all subVatStatement
+ List<VatStatement> vatStatements =
+ getAllChildrenVatStatement(vatStatement,
+ new ArrayList<VatStatement>());
+
+ //if VatStatement have subVatStatement
+ if (vatStatements.size() > 0){
+ for (VatStatement subVatStatement : vatStatements) {
+ VatStatement subVatStatementToDelete =
+ vatStatementDAO.findByTopiaId(
+ subVatStatement.getTopiaId());
+ vatStatementDAO.delete(subVatStatementToDelete);
+ }
+ }
+
+ //commit
+ commitTransaction(transaction);
+
+ }
+ catch (TopiaException ex) {
+ doCatch(transaction, ex, log);
+ }
+ finally {
+ doFinally(transaction, log);
+ }
+ }
+
+ @Override
+ public void removeAllVatStatement() throws LimaException {
+ for (VatStatement vatStatement : getChildrenVatStatement(null)) {
+ removeVatStatement(vatStatement);
+ }
+ }
+
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 2011-08-02 11:39:02 UTC (rev 3241)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/DocumentService.java 2011-08-02 11:39:58 UTC (rev 3242)
@@ -47,6 +47,6 @@
void createEntryBooksDocuments(Date beginDate, Date endDate, FormatsEnum format) throws LimaException;
void createBalanceDocuments(Date beginDate, Date endDate, FormatsEnum format) throws LimaException;
void createGeneralEntryBooksDocuments(Date beginDate, Date endDate, FormatsEnum format) throws LimaException;
- void createVatDocuments(Date beginDate, Date endDate, FormatsEnum format, String autocomplete, String datas) throws LimaException, IOException, COSVisitorException;;
+ void createVatDocuments(Date beginDate, Date endDate, FormatsEnum format, String autocomplete) throws LimaException, IOException, COSVisitorException;
}
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ImportService.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ImportService.java 2011-08-02 11:39:02 UTC (rev 3241)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ImportService.java 2011-08-02 11:39:58 UTC (rev 3242)
@@ -76,4 +76,6 @@
String importAllAsCSV(String path) throws LimaException;
String importAsCSV(String datas, ImportExportEntityEnum importExportEntityEnum) throws LimaException;
+
+ String importAsPDF(String datas, ImportExportEntityEnum importExportEntityEnum, boolean saveMode) throws LimaException;
}
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/VatStatementService.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/VatStatementService.java 2011-08-02 11:39:02 UTC (rev 3241)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/VatStatementService.java 2011-08-02 11:39:58 UTC (rev 3242)
@@ -58,6 +58,10 @@
VatStatement findVatStatementByString(String label) throws LimaException;
List<VatStatementAmounts> vatStatementReport(Date beginDate, Date endDate) throws LimaException;
+
+ void removeAllVatStatement() throws LimaException;
+
+ void removeVatStatement(VatStatement vatStatement) throws LimaException;
}
\ No newline at end of file
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/VatStatementServiceLocal.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/VatStatementServiceLocal.java 2011-08-02 11:39:02 UTC (rev 3241)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/VatStatementServiceLocal.java 2011-08-02 11:39:58 UTC (rev 3242)
@@ -28,6 +28,7 @@
import javax.ejb.Local;
import org.chorem.lima.beans.VatStatementAmounts;
+import org.chorem.lima.beans.VatStatementDatas;
import org.chorem.lima.business.LimaException;
import org.chorem.lima.entity.VatStatement;
import org.nuiton.topia.TopiaContext;
@@ -40,8 +41,12 @@
VatStatement masterVatStatement, VatStatement vatStatement,
TopiaContext transaction) throws LimaException;
- VatStatementAmounts vatStatementAmounts(VatStatement vatStatement,
+ public VatStatementAmounts vatStatementAmounts(VatStatement vatStatement,
Date selectedBeginDate, Date selectedEndDate,
TopiaContext topiacontext) throws LimaException, TopiaException;
+
+ public VatStatementDatas vatStatementReport(VatStatement vatStatement,
+ Date selectedBeginDate, Date selectedEndDate, VatStatementDatas result,
+ TopiaContext topiaContext) throws LimaException, TopiaException;
}
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 2011-08-02 11:39:02 UTC (rev 3241)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/utils/ImportExportEntityEnum.java 2011-08-02 11:39:58 UTC (rev 3242)
@@ -30,7 +30,7 @@
ACCOUNT("ACCN"), ENTRYBOOK("ENBK"), FINANCIALSTATEMENT("FNST"),
FISCALPERIOD("FSCP"), CLOSEDPERIODICENTRYBOOK("CPEB"),
FINANCIALTRANSACTION("FTRC"), ENTRY("NTRY"),
- VATSTATEMENT("VAT"), IDENTITY("IDNT");
+ VATSTATEMENT("VAT"), IDENTITY("IDNT"), VATPDF("VATPDF");
private final String label;
private ImportExportEntityEnum(String label) {
Modified: trunk/lima-callao/src/main/xmi/accounting.zargo
===================================================================
(Binary files differ)
1
0
r3241 - in trunk/lima-swing/src/main: java/org/chorem/lima/enums java/org/chorem/lima/ui java/org/chorem/lima/ui/importexport java/org/chorem/lima/util resources/i18n
by vsalaun@users.chorem.org 02 Aug '11
by vsalaun@users.chorem.org 02 Aug '11
02 Aug '11
Author: vsalaun
Date: 2011-08-02 13:39:02 +0200 (Tue, 02 Aug 2011)
New Revision: 3241
Url: http://chorem.org/repositories/revision/lima/3241
Log:
#347 update import/export for vat
Modified:
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/importexport/ImportExport.java
trunk/lima-swing/src/main/java/org/chorem/lima/util/DialogHelper.java
trunk/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties
trunk/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/enums/ImportExportEnum.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/enums/ImportExportEnum.java 2011-08-02 11:37:55 UTC (rev 3240)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/enums/ImportExportEnum.java 2011-08-02 11:39:02 UTC (rev 3241)
@@ -36,6 +36,7 @@
CSV_ENTRYBOOKS_EXPORT(false, true), CSV_ENTRYBOOKS_IMPORT(true, true),
CSV_FINANCIALSTATEMENTS_EXPORT(false, true), CSV_FINANCIALSTATEMENTS_IMPORT(true, true),
CSV_VAT_EXPORT(false, true), CSV_VAT_IMPORT(true, true),
+ PDF_VAT_EXPORT(false, true), PDF_VAT_IMPORT(true, true),
EBP_ACCOUNTCHARTS_EXPORT(false, false), EBP_ENTRIES_EXPORT(false, false),
EBP_ACCOUNTCHARTS_IMPORT(true, false), EBP_ENTRIES_IMPORT(true, false);
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 2011-08-02 11:37:55 UTC (rev 3240)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainView.jaxx 2011-08-02 11:39:02 UTC (rev 3241)
@@ -170,8 +170,12 @@
actionIcon='charts-financialperiod'/>
<JMenuItem text="lima.charts.financialstatement" onActionPerformed='getHandler().showFinancialStatementView(this)'
actionIcon='charts-financialstatements'/>
- <JMenuItem text="lima.charts.vatstatement" onActionPerformed='getHandler().showVatChartView(this)'
- actionIcon='charts-vatstatements'/>
+ <JMenu text="lima.charts.vatstatement" actionIcon='charts-vatstatements'>
+ <JMenuItem text="lima.charts.vatstatement" onActionPerformed='getHandler().showVatChartView(this)'
+ actionIcon='charts-vatstatements'/>
+ <JMenuItem text="lima.charts.vatpdf" onActionPerformed='getHandler().showImportExportView(this, ImportExportEnum.PDF_VAT_IMPORT)'
+ actionIcon='charts-vatstatements'/>
+ </JMenu>
</JMenu>
<JMenu text="lima.entries" mnemonic="{'E'}">
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 2011-08-02 11:37:55 UTC (rev 3240)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java 2011-08-02 11:39:02 UTC (rev 3241)
@@ -172,6 +172,13 @@
datas = extractFile(filePath, charset.getEncoding());
result = importService.importAsCSV(datas, ImportExportEntityEnum.VATSTATEMENT);
break;
+ case PDF_VAT_IMPORT:
+ int response = JOptionPane.showConfirmDialog(waitView,
+ _("lima.importexport.usevatpdf"),
+ _("lima.common.confirmation"), JOptionPane.YES_NO_OPTION);
+ datas = extractFile(filePath, charset.getEncoding());
+ result = importService.importAsPDF(filePath, ImportExportEntityEnum.VATPDF, (response == JOptionPane.YES_OPTION));
+ break;
case EBP_ACCOUNTCHARTS_IMPORT:
//For windows ebp
datas = extractFile(filePath, EncodingEnum.ISOLATIN1.getEncoding());
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/util/DialogHelper.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/util/DialogHelper.java 2011-08-02 11:37:55 UTC (rev 3240)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/util/DialogHelper.java 2011-08-02 11:39:02 UTC (rev 3241)
@@ -51,6 +51,17 @@
}
/** @deprecated */
+ /*
+ * Use instead: JOptionPane.showMessageDialog (String message,String titre,int type)
+ *
+ * for e.g:
+ * JOptionPane.showMessageDialog(
+ view,
+ _("lima.importexport.export.terminated"),
+ _("lima.importexport.export"),
+ JOptionPane.INFORMATION_MESSAGE);
+ *
+ */
public static void showMessageDialog(String message) {
JFrame f = new JFrame();
f.setIconImage(Resource.getIcon("icons/lima.png").getImage());
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 2011-08-02 11:37:55 UTC (rev 3240)
+++ trunk/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties 2011-08-02 11:39:02 UTC (rev 3241)
@@ -39,7 +39,14 @@
lima.charts.fiscalperiod.question.morethan12=This period is longer than 12 months. Do you really create this ?
lima.charts.fiscalperiod.question.newyear=Do you want to create a new fiscal year ?
lima.charts.fiscalyear=Fiscal Years
+lima.charts.vatpdf=PDF structure
lima.charts.vatstatement=VAT statement chart
+lima.charts.vatstatement.base=Base VAT statement chart
+lima.charts.vatstatement.deleteparent=Delete subcategories before this line
+lima.charts.vatstatement.developed=Developped VAT statement chart
+lima.charts.vatstatement.nothing=No vat statement chart
+lima.charts.vatstatement.question.remove=Do you really want to delete this line ?
+lima.charts.vatstatement.shortened=Shortened vat statement chart
lima.common.account=Account
lima.common.amount=Amount
lima.common.amountcredit=Credit amount
@@ -61,6 +68,7 @@
lima.common.filter=Filter
lima.common.fin=Terminated
lima.common.globalexception=Global lima exception
+lima.common.info=Information
lima.common.label=Label
lima.common.movmentedfilter=Accounts filtered
lima.common.next=Next
@@ -193,6 +201,7 @@
lima.importexport.import.terminated=Import terminated
lima.importexport.importcsv=Import CSV
lima.importexport.importebp=Import EBP
+lima.importexport.usevatpdf=Would you like to use this PDF when editing the VAT document ?
lima.importexport.vatstatements=VAT chart
lima.importexport.wait=Job in progress…
lima.init.closed=Lima closed at %1$s
@@ -272,6 +281,16 @@
lima.tooltip.filter=<html>Regular expression \:<br/>- accounts interval i..j <br/>- accounts list i,j,k <br/>- Exclude an account -i</html>
lima.tooltip.lettering=<html>Add a letter on many entries <br/>Select many rows with combination ctrl + click</html>
lima.vatreport.listerror=Can't get entries list
+lima.vatstatement.accounts=List of accounts
+lima.vatstatement.boxname=PDF BoxName
+lima.vatstatement.check=
+lima.vatstatement.delete=Delete actual VAT statement chart before import new
+lima.vatstatement.header=
+lima.vatstatement.label=Label
+lima.vatstatement.masteramount=
+lima.vatstatement.mastervatstatement=
+lima.vatstatement.movement.add=Add movement
+lima.vatstatement.subamount=
lima.warning.nimbus.landf=Could not find Numbus Look&Feel
limma.config.thousandseparator.description=
nuitonutil.error.applicationconfig.save=
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 2011-08-02 11:37:55 UTC (rev 3240)
+++ trunk/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties 2011-08-02 11:39:02 UTC (rev 3241)
@@ -27,7 +27,7 @@
lima.charts.financialstatement=Plan BCR
lima.charts.financialstatement.base=Plan BCR de base
lima.charts.financialstatement.developed=Plan BCR développé
-lima.charts.financialstatement.nothing=<html><center>Aucun plan BCR chargé<br/>Veuillez sélectionner un plan par défault, <br/>importer un plan personnalisé<br/> ou annuler pour créer votre propre plan.</center></html>
+lima.charts.financialstatement.nothing=<html><center>Aucun plan BCR chargé<br/>Veuillez sélectionner un plan par défaut, <br/>importer un plan personnalisé<br/> ou annuler pour créer votre propre plan.</center></html>
lima.charts.financialstatement.shortened=Plan BCR abrégé
lima.charts.financialtransaction.question.removeentry=Voulez-vous supprimer cette ligne de transaction?
lima.charts.financialtransaction.question.removetransaction=Voulez-vous supprimer cette transaction?
@@ -39,7 +39,14 @@
lima.charts.fiscalperiod.question.morethan12=La période sélectionnée n'est pas de 12 mois, voulez-vous continuer ?
lima.charts.fiscalperiod.question.newyear=Voulez vous créer un nouvel exercice?
lima.charts.fiscalyear=Exercices
+lima.charts.vatpdf=Structure du pdf
lima.charts.vatstatement=Plan TVA
+lima.charts.vatstatement.base=Plan TVA de base
+lima.charts.vatstatement.deleteparent=Veuillez supprimer les sous-catégories de cette ligne
+lima.charts.vatstatement.developed=Plan TVA développé
+lima.charts.vatstatement.nothing=<html><center>Aucun plan TVA chargé<br/>Veuillez sélectionner un plan par défaut, <br/>importer un plan personnalisé<br/> ou annuler pour créer votre propre plan.</center></html>
+lima.charts.vatstatement.question.remove=Etes vous sur de vouloir supprimer cette ligne ?
+lima.charts.vatstatement.shortened=Plan TVA abrégé
lima.common.account=Compte
lima.common.amount=Montant
lima.common.amountcredit=Total Crédit
@@ -61,6 +68,7 @@
lima.common.filter=Filtrer
lima.common.fin=Terminé
lima.common.globalexception=Global lima exception
+lima.common.info=Information
lima.common.label=Libellé
lima.common.movmentedfilter=Comptes mouvementés
lima.common.next=Suivant
@@ -193,6 +201,7 @@
lima.importexport.import.terminated=Import terminé
lima.importexport.importcsv=Import CSV
lima.importexport.importebp=Import EBP
+lima.importexport.usevatpdf=Voulez-vous utilser ce PDF pour la déclaration de TVA ?
lima.importexport.vatstatements=Plan TVA
lima.importexport.wait=Traitement en cours …
lima.init.closed=Lima fermé à %1$s
@@ -224,7 +233,6 @@
lima.reports.financialstatement=Bilan et Compte de résultat
lima.reports.ledger=Grand Livre
lima.reports.vat=Edition TVA
-lima.reports.vatstatement=
lima.response.no=Non
lima.response.yes=Oui
lima.splash.1=Chargement des services...
@@ -272,6 +280,16 @@
lima.tooltip.filter=<html>Expression régulière \:<br/>- intervalle de compte i..j <br/>- liste de compte i,j,k <br/>- Exclure un compte -i</html>
lima.tooltip.lettering=<html>Pour ajouter une lettre à plusieurs écritures <br/>Sélectionner plusieurs lignes avec la combinaison ctrl + click</html>
lima.vatreport.listerror=Erreur lors de la récupération des données de la liste
+lima.vatstatement.accounts=Liste des comptes
+lima.vatstatement.boxname=PDF BoxName
+lima.vatstatement.check=
+lima.vatstatement.delete=Supprimer le plan TVA actuel avant d'importer
+lima.vatstatement.header=
+lima.vatstatement.label=Libellé
+lima.vatstatement.masteramount=
+lima.vatstatement.mastervatstatement=
+lima.vatstatement.movement.add=Ajouter un regrouprement
+lima.vatstatement.subamount=
lima.warning.nimbus.landf=Le look and feel nymbus n'a pas été trouvé
limma.config.thousandseparator.description=
nuitonutil.error.applicationconfig.save=
1
0
r3240 - trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatchart
by vsalaun@users.chorem.org 02 Aug '11
by vsalaun@users.chorem.org 02 Aug '11
02 Aug '11
Author: vsalaun
Date: 2011-08-02 13:37:55 +0200 (Tue, 02 Aug 2011)
New Revision: 3240
Url: http://chorem.org/repositories/revision/lima/3240
Log:
#347 update VatChart
Added:
trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatchart/VatChartImportForm.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatchart/VatChartMovementForm.jaxx
Modified:
trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatchart/VatChartTreeTable.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatchart/VatChartTreeTableModel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatchart/VatChartView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatchart/VatChartViewHandler.java
Added: trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatchart/VatChartImportForm.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatchart/VatChartImportForm.jaxx (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatchart/VatChartImportForm.jaxx 2011-08-02 11:37:55 UTC (rev 3240)
@@ -0,0 +1,67 @@
+<JDialog modal="true"
+ defaultCloseOperation="{JDialog.DO_NOTHING_ON_CLOSE}"
+ onWindowClosing="performCancel();">
+
+ <jaxx.runtime.swing.JAXXButtonGroup id="radioButtons" javaBean='new JAXXButtonGroup()'/>
+ <Boolean id="addState" javaBean='true'/>
+
+ <script>
+ <![CDATA[
+ import org.chorem.lima.enums.VatStatementsChartEnum;
+ getRootPane().setDefaultButton(ok);
+ protected void performCancel() {
+ getRadioButtons().setSelectedValue(null);
+ dispose();
+ }
+ ]]>
+ </script>
+
+ <Table>
+ <row>
+ <cell><JLabel text='lima.charts.vatstatement.nothing' /></cell>
+ </row>
+ <row>
+ <cell>
+ <JRadioButton text='lima.charts.vatstatement.shortened' value='{VatStatementsChartEnum.SHORTENED}' buttonGroup="{getRadioButtons()}"
+ selected='true'/>
+ </cell>
+ </row>
+ <row>
+ <cell>
+ <JRadioButton text='lima.charts.vatstatement.base' value='{VatStatementsChartEnum.BASE}' buttonGroup="{getRadioButtons()}"
+ selected='true'/>
+ </cell>
+ </row>
+ <row>
+ <cell>
+ <JRadioButton text='lima.charts.vatstatement.developed' value='{VatStatementsChartEnum.DEVELOPED}' buttonGroup="{getRadioButtons()}"
+ selected='true'/>
+ </cell>
+ </row>
+ <row>
+ <cell>
+ <JRadioButton text='lima.importexport.import' value='{VatStatementsChartEnum.IMPORT}' buttonGroup="{getRadioButtons()}"
+ selected='true'/>
+ </cell>
+ </row>
+ <row>
+ <cell>
+ <JCheckBox id='deleteVatStatementChart' text='lima.vatstatement.delete' selected='false'/>
+ </cell>
+ </row>
+ <row>
+ <cell>
+ <Table>
+ <row>
+ <cell fill="none">
+ <JButton text="lima.common.cancel" onActionPerformed="performCancel()"/>
+ </cell>
+ <cell fill="none">
+ <JButton id="ok" text="lima.common.ok" onActionPerformed="dispose()"/>
+ </cell>
+ </row>
+ </Table>
+ </cell>
+ </row>
+ </Table>
+</JDialog>
\ No newline at end of file
Added: trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatchart/VatChartMovementForm.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatchart/VatChartMovementForm.jaxx (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatchart/VatChartMovementForm.jaxx 2011-08-02 11:37:55 UTC (rev 3240)
@@ -0,0 +1,76 @@
+<JDialog modal="true"
+ defaultCloseOperation="{JDialog.DO_NOTHING_ON_CLOSE}"
+ onWindowClosing="performCancel();">
+
+ <org.chorem.lima.entity.VatStatement id="vatStatement" javaBean='null'/>
+ <Boolean id="addState" javaBean='true'/>
+
+ <script>
+ <![CDATA[
+
+ import org.chorem.lima.entity.VatStatementImpl;
+
+ getRootPane().setDefaultButton(ok);
+
+ protected void performCancel() {
+ setVatStatement(null);
+ dispose();
+ }
+
+ ]]>
+ </script>
+
+ <Table>
+
+ <row>
+ <cell fill="horizontal">
+ <JLabel text="lima.vatstatement.label"/>
+ </cell>
+ <cell fill="horizontal">
+ <JTextField id="labelTextField" text="{getVatStatement().getLabel()}"/>
+ <javax.swing.text.Document javaBean="getLabelTextField().getDocument()"
+ onInsertUpdate='getVatStatement().setLabel(getLabelTextField().getText())'
+ onRemoveUpdate='getVatStatement().setLabel(getLabelTextField().getText())' />
+ </cell>
+ </row>
+ <row>
+ <cell fill="horizontal">
+ <JLabel text="lima.vatstatement.boxname"/>
+ </cell>
+ <cell fill="horizontal">
+ <JTextField id="boxNameTextField" text="{getVatStatement().getBoxName()}"/>
+ <javax.swing.text.Document javaBean="getBoxNameTextField().getDocument()"
+ onInsertUpdate='getVatStatement().setBoxName(getBoxNameTextField().getText())'
+ onRemoveUpdate='getVatStatement().setBoxName(getBoxNameTextField().getText())' />
+ </cell>
+ </row>
+ <row>
+ <cell fill="horizontal">
+ <JLabel text="lima.vatstatement.accounts"/>
+ </cell>
+ <cell fill="horizontal">
+ <JTextField id="accountsTextField" text="{getVatStatement().getAccounts()}"/>
+ <javax.swing.text.Document javaBean="getAccountsTextField().getDocument()"
+ onInsertUpdate='getVatStatement().setAccounts(getAccountsTextField().getText())'
+ onRemoveUpdate='getVatStatement().setAccounts(getAccountsTextField().getText())' />
+ </cell>
+ </row>
+ <row>
+ <cell fill="horizontal">
+ <JLabel text="lima.vatstatement.mastervatstatement"/>
+ </cell>
+ <cell fill="horizontal">
+ <JTextField editable="{false}" id="masterVatStatementTextField"
+ text="{getVatStatement().getMasterVatStatement().getLabel()}" />
+ </cell>
+ </row>
+ <row>
+ <cell fill="none">
+ <JButton text="lima.common.cancel" onActionPerformed="performCancel()"/>
+ </cell>
+ <cell fill="none">
+ <JButton id="ok" text="lima.common.ok" onActionPerformed="dispose()"/>
+ </cell>
+ </row>
+ </Table>
+</JDialog>
\ No newline at end of file
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatchart/VatChartTreeTable.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatchart/VatChartTreeTable.java 2011-08-02 11:37:37 UTC (rev 3239)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatchart/VatChartTreeTable.java 2011-08-02 11:37:55 UTC (rev 3240)
@@ -24,14 +24,24 @@
*/
package org.chorem.lima.ui.vatchart;
+import java.awt.Color;
+import java.awt.Component;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
+import javax.swing.tree.TreePath;
+
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.chorem.lima.entity.VatStatement;
import org.jdesktop.swingx.JXTreeTable;
+import org.jdesktop.swingx.decorator.ColorHighlighter;
+import org.jdesktop.swingx.decorator.ComponentAdapter;
+import org.jdesktop.swingx.decorator.HighlightPredicate;
+import org.jdesktop.swingx.decorator.Highlighter;
+import org.jdesktop.swingx.treetable.TreeTableModel;
public class VatChartTreeTable extends JXTreeTable
implements KeyListener, MouseListener {
@@ -45,12 +55,48 @@
protected VatChartViewHandler handler;
+ private Highlighter colorLine;
+
public VatChartTreeTable(VatChartViewHandler handler) {
this.handler = handler;
addKeyListener(this);
addMouseListener(this);
+
+ //highlight missing box name lines
+ addMissingBoxNameColor();
+ }
+ /**
+ * Highlights line when line is a leaf and is missing its BoxName parameter
+ */
+ private void addMissingBoxNameColor() {
+ if (colorLine != null) {
+ removeHighlighter(colorLine);
+ }
+ HighlightPredicate predicate = new HighlightPredicate() {
+ @Override
+ public boolean isHighlighted(Component renderer,
+ ComponentAdapter adapter) {
+ JXTreeTable treeTable = handler.view.getTreeTable();
+ TreeTableModel treeTableModel = treeTable.getTreeTableModel();
+ TreePath treePath = treeTable.getPathForRow(adapter.row);
+ VatStatement vatStatement =
+ (VatStatement) treePath.getLastPathComponent();
+ boolean highlighted = false;
+ if (vatStatement.getBoxName() != null) {
+ if (treeTableModel.isLeaf(vatStatement) && vatStatement.getBoxName().isEmpty()) {
+ highlighted = true;
+ }
+ } else {
+ highlighted = true;
+ }
+ return highlighted;
+ }
+ };
+ colorLine =
+ new ColorHighlighter(predicate, new Color(255, 198, 209), null);
+ addHighlighter(colorLine);
}
@Override
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatchart/VatChartTreeTableModel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatchart/VatChartTreeTableModel.java 2011-08-02 11:37:37 UTC (rev 3239)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatchart/VatChartTreeTableModel.java 2011-08-02 11:37:55 UTC (rev 3240)
@@ -198,10 +198,11 @@
*/
public void addVatStatement(TreePath path, VatStatement vatStatement) throws LimaException {
// Calling account service
- VatStatement parentVatStatementHeader =
- (VatStatement) path.getLastPathComponent();
- if (parentVatStatementHeader == getRoot()) {
- parentVatStatementHeader = null;
+ //fixed bug when path is null
+ VatStatement parentVatStatementHeader = null;
+ if (path != null) {
+ parentVatStatementHeader =
+ (VatStatement) path.getLastPathComponent();
}
vatStatementService.createVatStatement(
parentVatStatementHeader, vatStatement);
@@ -221,6 +222,21 @@
vatStatementService.updateVatStatement(vatStatement);
modelSupport.fireTreeStructureChanged(path);
}
+
+ /**
+ * Remove vatStatement
+ *
+ * @param path
+ * @param object
+ * @throws LimaException
+ */
+ public void removeVatStatementObject(TreePath path, VatStatement vatStatement) throws LimaException {
+ // Calling account service
+ int index = getIndexOfChild(
+ path.getParentPath().getLastPathComponent(), vatStatement);
+ vatStatementService.removeVatStatement(vatStatement);
+ modelSupport.fireChildRemoved(path.getParentPath(), index, vatStatement);
+ }
@Override
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatchart/VatChartView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatchart/VatChartView.jaxx 2011-08-02 11:37:37 UTC (rev 3239)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatchart/VatChartView.jaxx 2011-08-02 11:37:55 UTC (rev 3240)
@@ -36,15 +36,41 @@
<row>
<cell fill="both" weightx="1" weighty="1" rows='6'>
<JScrollPane>
- <VatChartTreeTable id="treeTable"
+ <org.chorem.lima.ui.vatchart.VatChartTreeTableModel id="vatTreeTableModel"/>
+ <org.chorem.lima.ui.vatchart.VatChartTreeTable id="treeTable"
constructorParams="getHandler()"
selectionMode="{ListSelectionModel.SINGLE_SELECTION}"
- treeTableModel="{new org.chorem.lima.ui.vatchart.VatChartTreeTableModel()}"
- highlighters="{org.jdesktop.swingx.decorator.HighlighterFactory.createSimpleStriping(new java.awt.Color(222,222,222))}" />
+ treeTableModel="{getVatTreeTableModel()}" />
<javax.swing.ListSelectionModel
javaBean="getTreeTable().getSelectionModel()"
onValueChanged="setSelectedRow(treeTable.getSelectedRow() != -1)"/>
</JScrollPane>
</cell>
</row>
+ <row>
+ <cell fill="horizontal">
+ <JButton id="addVatStatementMovement" text="lima.vatstatement.movement.add"
+ onActionPerformed="getHandler().addVatStatementMovement()" />
+ </cell>
+ </row>
+ <row>
+ <cell fill="horizontal">
+ <JButton id="updateButton" text="lima.common.update"
+ onActionPerformed="getHandler().updateVatStatement()"
+ enabled="{isSelectedRow()}" />
+ </cell>
+ </row>
+ <row>
+ <cell fill="horizontal">
+ <JButton id="removeButton" text="lima.common.remove"
+ onActionPerformed="getHandler().removeVatStatement()"
+ enabled="{isSelectedRow()}" />
+ </cell>
+ </row>
+ <row>
+ <cell fill="horizontal">
+ <JButton id="importButton" text="lima.importexport.import"
+ onActionPerformed="getHandler().importVatStatementChart()" />
+ </cell>
+ </row>
</Table>
\ No newline at end of file
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatchart/VatChartViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatchart/VatChartViewHandler.java 2011-08-02 11:37:37 UTC (rev 3239)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatchart/VatChartViewHandler.java 2011-08-02 11:37:55 UTC (rev 3240)
@@ -24,13 +24,26 @@
*/
package org.chorem.lima.ui.vatchart;
+import static org.nuiton.i18n.I18n._;
+
+import java.math.BigDecimal;
+
+import javax.swing.JOptionPane;
+import javax.swing.tree.TreePath;
+
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.business.ImportServiceMonitorable;
+import org.chorem.lima.business.LimaBusinessException;
import org.chorem.lima.business.LimaException;
import org.chorem.lima.business.ServiceListener;
import org.chorem.lima.business.VatStatementServiceMonitorable;
+import org.chorem.lima.entity.VatStatement;
+import org.chorem.lima.entity.VatStatementImpl;
+import org.chorem.lima.enums.ImportExportEnum;
+import org.chorem.lima.enums.VatStatementsChartEnum;
import org.chorem.lima.service.LimaServiceFactory;
+import org.chorem.lima.ui.importexport.ImportExport;
import org.jdesktop.swingx.JXTreeTable;
public class VatChartViewHandler implements ServiceListener {
@@ -41,7 +54,7 @@
protected VatStatementServiceMonitorable vatStatementService;
protected VatChartView view;
-
+
protected VatChartViewHandler(VatChartView view) {
this.view = view;
@@ -52,11 +65,196 @@
ImportServiceMonitorable.class).addListener(this);
}
- public void refresh(){
- JXTreeTable treeTable = view.getTreeTable();
+ public void addVatStatementMovement(){
+
+ VatChartTreeTableModel treeTableModel =
+ (VatChartTreeTableModel) view.getTreeTable().getTreeTableModel();
+
+ int selectedRow = view.getTreeTable().getSelectedRow();
+ // get current selection path
+ TreePath treePath = null;
+ if (selectedRow == -1) {
+ treePath = null;
+ } else {
+ treePath = view.getTreeTable().getPathForRow(selectedRow);
+ }
+
+ VatStatement newVatChartMovement = new VatStatementImpl();
+ VatChartMovementForm vatChartMovementForm =
+ new VatChartMovementForm(view);
+ VatStatement masterVatStatement = null;
+ if (selectedRow != -1) {
+ masterVatStatement = (VatStatement)treePath.getLastPathComponent();
+ }
+ newVatChartMovement.setMasterVatStatement(masterVatStatement);
+ vatChartMovementForm.setVatStatement(newVatChartMovement);
+ // jaxx constructor don't call super() ?
+ vatChartMovementForm.setLocationRelativeTo(view);
+ vatChartMovementForm.setVisible(true);
+ newVatChartMovement = vatChartMovementForm.getVatStatement();
+
+ // null == cancel action
+ if (newVatChartMovement != null) {
+ newVatChartMovement.setAmount(BigDecimal.ZERO);
+ // add it
+ try {
+ treeTableModel.addVatStatement(treePath, newVatChartMovement);
+ } catch (LimaBusinessException eee) {
+ if (log.isErrorEnabled()) {
+ log.error("Can't add Vat chart Movement", eee);
+ }
+ JOptionPane.showMessageDialog(
+ view,
+ eee.getMessage(),
+ _("lima.common.error"),
+ JOptionPane.ERROR_MESSAGE);
+ }
+ catch (LimaException eee) {
+ if (log.isErrorEnabled()) {
+ log.error("Can't add Vat chart Movement", eee);
+ }
+ JOptionPane.showMessageDialog(
+ view,
+ eee.getMessage(),
+ _("lima.common.error"),
+ JOptionPane.ERROR_MESSAGE);
+ }
+ refresh();
+ }
+ }
+
+ public void updateVatStatement() {
+
+ JXTreeTable treeTable = view.getTreeTable();
+ VatChartTreeTableModel treeTableModel =
+ (VatChartTreeTableModel) treeTable.getTreeTableModel();
+
+ // get selected account
+ int selectedRow = view.treeTable.getSelectedRow();
+ TreePath treePath = view.treeTable.getPathForRow(selectedRow); // not null
+ VatStatement vatStatement =
+ (VatStatement) treePath.getLastPathComponent();
+ //update Account or update SubLedger
+ if (vatStatement != null) {
+ // get current selection path
+ if ( selectedRow != -1) {
+ treePath = view.treeTable.getPathForRow(selectedRow);
+ } else {
+ treePath = new TreePath(treeTableModel.getRoot());
+ }
+ VatChartMovementForm vatChartMovementForm =
+ new VatChartMovementForm(view);
+ if (vatStatement.getMasterVatStatement() == null) {
+ VatStatement masterVatStatement = new VatStatementImpl();
+ vatStatement.setMasterVatStatement(masterVatStatement);
+ }
+ vatChartMovementForm.setVatStatement(vatStatement);
+ // jaxx constructor don't call super() ?
+ vatChartMovementForm.setLocationRelativeTo(view);
+ vatChartMovementForm.setVisible(true);
+ // null == cancel action
+ vatStatement = vatChartMovementForm.getVatStatement();
+ //if action confirmed
+ if (vatStatement != null){
+ // update it
+ try {
+ treeTableModel.updateVatStatement(
+ treePath, vatStatement);
+ } catch (LimaException eee) {
+ if (log.isErrorEnabled()) {
+ log.error("Can't add update", eee);
+ }
+ JOptionPane.showMessageDialog(
+ view,
+ eee.getMessage(),
+ _("lima.common.error"),
+ JOptionPane.ERROR_MESSAGE);
+ }
+ }
+ }
+ refresh();
+ }
+
+ public void importVatStatementChart(){
+ VatChartImportForm form =
+ new VatChartImportForm();
+ form.setLocationRelativeTo(view);
+ form.setVisible(true);
+
+ Object value = form.getRadioButtons().getSelectedValue();
+ // if action confirmed
+ if (value != null){
+ if (form.getDeleteVatStatementChart().isSelected()){
+ try {
+ vatStatementService.removeAllVatStatement();
+
+ } catch (LimaException eee) {
+ if (log.isDebugEnabled()){
+ log.debug("Can't delete financial statement chart", eee);
+ }
+ }
+ }
+ VatStatementsChartEnum defaultVatStatementsEnum =
+ (VatStatementsChartEnum) value;
+ ImportExport importExport = ImportExport.getInstance(view);
+ importExport.importExport(ImportExportEnum.CSV_VAT_IMPORT,
+ defaultVatStatementsEnum.getFilePath(), true);
+ refresh();
+ }
+ }
+
+ /**
+ * Ask for user to remove for selected account, and remove it if confirmed.
+ */
+ public void removeVatStatement() {
+ JXTreeTable treeTable = view.getTreeTable();
VatChartTreeTableModel treeTableModel =
(VatChartTreeTableModel) treeTable.getTreeTableModel();
- try {
+
+ // Any row selected
+ int selectedRow = view.treeTable.getSelectedRow();
+ if ( selectedRow != -1) {
+ int n = JOptionPane.showConfirmDialog(view,
+ _("lima.charts.vatstatement.question.remove"),
+ _("lima.common.confirmation"),
+ JOptionPane.YES_NO_OPTION,
+ JOptionPane.QUESTION_MESSAGE);
+ if (n == JOptionPane.YES_OPTION) {
+ // update view of treetable
+ TreePath treePath = treeTable.getPathForRow(selectedRow);
+ VatStatement vatStatement =
+ (VatStatement) treePath.getLastPathComponent();
+ if (!treeTableModel.isLeaf(vatStatement)) {
+ JOptionPane.showMessageDialog(
+ view,
+ _("lima.charts.vatstatement.deleteparent"),
+ _("lima.common.info"),
+ JOptionPane.INFORMATION_MESSAGE);
+ } else {
+ try{
+ treeTableModel.removeVatStatementObject(
+ treePath, vatStatement);
+ } catch (LimaException eee) {
+ if (log.isErrorEnabled()) {
+ log.error("Can't delete account", eee);
+ }
+ JOptionPane.showMessageDialog(
+ view,
+ eee.getMessage(),
+ _("lima.common.error"),
+ JOptionPane.ERROR_MESSAGE);
+ }
+ }
+ }
+ refresh();
+ }
+ }
+
+ public void refresh(){
+ JXTreeTable treeTable = view.getTreeTable();
+ VatChartTreeTableModel treeTableModel =
+ (VatChartTreeTableModel) treeTable.getTreeTableModel();
+ try {
treeTableModel.refreshTree();
} catch (LimaException eee) {
if(log.isDebugEnabled()){
1
0
r3239 - trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatreports
by vsalaun@users.chorem.org 02 Aug '11
by vsalaun@users.chorem.org 02 Aug '11
02 Aug '11
Author: vsalaun
Date: 2011-08-02 13:37:37 +0200 (Tue, 02 Aug 2011)
New Revision: 3239
Url: http://chorem.org/repositories/revision/lima/3239
Log:
#347 update VatReport
Added:
trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatreports/VatReportPeriodSearchPanel.java
Modified:
trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatreports/VatReportTable.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatreports/VatReportTableModel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatreports/VatReportView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatreports/VatReportViewHandler.java
Added: trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatreports/VatReportPeriodSearchPanel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatreports/VatReportPeriodSearchPanel.java (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatreports/VatReportPeriodSearchPanel.java 2011-08-02 11:37:37 UTC (rev 3239)
@@ -0,0 +1,138 @@
+package org.chorem.lima.ui.vatreports;
+
+import static org.nuiton.i18n.I18n._;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.util.Calendar;
+import java.util.Date;
+
+import javax.swing.JComboBox;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+
+import org.apache.commons.lang.time.DateUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.chorem.lima.entity.FinancialPeriod;
+import org.chorem.lima.entity.FiscalPeriod;
+import org.chorem.lima.enums.ComboBoxDatesEnum;
+import org.chorem.lima.ui.combobox.FinancialPeriodComboBoxModel;
+import org.chorem.lima.ui.combobox.FinancialPeriodComboBoxRenderer;
+import org.chorem.lima.ui.combobox.FiscalPeriodComboBoxModel;
+import org.chorem.lima.ui.combobox.FiscalPeriodComboBoxRenderer;
+import org.jdesktop.swingx.JXDatePicker;
+
+public class VatReportPeriodSearchPanel extends JPanel {
+
+ private static final long serialVersionUID = 1L;
+
+ private static final Log log =
+ LogFactory.getLog(VatReportPeriodSearchPanel.class);
+
+ protected VatReportViewHandler handler;
+
+ public VatReportPeriodSearchPanel(VatReportViewHandler handler) {
+
+ this.handler = handler;
+
+ //init date
+ refresh(ComboBoxDatesEnum.FISCAL_PERIOD);
+ }
+
+ public void refresh(ComboBoxDatesEnum comboBoxPeriodEnum){
+
+ switch (comboBoxPeriodEnum) {
+ case PERIOD:
+ // get begin date
+ Calendar calendarBegin = Calendar.getInstance();
+ // set begindate to JAN 1 - 0:00.000 of this years
+ Date beginDate = calendarBegin.getTime();
+ beginDate = DateUtils.truncate(beginDate, Calendar.YEAR);
+ //handler().setBeginDate(beginDate);
+
+ // get end date
+ Calendar calendarEnd = Calendar.getInstance();
+ Date endDate = calendarEnd.getTime();
+ //handler().setEndDate(endDate);
+ JLabel beginDateLabel = new JLabel(_("lima.common.begindate"));
+ final JXDatePicker beginDatePicker = new JXDatePicker(beginDate);
+ ActionListener beginDateActionListener = new ActionListener() {
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ handler.tableModel.setBeginDate(beginDatePicker.getDate());
+ handler.refresh();
+ }
+ };
+ handler.tableModel.setBeginDate(beginDatePicker.getDate());
+ beginDatePicker.addActionListener(beginDateActionListener);
+
+ JLabel endDateLabel = new JLabel(_("lima.common.enddate"));
+ final JXDatePicker endDatePicker = new JXDatePicker(endDate);
+ ActionListener endDateActionListener = new ActionListener() {
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ handler.tableModel.setEndDate(endDatePicker.getDate());
+ handler.refresh();
+ }
+ };
+ handler.tableModel.setEndDate(endDatePicker.getDate());
+ endDatePicker.addActionListener(endDateActionListener);
+ handler.refresh();
+
+ this.removeAll();
+ this.add(beginDateLabel);
+ this.add(beginDatePicker);
+ this.add(endDateLabel);
+ this.add(endDatePicker);
+ break;
+
+ case FISCAL_PERIOD:
+ FiscalPeriodComboBoxModel fiscalModel = new FiscalPeriodComboBoxModel(true);
+ FiscalPeriodComboBoxRenderer fiscalRenderer = new FiscalPeriodComboBoxRenderer();
+ final JComboBox fiscalPeriod = new JComboBox(fiscalModel);
+ fiscalPeriod.setRenderer(fiscalRenderer);
+ fiscalPeriod.setEditable(false);
+ ActionListener fiscalPeriodActionListener = new ActionListener() {
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ FiscalPeriod fPeriod = (FiscalPeriod) fiscalPeriod.getSelectedItem();
+ if (fPeriod != null){
+ handler.tableModel.setBeginDate(fPeriod.getBeginDate());
+ handler.tableModel.setEndDate(fPeriod.getEndDate());
+ handler.refresh();
+ }
+ }
+ };
+ fiscalPeriod.addActionListener(fiscalPeriodActionListener);
+
+ this.removeAll();
+ this.add(fiscalPeriod);
+ break;
+
+ case FINANCIAL_PERIOD:
+ FinancialPeriodComboBoxModel financialModel = new FinancialPeriodComboBoxModel(true);
+ FinancialPeriodComboBoxRenderer financialRenderer = new FinancialPeriodComboBoxRenderer();
+ final JComboBox financialPeriod = new JComboBox(financialModel);
+ financialPeriod.setRenderer(financialRenderer);
+ financialPeriod.setEditable(false);
+ ActionListener financialPeriodActionListener = new ActionListener() {
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ FinancialPeriod fPeriod = (FinancialPeriod) financialPeriod.getSelectedItem();
+ if (fPeriod !=null){
+ handler.tableModel.setBeginDate(fPeriod.getBeginDate());
+ handler.tableModel.setEndDate(fPeriod.getEndDate());
+ handler.refresh();
+ }
+ }
+ };
+ financialPeriod.addActionListener(financialPeriodActionListener);
+ this.removeAll();
+ this.add(financialPeriod);
+ break;
+ }
+
+ }
+
+}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatreports/VatReportTable.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatreports/VatReportTable.java 2011-08-01 08:03:10 UTC (rev 3238)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatreports/VatReportTable.java 2011-08-02 11:37:37 UTC (rev 3239)
@@ -24,20 +24,13 @@
*/
package org.chorem.lima.ui.vatreports;
-import java.awt.Color;
-import java.awt.Component;
import java.math.BigDecimal;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.chorem.lima.entity.FinancialPeriod;
import org.chorem.lima.ui.celleditor.BigDecimalTableCellEditor;
import org.chorem.lima.ui.celleditor.BigDecimalTableCellRenderer;
import org.jdesktop.swingx.JXTable;
-import org.jdesktop.swingx.decorator.ColorHighlighter;
-import org.jdesktop.swingx.decorator.ComponentAdapter;
-import org.jdesktop.swingx.decorator.HighlightPredicate;
-import org.jdesktop.swingx.decorator.Highlighter;
public class VatReportTable extends JXTable {
@@ -50,8 +43,6 @@
protected VatReportViewHandler handler;
protected VatReportTableModel model;
-
- private Highlighter colorTransaction;
public VatReportTable(VatReportViewHandler handler) {
@@ -63,31 +54,6 @@
setDefaultEditor(BigDecimal.class, new BigDecimalTableCellEditor());
//Get new BigDecimal renderer
setDefaultRenderer(BigDecimal.class, new BigDecimalTableCellRenderer());
-
- //highlight financial financial transactions
- //FIXME 2011.06.09 doesn't work !!!
- addMonthColor();
}
-
- /*
- * Color the background row in grey if the month number is even (pair in french)
- */
- protected void addMonthColor() {
- HighlightPredicate predicate = new HighlightPredicate() {
- @Override
- public boolean isHighlighted(Component renderer,
- ComponentAdapter adapter) {
- Object object = model.getElementAt(adapter.row);
- if (object instanceof FinancialPeriod) {
- return true;
- } else {
- return false;
- }
- }
- };
- colorTransaction =
- new ColorHighlighter(predicate, new Color(222,222,222), null);
- addHighlighter(colorTransaction);
- }
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatreports/VatReportTableModel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatreports/VatReportTableModel.java 2011-08-01 08:03:10 UTC (rev 3238)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatreports/VatReportTableModel.java 2011-08-02 11:37:37 UTC (rev 3239)
@@ -27,7 +27,7 @@
import static org.nuiton.i18n.I18n._;
import java.math.BigDecimal;
-import java.util.ArrayList;
+import java.util.Date;
import java.util.List;
import javax.swing.table.AbstractTableModel;
@@ -41,7 +41,6 @@
import org.chorem.lima.business.ReportServiceMonitorable;
import org.chorem.lima.business.ServiceListener;
import org.chorem.lima.business.VatStatementServiceMonitorable;
-import org.chorem.lima.entity.FiscalPeriod;
import org.chorem.lima.service.LimaServiceFactory;
import org.chorem.lima.util.ErrorHelper;
import org.nuiton.topia.TopiaException;
@@ -62,18 +61,13 @@
protected ImportServiceMonitorable importService;
/** selected financial period */
- protected FiscalPeriod selectedFiscalPeriod;
+ protected Date selectedBeginDate;
+ protected Date selectedEndDate;
/** data cache */
protected List<VatStatementAmounts> cacheDataList;
/**
- * list of BigDecimal, save the difference between the number given by the VAT chart
- * and the number given by the user afterwards
- */
- private List<BigDecimal> diffBigDecimalList = new ArrayList<BigDecimal>(); //list of 65 elements
-
- /**
* variable used for the document edition,
* if "true" then the document will be automatically filled in
* if "false" the the document will be empty
@@ -108,11 +102,11 @@
List<VatStatementAmounts> list = null;
- if (selectedFiscalPeriod != null) {
+ if ((selectedBeginDate != null ) || (selectedEndDate != null)) {
try {
list = vatStatementService.vatStatementReport(
- selectedFiscalPeriod.getBeginDate(),
- selectedFiscalPeriod.getEndDate());
+ getBeginDate(),
+ getEndDate());
}
catch (LimaException eee) {
if (log.isErrorEnabled()) {
@@ -133,15 +127,6 @@
}
ErrorHelper.showErrorDialog("Can't get VAT list", eee);
}
-
- if (cacheDataList != null) {
- for (int index = 0; index < cacheDataList.size(); index++) {
- //sets the BigDecimal difference list
- if (diffBigDecimalList.size() != 65) {
- diffBigDecimalList.add(BigDecimal.ZERO);
- }
- }
- }
fireTableDataChanged();
}
@@ -152,7 +137,7 @@
switch (column) {
case 0:
- result = String.class; //libellé
+ result = String.class; //label
break;
case 1:
result = BigDecimal.class; //solde
@@ -210,12 +195,8 @@
result = value.getLabel();
break;
case 1:
- if (value.getAmount() != null) {
- //the number showed is the number given by the chart plus
- //the number calculated from the diffBigDecimalList
- //diffBigDecimalList can be a negative number !
- result = value.getAmount()
- .add(diffBigDecimalList.get(row));
+ if ((value.getAmount() != null) && (!value.isHeader())) {
+ result = value.getAmount();
} else {
result = null;
}
@@ -224,26 +205,21 @@
}
return result;
}
+
+ public void setBeginDate(Date date) {
+ selectedBeginDate = date;
+ }
- @Override
- public void setValueAt(Object value, int row, int column) {
- //check first if the user has changed the number value
- if (!getValueAt(row, column).equals((BigDecimal)value)) {
- //if so set the difference between the values inside diffBigDecimalList
- BigDecimal diff = diffBigDecimalList.get(row)
- .add(((BigDecimal) value)
- .subtract((BigDecimal)getValueAt(row, column)));
- diffBigDecimalList.set(row, diff);
- }
+ public Date getBeginDate() {
+ return selectedBeginDate;
}
- public FiscalPeriod getFiscalPeriod() {
- return selectedFiscalPeriod;
+ public void setEndDate(Date date) {
+ selectedEndDate = date;
}
- public void setFiscalPeriod(FiscalPeriod fiscalPeriod){
- selectedFiscalPeriod = fiscalPeriod;
- refresh();
+ public Date getEndDate() {
+ return selectedEndDate;
}
public String getAutocomplete() {
@@ -258,19 +234,9 @@
}
}
- public String getDiffBigDecimalList() {
- String result = "";
- for (BigDecimal bigdecimal : diffBigDecimalList) {
- result += bigdecimal.toString() + "_";
- }
- result = result.substring(0, result.length()-1);
- return result;
- }
-
@Override
public boolean isCellEditable(int row, int column) {
- //only the second column can be editable, and also if it contains a number
- return ((column ==1) && (getValueAt(row, column) != null));
+ return false;
}
@Override
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatreports/VatReportView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatreports/VatReportView.jaxx 2011-08-01 08:03:10 UTC (rev 3238)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatreports/VatReportView.jaxx 2011-08-02 11:37:37 UTC (rev 3239)
@@ -37,6 +37,9 @@
import org.chorem.lima.ui.vatreports.VatTableModel;
import org.chorem.lima.ui.vatreports.VatTable;
+ import org.chorem.lima.enums.ComboBoxDatesEnum;
+ VatReportPeriodSearchPanel periodSearchPanel = new VatReportPeriodSearchPanel(handler);
+
void $afterCompleteSetup() {
getHandler().refresh();
}
@@ -50,12 +53,11 @@
</cell>
<cell anchor="west">
<org.chorem.lima.ui.combobox.FiscalPeriodComboBoxModel id="modelFiscalPeriod"/>
- <JComboBox id="fiscalPeriodComboBox"
- model="{getModelFiscalPeriod()}"
- renderer="{new FiscalPeriodComboBoxRenderer()}"
- onActionPerformed="getVatReportTableModel().setFiscalPeriod((FiscalPeriod)fiscalPeriodComboBox.getSelectedItem())"
- editable="false"/>
+ <JComboBox id="periodComboBox" javaBean="new JComboBox(ComboBoxDatesEnum.descriptions())"
+ onActionPerformed="periodSearchPanel.refresh(ComboBoxDatesEnum.valueOfDescription((String) periodComboBox.getSelectedItem()));
+ validate(); repaint()"/>
</cell>
+ <cell><VatReportPeriodSearchPanel javaBean="periodSearchPanel"/></cell>
<cell>
<JCheckBox id='autocomplete' text='lima.common.autocomplete' selected='true'
onActionPerformed="getVatReportTableModel().setAutocomplete()"/>
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatreports/VatReportViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatreports/VatReportViewHandler.java 2011-08-01 08:03:10 UTC (rev 3238)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatreports/VatReportViewHandler.java 2011-08-02 11:37:37 UTC (rev 3239)
@@ -78,16 +78,15 @@
* Edit VAT document
*/
public void editVat() {
- if (tableModel.getFiscalPeriod() != null){
+ if ((tableModel.getBeginDate() != null) || (tableModel.getEndDate() != null)){
String address = LimaConfig.getInstance().getHostAdress();
try {
String url = "http://"+address+":"+port+"/?beginDate="
- + dateFormat.format(tableModel.getFiscalPeriod().getBeginDate())
- + "&endDate=" + dateFormat.format(tableModel.getFiscalPeriod().getEndDate())
+ + dateFormat.format(tableModel.getBeginDate())
+ + "&endDate=" + dateFormat.format(tableModel.getEndDate())
+ "&format=.pdf&model=" + DocumentsEnum.VAT.getFileName()
- + "&autocomplete=" + tableModel.getAutocomplete()
- + "&datas=" + tableModel.getDiffBigDecimalList();
+ + "&autocomplete=" + tableModel.getAutocomplete();
Desktop.getDesktop().browse(new URI(url));
} catch (IOException e) {
log.error("Can't open browser", e);
1
0
Author: vsalaun
Date: 2011-08-01 10:03:10 +0200 (Mon, 01 Aug 2011)
New Revision: 3238
Url: http://chorem.org/repositories/revision/lima/3238
Log:
add contributor to project
Modified:
trunk/pom.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2011-07-28 14:48:10 UTC (rev 3237)
+++ trunk/pom.xml 2011-08-01 08:03:10 UTC (rev 3238)
@@ -289,6 +289,16 @@
<role>Développeur</role>
</roles>
</contributor>
+ <contributor>
+ <name>Victor Salaun</name>
+ <email>salaun(a)codelutin.com</email>
+ <organization>Code Lutin</organization>
+ <organizationUrl>http://www.codelutin.com</organizationUrl>
+ <timezone>+2</timezone>
+ <roles>
+ <role>Développeur</role>
+ </roles>
+ </contributor>
</contributors>
<!-- ************************************************************* -->
1
0