Lima-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- 1853 discussions
Author: jpepin
Date: 2010-08-24 14:31:17 +0200 (Tue, 24 Aug 2010)
New Revision: 3018
Url: http://chorem.org/repositories/revision/lima/3018
Log:
D?\195?\169bogue UI des rapports.
Removed:
trunk/doc/
trunk/src/referencement.txt
trunk/src/site/resources/callao/
Modified:
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.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/BalanceView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceViewHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsViewHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportTableModel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportViewHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerViewHandler.java
trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties
trunk/src/site/rst/features.rst
trunk/src/site/rst/presentation.rst
trunk/src/site/site_fr.xml
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java 2010-08-23 20:01:24 UTC (rev 3017)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java 2010-08-24 12:31:17 UTC (rev 3018)
@@ -608,7 +608,8 @@
query.addDistinct();
query.addLeftJoin("T."+FinancialTransaction.ENTRY, "E", true);
//Load for lazy
- query.addLoad(FinancialTransaction.FINANCIAL_PERIOD);
+ query.addLoad(FinancialTransaction.ENTRY_BOOK)
+ .addLoad(FinancialTransaction.FINANCIAL_PERIOD);
Date beginDate = financialTransactionSearch.getBeginDate();
Date endDate = financialTransactionSearch.getEndDate();
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsView.jaxx 2010-08-23 20:01:24 UTC (rev 3017)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsView.jaxx 2010-08-24 12:31:17 UTC (rev 3018)
@@ -56,24 +56,30 @@
</JScrollPane>
</cell>
</row>
- <row fill="horizontal" anchor="center">
- <cell>
- <JLabel text="lima.common.amountdebit" />
+ <row>
+ <cell fill="horizontal" weightx="1" columns="7">
+ <Table>
+ <row fill="horizontal" weightx="1">
+ <cell>
+ <JLabel text="lima.common.amountdebit" />
+ </cell>
+ <cell>
+ <JLabel id="amountDebitLabel" />
+ </cell>
+ <cell>
+ <JLabel text="lima.common.amountcredit"/>
+ </cell>
+ <cell>
+ <JLabel id="amountCreditLabel" />
+ </cell>
+ <cell>
+ <JLabel id="soldeLabel" text="lima.common.solde"/>
+ </cell>
+ <cell>
+ <JLabel id="amountSoldeLabel"/>
+ </cell>
+ </row>
+ </Table>
</cell>
- <cell>
- <JLabel id="amountDebitLabel" />
- </cell>
- <cell>
- <JLabel text="lima.common.amountcredit"/>
- </cell>
- <cell>
- <JLabel id="amountCreditLabel" />
- </cell>
- <cell>
- <JLabel id="soldeLabel" text="lima.common.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/accountsreports/AccountsReportsViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsViewHandler.java 2010-08-23 20:01:24 UTC (rev 3017)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsViewHandler.java 2010-08-24 12:31:17 UTC (rev 3018)
@@ -111,36 +111,40 @@
public void refresh(){
- ReportsDatas datasList = getDataList();
-
- tableModel = view.getModelAccountsReportsTable();
- tableModel.refresh(datasList);
-
- /**
- * set text and amounts of labels credit, debit, solde
- */
-
- if (datasList != null){
- // set amounts credit and debit and solde
- view.amountCreditLabel.setText(datasList.getAmountCredit().toString());
- view.amountDebitLabel.setText(datasList.getAmountDebit().toString());
- BigDecimal amountSolde = datasList.getAmountSolde();
- view.amountSoldeLabel.setText(amountSolde.toString());
-
-
- if (amountSolde.doubleValue() == 0){
- view.soldeLabel.setText(_("lima.common.solde"));
- }
- else {
- // set label solde: credit or debit
- if (datasList.getSoldeDebit()) {
- view.soldeLabel.setText(_("lima.common.soldedebit"));
- }
- else {
- view.soldeLabel.setText(_("lima.common.soldecredit"));
- }
- }
- }
+ if (selectedBeginDate != null && selectedEndDate != null && selectedAccount != null){
+ ReportsDatas datasList = getDataList();
+
+ tableModel = view.getModelAccountsReportsTable();
+ tableModel.refresh(datasList);
+
+ /**
+ * set text and amounts of labels credit, debit, solde
+ */
+
+ if (datasList != null){
+ // set amounts credit and debit and solde
+ view.amountCreditLabel.setText(
+ datasList.getAmountCredit().toString());
+ view.amountDebitLabel.setText(
+ datasList.getAmountDebit().toString());
+ BigDecimal amountSolde = datasList.getAmountSolde();
+ view.amountSoldeLabel.setText(amountSolde.toString());
+
+
+ if (amountSolde.doubleValue() == 0){
+ view.soldeLabel.setText(_("lima.common.solde"));
+ }
+ else {
+ // set label solde: credit or debit
+ if (datasList.getSoldeDebit()) {
+ view.soldeLabel.setText(_("lima.common.soldedebit"));
+ }
+ else {
+ view.soldeLabel.setText(_("lima.common.soldecredit"));
+ }
+ }
+ }
+ }
}
@Override
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceView.jaxx 2010-08-23 20:01:24 UTC (rev 3017)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceView.jaxx 2010-08-24 12:31:17 UTC (rev 3018)
@@ -69,24 +69,30 @@
</JScrollPane>
</cell>
</row>
- <row fill="horizontal" anchor="center">
- <cell>
- <JLabel text="lima.common.amountdebit" />
+ <row>
+ <cell fill="horizontal" weightx="1" columns="7">
+ <Table>
+ <row fill="horizontal" weightx="1">
+ <cell>
+ <JLabel text="lima.common.amountdebit" />
+ </cell>
+ <cell>
+ <JLabel id="amountDebitLabel" />
+ </cell>
+ <cell>
+ <JLabel text="lima.common.amountcredit"/>
+ </cell>
+ <cell>
+ <JLabel id="amountCreditLabel" />
+ </cell>
+ <cell>
+ <JLabel id="soldeLabel" text="lima.common.solde"/>
+ </cell>
+ <cell>
+ <JLabel id="amountSoldeLabel"/>
+ </cell>
+ </row>
+ </Table>
</cell>
- <cell>
- <JLabel id="amountDebitLabel" />
- </cell>
- <cell>
- <JLabel text="lima.common.amountcredit"/>
- </cell>
- <cell>
- <JLabel id="amountCreditLabel" />
- </cell>
- <cell>
- <JLabel id="soldeLabel" text="lima.common.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/balance/BalanceViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceViewHandler.java 2010-08-23 20:01:24 UTC (rev 3017)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceViewHandler.java 2010-08-24 12:31:17 UTC (rev 3018)
@@ -122,36 +122,42 @@
}
public void refresh(){
- model = view.getModelBalanceTable();
- 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
- */
-
- if (datasList != null){
- // set amounts credit, debit and solde
- view.amountCreditLabel.setText(String.valueOf(datasList.getAmountCredit()));
- view.amountDebitLabel.setText(String.valueOf(datasList.getAmountDebit()));
- BigDecimal amountSolde = datasList.getAmountSolde();
- view.amountSoldeLabel.setText(String.valueOf(amountSolde));
-
-
- if (amountSolde.doubleValue() == 0){
- view.soldeLabel.setText(_("lima.common.solde"));
- }
- else {
- // set label solde: credit or debit
- if (datasList.getSoldeDebit()) {
- view.soldeLabel.setText(_("lima.common.soldedebit"));
- }
- else {
- view.soldeLabel.setText(_("lima.common.soldecredit"));
- }
- }
- }
+
+ if (selectedBeginDate != null && selectedEndDate != null){
+ model = view.getModelBalanceTable();
+ 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
+ */
+
+ if (datasList != null){
+ // set amounts credit, debit and solde
+ view.amountCreditLabel.setText(
+ String.valueOf(datasList.getAmountCredit()));
+ view.amountDebitLabel.setText(
+ String.valueOf(datasList.getAmountDebit()));
+ BigDecimal amountSolde = datasList.getAmountSolde();
+ view.amountSoldeLabel.setText(
+ String.valueOf(amountSolde));
+
+
+ if (amountSolde.doubleValue() == 0){
+ view.soldeLabel.setText(_("lima.common.solde"));
+ }
+ else {
+ // set label solde: credit or debit
+ if (datasList.getSoldeDebit()) {
+ view.soldeLabel.setText(_("lima.common.soldedebit"));
+ }
+ else {
+ view.soldeLabel.setText(_("lima.common.soldecredit"));
+ }
+ }
+ }
+ }
}
public void createDocument() {
@@ -160,8 +166,10 @@
String address = LimaConfig.getInstance().getHostAdress();
try {
- String url = "http://"+address+":"+port+"/?beginDate="+dateFormat.format(selectedBeginDate)
- +"&endDate="+dateFormat.format(selectedEndDate)+"&format="+selectedEnum.getExtension()+"&model="
+ String url = "http://"+address+":"+port+"/?beginDate="
+ +dateFormat.format(selectedBeginDate)
+ +"&endDate="+dateFormat.format(selectedEndDate)+"&format="
+ +selectedEnum.getExtension()+"&model="
+ DocumentsEnum.BALANCE.getFileName();
Desktop.getDesktop().browse(new URI(url));
} catch (IOException e) {
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsView.jaxx 2010-08-23 20:01:24 UTC (rev 3017)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsView.jaxx 2010-08-24 12:31:17 UTC (rev 3018)
@@ -61,24 +61,30 @@
</JScrollPane>
</cell>
</row>
- <row fill="horizontal" anchor="center">
- <cell>
- <JLabel text="lima.common.amountdebit" />
+ <row>
+ <cell fill="horizontal" weightx="1" columns="7">
+ <Table>
+ <row fill="horizontal" weightx="1">
+ <cell>
+ <JLabel text="lima.common.amountdebit" />
+ </cell>
+ <cell>
+ <JLabel id="amountDebitLabel" />
+ </cell>
+ <cell>
+ <JLabel text="lima.common.amountcredit"/>
+ </cell>
+ <cell>
+ <JLabel id="amountCreditLabel" />
+ </cell>
+ <cell>
+ <JLabel id="soldeLabel" text="lima.common.solde"/>
+ </cell>
+ <cell>
+ <JLabel id="amountSoldeLabel"/>
+ </cell>
+ </row>
+ </Table>
</cell>
- <cell>
- <JLabel id="amountDebitLabel" />
- </cell>
- <cell>
- <JLabel text="lima.common.amountcredit"/>
- </cell>
- <cell>
- <JLabel id="amountCreditLabel" />
- </cell>
- <cell>
- <JLabel id="soldeLabel" text="lima.common.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/entrybooksreports/EntryBooksReportsViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsViewHandler.java 2010-08-23 20:01:24 UTC (rev 3017)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsViewHandler.java 2010-08-24 12:31:17 UTC (rev 3018)
@@ -19,7 +19,6 @@
package org.chorem.lima.ui.entrybooksreports;
import static org.nuiton.i18n.I18n._;
-
import java.awt.Desktop;
import java.io.IOException;
import java.math.BigDecimal;
@@ -27,12 +26,10 @@
import java.net.URISyntaxException;
import java.text.SimpleDateFormat;
import java.util.Date;
-
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.LimaConfig;
import org.chorem.lima.beans.ReportsDatas;
-import org.chorem.lima.beans.ReportsDatasImpl;
import org.chorem.lima.business.DocumentServiceMonitorable;
import org.chorem.lima.business.FinancialTransactionServiceMonitorable;
import org.chorem.lima.business.HttpServerServiceMonitorable;
@@ -118,7 +115,8 @@
if (selectedEntryBook != null){
try {
results =
- reportService.generateEntryBooksReports(selectedEntryBook, selectedBeginDate, selectedEndDate);
+ reportService.generateEntryBooksReports(
+ selectedEntryBook, selectedBeginDate, selectedEndDate);
}
catch (LimaException eee) {
if (log.isErrorEnabled()) {
@@ -131,36 +129,41 @@
}
public void refresh(){
- tableModel = view.getModelTable();
-
- ReportsDatas datasList = getDataList();
-
- tableModel.refresh(datasList);
-
- /**
- * set text and amounts of labels credit, debit, solde
- */
-
- if (datasList != null){
- // set amounts credit, debit and solde
- view.amountCreditLabel.setText(String.valueOf(datasList.getAmountCredit()));
- view.amountDebitLabel.setText(String.valueOf(datasList.getAmountDebit()));
- BigDecimal amountSolde = datasList.getAmountSolde();
- view.amountSoldeLabel.setText(String.valueOf(amountSolde));
-
- if (amountSolde.doubleValue() == 0){
- view.soldeLabel.setText(_("lima.common.solde"));
- }
- else {
- // set label solde: credit or debit
- if (datasList.getSoldeDebit()) {
- view.soldeLabel.setText(_("lima.common.soldedebit"));
- }
- else {
- view.soldeLabel.setText(_("lima.common.soldecredit"));
- }
- }
- }
+
+ if (selectedBeginDate != null && selectedEndDate != null && selectedEntryBook != null){
+ tableModel = view.getModelTable();
+
+ ReportsDatas datasList = getDataList();
+
+ tableModel.refresh(datasList);
+
+ /**
+ * set text and amounts of labels credit, debit, solde
+ */
+
+ if (datasList != null){
+ // set amounts credit, debit and solde
+ view.amountCreditLabel.setText(
+ String.valueOf(datasList.getAmountCredit()));
+ view.amountDebitLabel.setText(
+ String.valueOf(datasList.getAmountDebit()));
+ BigDecimal amountSolde = datasList.getAmountSolde();
+ view.amountSoldeLabel.setText(String.valueOf(amountSolde));
+
+ if (amountSolde.doubleValue() == 0){
+ view.soldeLabel.setText(_("lima.common.solde"));
+ }
+ else {
+ // set label solde: credit or debit
+ if (datasList.getSoldeDebit()) {
+ view.soldeLabel.setText(_("lima.common.soldedebit"));
+ }
+ else {
+ view.soldeLabel.setText(_("lima.common.soldecredit"));
+ }
+ }
+ }
+ }
}
@@ -171,13 +174,17 @@
String address = LimaConfig.getInstance().getHostAdress();
try {
- String url = "http://"+address+":"+port+"/?beginDate="+dateFormat.format(selectedBeginDate)
- +"&endDate="+dateFormat.format(selectedEndDate)+"&format="+selectedEnum.getExtension()+"&model="
+ String url = "http://"+address+":"+port+"/?beginDate="
+ +dateFormat.format(selectedBeginDate)
+ +"&endDate="+dateFormat.format(selectedEndDate)
+ +"&format="+selectedEnum.getExtension()+"&model="
+ DocumentsEnum.ENTRYBOOKS.getFileName();
Desktop.getDesktop().browse(new URI(url));
- String url2 = "http://"+address+":"+port+"/?beginDate="+dateFormat.format(selectedBeginDate)
- +"&endDate="+dateFormat.format(selectedEndDate)+"&format="+selectedEnum.getExtension()+"&model="
+ String url2 = "http://"+address+":"+port+"/?beginDate="
+ +dateFormat.format(selectedBeginDate)
+ +"&endDate="+dateFormat.format(selectedEndDate)
+ +"&format="+selectedEnum.getExtension()+"&model="
+ DocumentsEnum.GENERAL_ENTRYBOOK.getFileName();
Desktop.getDesktop().browse(new URI(url2));
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportTableModel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportTableModel.java 2010-08-23 20:01:24 UTC (rev 3017)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportTableModel.java 2010-08-24 12:31:17 UTC (rev 3018)
@@ -218,15 +218,17 @@
*/
public List<FinancialStatementAmounts> getDataList(){
List<FinancialStatementAmounts> results = null;
- try {
- results = financialStatementService.financialStatementReport(selectedBeginDate, selectedEndDate);
- }
- catch (LimaException eee) {
- if (log.isErrorEnabled()) {
- log.debug("Can't update model", eee);
- }
- ErrorHelper.showErrorDialog("Can't get entries list", eee);
- }
+ if (selectedBeginDate != null && selectedEndDate != null){
+ try {
+ results = financialStatementService.financialStatementReport(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;
}
@@ -241,8 +243,10 @@
String address = LimaConfig.getInstance().getHostAdress();
try {
- String url = "http://"+address+":"+port+"/?beginDate="+dateFormat.format(selectedBeginDate)
- +"&endDate="+dateFormat.format(selectedEndDate)+"&format="+formatsEnum.getExtension()+"&model="
+ String url = "http://"+address+":"+port+"/?beginDate="
+ +dateFormat.format(selectedBeginDate)
+ +"&endDate="+dateFormat.format(selectedEndDate)
+ +"&format="+formatsEnum.getExtension()+"&model="
+ DocumentsEnum.FINANCIALSTATEMENT.getFileName();
Desktop.getDesktop().browse(new URI(url));
} catch (IOException e) {
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportViewHandler.java 2010-08-23 20:01:24 UTC (rev 3017)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportViewHandler.java 2010-08-24 12:31:17 UTC (rev 3018)
@@ -18,13 +18,6 @@
package org.chorem.lima.ui.financialstatementreport;
-import java.awt.Desktop;
-import java.io.IOException;
-import java.net.URI;
-import java.net.URISyntaxException;
-
-import org.chorem.lima.LimaConfig;
-import org.chorem.lima.business.utils.DocumentsEnum;
import org.chorem.lima.business.utils.FormatsEnum;
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerView.jaxx 2010-08-23 20:01:24 UTC (rev 3017)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerView.jaxx 2010-08-24 12:31:17 UTC (rev 3018)
@@ -67,24 +67,30 @@
</JScrollPane>
</cell>
</row>
- <row fill="horizontal" anchor="center">
- <cell>
- <JLabel text="lima.common.amountdebit" />
+ <row>
+ <cell fill="horizontal" weightx="1" columns="7">
+ <Table>
+ <row fill="horizontal" weightx="1">
+ <cell>
+ <JLabel text="lima.common.amountdebit" />
+ </cell>
+ <cell>
+ <JLabel id="amountDebitLabel" />
+ </cell>
+ <cell>
+ <JLabel text="lima.common.amountcredit"/>
+ </cell>
+ <cell>
+ <JLabel id="amountCreditLabel" />
+ </cell>
+ <cell>
+ <JLabel id="soldeLabel" text="lima.common.solde"/>
+ </cell>
+ <cell>
+ <JLabel id="amountSoldeLabel"/>
+ </cell>
+ </row>
+ </Table>
</cell>
- <cell>
- <JLabel id="amountDebitLabel" />
- </cell>
- <cell>
- <JLabel text="lima.common.amountcredit"/>
- </cell>
- <cell>
- <JLabel id="amountCreditLabel" />
- </cell>
- <cell>
- <JLabel id="soldeLabel" text="lima.common.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/ledger/LedgerViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerViewHandler.java 2010-08-23 20:01:24 UTC (rev 3017)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerViewHandler.java 2010-08-24 12:31:17 UTC (rev 3018)
@@ -19,7 +19,6 @@
package org.chorem.lima.ui.ledger;
import static org.nuiton.i18n.I18n._;
-
import java.awt.Desktop;
import java.io.IOException;
import java.math.BigDecimal;
@@ -30,7 +29,6 @@
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.LimaConfig;
@@ -47,7 +45,6 @@
import org.chorem.lima.business.utils.EntryComparator;
import org.chorem.lima.business.utils.FormatsEnum;
import org.chorem.lima.entity.Entry;
-import org.chorem.lima.entity.EntryBook;
import org.chorem.lima.service.LimaServiceFactory;
import org.chorem.lima.util.ErrorHelper;
@@ -69,9 +66,6 @@
protected ReportServiceMonitorable reportService;
protected DocumentServiceMonitorable documentService;
- /** Account. */
- protected EntryBook selectedEntryBook;
-
/** Begin Date. */
protected Date selectedBeginDate;
@@ -129,7 +123,8 @@
List<Object> results = new ArrayList<Object>();
try {
balanceTrialCache = reportService.generateLedger(selectedBeginDate,
- selectedEndDate, selectedAccounts, view.getMovmentedFilter().isSelected());
+ selectedEndDate, selectedAccounts,
+ view.getMovmentedFilter().isSelected());
if (balanceTrialCache.getReportsDatas() != null){
for (ReportsDatas reportsDatas : balanceTrialCache.getReportsDatas()) {
results.add(reportsDatas);
@@ -151,37 +146,39 @@
}
public void refresh(){
- model = view.getModelTable();
- cachedatasList = getDataList();
- model.refresh(cachedatasList);
-
- /**
- * set text and amounts of labels credit, debit, solde
- */
-
- if (balanceTrialCache != null){
- // set amounts credit, debit and solde
- view.amountCreditLabel.setText(
- String.valueOf(balanceTrialCache.getAmountCredit()));
- view.amountDebitLabel.setText(
- String.valueOf(balanceTrialCache.getAmountDebit()));
- BigDecimal amountSolde = balanceTrialCache.getAmountSolde();
- view.amountSoldeLabel.setText(
- String.valueOf(amountSolde));
-
- if (amountSolde.doubleValue() == 0){
- view.soldeLabel.setText(_("lima.common.solde"));
- }
- else {
- // set label solde: credit or debit
- if (balanceTrialCache.getSoldeDebit()) {
- view.soldeLabel.setText(_("lima.common.soldedebit"));
- }
- else {
- view.soldeLabel.setText(_("lima.common.soldecredit"));
- }
- }
- }
+ if (selectedBeginDate != null && selectedEndDate != null){
+ model = view.getModelTable();
+ cachedatasList = getDataList();
+ model.refresh(cachedatasList);
+
+ /**
+ * set text and amounts of labels credit, debit, solde
+ */
+
+ if (balanceTrialCache != null){
+ // set amounts credit, debit and solde
+ view.amountCreditLabel.setText(
+ String.valueOf(balanceTrialCache.getAmountCredit()));
+ view.amountDebitLabel.setText(
+ String.valueOf(balanceTrialCache.getAmountDebit()));
+ BigDecimal amountSolde = balanceTrialCache.getAmountSolde();
+ view.amountSoldeLabel.setText(
+ String.valueOf(amountSolde));
+
+ if (amountSolde.doubleValue() == 0){
+ view.soldeLabel.setText(_("lima.common.solde"));
+ }
+ else {
+ // set label solde: credit or debit
+ if (balanceTrialCache.getSoldeDebit()) {
+ view.soldeLabel.setText(_("lima.common.soldedebit"));
+ }
+ else {
+ view.soldeLabel.setText(_("lima.common.soldecredit"));
+ }
+ }
+ }
+ }
}
public void createDocument() {
@@ -190,8 +187,10 @@
String address = LimaConfig.getInstance().getHostAdress();
try {
- String url = "http://"+address+":"+port+"/?beginDate="+dateFormat.format(selectedBeginDate)
- +"&endDate="+dateFormat.format(selectedEndDate)+"&format="+selectedEnum.getExtension()+"&model="
+ String url = "http://"+address+":"+port+"/?beginDate="
+ +dateFormat.format(selectedBeginDate)
+ +"&endDate="+dateFormat.format(selectedEndDate)
+ +"&format="+selectedEnum.getExtension()+"&model="
+ DocumentsEnum.LEDGER.getFileName();
Desktop.getDesktop().browse(new URI(url));
} catch (IOException e) {
Modified: trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties
===================================================================
--- trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties 2010-08-23 20:01:24 UTC (rev 3017)
+++ trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties 2010-08-24 12:31:17 UTC (rev 3018)
@@ -84,6 +84,9 @@
lima.enum.comboboxaccount.account=Compte
lima.enum.comboboxaccount.accountlist=Liste de comptes
lima.enum.comboboxaccount.allaccount=Tous les comptes
+lima.enum.comboboxamount.both=Les deux
+lima.enum.comboboxamount.credit=Cr\u00E9dit
+lima.enum.comboboxamount.debit=D\u00E9bit
lima.enum.comboboxentrybook.all=Tous les journaux
lima.enum.comboboxentrybook.select_one=Journal
lima.enum.comboboxoperator.equal=\u00C9gal
Deleted: trunk/src/referencement.txt
===================================================================
--- trunk/src/referencement.txt 2010-08-23 20:01:24 UTC (rev 3017)
+++ trunk/src/referencement.txt 2010-08-24 12:31:17 UTC (rev 3018)
@@ -1,4 +0,0 @@
-Voici les adresses où la promotion du logiciel a été assurée :
-- http://forum.framasoft.org/viewtopic.php?f=99&t=30743
-- http://freshmeat.net/projects/limacallao/
-- http://linuxfr.org/forums/12/26311.html
Modified: trunk/src/site/rst/features.rst
===================================================================
--- trunk/src/site/rst/features.rst 2010-08-23 20:01:24 UTC (rev 3017)
+++ trunk/src/site/rst/features.rst 2010-08-24 12:31:17 UTC (rev 3018)
@@ -1,51 +1,46 @@
========
-Features
+Fonctionnalités
========
-Description
+
+Structure
-----------
-Le moteur de comptabilité CALLAO, couplé à l'interface graphique LIMA,
-propose toutes les fonctionnalités indispensables et légales à la tenue de la
-comptabilité générale d'une entreprise. Il peut communiquer avec l'ERP Chorem,
-pour effectuer de la comptabilité analytique.
+Cette section permet de définir le cadre de la comptabilité :
+- plan comptable
+- journaux
+- exercices
+- période comptable
+- plan bilan / compte de résultat
-Le tout proposera à terme un maximum de flexibilité avec des possibilités de
-stockage des données autonomes sur un seul poste, ou centralisées et accessibles
-à plusieurs personnes sur un serveur. On notera aussi que chacune des composantes
-se veut indépendante : LIMA pourra fonctionner sur CALLAO, OFBiz Neogia ou tout
-autre moteur de comptabilité conçu de manière à être compatible. Il en va de
-même pour Callao, qui pourra fonctionner avec d'autres interfaces conçues pour,
-et qui pourra donc être intégré dans un autre logiciel (ERP ou autre).
+Traitement
+-----------
-Liste de fonctionnalités
-------------------------
+La partie traitement regroupe les fonctions utiles au quotidien :
+Saisie et recherche
-Voici la liste de fonctionnalités de LIMA :
-- Saisie des écritures comptables multi-journal
-- Affichage des transactions des différents journaux et des comptes du grand livre
-- Clôture d'une période
-- Possibilité de modifier/supprimer les écritures d'une période non-clôturée
-- Fonctionnalité de semi-clôture pour éviter les saisies accidentelles sur un
- intervalle de temps donné.
-- Lettrage
-- Import/export des données depuis/vers un fichier.
-- Génération et publication des états comptables définitifs pour les périodes
- clôturés
-- Génération et publication d'états comptables provisoires pour les périodes
- non-clôturées
-- Conformité au cadre légal de la comptabilité informatisée en France
-- Labellisation des opérations suivant différentes informations (clients,
- projets, catégorie) afin de rendre possibles des échanges avec le projet
- Chorem_
+Rapports
+-----------
+Permet de visualiser les documents usuelles de la comptabilité :
+- journal
+- comptes
+- balance
+- grand-livre
+- Bilan et compte de résultat
-``Solutions``
-=============
+Les documents sont atteignables par les menu de LIMA et via un site internet embarqué.
-.. image:: schemas/schema-solutions.png
+Import / Export
+-----------
-.. _Chorem: http://chorem.org/
+Toutes les données de LIMA sont exportables et importables à volontés au format CSV.
+L'utilisation de ce format permet d'être exploité par un tableur.
+
+
+
+Actuellement LIMA permet l'import et l'export pour EBP. Il serait envisageable d'ajouté
+l'import / export pour d'autre logiciel à la demande.
Modified: trunk/src/site/rst/presentation.rst
===================================================================
--- trunk/src/site/rst/presentation.rst 2010-08-23 20:01:24 UTC (rev 3017)
+++ trunk/src/site/rst/presentation.rst 2010-08-24 12:31:17 UTC (rev 3018)
@@ -5,114 +5,102 @@
Introduction
------------
-LIMA_ est un logiciel libre de gestion de comptabilité pensé pour être le
-plus ergonomique possible.
+Acronyme de Lutin Invoice Monitoring and Accounting, l’application de comptabilité
+LIMA est un logiciel libre pensé pour être la plus ergonomique possible et facile
+d’accès à tout utilisateur quelque soit leur niveau en comptabilité : débutant
+comme confirmé.
+La particularité de LIMA est qu’il s’agit d’un produit évolutif permettant de
+répondre aux besoins spécifiques de toute entreprise ou organisation, tout en
+garantissant le maintien des données comptables.
-Ayant comme particularité d'être évolutif au fil des besoins de votre entreprise.
-LIMA_ n'est pas figé et doit vous garantir un maintien de vos données comptable
-ainsi que de vos habitudes de travail.
-Ce logiciel est multiplatforme, développé en JAVA, il peut s'adapter aux
-environnement Windows,UNIX: MacOs ou linux. Il peut être implanté avec un système
-de base de données embarqué ou sur un serveur.
+Le logiciel est écrit en Java ce qui assure une compatibilité multiplateforme :
+Windows, Mac OS X, Linux. Il peut-être installé en fonctionnement client monoposte,
+ou en configuration client <–> serveur.
+Lors d'une installation en client serveur, le moteur de persistence de donnée est
+installé coté serveur, et l'interface est installée sur autant de poste client que
+désiré.
-Cela permet de se conformer aux besoins de sociétés de taille diverse. Il n'est
-pas indispensable de disposer d'un serveur de base de données pour tenir sa
-comptabilité avec LIMA_.
+Historique
+------------
Ce projet est né d'un besoin d'adapter l'ergonomie d'OFBiz Neogia qui
proposait un système de comptabilité générale.
-OFBiz Neogia n'étant pas un système de comptablitié a part entière son interface
-n'est pas adaptée à la gestion de la comptabilité. Code Lutin à donc décidé de
-remplacer cette interface tout en gardant la possibilité d'utiliser le moteur
-d'OFBiz Neogia.
+OFBiz Neogia n'étant pas un simple système de comptablitié a part entière, mais
+un ERP complet.
+Son interface n'était pas adaptée au besoin d'un logiciel de comptabilité indépendant.
+Code Lutin à donc décidé de remplacer cette interface tout en gardant la possibilité
+d'utiliser le moteur d'OFBiz Neogia. La première étape a donc été d’adapter une
+interface autonome avec la technologie de bibliothèque graphique Java Swing.
-LIMA_ est indépendant du système gérant la comptabilité. Il a donc été décidé de
-développer un moteur propre à Code lutin: CALLAO_.
+L'interface de LIMA_ est indépendant du moteur gérant la comptabilité. Il a donc
+été décidé de développer un moteur propre à Code lutin: CALLAO_.
-.. _CALLAO: callao.html
-.. _LIMA: presentation.html
+En 2010, l'application a été réécrite en majeur partie pour d'une part répondre le
+plus fidèlement aux normes comptables, et d'autre part correspondre aux normes de
+programmation de Code Lutin. LIMA s'appuie notamment sur les projets internes Topia,
+ EuGene et JAXX.
-
Architecture
------------
+LIMA est un projet MAVEN multi-module, il est en réalité composé de trois projets Java :
+lima-business, lima-callao, lima-swing.
+
.. image:: resources/schemas/lima-callao-architecture.png
+Lima-callao
+~~~~~~~~~~~~~
-Présentation
-------------
+Ce projet permet de définir les entités appelées objets (données informatiques
+regroupant les principales caractéristiques des éléments du monde réel) nécessaires
+au métier du logiciel de comptabilité. Toutes les classes java correspondantes
+sont générées à l’aide d’un modèle UML (langage de modélisation unifié). Ce modèle
+est contenu dans un seul fichier au format zargo éditable avec le logiciel Argouml.
+Ce principe permet d’utiliser avantageusement la langue UML et ces normes. L’ensemble
+du schéma est ensuite généré via les projets internes à Code Lutin :
+EUGene et ToPIA grâce à Maven.
+Outre la définition des entités, le projet lima-callao permet via ToPIA- persistence
+de définir les méthodes associées à la base de données pour le stockage de ces
+entités : ajout, modification, suppression.
-L'interface de Lima se intègre les fonctionnalités suivantes
-
-Interface multi utilisateurs avec authentification :
+lima-business
+~~~~~~~~~~~~~
-.. image:: screenshots/lima-capture4-mini.png
+Ce projet permet d’implémenter/de définir le métier en utilisant des entités issues
+du projet lima-callao. Des services EJB qui ont un rôle précis y sont programmés.
+Ce sont ces services qui sont appelés par l’utilisateur lorsqu’il appelle des
+fonctions. Les services sont programmés avec un système de session afin de pouvoir
+être exécuté en mode client serveur. En effet, les services sont exécutés côté
+serveur et ainsi le client appelle les services en ouvrant une transaction.
+Il existe une multitude de services relatifs aux besoins du métier :
+service des comptes, service des journaux, service des périodes fiscales,
+service des périodes financières, service des entrées, services des rapports, etc...
+On peut ajouter, modifier et supprimer des services selon les besoins de l'activité.
-Connexion_
-.. _Connexion: screenshots/lima-capture4.png
+lima-swing
+~~~~~~~~~~~~~
+Il s’agit du projet qui permet d’exécuter l’UI (interface utilisateur) de LIMA.
+Le design de l’application y est défini : fenêtres, boutons, tableaux,...
+L’interface est programmée selon la méthode de conception MVC (modèle-vue-
+contrôleur). Le modèle est le couple lima-callao - lima-business. La partie
+vue-contrôleur se trouve donc dans lima-swing. La partie vue, ce qui s’affiche à
+l’utilisateur, est programmée en JAXX. Toutes les actions des éléments de la vue
+(fenêtres, boutons, menus, tableaux) sont définies dans le contrôleur. Le
+contrôleur est implémenté sous forme de classes Java qui s’occupent d’afficher
+les bons messages, d’appeler les services correspondants, et de retourner les
+données, par exemple : le remplissage d’un tableau.
-Gestion des écritures dans le journal :
-.. image:: screenshots/lima-capture-mini.png
-
-Ecritures_
-
-.. _Ecritures: screenshots/lima-capture.png
-
-
-Gestion des comptes du plan comptable général :
-
-.. image:: screenshots/lima-capture2-mini.png
-
-PCG_
-
-.. _PCG: screenshots/lima-capture2.png
-
-
-Edition des états comptables :
-
-.. image:: screenshots/etat-mini.png
-
-Etat_
-
-.. _Etat: screenshots/etat.png
-
-
-Recherches :
-
-.. image:: screenshots/recherche-mini.png
-
-Recherche_
-
-.. _Recherche: screenshots/recherche.png
-
-
-Les journaux :
-
-.. image:: screenshots/journaux-mini.png
-
-Journaux_
-
-.. _Journaux: screenshots/journaux.png
-
-
-Le lettrage :
-
-.. image:: screenshots/lettrage-mini.png
-
-Lettrage_
-
-.. _Lettrage: screenshots/lettrage.png
-
Licence
-------
-Lima est développé sous licence GPL.
+Lima est développé sous licence GPL :
+GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007
\ No newline at end of file
Modified: trunk/src/site/site_fr.xml
===================================================================
--- trunk/src/site/site_fr.xml 2010-08-23 20:01:24 UTC (rev 3017)
+++ trunk/src/site/site_fr.xml 2010-08-24 12:31:17 UTC (rev 3018)
@@ -13,20 +13,21 @@
</poweredBy>
<body>
- <menu name="Lima" inherit="top">
+ <menu name="Le projet" inherit="top">
<item name="Présentation" href="presentation.html"/>
- <item name="ScreenShots" href="screenshots.html"/>
- <item name="Features" href="features.html"/>
+ <item name="Fonctionnalités" href="features.html"/>
<item name="Lancer Lima en ligne" href="lima-main/jnlp/launch.jnlp" />
<item name="Téléchargements" href="http://chorem.org/projects/list_files/lima" />
- <item name="Lexique comptable" href="lexique.html" />
<item name="Contacts" href="contact.html" />
<item name="Dépôt SVN" href="http://svn.chorem.org/svn/lima/"/>
</menu>
- <menu name="Utilisateur" inherit="top" >
+ <menu name="Mode d'emploi" inherit="top" >
<item name="Installer et lancer" href="install.html" />
- <item name="Créer les journaux" href="journal.html" />
- <item name="Créer le plan comptable général" href="planComptable.html" />
+ <item name="Création de sa comptabilité" href="assistant.html" />
+ <item name="Saisie d'écritures" href="saisie.html" />
+ <item name="Rapports" href="rapports.html" />
+ <item name="Import / Export" href="importexport.html" />
+ <item name="Lexique comptable" href="lexique.html" />
</menu>
<menu ref="reports"/>
</body>
1
0
r3017 - in trunk: lima-business/src/main/java/org/chorem/lima/business/ejb lima-business/src/main/resources/images lima-swing/src/main/java/org/chorem/lima lima-swing/src/main/resources/images
by jpepin@users.chorem.org 23 Aug '10
by jpepin@users.chorem.org 23 Aug '10
23 Aug '10
Author: jpepin
Date: 2010-08-23 22:01:24 +0200 (Mon, 23 Aug 2010)
New Revision: 3017
Url: http://chorem.org/repositories/revision/lima/3017
Log:
Ajout icone LIMA sur la page web.
Slpash screen puzzle v2.
Added:
trunk/lima-business/src/main/resources/images/puzzle_icon_mini.png
Removed:
trunk/lima-business/src/main/resources/images/logo-codelutin.png
trunk/lima-business/src/main/resources/images/splash.png
Modified:
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/HttpServerServiceImpl.java
trunk/lima-swing/src/main/java/org/chorem/lima/LimaMain.java
trunk/lima-swing/src/main/java/org/chorem/lima/LimaSplash.java
trunk/lima-swing/src/main/resources/images/puzzle_splash.png
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/HttpServerServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/HttpServerServiceImpl.java 2010-08-23 16:49:11 UTC (rev 3016)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/HttpServerServiceImpl.java 2010-08-23 20:01:24 UTC (rev 3017)
@@ -203,14 +203,15 @@
+ "<style type=\"text/css\">"
+ "body { font: 14px sans-serif; }"
+ "h1 { font: 20px sans-serif; text-align: center; }"
- + "table.paddingleft td {padding-left:100px;}"
+ + "table.padding td {padding-right:20px;}"
+ ".tdright {text-align: right;}"
+ "</style>"
+ "</head>\n"
+ "<body>\n"
- + "<table class=\"paddingleft\">\n"
- + "<tr><td colspan=2><h1>LIMA Documents Report</h1></td></tr>\n"
- + "<tr><td><img src=\"?img=identity.png\"/></td>\n"
+ + "<table class=\"padding\">\n"
+ + "<tr><td><img src=\"?img=puzzle_icon_mini.png\"/></td>\n"
+ + "<td><h1>LIMA Documents Report</h1></td></tr>\n"
+ + "<tr><td class=\"tdright\"><img src=\"?img=identity.png\"/></td>\n"
+ "<td rowspan=3><form method=GET action="
+ serverAdress + ">\n"
+ _("lima-business.document.date.begin")
@@ -237,12 +238,12 @@
}
pageContent.append("</select>\n"
- + "<tr><td><img src=\"?img=entries.png\"/></td></tr>\n"
- + "<tr><td><img src=\"?img=accounts.png\"/></td></tr>\n"
- + "<tr><td><img src=\"?img=entrybooks.png\"/></td>\n"
+ + "<tr><td class=\"tdright\"><img src=\"?img=entries.png\"/></td></tr>\n"
+ + "<tr><td class=\"tdright\"><img src=\"?img=accounts.png\"/></td></tr>\n"
+ + "<tr><td class=\"tdright\"><img src=\"?img=entrybooks.png\"/></td>\n"
+ "<td class=\"tdright\"><input type=\"submit\"></td></tr>"
+ "</form>\n"
- + "<tr><td><img src=\"?img=fiscalperiods.png\"/></td></tr>\n"
+ + "<tr><td class=\"tdright\"><img src=\"?img=fiscalperiods.png\"/></td></tr>\n"
+ "</table>\n"
+ "</body>\n"
+ "</html>");
Deleted: trunk/lima-business/src/main/resources/images/logo-codelutin.png
===================================================================
(Binary files differ)
Added: trunk/lima-business/src/main/resources/images/puzzle_icon_mini.png
===================================================================
(Binary files differ)
Property changes on: trunk/lima-business/src/main/resources/images/puzzle_icon_mini.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Deleted: trunk/lima-business/src/main/resources/images/splash.png
===================================================================
(Binary files differ)
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/LimaMain.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/LimaMain.java 2010-08-23 16:49:11 UTC (rev 3016)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/LimaMain.java 2010-08-23 20:01:24 UTC (rev 3017)
@@ -54,6 +54,9 @@
/** Lima configuration. */
public static LimaConfig config;
+ /** splash */
+ private static LimaSplash splash;
+
/**
* Lima main method.
*
@@ -67,6 +70,7 @@
}
try {
+
// init root context
final LimaContext context = init(args);
@@ -98,6 +102,10 @@
*/
public static synchronized LimaContext init(String... args) throws Exception {
+ // update splash
+ splash = new LimaSplash();
+ splash.initSplash();
+
// to enable javassist on webstart, must remove any securityManager,
// see if this can be dangerous (should not be since jnlp is signed ?)
// moreover it speeds up the loading :)
@@ -114,6 +122,7 @@
log.debug("i18n loading time : " + (StringUtil.convertTime(t0, System.nanoTime())));
}
+
Runtime.getRuntime().addShutdownHook(new ShutdownHook());
// init root context
@@ -150,12 +159,10 @@
protected static void launch(LimaContext context) throws Exception {
+
+ splash.drawVersion(config.getVersion());
+ splash.updateProgression(0.1, _("lima.splash.1"));
- // update splash
- LimaSplash splash = new LimaSplash();
- splash.initSplash(config.getVersion());
- splash.updateProgression(0.1, _("lima.splash.1"));
-
// do init ui
MainViewHandler uiHandler = context.getContextValue(MainViewHandler.class);
final MainView ui = uiHandler.initUI(context, context.getConfig().isFullScreen());
@@ -166,7 +173,7 @@
// load accounts and test if there is an account plan defined
// if not, call #loadDefaultAccount()
- splash.updateProgression(0.5, _("lima.splash.2"));
+ splash.updateProgression(0.7, _("lima.splash.2"));
//start http server
LimaServiceFactory.getInstance().getService(HttpServerServiceMonitorable.class).start();
@@ -185,7 +192,7 @@
openingView.setLocationRelativeTo(null);
openingView.setVisible(true);
}
- splash.updateProgression(0.5, _("lima.splash.3"));
+ splash.updateProgression(1, _("lima.splash.3"));
// show ui
SwingUtilities.invokeLater(new Runnable() {
@Override
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/LimaSplash.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/LimaSplash.java 2010-08-23 16:49:11 UTC (rev 3016)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/LimaSplash.java 2010-08-23 20:01:24 UTC (rev 3017)
@@ -67,10 +67,18 @@
*
* @param version version to display on splash screen
*/
- public void initSplash(String version) {
+ public void initSplash() {
if (splashGraphics != null) {
- splashGraphics.setColor(Color.BLACK);
- splashGraphics.drawString("Version : " + version, 394, 42);
+ splashGraphics.setColor(Color.GRAY);
+ splashGraphics.drawRect(65, 253, 300, 10);
+ splashGraphics.fillRect(65, 253, 0, 10);
+
+ splashGraphics.setColor(Color.DARK_GRAY);
+ Font font = new Font("Lucida Sans", Font.BOLD, 14);
+ splashGraphics.setFont(font);
+ splashGraphics.drawString("Lutin Invoice Monitoring and Accounting", 65, 249);
+
+ splash.update();
}
else {
if (log.isWarnEnabled()) {
@@ -81,6 +89,17 @@
}
}
+ public void drawVersion(String version){
+ if (splashGraphics != null) {
+ splashGraphics.setColor(Color.DARK_GRAY);
+ Font font = new Font("Lucida Sans", Font.PLAIN, 12);
+ splashGraphics.setFont(font);
+ splashGraphics.setColor(Color.BLACK);
+ splashGraphics.drawString("Version : " + version, 394, 42);
+ splash.update();
+ }
+ }
+
/**
* Update progression.
*
Modified: trunk/lima-swing/src/main/resources/images/puzzle_splash.png
===================================================================
(Binary files differ)
1
0
r3016 - in trunk/lima-swing/src/main: java/org/chorem/lima/ui resources/import
by jpepin@users.chorem.org 23 Aug '10
by jpepin@users.chorem.org 23 Aug '10
23 Aug '10
Author: jpepin
Date: 2010-08-23 18:49:11 +0200 (Mon, 23 Aug 2010)
New Revision: 3016
Url: http://chorem.org/repositories/revision/lima/3016
Log:
Ajout ic?\195?\180ne ?\195?\160 la fen?\195?\170tre principale.
Mis ?\195?\160 jour fichier journaux par d?\195?\169faut.
Modified:
trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainView.jaxx
trunk/lima-swing/src/main/resources/import/eb_default.csv
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainView.jaxx 2010-08-23 16:38:53 UTC (rev 3015)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainView.jaxx 2010-08-23 16:49:11 UTC (rev 3016)
@@ -19,7 +19,8 @@
defaultCloseOperation="do_nothing_on_close"
undecorated='{getConfig().isFullScreen()}'
resizable="true" width="800" height="600"
- extendedState='{this.MAXIMIZED_BOTH}'>
+ extendedState='{this.MAXIMIZED_BOTH}'
+ iconImage='{new ImageIcon(getClass().getResource("/images/puzzle_icon.png")).getImage()}'>
<java.awt.Desktop id='desktop' javaBean='java.awt.Desktop.getDesktop()'/>
Modified: trunk/lima-swing/src/main/resources/import/eb_default.csv
===================================================================
--- trunk/lima-swing/src/main/resources/import/eb_default.csv 2010-08-23 16:38:53 UTC (rev 3015)
+++ trunk/lima-swing/src/main/resources/import/eb_default.csv 2010-08-23 16:49:11 UTC (rev 3016)
@@ -1,4 +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"
+"ENBK";"ACH";"Journal des achats"
+"ENBK";"VTE";"Journal des ventes"
+"ENBK";"ODT";"Journal des opérations diverses"
+"ENBK";"BQE";"Journal de trésorerie"
1
0
Author: jpepin
Date: 2010-08-23 18:38:53 +0200 (Mon, 23 Aug 2010)
New Revision: 3015
Url: http://chorem.org/repositories/revision/lima/3015
Log:
Suppression de code inutile.
Nettoyage des cl?\195?\169s i18n et traduction.
Added:
trunk/lima-swing/src/main/resources/images/puzzle_icon.png
Removed:
trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/EntryBookTypeListModel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/CriteriaWidget.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/util/FileChooseView.jaxx
trunk/lima-swing/src/main/resources/images/logo-codelutin.png
trunk/lima-swing/src/main/resources/images/splash.png
Modified:
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/DocumentServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/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/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/ejbinterface/FiscalPeriodService.java
trunk/lima-business/src/main/resources/i18n/lima-business-en_GB.properties
trunk/lima-business/src/main/resources/i18n/lima-business-fr_FR.properties
trunk/lima-callao/src/main/java/org/chorem/lima/entity/AccountDAOImpl.java
trunk/lima-callao/src/main/xmi/accounting.zargo
trunk/lima-swing/src/main/java/org/chorem/lima/LimaMain.java
trunk/lima-swing/src/main/java/org/chorem/lima/LimaSplash.java
trunk/lima-swing/src/main/java/org/chorem/lima/actions/MiscAction.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/AccountForm.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountViewHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/SubLedgerForm.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsPeriodSearchPanel.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/BalancePeriodSearchPanel.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/entrybook/EntryBookForm.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookTableModel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookViewHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsPeriodSearchPanel.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/financialperiod/FinancialPeriodTableModel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialperiod/FinancialPeriodView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialperiod/FinancialPeriodViewHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartViewHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportPeriodSearchPanel.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/FinancialTransactionView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionViewHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionPeriodSearchPanel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedViewHandler.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/FiscalPeriodTableModel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/FiscalPeriodView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/FiscalPeriodViewHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/AccountsPane.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/EntryBooksPane.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/FinancialTransactionsPane.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/FiscalPeriodsPane.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/HomeView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerPeriodSearchPanel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerViewHandler.java
trunk/lima-swing/src/main/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/util/DialogHelper.java
trunk/lima-swing/src/main/java/org/chorem/lima/util/ErrorHelper.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/AccountServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java 2010-08-23 09:35:53 UTC (rev 3014)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java 2010-08-23 16:38:53 UTC (rev 3015)
@@ -85,7 +85,7 @@
accountDAO.findByAccountNumber(account.getAccountNumber());
if (existAccount != null) {
throw new LimaBusinessException(_(
- "An account already exists with this number : %s",
+ "lima-business.account.accountalreardyexist",
account.getAccountNumber()));
}
@@ -153,7 +153,7 @@
accountDAO.findByAccountNumber(account.getAccountNumber());
if (existAccount != null) {
throw new LimaBusinessException(_(
- "An account already exists with this number : %s",
+ "lima-business.account.accountalreardyexist",
account.getAccountNumber()));
}
@@ -432,109 +432,6 @@
}
- /*
- * Convert string of extends number to list of accounts
- * Example '22, 45..48, 67' -> [22, 45, 46, 47, 48, 67]
- * SubAccountsMode return list of existing subaccounts ex 6 return : 61, 62, .., 69, 610, .., 619 etc
- *
- @Override
- public List<Account> stringToListAccountsWithTransaction(String selectedAccounts, Boolean subAccountsMode, TopiaContext topiaContext) throws LimaException{
- List<Account> accounts = new ArrayList<Account>();
- if (selectedAccounts != null){
- try {
- AccountDAO accountDAO =
- LimaCallaoDAOHelper.getAccountDAO(topiaContext);
- //Remove Spaces
- selectedAccounts = StringUtils.deleteWhitespace(selectedAccounts);
- //use hashset for delete duplicate numbers
- HashSet<String> accountNumbers = new HashSet<String>();
- HashSet<String> accountNumbersToRemove = new HashSet<String>();
- Boolean first = true;
- StringTokenizer stStar = new StringTokenizer(selectedAccounts, "-");
- while (stStar.hasMoreTokens()) {
- String subString = stStar.nextToken();
-
- //Split comma
- StringTokenizer stComma = new StringTokenizer(subString, ",");
- while (stComma.hasMoreTokens()) {
- String s = stComma.nextToken();
- if (s.contains("..")){
- //Split ..
- String stringDoubleDot[] = s.split("\\.\\.");
- int lowAccount=Integer.parseInt(stringDoubleDot[0]);
- int highAccount=Integer.parseInt(stringDoubleDot[1]);
- for (int i=lowAccount; i <= highAccount; i++) {
- //if first add accounts, else remove
- if (first){
- accountNumbers.add(String.valueOf(i));
- }
- else {
- accountNumbersToRemove.add(String.valueOf(i));
- }
- }
- }
- else{
- //if first
- if (first){
- accountNumbers.add(s);
- }
- else {
- accountNumbersToRemove.add(s);
- }
- }
- }
- first=false;
- }
- //add all accounts
- for (String accountNumber : accountNumbers) {
- Account account = null;
- if (subAccountsMode){
- account = accountDAO.findSubAccountByNumber(accountNumber);
- }
- else {
- account = accountDAO.findByAccountNumber(accountNumber);
-
- }
- //add account if exist
- if (account != null){
- accounts.add(account);
- }
- //search all account start with accountnumber
- else {
- TopiaQuery query = accountDAO.createQuery();
- String subAccountsProperty = TopiaQuery.getProperty(Account.SUB_ACCOUNTS);
- //String subLedgersProperty = TopiaQuery.getProperty(Account.SUB_LEDGERS);
- query.addWhere("not exists elements ("+subAccountsProperty+")")
- //.addWhere("not exists elements ("+subLedgersProperty+")")
- .addWhere(Account.ACCOUNT_NUMBER, Op.LIKE, accountNumber+"%");
- List<Account> accountsResult = accountDAO.findAllByQuery(query);
- if (accountsResult != null){
- accounts.addAll(accountsResult);
- }
- }
- }
- //remove all accounts
- for (String accountNumber : accountNumbersToRemove) {
- Account account = null;
- if (subAccountsMode){
- account = accountDAO.findSubAccountByNumber(accountNumber);
- }
- else {
- account = accountDAO.findByAccountNumber(accountNumber);
- }
- if (account != null) {
- accounts.remove(account);
- }
- }
- }
- catch (TopiaException ex) {
- doCatch(topiaContext, ex, log);
- }
- }
-
- return accounts;
- }*/
-
protected TopiaContext beginTransaction() throws TopiaException {
// basic check done, make check in database
// TODO move it into JTA
@@ -554,6 +451,5 @@
throw eee;
}
}
-
}
\ No newline at end of file
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/DocumentServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/DocumentServiceImpl.java 2010-08-23 09:35:53 UTC (rev 3014)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/DocumentServiceImpl.java 2010-08-23 16:38:53 UTC (rev 3015)
@@ -272,7 +272,6 @@
//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();
int max = n;
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-08-23 09:35:53 UTC (rev 3014)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/EntryBookServiceImpl.java 2010-08-23 16:38:53 UTC (rev 3015)
@@ -85,7 +85,7 @@
entryBookDAO.findByLabel(entryBook.getCode());
if (existingEntryBook != null) {
throw new LimaBusinessException(
- _("An EntryBook already exists with this label : %s",
+ _("lima-business.entrybook.entrybookalreadyexist",
entryBook.getLabel()));
}
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ExportServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ExportServiceImpl.java 2010-08-23 09:35:53 UTC (rev 3014)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ExportServiceImpl.java 2010-08-23 16:38:53 UTC (rev 3015)
@@ -209,7 +209,7 @@
doCatch(topiaContext, eeeTE, log);
}
catch (IOException eeeIO) {
- log.debug("Can't create new CSV Writer",eeeIO);
+ log.error("Can't create new CSV Writer",eeeIO);
}
finally {
doFinally(topiaContext, log);
@@ -249,7 +249,7 @@
doCatch(topiaContext, eeeTE, log);
}
catch (IOException eeeIO) {
- log.debug("Can't create new CSV Writer",eeeIO);
+ log.error("Can't create new CSV Writer",eeeIO);
}
finally {
doFinally(topiaContext, log);
@@ -279,7 +279,7 @@
doCatch(topiaContext, eeeTE, log);
}
catch (IOException eeeIO) {
- log.debug("Can't create new CSV Writer",eeeIO);
+ log.error("Can't create new CSV Writer",eeeIO);
}
finally {
doFinally(topiaContext, log);
@@ -366,7 +366,7 @@
doCatch(topiaContext, eeeTE, log);
}
catch (IOException eeeIO) {
- log.debug("Can't create new CSV Writer",eeeIO);
+ log.error("Can't create new CSV Writer",eeeIO);
}
finally {
doFinally(topiaContext, log);
@@ -381,7 +381,7 @@
*/
public void exportEntryBookChartAsCSV(CSVWriter csvWriter, TopiaContext topiaContext) throws LimaException {
try {
- String[] nextLine = new String[4];
+ String[] nextLine = new String[3];
// Get all entrybook
EntryBookDAO entryBookDAO =
LimaCallaoDAOHelper.getEntryBookDAO(topiaContext);
@@ -391,7 +391,6 @@
nextLine[0] = ImportExportEntityEnum.ENTRYBOOK.getLabel();
nextLine[1] = entryBook.getCode();
nextLine[2] = entryBook.getLabel();
- nextLine[3] = entryBook.getType();
// Ajoute la ligne au fichier
csvWriter.writeNext(nextLine);
}
@@ -423,7 +422,7 @@
doCatch(topiaContext, eeeTE, log);
}
catch (IOException eeeIO) {
- log.debug("Can't create new CSV Writer",eeeIO);
+ log.error("Can't create new CSV Writer",eeeIO);
}
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-08-23 09:35:53 UTC (rev 3014)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialStatementServiceImpl.java 2010-08-23 16:38:53 UTC (rev 3015)
@@ -90,19 +90,6 @@
FinancialStatementDAO financialStatementDAO =
LimaCallaoDAOHelper.getFinancialStatementDAO(topiaContext);
- /* 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);
FinancialStatement masterfinancialStatementUpdate = null;
@@ -560,8 +547,8 @@
for (Account account : accountsList) {
- result.append(_("lima-business.financialstatement.check.nothing")
- + " : "+account.getAccountNumber()+" - "+account.getLabel()+"\n");
+ result.append(_("lima-business.financialstatement.check.nothing",
+ account.getAccountNumber(), account.getLabel()));
}
}
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java 2010-08-23 09:35:53 UTC (rev 3014)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java 2010-08-23 16:38:53 UTC (rev 3015)
@@ -678,9 +678,7 @@
break;
}
}
- log.debug(query);
financialTransactions = financialTransactionDAO.findAllByQuery(query);
- log.debug(financialTransactions);
EntryDAO entryDAO = LimaCallaoDAOHelper.getEntryDAO(topiaContext);
for (FinancialTransaction financialTransaction : financialTransactions) {
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-08-23 09:35:53 UTC (rev 3014)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FiscalPeriodServiceImpl.java 2010-08-23 16:38:53 UTC (rev 3015)
@@ -35,7 +35,6 @@
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;
import org.chorem.lima.entity.FiscalPeriodDAO;
import org.chorem.lima.entity.LimaCallaoDAOHelper;
@@ -253,35 +252,6 @@
}
}
- /**
- * just for debug, this method must delete
- * Unauthorized action for user !!!
- */
- public void removeAllFiscalPeriods() throws LimaException{
- TopiaContext transaction = null;
- try {
- transaction = beginTransaction();
-
- FiscalPeriodDAO fiscalPeriodDAO =
- LimaCallaoDAOHelper.getFiscalPeriodDAO(transaction);
- FinancialPeriodDAO financialPeriodDAO =
- LimaCallaoDAOHelper.getFinancialPeriodDAO(transaction);
- for (FiscalPeriod fiscalPeriod : fiscalPeriodDAO.findAll()) {
- for (FinancialPeriod financialPeriod : fiscalPeriod.getFinancialPeriod()){
- financialPeriodDAO.delete(financialPeriod);
- }
- fiscalPeriodDAO.delete(fiscalPeriod);
- }
-
- commitTransaction(transaction);
-
- } catch (TopiaException ex) {
- doCatch(transaction, ex, log);
- }
- finally {
- doFinally(transaction, log);
- }
- }
protected TopiaContext beginTransaction() throws TopiaException {
// basic check done, make check in database
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java 2010-08-23 09:35:53 UTC (rev 3014)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java 2010-08-23 16:38:53 UTC (rev 3015)
@@ -19,6 +19,7 @@
package org.chorem.lima.business.ejb;
+import static org.nuiton.i18n.I18n._;
import java.io.IOException;
import java.io.StringReader;
import java.math.BigDecimal;
@@ -36,7 +37,6 @@
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;
@@ -187,7 +187,7 @@
if (!Arrays.asList(strat.getColumnMapping()).containsAll(
headAccount)) {
throw new LimaBusinessException(
- "ERROR : This file contains no entries");
+ _("lima-business.import.ebpnoentry"));
}
CsvToBean<EntryEBPImpl> csv = new CsvToBean<EntryEBPImpl>();
@@ -207,7 +207,7 @@
if (nbFiscalPeriods == 0) {
throw new LimaBusinessException(
- "Can't import entries, no fiscalperiod is open");
+ _("lima-business.import.nofiscalperiodopen"));
}
FinancialTransaction financialTransaction = null;
@@ -224,17 +224,13 @@
// if account not exist not export
if (account == null) {
throw new LimaBusinessException(
- "FAILED : Account "
- + entryEBP.getCompte()
- + " not exist !\n"
- + "Import aborted ! Create all accounts before import entries");
+ _("lima-business.import.ebpmissingaccount",
+ entryEBP.getCompte()));
}
else if (date.compareTo(beginDate) < 0 || date.compareTo(endDate) > 0){
- result.append("WARNING : " + date + " entries is out of range of" +
- " opened fiscal periods. "
- + "Entry was skip !\n");
+ result.append(_("lima-business.import.entriesoutofdatesrange",date));
}
else {
entry.setAccount(account);
@@ -260,8 +256,7 @@
entryBook.setCode(entryBookCode);
// create it
entryBookService.createEntryBook(entryBook);
- result.append("WARNING : Entrybook " + entryBook
- + "not exist was created !\n");
+ result.append(_("lima-business.import.entrybooknotexist",entryBook));
}
if (financialTransaction == null
@@ -287,15 +282,13 @@
financialTransactionService
.createFinancialTransactionWithTransaction(
financialTransaction, topiaContext);
- result.append("SUCCES : FinancialTransaction" + date + " "
- + entryBook.getCode() + " added\n");
+ result.append(_("lima-business.import.transactionadded", date, entryBook.getCode()));
}
financialTransaction.addEntry(entry);
financialTransactionService.createEntryWithTransaction(
entry, topiaContext);
- result.append("SUCCES : Entry" + entry.getDescription() + " "
- + entry.getAmount() + " added\n");
+ result.append(_("lima-business.import.entryadded", entry.getDescription(), entry.getAmount()));
}
}
// update last financial transaction
@@ -310,13 +303,9 @@
} catch (TopiaException eeeTE) {
doCatch(topiaContext, eeeTE, log);
} catch (IOException eeeIO) {
- if (log.isDebugEnabled()) {
- log.debug("Can't read string", eeeIO);
- }
+ log.error("Can't read string", eeeIO);
} catch (ParseException eeePE) {
- if (log.isDebugEnabled()) {
- log.debug("Can't parse date", eeePE);
- }
+ log.error("Can't parse date", eeePE);
} finally {
doFinally(topiaContext, log);
}
@@ -343,7 +332,7 @@
if (!Arrays.asList(strat.getColumnMapping()).containsAll(
headAccount)) {
throw new LimaBusinessException(
- "ERROR : This file contains no account");
+ _("lima-business.import.noaccount"));
}
CsvToBean<AccountEBPImpl> csv = new CsvToBean<AccountEBPImpl>();
@@ -355,8 +344,7 @@
for (AccountEBP accountEBP : list) {
String accountNumber = accountEBP.getNumero();
if (accountDAO.findByAccountNumber(accountNumber) != null) {
- result.append("FAILED : Account" + accountNumber
- + " already exist \n");
+ result.append(_("lima-business.import.accountalreadyexist", accountNumber));
} else {
String label = accountEBP.getIntitule();
Account account = new AccountImpl();
@@ -376,8 +364,7 @@
}
accountService.createSubLedgerWithTransaction(
masterAccount, account, topiaContext);
- result.append("SUCCES : Account" + accountNumber + " "
- + label + " added\n");
+ result.append(_("lima-business.import.accountadded", accountNumber, label));
}
// else is account
else {
@@ -386,8 +373,7 @@
if (nbCharAccountNumber == 1) {
accountService.createAccountWithTransaction(null,
account, topiaContext);
- result.append("SUCCES : Account" + accountNumber + " "
- + label + " added\n");
+ result.append(_("lima-business.import.accountadded", accountNumber, label));
}
else {
Account masterAccount = null;
@@ -401,8 +387,7 @@
}
accountService.createAccountWithTransaction(
masterAccount, account, topiaContext);
- result.append("SUCCES : Account" + accountNumber + " "
- + label + " added\n");
+ result.append(_("lima-business.import.accountadded", accountNumber, label));
}
}
}
@@ -410,9 +395,7 @@
} catch (TopiaException eeeTE) {
doCatch(topiaContext, eeeTE, log);
} catch (IOException eeeIO) {
- if (log.isDebugEnabled()) {
- log.debug("Can't read string", eeeIO);
- }
+ log.error("Can't read string", eeeIO);
} finally {
doFinally(topiaContext, log);
}
@@ -523,7 +506,7 @@
} catch (TopiaException eeeTE) {
doCatch(topiaContext, eeeTE, log);
} catch (IOException eeeIO) {
- log.debug("Can't create new CSV Reader", eeeIO);
+ log.error("Can't create new CSV Reader", eeeIO);
} finally {
doFinally(topiaContext, log);
}
@@ -593,7 +576,7 @@
} catch (TopiaException eeeTE) {
doCatch(topiaContext, eeeTE, log);
} catch (IOException eeeIO) {
- log.debug("Can't create new CSV Reader", eeeIO);
+ log.error("Can't create new CSV Reader", eeeIO);
} finally {
doFinally(topiaContext, log);
}
@@ -633,8 +616,7 @@
// put it in hashset
accounts.put(accountNumber, accountImport);
} else {
- result.append("FAILED : The account " + accountNumber
- + " already exists !\n");
+ result.append(_("lima-business.import.accountalreadyexist", accountNumber));
}
} catch (TopiaException eeeTE) {
doCatch(topiaContext, eeeTE, log);
@@ -665,13 +647,10 @@
if (fiscalPeriodDAO.findByNaturalId(beginDate, endDate) == null) {
fiscalPeriods.add(fiscalPeriod);
} else {
- result.append("FAILED : The fiscalperiod " + beginDate + "-"
- + endDate + " already exists !\n");
+ result.append(_("lima-business.import.fiscalperiodalreadyexist", beginDate , endDate));
}
} catch (ParseException eeePE) {
- if (log.isDebugEnabled()) {
- log.debug("Can't parse date", eeePE);
- }
+ log.error("Can't parse date", eeePE);
} catch (TopiaException eeeTE) {
doCatch(topiaContext, eeeTE, log);
}
@@ -692,17 +671,14 @@
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.append("FAILED : The entrybook " + entryBook.getLabel()
- + " already exists !\n");
+ result.append(_("lima-business.import.entrybookalreadyexist", entryBook.getLabel()));
} else {
// create it
entryBookService.createEntryBook(entryBook);
- result.append("SUCCESS : The financialStatement "
- + entryBook.getLabel() + " is created ! \n");
+ result.append(_("lima-business.import.financialstatementadded", entryBook.getLabel()));
}
} catch (TopiaException eeeTE) {
doCatch(topiaContext, eeeTE, log);
@@ -788,8 +764,7 @@
financialStatements.put(label, (ArrayList<FinancialStatementImport>) list);
}
} else {
- result.append("FAILED : The financialstatement " + label
- + " already exists !\n");
+ result.append(_("lima-business.import.financialstatementalreadyexist", label));
}
} catch (TopiaException eeeTE) {
doCatch(topiaContext, eeeTE, log);
@@ -911,18 +886,15 @@
masterFinancialStatement,
financialStatement, topiaContext);
- result.append("SUCCESS : The financialStatement "
- + financialStatementImport.getLabel()
- + " is created ! \n");
+ result.append(_("lima-business.import.financialstatementadded",
+ financialStatementImport.getLabel()));
itr2.remove();
} else if (!financialStatements
.containsKey(masterFinancialStatementLabel)) {
- result.append("FAILED : The financialStatement "
- + financialStatementImport.getLabel()
- + " have masterFinancialStatement : "
- + masterFinancialStatementLabel
- + "which not exist \n");
+ result.append(_("lima-business.import.financialstatementalnomaster",
+ financialStatementImport.getLabel(),
+ masterFinancialStatementLabel));
itr2.remove();
}
}
@@ -945,11 +917,11 @@
try {
fiscalPeriodService.createFiscalPeriodWithTransaction(
fiscalPeriod, topiaContext);
- result.append("SUCCESS : The fiscalPeriod "
- + fiscalPeriod.getBeginDate() + "-"
- + fiscalPeriod.getEndDate() + " is created ! \n");
+ result.append(_("lima-business.import.fiscalperiodadded",
+ fiscalPeriod.getBeginDate(),
+ fiscalPeriod.getEndDate()));
} catch (LimaException eee) {
- result.append("FAILED : " + eee + " \n");
+ result.append(_("lima-business.common.failed", eee.getMessage()));
}
}
return result.toString();
@@ -993,16 +965,15 @@
accountService.createAccountWithTransaction(
masterAccount, account, topiaContext);
}
- result.append("SUCCESS : The account "
- + accountImport.getAccountNumber()
- + " is created ! \n");
+ result.append(_("lima-business.import.accountadded",
+ accountImport.getAccountNumber(),
+ accountImport.getLabel()));
itr.remove();
} else if (!accounts.containsKey(masterAccountNumber)
&& !accounts.containsKey(generalLedgerNumber)) {
- result.append("FAILED : The account "
- + accountImport.getAccountNumber()
- + " have masterAccount : "
- + masterAccountNumber + "which not exist \n");
+ result.append(_("lima-business.import.accountnomaster",
+ accountImport.getAccountNumber(),
+ masterAccountNumber));
itr.remove();
}
}
@@ -1046,20 +1017,16 @@
financialPeriodService
.blockClosedPeriodicEntryBookWithTransaction(
closedPeriodicEntryBook, topiaContext);
- result.append("SUCCESS : The blockClosedPeriodicEntryBook "
- + beginDateFinancialPeriod + "-"
- + endDateFinancialPeriod + ", " + codeEntryBook
- + " is updated ! \n");
+ result.append(_("lima-business.import.closedperiodicentrybookupdated",
+ beginDateFinancialPeriod, endDateFinancialPeriod, codeEntryBook));
} catch (LimaException eee) {
- result.append("FAILED : " + eee + " \n");
+ result.append(_("lima-business.common.failed", eee));
}
}
} catch (TopiaException eeeTE) {
doCatch(topiaContext, eeeTE, log);
} catch (ParseException eeePE) {
- if (log.isDebugEnabled()) {
- log.debug("Can't parse date", eeePE);
- }
+ log.error("Can't parse date", eeePE);
}
return result.toString();
}
@@ -1124,9 +1091,7 @@
} catch (TopiaException eeeTE) {
doCatch(topiaContext, eeeTE, log);
} catch (ParseException eeePE) {
- if (log.isDebugEnabled()) {
- log.debug("Can't parse date", eeePE);
- }
+ log.error("Can't parse date", eeePE);
}
return result.toString();
}
@@ -1151,8 +1116,7 @@
identityService.updateIdentityWithTransaction(identity, topiaContext);
// create it
- result.append("SUCCESS : The identity " + identity.getName()
- + " is created ! \n");
+ result.append(_("lima-business.import.identityadded", identity.getName()));
return result.toString();
}
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FiscalPeriodService.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FiscalPeriodService.java 2010-08-23 09:35:53 UTC (rev 3014)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FiscalPeriodService.java 2010-08-23 16:38:53 UTC (rev 3015)
@@ -44,7 +44,5 @@
void createFiscalPeriod(FiscalPeriod fiscalPeriod) throws LimaException;
- void blockFiscalPeriod(FiscalPeriod fiscalPeriod) throws LimaException;
-
- void removeAllFiscalPeriods() throws LimaException;
+ void blockFiscalPeriod(FiscalPeriod fiscalPeriod) throws LimaException;
}
Modified: trunk/lima-business/src/main/resources/i18n/lima-business-en_GB.properties
===================================================================
--- trunk/lima-business/src/main/resources/i18n/lima-business-en_GB.properties 2010-08-23 09:35:53 UTC (rev 3014)
+++ trunk/lima-business/src/main/resources/i18n/lima-business-en_GB.properties 2010-08-23 16:38:53 UTC (rev 3015)
@@ -1,56 +1,62 @@
-An\ EntryBook\ already\ exists\ with\ this\ label\ \:\ %s=
-An\ account\ already\ exists\ with\ this\ number\ \:\ %s=
-An\ financialStatement\ already\ exists\ with\ this\ label\ \:\ %s=
-business.document.financialstatement=
-lima-business.config.configFileName.description=
-lima-business.config.rulesnationality=
-lima-business.document.accountnubmer=
-lima-business.document.accountnumber=
-lima-business.document.amount=Amout
-lima-business.document.amounts=
-lima-business.document.balance=
-lima-business.document.businessnumber=
+lima-business.account.accountalreardyexist=An account already exists with this number \: %s
+lima-business.common.failed=FAILED \: %s \n
+lima-business.document.accountnumber=Account N\u00B0
+lima-business.document.amounts=Amounts
+lima-business.document.balance=Balance
+lima-business.document.businessnumber=Business N\u00B0
lima-business.document.carryback=Carry Back
lima-business.document.carryforward=reporter\u00C0
-lima-business.document.classificationcode=
-lima-business.document.classificationcode\ \:=
-lima-business.document.createdate1=
-lima-business.document.createdate2=
+lima-business.document.classificationcode=Classification Code
+lima-business.document.createdate1=Editing Date
+lima-business.document.createdate2=to
lima-business.document.credit=Credit
lima-business.document.date=Date
-lima-business.document.date.begin=
-lima-business.document.date.end=
+lima-business.document.date.begin=Begin date
+lima-business.document.date.end=End date
lima-business.document.debit=Debit
lima-business.document.description=Description
lima-business.document.entrybook=EntryBook
-lima-business.document.financialstatement=
-lima-business.document.generalentrybook=
+lima-business.document.financialstatement=FinancialStatement
+lima-business.document.generalentrybook=General EntryBook
lima-business.document.grossamount=Gross Amount
lima-business.document.label=Label
-lima-business.document.ledger=
-lima-business.document.movementcredit=
-lima-business.document.movementdebit=
+lima-business.document.ledger=Ledger
+lima-business.document.movementcredit=Credit movement
+lima-business.document.movementdebit=Debit movement
lima-business.document.netamount=Net Amount
-lima-business.document.pagenumber=
-lima-business.document.period1=
-lima-business.document.period2=
+lima-business.document.pagenumber=Page N\u00B0
+lima-business.document.period1=Periode from
+lima-business.document.period2=to
lima-business.document.provisiondeprecationamount=Provision Deprecation Amount
lima-business.document.solde=Solde
-lima-business.document.soldecredit=
-lima-business.document.soldedebit=
-lima-business.document.vatnumber=
+lima-business.document.soldecredit=Credit solde
+lima-business.document.soldedebit=Debit solde
+lima-business.document.vatnumber=VAT N\u00B0
lima-business.document.voucher=Voucher
-lima-business.financialstatement.check.nothing=
-lima-business.financialstatement.check.warn=
-lima.business.document.date=Date
+lima-business.entrybook.entrybookalreadyexist=An EntryBook already exists with this label \: %s
+lima-business.financialstatement.check.nothing=Not found \: %s - %s \n
+lima-business.financialstatement.check.warn=Warning this function is just an help.\n Many accounts must no calculate on Financialstatement.\n Some account marked not found is normally.\n\n
+lima-business.import.accountadded=SUCCES \: Account %s - %s added\n
+lima-business.import.accountalreadyexist=FAILED \: Account %s already exist \n
+lima-business.import.accountnomaster=FAILED \: The account %s have master \: %s which not exist \n
+lima-business.import.closedperiodicentrybookupdated=SUCCESS \: The blockClosedPeriodicEntryBook %s - %s - %s is updated \! \n
+lima-business.import.ebpmissingaccount=FAILED \: Account %s already exist, import aborted. \nCreate all accounts before import entries.
+lima-business.import.ebpnoentry=FAILED \: This file contains no entries.
+lima-business.import.entriesoutofdatesrange=WARNING \: %s entries is out of range of opened fiscal periods. Entry was skip \!\n
+lima-business.import.entryadded=SUCCES \: Entry %s %s added\n"
+lima-business.import.entrybookalreadyexist=FAILED \: The entrybook %s already exists \!\n
+lima-business.import.entrybooknotexist=WARNING \: Entrybook %s not exist was created \!\n
+lima-business.import.financialstatementadded=SUCCESS \: The financialStatement %s is created \n
+lima-business.import.financialstatementalnomaster=FAILED \: The financialStatement %s have master \: %s which not exist \n
+lima-business.import.financialstatementalreadyexist=FAILED \: The financialstatement %s already exists \!\n
+lima-business.import.fiscalperiodadded=SUCCESS \: The fiscalPeriod %s - %s is created \! \n
+lima-business.import.fiscalperiodalreadyexist=FAILED \: The fiscalperiod %s - %s already exists \!\n
+lima-business.import.identityadded=SUCCESS \: The identity %s is created \! \n
+lima-business.import.noaccount=ERROR \: This file contains no account
+lima-business.import.nofiscalperiodopen=FAILED \: No Fiscal period open \! \n
+lima-business.import.transactionadded=SUCCES \: FinancialTransaction, %s - %s, added\n
lima.config.configFileName.description=
-lima.config.http-port=
-lima.config.httpport=
-lima.config.reports-dir=
-lima.config.reportsdir=
-lima.config.rulesnationality=
-lima.config.serveraddress=
-lima.table.grossamount=
-lima.table.label=Test
-lima.table.netamount=
-lima.table.provisiondeprecationamount=
+lima.config.httpport=HTTP Port
+lima.config.reportsdir=Reports directories
+lima.config.rulesnationality=Rules Nationality
+lima.config.serveraddress=Server Address
Modified: trunk/lima-business/src/main/resources/i18n/lima-business-fr_FR.properties
===================================================================
--- trunk/lima-business/src/main/resources/i18n/lima-business-fr_FR.properties 2010-08-23 09:35:53 UTC (rev 3014)
+++ trunk/lima-business/src/main/resources/i18n/lima-business-fr_FR.properties 2010-08-23 16:38:53 UTC (rev 3015)
@@ -1,11 +1,8 @@
-An\ EntryBook\ already\ exists\ with\ this\ label\ \:\ %s=
-An\ account\ already\ exists\ with\ this\ number\ \:\ %s=
-An\ financialStatement\ already\ exists\ with\ this\ label\ \:\ %s=
-business.document.financialstatement=
+lima-business.account.accountalreardyexist=Un compte existe d\u00E9j\u00E0 avec ce num\u00E9ro \: %s
+lima-business.common.failed=\u00C9chec \: %s \n
lima-business.document.accountnumber=N\u00B0 Compte
lima-business.document.amounts=Totaux
lima-business.document.balance=Balance
-lima-business.document.beginDate=Date de d\u00E9but \:
lima-business.document.businessnumber=N\u00B0 Siret
lima-business.document.carryback=Report
lima-business.document.carryforward=\u00C0 reporter
@@ -18,7 +15,6 @@
lima-business.document.date.end=Date de fin \:
lima-business.document.debit=D\u00E9bit
lima-business.document.description=Description
-lima-business.document.endDate=Date de fin \:
lima-business.document.entrybook=Journal
lima-business.document.financialstatement=Bilan et compte de r\u00E9sultat
lima-business.document.generalentrybook=Journal G\u00E9n\u00E9ral
@@ -37,12 +33,30 @@
lima-business.document.soldedebit=Solde D\u00E9biteur
lima-business.document.vatnumber=N\u00B0 TVA
lima-business.document.voucher=Pi\u00E8ce comptable
-lima-business.financialstatement.check.nothing=Introuvable
+lima-business.entrybook.entrybookalreadyexist=Un journal existe d\u00E9j\u00E0 avec ce libell\u00E9 \: %s
+lima-business.financialstatement.check.nothing=Introuvable \: %s - %s \n
lima-business.financialstatement.check.warn=Attention cette fonctionnalit\u00E9 n'est qu'une aide utilisateur.\n Certains comptes ne doivent pas \u00EAtre pr\u00E9sent au bilan et compte de r\u00E9sultat.\n Il est donc normal que des comptes sont marqu\u00E9s comme introuvable.\n\n
+lima-business.import.accountadded=Succ\u00E8s \: Compte %s - %s ajout\u00E9\n
+lima-business.import.accountalreadyexist=\u00C9chec \: Le compte %s existe d\u00E9j\u00E0 \n
+lima-business.import.accountnomaster=\u00C9chec \: Le compte %s poss\u00E8de le master \: %s inexistant \n
+lima-business.import.closedperiodicentrybookupdated=Succ\u00E8s \: La p\u00E9riode financi\u00E8re %s - %s - %s est ajout\u00E9e \! \n
+lima-business.import.ebpmissingaccount=\u00C9chec \: Compte %s inexistant. \nImportation annul\u00E9e. \nCr\u00E9er tous les comptes avant d'importer les \u00E9critures.
+lima-business.import.ebpnoentry=\u00C9chec \: Ce fichier ne contient aucune entr\u00E9e.
+lima-business.import.entriesoutofdatesrange=Attention \: Cette entr\u00E9e %s ne fait partie d'aucune p\u00E9riode ouverte. Entr\u00E9e non import\u00E9e \!\n
+lima-business.import.entryadded=Succ\u00E8s \: Entr\u00E9e %s %s ajout\u00E9e \n
+lima-business.import.entrybookalreadyexist=\u00C9chec \: Le journal %s exist d\u00E9j\u00E0 \!\n
+lima-business.import.entrybooknotexist=Attention \: Le journal %s inexistant a \u00E9t\u00E9 cr\u00E9\u00E9 \!\n
+lima-business.import.financialstatementadded=Succ\u00E8s \: Mouvement %s ajout\u00E9e \n
+lima-business.import.financialstatementalnomaster=u00C9chec \: Le mouvement %s poss\u00E8de le master \: %s inexistant \n
+lima-business.import.financialstatementalreadyexist=u00C9chec \: Le mouvement %s exist d\u00E9j\u00E0 \!\n
+lima-business.import.fiscalperiodadded=Succ\u00E8s \: Exercice %s - %s ajout\u00E9e \! \n
+lima-business.import.fiscalperiodalreadyexist=u00C9chec \: L'exerice %s - %s existe d\u00E9j\u00E0 \!\n
+lima-business.import.identityadded=Succ\u00E8s \: Identit\u00E9 %s ajout\u00E9e \! \n
+lima-business.import.noaccount=Erreur \: Ce fichier ne contient aucun compte.
+lima-business.import.nofiscalperiodopen=u00C9chec \: Aucun exercice ouvert \! \n
+lima-business.import.transactionadded=Succ\u00E8s \: Transaction, %s, %s, ajout\u00E9e\n
lima.config.configFileName.description=
-lima.config.http-port=
-lima.config.httpport=
-lima.config.reports-dir=
-lima.config.reportsdir=
-lima.config.rulesnationality=
-lima.config.serveraddress=
+lima.config.httpport=Port HTTP
+lima.config.reportsdir=Dossier des rapports
+lima.config.rulesnationality=R\u00E8gles nationales
+lima.config.serveraddress=Addresse serveur
Modified: trunk/lima-callao/src/main/java/org/chorem/lima/entity/AccountDAOImpl.java
===================================================================
--- trunk/lima-callao/src/main/java/org/chorem/lima/entity/AccountDAOImpl.java 2010-08-23 09:35:53 UTC (rev 3014)
+++ trunk/lima-callao/src/main/java/org/chorem/lima/entity/AccountDAOImpl.java 2010-08-23 16:38:53 UTC (rev 3015)
@@ -75,7 +75,6 @@
StringTokenizer stStar = new StringTokenizer(result, "-");
while (stStar.hasMoreTokens()) {
String subString = stStar.nextToken();
- log.debug(subString);
//Split comma
StringTokenizer stComma = new StringTokenizer(subString, ",");
Modified: trunk/lima-callao/src/main/xmi/accounting.zargo
===================================================================
(Binary files differ)
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/LimaMain.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/LimaMain.java 2010-08-23 09:35:53 UTC (rev 3014)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/LimaMain.java 2010-08-23 16:38:53 UTC (rev 3015)
@@ -80,9 +80,9 @@
}
} catch (Exception ex) {
if (log.isErrorEnabled()) {
- log.error(_("Global lima exception"), ex);
+ log.error(_("lima.common.globalexception"), ex);
}
- ErrorHelper.showErrorDialog(_("Global lima exception"), ex);
+ ErrorHelper.showErrorDialog(_("lima.common.globalexception"), ex);
System.exit(1);
}
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/LimaSplash.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/LimaSplash.java 2010-08-23 09:35:53 UTC (rev 3014)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/LimaSplash.java 2010-08-23 16:38:53 UTC (rev 3015)
@@ -98,10 +98,10 @@
splashGraphics.setComposite(AlphaComposite.Clear);
splashGraphics.fillRect(65, 238, 300, 15);
splashGraphics.setPaintMode();
- splashGraphics.setColor(new Color(255, 210, 55));
+ splashGraphics.setColor(Color.DARK_GRAY);
Font font = new Font("Lucida Sans", Font.BOLD, 14);
splashGraphics.setFont(font);
- splashGraphics.drawString(message + "...", 65, 248);
+ splashGraphics.drawString(message + "...", 65, 249);
}
splash.update();
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/actions/MiscAction.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/actions/MiscAction.java 2010-08-23 09:35:53 UTC (rev 3014)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/actions/MiscAction.java 2010-08-23 16:38:53 UTC (rev 3015)
@@ -43,7 +43,6 @@
public void help() {
System.out.println(_("lima.message.help.usage"));
- System.out.println("Options (set with --option <key> <value>:");
for (LimaConfig.Option o : LimaConfig.Option.values()) {
System.out.println("\t" + o.key + "(" + o.defaultValue + "):" + o.description);
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainView.jaxx 2010-08-23 09:35:53 UTC (rev 3014)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainView.jaxx 2010-08-23 16:38:53 UTC (rev 3015)
@@ -105,13 +105,13 @@
<JMenu text="lima.importexport.import" actionIcon='import-element'>
<JMenuItem text="lima.importexport.all" onActionPerformed='getHandler().showImportExportView(this, ImportExportEnum.CSV_ALL_IMPORT)'/>
<JMenuItem text="lima.importexport.accountcharts" onActionPerformed='getHandler().showImportExportView(this, ImportExportEnum.CSV_ACCOUNTCHARTS_IMPORT)'/>
- <JMenuItem text="lima.importexport.entrybooks" onActionPerformed='getHandler().showImportExportView(this, ImportExportEnum.CSV_ENTRYBOOKS_IMPORT)'/>
+ <JMenuItem text="lima.common.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.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.common.entrybooks" onActionPerformed='getHandler().showImportExportView(this, ImportExportEnum.CSV_ENTRYBOOKS_EXPORT)'/>
<JMenuItem text="lima.importexport.financialstatements" onActionPerformed='getHandler().showImportExportView(this, ImportExportEnum.CSV_FINANCIALSTATEMENTS_EXPORT)'/>
</JMenu>
</JMenu>
@@ -142,7 +142,7 @@
<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)'
+ <JMenuItem text="lima.common.entrybooks" onActionPerformed='getHandler().showEntryBookView(this)'
actionIcon='charts-entrybooks'/>
<JMenuItem text="lima.charts.fiscalyear" onActionPerformed='getHandler().showFiscalPeriodView(this)'
actionIcon='charts-fiscalperiod'/>
@@ -153,7 +153,7 @@
</JMenu>
<JMenu text="lima.entries" mnemonic="{'E'}">
- <JMenuItem text="lima.entries.addtransaction" onActionPerformed='getHandler().showTransactionView(this)'
+ <JMenuItem text="lima.entries.writetransaction" onActionPerformed='getHandler().showTransactionView(this)'
actionIcon='entries-balanced'/>
<JMenuItem text="lima.entries.searchunbalancedtransaction" onActionPerformed='getHandler().showTransactionUnbalancedView(this)'
actionIcon='entries-unbalanced'/>
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainViewHandler.java 2010-08-23 09:35:53 UTC (rev 3014)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainViewHandler.java 2010-08-23 16:38:53 UTC (rev 3015)
@@ -201,7 +201,7 @@
}
}*/;
about.setTitle(_("lima.title.about"));
- about.setAboutText(_("lima.about.message"));
+ about.setAboutText(_("lima.title.about.description"));
about.setBottomText(ui.getConfig().getCopyrightText());
about.setIconPath("/icons/lima.png");
about.setLicenseFile("META-INF/lima-main-LICENSE.txt");
@@ -298,7 +298,7 @@
public void showEntryBookView(JAXXContext rootContext) {
MainView mainView = getUI(rootContext);
EntryBookView entryBookView= new EntryBookView(mainView);
- mainView.showTab(_("lima.charts.entrybook"), entryBookView);
+ mainView.showTab(_("lima.common.entrybooks"), entryBookView);
}
/**
@@ -362,7 +362,7 @@
public void showTransactionView(JAXXContext rootContext) {
MainView mainView = getUI(rootContext);
FinancialTransactionView transactionView = new FinancialTransactionView(mainView);
- mainView.showTab(_("lima.entries.addtransaction"), transactionView);
+ mainView.showTab(_("lima.entries.writetransaction"), transactionView);
}
public void showTransactionUnbalancedView(JAXXContext rootContext) {
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountForm.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountForm.jaxx 2010-08-23 09:35:53 UTC (rev 3014)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountForm.jaxx 2010-08-23 16:38:53 UTC (rev 3015)
@@ -33,7 +33,7 @@
<Table>
<row>
<cell fill="horizontal">
- <JLabel text="lima.account.number"/>
+ <JLabel text="lima.charts.account.number"/>
</cell>
<cell fill="horizontal">
<JTextField id="numberTextField" editable='{isAddState()}' text="{getAccount().getAccountNumber()}"/>
@@ -44,7 +44,7 @@
</row>
<row>
<cell fill="horizontal">
- <JLabel text="lima.account.label"/>
+ <JLabel text="lima.common.label"/>
</cell>
<cell fill="horizontal">
<JTextField id="descriptionTextField" text="{getAccount().getLabel()}"/>
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-08-23 09:35:53 UTC (rev 3014)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountView.jaxx 2010-08-23 16:38:53 UTC (rev 3015)
@@ -39,13 +39,13 @@
</JScrollPane>
</cell>
<cell fill="horizontal">
- <JButton id="addButton" text="lima.common.add"
+ <JButton id="addButton" text="lima.charts.account.addAccount"
onActionPerformed="getHandler().addAccount()"/>
</cell>
</row>
<row>
<cell fill="horizontal">
- <JButton id="addSubLedger" text="lima.common.addSubLedger"
+ <JButton id="addSubLedger" text="lima.charts.account.addSubLedger"
onActionPerformed="getHandler().addSubLedger()"
enabled="{isSelectedRow()}"/>
</cell>
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountViewHandler.java 2010-08-23 09:35:53 UTC (rev 3014)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountViewHandler.java 2010-08-23 16:38:53 UTC (rev 3015)
@@ -226,8 +226,8 @@
int selectedRow = view.getAccountsTreeTable().getSelectedRow();
if ( selectedRow != -1) {
int n = JOptionPane.showConfirmDialog(view,
- _("lima.question.remove.account"),
- _("lima.question"),
+ _("lima.charts.account.question.remove"),
+ _("lima.common.question"),
JOptionPane.YES_NO_OPTION,
JOptionPane.QUESTION_MESSAGE);
if (n == JOptionPane.YES_OPTION) {
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/SubLedgerForm.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/SubLedgerForm.jaxx 2010-08-23 09:35:53 UTC (rev 3014)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/SubLedgerForm.jaxx 2010-08-23 16:38:53 UTC (rev 3015)
@@ -34,7 +34,7 @@
<Table>
<row>
<cell fill="horizontal">
- <JLabel text="lima.subledger.code"/>
+ <JLabel text="lima.common.code"/>
</cell>
<cell fill="horizontal">
<JTextField id="numberTextField" editable='{isAddState()}'
@@ -46,7 +46,7 @@
</row>
<row>
<cell fill="horizontal">
- <JLabel text="lima.account.label"/>
+ <JLabel text="lima.common.label"/>
</cell>
<cell fill="horizontal">
<JTextField id="descriptionTextField" text="{getAccount().getLabel()}"/>
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsPeriodSearchPanel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsPeriodSearchPanel.java 2010-08-23 09:35:53 UTC (rev 3014)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsPeriodSearchPanel.java 2010-08-23 16:38:53 UTC (rev 3015)
@@ -69,7 +69,7 @@
Calendar calendarEnd = Calendar.getInstance();
Date endDate = calendarEnd.getTime();
//handler().setEndDate(endDate);
- JLabel beginDateLabel = new JLabel(_("lima.period.begindate"));
+ JLabel beginDateLabel = new JLabel(_("lima.common.begindate"));
final JXDatePicker beginDatePicker = new JXDatePicker(beginDate);
ActionListener beginDateActionListener = new ActionListener() {
@Override
@@ -81,7 +81,7 @@
handler.setBeginDate(beginDatePicker.getDate());
beginDatePicker.addActionListener(beginDateActionListener);
- JLabel endDateLabel = new JLabel(_("lima.period.enddate"));
+ JLabel endDateLabel = new JLabel(_("lima.common.enddate"));
final JXDatePicker endDatePicker = new JXDatePicker(endDate);
ActionListener endDateActionListener = new ActionListener() {
@Override
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsView.jaxx 2010-08-23 09:35:53 UTC (rev 3014)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsView.jaxx 2010-08-23 16:38:53 UTC (rev 3015)
@@ -38,7 +38,7 @@
<cell><AccountsReportsPeriodSearchPanel javaBean="periodSearchPanel"/></cell>
</row></Table></cell>
<cell anchor="east">
- <JLabel id="accountSelectorLabel" text="lima.account"/>
+ <JLabel id="accountSelectorLabel" text="lima.common.account"/>
</cell>
<cell anchor="west">
<JComboBox javaBean='new org.chorem.lima.ui.accountsreports.AccountComboBox(getHandler())' />
@@ -58,19 +58,19 @@
</row>
<row fill="horizontal" anchor="center">
<cell>
- <JLabel text="lima.amountdebit" />
+ <JLabel text="lima.common.amountdebit" />
</cell>
<cell>
<JLabel id="amountDebitLabel" />
</cell>
<cell>
- <JLabel text="lima.amountcredit"/>
+ <JLabel text="lima.common.amountcredit"/>
</cell>
<cell>
<JLabel id="amountCreditLabel" />
</cell>
<cell>
- <JLabel id="soldeLabel" text="lima.solde"/>
+ <JLabel id="soldeLabel" text="lima.common.solde"/>
</cell>
<cell>
<JLabel id="amountSoldeLabel"/>
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsViewHandler.java 2010-08-23 09:35:53 UTC (rev 3014)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsViewHandler.java 2010-08-23 16:38:53 UTC (rev 3015)
@@ -129,15 +129,15 @@
if (amountSolde.doubleValue() == 0){
- view.soldeLabel.setText(_("lima.solde"));
+ view.soldeLabel.setText(_("lima.common.solde"));
}
else {
// set label solde: credit or debit
if (datasList.getSoldeDebit()) {
- view.soldeLabel.setText(_("lima.soldedebit"));
+ view.soldeLabel.setText(_("lima.common.soldedebit"));
}
else {
- view.soldeLabel.setText(_("lima.soldecredit"));
+ view.soldeLabel.setText(_("lima.common.soldecredit"));
}
}
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalancePeriodSearchPanel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalancePeriodSearchPanel.java 2010-08-23 09:35:53 UTC (rev 3014)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalancePeriodSearchPanel.java 2010-08-23 16:38:53 UTC (rev 3015)
@@ -70,7 +70,7 @@
Calendar calendarEnd = Calendar.getInstance();
Date endDate = calendarEnd.getTime();
//handler().setEndDate(endDate);
- JLabel beginDateLabel = new JLabel(_("lima.period.begindate"));
+ JLabel beginDateLabel = new JLabel(_("lima.common.begindate"));
final JXDatePicker beginDatePicker = new JXDatePicker(beginDate);
ActionListener beginDateActionListener = new ActionListener() {
@Override
@@ -82,7 +82,7 @@
handler.setBeginDate(beginDatePicker.getDate());
beginDatePicker.addActionListener(beginDateActionListener);
- JLabel endDateLabel = new JLabel(_("lima.period.enddate"));
+ JLabel endDateLabel = new JLabel(_("lima.common.enddate"));
final JXDatePicker endDatePicker = new JXDatePicker(endDate);
ActionListener endDateActionListener = new ActionListener() {
@Override
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceView.jaxx 2010-08-23 09:35:53 UTC (rev 3014)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceView.jaxx 2010-08-23 16:38:53 UTC (rev 3015)
@@ -71,19 +71,19 @@
</row>
<row fill="horizontal" anchor="center">
<cell>
- <JLabel text="lima.amountdebit" />
+ <JLabel text="lima.common.amountdebit" />
</cell>
<cell>
<JLabel id="amountDebitLabel" />
</cell>
<cell>
- <JLabel text="lima.amountcredit"/>
+ <JLabel text="lima.common.amountcredit"/>
</cell>
<cell>
<JLabel id="amountCreditLabel" />
</cell>
<cell>
- <JLabel id="soldeLabel" text="lima.solde"/>
+ <JLabel id="soldeLabel" text="lima.common.solde"/>
</cell>
<cell>
<JLabel id="amountSoldeLabel"/>
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceViewHandler.java 2010-08-23 09:35:53 UTC (rev 3014)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceViewHandler.java 2010-08-23 16:38:53 UTC (rev 3015)
@@ -140,15 +140,15 @@
if (amountSolde.doubleValue() == 0){
- view.soldeLabel.setText(_("lima.solde"));
+ view.soldeLabel.setText(_("lima.common.solde"));
}
else {
// set label solde: credit or debit
if (datasList.getSoldeDebit()) {
- view.soldeLabel.setText(_("lima.soldedebit"));
+ view.soldeLabel.setText(_("lima.common.soldedebit"));
}
else {
- view.soldeLabel.setText(_("lima.soldecredit"));
+ view.soldeLabel.setText(_("lima.common.soldecredit"));
}
}
}
Deleted: trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/EntryBookTypeListModel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/EntryBookTypeListModel.java 2010-08-23 09:35:53 UTC (rev 3014)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/EntryBookTypeListModel.java 2010-08-23 16:38:53 UTC (rev 3015)
@@ -1,76 +0,0 @@
-/* *##% Lima Swing
- * Copyright (C) 2008 - 2010 CodeLutin
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- * ##%*/
-
-package org.chorem.lima.ui.combobox;
-
-import static org.nuiton.i18n.I18n._;
-import javax.swing.AbstractListModel;
-import javax.swing.ComboBoxModel;
-
-/**
- * Combo box model with entrybook types.
- * (achats, ventes, trésorerie, général, situation).
- *
- */
-public class EntryBookTypeListModel extends AbstractListModel implements ComboBoxModel {
-
- private static final long serialVersionUID = 1L;
-
- protected Object selectedObject;
-
- /** Data. TODO put string in another place, don't use hard coded string. */
- protected Object[] data = new Object[]{ _("lima.entrybook.type1"),
- _("lima.entrybook.type2"), _("lima.entrybook.type3"),
- _("lima.entrybook.type4"), _("lima.entrybook.type5")};
-
- public EntryBookTypeListModel() {
- super();
- }
-
- /*
- * @see javax.swing.ComboBoxModel#setSelectedItem(java.lang.Object)
- */
- @Override
- public void setSelectedItem(Object anItem) {
- selectedObject = anItem;
- }
-
- /*
- * @see javax.swing.ComboBoxModel#getSelectedItem()
- */
- @Override
- public Object getSelectedItem() {
- return selectedObject;
- }
-
- /*
- * @see javax.swing.ListModel#getSize()
- */
- @Override
- public int getSize() {
- return data.length;
- }
-
- /*
- * @see javax.swing.ListModel#getElementAt(int)
- */
- @Override
- public Object getElementAt(int index) {
- return data[index];
- }
-}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookForm.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookForm.jaxx 2010-08-23 09:35:53 UTC (rev 3014)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookForm.jaxx 2010-08-23 16:38:53 UTC (rev 3015)
@@ -33,7 +33,7 @@
<Table>
<row>
<cell>
- <JLabel text="lima.entrybook.code"/>
+ <JLabel text="lima.common.code"/>
</cell>
<cell>
<JTextField id="entryBookCodeField" text="{getEntryBook().getCode()}"/>
@@ -44,7 +44,7 @@
</row>
<row>
<cell>
- <JLabel text="lima.entrybook.label"/>
+ <JLabel text="lima.common.label"/>
</cell>
<cell>
<JTextField id="entryBookLabelField" editable='{isAddState()}' text="{getEntryBook().getLabel()}"/>
@@ -55,16 +55,6 @@
</row>
<row>
<cell>
- <JLabel text="lima.entrybook.type"/>
- </cell>
- <cell>
- <JComboBox id="typeComboBox" model='{new org.chorem.lima.ui.combobox.EntryBookTypeListModel()}'
- selectedItem="{getEntryBook().getType()}"
- onActionPerformed="getEntryBook().setType((String)getTypeComboBox().getSelectedItem())"/>
- </cell>
- </row>
- <row>
- <cell>
<JButton id="cancelButton" text="lima.common.cancel" onActionPerformed="performCancel()"/>
</cell>
<cell>
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookTableModel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookTableModel.java 2010-08-23 09:35:53 UTC (rev 3014)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookTableModel.java 2010-08-23 16:38:53 UTC (rev 3015)
@@ -68,8 +68,9 @@
try {
result = entryBookService.getAllEntryBooks().size();
} catch (LimaException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
+ if (log.isDebugEnabled()){
+ log.debug("Can't get all entrybooks",e);
+ }
}
return result;
@@ -77,7 +78,7 @@
@Override
public int getColumnCount() {
- return 3;
+ return 2;
}
@Override
@@ -90,9 +91,6 @@
case 1:
res = _("lima.table.label");
break;
- case 2:
- res = _("lima.table.type");
- break;
}
return res;
}
@@ -118,9 +116,6 @@
case 1:
result = entryBook.getLabel();
break;
- case 2:
- result = entryBook.getType();
- break;
}
} catch (LimaException eee) {
if (log.isDebugEnabled()){
@@ -176,7 +171,9 @@
public void notifyMethod(String serviceName, String methodeName) {
//refresh on import datas
- if (methodeName.contains("importEntryBooks") || methodeName.contains("importAll") || methodeName.contains("importAs")){
+ if (methodeName.contains("importEntryBooks")
+ || methodeName.contains("importAll")
+ || methodeName.contains("importAs")){
fireTableDataChanged();
}
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookView.jaxx 2010-08-23 09:35:53 UTC (rev 3014)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookView.jaxx 2010-08-23 16:38:53 UTC (rev 3015)
@@ -42,7 +42,7 @@
</row>
<row>
<cell fill="horizontal">
- <JButton id="addButton" text="lima.entrybook.add"
+ <JButton id="addButton" text="lima.charts.entrybook.add"
onActionPerformed="getHandler().addEntryBook()"/>
</cell>
</row>
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-08-23 09:35:53 UTC (rev 3014)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookViewHandler.java 2010-08-23 16:38:53 UTC (rev 3015)
@@ -130,9 +130,9 @@
int response =
JOptionPane.showConfirmDialog(view,
- _("Do you really want to delete entry book %s ?",
+ _("lima.charts.entrybook.confirmation",
selectedEntryBook.getLabel()),
- _("Confirmation"), JOptionPane.YES_NO_OPTION,
+ _("lima.common.confirmation"), JOptionPane.YES_NO_OPTION,
JOptionPane.QUESTION_MESSAGE);
if (response == JOptionPane.YES_OPTION) {
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsPeriodSearchPanel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsPeriodSearchPanel.java 2010-08-23 09:35:53 UTC (rev 3014)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsPeriodSearchPanel.java 2010-08-23 16:38:53 UTC (rev 3015)
@@ -69,7 +69,7 @@
Calendar calendarEnd = Calendar.getInstance();
Date endDate = calendarEnd.getTime();
//handler().setEndDate(endDate);
- JLabel beginDateLabel = new JLabel(_("lima.period.begindate"));
+ JLabel beginDateLabel = new JLabel(_("lima.common.begindate"));
final JXDatePicker beginDatePicker = new JXDatePicker(beginDate);
ActionListener beginDateActionListener = new ActionListener() {
@Override
@@ -81,7 +81,7 @@
handler.setBeginDate(beginDatePicker.getDate());
beginDatePicker.addActionListener(beginDateActionListener);
- JLabel endDateLabel = new JLabel(_("lima.period.enddate"));
+ JLabel endDateLabel = new JLabel(_("lima.common.enddate"));
final JXDatePicker endDatePicker = new JXDatePicker(endDate);
ActionListener endDateActionListener = new ActionListener() {
@Override
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsView.jaxx 2010-08-23 09:35:53 UTC (rev 3014)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsView.jaxx 2010-08-23 16:38:53 UTC (rev 3015)
@@ -39,7 +39,7 @@
<cell><EntryBooksReportsPeriodSearchPanel javaBean="periodSearchPanel"/></cell>
</row></Table></cell>
<cell anchor="east">
- <JLabel id="entryBookSelectorLabel" text="lima.entrybook"/>
+ <JLabel id="entryBookSelectorLabel" text="lima.common.entrybook"/>
</cell>
<cell anchor="west">
<JComboBox javaBean='new org.chorem.lima.ui.entrybooksreports.EntryBookComboBox(getHandler())' />
@@ -63,19 +63,19 @@
</row>
<row fill="horizontal" anchor="center">
<cell>
- <JLabel text="lima.amountdebit" />
+ <JLabel text="lima.common.amountdebit" />
</cell>
<cell>
<JLabel id="amountDebitLabel" />
</cell>
<cell>
- <JLabel text="lima.amountcredit"/>
+ <JLabel text="lima.common.amountcredit"/>
</cell>
<cell>
<JLabel id="amountCreditLabel" />
</cell>
<cell>
- <JLabel id="soldeLabel" text="lima.solde"/>
+ <JLabel id="soldeLabel" text="lima.common.solde"/>
</cell>
<cell>
<JLabel id="amountSoldeLabel"/>
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsViewHandler.java 2010-08-23 09:35:53 UTC (rev 3014)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsViewHandler.java 2010-08-23 16:38:53 UTC (rev 3015)
@@ -149,15 +149,15 @@
view.amountSoldeLabel.setText(String.valueOf(amountSolde));
if (amountSolde.doubleValue() == 0){
- view.soldeLabel.setText(_("lima.solde"));
+ view.soldeLabel.setText(_("lima.common.solde"));
}
else {
// set label solde: credit or debit
if (datasList.getSoldeDebit()) {
- view.soldeLabel.setText(_("lima.soldedebit"));
+ view.soldeLabel.setText(_("lima.common.soldedebit"));
}
else {
- view.soldeLabel.setText(_("lima.soldecredit"));
+ view.soldeLabel.setText(_("lima.common.soldecredit"));
}
}
}
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-08-23 09:35:53 UTC (rev 3014)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialperiod/FinancialPeriodTableModel.java 2010-08-23 16:38:53 UTC (rev 3015)
@@ -151,10 +151,10 @@
break;
case 2:
if(closedPeriodicEntryBook.getLocked()){
- result = _("lima.close");
+ result = _("lima.common.closed");
}
else{
- result = _("lima.open");
+ result = _("lima.common.open");
}
break;
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialperiod/FinancialPeriodView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialperiod/FinancialPeriodView.jaxx 2010-08-23 09:35:53 UTC (rev 3014)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialperiod/FinancialPeriodView.jaxx 2010-08-23 16:38:53 UTC (rev 3015)
@@ -42,7 +42,7 @@
<Table>
<row>
<cell>
- <JButton id="blockButton" text="lima.financialperiod.block" enabled="{isSelectedPeriod()}"
+ <JButton id="blockButton" text="lima.charts.financialperiod.block" enabled="{isSelectedPeriod()}"
onActionPerformed="getHandler().blockFinancialPeriod();" />
</cell>
</row>
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialperiod/FinancialPeriodViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialperiod/FinancialPeriodViewHandler.java 2010-08-23 09:35:53 UTC (rev 3014)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialperiod/FinancialPeriodViewHandler.java 2010-08-23 16:38:53 UTC (rev 3015)
@@ -56,8 +56,8 @@
// blocked it
try {
ClosedPeriodicEntryBook closedPeriodicEntryBook = model.getFinancialPeriodAtRow(selectedRow);
- int response = JOptionPane.showConfirmDialog(view, _("lima.question.financialperiod.blocked"),
- _("lima.question"), JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);
+ int response = JOptionPane.showConfirmDialog(view, _("lima.charts.financialperiod.question.blocked"),
+ _("lima.common.question"), JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);
if (response == JOptionPane.YES_OPTION) {
model.blockFinancialPeriod(closedPeriodicEntryBook);
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartViewHandler.java 2010-08-23 09:35:53 UTC (rev 3014)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartViewHandler.java 2010-08-23 16:38:53 UTC (rev 3015)
@@ -236,8 +236,8 @@
int selectedRow = view.treeTable.getSelectedRow();
if ( selectedRow != -1) {
int n = JOptionPane.showConfirmDialog(view,
- _("lima.question.remove.account"),
- _("lima.question"),
+ _("lima.charts.account.question.remove"),
+ _("lima.common.confirmation"),
JOptionPane.YES_NO_OPTION,
JOptionPane.QUESTION_MESSAGE);
if (n == JOptionPane.YES_OPTION) {
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportPeriodSearchPanel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportPeriodSearchPanel.java 2010-08-23 09:35:53 UTC (rev 3014)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportPeriodSearchPanel.java 2010-08-23 16:38:53 UTC (rev 3015)
@@ -69,7 +69,7 @@
Calendar calendarEnd = Calendar.getInstance();
Date endDate = calendarEnd.getTime();
//handler().setEndDate(endDate);
- JLabel beginDateLabel = new JLabel(_("lima.period.begindate"));
+ JLabel beginDateLabel = new JLabel(_("lima.common.begindate"));
final JXDatePicker beginDatePicker = new JXDatePicker(beginDate);
ActionListener beginDateActionListener = new ActionListener() {
@Override
@@ -81,7 +81,7 @@
handler.model.setBeginDate(beginDatePicker.getDate());
beginDatePicker.addActionListener(beginDateActionListener);
- JLabel endDateLabel = new JLabel(_("lima.period.enddate"));
+ JLabel endDateLabel = new JLabel(_("lima.common.enddate"));
final JXDatePicker endDatePicker = new JXDatePicker(endDate);
ActionListener endDateActionListener = new ActionListener() {
@Override
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportView.jaxx 2010-08-23 09:35:53 UTC (rev 3014)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportView.jaxx 2010-08-23 16:38:53 UTC (rev 3015)
@@ -50,7 +50,7 @@
</script>
<row weightx="1" weighty="0" anchor="center">
<cell anchor="east">
- <JLabel id="beginCalendarPanelLabel" text="lima.accountsreports.begincalendar"/>
+ <JLabel id="beginCalendarPanelLabel" text="lima.common.begindate"/>
</cell>
<cell anchor="west">
<org.jdesktop.swingx.JXDatePicker id="beginDatePicker"
@@ -58,7 +58,7 @@
getHandler().refresh()" />
</cell>
<cell anchor="east">
- <JLabel id="endCalendarPanelLabel" text="lima.accountsreports.endcalendar"/>
+ <JLabel id="endCalendarPanelLabel" text="lima.common.enddate"/>
</cell>
<cell anchor="west">
<org.jdesktop.swingx.JXDatePicker id="endDatePicker"
Deleted: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/CriteriaWidget.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/CriteriaWidget.jaxx 2010-08-23 09:35:53 UTC (rev 3014)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/CriteriaWidget.jaxx 2010-08-23 16:38:53 UTC (rev 3015)
@@ -1,41 +0,0 @@
-<!-- ##% Lima Swing
- Copyright (C) 2008 - 2010 CodeLutin
- This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License
- as published by the Free Software Foundation; either version 2
- of the License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- ##% -->
-
-<Table insets='5,5,5,5'>
- <script>
- protected void removeCriteriaWidget(){}
- </script>
- <row>
- <cell>
- <JAXXComboBox id="criteriaComboBox" width="200">
- <item value='date' label='{_("lima.date")}' selected="true"/>
- <item value='voucher' label='{_("lima.voucher")}'/>
- <item value='account' label='{_("lima.account")}'/>
- <item value='description' label='{_("lima.description")}'/>
- <item value='debit' label='{_("lima.debit")}'/>
- <item value='credit' label='{_("lima.credit")}'/>
- <item value='amount' label='{_("lima.amount")}'/>
- </JAXXComboBox>
- </cell>
- <cell weightx="0">
- <JPanel id="criteriaPanel"/>
- </cell>
- <cell>
- <JButton id="removeButton" text="lima.remove" onActionPerformed="removeCriteriaWidget()"/>
- </cell>
- </row>
-</Table>
\ No newline at end of file
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionView.jaxx 2010-08-23 09:35:53 UTC (rev 3014)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionView.jaxx 2010-08-23 16:38:53 UTC (rev 3015)
@@ -54,7 +54,7 @@
editable="false"/>
</cell>
<cell anchor="east">
- <JLabel id="financialPeriodLabel" text="lima.transaction.period"
+ <JLabel id="financialPeriodLabel" text="lima.common.period"
/>
</cell>
<cell anchor="west">
@@ -75,11 +75,11 @@
onActionPerformed="getHandler().pasteRow()" enabled="{isSelectedRow()}"/>
</cell>
<cell>
- <JButton text="lima.add.transaction"
+ <JButton text="lima.entries.addTransaction"
onActionPerformed="getHandler().addFinancialTransaction()"/>
</cell>
<cell>
- <JButton text="lima.add.entry" onActionPerformed="getHandler().addEmptyEntry()" enabled="{isSelectedRow()}"/>
+ <JButton text="lima.entries.addEntry" onActionPerformed="getHandler().addEmptyEntry()" enabled="{isSelectedRow()}"/>
</cell>
<cell>
<JButton text="lima.common.remove"
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionViewHandler.java 2010-08-23 09:35:53 UTC (rev 3014)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionViewHandler.java 2010-08-23 16:38:53 UTC (rev 3015)
@@ -179,14 +179,14 @@
Object selectedValue = tableModel.getElementAt(indexSelectedRow);
String message = null;
if (selectedValue instanceof FinancialTransaction) {
- message = _("lima.question.remove.transaction");
+ message = _("lima.charts.financialtransaction.question.removetransaction");
}
else {
- message = _("lima.question.remove.entry");
+ message = _("lima.charts.financialtransaction.question.removeentry");
}
int response = JOptionPane.showConfirmDialog(view, message,
- _("lima.transaction.confirmdelete"), JOptionPane.YES_NO_OPTION);
+ _("lima.common.confirmation"), JOptionPane.YES_NO_OPTION);
if (response == JOptionPane.YES_OPTION) {
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionPeriodSearchPanel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionPeriodSearchPanel.java 2010-08-23 09:35:53 UTC (rev 3014)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionPeriodSearchPanel.java 2010-08-23 16:38:53 UTC (rev 3015)
@@ -90,7 +90,7 @@
Calendar calendarEnd = Calendar.getInstance();
Date endDate = calendarEnd.getTime();
//handler().setEndDate(endDate);
- JLabel beginDateLabel = new JLabel(_("lima.period.begindate"));
+ JLabel beginDateLabel = new JLabel(_("lima.common.begindate"));
final JXDatePicker beginDatePicker = new JXDatePicker(beginDate);
ActionListener beginDateActionListener = new ActionListener() {
@Override
@@ -102,7 +102,7 @@
handler.setBeginDate(beginDatePicker.getDate());
beginDatePicker.addActionListener(beginDateActionListener);
- JLabel endDateLabel = new JLabel(_("lima.period.enddate"));
+ JLabel endDateLabel = new JLabel(_("lima.common.enddate"));
final JXDatePicker endDatePicker = new JXDatePicker(endDate);
ActionListener endDateActionListener = new ActionListener() {
@Override
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchView.jaxx 2010-08-23 09:35:53 UTC (rev 3014)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchView.jaxx 2010-08-23 16:38:53 UTC (rev 3015)
@@ -86,7 +86,7 @@
</row>
<row>
<cell fill='both'><Table><row>
- <cell><JLabel text="lima.amount"/></cell>
+ <cell><JLabel text="lima.common.amount"/></cell>
<cell><JComboBox id="amountComboBox" javaBean="new JComboBox(FinancialStatementWayEnum.descriptions())"
onActionPerformed="handler.setAmountWayEnum(FinancialStatementWayEnum.valueOfDescription((String)amountComboBox.getSelectedItem()));
handler.refresh()"/></cell>
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedView.jaxx 2010-08-23 09:35:53 UTC (rev 3014)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedView.jaxx 2010-08-23 16:38:53 UTC (rev 3015)
@@ -56,7 +56,7 @@
editable="false"/>
</cell>
<cell>
- <JButton text="lima.add.entry"
+ <JButton text="lima.entries.addEntry"
onActionPerformed="getHandler().addEmptyEntry()"
enabled="{isSelectedRow()}"/>
</cell>
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedViewHandler.java 2010-08-23 09:35:53 UTC (rev 3014)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedViewHandler.java 2010-08-23 16:38:53 UTC (rev 3015)
@@ -109,14 +109,14 @@
Object selectedValue = tableModel.getElementAt(indexSelectedRow);
String message = null;
if (selectedValue instanceof FinancialTransaction) {
- message = _("lima.question.remove.transaction");
+ message = _("lima.charts.financialtransaction.question.removetransaction");
}
else {
- message = _("lima.question.remove.entry");
+ message = _("lima.charts.financialtransaction.question.removeentry");
}
int response = JOptionPane.showConfirmDialog(view, message,
- _("lima.transaction.confirmdelete"), JOptionPane.YES_NO_OPTION);
+ _("lima.common.confirmation"), JOptionPane.YES_NO_OPTION);
if (response == JOptionPane.YES_OPTION) {
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-08-23 09:35:53 UTC (rev 3014)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/AddPeriod.jaxx 2010-08-23 16:38:53 UTC (rev 3015)
@@ -80,7 +80,7 @@
<Table fill="both">
<row>
<cell>
- <JLabel text="lima.period.begindate"/>
+ <JLabel text="lima.common.begindate"/>
</cell>
<cell>
<org.jdesktop.swingx.JXDatePicker id="beginDatePicker"/>
@@ -88,7 +88,7 @@
</row>
<row>
<cell>
- <JLabel text="lima.period.enddate"/>
+ <JLabel text="lima.common.enddate"/>
</cell>
<cell>
<org.jdesktop.swingx.JXDatePicker id="endDatePicker"/>
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/FiscalPeriodTableModel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/FiscalPeriodTableModel.java 2010-08-23 09:35:53 UTC (rev 3014)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/FiscalPeriodTableModel.java 2010-08-23 16:38:53 UTC (rev 3015)
@@ -143,10 +143,10 @@
break;
case 1:
if(fiscalPeriod.getLocked()){
- result = _("lima.close");
+ result = _("lima.common.closed");
}
else{
- result = _("lima.open");
+ result = _("lima.common.open");
}
break;
}
@@ -181,11 +181,6 @@
fireTableRowsInserted(currentRowCount, currentRowCount);
}
- public void removeAllFiscalPeriods() throws LimaException {
- fiscalPeriodService.removeAllFiscalPeriods();
- fireTableDataChanged();
- }
-
public void blockFiscalPeriod(FiscalPeriod fiscalPeriod) throws LimaException {
fiscalPeriodService.blockFiscalPeriod(fiscalPeriod);
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/FiscalPeriodView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/FiscalPeriodView.jaxx 2010-08-23 09:35:53 UTC (rev 3014)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/FiscalPeriodView.jaxx 2010-08-23 16:38:53 UTC (rev 3015)
@@ -41,20 +41,14 @@
</row>
<row>
<cell fill="horizontal">
- <JButton id="addButton" text="lima.fiscalperiod.addFiscalPeriod"
+ <JButton id="addButton" text="lima.charts.fiscalperiod.add"
onActionPerformed="getHandler().addFiscalPeriod()"/>
</cell>
</row>
<row>
<cell>
- <JButton id="blockButton" text="lima.fiscalperiod.block" enabled="{isSelectedPeriod()}"
+ <JButton id="blockButton" text="lima.charts.fiscalperiod.block" enabled="{isSelectedPeriod()}"
onActionPerformed="getHandler().blockFiscalPeriod()" />
</cell>
</row>
- <row>
- <cell>
- <JButton id="deleteButton" text="DEBUG delete all"
- onActionPerformed="getHandler().removeAllFiscalPeriods()" />
- </cell>
- </row>
</Table>
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-08-23 09:35:53 UTC (rev 3014)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/FiscalPeriodViewHandler.java 2010-08-23 16:38:53 UTC (rev 3015)
@@ -69,8 +69,8 @@
int n = 0;
if(nbMonth !=12){
n = JOptionPane.showConfirmDialog(getView(),
- _("lima.question.fiscalperiod.morethan12"),
- _("lima.question"),
+ _("lima.charts.fiscalperiod.question.morethan12"),
+ _("lima.common.question"),
JOptionPane.YES_NO_OPTION,
JOptionPane.QUESTION_MESSAGE);
}
@@ -99,8 +99,8 @@
model.getFiscalPeriodAtRow(selectedRow);
int response =
JOptionPane.showConfirmDialog(getView(),
- _("lima.question.fiscalperiod.blocked"),
- _("lima.question"), JOptionPane.YES_NO_OPTION,
+ _("lima.charts.fiscalperiod.question.blocked"),
+ _("lima.common.question"), JOptionPane.YES_NO_OPTION,
JOptionPane.QUESTION_MESSAGE);
if (response == JOptionPane.YES_OPTION) {
@@ -114,20 +114,6 @@
}
}
- /** just for debug, no release version */
- public void removeAllFiscalPeriods(){
- FiscalPeriodTableModel model =
- (FiscalPeriodTableModel)getView().getFiscalPeriodTable().getModel();
- try {
- model.removeAllFiscalPeriods();
- } catch (LimaException eee) {
- if (log.isErrorEnabled()) {
- log.error("Can't delete all fiscal period", eee);
- }
- DialogHelper.showMessageDialog(eee.getMessage());
- }
- }
-
public FiscalPeriodView getView() {
return view;
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/AccountsPane.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/AccountsPane.java 2010-08-23 09:35:53 UTC (rev 3014)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/AccountsPane.java 2010-08-23 16:38:53 UTC (rev 3015)
@@ -92,18 +92,18 @@
List<Account> accounts = accountService.getAllAccounts();
if (accounts.size()>0){
setBackground(greenBackground);
- String accountsString = _("limahome.chartaccounts.state1_2") + " "
- + accounts.size() + " " + _("limahome.chartaccounts.state2_2")
+ String accountsString = _("lima.home.chartaccounts.state1_2") + " "
+ + accounts.size() + " " + _("lima.home.chartaccounts.state2_2")
+ "<br/><br/><a href='#accountschart'>"
- + _("limahome.chartaccounts.modify") + "</a>";
+ + _("lima.home.chartaccounts.modify") + "</a>";
//set Text
setText(htmlBegin + accountsString + htmlEnd);
}
else {
setBackground(redBackground);
- String accountsString = _("limahome.chartaccounts.nothing")
+ String accountsString = _("lima.home.chartaccounts.nothing")
+ "<br/><br/><a href='#accountschart'>"
- + _("limahome.chartaccounts.create") + "</a>";
+ + _("lima.home.chartaccounts.create") + "</a>";
//set Text
setText(htmlBegin + accountsString + htmlEnd);
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/EntryBooksPane.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/EntryBooksPane.java 2010-08-23 09:35:53 UTC (rev 3014)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/EntryBooksPane.java 2010-08-23 16:38:53 UTC (rev 3015)
@@ -94,23 +94,23 @@
setBackground(greenBackground);
String entryBooksString="";
if (ebSize == 1){
- entryBooksString = _("limahome.entrybooks.state.single")
+ entryBooksString = _("lima.home.entrybooks.state.single")
+ "<br/>" + entryBooks.get(0)
+ "<br/><br/><a href='#entrybookschart'>"
- + _("limahome.entrybooks.modify") + "</a>";
+ + _("lima.home.entrybooks.modify") + "</a>";
}
else {
- entryBooksString = _("limahome.entrybooks.state1_2.plural")
+ entryBooksString = _("lima.home.entrybooks.state1_2.plural")
+ " " + entryBooks.size() + " "
- + _("limahome.entrybooks.state2_2.plural") + "<ul>";
+ + _("lima.home.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>";
+ + _("lima.home.entrybooks.modify") + "</a>";
}
//set Text
setText(htmlBegin + entryBooksString + htmlEnd);
@@ -119,9 +119,9 @@
setBackground(redBackground);
//set Text
setText(htmlBegin
- + _("limahome.entrybooks.nothing")
+ + _("lima.home.entrybooks.nothing")
+ "<br/><br/><a href='#entrybookschart'>"
- + _("limahome.entrybooks.create") +"</a>" + htmlEnd);
+ + _("lima.home.entrybooks.create") +"</a>" + htmlEnd);
}
} catch (LimaException eee) {
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/FinancialTransactionsPane.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/FinancialTransactionsPane.java 2010-08-23 09:35:53 UTC (rev 3014)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/FinancialTransactionsPane.java 2010-08-23 16:38:53 UTC (rev 3015)
@@ -105,9 +105,9 @@
if (financialTransactionsUnbal.size()>0){
setBackground(redBackground);
String transactionsString = financialTransactionsUnbal.size()
- + " " + _("limahome.transaction.unbalanced")
+ + " " + _("lima.home.transaction.unbalanced")
+ "<br/><br/><a href='#financialtransactionunbalanced'>"
- + _("limahome.transaction.modifiy.unbalanced") + "</a>";
+ + _("lima.home.transaction.modifiy.unbalanced") + "</a>";
//set Text
setText(htmlBegin + transactionsString + htmlEnd);
}
@@ -118,17 +118,17 @@
if (financialTransactionsBal.size()>0){
setBackground(greenBackground);
String transactionsString = financialTransactionsBal.size()
- + " " + _("limahome.transaction.balanced")
+ + " " + _("lima.home.transaction.balanced")
+ "<br/><br/><a href='#financialtransactionbalanced'>"
- + _("limahome.transaction.modifiy.balanced") + "</a>";
+ + _("lima.home.transaction.modifiy.balanced") + "</a>";
//set Text
setText(htmlBegin + transactionsString + htmlEnd);
}
else {
setBackground(redBackground);
- String transactionsString = _("limahome.transaction.nothing")
+ String transactionsString = _("lima.home.transaction.nothing")
+ "<br/><br/><a href='#financialtransactionbalanced'>"
- + _("limahome.transaction.create") + "</a>";
+ + _("lima.home.transaction.create") + "</a>";
//set Text
setText(htmlBegin + transactionsString + htmlEnd);
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/FiscalPeriodsPane.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/FiscalPeriodsPane.java 2010-08-23 09:35:53 UTC (rev 3014)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/FiscalPeriodsPane.java 2010-08-23 16:38:53 UTC (rev 3015)
@@ -93,11 +93,11 @@
if (unblockedFiscalPeriods.size()>0){
setBackground(greenBackground);
String fiscalString = unblockedFiscalPeriods.size() + " "
- + _("limahome.fiscalperiod.opened") + "<br/>"
+ + _("lima.home.fiscalperiod.opened") + "<br/>"
+ (fiscalPeriods.size()-unblockedFiscalPeriods.size())
- + " " + _("limahome.fiscalperiod.closed")
+ + " " + _("lima.home.fiscalperiod.closed")
+ "<br/><br/><a href='#fiscalperiodschart'>"
- + _("limahome.fiscalperiod.modify") + "</a>";
+ + _("lima.home.fiscalperiod.modify") + "</a>";
//set Text
setText(htmlBegin + fiscalString + htmlEnd);
@@ -105,13 +105,13 @@
}
else {
setBackground(redBackground);
- String fiscalString = _("limahome.fiscalperiod.noopen");
+ String fiscalString = _("lima.home.fiscalperiod.noopen");
if (fiscalPeriods.size()>0){
fiscalString += "<br/>" + fiscalPeriods.size() + " "
- + _("limahome.fiscalperiod.closed");
+ + _("lima.home.fiscalperiod.closed");
}
fiscalString += "<br/><br/><a href='#fiscalperiodschart'>"
- + _("limahome.fiscalperiod.create") + "</a>";
+ + _("lima.home.fiscalperiod.create") + "</a>";
//set Text
setText(htmlBegin + fiscalString + htmlEnd);
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/HomeView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/HomeView.jaxx 2010-08-23 09:35:53 UTC (rev 3014)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/HomeView.jaxx 2010-08-23 16:38:53 UTC (rev 3015)
@@ -32,7 +32,7 @@
<row>
<cell anchor="southeast">
<JPanel
- id = 'accountPanel'
+ id='accountPanel'
border='{BorderFactory.createEtchedBorder(EtchedBorder.LOWERED)}'
minimumSize='{getMiniSize()}'
preferredSize='{getFixedSize()}'
@@ -60,7 +60,7 @@
<Table>
<row>
<cell weightx="0" weighty="0.1" anchor="northwest"><JLabel icon='{new ImageIcon(getClass().getResource("/images/entrybooks.png"))}'/></cell>
- <cell weightx="1" weighty="0.1" anchor="center"><JLabel foreground='{Color.DARK_GRAY}' font='{new Font("sans-serif", Font.BOLD, 16)}' text='lima.charts.entrybook'/></cell>
+ <cell weightx="1" weighty="0.1" anchor="center"><JLabel foreground='{Color.DARK_GRAY}' font='{new Font("sans-serif", Font.BOLD, 16)}' text='lima.common.entrybooks'/></cell>
</row>
<row fill="both">
<cell columns="2" weightx="1" weighty="0.9">
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java 2010-08-23 09:35:53 UTC (rev 3014)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java 2010-08-23 16:38:53 UTC (rev 3015)
@@ -49,7 +49,6 @@
import org.chorem.lima.service.LimaServiceFactory;
import org.chorem.lima.ui.account.AccountViewHandler;
import org.chorem.lima.util.DialogHelper;
-import org.chorem.lima.util.FileChooseView;
import org.jdesktop.swingx.painter.BusyPainter;
public class ImportExport {
@@ -97,95 +96,97 @@
encodingEnum = EncodingEnum.UTF8;
if (file.equals("")){
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 datas = "";
- String result = "";
- switch (importExportMethodeF) {
- case CSV_ALL_EXPORT:
- datas = exportService.exportAsCSV();
- createFile(filePath, charset.getEncoding(), datas);
- break;
- case CSV_ACCOUNTCHARTS_EXPORT:
- datas = exportService.exportAccountsChartAsCSV();
- createFile(filePath, charset.getEncoding(), datas);
- break;
- case CSV_ENTRYBOOKS_EXPORT:
- datas = exportService.exportEntryBookChartAsCSV();
- createFile(filePath, charset.getEncoding(), datas);
- break;
- case CSV_FINANCIALSTATEMENTS_EXPORT:
- datas = exportService.exportFinancialStatementChartAsCSV();
- createFile(filePath, charset.getEncoding(), datas);
- break;
- case EBP_ACCOUNTCHARTS_EXPORT:
- //For windows ebp
- datas = exportService.exportAccountsAsEBP();
- createFile(filePath, EncodingEnum.ISOLATIN1.getEncoding(), datas);
- break;
- case EBP_ENTRIES_EXPORT:
- //For windows ebp
- datas = exportService.exportEntriesAsEBP();
- createFile(filePath, EncodingEnum.ISOLATIN1.getEncoding(), datas);
- break;
- case CSV_ALL_IMPORT:
- datas = extractFile(filePath, charset.getEncoding());
- result = importService.importAllAsCSV(datas);
- break;
- case CSV_ACCOUNTCHARTS_IMPORT:
- datas = extractFile(filePath, charset.getEncoding());
- result = importService.importAsCSV(datas, ImportExportEntityEnum.ACCOUNT);
- break;
- case CSV_ENTRYBOOKS_IMPORT:
- datas = extractFile(filePath, charset.getEncoding());
- result = importService.importAsCSV(datas, ImportExportEntityEnum.ENTRYBOOK);
- break;
- case CSV_FINANCIALSTATEMENTS_IMPORT:
- datas = extractFile(filePath, charset.getEncoding());
- result = importService.importAsCSV(datas, ImportExportEntityEnum.FINANCIALSTATEMENT);
- break;
- case EBP_ACCOUNTCHARTS_IMPORT:
- //For windows ebp
- datas = extractFile(filePath, EncodingEnum.ISOLATIN1.getEncoding());
- result = importService.importAccountsChartFromEbp(datas);
- break;
- case EBP_ENTRIES_IMPORT:
- //For windows ebp
- datas = extractFile(filePath, EncodingEnum.ISOLATIN1.getEncoding());
- result = importService.importEntriesFromEbp(datas);
- break;
+ //if export cancel
+ if (!file.equals("")){
+ final EncodingEnum charset = encodingEnum;
+ final String filePath = file;
+ final Boolean verboseMode = verbose;
+ new SwingWorker<String,Void>() {
+ @Override protected String doInBackground() throws LimaException {
+ String datas = "";
+ String result = "";
+ switch (importExportMethodeF) {
+ case CSV_ALL_EXPORT:
+ datas = exportService.exportAsCSV();
+ createFile(filePath, charset.getEncoding(), datas);
+ break;
+ case CSV_ACCOUNTCHARTS_EXPORT:
+ datas = exportService.exportAccountsChartAsCSV();
+ createFile(filePath, charset.getEncoding(), datas);
+ break;
+ case CSV_ENTRYBOOKS_EXPORT:
+ datas = exportService.exportEntryBookChartAsCSV();
+ createFile(filePath, charset.getEncoding(), datas);
+ break;
+ case CSV_FINANCIALSTATEMENTS_EXPORT:
+ datas = exportService.exportFinancialStatementChartAsCSV();
+ createFile(filePath, charset.getEncoding(), datas);
+ break;
+ case EBP_ACCOUNTCHARTS_EXPORT:
+ //For windows ebp
+ datas = exportService.exportAccountsAsEBP();
+ createFile(filePath, EncodingEnum.ISOLATIN1.getEncoding(), datas);
+ break;
+ case EBP_ENTRIES_EXPORT:
+ //For windows ebp
+ datas = exportService.exportEntriesAsEBP();
+ createFile(filePath, EncodingEnum.ISOLATIN1.getEncoding(), datas);
+ break;
+ case CSV_ALL_IMPORT:
+ datas = extractFile(filePath, charset.getEncoding());
+ result = importService.importAllAsCSV(datas);
+ break;
+ case CSV_ACCOUNTCHARTS_IMPORT:
+ datas = extractFile(filePath, charset.getEncoding());
+ result = importService.importAsCSV(datas, ImportExportEntityEnum.ACCOUNT);
+ break;
+ case CSV_ENTRYBOOKS_IMPORT:
+ datas = extractFile(filePath, charset.getEncoding());
+ result = importService.importAsCSV(datas, ImportExportEntityEnum.ENTRYBOOK);
+ break;
+ case CSV_FINANCIALSTATEMENTS_IMPORT:
+ datas = extractFile(filePath, charset.getEncoding());
+ result = importService.importAsCSV(datas, ImportExportEntityEnum.FINANCIALSTATEMENT);
+ break;
+ case EBP_ACCOUNTCHARTS_IMPORT:
+ //For windows ebp
+ datas = extractFile(filePath, EncodingEnum.ISOLATIN1.getEncoding());
+ result = importService.importAccountsChartFromEbp(datas);
+ break;
+ case EBP_ENTRIES_IMPORT:
+ //For windows ebp
+ datas = extractFile(filePath, EncodingEnum.ISOLATIN1.getEncoding());
+ result = importService.importEntriesFromEbp(datas);
+ break;
+ }
+ return result;
+ }
+ @Override protected void done() {
+ try {
+ //hidde wait dialog panel
+ waitView.setVisible(false);
+ // display result dialog
+ 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);
+ }
+ } catch (ExecutionException eeeEE) {
+ DialogHelper.showMessageDialog(eeeEE.getMessage());
}
- return result;
- }
- @Override protected void done() {
- try {
- //hidde wait dialog panel
- waitView.setVisible(false);
- // display result dialog
- 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);
- }
- } catch (ExecutionException eeeEE) {
- DialogHelper.showMessageDialog(eeeEE.getMessage());
- }
- }
- }.execute();
- waitView.setVisible(true);
+ }
+ }.execute();
+ waitView.setVisible(true);
+ }
}
@@ -197,8 +198,7 @@
*/
public String chooseFile(Boolean importMode, ImportExportEnum importExportMethode){
String filePath = "";
- FileChooseView fileChooseView = new FileChooseView();
- JFileChooser chooser = fileChooseView.getChooser();
+ JFileChooser chooser = new JFileChooser();
//Encoding option
JComboBox comboBox = new JComboBox(EncodingEnum.descriptions());
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerPeriodSearchPanel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerPeriodSearchPanel.java 2010-08-23 09:35:53 UTC (rev 3014)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerPeriodSearchPanel.java 2010-08-23 16:38:53 UTC (rev 3015)
@@ -69,7 +69,7 @@
Calendar calendarEnd = Calendar.getInstance();
Date endDate = calendarEnd.getTime();
//handler().setEndDate(endDate);
- JLabel beginDateLabel = new JLabel(_("lima.period.begindate"));
+ JLabel beginDateLabel = new JLabel(_("lima.common.begindate"));
final JXDatePicker beginDatePicker = new JXDatePicker(beginDate);
ActionListener beginDateActionListener = new ActionListener() {
@Override
@@ -81,7 +81,7 @@
handler.setBeginDate(beginDatePicker.getDate());
beginDatePicker.addActionListener(beginDateActionListener);
- JLabel endDateLabel = new JLabel(_("lima.period.enddate"));
+ JLabel endDateLabel = new JLabel(_("lima.common.enddate"));
final JXDatePicker endDatePicker = new JXDatePicker(endDate);
ActionListener endDateActionListener = new ActionListener() {
@Override
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerView.jaxx 2010-08-23 09:35:53 UTC (rev 3014)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerView.jaxx 2010-08-23 16:38:53 UTC (rev 3015)
@@ -69,19 +69,19 @@
</row>
<row fill="horizontal" anchor="center">
<cell>
- <JLabel text="lima.amountdebit" />
+ <JLabel text="lima.common.amountdebit" />
</cell>
<cell>
<JLabel id="amountDebitLabel" />
</cell>
<cell>
- <JLabel text="lima.amountcredit"/>
+ <JLabel text="lima.common.amountcredit"/>
</cell>
<cell>
<JLabel id="amountCreditLabel" />
</cell>
<cell>
- <JLabel id="soldeLabel" text="lima.solde"/>
+ <JLabel id="soldeLabel" text="lima.common.solde"/>
</cell>
<cell>
<JLabel id="amountSoldeLabel"/>
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerViewHandler.java 2010-08-23 09:35:53 UTC (rev 3014)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerViewHandler.java 2010-08-23 16:38:53 UTC (rev 3015)
@@ -170,15 +170,15 @@
String.valueOf(amountSolde));
if (amountSolde.doubleValue() == 0){
- view.soldeLabel.setText(_("lima.solde"));
+ view.soldeLabel.setText(_("lima.common.solde"));
}
else {
// set label solde: credit or debit
if (balanceTrialCache.getSoldeDebit()) {
- view.soldeLabel.setText(_("lima.soldedebit"));
+ view.soldeLabel.setText(_("lima.common.soldedebit"));
}
else {
- view.soldeLabel.setText(_("lima.soldecredit"));
+ view.soldeLabel.setText(_("lima.common.soldecredit"));
}
}
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/CreateEntryBookPanel.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/CreateEntryBookPanel.jaxx 2010-08-23 09:35:53 UTC (rev 3014)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/CreateEntryBookPanel.jaxx 2010-08-23 16:38:53 UTC (rev 3015)
@@ -26,7 +26,7 @@
</row>
<row>
<cell>
- <JCheckBox id='importEntryBook' text='lima.import.journal' selected='false'/>
+ <JCheckBox id='importEntryBook' text='lima.importexport.defaultentrybooks' selected='false'/>
</cell>
</row>
</Table>
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/CreateFiscalPeriodPanel.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/CreateFiscalPeriodPanel.jaxx 2010-08-23 09:35:53 UTC (rev 3014)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/CreateFiscalPeriodPanel.jaxx 2010-08-23 16:38:53 UTC (rev 3015)
@@ -59,18 +59,18 @@
<Table fill="both">
<row>
<cell columns ="3">
- <JLabel text="lima.period.create"/>
+ <JLabel text="lima.charts.fiscalperiod.create"/>
</cell>
</row>
<row>
<cell>
- <JLabel text="lima.period.begindate"/>
+ <JLabel text="lima.common.begindate"/>
</cell>
<cell>
<org.jdesktop.swingx.JXDatePicker id="beginDatePicker"/>
</cell>
<cell>
- <JLabel text="lima.period.enddate"/>
+ <JLabel text="lima.common.enddate"/>
</cell>
<cell>
<org.jdesktop.swingx.JXDatePicker id="endDatePicker"/>
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 2010-08-23 09:35:53 UTC (rev 3014)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/util/DialogHelper.java 2010-08-23 16:38:53 UTC (rev 3015)
@@ -35,7 +35,7 @@
String[] response = {_("lima.response.yes"), _("lima.response.no")};
return JOptionPane.showOptionDialog(null,
message,
- _("lima.question"),
+ _("lima.common.question"),
JOptionPane.YES_NO_OPTION,
JOptionPane.QUESTION_MESSAGE,
null, //do not use a custom Icon
@@ -49,7 +49,7 @@
JOptionPane.showMessageDialog(
f,
message,
- _("lima.error"),
+ _("lima.common.error"),
JOptionPane.ERROR_MESSAGE);
f.dispose();
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/util/ErrorHelper.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/util/ErrorHelper.java 2010-08-23 09:35:53 UTC (rev 3014)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/util/ErrorHelper.java 2010-08-23 16:38:53 UTC (rev 3015)
@@ -67,7 +67,7 @@
public static void showErrorDialog(Component parent, String message,
Throwable cause) {
JXErrorPane pane = new JXErrorPane();
- ErrorInfo info = new ErrorInfo(_("lima.error.errorpane.title"),
+ ErrorInfo info = new ErrorInfo(_("lima.common.error"),
_("lima.error.errorpane.htmlmessage", message), null, null,
cause, null, null);
pane.setErrorInfo(info);
Deleted: trunk/lima-swing/src/main/java/org/chorem/lima/util/FileChooseView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/util/FileChooseView.jaxx 2010-08-23 09:35:53 UTC (rev 3014)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/util/FileChooseView.jaxx 2010-08-23 16:38:53 UTC (rev 3015)
@@ -1,3 +0,0 @@
-<JFrame title="lima.export">
- <JFileChooser id="chooser" width="620" height="400"/>
-</JFrame>
\ No newline at end of file
Modified: trunk/lima-swing/src/main/resources/i18n/lima-swing-en_GB.properties
===================================================================
--- trunk/lima-swing/src/main/resources/i18n/lima-swing-en_GB.properties 2010-08-23 09:35:53 UTC (rev 3014)
+++ trunk/lima-swing/src/main/resources/i18n/lima-swing-en_GB.properties 2010-08-23 16:38:53 UTC (rev 3015)
@@ -1,182 +1,165 @@
-Confirmation=
-DEBUG\ delete\ all=
-Do\ you\ really\ want\ to\ delete\ entry\ book\ %s\ ?=
-Global\ lima\ exception=
-lima.about.message=
-lima.account=Account
-lima.account.label=Label
-lima.account.number=Number
-lima.accountsreports.accountfilter=Filter
-lima.accountsreports.begincalendar=
-lima.accountsreports.endcalendar=
-lima.accountsreports.movmentedfilter=
lima.action.commandline.help=Show help in console
lima.action.fullscreen=Full screen
lima.action.fullscreen.tip=Open ui in full screen
lima.action.normalscreen=Normal screen
lima.action.normalscreen.tip=Open ui in normal screen
-lima.add.entry=Add an entry
-lima.add.transaction=Add a transaction
-lima.amount=Amount
-lima.amountcredit=
-lima.amountdebit=
lima.charts.account=Accounts chart
-lima.charts.account.base=
-lima.charts.account.developed=
-lima.charts.account.nothing=
-lima.charts.account.shortened=
-lima.charts.entrybook=EntryBooks chart
-lima.charts.entrybook.default=
-lima.charts.entrybook.import=
+lima.charts.account.addAccount=Add account
+lima.charts.account.addSubLedger=Add thirdpart account
+lima.charts.account.base=Base accountchart
+lima.charts.account.developed=Developped accountchart
+lima.charts.account.number=Account Number
+lima.charts.account.question.remove=Do you really remove this account ?
+lima.charts.account.shortened=Shorthened accountchart
+lima.charts.entrybook.add=Add entrybook
+lima.charts.entrybook.confirmation=Do you really remove this entrybook ?
+lima.charts.entrybook.default=Defaults entrybooks
+lima.charts.entrybook.import=Import entrybooks
lima.charts.financialperiod=Financial Periods
-lima.charts.financialstatement=
-lima.charts.financialstatement.base=
-lima.charts.financialstatement.developed=
-lima.charts.financialstatement.nothing=
-lima.charts.financialstatement.shortened=
+lima.charts.financialperiod.block=Block financialperiod
+lima.charts.financialperiod.question.blocked=Do you really block this financialperiod ? This action is irreversible \!
+lima.charts.financialstatement=Financialstatement chart
+lima.charts.financialstatement.base=Base financialstatement chart
+lima.charts.financialstatement.developed=Developped financialstatement chart
+lima.charts.financialstatement.nothing=NO financialstatement chart
+lima.charts.financialstatement.shortened=Shortened financialstatement chart
+lima.charts.financialtransaction.question.removeentry=Do you really remove this entry ?
+lima.charts.financialtransaction.question.removetransaction=Do you really remove this transaction ?
+lima.charts.fiscalperiod.add=Add fiscalperiod
+lima.charts.fiscalperiod.block=Block fiscalperiod
+lima.charts.fiscalperiod.create=Create fiscalperiod
+lima.charts.fiscalperiod.question.blocked=Block financialperiod
+lima.charts.fiscalperiod.question.morethan12=This period is longer than 12 months. Do you really create this ?
lima.charts.fiscalyear=Fiscal Years
-lima.close=Closed
-lima.common.add=
-lima.common.addSubLedger=
-lima.common.cancel=
-lima.common.close=
-lima.common.copy=
-lima.common.filter=
-lima.common.fin=
-lima.common.import=
-lima.common.importexport=Import/Export
-lima.common.movmentedfilter=
-lima.common.next=
-lima.common.ok=
-lima.common.paste=
-lima.common.print=
-lima.common.quit=
-lima.common.remove=
-lima.common.search=
-lima.common.update=
-lima.config.category.directories=
-lima.config.category.directories.description=
-lima.config.category.other=
-lima.config.category.other.description=
+lima.common.account=Account
+lima.common.amount=Amount
+lima.common.amountcredit=Credit amount
+lima.common.amountdebit=Debit amount
+lima.common.begindate=Begin
+lima.common.cancel=Cancel
+lima.common.close=Close
+lima.common.closed=Closed
+lima.common.code=Code
+lima.common.confirmation=Confirmation
+lima.common.copy=Copy
+lima.common.enddate=End
+lima.common.entrybook=EntryBook
+lima.common.entrybooks=EntryBooks
+lima.common.error=Error
+lima.common.filter=Filter
+lima.common.fin=Terminated
+lima.common.globalexception=Global lima exception
+lima.common.label=Label
+lima.common.movmentedfilter=Accounts filtered
+lima.common.next=Next
+lima.common.ok=OK
+lima.common.open=Open
+lima.common.paste=Paste
+lima.common.period=Period
+lima.common.question=Question
+lima.common.quit=Exit
+lima.common.remove=Remove
+lima.common.search=Search
+lima.common.solde=Solde
+lima.common.soldecredit=Credit solde
+lima.common.soldedebit=Debit solde
+lima.common.update=Modify
+lima.config.category.directories=Directories
+lima.config.category.directories.description=Directories used by LIMA
+lima.config.category.other=Other
+lima.config.category.other.description=Other configuration properties
lima.config.configFileName.description=
-lima.config.host.adress=
-lima.config.host.httpport=
-lima.config.locale.description=
+lima.config.host.adress=Host adress
+lima.config.locale.description=Localization used by LIMA
lima.config.ui.flaunchui.description=
-lima.config.ui.fullscreen.description=
-lima.createPDF=
-lima.credit=Credit
+lima.config.ui.fullscreen.description=FullScreen
lima.daily=Daily
-lima.date=Date
-lima.debit=Debit
-lima.description=Description
-lima.dialogreport=
-lima.documents=
-lima.documents.html=
+lima.documents=Documents...
lima.entries=Entries
-lima.entries.addtransaction=
-lima.entries.lettering=
-lima.entries.searchtransaction=
-lima.entries.searchunbalancedtransaction=
-lima.entrybook=Entry Book
-lima.entrybook.add=Add Entry Book
-lima.entrybook.code=
-lima.entrybook.label=
-lima.entrybook.type=
-lima.entrybook.type1=
-lima.entrybook.type2=
-lima.entrybook.type3=
-lima.entrybook.type4=
-lima.entrybook.type5=
-lima.enum.comboboxaccount.account=
-lima.enum.comboboxaccount.accountlist=
-lima.enum.comboboxaccount.allaccount=
-lima.enum.comboboxamount.both=
-lima.enum.comboboxamount.credit=
-lima.enum.comboboxamount.debit=
-lima.enum.comboboxentrybook.all=
-lima.enum.comboboxentrybook.select_one=
-lima.enum.comboboxoperator.equal=
-lima.enum.comboboxoperator.inferior=
-lima.enum.comboboxoperator.inferiororequal=
-lima.enum.comboboxoperator.interval=
-lima.enum.comboboxoperator.intervalle=
-lima.enum.comboboxoperator.notequal=
-lima.enum.comboboxoperator.superior=
-lima.enum.comboboxoperator.superiororequal=
-lima.enum.comboboxperiod.date=
-lima.enum.comboboxperiod.financialperiod=
-lima.enum.comboboxperiod.fiscalperiod=
-lima.enum.comboboxperiod.period=
-lima.error=Error
+lima.entries.addEntry=Add entry
+lima.entries.addTransaction=Add transaction
+lima.entries.searchtransaction=Search transaction
+lima.entries.searchunbalancedtransaction=Incorrect transactions
+lima.entries.writetransaction=Write entries
+lima.enum.comboboxaccount.account=Account
+lima.enum.comboboxaccount.accountlist=Account list
+lima.enum.comboboxaccount.allaccount=All accounts
+lima.enum.comboboxentrybook.all=All entrybooks
+lima.enum.comboboxentrybook.select_one=EntryBook
+lima.enum.comboboxoperator.equal=Equal
+lima.enum.comboboxoperator.inferior=Inferior
+lima.enum.comboboxoperator.inferiororequal=Inferior or equal
+lima.enum.comboboxoperator.interval=Inteval
+lima.enum.comboboxoperator.notequal=Not equal
+lima.enum.comboboxoperator.superior=Superior
+lima.enum.comboboxoperator.superiororequal=Superior or equal
+lima.enum.comboboxperiod.date=Date
+lima.enum.comboboxperiod.financialperiod=Financial period
+lima.enum.comboboxperiod.fiscalperiod=Fiscal period
+lima.enum.comboboxperiod.period=Period
lima.error.errorpane.htmlmessage=<html><body><b>An application error happened</b>\:<br/>%s</body></html>
-lima.error.errorpane.title=Lima error
-lima.export=Export
-lima.export.account=Export PCG
-lima.export.all=Export all datas (XML)
-lima.export.all.csv=Exporter all datas (CSV)
-lima.financialperiod.block=
-lima.financialstament.check=
-lima.financialstatement.accounts=
-lima.financialstatement.check=
-lima.financialstatement.credit=
-lima.financialstatement.creditaccounts=
-lima.financialstatement.debit=
-lima.financialstatement.debitaccounts=
-lima.financialstatement.delete=
-lima.financialstatement.formula=
-lima.financialstatement.header.add=
-lima.financialstatement.headeramount=
-lima.financialstatement.label=
-lima.financialstatement.movement.add=
-lima.financialstatement.provisiondeprecationaccounts=
-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
-lima.import.all.csv=Import all datas (CSV)
-lima.import.all.csv.ebp=Import all datas (EBP)
-lima.import.journal=Import journal
-lima.importexport.accountcharts=
-lima.importexport.all=
-lima.importexport.choiceencoding=
-lima.importexport.csv=
-lima.importexport.ebp=
-lima.importexport.entries=
-lima.importexport.entrybooks=
+lima.financialstatement.accounts=Account list on debit and on credit
+lima.financialstatement.check=Check accounts passing to movement
+lima.financialstatement.creditaccounts=Account credit list
+lima.financialstatement.debitaccounts=Account debit list
+lima.financialstatement.delete=Delete actual financialstatement chart before import new
+lima.financialstatement.header.add=Add category
+lima.financialstatement.headeramount=Calculate amount on header
+lima.financialstatement.label=Label
+lima.financialstatement.movement.add=Add movement
+lima.financialstatement.provisiondeprecationaccounts=Provisions and deprecations accounts list
+lima.financialstatement.subamount=Calculate a subamount
+lima.home.chartaccounts.create=Create accountschart
+lima.home.chartaccounts.modify=Modify accountschart
+lima.home.chartaccounts.nothing=No accountschart
+lima.home.chartaccounts.state1_2=The chart have
+lima.home.chartaccounts.state2_2=accounts
+lima.home.entrybooks.create=Create entrybook
+lima.home.entrybooks.modify=Modifiy entrybook
+lima.home.entrybooks.nothing=No entrybook
+lima.home.entrybooks.state.single=Entrybook is
+lima.home.entrybooks.state1_2.plural=The
+lima.home.entrybooks.state2_2.plural=entrybooks are
+lima.home.fiscalperiod.closed=fiscalperiods closed
+lima.home.fiscalperiod.create=Create fiscalperiod
+lima.home.fiscalperiod.modify=Modify fiscalperiod
+lima.home.fiscalperiod.noopen=No fiscalperiod
+lima.home.fiscalperiod.opened=fiscalperiods open
+lima.home.transaction.balanced=transactions are balanced
+lima.home.transaction.create=Create entries
+lima.home.transaction.modifiy.balanced=Modify entries
+lima.home.transaction.modifiy.unbalanced=Modify incorrect entries
+lima.home.transaction.nothing=No transaction
+lima.home.transaction.unbalanced=transactions are not balanced
+lima.identity=Identity
+lima.identity.address=Address
+lima.identity.address2=Address (next)
+lima.identity.businessNumber=Business number
+lima.identity.city=City
+lima.identity.classificationCode=Classification code
+lima.identity.contact=Contact
+lima.identity.description=Description
+lima.identity.email=Email
+lima.identity.name=Name
+lima.identity.phoneNumber=Phone number
+lima.identity.vatNumber=VAT number
+lima.identity.zipCode=Zip code
+lima.importexport.accountcharts=Accounts chart
+lima.importexport.all=All
+lima.importexport.choiceencoding=Choice encoding
+lima.importexport.csv=Import/Export CSV
+lima.importexport.defaultentrybooks=Defaults entrybooks
+lima.importexport.ebp=Import/Export EBP
+lima.importexport.entries=Entries
lima.importexport.export=Export
-lima.importexport.financialstatements=
+lima.importexport.financialstatements=FinancialStatements chart
lima.importexport.import=Import
-lima.importexport.import.terminated=
-lima.importexport.importcsv=
-lima.importexport.importebp=
-lima.importexport.lima=
-lima.importexport.wait=
+lima.importexport.import.terminated=Import terminated
+lima.importexport.importcsv=Import CSV
+lima.importexport.importebp=Import EBP
+lima.importexport.wait=Job in progress\u2026
lima.init.closed=Lima closed at %1$s
-lima.init.errorclosing=
-lima.lettering.add=
-lima.lettering.entries=
-lima.lettering.from=
-lima.lettering.lettered=
-lima.lettering.letteredall=
-lima.lettering.notlettered=
-lima.lettering.remove=
-lima.lettering.to=
+lima.init.errorclosing=Error during Lima close
lima.menu.file=File
lima.menu.help=Help
lima.menu.help.about=About
@@ -185,115 +168,54 @@
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
+lima.menu.window=Window
+lima.message.help.usage=Options (set with --option <key> <value>\:
+lima.misc.supportemail.description=Support email
lima.openejb.remotemode.description=
-lima.opening.accounts=
-lima.opening.entrybook=
-lima.opening.import=
-lima.opening.welcome=
-lima.pdf=
-lima.period.begindate=
-lima.period.create=
-lima.period.enddate=
+lima.opening.accounts=<html><center>No account chart is load<br/>Select a default, <br/>import your personnal<br/> or cancel to create your own account chart.</center></html>
+lima.opening.entrybook=<html>Tick box to import default accounts chart\:<br/> Achats, Ventes, Tr\u00E9sorerie, Op\u00E9ration diverses</html>
+lima.opening.import=Import a CSV Save
+lima.opening.welcome=<html><center>Welcome to Lima<br/>this assistant help you to start your business accounting in the blink of an eye<br/>OR import instantanly your already existing save in CSV format<br/><br/><br/><br/></center></html>
lima.preferences=Preferences
-lima.question=Question
-lima.question.financialperiod.blocked=
-lima.question.fiscalperiod.blocked=
-lima.question.fiscalperiod.morethan12=
-lima.question.load.accounts=There is no existing accounts in Lima. Do you want to load default accounts ?
-lima.question.remove.account=Do you want to remove this account ?
-lima.question.remove.entry=Do you want to remove this entry ?
-lima.question.remove.transaction=Do you want to remove this transaction ?
lima.refresh=\u21BB
-lima.remove=Remove
lima.reports=Reports
lima.reports.accounts=Edit account
lima.reports.balance=Balance
lima.reports.entrybooks=Edit entrybook
-lima.reports.financialstatement=
+lima.reports.financialstatement=Financialstatements
lima.reports.ledger=Ledger
lima.response.no=No
lima.response.yes=Yes
-lima.solde=
-lima.soldecredit=
-lima.soldedebit=
lima.splash.1=Loading services...
lima.splash.2="Loading accounting...
lima.splash.3=Ready \!
lima.structure=Structure
-lima.subledger.code=Code
lima.tab.home=Home
-lima.tab.result=Result
-lima.table.account=
-lima.table.balance=
-lima.table.closure=
-lima.table.code=
-lima.table.credit=
-lima.table.date=
-lima.table.debit=
-lima.table.debitcredit=
-lima.table.description=
-lima.table.entrybook=
-lima.table.fiscalperiod=
-lima.table.grossamount=
-lima.table.label=
-lima.table.letter=
-lima.table.lettering=
-lima.table.move.credit=
-lima.table.move.debit=
-lima.table.netamount=
-lima.table.number=
-lima.table.period=
-lima.table.position=
-lima.table.provisiondeprecationamount=
-lima.table.solde=
-lima.table.solde.credit=
-lima.table.solde.debit=
-lima.table.type=
-lima.table.voucher=
+lima.table.account=Account
+lima.table.balance=Balance
+lima.table.closure=Closed
+lima.table.code=Code
+lima.table.credit=Credit
+lima.table.date=Date
+lima.table.debit=Debit
+lima.table.debitcredit=Debit and credit
+lima.table.description=Description
+lima.table.entrybook=EntryBook
+lima.table.fiscalperiod=Fiscalperiod
+lima.table.grossamount=Gross amount
+lima.table.label=Label
+lima.table.letter=Letter
+lima.table.move.credit=Movmented Credit
+lima.table.move.debit=Movemented Debit
+lima.table.netamount=Net amount
+lima.table.number=Account Number
+lima.table.period=Period
+lima.table.provisiondeprecationamount=Provision & Deprecation
+lima.table.solde=Solder
+lima.table.solde.credit=Credit solde
+lima.table.solde.debit=Debit solde
+lima.table.voucher=Voucher
lima.title=Lutin Invoice Monitoring and Accounting
lima.title.about=About Lima...
-lima.transaction.confirmdelete=
-lima.transaction.period=Period
-lima.voucher=Voucher
+lima.title.about.description=Open sources accounting software
lima.warning.nimbus.landf=Could not find Numbus Look&Feel
-lima.welcome=
-limahome.chartaccounts.create=
-limahome.chartaccounts.modify=
-limahome.chartaccounts.nothing=
-limahome.chartaccounts.state1_2=
-limahome.chartaccounts.state2_2=
-limahome.chartaccounts1=
-limahome.chartaccounts2=
-limahome.createchartaccounts=
-limahome.createchartaccounts1=
-limahome.createchartaccounts2=
-limahome.entrybooknoopen=
-limahome.entrybooks.create=
-limahome.entrybooks.modify=
-limahome.entrybooks.nothing=
-limahome.entrybooks.state.single=
-limahome.entrybooks.state1_2.plural=
-limahome.entrybooks.state2_2.plural=
-limahome.entrybooks1=
-limahome.entrybooks2=
-limahome.fiscalperiod.closed=
-limahome.fiscalperiod.create=
-limahome.fiscalperiod.modify=
-limahome.fiscalperiod.noopen=
-limahome.fiscalperiod.opened=
-limahome.fiscalperiodclosed=
-limahome.fiscalperiodnoopen=
-limahome.fiscalperiodopened=
-limahome.transaction.balanced=
-limahome.transaction.create=
-limahome.transaction.modifiy=
-limahome.transaction.modifiy.balanced=
-limahome.transaction.modifiy.unbalanced=
-limahome.transaction.nothing=
-limahome.transaction.unbalanced=
-limahome.transactionbalanced=
-limahome.transactionunbalanced=
Modified: trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties
===================================================================
--- trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties 2010-08-23 09:35:53 UTC (rev 3014)
+++ trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties 2010-08-23 16:38:53 UTC (rev 3015)
@@ -1,94 +1,89 @@
-Confirmation=
-DEBUG\ delete\ all=
-Do\ you\ really\ want\ to\ delete\ entry\ book\ %s\ ?=
-Global\ lima\ exception=
-lima.about.message=\u00C0 propos de Lima
-lima.account=Compte
-lima.account.label=
-lima.account.number=
-lima.accountsreports.begincalendar=
-lima.accountsreports.endcalendar=
lima.action.commandline.help=Afficher l'aide en console
lima.action.fullscreen=Plein Ecran
lima.action.fullscreen.tip=Passer en mode plein \u00E9cran
lima.action.normalscreen=Ecran normal
lima.action.normalscreen.tip=Revenir en \u00E9cran normal
-lima.add.entry=Ajouter entr\u00E9e
-lima.add.transaction=Ajouter transaction
-lima.amount=Montant
-lima.amountcredit=Total Cr\u00E9dit
-lima.amountdebit=Total D\u00E9bit
lima.charts.account=Plan comptable
+lima.charts.account.addAccount=Ajout Compte G\u00E9n\u00E9ral
+lima.charts.account.addSubLedger=Ajouter Compte Tiers
lima.charts.account.base=Plan comptable de base
lima.charts.account.developed=Plan comptable d\u00E9velopp\u00E9
+lima.charts.account.number=Num\u00E9ro de compte
+lima.charts.account.question.remove=Voulez-vous supprimer ce compte?
lima.charts.account.shortened=Plan comptable abr\u00E9g\u00E9
-lima.charts.entrybook=Journaux
+lima.charts.entrybook.add=Ajouter un journal
+lima.charts.entrybook.confirmation=Do you really want to delete entry book %s ?
lima.charts.entrybook.default=Journaux par d\u00E9fault
lima.charts.entrybook.import=Importer des journaux
lima.charts.financialperiod=P\u00E9riodes comptables
+lima.charts.financialperiod.block=Cloturer une p\u00E9riode
+lima.charts.financialperiod.question.blocked=\u00C8tes vous s\u00FBre de vouloir cl\u00F4turer cette p\u00E9riode ? Cette action est irr\u00E9versible \!
lima.charts.financialstatement=Plan BCR
lima.charts.financialstatement.base=Plan BCR de base
lima.charts.financialstatement.developed=Plan BCR d\u00E9velopp\u00E9
lima.charts.financialstatement.nothing=<html><center>Aucun plan BCR 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.financialstatement.shortened=Plan BCR abr\u00E9g\u00E9
+lima.charts.financialtransaction.question.removeentry=Voulez-vous supprimer cette ligne de transaction?
+lima.charts.financialtransaction.question.removetransaction=Voulez-vous supprimer cette transaction?
+lima.charts.fiscalperiod.add=Nouvel exercice
+lima.charts.fiscalperiod.block=Cloturer un exercice
+lima.charts.fiscalperiod.create=Choisissez la date de d\u00E9but et de fin du nouvel exercice
+lima.charts.fiscalperiod.question.blocked=\u00C8tes vous s\u00FBre de vouloir cl\u00F4turer cette exercice ? Cette action est irr\u00E9versible \!
+lima.charts.fiscalperiod.question.morethan12=La p\u00E9riode s\u00E9lectionn\u00E9e n'est pas de 12 mois, voulez-vous continuer ?
lima.charts.fiscalyear=Exercices
-lima.close=Ferm\u00E9
-lima.common.add=Ajout Compte G\u00E9n\u00E9ral
-lima.common.addSubLedger=Ajouter Compte Tiers
+lima.common.account=Compte
+lima.common.amount=Montant
+lima.common.amountcredit=Total Cr\u00E9dit
+lima.common.amountdebit=Total D\u00E9bit
+lima.common.begindate=D\u00E9but
lima.common.cancel=Annuler
lima.common.close=Fermer
+lima.common.closed=Ferm\u00E9
+lima.common.code=Code
+lima.common.confirmation=Confirmation
lima.common.copy=Copier
+lima.common.enddate=Fin
+lima.common.entrybook=Journal
+lima.common.entrybooks=Journaux
+lima.common.error=Erreur
lima.common.filter=Filtrer
lima.common.fin=Termin\u00E9
-lima.common.importexport=Importer/Exporter
+lima.common.globalexception=Global lima exception
+lima.common.label=Libell\u00E9
lima.common.movmentedfilter=Comptes mouvement\u00E9s
lima.common.next=Suivant
lima.common.ok=OK
+lima.common.open=Ouvert
lima.common.paste=Coller
-lima.common.print=
+lima.common.period=P\u00E9riode
+lima.common.question=Question
lima.common.quit=Quitter
lima.common.remove=Supprimer
lima.common.search=Rechercher
+lima.common.solde=Solde
+lima.common.soldecredit=Solde Cr\u00E9diteur
+lima.common.soldedebit=Solde D\u00E9biteur
lima.common.update=Modifier
lima.config.category.directories=R\u00E9pertoires
lima.config.category.directories.description=R\u00E9pertoires utilis\u00E9s par Lima
lima.config.category.other=Autre
lima.config.category.other.description=Autre propri\u00E9t\u00E9s de configuration
lima.config.configFileName.description=
-lima.config.host.adress=
-lima.config.host.httpport=
+lima.config.host.adress=Adresse du serveur distant
lima.config.locale.description=Locale utilis\u00E9e par l'application
lima.config.ui.flaunchui.description=
-lima.config.ui.fullscreen.description=
-lima.createPDF=
-lima.credit=Credit
+lima.config.ui.fullscreen.description=Plein \u00E9cran
lima.daily=Quotidien
-lima.date=Date
-lima.debit=Debit
-lima.description=Description
-lima.dialogreport=
lima.documents=Documents\u0085
lima.entries=Traitement
-lima.entries.addtransaction=Saisir des \u00E9critures
-lima.entries.lettering=Ajouter une lettre
+lima.entries.addEntry=Ajouter entr\u00E9e
+lima.entries.addTransaction=Ajouter transaction
lima.entries.searchtransaction=Rechercher des \u00E9critures
lima.entries.searchunbalancedtransaction=Entr\u00E9es incorrect
-lima.entrybook=Journal
-lima.entrybook.add=Ajouter un journal
-lima.entrybook.code=
-lima.entrybook.label=
-lima.entrybook.type=
-lima.entrybook.type1=Achats
-lima.entrybook.type2=Ventes
-lima.entrybook.type3=Tr\u00E9sorerie
-lima.entrybook.type4=G\u00E9n\u00E9ral
-lima.entrybook.type5=Situation
+lima.entries.writetransaction=Saisir des \u00E9critures
lima.enum.comboboxaccount.account=Compte
lima.enum.comboboxaccount.accountlist=Liste de comptes
lima.enum.comboboxaccount.allaccount=Tous les comptes
-lima.enum.comboboxamount.both=Les deux
-lima.enum.comboboxamount.credit=Cr\u00E9dit
-lima.enum.comboboxamount.debit=D\u00E9bit
lima.enum.comboboxentrybook.all=Tous les journaux
lima.enum.comboboxentrybook.select_one=Journal
lima.enum.comboboxoperator.equal=\u00C9gal
@@ -102,29 +97,40 @@
lima.enum.comboboxperiod.financialperiod=P\u00E9riode Financi\u00E8re
lima.enum.comboboxperiod.fiscalperiod=Exercice
lima.enum.comboboxperiod.period=P\u00E9riode
-lima.error=Erreur
lima.error.errorpane.htmlmessage=<html><body><b>Une erreur s'est produite</b>\:<br/>%s</body></html>
-lima.error.errorpane.title=Lima erreur
-lima.export=Export
-lima.export.account=Exporter le PCG
-lima.export.all=Exporter toutes les donn\u00E9es (XML)
-lima.export.all.csv=Exporter toutes les donn\u00E9es (CSV)
-lima.financialperiod.block=Cloturer une p\u00E9riode
lima.financialstatement.accounts=Liste de comptes au cr\u00E9dit et au d\u00E9bit
lima.financialstatement.check=V\u00E9rification des comptes aux postes
-lima.financialstatement.credit=Sens du poste \: d\u00E9bit
lima.financialstatement.creditaccounts=Liste de comptes au cr\u00E9dit
lima.financialstatement.debitaccounts=Liste de comptes au d\u00E9bit
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
lima.financialstatement.label=Libell\u00E9
lima.financialstatement.movement.add=Ajouter un regrouprement
lima.financialstatement.provisiondeprecationaccounts=Liste de comptes d'amortissement et provisions
lima.financialstatement.subamount=Calculer un sous-total
-lima.fiscalperiod.addFiscalPeriod=Nouvel exercice
-lima.fiscalperiod.block=Cloturer un exercice
+lima.home.chartaccounts.create=Cr\u00E9er le plan des comptes
+lima.home.chartaccounts.modify=Modifier le plan des comptes
+lima.home.chartaccounts.nothing=Aucun compte \!
+lima.home.chartaccounts.state1_2=Le plan comptable possede
+lima.home.chartaccounts.state2_2=comptes
+lima.home.entrybooks.create=Cr\u00E9er les journaux
+lima.home.entrybooks.modify=Modifier les journaux
+lima.home.entrybooks.nothing=Aucun journal ouvert \!
+lima.home.entrybooks.state.single=Le journal est \:
+lima.home.entrybooks.state1_2.plural=Les
+lima.home.entrybooks.state2_2.plural=journaux sont \:
+lima.home.fiscalperiod.closed=exercices clotur\u00E9s
+lima.home.fiscalperiod.create=Cr\u00E9er un exercice
+lima.home.fiscalperiod.modify=Modifier les exercices
+lima.home.fiscalperiod.noopen=Aucun exercice ouvert \!
+lima.home.fiscalperiod.opened=exercices ouverts
+lima.home.transaction.balanced=transactions, toutes sont \u00E9quilibr\u00E9es
+lima.home.transaction.create=Ajouter des \u00E9critures
+lima.home.transaction.modifiy.balanced=Modifier les \u00E9critures
+lima.home.transaction.modifiy.unbalanced=Modifier les \u00E9critures incorrect
+lima.home.transaction.nothing=Aucune \u00E9criture
+lima.home.transaction.unbalanced=transactions ne sont pas \u00E9quilibr\u00E9es \!
lima.identity=Identit\u00E9
lima.identity.address=Adresse
lima.identity.address2=Adresse (suite)
@@ -138,14 +144,13 @@
lima.identity.phoneNumber=n\u00B0 Tel
lima.identity.vatNumber=n\u00B0 TVA
lima.identity.zipCode=Code Postal
-lima.import.journal=Journaux par d\u00E9faut
lima.importexport.accountcharts=Plan des comptes
lima.importexport.all=Tout
lima.importexport.choiceencoding=Choisir encodage \:
lima.importexport.csv=Import/Export CSV
+lima.importexport.defaultentrybooks=Journaux par d\u00E9faut
lima.importexport.ebp=Import/Export EBP
lima.importexport.entries=\u00C9critures
-lima.importexport.entrybooks=Journaux
lima.importexport.export=Export
lima.importexport.financialstatements=Plan BCR
lima.importexport.import=Import
@@ -154,15 +159,7 @@
lima.importexport.importebp=Import EBP
lima.importexport.wait=Traitement en cours \u2026
lima.init.closed=Lima ferm\u00E9 \u00E0 %1$s
-lima.init.errorclosing=
-lima.lettering.add=Ajouter une lettre
-lima.lettering.entries=Op\u00E9ration de saisie
-lima.lettering.from=De
-lima.lettering.lettered=Lettr\u00E9e
-lima.lettering.letteredall=Toutes
-lima.lettering.notlettered=Non lettr\u00E9e
-lima.lettering.remove=Supprimer
-lima.lettering.to=\u00C0
+lima.init.errorclosing=Erreur lors de la fermeture
lima.menu.file=Fichier
lima.menu.help=Aide
lima.menu.help.about=\u00C0 Propos
@@ -172,29 +169,15 @@
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
+lima.message.help.usage=Options (set with --option <key> <value>\:
+lima.misc.supportemail.description=Adresse email de support
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.import=Importer une sauvegarde CSV
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<br/>Ou bien importer directement une ancienne sauvegarde de LIMA au format CSV<br/><br/><br/><br/></center></html>
-lima.pdf=
-lima.period.begindate=D\u00E9but
-lima.period.create=Choisissez la date de d\u00E9but et de fin du nouvel exercice
-lima.period.enddate=Fin
lima.preferences=Pr\u00E9f\u00E9rences
-lima.question=Question
-lima.question.financialperiod.blocked=
-lima.question.fiscalperiod.blocked=\u00C8tes vous s\u00FBre de vouloir cl\u00F4turer cette exercice ? Cette action est irr\u00E9versible \!
-lima.question.fiscalperiod.morethan12=La p\u00E9riode s\u00E9lectionner n'est pas de 12 mois, voulez-vous continuer ?
-lima.question.load.accounts=Il n'y a aucun plan comptable existant dans Lima. Voulez-vous en charger un par d\u00E9faut ?
-lima.question.remove.account=Voulez-vous supprimer ce compte?
-lima.question.remove.entry=Voulez-vous supprimer cette ligne de transaction?
-lima.question.remove.transaction=Voulez-vous supprimer cette transaction?
lima.refresh=\u21BB
-lima.remove=
lima.reports=Rapports
lima.reports.accounts=Edition compte
lima.reports.balance=Balance
@@ -203,16 +186,11 @@
lima.reports.ledger=Grand Livre
lima.response.no=Non
lima.response.yes=Oui
-lima.solde=Solde
-lima.soldecredit=Solde Cr\u00E9diteur
-lima.soldedebit=Solde D\u00E9biteur
lima.splash.1=Chargement des services...
lima.splash.2=Chargement de la comptabilit\u00E9
lima.splash.3=Application pr\u00EAte \!
lima.structure=Structure
-lima.subledger.code=Code
lima.tab.home=Accueil
-lima.tab.result=
lima.table.account=Compte
lima.table.balance=Balance
lima.table.closure=Cloture
@@ -227,44 +205,17 @@
lima.table.grossamount=Brut
lima.table.label=Libell\u00E9
lima.table.letter=Lettre
-lima.table.lettering=
lima.table.move.credit=Mouvement au cr\u00E9dit
lima.table.move.debit=Mouvement au d\u00E9bit
lima.table.netamount=Net
-lima.table.number=Num\u00E9ro du compte
+lima.table.number=Num\u00E9ro de compte
lima.table.period=P\u00E9riode
-lima.table.position=Statut
lima.table.provisiondeprecationamount=Amortissements et provisions
lima.table.solde=Solde
lima.table.solde.credit=Solde cr\u00E9dit
lima.table.solde.debit=Solde d\u00E9bit
-lima.table.type=Type
lima.table.voucher=Pi\u00E8ce comptable
lima.title=Lutin Invoice Monitoring and Accounting
-lima.title.about=A propos de Lima...
-lima.transaction.confirmdelete=
-lima.transaction.period=P\u00E9riode
-lima.voucher=Document
+lima.title.about=\u00C0 propos de Lima...
+lima.title.about.description=Logiciel de comptabilit\u00E9 Libre
lima.warning.nimbus.landf=Le look and feel nymbus n'a pas \u00E9t\u00E9 trouv\u00E9
-limahome.chartaccounts.create=Cr\u00E9er le plan des comptes
-limahome.chartaccounts.modify=Modifier le plan des comptes
-limahome.chartaccounts.nothing=Aucun compte \!
-limahome.chartaccounts.state1_2=Le plan comptable possede
-limahome.chartaccounts.state2_2=comptes
-limahome.entrybooks.create=Cr\u00E9er les journaux
-limahome.entrybooks.modify=Modifier les journaux
-limahome.entrybooks.nothing=Aucun journal ouvert \!
-limahome.entrybooks.state.single=Le journal est \:
-limahome.entrybooks.state1_2.plural=Les
-limahome.entrybooks.state2_2.plural=journaux sont \:
-limahome.fiscalperiod.closed=exercices clotur\u00E9s
-limahome.fiscalperiod.create=Cr\u00E9er un exercice
-limahome.fiscalperiod.modify=Modifier les exercices
-limahome.fiscalperiod.noopen=Aucun exercice ouvert \!
-limahome.fiscalperiod.opened=exercices ouverts
-limahome.transaction.balanced=transactions, toutes sont \u00E9quilibr\u00E9es
-limahome.transaction.create=Ajouter des \u00E9critures
-limahome.transaction.modifiy.balanced=Modifier les \u00E9critures
-limahome.transaction.modifiy.unbalanced=Modifier les \u00E9critures incorrect
-limahome.transaction.nothing=Aucune \u00E9criture
-limahome.transaction.unbalanced=\u00E9critures ne sont pas \u00E9quilibr\u00E9es \!
Deleted: trunk/lima-swing/src/main/resources/images/logo-codelutin.png
===================================================================
(Binary files differ)
Added: trunk/lima-swing/src/main/resources/images/puzzle_icon.png
===================================================================
(Binary files differ)
Property changes on: trunk/lima-swing/src/main/resources/images/puzzle_icon.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Deleted: trunk/lima-swing/src/main/resources/images/splash.png
===================================================================
(Binary files differ)
1
0
23 Aug '10
Author: jpepin
Date: 2010-08-23 11:35:53 +0200 (Mon, 23 Aug 2010)
New Revision: 3014
Url: http://chorem.org/repositories/revision/lima/3014
Log:
Ajout dans les rapports choix de s?\195?\169lection de la p?\195?\169riod.
Ajout nouveau splash-screen puzzle.
Added:
trunk/lima-swing/src/main/java/org/chorem/lima/enums/ComboBoxDatesEnum.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsPeriodSearchPanel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalancePeriodSearchPanel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsPeriodSearchPanel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportPeriodSearchPanel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionPeriodSearchPanel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerPeriodSearchPanel.java
trunk/lima-swing/src/main/resources/images/puzzle_splash.png
Removed:
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/PeriodSearchPanel.java
Modified:
trunk/lima-swing/src/main/java/org/chorem/lima/LimaMain.java
trunk/lima-swing/src/main/java/org/chorem/lima/LimaSplash.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTable.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchTable.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchViewHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerView.jaxx
trunk/lima-swing/src/main/resources/i18n/lima-swing-en_GB.properties
trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/LimaMain.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/LimaMain.java 2010-08-22 19:14:52 UTC (rev 3013)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/LimaMain.java 2010-08-23 09:35:53 UTC (rev 3014)
@@ -154,6 +154,7 @@
// update splash
LimaSplash splash = new LimaSplash();
splash.initSplash(config.getVersion());
+ splash.updateProgression(0.1, _("lima.splash.1"));
// do init ui
MainViewHandler uiHandler = context.getContextValue(MainViewHandler.class);
@@ -165,7 +166,7 @@
// load accounts and test if there is an account plan defined
// if not, call #loadDefaultAccount()
- splash.updateProgression(0.5, _("Loading accounting..."));
+ splash.updateProgression(0.5, _("lima.splash.2"));
//start http server
LimaServiceFactory.getInstance().getService(HttpServerServiceMonitorable.class).start();
@@ -184,7 +185,7 @@
openingView.setLocationRelativeTo(null);
openingView.setVisible(true);
}
-
+ splash.updateProgression(0.5, _("lima.splash.3"));
// show ui
SwingUtilities.invokeLater(new Runnable() {
@Override
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/LimaSplash.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/LimaSplash.java 2010-08-22 19:14:52 UTC (rev 3013)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/LimaSplash.java 2010-08-23 09:35:53 UTC (rev 3014)
@@ -20,6 +20,7 @@
import java.awt.AlphaComposite;
import java.awt.Color;
+import java.awt.Font;
import java.awt.Graphics2D;
import java.awt.SplashScreen;
@@ -69,7 +70,7 @@
public void initSplash(String version) {
if (splashGraphics != null) {
splashGraphics.setColor(Color.BLACK);
- splashGraphics.drawString("Version : " + version, 300, 90);
+ splashGraphics.drawString("Version : " + version, 394, 42);
}
else {
if (log.isWarnEnabled()) {
@@ -89,16 +90,18 @@
public void updateProgression(double progress, String message) {
if (splashGraphics != null) {
- splashGraphics.setColor(Color.BLACK);
- splashGraphics.drawRect(50, 130, 300, 10);
- splashGraphics.fillRect(50, 130, (int)(300.0 * progress), 10);
+ splashGraphics.setColor(Color.GRAY);
+ splashGraphics.drawRect(65, 253, 300, 10);
+ splashGraphics.fillRect(65, 253, (int)(300.0 * progress), 10);
if (message != null) {
splashGraphics.setComposite(AlphaComposite.Clear);
- splashGraphics.fillRect(50,150, 200, 40);
+ splashGraphics.fillRect(65, 238, 300, 15);
splashGraphics.setPaintMode();
- splashGraphics.setColor(Color.BLACK);
- splashGraphics.drawString(message + "...", 50, 160);
+ splashGraphics.setColor(new Color(255, 210, 55));
+ Font font = new Font("Lucida Sans", Font.BOLD, 14);
+ splashGraphics.setFont(font);
+ splashGraphics.drawString(message + "...", 65, 248);
}
splash.update();
Added: trunk/lima-swing/src/main/java/org/chorem/lima/enums/ComboBoxDatesEnum.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/enums/ComboBoxDatesEnum.java (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/enums/ComboBoxDatesEnum.java 2010-08-23 09:35:53 UTC (rev 3014)
@@ -0,0 +1,61 @@
+/* *##% Lima Swing
+ * Copyright (C) 2008 - 2010 CodeLutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * ##%*/
+
+package org.chorem.lima.enums;
+
+import static org.nuiton.i18n.I18n._;
+
+
+public enum ComboBoxDatesEnum {
+
+ FISCAL_PERIOD(_("lima.enum.comboboxperiod.fiscalperiod")),
+ FINANCIAL_PERIOD(_("lima.enum.comboboxperiod.financialperiod")),
+ PERIOD(_("lima.enum.comboboxperiod.period"));
+
+ private final String description;
+
+ private ComboBoxDatesEnum(String description) {
+ this.description = description;
+ }
+
+ public String getDescription() {
+ return this.description;
+ }
+
+ public static String[] descriptions(){
+ int nbElts = ComboBoxDatesEnum.values().length;
+ String[] descriptions = new String[nbElts];
+ ComboBoxDatesEnum[] enums = ComboBoxDatesEnum.values();
+ for (int i = 0; i < nbElts; i++) {
+ descriptions[i] = enums[i].getDescription();
+ }
+ return descriptions;
+ }
+
+ public static ComboBoxDatesEnum valueOfDescription(String description){
+ ComboBoxDatesEnum value = null;
+
+ for (ComboBoxDatesEnum enums : ComboBoxDatesEnum.values()) {
+ if (description.equals(enums.description)){
+ value = enums;
+ break;
+ }
+ }
+ return value;
+ }
+}
Added: trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsPeriodSearchPanel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsPeriodSearchPanel.java (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsPeriodSearchPanel.java 2010-08-23 09:35:53 UTC (rev 3014)
@@ -0,0 +1,152 @@
+/* *##% Lima Swing
+ * Copyright (C) 2008 - 2010 CodeLutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * ##%*/
+
+package org.chorem.lima.ui.accountsreports;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.util.Calendar;
+import java.util.Date;
+import static org.nuiton.i18n.I18n._;
+import javax.swing.JComboBox;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import org.apache.commons.lang.time.DateUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.chorem.lima.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 AccountsReportsPeriodSearchPanel extends JPanel {
+
+ private static final Log log =
+ LogFactory.getLog(AccountsReportsPeriodSearchPanel.class);
+
+ protected AccountsReportsViewHandler handler;
+
+ public AccountsReportsPeriodSearchPanel(AccountsReportsViewHandler handler) {
+ this.handler = handler;
+
+ //init date
+ refresh(ComboBoxDatesEnum.FISCAL_PERIOD);
+ }
+
+ static final long serialVersionUID = 1L;
+
+ 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.period.begindate"));
+ final JXDatePicker beginDatePicker = new JXDatePicker(beginDate);
+ ActionListener beginDateActionListener = new ActionListener() {
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ handler.setBeginDate(beginDatePicker.getDate());
+ handler.refresh();
+ }
+ };
+ handler.setBeginDate(beginDatePicker.getDate());
+ beginDatePicker.addActionListener(beginDateActionListener);
+
+ JLabel endDateLabel = new JLabel(_("lima.period.enddate"));
+ final JXDatePicker endDatePicker = new JXDatePicker(endDate);
+ ActionListener endDateActionListener = new ActionListener() {
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ handler.setEndDate(endDatePicker.getDate());
+ handler.refresh();
+ }
+ };
+ handler.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();
+ 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.setBeginDate(fPeriod.getBeginDate());
+ handler.setEndDate(fPeriod.getEndDate());
+ handler.refresh();
+ }
+ }
+ };
+ fiscalPeriod.addActionListener(fiscalPeriodActionListener);
+
+ this.removeAll();
+ this.add(fiscalPeriod);
+ break;
+
+ case FINANCIAL_PERIOD:
+ FinancialPeriodComboBoxModel financialModel = new FinancialPeriodComboBoxModel();
+ 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.setBeginDate(fPeriod.getBeginDate());
+ handler.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/accountsreports/AccountsReportsView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsView.jaxx 2010-08-22 19:14:52 UTC (rev 3013)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsView.jaxx 2010-08-23 09:35:53 UTC (rev 3014)
@@ -22,47 +22,22 @@
<script>
<![CDATA[
- import org.chorem.lima.entity.Account;
- import org.apache.commons.lang.time.DateUtils;
- import java.util.Calendar;
+ import org.chorem.lima.enums.ComboBoxDatesEnum;
+ AccountsReportsPeriodSearchPanel periodSearchPanel = new AccountsReportsPeriodSearchPanel(handler);
- // 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);
- getHandler().setBeginDate(beginDate);
-
- // get end date
- Calendar calendarEnd = Calendar.getInstance();
- Date endDate = calendarEnd.getTime();
- getHandler().setEndDate(endDate);
-
- getBeginDatePicker().setDate(beginDate);
- getEndDatePicker().setDate(endDate);
-
void $afterCompleteSetup() {
- //getHandler().refresh();
}
]]>
</script>
<row weightx="1" weighty="0" anchor="center">
+ <cell fill='both'><Table><row>
+ <cell anchor="west"><JComboBox id="periodComboBox" javaBean="new JComboBox(ComboBoxDatesEnum.descriptions())"
+ onActionPerformed="periodSearchPanel.refresh(ComboBoxDatesEnum.valueOfDescription((String) periodComboBox.getSelectedItem()));
+ validate(); repaint()"/></cell>
+ <cell><AccountsReportsPeriodSearchPanel javaBean="periodSearchPanel"/></cell>
+ </row></Table></cell>
<cell anchor="east">
- <JLabel id="beginCalendarPanelLabel" text="lima.accountsreports.begincalendar"/>
- </cell>
- <cell anchor="west">
- <org.jdesktop.swingx.JXDatePicker id="beginDatePicker"
- 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="getHandler().setEndDate(endDatePicker.getDate())"/>
- </cell>
- <cell anchor="east">
<JLabel id="accountSelectorLabel" text="lima.account"/>
</cell>
<cell anchor="west">
Added: trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalancePeriodSearchPanel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalancePeriodSearchPanel.java (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalancePeriodSearchPanel.java 2010-08-23 09:35:53 UTC (rev 3014)
@@ -0,0 +1,153 @@
+/* *##% 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.balance;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.util.Calendar;
+import java.util.Date;
+import static org.nuiton.i18n.I18n._;
+import javax.swing.JComboBox;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import org.apache.commons.lang.time.DateUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.chorem.lima.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 BalancePeriodSearchPanel extends JPanel {
+
+ private static final Log log =
+ LogFactory.getLog(BalancePeriodSearchPanel.class);
+
+ protected BalanceViewHandler handler;
+
+ public BalancePeriodSearchPanel(BalanceViewHandler handler) {
+ this.handler = handler;
+
+ //init date
+ refresh(ComboBoxDatesEnum.FISCAL_PERIOD);
+ }
+
+ static final long serialVersionUID = 1L;
+
+ 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.period.begindate"));
+ final JXDatePicker beginDatePicker = new JXDatePicker(beginDate);
+ ActionListener beginDateActionListener = new ActionListener() {
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ handler.setBeginDate(beginDatePicker.getDate());
+ handler.refresh();
+ }
+ };
+ handler.setBeginDate(beginDatePicker.getDate());
+ beginDatePicker.addActionListener(beginDateActionListener);
+
+ JLabel endDateLabel = new JLabel(_("lima.period.enddate"));
+ final JXDatePicker endDatePicker = new JXDatePicker(endDate);
+ ActionListener endDateActionListener = new ActionListener() {
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ handler.setEndDate(endDatePicker.getDate());
+ handler.refresh();
+ }
+ };
+ handler.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();
+ 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.setBeginDate(fPeriod.getBeginDate());
+ handler.setEndDate(fPeriod.getEndDate());
+ handler.refresh();
+ }
+ }
+ };
+ fiscalPeriod.addActionListener(fiscalPeriodActionListener);
+
+ this.removeAll();
+ this.add(fiscalPeriod);
+ break;
+
+ case FINANCIAL_PERIOD:
+ FinancialPeriodComboBoxModel financialModel = new FinancialPeriodComboBoxModel();
+ 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.setBeginDate(fPeriod.getBeginDate());
+ handler.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/balance/BalanceView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceView.jaxx 2010-08-22 19:14:52 UTC (rev 3013)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceView.jaxx 2010-08-23 09:35:53 UTC (rev 3014)
@@ -22,48 +22,23 @@
<script>
<![CDATA[
- import org.chorem.lima.entity.Account;
- import org.apache.commons.lang.time.DateUtils;
- import java.util.Calendar;
-
- // 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);
+ import org.chorem.lima.enums.ComboBoxDatesEnum;
+ BalancePeriodSearchPanel periodSearchPanel = new BalancePeriodSearchPanel(handler);
- // get end date
- Calendar calendarEnd = Calendar.getInstance();
- Date endDate = calendarEnd.getTime();
-
- getBeginDatePicker().setDate(beginDate);
- getEndDatePicker().setDate(endDate);
- getHandler().setBeginDate(beginDate);
- getHandler().setEndDate(endDate);
-
void $afterCompleteSetup() {
- getHandler().refresh();
}
]]>
</script>
<row weightx="1" weighty="0" anchor="center">
+ <cell fill='both'><Table><row>
+ <cell anchor="west"><JComboBox id="periodComboBox" javaBean="new JComboBox(ComboBoxDatesEnum.descriptions())"
+ onActionPerformed="periodSearchPanel.refresh(ComboBoxDatesEnum.valueOfDescription((String) periodComboBox.getSelectedItem()));
+ validate(); repaint()"/></cell>
+ <cell><BalancePeriodSearchPanel javaBean="periodSearchPanel"/></cell>
+ </row></Table></cell>
<cell anchor="east">
- <JLabel id="beginCalendarPanelLabel" text="lima.period.begindate"/>
- </cell>
- <cell anchor="west">
- <org.jdesktop.swingx.JXDatePicker id="beginDatePicker"
- onActionPerformed="getHandler().setBeginDate(beginDatePicker.getDate())"/>
- </cell>
- <cell anchor="east">
- <JLabel id="endCalendarPanelLabel" text="lima.period.enddate"/>
- </cell>
- <cell anchor="west">
- <org.jdesktop.swingx.JXDatePicker id="endDatePicker"
- onActionPerformed="getHandler().setEndDate(endDatePicker.getDate())"/>
- </cell>
- <cell anchor="east">
<JLabel text="lima.common.filter"/>
</cell>
<cell anchor="west">
Added: trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsPeriodSearchPanel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsPeriodSearchPanel.java (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsPeriodSearchPanel.java 2010-08-23 09:35:53 UTC (rev 3014)
@@ -0,0 +1,152 @@
+/* *##% Lima Swing
+ * Copyright (C) 2008 - 2010 CodeLutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * ##%*/
+
+package org.chorem.lima.ui.entrybooksreports;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.util.Calendar;
+import java.util.Date;
+import static org.nuiton.i18n.I18n._;
+import javax.swing.JComboBox;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import org.apache.commons.lang.time.DateUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.chorem.lima.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 EntryBooksReportsPeriodSearchPanel extends JPanel {
+
+ private static final Log log =
+ LogFactory.getLog(EntryBooksReportsPeriodSearchPanel.class);
+
+ protected EntryBooksReportsViewHandler handler;
+
+ public EntryBooksReportsPeriodSearchPanel(EntryBooksReportsViewHandler handler) {
+ this.handler = handler;
+
+ //init date
+ refresh(ComboBoxDatesEnum.FISCAL_PERIOD);
+ }
+
+ static final long serialVersionUID = 1L;
+
+ 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.period.begindate"));
+ final JXDatePicker beginDatePicker = new JXDatePicker(beginDate);
+ ActionListener beginDateActionListener = new ActionListener() {
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ handler.setBeginDate(beginDatePicker.getDate());
+ handler.refresh();
+ }
+ };
+ handler.setBeginDate(beginDatePicker.getDate());
+ beginDatePicker.addActionListener(beginDateActionListener);
+
+ JLabel endDateLabel = new JLabel(_("lima.period.enddate"));
+ final JXDatePicker endDatePicker = new JXDatePicker(endDate);
+ ActionListener endDateActionListener = new ActionListener() {
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ handler.setEndDate(endDatePicker.getDate());
+ handler.refresh();
+ }
+ };
+ handler.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();
+ 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.setBeginDate(fPeriod.getBeginDate());
+ handler.setEndDate(fPeriod.getEndDate());
+ handler.refresh();
+ }
+ }
+ };
+ fiscalPeriod.addActionListener(fiscalPeriodActionListener);
+
+ this.removeAll();
+ this.add(fiscalPeriod);
+ break;
+
+ case FINANCIAL_PERIOD:
+ FinancialPeriodComboBoxModel financialModel = new FinancialPeriodComboBoxModel();
+ 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.setBeginDate(fPeriod.getBeginDate());
+ handler.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/entrybooksreports/EntryBooksReportsView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsView.jaxx 2010-08-22 19:14:52 UTC (rev 3013)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsView.jaxx 2010-08-23 09:35:53 UTC (rev 3014)
@@ -23,47 +23,22 @@
<script>
<![CDATA[
- import org.chorem.lima.entity.EntryBook;
- import org.apache.commons.lang.time.DateUtils;
- import java.util.Calendar;
+ import org.chorem.lima.enums.ComboBoxDatesEnum;
+ EntryBooksReportsPeriodSearchPanel periodSearchPanel = new EntryBooksReportsPeriodSearchPanel(handler);
- // 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);
- getHandler().setBeginDate(beginDate);
-
- // get end date
- Calendar calendarEnd = Calendar.getInstance();
- Date endDate = calendarEnd.getTime();
- getHandler().setEndDate(endDate);
-
- getBeginDatePicker().setDate(beginDate);
- getEndDatePicker().setDate(endDate);
-
void $afterCompleteSetup() {
- //getHandler().refresh();
}
]]>
</script>
<row weightx="1" weighty="0" anchor="center">
+ <cell fill='both'><Table><row>
+ <cell anchor="west"><JComboBox id="periodComboBox" javaBean="new JComboBox(ComboBoxDatesEnum.descriptions())"
+ onActionPerformed="periodSearchPanel.refresh(ComboBoxDatesEnum.valueOfDescription((String) periodComboBox.getSelectedItem()));
+ validate(); repaint()"/></cell>
+ <cell><EntryBooksReportsPeriodSearchPanel javaBean="periodSearchPanel"/></cell>
+ </row></Table></cell>
<cell anchor="east">
- <JLabel id="beginCalendarPanelLabel" text="lima.accountsreports.begincalendar"/>
- </cell>
- <cell anchor="west">
- <org.jdesktop.swingx.JXDatePicker id="beginDatePicker"
- 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="getHandler().setEndDate(endDatePicker.getDate())"/>
- </cell>
- <cell anchor="east">
<JLabel id="entryBookSelectorLabel" text="lima.entrybook"/>
</cell>
<cell anchor="west">
Added: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportPeriodSearchPanel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportPeriodSearchPanel.java (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportPeriodSearchPanel.java 2010-08-23 09:35:53 UTC (rev 3014)
@@ -0,0 +1,152 @@
+/* *##% 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.financialstatementreport;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.util.Calendar;
+import java.util.Date;
+import static org.nuiton.i18n.I18n._;
+import javax.swing.JComboBox;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import org.apache.commons.lang.time.DateUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.chorem.lima.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 FinancialStatementReportPeriodSearchPanel extends JPanel {
+
+ private static final Log log =
+ LogFactory.getLog(FinancialStatementReportPeriodSearchPanel.class);
+
+ protected FinancialStatementReportViewHandler handler;
+
+ public FinancialStatementReportPeriodSearchPanel(FinancialStatementReportViewHandler handler) {
+ this.handler = handler;
+
+ //init date
+ refresh(ComboBoxDatesEnum.FISCAL_PERIOD);
+ }
+
+ static final long serialVersionUID = 1L;
+
+ 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.period.begindate"));
+ final JXDatePicker beginDatePicker = new JXDatePicker(beginDate);
+ ActionListener beginDateActionListener = new ActionListener() {
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ handler.model.setBeginDate(beginDatePicker.getDate());
+ handler.refresh();
+ }
+ };
+ handler.model.setBeginDate(beginDatePicker.getDate());
+ beginDatePicker.addActionListener(beginDateActionListener);
+
+ JLabel endDateLabel = new JLabel(_("lima.period.enddate"));
+ final JXDatePicker endDatePicker = new JXDatePicker(endDate);
+ ActionListener endDateActionListener = new ActionListener() {
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ handler.model.setEndDate(endDatePicker.getDate());
+ handler.refresh();
+ }
+ };
+ handler.model.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();
+ 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.model.setBeginDate(fPeriod.getBeginDate());
+ handler.model.setEndDate(fPeriod.getEndDate());
+ handler.refresh();
+ }
+ }
+ };
+ fiscalPeriod.addActionListener(fiscalPeriodActionListener);
+
+ this.removeAll();
+ this.add(fiscalPeriod);
+ break;
+
+ case FINANCIAL_PERIOD:
+ FinancialPeriodComboBoxModel financialModel = new FinancialPeriodComboBoxModel();
+ 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.model.setBeginDate(fPeriod.getBeginDate());
+ handler.model.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/financialtransaction/FinancialTransactionTable.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTable.java 2010-08-22 19:14:52 UTC (rev 3013)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTable.java 2010-08-23 09:35:53 UTC (rev 3014)
@@ -19,25 +19,15 @@
package org.chorem.lima.ui.financialtransaction;
import static org.nuiton.i18n.I18n._;
-
import java.awt.Color;
import java.awt.Component;
-import java.awt.event.FocusEvent;
-import java.awt.event.FocusListener;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
-import java.awt.event.MouseEvent;
-import java.awt.event.MouseListener;
import java.math.BigDecimal;
import java.util.Date;
-import java.util.concurrent.ExecutionException;
-
import javax.swing.SwingWorker;
-import javax.swing.table.TableColumn;
-
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.chorem.lima.business.LimaException;
import org.chorem.lima.entity.Account;
import org.chorem.lima.entity.Entry;
import org.chorem.lima.entity.EntryBook;
@@ -45,7 +35,6 @@
import org.chorem.lima.ui.celleditor.AccountTableCellEditor;
import org.chorem.lima.ui.celleditor.DateTableCellEditor;
import org.chorem.lima.ui.celleditor.EntryBookTableCellEditor;
-import org.chorem.lima.util.DialogHelper;
import org.jdesktop.swingx.JXTable;
import org.jdesktop.swingx.decorator.ColorHighlighter;
import org.jdesktop.swingx.decorator.ComponentAdapter;
Copied: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionPeriodSearchPanel.java (from rev 3007, trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/PeriodSearchPanel.java)
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionPeriodSearchPanel.java (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionPeriodSearchPanel.java 2010-08-23 09:35:53 UTC (rev 3014)
@@ -0,0 +1,169 @@
+/* *##% Lima Swing
+ * Copyright (C) 2008 - 2010 CodeLutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * ##%*/
+
+package org.chorem.lima.ui.financialtransactionsearch;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.util.Calendar;
+import java.util.Date;
+import static org.nuiton.i18n.I18n._;
+import javax.swing.JComboBox;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+
+import org.apache.commons.lang.time.DateUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.chorem.lima.entity.FinancialPeriod;
+import org.chorem.lima.entity.FiscalPeriod;
+import org.chorem.lima.enums.ComboBoxPeriodEnum;
+import org.chorem.lima.ui.combobox.FinancialPeriodComboBoxModel;
+import org.chorem.lima.ui.combobox.FinancialPeriodComboBoxRenderer;
+import org.chorem.lima.ui.combobox.FiscalPeriodComboBoxModel;
+import org.chorem.lima.ui.combobox.FiscalPeriodComboBoxRenderer;
+import org.jdesktop.swingx.JXDatePicker;
+
+public class FinancialTransactionPeriodSearchPanel extends JPanel {
+
+ private static final Log log =
+ LogFactory.getLog(FinancialTransactionPeriodSearchPanel.class);
+
+ protected FinancialTransactionSearchViewHandler handler;
+
+ public FinancialTransactionPeriodSearchPanel(FinancialTransactionSearchViewHandler handler) {
+ this.handler = handler;
+
+ //init date
+ refresh(ComboBoxPeriodEnum.PERIOD);
+ }
+
+ static final long serialVersionUID = 1L;
+
+ public void refresh(ComboBoxPeriodEnum comboBoxPeriodEnum){
+
+ switch (comboBoxPeriodEnum) {
+ case DATE:
+ Calendar calendar = Calendar.getInstance();
+ Date date = calendar.getTime();
+ date = DateUtils.truncate(date, Calendar.DATE);
+ final JXDatePicker datePicker = new JXDatePicker(date);
+ ActionListener dateActionListener = new ActionListener() {
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ handler.setBeginDate(datePicker.getDate());
+ handler.refresh();
+ }
+ };
+ handler.setBeginDate(datePicker.getDate());
+ handler.setEndDate(null);
+ handler.refresh();
+ datePicker.addActionListener(dateActionListener);
+ this.removeAll();
+ this.add(datePicker);
+ break;
+
+ case PERIOD:
+ // get begin date
+ Calendar calendarBegin = Calendar.getInstance();
+ // set begindate to JAN 1 - 0:00.000 of this years
+ Date beginDate = calendarBegin.getTime();
+ beginDate = DateUtils.truncate(beginDate, Calendar.YEAR);
+ //handler().setBeginDate(beginDate);
+
+ // get end date
+ Calendar calendarEnd = Calendar.getInstance();
+ Date endDate = calendarEnd.getTime();
+ //handler().setEndDate(endDate);
+ JLabel beginDateLabel = new JLabel(_("lima.period.begindate"));
+ final JXDatePicker beginDatePicker = new JXDatePicker(beginDate);
+ ActionListener beginDateActionListener = new ActionListener() {
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ handler.setBeginDate(beginDatePicker.getDate());
+ handler.refresh();
+ }
+ };
+ handler.setBeginDate(beginDatePicker.getDate());
+ beginDatePicker.addActionListener(beginDateActionListener);
+
+ JLabel endDateLabel = new JLabel(_("lima.period.enddate"));
+ final JXDatePicker endDatePicker = new JXDatePicker(endDate);
+ ActionListener endDateActionListener = new ActionListener() {
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ handler.setEndDate(endDatePicker.getDate());
+ handler.refresh();
+ }
+ };
+ handler.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();
+ 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();
+ handler.setBeginDate(fPeriod.getBeginDate());
+ handler.setEndDate(fPeriod.getEndDate());
+ handler.refresh();
+ }
+ };
+ fiscalPeriod.addActionListener(fiscalPeriodActionListener);
+
+ this.removeAll();
+ this.add(fiscalPeriod);
+ break;
+
+ case FINANCIAL_PERIOD:
+ FinancialPeriodComboBoxModel financialModel = new FinancialPeriodComboBoxModel();
+ 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();
+ handler.setBeginDate(fPeriod.getBeginDate());
+ handler.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/financialtransactionsearch/FinancialTransactionSearchTable.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchTable.java 2010-08-22 19:14:52 UTC (rev 3013)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchTable.java 2010-08-23 09:35:53 UTC (rev 3014)
@@ -20,8 +20,6 @@
import java.awt.Color;
import java.awt.Component;
-import java.awt.event.KeyEvent;
-import java.awt.event.KeyListener;
import java.math.BigDecimal;
import java.util.Date;
import org.chorem.lima.entity.Account;
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchView.jaxx 2010-08-22 19:14:52 UTC (rev 3013)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchView.jaxx 2010-08-23 09:35:53 UTC (rev 3014)
@@ -30,7 +30,7 @@
AccountSearchPanel accountSearchPanel = new AccountSearchPanel(handler);
AmountSearchPanel amountSearchPanel = new AmountSearchPanel(handler);
EntryBookSearchPanel entryBookSearchPanel = new EntryBookSearchPanel(handler);
- PeriodSearchPanel periodSearchPanel = new PeriodSearchPanel(handler);
+ FinancialTransactionPeriodSearchPanel periodSearchPanel = new FinancialTransactionPeriodSearchPanel(handler);
void $afterCompleteSetup() {
handler.setAmountWayEnum(FinancialStatementWayEnum.valueOfDescription(
@@ -47,7 +47,7 @@
<cell anchor="west"><JComboBox id="periodComboBox" javaBean="new JComboBox(ComboBoxPeriodEnum.descriptions())"
onActionPerformed="periodSearchPanel.refresh(ComboBoxPeriodEnum.valueOfDescription((String) periodComboBox.getSelectedItem()));
validate(); repaint()"/></cell>
- <cell><PeriodSearchPanel javaBean="periodSearchPanel"/></cell>
+ <cell><FinancialTransactionPeriodSearchPanel javaBean="periodSearchPanel"/></cell>
</row></Table></cell>
</row>
<row>
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchViewHandler.java 2010-08-22 19:14:52 UTC (rev 3013)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchViewHandler.java 2010-08-23 09:35:53 UTC (rev 3014)
@@ -18,23 +18,18 @@
package org.chorem.lima.ui.financialtransactionsearch;
-import java.util.ArrayList;
import java.util.Date;
-import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.FinancialStatementWayEnum;
import org.chorem.lima.beans.FinancialTransactionSearch;
import org.chorem.lima.beans.FinancialTransactionSearchImpl;
import org.chorem.lima.business.FinancialTransactionServiceMonitorable;
-import org.chorem.lima.business.LimaException;
import org.chorem.lima.business.ejbinterface.FinancialTransactionService;
import org.chorem.lima.entity.Account;
-import org.chorem.lima.entity.Entry;
import org.chorem.lima.entity.EntryBook;
import org.chorem.lima.service.LimaServiceFactory;
import org.chorem.lima.ui.combobox.FiscalPeriodComboBoxModel;
-import org.chorem.lima.util.ErrorHelper;
/**
* Handler associated with financial transaction view.
Deleted: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/PeriodSearchPanel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/PeriodSearchPanel.java 2010-08-22 19:14:52 UTC (rev 3013)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/PeriodSearchPanel.java 2010-08-23 09:35:53 UTC (rev 3014)
@@ -1,169 +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.financialtransactionsearch;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.util.Calendar;
-import java.util.Date;
-import static org.nuiton.i18n.I18n._;
-import javax.swing.JComboBox;
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-
-import org.apache.commons.lang.time.DateUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.chorem.lima.entity.FinancialPeriod;
-import org.chorem.lima.entity.FiscalPeriod;
-import org.chorem.lima.enums.ComboBoxPeriodEnum;
-import org.chorem.lima.ui.combobox.FinancialPeriodComboBoxModel;
-import org.chorem.lima.ui.combobox.FinancialPeriodComboBoxRenderer;
-import org.chorem.lima.ui.combobox.FiscalPeriodComboBoxModel;
-import org.chorem.lima.ui.combobox.FiscalPeriodComboBoxRenderer;
-import org.jdesktop.swingx.JXDatePicker;
-
-public class PeriodSearchPanel extends JPanel {
-
- private static final Log log =
- LogFactory.getLog(PeriodSearchPanel.class);
-
- protected FinancialTransactionSearchViewHandler handler;
-
- public PeriodSearchPanel(FinancialTransactionSearchViewHandler handler) {
- this.handler = handler;
-
- //init date
- refresh(ComboBoxPeriodEnum.PERIOD);
- }
-
- static final long serialVersionUID = 1L;
-
- public void refresh(ComboBoxPeriodEnum comboBoxPeriodEnum){
-
- switch (comboBoxPeriodEnum) {
- case DATE:
- Calendar calendar = Calendar.getInstance();
- Date date = calendar.getTime();
- date = DateUtils.truncate(date, Calendar.DATE);
- final JXDatePicker datePicker = new JXDatePicker(date);
- ActionListener dateActionListener = new ActionListener() {
- @Override
- public void actionPerformed(ActionEvent e) {
- handler.setBeginDate(datePicker.getDate());
- handler.refresh();
- }
- };
- handler.setBeginDate(datePicker.getDate());
- handler.setEndDate(null);
- handler.refresh();
- datePicker.addActionListener(dateActionListener);
- this.removeAll();
- this.add(datePicker);
- break;
-
- case PERIOD:
- // get begin date
- Calendar calendarBegin = Calendar.getInstance();
- // set begindate to JAN 1 - 0:00.000 of this years
- Date beginDate = calendarBegin.getTime();
- beginDate = DateUtils.truncate(beginDate, Calendar.YEAR);
- //handler().setBeginDate(beginDate);
-
- // get end date
- Calendar calendarEnd = Calendar.getInstance();
- Date endDate = calendarEnd.getTime();
- //handler().setEndDate(endDate);
- JLabel beginDateLabel = new JLabel(_("lima.period.begindate"));
- final JXDatePicker beginDatePicker = new JXDatePicker(beginDate);
- ActionListener beginDateActionListener = new ActionListener() {
- @Override
- public void actionPerformed(ActionEvent e) {
- handler.setBeginDate(beginDatePicker.getDate());
- handler.refresh();
- }
- };
- handler.setBeginDate(beginDatePicker.getDate());
- beginDatePicker.addActionListener(beginDateActionListener);
-
- JLabel endDateLabel = new JLabel(_("lima.period.enddate"));
- final JXDatePicker endDatePicker = new JXDatePicker(endDate);
- ActionListener endDateActionListener = new ActionListener() {
- @Override
- public void actionPerformed(ActionEvent e) {
- handler.setEndDate(endDatePicker.getDate());
- handler.refresh();
- }
- };
- handler.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();
- 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();
- handler.setBeginDate(fPeriod.getBeginDate());
- handler.setEndDate(fPeriod.getEndDate());
- handler.refresh();
- }
- };
- fiscalPeriod.addActionListener(fiscalPeriodActionListener);
-
- this.removeAll();
- this.add(fiscalPeriod);
- break;
-
- case FINANCIAL_PERIOD:
- FinancialPeriodComboBoxModel financialModel = new FinancialPeriodComboBoxModel();
- 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();
- handler.setBeginDate(fPeriod.getBeginDate());
- handler.setEndDate(fPeriod.getEndDate());
- handler.refresh();
- }
- };
- financialPeriod.addActionListener(financialPeriodActionListener);
- this.removeAll();
- this.add(financialPeriod);
- break;
- }
-
- }
-
-}
Added: trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerPeriodSearchPanel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerPeriodSearchPanel.java (rev 0)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerPeriodSearchPanel.java 2010-08-23 09:35:53 UTC (rev 3014)
@@ -0,0 +1,152 @@
+/* *##% 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.ledger;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.util.Calendar;
+import java.util.Date;
+import static org.nuiton.i18n.I18n._;
+import javax.swing.JComboBox;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import org.apache.commons.lang.time.DateUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.chorem.lima.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 LedgerPeriodSearchPanel extends JPanel {
+
+ private static final Log log =
+ LogFactory.getLog(LedgerPeriodSearchPanel.class);
+
+ protected LedgerViewHandler handler;
+
+ public LedgerPeriodSearchPanel(LedgerViewHandler handler) {
+ this.handler = handler;
+
+ //init date
+ refresh(ComboBoxDatesEnum.FISCAL_PERIOD);
+ }
+
+ static final long serialVersionUID = 1L;
+
+ 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.period.begindate"));
+ final JXDatePicker beginDatePicker = new JXDatePicker(beginDate);
+ ActionListener beginDateActionListener = new ActionListener() {
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ handler.setBeginDate(beginDatePicker.getDate());
+ handler.refresh();
+ }
+ };
+ handler.setBeginDate(beginDatePicker.getDate());
+ beginDatePicker.addActionListener(beginDateActionListener);
+
+ JLabel endDateLabel = new JLabel(_("lima.period.enddate"));
+ final JXDatePicker endDatePicker = new JXDatePicker(endDate);
+ ActionListener endDateActionListener = new ActionListener() {
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ handler.setEndDate(endDatePicker.getDate());
+ handler.refresh();
+ }
+ };
+ handler.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();
+ 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.setBeginDate(fPeriod.getBeginDate());
+ handler.setEndDate(fPeriod.getEndDate());
+ handler.refresh();
+ }
+ }
+ };
+ fiscalPeriod.addActionListener(fiscalPeriodActionListener);
+
+ this.removeAll();
+ this.add(fiscalPeriod);
+ break;
+
+ case FINANCIAL_PERIOD:
+ FinancialPeriodComboBoxModel financialModel = new FinancialPeriodComboBoxModel();
+ 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.setBeginDate(fPeriod.getBeginDate());
+ handler.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/ledger/LedgerView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerView.jaxx 2010-08-22 19:14:52 UTC (rev 3013)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerView.jaxx 2010-08-23 09:35:53 UTC (rev 3014)
@@ -22,47 +22,22 @@
<org.chorem.lima.ui.ledger.LedgerTableModel id="modelTable"/>
<script>
<![CDATA[
+ import org.chorem.lima.enums.ComboBoxDatesEnum;
+ LedgerPeriodSearchPanel periodSearchPanel = new LedgerPeriodSearchPanel(handler);
- import org.apache.commons.lang.time.DateUtils;
- import java.util.Calendar;
-
- // 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);
- getHandler().setBeginDate(beginDate);
-
- // get end date
- Calendar calendarEnd = Calendar.getInstance();
- Date endDate = calendarEnd.getTime();
- getHandler().setEndDate(endDate);
-
- getBeginDatePicker().setDate(beginDate);
- getEndDatePicker().setDate(endDate);
-
void $afterCompleteSetup() {
- getHandler().refresh();
}
]]>
</script>
<row weightx="1" weighty="0" anchor="center">
+ <cell fill='both'><Table><row>
+ <cell anchor="west"><JComboBox id="periodComboBox" javaBean="new JComboBox(ComboBoxDatesEnum.descriptions())"
+ onActionPerformed="periodSearchPanel.refresh(ComboBoxDatesEnum.valueOfDescription((String) periodComboBox.getSelectedItem()));
+ validate(); repaint()"/></cell>
+ <cell><LedgerPeriodSearchPanel javaBean="periodSearchPanel"/></cell>
+ </row></Table></cell>
<cell anchor="east">
- <JLabel id="beginCalendarPanelLabel" text="lima.period.begindate"/>
- </cell>
- <cell anchor="west">
- <org.jdesktop.swingx.JXDatePicker id="beginDatePicker"
- onActionPerformed="getHandler().setBeginDate(beginDatePicker.getDate())" />
- </cell>
- <cell anchor="east">
- <JLabel id="endCalendarPanelLabel" text="lima.period.enddate"/>
- </cell>
- <cell anchor="west">
- <org.jdesktop.swingx.JXDatePicker id="endDatePicker"
- onActionPerformed="getHandler().setEndDate(endDatePicker.getDate())"/>
- </cell>
- <cell anchor="east">
<JLabel text="lima.common.filter"/>
</cell>
<cell anchor="west">
Modified: trunk/lima-swing/src/main/resources/i18n/lima-swing-en_GB.properties
===================================================================
--- trunk/lima-swing/src/main/resources/i18n/lima-swing-en_GB.properties 2010-08-22 19:14:52 UTC (rev 3013)
+++ trunk/lima-swing/src/main/resources/i18n/lima-swing-en_GB.properties 2010-08-23 09:35:53 UTC (rev 3014)
@@ -2,12 +2,6 @@
DEBUG\ delete\ all=
Do\ you\ really\ want\ to\ delete\ entry\ book\ %s\ ?=
Global\ lima\ exception=
-LIMA=
-Loading\ accounting...=
-blabla=
-export=
-hello\ world=
-import=
lima.about.message=
lima.account=Account
lima.account.label=Label
@@ -226,6 +220,9 @@
lima.solde=
lima.soldecredit=
lima.soldedebit=
+lima.splash.1=Loading services...
+lima.splash.2="Loading accounting...
+lima.splash.3=Ready \!
lima.structure=Structure
lima.subledger.code=Code
lima.tab.home=Home
@@ -300,4 +297,3 @@
limahome.transaction.unbalanced=
limahome.transactionbalanced=
limahome.transactionunbalanced=
-update=
Modified: trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties
===================================================================
--- trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties 2010-08-22 19:14:52 UTC (rev 3013)
+++ trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties 2010-08-23 09:35:53 UTC (rev 3014)
@@ -2,10 +2,6 @@
DEBUG\ delete\ all=
Do\ you\ really\ want\ to\ delete\ entry\ book\ %s\ ?=
Global\ lima\ exception=
-LIMA=
-Loading\ accounting...=
-export=
-hello\ world=
lima.about.message=\u00C0 propos de Lima
lima.account=Compte
lima.account.label=
@@ -210,6 +206,9 @@
lima.solde=Solde
lima.soldecredit=Solde Cr\u00E9diteur
lima.soldedebit=Solde D\u00E9biteur
+lima.splash.1=Chargement des services...
+lima.splash.2=Chargement de la comptabilit\u00E9
+lima.splash.3=Application pr\u00EAte \!
lima.structure=Structure
lima.subledger.code=Code
lima.tab.home=Accueil
@@ -269,4 +268,3 @@
limahome.transaction.modifiy.unbalanced=Modifier les \u00E9critures incorrect
limahome.transaction.nothing=Aucune \u00E9criture
limahome.transaction.unbalanced=\u00E9critures ne sont pas \u00E9quilibr\u00E9es \!
-update=
Added: trunk/lima-swing/src/main/resources/images/puzzle_splash.png
===================================================================
(Binary files differ)
Property changes on: trunk/lima-swing/src/main/resources/images/puzzle_splash.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
1
0
22 Aug '10
Author: jpepin
Date: 2010-08-22 21:14:52 +0200 (Sun, 22 Aug 2010)
New Revision: 3013
Url: http://chorem.org/repositories/revision/lima/3013
Log:
Fonction recherche des ?\195?\169critures : affichage couple entr?\195?\169es/transactions ?\195?\169ditables
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/HttpServerServiceImpl.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/FinancialTransactionService.java
trunk/lima-callao/src/main/xmi/accounting.zargo
trunk/lima-swing/src/main/assembly/bin.xml
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchTableModel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchViewHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedTableModel.java
trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java 2010-08-21 13:01:48 UTC (rev 3012)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java 2010-08-22 19:14:52 UTC (rev 3013)
@@ -20,12 +20,14 @@
package org.chorem.lima.business.ejb;
import java.math.BigDecimal;
+import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import javax.ejb.Stateless;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.FinancialStatementWayEnum;
+import org.chorem.lima.beans.FinancialTransactionSearch;
import org.chorem.lima.business.AccountingRules;
import org.chorem.lima.business.LimaConfig;
import org.chorem.lima.business.LimaException;
@@ -590,44 +592,48 @@
@Override
- public List<Entry> searchEntry(Date beginDate, Date endDate, String voucher,
- String description, String letter, String accountsList,
- Account account, EntryBook entryBook,
- FinancialStatementWayEnum fStWayEnum, String operator,
- String amount, String amount2) throws LimaException {
- List<Entry> entries = null;
+ public List<Object> searchFinancialTransaction(FinancialTransactionSearch financialTransactionSearch) throws LimaException {
+ List<Object> result = new ArrayList<Object>();
+ List<FinancialTransaction> financialTransactions = null;
TopiaContext topiaContext = null;
try {
topiaContext = beginTransaction();
- EntryDAO entryDAO = LimaCallaoDAOHelper.getEntryDAO(topiaContext);
- TopiaQuery query = entryDAO.createQuery();
- String dateProperty = TopiaQuery.getProperty(Entry.FINANCIAL_TRANSACTION, FinancialTransaction.TRANSACTION_DATE);
- String entryBookProperty = TopiaQuery.getProperty(Entry.FINANCIAL_TRANSACTION, FinancialTransaction.ENTRY_BOOK);
- String entryBookLabelProperty = TopiaQuery.getProperty(Entry.FINANCIAL_TRANSACTION, FinancialTransaction.ENTRY_BOOK, EntryBook.LABEL);
- String accountProperty = TopiaQuery.getProperty(Entry.ACCOUNT, Account.ACCOUNT_NUMBER);
+ FinancialTransactionDAO financialTransactionDAO =
+ LimaCallaoDAOHelper.getFinancialTransactionDAO(topiaContext);
+ TopiaQuery query = financialTransactionDAO.createQuery("T");
+
+ String dateProperty = TopiaQuery.getProperty(FinancialTransaction.TRANSACTION_DATE);
+ String accountNumberProperty = TopiaQuery.getProperty(Entry.ACCOUNT, Account.ACCOUNT_NUMBER);
+ query.addDistinct();
+ query.addLeftJoin("T."+FinancialTransaction.ENTRY, "E", true);
//Load for lazy
- query.addLoad(dateProperty)
- .addLoad(entryBookLabelProperty)
- .addLoad(accountProperty);
+ query.addLoad(FinancialTransaction.FINANCIAL_PERIOD);
+ Date beginDate = financialTransactionSearch.getBeginDate();
+ Date endDate = financialTransactionSearch.getEndDate();
if (beginDate != null && endDate != null){
query.addBetween(dateProperty, beginDate, endDate);
}
else if (beginDate != null){
query.addEquals(dateProperty, beginDate);
}
+ String voucher = financialTransactionSearch.getVoucher();
if (voucher != null){
- query.addWhere(Entry.VOUCHER, Op.LIKE, "%"+voucher+"%");
+ query.addWhere("E.voucher", Op.LIKE, "%"+voucher+"%");
}
+ String description = financialTransactionSearch.getDescription();
if (description != null){
- query.addWhere(Entry.DESCRIPTION, Op.LIKE, "%"+description+"%");
+ query.addWhere("E.description", Op.LIKE, "%"+description+"%");
}
+ String letter = financialTransactionSearch.getLetter();
if (letter != null){
- query.addWhere(Entry.LETTERING, Op.LIKE, "%"+letter+"%");
+ query.addWhere("E.lettering", Op.LIKE, "%"+letter+"%");
}
+ Account account = financialTransactionSearch.getAccount();
+ String accountsList = financialTransactionSearch.getAccountList();
if (account != null){
- query.addEquals(Entry.ACCOUNT, account);
+ query.addEquals("E.account", account);
}
else if (accountsList != null){
AccountDAO accountDAO = LimaCallaoDAOHelper.getAccountDAO(topiaContext);
@@ -642,33 +648,51 @@
}
}
if (accounts.size() > 0){
- query.addWhere(accountProperty + " in (" + accountNumbers + ")");
+ query.addWhere("E."+accountNumberProperty + " in (" + accountNumbers + ")");
}
}
+ EntryBook entryBook = financialTransactionSearch.getEntryBook();
+ String amount = financialTransactionSearch.getAmount();
+ String amount2 = financialTransactionSearch.getAmount2();
+ String operator = financialTransactionSearch.getOperator();
+ FinancialStatementWayEnum fStWayEnum = financialTransactionSearch.getAmountWayEnum();
if (entryBook != null){
- query.addEquals(entryBookProperty, entryBook);
+ query.addEquals("T."+FinancialTransaction.ENTRY_BOOK, entryBook);
}
- else if (amount != null){
+ if (amount != null){
if (amount2 != null){
BigDecimal value1 = new BigDecimal(amount);
BigDecimal value2 = new BigDecimal(amount2);
- query.addBetween(Entry.AMOUNT, value1, value2);
+ query.addBetween("E.amount", value1, value2);
}
else if (operator != null) {
- query.addWhere(Entry.AMOUNT+" "+operator+" "+amount);
+ query.addWhere("E.amount"+" "+operator+" "+amount);
}
switch (fStWayEnum) {
case CREDIT:
- query.addEquals(Entry.DEBIT, false);
+ query.addEquals("E.debit", false);
break;
case DEBIT:
- query.addEquals(Entry.DEBIT, true);
+ query.addEquals("E.debit", true);
break;
}
}
log.debug(query);
- entries = entryDAO.findAllByQuery(query);
+ financialTransactions = financialTransactionDAO.findAllByQuery(query);
+ log.debug(financialTransactions);
+
+ EntryDAO entryDAO = LimaCallaoDAOHelper.getEntryDAO(topiaContext);
+ for (FinancialTransaction financialTransaction : financialTransactions) {
+ result.add(financialTransaction);
+
+ TopiaQuery query2 = entryDAO.createQuery();
+ query2.addEquals(Entry.FINANCIAL_TRANSACTION, financialTransaction);
+ //Load for lazy
+ query2.addLoad(Entry.ACCOUNT);
+ List<Entry> entries = entryDAO.findAllByQuery(query2);
+ result.addAll(entries);
+ }
}
catch (TopiaException ex) {
doCatch(topiaContext, ex, log);
@@ -676,7 +700,7 @@
finally {
doFinally(topiaContext, log);
}
- return entries;
+ return result;
}
protected TopiaContext beginTransaction() throws TopiaException {
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/HttpServerServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/HttpServerServiceImpl.java 2010-08-21 13:01:48 UTC (rev 3012)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/HttpServerServiceImpl.java 2010-08-22 19:14:52 UTC (rev 3013)
@@ -68,7 +68,7 @@
protected int port;
- private static SimpleDateFormat DATEFORMAT = new SimpleDateFormat("yyyy-MM-dd");
+ private static final SimpleDateFormat DATEFORMAT = new SimpleDateFormat("yyyy-MM-dd");
public HttpServerServiceImpl() {
path = LimaConfig.getInstance().getReportsDir();
Modified: 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 2010-08-21 13:01:48 UTC (rev 3012)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialPeriodServiceLocal.java 2010-08-22 19:14:52 UTC (rev 3013)
@@ -41,7 +41,7 @@
public interface FinancialPeriodServiceLocal extends FinancialPeriodService {
void createFinancialPeriodsWithTransaction(List<FinancialPeriod> financialPeriods, TopiaContext topiaContext) throws LimaException;
- public void blockClosedPeriodicEntryBookWithTransaction(ClosedPeriodicEntryBook closedPeriodicEntryBook, TopiaContext topiaContext) throws LimaException;
+ void blockClosedPeriodicEntryBookWithTransaction(ClosedPeriodicEntryBook closedPeriodicEntryBook, TopiaContext topiaContext) throws LimaException;
}
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialTransactionService.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialTransactionService.java 2010-08-21 13:01:48 UTC (rev 3012)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialTransactionService.java 2010-08-22 19:14:52 UTC (rev 3013)
@@ -19,13 +19,10 @@
package org.chorem.lima.business.ejbinterface;
-import java.util.Date;
import java.util.List;
-import java.util.Set;
import javax.ejb.Remote;
-import org.chorem.lima.FinancialStatementWayEnum;
+import org.chorem.lima.beans.FinancialTransactionSearch;
import org.chorem.lima.business.LimaException;
-import org.chorem.lima.entity.Account;
import org.chorem.lima.entity.Entry;
import org.chorem.lima.entity.EntryBook;
import org.chorem.lima.entity.FinancialPeriod;
@@ -82,5 +79,5 @@
void removeEntry(Entry entry) throws LimaException;
- List<Entry> searchEntry(Date beginDate, Date endDate, String voucher, String description, String letter, String accountsList, Account account, EntryBook entryBook, FinancialStatementWayEnum fStWayEnum, String operator, String amount, String amount2) throws LimaException;
+ List<Object> searchFinancialTransaction(FinancialTransactionSearch financialTransactionSearch) throws LimaException;
}
Modified: trunk/lima-callao/src/main/xmi/accounting.zargo
===================================================================
(Binary files differ)
Modified: trunk/lima-swing/src/main/assembly/bin.xml
===================================================================
--- trunk/lima-swing/src/main/assembly/bin.xml 2010-08-21 13:01:48 UTC (rev 3012)
+++ trunk/lima-swing/src/main/assembly/bin.xml 2010-08-22 19:14:52 UTC (rev 3013)
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<assembly xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/assembly-1.1.1.xsd">
+<assembly xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/assembly-1.1.1.xsd">
<id>bin</id>
<formats>
<format>zip</format>
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchTableModel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchTableModel.java 2010-08-21 13:01:48 UTC (rev 3012)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchTableModel.java 2010-08-22 19:14:52 UTC (rev 3013)
@@ -19,21 +19,16 @@
package org.chorem.lima.ui.financialtransactionsearch;
import static org.nuiton.i18n.I18n._;
-
import java.math.BigDecimal;
-import java.util.ArrayList;
-import java.util.Collections;
import java.util.Date;
import java.util.List;
-import java.util.Set;
-
import javax.swing.table.AbstractTableModel;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.chorem.lima.beans.FinancialTransactionSearch;
import org.chorem.lima.business.FinancialTransactionServiceMonitorable;
import org.chorem.lima.business.LimaException;
-import org.chorem.lima.business.ejbinterface.FinancialTransactionService;
-import org.chorem.lima.business.utils.EntryComparator;
+import org.chorem.lima.business.ServiceListener;
import org.chorem.lima.entity.Account;
import org.chorem.lima.entity.Entry;
import org.chorem.lima.entity.EntryBook;
@@ -57,8 +52,7 @@
* Last update : $Date: 2010-05-14 13:22:26 +0200 (ven. 14 mai 2010) $
* By : $Author: jpepin $
*/
-public class FinancialTransactionSearchTableModel extends AbstractTableModel {
-
+public class FinancialTransactionSearchTableModel extends AbstractTableModel implements ServiceListener{
/** serialVersionUID. */
private static final long serialVersionUID = 3914954536809622358L;
@@ -67,15 +61,67 @@
private static final Log log = LogFactory
.getLog(FinancialTransactionSearchTableModel.class);
+ /** Transaction service. */
+ protected final FinancialTransactionServiceMonitorable financialTransactionService;
+ /** selected financial period */
+ protected FiscalPeriod selectedFiscalPeriod;
+
/** data cache */
- protected List<Entry> cacheDataList;
+ protected FinancialTransactionSearch financialTransactionSearch;
+ protected List<Object> cacheDataList;
+
- public void refresh(List<Entry> objects){
- cacheDataList = objects;
+ /**
+ * Model constructor.
+ *
+ * Just init service proxies.
+ */
+ public FinancialTransactionSearchTableModel() {
+ /* Services */
+ financialTransactionService =
+ LimaServiceFactory.getInstance().getService(
+ FinancialTransactionServiceMonitorable.class);
+ financialTransactionService.addListener(this);
+ }
+
+ /**
+ * Le model est une combinaison de Transaction/Entries.
+ *
+ *
+ * @return
+ */
+ protected List<Object> getDataList(FinancialTransactionSearch financialTransactionSearch) {
+ List<Object> results = null;
+ //prevent to much result
+ if (financialTransactionSearch != null && (financialTransactionSearch.getVoucher() != null || financialTransactionSearch.getDescription() != null
+ || financialTransactionSearch.getLetter() != null || financialTransactionSearch.getAccountList() != null
+ || financialTransactionSearch.getAccount() != null || financialTransactionSearch.getEntryBook() != null
+ || (financialTransactionSearch.getAmount() != null && financialTransactionSearch.getOperator() != null)
+ || (financialTransactionSearch.getAmount() != null && financialTransactionSearch.getAmount2() != null))){
+ try {
+ results = financialTransactionService.searchFinancialTransaction(financialTransactionSearch);
+ }
+ catch (LimaException eee) {
+ if (log.isErrorEnabled()) {
+ log.debug("Can't update model", eee);
+ }
+
+ ErrorHelper.showErrorDialog("Can't get transaction list", eee);
+ }
+ }
+
+ return results;
+ }
+
+
+ protected void refresh(FinancialTransactionSearch financialTransactionSearch) {
+ this.financialTransactionSearch = financialTransactionSearch;
+ cacheDataList = getDataList(financialTransactionSearch);
fireTableDataChanged();
}
+
@Override
public int getColumnCount() {
return 9;
@@ -174,67 +220,253 @@
// just prevent too much result
if (cacheDataList != null) {
- Entry currentRow = cacheDataList.get(row);
-
+ result = cacheDataList.get(row);
+
+ if (result instanceof FinancialTransaction) {
+ FinancialTransaction currentRow = (FinancialTransaction)result;
+ BigDecimal amountDebit = currentRow.getAmountDebit();
+ BigDecimal amountCredit = currentRow.getAmountCredit();
+
switch (column) {
case 0:
- result = currentRow.getFinancialTransaction().getTransactionDate();
+ result = currentRow.getTransactionDate();
break;
case 1:
- EntryBook entryBook =
- currentRow.getFinancialTransaction().getEntryBook();
- if (entryBook != null){
- result = entryBook.getCode();
+ if (currentRow.getEntryBook() != null){
+ result = currentRow.getEntryBook().getCode();
}
else {
result = null;
}
break;
case 2:
- result = currentRow.getVoucher();
+ result = null; //entrybook
break;
+ case 3:
+ result = null; // account
+ break;
+ case 4:
+ result = null; // description
+ break;
+ case 5 :
+ result = amountDebit;
+ break;
+ case 6:
+ result = amountCredit;
+ break;
+ case 7:
+ result = amountDebit.subtract(amountCredit);
+ break;
+ case 8:
+ result = null;
+ break;
+ }
+ }
+ else if (result instanceof Entry) {
+ Entry currentEntry = (Entry)result;
+ switch (column) {
+ case 0:
+ result = null; // date
+ break;
+ case 1 : // entry book
+ result = null;
+ break;
+ case 2:
+ result = currentEntry.getVoucher();
+ break;
case 3: // account
- Account account = currentRow.getAccount();
- if (account != null){
- result = account.getAccountNumber();
+ if (currentEntry.getAccount() != null){
+ result = currentEntry.getAccount().getAccountNumber();
}
else {
result = null;
}
break;
case 4:
- result = currentRow.getDescription();
+ result = currentEntry.getDescription();
break;
case 5 :
- result = currentRow.getDebit() ? currentRow.getAmount() : 0;
+ result = currentEntry.getDebit() ? currentEntry.getAmount() : 0;
break;
case 6:
- result = currentRow.getDebit() ? 0 : currentRow.getAmount();
+ result = currentEntry.getDebit() ? 0 : currentEntry.getAmount();
break;
case 7:
- result = null; // balance
+ result = null;
break;
case 8:
- result = currentRow.getLettering();
+ result = currentEntry.getLettering();
break;
}
}
+ }
return result;
}
+ public void setFiscalPeriod(FiscalPeriod fiscalPeriod){
+ selectedFiscalPeriod = fiscalPeriod;
+ }
+ /**
+ * To set cells editable or not
+ * different condition for entry or financial transaction
+ */
@Override
public boolean isCellEditable(int rowIndex, int columnIndex) {
-
- return false;
+ boolean editableCell=false;
+ Object currentRow = cacheDataList.get(rowIndex);
+ // cells editable for the entry row, all cells exclude the date
+ if ((currentRow instanceof Entry) && !((columnIndex==0) || (columnIndex==1))) {
+ editableCell=true;
+ }
+ // cells editable for the financialtransaction row, no cells exclude the date
+ if ((currentRow instanceof FinancialTransaction) && ((columnIndex==0) || (columnIndex==1))){
+ editableCell=true;
+ }
+ return editableCell;
}
+
+ /**
+ * @throws LimaException
+ */
+ public void addEmptyEntry(Object value, int row) throws LimaException {
+ FinancialTransaction currentTransaction = null;
+ Object currentRow = cacheDataList.get(row);
+ Entry entry = new EntryImpl();
+ entry.setAmount(new BigDecimal(0));
+ //check if current row is a transaction or an entry
+ if (currentRow instanceof FinancialTransaction) {
+ currentTransaction = (FinancialTransaction)currentRow;
+ }
+ else if (currentRow instanceof Entry) {
+ Entry currentEntry = (Entry)currentRow;
+ //get back the parent transaction of the entry
+ currentTransaction = currentEntry.getFinancialTransaction();
+ }
+ //create it
+ entry.setFinancialTransaction(currentTransaction);
+ financialTransactionService.createEntry(entry);
+ //on recharge la liste
+ cacheDataList = getDataList(financialTransactionSearch);
+ fireTableDataChanged();
+ }
+
+ /**
+ * to modifiy financialtransaction or entry
+ */
+ @Override
+ public void setValueAt(Object value, int row, int column) {
+ int financialTransactionRow = 0;
+ // just prevent too much result
+ Object currentRow = cacheDataList.get(row);
+ if (currentRow instanceof FinancialTransaction) {
+ FinancialTransaction currentFinancialTransaction =
+ (FinancialTransaction)currentRow;
+ switch (column) {
+ case 0:
+ //update
+ currentFinancialTransaction.setTransactionDate((Date)value);
+ break;
+ case 1 :
+ currentFinancialTransaction.setEntryBook((EntryBook)value);
+ break;
+ }
+ // notify service for modification
+ try {
+ financialTransactionService.
+ updateFinancialTransaction(currentFinancialTransaction);
+ } catch (LimaException eee) {
+ if (log.isDebugEnabled()){
+ log.debug("Can't update financial transaction", eee);
+ }
+ DialogHelper.showMessageDialog(eee.getMessage());
+ }
+ //update the financial transaction in entire
+ financialTransactionRow =
+ cacheDataList.indexOf(((FinancialTransaction) currentRow));
+ }
+ else if (currentRow instanceof Entry) {
+ Entry currentEntry = (Entry)currentRow;
+ switch (column) {
+ case 2 :
+ currentEntry.setVoucher((String)value);
+ break;
+ case 3:
+ currentEntry.setAccount((Account)value);
+ break;
+ case 4:
+ currentEntry.setDescription((String)value);
+ break;
+ case 5 :
+ currentEntry.setAmount((BigDecimal)value);
+ currentEntry.setDebit(true);
+ break;
+ case 6:
+ currentEntry.setAmount((BigDecimal)value);
+ currentEntry.setDebit(false);
+ break;
+ case 8:
+ currentEntry.setLettering((String)value);
+ break;
+ }
+ try {
+ financialTransactionService.updateEntry(currentEntry);
+ } catch (LimaException eee) {
+ if (log.isDebugEnabled()){
+ log.debug("Can't update entry", eee);
+ }
+ DialogHelper.showMessageDialog(eee.getMessage());
+ }
+ //update the financial transaction in entire
+ financialTransactionRow =
+ cacheDataList.indexOf(((Entry) currentRow).
+ getFinancialTransaction());
+ }
+ //on recharge la liste
+ cacheDataList = getDataList(financialTransactionSearch);
+ fireTableDataChanged();
+ }
+
public Object getElementAt(int row){
-
Object currentRow = cacheDataList.get(row);
return currentRow;
}
-
+
+
+ /**
+ * Delete selected row in table (could be transaction or entry).
+ *
+ * Called by model.
+ * @param Object, int
+ * @throws LimaException
+ */
+ public void removeObject(Object object, int row) throws LimaException {
+ Object currentRow = cacheDataList.get(row);
+ if (currentRow instanceof FinancialTransaction) {
+ FinancialTransaction currentTransaction =
+ (FinancialTransaction)currentRow;
+ financialTransactionService.removeFinancialTransaction(currentTransaction);
+ }
+ else if (currentRow instanceof Entry) {
+ Entry currentEntry = (Entry)currentRow;
+ financialTransactionService.removeEntry(currentEntry);
+ }
+ //on recharge la liste
+ cacheDataList = getDataList(financialTransactionSearch);
+ fireTableDataChanged();
+ }
+
+ @Override
+ public void notifyMethod(String serviceName, String methodeName) {
+ if ((serviceName.contains("FinancialTransaction") || methodeName.contains("importEntries")
+ || methodeName.contains("importAll")) && !methodeName.contains("search")){
+ //on recharge la liste
+ cacheDataList = getDataList(financialTransactionSearch);
+ fireTableDataChanged();
+ }
+ }
+
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchViewHandler.java 2010-08-21 13:01:48 UTC (rev 3012)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchViewHandler.java 2010-08-22 19:14:52 UTC (rev 3013)
@@ -18,11 +18,14 @@
package org.chorem.lima.ui.financialtransactionsearch;
+import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.FinancialStatementWayEnum;
+import org.chorem.lima.beans.FinancialTransactionSearch;
+import org.chorem.lima.beans.FinancialTransactionSearchImpl;
import org.chorem.lima.business.FinancialTransactionServiceMonitorable;
import org.chorem.lima.business.LimaException;
import org.chorem.lima.business.ejbinterface.FinancialTransactionService;
@@ -59,19 +62,8 @@
/** Transaction service. */
protected final FinancialTransactionService financialTransactionService;
- protected Date beginDate;
- protected Date endDate;
- protected String voucher;
- protected String description;
- protected String letter;
- protected String accountsList;
- protected Account account;
- protected EntryBook entryBook;
- protected FinancialStatementWayEnum amountWayEnum;
- protected String operator;
- protected String amount;
- protected String amount2;
-
+ /** data cache */
+ protected FinancialTransactionSearch financialTransactionSearch;
protected FinancialTransactionSearchViewHandler(FinancialTransactionSearchView view) {
this.view = view;
@@ -80,14 +72,17 @@
financialTransactionService =
LimaServiceFactory.getInstance().getService(
FinancialTransactionServiceMonitorable.class);
+
+ financialTransactionSearch = new FinancialTransactionSearchImpl();
+
}
public void setBeginDate(Date beginDate){
- this.beginDate = beginDate;
+ financialTransactionSearch.setBeginDate(beginDate);
}
public void setEndDate(Date endDate){
- this.endDate = endDate;
+ financialTransactionSearch.setEndDate(endDate);
}
public void setVoucher(String voucher){
@@ -96,7 +91,7 @@
if (!voucher.equals("")){
result = voucher;
}
- this.voucher=result;
+ financialTransactionSearch.setVoucher(result);
}
public void setDescription(String description){
@@ -104,7 +99,7 @@
if (!description.equals("")){
result = description;
}
- this.description=result;
+ financialTransactionSearch.setDescription(result);
}
public void setLetter(String letter){
@@ -112,11 +107,11 @@
if (!letter.equals("")){
result = letter;
}
- this.letter=result;
+ financialTransactionSearch.setLetter(result);
}
public String getAccountsList(){
- return this.accountsList;
+ return financialTransactionSearch.getAccountList();
}
public void setAccountsList(String accountsList){
@@ -124,24 +119,24 @@
if (!accountsList.equals("")){
result = accountsList;
}
- this.accountsList=result;
+ financialTransactionSearch.setAccountList(result);
}
public Account getAccount(){
- return this.account;
+ return financialTransactionSearch.getAccount();
}
public void setAccount(Account account){
- this.account=account;
+ financialTransactionSearch.setAccount(account);
}
public void setEntryBook(EntryBook entryBook){
- this.entryBook=entryBook;
+ financialTransactionSearch.setEntryBook(entryBook);
}
public String getAmount(){
- return this.amount;
+ return financialTransactionSearch.getAmount();
}
public void setAmount(String amount){
@@ -149,11 +144,11 @@
if (!amount.equals("")){
result = amount;
}
- this.amount=result;
+ financialTransactionSearch.setAmount(result);
}
public String getAmount2(){
- return this.amount2;
+ return financialTransactionSearch.getAmount2();
}
public void setAmount2(String amount2){
@@ -161,11 +156,11 @@
if (!amount2.equals("")){
result = amount2;
}
- this.amount2=result;
+ financialTransactionSearch.setAmount2(result);
}
public void setAmountWayEnum(FinancialStatementWayEnum amountWayEnum){
- this.amountWayEnum=amountWayEnum;
+ financialTransactionSearch.setAmountWayEnum(amountWayEnum);
}
public void setOperator(String operator){
@@ -173,39 +168,15 @@
if (!operator.equals("")){
result = operator;
}
- this.operator=result;
+ financialTransactionSearch.setOperator(result);
}
-
+
+
public void refresh(){
tableModel = view.getFinancialTransactionSearchTableModel();
if (tableModel != null){
- log.debug(voucher+" "
- +description+" "+letter+" "+accountsList+" "
- +account+" "+entryBook+" "+amount);
- tableModel.refresh(getDataList());
+ tableModel.refresh(financialTransactionSearch);
}
}
- protected List<Entry> getDataList() {
- List<Entry> results = null;
- //prevent to much result
- if (voucher != null || description != null || letter != null ||
- accountsList != null || account != null || entryBook != null ||
- (amount != null && operator != null) || (amount != null && amount2 != null)){
- try {
- results = financialTransactionService.searchEntry(beginDate, endDate,
- voucher, description, letter, accountsList, account,
- entryBook, amountWayEnum, operator, amount, amount2);
-
- }
- catch (LimaException eee) {
- if (log.isErrorEnabled()) {
- log.debug("Can't update model", eee);
- }
- ErrorHelper.showErrorDialog("Can't get transaction list", eee);
- }
- }
- return results;
- }
-
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedTableModel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedTableModel.java 2010-08-21 13:01:48 UTC (rev 3012)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedTableModel.java 2010-08-22 19:14:52 UTC (rev 3013)
@@ -19,20 +19,17 @@
package org.chorem.lima.ui.financialtransactionunbalanced;
import static org.nuiton.i18n.I18n._;
-
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.List;
-import java.util.Set;
-
import javax.swing.table.AbstractTableModel;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.business.FinancialTransactionServiceMonitorable;
import org.chorem.lima.business.LimaException;
-import org.chorem.lima.business.ejbinterface.FinancialTransactionService;
+import org.chorem.lima.business.ServiceListener;
import org.chorem.lima.business.utils.EntryComparator;
import org.chorem.lima.entity.Account;
import org.chorem.lima.entity.Entry;
@@ -57,7 +54,7 @@
* Last update : $Date: 2010-05-14 13:22:26 +0200 (ven. 14 mai 2010) $
* By : $Author: jpepin $
*/
-public class FinancialTransactionUnbalancedTableModel extends AbstractTableModel {
+public class FinancialTransactionUnbalancedTableModel extends AbstractTableModel implements ServiceListener{
/** serialVersionUID. */
private static final long serialVersionUID = 3914954536809622358L;
@@ -67,7 +64,7 @@
.getLog(FinancialTransactionUnbalancedTableModel.class);
/** Transaction service. */
- protected final FinancialTransactionService financialTransactionService;
+ protected final FinancialTransactionServiceMonitorable financialTransactionService;
/** selected financial period */
protected FiscalPeriod selectedFiscalPeriod;
@@ -88,6 +85,7 @@
financialTransactionService =
LimaServiceFactory.getInstance().getService(
FinancialTransactionServiceMonitorable.class);
+ financialTransactionService.addListener(this);
}
/**
@@ -430,8 +428,8 @@
getFinancialTransaction());
}
//on recharge la liste
- //TODO PEPIN 20100607 Get financial transaction of cachedatelist on replace it
- fireTableRowsUpdated(financialTransactionRow, getRowCount()-1);
+ cacheDataList = getDataList();
+ fireTableDataChanged();
}
}
@@ -464,4 +462,10 @@
refresh();
}
+ @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/resources/i18n/lima-swing-fr_FR.properties
===================================================================
--- trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties 2010-08-21 13:01:48 UTC (rev 3012)
+++ trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties 2010-08-22 19:14:52 UTC (rev 3013)
@@ -10,6 +10,8 @@
lima.account=Compte
lima.account.label=
lima.account.number=
+lima.accountsreports.begincalendar=
+lima.accountsreports.endcalendar=
lima.action.commandline.help=Afficher l'aide en console
lima.action.fullscreen=Plein Ecran
lima.action.fullscreen.tip=Passer en mode plein \u00E9cran
1
0
r3012 - in trunk/lima-swing/src/main: java/org/chorem/lima/ui/balance java/org/chorem/lima/ui/financialtransactionsearch java/org/chorem/lima/ui/ledger resources/i18n
by jpepin@users.chorem.org 21 Aug '10
by jpepin@users.chorem.org 21 Aug '10
21 Aug '10
Author: jpepin
Date: 2010-08-21 15:01:48 +0200 (Sat, 21 Aug 2010)
New Revision: 3012
Url: http://chorem.org/repositories/revision/lima/3012
Log:
Modification UI recherche d'?\195?\169criture.
Retouche UI balance et grand-journal.
Removed:
trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceFilterTextField.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerFilterTextField.java
Modified:
trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/AccountSearchComboBox.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/AccountSearchPanel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/AmountSearchPanel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/EntryBookSearchComboBox.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/EntryBookSearchPanel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchView.jaxx
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchViewHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerView.jaxx
trunk/lima-swing/src/main/resources/i18n/lima-swing-en_GB.properties
trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties
Deleted: trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceFilterTextField.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceFilterTextField.java 2010-08-21 11:51:36 UTC (rev 3011)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceFilterTextField.java 2010-08-21 13:01:48 UTC (rev 3012)
@@ -1,56 +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 Lesser General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
- *
- * You should have received a copy of the GNU General Lesser Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/lgpl-3.0.html>. ##%*
- */
-
-package org.chorem.lima.ui.balance;
-
-import java.awt.event.KeyEvent;
-import java.awt.event.KeyListener;
-import javax.swing.JTextField;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-public class BalanceFilterTextField extends JTextField implements KeyListener {
-
- private static final long serialVersionUID = 1L;
-
- private static final Log log =
- LogFactory.getLog(BalanceFilterTextField.class);
-
- protected BalanceViewHandler handler;
-
- public BalanceFilterTextField(BalanceViewHandler handler) {
- this.handler = handler;
- addKeyListener(this);
- }
-
- @Override
- public void keyPressed(KeyEvent e) {
- }
-
- @Override
- public void keyReleased(KeyEvent e) {
- handler.setAccountFilter(getText());
- }
-
- @Override
- public void keyTyped(KeyEvent e) {
-
- }
-
-}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceView.jaxx 2010-08-21 11:51:36 UTC (rev 3011)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceView.jaxx 2010-08-21 13:01:48 UTC (rev 3012)
@@ -50,27 +50,30 @@
</script>
<row weightx="1" weighty="0" anchor="center">
<cell anchor="east">
- <JLabel id="beginCalendarPanelLabel" text="lima.accountsreports.begincalendar"/>
+ <JLabel id="beginCalendarPanelLabel" text="lima.period.begindate"/>
</cell>
<cell anchor="west">
<org.jdesktop.swingx.JXDatePicker id="beginDatePicker"
onActionPerformed="getHandler().setBeginDate(beginDatePicker.getDate())"/>
</cell>
<cell anchor="east">
- <JLabel id="endCalendarPanelLabel" text="lima.accountsreports.endcalendar"/>
+ <JLabel id="endCalendarPanelLabel" text="lima.period.enddate"/>
</cell>
<cell anchor="west">
<org.jdesktop.swingx.JXDatePicker id="endDatePicker"
onActionPerformed="getHandler().setEndDate(endDatePicker.getDate())"/>
</cell>
<cell anchor="east">
- <JLabel text="lima.accountsreports.accountfilter"/>
+ <JLabel text="lima.common.filter"/>
</cell>
<cell anchor="west">
- <JTextField javaBean="new org.chorem.lima.ui.balance.BalanceFilterTextField(getHandler())"/>
+ <JTextField id='balanceFilter' minimumSize='{balanceFilter.getPreferredSize()}'/>
+ <javax.swing.text.Document javaBean="balanceFilter.getDocument()"
+ onInsertUpdate='handler.setAccountFilter(balanceFilter.getText())'
+ onRemoveUpdate='handler.setAccountFilter(balanceFilter.getText())' />
</cell>
<cell anchor="center">
- <JCheckBox id='movmentedFilter' text='lima.accountsreports.movmentedfilter' selected='false'
+ <JCheckBox id='movmentedFilter' text='lima.common.movmentedfilter' selected='false'
onActionPerformed="getHandler().refresh()"/>
</cell>
<cell>
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/AccountSearchComboBox.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/AccountSearchComboBox.java 2010-08-21 11:51:36 UTC (rev 3011)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/AccountSearchComboBox.java 2010-08-21 13:01:48 UTC (rev 3012)
@@ -59,7 +59,6 @@
Object object = this.getSelectedItem();
if (object instanceof Account){
handler.setAccount((Account) this.getSelectedItem());
- handler.refresh();
}
}
@@ -77,7 +76,6 @@
//to prevent useless call to service
if (!account.equals(handler.getAccount())){
handler.setAccount(account);
- handler.refresh();
}
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/AccountSearchPanel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/AccountSearchPanel.java 2010-08-21 11:51:36 UTC (rev 3011)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/AccountSearchPanel.java 2010-08-21 13:01:48 UTC (rev 3012)
@@ -54,6 +54,7 @@
case ACCOUNT_LIST:
final JTextField accountsList = new JTextField(16);
+ accountsList.setMinimumSize(accountsList.getPreferredSize());
KeyListener accountsListKeyListener = new KeyListener() {
@Override
@@ -66,7 +67,6 @@
//to prevent useless call to service
if (!accounts.equals(handler.getAccountsList())){
handler.setAccountsList(accounts);
- handler.refresh();
}
}
@@ -77,7 +77,6 @@
accountsList.addKeyListener(accountsListKeyListener);
handler.setAccountsList(accountsList.getText());
handler.setAccount(null);
- handler.refresh();
this.removeAll();
this.add(accountsList);
break;
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/AmountSearchPanel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/AmountSearchPanel.java 2010-08-21 11:51:36 UTC (rev 3011)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/AmountSearchPanel.java 2010-08-21 13:01:48 UTC (rev 3012)
@@ -38,6 +38,7 @@
public void refresh(ComboBoxOperatorsEnum enums){
final JTextField amountTextField = new JTextField(16);
+ amountTextField.setMinimumSize(amountTextField.getPreferredSize());
KeyListener amountKeyListener = new KeyListener() {
@Override
@@ -50,7 +51,6 @@
//to prevent useless call to service
if (!amount.equals(handler.getAmount())){
handler.setAmount(amount);
- handler.refresh();
}
}
@@ -61,12 +61,14 @@
amountTextField.addKeyListener(amountKeyListener);
handler.setAmount2("");
handler.setOperator(enums.getSymbol());
+ handler.refresh();
this.removeAll();
this.add(amountTextField);
switch (enums) {
case INTERVAL:
final JTextField amount2TextField = new JTextField(16);
+ amount2TextField.setMinimumSize(amount2TextField.getPreferredSize());
KeyListener amount2KeyListener = new KeyListener() {
@Override
@@ -80,7 +82,6 @@
//to prevent useless call to service
if (!amount2.equals(handler.getAmount2())){
handler.setAmount2(amount2);
- handler.refresh();
}
}
@@ -93,9 +94,7 @@
this.add(amount2TextField);
break;
}
- amountTextField.setText(handler.getAmount());
- handler.refresh();
-
+ amountTextField.setText(handler.getAmount());
}
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/EntryBookSearchComboBox.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/EntryBookSearchComboBox.java 2010-08-21 11:51:36 UTC (rev 3011)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/EntryBookSearchComboBox.java 2010-08-21 13:01:48 UTC (rev 3012)
@@ -59,7 +59,6 @@
Object object = this.getSelectedItem();
if (object instanceof EntryBook){
handler.setEntryBook((EntryBook) this.getSelectedItem());
- handler.refresh();
}
}
@@ -74,7 +73,6 @@
Object object = this.getSelectedItem();
if (object instanceof EntryBook){
handler.setEntryBook((EntryBook) this.getSelectedItem());
- handler.refresh();
}
// delegate popup list menu
if ( e.getKeyChar() == KeyEvent.VK_ENTER )
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/EntryBookSearchPanel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/EntryBookSearchPanel.java 2010-08-21 11:51:36 UTC (rev 3011)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/EntryBookSearchPanel.java 2010-08-21 13:01:48 UTC (rev 3012)
@@ -37,14 +37,12 @@
case SELECT_ONE:
EntryBookSearchComboBox entryBookSearchComboBox = new EntryBookSearchComboBox(handler);
handler.setEntryBook(null);
- handler.refresh();
this.removeAll();
this.add(entryBookSearchComboBox);
break;
case ALL:
handler.setEntryBook(null);
- handler.refresh();
this.removeAll();
break;
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchView.jaxx 2010-08-21 11:51:36 UTC (rev 3011)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchView.jaxx 2010-08-21 13:01:48 UTC (rev 3012)
@@ -18,6 +18,7 @@
<Table>
<FinancialTransactionSearchViewHandler id="handler" javaBean="new FinancialTransactionSearchViewHandler(this)" />
<Boolean id="selectedRow" javaBean="false" />
+ <java.awt.Dimension id="fieldSize" javaBean="new java.awt.Dimension()" />
<script>
<![CDATA[
import org.chorem.lima.enums.ComboBoxPeriodEnum;
@@ -32,7 +33,6 @@
PeriodSearchPanel periodSearchPanel = new PeriodSearchPanel(handler);
void $afterCompleteSetup() {
- handler.init();
handler.setAmountWayEnum(FinancialStatementWayEnum.valueOfDescription(
(String) getAmountComboBox().getSelectedItem()));
handler.setOperator(ComboBoxOperatorsEnum.valueOfDescription(
@@ -43,7 +43,7 @@
</script>
<row>
- <cell><Table><row>
+ <cell fill='both'><Table><row>
<cell anchor="west"><JComboBox id="periodComboBox" javaBean="new JComboBox(ComboBoxPeriodEnum.descriptions())"
onActionPerformed="periodSearchPanel.refresh(ComboBoxPeriodEnum.valueOfDescription((String) periodComboBox.getSelectedItem()));
validate(); repaint()"/></cell>
@@ -51,17 +51,29 @@
</row></Table></cell>
</row>
<row>
- <cell><Table><row>
+ <cell fill='both'><Table><row>
<cell><JLabel text="lima.table.voucher"/></cell>
- <cell><JTextField id='voucher'/></cell>
+ <cell><JTextField id='voucher' minimumSize="{voucher.getPreferredSize()}"/>
+ <javax.swing.text.Document javaBean="voucher.getDocument()"
+ onInsertUpdate='handler.setVoucher(voucher.getText())'
+ onRemoveUpdate='handler.setVoucher(voucher.getText())' />
+ </cell>
<cell><JLabel text="lima.table.description"/></cell>
- <cell><JTextField id='description'/></cell>
+ <cell><JTextField id='description' minimumSize='{description.getPreferredSize()}'/>
+ <javax.swing.text.Document javaBean="description.getDocument()"
+ onInsertUpdate='handler.setDescription(description.getText())'
+ onRemoveUpdate='handler.setDescription(description.getText())' />
+ </cell>
<cell><JLabel text="lima.table.letter"/></cell>
- <cell><JTextField id='letter'/></cell>
+ <cell><JTextField id='letter' minimumSize='{letter.getPreferredSize()}'/>
+ <javax.swing.text.Document javaBean="letter.getDocument()"
+ onInsertUpdate='handler.setLetter(letter.getText())'
+ onRemoveUpdate='handler.setLetter(letter.getText())' />
+ </cell>
</row></Table></cell>
</row>
<row>
- <cell><Table><row>
+ <cell fill='both'><Table><row>
<cell><JComboBox id="accountComboBox" javaBean="new JComboBox(ComboBoxAccountsEnum.descriptions())"
onActionPerformed="accountSearchPanel.refresh(ComboBoxAccountsEnum.valueOfDescription((String) accountComboBox.getSelectedItem()));
validate(); repaint()"/></cell>
@@ -73,7 +85,7 @@
</row></Table></cell>
</row>
<row>
- <cell><Table><row>
+ <cell fill='both'><Table><row>
<cell><JLabel text="lima.amount"/></cell>
<cell><JComboBox id="amountComboBox" javaBean="new JComboBox(FinancialStatementWayEnum.descriptions())"
onActionPerformed="handler.setAmountWayEnum(FinancialStatementWayEnum.valueOfDescription((String)amountComboBox.getSelectedItem()));
@@ -85,6 +97,9 @@
</row></Table></cell>
</row>
<row>
+ <cell><JButton id="validSearch" text='lima.common.search' onActionPerformed="handler.refresh()"/></cell>
+ </row>
+ <row>
<cell fill="both" weightx="1" weighty="1">
<JScrollPane>
<org.chorem.lima.ui.financialtransactionsearch.FinancialTransactionSearchTableModel
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchViewHandler.java 2010-08-21 11:51:36 UTC (rev 3011)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchViewHandler.java 2010-08-21 13:01:48 UTC (rev 3012)
@@ -1,4 +1,4 @@
-/* *##% Lima Swing
+ /* *##% Lima Swing
* Copyright (C) 2008 - 2010 CodeLutin
*
* This program is free software; you can redistribute it and/or
@@ -18,12 +18,8 @@
package org.chorem.lima.ui.financialtransactionsearch;
-import static org.nuiton.i18n.I18n._;
-import java.awt.event.KeyEvent;
-import java.awt.event.KeyListener;
import java.util.Date;
import java.util.List;
-import javax.swing.JTextField;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.FinancialStatementWayEnum;
@@ -86,85 +82,16 @@
FinancialTransactionServiceMonitorable.class);
}
- public void init(){
-
- final JTextField descriptionTextField = view.getDescription();
- KeyListener descriptionKeyListener = new KeyListener() {
-
- @Override
- public void keyTyped(KeyEvent e) {
- }
-
- @Override
- public void keyReleased(KeyEvent e) {
- setDescription(descriptionTextField.getText());
- refresh();
- }
-
- @Override
- public void keyPressed(KeyEvent e) {
- }
- };
- descriptionTextField.addKeyListener(descriptionKeyListener);
-
- final JTextField letterTextField = view.getLetter();
- KeyListener letterKeyListener = new KeyListener() {
-
- @Override
- public void keyTyped(KeyEvent e) {
- }
-
- @Override
- public void keyReleased(KeyEvent e) {
- //to prevent useless call to service
- String letterNew = letterTextField.getText();
- if (!letterNew.equals(letter)){
- setLetter(letterNew);
- refresh();
- }
- }
-
- @Override
- public void keyPressed(KeyEvent e) {
- }
- };
- letterTextField.addKeyListener(letterKeyListener);
-
- final JTextField voucherTextField = view.getVoucher();
- KeyListener voucherKeyListener = new KeyListener() {
-
- @Override
- public void keyTyped(KeyEvent e) {
- }
-
- @Override
- public void keyReleased(KeyEvent e) {
- //to prevent useless call to service
- String voucherNew = voucherTextField.getText();
- if (!voucherNew.equals(voucher)){
- setVoucher(voucherNew);
- refresh();
- }
- }
-
- @Override
- public void keyPressed(KeyEvent e) {
- }
- };
- voucherTextField.addKeyListener(voucherKeyListener);
- }
-
public void setBeginDate(Date beginDate){
this.beginDate = beginDate;
- log.debug(beginDate);
}
public void setEndDate(Date endDate){
this.endDate = endDate;
- log.debug(endDate);
}
public void setVoucher(String voucher){
+
String result = null;
if (!voucher.equals("")){
result = voucher;
@@ -255,13 +182,13 @@
log.debug(voucher+" "
+description+" "+letter+" "+accountsList+" "
+account+" "+entryBook+" "+amount);
- //prevent to much result
tableModel.refresh(getDataList());
}
}
protected List<Entry> getDataList() {
List<Entry> results = null;
+ //prevent to much result
if (voucher != null || description != null || letter != null ||
accountsList != null || account != null || entryBook != null ||
(amount != null && operator != null) || (amount != null && amount2 != null)){
Deleted: trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerFilterTextField.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerFilterTextField.java 2010-08-21 11:51:36 UTC (rev 3011)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerFilterTextField.java 2010-08-21 13:01:48 UTC (rev 3012)
@@ -1,58 +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 Lesser General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
- *
- * You should have received a copy of the GNU General Lesser Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/lgpl-3.0.html>. ##%*
- */
-
-package org.chorem.lima.ui.ledger;
-
-import java.awt.event.KeyEvent;
-import java.awt.event.KeyListener;
-import javax.swing.JTextField;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-public class LedgerFilterTextField extends JTextField implements KeyListener {
-
- private static final long serialVersionUID = 1L;
-
- private static final Log log =
- LogFactory.getLog(LedgerFilterTextField.class);
-
- protected LedgerViewHandler handler;
-
- public LedgerFilterTextField(LedgerViewHandler handler) {
- this.handler = handler;
- addKeyListener(this);
- }
-
- @Override
- public void keyPressed(KeyEvent e) {
-
- }
-
- @Override
- public void keyReleased(KeyEvent e) {
- handler.setAccountFilter(getText());
-
- }
-
- @Override
- public void keyTyped(KeyEvent e) {
-
- }
-
-}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerView.jaxx
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerView.jaxx 2010-08-21 11:51:36 UTC (rev 3011)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerView.jaxx 2010-08-21 13:01:48 UTC (rev 3012)
@@ -49,27 +49,30 @@
</script>
<row weightx="1" weighty="0" anchor="center">
<cell anchor="east">
- <JLabel id="beginCalendarPanelLabel" text="lima.accountsreports.begincalendar"/>
+ <JLabel id="beginCalendarPanelLabel" text="lima.period.begindate"/>
</cell>
<cell anchor="west">
<org.jdesktop.swingx.JXDatePicker id="beginDatePicker"
onActionPerformed="getHandler().setBeginDate(beginDatePicker.getDate())" />
</cell>
<cell anchor="east">
- <JLabel id="endCalendarPanelLabel" text="lima.accountsreports.endcalendar"/>
+ <JLabel id="endCalendarPanelLabel" text="lima.period.enddate"/>
</cell>
<cell anchor="west">
<org.jdesktop.swingx.JXDatePicker id="endDatePicker"
onActionPerformed="getHandler().setEndDate(endDatePicker.getDate())"/>
</cell>
<cell anchor="east">
- <JLabel text="lima.accountsreports.accountfilter"/>
+ <JLabel text="lima.common.filter"/>
</cell>
<cell anchor="west">
- <JTextField javaBean="new org.chorem.lima.ui.ledger.LedgerFilterTextField(getHandler())"/>
+ <JTextField id='balanceFilter' minimumSize='{balanceFilter.getPreferredSize()}'/>
+ <javax.swing.text.Document javaBean="balanceFilter.getDocument()"
+ onInsertUpdate='handler.setAccountFilter(balanceFilter.getText())'
+ onRemoveUpdate='handler.setAccountFilter(balanceFilter.getText())' />
</cell>
<cell anchor="center">
- <JCheckBox id='movmentedFilter' text='lima.accountsreports.movmentedfilter' selected='false'
+ <JCheckBox id='movmentedFilter' text='lima.common.movmentedfilter' selected='false'
onActionPerformed="getHandler().refresh()"/>
</cell>
<cell>
Modified: trunk/lima-swing/src/main/resources/i18n/lima-swing-en_GB.properties
===================================================================
--- trunk/lima-swing/src/main/resources/i18n/lima-swing-en_GB.properties 2010-08-21 11:51:36 UTC (rev 3011)
+++ trunk/lima-swing/src/main/resources/i18n/lima-swing-en_GB.properties 2010-08-21 13:01:48 UTC (rev 3012)
@@ -47,15 +47,18 @@
lima.common.cancel=
lima.common.close=
lima.common.copy=
+lima.common.filter=
lima.common.fin=
lima.common.import=
lima.common.importexport=Import/Export
+lima.common.movmentedfilter=
lima.common.next=
lima.common.ok=
lima.common.paste=
lima.common.print=
lima.common.quit=
lima.common.remove=
+lima.common.search=
lima.common.update=
lima.config.category.directories=
lima.config.category.directories.description=
Modified: trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties
===================================================================
--- trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties 2010-08-21 11:51:36 UTC (rev 3011)
+++ trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties 2010-08-21 13:01:48 UTC (rev 3012)
@@ -10,10 +10,6 @@
lima.account=Compte
lima.account.label=
lima.account.number=
-lima.accountsreports.accountfilter=Filtrer
-lima.accountsreports.begincalendar=Date d\u00E9but
-lima.accountsreports.endcalendar=Date fin
-lima.accountsreports.movmentedfilter=Afficher que les comptes mouvement\u00E9s
lima.action.commandline.help=Afficher l'aide en console
lima.action.fullscreen=Plein Ecran
lima.action.fullscreen.tip=Passer en mode plein \u00E9cran
@@ -44,14 +40,17 @@
lima.common.cancel=Annuler
lima.common.close=Fermer
lima.common.copy=Copier
+lima.common.filter=Filtrer
lima.common.fin=Termin\u00E9
lima.common.importexport=Importer/Exporter
+lima.common.movmentedfilter=Comptes mouvement\u00E9s
lima.common.next=Suivant
lima.common.ok=OK
lima.common.paste=Coller
lima.common.print=
lima.common.quit=Quitter
lima.common.remove=Supprimer
+lima.common.search=Rechercher
lima.common.update=Modifier
lima.config.category.directories=R\u00E9pertoires
lima.config.category.directories.description=R\u00E9pertoires utilis\u00E9s par Lima
1
0
r3011 - in trunk: lima-business/src/main/java/org/chorem/lima/business/ejb lima-business/src/main/java/org/chorem/lima/business/ejbinterface lima-callao/src/main/java/org/chorem/lima/entity lima-callao/src/main/xmi lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced lima-swing/src/main/java/org/chorem/lima/ui/home
by jpepin@users.chorem.org 21 Aug '10
by jpepin@users.chorem.org 21 Aug '10
21 Aug '10
Author: jpepin
Date: 2010-08-21 13:51:36 +0200 (Sat, 21 Aug 2010)
New Revision: 3011
Url: http://chorem.org/repositories/revision/lima/3011
Log:
Optimize topiaquery and lazy loading.
Modified:
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialTransactionService.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialTransactionServiceLocal.java
trunk/lima-callao/src/main/java/org/chorem/lima/entity/AccountDAOImpl.java
trunk/lima-callao/src/main/xmi/accounting.properties
trunk/lima-callao/src/main/xmi/accounting.zargo
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedTableModel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/FinancialTransactionsPane.java
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java 2010-08-20 23:46:18 UTC (rev 3010)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java 2010-08-21 11:51:36 UTC (rev 3011)
@@ -21,9 +21,7 @@
import java.math.BigDecimal;
import java.util.Date;
-import java.util.HashSet;
import java.util.List;
-import java.util.Set;
import javax.ejb.Stateless;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -147,8 +145,12 @@
FinancialTransactionDAO transactionDAO =
LimaCallaoDAOHelper.getFinancialTransactionDAO(topiaTransaction);
+ String financialPeriodProperty = TopiaQuery.getProperty(FinancialTransaction.FINANCIAL_PERIOD);
+ String entryBookLabelProperty = TopiaQuery.getProperty(FinancialTransaction.ENTRY_BOOK);
+ String accountProperty = TopiaQuery.getProperty(FinancialTransaction.ENTRY, Entry.ACCOUNT);
+
// filter with topia query
- TopiaQuery query = transactionDAO.createQuery();
+ TopiaQuery query = transactionDAO.createQuery("T");
if (entryBook != null) {
query.addEquals("entryBook", entryBook);
@@ -157,19 +159,13 @@
if (financialPeriod != null) {
query.addEquals("financialPeriod", financialPeriod);
}
- query.addOrder(FinancialTransaction.TOPIA_CREATE_DATE);
+ query.addDistinct()
+ .addOrder("T."+FinancialTransaction.TOPIA_CREATE_DATE)
+ //load for lazy
+ .addLoad(financialPeriodProperty)
+ .addLoad(entryBookLabelProperty)
+ .addFetch("T."+accountProperty);
financialTransactions = transactionDAO.findAllByQuery(query);
-
- //IMPORTANT : LOADING ENTRIES AND IS COLUMN FOR NO LAZY EXCEPTION
- for (FinancialTransaction financialTransaction : financialTransactions) {
- financialTransaction.getEntryBook();
-
- for (Entry entry : financialTransaction.getEntry()) {
- entry.getAccount();
- entry.getFinancialTransaction();
- entry.getFinancialTransaction().getFinancialPeriod();
- }
- }
}
catch (TopiaException ex) {
doCatch(topiaTransaction, ex, log);
@@ -186,44 +182,35 @@
* Get unbalanced financialtransaction from selected fiscalperiod
*/
@Override
- public Set<FinancialTransaction> getAllInexactFinancialTransactions(FiscalPeriod fiscalPeriod) throws LimaException {
+ public List<FinancialTransaction> getAllInexactFinancialTransactions(FiscalPeriod fiscalPeriod) throws LimaException {
TopiaContext topiaContext = null;
- Set<FinancialTransaction> result = new HashSet<FinancialTransaction>();
+ List<FinancialTransaction> result = null;
try {
topiaContext = beginTransaction();
FinancialTransactionDAO financialTransactionDAO =
LimaCallaoDAOHelper.getFinancialTransactionDAO(topiaContext);
- TopiaQuery query = financialTransactionDAO.createQuery("E");
- query.addFrom(FiscalPeriod.class, "F")
- .addWhere("E.amountCredit != E.amountDebit OR E.entryBook = null")
- .addInElements("E.financialPeriod", "F.financialPeriod")
- .addEquals("F", fiscalPeriod);
- result.addAll(financialTransactionDAO.findAllByQuery(query));
- TopiaQuery query2 = financialTransactionDAO.createQuery("T");
- query2.addFrom(Entry.class, "E")
- .addWhere("E.account = null")
- .addInElements("E", "T.entry");
- result.addAll(financialTransactionDAO.findAllByQuery(query2));
+ String financialPeriodProperty = TopiaQuery.getProperty(FinancialTransaction.FINANCIAL_PERIOD);
+ String entryBookLabelProperty = TopiaQuery.getProperty(FinancialTransaction.ENTRY_BOOK);
+ String accountProperty = TopiaQuery.getProperty(Entry.ACCOUNT);
- /* Just for fun : IN HQL
- result = topiaContext.find(
- "FROM org.chorem.lima.entity.FinancialTransaction "+
- "WHERE amountCredit != amountDebit and (financialPeriod in (" +
- "FROM org.chorem.lima.entity.FinancialPeriod " +
- "WHERE (fiscalPeriod = :fiscalPeriod)))","fiscalPeriod",fiscalPeriod);*/
+
+
+ TopiaQuery query = financialTransactionDAO.createQuery("T");
+ query.addFrom(FiscalPeriod.class, "F")
+ .addDistinct()
+ .addLeftJoin("T."+FinancialTransaction.ENTRY, "E", true)
+ .addWhere("T.amountCredit != T.amountDebit OR E.account = null OR T.entryBook = null")
+ .addInElements("T.financialPeriod", "F.financialPeriod")
+ .addEquals("F", fiscalPeriod)
+ // load lazy
+ .addLeftJoin("E."+accountProperty,"A", true)
+ .addLoad(financialPeriodProperty)
+ .addLoad(entryBookLabelProperty);
- //IMPORTANT : LOADING ENTRIES AND IS COLUMN FOR NO LAZY EXCEPTION
- for (FinancialTransaction financialTransaction : result) {
-
- for (Entry entry : financialTransaction.getEntry()) {
- entry.getAccount();
- entry.getFinancialTransaction();
- entry.getFinancialTransaction().getEntryBook();
- entry.getFinancialTransaction().getFinancialPeriod();
- }
- }
+ result = financialTransactionDAO.findAllByQuery(query);
+
}
catch (TopiaException ex) {
@@ -241,7 +228,7 @@
List<FinancialTransaction> result = null;
try {
topiaContext = beginTransaction();
- result = getAllFinancialTransactionsBalanced(topiaContext);
+ result = getAllFinancialTransactionsBalanced(fiscalPeriod, topiaContext);
}
catch (TopiaException ex) {
doCatch(topiaContext, ex, log);
@@ -256,28 +243,24 @@
/**
* Get balanced financialtransaction from selected fiscalperiod
*/
- @Override
- public List<FinancialTransaction> getAllFinancialTransactionsBalanced(TopiaContext topiaContext) throws LimaException {
+ public List<FinancialTransaction> getAllFinancialTransactionsBalanced(FiscalPeriod fiscalPeriod, TopiaContext topiaContext) throws LimaException {
List<FinancialTransaction> result = null;
try {
FinancialTransactionDAO financialTransactionDAO =
LimaCallaoDAOHelper.getFinancialTransactionDAO(topiaContext);
+
+ // WARN No load lazy, modify query with addLoad or addFetch if loading is necessary
+ TopiaQuery query = financialTransactionDAO.createQuery("T");
+ query.addFrom(FiscalPeriod.class, "F")
+ .addLeftJoin("T."+FinancialTransaction.ENTRY, "E", false)
+ .addWhere("T.amountCredit = T.amountDebit")
+ .addNotNull("E.account")
+ .addNotNull("T.entryBook")
+ .addInElements("T.financialPeriod", "F.financialPeriod")
+ .addEquals("F", fiscalPeriod);
- TopiaQuery query = financialTransactionDAO.createQuery("E");
- query.addWhere("E.amountCredit = E.amountDebit")
- .addNotNull("E.entryBook");
- result = financialTransactionDAO.findAllByQuery(query);
-
- //IMPORTANT : LOADING ENTRIES AND IS COLUMN FOR NO LAZY EXCEPTION
- for (FinancialTransaction financialTransaction : result) {
-
- for (Entry entry : financialTransaction.getEntry()) {
- entry.getAccount();
- entry.getFinancialTransaction();
- entry.getFinancialTransaction().getEntryBook();
- entry.getFinancialTransaction().getFinancialPeriod();
- }
- }
+ result = financialTransactionDAO.findAllByQuery(query);
+
}
catch (TopiaException ex) {
doCatch(topiaContext, ex, log);
@@ -648,7 +631,8 @@
}
else if (accountsList != null){
AccountDAO accountDAO = LimaCallaoDAOHelper.getAccountDAO(topiaContext);
- List<Account> accounts = accountDAO.stringToListAccounts(accountsList, false);
+ List<Account> accounts =
+ accountDAO.stringToListAccounts(accountsList, false);
StringBuffer accountNumbers = new StringBuffer("0,");
int max = accounts.size();
for (int i = 1; i <= max; i++) {
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java 2010-08-20 23:46:18 UTC (rev 3010)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java 2010-08-21 11:51:36 UTC (rev 3011)
@@ -155,23 +155,24 @@
/**
* Query for find entries for accountsreports and balancereports
- * Just balanced transaction are calculated
+ * Just exact and balanced transaction are calculated
*/
public TopiaQuery createEntryQuery(Account account, Date beginDate, Date endDate, EntryDAO entryDAO, String queryAlias) throws LimaException{
TopiaQuery query = entryDAO.createQuery(queryAlias);
- String transactionDateProperty =
- TopiaQuery.getProperty(Entry.FINANCIAL_TRANSACTION,
- FinancialTransaction.TRANSACTION_DATE);
- String amountCreditProperty =
- TopiaQuery.getProperty(Entry.FINANCIAL_TRANSACTION,
- FinancialTransaction.AMOUNT_CREDIT);
- String amountDebitProperty =
- TopiaQuery.getProperty(Entry.FINANCIAL_TRANSACTION,
- FinancialTransaction.AMOUNT_DEBIT);
+ String transactionDateProperty = TopiaQuery.getProperty(
+ Entry.FINANCIAL_TRANSACTION, FinancialTransaction.TRANSACTION_DATE);
+ String amountCreditProperty = TopiaQuery.getProperty(
+ Entry.FINANCIAL_TRANSACTION, FinancialTransaction.AMOUNT_CREDIT);
+ String amountDebitProperty = TopiaQuery.getProperty(
+ Entry.FINANCIAL_TRANSACTION, FinancialTransaction.AMOUNT_DEBIT);
+ String entryBookProperty = TopiaQuery.getProperty(
+ Entry.FINANCIAL_TRANSACTION, FinancialTransaction.ENTRY_BOOK);
+
query
.addWhere(amountCreditProperty+" = "+amountDebitProperty)
.addWhere(transactionDateProperty+" BETWEEN :beginDate AND :endDate")
+ .addNotNull(entryBookProperty)
.addParam("beginDate", beginDate)
.addParam("endDate", endDate)
.addEquals(Entry.ACCOUNT, account);
@@ -355,12 +356,6 @@
entriesQuery.addOrder(orderDateProperty)
.addOrder(orderIdProperty);
reportsDatas.setListEntry(entryDAO.findAllByQuery(entriesQuery));
-
-
- //TODO 20100603 PEPIN imbriqué les deux conditions de comparator
- // tri sur date, tri sur topiaid
- //Collections.sort(entries, new EntryFinancialTransactionDateComparator());
- //Collections.sort(entries, new EntryFinancialTransactionComparator());
TopiaQuery amountsQuery =
createEntryBookReportsQuery(entryBook, beginDate, endDate, entryDAO, "E");
@@ -427,7 +422,6 @@
FinancialTransaction.ENTRY_BOOK);
query
.addWhere(amountCreditProperty+" = "+amountDebitProperty)
- //TODO check this
.addEquals(entryBookProperty, entryBook)
.addWhere(transactionDateProperty+" BETWEEN :beginDate AND :endDate")
.addParam("beginDate", beginDate)
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialTransactionService.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialTransactionService.java 2010-08-20 23:46:18 UTC (rev 3010)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialTransactionService.java 2010-08-21 11:51:36 UTC (rev 3011)
@@ -60,7 +60,7 @@
List<FinancialTransaction> getAllFinancialTransactionsForEntryBookAndFinancialPeriod(
EntryBook entryBook, FinancialPeriod period) throws LimaException;
- Set<FinancialTransaction> getAllInexactFinancialTransactions(FiscalPeriod fiscalPeriod) throws LimaException;
+ List<FinancialTransaction> getAllInexactFinancialTransactions(FiscalPeriod fiscalPeriod) throws LimaException;
List<FinancialTransaction> getAllFinancialTransactionsBalanced(FiscalPeriod fiscalPeriod) throws LimaException;
Modified: 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 2010-08-20 23:46:18 UTC (rev 3010)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialTransactionServiceLocal.java 2010-08-21 11:51:36 UTC (rev 3011)
@@ -19,7 +19,6 @@
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.Entry;
@@ -38,8 +37,6 @@
@Local
public interface FinancialTransactionServiceLocal extends FinancialTransactionService {
-
- List<FinancialTransaction> getAllFinancialTransactionsBalanced(TopiaContext topiaContext) throws LimaException;
void createFinancialTransactionWithTransaction(FinancialTransaction financialtransaction, TopiaContext topiaContext) throws LimaException;
Modified: trunk/lima-callao/src/main/java/org/chorem/lima/entity/AccountDAOImpl.java
===================================================================
--- trunk/lima-callao/src/main/java/org/chorem/lima/entity/AccountDAOImpl.java 2010-08-20 23:46:18 UTC (rev 3010)
+++ trunk/lima-callao/src/main/java/org/chorem/lima/entity/AccountDAOImpl.java 2010-08-21 11:51:36 UTC (rev 3011)
@@ -23,12 +23,16 @@
import java.util.List;
import java.util.StringTokenizer;
import org.apache.commons.lang.StringUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.nuiton.topia.TopiaException;
import org.nuiton.topia.framework.TopiaQuery;
import org.nuiton.topia.framework.TopiaQuery.Op;
public class AccountDAOImpl <E extends Account> extends AccountDAOAbstract<E> {
+ private static final Log log = LogFactory.getLog(AccountDAOImpl.class);
+
/**
* List all subaccounts (no folderaccounts, exclude accounts contains thirdpart accounts)
* Sort by accout number in lexicographical order
@@ -42,118 +46,98 @@
return (List<Account>) findAllByQuery(query);
}
-
- /**
- * Convert string of extends number to list of accounts
- * Example '22, 45..48, 67' -> [22, 45, 46, 47, 48, 67]
- * SubAccountsMode return list of existing subaccounts ex 6 return : 61, 62, .., 69, 610, .., 619 etc
- */
@Override
+ public Account findSubAccountByNumber(String number) throws TopiaException {
+ TopiaQuery query = createQuery();
+ String subAccountsProperty = TopiaQuery.getProperty(Account.SUB_ACCOUNTS);
+ String subLedgersProperty = TopiaQuery.getProperty(Account.SUB_LEDGERS);
+ query.addWhere("not exists elements ("+subAccountsProperty+")")
+ .addWhere("not exists elements ("+subLedgersProperty+")")
+ .addEquals(Account.ACCOUNT_NUMBER, number);
+ return findByQuery(query);
+ }
+
+ public List<Account> findIntervalAccountByNumber(String accountNumberLow, String accountNumberHigh) throws TopiaException {
+ TopiaQuery query = createQuery();
+ query.addBetween(Account.ACCOUNT_NUMBER, accountNumberLow, accountNumberHigh);
+ return (List<Account>) findAllByQuery(query);
+ }
+
+ @Override
public List<Account> stringToListAccounts(String selectedAccounts,
Boolean subAccountsMode) throws TopiaException {
- List<Account> accounts = new ArrayList<Account>();
+ HashSet<Account> accounts = new HashSet<Account>();
if (selectedAccounts != null){
//Remove Spaces
- selectedAccounts = StringUtils.deleteWhitespace(selectedAccounts);
- //use hashset for delete duplicate numbers
- HashSet<String> accountNumbers = new HashSet<String>();
- HashSet<String> accountNumbersToRemove = new HashSet<String>();
+ String result = StringUtils.deleteWhitespace(selectedAccounts);
+
Boolean first = true;
- StringTokenizer stStar = new StringTokenizer(selectedAccounts, "-");
+ StringTokenizer stStar = new StringTokenizer(result, "-");
while (stStar.hasMoreTokens()) {
String subString = stStar.nextToken();
+ log.debug(subString);
//Split comma
StringTokenizer stComma = new StringTokenizer(subString, ",");
while (stComma.hasMoreTokens()) {
String s = stComma.nextToken();
+ //if intervall account
if (s.contains("..") && !s.endsWith("..")){
//Split ..
String stringDoubleDot[] = s.split("\\.\\.");
- int lowAccount = Integer.parseInt(stringDoubleDot[0]);
- int highAccount = Integer.parseInt(stringDoubleDot[1]);
- //prevent to much result, can't let intervall superior to 1000
- if (highAccount - lowAccount <= 10000){
- for (int i=lowAccount; i <= highAccount; i++) {
- //if first add accounts, else remove
- if (first){
- accountNumbers.add(String.valueOf(i));
- }
- else {
- accountNumbersToRemove.add(String.valueOf(i));
- }
- }
- }
+ List<Account> resultIntervall =
+ findIntervalAccountByNumber(stringDoubleDot[0], stringDoubleDot[1]);
+
+ //if first add accounts, else remove
+ if (first){
+ accounts.addAll(resultIntervall);
+ }
+ else {
+ accounts.removeAll(resultIntervall);
+ }
}
+ //else one account
else{
- //if first
- if (first){
- accountNumbers.add(s);
- }
- else {
- accountNumbersToRemove.add(s);
- }
+ Account account = null;
+ if (subAccountsMode){
+ account = findSubAccountByNumber(s);
+ }
+ else {
+ account = findByAccountNumber(s);
+ }
+ //if exist
+ if (account != null){
+ //if first
+ if (first){
+ accounts.add(account);
+ }
+ else {
+ accounts.remove(account);
+ }
+ }
+ //search all account start with accountnumber
+ else {
+ TopiaQuery query = createQuery();
+ String subAccountsProperty = TopiaQuery.getProperty(Account.SUB_ACCOUNTS);
+ query.addWhere("not exists elements ("+subAccountsProperty+")")
+ .addWhere(Account.ACCOUNT_NUMBER, Op.LIKE, s+"%");
+ List<Account> accountsResult = (List<Account>) findAllByQuery(query);
+ if (accountsResult != null){
+ //if first
+ if (first){
+ accounts.addAll(accountsResult);
+ }
+ else {
+ accounts.removeAll(accountsResult);
+ }
+ }
+ }
}
}
first=false;
}
- //add all accounts
- for (String accountNumber : accountNumbers) {
- Account account = null;
- if (subAccountsMode){
- account = findSubAccountByNumber(accountNumber);
- }
- else {
- account = findByAccountNumber(accountNumber);
-
- }
- //add account if exist
- if (account != null){
- accounts.add(account);
- }
- //search all account start with accountnumber
- else {
- TopiaQuery query = createQuery();
- String subAccountsProperty = TopiaQuery.getProperty(Account.SUB_ACCOUNTS);
- //String subLedgersProperty = TopiaQuery.getProperty(Account.SUB_LEDGERS);
- query.addWhere("not exists elements ("+subAccountsProperty+")")
- //.addWhere("not exists elements ("+subLedgersProperty+")")
- .addWhere(Account.ACCOUNT_NUMBER, Op.LIKE, accountNumber+"%");
- List<Account> accountsResult = (List<Account>) findAllByQuery(query);
- if (accountsResult != null){
- accounts.addAll(accountsResult);
- }
- }
- }
- //remove all accounts
- for (String accountNumber : accountNumbersToRemove) {
- Account account = null;
- if (subAccountsMode){
- account = findSubAccountByNumber(accountNumber);
- }
- else {
- account = findByAccountNumber(accountNumber);
- }
- if (account != null) {
- accounts.remove(account);
- }
- }
}
- return accounts;
+ return new ArrayList(accounts);
}
-
-
-
- @Override
- public Account findSubAccountByNumber(String number) throws TopiaException {
- TopiaQuery query = createQuery();
- String subAccountsProperty = TopiaQuery.getProperty(Account.SUB_ACCOUNTS);
- String subLedgersProperty = TopiaQuery.getProperty(Account.SUB_LEDGERS);
- query.addWhere("not exists elements ("+subAccountsProperty+")")
- .addWhere("not exists elements ("+subLedgersProperty+")")
- .addEquals(Account.ACCOUNT_NUMBER, number);
- return findByQuery(query);
- }
-
}
Modified: trunk/lima-callao/src/main/xmi/accounting.properties
===================================================================
--- trunk/lima-callao/src/main/xmi/accounting.properties 2010-08-20 23:46:18 UTC (rev 3010)
+++ trunk/lima-callao/src/main/xmi/accounting.properties 2010-08-21 11:51:36 UTC (rev 3011)
@@ -21,7 +21,6 @@
# lazy
org.chorem.lima.entity.Account.attribute.subAccounts.tagvalue.lazy=false
org.chorem.lima.entity.Account.attribute.subLedgers.tagvalue.lazy=false
-org.chorem.lima.entity.FinancialTransaction.attribute.financialPeriod.tagvalue.lazy=false
org.chorem.lima.entity.FiscalPeriod.attribute.financialPeriod.tagvalue.lazy=false
org.chorem.lima.entity.FinancialStatement.attribute.subFinancialStatements.tagvalue.lazy=false
org.chorem.lima.entity.FinancialStatement.attribute.masterFinancialStatement.tagvalue.lazy=false
Modified: trunk/lima-callao/src/main/xmi/accounting.zargo
===================================================================
(Binary files differ)
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedTableModel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedTableModel.java 2010-08-20 23:46:18 UTC (rev 3010)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedTableModel.java 2010-08-21 11:51:36 UTC (rev 3011)
@@ -100,7 +100,7 @@
List<Object> results = new ArrayList<Object>();
if(selectedFiscalPeriod != null){
try {
- Set<FinancialTransaction> financialtransactions =
+ List<FinancialTransaction> financialtransactions =
financialTransactionService.getAllInexactFinancialTransactions(selectedFiscalPeriod);
for (FinancialTransaction financialtransaction : financialtransactions) {
results.add(financialtransaction);
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/FinancialTransactionsPane.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/FinancialTransactionsPane.java 2010-08-20 23:46:18 UTC (rev 3010)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/FinancialTransactionsPane.java 2010-08-21 11:51:36 UTC (rev 3011)
@@ -21,8 +21,6 @@
import static org.nuiton.i18n.I18n._;
import java.awt.Color;
import java.util.List;
-import java.util.Set;
-
import javax.swing.JEditorPane;
import javax.swing.event.HyperlinkEvent;
import javax.swing.event.HyperlinkListener;
@@ -101,7 +99,7 @@
List<FiscalPeriod> unblockedFiscalPeriods =
fiscalPeriodService.getAllUnblockedFiscalPeriods();
if (unblockedFiscalPeriods.size() != 0){
- Set<FinancialTransaction> financialTransactionsUnbal =
+ List<FinancialTransaction> financialTransactionsUnbal =
financialTransactionService.
getAllInexactFinancialTransactions(unblockedFiscalPeriods.get(0));
if (financialTransactionsUnbal.size()>0){
1
0
Author: jpepin
Date: 2010-08-21 01:46:18 +0200 (Sat, 21 Aug 2010)
New Revision: 3010
Url: http://chorem.org/repositories/revision/lima/3010
Log:
D?\195?\169bogue et optimisation ?\195?\160 partir du rapport Sonar.
Removed:
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/RecordServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/UserServiceImpl.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/test/java/org/chorem/lima/business/RecordServiceImplTest.java
trunk/lima-business/src/test/java/org/chorem/lima/business/UserServiceImplTest.java
Modified:
trunk/lima-business/src/main/java/org/chorem/lima/business/AccountingRules.java
trunk/lima-business/src/main/java/org/chorem/lima/business/LimaConfig.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ServiceMonitorable.java
trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/DefaultAccountingRules.java
trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/FranceAccountingRules.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/DocumentServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/EntryBookServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ExportServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialStatementServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FiscalPeriodServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/HttpServerServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/AccountService.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/AccountServiceLocal.java
trunk/lima-business/src/main/java/org/chorem/lima/business/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/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/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/HttpServerService.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/IdentityService.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/IdentityServiceLocal.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ImportService.java
trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ReportServiceLocal.java
trunk/lima-business/src/main/java/org/chorem/lima/business/utils/AccountComparator.java
trunk/lima-business/src/main/java/org/chorem/lima/business/utils/AccountEBPComparator.java
trunk/lima-business/src/main/java/org/chorem/lima/business/utils/EntryComparator.java
trunk/lima-business/src/main/java/org/chorem/lima/business/utils/EntryEBPComparator.java
trunk/lima-business/src/main/java/org/chorem/lima/business/utils/FiscalPeriodComparator.java
trunk/lima-business/src/test/java/org/chorem/lima/business/LimaConfigTest.java
trunk/lima-swing/src/main/java/org/chorem/lima/service/LimaServiceFactory.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartViewHandler.java
trunk/lima-swing/src/main/java/org/chorem/lima/util/ErrorHelper.java
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/AccountingRules.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/AccountingRules.java 2010-08-20 12:11:16 UTC (rev 3009)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/AccountingRules.java 2010-08-20 23:46:18 UTC (rev 3010)
@@ -18,8 +18,8 @@
*/
package org.chorem.lima.business;
+
import java.util.List;
-
import org.chorem.lima.entity.Account;
import org.chorem.lima.entity.ClosedPeriodicEntryBook;
import org.chorem.lima.entity.Entry;
@@ -42,11 +42,11 @@
* @param account
* @throws LimaException
*/
- public void createAccountRules(Account masterAccount, Account account) throws LimaException;
- public void createSubLedgerRules(Account masterAccount, Account account) throws LimaException;
- public void updateAccountRules(Account masterAccount, Account account) throws LimaException;
- public void updateSubLedgerRules(Account account) throws LimaException;
- public void removeAccountRules(Account account, TopiaContext transaction) throws LimaException;
+ void createAccountRules(Account masterAccount, Account account) throws LimaException;
+ void createSubLedgerRules(Account masterAccount, Account account) throws LimaException;
+ void updateAccountRules(Account masterAccount, Account account) throws LimaException;
+ void updateSubLedgerRules(Account account) throws LimaException;
+ void removeAccountRules(Account account, TopiaContext transaction) throws LimaException;
/**
* Entrybook rules
@@ -54,7 +54,7 @@
* @param topiaTransaction
* @throws LimaException
*/
- public void removeEntryBookRules(EntryBook entryBook, TopiaContext topiaTransaction) throws LimaException;
+ void removeEntryBookRules(EntryBook entryBook, TopiaContext topiaTransaction) throws LimaException;
/**
* Fiscal Period rules
@@ -62,8 +62,8 @@
* @param transaction
* @throws LimaException
*/
- public List<FinancialPeriod> createFiscalPeriodRules(FiscalPeriod fiscalPeriod, TopiaContext transaction) throws LimaException;
- public void blockFiscalPeriodRules(FiscalPeriod fiscalPeriod, TopiaContext transaction) throws LimaException;
+ List<FinancialPeriod> createFiscalPeriodRules(FiscalPeriod fiscalPeriod, TopiaContext transaction) throws LimaException;
+ void blockFiscalPeriodRules(FiscalPeriod fiscalPeriod, TopiaContext transaction) throws LimaException;
/**
* Entry rules
@@ -71,14 +71,14 @@
* @param topiaTransaction
* @throws LimaException
*/
- public void updateEntryRules(Entry entry, Entry entryOld, TopiaContext topiaTransaction) throws LimaException;
- public void updateFinancialTransactionDateRules(FinancialTransaction financialTransaction, FinancialTransaction financialTransactionOld, TopiaContext topiaContext) throws LimaException, LimaBusinessException;
+ void updateEntryRules(Entry entry, Entry entryOld, TopiaContext topiaTransaction) throws LimaException;
+ void updateFinancialTransactionDateRules(FinancialTransaction financialTransaction, FinancialTransaction financialTransactionOld, TopiaContext topiaContext) throws LimaException;
/**
* Financialperiod/entrybook rules
* @param financialTransaction
* @param topiaContext
* @throws LimaException
*/
- public void checkFinancialPeriodBlockedWithFinancialTransaction(FinancialTransaction financialTransaction, TopiaContext topiaContext) throws LimaException;
- public void blockClosedPeriodicEntryBookRules(ClosedPeriodicEntryBook closedPeriodicEntryBook, TopiaContext topiaContext) throws LimaException;
+ void checkFinancialPeriodBlockedWithFinancialTransaction(FinancialTransaction financialTransaction, TopiaContext topiaContext) throws LimaException;
+ void blockClosedPeriodicEntryBookRules(ClosedPeriodicEntryBook closedPeriodicEntryBook, TopiaContext topiaContext) throws LimaException;
}
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/LimaConfig.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/LimaConfig.java 2010-08-20 12:11:16 UTC (rev 3009)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/LimaConfig.java 2010-08-20 23:46:18 UTC (rev 3010)
@@ -43,9 +43,9 @@
private static final Log log = LogFactory.getLog(LimaConfig.class);
- protected static LimaConfig instance;
+ private static LimaConfig instance;
- private static final String configFile = "lima.properties";
+ private static final String CONFIGFILE = "lima.properties";
protected AccountingRules accountingRules;
@@ -59,7 +59,7 @@
public static LimaConfig getInstance() {
if (instance == null) {
instance = new LimaConfig();
- instance.loadConfiguration(configFile);
+ instance.loadConfiguration(CONFIGFILE);
}
return instance;
}
@@ -136,41 +136,41 @@
HTTP_PORT("lima.httpport", _("lima.config.httpport"), "5462", String.class, false, false),
SERVER_ADRESS("lima.serveraddress", _("lima.config.serveraddress"), "", String.class, false, false);
- public final String key;
- public final String description;
- public String defaultValue;
- public final Class<?> type;
- public boolean _transient;
- public boolean _final;
+ private final String key;
+ private final String description;
+ private String defaultValue;
+ private final Class<?> type;
+ private boolean transientBoolean;
+ private boolean finalBoolean;
private Option(String key, String description, String defaultValue,
- Class<?> type, boolean _transient, boolean _final) {
+ Class<?> type, boolean transientBoolean, boolean finalBoolean) {
this.key = key;
this.description = description;
this.defaultValue = defaultValue;
this.type = type;
- this._final = _final;
- this._transient = _transient;
+ this.finalBoolean = finalBoolean;
+ this.transientBoolean = transientBoolean;
}
@Override
public boolean isFinal() {
- return _final;
+ return finalBoolean;
}
@Override
- public void setFinal(boolean _final){
- this._final=_final;
+ public void setFinal(boolean finalBoolean){
+ this.finalBoolean=finalBoolean;
}
@Override
public boolean isTransient() {
- return _transient;
+ return transientBoolean;
}
@Override
- public void setTransient(boolean _transient) {
- this._transient=_transient;
+ public void setTransient(boolean transientBoolean) {
+ this.transientBoolean = transientBoolean;
}
@Override
@@ -180,7 +180,7 @@
@Override
public void setDefaultValue(String defaultValue) {
- this.defaultValue=defaultValue;
+ this.defaultValue = defaultValue;
}
@Override
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-08-20 12:11:16 UTC (rev 3009)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ServiceMonitorable.java 2010-08-20 23:46:18 UTC (rev 3010)
@@ -20,6 +20,6 @@
package org.chorem.lima.business;
public interface ServiceMonitorable {
- public void addListener(ServiceListener l);
- public void removeListener(ServiceListener l);
+ void addListener(ServiceListener l);
+ void removeListener(ServiceListener l);
}
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/DefaultAccountingRules.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/DefaultAccountingRules.java 2010-08-20 12:11:16 UTC (rev 3009)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/DefaultAccountingRules.java 2010-08-20 23:46:18 UTC (rev 3010)
@@ -131,7 +131,7 @@
/**
* Check if entrybook have financial transaction
*/
- @Override
+ @Override
public void removeEntryBookRules(EntryBook entryBook, TopiaContext topiaTransaction) throws LimaException {
try {
FinancialTransactionDAO financialTransactionDAO = LimaCallaoDAOHelper.getFinancialTransactionDAO(topiaTransaction);
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/FranceAccountingRules.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/FranceAccountingRules.java 2010-08-20 12:11:16 UTC (rev 3009)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/FranceAccountingRules.java 2010-08-20 23:46:18 UTC (rev 3010)
@@ -89,8 +89,8 @@
/**
* Rules to check before create subledger
*/
- public void createSubLedgerRules(Account masterAccount, Account account) throws LimaException {
- super.createSubLedgerRules(masterAccount, account);
+ public void createSubLedgerRules(Account masterAccount, Account account) throws LimaException {
+ super.createSubLedgerRules(masterAccount, account);
// check if the master account number is begin with 4
if (!masterAccount.getAccountNumber().startsWith("4")){
@@ -308,24 +308,4 @@
}
throw new LimaException("Exception during query", cause);
}
-
- /**
- * Generic code used too close a transaction.
- *
- * @param transaction transaction to close
- * @param log log (can be null)
- * @throws LimaException
- */
- protected void doFinally(TopiaContext transaction, Log log) throws LimaException {
- if (transaction != null) {
- try {
- transaction.closeContext();
- } catch (TopiaException ex) {
- if (log != null && log.isErrorEnabled()) {
- log.error("Can't close transaction", ex);
- }
- throw new LimaException("Can't close transaction", ex);
- }
- }
- }
}
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java 2010-08-20 12:11:16 UTC (rev 3009)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java 2010-08-20 23:46:18 UTC (rev 3010)
@@ -22,11 +22,8 @@
import static org.nuiton.i18n.I18n._;
import java.util.ArrayList;
import java.util.Collections;
-import java.util.HashSet;
import java.util.List;
-import java.util.StringTokenizer;
import javax.ejb.Stateless;
-import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.chorem.lima.business.AccountingRules;
@@ -44,7 +41,6 @@
import org.nuiton.topia.TopiaException;
import org.nuiton.topia.TopiaNotFoundException;
import org.nuiton.topia.framework.TopiaQuery;
-import org.nuiton.topia.framework.TopiaQuery.Op;
/**
* Permet d'implémenter le Plan Comptable Général.
@@ -78,8 +74,7 @@
@Override
- public void createAccountWithTransaction(Account masterAccount, Account account, TopiaContext topiaContext) throws LimaException,
- LimaBusinessException {
+ public void createAccountWithTransaction(Account masterAccount, Account account, TopiaContext topiaContext) throws LimaException {
try {
// check if account number already exist
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/DocumentServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/DocumentServiceImpl.java 2010-08-20 12:11:16 UTC (rev 3009)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/DocumentServiceImpl.java 2010-08-20 23:46:18 UTC (rev 3010)
@@ -43,7 +43,6 @@
import org.chorem.lima.business.LimaException;
import org.chorem.lima.business.ejbinterface.DocumentService;
import org.chorem.lima.business.ejbinterface.DocumentServiceLocal;
-import org.chorem.lima.business.ejbinterface.EntryBookService;
import org.chorem.lima.business.ejbinterface.FinancialStatementService;
import org.chorem.lima.business.ejbinterface.IdentityService;
import org.chorem.lima.business.ejbinterface.ReportService;
@@ -92,17 +91,14 @@
//Services
@EJB
- IdentityService identityService;
+ private IdentityService identityService;
@EJB
- EntryBookService entryBookService;
+ private FinancialStatementService financialStatementService;
@EJB
- FinancialStatementService financialStatementService;
+ private ReportService reportService;
- @EJB
- ReportService reportService;
-
protected String path;
//SDFs
@@ -261,7 +257,7 @@
for (int i=0;i<size;i++) {
FinancialStatementAmounts fStatementAmounts =
financialStatementAmounts.get(i);
- if (fStatementAmounts.getLevel() == 1 && fStatementAmounts.getSubAmount() == false){
+ if (fStatementAmounts.getLevel() == 1 && !fStatementAmounts.getSubAmount()){
if (first){
first=false;
}
@@ -406,9 +402,9 @@
}
else {
//cell1
- String tab = "";
+ StringBuffer tab = new StringBuffer();
for (int i = 0; i < level; i++) {
- tab += "\t";
+ tab.append("\t");
}
Phrase phrase = null;
if (financialStatementAmount.getHeader()){
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-08-20 12:11:16 UTC (rev 3009)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/EntryBookServiceImpl.java 2010-08-20 23:46:18 UTC (rev 3010)
@@ -146,16 +146,16 @@
*/
public List<EntryBook> getAllEntryBooks() throws LimaException {
- List<EntryBook> EntryBooksList = new ArrayList<EntryBook>();
+ List<EntryBook> entryBooksList = new ArrayList<EntryBook>();
TopiaContext transaction = null;
try {
transaction = beginTransaction();
// check if entrybook with is name already exist
- EntryBookDAO EntryBookDAO =
+ EntryBookDAO entryBookDAO =
LimaCallaoDAOHelper.getEntryBookDAO(transaction);
- List<EntryBook> EntryBooks = EntryBookDAO.findAll();
- EntryBooksList.addAll(EntryBooks);
+ List<EntryBook> entryBooks = entryBookDAO.findAll();
+ entryBooksList.addAll(entryBooks);
}
catch (TopiaException ex) {
doCatch(transaction, ex, log);
@@ -164,7 +164,7 @@
doFinally(transaction, log);
}
- return EntryBooksList;
+ return entryBooksList;
}
/**
@@ -213,9 +213,9 @@
accountingRules.removeEntryBookRules(entryBook, topiaTransaction);
//delete
- EntryBookDAO EntryBookDAO =
+ EntryBookDAO entryBookDAO =
LimaCallaoDAOHelper.getEntryBookDAO(topiaTransaction);
- EntryBookDAO.delete(entryBook);
+ entryBookDAO.delete(entryBook);
commitTransaction(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-08-20 12:11:16 UTC (rev 3009)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ExportServiceImpl.java 2010-08-20 23:46:18 UTC (rev 3010)
@@ -73,7 +73,7 @@
private TopiaContext rootContext;
- private static final SimpleDateFormat SDateFormat = new SimpleDateFormat("dd,MM,yyyy HH:mm:ss");
+ private static final SimpleDateFormat SDATEFORMAT = new SimpleDateFormat("dd,MM,yyyy HH:mm:ss");
public ExportServiceImpl() {
LimaConfig config = LimaConfig.getInstance();
@@ -96,7 +96,7 @@
public String exportEntriesAsEBP() throws LimaException {
TopiaContext topiaContext = null;
SimpleDateFormat epbDateFormat = new SimpleDateFormat("ddMMyyyy");
- String result = "";
+ StringBuffer result = new StringBuffer();
int num = 0;
try {
@@ -151,10 +151,10 @@
string = nextln;
}
if (i==8){
- result+=string+"\r\n";
+ result.append(string+"\r\n");
}
else {
- result+=string+",";
+ result.append(string+",");
}
}
}
@@ -169,7 +169,7 @@
finally {
doFinally(topiaContext, log);
}
- return result;
+ return result.toString();
}
/**
@@ -310,17 +310,17 @@
for (FinancialStatement financialStatement : listFinancialStatements) {
nextLine[0] = ImportExportEntityEnum.FINANCIALSTATEMENT.getLabel();
nextLine[1] = financialStatement.getLabel();
- nextLine[2] = new Boolean(
- financialStatement.getHeader()).toString();
+ nextLine[2] = Boolean.toString(
+ financialStatement.getHeader());
nextLine[3] = financialStatement.getAccounts();
nextLine[4] = financialStatement.getDebitAccounts();
nextLine[5] = financialStatement.getCreditAccounts();
nextLine[6] = financialStatement.
getProvisionDeprecationAccounts();
- nextLine[7] = new Boolean(
- financialStatement.getSubAmount()).toString();
- nextLine[8] = new Boolean(
- financialStatement.getHeaderAmount()).toString();
+ nextLine[7] = Boolean.toString(
+ financialStatement.getSubAmount());
+ nextLine[8] = Boolean.toString(
+ financialStatement.getHeaderAmount());
FinancialStatement masterFinancialStatement =
financialStatement.getMasterFinancialStatement();
String masterFinancialStatementString = "";
@@ -491,14 +491,14 @@
nextLine[0] = ImportExportEntityEnum.FINANCIALTRANSACTION.getLabel();
nextLine[1] = String.valueOf(numTransaction);
nextLine[2] =
- SDateFormat.format(financialTransaction.getTransactionDate());
+ SDATEFORMAT.format(financialTransaction.getTransactionDate());
nextLine[3] = financialTransaction.getAmountDebit().toString();
nextLine[4] = financialTransaction.getAmountCredit().toString();
nextLine[5] =
- SDateFormat.format(financialTransaction.getFinancialPeriod().
+ SDATEFORMAT.format(financialTransaction.getFinancialPeriod().
getBeginDate());
nextLine[6] =
- SDateFormat.format(financialTransaction.getFinancialPeriod().
+ SDATEFORMAT.format(financialTransaction.getFinancialPeriod().
getEndDate());
EntryBook entryBook = financialTransaction.getEntryBook();
if (entryBook != null){
@@ -513,7 +513,7 @@
nextLine[1] = String.valueOf(numTransaction);
nextLine[2] = entry.getDescription();
nextLine[3] = entry.getAmount().toString();
- nextLine[4] = new Boolean(entry.getDebit()).toString();
+ nextLine[4] = Boolean.toString(entry.getDebit());
nextLine[5] = entry.getLettering();
nextLine[6] = entry.getDetail();
nextLine[7] = entry.getVoucher();
@@ -546,9 +546,9 @@
// For all Entry
for (FiscalPeriod fiscalPeriod : listFiscalPeriod) {
nextLine[0] = ImportExportEntityEnum.FISCALPERIOD.getLabel();
- nextLine[1] = SDateFormat.format(fiscalPeriod.getBeginDate());
- nextLine[2] = SDateFormat.format(fiscalPeriod.getEndDate());
- nextLine[3] = new Boolean(fiscalPeriod.getLocked()).toString();
+ nextLine[1] = SDATEFORMAT.format(fiscalPeriod.getBeginDate());
+ nextLine[2] = SDATEFORMAT.format(fiscalPeriod.getEndDate());
+ nextLine[3] = Boolean.toString(fiscalPeriod.getLocked());
// Ajoute la ligne au fichier
csvWriter.writeNext(nextLine);
}
@@ -574,13 +574,13 @@
// For all Entry
for (ClosedPeriodicEntryBook closedPeriodicEntryBook : listClosedPeriodicEntryBook) {
nextLine[0] = ImportExportEntityEnum.CLOSEDPERIODICENTRYBOOK.getLabel();
- nextLine[1] = new Boolean(
- closedPeriodicEntryBook.getLocked()).toString();
+ nextLine[1] = Boolean.toString(
+ closedPeriodicEntryBook.getLocked());
nextLine[2] =
- SDateFormat.format(closedPeriodicEntryBook.getFinancialPeriod().
+ SDATEFORMAT.format(closedPeriodicEntryBook.getFinancialPeriod().
getBeginDate());
nextLine[3] =
- SDateFormat.format(closedPeriodicEntryBook.getFinancialPeriod().
+ SDATEFORMAT.format(closedPeriodicEntryBook.getFinancialPeriod().
getEndDate());
nextLine[4] = closedPeriodicEntryBook.getEntryBook().getCode();
// Ajoute la ligne au fichier
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialStatementServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialStatementServiceImpl.java 2010-08-20 12:11:16 UTC (rev 3009)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialStatementServiceImpl.java 2010-08-20 23:46:18 UTC (rev 3010)
@@ -37,7 +37,6 @@
import org.chorem.lima.beans.FinancialStatementDatasImpl;
import org.chorem.lima.beans.ReportsDatas;
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.FinancialStatementService;
@@ -66,7 +65,7 @@
protected AccountingRules accountingRules;
@EJB
- ReportServiceLocal reportServiceLocal;
+ private ReportServiceLocal reportServiceLocal;
public FinancialStatementServiceImpl() {
LimaConfig config = LimaConfig.getInstance();
@@ -84,7 +83,7 @@
public void createFinancialStatementWithTransaction(
FinancialStatement masterFinancialStatement,
FinancialStatement financialStatement, TopiaContext topiaContext)
- throws LimaException, LimaBusinessException {
+ throws LimaException {
try {
@@ -126,7 +125,7 @@
}
@Override
- public void createFinancialStatement(FinancialStatement masterFinancialStatement, FinancialStatement financialStatement) throws LimaException, LimaBusinessException {
+ public void createFinancialStatement(FinancialStatement masterFinancialStatement, FinancialStatement financialStatement) throws LimaException {
TopiaContext transaction = null;
try {
@@ -144,7 +143,7 @@
@Override
- public void removeFinancialStatement(FinancialStatement financialStatement) throws LimaException, LimaBusinessException {
+ public void removeFinancialStatement(FinancialStatement financialStatement) throws LimaException {
TopiaContext transaction = null;
try {
@@ -189,8 +188,7 @@
@Override
- public void removeAllFinancialStatement() throws LimaException,
- LimaBusinessException {
+ public void removeAllFinancialStatement() throws LimaException {
for (FinancialStatement financialStatement : getChildrenFinancialStatement(null)) {
removeFinancialStatement(financialStatement);
}
@@ -212,7 +210,7 @@
}
@Override
- public List<FinancialStatement> getAllChildrenFinancialStatement(FinancialStatement financialStatement, List<FinancialStatement> result) throws LimaException, LimaBusinessException {
+ public List<FinancialStatement> getAllChildrenFinancialStatement(FinancialStatement financialStatement, List<FinancialStatement> result) throws LimaException {
List<FinancialStatement> childFinancialStatements =
getChildrenFinancialStatement(financialStatement);
for (FinancialStatement childFinancialStatement: childFinancialStatements) {
@@ -250,7 +248,7 @@
@Override
- public void updateFinancialStatement(FinancialStatement financialStatement) throws LimaException, LimaBusinessException {
+ public void updateFinancialStatement(FinancialStatement financialStatement) throws LimaException {
TopiaContext transaction = null;
try {
transaction = beginTransaction();
@@ -460,8 +458,8 @@
if (accountsNumberList != null){
//Remove Spaces
AccountDAO accountDAO = LimaCallaoDAOHelper.getAccountDAO(topiaContext);
- accountsNumberList = StringUtils.deleteWhitespace(accountsNumberList);
- StringTokenizer stQuote = new StringTokenizer(accountsNumberList, "-");
+ String result = StringUtils.deleteWhitespace(accountsNumberList);
+ StringTokenizer stQuote = new StringTokenizer(result, "-");
while (stQuote.hasMoreTokens()) {
String s = stQuote.nextToken();
List<Account> accountsList = accountDAO.stringToListAccounts(s, false);
@@ -526,7 +524,7 @@
@Override
public String checkFinancialStatementChart() throws LimaException {
- String result =_("lima-business.financialstatement.check.warn");
+ StringBuffer result = new StringBuffer(_("lima-business.financialstatement.check.warn"));
TopiaContext transaction = null;
try {
transaction = beginTransaction();
@@ -562,8 +560,8 @@
for (Account account : accountsList) {
- result += _("lima-business.financialstatement.check.nothing")
- + " : "+account.getAccountNumber()+" - "+account.getLabel()+"\n";
+ result.append(_("lima-business.financialstatement.check.nothing")
+ + " : "+account.getAccountNumber()+" - "+account.getLabel()+"\n");
}
}
@@ -573,7 +571,7 @@
finally {
doFinally(transaction, log);
}
- return result;
+ return result.toString();
}
public List<FinancialStatement> findFinancialStatementByAccountNumber(String accountNumber, TopiaContext topiaContext) throws TopiaException{
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java 2010-08-20 12:11:16 UTC (rev 3009)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java 2010-08-20 23:46:18 UTC (rev 3010)
@@ -19,9 +19,7 @@
package org.chorem.lima.business.ejb;
-import static org.nuiton.i18n.I18n._;
import java.math.BigDecimal;
-import java.util.ArrayList;
import java.util.Date;
import java.util.HashSet;
import java.util.List;
@@ -651,12 +649,12 @@
else if (accountsList != null){
AccountDAO accountDAO = LimaCallaoDAOHelper.getAccountDAO(topiaContext);
List<Account> accounts = accountDAO.stringToListAccounts(accountsList, false);
- String accountNumbers = "0,";
+ StringBuffer accountNumbers = new StringBuffer("0,");
int max = accounts.size();
for (int i = 1; i <= max; i++) {
- accountNumbers += accounts.get(i-1).getAccountNumber();
+ accountNumbers.append(accounts.get(i-1).getAccountNumber());
if (i != max){
- accountNumbers += ",";
+ accountNumbers.append(",");
}
}
if (accounts.size() > 0){
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-08-20 12:11:16 UTC (rev 3009)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FiscalPeriodServiceImpl.java 2010-08-20 23:46:18 UTC (rev 3010)
@@ -19,7 +19,6 @@
package org.chorem.lima.business.ejb;
-import static org.nuiton.i18n.I18n._;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
@@ -63,7 +62,7 @@
protected AccountingRules accountingRules;
@EJB
- FinancialPeriodServiceLocal financialPeriodService;
+ private FinancialPeriodServiceLocal financialPeriodService;
public FiscalPeriodServiceImpl() {
LimaConfig config = LimaConfig.getInstance();
@@ -222,7 +221,7 @@
try {
transaction = beginTransaction();
- if (fiscalPeriod.getLocked()==true){
+ if (fiscalPeriod.getLocked()){
throw new LimaBusinessException("Fiscal Period already blocked");
}
//check rules
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/HttpServerServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/HttpServerServiceImpl.java 2010-08-20 12:11:16 UTC (rev 3009)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/HttpServerServiceImpl.java 2010-08-20 23:46:18 UTC (rev 3010)
@@ -57,11 +57,10 @@
@Stateless
public class HttpServerServiceImpl extends AbstractLimaService implements HttpServerService, HttpServerServiceLocal {
- private static final Log log =
- LogFactory.getLog(HttpServerServiceImpl.class);
+ private static final Log log = LogFactory.getLog(HttpServerServiceImpl.class);
@EJB
- DocumentService documentService;
+ private DocumentService documentService;
protected Server server;
@@ -69,8 +68,7 @@
protected int port;
- private static SimpleDateFormat dateFormat =
- new SimpleDateFormat("yyyy-MM-dd");
+ private static SimpleDateFormat DATEFORMAT = new SimpleDateFormat("yyyy-MM-dd");
public HttpServerServiceImpl() {
path = LimaConfig.getInstance().getReportsDir();
@@ -110,7 +108,7 @@
/** this servlet send a static html page */
public class MainServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
- String serverAddressConfig = LimaConfig.getInstance().getAddressServer();
+ private String serverAddressConfig = LimaConfig.getInstance().getAddressServer();
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
@@ -139,8 +137,8 @@
+ model +formatsEnum.getExtension());
//create docs
try {
- Date beginDateFormat = dateFormat.parse(beginDate);
- Date endDateFormat = dateFormat.parse(endDate);
+ Date beginDateFormat = DATEFORMAT.parse(beginDate);
+ Date endDateFormat = DATEFORMAT.parse(endDate);
switch (DocumentsEnum.valueOfLink(model)) {
case BALANCE:
@@ -177,7 +175,7 @@
// else return home html
else {
resp.setContentType(FormatsEnum.HTML.getMimeType());
- String pageContent = "";
+ StringBuffer pageContent = new StringBuffer();
String serverAdress = "http://";
log.info("Page load");
@@ -198,7 +196,7 @@
beginDatePicker =
DateUtils.truncate(beginDatePicker, Calendar.YEAR);
- pageContent = "<!DOCTYPE html>\n"
+ pageContent.append("<!DOCTYPE html>\n"
+ "<html lang=\"fr\">\n"
+ "<head>\n"
+ "<title>LIMA Documents Report</title>\n"
@@ -216,29 +214,29 @@
+ "<td rowspan=3><form method=GET action="
+ serverAdress + ">\n"
+ _("lima-business.document.date.begin")
- + "<input value=\""+dateFormat.format(beginDatePicker)
+ + "<input value=\""+DATEFORMAT.format(beginDatePicker)
+ "\" type=\"date\" name=\"beginDate\">\n"
+ _("lima-business.document.date.end")
- + "<input value=\""+dateFormat.format(endDatePicker)
+ + "<input value=\""+DATEFORMAT.format(endDatePicker)
+ "\" type=\"date\" name=\"endDate\">\n<br/><br/>"
- + "Format : <select name=\"format\">";
+ + "Format : <select name=\"format\">");
for (FormatsEnum formatsEnum : FormatsEnum.values()) {
- pageContent += "<option value=\""
+ pageContent.append("<option value=\""
+ formatsEnum.getExtension()+"\">"
- + formatsEnum.getDescription()+"</option>\n";
+ + formatsEnum.getDescription()+"</option>\n");
}
- pageContent += "</select>\n"
- + "Documents : <select name=\"model\">";
+ pageContent.append("</select>\n"
+ + "Documents : <select name=\"model\">");
for (DocumentsEnum documentsEnum : DocumentsEnum.values()) {
- pageContent += "<option value=\""
+ pageContent.append("<option value=\""
+ documentsEnum.getFileName()+"\">"
- + documentsEnum.getDescription()+"</option>\n";
+ + documentsEnum.getDescription()+"</option>\n");
}
- pageContent += "</select>\n"
+ pageContent.append("</select>\n"
+ "<tr><td><img src=\"?img=entries.png\"/></td></tr>\n"
+ "<tr><td><img src=\"?img=accounts.png\"/></td></tr>\n"
+ "<tr><td><img src=\"?img=entrybooks.png\"/></td>\n"
@@ -247,9 +245,9 @@
+ "<tr><td><img src=\"?img=fiscalperiods.png\"/></td></tr>\n"
+ "</table>\n"
+ "</body>\n"
- + "</html>";
+ + "</html>");
- resp.getWriter().write(pageContent);
+ resp.getWriter().write(pageContent.toString());
}
}
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java 2010-08-20 12:11:16 UTC (rev 3009)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java 2010-08-20 23:46:18 UTC (rev 3010)
@@ -123,27 +123,27 @@
// Services
@EJB
- AccountServiceLocal accountService;
+ private AccountServiceLocal accountService;
@EJB
- FiscalPeriodServiceLocal fiscalPeriodService;
+ private FiscalPeriodServiceLocal fiscalPeriodService;
@EJB
- FinancialPeriodServiceLocal financialPeriodService;
+ private FinancialPeriodServiceLocal financialPeriodService;
@EJB
- FinancialTransactionServiceLocal financialTransactionService;
+ private FinancialTransactionServiceLocal financialTransactionService;
@EJB
- FinancialStatementServiceLocal financialStatementService;
+ private FinancialStatementServiceLocal financialStatementService;
@EJB
- EntryBookServiceLocal entryBookService;
+ private EntryBookServiceLocal entryBookService;
@EJB
- IdentityServiceLocal identityService;
+ private IdentityServiceLocal identityService;
- private static final SimpleDateFormat SDateFormat = new SimpleDateFormat(
+ private static final SimpleDateFormat SDATEFORMAT = new SimpleDateFormat(
"dd,MM,yyyy HH:mm:ss");
public ImportServiceImpl() {
@@ -162,7 +162,7 @@
@Override
public String importEntriesFromEbp(String datas) throws LimaException {
SimpleDateFormat epbDateFormat = new SimpleDateFormat("dd/MM/yyyy");
- String result = "";
+ StringBuffer result = new StringBuffer();
TopiaContext topiaContext = null;
try {
@@ -232,9 +232,9 @@
else if (date.compareTo(beginDate) < 0 || date.compareTo(endDate) > 0){
- result += "WARNING : " + date + " entries is out of range of" +
+ result.append("WARNING : " + date + " entries is out of range of" +
" opened fiscal periods. "
- + "Entry was skip !\n";
+ + "Entry was skip !\n");
}
else {
entry.setAccount(account);
@@ -260,8 +260,8 @@
entryBook.setCode(entryBookCode);
// create it
entryBookService.createEntryBook(entryBook);
- result += "WARNING : Entrybook " + entryBook
- + "not exist was created !\n";
+ result.append("WARNING : Entrybook " + entryBook
+ + "not exist was created !\n");
}
if (financialTransaction == null
@@ -287,15 +287,15 @@
financialTransactionService
.createFinancialTransactionWithTransaction(
financialTransaction, topiaContext);
- result += "SUCCES : FinancialTransaction" + date + " "
- + entryBook.getCode() + " added\n";
+ result.append("SUCCES : FinancialTransaction" + date + " "
+ + entryBook.getCode() + " added\n");
}
financialTransaction.addEntry(entry);
financialTransactionService.createEntryWithTransaction(
entry, topiaContext);
- result += "SUCCES : Entry" + entry.getDescription() + " "
- + entry.getAmount() + " added\n";
+ result.append("SUCCES : Entry" + entry.getDescription() + " "
+ + entry.getAmount() + " added\n");
}
}
// update last financial transaction
@@ -320,12 +320,12 @@
} finally {
doFinally(topiaContext, log);
}
- return result;
+ return result.toString();
}
@Override
public String importAccountsChartFromEbp(String datas) throws LimaException {
- String result = "";
+ StringBuffer result = new StringBuffer();
TopiaContext topiaContext = null;
try {
@@ -355,8 +355,8 @@
for (AccountEBP accountEBP : list) {
String accountNumber = accountEBP.getNumero();
if (accountDAO.findByAccountNumber(accountNumber) != null) {
- result += "FAILED : Account" + accountNumber
- + " already exist \n";
+ result.append("FAILED : Account" + accountNumber
+ + " already exist \n");
} else {
String label = accountEBP.getIntitule();
Account account = new AccountImpl();
@@ -376,8 +376,8 @@
}
accountService.createSubLedgerWithTransaction(
masterAccount, account, topiaContext);
- result += "SUCCES : Account" + accountNumber + " "
- + label + " added\n";
+ result.append("SUCCES : Account" + accountNumber + " "
+ + label + " added\n");
}
// else is account
else {
@@ -386,8 +386,8 @@
if (nbCharAccountNumber == 1) {
accountService.createAccountWithTransaction(null,
account, topiaContext);
- result += "SUCCES : Account" + accountNumber + " "
- + label + " added\n";
+ result.append("SUCCES : Account" + accountNumber + " "
+ + label + " added\n");
}
else {
Account masterAccount = null;
@@ -401,8 +401,8 @@
}
accountService.createAccountWithTransaction(
masterAccount, account, topiaContext);
- result += "SUCCES : Account" + accountNumber + " "
- + label + " added\n";
+ result.append("SUCCES : Account" + accountNumber + " "
+ + label + " added\n");
}
}
}
@@ -417,7 +417,7 @@
doFinally(topiaContext, log);
}
- return result;
+ return result.toString();
}
@Override
@@ -439,7 +439,7 @@
*/
@Override
public String importAllAsCSV(String datas) throws LimaException {
- String result = "";
+ StringBuffer result = new StringBuffer();
Map<String, AccountImport> accounts = new TreeMap<String, AccountImport>();
@@ -470,20 +470,20 @@
if (importExportEntityEnum != null) {
switch (importExportEntityEnum) {
case ACCOUNT:
- result += importAccountsChartsCSV(nextLine, accounts,
- topiaContext);
+ result.append(importAccountsChartsCSV(nextLine, accounts,
+ topiaContext));
break;
case ENTRYBOOK:
- result += importEntryBooksChartCSV(nextLine,
- topiaContext);
+ result.append(importEntryBooksChartCSV(nextLine,
+ topiaContext));
break;
case FINANCIALSTATEMENT:
- result += importFinancialsStatementChartCSV(nextLine,
- financialStatements, topiaContext);
+ result.append(importFinancialsStatementChartCSV(nextLine,
+ financialStatements, topiaContext));
break;
case FISCALPERIOD:
- result += importFiscalPeriodCSV(nextLine,
- fiscalPeriods, topiaContext);
+ result.append(importFiscalPeriodCSV(nextLine,
+ fiscalPeriods, topiaContext));
break;
case CLOSEDPERIODICENTRYBOOK:
importClosedPeriodicEntryBookCSV(nextLine,
@@ -504,19 +504,19 @@
}
// create accounts
- result += createAccounts(accounts, topiaContext);
+ result.append(createAccounts(accounts, topiaContext));
// create financialStatements
- result += createFinancialStatements(financialStatements,
- topiaContext);
+ result.append(createFinancialStatements(financialStatements,
+ topiaContext));
// create fiscalperiod
Collections.sort(fiscalPeriods, new FiscalPeriodComparator());
- result += createFiscalPeriod(fiscalPeriods, topiaContext);
+ result.append(createFiscalPeriod(fiscalPeriods, topiaContext));
// update closedperiodicentrybooks
- result += updateClosedPeriodicEntryBooks(closedPeriodicEntryBooks,
- topiaContext);
+ result.append(updateClosedPeriodicEntryBooks(closedPeriodicEntryBooks,
+ topiaContext));
// create financialtransaction and entries
- result += createFinancialTransactionsAndEntries(
- financialTransactions, entries, topiaContext);
+ result.append(createFinancialTransactionsAndEntries(
+ financialTransactions, entries, topiaContext));
commitTransaction(topiaContext);
@@ -527,7 +527,7 @@
} finally {
doFinally(topiaContext, log);
}
- return result;
+ return result.toString();
}
/**
@@ -536,7 +536,7 @@
*/
@Override
public String importAsCSV(String datas, ImportExportEntityEnum importExportEntityEnum) throws LimaException {
- String result = "";
+ StringBuffer result = new StringBuffer();
// FinancialStatements
LinkedHashMap<String, ArrayList<FinancialStatementImport>> financialStatements = null;
@@ -563,17 +563,17 @@
if (ImportExportEntityEnum.valueOfLabel(nextLine[0]) == importExportEntityEnum) {
switch (importExportEntityEnum) {
case ENTRYBOOK:
- result += importEntryBooksChartCSV(nextLine, topiaContext);
+ result.append(importEntryBooksChartCSV(nextLine, topiaContext));
break;
case ACCOUNT:
- result += importAccountsChartsCSV(nextLine, accounts,
- topiaContext);
+ result.append(importAccountsChartsCSV(nextLine, accounts,
+ topiaContext));
break;
case FINANCIALSTATEMENT:
- result += importFinancialsStatementChartCSV(nextLine,
- financialStatements, topiaContext);
+ result.append(importFinancialsStatementChartCSV(nextLine,
+ financialStatements, topiaContext));
break;
}
}
@@ -582,11 +582,11 @@
//create entity
switch (importExportEntityEnum) {
case ACCOUNT:
- result += createAccounts(accounts, topiaContext);
+ result.append(createAccounts(accounts, topiaContext));
break;
case FINANCIALSTATEMENT:
- result += createFinancialStatements(financialStatements,
- topiaContext);
+ result.append(createFinancialStatements(financialStatements,
+ topiaContext));
break;
}
@@ -597,7 +597,7 @@
} finally {
doFinally(topiaContext, log);
}
- return result;
+ return result.toString();
}
@@ -610,7 +610,7 @@
public String importAccountsChartsCSV(String[] nextLine,
Map<String, AccountImport> accounts, TopiaContext topiaContext)
throws LimaException {
- String result = "";
+ StringBuffer result = new StringBuffer();
String accountNumber = nextLine[1];
String label = nextLine[2];
String thirdParty = nextLine[3];
@@ -633,13 +633,13 @@
// put it in hashset
accounts.put(accountNumber, accountImport);
} else {
- result += "FAILED : The account " + accountNumber
- + " already exists !\n";
+ result.append("FAILED : The account " + accountNumber
+ + " already exists !\n");
}
} catch (TopiaException eeeTE) {
doCatch(topiaContext, eeeTE, log);
}
- return result;
+ return result.toString();
}
/**
@@ -649,24 +649,24 @@
public String importFiscalPeriodCSV(String[] nextLine,
List<FiscalPeriod> fiscalPeriods, TopiaContext topiaContext)
throws LimaException {
- String result = "";
+ StringBuffer result = new StringBuffer();
try {
FiscalPeriodDAO fiscalPeriodDAO = LimaCallaoDAOHelper
.getFiscalPeriodDAO(topiaContext);
FiscalPeriod fiscalPeriod = new FiscalPeriodImpl();
- Date beginDate = SDateFormat.parse(nextLine[1]);
+ Date beginDate = SDATEFORMAT.parse(nextLine[1]);
fiscalPeriod.setBeginDate(beginDate);
- Date endDate = SDateFormat.parse(nextLine[2]);
+ Date endDate = SDATEFORMAT.parse(nextLine[2]);
fiscalPeriod.setEndDate(endDate);
- fiscalPeriod.setLocked(new Boolean(nextLine[3]));
+ fiscalPeriod.setLocked(Boolean.parseBoolean(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";
+ result.append("FAILED : The fiscalperiod " + beginDate + "-"
+ + endDate + " already exists !\n");
}
} catch (ParseException eeePE) {
if (log.isDebugEnabled()) {
@@ -675,7 +675,7 @@
} catch (TopiaException eeeTE) {
doCatch(topiaContext, eeeTE, log);
}
- return result;
+ return result.toString();
}
/**
@@ -683,7 +683,7 @@
*/
public String importEntryBooksChartCSV(String[] nextLine,
TopiaContext topiaContext) throws LimaException {
- String result = "";
+ StringBuffer result = new StringBuffer();
try {
EntryBookDAO entryBookDAO = LimaCallaoDAOHelper
@@ -696,18 +696,18 @@
// if exist, skip
if (entryBookDAO.findByCode(entryBook.getCode()) != null) {
- result += "FAILED : The entrybook " + entryBook.getLabel()
- + " already exists !\n";
+ result.append("FAILED : The entrybook " + entryBook.getLabel()
+ + " already exists !\n");
} else {
// create it
entryBookService.createEntryBook(entryBook);
- result += "SUCCESS : The financialStatement "
- + entryBook.getLabel() + " is created ! \n";
+ result.append("SUCCESS : The financialStatement "
+ + entryBook.getLabel() + " is created ! \n");
}
} catch (TopiaException eeeTE) {
doCatch(topiaContext, eeeTE, log);
}
- return result;
+ return result.toString();
}
/**
@@ -722,7 +722,7 @@
String endDate = nextLine[3];
String entryBookCode = nextLine[4];
- if (new Boolean(locked)) {
+ if (Boolean.parseBoolean(locked)) {
ClosedPeriodicEntryBookImport closedPeriodicEntryBookImport = new ClosedPeriodicEntryBookImportImpl();
closedPeriodicEntryBookImport.setLocked(locked);
closedPeriodicEntryBookImport
@@ -744,7 +744,7 @@
public String importFinancialsStatementChartCSV(String[] nextLine,
LinkedHashMap<String, ArrayList<FinancialStatementImport>> financialStatements,
TopiaContext topiaContext) throws LimaException {
- String result = "";
+ StringBuffer result = new StringBuffer();
String label = nextLine[1];
String header = nextLine[2];
@@ -788,13 +788,13 @@
financialStatements.put(label, (ArrayList<FinancialStatementImport>) list);
}
} else {
- result += "FAILED : The financialstatement " + label
- + " already exists !\n";
+ result.append("FAILED : The financialstatement " + label
+ + " already exists !\n");
}
} catch (TopiaException eeeTE) {
doCatch(topiaContext, eeeTE, log);
}
- return result;
+ return result.toString();
}
/**
@@ -852,7 +852,7 @@
public String createFinancialStatements(LinkedHashMap<String, ArrayList<FinancialStatementImport>> financialStatements,
TopiaContext topiaContext) throws LimaException {
- String result = "";
+ StringBuffer result = new StringBuffer();
try {
FinancialStatementDAO financialStatementDAO = LimaCallaoDAOHelper
@@ -911,18 +911,18 @@
masterFinancialStatement,
financialStatement, topiaContext);
- result += "SUCCESS : The financialStatement "
+ result.append("SUCCESS : The financialStatement "
+ financialStatementImport.getLabel()
- + " is created ! \n";
+ + " is created ! \n");
itr2.remove();
} else if (!financialStatements
.containsKey(masterFinancialStatementLabel)) {
- result += "FAILED : The financialStatement "
+ result.append("FAILED : The financialStatement "
+ financialStatementImport.getLabel()
+ " have masterFinancialStatement : "
+ masterFinancialStatementLabel
- + "which not exist \n";
+ + "which not exist \n");
itr2.remove();
}
}
@@ -934,30 +934,30 @@
} catch (TopiaException eeeTE) {
doCatch(topiaContext, eeeTE, log);
}
- return result;
+ return result.toString();
}
public String createFiscalPeriod(List<FiscalPeriod> fiscalPeriods,
TopiaContext topiaContext) {
- String result = "";
+ StringBuffer result = new StringBuffer();
for (FiscalPeriod fiscalPeriod : fiscalPeriods) {
// create fiscalPeriod
try {
fiscalPeriodService.createFiscalPeriodWithTransaction(
fiscalPeriod, topiaContext);
- result += "SUCCESS : The fiscalPeriod "
+ result.append("SUCCESS : The fiscalPeriod "
+ fiscalPeriod.getBeginDate() + "-"
- + fiscalPeriod.getEndDate() + " is created ! \n";
+ + fiscalPeriod.getEndDate() + " is created ! \n");
} catch (LimaException eee) {
- result += "FAILED : " + eee + " \n";
+ result.append("FAILED : " + eee + " \n");
}
}
- return result;
+ return result.toString();
}
public String createAccounts(Map<String, AccountImport> accounts,
TopiaContext topiaContext) throws LimaException {
- String result = "";
+ StringBuffer result = new StringBuffer();
try {
AccountDAO accountDAO = LimaCallaoDAOHelper
@@ -993,16 +993,16 @@
accountService.createAccountWithTransaction(
masterAccount, account, topiaContext);
}
- result += "SUCCESS : The account "
+ result.append("SUCCESS : The account "
+ accountImport.getAccountNumber()
- + " is created ! \n";
+ + " is created ! \n");
itr.remove();
} else if (!accounts.containsKey(masterAccountNumber)
&& !accounts.containsKey(generalLedgerNumber)) {
- result += "FAILED : The account "
+ result.append("FAILED : The account "
+ accountImport.getAccountNumber()
+ " have masterAccount : "
- + masterAccountNumber + "which not exist \n";
+ + masterAccountNumber + "which not exist \n");
itr.remove();
}
}
@@ -1010,13 +1010,13 @@
} catch (TopiaException eeeTE) {
doCatch(topiaContext, eeeTE, log);
}
- return result;
+ return result.toString();
}
public String updateClosedPeriodicEntryBooks(
List<ClosedPeriodicEntryBookImport> closedPeriodicEntryBooks,
TopiaContext topiaContext) throws LimaException {
- String result = "";
+ StringBuffer result = new StringBuffer();
try {
FinancialPeriodDAO financialPeriodDAO = LimaCallaoDAOHelper
@@ -1027,10 +1027,10 @@
.getClosedPeriodicEntryBookDAO(topiaContext);
for (ClosedPeriodicEntryBookImport closedPeriodicEntryBookImport : closedPeriodicEntryBooks) {
// update closedPeriodicEntryBook
- Date beginDateFinancialPeriod = SDateFormat
+ Date beginDateFinancialPeriod = SDATEFORMAT
.parse(closedPeriodicEntryBookImport
.getBeginDateFinancialPeriod());
- Date endDateFinancialPeriod = SDateFormat
+ Date endDateFinancialPeriod = SDATEFORMAT
.parse(closedPeriodicEntryBookImport
.getEndDateFinancialPeriod());
FinancialPeriod financialPeriod = financialPeriodDAO
@@ -1046,12 +1046,12 @@
financialPeriodService
.blockClosedPeriodicEntryBookWithTransaction(
closedPeriodicEntryBook, topiaContext);
- result += "SUCCESS : The blockClosedPeriodicEntryBook "
+ result.append("SUCCESS : The blockClosedPeriodicEntryBook "
+ beginDateFinancialPeriod + "-"
+ endDateFinancialPeriod + ", " + codeEntryBook
- + " is updated ! \n";
+ + " is updated ! \n");
} catch (LimaException eee) {
- result += "FAILED : " + eee + " \n";
+ result.append("FAILED : " + eee + " \n");
}
}
} catch (TopiaException eeeTE) {
@@ -1061,14 +1061,14 @@
log.debug("Can't parse date", eeePE);
}
}
- return result;
+ return result.toString();
}
public String createFinancialTransactionsAndEntries(
Map<Integer, FinancialTransactionImport> financialTransactions,
Map<Integer, List<EntryImport>> entries, TopiaContext topiaContext)
throws LimaException {
- String result = "";
+ StringBuffer result = new StringBuffer();
try {
EntryBookDAO entryBookDAO = LimaCallaoDAOHelper
.getEntryBookDAO(topiaContext);
@@ -1085,7 +1085,7 @@
FinancialTransactionImport financialTransactionImport = map
.getValue();
FinancialTransaction financialTransaction = new FinancialTransactionImpl();
- Date dateFinancialTransaction = SDateFormat
+ Date dateFinancialTransaction = SDATEFORMAT
.parse(financialTransactionImport.getDate());
financialTransaction
.setTransactionDate(dateFinancialTransaction);
@@ -1112,7 +1112,7 @@
entry.setAccount(account);
entry.setDescription(entryImport.getDescription());
entry.setAmount(new BigDecimal(entryImport.getAmount()));
- entry.setDebit(new Boolean(entryImport.getDebit()));
+ entry.setDebit(Boolean.parseBoolean(entryImport.getDebit()));
entry.setLettering(entryImport.getLettering());
entry.setDetail(entryImport.getDetail());
entry.setVoucher(entryImport.getVoucher());
@@ -1128,12 +1128,12 @@
log.debug("Can't parse date", eeePE);
}
}
- return result;
+ return result.toString();
}
public String importIdentity(String[] nextLine, TopiaContext topiaContext)
throws LimaException {
- String result = "";
+ StringBuffer result = new StringBuffer();
Identity identity = new IdentityImpl();
nextLine[0] = ImportExportEntityEnum.IDENTITY.getLabel();
@@ -1151,10 +1151,10 @@
identityService.updateIdentityWithTransaction(identity, topiaContext);
// create it
- result += "SUCCESS : The identity " + identity.getName()
- + " is created ! \n";
+ result.append("SUCCESS : The identity " + identity.getName()
+ + " is created ! \n");
- return result;
+ return result.toString();
}
protected TopiaContext beginTransaction() throws TopiaException {
Deleted: 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-08-20 12:11:16 UTC (rev 3009)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/RecordServiceImpl.java 2010-08-20 23:46:18 UTC (rev 3010)
@@ -1,371 +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.ejb;
-
-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.business.LimaConfig;
-import org.chorem.lima.business.LimaException;
-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;
-import org.nuiton.topia.TopiaContext;
-import org.nuiton.topia.TopiaContextFactory;
-import org.nuiton.topia.TopiaException;
-import org.nuiton.topia.TopiaNotFoundException;
-
-/**
- * Permet d'ajouter des logs au systeme.
- *
- * ATTENTION on ne peut supprimer un log.
- *
- * @author Rémi Chapelet
- */
-@Stateless
-public class RecordServiceImpl implements RecordService, RecordServiceLocal {
-
- /** log */
- private static final Log log = LogFactory.getLog(RecordServiceImpl.class);
-
- private TopiaContext rootContext;
-
-
- public RecordServiceImpl() {
- LimaConfig config = LimaConfig.getInstance();
- try {
- rootContext = TopiaContextFactory.getContext(config.getOptions());
- } catch (TopiaNotFoundException ex) {
- if (log.isErrorEnabled()) {
- log.error("Can't init topia context", ex);
- }
- }
- }
-
- /**
- * Création d'un log dans le systeme.
- *
- * @param entryLog date de creation du log
- * @throws LimaException
- */
- public void addLog(Record entryLog) throws LimaException {
- /*String result = ServiceHelper.RESPOND_ERROR;
- try {
- // Acces BDD
- TopiaContext topiaContext = rootContext.beginTransaction();
- // Chargement du DAO
- EntryLogDAO logDAO = LimaCallaoDAOHelper.getEntryLogDAO(topiaContext);
- // Creation du log
- EntryLog newlog = logDAO.create();
- newlog.setLogDate(logDate);
- newlog.setTransDate(transDate);
- newlog.setVoucherRef(voucherRef);
- newlog.setType(type);
- newlog.setTransDesc(transDesc);
- newlog.setEntryDesc(entryDesc);
- newlog.setAmount(amount);
- newlog.setDebit(debit);
- newlog.setLettering(lettering);
- // Création BDD
- topiaContext.commitTransaction();
- // Fermeture BDD
- topiaContext.closeContext();
- // Affichage pour les logs
- String topiaId = newlog.getTopiaId();
- if (log.isInfoEnabled()) {
- log.info("Log created: "+ topiaId);
- }
- result = ServiceHelper.RESPOND_SUCCESS;
- }catch (TopiaException e) {
- log.error(e);
- }
- return result;*/
-
- TopiaContext transaction = null;
- try {
- // basic check done, make check in database
- // TODO move it into JTA
- transaction = rootContext.beginTransaction();
-
- // creation
- RecordDAO recordDAO = LimaCallaoDAOHelper
- .getRecordDAO(transaction);
- recordDAO.create(entryLog);
-
- // commit
- transaction.commitTransaction();
- } catch (TopiaException ex) {
- if (transaction != null) {
- try {
- transaction.rollbackTransaction();
- } catch (TopiaException e) {
- if (log.isErrorEnabled()) {
- log.error("Error during rollback context", ex);
- }
- }
- }
- if (log.isErrorEnabled()) {
- log.error("Error during create account", ex);
- }
- throw new LimaException("Can't create entry log", ex);
- } finally {
- if (transaction != null) {
- try {
- transaction.closeContext();
- } catch (TopiaException ex) {
- if (log.isErrorEnabled()) {
- log.error("Error during rollback context", ex);
- }
- throw new LimaException("Can't create entry log", ex);
- }
- }
- }
- }
-
- /*
- * Création d'un log à partir d'un log DTO.
- * @param logDTO log en format DTO qu'on souhaite créer
- * @return
- *
- public String addLog (LogDTO logDTO) {
- String result = ServiceHelper.RESPOND_ERROR;
- // Vérifie si logDTO existe
- if (logDTO != null)
- {
- result = addLog(logDTO.getLogDate(),logDTO.getTransDate(),logDTO.getType(),
- logDTO.getVoucherRef(),logDTO.getTransDesc(),logDTO.getEntryDesc(),
- logDTO.getAmount(),logDTO.isDebit(),logDTO.getLettering());
- }
- return result;
- }*/
-
- /**
- * Recherche tous les logs dans la base de donnees.
- *
- * @return la liste des logs
- * @throws LimaException
- */
- public List<Record> listeAllLog() throws LimaException {
- /*List<EntryLog> listelog = null;
- try {
- // Acces BDD
- TopiaContext topiaContext = rootContext.beginTransaction();
- // Chargement du DAO
- EntryLogDAO logDAO = LimaCallaoDAOHelper
- .getEntryLogDAO(topiaContext);
- // recherche des log
- listelog = logDAO.findAll();
- // Fermeture BDD
- topiaContext.closeContext();
- if (log.isInfoEnabled()) {
- log.info("Search all logs");
- }
- } catch (TopiaException e) {
- log.error(e);
- }
- return listelog;*/
-
- List<Record> entryLogsList = new ArrayList<Record>();
- TopiaContext transaction = null;
- try {
- // basic check done, make check in database
- // TODO move it into JTA
- transaction = rootContext.beginTransaction();
-
- // creation
- RecordDAO recordDAO = LimaCallaoDAOHelper
- .getRecordDAO(transaction);
- List<Record> entryLogs = recordDAO.findAll();
- entryLogsList.addAll(entryLogs);
-
- // commit
- transaction.commitTransaction();
- } catch (TopiaException ex) {
- if (transaction != null) {
- try {
- transaction.rollbackTransaction();
- } catch (TopiaException e) {
- if (log.isErrorEnabled()) {
- log.error("Error during rollback context", ex);
- }
- }
- }
- if (log.isErrorEnabled()) {
- log.error("Error during create account", ex);
- }
- throw new LimaException("Can't create entry log", ex);
- } finally {
- if (transaction != null) {
- try {
- transaction.closeContext();
- } catch (TopiaException ex) {
- if (log.isErrorEnabled()) {
- log.error("Error during rollback context", ex);
- }
- throw new LimaException("Can't create entry log", ex);
- }
- }
- }
-
- return entryLogsList;
- }
-
- /*
- * Permet de renvoyer tous les logs au format DTO.
- * @return
- *
- public List<LogDTO> listeAllLogDTO() {
- List<LogDTO> listLogDTO = new ArrayList<LogDTO>();
- // On recherche tous les logs.
- List<EntryLog> listLog = listeAllLog();
- // Pour chaque log, on le converti en logDTO et on l'ajoute à la nouvelle liste de DTO
- for (EntryLog log : listLog) {
- // conerti de l'entity en DTO
- LogDTO logDTO = convertLog.logEntityToDto(log);
- // Ajoute à la liste des logs DTO
- listLogDTO.add(logDTO);
- }
- return listLogDTO;
- }*/
-
- /*
- * Renvoie une liste de tous les logs suivant la date de creation
- * @param datecreate date de creation des logs recherchés
- * @return une liste des logs trouves
- *
- public List<EntryLog> searchLogWithDateCreate(Date dateCreate) {
- List<EntryLog> listelog = null;
- try {
- // Acces BDD
- TopiaContext topiaContext = rootContext.beginTransaction();
- // Chargement du DAO
- EntryLogDAO logDAO = LimaCallaoDAOHelper
- .getEntryLogDAO(topiaContext);
- // recherche des log
- listelog = logDAO.findAllByLogDate(dateCreate);
- // Fermeture BDD
- topiaContext.closeContext();
- if (log.isInfoEnabled()) {
- log.info("Log(s) find : " + listelog.size() + "log(s)");
- }
- } catch (TopiaException e) {
- log.error(e);
- }
- return listelog;
- }*/
-
- /*
- * Permet de rechercher tous les logs suivant la date de création, c'est à
- * dire de l'opération effectuée sur une entry à un jour précis, et qui a
- * déclenchée automatiquement une création de log.
- * La méthode renvoie sous forme de liste, en convertissant les objets
- * entitys en DTO.
- * @param dateCreate date de création des logs recherchés
- * @return
- *
- public List<LogDTO> searchLogDTOWithDateCreate(Date dateCreate) {
- List<LogDTO> listLogDTO = new ArrayList<LogDTO>();
- // On recherche tous les logs suivant la date de création.
- List<EntryLog> listLog = searchLogWithDateCreate(dateCreate);
- // Pour chaque log, on le converti en logDTO et on l'ajoute à la nouvelle liste de DTO
- for (EntryLog log : listLog) {
- // conerti de l'entity en DTO
- LogDTO logDTO = convertLog.logEntityToDto(log);
- // Ajoute à la liste des logs DTO
- listLogDTO.add(logDTO);
- }
- return listLogDTO;
- }*/
-
- /*
- * Recherche un log avec son identifiant topiaId.
- * @param topiaId identifiant d'un log
- * @return
- *
- public EntryLog searchLogWithTopiaId(String topiaId) {
- EntryLog logSearch = null;
- try {
- // Acces BDD
- TopiaContext topiaContext = rootContext.beginTransaction();
- // Chargement du DAO
- EntryLogDAO logDAO = LimaCallaoDAOHelper
- .getEntryLogDAO(topiaContext);
- // Creation du journal
- logSearch = logDAO.findByTopiaId(topiaId);
- // Fermeture BDD
- topiaContext.closeContext();
- } catch (TopiaException e) {
- log.error(e);
- }
- return logSearch;
- }*/
-
- /*
- * Efface un log : uniquement utilisé pour supprimer les logs dans les tests
- * unitaires.
- * @param topiaId identifiant du log à supprimer
- * @return
- *
- public String removeLog(String topiaId) {
- String result = ServiceHelper.RESPOND_ERROR;
- EntryLog logDelete = searchLogWithTopiaId(topiaId);
- // Si le log n'existe pas
- if (logDelete == null) {
- if (log.isWarnEnabled()) {
- log.warn("Le log " + topiaId + " n'existe pas !");
- }
- } else // Sinon on efface le log
- {
- try {
- // Acces BDD
- TopiaContext topiaContext = rootContext.beginTransaction();
- // Chargement du DAO
- EntryLogDAO logDAO = LimaCallaoDAOHelper
- .getEntryLogDAO(topiaContext);
- // Supprime le log
- logDAO.delete(logDelete);
- // Création BDD
- topiaContext.commitTransaction();
- // Fermeture BDD
- topiaContext.closeContext();
- result = ServiceHelper.RESPOND_SUCCESS;
- } catch (TopiaException e) {
- log.error(e);
- }
- }
- return result;
- }*/
-
- /*
- * Permet de supprimer un log à partir de son DTO.
- * @param logDTO log à supprimer
- * @return
- *
- public String removeLog(LogDTO logDTO) {
- String result = removeLog(logDTO.getId());
- return result;
- }*/
-}
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java 2010-08-20 12:11:16 UTC (rev 3009)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java 2010-08-20 23:46:18 UTC (rev 3010)
@@ -105,7 +105,7 @@
BigDecimal solde = new BigDecimal(0);
List<Entry> entries = new ArrayList<Entry>();
if (account != null){
-
+
//Get allsubaccounts and thirdParts accounts
List<Account> accounts = (List<Account>) account.getSubAccounts();
if (thirdPartAccountsMode){
@@ -183,7 +183,6 @@
* Get list entries
* Calculate all credit, debit and solde amounts for the accounts reports
*/
- @SuppressWarnings("unchecked")
protected ReportsDatas generateSubAccountReportsWithTransaction(Account account, Date beginDate, Date endDate, TopiaContext topiaContext) throws LimaException {
ReportsDatas reportsDatas = new ReportsDatasImpl();
BigDecimal credit = new BigDecimal(0);
@@ -254,7 +253,6 @@
*
* Get all entries if true
*/
- @SuppressWarnings("unchecked")
protected ReportsDatas generateSubAccountBalanceWithTransaction(Account account, Date beginDate, Date endDate, Boolean getEntries, TopiaContext topiaContext) throws LimaException {
ReportsDatas reportsDatas = new ReportsDatasImpl();
BigDecimal credit = new BigDecimal(0);
@@ -332,7 +330,6 @@
* Just balanced transaction are calculated
*
*/
- @SuppressWarnings({ "unchecked" })
@Override
public ReportsDatas generateEntryBooksReports(EntryBook entryBook, Date beginDate, Date endDate) throws LimaException {
ReportsDatas reportsDatas = new ReportsDatasImpl();
@@ -468,15 +465,15 @@
List<Account> accounts =null;
//Remove Spaces
- selectedAccounts = StringUtils.deleteWhitespace(selectedAccounts);
+ String result = StringUtils.deleteWhitespace(selectedAccounts);
//if no filter account
- if (selectedAccounts == null || selectedAccounts.equals("")){
+ if (result == null || result.equals("")){
accounts = accountDAO.findAll();
}
//build list account from selectedAccounts
else{
accounts = accountDAO.stringToListAccounts(
- selectedAccounts, false);
+ result, false);
}
for (Account account : accounts) {
ReportsDatas reportsDatas =
@@ -549,15 +546,4 @@
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;
- }
- }
-
}
Deleted: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/UserServiceImpl.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/UserServiceImpl.java 2010-08-20 12:11:16 UTC (rev 3009)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/UserServiceImpl.java 2010-08-20 23:46:18 UTC (rev 3010)
@@ -1,114 +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.ejb;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.chorem.lima.business.LimaConfig;
-import org.nuiton.topia.TopiaContext;
-import org.nuiton.topia.TopiaContextFactory;
-import org.nuiton.topia.TopiaNotFoundException;
-
-/**
- * User service.
- *
- * @author chatellier
- * @version $Revision$
- *
- * Last update : $Date$
- * By : $Author$
- */
-public class UserServiceImpl {
-
- /** log */
- private static final Log log = LogFactory.getLog(UserServiceImpl.class);
-
- private TopiaContext rootContext;
-
- public UserServiceImpl() {
- LimaConfig config = LimaConfig.getInstance();
- try {
- rootContext = TopiaContextFactory.getContext(config.getOptions());
- } catch (TopiaNotFoundException ex) {
- if (log.isErrorEnabled()) {
- log.error("Can't init topia context", ex);
- }
- }
- }
-
- /**
- * Add new user.
- *
- * @param name new user name
- * @throws LimaException
- */
- /*
- public void addUser(User user/*String name) throws LimaException {
- // Attention doublon utilisateur
- try {
- // Acces BDD
- TopiaContext topiaContext = rootContext.beginTransaction();
- // Chargement du DAO
- UsersDAO userdao = LimaCallaoDAOHelper.getUsersDAO(topiaContext);
- // Création de l'user
- Users newuser = userdao.create();
- newuser.setMatcher(name);
- // Création BDD
- topiaContext.commitTransaction();
- topiaContext.closeContext();
- if (log.isInfoEnabled()) {
- log.info("Add user : " + name);
- }
- } catch (TopiaException ex) {
- if (log.isErrorEnabled()) {
- log.error("Can't create user", ex);
- throw new LimaException("Can't create user", ex);
- }
-
- }
- }*/
-
- /**
- * Find user with name.
- *
- * @param name
- * @throws LimaException
- */
- /*public void findUser(String name) throws LimaException {
- /*try {
- // Acces BDD
- TopiaContext topiaContext = rootContext.beginTransaction();
- // Chargement du DAO
- UsersDAO userdao = LimaCallaoDAOHelper.getUsersDAO(topiaContext);
- // Recherche du user
- Users newuser = userdao.findByMatcher(name);
- // Fermeture BDD
- topiaContext.closeContext();
- if (newuser == null) {
- throw new LimaBusinessException("can't find user " + name);
- }
- } catch (TopiaException ex) {
- if (log.isErrorEnabled()) {
- log.error("Can't find user", ex);
- throw new LimaException("Can't find user", ex);
- }
- }
- }*/
-}
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-08-20 12:11:16 UTC (rev 3009)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/AccountService.java 2010-08-20 23:46:18 UTC (rev 3010)
@@ -21,7 +21,6 @@
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;
@@ -51,13 +50,13 @@
* @throws LimaException
*/
//EJB Remote
- void createAccount(Account masterAccount, Account account) throws LimaException, LimaBusinessException;
+ void createAccount(Account masterAccount, Account account) throws LimaException;
- void createSubLedger(Account masterAccount, Account account) throws LimaException, LimaBusinessException;
+ void createSubLedger(Account masterAccount, Account account) throws LimaException;
- void updateAccount(Account account) throws LimaException, LimaBusinessException;
+ void updateAccount(Account account) throws LimaException;
- void removeAccount(Account account) throws LimaException, LimaBusinessException;
+ void removeAccount(Account account) throws LimaException;
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/AccountServiceLocal.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/AccountServiceLocal.java 2010-08-20 12:11:16 UTC (rev 3009)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/AccountServiceLocal.java 2010-08-20 23:46:18 UTC (rev 3010)
@@ -19,10 +19,7 @@
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;
@@ -40,7 +37,7 @@
@Local
public interface AccountServiceLocal extends AccountService{
- void createAccountWithTransaction(Account masterAccount, Account account, TopiaContext topiaContext) throws LimaException, LimaBusinessException;
+ void createAccountWithTransaction(Account masterAccount, Account account, TopiaContext topiaContext) throws LimaException;
void createSubLedgerWithTransaction(Account masterAccount, Account account, TopiaContext topiaContext) throws LimaException;
}
\ No newline at end of file
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/DocumentService.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/DocumentService.java 2010-08-20 12:11:16 UTC (rev 3009)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/DocumentService.java 2010-08-20 23:46:18 UTC (rev 3010)
@@ -33,10 +33,10 @@
@Remote
public interface DocumentService {
- public void createFinancialStatementsDocuments(Date beginDate, Date endDate, FormatsEnum format) throws LimaException;
- public void createLedgerDocuments(Date beginDate, Date endDate, FormatsEnum format) throws LimaException;
- public void createEntryBooksDocuments(Date beginDate, Date endDate, FormatsEnum format) throws LimaException;
- public void createBalanceDocuments(Date beginDate, Date endDate, FormatsEnum format) throws LimaException;
- public void createGeneralEntryBooksDocuments(Date beginDate, Date endDate, FormatsEnum format) throws LimaException;
+ void createFinancialStatementsDocuments(Date beginDate, Date endDate, FormatsEnum format) throws LimaException;
+ void createLedgerDocuments(Date beginDate, Date endDate, FormatsEnum format) throws LimaException;
+ void createEntryBooksDocuments(Date beginDate, Date endDate, FormatsEnum format) throws LimaException;
+ void createBalanceDocuments(Date beginDate, Date endDate, FormatsEnum format) throws LimaException;
+ void createGeneralEntryBooksDocuments(Date beginDate, Date endDate, FormatsEnum format) throws LimaException;
}
Modified: 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 2010-08-20 12:11:16 UTC (rev 3009)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/DocumentServiceLocal.java 2010-08-20 23:46:18 UTC (rev 3010)
@@ -30,5 +30,4 @@
@Local
public interface DocumentServiceLocal {
-
}
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/EntryBookServiceLocal.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/EntryBookServiceLocal.java 2010-08-20 12:11:16 UTC (rev 3009)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/EntryBookServiceLocal.java 2010-08-20 23:46:18 UTC (rev 3010)
@@ -39,6 +39,6 @@
@Local
public interface EntryBookServiceLocal extends EntryBookService {
- public void createEntryBookWithTransaction(EntryBook entryBook, TopiaContext topiaContext) throws LimaException;
+ void createEntryBookWithTransaction(EntryBook entryBook, TopiaContext topiaContext) throws LimaException;
}
Modified: 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 2010-08-20 12:11:16 UTC (rev 3009)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ExportService.java 2010-08-20 23:46:18 UTC (rev 3010)
@@ -43,32 +43,32 @@
* @return export as byte array
* @throws LimaException
*/
- public String exportAsCSV() throws LimaException;
+ String exportAsCSV() throws LimaException;
/**
* export entrybook chart as CSV.
*/
- public String exportEntryBookChartAsCSV() throws LimaException;
+ String exportEntryBookChartAsCSV() throws LimaException;
/**
* export financialstatement chart as CSV.
*/
- public String exportFinancialStatementChartAsCSV() throws LimaException;
+ String exportFinancialStatementChartAsCSV() throws LimaException;
/**
* export accounts chart as CSV.
*/
- public String exportAccountsChartAsCSV() throws LimaException;
+ String exportAccountsChartAsCSV() throws LimaException;
/**
* export entries as EBP
*/
- public String exportEntriesAsEBP() throws LimaException;
+ String exportEntriesAsEBP() throws LimaException;
/**
* export accounts as EBP
*/
- public String exportAccountsAsEBP() throws LimaException;
+ String exportAccountsAsEBP() throws LimaException;
}
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialStatementService.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialStatementService.java 2010-08-20 12:11:16 UTC (rev 3009)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialStatementService.java 2010-08-20 23:46:18 UTC (rev 3010)
@@ -23,7 +23,6 @@
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;
@@ -31,17 +30,17 @@
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 void removeAllFinancialStatement() throws LimaException, LimaBusinessException;
+ void createFinancialStatement(FinancialStatement masterFinancialStatement, FinancialStatement financialStatement) throws LimaException;
+ void updateFinancialStatement(FinancialStatement financialStatement) throws LimaException;
+ void removeFinancialStatement(FinancialStatement financialStatement) throws LimaException;
+ void removeAllFinancialStatement() throws LimaException;
- 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;
+ List<FinancialStatement> getAllFinancialStatements() throws LimaException;
+ List<FinancialStatement> getChildrenFinancialStatement(FinancialStatement financialStatement) throws LimaException;
+ List<FinancialStatement> getAllChildrenFinancialStatement(FinancialStatement financialStatement, List<FinancialStatement> financialStatements) throws LimaException;
- public List<FinancialStatementAmounts> financialStatementReport(Date selectedBeginDate, Date selectedEndDate) throws LimaException;
+ List<FinancialStatementAmounts> financialStatementReport(Date selectedBeginDate, Date selectedEndDate) throws LimaException;
- public String checkFinancialStatementChart() throws LimaException;
+ String checkFinancialStatementChart() throws LimaException;
}
Modified: 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 2010-08-20 12:11:16 UTC (rev 3009)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialStatementServiceLocal.java 2010-08-20 23:46:18 UTC (rev 3010)
@@ -20,8 +20,6 @@
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;
@@ -29,8 +27,8 @@
@Local
public interface FinancialStatementServiceLocal extends FinancialStatementService {
- public void createFinancialStatementWithTransaction(FinancialStatement masterFinancialStatement,
- FinancialStatement financialStatement, TopiaContext topiaContext) throws LimaException, LimaBusinessException;
+ void createFinancialStatementWithTransaction(FinancialStatement masterFinancialStatement,
+ FinancialStatement financialStatement, TopiaContext topiaContext) throws LimaException;
}
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialTransactionService.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialTransactionService.java 2010-08-20 12:11:16 UTC (rev 3009)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialTransactionService.java 2010-08-20 23:46:18 UTC (rev 3010)
@@ -22,11 +22,8 @@
import java.util.Date;
import java.util.List;
import java.util.Set;
-
import javax.ejb.Remote;
-
import org.chorem.lima.FinancialStatementWayEnum;
-import org.chorem.lima.business.LimaBusinessException;
import org.chorem.lima.business.LimaException;
import org.chorem.lima.entity.Account;
import org.chorem.lima.entity.Entry;
@@ -69,7 +66,7 @@
void createFinancialTransaction(FinancialTransaction financialtransaction) throws LimaException;
- void updateFinancialTransaction(FinancialTransaction financialtransaction) throws LimaException, LimaBusinessException;
+ void updateFinancialTransaction(FinancialTransaction financialtransaction) throws LimaException;
void removeFinancialTransaction(FinancialTransaction financialtransaction) throws LimaException;
Modified: 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 2010-08-20 12:11:16 UTC (rev 3009)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/FinancialTransactionServiceLocal.java 2010-08-20 23:46:18 UTC (rev 3010)
@@ -21,8 +21,6 @@
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;
@@ -41,11 +39,11 @@
@Local
public interface FinancialTransactionServiceLocal extends FinancialTransactionService {
- public List<FinancialTransaction> getAllFinancialTransactionsBalanced(TopiaContext topiaContext) throws LimaException;
+ 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 updateFinancialTransactionWithTransaction(FinancialTransaction financialtransaction, TopiaContext topiaContext) throws LimaException;
void createEntryWithTransaction(Entry entry, TopiaContext topiaContext) throws LimaException;
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/HttpServerService.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/HttpServerService.java 2010-08-20 12:11:16 UTC (rev 3009)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/HttpServerService.java 2010-08-20 23:46:18 UTC (rev 3010)
@@ -25,7 +25,7 @@
@Remote
public interface HttpServerService {
- public void start();
- public int getHttpPort();
+ void start();
+ int getHttpPort();
}
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/IdentityService.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/IdentityService.java 2010-08-20 12:11:16 UTC (rev 3009)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/IdentityService.java 2010-08-20 23:46:18 UTC (rev 3010)
@@ -27,7 +27,7 @@
@Remote
public interface IdentityService {
- public Identity getIdentity() throws LimaException;
- public void updateIdentity(Identity identity) throws LimaException;
+ Identity getIdentity() throws LimaException;
+ void updateIdentity(Identity identity) throws LimaException;
}
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-08-20 12:11:16 UTC (rev 3009)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/IdentityServiceLocal.java 2010-08-20 23:46:18 UTC (rev 3010)
@@ -28,7 +28,7 @@
@Local
public interface IdentityServiceLocal {
- public void updateIdentityWithTransaction(Identity identity, TopiaContext topiaContext) throws LimaException;
- public Identity getIdentityWithTransaction(TopiaContext topiaContext) throws LimaException;
+ void updateIdentityWithTransaction(Identity identity, TopiaContext topiaContext) throws LimaException;
+ Identity getIdentityWithTransaction(TopiaContext topiaContext) throws LimaException;
}
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ImportService.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ImportService.java 2010-08-20 12:11:16 UTC (rev 3009)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ImportService.java 2010-08-20 23:46:18 UTC (rev 3010)
@@ -43,8 +43,8 @@
* @param data
* @throws LimaException
*/
- public String importEntriesFromEbp(String datas) throws LimaException;
- public String importAccountsChartFromEbp(String datas) throws LimaException;
+ String importEntriesFromEbp(String datas) throws LimaException;
+ String importAccountsChartFromEbp(String datas) throws LimaException;
/**
@@ -53,7 +53,7 @@
* @param data
* @throws LimaException
*/
- public void importAsSage(byte[] data) throws LimaException;
+ void importAsSage(byte[] data) throws LimaException;
/**
* Import data as Ciel Compta export.
@@ -61,13 +61,13 @@
* @param data
* @throws LimaException
*/
- public void importAsCiel(byte[] data) throws LimaException;
+ void importAsCiel(byte[] data) throws LimaException;
/**
* import CSV.
* Return result log
*/
- public String importAllAsCSV(String path) throws LimaException;
+ String importAllAsCSV(String path) throws LimaException;
- public String importAsCSV(String path, ImportExportEntityEnum importExportEntityEnum) throws LimaException;
+ String importAsCSV(String path, ImportExportEntityEnum importExportEntityEnum) throws LimaException;
}
Deleted: 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 2010-08-20 12:11:16 UTC (rev 3009)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/RecordService.java 2010-08-20 23:46:18 UTC (rev 3010)
@@ -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.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;
-}
Deleted: 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 2010-08-20 12:11:16 UTC (rev 3009)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/RecordServiceLocal.java 2010-08-20 23:46:18 UTC (rev 3010)
@@ -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.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 {
-
-}
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ReportServiceLocal.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ReportServiceLocal.java 2010-08-20 12:11:16 UTC (rev 3009)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ReportServiceLocal.java 2010-08-20 23:46:18 UTC (rev 3010)
@@ -46,6 +46,6 @@
@Local
public interface ReportServiceLocal extends ReportService {
- public ReportsDatas generateAccountReportsWithTransaction (Account account, Boolean thirdPartAccountsMode, Date beginDate, Date endDate, TopiaContext topiaContext) throws LimaException;
+ ReportsDatas generateAccountReportsWithTransaction (Account account, Boolean thirdPartAccountsMode, Date beginDate, Date endDate, TopiaContext topiaContext) throws LimaException;
}
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/utils/AccountComparator.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/utils/AccountComparator.java 2010-08-20 12:11:16 UTC (rev 3009)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/utils/AccountComparator.java 2010-08-20 23:46:18 UTC (rev 3010)
@@ -19,12 +19,15 @@
package org.chorem.lima.business.utils;
+import java.io.Serializable;
import java.util.Comparator;
import org.chorem.lima.entity.Account;
-public class AccountComparator implements Comparator<Account>{
+public class AccountComparator implements Serializable, Comparator<Account>{
- /**
+ private static final long serialVersionUID = 1L;
+
+ /**
* sort by accout number in lexicographical order
*/
@Override
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/utils/AccountEBPComparator.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/utils/AccountEBPComparator.java 2010-08-20 12:11:16 UTC (rev 3009)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/utils/AccountEBPComparator.java 2010-08-20 23:46:18 UTC (rev 3010)
@@ -1,11 +1,14 @@
package org.chorem.lima.business.utils;
+import java.io.Serializable;
import java.util.Comparator;
import org.chorem.lima.beans.AccountEBP;
-public class AccountEBPComparator implements Comparator<AccountEBP> {
+public class AccountEBPComparator implements Serializable, Comparator<AccountEBP> {
+ private static final long serialVersionUID = 1L;
+
@Override
public int compare(AccountEBP o1, AccountEBP o2) {
return o1.getNumero().compareTo(o2.getNumero());
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/utils/EntryComparator.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/utils/EntryComparator.java 2010-08-20 12:11:16 UTC (rev 3009)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/utils/EntryComparator.java 2010-08-20 23:46:18 UTC (rev 3010)
@@ -19,11 +19,14 @@
package org.chorem.lima.business.utils;
+import java.io.Serializable;
import java.util.Comparator;
import org.chorem.lima.entity.Entry;
-public class EntryComparator implements Comparator<Entry>{
+public class EntryComparator implements Serializable, Comparator<Entry>{
+ private static final long serialVersionUID = 1L;
+
@Override
public int compare(Entry o1, Entry o2) {
return o1.getTopiaCreateDate().compareTo(o2.getTopiaCreateDate());
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/utils/EntryEBPComparator.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/utils/EntryEBPComparator.java 2010-08-20 12:11:16 UTC (rev 3009)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/utils/EntryEBPComparator.java 2010-08-20 23:46:18 UTC (rev 3010)
@@ -19,11 +19,14 @@
package org.chorem.lima.business.utils;
+import java.io.Serializable;
import java.util.Comparator;
import org.chorem.lima.beans.EntryEBP;
-public class EntryEBPComparator implements Comparator<EntryEBP>{
+public class EntryEBPComparator implements Serializable, Comparator<EntryEBP>{
+ private static final long serialVersionUID = 1L;
+
@Override
public int compare(EntryEBP o1, EntryEBP o2) {
Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/utils/FiscalPeriodComparator.java
===================================================================
--- trunk/lima-business/src/main/java/org/chorem/lima/business/utils/FiscalPeriodComparator.java 2010-08-20 12:11:16 UTC (rev 3009)
+++ trunk/lima-business/src/main/java/org/chorem/lima/business/utils/FiscalPeriodComparator.java 2010-08-20 23:46:18 UTC (rev 3010)
@@ -19,11 +19,14 @@
package org.chorem.lima.business.utils;
+import java.io.Serializable;
import java.util.Comparator;
import org.chorem.lima.entity.FiscalPeriod;
-public class FiscalPeriodComparator implements Comparator<FiscalPeriod>{
+public class FiscalPeriodComparator implements Serializable, Comparator<FiscalPeriod>{
+ private static final long serialVersionUID = 1L;
+
/**
* sort by fiscal begin date
*/
Modified: trunk/lima-business/src/test/java/org/chorem/lima/business/LimaConfigTest.java
===================================================================
--- trunk/lima-business/src/test/java/org/chorem/lima/business/LimaConfigTest.java 2010-08-20 12:11:16 UTC (rev 3009)
+++ trunk/lima-business/src/test/java/org/chorem/lima/business/LimaConfigTest.java 2010-08-20 23:46:18 UTC (rev 3010)
@@ -20,9 +20,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.chorem.lima.entity.LimaCallaoDAOHelper;
import org.junit.Ignore;
-import org.nuiton.util.ArgumentsParserException;
/**
* TODO add comment here.
@@ -40,12 +38,13 @@
private static final String configFile = "lima_test.properties";
+ /*
public static LimaConfig getInstance() {
-
+
if (instance == null) {
instance = new LimaConfig();
instance.loadConfiguration(configFile);
}
return instance;
- }
+ }*/
}
Deleted: trunk/lima-business/src/test/java/org/chorem/lima/business/RecordServiceImplTest.java
===================================================================
--- trunk/lima-business/src/test/java/org/chorem/lima/business/RecordServiceImplTest.java 2010-08-20 12:11:16 UTC (rev 3009)
+++ trunk/lima-business/src/test/java/org/chorem/lima/business/RecordServiceImplTest.java 2010-08-20 23:46:18 UTC (rev 3010)
@@ -1,109 +0,0 @@
-package org.chorem.lima.business;
-
-import java.util.Date;
-import java.util.List;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.chorem.lima.business.ejb.RecordServiceImpl;
-import org.chorem.lima.entity.Record;
-import org.junit.AfterClass;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- * Tests pour la gestion des timespans
- * @author Rémi Chapelet
- */
-public class RecordServiceImplTest {
-
- /** log. */
- private static final org.apache.commons.logging.Log log = LogFactory
- .getLog(UserServiceImplTest.class);
-
- private static RecordServiceImpl instance;
-
- @BeforeClass
- public static void setUpClass() throws Exception {
- LimaConfigTest.getInstance();
- }
-
- @Before
- public void setUp() {
- instance = new RecordServiceImpl();
- }
-
- @AfterClass
- public static void tearDownClass() throws Exception {
- /*List<LogDTO> list = instance.listeAllLogDTO();
- for (LogDTO logDTO : list)
- {
- instance.removeLog(logDTO);
- }*/
- }
-
- /**
- * Permet de tester la recherche de tous les logs
- */
- @Test
- public void listeAllLogTest() {
- /*// Ajout d'un log
- Date logDate = new Date(2008,1,1);
- Date transDate = new Date();
- instance.addLog(logDate, transDate, "test", "test", "test",
- "test", "test", true, "test");
- // Recherche des logs
- List<EntryLog> result = instance.listeAllLog();
- if (log.isDebugEnabled()) {
- log.debug("Nombre de log : " + result.size());
- }
- // trouve un log
- Assert.assertEquals(1,result.size());*/
- }
-
- /**
- * Test de la fonction de recherche de tous les logs suivant la date
- * de création
- */
- @Test
- public void searchDateCreateTest() {
- /*// Ajout d'un log avec comme date de creation 01/01/2009
- Date logDate = new Date(2009,1,1);
- Date transDate = new Date();
- instance.addLog(logDate, transDate, "test", "test", "test",
- "test", "test", true, "test");
- // Recherche des logs suivant la date
- List<EntryLog> result = instance.searchLogWithDateCreate(logDate);
- if (log.isDebugEnabled()) {
- log.debug("Nombre de log recherche pour la date de creation : "
- + result.size());
- }
- // Apres avoir inséré un log a la date, il doit obligatoirement
- // avoir au moins un log.
- Assert.assertEquals(1,result.size());*/
- }
-
- /**
- * Permet de tester la recherche de logs en format DTO.
- */
- @Test
- public void searchLogDTOWithDateCreate() {
-
- // Création de trois logs DTO
- /*Date logDate = new Date(2000,1,1);
- Date transDate = new Date();
- // Création logDTO
- LogDTO logDTO = new LogDTO("",logDate, "test", transDate, "test", "test",
- "test", "test", true, "test");
- // Ajout de trois logs
- instance.addLog(logDTO);
- instance.addLog(logDTO);
- instance.addLog(logDTO);
- // Recherche de ses trois logs sous forme de list de DTO
- List<LogDTO> listLogDTO = instance.searchLogDTOWithDateCreate(logDate);
- Assert.assertEquals(3,listLogDTO.size());*/
- }
-
-}
Deleted: trunk/lima-business/src/test/java/org/chorem/lima/business/UserServiceImplTest.java
===================================================================
--- trunk/lima-business/src/test/java/org/chorem/lima/business/UserServiceImplTest.java 2010-08-20 12:11:16 UTC (rev 3009)
+++ trunk/lima-business/src/test/java/org/chorem/lima/business/UserServiceImplTest.java 2010-08-20 23:46:18 UTC (rev 3010)
@@ -1,52 +0,0 @@
-package org.chorem.lima.business;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.chorem.lima.business.ejb.UserServiceImpl;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- * Tests pour la gestion des timespans
- * @author Rémi Chapelet
- */
-public class UserServiceImplTest {
-
- /** log. */
- private static final Log log = LogFactory.getLog(UserServiceImplTest.class);
-
- private UserServiceImpl instance;
-
- @BeforeClass
- public static void setUpClass() throws Exception {
- LimaConfigTest.getInstance();
- }
-
- @Before
- public void setUp() {
- instance = new UserServiceImpl();
- }
-
- @AfterClass
- public static void tearDownClass() throws Exception {
-
- }
-
- public UserServiceImplTest() {
- }
-
- /**
- * Permet de tester l'ajout d'un utilisateur dans la base de données
- */
- @Test
- public void addUserTest() {
- /*String result = instance.addUser("test-add-user");
- if (log.isDebugEnabled()) {
- log.debug("Ajout utilisateur (name is test-add-user) : result " + result);
- }
- Assert.assertEquals("success", instance.findUser("test-add-user"));*/
- }
-
-}
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-08-20 12:11:16 UTC (rev 3009)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/service/LimaServiceFactory.java 2010-08-20 23:46:18 UTC (rev 3010)
@@ -32,8 +32,6 @@
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.
@@ -44,7 +42,7 @@
private static Log log = LogFactory.getLog(LimaServiceFactory.class);
/** Single instance. */
- protected static LimaServiceFactory instance;
+ private static LimaServiceFactory instance;
protected HashMap<Class, Object> services = new HashMap<Class, Object>();
/** JNDI context used to look for EJB. */
@@ -108,215 +106,9 @@
}
return result;
}
-
-
- /**
- * Get Account service.
- *
- * @return account service proxy
- */
- /*public AccountServiceMonitorable getAccountService() {
- // TODO EC-20100410 put lookup name in configuration
- // name should be fully configurable due to custom implementation used
- String lookupName = "AccountServiceImplRemote";
- AccountService ejbHome = null;
- try {
- ejbHome = (AccountService)ctx.lookup(lookupName);
- } catch (NamingException eee) {
- if (log.isErrorEnabled()) {
- log.error("Can't lookup for service : " + lookupName, eee);
- }
- }
- InvocationHandler handler = new ServiceMonitorableHandler(ejbHome);
- AccountServiceMonitorable result = (AccountServiceMonitorable)Proxy.newProxyInstance(
- AccountServiceMonitorable.class.getClassLoader(),
- new Class[]{AccountServiceMonitorable.class}, handler);
- return result;
- }
-
- /**
- * Get FiscalPeriod service.
- *
- * @return fiscalPeriod service proxy
- *
- public FiscalPeriodService getFiscalPeriodService() {
- // TODO EC-20100410 put lookup name in configuration
- // name should be fully configurable due to custom implementation used
- String lookupName = "FiscalPeriodServiceImplRemote";
- FiscalPeriodService ejbHome = null;
- try {
- ejbHome = (FiscalPeriodService)ctx.lookup(lookupName);
- } catch (NamingException eee) {
- if (log.isErrorEnabled()) {
- log.error("Can't lookup for service : " + lookupName, eee);
- }
- }
- return ejbHome;
- }
-
/**
- * Get FinancialPeriod service.
- *
- * @return Financial Period service proxy
- *
- public FinancialPeriodService getFinancialPeriodService() {
-
- // TODO EC-20100410 put lookup name in configuration
- // name should be fully configurable due to custom implementation used
- String lookupName = "FinancialPeriodServiceImplRemote";
- FinancialPeriodService ejbHome = null;
- try {
- ejbHome = (FinancialPeriodService)ctx.lookup(lookupName);
- } catch (NamingException eee) {
- if (log.isErrorEnabled()) {
- log.error("Can't lookup for service : " + lookupName, eee);
- }
- }
- return ejbHome;
- }
-
- /**
- * Get transaction service.
- *
- * @return transaction service proxy
- *
- public FinancialTransactionService getTransactionService() {
-
- // TODO EC-20100410 put lookup name in configuration
- // name should be fully configurable due to custom implementation used
- String lookupName = "FinancialTransactionServiceImplRemote";
- FinancialTransactionService ejbHome = null;
- try {
- ejbHome = (FinancialTransactionService)ctx.lookup(lookupName);
- } catch (NamingException eee) {
- if (log.isErrorEnabled()) {
- log.error("Can't lookup for service : " + lookupName, eee);
- }
- }
- return ejbHome;
- }
-
- /**
- * Get entrybook service.
- *
- * @return entrybook service proxy
- *
- public EntryBookService getEntryBookService() {
-
- // TODO EC-20100410 put lookup name in configuration
- // name should be fully configurable due to custom implementation used
- String lookupName = "EntryBookServiceImplRemote";
- EntryBookService ejbHome = null;
- try {
- ejbHome = (EntryBookService)ctx.lookup(lookupName);
- } catch (NamingException eee) {
- if (log.isErrorEnabled()) {
- log.error("Can't lookup for service : " + lookupName, eee);
- }
- }
- return ejbHome;
- }
-
-
- /**
- * Get report service.
- *
- *
- public ReportService getReportService() {
-
- // TODO EC-20100410 put lookup name in configuration
- // name should be fully configurable due to custom implementation used
- String lookupName = "ReportServiceImplRemote";
- ReportService ejbHome = null;
- try {
- ejbHome = (ReportService)ctx.lookup(lookupName);
- } catch (NamingException eee) {
- if (log.isErrorEnabled()) {
- log.error("Can't lookup for service : " + lookupName, eee);
- }
- }
- return ejbHome;
- }
-
- /**
- * Get financial statement service.
- *
- *
- public FinancialStatementService getFinancialStatementService() {
-
- String lookupName = "FinancialStatementServiceImplRemote";
- FinancialStatementService ejbHome = null;
- try {
- ejbHome = (FinancialStatementService)ctx.lookup(lookupName);
- } catch (NamingException eee) {
- if (log.isErrorEnabled()) {
- log.error("Can't lookup for service : " + lookupName, eee);
- }
- }
- return ejbHome;
- }
-
- /**
- * Get import service.
- *
- *
- public ImportService getImportService() {
-
- String lookupName = "ImportServiceImplRemote";
- ImportService ejbHome = null;
- try {
- ejbHome = (ImportService)ctx.lookup(lookupName);
- } catch (NamingException eee) {
- if (log.isErrorEnabled()) {
- log.error("Can't lookup for service : " + lookupName, eee);
- }
- }
- return ejbHome;
- }
-
-
- /**
- * Get export service.
- *
- *
- public ExportService getExportService() {
-
- String lookupName = "ExportServiceImplRemote";
- ExportService ejbHome = null;
- try {
- ejbHome = (ExportService)ctx.lookup(lookupName);
- } catch (NamingException eee) {
- if (log.isErrorEnabled()) {
- log.error("Can't lookup for service : " + lookupName, eee);
- }
- }
- return ejbHome;
- }
-
- /**
- * Get record service.
- *
- * @return record service proxy
- *
- public RecordService getRecordService() {
-
- // TODO EC-20100410 put lookup name in configuration
- // name should be fully configurable due to custom implementation used
- String lookupName = "RecordServiceImplRemote";
- RecordService ejbHome = null;
- try {
- ejbHome = (RecordService)ctx.lookup(lookupName);
- } catch (NamingException eee) {
- if (log.isErrorEnabled()) {
- log.error("Can't lookup for service : " + lookupName, eee);
- }
- }
- return ejbHome;
- }*/
-
- /**
* Destroy openejb jndi context.
*
* Code taken from openEJB faq :
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartViewHandler.java 2010-08-20 12:11:16 UTC (rev 3009)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartViewHandler.java 2010-08-20 23:46:18 UTC (rev 3010)
@@ -88,8 +88,8 @@
// null == cancel action
newFinancialStatementHeader = financialStatementHeaderForm.getFinancialStatement();
- newFinancialStatementHeader.setHeader(true);
if (newFinancialStatementHeader != null) {
+ newFinancialStatementHeader.setHeader(true);
// get current selection path
TreePath treePath = null;
int selectedRow = treeTable.getSelectedRow();
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/util/ErrorHelper.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/util/ErrorHelper.java 2010-08-20 12:11:16 UTC (rev 3009)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/util/ErrorHelper.java 2010-08-20 23:46:18 UTC (rev 3010)
@@ -114,19 +114,20 @@
email.setSubject("Project error notification : Lima");
// message description
- String message = formatMessage("Project", "Lima " + LimaMain.config.getVersion());
- message += formatMessage("Date", new Date().toString());
- message += formatMessage("Title", errorInfo.getTitle());
- message += formatMessage("Description", errorInfo.getBasicErrorMessage().replaceAll("<[^>]+>", ""));
+ StringBuffer message = new StringBuffer();
+ message.append(formatMessage("Project", "Lima " + LimaMain.config.getVersion()));
+ message.append(formatMessage("Date", new Date().toString()));
+ message.append(formatMessage("Title", errorInfo.getTitle()));
+ message.append(formatMessage("Description", errorInfo.getBasicErrorMessage().replaceAll("<[^>]+>", "")));
// message configuration
- message += formatMessage("Configuration", null);
+ message.append(formatMessage("Configuration", null));
List<String> propertiesNames = new ArrayList<String>(LimaMain.config.getOptions().stringPropertyNames());
Collections.sort(propertiesNames);
for (String propertyName : propertiesNames) {
// security, don't send string containing password :
if (!propertyName.contains("pass")) {
- message += "\t" + propertyName + " : " + LimaMain.config.getOptions().getProperty(propertyName) + "\n";
+ message.append("\t" + propertyName + " : " + LimaMain.config.getOptions().getProperty(propertyName) + "\n");
}
}
@@ -134,10 +135,10 @@
StringWriter out = new StringWriter();
PrintWriter writer = new PrintWriter(out);
errorInfo.getErrorException().printStackTrace(writer);
- message += formatMessage("Exception", out.toString());
+ message.append(formatMessage("Exception", out.toString()));
// TODO EC-20100409 i18n files are iso encoded ?
- email.setContent(message, "text/plain; charset=ISO-8859-9");
+ email.setContent(message.toString(), "text/plain; charset=ISO-8859-9");
// send mail
email.send();
1
0
r3009 - trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction
by jpepin@users.chorem.org 20 Aug '10
by jpepin@users.chorem.org 20 Aug '10
20 Aug '10
Author: jpepin
Date: 2010-08-20 14:11:16 +0200 (Fri, 20 Aug 2010)
New Revision: 3009
Url: http://chorem.org/repositories/revision/lima/3009
Log:
D?\195?\169bogue ajout de ligne automatique.
Modified:
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTable.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTableModel.java
trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionViewHandler.java
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTable.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTable.java 2010-08-19 23:48:02 UTC (rev 3008)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTable.java 2010-08-20 12:11:16 UTC (rev 3009)
@@ -18,6 +18,8 @@
package org.chorem.lima.ui.financialtransaction;
+import static org.nuiton.i18n.I18n._;
+
import java.awt.Color;
import java.awt.Component;
import java.awt.event.FocusEvent;
@@ -28,11 +30,14 @@
import java.awt.event.MouseListener;
import java.math.BigDecimal;
import java.util.Date;
+import java.util.concurrent.ExecutionException;
+import javax.swing.SwingWorker;
import javax.swing.table.TableColumn;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.chorem.lima.business.LimaException;
import org.chorem.lima.entity.Account;
import org.chorem.lima.entity.Entry;
import org.chorem.lima.entity.EntryBook;
@@ -40,6 +45,7 @@
import org.chorem.lima.ui.celleditor.AccountTableCellEditor;
import org.chorem.lima.ui.celleditor.DateTableCellEditor;
import org.chorem.lima.ui.celleditor.EntryBookTableCellEditor;
+import org.chorem.lima.util.DialogHelper;
import org.jdesktop.swingx.JXTable;
import org.jdesktop.swingx.decorator.ColorHighlighter;
import org.jdesktop.swingx.decorator.ComponentAdapter;
@@ -66,6 +72,9 @@
private Highlighter colorTransaction;
private ColorHighlighter colorBalance;
+
+ private int x_tab;
+ private int y_tab;
public FinancialTransactionTable(FinancialTransactionViewHandler handler) {
@@ -148,7 +157,7 @@
//TODO combinaison de touches dans la config
- // delete selected row with the key : delete or ctrl clear
+ // delete selected row with the key : delete or ctrl + clear
// ou de l'entree
if ((e.getKeyCode() == KeyEvent.VK_DELETE )
|| (e.getKeyCode() == KeyEvent.VK_CLEAR
@@ -164,11 +173,27 @@
}
// add financial transaction with the key combination : ctrl + tab
+ if (e.getKeyCode() == KeyEvent.VK_C
+ && e.getModifiers() == KeyEvent.CTRL_MASK) {
+ handler.copyRow();
+ }
+
+ // copy : ctrl + c
+
+ // add financial transaction with the key combination : ctrl + tab
+ if (e.getKeyCode() == KeyEvent.VK_V
+ && e.getModifiers() == KeyEvent.CTRL_MASK) {
+ handler.pasteRow();
+ }
+
+ // paste : ctrl + v
+
+ // add financial transaction with the key combination : ctrl + tab
if (e.getKeyCode() == KeyEvent.VK_TAB
&& e.getModifiers() == KeyEvent.CTRL_MASK) {
handler.addFinancialTransaction();
}
-
+
/**
* Touche tab
* Incrémente le curseur de case tant que la case n'est pas editable
@@ -176,21 +201,24 @@
* la dernière cellule et si la transaction est non équilibré
* sinon rajoute une transaction
*/
+
if (e.getKeyChar() == KeyEvent.VK_TAB) {
int max_x = this.getColumnCount();
int max_y = this.getRowCount();
- int x_tab = this.getSelectedColumn();
- int y_tab = this.getSelectedRow();
+ x_tab = this.getSelectedColumn();
+ y_tab = this.getSelectedRow();
+ Boolean end = true;
- if (x_tab < max_x - 1){
+ if (x_tab < max_x - 1){
x_tab++;
}
+ //end of row
else {
+ x_tab=0;
y_tab++;
}
- //skip all cell while not editable
- while (!isCellEditable(y_tab, x_tab)){
-
+ //skip all cell while not editable or if end of table add entry or transaction or end of table
+ while (!isCellEditable(y_tab, x_tab) && end ){
//if end of row
if (x_tab == max_x-1) {
Object object = this.handler.tableModel.getElementAt(y_tab);
@@ -205,35 +233,60 @@
}
//if entry
else {
- Entry entry = (Entry) object;
- FinancialTransaction financialTransaction = entry.getFinancialTransaction();
- Boolean balanced =
- financialTransaction.getAmountCredit() ==
- financialTransaction.getAmountDebit();
- if (balanced){
- if (y_tab == max_y-1){
- handler.addFinancialTransaction();
- this.setColumnSelectionInterval(0, 0);
- }
- }
- else {
- handler.addEmptyEntry();
- this.setColumnSelectionInterval(1, 1);
- }
+ log.debug("not end");
+ //FIXME set value is doing after key pressed
+ // so update not terminated before get balanced
+ //Swing Worker stop the UI 500ms
+ // found best solution ?
+ final JXTable table = this;
+ final int y_t = y_tab;
+ final int m_t = max_y;
+ new SwingWorker<Void,Void>() {
+ @Override protected Void doInBackground() throws InterruptedException {
+ Thread.sleep(500);
+ return null;
+ }
+ @Override protected void done() {
+ Object object = handler.tableModel.getElementAt(y_tab-1);
+ FinancialTransaction financialTransaction = null;
+ if (object instanceof Entry){
+ financialTransaction = ((Entry) object).getFinancialTransaction();
+ }
+ else if (object instanceof FinancialTransaction){
+ financialTransaction = (FinancialTransaction) object;
+ }
+ BigDecimal amountC = financialTransaction.getAmountCredit();
+ BigDecimal amountD = financialTransaction.getAmountDebit();
+ if (amountC == amountD){
+ if (y_t == m_t-1){
+ handler.addFinancialTransaction();
+ table.setColumnSelectionInterval(0, 0);
+ }
+ }
+ else {
+ handler.addEmptyEntry();
+ table.setColumnSelectionInterval(1, 1);
+ y_tab++;
+ // positionne la sélection sur la nouvelle ligne créée
+ table.setRowSelectionInterval(y_tab, y_tab);
+ x_tab=0;
+ }
+ }
+ }.execute();
}
- y_tab++;
- // positionne la sélection sur la nouvelle ligne créée
- this.setRowSelectionInterval(y_tab, y_tab);
- x_tab=0;
+ end = false;
}
else {
if (x_tab < max_x){
+ this.setRowSelectionInterval(y_tab, y_tab);
this.setColumnSelectionInterval(x_tab, x_tab);
x_tab++;
}
}
}
}
+
+
}
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTableModel.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTableModel.java 2010-08-19 23:48:02 UTC (rev 3008)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTableModel.java 2010-08-20 12:11:16 UTC (rev 3009)
@@ -159,7 +159,7 @@
result = String.class;
break;
case 5:
- result = BigDecimal.class;
+ result = String.class;
break;
case 6:
result = BigDecimal.class;
@@ -168,7 +168,7 @@
result = BigDecimal.class;
break;
case 8:
- result = String.class;
+ result = BigDecimal.class;
break;
}
@@ -198,16 +198,16 @@
result = _("lima.table.description");
break;
case 5:
- result = _("lima.table.debit");
+ result = _("lima.table.letter");
break;
case 6:
- result = _("lima.table.credit");
+ result = _("lima.table.debit");
break;
case 7:
- result = _("lima.table.balance");
+ result = _("lima.table.credit");
break;
case 8:
- result = _("lima.table.letter");
+ result = _("lima.table.balance");
break;
}
@@ -260,16 +260,16 @@
result = null; // description
break;
case 5 :
- result = amountDebit;
+ result = null; // letter
break;
case 6:
- result = amountCredit;
+ result = amountDebit;
break;
case 7:
- result = amountDebit.subtract(amountCredit);
+ result = amountCredit;
break;
case 8:
- result = null;
+ result = amountDebit.subtract(amountCredit);
break;
}
}
@@ -297,16 +297,16 @@
result = currentEntry.getDescription();
break;
case 5 :
- result = currentEntry.getDebit() ? currentEntry.getAmount() : 0;
+ result = currentEntry.getLettering();
break;
case 6:
- result = currentEntry.getDebit() ? 0 : currentEntry.getAmount();
+ result = currentEntry.getDebit() ? currentEntry.getAmount() : 0;
break;
case 7:
- result = null;
+ result = currentEntry.getDebit() ? 0 : currentEntry.getAmount();
break;
case 8:
- result = currentEntry.getLettering();
+ result = null;
break;
}
@@ -329,11 +329,11 @@
boolean editableCell=false;
Object currentRow = cacheDataList.get(rowIndex);
// cells editable for the entry row, all cells exclude the date
- if ((currentRow instanceof Entry) && !((columnIndex==0) || (columnIndex==1))) {
+ if ((currentRow instanceof Entry) && !((columnIndex==0) || (columnIndex==1) || (columnIndex==8))) {
editableCell=true;
}
// cells editable for the financialtransaction row, no cells exclude the date
- if ((currentRow instanceof FinancialTransaction) && ((columnIndex==0) || (columnIndex==1) || (columnIndex==8))){
+ if ((currentRow instanceof FinancialTransaction) && ((columnIndex==0) || (columnIndex==1))){
editableCell=true;
}
return editableCell;
@@ -494,16 +494,16 @@
currentEntry.setDescription((String)value);
break;
case 5 :
+ currentEntry.setLettering((String)value);
+ break;
+ case 6:
currentEntry.setAmount((BigDecimal)value);
currentEntry.setDebit(true);
break;
- case 6:
+ case 7:
currentEntry.setAmount((BigDecimal)value);
currentEntry.setDebit(false);
break;
- case 8:
- currentEntry.setLettering((String)value);
- break;
}
try {
financialTransactionService.updateEntry(currentEntry);
Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionViewHandler.java
===================================================================
--- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionViewHandler.java 2010-08-19 23:48:02 UTC (rev 3008)
+++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionViewHandler.java 2010-08-20 12:11:16 UTC (rev 3009)
@@ -67,6 +67,7 @@
//copy entry
public void copyRow(){
+ table = view.getFinancialTransactionTable();
int indexSelectedRow = table.getSelectedRow();
if (indexSelectedRow != -1) {
@@ -76,6 +77,7 @@
//paste entry
public void pasteRow(){
+ table = view.getFinancialTransactionTable();
int indexSelectedRow = table.getSelectedRow();
if (indexSelectedRow != -1) {
1
0